From 09a8151abe3934ccf17fa84d5b2000e259351312 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 16 Aug 2012 16:06:57 +0200
Subject: Fix FFMPEGMediaPlayer: Use GL_ALPHA (texture format intern/data)
 instead of GL_RGBA/GL_ALPHA ; Load dedicated native libav/libffmpeg

- ES2 spec does not allow GL_RGBA/GL_ALPHA.

- Load dedicated native libs (libav/libffmpeg) since distributions don't create
  symlink e.g. libavutil.so -> libavutil.so.53
---
 .../classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java    | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index d3d45e692..27c926704 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -62,6 +62,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected int textureCount;
     protected int textureTarget;
     protected int textureFormat;
+    protected int textureInternalFormat; 
     protected int textureType;
     protected int texUnit;
     
@@ -104,6 +105,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         this.textureCount=3;
         this.textureTarget=GL.GL_TEXTURE_2D;
         this.textureFormat = GL.GL_RGBA;
+        this.textureInternalFormat = GL.GL_RGBA;
         this.textureType = GL.GL_UNSIGNED_BYTE;        
         this.texUnit = 0;
         this.state = State.Uninitialized;
@@ -122,7 +124,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final int getTextureCount() { return textureCount; }
     
     protected final void setTextureTarget(int target) { textureTarget=target; }
-    protected final void setTextureFormat(int f) { textureFormat=f; }    
+    protected final void setTextureFormat(int internalFormat, int format) { 
+        textureInternalFormat=internalFormat; 
+        textureFormat=format; 
+    }    
     protected final void setTextureType(int t) { textureType=t; }
 
     public final void setTextureMinMagFilter(int[] minMagFilter) { texMinMagFilter[0] = minMagFilter[0]; texMinMagFilter[1] = minMagFilter[1];}
@@ -361,9 +366,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             gl.glTexImage2D(
                     textureTarget,    // target
                     0,                // level
-                    GL.GL_RGBA,       // internal format
-                    tWidth,            // width
-                    tHeight,           // height
+                    textureInternalFormat, // internal format
+                    tWidth,           // width
+                    tHeight,          // height
                     0,                // border
                     textureFormat,
                     textureType,
-- 
cgit v1.2.3


From da7210c6498b6fcc2fbf829684ea399a6b4c3f65 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Fri, 19 Jul 2013 05:08:34 +0200
Subject: FFMPEGPlayer Audio Sink Refactoring ..

- AudioSink w/ AudioFrame and formats public

- ALAudioSink uses a circular buffer now, hence relaxes the one-threaded player mode

- FFMPEGMediaPlayer uses multiple audio frames (equal to the ALAudioSink number)
  and wraps data to NIO buffer w/o copy.

- FFMPEGMediaPlayer audio threading currently disabled: distorted sound
  Seems that the ALAudioSink's circular buffer usage is good enough for now.

- Verbosity only w/ DEBUG flag

- New SyncedRingbuffer for effcient synced buffering
---
 make/scripts/tests.sh                              |  15 +-
 .../com/jogamp/opengl/util/av/AudioSink.java       | 168 +++++++
 .../jogamp/opengl/util/av/AudioSinkFactory.java    |  65 +++
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |   8 +
 .../opengl/util/av/GLMediaPlayerFactory.java       |  26 +-
 .../android/av/AndroidGLMediaPlayerAPI14.java      |  10 +-
 .../jogamp/opengl/openal/av/ALAudioSink.java       | 484 ++++++++++++++++-----
 .../classes/jogamp/opengl/util/av/AudioSink.java   |  13 -
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   |   4 +-
 .../jogamp/opengl/util/av/JavaSoundAudioSink.java  | 120 +++--
 .../jogamp/opengl/util/av/NullAudioSink.java       |  41 +-
 .../jogamp/opengl/util/av/SyncedRingbuffer.java    | 286 ++++++++++++
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     | 245 ++++++-----
 src/jogl/native/libav/ffmpeg_tool.h                |   4 +-
 .../jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c |  87 ++--
 .../test/junit/jogl/demos/es2/av/MovieCube.java    |   2 +-
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  |   2 +-
 17 files changed, 1222 insertions(+), 358 deletions(-)
 create mode 100644 src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
 create mode 100644 src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
 delete mode 100644 src/jogl/classes/jogamp/opengl/util/av/AudioSink.java
 create mode 100644 src/jogl/classes/jogamp/opengl/util/av/SyncedRingbuffer.java

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 0ad9d8a83..4a326a3f7 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -88,7 +88,7 @@ function jrun() {
     #D_ARGS="-Djogl.debug.FBObject -Djogl.debug.TraceGL -Djogl.debug.GLBufferStateTracker"
     #D_ARGS="-Djogl.debug.FBObject"
     #D_ARGS="-Djogl.debug.GLSLCode"
-    D_ARGS="-Djogl.debug.GLSLCode -Djogl.debug.DebugGL"
+    #D_ARGS="-Djogl.debug.GLSLCode -Djogl.debug.DebugGL"
     #D_ARGS="-Djogl.debug=all -Dnewt.debug=all"
     #D_ARGS="-Djogl.debug.GLContext -Dnativewindow.debug.JAWT -Dnewt.debug.Window"
     #D_ARGS="-Dnativewindow.debug.JAWT -Djogamp.debug.TaskBase.TraceSource"
@@ -131,6 +131,7 @@ function jrun() {
     #D_ARGS="-Djogl.1thread=true -Djogl.debug.Threading"
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
+    D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.GLArrayData"
     #D_ARGS="-Djogl.debug.GLDrawable"
     #D_ARGS="-Djogl.debug.EGLDisplayUtil -Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.GLDrawable"
@@ -313,7 +314,7 @@ function testawtswt() {
 # 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 $*
 
 #
@@ -616,15 +617,5 @@ function testawtswt() {
 
 # NEW
 
-#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT $*
-
-testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestFBOMRTNEWT01 $*
-#testnoawt com.jogamp.opengl.test.junit.graph.TestRegionRendererNEWT01 $*
-
-#testnoawt com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen01GLPBufferNEWT $*
-#testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove01GLCanvasSwingAWT $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleES1NEWT $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleES2NEWT $*
-
 $spath/count-edt-start.sh java-run.log
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
new file mode 100644
index 000000000..5caeb969a
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
@@ -0,0 +1,168 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.av;
+
+import java.nio.ByteBuffer;
+
+import jogamp.opengl.Debug;
+
+public interface AudioSink {
+    public static final boolean DEBUG = Debug.debug("AudioSink");
+    
+    /** Specifies the audio data type. Currently only PCM is supported. */
+    public static enum AudioDataType { PCM };
+    
+    /**
+     * Specifies the audio data format.
+     */
+    public static class AudioDataFormat {
+        public AudioDataFormat(AudioDataType dataType, int sampleRate, int sampleSize, int channelCount, boolean signed, boolean littleEndian) {
+            this.dataType = dataType;
+            this.sampleRate = sampleRate;
+            this.sampleSize = sampleSize;
+            this.channelCount = channelCount;
+            this.signed = signed;
+            this.littleEndian = littleEndian;
+        }
+        /** Audio data type. */
+        public final AudioDataType dataType;
+        /** Sample rate in Hz (1/s). */
+        public final int sampleRate;
+        /** Sample size in bits. */
+        public final int sampleSize;
+        /** Number of channels. */
+        public final int channelCount;
+        public final boolean signed;
+        public final boolean littleEndian;
+        
+        public String toString() { 
+            return "AudioDataFormat[type "+dataType+", sampleRate "+sampleRate+", sampleSize "+sampleSize+", channelCount "+channelCount+
+                   ", signed "+signed+", "+(littleEndian?"little":"big")+"endian]"; }
+    }
+    /** Default {@link AudioDataFormat}, [type PCM, sampleRate 44100, sampleSize 16, channelCount 2, signed, littleEndian]. */    
+    public static final AudioDataFormat DefaultFormat = new AudioDataFormat(AudioDataType.PCM, 44100, 16, 2, true /* signed */, true /* littleEndian */);
+    
+    public static class AudioFrame {
+        public final ByteBuffer data;
+        public final int dataSize;
+        public final int audioPTS;
+        
+        public AudioFrame(ByteBuffer data, int dataSize, int audioPTS) {
+            if( dataSize > data.remaining() ) {
+                throw new IllegalArgumentException("Give size "+dataSize+" exceeds remaining bytes in ls "+data+". "+this);
+            }
+            this.data=data;
+            this.dataSize=dataSize;
+            this.audioPTS=audioPTS;
+        }
+        
+        public String toString() { return "AudioFrame[apts "+audioPTS+", data "+data+", payloadSize "+dataSize+"]"; }
+    }
+    
+    /** 
+     * Returns the <code>initialized state</code> of this instance.
+     * <p>
+     * The <code>initialized state</code> is affected by this instance
+     * overall availability, i.e. after instantiation,
+     * as well as by {@link #destroy()}.
+     * </p> 
+     */
+    public boolean isInitialized();
+
+    /** 
+     * Returns the preferred {@link AudioDataFormat} by this sink.
+     * <p>
+     * The preferred format shall reflect this sinks most native format,
+     * i.e. best performance w/o data conversion. 
+     * </p>
+     * @see #initSink(AudioDataFormat) 
+     */
+    public AudioDataFormat getPreferredFormat();
+    
+    /**
+     * Initializes the sink.
+     * <p>
+     * Implementation shall try to match the given <code>requestedFormat</code> {@link AudioDataFormat}
+     * as close as possible, regarding it's capabilities.
+     * </p>
+     * <p>
+     * A user may consider {@link #getPreferredFormat()} and pass this value
+     * to utilize best performance and <i>behavior</i>. 
+     * </p>
+     * The {@link #DefaultFormat} <i>should be</i> supported by all implementations.
+     * </p>
+     * @param requestedFormat the requested {@link AudioDataFormat}. 
+     * @param bufferCount number of buffers for sink
+     * @return if successful the chosen AudioDataFormat based on the <code>requestedFormat</code> and this sinks capabilities, otherwise <code>null</code>. 
+     */
+    public AudioDataFormat initSink(AudioDataFormat requestedFormat, int bufferCount);
+
+    
+    /** Destroys this instance, i.e. closes all streams and devices allocated. */
+    public void destroy();
+    
+    /** 
+     * Returns the number of bytes queued for playing.
+     * <p>
+     * {@link #initSink(AudioDataFormat)} must be called first.
+     * </p>
+     */
+    public int getQueuedByteCount();
+
+    /** 
+     * Returns the queued buffer time in milliseconds for playing.
+     * <p>
+     * {@link #initSink(AudioDataFormat)} must be called first.
+     * </p>
+     */
+    public int getQueuedTime();
+    
+    /** 
+     * Returns the number of buffers in the sink available for writing.
+     * <p>
+     * {@link #initSink(AudioDataFormat)} must be called first.
+     * </p>
+     */
+    public int getWritableBufferCount();
+    
+    /** 
+     * Returns true if data is available to be written in the sink.
+     * <p>
+     * {@link #initSink(AudioDataFormat)} must be called first.
+     * </p>
+     */
+    public boolean isDataAvailable(int data_size);
+
+    /** 
+     * Writes the remaining bytes of the given direct ByteBuffer to this sink.
+     * <p>
+     * The data must comply with the chosen {@link AudioDataFormat} as returned by {@link #initSink(AudioDataFormat)}.
+     * </p>
+     */
+    public void writeData(AudioFrame audioFrame);
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
new file mode 100644
index 000000000..40321fb6f
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
@@ -0,0 +1,65 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.av;
+
+import jogamp.opengl.util.av.NullAudioSink;
+
+import com.jogamp.common.util.ReflectionUtil;
+
+public class AudioSinkFactory {
+    private static final String ALAudioSinkClazzName = "jogamp.opengl.openal.av.ALAudioSink";
+    private static final String JavaAudioSinkClazzName = "jogamp.opengl.util.av.JavaSoundAudioSink";
+
+    public static AudioSink createDefault() {
+        final ClassLoader cl = GLMediaPlayerFactory.class.getClassLoader();
+        AudioSink sink = create(cl, ALAudioSinkClazzName);
+        if( null == sink ) {
+            sink = create(cl, JavaAudioSinkClazzName);
+        }
+        if( null == sink ) {
+            sink = new NullAudioSink();
+        }
+        return sink;
+    }
+
+    public static AudioSink create(final ClassLoader cl, String implName) {
+        final AudioSink audioSink;
+        if(ReflectionUtil.isClassAvailable(implName, cl)){
+            try {
+                audioSink = (AudioSink) ReflectionUtil.createInstance(implName, cl);
+                if( audioSink.isInitialized() ) {
+                    return audioSink;
+                }
+            } catch (Throwable t) { 
+                if(AudioSink.DEBUG) { System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); }
+            }
+        }
+        return null;
+    }
+
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 3eca01986..1825dbd47 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -57,6 +57,14 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  * </ul>
  * </p>
  * <p>
+ * Implementations of this interface must implement:
+ * <pre>
+ *    public static final boolean isAvailable();
+ * </pre>
+ * to be properly considered by {@link GLMediaPlayerFactory#create(ClassLoader, String)}
+ * and {@link GLMediaPlayerFactory#createDefault()}.
+ * </p>
+ * <p>
  * Variable type, value range and dimension has been chosen to suit embedded CPUs
  * and characteristics of audio and video streaming.
  * Milliseconds of type integer with a maximum value of {@link Integer#MAX_VALUE} 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
index 6fcf20ed2..f09531f7f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
@@ -38,18 +38,24 @@ public class GLMediaPlayerFactory {
     private static final String FFMPEGMediaPlayerClazzName = "jogamp.opengl.util.av.impl.FFMPEGMediaPlayer";
     private static final String isAvailableMethodName = "isAvailable";
     
-    public static GLMediaPlayer create() {
+    public static GLMediaPlayer createDefault() {
         final ClassLoader cl = GLMediaPlayerFactory.class.getClassLoader();
-        if(Platform.OS_TYPE.equals(Platform.OSType.ANDROID)) {
-            if(AndroidVersion.SDK_INT >= 14) {
-                if(((Boolean)ReflectionUtil.callStaticMethod(AndroidGLMediaPlayerAPI14ClazzName, isAvailableMethodName, null, null, cl)).booleanValue()) {
-                    return (GLMediaPlayer) ReflectionUtil.createInstance(AndroidGLMediaPlayerAPI14ClazzName, cl);
-                }
-            }
+        GLMediaPlayer sink = create(cl, AndroidGLMediaPlayerAPI14ClazzName);
+        if( null == sink ) {
+            sink = create(cl, FFMPEGMediaPlayerClazzName);
         }
-        if(((Boolean)ReflectionUtil.callStaticMethod(FFMPEGMediaPlayerClazzName, isAvailableMethodName, null, null, cl)).booleanValue()) {
-            return (GLMediaPlayer) ReflectionUtil.createInstance(FFMPEGMediaPlayerClazzName, cl);
+        if( null == sink ) {
+            sink = new NullGLMediaPlayer();
         }
-        return new NullGLMediaPlayer();
+        return sink;
+    }
+    
+    public static GLMediaPlayer create(final ClassLoader cl, String implName) {
+        try {
+            if(((Boolean)ReflectionUtil.callStaticMethod(implName, isAvailableMethodName, null, null, cl)).booleanValue()) {
+                return (GLMediaPlayer) ReflectionUtil.createInstance(implName, cl);
+            }
+        } catch (Throwable t) { if(GLMediaPlayer.DEBUG) { System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); } }
+        return null;
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 23f9161d4..8356a2bae 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -32,6 +32,8 @@ import java.io.IOException;
 import javax.media.opengl.GL;
 import javax.media.opengl.GLES2;
 
+import com.jogamp.common.os.AndroidVersion;
+import com.jogamp.common.os.Platform;
 import com.jogamp.opengl.util.texture.TextureSequence;
 
 import jogamp.common.os.android.StaticContext;
@@ -60,7 +62,13 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     static final boolean available;
     
     static {
-        available = true; // default .. TODO: May restrict availability ? 
+        boolean _avail = false;
+        if(Platform.OS_TYPE.equals(Platform.OSType.ANDROID)) {
+            if(AndroidVersion.SDK_INT >= 14) {
+                _avail = true;
+            }
+        }
+        available = _avail;
     }
     
     public static final boolean isAvailable() { return available; }
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
index 690948c5a..87c7b937a 100644
--- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
@@ -1,176 +1,428 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
 package jogamp.opengl.openal.av;
 
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
 
-import java.lang.InterruptedException;
+import jogamp.opengl.util.av.SyncedRingbuffer;
 
-import jogamp.opengl.util.av.AudioSink;
-
-import com.jogamp.common.nio.Buffers;
-import com.jogamp.openal.*;
+import com.jogamp.openal.AL;
+import com.jogamp.openal.ALC;
+import com.jogamp.openal.ALCcontext;
+import com.jogamp.openal.ALCdevice;
+import com.jogamp.openal.ALFactory;
+import com.jogamp.opengl.util.av.AudioSink;
 
+/***
+ * OpenAL Audio Sink
+ */
 public class ALAudioSink implements AudioSink {
 
-    static ALC alc;
-    static AL al;
-    static ALCdevice device;
-    static ALCcontext context;
-
-    // AudioFormat parameters
-    public  static final int     SAMPLE_RATE = 44100;
-
-    // Chunk of audio processed at one time
-    public static final int BUFFER_SIZE = 1000;
+    /** Chunk of audio processed at one time. FIXME: Parameterize .. */
+    public static final int BUFFER_SIZE = 4096;
     public static final int SAMPLES_PER_BUFFER = BUFFER_SIZE / 2;
     
-    // Sample time values
-    public static final double SAMPLE_TIME_IN_SECS = 1.0 / SAMPLE_RATE;
-    public static final double BUFFER_TIME_IN_SECS = SAMPLE_TIME_IN_SECS * SAMPLES_PER_BUFFER;
+    private static final ALC alc;
+    private static final AL al;
+    private static final boolean staticAvailable;    
     
-    private static int NUM_BUFFERS = 5;
-    private static int bufferNumber = 0;
-    private static int[] buffers = new int[NUM_BUFFERS];
-    private static int[] source = new int[1];
-    private static boolean initBuffer = true;
-    private static int frequency = 44100;
-    private static int format = AL.AL_FORMAT_STEREO16;
+    private String deviceSpecifier;
+    private ALCdevice device;
+    private ALCcontext context;
+
+    /** Sample period in seconds */
+    public float samplePeriod;
+    /** Buffer period in seconds */
+    public float bufferPeriod;
     
-    private static boolean available = false;
+    static class ActiveBuffer {
+        ActiveBuffer(Integer name, int size) {
+            this.name = name;
+            this.size = size;
+        }
+        public final Integer name;
+        public final int size;
+        public String toString() { return "ABuffer[name "+name+", size "+size+"]"; }
+    }
     
+    int[] alBuffers = null;
+    private SyncedRingbuffer<Integer> alBufferAvail = null;
+    private SyncedRingbuffer<ActiveBuffer> alBufferPlaying = null;
+    private int alBufferBytesQueued = 0;
+
+    private int[] alSource = null;
+    private AudioDataFormat chosenFormat;
+    private int alFormat;    
+    private boolean initialized;
+
     static {
-        
-        boolean joalFound = false;
+        ALC _alc = null;
+        AL _al = null;
         try {
-            Class.forName("com.jogamp.openal.ALFactory");
-            joalFound = true;
-        } catch(ClassNotFoundException e){
-            // Joal not found on classpath
-        }            
-            
-        if(joalFound) {
+            _alc = ALFactory.getALC();            
+            _al = ALFactory.getAL();
+        } catch(Throwable t) {
+            if( DEBUG ) {
+                System.err.println("ALAudioSink: Catched "+t.getClass().getName()+": "+t.getMessage());
+                t.printStackTrace();
+            }
+        }
+        alc = _alc;
+        al = _al;
+        staticAvailable = null != alc && null != al;
+    }
+    
+    public ALAudioSink() {
+        initialized = false;
+        chosenFormat = null;
         
-            alc = ALFactory.getALC();            
-            String deviceSpecifier;
-
+        if( !staticAvailable ) {
+            return;
+        }
+        
+        try {
             // Get handle to default device.
             device = alc.alcOpenDevice(null);
             if (device == null) {
-                throw new ALException("Error opening default OpenAL device");
+                throw new RuntimeException("ALAudioSink: Error opening default OpenAL device");
             }
         
             // Get the device specifier.
             deviceSpecifier = alc.alcGetString(device, ALC.ALC_DEVICE_SPECIFIER);
             if (deviceSpecifier == null) {
-                throw new ALException("Error getting specifier for default OpenAL device");
+                throw new RuntimeException("ALAudioSink: Error getting specifier for default OpenAL device");
             }
                 
             // Create audio context.
             context = alc.alcCreateContext(device, null);
             if (context == null) {
-                throw new ALException("Error creating OpenAL context");
+                throw new RuntimeException("ALAudioSink: Error creating OpenAL context");
             }
         
             // Set active context.
             alc.alcMakeContextCurrent(context);
         
             // Check for an error.
-            if (alc.alcGetError(device) != ALC.ALC_NO_ERROR) {
-                throw new ALException("Error making OpenAL context current");
+            if ( alc.alcGetError(device) != ALC.ALC_NO_ERROR ) {
+                throw new RuntimeException("ALAudioSink: Error making OpenAL context current");
             }
             
-            al = ALFactory.getAL();
-            
-            // Allocate buffers
-            al.alGenBuffers(NUM_BUFFERS, buffers, 0);                       
-            al.alGenSources(1, source, 0);
+            // Create source
+            {
+                alSource = new int[1];
+                al.alGenSources(1, alSource, 0);
+                final int err = al.alGetError();
+                if( err != AL.AL_NO_ERROR ) {
+                    alSource = null;
+                    throw new RuntimeException("ALAudioSink: Error generating Source: 0x"+Integer.toHexString(err));
+                }       
+            }
             
-            if(al.alGetError() != AL.AL_NO_ERROR) {
-                throw new ALException("Error generating :(");                 
-            }            
-        
-            System.out.println("OpenAL audio sink using device: " + deviceSpecifier);        
-            available = true;
+            if( DEBUG ) {                
+                System.err.println("ALAudioSink: Using device: " + deviceSpecifier);
+            }
+            initialized = true;
+            return;
+        } catch ( Exception e ) {
+            if( DEBUG ) {
+                System.err.println(e.getMessage());
+            }
+            destroy();
         }
     }
     
     @Override
-    public boolean isDataAvailable(int data_size) {               
-        return true;
+    public String toString() {
+        final int alSrcName = null != alSource ? alSource[0] : 0;
+        final int alBuffersLen = null != alBuffers ? alBuffers.length : 0;
+        return "ALAudioSink[init "+initialized+", device "+deviceSpecifier+", ctx "+context+", alSource "+alSrcName+
+               ", chosen "+chosenFormat+", alFormat "+toHexString(alFormat)+
+               ", buffers[total "+alBuffersLen+", avail "+alBufferAvail.size()+", "+alBufferPlaying.getFreeSlots()+
+               ", queued[bufferCount "+alBufferPlaying.size()+", "+getQueuedTime() + " ms, " + alBufferBytesQueued+" bytes]";
     }
     
     @Override
-    public void writeData(byte[] sampleData, int data_size) {
-        // OpenAL consumes buffers in the background
-        // we first need to initialize the OpenAL buffers then
-        // start continous playback.
-        alc.alcMakeContextCurrent(context);
-        if(initBuffer) {
-
-            ByteBuffer data = Buffers.newDirectByteBuffer(sampleData);
-            al.alBufferData(buffers[bufferNumber], format, data, data_size, frequency);
-            int error = al.alGetError();
-            if(error != AL.AL_NO_ERROR) {
-                System.out.println("bufferNumber"+bufferNumber+" Data "+sampleData+" size"+data_size);
-                throw new ALException("Error loading :( error code: " + error);                
+    public AudioDataFormat getPreferredFormat() {
+        return DefaultFormat;
+    }
+    
+    @Override
+    public AudioDataFormat initSink(AudioDataFormat requestedFormat, int bufferCount) {
+        if( !staticAvailable ) {
+            return null;
+        }
+        samplePeriod = 1.0f / requestedFormat.sampleRate;
+        bufferPeriod = samplePeriod * SAMPLES_PER_BUFFER;
+        switch( requestedFormat.channelCount ) {
+            case 1: { 
+                switch ( requestedFormat.sampleSize ) {
+                    case 8: 
+                        alFormat = AL.AL_FORMAT_MONO8; break;
+                    case 16:
+                        alFormat = AL.AL_FORMAT_MONO16; break;
+                    default:
+                        return null;
+                }
+            } break;
+            case 2: 
+                switch ( requestedFormat.sampleSize ) {
+                    case 8: 
+                        alFormat = AL.AL_FORMAT_STEREO8; break;
+                    case 16:
+                        alFormat = AL.AL_FORMAT_STEREO16; break;
+                    default:
+                        return null;
+                }
+        }
+        // Allocate buffers
+        destroyBuffers();
+        {
+            alBuffers = new int[bufferCount];
+            al.alGenBuffers(bufferCount, alBuffers, 0);
+            final int err = al.alGetError();
+            if( err != AL.AL_NO_ERROR ) {
+                alBuffers = null;
+                throw new RuntimeException("ALAudioSink: Error generating Buffers: 0x"+Integer.toHexString(err));
             }
-
-            if(bufferNumber==NUM_BUFFERS-1){
-                // all buffers queued
-                al.alSourceQueueBuffers(source[0], NUM_BUFFERS, buffers, 0);
-                // start playback
-                al.alSourcePlay(source[0]);
-                if(al.alGetError() != AL.AL_NO_ERROR) {
-                    throw new ALException("Error starting :(");                 
+            final Integer[] alBufferRingArray = new Integer[bufferCount];
+            for(int i=0; i<bufferCount; i++) {
+                alBufferRingArray[i] = Integer.valueOf(alBuffers[i]);
+            }
+            alBufferAvail = new SyncedRingbuffer<Integer>(alBufferRingArray, true /* full */);
+            alBufferPlaying = new SyncedRingbuffer<ActiveBuffer>(new ActiveBuffer[bufferCount], false /* full */);
+        }
+        
+        
+        chosenFormat = requestedFormat;
+        return chosenFormat;
+    }
+    
+    private void destroyBuffers() {
+        if( !staticAvailable ) {
+            return;
+        }
+        if( null != alBuffers ) {
+            try {
+                al.alDeleteBuffers(alBufferAvail.capacity(), alBuffers, 0);
+            } catch (Throwable t) {
+                if( DEBUG ) {
+                    System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+                    t.printStackTrace();
                 }
-                initBuffer=false;
             }
-
-            // update buffer number to fill
-            bufferNumber=(bufferNumber+1)%NUM_BUFFERS;
-        } else {
-            // OpenAL is playing in the background.
-            // one new frame with audio data is ready
-
-            // first wait for openal to release one buffer
-            int[] buffer=new int[1];
-            int[] val=new int[1];
-            do {
-                al.alGetSourcei(source[0], AL.AL_BUFFERS_PROCESSED, val, 0);
-                if(val[0] <= 0){
-                    try {
-                        Thread.sleep(1);
-                    } catch (InterruptedException e){
-                    }
+            alBufferAvail.clear(true);
+            alBufferAvail = null;
+            alBufferPlaying.clear(true);
+            alBufferPlaying = null;
+            alBufferBytesQueued = 0;
+            alBuffers = null;
+        }
+    }
+    
+    @Override
+    public void destroy() {
+        initialized = false;
+        if( !staticAvailable ) {
+            return;
+        }
+        if( null != alSource ) {
+            try {
+                al.alDeleteSources(1, alSource, 0);
+            } catch (Throwable t) {
+                if( DEBUG ) {
+                    System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+                    t.printStackTrace();
                 }
-            } while (val[0] <= 0);
-
-            // fill and requeue the empty buffer
-            al.alSourceUnqueueBuffers(source[0], 1, buffer , 0);
-            Buffer data = Buffers.newDirectByteBuffer(sampleData);
-            al.alBufferData(buffer[0], format, data, data_size, frequency);
-            al.alSourceQueueBuffers(source[0], 1, buffer, 0);
-            if(al.alGetError() != AL.AL_NO_ERROR) {
-                throw new ALException("Error buffering :(");                 
             }
+            alSource = null;
+        }
+        
+        destroyBuffers();
 
-            // Restart openal playback if needed
-            al.alGetSourcei(source[0], AL.AL_SOURCE_STATE, val, 0);
-            if(val[0] != al.AL_PLAYING) {
-                al.alSourcePlay(source[0]);
+        if( null != context ) {
+            try {
+                alc.alcDestroyContext(context);
+            } catch (Throwable t) {
+                if( DEBUG ) {
+                    System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+                    t.printStackTrace();
+                }
+            }
+            context = null;            
+        }
+        if( null != device ) {
+            try {
+                alc.alcCloseDevice(device);
+            } catch (Throwable t) {
+                if( DEBUG ) {
+                    System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+                    t.printStackTrace();
+                }
             }
+            device = null;            
         }
+        chosenFormat = null;
+    }
+    
+    @Override
+    public boolean isInitialized() {
+        return initialized;
     }
+    
+    private final void dequeueBuffer(boolean wait) {
+        int alErr = AL.AL_NO_ERROR;
+        final int[] val=new int[1];
+        do {
+            al.alGetSourcei(alSource[0], AL.AL_BUFFERS_PROCESSED, val, 0);
+            alErr = al.alGetError();
+            if( AL.AL_NO_ERROR != alErr ) {
+                throw new RuntimeException("ALError "+toHexString(alErr)+" while quering processed buffers at source. "+this);                 
+            }
+            if( wait && val[0] <= 0 ) {
+                try {
+                    Thread.sleep(1);
+                } catch (InterruptedException e){
+                }
+            }
+        } while (val[0] <= 0);
+        final int processedBuffers = val[0];
 
+        if( processedBuffers > 0 ) {
+            int[] buffers=new int[processedBuffers];
+            al.alSourceUnqueueBuffers(alSource[0], processedBuffers, buffers, 0);
+            alErr = al.alGetError();
+            if( AL.AL_NO_ERROR != alErr ) {
+                throw new RuntimeException("ALError "+toHexString(alErr)+" while dequeueing "+processedBuffers+" processed buffers. "+this);                 
+            }
+            for ( int i=0; i<processedBuffers; i++ ) {
+                final ActiveBuffer releasedBuffer = alBufferPlaying.get(true /* clearRef */);
+                if( null == releasedBuffer ) {
+                    throw new InternalError("Internal Error: "+this);
+                }
+                if( releasedBuffer.name.intValue() != buffers[i] ) {                    
+                    throw new InternalError("Buffer name mismatch: dequeued: "+buffers[i]+", released "+releasedBuffer);
+                    // System.err.println("XXX ["+i+"]: dequeued: "+buffers[i]+", released "+releasedBuffer);
+                }
+                alBufferBytesQueued -= releasedBuffer.size;
+                if( !alBufferAvail.put(releasedBuffer.name) ) {
+                    throw new InternalError("Internal Error: "+this);
+                }
+                if( DEBUG ) {
+                    System.err.println("ALAudioSink: Dequeued "+processedBuffers+", wait "+wait+", "+this);
+                }                
+            }
+        }
+    }
+    
+    private static final String toHexString(int v) {
+        return "0x"+Integer.toHexString(v);
+    }
+        
     @Override
-    public int getDataAvailable() {
-        int[] val=new int[1];       
-        al.alGetSourcei(source[0], AL.AL_BUFFERS_PROCESSED, val, 0);
-        return (NUM_BUFFERS-val[0])*4096;
+    public void writeData(AudioFrame audioFrame) {
+        if( !initialized || null == chosenFormat ) {
+            return;
+        }
+        int alErr = AL.AL_NO_ERROR;
+            
+        // OpenAL consumes buffers in the background
+        // we first need to initialize the OpenAL buffers then
+        // start continuous playback.
+        alc.alcMakeContextCurrent(context);
+        alErr = al.alGetError();
+        if(al.alGetError() != AL.AL_NO_ERROR) {
+            throw new RuntimeException("ALError "+toHexString(alErr)+" while makeCurrent. "+this);
+        }
+        
+        if( alBufferAvail.isEmpty() ) {
+            dequeueBuffer(true);
+        }
+        
+        final Integer alBufferName = alBufferAvail.get(true /* clearRef */);
+        if( null == alBufferName ) {
+            throw new InternalError("Internal Error: "+this);
+        }
+        if( !alBufferPlaying.put( new ActiveBuffer(alBufferName, audioFrame.dataSize) ) ) {
+            throw new InternalError("Internal Error: "+this);
+        }
+        al.alBufferData(alBufferName.intValue(), alFormat, audioFrame.data, audioFrame.dataSize, chosenFormat.sampleRate);
+        final int[] alBufferNames = new int[] { alBufferName.intValue() };
+        al.alSourceQueueBuffers(alSource[0], 1, alBufferNames, 0);
+        alErr = al.alGetError();
+        if(al.alGetError() != AL.AL_NO_ERROR) {
+            throw new RuntimeException("ALError "+toHexString(alErr)+" while queueing buffer "+toHexString(alBufferNames[0])+". "+this);
+        }
+        alBufferBytesQueued += audioFrame.dataSize;
+        
+        // Restart openal playback if needed
+        {
+            int[] val = new int[1];
+            al.alGetSourcei(alSource[0], AL.AL_SOURCE_STATE, val, 0);
+            if(val[0] != AL.AL_PLAYING) {
+                if( DEBUG ) {
+                    System.err.println("ALAudioSink: Start playing: "+this);
+                }
+                al.alSourcePlay(alSource[0]);
+                alErr = al.alGetError();
+                if(al.alGetError() != AL.AL_NO_ERROR) {
+                    throw new RuntimeException("ALError "+toHexString(alErr)+" while start playing. "+this);
+                }
+            }
+        }
     }
 
     @Override
-    public boolean isAudioSinkAvailable() {
-        return available;
+    public int getQueuedByteCount() {
+        if( !initialized || null == chosenFormat ) {
+            return 0;
+        }
+        return alBufferBytesQueued;
+    }
+    
+    @Override
+    public int getQueuedTime() {
+        if( !initialized || null == chosenFormat ) {
+            return 0;
+        }
+        final int bps = chosenFormat.sampleSize / 8;
+        return alBufferBytesQueued / ( chosenFormat.channelCount * bps * ( chosenFormat.sampleRate / 1000 ) );
     }
+    
+    @Override
+    public int getWritableBufferCount() {
+        if( !initialized || null == chosenFormat ) {
+            return 0;
+        }
+        return alBufferPlaying.getFreeSlots();
+    }
+    
+    @Override
+    public boolean isDataAvailable(int data_size) {               
+        return initialized && null != chosenFormat;
+    }
+    
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/AudioSink.java
deleted file mode 100644
index 504e4b2db..000000000
--- a/src/jogl/classes/jogamp/opengl/util/av/AudioSink.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package jogamp.opengl.util.av;
-
-public interface AudioSink {
-
-    boolean isAudioSinkAvailable();
-    
-    int getDataAvailable();
-
-    boolean isDataAvailable(int data_size);
-
-    void writeData(byte[] sampleData, int data_size);
-    
-}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 27c926704..2ff91a3f6 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -72,7 +72,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     
     protected URLConnection urlConn = null;
     
-    protected float playSpeed = 1.0f;
+    protected volatile float playSpeed = 1.0f;
     
     /** Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
     protected int width = 0;
@@ -215,7 +215,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     
     @Override
-    public final synchronized float getPlaySpeed() {
+    public final float getPlaySpeed() {
         return playSpeed;
     }
     
diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
index 653a02111..a5fedce59 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
@@ -2,39 +2,67 @@ package jogamp.opengl.util.av;
 
 import java.util.Arrays;
 
-import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.DataLine;
 import javax.sound.sampled.SourceDataLine;
 
-public class JavaSoundAudioSink implements AudioSink {
+import com.jogamp.opengl.util.av.AudioSink;
 
-    // AudioFormat parameters
-    public  static final int     SAMPLE_RATE = 44100;
-    private static final int     SAMPLE_SIZE = 16;
-    private static final int     CHANNELS = 2;
-    private static final boolean SIGNED = true;
-    private static final boolean BIG_ENDIAN = false;
+/***
+ * JavaSound Audio Sink
+ * <p>
+ * FIXME: Parameterize .. all configs .. best via an init-method, passing requested
+ * audio capabilities
+ * </p>
+ */
+public class JavaSoundAudioSink implements AudioSink {
 
     // Chunk of audio processed at one time
     public static final int BUFFER_SIZE = 1000;
     public static final int SAMPLES_PER_BUFFER = BUFFER_SIZE / 2;
+    private static final boolean staticAvailable;
     
     // Sample time values
-    public static final double SAMPLE_TIME_IN_SECS = 1.0 / SAMPLE_RATE;
-    public static final double BUFFER_TIME_IN_SECS = SAMPLE_TIME_IN_SECS * SAMPLES_PER_BUFFER;
+    // public static final double SAMPLE_TIME_IN_SECS = 1.0 / DEFAULT_SAMPLE_RATE;
+    // public static final double BUFFER_TIME_IN_SECS = SAMPLE_TIME_IN_SECS * SAMPLES_PER_BUFFER;
     
-    private static AudioFormat format;
-    private static DataLine.Info info;
-    private static SourceDataLine auline;
-    private static int bufferCount;
-    private static byte [] sampleData = new byte[BUFFER_SIZE];  
-    
-    private static boolean available;
+    private javax.sound.sampled.AudioFormat format;
+    private DataLine.Info info;
+    private SourceDataLine auline;
+    private int bufferCount;
+    private byte [] sampleData = new byte[BUFFER_SIZE];  
+    private boolean initialized = false;
+    private AudioDataFormat chosenFormat = null;
     
     static {
-     // Create the audio format we wish to use
-        format = new AudioFormat(SAMPLE_RATE, SAMPLE_SIZE, CHANNELS, SIGNED, BIG_ENDIAN);
+        boolean ok = false;
+        try {
+            AudioSystem.getAudioFileTypes();
+            ok = true;
+        } catch (Throwable t) {
+            
+        }
+        staticAvailable=ok;
+    }   
+    
+    @Override
+    public String toString() {
+        return "JavaSoundSink[init "+initialized+", dataLine "+info+", source "+auline+", bufferCount "+bufferCount+
+               ", chosen "+chosenFormat+", jsFormat "+format;
+    }
+    
+    @Override
+    public AudioDataFormat getPreferredFormat() {
+        return DefaultFormat;
+    }
+    
+    @Override
+    public AudioDataFormat initSink(AudioDataFormat requestedFormat, int bufferCount) {
+        if( !staticAvailable ) {
+            return null;
+        }
+        // Create the audio format we wish to use
+        format = new javax.sound.sampled.AudioFormat(requestedFormat.sampleRate, requestedFormat.sampleSize, requestedFormat.channelCount, requestedFormat.signed, !requestedFormat.littleEndian);
 
         // Create dataline info object describing line format
         info = new DataLine.Info(SourceDataLine.class, format);
@@ -47,33 +75,61 @@ public class JavaSoundAudioSink implements AudioSink {
             auline.open(format);
             auline.start();
             System.out.println("JavaSound audio sink");
-            available=true;
+            initialized=true;
+            chosenFormat = requestedFormat;
         } catch (Exception e) {
-            available=false;
+            initialized=false;
         }
-    }   
+        return chosenFormat;
+    }
     
-    public void writeData(byte[] sampleData, int data_size) {
-         int written = 0;
-         int len;
-         while (data_size > 0) {
-            len = auline.write(sampleData, written, data_size);
+    @Override
+    public boolean isInitialized() {
+        return initialized;
+    }
+
+    @Override
+    public void destroy() {
+        initialized = false;
+        chosenFormat = null;
+        // FIXEM: complete code!
+    }
+    
+    public void writeData(AudioFrame audioFrame) {
+        int data_size = audioFrame.dataSize;
+        final byte[] lala = new byte[data_size];
+        final int p = audioFrame.data.position();
+        audioFrame.data.get(lala, 0, data_size);
+        audioFrame.data.position(p);
+        
+        int written = 0;
+        int len;
+        while (data_size > 0) {
+            // Nope: We don't make compromises for this crappy API !
+            len = auline.write(lala, written, data_size);
             data_size -= len;
             written += len;
         }        
     }
 
-    public int getDataAvailable() {
+    @Override
+    public int getQueuedByteCount() {
         return auline.available();
     }
     
-    public boolean isDataAvailable(int data_size) {
-        return auline.available()>=data_size;
+    @Override
+    public int getQueuedTime() {
+        return 0; // FIXME
     }
 
+    
     @Override
-    public boolean isAudioSinkAvailable() {
-        return available;
+    public int getWritableBufferCount() {
+        return 1;
+    }
+    
+    public boolean isDataAvailable(int data_size) {
+        return auline.available()>=data_size;
     }
 
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
index d92967849..cef1c3361 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
@@ -1,23 +1,50 @@
 package jogamp.opengl.util.av;
 
+
+import com.jogamp.opengl.util.av.AudioSink;
+
 public class NullAudioSink implements AudioSink {
 
     @Override
-    public int getDataAvailable() {
-        return 0;
+    public boolean isInitialized() {
+        return true;
     }
 
     @Override
-    public boolean isDataAvailable(int data_size) {
-        return false;
+    public AudioDataFormat getPreferredFormat() {
+        return DefaultFormat;
+    }
+
+    @Override
+    public AudioDataFormat initSink(AudioDataFormat requestedFormat, int bufferCount) {
+        return requestedFormat;
+    }
+    
+    @Override
+    public void destroy() {
+    }
+    
+    @Override
+    public int getQueuedByteCount() {
+        return 0;
+    }
+    
+    @Override
+    public int getQueuedTime() {
+        return 0;
     }
 
     @Override
-    public void writeData(byte[] sampleData, int data_size) {
+    public int getWritableBufferCount() {
+        return 1;        
+    }
+    
+    @Override
+    public boolean isDataAvailable(int data_size) {
+        return false;
     }
 
     @Override
-    public boolean isAudioSinkAvailable() {
-        return true;
+    public void writeData(AudioFrame audioFrame) {
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/SyncedRingbuffer.java b/src/jogl/classes/jogamp/opengl/util/av/SyncedRingbuffer.java
new file mode 100644
index 000000000..5f5d69cf8
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/av/SyncedRingbuffer.java
@@ -0,0 +1,286 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.opengl.util.av;
+
+/** 
+ * Simple synchronized ring buffer implementation.
+ * <p>
+ * Caller can chose whether to block until get / put is able to proceed or not.
+ * </p>
+ * <p>
+ * Caller can chose whether to pass an empty array and clear references at get,
+ * or using a preset array for circular access of same objects.
+ * </p>
+ * <p>
+ * Circular write position is equal to the read position if buffer is full or if buffer is empty. 
+ * </p>
+ */
+public class SyncedRingbuffer<T> {
+
+    protected final Object sync = new Object();
+    protected final T[] array;
+    protected final int capacity;
+    protected int readPos;
+    protected int writePos;
+    protected int size;
+    
+    public final String toString() {
+        return "SyncedRingbuffer<?>[filled "+size+" / "+capacity+", writePos "+writePos+", readPos "+readPos+"]";
+    }
+    
+    /** 
+     * Create instance w/ the given array and it's capacity, e.g.:
+     * <pre>
+     *      SyncedRingbuffer r = new SyncedRingbuffer<Integer>(new Integer[10]);
+     * </pre>
+     * <p>
+     * The array may either be clear, or preset w/ elements!
+     * </p>
+     * @param full if true, given array is assumed to be full, i.e. {@link #isFull()} will return true.
+     * @param array
+     */
+    public SyncedRingbuffer(T[] array, boolean full) {
+        this.array = array;
+        this.capacity = array.length;
+        clearImpl(false);
+        if(full) {
+            size = capacity;
+        }
+    }
+    
+    public final int capacity() {
+        return capacity;
+    }
+    
+    /**
+     * Resets all ring buffer pointer to zero.
+     * <p>
+     * {@link #isEmpty()} will return <code>true</code> after calling this method.
+     * </p>
+     * <p>
+     * If <code>clearRefs</code> is true, all ring buffer slots will be set to <code>null</code>.
+     * </p>
+     * @param clearRefs if true, all ring buffer slots will be flushed, otherwise they remain intact.
+     */
+    public final void clear(boolean clearRefs) {
+        synchronized ( sync ) {
+            clearImpl(clearRefs);
+        }
+    }
+    
+    private final void clearImpl(boolean clearRefs) {
+        readPos = 0;
+        writePos = 0;
+        size = 0;
+        if( clearRefs ) {
+            for(int i=0; i<capacity; i++) {
+                this.array[i] = null;
+            }
+        }
+    }
+    
+    /** Returns the number of elements in this ring buffer. */
+    public final int size() {
+        synchronized ( sync ) {
+            return size;
+        }
+    }
+    
+    /** Returns the number of free slots available to put.  */
+    public final int getFreeSlots() {
+        synchronized ( sync ) {
+            return capacity - size;
+        }
+    }
+
+    /** Returns true if this ring buffer is empty, otherwise false. */
+    public final boolean isEmpty() {
+        synchronized ( sync ) {
+            return 0 == size;
+        }
+    }
+    
+    /** Returns true if this ring buffer is full, otherwise false. */
+    public final boolean isFull() {
+        synchronized ( sync ) {
+            return capacity == size;
+        }
+    }
+    
+    /**
+     * Returns the oldest put element if available, otherwise null.
+     * <p>
+     * Impl. returns the element at the current read position
+     * and advances the read position - if available.
+     * </p>
+     * <p>
+     * If <code>clearRef</code> is true, the returned ring buffer slot will be set to <code>null</code>.
+     * </p>
+     * <p>
+     * Method is non blocking and returns immediately;.
+     * </p>
+     * @param clearRef if true, the returned ring buffer slot will be flushed, otherwise it remains intact.
+     * @return the oldest put element if available, otherwise null.  
+     */
+    public final T get(boolean clearRef) {
+        try {
+            return getImpl(clearRef, false, false);
+        } catch (InterruptedException ie) { throw new RuntimeException(ie); }
+    }
+
+    /**
+     * Returns the oldest put element.
+     * <p>
+     * Impl. returns the element at the current read position
+     * and advances the read position.
+     * </p>
+     * <p>
+     * If <code>clearRef</code> is true, the returned ring buffer slot will be set to <code>null</code>.
+     * </p>
+     * <p>
+     * Methods blocks until an element becomes available via put.
+     * </p>
+     * @param clearRef if true, the returned ring buffer slot will be flushed, otherwise it remains intact.
+     * @return the oldest put element  
+     * @throws InterruptedException 
+     */
+    public final T getBlocking(boolean clearRef) throws InterruptedException {
+        return getImpl(clearRef, true, false);
+    }
+    
+    public final T peek() throws InterruptedException {
+        return getImpl(false, false, true);
+    }
+    public final T peekBlocking() throws InterruptedException {
+        return getImpl(false, true, true);
+    }
+    
+    private final T getImpl(boolean clearRef, boolean blocking, boolean peek) throws InterruptedException {
+        synchronized ( sync ) {
+            if( 0 == size ) {
+                if( blocking ) {
+                    while( 0 == size ) {
+                        sync.wait();
+                    }
+                } else {
+                    return null;
+                }
+            }
+            final T r = array[readPos];
+            if( !peek ) {
+                if( clearRef ) {
+                    array[readPos] = null;
+                }
+                readPos = (readPos + 1) % capacity;
+                size--;
+                sync.notifyAll(); // notify waiting putter
+            }
+            return r;
+        }
+    }
+    
+    /** 
+     * Puts the element <code>e</code> at the current write position
+     * and advances the write position.
+     * <p>
+     * Returns true if successful, otherwise false in case buffer is full.
+     * </p>
+     * <p>
+     * Method is non blocking and returns immediately;.
+     * </p>
+     */
+    public final boolean put(T e) {
+        try {
+            return putImpl(e, false, false);
+        } catch (InterruptedException ie) { throw new RuntimeException(ie); }
+    }
+    
+    /** 
+     * Puts the element <code>e</code> at the current write position
+     * and advances the write position.
+     * <p>
+     * Method blocks until a free slot becomes available via get.
+     * </p>
+     * @throws InterruptedException 
+     */
+    public final void putBlocking(T e) throws InterruptedException {
+        if( !putImpl(e, false, true) ) {
+            throw new InternalError("Blocking put failed: "+this);
+        }
+    }
+    
+    /** 
+     * Keeps the element at the current write position intact
+     * and advances the write position. 
+     * <p>
+     * Returns true if successful, otherwise false in case buffer is full.
+     * </p>
+     * <p>
+     * If <code>blocking</code> is true, method blocks until a free slot becomes available via get.
+     * </p>
+     * @param blocking if true, wait until a free slot becomes available via get.
+     * @throws InterruptedException 
+     */
+    public final boolean putSame(boolean blocking) throws InterruptedException {
+        return putImpl(null, true, blocking);
+    }
+    
+    private final boolean putImpl(T e, boolean sameRef, boolean blocking) throws InterruptedException {
+        synchronized ( sync ) {
+            if( capacity <= size ) {
+                if( blocking ) {
+                    while( capacity <= size ) {
+                        sync.wait();
+                    }
+                } else { 
+                    return false;
+                }
+            }
+            if( !sameRef ) {
+                array[ writePos ] = e;
+            }
+            writePos = (writePos + 1) % capacity;
+            size++;
+            sync.notifyAll(); // notify waiting getter
+            return true;
+        }
+    }
+    
+    public final void waitForFreeSlots(int count) throws InterruptedException {
+        synchronized ( sync ) {
+            if( capacity - size < count ) {
+                while( capacity - size < count ) {
+                    System.err.println("XXXX AAA XXX");
+                    sync.wait();
+                }
+            }
+        }
+    }
+    
+}
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 33b5b3b20..65b867ba1 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -38,20 +38,17 @@ import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLException;
 
-import java.util.Arrays;
-import java.util.Queue;
-
-import com.jogamp.common.util.ReflectionUtil;
 import com.jogamp.common.util.VersionNumber;
 import com.jogamp.gluegen.runtime.ProcAddressTable;
 import com.jogamp.opengl.util.GLPixelStorageModes;
-import com.jogamp.opengl.util.av.GLMediaPlayerFactory;
+import com.jogamp.opengl.util.av.AudioSink;
+import com.jogamp.opengl.util.av.AudioSinkFactory;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
 
 import jogamp.opengl.GLContextImpl;
-import jogamp.opengl.util.av.AudioSink;
 import jogamp.opengl.util.av.EGLMediaPlayerImpl;
+import jogamp.opengl.util.av.SyncedRingbuffer;
 
 /***
  * Implementation utilizes <a href="http://libav.org/">Libav</a>
@@ -111,13 +108,10 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     private static final int TEMP_BUFFER_COUNT = 20;
 
     // Instance data
-    private static AudioSink audioSink;
-    private static int maxAvailableAudio;
-
     public static final VersionNumber avUtilVersion;
     public static final VersionNumber avFormatVersion;
     public static final VersionNumber avCodecVersion;    
-    static boolean available;
+    static final boolean available;
     
     static {
         if(FFMPEGDynamicLibraryBundleInfo.initSingleton()) {
@@ -129,24 +123,6 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
             System.err.println("LIB_AV Codec : "+avCodecVersion);
             initIDs0();            
             available = true;
-            final ClassLoader cl = GLMediaPlayerFactory.class.getClassLoader();
-            
-            if(ReflectionUtil.isClassAvailable("com.jogamp.openal.ALFactory", cl)){
-              // Only instance ALAudioSink if JOAL is found on the classpath.
-              audioSink = (AudioSink) ReflectionUtil.createInstance("jogamp.opengl.openal.av.ALAudioSink", cl);
-              if(!audioSink.isAudioSinkAvailable()){
-            	  // Failed to initialize OpenAL.
-            	  audioSink=null;
-              }
-            }
-            if(audioSink==null) {
-                audioSink = (AudioSink) ReflectionUtil.createInstance("jogamp.opengl.util.av.JavaSoundAudioSink", cl);
-                if(!audioSink.isAudioSinkAvailable()) {
-                    audioSink = (AudioSink) ReflectionUtil.createInstance("jogamp.opengl.util.av.NullAudioSink", cl);
-                }
-            }
-            maxAvailableAudio = audioSink.getDataAvailable();
-
         } else {
             avUtilVersion = null;
             avFormatVersion = null;
@@ -163,6 +139,10 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
                                   ( vers >>  0 ) & 0xFF );
     }
     
+    //
+    // Video
+    //
+    
     protected long moviePtr = 0;    
     protected long procAddrGLTexSubImage2D = 0;
     protected EGLMediaPlayerImpl.EGLTextureFrame lastTex = null;
@@ -176,17 +156,29 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     protected int texWidth, texHeight; // overall (stuffing planes in one texture)
     protected ByteBuffer texCopy;
 
+    //
+    // Audio
+    //
+    
+    protected final int AudioFrameCount = 8;        
+    protected final AudioSink audioSink;    
+    protected final int maxAvailableAudio;
+    protected AudioSink.AudioDataFormat chosenAudioFormat; 
+    protected final SyncedRingbuffer<AudioSink.AudioFrame> audioFramesBuffer = new SyncedRingbuffer<AudioSink.AudioFrame>(new AudioSink.AudioFrame[AudioFrameCount], false /* full */);
+    
     public FFMPEGMediaPlayer() {
         super(TextureType.GL, false);
         if(!available) {
             throw new RuntimeException("FFMPEGMediaPlayer not available");
         }
         setTextureCount(1);
-        moviePtr = createInstance0(true);
+        moviePtr = createInstance0(DEBUG);
         if(0==moviePtr) {
             throw new GLException("Couldn't create FFMPEGInstance");
         }
         psm = new GLPixelStorageModes();
+        audioSink = AudioSinkFactory.createDefault(); 
+        maxAvailableAudio = audioSink.getQueuedByteCount();
     }
     
     @Override
@@ -221,9 +213,11 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
         }
         final String urlS=urlConn.getURL().toExternalForm();
     
-        System.out.println("setURL: p1 "+this);
-        setStream0(moviePtr, urlS, -1, -1);
-        System.out.println("setURL: p2 "+this);
+        chosenAudioFormat = audioSink.initSink(audioSink.getPreferredFormat(), AudioFrameCount);
+        System.err.println("setURL: p1 "+this);
+        setStream0(moviePtr, urlS, -1, -1, AudioFrameCount);
+        System.err.println("setURL: p2 "+this);
+        
         int tf, tif=GL.GL_RGBA; // texture format and internal format
         switch(vBytesPerPixelPerPlane) {
             case 1:
@@ -264,74 +258,103 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     }
 
 
-    private class AudioFrame {
-        final byte[] sampleData; 
-        final int data_size;
-        final int audio_pts;
-        AudioFrame(byte[] sampleData, int data_size, int audio_pts) {
-            this.sampleData=sampleData;
-            this.data_size=data_size;
-            this.audio_pts=audio_pts;
+    private final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
+        if( audioPusher != null && audioPusher.isRunning() ) {
+            try {
+                audioFramesBuffer.putBlocking(new AudioSink.AudioFrame(sampleData, data_size, audio_pts));
+            } catch (InterruptedException e) {
+                e.printStackTrace(); // oops
+            }
+            if( null != audioPusher ) {
+                audioPusher.pushOne();
+            }
         }
     }
 
-    static final Queue<AudioFrame> audioFrameBuffer = new java.util.LinkedList<AudioFrame>(); 
-
-    private void updateSound(byte[] sampleData, int data_size, int audio_pts) {
-/*
-        // Visualize incomming data
-        int c=0; 
-        for(byte b: sampleData){
-            if(b<0) {
-                System.out.print(" ");
-            } else if(b<64) {
-                System.out.print("_");
-            } else if(b < 128) {
-                System.out.print("-");
-            } else if(b == 128) {
-                System.out.print("=");
-            } else if(b < 256-64) {
-                System.out.print("\"");
-            } else {
-                System.out.print("'");
+    class AudioPusher extends Thread {
+        volatile boolean shallStop = false;
+        volatile boolean isBlocked = false;
+        
+        AudioPusher() {
+            setDaemon(true);
+        }
+        public void requestStop() {
+            shallStop = true;
+            if( isBlocked ) {
+                // interrupt();
             }
-                        
-            c++;
-            if(c>=40)
-                break;                   
         }
-        System.out.println("jA");
-*/
-
-        //TODO reduce GC
-        audioFrameBuffer.add(new AudioFrame(sampleData, data_size, audio_pts));
-        pumpAudio();
-    }
-
-    private void pumpAudio() {
-        if(audioSink.getDataAvailable()==maxAvailableAudio){
-           System.out.println("warning: audio buffer underrun");
+        public boolean isRunning() { return !shallStop; }
+        
+        public void run() {
+            setName(getName()+"-AudioPusher_"+AudioPusherInstanceId);
+            AudioPusherInstanceId++;
+            
+            while( !shallStop ){
+                pushOne();
+            }
         }
-        while(audioFrameBuffer.peek()!=null){
-            AudioFrame a = audioFrameBuffer.peek();
-
-            // poor mans audio sync .. TODO: off thread
-            final long now = System.currentTimeMillis();
-            final long now_d = now - lastAudioTime;
-            final long pts_d = a.audio_pts - lastAudioPTS;
-            final long dt = (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ;
-           
-            System.err.println("s: pts-a "+a.audio_pts+", pts-d "+pts_d+", now_d "+now_d+", dt "+dt); 
-            lastAudioTime = now;
-            if( (dt<audio_dt_d  ) && audioSink.isDataAvailable(a.data_size)) {
-                audioFrameBuffer.poll(); /* remove first item from the queue */
-                audioSink.writeData(a.sampleData, a.data_size);                
-                lastAudioPTS=a.audio_pts; 
-            } else {
-                break;
+        public void pushOne() {
+            final AudioSink.AudioFrame audioFrame;
+            try {
+                isBlocked = true;
+                audioFrame = audioFramesBuffer.getBlocking(true /* clearRef */);
+            } catch (InterruptedException e) {
+                if( !shallStop ) {
+                    e.printStackTrace(); // oops
+                }
+                shallStop = true;
+                return;
+            }
+            isBlocked = false;
+            
+            if( null != audioFrame ) {  
+                // poor mans audio sync ..
+                final long now = System.currentTimeMillis();
+                final long now_d = now - lastAudioTime;
+                final long pts_d = audioFrame.audioPTS - lastAudioPTS;
+                final long dt = (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ;
+                final boolean sleep = dt > audio_dt_d && !shallStop;
+                final long sleepP = dt - ( audio_dt_d / 2 );
+                if(DEBUG) {
+                    final int qAT = audioSink.getQueuedTime();
+                    System.err.println("s: pts-a "+audioFrame.audioPTS+", qAT "+qAT+", pts-d "+pts_d+", now_d "+now_d+", dt "+dt+", sleep "+sleep+", sleepP "+sleepP+" ms");
+                }
+                if( sleep ) {
+                    try {
+                        isBlocked = true;
+                        Thread.sleep( sleepP );
+                    } catch (InterruptedException e) {
+                        e.printStackTrace(); // oops
+                    }
+                    isBlocked = false;
+                    lastAudioTime = System.currentTimeMillis();
+                } else {
+                    lastAudioTime = now;
+                }
+                if( !shallStop && audioSink.isDataAvailable(audioFrame.dataSize) ) {
+                    audioSink.writeData(audioFrame);
+                    lastAudioPTS=audioFrame.audioPTS;
+                }
             }
         }
     }
+    
+    static int AudioPusherInstanceId = 0;    
+    private AudioPusher audioPusher = null;
+    
+    private final void stopAudioPusher() {
+        if( null != audioPusher ) {
+            audioPusher.requestStop();
+            audioPusher = null;
+        }
+        audioFramesBuffer.clear(true);
+    }
+    private final void startAudioPusher() {
+        stopAudioPusher();
+        audioPusher = new AudioPusher();
+        // audioPusher.start();
+    }
 
     private void updateAttributes2(int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
                                    int lSz0, int lSz1, int lSz2,
@@ -448,6 +471,7 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
         if(0==moviePtr) {
             return false;
         }
+        startAudioPusher();
         return true;
     }
 
@@ -457,6 +481,7 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
         if(0==moviePtr) {
             return false;
         }
+        stopAudioPusher();
         return true;
     }
 
@@ -466,6 +491,7 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
         if(0==moviePtr) {
             return false;
         }
+        stopAudioPusher();
         return true;
     }
 
@@ -475,12 +501,13 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
+        stopAudioPusher();
         int pts0 = getVideoPTS0(moviePtr);
         int pts1 = seek0(moviePtr, msec);
         System.err.println("Seek: "+pts0+" -> "+msec+" : "+pts1);
-        audioFrameBuffer.clear();
         lastAudioPTS=pts1;
         lastVideoPTS=pts1;
+        startAudioPusher();
         return pts1;
     }
 
@@ -509,6 +536,12 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
                 tex.enable(gl);
                 tex.bind(gl);
 
+                try {
+                    audioFramesBuffer.waitForFreeSlots(2);
+                } catch (InterruptedException e) {
+                    e.printStackTrace(); // oops
+                }
+
                 /* try decode 10 packets to find one containing video
                    (res == 2) */
                 int res = 0;
@@ -529,27 +562,27 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
                 final long pts_d = pts - lastAudioPTS - 444; /* hack 444 == play video 444ms ahead of audio */
                 final long dt = Math.min(47, (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ) ;
                 //final long dt = (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ;
-                lastVideoTime = now;
-                System.err.println("s: pts-v "+pts+", pts-d "+pts_d+", now_d "+now_d+", dt "+dt);
-                
-                if(dt>video_dt_d && dt<1000 && audioSink.getDataAvailable()<maxAvailableAudio-10000) {
+                final boolean sleep = dt>video_dt_d && dt<1000 && audioSink.getQueuedByteCount()<maxAvailableAudio-10000;
+                final long sleepP = dt-video_dt_d;
+                if(DEBUG) {
+                    final int qAT = audioSink.getQueuedTime();
+                    System.err.println("s: pts-v "+pts+", qAT "+qAT+", pts-d "+pts_d+", now_d "+now_d+", dt "+dt+", sleep "+sleep+", sleepP "+sleepP+" ms");
+                }
+                // ?? Maybe use audioSink.getQueuedTime();
+                if( sleep ) {
                     try {
-                        Thread.sleep(dt-video_dt_d);
+                        Thread.sleep(sleepP);
                     } catch (InterruptedException e) { }
-                } /* else if(0>pts_d) {
-                    System.err.println("s: pts-v "+pts+", pts-d "+pts_d+", now_d "+now_d+", dt "+dt);
-                } */
+                    lastVideoTime = System.currentTimeMillis();
+                } else { 
+                    lastVideoTime = now;
+                }
             }
-            pumpAudio();
             lastVideoPTS = pts;
         }
         return lastTex;
     }
     
-    private void consumeAudio(int len) {
-        
-    }
-    
     private static native int getAvUtilVersion0();
     private static native int getAvFormatVersion0();
     private static native int getAvCodecVersion0();
@@ -557,7 +590,7 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     private native long createInstance0(boolean verbose);    
     private native void destroyInstance0(long moviePtr);
     
-    private native void setStream0(long moviePtr, String url, int vid, int aid);
+    private native void setStream0(long moviePtr, String url, int vid, int aid, int audioFrameCount);
 
     private native int getVideoPTS0(long moviePtr);    
     
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index 3181a8a8f..5560b8617 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -82,7 +82,9 @@ typedef struct {
     AVStream*        pAStream;
     AVCodecContext*  pACodecCtx;
     AVCodec*         pACodec;
-    AVFrame*         pAFrame;
+    AVFrame**        pAFrames;
+    int32_t          aFrameCount;
+    int32_t          aFrameCurrent;
     int32_t          aSampleRate;
     int32_t          aChannels;
     int32_t          aFrameSize;
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
index d93caa30b..623bdcac7 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
+++ b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
@@ -38,7 +38,7 @@ typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLi
 static const char * const ClazzNameFFMPEGMediaPlayer = "jogamp/opengl/util/av/impl/FFMPEGMediaPlayer";
 
 static jclass ffmpegMediaPlayerClazz = NULL;
-static jmethodID jni_mid_updateSound = NULL;
+static jmethodID jni_mid_pushSound = NULL;
 static jmethodID jni_mid_updateAttributes1 = NULL;
 static jmethodID jni_mid_updateAttributes2 = NULL;
 
@@ -192,41 +192,6 @@ JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGDynamicLibraryB
     return JNI_TRUE;
 }
 
-static void _updateSound(JNIEnv *env, jobject instance, int8_t *data, int32_t data_size, int32_t aPTS) {
-    if(NULL!=env) {
-        jbyteArray jbArray = (*env)->NewByteArray(env, data_size);
-        if (jbArray == NULL) {
-            fprintf(stderr, "FFMPEGMediaPlayer out of memory at native code _updateSound");
-            return; /* out of memory error thrown */
-        }
-
-/*
-        // Visualize sample waveform
-        int i;
-        for(i=0;i<40;i++){
-            int8_t b = data[i];
-            if(b<0) {
-                printf(" ");
-            } else if(b<64) {
-                printf("_");
-            } else if(b < 128) {
-                printf("-");
-            } else if(b == 128) {
-                printf("=");
-            } else if(b < 256-64) {
-                printf("\"");
-            } else {
-                printf("'");
-            }
-        }
-        printf("nA\n");
-*/
-
-        (*env)->SetByteArrayRegion(env, jbArray, 0, data_size, data);
-        (*env)->CallVoidMethod(env, instance, jni_mid_updateSound, jbArray, data_size, aPTS);
-    }
-}
-
 static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasicAV_t* pAV)
 {
     // int shallBeDetached = 0;
@@ -277,9 +242,12 @@ static void freeInstance(FFMPEGToolBasicAV_t* pAV) {
             sp_av_free(pAV->pVFrame);
             pAV->pVFrame = NULL;
         }
-        if(NULL != pAV->pAFrame) {
-            sp_av_free(pAV->pAFrame);
-            pAV->pAFrame = NULL;
+        if(NULL != pAV->pAFrames) {
+            for(i=0; i<pAV->aFrameCount; i++) {
+                sp_av_free(pAV->pAFrames[i]);
+            }
+            free(pAV->pAFrames);
+            pAV->pAFrames = NULL;
         }
 
         // Close the video file
@@ -370,11 +338,11 @@ JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_ini
         JoglCommon_FatalError(env, "JOGL FFMPEG: can't use %s", ClazzNameFFMPEGMediaPlayer);
     }
 
-    jni_mid_updateSound = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateSound", "([BII)V");
+    jni_mid_pushSound = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "pushSound", "(Ljava/nio/ByteBuffer;II)V");
     jni_mid_updateAttributes1 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIFIILjava/lang/String;Ljava/lang/String;)V");
     jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIII)V");
 
-    if(jni_mid_updateSound == NULL ||
+    if(jni_mid_pushSound == NULL ||
        jni_mid_updateAttributes1 == NULL ||
        jni_mid_updateAttributes2 == NULL) {
         return JNI_FALSE;
@@ -415,7 +383,7 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_destroy
 }
 
 JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStream0
-  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jint vid, jint aid)
+  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jint vid, jint aid, jint audioFrameCount)
 {
     int res, i;
     jboolean iscopy;
@@ -525,11 +493,17 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
         pAV->aChannels = pAV->pACodecCtx->channels;
         pAV->aFrameSize = pAV->pACodecCtx->frame_size;
         pAV->aSampleFmt = pAV->pACodecCtx->sample_fmt;
-        pAV->pAFrame=sp_avcodec_alloc_frame();
-        if(pAV->pAFrame==NULL) {
-            JoglCommon_throwNewRuntimeException(env, "Couldn't alloc audio frame");
-            return;
+
+        pAV->aFrameCount = audioFrameCount;
+        pAV->pAFrames = calloc(audioFrameCount, sizeof(AVFrame*));
+        for(i=0; i<pAV->aFrameCount; i++) {
+            pAV->pAFrames[i]=sp_avcodec_alloc_frame();
+            if(pAV->pAFrames[i]==NULL) {
+                JoglCommon_throwNewRuntimeException(env, "Couldn't alloc audio frame %d / %d", i, audioFrameCount);
+                return;
+            }
         }
+        pAV->aFrameCurrent = 0;
     }
 
     if(0<=pAV->vid) {
@@ -622,11 +596,12 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
     if(sp_av_read_frame(pAV->pFormatCtx, &packet)>=0) {
         if(packet.stream_index==pAV->aid) {
             // Decode audio frame
-            if(NULL == pAV->pAFrame) {
+            if(NULL == pAV->pAFrames) { // no audio registered
                 sp_av_free_packet(&packet);
                 return res;
             }
-
+            AVFrame* pAFrameCurrent = pAV->pAFrames[pAV->aFrameCurrent];
+            pAV->aFrameCurrent = ( pAV->aFrameCurrent + 1 ) % pAV->aFrameCount ;
             int new_packet = 1;
             int len1;
             int flush_complete = 0;
@@ -636,7 +611,7 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                     break;
                 }
                 if(HAS_FUNC(sp_avcodec_decode_audio4)) {
-                    len1 = sp_avcodec_decode_audio4(pAV->pACodecCtx, pAV->pAFrame, &frameFinished, &packet);
+                    len1 = sp_avcodec_decode_audio4(pAV->pACodecCtx, pAFrameCurrent, &frameFinished, &packet);
                 } else {
                     #if 0
                     len1 = sp_avcodec_decode_audio3(pAV->pACodecCtx, int16_t *samples, int *frame_size_ptr, &frameFinished, &packet);
@@ -664,11 +639,11 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 if(HAS_FUNC(sp_av_samples_get_buffer_size)) {
                     data_size = sp_av_samples_get_buffer_size(NULL /* linesize, may be NULL */,
                                                               pAV->aChannels,
-                                                              pAV->pAFrame->nb_samples,
-                                                              pAV->pAFrame->format,
+                                                              pAFrameCurrent->nb_samples,
+                                                              pAFrameCurrent->format,
                                                               1 /* align */);
                 }
-                int32_t pts = (int64_t) ( pAV->pAFrame->pkt_pts * (int64_t) 1000 * (int64_t) pAV->pAStream->time_base.num )
+                int32_t pts = (int64_t) ( pAFrameCurrent->pkt_pts * (int64_t) 1000 * (int64_t) pAV->pAStream->time_base.num )
                               / (int64_t) pAV->pAStream->time_base.den;
                 #if 0
                 printf("channels %d sample_rate %d \n", pAV->aChannels , pAV->aSampleRate);
@@ -679,10 +654,10 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 if( pAV->verbose ) {
                     printf("A pts %d - %d\n", pts, pAV->aPTS);
                 }
-                // TODO: Wrap audio buffer data in a com.jogamp.openal.sound3d.Buffer or similar
-                // and hand it over to the user using a suitable API.
-                // TODO: OR send the audio buffer data down to sound card directly using JOAL.
-                _updateSound(env, instance, pAV->pAFrame->data[0], data_size, pAV->aPTS);
+                if( NULL != env ) {
+                    jobject jSampleData = (*env)->NewDirectByteBuffer(env, pAFrameCurrent->data[0], data_size);
+                    (*env)->CallVoidMethod(env, instance, jni_mid_pushSound, jSampleData, data_size, pAV->aPTS);
+                }
 
                 res = 1;
             }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index ad096c7a6..921710fed 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -138,7 +138,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
 
-        mPlayer = GLMediaPlayerFactory.create();
+        mPlayer = GLMediaPlayerFactory.createDefault();
         mPlayer.addEventListener(this);
         cube = new TextureSequenceCubeES2(mPlayer, false, zoom0, rotx, roty);        
         
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 5bf3145d0..7e0dcd909 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -151,7 +151,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         mPlayerScaleOrig = false;
         mPlayerShared = false;
         mPlayerExternal = false;
-        mPlayer = GLMediaPlayerFactory.create();
+        mPlayer = GLMediaPlayerFactory.createDefault();
         mPlayer.addEventListener(this);
         this.stream = stream;
         System.out.println("pC.1 "+mPlayer);
-- 
cgit v1.2.3


From 6332e13b2f0aa9818d37802302f04c90a4fa4239 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sat, 10 Aug 2013 09:14:19 +0200
Subject: GLMediaPlayer: Add multithreaded decoding w/ textureCount > 2 where
 available EGL/FFMPeg. WIP!

Off-thread decoding:
  If validated (impl) textureCount > 2, decoding happens on extra thread.
  If decoding requires GL context, a shared context is created for decoding thread.

API Changes:
- initGLStream(..): Adds 'textureCount' as argument.
- TextureSequence.TexSeqEventListener.newFrameAvailable(..) exposes the new frame available
- TextureSequence.TextureFrame exposes the PTS (video)

Implementation:

- 'int validateTextureCount(int)': implementation decides whether textureCount can be > 2, i.e. off-thread decoding allowed,
  default is NO w/ textureCount==2!

- 'boolean requiresOffthreadGLCtx()': implementation decides whether shared context is required for off-thread decoding

- 'syncFrame2Audio(TextureFrame frame)': implementation shall handle a/v sync, due to audio stream details (pts, buffered frames)

- FFMPEGMediaPlayer extends GLMediaPlayerImpl, no more EGLMediaPlayerImpl (redundant)

+++

- SyncedRingbuffer: Expose T[] array

+++

TODO:
 - syncAV!
 - test Android
---
 make/scripts/tests.sh                              |   6 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |  35 +-
 .../opengl/util/av/GLMediaPlayerFactory.java       |   8 +-
 .../opengl/util/texture/TextureSequence.java       |  17 +-
 .../android/av/AndroidGLMediaPlayerAPI14.java      | 139 +++---
 .../jogamp/opengl/util/av/EGLMediaPlayerImpl.java  |  20 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 501 ++++++++++++++++-----
 .../jogamp/opengl/util/av/NullGLMediaPlayer.java   |  74 +--
 .../jogamp/opengl/util/av/SyncedRingbuffer.java    |   2 +
 .../av/impl/FFMPEGDynamicLibraryBundleInfo.java    |  16 +-
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     | 336 +++++---------
 .../opengl/util/av/impl/OMXGLMediaPlayer.java      |  44 +-
 src/jogl/native/libav/ffmpeg_tool.h                |   8 +
 .../jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c |  59 ++-
 src/jogl/native/openmax/omx_tool.c                 |   8 +-
 .../jogl/demos/es2/TextureSequenceCubeES2.java     |   2 +-
 .../test/junit/jogl/demos/es2/av/MovieCube.java    |  18 +-
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  |  19 +-
 18 files changed, 798 insertions(+), 514 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 454bf21f3..ba4589d14 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -131,7 +131,7 @@ function jrun() {
     #D_ARGS="-Djogl.1thread=true -Djogl.debug.Threading"
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
-    D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.GLArrayData"
     #D_ARGS="-Djogl.debug.GLDrawable"
     #D_ARGS="-Djogl.debug.EGLDisplayUtil -Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.GLDrawable"
@@ -314,8 +314,8 @@ function testawtswt() {
 # 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.MovieSimple $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
 
 #
 # core/newt (testnoawt and testawt)
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 1825dbd47..a36bce305 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -40,12 +40,12 @@ import com.jogamp.opengl.util.texture.TextureSequence;
 /**
  * Lifecycle of an GLMediaPlayer:
  * <table border="1">
- *   <tr><th>action</th>                                   <th>state before</th>        <th>state after</th></tr>
- *   <tr><td>{@link #initGLStream(GL, URLConnection)}</td> <td>Uninitialized</td>       <td>Stopped</td></tr>
- *   <tr><td>{@link #start()}</td>                         <td>Stopped, Paused</td>     <td>Playing</td></tr>
- *   <tr><td>{@link #stop()}</td>                          <td>Playing, Paused</td>     <td>Stopped</td></tr>
- *   <tr><td>{@link #pause()}</td>                         <td>Playing</td>             <td>Paused</td></tr>
- *   <tr><td>{@link #destroy(GL)}</td>                     <td>ANY</td>                 <td>Uninitialized</td></tr>
+ *   <tr><th>action</th>                                        <th>state before</th>        <th>state after</th></tr>
+ *   <tr><td>{@link #initGLStream(GL, int, URLConnection)}</td> <td>Uninitialized</td>       <td>Stopped</td></tr>
+ *   <tr><td>{@link #start()}</td>                              <td>Stopped, Paused</td>     <td>Playing</td></tr>
+ *   <tr><td>{@link #stop()}</td>                               <td>Playing, Paused</td>     <td>Stopped</td></tr>
+ *   <tr><td>{@link #pause()}</td>                              <td>Playing</td>             <td>Paused</td></tr>
+ *   <tr><td>{@link #destroy(GL)}</td>                          <td>ANY</td>                 <td>Uninitialized</td></tr>
  * </table>
  * <p>
  * Current implementations (check each API doc link for details):
@@ -105,8 +105,12 @@ public interface GLMediaPlayer extends TextureSequence {
     
     public int getTextureCount();
     
-    /** Defaults to 0 */
+    /** Returns the texture target used by implementation. */
+    public int getTextureTarget();
+
+    /** Sets the texture unit. Defaults to 0. */
     public void setTextureUnit(int u);
+    
     /** Sets the texture min-mag filter, defaults to {@link GL#GL_NEAREST}. */
     public void setTextureMinMagFilter(int[] minMagFilter);
     /** Sets the texture min-mag filter, defaults to {@link GL#GL_CLAMP_TO_EDGE}. */
@@ -119,6 +123,7 @@ public interface GLMediaPlayer extends TextureSequence {
      * Uninitialized -> Stopped
      * </p>
      * @param gl current GL object. If null, no video output and textures will be available.
+     * @param textureCount desired number of buffered textures to be decoded off-thread, use <code>1</code> for on-thread decoding.  
      * @param urlConn the stream connection
      * @return the new state
      * 
@@ -126,7 +131,7 @@ public interface GLMediaPlayer extends TextureSequence {
      * @throws IOException in case of difficulties to open or process the stream
      * @throws GLException in case of difficulties to initialize the GL resources
      */
-    public State initGLStream(GL gl, URLConnection urlConn) throws IllegalStateException, GLException, IOException;
+    public State initGLStream(GL gl, int textureCount, URLConnection urlConn) throws IllegalStateException, GLException, IOException;
     
     /**
      * Releases the GL and stream resources.
@@ -161,10 +166,20 @@ public interface GLMediaPlayer extends TextureSequence {
     public State getState();
     
     /**
-     * @return time current position in milliseconds 
+     * @return current streaming position in milliseconds 
      **/
     public int getCurrentPosition();
 
+    /**
+     * @return current video PTS in milliseconds of {@link #getLastTexture()} 
+     **/
+    public int getVideoPTS();
+    
+    /**
+     * @return current audio PTS in milliseconds. 
+     **/
+    public int getAudioPTS();
+    
     /**
      * Allowed in state Stopped, Playing and Paused, otherwise ignored.
      * 
@@ -187,7 +202,7 @@ public interface GLMediaPlayer extends TextureSequence {
      * </p>
      * 
      * @see #addEventListener(GLMediaEventListener)
-     * @see GLMediaEventListener#newFrameAvailable(GLMediaPlayer, long)
+     * @see GLMediaEventListener#newFrameAvailable(GLMediaPlayer, TextureFrame, long)
      */
     @Override
     public TextureSequence.TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
index f09531f7f..2707dd6d2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
@@ -29,18 +29,20 @@ package com.jogamp.opengl.util.av;
 
 import jogamp.opengl.util.av.NullGLMediaPlayer;
 
-import com.jogamp.common.os.AndroidVersion;
-import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.ReflectionUtil;
 
 public class GLMediaPlayerFactory {
     private static final String AndroidGLMediaPlayerAPI14ClazzName = "jogamp.opengl.android.av.AndroidGLMediaPlayerAPI14";
     private static final String FFMPEGMediaPlayerClazzName = "jogamp.opengl.util.av.impl.FFMPEGMediaPlayer";
+    private static final String OMXGLMediaPlayerClazzName = "jogamp.opengl.util.av.impl.OMXGLMediaPlayer";
     private static final String isAvailableMethodName = "isAvailable";
     
     public static GLMediaPlayer createDefault() {
         final ClassLoader cl = GLMediaPlayerFactory.class.getClassLoader();
-        GLMediaPlayer sink = create(cl, AndroidGLMediaPlayerAPI14ClazzName);
+        GLMediaPlayer sink = create(cl, OMXGLMediaPlayerClazzName);
+        if( null == sink ) {
+            sink = create(cl, AndroidGLMediaPlayerAPI14ClazzName);
+        }
         if( null == sink ) {
             sink = create(cl, FFMPEGMediaPlayerClazzName);
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index 9f951d5da..3f739b2cc 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -112,26 +112,35 @@ public interface TextureSequence {
     public static class TextureFrame {
         public TextureFrame(Texture t) {
             texture = t;
+            pts = 0;
         }
         
         public final Texture getTexture() { return texture; }
+        public final int getPTS() { return pts; }
+        public final void setPTS(int pts) { this.pts = pts; }
         
         public String toString() {
-            return "TextureFrame[" + texture + "]";
+            return "TextureFrame[" + pts + "ms: " + texture + "]";
         }
         protected final Texture texture;
+        protected int pts;
     }
 
     public interface TexSeqEventListener<T extends TextureSequence> {
         /** 
-         * Signaling listeners that {@link TextureSequence#getNextTexture(GL, boolean)} is able to deliver a new frame.
+         * Signaling listeners that a new {@link TextureFrame} is available.
+         * <p>
+         * User shall utilize {@link TextureSequence#getNextTexture(GL, boolean)} to dequeue it to maintain 
+         * a consistent queue.  
+         * </p>
          * @param ts the event source 
+         * @param newFrame the newly enqueued frame
          * @param when system time in msec. 
          **/
-        public void newFrameAvailable(T ts, long when);
+        public void newFrameAvailable(T ts, TextureFrame newFrame, long when);
     }
     
-    /** Return the texture unit to be used with this frame. */
+    /** Return the texture unit used to render the current frame. */
     public int getTextureUnit();
 
     public int[] getTextureMinMagFilter();
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 8356a2bae..765cda084 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -28,12 +28,14 @@
 package jogamp.opengl.android.av;
 
 import java.io.IOException;
+import java.nio.Buffer;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GLES2;
 
 import com.jogamp.common.os.AndroidVersion;
 import com.jogamp.common.os.Platform;
+import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
 
 import jogamp.common.os.android.StaticContext;
@@ -76,7 +78,6 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     MediaPlayer mp;
     volatile boolean updateSurface = false;
     Object updateSurfaceLock = new Object();
-    TextureSequence.TextureFrame lastTexFrame = null;
 
     /**
     private static String toString(MediaPlayer m) {
@@ -90,17 +91,16 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             throw new RuntimeException("AndroidGLMediaPlayerAPI14 not available");
         }
         this.setTextureTarget(GLES2.GL_TEXTURE_EXTERNAL_OES);
-        this.setTextureCount(1);
         mp = new MediaPlayer();
     }
 
     @Override
-    protected boolean setPlaySpeedImpl(float rate) {
+    protected final boolean setPlaySpeedImpl(float rate) {
         return false;
     }
 
     @Override
-    protected boolean startImpl() {
+    protected final boolean startImpl() {
         if(null != mp) {        
             try {
                 mp.start();
@@ -115,7 +115,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected boolean pauseImpl() {
+    protected final boolean pauseImpl() {
         if(null != mp) {
             wakeUp(false);
             try {
@@ -131,7 +131,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected boolean stopImpl() {
+    protected final boolean stopImpl() {
         if(null != mp) {
             wakeUp(false);
             try {
@@ -147,7 +147,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected int seekImpl(int msec) {
+    protected final int seekImpl(int msec) {
         if(null != mp) {
             mp.seekTo(msec);
             return mp.getCurrentPosition();
@@ -155,40 +155,6 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
         return 0;
     }
 
-    @Override
-    protected TextureSequence.TextureFrame getLastTextureImpl() {
-        return lastTexFrame;
-    }
-
-    @Override
-    protected TextureSequence.TextureFrame getNextTextureImpl(GL gl, boolean blocking) {
-        if(null != stex && null != mp) {
-            // Only block once, no while-loop. 
-            // This relaxes locking code of non crucial resources/events.
-            boolean update = updateSurface;
-            if(!update && blocking) {
-                synchronized(updateSurfaceLock) {
-                    if(!updateSurface) { // volatile OK.
-                        try {
-                            updateSurfaceLock.wait();
-                        } catch (InterruptedException e) {
-                            e.printStackTrace();
-                        }
-                    }
-                    updateSurface = false;
-                    update = true;
-                }
-            }
-            if(update) {
-                stex.updateTexImage();
-                // stex.getTransformMatrix(atex.getSTMatrix());
-                lastTexFrame=texFrames[0];
-            }
-            
-        }
-        return lastTexFrame;
-    }
-    
     private void wakeUp(boolean newFrame) {
         synchronized(updateSurfaceLock) {
             if(newFrame) {
@@ -199,12 +165,13 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected int getCurrentPositionImpl() {
-        return null != mp ? mp.getCurrentPosition() : 0;
-    }
+    protected final int getCurrentPositionImpl() { return null != mp ? mp.getCurrentPosition() : 0; }
+    
+    @Override
+    protected final int getAudioPTSImpl() { return getCurrentPositionImpl(); }    
 
     @Override
-    protected void destroyImpl(GL gl) {
+    protected final void destroyImpl(GL gl) {
         if(null != mp) {
             wakeUp(false);
             mp.release();
@@ -213,9 +180,25 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
     
     SurfaceTexture stex = null;
+    public static class SurfaceTextureFrame extends TextureSequence.TextureFrame {        
+        public SurfaceTextureFrame(Texture t, SurfaceTexture stex) {
+            super(t);
+            this.surfaceTex = stex;
+            this.surface = new Surface(stex);
+        }
+        
+        public final SurfaceTexture getSurfaceTexture() { return surfaceTex; }
+        public final Surface getSurface() { return surface; }
+        
+        public String toString() {
+            return "SurfaceTextureFrame[" + pts + "ms: " + texture + ", " + surfaceTex + "]";
+        }
+        private final SurfaceTexture surfaceTex;
+        private final Surface surface; 
+    }
     
     @Override
-    protected void initGLStreamImpl(GL gl, int[] texNames) throws IOException {
+    protected final void initGLStreamImpl(GL gl) throws IOException {
         if(null!=mp && null!=urlConn) {
             try {
                 final Uri uri = Uri.parse(urlConn.getURL().toExternalForm());        
@@ -227,44 +210,86 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             } catch (IllegalStateException e) {
                 throw new RuntimeException(e);
             }
-            stex = new SurfaceTexture(texNames[0]); // only 1 texture
-            stex.setOnFrameAvailableListener(onFrameAvailableListener);
+            if( null == stex ) {
+                throw new InternalError("XXX");
+            }
             final Surface surf = new Surface(stex);
             mp.setSurface(surf);
             surf.release();
+            mp.setSurface(null);
             try {
                 mp.prepare();
             } catch (IOException ioe) {
                 throw new IOException("MediaPlayer failed to process stream <"+urlConn.getURL().toExternalForm()+">: "+ioe.getMessage(), ioe);
             }
+            final String icodec = "android";
             updateAttributes(mp.getVideoWidth(), mp.getVideoHeight(), 
                              0, 0, 0, 
                              0f, 0, mp.getDuration(), 
-                             null, null);
+                             icodec, icodec);
+        }
+    }
+    
+    @Override
+    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking) {
+        if(null != stex && null != mp) {
+            final SurfaceTextureFrame nextSFrame = (SurfaceTextureFrame) nextFrame;
+            final Surface nextSurface = nextSFrame.getSurface();
+            mp.setSurface(nextSurface);
+            nextSurface.release();
+            
+            // Only block once, no while-loop. 
+            // This relaxes locking code of non crucial resources/events.
+            boolean update = updateSurface;
+            if(!update && blocking) {
+                synchronized(updateSurfaceLock) {
+                    if(!updateSurface) { // volatile OK.
+                        try {
+                            updateSurfaceLock.wait();
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    update = updateSurface;
+                    updateSurface = false;
+                }
+            }
+            if(update) {
+                final SurfaceTexture nextSTex = nextSFrame.getSurfaceTexture(); 
+                nextSTex.updateTexImage();
+                // nextFrame.setPTS( (int) ( nextSTex.getTimestamp() / 1000000L ) ); // nano -9 -> milli -3
+                nextFrame.setPTS( mp.getCurrentPosition() );
+                // stex.getTransformMatrix(atex.getSTMatrix());
+            }
         }
+        return true;
     }
+    @Override
+    protected final void syncFrame2Audio(TextureFrame frame) {}
     
     @Override
-    protected TextureSequence.TextureFrame createTexImage(GL gl, int idx, int[] tex) {
-        lastTexFrame = new TextureSequence.TextureFrame( createTexImageImpl(gl, idx, tex, width, height, true) );
-        return lastTexFrame; 
+    protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+        if( null != stex ) {
+            throw new InternalError("XXX");
+        }
+        stex = new SurfaceTexture(texName); // only 1 texture
+        stex.setOnFrameAvailableListener(onFrameAvailableListener);
+        return new TextureSequence.TextureFrame( createTexImageImpl(gl, texName, width, height, true) );
     }
     
     @Override
-    protected void destroyTexImage(GL gl, TextureSequence.TextureFrame imgTex) {
+    protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame imgTex) {
         if(null != stex) {
             stex.release();
             stex = null;
         }
-        lastTexFrame = null;
-        super.destroyTexImage(gl, imgTex);
+        super.destroyTexFrame(gl, imgTex);
     }
     
     protected OnFrameAvailableListener onFrameAvailableListener = new OnFrameAvailableListener() {
         @Override
         public void onFrameAvailable(SurfaceTexture surfaceTexture) {
             wakeUp(true);
-            AndroidGLMediaPlayerAPI14.this.newFrameAvailable();
         }        
-    };        
+    };
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
index 274ccffd5..57d5ff625 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
@@ -77,19 +77,19 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
     }
 
     
-    protected EGLMediaPlayerImpl() {
-        this(TextureType.GL, false);
-    }
-    
     protected EGLMediaPlayerImpl(TextureType texType, boolean useKHRSync) {
         super();
         this.texType = texType;
         this.useKHRSync = useKHRSync;
     }
+    @Override
+    protected final int validateTextureCount(int desiredTextureCount) {
+        return desiredTextureCount>1 ? desiredTextureCount : 2;
+    }
 
     @Override
-    protected TextureSequence.TextureFrame createTexImage(GL gl, int idx, int[] tex) {
-        final Texture texture = super.createTexImageImpl(gl, idx, tex, width, height, false);
+    protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+        final Texture texture = super.createTexImageImpl(gl, texName, width, height, false);
         final Buffer clientBuffer;
         final long image;
         final long sync;
@@ -117,7 +117,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
                                                EGLExt.EGL_GL_TEXTURE_2D_KHR,
                                                clientBuffer, nioTmp);
             if (0==image) {
-                throw new RuntimeException("EGLImage creation failed: "+EGL.eglGetError()+", ctx "+eglCtx+", tex "+tex[idx]+", err "+toHexString(EGL.eglGetError()));
+                throw new RuntimeException("EGLImage creation failed: "+EGL.eglGetError()+", ctx "+eglCtx+", tex "+texName+", err "+toHexString(EGL.eglGetError()));
             }
         } else {
             clientBuffer = null;
@@ -141,7 +141,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected void destroyTexImage(GL gl, TextureSequence.TextureFrame imgTex) {
+    protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
         final boolean eglUsage = TextureType.KHRImage == texType || useKHRSync ; 
         final EGLContext eglCtx;
         final EGLExt eglExt;
@@ -156,7 +156,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
             eglExt = null;
             eglDrawable = null;
         }
-        final EGLTextureFrame eglTex = (EGLTextureFrame) imgTex;
+        final EGLTextureFrame eglTex = (EGLTextureFrame) frame;
         
         if(0!=eglTex.getImage()) {
             eglExt.eglDestroyImageKHR(eglDrawable.getNativeSurface().getDisplayHandle(), eglTex.getImage());
@@ -164,6 +164,6 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
         if(0!=eglTex.getSync()) {
             eglExt.eglDestroySyncKHR(eglDrawable.getNativeSurface().getDisplayHandle(), eglTex.getSync());
         }
-        super.destroyTexImage(gl, imgTex);
+        super.destroyTexFrame(gl, frame);
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 2ff91a3f6..bc297dc21 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -30,13 +30,17 @@ package jogamp.opengl.util.av;
 import java.io.IOException;
 import java.net.URLConnection;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 
+import javax.media.nativewindow.AbstractGraphicsDevice;
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawable;
+import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLES2;
 import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
 
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
@@ -45,7 +49,7 @@ import com.jogamp.opengl.util.texture.TextureSequence;
 /**
  * After object creation an implementation may customize the behavior:
  * <ul>
- *   <li>{@link #setTextureCount(int)}</li>
+ *   <li>{@link #setDesTextureCount(int)}</li>
  *   <li>{@link #setTextureTarget(int)}</li>
  *   <li>{@link EGLMediaPlayerImpl#setEGLTexImageAttribs(boolean, boolean)}.</li>
  * </ul>
@@ -59,6 +63,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected static final String unknown = "unknown";
 
     protected State state;
+    
     protected int textureCount;
     protected int textureTarget;
     protected int textureFormat;
@@ -74,35 +79,38 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     
     protected volatile float playSpeed = 1.0f;
     
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected int width = 0;
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected int height = 0;
-    /** Video fps. Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** Video fps. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected float fps = 0;
-    /** Stream bps. Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** Stream bps. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected int bps_stream = 0;
-    /** Video bps. Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** Video bps. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected int bps_video = 0;
-    /** Audio bps. Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** Audio bps. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected int bps_audio = 0;
-    /** In frames. Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** In frames. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected int totalFrames = 0;
-    /** In ms. Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** In ms. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected int duration = 0;
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected String acodec = unknown;
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int[])} method implementation. */
+    /** Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
     protected String vcodec = unknown;
     
     protected int frameNumber = 0;
+    protected int currentVideoPTS = 0;
     
-    protected TextureSequence.TextureFrame[] texFrames = null;
-    protected HashMap<Integer, TextureSequence.TextureFrame> texFrameMap = new HashMap<Integer, TextureSequence.TextureFrame>();
+    protected SyncedRingbuffer<TextureFrame> videoFramesFree =  null;
+    protected SyncedRingbuffer<TextureFrame> videoFramesDecoded =  null;
+    protected volatile TextureFrame lastFrame = null;
+
     private ArrayList<GLMediaEventListener> eventListeners = new ArrayList<GLMediaEventListener>();
 
     protected GLMediaPlayerImpl() {
-        this.textureCount=3;
+        this.textureCount=0;
         this.textureTarget=GL.GL_TEXTURE_2D;
         this.textureFormat = GL.GL_RGBA;
         this.textureInternalFormat = GL.GL_RGBA;
@@ -112,14 +120,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
-    public void setTextureUnit(int u) { texUnit = u; }
+    public final void setTextureUnit(int u) { texUnit = u; }
     
     @Override
-    public int getTextureUnit() { return texUnit; }
+    public final int getTextureUnit() { return texUnit; }
+    
+    @Override
+    public final int getTextureTarget() { return textureTarget; }
     
-    protected final void setTextureCount(int textureCount) {
-        this.textureCount=textureCount;
-    }
     @Override
     public final int getTextureCount() { return textureCount; }
     
@@ -134,29 +142,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final int[] getTextureMinMagFilter() { return texMinMagFilter; }
     
     public final void setTextureWrapST(int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
-    public final int[] getTextureWrapST() { return texWrapST; }
-
-    @Override
-    public final TextureSequence.TextureFrame getLastTexture() throws IllegalStateException {
-        if(State.Uninitialized == state) {
-            throw new IllegalStateException("Instance not initialized: "+this);
-        }
-        return getLastTextureImpl();
-    }
-    protected abstract TextureSequence.TextureFrame getLastTextureImpl();
-    
-    @Override
-    public final synchronized TextureSequence.TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException {
-        if(State.Uninitialized == state) {
-            throw new IllegalStateException("Instance not initialized: "+this);
-        }
-        if(State.Playing == state) {
-            final TextureSequence.TextureFrame f = getNextTextureImpl(gl, blocking);
-            return f;
-        }
-        return getLastTextureImpl();        
-    }
-    protected abstract TextureSequence.TextureFrame getNextTextureImpl(GL gl, boolean blocking);
+    public final int[] getTextureWrapST() { return texWrapST; }    
     
     @Override
     public String getRequiredExtensionsShaderStub() throws IllegalStateException {
@@ -229,12 +215,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected abstract boolean setPlaySpeedImpl(float rate);
 
     public final State start() {
-        switch(state) {
+        switch( state ) {
             case Stopped:
+                /** fall-through intended */
             case Paused:
-                if(startImpl()) {
+                if( startImpl() ) {
+                    resumeFramePusher();
                     state = State.Playing;
                 }
+            default:
         }
         if(DEBUG) { System.err.println("Start: "+toString()); }
         return state;
@@ -242,7 +231,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected abstract boolean startImpl();
     
     public final State pause() {
-        if(State.Playing == state && pauseImpl()) {
+        if( State.Playing == state && pauseImpl() ) {
+            pauseFramePusher();
             state = State.Paused;
         }
         if(DEBUG) { System.err.println("Pause: "+toString()); }            
@@ -251,12 +241,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected abstract boolean pauseImpl();
     
     public final State stop() {
-        switch(state) {
+        switch( state ) {
             case Playing:
+                /** fall-through intended */
             case Paused:
-                if(stopImpl()) {
+                if( stopImpl() ) {
+                    pauseFramePusher();
                     state = State.Stopped;
                 }
+            default:
         }
         if(DEBUG) { System.err.println("Stop: "+toString()); }
         return state;
@@ -265,61 +258,70 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     
     @Override
     public final int getCurrentPosition() {
-        if(State.Uninitialized != state) {
+        if( State.Uninitialized != state ) {
             return getCurrentPositionImpl();
         }
         return 0;
     }
     protected abstract int getCurrentPositionImpl();
     
+    @Override
+    public final int getVideoPTS() { return currentVideoPTS; }
+    
+    @Override
+    public final int getAudioPTS() { 
+        if( State.Uninitialized != state ) {
+            return getAudioPTSImpl();
+        }
+        return 0;
+    }    
+    protected abstract int getAudioPTSImpl();
+    
     public final int seek(int msec) {
-        final int cp;
+        final int pts1;
         switch(state) {
             case Stopped:
             case Playing:
             case Paused:
-                cp = seekImpl(msec);
+                pauseFramePusher();
+                pts1 = seekImpl(msec);
+                currentVideoPTS=pts1;
+                resumeFramePusher();
                 break;
             default:
-                cp = 0;
+                pts1 = 0;
         }
         if(DEBUG) { System.err.println("Seek("+msec+"): "+toString()); }
-        return cp;        
+        return pts1;        
     }
     protected abstract int seekImpl(int msec);
     
     public final State getState() { return state; }
     
     @Override
-    public final State initGLStream(GL gl, URLConnection urlConn) throws IllegalStateException, GLException, IOException {
+    public final State initGLStream(GL gl, int reqTextureCount, URLConnection urlConn) throws IllegalStateException, GLException, IOException {
         if(State.Uninitialized != state) {
             throw new IllegalStateException("Instance not in state "+State.Uninitialized+", but "+state+", "+this);
         }
         this.urlConn = urlConn;
         if (this.urlConn != null) {
             try {                
-                if(null != gl) {
-                    if(null!=texFrames) {
-                        // re-init ..
-                        removeAllImageTextures(gl);
-                    } else {
-                        texFrames = new TextureSequence.TextureFrame[textureCount];
-                    }
-                    final int[] tex = new int[textureCount];
-                    {
-                        gl.glGenTextures(textureCount, tex, 0);
-                        final int err = gl.glGetError();
-                        if( GL.GL_NO_ERROR != err ) {
-                            throw new RuntimeException("TextureNames creation failed (num: "+textureCount+"): err "+toHexString(err));
-                        }
+                if( null != gl ) {
+                    removeAllTextureFrames(gl);
+                    textureCount = validateTextureCount(reqTextureCount);
+                    if( textureCount < 2 ) {
+                        throw new InternalError("Validated texture count < 2: "+textureCount);
                     }
-                    initGLStreamImpl(gl, tex);
-                    
-                    for(int i=0; i<textureCount; i++) {
-                        final TextureSequence.TextureFrame tf = createTexImage(gl, i, tex); 
-                        texFrames[i] = tf;
-                        texFrameMap.put(tex[i], tf);
+                    initGLStreamImpl(gl); // also initializes width, height, .. etc
+                    videoFramesFree = new SyncedRingbuffer<TextureFrame>(createTexFrames(gl, textureCount), true /* full */);
+                    if( 2 < textureCount ) {
+                        videoFramesDecoded = new SyncedRingbuffer<TextureFrame>(new TextureFrame[textureCount], false /* full */);
+                        framePusher = new FramePusher(gl, requiresOffthreadGLCtx());
+                        framePusher.doStart();
+                    } else {
+                        videoFramesDecoded = null;
                     }
+                    lastFrame = videoFramesFree.getBlocking(false /* clearRef */ );
                 }
                 state = State.Stopped;
                 return state;
@@ -329,35 +331,42 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
         return state;        
     }
+    /** 
+     * Returns the validated number of textures to be handled.
+     * <p>
+     * Default is always 2 textures, last texture and the decoding texture. 
+     * </p>
+     */
+    protected int validateTextureCount(int desiredTextureCount) {
+        return 2;
+    }
+    protected boolean requiresOffthreadGLCtx() { return false; }
     
-    /**
-     * Implementation shall set the following set of data here 
-     * @param gl TODO
-     * @param texNames TODO
-     * @see #width
-     * @see #height
-     * @see #fps
-     * @see #bps_stream
-     * @see #totalFrames
-     * @see #acodec
-     * @see #vcodec
-    */
-    protected abstract void initGLStreamImpl(GL gl, int[] texNames) throws IOException;
-    
-    protected TextureSequence.TextureFrame createTexImage(GL gl, int idx, int[] tex) {
-        return new TextureSequence.TextureFrame( createTexImageImpl(gl, idx, tex, width, height, false) );
+    private final TextureFrame[] createTexFrames(GL gl, final int count) {
+        final int[] texNames = new int[count];
+        gl.glGenTextures(count, texNames, 0);
+        final int err = gl.glGetError();
+        if( GL.GL_NO_ERROR != err ) {
+            throw new RuntimeException("TextureNames creation failed (num: "+count+"): err "+toHexString(err));
+        }
+        final TextureFrame[] texFrames = new TextureFrame[count];
+        for(int i=0; i<count; i++) {
+            texFrames[i] = createTexImage(gl, texNames[i]);
+        }
+        return texFrames;
     }
+    protected abstract TextureFrame createTexImage(GL gl, int texName);
     
-    protected Texture createTexImageImpl(GL gl, int idx, int[] tex, int tWidth, int tHeight, boolean mustFlipVertically) {
-        if( 0 > tex[idx] ) {
-            throw new RuntimeException("TextureName "+toHexString(tex[idx])+" invalid.");
+    protected final Texture createTexImageImpl(GL gl, int texName, int tWidth, int tHeight, boolean mustFlipVertically) {
+        if( 0 > texName ) {
+            throw new RuntimeException("TextureName "+toHexString(texName)+" invalid.");
         }
         gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
-        gl.glBindTexture(textureTarget, tex[idx]);
+        gl.glBindTexture(textureTarget, texName);
         {
             final int err = gl.glGetError();
             if( GL.GL_NO_ERROR != err ) {
-                throw new RuntimeException("Couldn't bind textureName "+toHexString(tex[idx])+" to 2D target, err "+toHexString(err));
+                throw new RuntimeException("Couldn't bind textureName "+toHexString(texName)+" to 2D target, err "+toHexString(err));
             }
         }
 
@@ -389,30 +398,297 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, texWrapST[0]);
         gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, texWrapST[1]);
         
-        return com.jogamp.opengl.util.texture.TextureIO.newTexture(tex[idx],
-                     textureTarget,
+        return com.jogamp.opengl.util.texture.TextureIO.newTexture(
+                     texName, textureTarget,
                      tWidth, tHeight,
                      width,  height,
                      mustFlipVertically);        
     }
+        
+    private final void removeAllTextureFrames(GL gl) {
+        if( null != videoFramesFree ) {
+            final TextureFrame[] texFrames = videoFramesFree.getArray(); 
+            videoFramesFree = null;
+            videoFramesDecoded = null;
+            lastFrame = null;
+            for(int i=0; i<texFrames.length; i++) {
+                final TextureFrame frame = texFrames[i];
+                if(null != frame) {
+                    destroyTexFrame(gl, frame);
+                    texFrames[i] = null;
+                }
+            }        
+        }
+        textureCount=0;
+    }
+    protected void destroyTexFrame(GL gl, TextureFrame frame) {
+        frame.getTexture().destroy(gl);        
+    }
+
+    /**
+     * Implementation shall set the following set of data here 
+     * @param gl TODO
+     * @see #width
+     * @see #height
+     * @see #fps
+     * @see #bps_stream
+     * @see #totalFrames
+     * @see #acodec
+     * @see #vcodec
+    */
+    protected abstract void initGLStreamImpl(GL gl) throws IOException;
     
-    protected void destroyTexImage(GL gl, TextureSequence.TextureFrame imgTex) {
-        imgTex.getTexture().destroy(gl);        
+    @Override
+    public final TextureFrame getLastTexture() throws IllegalStateException {
+        if(State.Uninitialized == state) {
+            throw new IllegalStateException("Instance not initialized: "+this);
+        }
+        return lastFrame;
     }
     
-    protected void removeAllImageTextures(GL gl) {
-        if(null != texFrames) {
-            for(int i=0; i<textureCount; i++) {
-                final TextureSequence.TextureFrame imgTex = texFrames[i];
-                if(null != imgTex) {
-                    destroyTexImage(gl, imgTex);
-                    texFrames[i] = null;
+    @Override
+    public final synchronized TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException {
+        if(State.Uninitialized == state) {
+            throw new IllegalStateException("Instance not initialized: "+this);
+        }
+        if(State.Playing == state) {
+            TextureFrame nextFrame = null;
+            boolean ok = true;
+            try {
+                if( 2 < textureCount ) {
+                    nextFrame = videoFramesDecoded.getBlocking(false /* clearRef */ );
+                } else {
+                    nextFrame = videoFramesFree.getBlocking(false /* clearRef */ );
+                    if( getNextTextureImpl(gl, nextFrame, blocking) ) {
+                        newFrameAvailable(nextFrame);
+                    } else {
+                        ok = false;
+                    }
+                }
+                if( ok ) {
+                    currentVideoPTS = nextFrame.getPTS();
+                    if( blocking ) {
+                        syncFrame2Audio(nextFrame);
+                    }
+                    final TextureFrame _lastFrame = lastFrame;
+                    lastFrame = nextFrame;
+                    videoFramesFree.putBlocking(_lastFrame);
+                }
+            } catch (InterruptedException e) {
+                ok = false;
+                e.printStackTrace();
+            } finally {
+                if( !ok && null != nextFrame ) { // put back
+                    videoFramesFree.put(nextFrame);
                 }
             }
         }
-        texFrameMap.clear();
+        return lastFrame;
     }
+    protected abstract boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking);
+    protected abstract void syncFrame2Audio(TextureFrame frame);
+    
+    private final void newFrameAvailable(TextureFrame frame) {
+        frameNumber++;        
+        synchronized(eventListenersLock) {
+            for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
+                i.next().newFrameAvailable(this, frame, System.currentTimeMillis());
+            }
+        }
+    }
+    
+    class FramePusher extends Thread {
+        private volatile boolean isRunning = false;
+        private volatile boolean isActive = false;
+        
+        private volatile boolean shallPause = true;
+        private volatile boolean shallStop = false;
+        
+        private final GL gl;
+        private GLDrawable dummyDrawable = null;
+        private GLContext sharedGLCtx = null;
+        
+        FramePusher(GL gl, boolean createSharedCtx) {
+            setDaemon(true);
+            this.gl = createSharedCtx ? createSharedGL(gl) : gl;
+        }
+        
+        private GL createSharedGL(GL gl) {
+            final GLContext glCtx = gl.getContext();
+            final boolean glCtxCurrent = glCtx.isCurrent();
+            final GLProfile glp = gl.getGLProfile();
+            final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+            final AbstractGraphicsDevice device = glCtx.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+            dummyDrawable = factory.createDummyDrawable(device, true, glp); // own device!
+            dummyDrawable.setRealized(true);
+            sharedGLCtx = dummyDrawable.createContext(glCtx);
+            makeCurrent(sharedGLCtx);
+            if( glCtxCurrent ) {
+                makeCurrent(glCtx);
+            } else {
+                sharedGLCtx.release();
+            }
+            return sharedGLCtx.getGL();
+        }
+        private void makeCurrent(GLContext ctx) {
+            if( GLContext.CONTEXT_NOT_CURRENT >= ctx.makeCurrent() ) {
+                throw new GLException("Couldn't make ctx current: "+ctx);
+            }
+        }
+        
+        private void destroySharedGL() {
+            if( null != sharedGLCtx ) {
+                if( sharedGLCtx.isCreated() ) {
+                    // Catch dispose GLExceptions by GLEventListener, just 'print' them
+                    // so we can continue with the destruction.
+                    try {
+                        sharedGLCtx.destroy();
+                    } catch (GLException gle) {
+                        gle.printStackTrace();
+                    }
+                }
+                sharedGLCtx = null;            
+            }
+            if( null != dummyDrawable ) {
+                final AbstractGraphicsDevice device = dummyDrawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+                dummyDrawable.setRealized(false);
+                dummyDrawable = null;
+                device.close();
+            }            
+        }
+        
+        public synchronized void doPause() {
+            if( isActive ) {
+                shallPause = true;
+                while( isActive ) {
+                    try {
+                        this.wait(); // wait until paused
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        public synchronized void doResume() {
+            if( isRunning && !isActive ) {
+                shallPause = false;
+                while( !isActive ) {
+                    this.notify();  // wake-up pause-block
+                    try {
+                        this.wait(); // wait until resumed 
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        public synchronized void doStart() {
+            start();
+            while( !isRunning ) {
+                try {
+                    this.wait();  // wait until started
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        public synchronized void doStop() {
+            if( isRunning ) {
+                shallStop = true;
+                while( isRunning ) {
+                    this.notify();  // wake-up pause-block (opt)
+                    try {
+                        this.wait();  // wait until stopped
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        public boolean isRunning() { return isRunning; }
+        public boolean isActive() { return isActive; }
+        
+        public void run() {
+            setName(getName()+"-FramePusher_"+FramePusherInstanceId);
+            FramePusherInstanceId++;
+            
+            synchronized ( this ) {
+                if( null != sharedGLCtx ) {
+                    makeCurrent( sharedGLCtx );
+                }
+                isRunning = true;
+                this.notify();   // wake-up doStart()
+            }
+            
+            while( !shallStop ){
+                if( shallPause ) {
+                    synchronized ( this ) {
+                        while( shallPause && !shallStop ) {
+                            isActive = false;
+                            this.notify();   // wake-up doPause()
+                            try {
+                                this.wait(); // wait until resumed
+                            } catch (InterruptedException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                        isActive = true;
+                        this.notify(); // wake-up doResume()
+                    }
+                }
+                
+                if( !shallStop ) {
+                    TextureFrame nextFrame = null;
+                    boolean ok = false;
+                    try {
+                        nextFrame = videoFramesFree.getBlocking(true /* clearRef */ );
+                        if( getNextTextureImpl(gl, nextFrame, true) ) {
+                            gl.glFinish();
+                            videoFramesDecoded.putBlocking(nextFrame);
+                            newFrameAvailable(nextFrame);
+                            ok = true;
+                        }
+                    } catch (InterruptedException e) {
+                        if( !shallStop && !shallPause ) {
+                            e.printStackTrace(); // oops
+                            shallPause = false;
+                            shallStop = true;
+                        }
+                    } finally {
+                        if( !ok && null != nextFrame ) { // put back
+                            videoFramesFree.put(nextFrame);
+                        }
+                    }
+                }
+            }
+            destroySharedGL();
+            synchronized ( this ) {
+                isRunning = false;
+                isActive = false;
+                this.notify(); // wake-up doStop()
+            }
+        }
+    }    
+    static int FramePusherInstanceId = 0;    
+    private FramePusher framePusher = null;
 
+    private final void pauseFramePusher() {
+        if( null != framePusher ) {
+            framePusher.doPause();
+        }
+    }
+    private final void resumeFramePusher() {
+        if( null != framePusher ) {
+            framePusher.doResume();
+        }
+    }
+    private final void destroyFramePusher() {
+        if( null != framePusher ) {
+            framePusher.doStop();
+            framePusher = null;
+        }
+    }
+    
     protected final void updateAttributes(int width, int height, int bps_stream, int bps_video, int bps_audio, 
                                           float fps, int totalFrames, int duration, 
                                           String vcodec, String acodec) {
@@ -458,19 +734,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
         }
     }
-    protected final void newFrameAvailable() {
-        frameNumber++;        
-        synchronized(eventListenersLock) {
-            for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
-                i.next().newFrameAvailable(this, System.currentTimeMillis());
-            }
-        }
-    }
     
     @Override
     public final synchronized State destroy(GL gl) {
+        destroyFramePusher();
         destroyImpl(gl);
-        removeAllImageTextures(gl);
+        removeAllTextureFrames(gl);
         state = State.Uninitialized;
         return state;
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index cd48c3962..f1ce42257 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -49,66 +49,68 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  */
 public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     private TextureData texData = null;
-    private TextureSequence.TextureFrame frame = null;
     private int pos_ms = 0;
     private int pos_start = 0;
     
     public NullGLMediaPlayer() {
         super();
-        this.setTextureCount(1);
     }
 
     @Override
-    protected boolean setPlaySpeedImpl(float rate) {
+    protected final boolean setPlaySpeedImpl(float rate) {
         return false;
     }
 
     @Override
-    protected boolean startImpl() {
+    protected final boolean startImpl() {
         pos_start = (int)System.currentTimeMillis();
         return true;
     }
 
     @Override
-    protected boolean pauseImpl() {
+    protected final boolean pauseImpl() {
         return true;
     }
 
     @Override
-    protected boolean stopImpl() {
+    protected final boolean stopImpl() {
         return true;
     }
     
     @Override
-    protected int seekImpl(int msec) {
+    protected final int seekImpl(int msec) {
         pos_ms = msec;
         validatePos();
         return pos_ms;
     }
     
     @Override
-    protected TextureSequence.TextureFrame getLastTextureImpl() {
-        return frame;
+    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking) {
+        return true;
     }
-
     @Override
-    protected TextureSequence.TextureFrame getNextTextureImpl(GL gl, boolean blocking) {
-        return frame;
-    }
+    protected final void syncFrame2Audio(TextureFrame frame) { }
     
     @Override
-    protected int getCurrentPositionImpl() {
+    protected final int getCurrentPositionImpl() {
         pos_ms = (int)System.currentTimeMillis() - pos_start;
         validatePos();
         return pos_ms;
     }
+    @Override
+    protected final int getAudioPTSImpl() { return getCurrentPositionImpl(); }
+
 
     @Override
-    protected void destroyImpl(GL gl) {
+    protected final void destroyImpl(GL gl) {
+        if(null != texData) {
+            texData.destroy();
+            texData = null;
+        }                      
     }
-    
+        
     @Override
-    protected void initGLStreamImpl(GL gl, int[] texNames) throws IOException {
+    protected final void initGLStreamImpl(GL gl) throws IOException {
         try {
             URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-160x90.png", this.getClass().getClassLoader());
             if(null != urlConn) {
@@ -117,44 +119,44 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
         } catch (Exception e) {
             e.printStackTrace();
         }
+        final int _w, _h;
         if(null != texData) {
-            width = texData.getWidth();
-            height = texData.getHeight();            
+            _w = texData.getWidth();
+            _h = texData.getHeight();            
         } else {
-            width = 640;
-            height = 480;
-            ByteBuffer buffer = Buffers.newDirectByteBuffer(width*height*4);
+            _w = 640;
+            _h = 480;
+            ByteBuffer buffer = Buffers.newDirectByteBuffer(_w*_h*4);
             while(buffer.hasRemaining()) {
                 buffer.put((byte) 0xEA); buffer.put((byte) 0xEA); buffer.put((byte) 0xEA); buffer.put((byte) 0xEA);
             }
             buffer.rewind();
             texData = new TextureData(GLProfile.getGL2ES2(),
-                   GL.GL_RGBA, width, height, 0,
+                   GL.GL_RGBA, _w, _h, 0,
                    GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, false, 
                    false, false, buffer, null);
         }
-        fps = 24f;
-        duration = 10*60*1000; // msec
-        totalFrames = (int) ( (duration/1000)*fps );
-        vcodec = "png-static";
+        final float _fps = 24f;
+        final int _duration = 10*60*1000; // msec
+        final int _totalFrames = (int) ( (_duration/1000)*_fps );
+        updateAttributes(_w, _h, 
+                         0, 0, 0, 
+                         _fps, _totalFrames, _duration, 
+                         "png-static", null);
     }
     
     @Override
-    protected TextureSequence.TextureFrame createTexImage(GL gl, int idx, int[] tex) {
-        Texture texture = super.createTexImageImpl(gl, idx, tex, width, height, false);
+    protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+        final Texture texture = super.createTexImageImpl(gl, texName, width, height, false);
         if(null != texData) {
             texture.updateImage(gl, texData);
-            texData.destroy();
-            texData = null;
         }                      
-        frame = new TextureSequence.TextureFrame( texture );
-        return frame;
+        return new TextureSequence.TextureFrame( texture );
     }
     
     @Override
-    protected void destroyTexImage(GL gl, TextureSequence.TextureFrame imgTex) {
-        frame = null;
-        super.destroyTexImage(gl, imgTex);
+    protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
+        super.destroyTexFrame(gl, frame);
     }
     
     private void validatePos() {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/SyncedRingbuffer.java b/src/jogl/classes/jogamp/opengl/util/av/SyncedRingbuffer.java
index 5f5d69cf8..ea67387a0 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/SyncedRingbuffer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/SyncedRingbuffer.java
@@ -74,6 +74,8 @@ public class SyncedRingbuffer<T> {
         }
     }
     
+    public final T[] getArray() { return array; }
+    
     public final int capacity() {
         return capacity;
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index 852e5149c..3680da1a8 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -116,25 +116,32 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     
     private static long[] symbolAddr;
     private static final boolean ready;
+    private static final boolean libsLoaded;
     
     static {
         // native ffmpeg media player implementation is included in jogl_desktop and jogl_mobile     
         GLProfile.initSingleton();
         boolean _ready = false;
+        boolean[] _libsLoaded= { false };
         try {
-            _ready = initSymbols();
+            _ready = initSymbols(_libsLoaded);
         } catch (Throwable t) {
             t.printStackTrace();
         }
+        libsLoaded = _libsLoaded[0];
         ready = _ready;
-        if(!ready) {
-            System.err.println("FFMPEG: Not Available");
+        if(!libsLoaded) {
+            System.err.println("LIB_AV Not Available");
+        } else if(!ready) {
+            System.err.println("LIB_AV Not Matching");
         }
     }
     
+    static boolean libsLoaded() { return libsLoaded; }
     static boolean initSingleton() { return ready; }
     
-    private static final boolean initSymbols() {
+    private static final boolean initSymbols(boolean[] libsLoaded) {
+        libsLoaded[0] = false;
         final DynamicLibraryBundle dl = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() {
                                           public DynamicLibraryBundle run() {
                                               return new DynamicLibraryBundle(new FFMPEGDynamicLibraryBundleInfo());
@@ -148,6 +155,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         if(!dl.isToolLibComplete()) {
             throw new RuntimeException("FFMPEG Tool libraries incomplete");
         }
+        libsLoaded[0] = true;
         if(symbolNames.length != symbolCount) {
             throw new InternalError("XXX0 "+symbolNames.length+" != "+symbolCount);
         }
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 b6708b379..83a5960f1 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -44,11 +44,10 @@ import com.jogamp.opengl.util.GLPixelStorageModes;
 import com.jogamp.opengl.util.av.AudioSink;
 import com.jogamp.opengl.util.av.AudioSinkFactory;
 import com.jogamp.opengl.util.texture.Texture;
-import com.jogamp.opengl.util.texture.TextureSequence;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 import jogamp.opengl.GLContextImpl;
-import jogamp.opengl.util.av.EGLMediaPlayerImpl;
-import jogamp.opengl.util.av.SyncedRingbuffer;
+import jogamp.opengl.util.av.GLMediaPlayerImpl;
 
 /***
  * Implementation utilizes <a href="http://libav.org/">Libav</a>
@@ -102,7 +101,7 @@ import jogamp.opengl.util.av.SyncedRingbuffer;
  *       </pre></li>
  * </ul> 
  */
-public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
+public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
 
     // Count of zeroed buffers to return before switching to real sample provider
     private static final int TEMP_BUFFER_COUNT = 20;
@@ -114,21 +113,20 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     static final boolean available;
     
     static {
-        if(FFMPEGDynamicLibraryBundleInfo.initSingleton()) {
+        final boolean libAVGood = FFMPEGDynamicLibraryBundleInfo.initSingleton();
+        if( FFMPEGDynamicLibraryBundleInfo.libsLoaded() ) {
             avUtilVersion = getAVVersion(getAvUtilVersion0());
             avFormatVersion = getAVVersion(getAvFormatVersion0());
             avCodecVersion = getAVVersion(getAvCodecVersion0());        
             System.err.println("LIB_AV Util  : "+avUtilVersion);
             System.err.println("LIB_AV Format: "+avFormatVersion);
             System.err.println("LIB_AV Codec : "+avCodecVersion);
-            initIDs0();            
-            available = true;
         } else {
             avUtilVersion = null;
             avFormatVersion = null;
             avCodecVersion = null;
-            available = false;
         }
+        available = libAVGood ? initIDs0() : false;            
     }
     
     public static final boolean isAvailable() { return available; }
@@ -144,8 +142,6 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     //
     
     protected long moviePtr = 0;    
-    protected long procAddrGLTexSubImage2D = 0;
-    protected EGLMediaPlayerImpl.EGLTextureFrame lastTex = null;
     protected GLPixelStorageModes psm;
     protected PixelFormat vPixelFmt = null;
     protected int vPlanes = 0;
@@ -161,21 +157,15 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     // Audio
     //
     
-    protected static final boolean USE_AUDIO_PUSHER = false;
     protected final int AudioFrameCount = 8;        
     protected final AudioSink audioSink;    
     protected final int maxAvailableAudio;
     protected AudioSink.AudioDataFormat chosenAudioFormat;
-    protected final SyncedRingbuffer<AudioSink.AudioFrame> audioFramesBuffer = 
-            USE_AUDIO_PUSHER ? new SyncedRingbuffer<AudioSink.AudioFrame>(new AudioSink.AudioFrame[AudioFrameCount], false /* full */)
-                             : null;
     
     public FFMPEGMediaPlayer() {
-        super(TextureType.GL, false);
         if(!available) {
             throw new RuntimeException("FFMPEGMediaPlayer not available");
         }
-        setTextureCount(1);
         moviePtr = createInstance0(DEBUG);
         if(0==moviePtr) {
             throw new GLException("Couldn't create FFMPEGInstance");
@@ -184,26 +174,15 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
         audioSink = AudioSinkFactory.createDefault(); 
         maxAvailableAudio = audioSink.getQueuedByteCount();
     }
-    
     @Override
-    protected TextureSequence.TextureFrame createTexImage(GL gl, int idx, int[] tex) {
-        if(TextureType.GL == texType) {
-            final Texture texture = super.createTexImageImpl(gl, idx, tex, texWidth, texHeight, true);
-            lastTex = new EGLTextureFrame(null, texture, 0, 0);
-        } else {
-            throw new InternalError("n/a");
-        }
-        return lastTex;
+    protected final int validateTextureCount(int desiredTextureCount) {
+        return desiredTextureCount>1 ? desiredTextureCount : 2;
     }
-    
     @Override
-    protected void destroyTexImage(GL gl, TextureSequence.TextureFrame imgTex) {
-        lastTex = null;
-        super.destroyTexImage(gl, imgTex);        
-    }
-    
+    protected final boolean requiresOffthreadGLCtx() { return true; }
+
     @Override
-    protected void destroyImpl(GL gl) {
+    protected final void destroyImpl(GL gl) {
         if (moviePtr != 0) {
             destroyInstance0(moviePtr);
             moviePtr = 0;
@@ -211,15 +190,29 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     }
     
     @Override
-    protected void initGLStreamImpl(GL gl, int[] texNames) throws IOException {
+    protected final void initGLStreamImpl(GL gl) throws IOException {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
+        {
+            final GLContextImpl ctx = (GLContextImpl)gl.getContext();
+            final ProcAddressTable pt = ctx.getGLProcAddressTable();
+            final long procAddrGLTexSubImage2D = getAddressFor(pt, "glTexSubImage2D");
+            if( 0 == procAddrGLTexSubImage2D ) {
+                throw new InternalError("glTexSubImage2D n/a in ProcAddressTable: "+pt.getClass().getName()+" of "+ctx.getGLVersion());
+            }
+            final long procAddrGLGetError = getAddressFor(pt, "glGetError");
+            if( 0 == procAddrGLGetError ) {
+                throw new InternalError("glGetError n/a in ProcAddressTable: "+pt.getClass().getName()+" of "+ctx.getGLVersion());
+            }
+            setGLFuncs0(moviePtr, procAddrGLTexSubImage2D, procAddrGLGetError);
+        }
+        
         final String urlS=urlConn.getURL().toExternalForm();
     
         chosenAudioFormat = audioSink.initSink(audioSink.getPreferredFormat(), AudioFrameCount);
         System.err.println("setURL: p1 "+this);
-        setStream0(moviePtr, urlS, -1, -1, AudioFrameCount);
+        setStream0(moviePtr, urlS, -1, -1, AudioFrameCount); // issues updateAttributes*(..)
         System.err.println("setURL: p2 "+this);
         
         int tf, tif=GL.GL_RGBA; // texture format and internal format
@@ -239,12 +232,10 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
         }        
         setTextureFormat(tif, tf);
         setTextureType(GL.GL_UNSIGNED_BYTE);
-        final GLContextImpl ctx = (GLContextImpl)gl.getContext();
-        final ProcAddressTable pt = ctx.getGLProcAddressTable();
-        procAddrGLTexSubImage2D = getAddressFor(pt, "glTexSubImage2D");
-        if( 0 == procAddrGLTexSubImage2D ) {
-            throw new InternalError("glTexSubImage2D n/a in ProcAddressTable: "+pt.getClass().getName()+" of "+ctx.getGLVersion());
-        }
+    }
+    @Override
+    protected final TextureFrame createTexImage(GL gl, int texName) {
+        return new TextureFrame( createTexImageImpl(gl, texName, texWidth, texHeight, true) );
     }
     
     /**
@@ -263,107 +254,6 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
         } ).longValue();
     }
 
-    private final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
-        if( USE_AUDIO_PUSHER ) {
-            if( audioPusher != null && audioPusher.isRunning() ) {
-                try {
-                    audioFramesBuffer.putBlocking(new AudioSink.AudioFrame(sampleData, data_size, audio_pts));
-                } catch (InterruptedException e) {
-                    e.printStackTrace(); // oops
-                }
-            }
-        } else {
-            pushAudioFrame(new AudioSink.AudioFrame(sampleData, data_size, audio_pts));
-        }
-    }
-
-    private final void pushAudioFrame(AudioSink.AudioFrame audioFrame) {
-        // poor mans audio sync ..
-        final long now = System.currentTimeMillis();
-        final long now_d = now - lastAudioTime;
-        final long pts_d = audioFrame.audioPTS - lastAudioPTS;
-        final long dt = (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ;
-        final boolean sleep = dt > audio_dt_d;
-        final long sleepP = dt - ( audio_dt_d / 2 );
-        if(DEBUG) {
-            final int qAT = audioSink.getQueuedTime();
-            System.err.println("s: pts-a "+audioFrame.audioPTS+", qAT "+qAT+", pts-d "+pts_d+", now_d "+now_d+", dt "+dt+", sleep "+sleep+", sleepP "+sleepP+" ms");
-        }
-        if( sleep ) {
-            try {
-                Thread.sleep( sleepP );
-            } catch (InterruptedException e) {
-                e.printStackTrace(); // oops
-            }
-            lastAudioTime = System.currentTimeMillis();
-        } else {
-            lastAudioTime = now;
-        }
-        if( audioSink.isDataAvailable(audioFrame.dataSize) ) {
-            audioSink.writeData(audioFrame);
-            lastAudioPTS=audioFrame.audioPTS;
-        }
-    }
-    
-    class AudioPusher extends Thread {
-        volatile boolean shallStop = false;
-        volatile boolean isBlocked = false;
-        
-        AudioPusher() {
-            setDaemon(true);
-        }
-        public void requestStop() {
-            shallStop = true;
-            if( isBlocked ) {
-                interrupt();
-            }
-        }
-        public boolean isRunning() { return !shallStop; }
-        
-        public void run() {
-            setName(getName()+"-AudioPusher_"+AudioPusherInstanceId);
-            AudioPusherInstanceId++;
-            
-            while( !shallStop ){
-                final AudioSink.AudioFrame audioFrame;
-                try {
-                    isBlocked = true;
-                    audioFrame = audioFramesBuffer.getBlocking(true /* clearRef */);
-                } catch (InterruptedException e) {
-                    if( !shallStop ) {
-                        e.printStackTrace(); // oops
-                    }
-                    shallStop = true;
-                    return;
-                }
-                isBlocked = false;
-                
-                if( null != audioFrame ) {
-                    FFMPEGMediaPlayer.this.pushAudioFrame(audioFrame);
-                }
-            }
-        }
-    }    
-    static int AudioPusherInstanceId = 0;    
-    private AudioPusher audioPusher = null;
-    
-    private final void stopAudioPusher() {
-        if( USE_AUDIO_PUSHER ) {
-            if( null != audioPusher ) {
-                audioPusher.requestStop();
-                audioPusher = null;
-            }
-            audioFramesBuffer.clear(true);
-        }
-    }
-    private final void startAudioPusher() {
-        if( USE_AUDIO_PUSHER ) {
-            stopAudioPusher();
-            audioPusher = new AudioPusher();
-            audioPusher.start();
-        }
-    }
-
     private void updateAttributes2(int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
                                    int lSz0, int lSz1, int lSz2,
                                    int tWd0, int tWd1, int tWd2) {
@@ -413,7 +303,7 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
      * Otherwise the call is delegated to it's super class.
      */
     @Override
-    public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException {
+    public final String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException {
         if(State.Uninitialized == state) {
             throw new IllegalStateException("Instance not initialized: "+this);
         }
@@ -434,7 +324,7 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
      * e.g. YUV420P to RGB. Otherwise the call is delegated to it's super class.  
      */ 
     @Override
-    public String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
+    public final String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
       if(State.Uninitialized == state) {
           throw new IllegalStateException("Instance not initialized: "+this);
       }
@@ -465,134 +355,131 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     }
     
     @Override
-    protected synchronized int getCurrentPositionImpl() {
+    protected final synchronized int getCurrentPositionImpl() {
         return 0!=moviePtr ? getVideoPTS0(moviePtr) : 0;
     }
 
     @Override
-    protected synchronized boolean setPlaySpeedImpl(float rate) {
+    public final int getAudioPTSImpl() { return 0; }    
+    
+    @Override
+    protected final synchronized boolean setPlaySpeedImpl(float rate) {
         return true;
     }
 
     @Override
-    public synchronized boolean startImpl() {
+    public final synchronized boolean startImpl() {
         if(0==moviePtr) {
             return false;
         }
-        startAudioPusher();
         return true;
     }
 
     /** @return time position after issuing the command */
     @Override
-    public synchronized boolean pauseImpl() {
+    public final synchronized boolean pauseImpl() {
         if(0==moviePtr) {
             return false;
         }
-        stopAudioPusher();
         return true;
     }
 
     /** @return time position after issuing the command */
     @Override
-    public synchronized boolean stopImpl() {
+    public final synchronized boolean stopImpl() {
         if(0==moviePtr) {
             return false;
         }
-        stopAudioPusher();
         return true;
     }
 
     /** @return time position after issuing the command */
     @Override
-    protected synchronized int seekImpl(int msec) {
+    protected final synchronized int seekImpl(int msec) {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
-        stopAudioPusher();
         int pts0 = getVideoPTS0(moviePtr);
         int pts1 = seek0(moviePtr, msec);
         System.err.println("Seek: "+pts0+" -> "+msec+" : "+pts1);
-        lastAudioPTS=pts1;
-        lastVideoPTS=pts1;
-        startAudioPusher();
         return pts1;
     }
 
     @Override
-    protected TextureSequence.TextureFrame getLastTextureImpl() {
-        return lastTex;
+    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking) {
+        if(0==moviePtr) {
+            throw new GLException("FFMPEG native instance null");
+        }                
+        psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
+        int avPTS = 0;
+        try {
+            final Texture tex = nextFrame.getTexture();
+            gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
+            tex.enable(gl);
+            tex.bind(gl);
+
+            /** Try decode up to 10 packets to find one containing video, i.e. vPTS > 0 */
+            for(int retry=10; 0 >= avPTS && 0 < retry; retry--) {
+               avPTS = readNextPacket0(moviePtr, textureTarget, textureFormat, textureType);
+               retry--;
+            }
+        } finally {
+            psm.restore(gl);
+        }
+        if( 0 < avPTS ) {
+            vSTS = avPTS;
+            nextFrame.setPTS(avPTS);
+            return true;
+        } else {
+            return false;
+        }
     }
     
+    private final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
+        aSTS = audio_pts;
+        final AudioSink.AudioFrame frame = new AudioSink.AudioFrame(sampleData, data_size, audio_pts);
+        if( audioSink.isDataAvailable(frame.dataSize) ) {
+            audioSink.writeData(frame);
+        }
+    }
+    
+    /** last audio streaming TS */
+    private int aSTS = 0;
+    /** last video streaming TS */
+    private int vSTS = 0;
+    
     private long lastAudioTime = 0;
-    private int lastAudioPTS = 0;
     private static final int audio_dt_d = 400;
     private long lastVideoTime = 0;
-    private int lastVideoPTS = 0;
     private static final int video_dt_d = 9;
     
     @Override
-    protected TextureSequence.TextureFrame getNextTextureImpl(GL gl, boolean blocking) {
-        if(0==moviePtr) {
-            throw new GLException("FFMPEG native instance null");
-        }                
-        if(null != lastTex) {
-            psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
-            try {
-                final Texture tex = lastTex.getTexture();
-                gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
-                tex.enable(gl);
-                tex.bind(gl);
-
-                if( USE_AUDIO_PUSHER ) {
-                    try {
-                        audioFramesBuffer.waitForFreeSlots(2);
-                    } catch (InterruptedException e) {
-                        e.printStackTrace(); // oops
-                    }
-                }
-
-                /* try decode 10 packets to find one containing video
-                   (res == 2) */
-                int res = 0;
-                int retry = 10; 
-                while(res!=2 && retry >= 0) { 
-                   res = readNextPacket0(moviePtr, procAddrGLTexSubImage2D, textureTarget, textureFormat, textureType);
-                   retry--;
-                }
-            } finally {
-                psm.restore(gl);
-            }
-            final int pts = getVideoPTS0(moviePtr); // this frame
-            if(blocking) {
-                // poor mans video sync .. TODO: off thread 'readNextPackage0(..)' on shared GLContext and multi textures/unit!
-                final long now = System.currentTimeMillis();
-                // Try sync video to audio
-                final long now_d = now - lastAudioTime;
-                final long pts_d = pts - lastAudioPTS - 444; /* hack 444 == play video 444ms ahead of audio */
-                final long dt = Math.min(47, (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ) ;
-                //final long dt = (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ;
-                final boolean sleep = dt>video_dt_d && dt<1000 && audioSink.getQueuedByteCount()<maxAvailableAudio-10000;
-                final long sleepP = dt-video_dt_d;
-                if(DEBUG) {
-                    final int qAT = audioSink.getQueuedTime();
-                    System.err.println("s: pts-v "+pts+", qAT "+qAT+", pts-d "+pts_d+", now_d "+now_d+", dt "+dt+", sleep "+sleep+", sleepP "+sleepP+" ms");
-                }
-                // ?? Maybe use audioSink.getQueuedTime();
-                if( sleep ) {
-                    try {
-                        Thread.sleep(sleepP);
-                    } catch (InterruptedException e) { }
-                    lastVideoTime = System.currentTimeMillis();
-                } else { 
-                    lastVideoTime = now;
-                }
-            }
-            lastVideoPTS = pts;
+    protected final void syncFrame2Audio(TextureFrame frame) {
+        /** 
+        // poor mans video sync .. TODO: off thread 'readNextPackage0(..)' on shared GLContext and multi textures/unit!
+        final long now = System.currentTimeMillis();
+        // Try sync video to audio
+        final long now_d = now - lastAudioTime;
+        final long pts_d = vSTS - aSTS - 444; // hack 444 == play video 444ms ahead of audio
+        final long dt = Math.min(47, (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ) ;
+        //final long dt = (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ;
+        final boolean sleep = dt>video_dt_d && dt<1000 && audioSink.getQueuedByteCount()<maxAvailableAudio-10000;
+        final long sleepP = dt-video_dt_d;
+        if(DEBUG) {
+            final int qAT = audioSink.getQueuedTime();
+            System.err.println("s: pts-v "+vSTS+", qAT "+qAT+", pts-d "+pts_d+", now_d "+now_d+", dt "+dt+", sleep "+sleep+", sleepP "+sleepP+" ms");
         }
-        return lastTex;
+        // ?? Maybe use audioSink.getQueuedTime();
+        if( sleep ) {
+            try {
+                Thread.sleep(sleepP);
+            } catch (InterruptedException e) { }
+            lastVideoTime = System.currentTimeMillis();
+        } else { 
+            lastVideoTime = now;
+        }   
+        */
     }
-    
     private static native int getAvUtilVersion0();
     private static native int getAvFormatVersion0();
     private static native int getAvCodecVersion0();
@@ -600,14 +487,22 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
     private native long createInstance0(boolean verbose);    
     private native void destroyInstance0(long moviePtr);
     
+    /**
+     * Issues {@link #updateAttributes(int, int, int, int, int, float, int, int, String, String)}
+     * and {@link #updateAttributes2(int, int, int, int, int, int, int, int, int, int)}.
+     */
     private native void setStream0(long moviePtr, String url, int vid, int aid, int audioFrameCount);
+    private native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError);
 
     private native int getVideoPTS0(long moviePtr);    
     
     private native int getAudioPTS0(long moviePtr);
     private native Buffer getAudioBuffer0(long moviePtr, int plane);
     
-    private native int readNextPacket0(long moviePtr, long procAddrGLTexSubImage2D, int texTarget, int texFmt, int texType);
+    /**
+     * @return resulting current PTS: audio < 0, video > 0, invalid == 0
+     */
+    private native int readNextPacket0(long moviePtr, int texTarget, int texFmt, int texType);
     
     private native int seek0(long moviePtr, int position);
 
@@ -720,6 +615,5 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
             return null;            
         }
     }
-
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index aef98fcde..a21bb40a8 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -33,7 +33,6 @@ import java.net.URL;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
 
 import com.jogamp.opengl.util.texture.TextureSequence;
 
@@ -49,17 +48,17 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     static final boolean available;
     
     static {
+        available = false;
+        /** FIXME!
         // OMX binding is included in jogl_desktop and jogl_mobile     
         GLProfile.initSingleton();
-        available = initIDs0();
+        available = initIDs0(); */
     }
     
     public static final boolean isAvailable() { return available; }
     
     protected long moviePtr = 0;
     
-    protected TextureSequence.TextureFrame lastTex = null;
-
     public OMXGLMediaPlayer() {
         super(TextureType.KHRImage, true);
         if(!available) {
@@ -76,17 +75,15 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
     
     @Override
-    protected TextureSequence.TextureFrame createTexImage(GL gl, int idx, int[] tex) {
-        final EGLTextureFrame eglTex = (EGLTextureFrame) super.createTexImage(gl, idx, tex);
-        _setStreamEGLImageTexture2D(moviePtr, idx, tex[idx], eglTex.getImage(), eglTex.getSync());
-        lastTex = eglTex;
+    protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+        final EGLTextureFrame eglTex = (EGLTextureFrame) super.createTexImage(gl, texName);
+        _setStreamEGLImageTexture2D(moviePtr, texName, eglTex.getImage(), eglTex.getSync());
         return eglTex;
     }
     
     @Override
-    protected void destroyTexImage(GL gl, TextureSequence.TextureFrame imgTex) {
-        lastTex = null;
-        super.destroyTexImage(gl, imgTex);        
+    protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame imgTex) {
+        super.destroyTexFrame(gl, imgTex);        
     }
     
     @Override
@@ -99,7 +96,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
     
     @Override
-    protected void initGLStreamImpl(GL gl, int[] texNames) throws IOException {
+    protected void initGLStreamImpl(GL gl) throws IOException {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
@@ -119,6 +116,10 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     protected int getCurrentPositionImpl() {
         return 0!=moviePtr ? _getCurrentPosition(moviePtr) : 0;
     }
+    @Override
+    protected int getAudioPTSImpl() {
+        return getCurrentPositionImpl();
+    }
 
     @Override
     protected boolean setPlaySpeedImpl(float rate) {
@@ -168,24 +169,23 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     @Override
-    protected TextureSequence.TextureFrame getLastTextureImpl() {
-        return lastTex;
-    }
-    
-    @Override
-    protected TextureSequence.TextureFrame getNextTextureImpl(GL gl, boolean blocking) {
+    protected boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking) {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
         final int nextTex = _getNextTextureID(moviePtr, blocking);
         if(0 < nextTex) {
-            final TextureSequence.TextureFrame eglImgTex = texFrameMap.get(new Integer(_getNextTextureID(moviePtr, blocking)));
+            /* FIXME 
+            final TextureSequence.TextureFrame eglImgTex = 
+                    texFrameMap.get(new Integer(_getNextTextureID(moviePtr, blocking)));
             if(null!=eglImgTex) {
                 lastTex = eglImgTex;
-            }
+            } */
         }
-        return lastTex;
+        return true;
     }
+    @Override
+    protected void syncFrame2Audio(TextureFrame frame) { }
     
     private String replaceAll(String orig, String search, String repl) {
         String dest=null;
@@ -216,7 +216,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     private native void _setStream(long moviePtr, int textureNum, String path);
     private native void _activateStream(long moviePtr);
     
-    private native void _setStreamEGLImageTexture2D(long moviePtr, int i, int tex, long image, long sync);
+    private native void _setStreamEGLImageTexture2D(long moviePtr, int tex, long image, long sync);
     private native int  _seek(long moviePtr, int position);
     private native void _setPlaySpeed(long moviePtr, float rate);
     private native void _play(long moviePtr);
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index 5560b8617..2dff1110c 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -48,6 +48,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <GL/gl.h>
+
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+typedef GLenum (APIENTRYP PFNGLGETERRORPROC) (void);
+
 /**
  *  AV_TIME_BASE   1000000
  */
@@ -63,6 +68,9 @@ static inline int32_t my_av_q2i32(int32_t snum, AVRational a){
 typedef struct {
     int32_t          verbose;
 
+    PFNGLTEXSUBIMAGE2DPROC procAddrGLTexSubImage2D;
+    PFNGLGETERRORPROC procAddrGLGetError;
+
     AVFormatContext* pFormatCtx;
     int32_t          vid;
     AVStream*        pVStream;
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
index 623bdcac7..346ba6c07 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
+++ b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
@@ -33,8 +33,6 @@
 #include <libavutil/pixdesc.h>
 #include <GL/gl.h>
 
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-
 static const char * const ClazzNameFFMPEGMediaPlayer = "jogamp/opengl/util/av/impl/FFMPEGMediaPlayer";
 
 static jclass ffmpegMediaPlayerClazz = NULL;
@@ -583,22 +581,29 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
     _updateJavaAttributes(env, instance, pAV);
 }
 
+JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setGLFuncs0
+  (JNIEnv *env, jobject instance, jlong ptr, jlong jProcAddrGLTexSubImage2D, jlong jProcAddrGLGetError)
+{
+    FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
+    pAV->procAddrGLTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) (intptr_t)jProcAddrGLTexSubImage2D;
+    pAV->procAddrGLGetError = (PFNGLGETERRORPROC) (intptr_t)jProcAddrGLGetError;
+}
+
 JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNextPacket0
-  (JNIEnv *env, jobject instance, jlong ptr, jlong jProcAddrGLTexSubImage2D, jint texTarget, jint texFmt, jint texType)
+  (JNIEnv *env, jobject instance, jlong ptr, jint texTarget, jint texFmt, jint texType)
 {
     FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
-    PFNGLTEXSUBIMAGE2DPROC procAddrGLTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) (intptr_t)jProcAddrGLTexSubImage2D;
 
-    jint res = 0; // 1 - audio, 2 - video
     AVPacket packet;
     int frameFinished;
+    jint resPTS = 0; // resulting current PTS: audio < 0, video > 0, invalid == 0
 
     if(sp_av_read_frame(pAV->pFormatCtx, &packet)>=0) {
         if(packet.stream_index==pAV->aid) {
             // Decode audio frame
             if(NULL == pAV->pAFrames) { // no audio registered
                 sp_av_free_packet(&packet);
-                return res;
+                return 0;
             }
             AVFrame* pAFrameCurrent = pAV->pAFrames[pAV->aFrameCurrent];
             pAV->aFrameCurrent = ( pAV->aFrameCurrent + 1 ) % pAV->aFrameCount ;
@@ -658,14 +663,13 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                     jobject jSampleData = (*env)->NewDirectByteBuffer(env, pAFrameCurrent->data[0], data_size);
                     (*env)->CallVoidMethod(env, instance, jni_mid_pushSound, jSampleData, data_size, pAV->aPTS);
                 }
-
-                res = 1;
+                resPTS = pAV->aPTS * -1; // Audio Frame!
             }
         } else if(packet.stream_index==pAV->vid) {
             // Decode video frame
             if(NULL == pAV->pVFrame) {
                 sp_av_free_packet(&packet);
-                return res;
+                return 0;
             }
 
             int new_packet = 1;
@@ -696,7 +700,6 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                     continue;
                 }
 
-                res = 2;
                 // FIXME: Libav Binary compatibility! JAU01
                 const AVRational time_base = pAV->pVStream->time_base;
                 const int64_t pts = pAV->pVFrame->pkt_pts;
@@ -708,6 +711,7 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                         pAV->vPTS, pAV->pVFrame->pkt_pts, time_base.num, time_base.den, (time_base.num/(double)time_base.den));
                     #endif
                 }
+                resPTS = pAV->vPTS; // Video Frame!
 
                 #if 0
                 printf("tex2D codec %dx%d - frame %dx%d - width %d tex / %d linesize, pixfmt 0x%X, texType 0x%x, texTarget 0x%x\n", 
@@ -718,24 +722,51 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
 
                 // 1st plane or complete packed frame
                 // FIXME: Libav Binary compatibility! JAU01
-                procAddrGLTexSubImage2D(texTarget, 0, 
+                #if 0
+                GLenum glerr = pAV->procAddrGLGetError();
+                printf("TexSubImage2D.1 texTarget 0x%x, offset %d / %d, size %d x %d, fmt 0x%X, type 0x%X, pre-err 0x%X, ", 
+                         texTarget, 0, 0, pAV->vTexWidth[0], pAV->pVCodecCtx->height, texFmt, texType, glerr);
+                #endif
+                pAV->procAddrGLTexSubImage2D(texTarget, 0, 
                                         0,                 0, 
                                         pAV->vTexWidth[0], pAV->pVCodecCtx->height, 
                                         texFmt, texType, pAV->pVFrame->data[0]);
+                #if 0
+                glerr = pAV->procAddrGLGetError();
+                printf("err 0x%X\n", glerr);
+                #endif
 
                 if(pAV->vPixFmt == PIX_FMT_YUV420P) {
                     // U plane
                     // FIXME: Libav Binary compatibility! JAU01
-                    procAddrGLTexSubImage2D(texTarget, 0, 
+                    #if 0
+                    printf("TexSubImage2D.U texTarget 0x%x, offset %d / %d, size %d x %d, fmt 0x%X, type 0x%X, ", 
+                             texTarget, pAV->pVCodecCtx->width, 0, pAV->vTexWidth[1], pAV->pVCodecCtx->height/2,
+                             texFmt, texType);
+                    #endif
+                    pAV->procAddrGLTexSubImage2D(texTarget, 0, 
                                             pAV->pVCodecCtx->width, 0,
                                             pAV->vTexWidth[1],      pAV->pVCodecCtx->height/2, 
                                             texFmt, texType, pAV->pVFrame->data[1]);
+                    #if 0
+                    glerr = pAV->procAddrGLGetError();
+                    printf("err 0x%X\n", glerr);
+                    #endif
                     // V plane
                     // FIXME: Libav Binary compatibility! JAU01
-                    procAddrGLTexSubImage2D(texTarget, 0, 
+                    #if 0
+                    printf("TexSubImage2D.V texTarget 0x%x, offset %d / %d, size %d x %d, fmt 0x%X, type 0x%X, ", 
+                             texTarget, pAV->pVCodecCtx->width, pAV->pVCodecCtx->height/2, pAV->vTexWidth[2], pAV->pVCodecCtx->height/2,
+                             texFmt, texType);
+                    #endif
+                    pAV->procAddrGLTexSubImage2D(texTarget, 0, 
                                             pAV->pVCodecCtx->width, pAV->pVCodecCtx->height/2,
                                             pAV->vTexWidth[2],      pAV->pVCodecCtx->height/2, 
                                             texFmt, texType, pAV->pVFrame->data[2]);
+                    #if 0
+                    glerr = pAV->procAddrGLGetError();
+                    printf("err 0x%X\n", glerr);
+                    #endif
                 } // FIXME: Add more planar formats !
             }
         }
@@ -745,7 +776,7 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
         // TODO: check what release the packets memory. 
         // sp_av_free_packet(&packet);
     }
-    return res;
+    return resPTS;
 }
 
 JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_seek0
diff --git a/src/jogl/native/openmax/omx_tool.c b/src/jogl/native/openmax/omx_tool.c
index 16c43f6a8..26a3b93f1 100644
--- a/src/jogl/native/openmax/omx_tool.c
+++ b/src/jogl/native/openmax/omx_tool.c
@@ -1049,17 +1049,13 @@ void OMXToolBasicAV_SetStream(OMXToolBasicAV_t * pOMXAV, int vBufferNum, const K
     DBG_PRINT( "SetStream X\n");
 }
 
-void OMXToolBasicAV_SetStreamEGLImageTexture2D(OMXToolBasicAV_t * pOMXAV, KDint i, GLuint tex, EGLImageKHR image, EGLSyncKHR sync)
+void OMXToolBasicAV_SetStreamEGLImageTexture2D(OMXToolBasicAV_t * pOMXAV, GLuint tex, EGLImageKHR image, EGLSyncKHR sync)
 {
     if(NULL==pOMXAV) {
         JoglCommon_throwNewRuntimeException(0, "OMX instance null\n");
         return;
     }
-    DBG_PRINT( "SetStreamEGLImg %p #%d/%d t:%d i:%p s:%p..\n", pOMXAV, i, pOMXAV->vBufferNum, tex, image, sync);
-    if(i<0||i>=pOMXAV->vBufferNum) {
-        JoglCommon_throwNewRuntimeException(0, "Buffer index out of range: %d\n", i);
-        return;
-    }
+    DBG_PRINT( "SetStreamEGLImg %p count %d t:%d i:%p s:%p..\n", pOMXAV, pOMXAV->vBufferNum, tex, image, sync);
 
     kdThreadMutexLock(pOMXAV->mutex);
     {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
index 20c28c3ea..adccecba0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
@@ -136,7 +136,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
             }
         }        
         public void mouseWheelMoved(MouseEvent e) {
-            System.err.println("XXX "+e);
+            // System.err.println("XXX "+e);
             if( !e.isShiftDown() ) {
                 final float o = zoom;
                 final float d = e.getRotation()[1]/10f; // vertical: wheel
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index 921710fed..3f979e16f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -61,9 +61,11 @@ import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
 import com.jogamp.opengl.util.av.GLMediaPlayerFactory;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 public class MovieCube implements GLEventListener, GLMediaEventListener {
     static boolean waitForKey = false;
+    int textureCount = 3; // default - threaded
     final URLConnection stream;
     final float zoom0, rotx, roty;
     TextureSequenceCubeES2 cube=null;
@@ -81,6 +83,10 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         this.roty = roty;
     }
 
+    public void setTextureCount(int v) {
+        textureCount = v;
+    }
+    
     private final KeyListener keyAction = new KeyAdapter() {
         public void keyReleased(KeyEvent e)  {
             if( !e.isPrintableKey() || e.isAutoRepeat() ) {
@@ -130,7 +136,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
     }
 
     @Override
-    public void newFrameAvailable(GLMediaPlayer mp, long when) {
+    public void newFrameAvailable(GLMediaPlayer mp, TextureFrame newFrame, long when) {
         // System.out.println("newFrameAvailable: "+mp+", when "+when);
     }
 
@@ -151,7 +157,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         }
         try {
             System.out.println("p0 "+mPlayer);
-            mPlayer.initGLStream(gl, stream);
+            mPlayer.initGLStream(gl, textureCount, stream);
             System.out.println("p1 "+mPlayer);
         } catch (Exception e) { 
             e.printStackTrace(); 
@@ -202,7 +208,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
     public static void main(String[] args) throws MalformedURLException, IOException, InterruptedException {
         int width = 510;
         int height = 300;
-        System.err.println("TexCubeES2.run()");
+        int textureCount = 3; // default - threaded
 
         boolean forceES2 = false;
         boolean forceES3 = false;
@@ -217,6 +223,9 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
             } else if(args[i].equals("-height")) {
                 i++;
                 height = MiscUtils.atoi(args[i], height);
+            } else if(args[i].equals("-textureCount")) {
+                i++;
+                textureCount = MiscUtils.atoi(args[i], textureCount);
             } else if(args[i].equals("-url")) {
                 i++;
                 url_s = args[i];
@@ -232,6 +241,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
                 waitForKey = true;
             }
         }
+        System.err.println("textureCount "+textureCount);
         System.err.println("forceES2   "+forceES2);
         System.err.println("forceES3   "+forceES3);
         System.err.println("forceGL3   "+forceGL3);
@@ -264,7 +274,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
                 anim.stop();
             }                
         });
-        // anim.setUpdateFPSFrames(60, System.err);
+        anim.setUpdateFPSFrames(60, System.err);
         anim.start();
         window.setVisible(true);
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 7e0dcd909..90c73661a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -66,9 +66,11 @@ import com.jogamp.opengl.util.glsl.ShaderState;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureCoords;
 import com.jogamp.opengl.util.texture.TextureSequence;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 public class MovieSimple implements GLEventListener, GLMediaEventListener {
     private int winWidth, winHeight;
+    int textureCount = 3; // default - threaded
     private int prevMouseX; // , prevMouseY;
     private int rotate = 0;
     private boolean  orthoProjection = true;
@@ -169,6 +171,9 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
     
     public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
     
+    public void setTextureCount(int v) {
+        textureCount = v;
+    }
     public void setScaleOrig(boolean v) {
         mPlayerScaleOrig = v;
     }
@@ -179,7 +184,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
     }
 
     @Override
-    public void newFrameAvailable(GLMediaPlayer mp, long when) {
+    public void newFrameAvailable(GLMediaPlayer mp, TextureFrame newFrame, long when) {
         // System.out.println("newFrameAvailable: "+mp+", when "+when);        
     }
 
@@ -252,7 +257,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         try {
             System.out.println("p0 "+mPlayer+", shared "+mPlayerShared);
             if(!mPlayerShared) {
-                mPlayer.initGLStream(gl, stream);
+                mPlayer.initGLStream(gl, textureCount, stream);
             }
             tex = mPlayer.getLastTexture().getTexture();
             System.out.println("p1 "+mPlayer+", shared "+mPlayerShared);
@@ -263,7 +268,8 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             if(!mPlayerShared) {
                 mPlayer.setTextureMinMagFilter( new int[] { GL.GL_NEAREST, GL.GL_LINEAR } );
             }
-        } catch (Exception glex) { 
+        } catch (Exception glex) {
+            glex.printStackTrace();
             if(!mPlayerShared && null != mPlayer) {
                 mPlayer.destroy(gl);
                 mPlayer = null;
@@ -506,6 +512,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
     public static void main(String[] args) throws IOException, MalformedURLException {
         int width = 640;
         int height = 600;
+        int textureCount = 3; // default - threaded
         boolean ortho = true;
         boolean zoom = false;
         
@@ -522,6 +529,9 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             } else if(args[i].equals("-height")) {
                 i++;
                 height = MiscUtils.atoi(args[i], height);
+            } else if(args[i].equals("-textureCount")) {
+                i++;
+                textureCount = MiscUtils.atoi(args[i], textureCount);
             } else if(args[i].equals("-es2")) {
                 forceES2 = true;
             } else if(args[i].equals("-es3")) {
@@ -539,12 +549,14 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
                 url_s = args[i];
             }
         }
+        System.err.println("textureCount "+textureCount);
         System.err.println("forceES2   "+forceES2);
         System.err.println("forceES3   "+forceES3);
         System.err.println("forceGL3   "+forceGL3);
         System.err.println("forceGLDef "+forceGLDef);
         
         final MovieSimple ms = new MovieSimple(new URL(url_s).openConnection());
+        ms.setTextureCount(textureCount);
         ms.setScaleOrig(!zoom);
         ms.setOrthoProjection(ortho);
         
@@ -570,6 +582,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             window.setSize(width, height);
             window.setVisible(true);
             final Animator anim = new Animator(window);
+            anim.setUpdateFPSFrames(60, System.err);
             anim.start();
             window.addWindowListener(new WindowAdapter() {
                 public void windowDestroyed(WindowEvent e) {
-- 
cgit v1.2.3


From c37629ea8fdcb11f7f8a18e37a4cde57d4ba6a01 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Wed, 14 Aug 2013 07:02:59 +0200
Subject: GLMediaPlayer Multithreaded Decoding: GLMediaPlayer* (Part-3) - WIP

- GLMediaPlayer
  - Remove State.Stopped and method stop() - redundant, use pause() / destroy()
  - Add notion of stream IDs
  - Add API doc: State / Stream-ID incl. html-anchor
  - Expose video/audio PTS, ..
  - Expose optional AudioSink
  - Min multithreaded textureCount is 4 (EGL* and FFMPEG*)

- GLMediaPlayerImpl
  - Move AudioSink rel. impl. to this class,
    allowing a tight video implementation reusing logic.

  - Remove 'synchronized' methods, synchronize on State
    where applicable

  - implement new methods (see above)

  - playSpeed is handled partially in AudioSink.
    If it exeeds AudioSink's capabilities, drop audio and rely solely on video sync.

  - video sync (WIP)
    - video pts delay based on geometric weight
    - reset video SCR if 'out of range', resync w/ PTS
    -

  - FramePusher
    - allow interruption when pausing/stopping,
      while waiting for next avail free frame to decode.

- FFMPEGMediaPlayer
  - Add proper AudioDataFormat negotiation AudioSink <-> libav
  - Parse libav's SampleFormat
  - Remove AudioSink interaction (moved to GLMediaPlayerImpl)

- Tests (MovieSimple, MovieCube):
  - Add aid/vid selection
  - Add KeyListener for actions: seek(..), play()/pause(), setPlaySpeed(..)
  - Dump perf-string each 2s

- TODO:
  - Add audio sync in AudioSink, similar to GLMediaPlayer's weighted video delay,
    here: drop audio frames.
---
 make/scripts/tests.sh                              |   6 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   | 146 ++--
 .../opengl/util/av/GLMediaPlayerFactory.java       |   5 +-
 .../opengl/util/texture/TextureSequence.java       |   5 +-
 .../android/av/AndroidGLMediaPlayerAPI14.java      |  53 +-
 .../jogamp/opengl/util/av/EGLMediaPlayerImpl.java  |   2 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 740 +++++++++++++++------
 .../jogamp/opengl/util/av/NullGLMediaPlayer.java   |  27 +-
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     | 232 ++++---
 .../opengl/util/av/impl/OMXGLMediaPlayer.java      |  25 +-
 src/jogl/native/libav/ffmpeg_tool.h                |  19 +-
 .../jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c | 223 ++++---
 .../opengl/test/android/MovieCubeActivity0.java    |   3 +-
 .../opengl/test/android/MovieSimpleActivity0.java  |   3 +-
 .../opengl/test/android/MovieSimpleActivity1.java  |   4 +-
 .../jogl/demos/es2/TextureSequenceCubeES2.java     |  23 +-
 .../test/junit/jogl/demos/es2/av/MovieCube.java    | 157 +++--
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  | 228 +++++--
 18 files changed, 1283 insertions(+), 618 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index ba4589d14..82e9fb92b 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -131,7 +131,9 @@ function jrun() {
     #D_ARGS="-Djogl.1thread=true -Djogl.debug.Threading"
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
+    #D_ARGS="-Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.GLArrayData"
     #D_ARGS="-Djogl.debug.GLDrawable"
     #D_ARGS="-Djogl.debug.EGLDisplayUtil -Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.GLDrawable"
@@ -314,8 +316,8 @@ function testawtswt() {
 # 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.MovieSimple $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
 
 #
 # core/newt (testnoawt and testawt)
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index a36bce305..fae88ea18 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -34,19 +34,37 @@ import javax.media.opengl.GL;
 import javax.media.opengl.GLException;
 
 import jogamp.opengl.Debug;
+import jogamp.opengl.util.av.GLMediaPlayerImpl;
 
 import com.jogamp.opengl.util.texture.TextureSequence;
 
 /**
- * Lifecycle of an GLMediaPlayer:
+ * GLMediaPlayer interface specifies a {@link TextureSequence}
+ * with a video stream as it's source.
+ * <p>
+ * Audio maybe supported and played back internally or via an {@link AudioSink} implementation,
+ * if an audio stream is selected in {@link #initGLStream(GL, int, URLConnection, int, int)}.
+ * </p>  
+ * <a name="lifecycle"><h5>GLMediaPlayer Lifecycle</h5></a>
+ * <p>
+ * <table border="1">
+ *   <tr><th>action</th>                                                  <th>state before</th>        <th>state after</th></tr>
+ *   <tr><td>{@link #initGLStream(GL, int, URLConnection, int, int)}</td> <td>Uninitialized</td>       <td>Paused</td></tr>
+ *   <tr><td>{@link #play()}</td>                                         <td>Paused</td>              <td>Playing</td></tr>
+ *   <tr><td>{@link #pause()}</td>                                        <td>Playing</td>             <td>Paused</td></tr>
+ *   <tr><td>{@link #seek(int)}</td>                                      <td>Playing, Paused</td>     <td>Unchanged</td></tr>
+ *   <tr><td>{@link #destroy(GL)}</td>                                    <td>ANY</td>                 <td>Uninitialized</td></tr>
+ * </table>
+ * </p>
+ * <a name="streamIDs"><h5>Audio and video Stream IDs</h5></a>
+ * <p>
  * <table border="1">
- *   <tr><th>action</th>                                        <th>state before</th>        <th>state after</th></tr>
- *   <tr><td>{@link #initGLStream(GL, int, URLConnection)}</td> <td>Uninitialized</td>       <td>Stopped</td></tr>
- *   <tr><td>{@link #start()}</td>                              <td>Stopped, Paused</td>     <td>Playing</td></tr>
- *   <tr><td>{@link #stop()}</td>                               <td>Playing, Paused</td>     <td>Stopped</td></tr>
- *   <tr><td>{@link #pause()}</td>                              <td>Playing</td>             <td>Paused</td></tr>
- *   <tr><td>{@link #destroy(GL)}</td>                          <td>ANY</td>                 <td>Uninitialized</td></tr>
+ *   <tr><th>value</th>                    <th>request</th>             <th>get</th></tr>
+ *   <tr><td>{@link #STREAM_ID_NONE}</td>  <td>mute</td>                <td>not available</td></tr>
+ *   <tr><td>{@link #STREAM_ID_AUTO}</td>  <td>auto</td>                <td>unspecified</td></tr>
+ *   <tr><td>&ge;0</td>                    <td>specific stream</td>     <td>specific stream</td></tr>
  * </table>
+ * </p>
  * <p>
  * Current implementations (check each API doc link for details):
  * <ul>
@@ -76,14 +94,21 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  */
 public interface GLMediaPlayer extends TextureSequence {
     public static final boolean DEBUG = Debug.debug("GLMediaPlayer");
+    
+    /** Constant {@value} for <i>mute</i> or <i>not available</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
+    public static final int STREAM_ID_NONE = -2;
+    /** Constant {@value} for <i>auto</i> or <i>unspecified</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
+    public static final int STREAM_ID_AUTO = -1;
         
     public interface GLMediaEventListener extends TexSeqEventListener<GLMediaPlayer> {
     
-        static final int EVENT_CHANGE_SIZE   = 1<<0;
-        static final int EVENT_CHANGE_FPS    = 1<<1;
-        static final int EVENT_CHANGE_BPS    = 1<<2;
-        static final int EVENT_CHANGE_LENGTH = 1<<3;
-        static final int EVENT_CHANGE_CODEC  = 1<<3;
+        static final int EVENT_CHANGE_VID    = 1<<0;
+        static final int EVENT_CHANGE_AID    = 1<<1;
+        static final int EVENT_CHANGE_SIZE   = 1<<2;
+        static final int EVENT_CHANGE_FPS    = 1<<3;
+        static final int EVENT_CHANGE_BPS    = 1<<4;
+        static final int EVENT_CHANGE_LENGTH = 1<<5;
+        static final int EVENT_CHANGE_CODEC  = 1<<6;
     
         /**
          * @param mp the event source 
@@ -93,8 +118,11 @@ public interface GLMediaPlayer extends TextureSequence {
         public void attributesChanges(GLMediaPlayer mp, int event_mask, long when);    
     }
     
+    /**
+     * See <a href="#lifecycle">GLMediaPlayer Lifecycle</a>.
+     */
     public enum State {
-        Uninitialized(0), Stopped(1), Playing(2), Paused(3); 
+        Uninitialized(0), Playing(1), Paused(2);
         
         public final int id;
 
@@ -120,74 +148,106 @@ public interface GLMediaPlayer extends TextureSequence {
      * Sets the stream to be used. Initializes all stream related states inclusive OpenGL ones,
      * if <code>gl</code> is not null.
      * <p>
-     * Uninitialized -> Stopped
+     * <a href="#lifecycle">GLMediaPlayer Lifecycle</a>: Uninitialized -> Paused
      * </p>
      * @param gl current GL object. If null, no video output and textures will be available.
      * @param textureCount desired number of buffered textures to be decoded off-thread, use <code>1</code> for on-thread decoding.  
      * @param urlConn the stream connection
+     * @param vid video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>
+     * @param aid video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>
      * @return the new state
      * 
      * @throws IllegalStateException if not invoked in state Uninitialized 
      * @throws IOException in case of difficulties to open or process the stream
      * @throws GLException in case of difficulties to initialize the GL resources
      */
-    public State initGLStream(GL gl, int textureCount, URLConnection urlConn) throws IllegalStateException, GLException, IOException;
+    public State initGLStream(GL gl, int textureCount, URLConnection urlConn, int vid, int aid) throws IllegalStateException, GLException, IOException;
+    
+    /** 
+     * If implementation uses a {@link AudioSink}, it's instance will be returned.
+     * <p> 
+     * The {@link AudioSink} instance is available after {@link #initGLStream(GL, int, URLConnection, int, int)}, 
+     * if used by implementation.
+     * </p> 
+     */
+    public AudioSink getAudioSink();
     
     /**
      * Releases the GL and stream resources.
      * <p>
-     * <code>ANY</code> -> Uninitialized
+     * <a href="#lifecycle">GLMediaPlayer Lifecycle</a>: <code>ANY</code> -> Uninitialized
      * </p>
      */
     public State destroy(GL gl);
 
-    public void setPlaySpeed(float rate);
+    /**
+     * Sets the playback speed.
+     * <p>
+     * Play speed is set to <i>normal</i>, i.e. <code>1.0f</code>
+     * if <code> abs(1.0f - rate) < 0.01f</code> to simplify test.
+     * </p>
+     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation. 
+     */
+    public boolean setPlaySpeed(float rate);
 
     public float getPlaySpeed();
 
     /**
-     * Stopped/Paused -> Playing
+     * <a href="#lifecycle">GLMediaPlayer Lifecycle</a>: Paused -> Playing
      */
-    public State start();
+    public State play();
 
     /**
-     * Playing -> Paused
+     * <a href="#lifecycle">GLMediaPlayer Lifecycle</a>: Playing -> Paused
      */
     public State pause();
 
     /**
-     * Playing/Paused -> Stopped
+     * Allowed in state Playing and Paused, otherwise ignored,
+     * see <a href="#lifecycle">GLMediaPlayer Lifecycle</a>. 
+     * 
+     * @param msec absolute desired time position in milliseconds 
+     * @return time current position in milliseconds, after seeking to the desired position  
+     **/
+    public int seek(int msec);
+
+    /**
+     * See <a href="#lifecycle">GLMediaPlayer Lifecycle</a>.
+     * @return the current state, either Uninitialized, Playing, Paused
      */
-    public State stop();
+    public State getState();
     
     /**
-     * @return the current state, either Uninitialized, Stopped, Playing, Paused
+     * Return the video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>.
      */
-    public State getState();
+    public int getVID();
     
     /**
-     * @return current streaming position in milliseconds 
-     **/
-    public int getCurrentPosition();
-
+     * Return the audio stream id, see <a href="#streamIDs">audio and video Stream IDs</a>.
+     */
+    public int getAID();
+    
+    /**
+     * @return the current decoded frame count since {@link #initGLStream(GL, int, URLConnection, int, int)}.
+     */
+    public int getDecodedFrameCount();
+    
+    /**
+     * @return the current presented frame count since {@link #initGLStream(GL, int, URLConnection, int, int)}, 
+     *         increased by {@link #getNextTexture(GL, boolean)}.
+     */
+    public int getPresentedFrameCount();
+    
     /**
-     * @return current video PTS in milliseconds of {@link #getLastTexture()} 
+     * @return current video presentation timestamp (PTS) in milliseconds of {@link #getLastTexture()} 
      **/
     public int getVideoPTS();
     
     /**
-     * @return current audio PTS in milliseconds. 
+     * @return current audio presentation timestamp (PTS) in milliseconds. 
      **/
     public int getAudioPTS();
     
-    /**
-     * Allowed in state Stopped, Playing and Paused, otherwise ignored.
-     * 
-     * @param msec absolute desired time position in milliseconds 
-     * @return time current position in milliseconds, after seeking to the desired position  
-     **/
-    public int seek(int msec);
-
     /**
      * {@inheritDoc}
      */
@@ -225,7 +285,13 @@ public interface GLMediaPlayer extends TextureSequence {
      * <i>Warning:</i> Optional information, may not be supported by implementation.
      * @return the total number of video frames
      */
-    public long getTotalFrames();
+    public int getVideoFrames();
+
+    /**
+     * <i>Warning:</i> Optional information, may not be supported by implementation.
+     * @return the total number of audio frames
+     */
+    public int getAudioFrames();
 
     /**
      * @return total duration of stream in msec.
@@ -262,6 +328,8 @@ public interface GLMediaPlayer extends TextureSequence {
 
     public String toString();
 
+    public String getPerfString();
+    
     public void addEventListener(GLMediaEventListener l);
 
     public void removeEventListener(GLMediaEventListener l);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
index 2707dd6d2..c7e1ab5e6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
@@ -47,10 +47,13 @@ public class GLMediaPlayerFactory {
             sink = create(cl, FFMPEGMediaPlayerClazzName);
         }
         if( null == sink ) {
-            sink = new NullGLMediaPlayer();
+            sink = createNull();
         }
         return sink;
     }
+    public static GLMediaPlayer createNull() {
+        return new NullGLMediaPlayer();
+    }
     
     public static GLMediaPlayer create(final ClassLoader cl, String implName) {
         try {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index 3f739b2cc..50801e791 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -110,9 +110,12 @@ public interface TextureSequence {
      * to associated related data. 
      */
     public static class TextureFrame {
+        /** Constant marking an invalid PTS, i.e. Integer.MIN_VALUE {@value}. */
+        public static final int INVALID_PTS = Integer.MIN_VALUE;
+        
         public TextureFrame(Texture t) {
             texture = t;
-            pts = 0;
+            pts = INVALID_PTS;
         }
         
         public final Texture getTexture() { return texture; }
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 765cda084..e14642c34 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -28,13 +28,13 @@
 package jogamp.opengl.android.av;
 
 import java.io.IOException;
-import java.nio.Buffer;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GLES2;
 
 import com.jogamp.common.os.AndroidVersion;
 import com.jogamp.common.os.Platform;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
 
@@ -100,7 +100,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final boolean startImpl() {
+    protected final boolean playImpl() {
         if(null != mp) {        
             try {
                 mp.start();
@@ -130,22 +130,6 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
         return false;
     }
 
-    @Override
-    protected final boolean stopImpl() {
-        if(null != mp) {
-            wakeUp(false);
-            try {
-                mp.stop();
-                return true;
-            } catch (IllegalStateException ise) {
-                if(DEBUG) {
-                    ise.printStackTrace();
-                }
-            }
-        }
-        return false;
-    }
-    
     @Override
     protected final int seekImpl(int msec) {
         if(null != mp) {
@@ -165,15 +149,19 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final int getCurrentPositionImpl() { return null != mp ? mp.getCurrentPosition() : 0; }
-    
-    @Override
-    protected final int getAudioPTSImpl() { return getCurrentPositionImpl(); }    
+    protected final int getAudioPTSImpl() { return null != mp ? mp.getCurrentPosition() : 0; }    
 
     @Override
     protected final void destroyImpl(GL gl) {
         if(null != mp) {
             wakeUp(false);
+            try {
+                mp.stop();
+            } catch (IllegalStateException ise) {
+                if(DEBUG) {
+                    ise.printStackTrace();
+                }
+            }
             mp.release();
             mp = null;
         }
@@ -198,8 +186,13 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final void initGLStreamImpl(GL gl) throws IOException {
+    protected final void initGLStreamImpl(GL gl, int vid, int aid) throws IOException {
         if(null!=mp && null!=urlConn) {
+            if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
+                mp.setVolume(0f, 0f);
+                // FIXME: Disable audio handling
+            } // else FIXME: Select aid !
+            // Note: Both FIXMEs seem to be n/a via Android's MediaPlayer -> Switch to API level 16 MediaCodec/MediaExtractor ..
             try {
                 final Uri uri = Uri.parse(urlConn.getURL().toExternalForm());        
                 mp.setDataSource(StaticContext.getContext(), uri);
@@ -213,20 +206,18 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             if( null == stex ) {
                 throw new InternalError("XXX");
             }
-            final Surface surf = new Surface(stex);
-            mp.setSurface(surf);
-            surf.release();
             mp.setSurface(null);
             try {
                 mp.prepare();
             } catch (IOException ioe) {
                 throw new IOException("MediaPlayer failed to process stream <"+urlConn.getURL().toExternalForm()+">: "+ioe.getMessage(), ioe);
             }
+            final int r_aid = GLMediaPlayer.STREAM_ID_NONE == aid ? GLMediaPlayer.STREAM_ID_NONE : GLMediaPlayer.STREAM_ID_AUTO;
             final String icodec = "android";
-            updateAttributes(mp.getVideoWidth(), mp.getVideoHeight(), 
-                             0, 0, 0, 
-                             0f, 0, mp.getDuration(), 
-                             icodec, icodec);
+            updateAttributes(GLMediaPlayer.STREAM_ID_AUTO, r_aid, 
+                             mp.getVideoWidth(), mp.getVideoHeight(), 0, 
+                             0, 0, 0f, 
+                             0, 0, mp.getDuration(), icodec, icodec);
         }
     }
     
@@ -264,8 +255,6 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
         }
         return true;
     }
-    @Override
-    protected final void syncFrame2Audio(TextureFrame frame) {}
     
     @Override
     protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
index 57d5ff625..db2146cdc 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
@@ -84,7 +84,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
     }
     @Override
     protected final int validateTextureCount(int desiredTextureCount) {
-        return desiredTextureCount>1 ? desiredTextureCount : 2;
+        return desiredTextureCount>2 ? Math.max(4, desiredTextureCount) : 2;
     }
 
     @Override
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index bc297dc21..c1cfc0d95 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -42,6 +42,7 @@ import javax.media.opengl.GLES2;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 
+import com.jogamp.opengl.util.av.AudioSink;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
@@ -62,7 +63,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
     protected static final String unknown = "unknown";
 
-    protected State state;
+    /** Default texture count w/o threading, value {@value}. */
+    protected static final int TEXTURE_COUNT_DEFAULT = 2;
+    
+    protected volatile State state;
+    private Object stateLock = new Object();
     
     protected int textureCount;
     protected int textureTarget;
@@ -79,30 +84,72 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     
     protected volatile float playSpeed = 1.0f;
     
-    /** Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
+    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    protected int vid = GLMediaPlayer.STREAM_ID_AUTO;
+    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    protected int aid = GLMediaPlayer.STREAM_ID_AUTO;
+    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected int width = 0;
-    /** Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
+    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected int height = 0;
-    /** Video fps. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
+    /** Video fps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected float fps = 0;
-    /** Stream bps. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
+    protected int frame_period = 0;
+    /** Stream bps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected int bps_stream = 0;
-    /** Video bps. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
+    /** Video bps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected int bps_video = 0;
-    /** Audio bps. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
+    /** Audio bps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected int bps_audio = 0;
-    /** In frames. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
-    protected int totalFrames = 0;
-    /** In ms. Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
+    /** In frames. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    protected int videoFrames = 0;
+    /** In frames. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    protected int audioFrames = 0;
+    /** In ms. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected int duration = 0;
-    /** Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
+    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected String acodec = unknown;
-    /** Shall be set by the {@link #initGLStreamImpl(GL)} method implementation. */
+    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected String vcodec = unknown;
     
-    protected int frameNumber = 0;
-    protected int currentVideoPTS = 0;
+    protected volatile int decodedFrameCount = 0;
+    protected int presentedFrameCount = 0;
+    protected volatile int video_pts_last = 0;
+    
+    /** See {@link #getAudioSink()}. Set by implementation if used from within {@link #initGLStreamImpl(GL, int, int)}! */
+    protected AudioSink audioSink = null;
+    protected boolean audioSinkPlaySpeedSet = false;
+    
+    /** System Clock Reference (SCR) of first audio PTS at start time. */
+    private long audio_scr_t0 = 0;
+    private boolean audioSCR_reset = true;
     
+    /** System Clock Reference (SCR) of first video frame at start time. */
+    private long video_scr_t0 = 0;
+    /** System Clock Reference (SCR) PTS offset, i.e. first video PTS at start time. */
+    private int video_scr_pts = 0;
+    /** Cumulative video pts diff. */
+    private float video_dpts_cum = 0;
+    /** Cumulative video frames. */
+    private int video_dpts_count = 0;
+    /** Number of min frame count required for video cumulative sync. */ 
+    private static final int VIDEO_DPTS_NUM = 20;
+    /** Cumulative coefficient, value {@value}. */
+    private static final float VIDEO_DPTS_COEFF = 0.7943282f; // (float) Math.exp(Math.log(0.01) / VIDEO_DPTS_NUM);
+    /** Maximum valid video pts diff. */
+    private static final int VIDEO_DPTS_MAX = 5000; // 5s max diff
+    /** Trigger video PTS reset with given cause as bitfield. */
+    private volatile int videoSCR_reset = 0;
+    
+    private final boolean isSCRCause(int bit) { return 0 != ( bit & videoSCR_reset); }
+    /** SCR reset due to: Start, Resume, Seek, .. */ 
+    private static final int SCR_RESET_FORCE = 1 << 0;
+    /** SCR reset due to: PlaySpeed */
+    private static final int SCR_RESET_SPEED = 1 << 1;
+    
+    /** Latched video PTS reset, to wait until valid pts after invalidation of cached ones. Currently [1..{@link #VIDEO_DPTS_NUM}] frames. */
+    private int videoSCR_reset_latch = 0;
+        
     protected SyncedRingbuffer<TextureFrame> videoFramesFree =  null;
     protected SyncedRingbuffer<TextureFrame> videoFramesDecoded =  null;
     protected volatile TextureFrame lastFrame = null;
@@ -201,144 +248,205 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     
     @Override
-    public final float getPlaySpeed() {
-        return playSpeed;
-    }
+    public final int getDecodedFrameCount() { return decodedFrameCount; }
+    
+    @Override
+    public final int getPresentedFrameCount() { return this.presentedFrameCount; }
+    
+    @Override
+    public final int getVideoPTS() { return video_pts_last; }
     
     @Override
-    public final synchronized void setPlaySpeed(float rate) {
-        if(State.Uninitialized != state && setPlaySpeedImpl(rate)) {
-            playSpeed = rate;
+    public final int getAudioPTS() { 
+        if( State.Uninitialized != state ) {
+            return getAudioPTSImpl();
         }
-        if(DEBUG) { System.err.println("SetPlaySpeed: "+toString()); }
+        return 0;
     }
-    protected abstract boolean setPlaySpeedImpl(float rate);
-
-    public final State start() {
-        switch( state ) {
-            case Stopped:
-                /** fall-through intended */
-            case Paused:
-                if( startImpl() ) {
-                    resumeFramePusher();
-                    state = State.Playing;
-                }
-            default:
+    /** Override if not using audioSink! */
+    protected int getAudioPTSImpl() {
+        if( null != audioSink ) {
+            return audioSink.getPTS();
+        } else {
+            return 0;
         }
-        if(DEBUG) { System.err.println("Start: "+toString()); }
-        return state;
     }
-    protected abstract boolean startImpl();
     
-    public final State pause() {
-        if( State.Playing == state && pauseImpl() ) {
-            pauseFramePusher();
-            state = State.Paused;
+    public final State getState() { return state; }
+    
+    public final State play() {
+        synchronized( stateLock ) {
+            switch( state ) {
+                case Paused:
+                    if( playImpl() ) {
+                        resetAudioVideoSCR(SCR_RESET_FORCE);
+                        resumeFramePusher();
+                        if( null != audioSink ) {
+                            audioSink.play();
+                        }
+                        state = State.Playing;
+                    }
+                default:
+            }
+            if(DEBUG) { System.err.println("Start: "+toString()); }
+            return state;
         }
-        if(DEBUG) { System.err.println("Pause: "+toString()); }            
-        return state;
     }
-    protected abstract boolean pauseImpl();
+    protected abstract boolean playImpl();
     
-    public final State stop() {
-        switch( state ) {
-            case Playing:
-                /** fall-through intended */
-            case Paused:
-                if( stopImpl() ) {
+    public final State pause() {
+        synchronized( stateLock ) {
+            if( State.Playing == state ) {
+                State _state = state;
+                state = State.Paused;
+                if( pauseImpl() ) {
+                    _state = State.Paused;
                     pauseFramePusher();
-                    state = State.Stopped;
+                    if( null != audioSink ) {
+                        audioSink.pause();
+                    }
                 }
-            default:
+                state = _state;
+            }
+            if(DEBUG) { System.err.println("Pause: "+toString()); }            
+            return state;
         }
-        if(DEBUG) { System.err.println("Stop: "+toString()); }
-        return state;
     }
-    protected abstract boolean stopImpl();
+    protected abstract boolean pauseImpl();
     
-    @Override
-    public final int getCurrentPosition() {
-        if( State.Uninitialized != state ) {
-            return getCurrentPositionImpl();
+    public final int seek(int msec) {
+        synchronized( stateLock ) {
+            final int pts1;
+            switch(state) {
+                case Playing:
+                case Paused:
+                    final State _state = state;
+                    state = State.Paused;
+                    pauseFramePusher();
+                    resetAudioVideoSCR(SCR_RESET_FORCE);
+                    pts1 = seekImpl(msec);
+                    if( null != audioSink ) {
+                        audioSink.flush();
+                        if( State.Playing == _state ) {
+                            audioSink.play(); // cont. w/ new data
+                        }
+                    }
+                    resumeFramePusher();
+                    state = _state;
+                    break;
+                default:
+                    pts1 = 0;
+            }
+            if(DEBUG) { System.err.println("Seek("+msec+"): "+toString()); }
+            return pts1;
         }
-        return 0;
     }
-    protected abstract int getCurrentPositionImpl();
+    protected abstract int seekImpl(int msec);
     
     @Override
-    public final int getVideoPTS() { return currentVideoPTS; }
+    public final float getPlaySpeed() {
+        return playSpeed;
+    }
     
     @Override
-    public final int getAudioPTS() { 
-        if( State.Uninitialized != state ) {
-            return getAudioPTSImpl();
+    public final boolean setPlaySpeed(float rate) {
+        synchronized( stateLock ) {
+            boolean res = false;
+            if(State.Uninitialized != state ) {
+                if( rate > 0.01f ) {
+                    if( Math.abs(1.0f - rate) < 0.01f ) {
+                        rate = 1.0f;
+                    }
+                    if( setPlaySpeedImpl(rate) ) {
+                        resetAudioVideoSCR(SCR_RESET_SPEED);
+                        playSpeed = rate;
+                        if(DEBUG) { System.err.println("SetPlaySpeed: "+toString()); }
+                        res = true;
+                    }
+                }
+            }
+            return res;
         }
-        return 0;
-    }    
-    protected abstract int getAudioPTSImpl();
-    
-    public final int seek(int msec) {
-        final int pts1;
-        switch(state) {
-            case Stopped:
-            case Playing:
-            case Paused:
-                pauseFramePusher();
-                pts1 = seekImpl(msec);
-                currentVideoPTS=pts1;
-                resumeFramePusher();
-                break;
-            default:
-                pts1 = 0;
+    }
+    /** 
+     * Override if not using AudioSink, or AudioSink's {@link AudioSink#setPlaySpeed(float)} is not sufficient!
+     * <p>
+     * AudioSink shall respect <code>!audioSinkPlaySpeedSet</code> to determine data_size 
+     * at {@link AudioSink#enqueueData(com.jogamp.opengl.util.av.AudioSink.AudioFrame)}.
+     * </p> 
+     */
+    protected boolean setPlaySpeedImpl(float rate) {
+        if( null != audioSink ) {
+            audioSinkPlaySpeedSet = audioSink.setPlaySpeed(rate);
         }
-        if(DEBUG) { System.err.println("Seek("+msec+"): "+toString()); }
-        return pts1;        
+        // still true, even if audioSink rejects command since we deal w/ video sync 
+        // and AudioSink w/ audioSinkPlaySpeedSet at enqueueData(..).
+        return true;
     }
-    protected abstract int seekImpl(int msec);
-    
-    public final State getState() { return state; }
-    
+
     @Override
-    public final State initGLStream(GL gl, int reqTextureCount, URLConnection urlConn) throws IllegalStateException, GLException, IOException {
-        if(State.Uninitialized != state) {
-            throw new IllegalStateException("Instance not in state "+State.Uninitialized+", but "+state+", "+this);
-        }
-        this.urlConn = urlConn;
-        if (this.urlConn != null) {
-            try {                
-                if( null != gl ) {
-                    removeAllTextureFrames(gl);
-                    textureCount = validateTextureCount(reqTextureCount);
-                    if( textureCount < 2 ) {
-                        throw new InternalError("Validated texture count < 2: "+textureCount);
-                    }
-                    initGLStreamImpl(gl); // also initializes width, height, .. etc
-                    videoFramesFree = new SyncedRingbuffer<TextureFrame>(createTexFrames(gl, textureCount), true /* full */);
-                    if( 2 < textureCount ) {
-                        videoFramesDecoded = new SyncedRingbuffer<TextureFrame>(new TextureFrame[textureCount], false /* full */);
-                        framePusher = new FramePusher(gl, requiresOffthreadGLCtx());
-                        framePusher.doStart();
-                    } else {
-                        videoFramesDecoded = null;
+    public final State initGLStream(GL gl, int reqTextureCount, URLConnection urlConn, int vid, int aid) throws IllegalStateException, GLException, IOException {
+        synchronized( stateLock ) {
+            if(State.Uninitialized != state) {
+                throw new IllegalStateException("Instance not in state "+State.Uninitialized+", but "+state+", "+this);
+            }
+            decodedFrameCount = 0;
+            presentedFrameCount = 0;
+            this.urlConn = urlConn;
+            if (this.urlConn != null) {
+                try {                
+                    if( null != gl ) {
+                        removeAllTextureFrames(gl);
+                        textureCount = validateTextureCount(reqTextureCount);
+                        if( textureCount < TEXTURE_COUNT_DEFAULT ) {
+                            throw new InternalError("Validated texture count < "+TEXTURE_COUNT_DEFAULT+": "+textureCount);
+                        }
+                        initGLStreamImpl(gl, vid, aid); // also initializes width, height, .. etc
+                        videoFramesFree = new SyncedRingbuffer<TextureFrame>(createTexFrames(gl, textureCount), true /* full */);
+                        if( TEXTURE_COUNT_DEFAULT < textureCount ) {
+                            videoFramesDecoded = new SyncedRingbuffer<TextureFrame>(new TextureFrame[textureCount], false /* full */);
+                            framePusher = new FramePusher(gl, requiresOffthreadGLCtx());
+                            framePusher.doStart();
+                        } else {
+                            videoFramesDecoded = null;
+                        }
+                        lastFrame = videoFramesFree.getBlocking(false /* clearRef */ );
+                        state = State.Paused;
                     }
-                    lastFrame = videoFramesFree.getBlocking(false /* clearRef */ );
+                    return state;
+                } catch (Throwable t) {
+                    throw new GLException("Error initializing GL resources", t);
                 }
-                state = State.Stopped;
-                return state;
-            } catch (Throwable t) {
-                throw new GLException("Error initializing GL resources", t);
             }
+            return state;
         }
-        return state;        
     }
+    /**
+     * Implementation shall set the following set of data here
+     * @see #vid
+     * @see #aid 
+     * @see #width
+     * @see #height
+     * @see #fps
+     * @see #bps_stream
+     * @see #videoFrames
+     * @see #audioFrames
+     * @see #acodec
+     * @see #vcodec
+    */
+    protected abstract void initGLStreamImpl(GL gl, int vid, int aid) throws IOException;
+    
     /** 
      * Returns the validated number of textures to be handled.
      * <p>
-     * Default is always 2 textures, last texture and the decoding texture. 
+     * Default is 2 textures w/o threading, last texture and the decoding texture. 
+     * </p>
+     * <p>
+     * &gt; 2 textures is used for threaded decoding, a minimum of 4 textures seems reasonable in this case.
      * </p>
      */
     protected int validateTextureCount(int desiredTextureCount) {
-        return 2;
+        return TEXTURE_COUNT_DEFAULT;
     }
     protected boolean requiresOffthreadGLCtx() { return false; }
     
@@ -405,6 +513,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                      mustFlipVertically);        
     }
         
+    protected void destroyTexFrame(GL gl, TextureFrame frame) {
+        frame.getTexture().destroy(gl);        
+    }
+
+    @Override
+    public final TextureFrame getLastTexture() throws IllegalStateException {
+        if(State.Uninitialized == state) {
+            throw new IllegalStateException("Instance not initialized: "+this);
+        }
+        return lastFrame;
+    }
+    
     private final void removeAllTextureFrames(GL gl) {
         if( null != videoFramesFree ) {
             final TextureFrame[] texFrames = videoFramesFree.getArray(); 
@@ -417,79 +537,209 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     destroyTexFrame(gl, frame);
                     texFrames[i] = null;
                 }
+                System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null");            
             }        
         }
         textureCount=0;
     }
-    protected void destroyTexFrame(GL gl, TextureFrame frame) {
-        frame.getTexture().destroy(gl);        
-    }
-
-    /**
-     * Implementation shall set the following set of data here 
-     * @param gl TODO
-     * @see #width
-     * @see #height
-     * @see #fps
-     * @see #bps_stream
-     * @see #totalFrames
-     * @see #acodec
-     * @see #vcodec
-    */
-    protected abstract void initGLStreamImpl(GL gl) throws IOException;
     
     @Override
-    public final TextureFrame getLastTexture() throws IllegalStateException {
-        if(State.Uninitialized == state) {
-            throw new IllegalStateException("Instance not initialized: "+this);
+    public final TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException {
+        synchronized( stateLock ) {
+            if(State.Uninitialized == state) {
+                throw new IllegalStateException("Instance not initialized: "+this);
+            }
+            if(State.Playing == state) {
+                TextureFrame nextFrame = null;
+                boolean ok = true;
+                boolean dropFrame = false;
+                try {
+                    do { 
+                        if( TEXTURE_COUNT_DEFAULT < textureCount ) {
+                            nextFrame = videoFramesDecoded.getBlocking(false /* clearRef */ );
+                        } else {
+                            nextFrame = videoFramesFree.getBlocking(false /* clearRef */ );
+                            if( getNextTextureImpl(gl, nextFrame, blocking) ) {
+                                newFrameAvailable(nextFrame);
+                            } else {
+                                ok = false;
+                            }
+                        }
+                        if( ok ) {
+                            presentedFrameCount++;
+                            final int video_pts;
+                            if( 0 != videoSCR_reset ) {
+                                if( isSCRCause(SCR_RESET_FORCE) ) {
+                                    videoSCR_reset_latch = VIDEO_DPTS_NUM / 2;
+                                    resetVideoDPTS();
+                                    resetAllVideoPTS();
+                                } else {
+                                    // SCR_RESET_SPEED
+                                    videoSCR_reset_latch = 1;
+                                }
+                                videoSCR_reset = 0;
+                                video_pts = TextureFrame.INVALID_PTS;
+                            } else {
+                                video_pts = nextFrame.getPTS();
+                            }
+                            if( video_pts != TextureFrame.INVALID_PTS ) {
+                                final int frame_period_last = video_pts - video_pts_last; // rendering loop interrupted ?
+                                if( videoSCR_reset_latch > 0 || frame_period_last > frame_period*10 ) {
+                                    if( videoSCR_reset_latch > 0 ) {
+                                        videoSCR_reset_latch--;
+                                    }
+                                    setFirstVideoPTS2SCR( video_pts );
+                                }
+                                final int scr_pts = video_scr_pts + 
+                                                    (int) ( ( System.currentTimeMillis() - video_scr_t0 ) * playSpeed );
+                                final int d_vpts = video_pts - scr_pts;
+                                if( -VIDEO_DPTS_MAX > d_vpts || d_vpts > VIDEO_DPTS_MAX ) {
+                                    if( DEBUG ) {
+                                        System.err.println( getPerfStringImpl( scr_pts, video_pts, d_vpts, 0 ) );
+                                    }
+                                } else {
+                                    video_dpts_count++;
+                                    video_dpts_cum = d_vpts + VIDEO_DPTS_COEFF * video_dpts_cum;
+                                    final int video_dpts_avg_diff = getVideoDPTSAvg();
+                                    if( DEBUG ) {
+                                        System.err.println( getPerfStringImpl( scr_pts, video_pts, d_vpts, video_dpts_avg_diff ) );
+                                    }
+                                    if( blocking && syncAVRequired() ) {
+                                        if( !syncAV( (int) ( video_dpts_avg_diff / playSpeed + 0.5f ) ) ) {
+                                            resetVideoDPTS();
+                                            dropFrame = true;
+                                        }
+                                    }
+                                    video_pts_last = video_pts;
+                                }
+                            }
+                            final TextureFrame _lastFrame = lastFrame;
+                            lastFrame = nextFrame;
+                            videoFramesFree.putBlocking(_lastFrame);
+                        }
+                    } while( dropFrame );
+                } catch (InterruptedException e) {
+                    ok = false;
+                    e.printStackTrace();
+                } finally {
+                    if( !ok && null != nextFrame ) { // put back
+                        videoFramesFree.put(nextFrame);
+                    }
+                }
+            }
+            return lastFrame;
         }
-        return lastFrame;
     }
+    protected abstract boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking);
+    protected boolean syncAVRequired() { return false; }
     
+    /** 
+     * {@inheritDoc}
+     * <p>
+     * Note: All {@link AudioSink} operations are performed from {@link GLMediaPlayerImpl},
+     * i.e. {@link #play()}, {@link #pause()}, {@link #seek(int)}, {@link #setPlaySpeed(float)}, {@link #getAudioPTS()}.
+     * </p>
+     * <p>
+     * Implementations using an {@link AudioSink} shall write it's instance to {@link #audioSink}
+     * from within their {@link #initGLStreamImpl(GL, int, int)} implementation.
+     * </p>
+     */
     @Override
-    public final synchronized TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException {
-        if(State.Uninitialized == state) {
-            throw new IllegalStateException("Instance not initialized: "+this);
+    public final AudioSink getAudioSink() { return audioSink; }
+    
+    /** 
+     * To be called from implementation at 1st PTS after start
+     * w/ current pts value in milliseconds.
+     * @param audio_scr_t0
+     */
+    protected void setFirstAudioPTS2SCR(int pts) {
+        if( audioSCR_reset ) {
+            audio_scr_t0 = System.currentTimeMillis() - pts;
+            audioSCR_reset = false;
         }
-        if(State.Playing == state) {
-            TextureFrame nextFrame = null;
-            boolean ok = true;
-            try {
-                if( 2 < textureCount ) {
-                    nextFrame = videoFramesDecoded.getBlocking(false /* clearRef */ );
-                } else {
-                    nextFrame = videoFramesFree.getBlocking(false /* clearRef */ );
-                    if( getNextTextureImpl(gl, nextFrame, blocking) ) {
-                        newFrameAvailable(nextFrame);
-                    } else {
-                        ok = false;
-                    }
-                }
-                if( ok ) {
-                    currentVideoPTS = nextFrame.getPTS();
-                    if( blocking ) {
-                        syncFrame2Audio(nextFrame);
-                    }
-                    final TextureFrame _lastFrame = lastFrame;
-                    lastFrame = nextFrame;
-                    videoFramesFree.putBlocking(_lastFrame);
-                }
-            } catch (InterruptedException e) {
-                ok = false;
-                e.printStackTrace();
-            } finally {
-                if( !ok && null != nextFrame ) { // put back
-                    videoFramesFree.put(nextFrame);
-                }
+    }
+    private void setFirstVideoPTS2SCR(int pts) {
+        // video_scr_t0 = System.currentTimeMillis() - pts;
+        video_scr_t0 = System.currentTimeMillis();
+        video_scr_pts = pts;
+    }
+    private void resetAllVideoPTS() {
+        if( null != videoFramesFree ) {
+            final TextureFrame[] texFrames = videoFramesFree.getArray(); 
+            for(int i=0; i<texFrames.length; i++) {
+                final TextureFrame frame = texFrames[i];
+                frame.setPTS(TextureFrame.INVALID_PTS);
+            }        
+        }        
+    }
+    private void resetVideoDPTS() {
+        video_dpts_cum = 0;
+        video_dpts_count = 0;        
+    }
+    private final int getVideoDPTSAvg() {
+        if( video_dpts_count < VIDEO_DPTS_NUM ) {
+            return 0;
+        } else {
+            return (int) ( video_dpts_cum * (1.0f - VIDEO_DPTS_COEFF) + 0.5f );
+        }
+    }
+    
+    private void resetAudioVideoSCR(int cause) {
+        audioSCR_reset = true;
+        videoSCR_reset |= cause;
+    }
+    
+    /**
+     * Synchronizes A-V.
+     * <p>
+     * https://en.wikipedia.org/wiki/Audio_to_video_synchronization
+     * <pre>
+     *   d_av = v_pts - a_pts;
+     * </pre>
+     * </p>
+     * <p>
+     * Recommendation of audio/video pts time lead/lag at production:
+     * <ul>
+     *   <li>Overall:    +40ms and -60ms  audio ahead video / audio after video</li>
+     *   <li>Each stage:  +5ms and -15ms. audio ahead video / audio after video</li>
+     * </ul>
+     * </p>
+     * <p>
+     * Recommendation of av pts time lead/lag at presentation:
+     * <ul>
+     *   <li>TV:         +15ms and -45ms. audio ahead video / audio after video.</li>
+     *   <li>Film:       +22ms and -22ms. audio ahead video / audio after video.</li>
+     * </ul>
+     * </p>
+     * <p>
+     * Maybe implemented as follows: 
+     * <pre>
+     *   d_av = vpts - apts;
+     *   d_av < -22: audio after video == video ahead audio -> drop
+     *   d_av >  22: audio ahead video == video after audio -> sleep(d_av - 10) 
+     * </pre>
+     * </p>
+     * <p>
+     * Returns true if audio is ahead of video, otherwise false (video is ahead of audio).
+     * In case of the latter (false), the video frame shall be dropped!
+     * </p>
+     * @param frame
+     * @return true if audio is ahead of video, otherwise false (video is ahead of audio)
+     */
+    protected boolean syncAV(int d_vpts) {
+        if( d_vpts > 22 ) {
+            if( DEBUG ) {
+                System.err.println("V (sleep): "+(d_vpts - 22 / 2)+" ms");
             }
+            try {
+                Thread.sleep( d_vpts - 22 / 2 );
+            } catch (InterruptedException e) { }
         }
-        return lastFrame;
+        return true;
     }
-    protected abstract boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking);
-    protected abstract void syncFrame2Audio(TextureFrame frame);
     
     private final void newFrameAvailable(TextureFrame frame) {
-        frameNumber++;        
+        decodedFrameCount++;        
         synchronized(eventListenersLock) {
             for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
                 i.next().newFrameAvailable(this, frame, System.currentTimeMillis());
@@ -500,6 +750,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     class FramePusher extends Thread {
         private volatile boolean isRunning = false;
         private volatile boolean isActive = false;
+        private volatile boolean isBlocked = false;
         
         private volatile boolean shallPause = true;
         private volatile boolean shallStop = false;
@@ -560,6 +811,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         public synchronized void doPause() {
             if( isActive ) {
                 shallPause = true;
+                if( isBlocked && isActive ) {
+                    this.interrupt();
+                }
                 while( isActive ) {
                     try {
                         this.wait(); // wait until paused
@@ -595,6 +849,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         public synchronized void doStop() {
             if( isRunning ) {
                 shallStop = true;
+                if( isBlocked && isRunning ) {
+                    this.interrupt();
+                }
                 while( isRunning ) {
                     this.notify();  // wake-up pause-block (opt)
                     try {
@@ -629,7 +886,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             try {
                                 this.wait(); // wait until resumed
                             } catch (InterruptedException e) {
-                                e.printStackTrace();
+                                if( !shallPause ) {
+                                    e.printStackTrace();
+                                }
                             }
                         }
                         isActive = true;
@@ -639,23 +898,30 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 
                 if( !shallStop ) {
                     TextureFrame nextFrame = null;
-                    boolean ok = false;
                     try {
-                        nextFrame = videoFramesFree.getBlocking(true /* clearRef */ );
+                        isBlocked = true;
+                        nextFrame = videoFramesFree.getBlocking(false /* clearRef */ );
+                        isBlocked = false;
+                        nextFrame.setPTS( TextureFrame.INVALID_PTS ); // mark invalid until processed!
                         if( getNextTextureImpl(gl, nextFrame, true) ) {
-                            gl.glFinish();
-                            videoFramesDecoded.putBlocking(nextFrame);
-                            newFrameAvailable(nextFrame);
-                            ok = true;
+                            // gl.glFinish();
+                            gl.glFlush(); // even better: sync object!
+                            if( !videoFramesDecoded.put(nextFrame) ) { 
+                                throw new InternalError("XXX: "+GLMediaPlayerImpl.this); 
+                            }
+                            final TextureFrame _nextFrame = nextFrame;
+                            nextFrame = null;
+                            newFrameAvailable(_nextFrame);
                         }
                     } catch (InterruptedException e) {
+                        isBlocked = false;
                         if( !shallStop && !shallPause ) {
                             e.printStackTrace(); // oops
                             shallPause = false;
                             shallStop = true;
                         }
                     } finally {
-                        if( !ok && null != nextFrame ) { // put back
+                        if( null != nextFrame ) { // put back
                             videoFramesFree.put(nextFrame);
                         }
                     }
@@ -689,10 +955,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
     
-    protected final void updateAttributes(int width, int height, int bps_stream, int bps_video, int bps_audio, 
-                                          float fps, int totalFrames, int duration, 
-                                          String vcodec, String acodec) {
+    protected final void updateAttributes(int vid, int aid, int width, int height, int bps_stream, 
+                                          int bps_video, int bps_audio, float fps, 
+                                          int videoFrames, int audioFrames, int duration, String vcodec, String acodec) {
         int event_mask = 0;
+        if( this.vid != vid ) {
+            event_mask |= GLMediaEventListener.EVENT_CHANGE_VID;
+            this.vid = vid;
+        }   
+        if( this.aid != aid ) {
+            event_mask |= GLMediaEventListener.EVENT_CHANGE_AID;
+            this.aid = aid;
+        }   
         if( this.width != width || this.height != height ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_SIZE;
             this.width = width;
@@ -701,6 +975,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         if( this.fps != fps ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_FPS;
             this.fps = fps;
+            this.frame_period = (int) ( 1000f / fps + 0.5f );
         }
         if( this.bps_stream != bps_stream || this.bps_video != bps_video || this.bps_audio != bps_audio ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_BPS;
@@ -708,9 +983,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             this.bps_video = bps_video;
             this.bps_audio = bps_audio;
         }
-        if( this.totalFrames != totalFrames || this.duration != duration ) {
+        if( this.videoFrames != videoFrames || this.audioFrames != audioFrames || this.duration != duration ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_LENGTH;
-            this.totalFrames = totalFrames;
+            this.videoFrames = videoFrames;
+            this.audioFrames = audioFrames;
             this.duration = duration;
         }
         if( (null!=acodec && acodec.length()>0 && !this.acodec.equals(acodec)) ) { 
@@ -736,78 +1012,120 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     
     @Override
-    public final synchronized State destroy(GL gl) {
-        destroyFramePusher();
-        destroyImpl(gl);
-        removeAllTextureFrames(gl);
-        state = State.Uninitialized;
-        return state;
+    public final State destroy(GL gl) {
+        synchronized( stateLock ) {
+            destroyFramePusher();
+            destroyImpl(gl);
+            removeAllTextureFrames(gl);
+            state = State.Uninitialized;
+            return state;
+        }
     }
     protected abstract void destroyImpl(GL gl);
 
     @Override
-    public final synchronized URLConnection getURLConnection() {
+    public final URLConnection getURLConnection() {
         return urlConn;
     }
 
     @Override
-    public final synchronized String getVideoCodec() {
+    public final int getVID() { return vid; }
+    
+    @Override
+    public final int getAID() { return aid; }
+    
+    @Override
+    public final String getVideoCodec() {
         return vcodec;
     }
 
     @Override
-    public final synchronized String getAudioCodec() {
+    public final String getAudioCodec() {
         return acodec;
     }
 
     @Override
-    public final synchronized long getTotalFrames() {
-        return totalFrames;
+    public final int getVideoFrames() {
+        return videoFrames;
+    }
+    
+    public final int getAudioFrames() {
+        return audioFrames;
     }
 
     @Override
-    public final synchronized int getDuration() {
+    public final int getDuration() {
         return duration;
     }
     
     @Override
-    public final synchronized long getStreamBitrate() {
+    public final long getStreamBitrate() {
         return bps_stream;
     }
 
     @Override
-    public final synchronized int getVideoBitrate() {
+    public final int getVideoBitrate() {
         return bps_video;
     }
     
     @Override
-    public final synchronized int getAudioBitrate() {
+    public final int getAudioBitrate() {
         return bps_audio;
     }
     
     @Override
-    public final synchronized float getFramerate() {
+    public final float getFramerate() {
         return fps;
     }
 
     @Override
-    public final synchronized int getWidth() {
+    public final int getWidth() {
         return width;
     }
 
     @Override
-    public final synchronized int getHeight() {
+    public final int getHeight() {
         return height;
     }
 
     @Override
-    public final synchronized String toString() {
-        final float ct = getCurrentPosition() / 1000.0f, tt = getDuration() / 1000.0f;
+    public final String toString() {
+        final float tt = getDuration() / 1000.0f;
         final String loc = ( null != urlConn ) ? urlConn.getURL().toExternalForm() : "<undefined stream>" ;
-        return "GLMediaPlayer["+state+", "+frameNumber+"/"+totalFrames+" frames, "+ct+"/"+tt+"s, speed "+playSpeed+", "+bps_stream+" bps, "+
-                "Texture[count "+textureCount+", target "+toHexString(textureTarget)+", format "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+               
-               "Stream[Video[<"+vcodec+">, "+width+"x"+height+", "+fps+" fps, "+bps_video+" bsp], "+
-               "Audio[<"+acodec+">, "+bps_audio+" bsp]], "+loc+"]";
+        final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
+        final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
+        return "GLMediaPlayer["+state+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
+               "speed "+playSpeed+", "+bps_stream+" bps, "+
+               "Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", target "+toHexString(textureTarget)+", format "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+               
+               "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", "+fps+" fps, "+bps_video+" bps], "+
+               "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+"]";
+    }
+    
+    @Override
+    public final String getPerfString() {
+        final int scr_pts = video_scr_pts + 
+                            (int) ( ( System.currentTimeMillis() - video_scr_t0 ) * playSpeed );
+        final int d_vpts = video_pts_last - scr_pts;
+        return getPerfStringImpl( scr_pts, video_pts_last, d_vpts, getVideoDPTSAvg() );
+    }
+    private final String getPerfStringImpl(final int scr_pts, final int video_pts, final int d_vpts, final int video_dpts_avg_diff) {
+        final float tt = getDuration() / 1000.0f;        
+        final int audio_scr = (int) ( ( System.currentTimeMillis() - audio_scr_t0 ) * playSpeed );
+        final int audio_pts = getAudioPTSImpl();
+        final int d_apts = audio_pts - audio_scr;
+        final String audioSinkInfo;
+        final AudioSink audioSink = getAudioSink();
+        if( null != audioSink ) {
+            audioSinkInfo = "AudioSink[frames [d "+audioSink.getEnqueuedFrameCount()+", q "+audioSink.getQueuedFrameCount()+", f "+audioSink.getFreeFrameCount()+"], time "+audioSink.getQueuedTime()+", bytes "+audioSink.getQueuedByteCount()+"]";
+        } else {
+            audioSinkInfo = "";
+        }
+        final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
+        final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
+        return state+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
+               "speed " + playSpeed+", vSCR "+scr_pts+", vpts "+video_pts+", dSCR["+d_vpts+", avrg "+video_dpts_avg_diff+"], "+
+               "aSCR "+audio_scr+", apts "+audio_pts+" ( "+d_apts+" ), "+audioSinkInfo+
+               ", Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+"]";
     }
 
     @Override
@@ -831,7 +1149,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
-    public final synchronized GLMediaEventListener[] getEventListeners() {
+    public final GLMediaEventListener[] getEventListeners() {
         synchronized(eventListenersLock) {
             return eventListeners.toArray(new GLMediaEventListener[eventListeners.size()]);
         }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index f1ce42257..5d70ca33d 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -38,6 +38,7 @@ import jogamp.opengl.util.av.GLMediaPlayerImpl;
 
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.util.IOUtil;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureData;
 import com.jogamp.opengl.util.texture.TextureIO;
@@ -62,7 +63,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final boolean startImpl() {
+    protected final boolean playImpl() {
         pos_start = (int)System.currentTimeMillis();
         return true;
     }
@@ -72,11 +73,6 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
         return true;
     }
 
-    @Override
-    protected final boolean stopImpl() {
-        return true;
-    }
-    
     @Override
     protected final int seekImpl(int msec) {
         pos_ms = msec;
@@ -86,20 +82,16 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     
     @Override
     protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking) {
+        nextFrame.setPTS( getAudioPTSImpl() );
         return true;
     }
-    @Override
-    protected final void syncFrame2Audio(TextureFrame frame) { }
     
     @Override
-    protected final int getCurrentPositionImpl() {
+    protected final int getAudioPTSImpl() { 
         pos_ms = (int)System.currentTimeMillis() - pos_start;
         validatePos();
         return pos_ms;
     }
-    @Override
-    protected final int getAudioPTSImpl() { return getCurrentPositionImpl(); }
-
 
     @Override
     protected final void destroyImpl(GL gl) {
@@ -110,7 +102,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
         
     @Override
-    protected final void initGLStreamImpl(GL gl) throws IOException {
+    protected final void initGLStreamImpl(GL gl, int vid, int aid) throws IOException {
         try {
             URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-160x90.png", this.getClass().getClassLoader());
             if(null != urlConn) {
@@ -136,13 +128,14 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
                    GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, false, 
                    false, false, buffer, null);
         }
+        final int r_aid = GLMediaPlayer.STREAM_ID_NONE == aid ? GLMediaPlayer.STREAM_ID_NONE : GLMediaPlayer.STREAM_ID_AUTO; 
         final float _fps = 24f;
         final int _duration = 10*60*1000; // msec
         final int _totalFrames = (int) ( (_duration/1000)*_fps );
-        updateAttributes(_w, _h, 
-                         0, 0, 0, 
-                         _fps, _totalFrames, _duration, 
-                         "png-static", null);
+        updateAttributes(GLMediaPlayer.STREAM_ID_AUTO, r_aid, 
+                         _w, _h, 0, 
+                         0, 0, _fps, 
+                         _totalFrames, 0, _duration, "png-static", null);
     }
     
     @Override
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 83a5960f1..dc7ceae39 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -42,9 +42,11 @@ import com.jogamp.common.util.VersionNumber;
 import com.jogamp.gluegen.runtime.ProcAddressTable;
 import com.jogamp.opengl.util.GLPixelStorageModes;
 import com.jogamp.opengl.util.av.AudioSink;
+import com.jogamp.opengl.util.av.AudioSink.AudioDataFormat;
+import com.jogamp.opengl.util.av.AudioSink.AudioDataType;
 import com.jogamp.opengl.util.av.AudioSinkFactory;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
-import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 import jogamp.opengl.GLContextImpl;
 import jogamp.opengl.util.av.GLMediaPlayerImpl;
@@ -136,13 +138,17 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                                   ( vers >>  8 ) & 0xFF,
                                   ( vers >>  0 ) & 0xFF );
     }
+
+    //
+    // General
+    //
+    
+    protected long moviePtr = 0;    
     
     //
     // Video
     //
     
-    protected long moviePtr = 0;    
-    protected GLPixelStorageModes psm;
     protected PixelFormat vPixelFmt = null;
     protected int vPlanes = 0;
     protected int vBitsPerPixel = 0;
@@ -152,15 +158,17 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     protected int texWidth, texHeight; // overall (stuffing planes in one texture)
     protected ByteBuffer texCopy;
     protected String singleTexComp = "r";
+    protected GLPixelStorageModes psm;
 
     //
     // Audio
     //
     
-    protected final int AudioFrameCount = 8;        
-    protected final AudioSink audioSink;    
-    protected final int maxAvailableAudio;
-    protected AudioSink.AudioDataFormat chosenAudioFormat;
+    protected static final int AFRAMES_PER_VFRAME = 8;
+    protected int aFrameCount = 0;
+    protected SampleFormat aSampleFmt = null;
+    protected AudioSink.AudioDataFormat avChosenAudioFormat;
+    protected AudioSink.AudioDataFormat sinkChosenAudioFormat;
     
     public FFMPEGMediaPlayer() {
         if(!available) {
@@ -171,12 +179,11 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             throw new GLException("Couldn't create FFMPEGInstance");
         }
         psm = new GLPixelStorageModes();
-        audioSink = AudioSinkFactory.createDefault(); 
-        maxAvailableAudio = audioSink.getQueuedByteCount();
+        audioSink = null;
     }
     @Override
     protected final int validateTextureCount(int desiredTextureCount) {
-        return desiredTextureCount>1 ? desiredTextureCount : 2;
+        return desiredTextureCount>2 ? Math.max(4, desiredTextureCount) : 2;
     }
     @Override
     protected final boolean requiresOffthreadGLCtx() { return true; }
@@ -187,10 +194,18 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             destroyInstance0(moviePtr);
             moviePtr = 0;
         }
+        destroyAudioSink();
+    }
+    private final void destroyAudioSink() {
+        final AudioSink _audioSink = audioSink;
+        if( null != _audioSink ) {            
+            audioSink = null;
+            _audioSink.destroy();
+        }
     }
     
     @Override
-    protected final void initGLStreamImpl(GL gl) throws IOException {
+    protected final void initGLStreamImpl(GL gl, int vid, int aid) throws IOException {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
@@ -209,11 +224,32 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
         
         final String urlS=urlConn.getURL().toExternalForm();
+        
+        aFrameCount = AFRAMES_PER_VFRAME * textureCount + AFRAMES_PER_VFRAME/2;
     
-        chosenAudioFormat = audioSink.initSink(audioSink.getPreferredFormat(), AudioFrameCount);
         System.err.println("setURL: p1 "+this);
-        setStream0(moviePtr, urlS, -1, -1, AudioFrameCount); // issues updateAttributes*(..)
-        System.err.println("setURL: p2 "+this);
+        destroyAudioSink();
+        AudioSink _audioSink;
+        if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
+            _audioSink = AudioSinkFactory.createNull();
+        } else {
+            _audioSink = AudioSinkFactory.createDefault();
+        }
+        final AudioDataFormat preferredAudioFormat = _audioSink.getPreferredFormat();
+         // setStream(..) issues updateAttributes*(..), and defines avChosenAudioFormat, vid, aid, .. etc
+        setStream0(moviePtr, urlS, vid, aid, aFrameCount, preferredAudioFormat.channelCount, preferredAudioFormat.sampleRate);
+        // final int audioBytesPerFrame = bps_audio/8000 * frame_period * textureCount;
+        
+        System.err.println("setURL: p2 preferred "+preferredAudioFormat+", avChosen "+avChosenAudioFormat+", "+this);
+        sinkChosenAudioFormat = _audioSink.initSink(avChosenAudioFormat, aFrameCount);
+        System.err.println("setURL: p3 avChosen "+avChosenAudioFormat+", chosen "+sinkChosenAudioFormat);
+        if( null == sinkChosenAudioFormat ) {
+            System.err.println("AudioSink "+_audioSink.getClass().getName()+" does not support "+avChosenAudioFormat+", using Null");
+            _audioSink.destroy();
+            _audioSink = AudioSinkFactory.createNull();
+            sinkChosenAudioFormat = _audioSink.initSink(avChosenAudioFormat, aFrameCount);
+        }
+        audioSink = _audioSink;
         
         int tf, tif=GL.GL_RGBA; // texture format and internal format
         switch(vBytesPerPixelPerPlane) {
@@ -256,7 +292,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
 
     private void updateAttributes2(int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
                                    int lSz0, int lSz1, int lSz2,
-                                   int tWd0, int tWd1, int tWd2) {
+                                   int tWd0, int tWd1, int tWd2,
+                                   int sampleFmt, int sampleRate, int channels) {
         vPixelFmt = PixelFormat.valueOf(pixFmt);
         vPlanes = planes;
         vBitsPerPixel = bitsPerPixel;
@@ -286,12 +323,53 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             default: // FIXME: Add more planar formats !
                 throw new RuntimeException("Unsupported pixelformat: "+vPixelFmt);
         }
+
+        aSampleFmt = SampleFormat.valueOf(sampleFmt);
+        final int sampleSize;
+        final boolean signed, fixedP;
+        switch( aSampleFmt ) {
+            case S32:
+            case S32P:
+                sampleSize = 32;
+                signed = true;
+                fixedP = true;
+                break;
+            case S16:
+            case S16P:
+                sampleSize = 16;
+                signed = true;
+                fixedP = true;
+                break;
+            case U8:
+            case U8P:
+                sampleSize = 8;
+                signed = false;
+                fixedP = true;
+                break;
+            case DBL:
+            case DBLP:
+                sampleSize = 64;
+                signed = true;
+                fixedP = true;
+                break;
+            case FLT:
+            case FLTP:
+                sampleSize = 32;
+                signed = true;
+                fixedP = true;
+                break;
+            default: // FIXME: Add more planar formats !
+                throw new RuntimeException("Unsupported sampleformat: "+aSampleFmt);
+        }
+        avChosenAudioFormat = new AudioDataFormat(AudioDataType.PCM, sampleRate, sampleSize, channels, signed, fixedP, true /* littleEndian */);  
+        
         if(DEBUG) {
-            System.err.println("XXX0: fmt "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane);
+            System.err.println("audio: fmt "+aSampleFmt+", "+avChosenAudioFormat);
+            System.err.println("video: fmt "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane);
             for(int i=0; i<3; i++) {
-                System.err.println("XXX0 "+i+": "+vTexWidth[i]+"/"+vLinesize[i]);
+                System.err.println("video: "+i+": "+vTexWidth[i]+"/"+vLinesize[i]);
             }
-            System.err.println("XXX0 total tex "+texWidth+"x"+texHeight);
+            System.err.println("video: total tex "+texWidth+"x"+texHeight);
         }
     }
     
@@ -355,54 +433,27 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final synchronized int getCurrentPositionImpl() {
-        return 0!=moviePtr ? getVideoPTS0(moviePtr) : 0;
-    }
-
-    @Override
-    public final int getAudioPTSImpl() { return 0; }    
-    
-    @Override
-    protected final synchronized boolean setPlaySpeedImpl(float rate) {
-        return true;
-    }
-
-    @Override
-    public final synchronized boolean startImpl() {
+    public final boolean playImpl() {
         if(0==moviePtr) {
             return false;
         }
         return true;
     }
 
-    /** @return time position after issuing the command */
     @Override
-    public final synchronized boolean pauseImpl() {
+    public final boolean pauseImpl() {
         if(0==moviePtr) {
             return false;
         }
         return true;
     }
 
-    /** @return time position after issuing the command */
-    @Override
-    public final synchronized boolean stopImpl() {
-        if(0==moviePtr) {
-            return false;
-        }
-        return true;
-    }
-
-    /** @return time position after issuing the command */
     @Override
     protected final synchronized int seekImpl(int msec) {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
-        int pts0 = getVideoPTS0(moviePtr);
-        int pts1 = seek0(moviePtr, msec);
-        System.err.println("Seek: "+pts0+" -> "+msec+" : "+pts1);
-        return pts1;
+        return seek0(moviePtr, msec);
     }
 
     @Override
@@ -427,7 +478,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             psm.restore(gl);
         }
         if( 0 < avPTS ) {
-            vSTS = avPTS;
             nextFrame.setPTS(avPTS);
             return true;
         } else {
@@ -436,50 +486,15 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
     
     private final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
-        aSTS = audio_pts;
-        final AudioSink.AudioFrame frame = new AudioSink.AudioFrame(sampleData, data_size, audio_pts);
-        if( audioSink.isDataAvailable(frame.dataSize) ) {
-            audioSink.writeData(frame);
+        setFirstAudioPTS2SCR( audio_pts );
+        if( 1.0f == playSpeed || audioSinkPlaySpeedSet ) {
+            audioSink.enqueueData( new AudioSink.AudioFrame(sampleData, data_size, audio_pts ) );
         }
     }
-    
-    /** last audio streaming TS */
-    private int aSTS = 0;
-    /** last video streaming TS */
-    private int vSTS = 0;
-    
-    private long lastAudioTime = 0;
-    private static final int audio_dt_d = 400;
-    private long lastVideoTime = 0;
-    private static final int video_dt_d = 9;
-    
+
     @Override
-    protected final void syncFrame2Audio(TextureFrame frame) {
-        /** 
-        // poor mans video sync .. TODO: off thread 'readNextPackage0(..)' on shared GLContext and multi textures/unit!
-        final long now = System.currentTimeMillis();
-        // Try sync video to audio
-        final long now_d = now - lastAudioTime;
-        final long pts_d = vSTS - aSTS - 444; // hack 444 == play video 444ms ahead of audio
-        final long dt = Math.min(47, (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ) ;
-        //final long dt = (long) ( (float) ( pts_d - now_d ) / getPlaySpeed() ) ;
-        final boolean sleep = dt>video_dt_d && dt<1000 && audioSink.getQueuedByteCount()<maxAvailableAudio-10000;
-        final long sleepP = dt-video_dt_d;
-        if(DEBUG) {
-            final int qAT = audioSink.getQueuedTime();
-            System.err.println("s: pts-v "+vSTS+", qAT "+qAT+", pts-d "+pts_d+", now_d "+now_d+", dt "+dt+", sleep "+sleep+", sleepP "+sleepP+" ms");
-        }
-        // ?? Maybe use audioSink.getQueuedTime();
-        if( sleep ) {
-            try {
-                Thread.sleep(sleepP);
-            } catch (InterruptedException e) { }
-            lastVideoTime = System.currentTimeMillis();
-        } else { 
-            lastVideoTime = now;
-        }   
-        */
-    }
+    protected final boolean syncAVRequired() { return true; }
+    
     private static native int getAvUtilVersion0();
     private static native int getAvFormatVersion0();
     private static native int getAvCodecVersion0();
@@ -488,10 +503,17 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     private native void destroyInstance0(long moviePtr);
     
     /**
-     * Issues {@link #updateAttributes(int, int, int, int, int, float, int, int, String, String)}
+     * Issues {@link #updateAttributes(int, int, int, int, int, int, int, float, int, int, String, String)}
      * and {@link #updateAttributes2(int, int, int, int, int, int, int, int, int, int)}.
+     * <p>
+     * Always uses {@link AudioSink.AudioDataFormat}:
+     * <pre>
+     *   [type PCM, sampleRate [10000(?)..44100..48000], sampleSize 16, channelCount 1-2, signed, littleEndian]
+     * </pre>
+     * </p>
      */
-    private native void setStream0(long moviePtr, String url, int vid, int aid, int audioFrameCount);
+    private native void setStream0(long moviePtr, String url, int vid, int aid, int audioFrameCount,
+                                   int aChannelCount, int aSampleRate);
     private native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError);
 
     private native int getVideoPTS0(long moviePtr);    
@@ -505,6 +527,32 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     private native int readNextPacket0(long moviePtr, int texTarget, int texFmt, int texType);
     
     private native int seek0(long moviePtr, int position);
+    
+    public static enum SampleFormat {
+        // NONE = -1,
+        U8,          ///< unsigned 8 bits
+        S16,         ///< signed 16 bits
+        S32,         ///< signed 32 bits
+        FLT,         ///< float
+        DBL,         ///< double
+
+        U8P,         ///< unsigned 8 bits, planar
+        S16P,        ///< signed 16 bits, planar
+        S32P,        ///< signed 32 bits, planar
+        FLTP,        ///< float, planar
+        DBLP,        ///< double, planar
+        
+        COUNT;       ///< Number of sample formats.
+        
+        public static SampleFormat valueOf(int i) {
+            for (SampleFormat fmt : SampleFormat.values()) {
+                if(fmt.ordinal() == i) {
+                    return fmt;
+                }
+            }
+            return null;            
+        }
+    };
 
     public static enum PixelFormat {
         // NONE= -1,
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index a21bb40a8..d03cad28a 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -88,15 +88,16 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     
     @Override
     protected void destroyImpl(GL gl) {
-        _detachVideoRenderer(moviePtr);
         if (moviePtr != 0) {
+            _stop(moviePtr);
+            _detachVideoRenderer(moviePtr);
             _destroyInstance(moviePtr);
             moviePtr = 0;
         }
     }
     
     @Override
-    protected void initGLStreamImpl(GL gl) throws IOException {
+    protected void initGLStreamImpl(GL gl, int vid, int aid) throws IOException {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
@@ -112,13 +113,9 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         System.out.println("setURL: p2 "+this);        
     }
     
-    @Override
-    protected int getCurrentPositionImpl() {
-        return 0!=moviePtr ? _getCurrentPosition(moviePtr) : 0;
-    }
     @Override
     protected int getAudioPTSImpl() {
-        return getCurrentPositionImpl();
+        return 0!=moviePtr ? _getCurrentPosition(moviePtr) : 0;
     }
 
     @Override
@@ -131,7 +128,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     @Override
-    public synchronized boolean startImpl() {
+    public synchronized boolean playImpl() {
         if(0==moviePtr) {
             return false;
         }
@@ -149,16 +146,6 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         return true;
     }
 
-    /** @return time position after issuing the command */
-    @Override
-    public synchronized boolean stopImpl() {
-        if(0==moviePtr) {
-            return false;
-        }
-        _stop(moviePtr);
-        return true;
-    }
-
     /** @return time position after issuing the command */
     @Override
     protected int seekImpl(int msec) {
@@ -184,8 +171,6 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         }
         return true;
     }
-    @Override
-    protected void syncFrame2Audio(TextureFrame frame) { }
     
     private String replaceAll(String orig, String search, String repl) {
         String dest=null;
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index 2dff1110c..081e17323 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -58,6 +58,18 @@ typedef GLenum (APIENTRYP PFNGLGETERRORPROC) (void);
  */
 #define AV_TIME_BASE_MSEC    (AV_TIME_BASE/1000)
 
+#define AV_VERSION_MAJOR(i) ( ( i >> 16 ) & 0xFF )
+#define AV_VERSION_MINOR(i) ( ( i >>  8 ) & 0xFF )
+#define AV_VERSION_SUB(i)   ( ( i >>  0 ) & 0xFF )
+
+/** Sync w/ GLMediaPlayer.STREAM_ID_NONE */
+#define AV_STREAM_ID_NONE -2
+
+/** Sync w/ GLMediaPlayer.STREAM_ID_AUTO */
+#define AV_STREAM_ID_AUTO -1
+
+#define AV_HAS_API_REQUEST_CHANNELS(pAV) (AV_VERSION_MAJOR(pAV->avcodecVersion) < 55)
+
 static inline float my_av_q2f(AVRational a){
     return a.num / (float) a.den;
 }
@@ -68,6 +80,10 @@ static inline int32_t my_av_q2i32(int32_t snum, AVRational a){
 typedef struct {
     int32_t          verbose;
 
+    uint32_t         avcodecVersion;
+    uint32_t         avformatVersion;
+    uint32_t         avutilVersion;
+
     PFNGLTEXSUBIMAGE2DPROC procAddrGLTexSubImage2D;
     PFNGLGETERRORPROC procAddrGLGetError;
 
@@ -103,7 +119,8 @@ typedef struct {
     int32_t          bps_stream; // bits per seconds
     int32_t          bps_video;  // bits per seconds
     int32_t          bps_audio;  // bits per seconds
-    int32_t          totalFrames;
+    int32_t          frames_video;
+    int32_t          frames_audio;
     int32_t          duration;   // msec
     int32_t          start_time; // msec
 
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
index 346ba6c07..bc376cebd 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
+++ b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
@@ -31,6 +31,7 @@
 #include "JoglCommon.h"
 #include "ffmpeg_tool.h"
 #include <libavutil/pixdesc.h>
+#include <libavutil/samplefmt.h>
 #include <GL/gl.h>
 
 static const char * const ClazzNameFFMPEGMediaPlayer = "jogamp/opengl/util/av/impl/FFMPEGMediaPlayer";
@@ -204,17 +205,18 @@ static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasic
         }
 
         (*env)->CallVoidMethod(env, instance, jni_mid_updateAttributes1,
+                               pAV->vid, pAV->aid,
                                w, h, 
                                pAV->bps_stream, pAV->bps_video, pAV->bps_audio,
-                               pAV->fps, (int32_t)((pAV->duration/1000)*pAV->fps), pAV->duration,
+                               pAV->fps, pAV->frames_video, pAV->frames_audio, pAV->duration,
                                (*env)->NewStringUTF(env, pAV->vcodec),
                                (*env)->NewStringUTF(env, pAV->acodec) );
         (*env)->CallVoidMethod(env, instance, jni_mid_updateAttributes2,
                                pAV->vPixFmt, pAV->vBufferPlanes, 
                                pAV->vBitsPerPixel, pAV->vBytesPerPixelPerPlane,
                                pAV->vLinesize[0], pAV->vLinesize[1], pAV->vLinesize[2],
-                               pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2]);
-        // JoglCommon_ReleaseJNIEnv (shallBeDetached);
+                               pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2],
+                               pAV->aSampleFmt, pAV->aSampleRate, pAV->aChannels);
     }
 }
 
@@ -337,8 +339,8 @@ JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_ini
     }
 
     jni_mid_pushSound = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "pushSound", "(Ljava/nio/ByteBuffer;II)V");
-    jni_mid_updateAttributes1 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIFIILjava/lang/String;Ljava/lang/String;)V");
-    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIII)V");
+    jni_mid_updateAttributes1 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIIIFIIILjava/lang/String;Ljava/lang/String;)V");
+    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIII)V");
 
     if(jni_mid_pushSound == NULL ||
        jni_mid_updateAttributes1 == NULL ||
@@ -356,6 +358,10 @@ JNIEXPORT jlong JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_create
         JoglCommon_throwNewRuntimeException(env, "Couldn't alloc instance");
         return 0;
     }
+    pAV->avcodecVersion = sp_avcodec_version();
+    pAV->avformatVersion = sp_avformat_version(); 
+    pAV->avutilVersion = sp_avutil_version();
+
     // Register all formats and codecs
     sp_av_register_all();
     // Network too ..
@@ -364,8 +370,8 @@ JNIEXPORT jlong JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_create
     }
 
     pAV->verbose = verbose;
-    pAV->vid=-1;
-    pAV->aid=-1;
+    pAV->vid=AV_STREAM_ID_AUTO;
+    pAV->aid=AV_STREAM_ID_AUTO;
 
     return (jlong) (intptr_t) pAV;
 }
@@ -380,8 +386,23 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_destroy
   }
 }
 
+static uint64_t getDefaultAudioChannelLayout(int channelCount) {
+    switch(channelCount) {
+        case 1: return AV_CH_LAYOUT_MONO;
+        case 2: return AV_CH_LAYOUT_STEREO;
+        case 3: return AV_CH_LAYOUT_SURROUND;
+        case 4: return AV_CH_LAYOUT_QUAD;
+        case 5: return AV_CH_LAYOUT_5POINT0;
+        case 6: return AV_CH_LAYOUT_5POINT1;
+        case 7: return AV_CH_LAYOUT_6POINT1;
+        case 8: return AV_CH_LAYOUT_7POINT1;
+        default: return AV_CH_LAYOUT_NATIVE;
+    }
+}
+
 JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStream0
-  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jint vid, jint aid, jint audioFrameCount)
+  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jint vid, jint aid, jint audioFrameCount,
+   jint aChannelCount, jint aSampleRate)
 {
     int res, i;
     jboolean iscopy;
@@ -434,27 +455,39 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
         pAV->bps_stream = pAV->pFormatCtx->bit_rate;
     }
 
-    fprintf(stderr, "Streams: %d\n", pAV->pFormatCtx->nb_streams); // JAU
+    if(pAV->verbose) {
+        fprintf(stderr, "Streams: %d, req vid %d aid %d\n", pAV->pFormatCtx->nb_streams, vid, aid);
+    }
 
     // Find the first audio and video stream, or the one matching vid
     // FIXME: Libav Binary compatibility! JAU01
-    for(i=0; ( -1==pAV->aid || -1==pAV->vid ) && i<pAV->pFormatCtx->nb_streams; i++) {
+    for(i=0; ( AV_STREAM_ID_AUTO==pAV->aid || AV_STREAM_ID_AUTO==pAV->vid ) && i<pAV->pFormatCtx->nb_streams; i++) {
         AVStream *st = pAV->pFormatCtx->streams[i];
-        fprintf(stderr, "Stream: %d: is-video %d, is-audio %d\n", i, (AVMEDIA_TYPE_VIDEO == st->codec->codec_type), AVMEDIA_TYPE_AUDIO == st->codec->codec_type); // JAU
+        if(pAV->verbose) {
+            fprintf(stderr, "Stream: %d: is-video %d, is-audio %d\n", i, (AVMEDIA_TYPE_VIDEO == st->codec->codec_type), AVMEDIA_TYPE_AUDIO == st->codec->codec_type);
+        }
         if(AVMEDIA_TYPE_VIDEO == st->codec->codec_type) {
-            if(-1==pAV->vid && (-1==vid || vid == i) ) {
+            if(AV_STREAM_ID_AUTO==pAV->vid && (AV_STREAM_ID_AUTO==vid || vid == i) ) {
                 pAV->pVStream = st;
                 pAV->vid=i;
             }
         } else if(AVMEDIA_TYPE_AUDIO == st->codec->codec_type) {
-            if(-1==pAV->aid && (-1==aid || aid == i) ) {
+            if(AV_STREAM_ID_AUTO==pAV->aid && (AV_STREAM_ID_AUTO==aid || aid == i) ) {
                 pAV->pAStream = st;
                 pAV->aid=i;
             }
         }
     }
+    if( AV_STREAM_ID_AUTO == pAV->aid ) {
+        pAV->aid = AV_STREAM_ID_NONE;
+    }
+    if( AV_STREAM_ID_AUTO == pAV->vid ) {
+        pAV->vid = AV_STREAM_ID_NONE;
+    }
 
-    fprintf(stderr, "Found vid %d, aid %d\n", pAV->vid, pAV->aid); // JAU
+    if( pAV->verbose ) {
+        fprintf(stderr, "Found vid %d, aid %d\n", pAV->vid, pAV->aid);
+    }
 
     if(0<=pAV->aid) {
         // Get a pointer to the codec context for the audio stream
@@ -465,6 +498,23 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
         if (pAV->pACodecCtx->bit_rate) {
             pAV->bps_audio = pAV->pACodecCtx->bit_rate;
         }
+
+        // Customize ..
+        // pAV->pACodecCtx->thread_count=2;
+        // pAV->pACodecCtx->thread_type=FF_THREAD_FRAME|FF_THREAD_SLICE; // Decode more than one frame at once
+        pAV->pACodecCtx->thread_count=1;
+        pAV->pACodecCtx->thread_type=0;
+        pAV->pACodecCtx->workaround_bugs=FF_BUG_AUTODETECT;
+        pAV->pACodecCtx->skip_frame=AVDISCARD_DEFAULT;
+
+        pAV->pACodecCtx->request_channel_layout=getDefaultAudioChannelLayout(aChannelCount);
+        if( AV_HAS_API_REQUEST_CHANNELS(pAV) && 1 <= aChannelCount && aChannelCount <= 2 ) {
+            pAV->pACodecCtx->request_channels=aChannelCount;
+        }
+        pAV->pACodecCtx->request_sample_fmt=AV_SAMPLE_FMT_S16;
+        // ignored: aSampleRate !
+        pAV->pACodecCtx->skip_frame=AVDISCARD_DEFAULT;
+
         sp_avcodec_string(pAV->acodec, sizeof(pAV->acodec), pAV->pACodecCtx, 0);
 
         // Find the decoder for the audio stream
@@ -489,8 +539,17 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
         // FIXME: Libav Binary compatibility! JAU01
         pAV->aSampleRate = pAV->pACodecCtx->sample_rate;
         pAV->aChannels = pAV->pACodecCtx->channels;
-        pAV->aFrameSize = pAV->pACodecCtx->frame_size;
+        pAV->aFrameSize = pAV->pACodecCtx->frame_size; // in samples!
         pAV->aSampleFmt = pAV->pACodecCtx->sample_fmt;
+        pAV->frames_audio = pAV->pAStream->nb_frames;
+
+        if( pAV->verbose ) {
+            fprintf(stderr, "A channels %d, sample_rate %d, frame_size %d, frame_number %d, r_frame_rate %f, avg_frame_rate %f, nb_frames %d, \n", 
+                pAV->aChannels, pAV->aSampleRate, pAV->aFrameSize, pAV->pACodecCtx->frame_number,
+                my_av_q2f(pAV->pAStream->r_frame_rate),
+                my_av_q2f(pAV->pAStream->avg_frame_rate),
+                pAV->pAStream->nb_frames);
+        }
 
         pAV->aFrameCount = audioFrameCount;
         pAV->pAFrames = calloc(audioFrameCount, sizeof(AVFrame*));
@@ -516,6 +575,15 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
             // FIXME: Libav Binary compatibility! JAU01
             pAV->bps_video = pAV->pVCodecCtx->bit_rate;
         }
+
+        // Customize ..
+        // pAV->pVCodecCtx->thread_count=2;
+        // pAV->pVCodecCtx->thread_type=FF_THREAD_FRAME|FF_THREAD_SLICE; // Decode more than one frame at once
+        pAV->pVCodecCtx->thread_count=1;
+        pAV->pVCodecCtx->thread_type=0;
+        pAV->pVCodecCtx->workaround_bugs=FF_BUG_AUTODETECT;
+        pAV->pVCodecCtx->skip_frame=AVDISCARD_DEFAULT;
+
         sp_avcodec_string(pAV->vcodec, sizeof(pAV->vcodec), pAV->pVCodecCtx, 0);
 
         // Find the decoder for the video stream
@@ -542,8 +610,21 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
             pAV->pVCodecCtx->time_base.den=1000;
         }
         // FIXME: Libav Binary compatibility! JAU01
-        pAV->fps = my_av_q2f(pAV->pVStream->avg_frame_rate);
+        if( 0 < pAV->pVStream->avg_frame_rate.den ) {
+            pAV->fps = my_av_q2f(pAV->pVStream->avg_frame_rate);
+        } else {
+            pAV->fps = my_av_q2f(pAV->pVStream->r_frame_rate);
+        }
+        pAV->frames_video = pAV->pVStream->nb_frames;
             
+        if( pAV->verbose ) {
+            fprintf(stderr, "V frame_size %d, frame_number %d, r_frame_rate %f %d/%d, avg_frame_rate %f %d/%d, nb_frames %d, \n", 
+                pAV->pVCodecCtx->frame_size, pAV->pVCodecCtx->frame_number, 
+                my_av_q2f(pAV->pVStream->r_frame_rate), pAV->pVStream->r_frame_rate.num, pAV->pVStream->r_frame_rate.den, 
+                my_av_q2f(pAV->pVStream->avg_frame_rate), pAV->pVStream->avg_frame_rate.num, pAV->pVStream->avg_frame_rate.den,
+                pAV->pVStream->nb_frames);
+        }
+
         // Allocate video frames
         // FIXME: Libav Binary compatibility! JAU01
         pAV->vPixFmt = pAV->pVCodecCtx->pix_fmt;
@@ -589,6 +670,14 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setGLFu
     pAV->procAddrGLGetError = (PFNGLGETERRORPROC) (intptr_t)jProcAddrGLGetError;
 }
 
+#if 0
+#define DBG_TEXSUBIMG2D_a(c,p,i) fprintf(stderr, "TexSubImage2D.%c offset %d / %d, size %d x %d, ", c, p->pVCodecCtx->width, p->pVCodecCtx->height/2, p->vTexWidth[i], p->pVCodecCtx->height/2)
+#define DBG_TEXSUBIMG2D_b(p) fprintf(stderr, "err 0x%X\n", pAV->procAddrGLGetError())
+#else
+#define DBG_TEXSUBIMG2D_a(c,p,i)
+#define DBG_TEXSUBIMG2D_b(p)
+#endif
+
 JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNextPacket0
   (JNIEnv *env, jobject instance, jlong ptr, jint texTarget, jint texFmt, jint texType)
 {
@@ -607,11 +696,10 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
             }
             AVFrame* pAFrameCurrent = pAV->pAFrames[pAV->aFrameCurrent];
             pAV->aFrameCurrent = ( pAV->aFrameCurrent + 1 ) % pAV->aFrameCount ;
-            int new_packet = 1;
-            int len1;
+            int frameCount;
             int flush_complete = 0;
-            while (packet.size > 0 || (!packet.data && new_packet)) {
-                new_packet = 0;
+            for ( frameCount=0; 0 < packet.size || 0 == frameCount; frameCount++ ) {
+                int len1;
                 if (flush_complete) {
                     break;
                 }
@@ -640,7 +728,7 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                     continue;
                 }
 
-                int data_size = 0;
+                int32_t data_size = 0;
                 if(HAS_FUNC(sp_av_samples_get_buffer_size)) {
                     data_size = sp_av_samples_get_buffer_size(NULL /* linesize, may be NULL */,
                                                               pAV->aChannels,
@@ -648,16 +736,25 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                                                               pAFrameCurrent->format,
                                                               1 /* align */);
                 }
-                int32_t pts = (int64_t) ( pAFrameCurrent->pkt_pts * (int64_t) 1000 * (int64_t) pAV->pAStream->time_base.num )
-                              / (int64_t) pAV->pAStream->time_base.den;
                 #if 0
-                printf("channels %d sample_rate %d \n", pAV->aChannels , pAV->aSampleRate);
-                printf("data %d \n", pAV->aFrameSize); 
+                fprintf(stderr, "channels %d sample_rate %d \n", pAV->aChannels , pAV->aSampleRate);
+                fprintf(stderr, "data %d \n", pAV->aFrameSize); 
                 #endif
-                pAV->aPTS += (int64_t) ( data_size * (int64_t) 1000 )
-                             / (int64_t) (2 * (int64_t) pAV->aChannels * (int64_t) pAV->aSampleRate);
+
+                const AVRational time_base = pAV->pAStream->time_base;
+                const int64_t pkt_pts = pAFrameCurrent->pkt_pts;
+                int aptsMode;
+                if( 0 == frameCount && AV_NOPTS_VALUE != pkt_pts ) { // 1st frame only, discard invalid PTS ..
+                    pAV->aPTS = (pkt_pts * (int64_t) 1000 * (int64_t) time_base.num) / (int64_t) time_base.den ;
+                    aptsMode = 0;
+                } else { // subsequent frames or invalid PTS ..
+                    const int32_t bytesPerSample = 2; // av_get_bytes_per_sample( pAV->pACodecCtx->sample_fmt );
+                    pAV->aPTS += data_size / ( pAV->aChannels * bytesPerSample * ( pAV->aSampleRate / 1000 ) );
+                    aptsMode = 1;
+                }
                 if( pAV->verbose ) {
-                    printf("A pts %d - %d\n", pts, pAV->aPTS);
+                    fprintf(stderr, "A pts %d [pkt_pts %ld, pkt_dts %ld], dataSize %d, f# %d, pts-mode %d\n", 
+                        pAV->aPTS, pkt_pts, pAFrameCurrent->pkt_dts, data_size, frameCount, aptsMode);
                 }
                 if( NULL != env ) {
                     jobject jSampleData = (*env)->NewDirectByteBuffer(env, pAFrameCurrent->data[0], data_size);
@@ -671,19 +768,14 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 sp_av_free_packet(&packet);
                 return 0;
             }
-
-            int new_packet = 1;
-            int len1;
+            int frameCount;
             int flush_complete = 0;
-            while (packet.size > 0 || (!packet.data && new_packet)) {
-
-                new_packet = 0;
+            for ( frameCount=0; 0 < packet.size || 0 == frameCount; frameCount++ ) {
+                int len1;
                 if (flush_complete) {
                     break;
                 }
-
                 len1 = sp_avcodec_decode_video2(pAV->pVCodecCtx, pAV->pVFrame, &frameFinished, &packet);
-
                 if (len1 < 0) {
                     // if error, we skip the frame
                     packet.size = 0;
@@ -702,71 +794,46 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
 
                 // FIXME: Libav Binary compatibility! JAU01
                 const AVRational time_base = pAV->pVStream->time_base;
-                const int64_t pts = pAV->pVFrame->pkt_pts;
-                if(AV_NOPTS_VALUE != pts) { // discard invalid PTS ..
-                    pAV->vPTS = (pts * (int64_t) 1000 * (int64_t) time_base.num) / (int64_t) time_base.den ;
-
-                    #if 0
-                    printf("PTS %d = %ld * ( ( 1000 * %ld ) / %ld ) '1000 * time_base', time_base = %lf\n",
-                        pAV->vPTS, pAV->pVFrame->pkt_pts, time_base.num, time_base.den, (time_base.num/(double)time_base.den));
-                    #endif
+                const int64_t pkt_pts = pAV->pVFrame->pkt_pts;
+                if(AV_NOPTS_VALUE != pkt_pts) { // discard invalid PTS ..
+                    int32_t vPTS2 = (pAV->pVFrame->pkt_dts * (int64_t) 1000 * (int64_t) time_base.num) / (int64_t) time_base.den ;
+                    pAV->vPTS = (pkt_pts * (int64_t) 1000 * (int64_t) time_base.num) / (int64_t) time_base.den ;
+                    if( pAV->verbose ) {
+                        fprintf(stderr, "V pts %d [pkt_pts %ld], pts2 %d [pkt_dts %ld]\n", pAV->vPTS, pkt_pts, vPTS2, pAV->pVFrame->pkt_dts);
+                    }
+                } else {
+                    if( pAV->verbose ) {
+                        fprintf(stderr, "V pts ?? [pkt_pts %ld], pts2 ?? [pkt_dts %ld]\n", pkt_pts, pAV->pVFrame->pkt_dts);
+                    }
                 }
                 resPTS = pAV->vPTS; // Video Frame!
 
-                #if 0
-                printf("tex2D codec %dx%d - frame %dx%d - width %d tex / %d linesize, pixfmt 0x%X, texType 0x%x, texTarget 0x%x\n", 
-                         pAV->pVCodecCtx->width, pAV->pVCodecCtx->height, 
-                         pAV->pVFrame->width, pAV->pVFrame->height, pAV->vTexWidth[0], pAV->pVFrame->linesize[0],
-                         texFmt, texType, texTarget);
-                #endif
-
                 // 1st plane or complete packed frame
                 // FIXME: Libav Binary compatibility! JAU01
-                #if 0
-                GLenum glerr = pAV->procAddrGLGetError();
-                printf("TexSubImage2D.1 texTarget 0x%x, offset %d / %d, size %d x %d, fmt 0x%X, type 0x%X, pre-err 0x%X, ", 
-                         texTarget, 0, 0, pAV->vTexWidth[0], pAV->pVCodecCtx->height, texFmt, texType, glerr);
-                #endif
+                DBG_TEXSUBIMG2D_a('Y',pAV,0);
                 pAV->procAddrGLTexSubImage2D(texTarget, 0, 
                                         0,                 0, 
                                         pAV->vTexWidth[0], pAV->pVCodecCtx->height, 
                                         texFmt, texType, pAV->pVFrame->data[0]);
-                #if 0
-                glerr = pAV->procAddrGLGetError();
-                printf("err 0x%X\n", glerr);
-                #endif
+                DBG_TEXSUBIMG2D_b(pAV);
 
                 if(pAV->vPixFmt == PIX_FMT_YUV420P) {
                     // U plane
                     // FIXME: Libav Binary compatibility! JAU01
-                    #if 0
-                    printf("TexSubImage2D.U texTarget 0x%x, offset %d / %d, size %d x %d, fmt 0x%X, type 0x%X, ", 
-                             texTarget, pAV->pVCodecCtx->width, 0, pAV->vTexWidth[1], pAV->pVCodecCtx->height/2,
-                             texFmt, texType);
-                    #endif
+                    DBG_TEXSUBIMG2D_a('U',pAV,1);
                     pAV->procAddrGLTexSubImage2D(texTarget, 0, 
                                             pAV->pVCodecCtx->width, 0,
                                             pAV->vTexWidth[1],      pAV->pVCodecCtx->height/2, 
                                             texFmt, texType, pAV->pVFrame->data[1]);
-                    #if 0
-                    glerr = pAV->procAddrGLGetError();
-                    printf("err 0x%X\n", glerr);
-                    #endif
+                    DBG_TEXSUBIMG2D_b(pAV);
                     // V plane
                     // FIXME: Libav Binary compatibility! JAU01
-                    #if 0
-                    printf("TexSubImage2D.V texTarget 0x%x, offset %d / %d, size %d x %d, fmt 0x%X, type 0x%X, ", 
-                             texTarget, pAV->pVCodecCtx->width, pAV->pVCodecCtx->height/2, pAV->vTexWidth[2], pAV->pVCodecCtx->height/2,
-                             texFmt, texType);
-                    #endif
+                    DBG_TEXSUBIMG2D_a('V',pAV,2);
                     pAV->procAddrGLTexSubImage2D(texTarget, 0, 
                                             pAV->pVCodecCtx->width, pAV->pVCodecCtx->height/2,
                                             pAV->vTexWidth[2],      pAV->pVCodecCtx->height/2, 
                                             texFmt, texType, pAV->pVFrame->data[2]);
-                    #if 0
-                    glerr = pAV->procAddrGLGetError();
-                    printf("err 0x%X\n", glerr);
-                    #endif
+                    DBG_TEXSUBIMG2D_b(pAV);
                 } // FIXME: Add more planar formats !
             }
         }
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
index 3e61e509c..e905bfeab 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
@@ -44,6 +44,7 @@ import com.jogamp.newt.opengl.GLWindow;
 
 import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
 
 import android.os.Bundle;
 import android.util.Log;
@@ -84,7 +85,7 @@ public class MovieCubeActivity0 extends NewtBaseActivity {
            final Animator animator = new Animator();
            
            // Main           
-           final MovieCube demoMain = new MovieCube(urlConnection0, -2.3f, 0f, 0f);
+           final MovieCube demoMain = new MovieCube(urlConnection0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, -2.3f, 0f, 0f);
            final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
            glWindowMain.setFullscreen(true);
            setContentView(getWindow(), glWindowMain);
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
index bcff3d5bd..7a92360fb 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
@@ -45,6 +45,7 @@ import com.jogamp.newt.opengl.GLWindow;
 
 import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
 
 import android.os.Bundle;
 import android.util.Log;
@@ -84,7 +85,7 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
            final Animator animator = new Animator();
            
            // Main           
-           final MovieSimple demoMain = new MovieSimple(urlConnection0);
+           final MovieSimple demoMain = new MovieSimple(urlConnection0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO);
            demoMain.setScaleOrig(true);
            final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
            glWindowMain.setFullscreen(true);
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
index cb0fd0720..d0fb41828 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
@@ -111,7 +111,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
            final Animator animator = new Animator();
            
            // Main           
-           final MovieSimple demoMain = new MovieSimple(urlConnection0);
+           final MovieSimple demoMain = new MovieSimple(urlConnection0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO);
            if(mPlayerHUD) {
                demoMain.setEffects(MovieSimple.EFFECT_GRADIENT_BOTTOM2TOP);
                demoMain.setTransparency(0.9f);
@@ -154,7 +154,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
                            glWindowHUD.addGLEventListener(new MovieSimple(sharedPlayer));                            
                         } else {
                            try {
-                               glWindowHUD.addGLEventListener(new MovieSimple(urlConnection1));
+                               glWindowHUD.addGLEventListener(new MovieSimple(urlConnection1, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO));
                            } catch (IOException e) {
                                e.printStackTrace();
                            }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
index adccecba0..556d17992 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
@@ -332,22 +332,32 @@ public class TextureSequenceCubeES2 implements GLEventListener {
     }
 
 
+    @Override
     public void dispose(GLAutoDrawable drawable) {
         GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         texSeq = null;        
         pmvMatrixUniform = null;
-        pmvMatrix.destroy();
-        pmvMatrix=null;
-        st.destroy(gl);
-        st=null;
+        if( null != pmvMatrix ) {
+            pmvMatrix.destroy();
+            pmvMatrix=null;
+        }
+        if( null != st ) {
+            st.destroy(gl);
+            st=null;
+        }
     }
 
+    @Override
     public void display(GLAutoDrawable drawable) {
         GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-
+        
+        if( null == st ) {
+            return;
+        }
+        
         st.useProgram(gl, true);
         
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
@@ -379,9 +389,6 @@ public class TextureSequenceCubeES2 implements GLEventListener {
         st.useProgram(gl, false);        
     }
 
-    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
-    }
-    
     static final float[] light_position = { -50.f, 50.f, 50.f, 0.f };
     static final float[] light_ambient = { 0.125f, 0.125f, 0.125f, 1.f };
     static final float[] light_diffuse = { 1.0f, 1.0f, 1.0f, 1.f };
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index 3f979e16f..fbbd77260 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -57,6 +57,7 @@ import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.JoglVersion;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.TextureSequenceCubeES2;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
@@ -67,20 +68,25 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
     static boolean waitForKey = false;
     int textureCount = 3; // default - threaded
     final URLConnection stream;
+    final int vid, aid;
     final float zoom0, rotx, roty;
     TextureSequenceCubeES2 cube=null;
     GLMediaPlayer mPlayer=null;
     
     public MovieCube() throws IOException {
         this(new URL("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4").openConnection(), 
-             -2.3f, 0f, 0f);        
+             GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, -2.3f, 0f, 0f);        
     }
     
-    public MovieCube(URLConnection stream, float zoom0, float rotx, float roty) throws IOException {
+    public MovieCube(URLConnection stream, int vid, int aid, float zoom0, float rotx, float roty) throws IOException {
         this.stream = stream;
         this.zoom0 = zoom0;
         this.rotx = rotx;
         this.roty = roty;
+        this.vid = vid;
+        this.aid = aid;
+        mPlayer = GLMediaPlayerFactory.createDefault();
+        mPlayer.addEventListener(this);        
     }
 
     public void setTextureCount(int v) {
@@ -89,11 +95,11 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
     
     private final KeyListener keyAction = new KeyAdapter() {
         public void keyReleased(KeyEvent e)  {
-            if( !e.isPrintableKey() || e.isAutoRepeat() ) {
+            if( e.isAutoRepeat() ) {
                 return;
             }            
             System.err.println("MC "+e);
-            int pts0 = mPlayer.getCurrentPosition();
+            int pts0 = mPlayer.getVideoPTS();
             int pts1 = 0;
             switch(e.getKeyCode()) {
                 case KeyEvent.VK_3:
@@ -107,21 +113,37 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
                 case KeyEvent.VK_ESCAPE:
                 case KeyEvent.VK_DELETE:
                 case KeyEvent.VK_BACK_SPACE: {
-                    mPlayer.seek(0);
                     mPlayer.setPlaySpeed(1.0f);
-                    mPlayer.start();
+                    mPlayer.seek(0);
+                    mPlayer.play();
                     break;
                 }
                 case KeyEvent.VK_SPACE: {
                     if(GLMediaPlayer.State.Paused == mPlayer.getState()) {
-                        mPlayer.start();
+                        mPlayer.play();
                     } else {
                         mPlayer.pause();
                     }
                     break;
                 }
-                case KeyEvent.VK_S: mPlayer.setPlaySpeed(mPlayer.getPlaySpeed()/2.0f); break;
-                case KeyEvent.VK_F: mPlayer.setPlaySpeed(mPlayer.getPlaySpeed()*2.0f); break;
+                case KeyEvent.VK_SUBTRACT: {
+                      float playSpeed = mPlayer.getPlaySpeed();
+                      if( e.isShiftDown() ) {
+                          playSpeed /= 2.0f;
+                      } else {
+                          playSpeed -= 0.1f;
+                      }
+                      mPlayer.setPlaySpeed(playSpeed); 
+                    } break;
+                case KeyEvent.VK_ADD: {
+                      float playSpeed = mPlayer.getPlaySpeed();
+                      if( e.isShiftDown() ) {
+                          playSpeed *= 2.0f;
+                      } else {
+                          playSpeed += 0.1f;
+                      }
+                      mPlayer.setPlaySpeed(playSpeed); 
+                    } break;
             }
             
             if( 0 != pts1 ) {
@@ -140,25 +162,18 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         // System.out.println("newFrameAvailable: "+mp+", when "+when);
     }
 
+    @Override
     public void init(GLAutoDrawable drawable) {
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
 
-        mPlayer = GLMediaPlayerFactory.createDefault();
-        mPlayer.addEventListener(this);
         cube = new TextureSequenceCubeES2(mPlayer, false, zoom0, rotx, roty);        
         
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
-            System.err.println("Press enter to continue");
-            try {
-                System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            UITestCase.waitForKey("Init>");
         }
         try {
-            System.out.println("p0 "+mPlayer);
-            mPlayer.initGLStream(gl, textureCount, stream);
-            System.out.println("p1 "+mPlayer);
+            mPlayer.initGLStream(gl, textureCount, stream, vid, aid);
         } catch (Exception e) { 
             e.printStackTrace(); 
             if(null != mPlayer) {
@@ -169,7 +184,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         }
         
         cube.init(drawable);
-        mPlayer.start();
+        mPlayer.play();
 
         boolean added;
         final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -181,30 +196,38 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         System.err.println("MC.init: kl-added "+added+", "+drawable.getClass().getName());
     }
 
+    @Override
     public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
         if(null == mPlayer) { return; }
         cube.reshape(drawable, x, y, width, height);
     }
 
+    @Override
     public void dispose(GLAutoDrawable drawable) {
         System.err.println(Thread.currentThread()+" MovieCube.dispose ... ");
         if(null == mPlayer) { return; }
-        mPlayer.stop();
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         mPlayer.destroy(gl);
         mPlayer=null;
         cube.dispose(drawable);
         cube=null;
     }
 
+    long lastPerfPos = 0;
+    
+    @Override
     public void display(GLAutoDrawable drawable) {
         if(null == mPlayer) { return; }
+        
+        final long currentPos = System.currentTimeMillis();
+        if( currentPos - lastPerfPos > 2000 ) {
+            System.err.println( mPlayer.getPerfString() );
+            lastPerfPos = currentPos;  
+        }
+        
         cube.display(drawable);
     }
 
-    public void displayChanged(javax.media.opengl.GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
-    }
-    
     public static void main(String[] args) throws MalformedURLException, IOException, InterruptedException {
         int width = 510;
         int height = 300;
@@ -214,40 +237,56 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         boolean forceES3 = false;
         boolean forceGL3 = false;
         boolean forceGLDef = false;
+        int vid = GLMediaPlayer.STREAM_ID_AUTO;
+        int aid = GLMediaPlayer.STREAM_ID_AUTO;
+        final boolean origSize;
         
-        String url_s="http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4";        
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-width")) {
-                i++;
-                width = MiscUtils.atoi(args[i], width);
-            } else if(args[i].equals("-height")) {
-                i++;
-                height = MiscUtils.atoi(args[i], height);
-            } else if(args[i].equals("-textureCount")) {
-                i++;
-                textureCount = MiscUtils.atoi(args[i], textureCount);
-            } else if(args[i].equals("-url")) {
-                i++;
-                url_s = args[i];
-            } else if(args[i].equals("-es2")) {
-                forceES2 = true;
-            } else if(args[i].equals("-es3")) {
-                forceES3 = true;
-            } else if(args[i].equals("-gl3")) {
-                forceGL3 = true;
-            } else if(args[i].equals("-gldef")) {
-                forceGLDef = true;
-            } else if(args[i].equals("-wait")) {
-                waitForKey = true;
+        String url_s="http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4";
+        {
+            boolean _origSize = false;        
+            for(int i=0; i<args.length; i++) {
+                if(args[i].equals("-vid")) {
+                    i++;
+                    vid = MiscUtils.atoi(args[i], vid);
+                } else if(args[i].equals("-aid")) {
+                    i++;
+                    aid = MiscUtils.atoi(args[i], aid);
+                } else if(args[i].equals("-width")) {
+                    i++;
+                    width = MiscUtils.atoi(args[i], width);
+                } else if(args[i].equals("-height")) {
+                    i++;
+                    height = MiscUtils.atoi(args[i], height);
+                } else if(args[i].equals("-osize")) {
+                    _origSize = true;
+                } else if(args[i].equals("-textureCount")) {
+                    i++;
+                    textureCount = MiscUtils.atoi(args[i], textureCount);
+                } else if(args[i].equals("-url")) {
+                    i++;
+                    url_s = args[i];
+                } else if(args[i].equals("-es2")) {
+                    forceES2 = true;
+                } else if(args[i].equals("-es3")) {
+                    forceES3 = true;
+                } else if(args[i].equals("-gl3")) {
+                    forceGL3 = true;
+                } else if(args[i].equals("-gldef")) {
+                    forceGLDef = true;
+                } else if(args[i].equals("-wait")) {
+                    waitForKey = true;
+                }
             }
+            origSize = _origSize;
         }
+        System.err.println("vid "+vid+", aid "+aid);
         System.err.println("textureCount "+textureCount);
         System.err.println("forceES2   "+forceES2);
         System.err.println("forceES3   "+forceES3);
         System.err.println("forceGL3   "+forceGL3);
         System.err.println("forceGLDef "+forceGLDef);
         
-        final MovieCube mc = new MovieCube(new URL(url_s).openConnection(), -2.3f, 0f, 0f);
+        final MovieCube mc = new MovieCube(new URL(url_s).openConnection(), vid, aid, -2.3f, 0f, 0f);
         
         final GLProfile glp;
         if(forceGLDef) {
@@ -265,18 +304,30 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         final GLWindow window = GLWindow.create(new GLCapabilities(glp));
         // Size OpenGL to Video Surface
         window.setSize(width, height);
-        window.setFullscreen(false);
-        window.setSize(width, height);
         window.addGLEventListener(mc);
+        
+        mc.mPlayer.addEventListener(new GLMediaEventListener() {
+            @Override
+            public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+            }
+
+            @Override
+            public void attributesChanges(final GLMediaPlayer mp, int event_mask, long when) {
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) && origSize ) {
+                    window.setSize(mp.getWidth(), mp.getHeight());
+                }
+            }            
+        });
+        
         final Animator anim = new Animator(window);
         window.addWindowListener(new WindowAdapter() {
             public void windowDestroyed(WindowEvent e) {
                 anim.stop();
             }                
         });
+        window.setVisible(true);
         anim.setUpdateFPSFrames(60, System.err);
         anim.start();
-        window.setVisible(true);
     }
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 90c73661a..f5490d19a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -46,6 +46,9 @@ import javax.media.opengl.GLUniformData;
 import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.newt.Window;
+import com.jogamp.newt.event.KeyAdapter;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.event.KeyListener;
 import com.jogamp.newt.event.MouseAdapter;
 import com.jogamp.newt.event.MouseEvent;
 import com.jogamp.newt.event.MouseListener;
@@ -54,6 +57,7 @@ import com.jogamp.newt.event.WindowEvent;
 import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.JoglVersion;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.GLArrayDataServer;
 import com.jogamp.opengl.util.PMVMatrix;
@@ -69,6 +73,7 @@ import com.jogamp.opengl.util.texture.TextureSequence;
 import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 public class MovieSimple implements GLEventListener, GLMediaEventListener {
+    static boolean waitForKey = false;
     private int winWidth, winHeight;
     int textureCount = 3; // default - threaded
     private int prevMouseX; // , prevMouseY;
@@ -98,7 +103,8 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
     }    
 
     GLMediaPlayer mPlayer;
-    URLConnection stream = null;
+    final URLConnection stream;
+    final int vid, aid;
     boolean mPlayerExternal;
     boolean mPlayerShared;
     boolean mPlayerScaleOrig;
@@ -110,7 +116,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
                 if(GLMediaPlayer.State.Playing == mPlayer.getState()) {
                     mPlayer.pause();
                 } else {
-                    mPlayer.start();
+                    mPlayer.play();
                 }
             }
         }
@@ -131,9 +137,9 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             
             if(y>winHeight/2) {
                 final float dp  = (float)(x-prevMouseX)/(float)winWidth;
-                mPlayer.seek(mPlayer.getCurrentPosition() + (int) (mPlayer.getDuration() * dp));                
+                mPlayer.seek(mPlayer.getVideoPTS() + (int) (mPlayer.getDuration() * dp));                
             } else {
-                mPlayer.start();
+                mPlayer.play();
                 rotate = 1;                
                 zoom = zoom1;
             }
@@ -149,13 +155,74 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         }
     };
     
-    public MovieSimple(URLConnection stream) throws IOException {
+    private final KeyListener keyAction = new KeyAdapter() {
+        public void keyReleased(KeyEvent e)  {
+            if( e.isAutoRepeat() ) {
+                return;
+            }            
+            System.err.println("MC "+e);
+            int pts0 = mPlayer.getVideoPTS();
+            int pts1 = 0;
+            switch(e.getKeyCode()) {
+                case KeyEvent.VK_3:
+                case KeyEvent.VK_RIGHT:      pts1 = pts0 +  1000; break;
+                case KeyEvent.VK_4:
+                case KeyEvent.VK_UP:         pts1 = pts0 + 10000; break;
+                case KeyEvent.VK_2:
+                case KeyEvent.VK_LEFT:       pts1 = pts0 -  1000; break;
+                case KeyEvent.VK_1:
+                case KeyEvent.VK_DOWN:       pts1 = pts0 - 10000; break;
+                case KeyEvent.VK_ESCAPE:
+                case KeyEvent.VK_DELETE:
+                case KeyEvent.VK_BACK_SPACE: {
+                    mPlayer.setPlaySpeed(1.0f);
+                    mPlayer.seek(0);
+                    mPlayer.play();
+                    break;
+                }
+                case KeyEvent.VK_SPACE: {
+                    if(GLMediaPlayer.State.Paused == mPlayer.getState()) {
+                        mPlayer.play();
+                    } else {
+                        mPlayer.pause();
+                    }
+                    break;
+                }
+                case KeyEvent.VK_SUBTRACT: {
+                      float playSpeed = mPlayer.getPlaySpeed();
+                      if( e.isShiftDown() ) {
+                          playSpeed /= 2.0f;
+                      } else {
+                          playSpeed -= 0.1f;
+                      }
+                      mPlayer.setPlaySpeed(playSpeed); 
+                    } break;
+                case KeyEvent.VK_ADD: {
+                      float playSpeed = mPlayer.getPlaySpeed();
+                      if( e.isShiftDown() ) {
+                          playSpeed *= 2.0f;
+                      } else {
+                          playSpeed += 0.1f;
+                      }
+                      mPlayer.setPlaySpeed(playSpeed); 
+                    } break;
+            }
+            
+            if( 0 != pts1 ) {
+                mPlayer.seek(pts1);
+            }
+        }        
+    };
+    
+    public MovieSimple(URLConnection stream, int vid, int aid) throws IOException {
         mPlayerScaleOrig = false;
         mPlayerShared = false;
         mPlayerExternal = false;
         mPlayer = GLMediaPlayerFactory.createDefault();
         mPlayer.addEventListener(this);
         this.stream = stream;
+        this.vid = vid;
+        this.aid = aid;
         System.out.println("pC.1 "+mPlayer);
     }
 
@@ -166,6 +233,8 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         mPlayer = sharedMediaPlayer;
         mPlayer.addEventListener(this);
         this.stream = null;
+        this.vid = sharedMediaPlayer.getVID();
+        this.aid = sharedMediaPlayer.getAID();
         System.out.println("pC.2 shared "+mPlayerShared+", "+mPlayer);
     }
     
@@ -188,20 +257,13 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         // System.out.println("newFrameAvailable: "+mp+", when "+when);        
     }
 
-    public void start() {
+    public void play() {
         if(null!=mPlayer) {
-            mPlayer.start();
+            mPlayer.play();
             System.out.println("pStart "+mPlayer);
         }        
     }
 
-    public void stop() {
-        if(null!=mPlayer) {
-            mPlayer.stop();
-            System.out.println("pStop "+mPlayer);
-        }        
-    }
-    
     ShaderState st;
     PMVMatrix pmvMatrix;
     GLUniformData pmvMatrixUniform;
@@ -242,6 +304,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         st.attachShaderProgram(gl, sp, false);
     }
 
+    @Override
     public void init(GLAutoDrawable drawable) {
         zoom0 =  orthoProjection ? 0f : -2.5f;
         zoom1 = orthoProjection ? 0f : -5f;
@@ -252,12 +315,15 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         System.err.println("Alpha: "+alpha+", opaque "+drawable.getChosenGLCapabilities().isBackgroundOpaque()+
                            ", "+drawable.getClass().getName()+", "+drawable);
         
+        if(waitForKey) {
+            UITestCase.waitForKey("Init>");
+        }        
         final Texture tex;
         boolean useExternalTexture = false;
         try {
             System.out.println("p0 "+mPlayer+", shared "+mPlayerShared);
             if(!mPlayerShared) {
-                mPlayer.initGLStream(gl, textureCount, stream);
+                mPlayer.initGLStream(gl, textureCount, stream, vid, aid);
             }
             tex = mPlayer.getLastTexture().getTexture();
             System.out.println("p1 "+mPlayer+", shared "+mPlayerShared);
@@ -392,7 +458,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         System.out.println(st);
 
         if(null!=mPlayer) {
-            start();
+            play();
             System.out.println("p2 "+mPlayer);
         }
         
@@ -402,11 +468,13 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         if (upstreamWidget instanceof Window) {            
             final Window window = (Window) upstreamWidget;
             window.addMouseListener(mouseAction);
+            window.addKeyListener(keyAction);
             winWidth = window.getWidth();
             winHeight = window.getHeight();
         }
     }
     
+    @Override
     public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
         if(null == mPlayer) { return; }
         winWidth = width;
@@ -442,34 +510,51 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         pmvMatrix.glTranslatef(0, 0, zoom0);        
     }
 
+    @Override
     public void dispose(GLAutoDrawable drawable) {
         if(null == mPlayer) { return; }
         
-        stop();
-        System.out.println("pD.1 "+mPlayer);
-        
+        System.out.println("pD.1 "+mPlayer);        
         GL2ES2 gl = drawable.getGL().getGL2ES2();
-
-        mPlayer.removeEventListener(this);
-        if(!mPlayerExternal) {
-            mPlayer.destroy(gl);
+        if( null != mPlayer ) {
+            mPlayer.removeEventListener(this);
+            if(!mPlayerExternal) {
+                mPlayer.destroy(gl);
+            }
         }
         System.out.println("pD.X "+mPlayer);
         mPlayer=null;
         pmvMatrixUniform = null;
-        pmvMatrix.destroy();
-        pmvMatrix=null;
-        st.destroy(gl);
-        st=null;
+        if(null != pmvMatrix) {
+            pmvMatrix.destroy();
+            pmvMatrix=null;
+        }
+        if(null != st) {
+            st.destroy(gl);
+            st=null;
+        }
     }
 
+    long lastPerfPos = 0;
+    
+    @Override
     public void display(GLAutoDrawable drawable) {
         if(null == mPlayer) { return; }
         
+        final long currentPos = System.currentTimeMillis();
+        if( currentPos - lastPerfPos > 2000 ) {
+            System.err.println( mPlayer.getPerfString() );
+            lastPerfPos = currentPos;  
+        }
+        
         GL2ES2 gl = drawable.getGL().getGL2ES2();        
 
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
+        if(null == st) {
+            return;
+        }
+        
         st.useProgram(gl, true);
 
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
@@ -506,9 +591,6 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         st.useProgram(gl, false);
     }
 
-    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
-    }
-
     public static void main(String[] args) throws IOException, MalformedURLException {
         int width = 640;
         int height = 600;
@@ -520,42 +602,60 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         boolean forceES3 = false;
         boolean forceGL3 = false;
         boolean forceGLDef = false;
+        int vid = GLMediaPlayer.STREAM_ID_AUTO;
+        int aid = GLMediaPlayer.STREAM_ID_AUTO;
+        final boolean origSize;
         
-        String url_s="http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4";        
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-width")) {
-                i++;
-                width = MiscUtils.atoi(args[i], width);
-            } else if(args[i].equals("-height")) {
-                i++;
-                height = MiscUtils.atoi(args[i], height);
-            } else if(args[i].equals("-textureCount")) {
-                i++;
-                textureCount = MiscUtils.atoi(args[i], textureCount);
-            } else if(args[i].equals("-es2")) {
-                forceES2 = true;
-            } else if(args[i].equals("-es3")) {
-                forceES3 = true;
-            } else if(args[i].equals("-gl3")) {
-                forceGL3 = true;
-            } else if(args[i].equals("-gldef")) {
-                forceGLDef = true;
-            } else if(args[i].equals("-projection")) {
-                ortho=false;
-            } else if(args[i].equals("-zoom")) {
-                zoom=true;
-            } else if(args[i].equals("-url")) {
-                i++;
-                url_s = args[i];
+        String url_s="http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4";
+        {
+            boolean _origSize = false;        
+            for(int i=0; i<args.length; i++) {
+                if(args[i].equals("-vid")) {
+                    i++;
+                    vid = MiscUtils.atoi(args[i], vid);
+                } else if(args[i].equals("-aid")) {
+                    i++;
+                    aid = MiscUtils.atoi(args[i], aid);
+                } else if(args[i].equals("-width")) {
+                    i++;
+                    width = MiscUtils.atoi(args[i], width);
+                } else if(args[i].equals("-height")) {
+                    i++;
+                    height = MiscUtils.atoi(args[i], height);
+                } else if(args[i].equals("-osize")) {
+                    _origSize = true;
+                } else if(args[i].equals("-textureCount")) {
+                    i++;
+                    textureCount = MiscUtils.atoi(args[i], textureCount);
+                } else if(args[i].equals("-es2")) {
+                    forceES2 = true;
+                } else if(args[i].equals("-es3")) {
+                    forceES3 = true;
+                } else if(args[i].equals("-gl3")) {
+                    forceGL3 = true;
+                } else if(args[i].equals("-gldef")) {
+                    forceGLDef = true;
+                } else if(args[i].equals("-projection")) {
+                    ortho=false;
+                } else if(args[i].equals("-zoom")) {
+                    zoom=true;
+                } else if(args[i].equals("-url")) {
+                    i++;
+                    url_s = args[i];
+                } else if(args[i].equals("-wait")) {
+                    waitForKey = true;
+                }
             }
+            origSize = _origSize;
         }
+        System.err.println("vid "+vid+", aid "+aid);
         System.err.println("textureCount "+textureCount);
         System.err.println("forceES2   "+forceES2);
         System.err.println("forceES3   "+forceES3);
         System.err.println("forceGL3   "+forceGL3);
         System.err.println("forceGLDef "+forceGLDef);
         
-        final MovieSimple ms = new MovieSimple(new URL(url_s).openConnection());
+        final MovieSimple ms = new MovieSimple(new URL(url_s).openConnection(), vid, aid);
         ms.setTextureCount(textureCount);
         ms.setScaleOrig(!zoom);
         ms.setOrthoProjection(ortho);
@@ -575,9 +675,21 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             }        
             System.err.println("GLProfile: "+glp);
             GLCapabilities caps = new GLCapabilities(glp);
-            GLWindow window = GLWindow.create(caps);            
+            final GLWindow window = GLWindow.create(caps);            
 
             window.addGLEventListener(ms);
+            ms.mPlayer.addEventListener(new GLMediaEventListener() {
+                @Override
+                public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+                }
+    
+                @Override
+                public void attributesChanges(final GLMediaPlayer mp, int event_mask, long when) {
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) && origSize ) {
+                        window.setSize(mp.getWidth(), mp.getHeight());
+                    }
+                }            
+            });
 
             window.setSize(width, height);
             window.setVisible(true);
-- 
cgit v1.2.3


From c200045aa661cf82474c2b3c1db0ac69db40452a Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Fri, 16 Aug 2013 20:18:36 +0200
Subject: GLMediaPlayer Multithreaded Decoding: GLMediaPlayer* (Part-4) - WIP

- Use Platform.currentTimeMillis() for accurate timing!

- GLMediaPlayer / GLMediaPlayerImpl
  - Add DEBUG_NATIVE property jogl.debug.GLMediaPlayer.Native
    for verbose impl. messages, i.e. ffmpeg/libav

  - Add 'synchronization' section in GLMediaPlayer API doc (WIP)

  - Use passive non-blocking video synchronization,
    i.e. repeat frames instead of 'sleep'.
    Thx to Xerxes's suggestion.

  - Add flushing of cached decoded frames,
    allowing to remove complicated 'videoSCR_reset_latch'

  - FramePusher (threaded decoding):
    - Always create a shared context!
    - Release context while pausing
    - Pre/post 'getNextTextureImpl()' actions only
      at makeCurrent/release.
    - newFrameAvailable(..) signal after decoded frame is enqueued

- FFMPEGDynamicLibraryBundleInfo
  - Bind add. functions of libavcodec:
    +         "av_init_packet",
    +         "av_new_packet",
    +         "av_destruct_packet",
  - Bind add. functions of libavformat:
    +         "avformat_seek_file",
    +         "av_read_play",
    +         "av_read_pause",
  - DEBUG property := FFMPEGMediaPlayer.DEBUG || DynamicLibraryBundleInfo.DEBUG;

- FFMPEGMediaPlayer
  - Use libavformat's 'av_read_play()' and 'av_read_pause()',
    which may get utilized for network streams, e.g. RTSP

  - getNextTextureImpl(..):
    - Fix retry loop
    - Use postNextTextureImpl/preNextTextureImpl if desired (PSM)

  - Native:
    - Use fixed my_av_q2i32(..) macro (again)
    - Use INVALID_PTS marker (synced w/ Java code)
    - DEBUG: Dump more detailed frame information
    - TODO: Consider passing frame_delay, especially for repeated frames!

- Tests (MovieSimple, MovieCube):
  - Refine KeyEvents control for seek and speed.

- TODO:
  - Proper audio clock calculation - difficult w/ OpenAL !
  - Video / Audio sync:
    - seek !
    - streams w/ very async A/V frames
    - Test Streams:
      - Five-minute-sync-test.mp4
      - Audio-Video-Sync-Test-Calibration-23.98fps-24fps.mp4
      - sound_in_sync_test.mp4
      - big_buck_bunny_1080p_surround.avi
---
 make/scripts/tests.sh                              |   6 +-
 .../com/jogamp/opengl/util/av/AudioSink.java       |   3 +
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |  51 ++-
 .../opengl/util/texture/TextureSequence.java       |  14 +-
 .../android/av/AndroidGLMediaPlayerAPI14.java      |   2 +-
 .../jogamp/opengl/openal/av/ALAudioSink.java       |  18 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 354 ++++++++++-----------
 .../jogamp/opengl/util/av/NullGLMediaPlayer.java   |   9 +-
 .../av/impl/FFMPEGDynamicLibraryBundleInfo.java    |  22 +-
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     |  59 ++--
 .../opengl/util/av/impl/OMXGLMediaPlayer.java      |   2 +-
 src/jogl/native/libav/ffmpeg_tool.h                |   7 +-
 .../jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c | 114 +++++--
 .../test/junit/jogl/demos/es2/av/MovieCube.java    |  15 +-
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  |  13 +-
 15 files changed, 411 insertions(+), 278 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 82e9fb92b..7aac0ca33 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -131,8 +131,9 @@ function jrun() {
     #D_ARGS="-Djogl.1thread=true -Djogl.debug.Threading"
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
-    #D_ARGS="-Djogl.debug.GLMediaPlayer"
-    #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
+    D_ARGS="-Djogl.debug.GLMediaPlayer"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer.Native -Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.GLArrayData"
     #D_ARGS="-Djogl.debug.GLDrawable"
@@ -564,6 +565,7 @@ testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestGLReadBufferUtilTextureIOWrite02NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestTextureSequence01NEWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.util.texture.TestTextureSequence01AWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT $*
 
 
 #
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
index ba785ac31..d5db73c6b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
@@ -71,6 +71,9 @@ public interface AudioSink {
     public static final AudioDataFormat DefaultFormat = new AudioDataFormat(AudioDataType.PCM, 44100, 16, 2, true /* signed */, true /* fixed point */, true /* littleEndian */);
     
     public static class AudioFrame {
+        /** Constant marking an invalid PTS, i.e. Integer.MIN_VALUE 0x80000000 {@value}. */
+        public static final int INVALID_PTS = 0x80000000 ; // == -2147483648 == Integer.MIN_VALUE;
+        
         public final ByteBuffer data;
         public final int dataSize;
         public final int pts;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index fae88ea18..1b82bb994 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -34,7 +34,6 @@ import javax.media.opengl.GL;
 import javax.media.opengl.GLException;
 
 import jogamp.opengl.Debug;
-import jogamp.opengl.util.av.GLMediaPlayerImpl;
 
 import com.jogamp.opengl.util.texture.TextureSequence;
 
@@ -44,7 +43,8 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  * <p>
  * Audio maybe supported and played back internally or via an {@link AudioSink} implementation,
  * if an audio stream is selected in {@link #initGLStream(GL, int, URLConnection, int, int)}.
- * </p>  
+ * </p>
+ *   
  * <a name="lifecycle"><h5>GLMediaPlayer Lifecycle</h5></a>
  * <p>
  * <table border="1">
@@ -56,6 +56,7 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  *   <tr><td>{@link #destroy(GL)}</td>                                    <td>ANY</td>                 <td>Uninitialized</td></tr>
  * </table>
  * </p>
+ * 
  * <a name="streamIDs"><h5>Audio and video Stream IDs</h5></a>
  * <p>
  * <table border="1">
@@ -91,14 +92,47 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  * Milliseconds granularity is also more than enough to deal with A-V synchronization,
  * where the threshold usually lies within 100ms. 
  * </p>
+ * 
+ * <a name="synchronization"><h5>Audio and video synchronization</h5></a>
+ * <p>
+ * The class follows a passive A/V synchronization pattern.
+ * Audio is being untouched, while {@link #getNextTexture(GL, boolean)} delivers a new video frame
+ * only, if its timestamp is less than 22ms ahead of <i>time</i>.
+ * Otherwise the early frame is cached for later retrieval and the previous frame is returned.
+ * FIXME: Refine!
+ * </p>
+ * <p>
+ * https://en.wikipedia.org/wiki/Audio_to_video_synchronization
+ * <pre>
+ *   d_av = v_pts - a_pts;
+ * </pre>
+ * </p>
+ * <p>
+ * Recommendation of audio/video pts time lead/lag at production:
+ * <ul>
+ *   <li>Overall:    +40ms and -60ms  audio ahead video / audio after video</li>
+ *   <li>Each stage:  +5ms and -15ms. audio ahead video / audio after video</li>
+ * </ul>
+ * </p>
+ * <p>
+ * Recommendation of av pts time lead/lag at presentation:
+ * <ul>
+ *   <li>TV:         +15ms and -45ms. audio ahead video / audio after video.</li>
+ *   <li>Film:       +22ms and -22ms. audio ahead video / audio after video.</li>
+ * </ul>
+ * </p>
  */
 public interface GLMediaPlayer extends TextureSequence {
     public static final boolean DEBUG = Debug.debug("GLMediaPlayer");
+    public static final boolean DEBUG_NATIVE = Debug.debug("GLMediaPlayer.Native");
     
     /** Constant {@value} for <i>mute</i> or <i>not available</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
     public static final int STREAM_ID_NONE = -2;
     /** Constant {@value} for <i>auto</i> or <i>unspecified</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
     public static final int STREAM_ID_AUTO = -1;
+    
+    /** Maximum video frame async .. */
+    public static final int MAXIMUM_VIDEO_ASYNC = 22;
         
     public interface GLMediaEventListener extends TexSeqEventListener<GLMediaPlayer> {
     
@@ -228,13 +262,14 @@ public interface GLMediaPlayer extends TextureSequence {
     public int getAID();
     
     /**
-     * @return the current decoded frame count since {@link #initGLStream(GL, int, URLConnection, int, int)}.
+     * @return the current decoded frame count since {@link #play()} and {@link #seek(int)} 
+     *         as increased by {@link #getNextTexture(GL, boolean)} or the decoding thread.
      */
     public int getDecodedFrameCount();
     
     /**
-     * @return the current presented frame count since {@link #initGLStream(GL, int, URLConnection, int, int)}, 
-     *         increased by {@link #getNextTexture(GL, boolean)}.
+     * @return the current presented frame count since {@link #play()} and {@link #seek(int)} 
+     *         as increased by {@link #getNextTexture(GL, boolean)} for new frames.
      */
     public int getPresentedFrameCount();
     
@@ -250,6 +285,9 @@ public interface GLMediaPlayer extends TextureSequence {
     
     /**
      * {@inheritDoc}
+     * <p>
+     * See <a href="#synchronization">audio and video synchronization</a>.
+     * </p>
      */
     @Override
     public TextureSequence.TextureFrame getLastTexture() throws IllegalStateException;
@@ -260,6 +298,9 @@ public interface GLMediaPlayer extends TextureSequence {
      * <p>
      * In case the current state is not {@link State#Playing}, {@link #getLastTexture()} is returned.
      * </p>
+     * <p>
+     * See <a href="#synchronization">audio and video synchronization</a>.
+     * </p>
      * 
      * @see #addEventListener(GLMediaEventListener)
      * @see GLMediaEventListener#newFrameAvailable(GLMediaPlayer, TextureFrame, long)
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index 50801e791..05fda99ae 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -110,23 +110,31 @@ public interface TextureSequence {
      * to associated related data. 
      */
     public static class TextureFrame {
-        /** Constant marking an invalid PTS, i.e. Integer.MIN_VALUE {@value}. */
-        public static final int INVALID_PTS = Integer.MIN_VALUE;
+        /** Constant marking an invalid PTS, i.e. Integer.MIN_VALUE 0x80000000 {@value}. */
+        public static final int INVALID_PTS = 0x80000000 ; // == -2147483648 == Integer.MIN_VALUE;
         
         public TextureFrame(Texture t) {
             texture = t;
             pts = INVALID_PTS;
+            duration = 0;
         }
         
         public final Texture getTexture() { return texture; }
+        /** Get this frame's presentation timestamp (PTS) in milliseconds. */
         public final int getPTS() { return pts; }
+        /** Set this frame's presentation timestamp (PTS) in milliseconds. */
         public final void setPTS(int pts) { this.pts = pts; }
+        /** Get this frame's duration in milliseconds. */
+        public final int getDuration() { return duration; }
+        /** Set this frame's duration in milliseconds. */
+        public final void setDuration(int duration) { this.duration = duration; }
         
         public String toString() {
-            return "TextureFrame[" + pts + "ms: " + texture + "]";
+            return "TextureFrame[pts " + pts + " ms, l " + duration + " ms, "+ texture + "]";
         }
         protected final Texture texture;
         protected int pts;
+        protected int duration;
     }
 
     public interface TexSeqEventListener<T extends TextureSequence> {
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index e14642c34..86e6bc121 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -222,7 +222,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking) {
+    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost) {
         if(null != stex && null != mp) {
             final SurfaceTextureFrame nextSFrame = (SurfaceTextureFrame) nextFrame;
             final Surface nextSurface = nextSFrame.getSurface();
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
index 5783c32f1..217ab2954 100644
--- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
@@ -80,7 +80,7 @@ public class ALAudioSink implements AudioSink {
     private SyncedRingbuffer<Integer> alBufferAvail = null;
     private SyncedRingbuffer<ActiveBuffer> alBufferPlaying = null;
     private volatile int alBufferBytesQueued = 0;
-    private volatile int ptsPlaying = 0;
+    private volatile int playingPTS = AudioFrame.INVALID_PTS;
     private volatile int enqueuedFrameCount;
 
     private int[] alSource = null;
@@ -207,11 +207,11 @@ public class ALAudioSink implements AudioSink {
         return "ALAudioSink[init "+initialized+", playRequested "+playRequested+", device "+deviceSpecifier+", ctx "+toHexString(ctxHash)+", alSource "+alSrcName+
                ", chosen "+chosenFormat+", alFormat "+toHexString(alFormat)+
                ", playSpeed "+playSpeed+", buffers[total "+alBuffersLen+", avail "+alBufferAvail.size()+", "+
-               "queued["+alBufferPlaying.size()+", apts "+ptsPlaying+", "+getQueuedTime() + " ms, " + alBufferBytesQueued+" bytes]";
+               "queued["+alBufferPlaying.size()+", apts "+getPTS()+", "+getQueuedTime() + " ms, " + alBufferBytesQueued+" bytes]";
     }
     public final String getPerfString() {
         final int alBuffersLen = null != alBuffers ? alBuffers.length : 0;
-        return "Play [buffer "+alBufferPlaying.size()+"/"+alBuffersLen+", apts "+ptsPlaying+", "+getQueuedTime() + " ms, " + alBufferBytesQueued+" bytes]";
+        return "Play [buffer "+alBufferPlaying.size()+"/"+alBuffersLen+", apts "+getPTS()+", "+getQueuedTime() + " ms, " + alBufferBytesQueued+" bytes]";
     }
     
     @Override
@@ -289,9 +289,9 @@ public class ALAudioSink implements AudioSink {
                     t.printStackTrace();
                 }
             }
-            alBufferAvail.clear(true);
+            alBufferAvail.clear();
             alBufferAvail = null;
-            alBufferPlaying.clear(true);
+            alBufferPlaying.clear();
             alBufferPlaying = null;
             alBufferBytesQueued = 0;
             alBuffers = null;
@@ -434,7 +434,11 @@ public class ALAudioSink implements AudioSink {
                 }
                 final int dequeuedBufferCount = dequeueBuffer( false /* all */, wait );        
                 final ActiveBuffer currentBuffer = alBufferPlaying.peek();
-                ptsPlaying = null != currentBuffer ? currentBuffer.pts : audioFrame.pts;
+                if( null != currentBuffer ) {
+                    playingPTS = currentBuffer.pts;
+                } else {
+                    playingPTS = audioFrame.pts;
+                }
                 if( DEBUG ) {
                     System.err.println(getThreadName()+": ALAudioSink: Write "+audioFrame.pts+", "+getQueuedTimeImpl(audioFrame.dataSize)+" ms, dequeued "+dequeuedBufferCount+", wait "+wait+", "+getPerfString());
                 }
@@ -652,5 +656,5 @@ public class ALAudioSink implements AudioSink {
     }
     
     @Override
-    public final int getPTS() { return ptsPlaying; }
+    public final int getPTS() { return playingPTS; }
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index c1cfc0d95..85b599c0e 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -42,7 +42,9 @@ import javax.media.opengl.GLES2;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 
+import com.jogamp.common.os.Platform;
 import com.jogamp.opengl.util.av.AudioSink;
+import com.jogamp.opengl.util.av.AudioSink.AudioFrame;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
@@ -92,9 +94,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected int width = 0;
     /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected int height = 0;
-    /** Video fps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Video avg. fps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected float fps = 0;
-    protected int frame_period = 0;
+    /** Video avg. frame duration in ms. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    protected float frame_duration = 0f;
     /** Stream bps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
     protected int bps_stream = 0;
     /** Video bps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
@@ -114,6 +117,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     
     protected volatile int decodedFrameCount = 0;
     protected int presentedFrameCount = 0;
+    protected int displayedFrameCount = 0;
     protected volatile int video_pts_last = 0;
     
     /** See {@link #getAudioSink()}. Set by implementation if used from within {@link #initGLStreamImpl(GL, int, int)}! */
@@ -139,17 +143,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     /** Maximum valid video pts diff. */
     private static final int VIDEO_DPTS_MAX = 5000; // 5s max diff
     /** Trigger video PTS reset with given cause as bitfield. */
-    private volatile int videoSCR_reset = 0;
+    private boolean videoSCR_reset = false;
     
-    private final boolean isSCRCause(int bit) { return 0 != ( bit & videoSCR_reset); }
-    /** SCR reset due to: Start, Resume, Seek, .. */ 
-    private static final int SCR_RESET_FORCE = 1 << 0;
-    /** SCR reset due to: PlaySpeed */
-    private static final int SCR_RESET_SPEED = 1 << 1;
-    
-    /** Latched video PTS reset, to wait until valid pts after invalidation of cached ones. Currently [1..{@link #VIDEO_DPTS_NUM}] frames. */
-    private int videoSCR_reset_latch = 0;
-        
     protected SyncedRingbuffer<TextureFrame> videoFramesFree =  null;
     protected SyncedRingbuffer<TextureFrame> videoFramesDecoded =  null;
     protected volatile TextureFrame lastFrame = null;
@@ -279,16 +274,17 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             switch( state ) {
                 case Paused:
                     if( playImpl() ) {
-                        resetAudioVideoSCR(SCR_RESET_FORCE);
-                        resumeFramePusher();
+                        // FIXME
+                        resetAudioVideoPTS();
                         if( null != audioSink ) {
-                            audioSink.play();
-                        }
+                            audioSink.play(); // cont. w/ new data
+                        }                        
+                        resumeFramePusher();
                         state = State.Playing;
                     }
                 default:
             }
-            if(DEBUG) { System.err.println("Start: "+toString()); }
+            if(DEBUG) { System.err.println("Play: "+toString()); }
             return state;
         }
     }
@@ -297,16 +293,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final State pause() {
         synchronized( stateLock ) {
             if( State.Playing == state ) {
-                State _state = state;
                 state = State.Paused;
-                if( pauseImpl() ) {
-                    _state = State.Paused;
-                    pauseFramePusher();
-                    if( null != audioSink ) {
-                        audioSink.pause();
-                    }
+                // FIXME
+                pauseFramePusher();
+                if( null != audioSink ) {
+                    audioSink.pause();
+                }
+                if( !pauseImpl() ) {
+                    play();
                 }
-                state = _state;
             }
             if(DEBUG) { System.err.println("Pause: "+toString()); }            
             return state;
@@ -322,14 +317,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 case Paused:
                     final State _state = state;
                     state = State.Paused;
+                    // FIXME
                     pauseFramePusher();
-                    resetAudioVideoSCR(SCR_RESET_FORCE);
                     pts1 = seekImpl(msec);
-                    if( null != audioSink ) {
-                        audioSink.flush();
-                        if( State.Playing == _state ) {
-                            audioSink.play(); // cont. w/ new data
-                        }
+                    resetAllAudioVideoSync();
+                    if( null != audioSink && State.Playing == _state ) {
+                        audioSink.play(); // cont. w/ new data
                     }
                     resumeFramePusher();
                     state = _state;
@@ -358,7 +351,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         rate = 1.0f;
                     }
                     if( setPlaySpeedImpl(rate) ) {
-                        resetAudioVideoSCR(SCR_RESET_SPEED);
+                        resetAudioVideoPTS();
                         playSpeed = rate;
                         if(DEBUG) { System.err.println("SetPlaySpeed: "+toString()); }
                         res = true;
@@ -392,6 +385,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
             decodedFrameCount = 0;
             presentedFrameCount = 0;
+            displayedFrameCount = 0;
             this.urlConn = urlConn;
             if (this.urlConn != null) {
                 try {                
@@ -405,7 +399,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         videoFramesFree = new SyncedRingbuffer<TextureFrame>(createTexFrames(gl, textureCount), true /* full */);
                         if( TEXTURE_COUNT_DEFAULT < textureCount ) {
                             videoFramesDecoded = new SyncedRingbuffer<TextureFrame>(new TextureFrame[textureCount], false /* full */);
-                            framePusher = new FramePusher(gl, requiresOffthreadGLCtx());
+                            framePusher = new FramePusher(gl);
                             framePusher.doStart();
                         } else {
                             videoFramesDecoded = null;
@@ -448,7 +442,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected int validateTextureCount(int desiredTextureCount) {
         return TEXTURE_COUNT_DEFAULT;
     }
-    protected boolean requiresOffthreadGLCtx() { return false; }
     
     private final TextureFrame[] createTexFrames(GL gl, final int count) {
         final int[] texNames = new int[count];
@@ -543,6 +536,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         textureCount=0;
     }
     
+    protected TextureFrame cachedFrame = null;
+    protected long lastTimeMillis = 0;
+    
     @Override
     public final TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException {
         synchronized( stateLock ) {
@@ -554,68 +550,95 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 boolean ok = true;
                 boolean dropFrame = false;
                 try {
-                    do { 
-                        if( TEXTURE_COUNT_DEFAULT < textureCount ) {
+                    do {
+                        final long currentTimeMillis;
+                        final boolean playCached = null != cachedFrame;
+                        if( dropFrame ) {
+                            presentedFrameCount--;
+                            dropFrame = false;
+                        }
+                        if( playCached ) {
+                            nextFrame = cachedFrame;
+                            cachedFrame = null;
+                            presentedFrameCount--;
+                            currentTimeMillis = Platform.currentTimeMillis();
+                        } else if( TEXTURE_COUNT_DEFAULT < textureCount ) {
                             nextFrame = videoFramesDecoded.getBlocking(false /* clearRef */ );
+                            currentTimeMillis = Platform.currentTimeMillis();
                         } else {
                             nextFrame = videoFramesFree.getBlocking(false /* clearRef */ );
-                            if( getNextTextureImpl(gl, nextFrame, blocking) ) {
-                                newFrameAvailable(nextFrame);
-                            } else {
-                                ok = false;
+                            nextFrame.setPTS( TextureFrame.INVALID_PTS ); // mark invalid until processed!
+                            ok = getNextTextureImpl(gl, nextFrame, blocking, true /* issuePreAndPost */);
+                            currentTimeMillis = Platform.currentTimeMillis();
+                            if( ok ) {
+                                newFrameAvailable(nextFrame, currentTimeMillis);
                             }
                         }
+                        if( DEBUG ) {
+                            System.err.println("> "+currentTimeMillis+", d "+(currentTimeMillis-lastTimeMillis)+", playCached "+playCached);
+                        }
                         if( ok ) {
                             presentedFrameCount++;
-                            final int video_pts;
-                            if( 0 != videoSCR_reset ) {
-                                if( isSCRCause(SCR_RESET_FORCE) ) {
-                                    videoSCR_reset_latch = VIDEO_DPTS_NUM / 2;
-                                    resetVideoDPTS();
-                                    resetAllVideoPTS();
+                            final int video_pts = nextFrame.getPTS();
+                            if( video_pts != TextureFrame.INVALID_PTS ) {
+                                lastTimeMillis = currentTimeMillis;
+                                
+                                final int audio_pts = getAudioPTSImpl();
+                                final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
+                                final int d_apts;
+                                if( audio_pts != AudioFrame.INVALID_PTS ) {
+                                    d_apts = audio_pts - audio_scr;
                                 } else {
-                                    // SCR_RESET_SPEED
-                                    videoSCR_reset_latch = 1;
+                                    d_apts = 0;
                                 }
-                                videoSCR_reset = 0;
-                                video_pts = TextureFrame.INVALID_PTS;
-                            } else {
-                                video_pts = nextFrame.getPTS();
-                            }
-                            if( video_pts != TextureFrame.INVALID_PTS ) {
+                                
                                 final int frame_period_last = video_pts - video_pts_last; // rendering loop interrupted ?
-                                if( videoSCR_reset_latch > 0 || frame_period_last > frame_period*10 ) {
-                                    if( videoSCR_reset_latch > 0 ) {
-                                        videoSCR_reset_latch--;
-                                    }
-                                    setFirstVideoPTS2SCR( video_pts );
+                                if( videoSCR_reset || frame_period_last > frame_duration*10 ) {
+                                    videoSCR_reset = false;
+                                    video_scr_t0 = currentTimeMillis;
+                                    video_scr_pts = video_pts;
                                 }
-                                final int scr_pts = video_scr_pts + 
-                                                    (int) ( ( System.currentTimeMillis() - video_scr_t0 ) * playSpeed );
-                                final int d_vpts = video_pts - scr_pts;
+                                final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed );
+                                final int d_vpts = video_pts - video_scr;
+                                // final int d_avpts = d_vpts - d_apts;
                                 if( -VIDEO_DPTS_MAX > d_vpts || d_vpts > VIDEO_DPTS_MAX ) {
+                                // if( -VIDEO_DPTS_MAX > d_avpts || d_avpts > VIDEO_DPTS_MAX ) {
                                     if( DEBUG ) {
-                                        System.err.println( getPerfStringImpl( scr_pts, video_pts, d_vpts, 0 ) );
+                                        System.err.println( "AV*: "+getPerfStringImpl( video_scr, video_pts, d_vpts, audio_scr, audio_pts, d_apts, 0 ) + ", "+nextFrame+", playCached " + playCached+ ", dropFrame "+dropFrame);
                                     }
                                 } else {
+                                    final int dpy_den = displayedFrameCount > 0 ? displayedFrameCount : 1;
+                                    final int avg_dpy_duration = ( (int) ( currentTimeMillis - video_scr_t0 ) ) / dpy_den ; // ms/f
+                                    final int maxVideoDelay = Math.min(avg_dpy_duration, MAXIMUM_VIDEO_ASYNC);
                                     video_dpts_count++;
+                                    // video_dpts_cum = d_avpts + VIDEO_DPTS_COEFF * video_dpts_cum;
                                     video_dpts_cum = d_vpts + VIDEO_DPTS_COEFF * video_dpts_cum;
-                                    final int video_dpts_avg_diff = getVideoDPTSAvg();
-                                    if( DEBUG ) {
-                                        System.err.println( getPerfStringImpl( scr_pts, video_pts, d_vpts, video_dpts_avg_diff ) );
-                                    }
-                                    if( blocking && syncAVRequired() ) {
-                                        if( !syncAV( (int) ( video_dpts_avg_diff / playSpeed + 0.5f ) ) ) {
-                                            resetVideoDPTS();
-                                            dropFrame = true;
-                                        }
+                                    final int video_dpts_avg_diff = video_dpts_count >= VIDEO_DPTS_NUM ? getVideoDPTSAvg() : 0;
+                                    final int dt = (int) ( video_dpts_avg_diff / playSpeed + 0.5f );
+                                    // final int dt = (int) ( d_vpts  / playSpeed + 0.5f );
+                                    // final int dt = (int) ( d_avpts / playSpeed + 0.5f );
+                                    if( dt > maxVideoDelay ) {
+                                        cachedFrame = nextFrame;
+                                        nextFrame = null;
+                                    } else if ( dt < -maxVideoDelay ) {
+                                        dropFrame = true;
                                     }
                                     video_pts_last = video_pts;
+                                    if( DEBUG ) {
+                                        System.err.println( "AV_: "+getPerfStringImpl( video_scr, video_pts, d_vpts,
+                                                                                       audio_scr, audio_pts, d_apts,
+                                                                                       video_dpts_avg_diff ) + 
+                                                                                       ", avg dpy-fps "+avg_dpy_duration+" ms/f, maxD "+maxVideoDelay+" ms, "+nextFrame+", playCached " + playCached + ", dropFrame "+dropFrame);
+                                    }
                                 }
+                            } else if( DEBUG ) {
+                                System.err.println("Invalid PTS: "+nextFrame);
+                            }
+                            if( null != nextFrame ) {
+                                final TextureFrame _lastFrame = lastFrame;
+                                lastFrame = nextFrame;
+                                videoFramesFree.putBlocking(_lastFrame);
                             }
-                            final TextureFrame _lastFrame = lastFrame;
-                            lastFrame = nextFrame;
-                            videoFramesFree.putBlocking(_lastFrame);
                         }
                     } while( dropFrame );
                 } catch (InterruptedException e) {
@@ -623,14 +646,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     e.printStackTrace();
                 } finally {
                     if( !ok && null != nextFrame ) { // put back
-                        videoFramesFree.put(nextFrame);
+                        if( !videoFramesFree.put(nextFrame) ) {
+                            throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); 
+                        }
                     }
                 }
             }
+            displayedFrameCount++;
             return lastFrame;
         }
     }
-    protected abstract boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking);
+    protected void preNextTextureImpl(GL gl) {}
+    protected void postNextTextureImpl(GL gl) {}
+    protected abstract boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost);
     protected boolean syncAVRequired() { return false; }
     
     /** 
@@ -654,95 +682,49 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      */
     protected void setFirstAudioPTS2SCR(int pts) {
         if( audioSCR_reset ) {
-            audio_scr_t0 = System.currentTimeMillis() - pts;
+            audio_scr_t0 = Platform.currentTimeMillis() - pts;
             audioSCR_reset = false;
         }
     }
-    private void setFirstVideoPTS2SCR(int pts) {
-        // video_scr_t0 = System.currentTimeMillis() - pts;
-        video_scr_t0 = System.currentTimeMillis();
-        video_scr_pts = pts;
-    }
-    private void resetAllVideoPTS() {
+    private void flushAllVideoFrames() {
         if( null != videoFramesFree ) {
-            final TextureFrame[] texFrames = videoFramesFree.getArray(); 
-            for(int i=0; i<texFrames.length; i++) {
-                final TextureFrame frame = texFrames[i];
-                frame.setPTS(TextureFrame.INVALID_PTS);
-            }        
-        }        
+            videoFramesFree.reset(true);
+        }
+        if( null != videoFramesDecoded ) {
+            videoFramesDecoded.reset(false);
+        }
+        lastFrame = videoFramesFree.get(false /* clearRef */ );
+        if( null == lastFrame ) { throw new InternalError("XXX"); }
+        cachedFrame = null;
     }
-    private void resetVideoDPTS() {
+    private void resetAllAudioVideoSync() {
         video_dpts_cum = 0;
-        video_dpts_count = 0;        
-    }
-    private final int getVideoDPTSAvg() {
-        if( video_dpts_count < VIDEO_DPTS_NUM ) {
-            return 0;
-        } else {
-            return (int) ( video_dpts_cum * (1.0f - VIDEO_DPTS_COEFF) + 0.5f );
+        video_dpts_count = 0;
+        resetAudioVideoPTS();
+        flushAllVideoFrames();
+        if( null != audioSink ) {
+            audioSink.flush();
         }
     }
-    
-    private void resetAudioVideoSCR(int cause) {
+    private void resetAudioVideoPTS() {
+        presentedFrameCount = 0;
+        displayedFrameCount = 0;
+        decodedFrameCount = 0;
         audioSCR_reset = true;
-        videoSCR_reset |= cause;
+        videoSCR_reset = true;
     }
-    
-    /**
-     * Synchronizes A-V.
-     * <p>
-     * https://en.wikipedia.org/wiki/Audio_to_video_synchronization
-     * <pre>
-     *   d_av = v_pts - a_pts;
-     * </pre>
-     * </p>
-     * <p>
-     * Recommendation of audio/video pts time lead/lag at production:
-     * <ul>
-     *   <li>Overall:    +40ms and -60ms  audio ahead video / audio after video</li>
-     *   <li>Each stage:  +5ms and -15ms. audio ahead video / audio after video</li>
-     * </ul>
-     * </p>
-     * <p>
-     * Recommendation of av pts time lead/lag at presentation:
-     * <ul>
-     *   <li>TV:         +15ms and -45ms. audio ahead video / audio after video.</li>
-     *   <li>Film:       +22ms and -22ms. audio ahead video / audio after video.</li>
-     * </ul>
-     * </p>
-     * <p>
-     * Maybe implemented as follows: 
-     * <pre>
-     *   d_av = vpts - apts;
-     *   d_av < -22: audio after video == video ahead audio -> drop
-     *   d_av >  22: audio ahead video == video after audio -> sleep(d_av - 10) 
-     * </pre>
-     * </p>
-     * <p>
-     * Returns true if audio is ahead of video, otherwise false (video is ahead of audio).
-     * In case of the latter (false), the video frame shall be dropped!
-     * </p>
-     * @param frame
-     * @return true if audio is ahead of video, otherwise false (video is ahead of audio)
-     */
-    protected boolean syncAV(int d_vpts) {
-        if( d_vpts > 22 ) {
-            if( DEBUG ) {
-                System.err.println("V (sleep): "+(d_vpts - 22 / 2)+" ms");
-            }
-            try {
-                Thread.sleep( d_vpts - 22 / 2 );
-            } catch (InterruptedException e) { }
-        }
-        return true;
+    private final int getVideoDPTSAvg() {
+        return (int) ( video_dpts_cum * (1.0f - VIDEO_DPTS_COEFF) + 0.5f );
     }
     
-    private final void newFrameAvailable(TextureFrame frame) {
-        decodedFrameCount++;        
+    private final void newFrameAvailable(TextureFrame frame, long currentTimeMillis) {
+        decodedFrameCount++;
+        if( 0 == frame.getDuration() ) { // patch frame duration if not set already 
+            frame.setDuration( (int) frame_duration );
+        }
         synchronized(eventListenersLock) {
             for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
-                i.next().newFrameAvailable(this, frame, System.currentTimeMillis());
+                i.next().newFrameAvailable(this, frame, currentTimeMillis);
             }
         }
     }
@@ -759,12 +741,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         private GLDrawable dummyDrawable = null;
         private GLContext sharedGLCtx = null;
         
-        FramePusher(GL gl, boolean createSharedCtx) {
+        FramePusher(GL gl) {
             setDaemon(true);
-            this.gl = createSharedCtx ? createSharedGL(gl) : gl;
-        }
-        
-        private GL createSharedGL(GL gl) {
+            
             final GLContext glCtx = gl.getContext();
             final boolean glCtxCurrent = glCtx.isCurrent();
             final GLProfile glp = gl.getGLProfile();
@@ -779,8 +758,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             } else {
                 sharedGLCtx.release();
             }
-            return sharedGLCtx.getGL();
+            this.gl = sharedGLCtx.getGL();
         }
+        
         private void makeCurrent(GLContext ctx) {
             if( GLContext.CONTEXT_NOT_CURRENT >= ctx.makeCurrent() ) {
                 throw new GLException("Couldn't make ctx current: "+ctx);
@@ -789,6 +769,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         
         private void destroySharedGL() {
             if( null != sharedGLCtx ) {
+                postNextTextureImpl(gl);
                 if( sharedGLCtx.isCreated() ) {
                     // Catch dispose GLExceptions by GLEventListener, just 'print' them
                     // so we can continue with the destruction.
@@ -870,9 +851,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             FramePusherInstanceId++;
             
             synchronized ( this ) {
-                if( null != sharedGLCtx ) {
-                    makeCurrent( sharedGLCtx );
-                }
+                makeCurrent( sharedGLCtx );
+                preNextTextureImpl(gl);
                 isRunning = true;
                 this.notify();   // wake-up doStart()
             }
@@ -880,10 +860,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             while( !shallStop ){
                 if( shallPause ) {
                     synchronized ( this ) {
+                        postNextTextureImpl(gl);
+                        sharedGLCtx.release();
                         while( shallPause && !shallStop ) {
                             isActive = false;
                             this.notify();   // wake-up doPause()
                             try {
+                                System.err.println("!!! PAUSE ON"); // FIXME
                                 this.wait(); // wait until resumed
                             } catch (InterruptedException e) {
                                 if( !shallPause ) {
@@ -891,6 +874,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 }
                             }
                         }
+                        makeCurrent(sharedGLCtx);
+                        preNextTextureImpl(gl);
+                        System.err.println("!!! PAUSE OFF"); // FIXME
                         isActive = true;
                         this.notify(); // wake-up doResume()
                     }
@@ -903,15 +889,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         nextFrame = videoFramesFree.getBlocking(false /* clearRef */ );
                         isBlocked = false;
                         nextFrame.setPTS( TextureFrame.INVALID_PTS ); // mark invalid until processed!
-                        if( getNextTextureImpl(gl, nextFrame, true) ) {
+                        if( getNextTextureImpl(gl, nextFrame, true, false /* issuePreAndPost */) ) {
                             // gl.glFinish();
                             gl.glFlush(); // even better: sync object!
                             if( !videoFramesDecoded.put(nextFrame) ) { 
-                                throw new InternalError("XXX: "+GLMediaPlayerImpl.this); 
+                                throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); 
                             }
-                            final TextureFrame _nextFrame = nextFrame;
+                            newFrameAvailable(nextFrame, Platform.currentTimeMillis());
                             nextFrame = null;
-                            newFrameAvailable(_nextFrame);
                         }
                     } catch (InterruptedException e) {
                         isBlocked = false;
@@ -927,6 +912,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     }
                 }
             }
+            postNextTextureImpl(gl);
             destroySharedGL();
             synchronized ( this ) {
                 isRunning = false;
@@ -975,7 +961,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         if( this.fps != fps ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_FPS;
             this.fps = fps;
-            this.frame_period = (int) ( 1000f / fps + 0.5f );
+            this.frame_duration = 1000f / (float)fps;
         }
         if( this.bps_stream != bps_stream || this.bps_video != bps_video || this.bps_audio != bps_audio ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_BPS;
@@ -1006,7 +992,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected final void attributesUpdated(int event_mask) {
         synchronized(eventListenersLock) {
             for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
-                i.next().attributesChanges(this, event_mask, System.currentTimeMillis());
+                i.next().attributesChanges(this, event_mask, Platform.currentTimeMillis());
             }
         }
     }
@@ -1017,6 +1003,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             destroyFramePusher();
             destroyImpl(gl);
             removeAllTextureFrames(gl);
+            if( null != videoFramesFree ) {
+                videoFramesFree.clear();
+            }
+            if( null != videoFramesDecoded ) {
+                videoFramesDecoded.clear();
+            }
             state = State.Uninitialized;
             return state;
         }
@@ -1094,25 +1086,28 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         final String loc = ( null != urlConn ) ? urlConn.getURL().toExternalForm() : "<undefined stream>" ;
         final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
         final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
-        return "GLMediaPlayer["+state+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
+        final int video_scr = video_scr_pts + (int) ( ( Platform.currentTimeMillis() - video_scr_t0 ) * playSpeed );        
+        return "GLMediaPlayer["+state+", vSCR "+video_scr+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
                "speed "+playSpeed+", "+bps_stream+" bps, "+
                "Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", target "+toHexString(textureTarget)+", format "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+               
-               "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", "+fps+" fps, "+bps_video+" bps], "+
+               "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
                "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+"]";
     }
     
     @Override
     public final String getPerfString() {
-        final int scr_pts = video_scr_pts + 
-                            (int) ( ( System.currentTimeMillis() - video_scr_t0 ) * playSpeed );
-        final int d_vpts = video_pts_last - scr_pts;
-        return getPerfStringImpl( scr_pts, video_pts_last, d_vpts, getVideoDPTSAvg() );
-    }
-    private final String getPerfStringImpl(final int scr_pts, final int video_pts, final int d_vpts, final int video_dpts_avg_diff) {
-        final float tt = getDuration() / 1000.0f;        
-        final int audio_scr = (int) ( ( System.currentTimeMillis() - audio_scr_t0 ) * playSpeed );
+        final long currentTimeMillis = Platform.currentTimeMillis();
+        final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed );        
+        final int d_vpts = video_pts_last - video_scr;
+        final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
         final int audio_pts = getAudioPTSImpl();
         final int d_apts = audio_pts - audio_scr;
+        return getPerfStringImpl( video_scr, video_pts_last, d_vpts, audio_scr, audio_pts, d_apts, getVideoDPTSAvg() );
+    }
+    private final String getPerfStringImpl(final int video_scr, final int video_pts, final int d_vpts,
+                                           final int audio_scr, final int audio_pts, final int d_apts,
+                                           final int video_dpts_avg_diff) {
+        final float tt = getDuration() / 1000.0f;        
         final String audioSinkInfo;
         final AudioSink audioSink = getAudioSink();
         if( null != audioSink ) {
@@ -1122,8 +1117,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
         final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
         final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
-        return state+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
-               "speed " + playSpeed+", vSCR "+scr_pts+", vpts "+video_pts+", dSCR["+d_vpts+", avrg "+video_dpts_avg_diff+"], "+
+        return state+", frames[(p "+presentedFrameCount+", d "+decodedFrameCount+") / "+videoFrames+", "+tt+" s], "+
+               "speed " + playSpeed+", dAV "+( d_vpts - d_apts )+", vSCR "+video_scr+", vpts "+video_pts+", dSCR["+d_vpts+", avrg "+video_dpts_avg_diff+"], "+
                "aSCR "+audio_scr+", apts "+audio_pts+" ( "+d_apts+" ), "+audioSinkInfo+
                ", Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+"]";
     }
@@ -1163,5 +1158,4 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected static final String toHexString(int v) {
         return "0x"+Integer.toHexString(v);
     }
-        
 }
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index 5d70ca33d..ad8587e6b 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -37,6 +37,7 @@ import javax.media.opengl.GLProfile;
 import jogamp.opengl.util.av.GLMediaPlayerImpl;
 
 import com.jogamp.common.nio.Buffers;
+import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.IOUtil;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
@@ -51,7 +52,7 @@ import com.jogamp.opengl.util.texture.TextureSequence;
 public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     private TextureData texData = null;
     private int pos_ms = 0;
-    private int pos_start = 0;
+    private long pos_start = 0;
     
     public NullGLMediaPlayer() {
         super();
@@ -64,7 +65,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
 
     @Override
     protected final boolean playImpl() {
-        pos_start = (int)System.currentTimeMillis();
+        pos_start = Platform.currentTimeMillis();
         return true;
     }
 
@@ -81,14 +82,14 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking) {
+    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost) {
         nextFrame.setPTS( getAudioPTSImpl() );
         return true;
     }
     
     @Override
     protected final int getAudioPTSImpl() { 
-        pos_ms = (int)System.currentTimeMillis() - pos_start;
+        pos_ms = (int) ( Platform.currentTimeMillis() - pos_start );
         validatePos();
         return pos_ms;
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index 3680da1a8..cf864daa2 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -55,9 +55,11 @@ import com.jogamp.common.util.RunnableExecutor;
  *          Tue Feb 28 12:07:53 2012 322537478b63c6bc01e640643550ff539864d790 minor  1 ->  2
  */
 class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
+    private static final boolean DEBUG = FFMPEGMediaPlayer.DEBUG || DynamicLibraryBundleInfo.DEBUG;
+    
     private static final List<String> glueLibNames = new ArrayList<String>(); // none
     
-    private static final int symbolCount = 32;
+    private static final int symbolCount = 38;
     private static final String[] symbolNames = {
          "avcodec_version",
          "avformat_version",
@@ -71,17 +73,20 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avcodec_open", 
          "avcodec_alloc_frame", 
          "avcodec_default_get_buffer", 
-         "avcodec_default_release_buffer", 
+         "avcodec_default_release_buffer",
+         "av_init_packet",
+         "av_new_packet",
+         "av_destruct_packet",
          "av_free_packet", 
          "avcodec_decode_audio4",     // 53.25.0   (opt)
          "avcodec_decode_audio3",     // 52.23.0
-/* 15 */ "avcodec_decode_video2",     // 52.23.0
+/* 18 */ "avcodec_decode_video2",     // 52.23.0
         
          // libavutil
          "av_pix_fmt_descriptors", 
          "av_free", 
          "av_get_bits_per_pixel",
-/* 19 */ "av_samples_get_buffer_size",
+/* 22 */ "av_samples_get_buffer_size",
         
          // libavformat
          "avformat_alloc_context",
@@ -93,10 +98,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "av_dump_format", 
          "av_read_frame",
          "av_seek_frame",
+         "avformat_seek_file",
+         "av_read_play",
+         "av_read_pause",
          "avformat_network_init",     // 53.13.0   (opt)
          "avformat_network_deinit",   // 53.13.0   (opt)
          "avformat_find_stream_info", // 53.3.0    (opt)
-/* 32 */ "av_find_stream_info",
+/* 38 */ "av_find_stream_info",
     };
     
     // alternate symbol names
@@ -203,7 +211,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
                         for(int j=0; !ok && j<iAltSymbolNames[ci].length; j++) {
                             final int si = iAltSymbolNames[ci][j];
                             ok = 0 != symbolAddr[si];
-                            if(ok && (true || DEBUG )) { // keep it verbose per default for now ..
+                            if(ok && DEBUG) {
                                 System.err.println("OK: Unresolved symbol <"+symbol+">, but has alternative <"+symbolNames[si]+">");
                             }
                         }
@@ -212,7 +220,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
                         System.err.println("Fail: Could not resolve symbol <"+symbolNames[i]+">: not optional, no alternatives.");
                         return false;
                     }
-                } else if(true || DEBUG ) { // keep it verbose per default for now ..
+                } else if(DEBUG) {
                     System.err.println("OK: Unresolved optional symbol <"+symbolNames[i]+">");
                 }
             }
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 dc7ceae39..8998f689a 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -156,7 +156,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     protected int[] vLinesize = { 0, 0, 0 }; // per plane
     protected int[] vTexWidth = { 0, 0, 0 }; // per plane
     protected int texWidth, texHeight; // overall (stuffing planes in one texture)
-    protected ByteBuffer texCopy;
     protected String singleTexComp = "r";
     protected GLPixelStorageModes psm;
 
@@ -174,7 +173,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if(!available) {
             throw new RuntimeException("FFMPEGMediaPlayer not available");
         }
-        moviePtr = createInstance0(DEBUG);
+        moviePtr = createInstance0( DEBUG_NATIVE );
         if(0==moviePtr) {
             throw new GLException("Couldn't create FFMPEGInstance");
         }
@@ -185,8 +184,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     protected final int validateTextureCount(int desiredTextureCount) {
         return desiredTextureCount>2 ? Math.max(4, desiredTextureCount) : 2;
     }
-    @Override
-    protected final boolean requiresOffthreadGLCtx() { return true; }
 
     @Override
     protected final void destroyImpl(GL gl) {
@@ -320,7 +317,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             case BGRA:
                 texWidth = vTexWidth[0]; texHeight = height; 
                 break;
-            default: // FIXME: Add more planar formats !
+            default: // FIXME: Add more formats !
                 throw new RuntimeException("Unsupported pixelformat: "+vPixelFmt);
         }
 
@@ -358,7 +355,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                 signed = true;
                 fixedP = true;
                 break;
-            default: // FIXME: Add more planar formats !
+            default: // FIXME: Add more formats !
                 throw new RuntimeException("Unsupported sampleformat: "+aSampleFmt);
         }
         avChosenAudioFormat = new AudioDataFormat(AudioDataType.PCM, sampleRate, sampleSize, channels, signed, fixedP, true /* littleEndian */);  
@@ -427,7 +424,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
               "  return vec4(r, g, b, 1);\n"+
               "}\n"
           ;
-        default: // FIXME: Add more planar formats !
+        default: // FIXME: Add more formats !
           return super.getTextureLookupFragmentShaderImpl();
       }        
     }
@@ -437,7 +434,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if(0==moviePtr) {
             return false;
         }
-        return true;
+        return play0(moviePtr);
     }
 
     @Override
@@ -445,7 +442,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if(0==moviePtr) {
             return false;
         }
-        return true;
+        return pause0(moviePtr);
     }
 
     @Override
@@ -457,28 +454,41 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking) {
+    protected void preNextTextureImpl(GL gl) {
+        psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
+    }
+    
+    @Override
+    protected void postNextTextureImpl(GL gl) {
+        psm.restore(gl);
+    }
+    
+    @Override
+    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost) {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
-        }                
-        psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
-        int avPTS = 0;
+        }
+        if( issuePreAndPost ) {
+            preNextTextureImpl(gl);
+        }
+        int vPTS = TextureFrame.INVALID_PTS;
         try {
             final Texture tex = nextFrame.getTexture();
             gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
             tex.enable(gl);
             tex.bind(gl);
 
-            /** Try decode up to 10 packets to find one containing video, i.e. vPTS > 0 */
-            for(int retry=10; 0 >= avPTS && 0 < retry; retry--) {
-               avPTS = readNextPacket0(moviePtr, textureTarget, textureFormat, textureType);
-               retry--;
+            /** Try decode up to 10 packets to find one containing video. */
+            for(int i=0; TextureFrame.INVALID_PTS == vPTS && 10 > i; i++) {
+               vPTS = readNextPacket0(moviePtr, textureTarget, textureFormat, textureType);
             }
         } finally {
-            psm.restore(gl);
+            if( issuePreAndPost ) {
+                postNextTextureImpl(gl);
+            }
         }
-        if( 0 < avPTS ) {
-            nextFrame.setPTS(avPTS);
+        if( TextureFrame.INVALID_PTS != vPTS ) {
+            nextFrame.setPTS(vPTS);
             return true;
         } else {
             return false;
@@ -492,6 +502,11 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
     }
 
+    private final int getBytesPerMS(int time) {
+        final int bytesPerSample = sinkChosenAudioFormat.sampleSize >>> 3; // /8
+        return time * ( sinkChosenAudioFormat.channelCount * bytesPerSample * ( sinkChosenAudioFormat.sampleRate / 1000 ) );        
+    }
+    
     @Override
     protected final boolean syncAVRequired() { return true; }
     
@@ -522,10 +537,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     private native Buffer getAudioBuffer0(long moviePtr, int plane);
     
     /**
-     * @return resulting current PTS: audio < 0, video > 0, invalid == 0
+     * @return resulting current video PTS, or {@link TextureFrame#INVALID_PTS}
      */
     private native int readNextPacket0(long moviePtr, int texTarget, int texFmt, int texType);
     
+    private native boolean play0(long moviePtr);
+    private native boolean pause0(long moviePtr);
     private native int seek0(long moviePtr, int position);
     
     public static enum SampleFormat {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index d03cad28a..c6f31d81e 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -156,7 +156,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     @Override
-    protected boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking) {
+    protected boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost) {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index 081e17323..06c3862db 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -68,13 +68,16 @@ typedef GLenum (APIENTRYP PFNGLGETERRORPROC) (void);
 /** Sync w/ GLMediaPlayer.STREAM_ID_AUTO */
 #define AV_STREAM_ID_AUTO -1
 
+/** Constant marking an invalid PTS, i.e. Integer.MIN_VALUE 0x80000000 {@value}. Sync w/ TextureFrame.INVALID_PTS */
+#define INVALID_PTS 0x80000000
+
 #define AV_HAS_API_REQUEST_CHANNELS(pAV) (AV_VERSION_MAJOR(pAV->avcodecVersion) < 55)
 
 static inline float my_av_q2f(AVRational a){
     return a.num / (float) a.den;
 }
-static inline int32_t my_av_q2i32(int32_t snum, AVRational a){
-    return (snum * a.num) / a.den;
+static inline int32_t my_av_q2i32(int64_t snum, AVRational a){
+    return (int32_t) ( ( snum * (int64_t) a.num ) / (int64_t)a.den );
 }
 
 typedef struct {
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
index bc376cebd..ca0bf9bb9 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
+++ b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
@@ -62,6 +62,9 @@ typedef int (APIENTRYP AVCODEC_OPEN)(AVCodecContext *avctx, AVCodec *codec);
 typedef AVFrame *(APIENTRYP AVCODEC_ALLOC_FRAME)(void);
 typedef int (APIENTRYP AVCODEC_DEFAULT_GET_BUFFER)(AVCodecContext *s, AVFrame *pic);
 typedef void (APIENTRYP AVCODEC_DEFAULT_RELEASE_BUFFER)(AVCodecContext *s, AVFrame *pic);
+typedef void (APIENTRYP AV_INIT_PACKET)(AVPacket *pkt);
+typedef int (APIENTRYP AV_NEW_PACKET)(AVPacket *pkt, int size);
+typedef void (APIENTRYP AV_DESTRUCT_PACKET)(AVPacket *pkt);
 typedef void (APIENTRYP AV_FREE_PACKET)(AVPacket *pkt);
 typedef int (APIENTRYP AVCODEC_DECODE_AUDIO4)(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt);     // 53.25.0
 typedef int (APIENTRYP AVCODEC_DECODE_AUDIO3)(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt);  // 52.23.0
@@ -75,6 +78,9 @@ static AVCODEC_OPEN sp_avcodec_open;
 static AVCODEC_ALLOC_FRAME sp_avcodec_alloc_frame;
 static AVCODEC_DEFAULT_GET_BUFFER sp_avcodec_default_get_buffer;
 static AVCODEC_DEFAULT_RELEASE_BUFFER sp_avcodec_default_release_buffer;
+static AV_INIT_PACKET sp_av_init_packet;
+static AV_NEW_PACKET sp_av_new_packet;
+static AV_DESTRUCT_PACKET sp_av_destruct_packet;
 static AV_FREE_PACKET sp_av_free_packet;
 static AVCODEC_DECODE_AUDIO4 sp_avcodec_decode_audio4;    // 53.25.0
 static AVCODEC_DECODE_AUDIO3 sp_avcodec_decode_audio3;    // 52.23.0
@@ -89,7 +95,7 @@ static const AVPixFmtDescriptor* sp_av_pix_fmt_descriptors;
 static AV_FREE sp_av_free;
 static AV_GET_BITS_PER_PIXEL sp_av_get_bits_per_pixel;
 static AV_SAMPLES_GET_BUFFER_SIZE sp_av_samples_get_buffer_size;
-// count: 19
+// count: 22
 
 // libavformat
 typedef AVFormatContext *(APIENTRYP AVFORMAT_ALLOC_CONTEXT)(void);
@@ -101,6 +107,9 @@ typedef int (APIENTRYP AVFORMAT_OPEN_INPUT)(AVFormatContext **ps, const char *fi
 typedef void (APIENTRYP AV_DUMP_FORMAT)(AVFormatContext *ic, int index, const char *url, int is_output);
 typedef int (APIENTRYP AV_READ_FRAME)(AVFormatContext *s, AVPacket *pkt);
 typedef int (APIENTRYP AV_SEEK_FRAME)(AVFormatContext *s, int stream_index, int64_t timestamp, int flags);
+typedef int (APIENTRYP AVFORMAT_SEEK_FILE)(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+typedef int (APIENTRYP AV_READ_PLAY)(AVFormatContext *s);
+typedef int (APIENTRYP AV_READ_PAUSE)(AVFormatContext *s);
 typedef int (APIENTRYP AVFORMAT_NETWORK_INIT)(void);                                                 // 53.13.0
 typedef int (APIENTRYP AVFORMAT_NETWORK_DEINIT)(void);                                               // 53.13.0
 typedef int (APIENTRYP AVFORMAT_FIND_STREAM_INFO)(AVFormatContext *ic, AVDictionary **options);      // 53.3.0
@@ -115,13 +124,16 @@ static AVFORMAT_OPEN_INPUT sp_avformat_open_input;
 static AV_DUMP_FORMAT sp_av_dump_format;
 static AV_READ_FRAME sp_av_read_frame;
 static AV_SEEK_FRAME sp_av_seek_frame;
+static AVFORMAT_SEEK_FILE sp_avformat_seek_file;
+static AV_READ_PLAY sp_av_read_play;
+static AV_READ_PAUSE sp_av_read_pause;
 static AVFORMAT_NETWORK_INIT sp_avformat_network_init;            // 53.13.0
 static AVFORMAT_NETWORK_DEINIT sp_avformat_network_deinit;        // 53.13.0
 static AVFORMAT_FIND_STREAM_INFO sp_avformat_find_stream_info;    // 53.3.0
 static AV_FIND_STREAM_INFO sp_av_find_stream_info;
-// count: 32
+// count: 38
 
-#define SYMBOL_COUNT 32
+#define SYMBOL_COUNT 38
 
 JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGDynamicLibraryBundleInfo_initSymbols0
   (JNIEnv *env, jclass clazz, jobject jSymbols, jint count)
@@ -152,17 +164,20 @@ JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGDynamicLibraryB
     sp_avcodec_alloc_frame = (AVCODEC_ALLOC_FRAME) (intptr_t) symbols[i++];
     sp_avcodec_default_get_buffer = (AVCODEC_DEFAULT_GET_BUFFER) (intptr_t) symbols[i++];
     sp_avcodec_default_release_buffer = (AVCODEC_DEFAULT_RELEASE_BUFFER) (intptr_t) symbols[i++];
+    sp_av_init_packet = (AV_INIT_PACKET) (intptr_t) symbols[i++];
+    sp_av_new_packet = (AV_NEW_PACKET) (intptr_t) symbols[i++];
+    sp_av_destruct_packet = (AV_DESTRUCT_PACKET) (intptr_t) symbols[i++];
     sp_av_free_packet = (AV_FREE_PACKET) (intptr_t) symbols[i++];
     sp_avcodec_decode_audio4 = (AVCODEC_DECODE_AUDIO4) (intptr_t) symbols[i++];
     sp_avcodec_decode_audio3 = (AVCODEC_DECODE_AUDIO3) (intptr_t) symbols[i++];
     sp_avcodec_decode_video2 = (AVCODEC_DECODE_VIDEO2) (intptr_t) symbols[i++];
-    // count: 15
+    // count: 18
 
     sp_av_pix_fmt_descriptors = (const AVPixFmtDescriptor*)  (intptr_t) symbols[i++];
     sp_av_free = (AV_FREE) (intptr_t) symbols[i++];
     sp_av_get_bits_per_pixel = (AV_GET_BITS_PER_PIXEL) (intptr_t) symbols[i++];
     sp_av_samples_get_buffer_size = (AV_SAMPLES_GET_BUFFER_SIZE) (intptr_t) symbols[i++];
-    // count: 19
+    // count: 22
 
     sp_avformat_alloc_context = (AVFORMAT_ALLOC_CONTEXT) (intptr_t) symbols[i++];;
     sp_avformat_free_context = (AVFORMAT_FREE_CONTEXT) (intptr_t) symbols[i++];
@@ -173,11 +188,14 @@ JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGDynamicLibraryB
     sp_av_dump_format = (AV_DUMP_FORMAT) (intptr_t) symbols[i++];
     sp_av_read_frame = (AV_READ_FRAME) (intptr_t) symbols[i++];
     sp_av_seek_frame = (AV_SEEK_FRAME) (intptr_t) symbols[i++];
+    sp_avformat_seek_file = (AVFORMAT_SEEK_FILE) (intptr_t) symbols[i++];
+    sp_av_read_play = (AV_READ_PLAY) (intptr_t) symbols[i++];
+    sp_av_read_pause = (AV_READ_PAUSE) (intptr_t) symbols[i++];
     sp_avformat_network_init = (AVFORMAT_NETWORK_INIT) (intptr_t) symbols[i++];
     sp_avformat_network_deinit = (AVFORMAT_NETWORK_DEINIT) (intptr_t) symbols[i++];
     sp_avformat_find_stream_info = (AVFORMAT_FIND_STREAM_INFO) (intptr_t) symbols[i++];
     sp_av_find_stream_info = (AV_FIND_STREAM_INFO) (intptr_t) symbols[i++];
-    // count: 32
+    // count: 38
 
     (*env)->ReleasePrimitiveArrayCritical(env, jSymbols, symbols, 0);
 
@@ -502,7 +520,7 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
         // Customize ..
         // pAV->pACodecCtx->thread_count=2;
         // pAV->pACodecCtx->thread_type=FF_THREAD_FRAME|FF_THREAD_SLICE; // Decode more than one frame at once
-        pAV->pACodecCtx->thread_count=1;
+        pAV->pACodecCtx->thread_count=0;
         pAV->pACodecCtx->thread_type=0;
         pAV->pACodecCtx->workaround_bugs=FF_BUG_AUTODETECT;
         pAV->pACodecCtx->skip_frame=AVDISCARD_DEFAULT;
@@ -579,7 +597,7 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
         // Customize ..
         // pAV->pVCodecCtx->thread_count=2;
         // pAV->pVCodecCtx->thread_type=FF_THREAD_FRAME|FF_THREAD_SLICE; // Decode more than one frame at once
-        pAV->pVCodecCtx->thread_count=1;
+        pAV->pVCodecCtx->thread_count=0;
         pAV->pVCodecCtx->thread_type=0;
         pAV->pVCodecCtx->workaround_bugs=FF_BUG_AUTODETECT;
         pAV->pVCodecCtx->skip_frame=AVDISCARD_DEFAULT;
@@ -684,10 +702,12 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
     FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
 
     AVPacket packet;
-    int frameFinished;
-    jint resPTS = 0; // resulting current PTS: audio < 0, video > 0, invalid == 0
+    int frameDecoded;
+    jint resPTS = INVALID_PTS;
 
-    if(sp_av_read_frame(pAV->pFormatCtx, &packet)>=0) {
+    sp_av_init_packet(&packet);
+
+    if( sp_av_read_frame(pAV->pFormatCtx, &packet) >= 0 ) {
         if(packet.stream_index==pAV->aid) {
             // Decode audio frame
             if(NULL == pAV->pAFrames) { // no audio registered
@@ -704,10 +724,10 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                     break;
                 }
                 if(HAS_FUNC(sp_avcodec_decode_audio4)) {
-                    len1 = sp_avcodec_decode_audio4(pAV->pACodecCtx, pAFrameCurrent, &frameFinished, &packet);
+                    len1 = sp_avcodec_decode_audio4(pAV->pACodecCtx, pAFrameCurrent, &frameDecoded, &packet);
                 } else {
                     #if 0
-                    len1 = sp_avcodec_decode_audio3(pAV->pACodecCtx, int16_t *samples, int *frame_size_ptr, &frameFinished, &packet);
+                    len1 = sp_avcodec_decode_audio3(pAV->pACodecCtx, int16_t *samples, int *frame_size_ptr, &frameDecoded, &packet);
                     #endif
                     JoglCommon_throwNewRuntimeException(env, "Unimplemented: FFMPEGMediaPlayer sp_avcodec_decode_audio3 fallback");
                     return 0;
@@ -720,7 +740,7 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 packet.data += len1;
                 packet.size -= len1;
 
-                if (!frameFinished) {
+                if (!frameDecoded) {
                     // stop sending empty packets if the decoder is finished 
                     if (!packet.data && pAV->pACodecCtx->codec->capabilities & CODEC_CAP_DELAY) {
                         flush_complete = 1;
@@ -745,7 +765,7 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 const int64_t pkt_pts = pAFrameCurrent->pkt_pts;
                 int aptsMode;
                 if( 0 == frameCount && AV_NOPTS_VALUE != pkt_pts ) { // 1st frame only, discard invalid PTS ..
-                    pAV->aPTS = (pkt_pts * (int64_t) 1000 * (int64_t) time_base.num) / (int64_t) time_base.den ;
+                    pAV->aPTS = my_av_q2i32( pkt_pts * 1000, time_base);
                     aptsMode = 0;
                 } else { // subsequent frames or invalid PTS ..
                     const int32_t bytesPerSample = 2; // av_get_bytes_per_sample( pAV->pACodecCtx->sample_fmt );
@@ -753,14 +773,15 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                     aptsMode = 1;
                 }
                 if( pAV->verbose ) {
-                    fprintf(stderr, "A pts %d [pkt_pts %ld, pkt_dts %ld], dataSize %d, f# %d, pts-mode %d\n", 
-                        pAV->aPTS, pkt_pts, pAFrameCurrent->pkt_dts, data_size, frameCount, aptsMode);
+                    int32_t aDTS = my_av_q2i32( pAFrameCurrent->pkt_dts * 1000, time_base);
+
+                    fprintf(stderr, "A pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], dataSize %d, f# %d, pts-mode %d\n", 
+                        pAV->aPTS, pkt_pts, aDTS, pAFrameCurrent->pkt_dts, data_size, frameCount, aptsMode);
                 }
                 if( NULL != env ) {
                     jobject jSampleData = (*env)->NewDirectByteBuffer(env, pAFrameCurrent->data[0], data_size);
                     (*env)->CallVoidMethod(env, instance, jni_mid_pushSound, jSampleData, data_size, pAV->aPTS);
                 }
-                resPTS = pAV->aPTS * -1; // Audio Frame!
             }
         } else if(packet.stream_index==pAV->vid) {
             // Decode video frame
@@ -775,7 +796,7 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 if (flush_complete) {
                     break;
                 }
-                len1 = sp_avcodec_decode_video2(pAV->pVCodecCtx, pAV->pVFrame, &frameFinished, &packet);
+                len1 = sp_avcodec_decode_video2(pAV->pVCodecCtx, pAV->pVFrame, &frameDecoded, &packet);
                 if (len1 < 0) {
                     // if error, we skip the frame
                     packet.size = 0;
@@ -784,7 +805,7 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 packet.data += len1;
                 packet.size -= len1;
 
-                if (!frameFinished) {
+                if (!frameDecoded) {
                     // stop sending empty packets if the decoder is finished
                     if (!packet.data && pAV->pVCodecCtx->codec->capabilities & CODEC_CAP_DELAY) {
                         flush_complete = 1;
@@ -796,15 +817,25 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 const AVRational time_base = pAV->pVStream->time_base;
                 const int64_t pkt_pts = pAV->pVFrame->pkt_pts;
                 if(AV_NOPTS_VALUE != pkt_pts) { // discard invalid PTS ..
-                    int32_t vPTS2 = (pAV->pVFrame->pkt_dts * (int64_t) 1000 * (int64_t) time_base.num) / (int64_t) time_base.den ;
-                    pAV->vPTS = (pkt_pts * (int64_t) 1000 * (int64_t) time_base.num) / (int64_t) time_base.den ;
+                    pAV->vPTS =  my_av_q2i32( pkt_pts * 1000, time_base);
                     if( pAV->verbose ) {
-                        fprintf(stderr, "V pts %d [pkt_pts %ld], pts2 %d [pkt_dts %ld]\n", pAV->vPTS, pkt_pts, vPTS2, pAV->pVFrame->pkt_dts);
-                    }
-                } else {
-                    if( pAV->verbose ) {
-                        fprintf(stderr, "V pts ?? [pkt_pts %ld], pts2 ?? [pkt_dts %ld]\n", pkt_pts, pAV->pVFrame->pkt_dts);
+                        int32_t vDTS = my_av_q2i32( pAV->pVFrame->pkt_dts * 1000, time_base);
+
+                        double frame_delay_d = av_q2d(pAV->pVCodecCtx->time_base);
+                        double frame_repeat_d = pAV->pVFrame->repeat_pict * (frame_delay_d * 0.5);
+
+                        int32_t frame_delay_i = my_av_q2i32(1000, pAV->pVCodecCtx->time_base);
+                        int32_t frame_repeat_i = pAV->pVFrame->repeat_pict * (frame_delay_i / 2);
+
+                        const char * warn = frame_repeat_i > 0 ? "REPEAT" : "NORMAL" ;
+
+                        fprintf(stderr, "V pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], time d(%lf s + r %lf = %lf s), i(%d ms + r %d = %d ms) - %s - f# %d\n", 
+                                pAV->vPTS, pkt_pts, vDTS, pAV->pVFrame->pkt_dts, 
+                                frame_delay_d, frame_repeat_d, (frame_delay_d + frame_repeat_d),
+                                frame_delay_i, frame_repeat_i, (frame_delay_i + frame_repeat_i), warn, frameCount);
                     }
+                } else if( pAV->verbose ) {
+                    fprintf(stderr, "V pts ?? [pkt_pts %ld], pts2 ?? [pkt_dts %ld], f# %d\n", pkt_pts, pAV->pVFrame->pkt_dts, frameCount);
                 }
                 resPTS = pAV->vPTS; // Video Frame!
 
@@ -846,6 +877,31 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
     return resPTS;
 }
 
+JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_play0
+  (JNIEnv *env, jobject instance, jlong ptr)
+{
+    FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
+    int res = sp_av_read_play(pAV->pFormatCtx);
+    if ( 0 != res && -ENOSYS != res ) { // Ignore ENOSYS (not impl.)
+        fprintf(stderr, "PLAY: err %d 0x%X\n", res, res);
+        return JNI_FALSE;
+    } else {
+        return JNI_TRUE;
+    }
+}
+JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_pause0
+  (JNIEnv *env, jobject instance, jlong ptr)
+{
+    FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
+    int res = sp_av_read_pause(pAV->pFormatCtx);
+    if ( 0 != res && -ENOSYS != res ) { // Ignore ENOSYS (not impl.)
+        fprintf(stderr, "PAUSE: err %d 0x%X\n", res, res);
+        return JNI_FALSE;
+    } else {
+        return JNI_TRUE;
+    }
+}
+
 JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_seek0
   (JNIEnv *env, jobject instance, jlong ptr, jint pos1)
 {
@@ -854,14 +910,14 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_seek0
     int64_t pts0 = pAV->pVFrame->pkt_pts;
     int64_t pts1 = (int64_t) (pos1 * (int64_t) pAV->pVStream->time_base.den)
                              / (1000 * (int64_t) pAV->pVStream->time_base.num);
+
     int flags = 0;
     if(pos1 < pos0) {
         flags |= AVSEEK_FLAG_BACKWARD;
     }
     fprintf(stderr, "SEEK: pre  : u %ld, p %ld -> u %ld, p %ld\n", pos0, pts0, pos1, pts1);
     sp_av_seek_frame(pAV->pFormatCtx, pAV->vid, pts1, flags);
-    pAV->vPTS = (int64_t) (pAV->pVFrame->pkt_pts * (int64_t) 1000 * (int64_t) pAV->pVStream->time_base.num)
-                / (int64_t) pAV->pVStream->time_base.den;
+    pAV->vPTS =  my_av_q2i32( pAV->pVFrame->pkt_pts * 1000, pAV->pVStream->time_base);
     fprintf(stderr, "SEEK: post : u %ld, p %ld\n", pAV->vPTS, pAV->pVFrame->pkt_pts);
     return pAV->vPTS;
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index fbbd77260..b673a9d2a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -33,9 +33,7 @@
 
 package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
 
-import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
@@ -102,20 +100,16 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
             int pts0 = mPlayer.getVideoPTS();
             int pts1 = 0;
             switch(e.getKeyCode()) {
-                case KeyEvent.VK_3:
                 case KeyEvent.VK_RIGHT:      pts1 = pts0 +  1000; break;
-                case KeyEvent.VK_4:
                 case KeyEvent.VK_UP:         pts1 = pts0 + 10000; break;
-                case KeyEvent.VK_2:
+                case KeyEvent.VK_PAGE_UP:    pts1 = pts0 + 30000; break;
                 case KeyEvent.VK_LEFT:       pts1 = pts0 -  1000; break;
-                case KeyEvent.VK_1:
                 case KeyEvent.VK_DOWN:       pts1 = pts0 - 10000; break;
+                case KeyEvent.VK_PAGE_DOWN:  pts1 = pts0 - 30000; break;
                 case KeyEvent.VK_ESCAPE:
-                case KeyEvent.VK_DELETE:
+                case KeyEvent.VK_HOME:
                 case KeyEvent.VK_BACK_SPACE: {
-                    mPlayer.setPlaySpeed(1.0f);
                     mPlayer.seek(0);
-                    mPlayer.play();
                     break;
                 }
                 case KeyEvent.VK_SPACE: {
@@ -126,6 +120,9 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
                     }
                     break;
                 }
+                case KeyEvent.VK_MULTIPLY:
+                      mPlayer.setPlaySpeed(1.0f); 
+                      break;
                 case KeyEvent.VK_SUBTRACT: {
                       float playSpeed = mPlayer.getPlaySpeed();
                       if( e.isShiftDown() ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index f5490d19a..af9454464 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -164,20 +164,16 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             int pts0 = mPlayer.getVideoPTS();
             int pts1 = 0;
             switch(e.getKeyCode()) {
-                case KeyEvent.VK_3:
                 case KeyEvent.VK_RIGHT:      pts1 = pts0 +  1000; break;
-                case KeyEvent.VK_4:
                 case KeyEvent.VK_UP:         pts1 = pts0 + 10000; break;
-                case KeyEvent.VK_2:
+                case KeyEvent.VK_PAGE_UP:    pts1 = pts0 + 30000; break;
                 case KeyEvent.VK_LEFT:       pts1 = pts0 -  1000; break;
-                case KeyEvent.VK_1:
                 case KeyEvent.VK_DOWN:       pts1 = pts0 - 10000; break;
+                case KeyEvent.VK_PAGE_DOWN:  pts1 = pts0 - 30000; break;
                 case KeyEvent.VK_ESCAPE:
-                case KeyEvent.VK_DELETE:
+                case KeyEvent.VK_HOME:
                 case KeyEvent.VK_BACK_SPACE: {
-                    mPlayer.setPlaySpeed(1.0f);
                     mPlayer.seek(0);
-                    mPlayer.play();
                     break;
                 }
                 case KeyEvent.VK_SPACE: {
@@ -188,6 +184,9 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
                     }
                     break;
                 }
+                case KeyEvent.VK_MULTIPLY:
+                      mPlayer.setPlaySpeed(1.0f); 
+                      break;
                 case KeyEvent.VK_SUBTRACT: {
                       float playSpeed = mPlayer.getPlaySpeed();
                       if( e.isShiftDown() ) {
-- 
cgit v1.2.3


From 3f262a9f4653a09b28a84442378428c18b64775f Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Fri, 16 Aug 2013 21:09:21 +0200
Subject: GLMediaPlayerImpl: Refine getNextTexture(..) DEBUG output, put 'last
 SCR delay' in regular println.

---
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java       | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 85b599c0e..8456aca6f 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -574,15 +574,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 newFrameAvailable(nextFrame, currentTimeMillis);
                             }
                         }
-                        if( DEBUG ) {
-                            System.err.println("> "+currentTimeMillis+", d "+(currentTimeMillis-lastTimeMillis)+", playCached "+playCached);
-                        }
                         if( ok ) {
                             presentedFrameCount++;
                             final int video_pts = nextFrame.getPTS();
                             if( video_pts != TextureFrame.INVALID_PTS ) {
-                                lastTimeMillis = currentTimeMillis;
-                                
                                 final int audio_pts = getAudioPTSImpl();
                                 final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
                                 final int d_apts;
@@ -604,7 +599,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 if( -VIDEO_DPTS_MAX > d_vpts || d_vpts > VIDEO_DPTS_MAX ) {
                                 // if( -VIDEO_DPTS_MAX > d_avpts || d_avpts > VIDEO_DPTS_MAX ) {
                                     if( DEBUG ) {
-                                        System.err.println( "AV*: "+getPerfStringImpl( video_scr, video_pts, d_vpts, audio_scr, audio_pts, d_apts, 0 ) + ", "+nextFrame+", playCached " + playCached+ ", dropFrame "+dropFrame);
+                                        System.err.println( "AV*: dT "+(currentTimeMillis-lastTimeMillis)+", "+
+                                                getPerfStringImpl( video_scr, video_pts, d_vpts, audio_scr, audio_pts, d_apts, 0 ) + ", "+nextFrame+", playCached " + playCached+ ", dropFrame "+dropFrame);
                                     }
                                 } else {
                                     final int dpy_den = displayedFrameCount > 0 ? displayedFrameCount : 1;
@@ -625,10 +621,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                     }
                                     video_pts_last = video_pts;
                                     if( DEBUG ) {
-                                        System.err.println( "AV_: "+getPerfStringImpl( video_scr, video_pts, d_vpts,
-                                                                                       audio_scr, audio_pts, d_apts,
-                                                                                       video_dpts_avg_diff ) + 
-                                                                                       ", avg dpy-fps "+avg_dpy_duration+" ms/f, maxD "+maxVideoDelay+" ms, "+nextFrame+", playCached " + playCached + ", dropFrame "+dropFrame);
+                                        System.err.println( "AV_: dT "+(currentTimeMillis-lastTimeMillis)+", "+
+                                                getPerfStringImpl( video_scr, video_pts, d_vpts,
+                                                                   audio_scr, audio_pts, d_apts,
+                                                                   video_dpts_avg_diff ) + 
+                                                                   ", avg dpy-fps "+avg_dpy_duration+" ms/f, maxD "+maxVideoDelay+" ms, "+nextFrame+", playCached " + playCached + ", dropFrame "+dropFrame);
                                     }
                                 }
                             } else if( DEBUG ) {
@@ -640,6 +637,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 videoFramesFree.putBlocking(_lastFrame);
                             }
                         }
+                        lastTimeMillis = currentTimeMillis;
                     } while( dropFrame );
                 } catch (InterruptedException e) {
                     ok = false;
-- 
cgit v1.2.3


From 2cb284545a2a0fd35762a104fee8107234808389 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sat, 17 Aug 2013 01:30:25 +0200
Subject: GLMediaPlayer: Use URI instead of URL / Misc refinements

- GLMediaPlayer: Use URI instead of URL, allowing passing a non resolved location
  - Java's URL doesn't allow 'other' protocols, i.e. RTSP

- GLMediaPlayer: Add Table of test streams and their location ..

- FFMPEGMediaPlayer
  - Handle av_read_play/pause response on java side, ignore error - simply dump in DEBUG_NATIVE mode
---
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   | 38 +++++++++++++---
 .../android/av/AndroidGLMediaPlayerAPI14.java      |  8 ++--
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 16 +++----
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     | 39 +++++++++++-----
 .../opengl/util/av/impl/OMXGLMediaPlayer.java      | 20 ++++----
 .../jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c | 20 ++------
 .../opengl/test/android/MovieCubeActivity0.java    | 41 +++++++++++++----
 .../opengl/test/android/MovieSimpleActivity0.java  | 41 +++++++++++++----
 .../opengl/test/android/MovieSimpleActivity1.java  | 53 +++++++++++++++-------
 .../test/junit/jogl/demos/es2/av/MovieCube.java    | 21 ++++-----
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  | 19 ++++----
 11 files changed, 207 insertions(+), 109 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 1b82bb994..512567f33 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -28,7 +28,7 @@
 package com.jogamp.opengl.util.av;
 
 import java.io.IOException;
-import java.net.URLConnection;
+import java.net.URI;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GLException;
@@ -42,14 +42,14 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  * with a video stream as it's source.
  * <p>
  * Audio maybe supported and played back internally or via an {@link AudioSink} implementation,
- * if an audio stream is selected in {@link #initGLStream(GL, int, URLConnection, int, int)}.
+ * if an audio stream is selected in {@link #initGLStream(GL, int, URI, int, int)}.
  * </p>
  *   
  * <a name="lifecycle"><h5>GLMediaPlayer Lifecycle</h5></a>
  * <p>
  * <table border="1">
  *   <tr><th>action</th>                                                  <th>state before</th>        <th>state after</th></tr>
- *   <tr><td>{@link #initGLStream(GL, int, URLConnection, int, int)}</td> <td>Uninitialized</td>       <td>Paused</td></tr>
+ *   <tr><td>{@link #initGLStream(GL, int, URI, int, int)}</td> <td>Uninitialized</td>       <td>Paused</td></tr>
  *   <tr><td>{@link #play()}</td>                                         <td>Paused</td>              <td>Playing</td></tr>
  *   <tr><td>{@link #pause()}</td>                                        <td>Playing</td>             <td>Paused</td></tr>
  *   <tr><td>{@link #seek(int)}</td>                                      <td>Playing, Paused</td>     <td>Unchanged</td></tr>
@@ -121,6 +121,29 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  *   <li>Film:       +22ms and -22ms. audio ahead video / audio after video.</li>
  * </ul>
  * </p>
+ * 
+ * <a name="teststreams"><h5>Test Streams</h5></a>
+ * <p>
+ * <table border="1">
+ *   <tr><th colspan=5>Big Buck Bunny 24f 16:9</th></tr>
+ *   <tr><td>Big Buck Bunny</td><td>320p</td><td>h264<td>aac 48000Hz 2 chan</td><td>http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4</td></tr>
+ *   <tr><td>Big Buck Bunny</td><td>720p</td><td>mpeg4<td>ac3 48000Hz 5.1 chan</td><td>http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_surround.avi</td></tr>
+ *   <tr><td>Big Buck Bunny</td><td>720p</td><td>msmpeg4v2<td>mp3 48000Hz 2 chan</td><td>http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_stereo.avi</td></tr>
+ *   <tr><td>Big Buck Bunny</td><td>720p</td><td>theora<td>vorbis 48000Hz 2 chan</td><td>http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_stereo.ogg</td></tr>
+ *   <tr><td>Big Buck Bunny</td><td>1080p</td><td>mpeg4<td>ac3 48000Hz 5.1 chan</td><td>http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_surround.avi</td></tr>
+ *   <tr><th colspan=5>WebM/Matroska (vp8/vorbis)</th></tr>
+ *   <tr><td>Big Buck Bunny Trailer</td><td>640p</td><td>vp8<td>vorbis 44100Hz 1 chan</td><td>http://video.webmfiles.org/big-buck-bunny_trailer.webm</td></tr>
+ *   <tr><td>Elephants Dream</td><td>540p</td><td>vp8<td>vorbis 44100Hz 1 chan</td><td>http://video.webmfiles.org/elephants-dream.webm</td></tr>
+ *   <tr><th colspan=5>You Tube http/rtsp</th></tr>
+ *   <tr><td>Sintel</td><td colspan=3>http://www.youtube.com/watch?v=eRsGyueVLvQ</td><td>rtsp://v3.cache1.c.youtube.com/CiILENy73wIaGQn0LpXnygYbeRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp</td></tr>
+ *   <tr><th colspan=5>Audio/Video Sync</th></tr>
+ *   <tr><td>Five-minute-sync-test1080p</td><td colspan=3>https://www.youtube.com/watch?v=szoOsG9137U</td><td>rtsp://v7.cache8.c.youtube.com/CiILENy73wIaGQm133VvsA46sxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp</td></tr>
+ *   <tr><td>Audio-Video-Sync-Test-Calibration-23.98fps-24fps</td><td colspan=4>https://www.youtube.com/watch?v=cGgf_dbDMsw</td></tr>
+ *   <tr><td>sound_in_sync_test</td><td colspan=4>https://www.youtube.com/watch?v=O-zIZkhXNLE</td></tr>
+ *   <!-- <tr><td> title </td><td>1080p</td><td>mpeg4<td>ac3 48000Hz 5.1 chan</td><td> url </td></tr> -->
+ *   <!-- <tr><td> title </td><td colspan=3> url1 </td><td> url2 </td></tr>
+ * </table>
+ * </p>
  */
 public interface GLMediaPlayer extends TextureSequence {
     public static final boolean DEBUG = Debug.debug("GLMediaPlayer");
@@ -186,7 +209,7 @@ public interface GLMediaPlayer extends TextureSequence {
      * </p>
      * @param gl current GL object. If null, no video output and textures will be available.
      * @param textureCount desired number of buffered textures to be decoded off-thread, use <code>1</code> for on-thread decoding.  
-     * @param urlConn the stream connection
+     * @param streamLoc the stream location
      * @param vid video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>
      * @param aid video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>
      * @return the new state
@@ -195,12 +218,12 @@ public interface GLMediaPlayer extends TextureSequence {
      * @throws IOException in case of difficulties to open or process the stream
      * @throws GLException in case of difficulties to initialize the GL resources
      */
-    public State initGLStream(GL gl, int textureCount, URLConnection urlConn, int vid, int aid) throws IllegalStateException, GLException, IOException;
+    public State initGLStream(GL gl, int textureCount, URI streamLoc, int vid, int aid) throws IllegalStateException, GLException, IOException;
     
     /** 
      * If implementation uses a {@link AudioSink}, it's instance will be returned.
      * <p> 
-     * The {@link AudioSink} instance is available after {@link #initGLStream(GL, int, URLConnection, int, int)}, 
+     * The {@link AudioSink} instance is available after {@link #initGLStream(GL, int, URI, int, int)}, 
      * if used by implementation.
      * </p> 
      */
@@ -308,7 +331,8 @@ public interface GLMediaPlayer extends TextureSequence {
     @Override
     public TextureSequence.TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException;
     
-    public URLConnection getURLConnection();
+    /** Return the stream location, as set by {@link #initGLStream(GL, int, URI, int, int)}. */
+    public URI getURI();
 
     /**
      * <i>Warning:</i> Optional information, may not be supported by implementation.
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 86e6bc121..f87df950c 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -187,15 +187,15 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     
     @Override
     protected final void initGLStreamImpl(GL gl, int vid, int aid) throws IOException {
-        if(null!=mp && null!=urlConn) {
+        if(null!=mp && null!=streamLoc) {
             if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
                 mp.setVolume(0f, 0f);
                 // FIXME: Disable audio handling
             } // else FIXME: Select aid !
             // Note: Both FIXMEs seem to be n/a via Android's MediaPlayer -> Switch to API level 16 MediaCodec/MediaExtractor ..
             try {
-                final Uri uri = Uri.parse(urlConn.getURL().toExternalForm());        
-                mp.setDataSource(StaticContext.getContext(), uri);
+                final Uri _uri = Uri.parse(streamLoc.toString());        
+                mp.setDataSource(StaticContext.getContext(), _uri);
             } catch (IllegalArgumentException e) {
                 throw new RuntimeException(e);
             } catch (SecurityException e) {
@@ -210,7 +210,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             try {
                 mp.prepare();
             } catch (IOException ioe) {
-                throw new IOException("MediaPlayer failed to process stream <"+urlConn.getURL().toExternalForm()+">: "+ioe.getMessage(), ioe);
+                throw new IOException("MediaPlayer failed to process stream <"+streamLoc.toString()+">: "+ioe.getMessage(), ioe);
             }
             final int r_aid = GLMediaPlayer.STREAM_ID_NONE == aid ? GLMediaPlayer.STREAM_ID_NONE : GLMediaPlayer.STREAM_ID_AUTO;
             final String icodec = "android";
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 8456aca6f..a82c84d17 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -28,7 +28,7 @@
 package jogamp.opengl.util.av;
 
 import java.io.IOException;
-import java.net.URLConnection;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.Iterator;
 
@@ -82,7 +82,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected int[] texMinMagFilter = { GL.GL_NEAREST, GL.GL_NEAREST };
     protected int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE };
     
-    protected URLConnection urlConn = null;
+    protected URI streamLoc = null;
     
     protected volatile float playSpeed = 1.0f;
     
@@ -378,7 +378,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
-    public final State initGLStream(GL gl, int reqTextureCount, URLConnection urlConn, int vid, int aid) throws IllegalStateException, GLException, IOException {
+    public final State initGLStream(GL gl, int reqTextureCount, URI streamLoc, int vid, int aid) throws IllegalStateException, GLException, IOException {
         synchronized( stateLock ) {
             if(State.Uninitialized != state) {
                 throw new IllegalStateException("Instance not in state "+State.Uninitialized+", but "+state+", "+this);
@@ -386,8 +386,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             decodedFrameCount = 0;
             presentedFrameCount = 0;
             displayedFrameCount = 0;
-            this.urlConn = urlConn;
-            if (this.urlConn != null) {
+            this.streamLoc = streamLoc;
+            if (this.streamLoc != null) {
                 try {                
                     if( null != gl ) {
                         removeAllTextureFrames(gl);
@@ -1014,8 +1014,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected abstract void destroyImpl(GL gl);
 
     @Override
-    public final URLConnection getURLConnection() {
-        return urlConn;
+    public final URI getURI() {
+        return streamLoc;
     }
 
     @Override
@@ -1081,7 +1081,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     @Override
     public final String toString() {
         final float tt = getDuration() / 1000.0f;
-        final String loc = ( null != urlConn ) ? urlConn.getURL().toExternalForm() : "<undefined stream>" ;
+        final String loc = ( null != streamLoc ) ? streamLoc.toString() : "<undefined stream>" ;
         final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
         final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
         final int video_scr = video_scr_pts + (int) ( ( Platform.currentTimeMillis() - video_scr_t0 ) * playSpeed );        
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 8998f689a..9838181ab 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -105,7 +105,10 @@ import jogamp.opengl.util.av.GLMediaPlayerImpl;
  */
 public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
 
-    // Count of zeroed buffers to return before switching to real sample provider
+    /** POSIX ENOSYS {@value}: Function not implemented. FIXME: Move to GlueGen ?!*/
+    private static final int ENOSYS = 38;
+    
+    /** Count of zeroed buffers to return before switching to real sample provider */
     private static final int TEMP_BUFFER_COUNT = 20;
 
     // Instance data
@@ -220,11 +223,13 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             setGLFuncs0(moviePtr, procAddrGLTexSubImage2D, procAddrGLGetError);
         }
         
-        final String urlS=urlConn.getURL().toExternalForm();
+        final String streamLocS=streamLoc.toString();
         
         aFrameCount = AFRAMES_PER_VFRAME * textureCount + AFRAMES_PER_VFRAME/2;
     
-        System.err.println("setURL: p1 "+this);
+        if(DEBUG) {
+            System.err.println("initGLStream: p1 "+this);
+        }
         destroyAudioSink();
         AudioSink _audioSink;
         if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
@@ -234,12 +239,16 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
         final AudioDataFormat preferredAudioFormat = _audioSink.getPreferredFormat();
          // setStream(..) issues updateAttributes*(..), and defines avChosenAudioFormat, vid, aid, .. etc
-        setStream0(moviePtr, urlS, vid, aid, aFrameCount, preferredAudioFormat.channelCount, preferredAudioFormat.sampleRate);
+        setStream0(moviePtr, streamLocS, vid, aid, aFrameCount, preferredAudioFormat.channelCount, preferredAudioFormat.sampleRate);
         // final int audioBytesPerFrame = bps_audio/8000 * frame_period * textureCount;
         
-        System.err.println("setURL: p2 preferred "+preferredAudioFormat+", avChosen "+avChosenAudioFormat+", "+this);
+        if(DEBUG) {
+            System.err.println("initGLStream: p2 preferred "+preferredAudioFormat+", avChosen "+avChosenAudioFormat+", "+this);
+        }
         sinkChosenAudioFormat = _audioSink.initSink(avChosenAudioFormat, aFrameCount);
-        System.err.println("setURL: p3 avChosen "+avChosenAudioFormat+", chosen "+sinkChosenAudioFormat);
+        if(DEBUG) {
+            System.err.println("initGLStream: p3 avChosen "+avChosenAudioFormat+", chosen "+sinkChosenAudioFormat);
+        }
         if( null == sinkChosenAudioFormat ) {
             System.err.println("AudioSink "+_audioSink.getClass().getName()+" does not support "+avChosenAudioFormat+", using Null");
             _audioSink.destroy();
@@ -434,15 +443,23 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if(0==moviePtr) {
             return false;
         }
-        return play0(moviePtr);
+        final int errno = play0(moviePtr);
+        if( DEBUG_NATIVE && errno != 0 && errno != -ENOSYS) {
+            System.err.println("libav play err: "+errno);
+        }
+        return true;
     }
-
+    
     @Override
     public final boolean pauseImpl() {
         if(0==moviePtr) {
             return false;
         }
-        return pause0(moviePtr);
+        final int errno = pause0(moviePtr);
+        if( DEBUG_NATIVE && errno != 0 && errno != -ENOSYS) {
+            System.err.println("libav pause err: "+errno);
+        }
+        return true;
     }
 
     @Override
@@ -541,8 +558,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      */
     private native int readNextPacket0(long moviePtr, int texTarget, int texFmt, int texType);
     
-    private native boolean play0(long moviePtr);
-    private native boolean pause0(long moviePtr);
+    private native int play0(long moviePtr);
+    private native int pause0(long moviePtr);
     private native int seek0(long moviePtr, int position);
     
     public static enum SampleFormat {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index c6f31d81e..d0517fc5f 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -29,7 +29,6 @@
 package jogamp.opengl.util.av.impl;
 
 import java.io.IOException;
-import java.net.URL;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GLException;
@@ -101,16 +100,21 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
-        final URL url = urlConn.getURL();
-        if(!url.getProtocol().equals("file")) {
-            throw new IOException("Only file URLs are allowed: "+url);            
+        if(!streamLoc.getScheme().equals("file")) {
+            throw new IOException("Only file schemes are allowed: "+streamLoc);            
+        }
+        final String path=streamLoc.getPath();
+        if(DEBUG) {
+            System.out.println("initGLStream: clean path "+path);
         }
-        final String path=url.getPath();
-        System.out.println("setURL: clean path "+path);
     
-        System.out.println("setURL: p1 "+this);
+        if(DEBUG) {
+            System.out.println("initGLStream: p1 "+this);
+        }
         _setStream(moviePtr, textureCount, path);
-        System.out.println("setURL: p2 "+this);        
+        if(DEBUG) {
+            System.out.println("initGLStream: p2 "+this);
+        }
     }
     
     @Override
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
index ca0bf9bb9..99b385e3c 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
+++ b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
@@ -877,29 +877,17 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
     return resPTS;
 }
 
-JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_play0
+JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_play0
   (JNIEnv *env, jobject instance, jlong ptr)
 {
     FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
-    int res = sp_av_read_play(pAV->pFormatCtx);
-    if ( 0 != res && -ENOSYS != res ) { // Ignore ENOSYS (not impl.)
-        fprintf(stderr, "PLAY: err %d 0x%X\n", res, res);
-        return JNI_FALSE;
-    } else {
-        return JNI_TRUE;
-    }
+    return sp_av_read_play(pAV->pFormatCtx);
 }
-JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_pause0
+JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_pause0
   (JNIEnv *env, jobject instance, jlong ptr)
 {
     FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
-    int res = sp_av_read_pause(pAV->pFormatCtx);
-    if ( 0 != res && -ENOSYS != res ) { // Ignore ENOSYS (not impl.)
-        fprintf(stderr, "PAUSE: err %d 0x%X\n", res, res);
-        return JNI_FALSE;
-    } else {
-        return JNI_TRUE;
-    }
+    return sp_av_read_pause(pAV->pFormatCtx);
 }
 
 JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_seek0
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
index e905bfeab..2c434f38a 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
@@ -28,6 +28,9 @@
 package com.jogamp.opengl.test.android;
 
 import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URLConnection;
 import java.util.Arrays;
 
@@ -65,12 +68,12 @@ public class MovieCubeActivity0 extends NewtBaseActivity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
-       String[] urls0 = new String[] {                    
+       String[] streamLocs = new String[] {                    
                System.getProperty("jnlp.media0_url2"),
                System.getProperty("jnlp.media0_url1"),
                System.getProperty("jnlp.media0_url0") };       
-       final URLConnection urlConnection0 = getResource(urls0, 0);
-       if(null == urlConnection0) { throw new RuntimeException("no media reachable: "+Arrays.asList(urls0)); }
+       final URI streamLoc = getURI(streamLocs, 0, false);
+       if(null == streamLoc) { throw new RuntimeException("no media reachable: "+Arrays.asList(streamLocs)); }
        
        // also initializes JOGL
        final GLCapabilities capsMain = new GLCapabilities(GLProfile.getGL2ES2());
@@ -85,7 +88,7 @@ public class MovieCubeActivity0 extends NewtBaseActivity {
            final Animator animator = new Animator();
            
            // Main           
-           final MovieCube demoMain = new MovieCube(urlConnection0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, -2.3f, 0f, 0f);
+           final MovieCube demoMain = new MovieCube(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, -2.3f, 0f, 0f);
            final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
            glWindowMain.setFullscreen(true);
            setContentView(getWindow(), glWindowMain);
@@ -106,14 +109,32 @@ public class MovieCubeActivity0 extends NewtBaseActivity {
        Log.d(TAG, "onCreate - X");
    }
    
-   static URLConnection getResource(String path[], int off) {
-       URLConnection uc = null;
-       for(int i=off; null==uc && i<path.length; i++) {
+   static URI getURI(String path[], int off, boolean checkAvail) {
+       URI uri = null;
+       for(int i=off; null==uri && i<path.length; i++) {
            if(null != path[i] && path[i].length()>0) {
-               uc = IOUtil.getResource(path[i], null);
-               Log.d(TAG, "Stream: <"+path[i]+">: "+(null!=uc));
+               if( checkAvail ) {
+                   final URLConnection uc = IOUtil.getResource(path[i], null);
+                   if( null != uc ) {
+                       try {
+                           uri = uc.getURL().toURI();
+                       } catch (URISyntaxException e) {
+                           uri = null;
+                       }
+                       if( uc instanceof HttpURLConnection ) {
+                           ((HttpURLConnection)uc).disconnect();
+                       }
+                   }
+               } else {
+                   try {
+                       uri = new URI(path[i]);
+                   } catch (URISyntaxException e) {
+                       uri = null;
+                   }
+               }
+               Log.d(TAG, "Stream: <"+path[i]+">: "+(null!=uri));
            }
        }
-       return uc;       
+       return uri;
    }
 }
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
index 7a92360fb..2c8f0eb50 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
@@ -28,6 +28,9 @@
 package com.jogamp.opengl.test.android;
 
 import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URLConnection;
 import java.util.Arrays;
 
@@ -65,12 +68,12 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
-       String[] urls0 = new String[] {                    
+       final String[] streamLocs = new String[] {                    
                System.getProperty("jnlp.media0_url2"),
                System.getProperty("jnlp.media0_url1"),
                System.getProperty("jnlp.media0_url0") };       
-       final URLConnection urlConnection0 = getResource(urls0, 0);
-       if(null == urlConnection0) { throw new RuntimeException("no media reachable: "+Arrays.asList(urls0)); }
+       final URI streamLoc = getURI(streamLocs, 0, false);
+       if(null == streamLoc) { throw new RuntimeException("no media reachable: "+Arrays.asList(streamLocs)); }
        
        // also initializes JOGL
        final GLCapabilities capsMain = new GLCapabilities(GLProfile.getGL2ES2());
@@ -85,7 +88,7 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
            final Animator animator = new Animator();
            
            // Main           
-           final MovieSimple demoMain = new MovieSimple(urlConnection0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO);
+           final MovieSimple demoMain = new MovieSimple(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO);
            demoMain.setScaleOrig(true);
            final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
            glWindowMain.setFullscreen(true);
@@ -106,14 +109,32 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
        Log.d(TAG, "onCreate - X");
    }
    
-   static URLConnection getResource(String path[], int off) {
-       URLConnection uc = null;
-       for(int i=off; null==uc && i<path.length; i++) {
+   static URI getURI(String path[], int off, boolean checkAvail) {
+       URI uri = null;
+       for(int i=off; null==uri && i<path.length; i++) {
            if(null != path[i] && path[i].length()>0) {
-               uc = IOUtil.getResource(path[i], null);
-               Log.d(TAG, "Stream: <"+path[i]+">: "+(null!=uc));
+               if( checkAvail ) {
+                   final URLConnection uc = IOUtil.getResource(path[i], null);
+                   if( null != uc ) {
+                       try {
+                           uri = uc.getURL().toURI();
+                       } catch (URISyntaxException e) {
+                           uri = null;
+                       }
+                       if( uc instanceof HttpURLConnection ) {
+                           ((HttpURLConnection)uc).disconnect();
+                       }
+                   }
+               } else {
+                   try {
+                       uri = new URI(path[i]);
+                   } catch (URISyntaxException e) {
+                       uri = null;
+                   }
+               }
+               Log.d(TAG, "Stream: <"+path[i]+">: "+(null!=uri));
            }
        }
-       return uc;       
+       return uri;
    }
 }
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
index d0fb41828..df6b91582 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
@@ -28,6 +28,9 @@
 package com.jogamp.opengl.test.android;
 
 import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URLConnection;
 import java.util.Arrays;
 
@@ -74,22 +77,22 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
        final boolean mPlayerSharedHUD = mPlayerHUD && Boolean.valueOf(System.getProperty("jnlp.mplayer.hud.shared"));
        Log.d(TAG, "onCreate - 0 - mPlayerLocal "+mPlayerLocal+", mPlayerNoScale "+mPlayerNoZoom+", mPlayerHUD "+mPlayerHUD+", mPlayerSharedHUD "+mPlayerSharedHUD);
        
-       String[] urls0 = new String[] {                    
+       String[] streamLocs = new String[] {                    
                System.getProperty("jnlp.media0_url2"),
                System.getProperty("jnlp.media0_url1"),
                System.getProperty("jnlp.media0_url0") };       
-       final URLConnection urlConnection0 = getResource(urls0, mPlayerLocal ? 2 : 0);
-       if(null == urlConnection0) { throw new RuntimeException("no media reachable: "+Arrays.asList(urls0)); }
+       final URI streamLoc0 = getURI(streamLocs, mPlayerLocal ? 2 : 0, false);
+       if(null == streamLoc0) { throw new RuntimeException("no media reachable: "+Arrays.asList(streamLocs)); }
        
-       final URLConnection urlConnection1;
+       final URI streamLoc1;
        {
-           URLConnection _urlConnection1 = null;
+           URI _streamLoc1 = null;
            if(mPlayerHUD && !mPlayerSharedHUD) {
                String[] urls1 = new String[] { System.getProperty("jnlp.media1_url0") };
-               _urlConnection1 = getResource(urls1, 0);
+               _streamLoc1 = getURI(urls1, 0, false);
            }
-           if(null == _urlConnection1) { _urlConnection1 = urlConnection0; }
-           urlConnection1 = _urlConnection1;
+           if(null == _streamLoc1) { _streamLoc1 = streamLoc0; }
+           streamLoc1 = _streamLoc1;
        }
        
        setTransparencyTheme();
@@ -111,7 +114,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
            final Animator animator = new Animator();
            
            // Main           
-           final MovieSimple demoMain = new MovieSimple(urlConnection0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO);
+           final MovieSimple demoMain = new MovieSimple(streamLoc0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO);
            if(mPlayerHUD) {
                demoMain.setEffects(MovieSimple.EFFECT_GRADIENT_BOTTOM2TOP);
                demoMain.setTransparency(0.9f);
@@ -154,7 +157,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
                            glWindowHUD.addGLEventListener(new MovieSimple(sharedPlayer));                            
                         } else {
                            try {
-                               glWindowHUD.addGLEventListener(new MovieSimple(urlConnection1, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO));
+                               glWindowHUD.addGLEventListener(new MovieSimple(streamLoc1, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO));
                            } catch (IOException e) {
                                e.printStackTrace();
                            }
@@ -190,14 +193,32 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
        Log.d(TAG, "onCreate - X");
    }
    
-   static URLConnection getResource(String path[], int off) {
-       URLConnection uc = null;
-       for(int i=off; null==uc && i<path.length; i++) {
+   static URI getURI(String path[], int off, boolean checkAvail) {
+       URI uri = null;
+       for(int i=off; null==uri && i<path.length; i++) {
            if(null != path[i] && path[i].length()>0) {
-               uc = IOUtil.getResource(path[i], null);
-               Log.d(TAG, "Stream: <"+path[i]+">: "+(null!=uc));
+               if( checkAvail ) {
+                   final URLConnection uc = IOUtil.getResource(path[i], null);
+                   if( null != uc ) {
+                       try {
+                           uri = uc.getURL().toURI();
+                       } catch (URISyntaxException e) {
+                           uri = null;
+                       }
+                       if( uc instanceof HttpURLConnection ) {
+                           ((HttpURLConnection)uc).disconnect();
+                       }
+                   }
+               } else {
+                   try {
+                       uri = new URI(path[i]);
+                   } catch (URISyntaxException e) {
+                       uri = null;
+                   }
+               }
+               Log.d(TAG, "Stream: <"+path[i]+">: "+(null!=uri));
            }
        }
-       return uc;       
+       return uri;
    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index b673a9d2a..a9c200943 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -34,9 +34,8 @@
 package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
 
 import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
 
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
@@ -65,19 +64,19 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 public class MovieCube implements GLEventListener, GLMediaEventListener {
     static boolean waitForKey = false;
     int textureCount = 3; // default - threaded
-    final URLConnection stream;
+    final URI streamLoc;
     final int vid, aid;
     final float zoom0, rotx, roty;
     TextureSequenceCubeES2 cube=null;
     GLMediaPlayer mPlayer=null;
     
-    public MovieCube() throws IOException {
-        this(new URL("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4").openConnection(), 
+    public MovieCube() throws IOException, URISyntaxException {
+        this(new URI("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4"), 
              GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, -2.3f, 0f, 0f);        
     }
     
-    public MovieCube(URLConnection stream, int vid, int aid, float zoom0, float rotx, float roty) throws IOException {
-        this.stream = stream;
+    public MovieCube(URI streamLoc, int vid, int aid, float zoom0, float rotx, float roty) throws IOException {
+        this.streamLoc = streamLoc;
         this.zoom0 = zoom0;
         this.rotx = rotx;
         this.roty = roty;
@@ -170,7 +169,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
             UITestCase.waitForKey("Init>");
         }
         try {
-            mPlayer.initGLStream(gl, textureCount, stream, vid, aid);
+            mPlayer.initGLStream(gl, textureCount, streamLoc, vid, aid);
         } catch (Exception e) { 
             e.printStackTrace(); 
             if(null != mPlayer) {
@@ -225,7 +224,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         cube.display(drawable);
     }
 
-    public static void main(String[] args) throws MalformedURLException, IOException, InterruptedException {
+    public static void main(String[] args) throws IOException, InterruptedException, URISyntaxException {
         int width = 510;
         int height = 300;
         int textureCount = 3; // default - threaded
@@ -283,7 +282,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         System.err.println("forceGL3   "+forceGL3);
         System.err.println("forceGLDef "+forceGLDef);
         
-        final MovieCube mc = new MovieCube(new URL(url_s).openConnection(), vid, aid, -2.3f, 0f, 0f);
+        final MovieCube mc = new MovieCube(new URI(url_s), vid, aid, -2.3f, 0f, 0f);
         
         final GLProfile glp;
         if(forceGLDef) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index af9454464..9d91ce8c8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -29,9 +29,8 @@
 package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
 
 import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.nio.FloatBuffer;
 
 import javax.media.opengl.GL;
@@ -72,6 +71,9 @@ import com.jogamp.opengl.util.texture.TextureCoords;
 import com.jogamp.opengl.util.texture.TextureSequence;
 import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
+/**
+ *
+ */
 public class MovieSimple implements GLEventListener, GLMediaEventListener {
     static boolean waitForKey = false;
     private int winWidth, winHeight;
@@ -103,7 +105,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
     }    
 
     GLMediaPlayer mPlayer;
-    final URLConnection stream;
+    final URI stream;
     final int vid, aid;
     boolean mPlayerExternal;
     boolean mPlayerShared;
@@ -213,13 +215,13 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         }        
     };
     
-    public MovieSimple(URLConnection stream, int vid, int aid) throws IOException {
+    public MovieSimple(URI streamLoc, int vid, int aid) throws IOException {
         mPlayerScaleOrig = false;
         mPlayerShared = false;
         mPlayerExternal = false;
         mPlayer = GLMediaPlayerFactory.createDefault();
         mPlayer.addEventListener(this);
-        this.stream = stream;
+        this.stream = streamLoc;
         this.vid = vid;
         this.aid = aid;
         System.out.println("pC.1 "+mPlayer);
@@ -590,7 +592,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         st.useProgram(gl, false);
     }
 
-    public static void main(String[] args) throws IOException, MalformedURLException {
+    public static void main(String[] args) throws IOException, URISyntaxException {
         int width = 640;
         int height = 600;
         int textureCount = 3; // default - threaded
@@ -654,7 +656,8 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         System.err.println("forceGL3   "+forceGL3);
         System.err.println("forceGLDef "+forceGLDef);
         
-        final MovieSimple ms = new MovieSimple(new URL(url_s).openConnection(), vid, aid);
+        final URI streamURI = new URI(url_s);
+        final MovieSimple ms = new MovieSimple(streamURI, vid, aid);
         ms.setTextureCount(textureCount);
         ms.setScaleOrig(!zoom);
         ms.setOrthoProjection(ortho);
-- 
cgit v1.2.3


From 474ce65081ecd452215bc07ab866666cb11ca8b1 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Fri, 23 Aug 2013 01:02:33 +0200
Subject: GLMediaPlayer Multithreaded Decoding: GLMediaPlayer* (Part-5) - WIP

- Update/fix GLMediaPlayer API doc

- GLMediaEventListener: Add event bits for all state changes to be delivered via attributesChanged(..)

- StreamWorker / Decoder Thread:
  - Use StreamWorker only !
  - Handle exceptions on StreamWorker via StreamException
  - Handles stream initialization and decoding (-> initStream(..))

- Split initGLStream(..) -> initStream(..) + initGL(GL)
  - allow initStream(..)'s implementation being executed on StreamWorker
  - allow GL initialization to be 'postponed' when stream is read,
    i.e. non blocking stream initialization (UI .. etc)

- Handle EOS via END_OF_STREAM_PTS -> pause/event

- Video: Use lock-free LFRingbuffer, similar to
  ALAudioSink (commit f18a94b3defef16e98badd6d99f2422609aa56c5)

+++

- FFMPEGDynamicLibraryBundleInfo
 - Add avcodec's:
     - avcodec_get_frame_defaults, avcodec_free_frame (54.28.0), avcodec_flush_buffers,
 - Add avutil's:
     - av_frame_unref (55.0.0)
 - Add avformat's:
     - avformat_seek_file (??)

+++

- FFMPEGMediaPlayer Native:
  - add 'snoop' video frames for a/v frame count relation.
    disabled per default, since no more needed due to ALAudioSink's
    grow-buffer usage of LFRingbuffer.

  - use sp_avcodec_free_frame if available

  - 'useRefCountedFrames=1' for libav 55.0 to cache more than one audio frame,
     not used since ALAudioSink's OpenAL usage does not require it (copies data once).
     Note: the above snooped-video frame count is used here.

  - use only one cached audio-frame (-> see above, OpenAL copies data once),
    while reusing the NIO buffer!

  - Perform OpenGL sync (glFinish) in native code!

  - find proper PTS value, i.e. either frame's PTS or DTS,
    see 'PTSStats'.

- FFMPEGMediaPlayer Java:
  - use private fields

  - simplified code due to above changes.

+++

Working Tests: MovieSimple and MovieCube

TODO-1: Fix
  - Android
  - OMXGLMediaPlayer

TODO-2:
  - Fix issue where async audio frames arrive much later than 1st video frame, i.e. around 300ms.
  - Default TextureCount .. maybe 3 ?
  - Adding Audio synchronization ?
  - Find 'truth' about correlation of audio and video PTS values,
    currently, we assume both to be unrelated ?
---
 make/scripts/tests.sh                              |   9 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   | 210 +++++++--
 .../android/av/AndroidGLMediaPlayerAPI14.java      |  13 +-
 .../jogamp/opengl/util/av/EGLMediaPlayerImpl.java  |   6 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 514 +++++++++++++--------
 .../jogamp/opengl/util/av/NullGLMediaPlayer.java   |   9 +-
 .../av/impl/FFMPEGDynamicLibraryBundleInfo.java    |  23 +-
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     | 239 +++++-----
 .../opengl/util/av/impl/OMXGLMediaPlayer.java      |  10 +-
 src/jogl/native/libav/ffmpeg_tool.h                |  36 +-
 .../jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c | 463 ++++++++++++++++---
 .../opengl/test/android/MovieCubeActivity0.java    |  43 +-
 .../opengl/test/android/MovieSimpleActivity0.java  |  61 ++-
 .../opengl/test/android/MovieSimpleActivity1.java  | 191 +++++---
 .../test/junit/jogl/demos/es2/av/MovieCube.java    | 182 +++++---
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  | 205 ++++----
 16 files changed, 1511 insertions(+), 703 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 7aac0ca33..6475f06b4 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -131,9 +131,10 @@ function jrun() {
     #D_ARGS="-Djogl.1thread=true -Djogl.debug.Threading"
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
-    D_ARGS="-Djogl.debug.GLMediaPlayer"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
-    #D_ARGS="-Djogl.debug.GLMediaPlayer.Native -Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.GLArrayData"
     #D_ARGS="-Djogl.debug.GLDrawable"
@@ -317,8 +318,8 @@ function testawtswt() {
 # 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.MovieSimple $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
 
 #
 # core/newt (testnoawt and testawt)
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 512567f33..726eddb01 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -27,7 +27,6 @@
  */
 package com.jogamp.opengl.util.av;
 
-import java.io.IOException;
 import java.net.URI;
 
 import javax.media.opengl.GL;
@@ -38,22 +37,56 @@ import jogamp.opengl.Debug;
 import com.jogamp.opengl.util.texture.TextureSequence;
 
 /**
- * GLMediaPlayer interface specifies a {@link TextureSequence}
- * with a video stream as it's source.
+ * GLMediaPlayer interface specifies a {@link TextureSequence} state machine
+ * using a multiplexed audio/video stream as it's source.
  * <p>
- * Audio maybe supported and played back internally or via an {@link AudioSink} implementation,
- * if an audio stream is selected in {@link #initGLStream(GL, int, URI, int, int)}.
+ * Audio maybe supported and played back internally or via an {@link AudioSink} implementation.
+ * </p>
+ * <p>
+ * Audio and video streams can be selected or muted via {@link #initStream(URI, int, int, int)}
+ * using the appropriate <a href="#streamIDs">stream id</a>'s.
  * </p>
  *   
+ * <a name="streamworker"><h5><i>StreamWorker</i> Decoding Thread</h5></a>
+ * <p>
+ * Most of the stream processing is performed on the decoding thread, a.k.a. <i>StreamWorker</i>:
+ * <ul>
+ *   <li>Stream initialization triggered by {@link #initStream(URI, int, int, int) initStream(..)} - User gets notified whether the stream has been initialized or not via {@link GLMediaEventListener#attributesChanged(GLMediaPlayer, int, long) attributesChanges(..)}.</li>
+ *   <li>Stream decoding - User gets notified of a new frame via {@link GLMediaEventListener#newFrameAvailable(GLMediaPlayer, com.jogamp.opengl.util.texture.TextureSequence.TextureFrame, long) newFrameAvailable(...)}.</li>
+ *   <li>Caught <a href="#streamerror">exceptions on the decoding thread</a> are delivered as {@link StreamException}s.</li>
+ * </ul>
+ * <i>StreamWorker</i> generates it's own {@link GLContext}, shared with the one passed to {@link #initGL(GL)}.
+ * The shared {@link GLContext} allows the decoding thread to push the video frame data directly into 
+ * the designated {@link TextureFrame}, later returned via {@link #getNextTexture(GL)} and used by the user.
+ * </p>
+ * <a name="streamerror"><h7><i>StreamWorker</i> Error Handling</h7></a>
+ * <p>
+ * Caught exceptions on <a href="#streamworker">StreamWorker</a> are delivered as {@link StreamException}s,
+ * which either degrades the {@link State} to {@link State#Uninitialized} or {@link State#Paused}.
+ * </p>
+ * <p>
+ * An occurring {@link StreamException} triggers a {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} event,
+ * which can be listened to via {@link GLMediaEventListener#attributesChanged(GLMediaPlayer, int, long)}. 
+ * </p>
+ * <p>
+ * An occurred {@link StreamException} can be read via {@link #getStreamException()}. 
+ * </p>
+ * 
+ * </p>
  * <a name="lifecycle"><h5>GLMediaPlayer Lifecycle</h5></a>
  * <p>
  * <table border="1">
- *   <tr><th>action</th>                                                  <th>state before</th>        <th>state after</th></tr>
- *   <tr><td>{@link #initGLStream(GL, int, URI, int, int)}</td> <td>Uninitialized</td>       <td>Paused</td></tr>
- *   <tr><td>{@link #play()}</td>                                         <td>Paused</td>              <td>Playing</td></tr>
- *   <tr><td>{@link #pause()}</td>                                        <td>Playing</td>             <td>Paused</td></tr>
- *   <tr><td>{@link #seek(int)}</td>                                      <td>Playing, Paused</td>     <td>Unchanged</td></tr>
- *   <tr><td>{@link #destroy(GL)}</td>                                    <td>ANY</td>                 <td>Uninitialized</td></tr>
+ *   <tr><th>Action</th>                                               <th>{@link State} Before</th>                                        <th>{@link State} After</th>                                                                                                       <th>{@link GLMediaEventListener Event}</th></tr>
+ *   <tr><td>{@link #initStream(URI, int, int, int)}</td>              <td>{@link State#Uninitialized Uninitialized}</td>                   <td>{@link State#Initialized Initialized}<sup><a href="#streamworker">1</a></sup>, {@link State#Uninitialized Uninitialized}</td> <td>{@link GLMediaEventListener#EVENT_CHANGE_INIT EVENT_CHANGE_INIT} or ( {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} )</td></tr>
+ *   <tr><td>{@link #initGL(GL)}</td>                                  <td>{@link State#Initialized Initialized}</td>                       <td>{@link State#Paused Paused}, {@link State#Initialized Initialized}</td>                                                        <td>{@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE}</td></tr>
+ *   <tr><td>{@link #play()}</td>                                      <td>{@link State#Paused Paused}</td>                                 <td>{@link State#Playing Playing}</td>                                                                                             <td>{@link GLMediaEventListener#EVENT_CHANGE_PLAY EVENT_CHANGE_PLAY}</td></tr>
+ *   <tr><td>{@link #pause()}</td>                                     <td>{@link State#Playing Playing}</td>                               <td>{@link State#Paused Paused}</td>                                                                                               <td>{@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE}</td></tr>
+ *   <tr><td>{@link #seek(int)}</td>                                   <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>  <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>                                                                <td>none</td></tr>
+ *   <tr><td>{@link #getNextTexture(GL)}</td>                          <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>  <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>                                                                <td>none</td></tr>
+ *   <tr><td>{@link #getLastTexture()}</td>                            <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>  <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>                                                                <td>none</td></tr>
+ *   <tr><td>{@link TextureFrame#END_OF_STREAM_PTS END_OF_STREAM}</td> <td>{@link State#Playing Playing}</td>                               <td>{@link State#Paused Paused}</td>                                                                                               <td>{@link GLMediaEventListener#EVENT_CHANGE_EOS EVENT_CHANGE_EOS} + {@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE}</td></tr>
+ *   <tr><td>{@link StreamException}</td>                              <td>ANY</td>                                                         <td>{@link State#Paused Paused}, {@link State#Uninitialized Uninitialized}</td>                                                    <td>{@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + ( {@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} or {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} )</td></tr>
+ *   <tr><td>{@link #destroy(GL)}</td>                                 <td>ANY</td>                                                         <td>{@link State#Uninitialized Uninitialized}</td>                                                                                 <td>{@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT}</td></tr>
  * </table>
  * </p>
  * 
@@ -90,16 +123,18 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  * will allow tracking time up 2,147,483.647 seconds or
  * 24 days 20 hours 31 minutes and 23 seconds.
  * Milliseconds granularity is also more than enough to deal with A-V synchronization,
- * where the threshold usually lies within 100ms. 
+ * where the threshold usually lies within 22ms. 
  * </p>
  * 
  * <a name="synchronization"><h5>Audio and video synchronization</h5></a>
  * <p>
  * The class follows a passive A/V synchronization pattern.
- * Audio is being untouched, while {@link #getNextTexture(GL, boolean)} delivers a new video frame
- * only, if its timestamp is less than 22ms ahead of <i>time</i>.
- * Otherwise the early frame is cached for later retrieval and the previous frame is returned.
- * FIXME: Refine!
+ * Audio is being untouched, while {@link #getNextTexture(GL)} delivers a new video frame
+ * only, if its timestamp is less than {@link #MAXIMUM_VIDEO_ASYNC} ahead of <i>time</i>.
+ * If its timestamp is more than {@link #MAXIMUM_VIDEO_ASYNC} ahead of <i>time</i>,
+ * the previous frame is returned.
+ * If its timestamp is more than {@link #MAXIMUM_VIDEO_ASYNC} after <i>time</i>,
+ * the frame is dropped and the next frame is being fetched.
  * </p>
  * <p>
  * https://en.wikipedia.org/wiki/Audio_to_video_synchronization
@@ -149,37 +184,80 @@ public interface GLMediaPlayer extends TextureSequence {
     public static final boolean DEBUG = Debug.debug("GLMediaPlayer");
     public static final boolean DEBUG_NATIVE = Debug.debug("GLMediaPlayer.Native");
     
+    /** Minimum texture count, value {@value}. */
+    public static final int TEXTURE_COUNT_MIN = 4;
+    
     /** Constant {@value} for <i>mute</i> or <i>not available</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
     public static final int STREAM_ID_NONE = -2;
     /** Constant {@value} for <i>auto</i> or <i>unspecified</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
     public static final int STREAM_ID_AUTO = -1;
     
-    /** Maximum video frame async .. */
+    /** Maximum video frame async of {@value} milliseconds. */
     public static final int MAXIMUM_VIDEO_ASYNC = 22;
         
+    /**
+     * A StreamException encapsulates a caught exception in the decoder thread, a.k.a <i>StreamWorker</i>,
+     * see See <a href="#streamerror"><i>StreamWorker</i> Error Handling</a>.
+     */
+    @SuppressWarnings("serial")
+    public static class StreamException extends Exception {
+        public StreamException(Throwable cause) {
+            super(cause);
+        }
+        public StreamException(String message, Throwable cause) {
+            super(message, cause);
+        }
+    }
     public interface GLMediaEventListener extends TexSeqEventListener<GLMediaPlayer> {
     
-        static final int EVENT_CHANGE_VID    = 1<<0;
-        static final int EVENT_CHANGE_AID    = 1<<1;
-        static final int EVENT_CHANGE_SIZE   = 1<<2;
-        static final int EVENT_CHANGE_FPS    = 1<<3;
-        static final int EVENT_CHANGE_BPS    = 1<<4;
-        static final int EVENT_CHANGE_LENGTH = 1<<5;
-        static final int EVENT_CHANGE_CODEC  = 1<<6;
+        /** State changed to {@link State#Initialized}. See <a href="#lifecycle">Lifecycle</a>.*/
+        static final int EVENT_CHANGE_INIT   = 1<<0;
+        /** State changed to {@link State#Uninitialized}. See <a href="#lifecycle">Lifecycle</a>.*/
+        static final int EVENT_CHANGE_UNINIT = 1<<1;
+        /** State changed to {@link State#Playing}. See <a href="#lifecycle">Lifecycle</a>.*/
+        static final int EVENT_CHANGE_PLAY   = 1<<2;
+        /** State changed to {@link State#Paused}. See <a href="#lifecycle">Lifecycle</a>.*/
+        static final int EVENT_CHANGE_PAUSE  = 1<<3;
+        /** End of stream reached. See <a href="#lifecycle">Lifecycle</a>.*/
+        static final int EVENT_CHANGE_EOS    = 1<<4;
+        /** An error occurred, e.g. during off-thread initialization. See {@link StreamException} and <a href="#lifecycle">Lifecycle</a>. */
+        static final int EVENT_CHANGE_ERR    = 1<<5;
+        
+        /** Stream video id change. */
+        static final int EVENT_CHANGE_VID    = 1<<16;
+        /** Stream audio id change. */
+        static final int EVENT_CHANGE_AID    = 1<<17;
+        /** TextureFrame size change. */
+        static final int EVENT_CHANGE_SIZE   = 1<<18;
+        /** Stream fps change. */
+        static final int EVENT_CHANGE_FPS    = 1<<19;
+        /** Stream bps change. */
+        static final int EVENT_CHANGE_BPS    = 1<<20;
+        /** Stream length change. */
+        static final int EVENT_CHANGE_LENGTH = 1<<21;
+        /** Stream codec change. */
+        static final int EVENT_CHANGE_CODEC  = 1<<22;
     
         /**
          * @param mp the event source 
          * @param event_mask the changes attributes
          * @param when system time in msec. 
          */
-        public void attributesChanges(GLMediaPlayer mp, int event_mask, long when);    
+        public void attributesChanged(GLMediaPlayer mp, int event_mask, long when);    
     }
     
     /**
-     * See <a href="#lifecycle">GLMediaPlayer Lifecycle</a>.
+     * See <a href="#lifecycle">Lifecycle</a>.
      */
     public enum State {
-        Uninitialized(0), Playing(1), Paused(2);
+        /** Uninitialized player, no resources shall be hold. */
+        Uninitialized(0),
+        /** Stream has been initialized, user may play or call {@link #initGL(GL)}. */ 
+        Initialized(1), 
+        /** Stream is playing. */
+        Playing(2),
+        /** Stream is pausing. */
+        Paused(3);
         
         public final int id;
 
@@ -202,28 +280,62 @@ public interface GLMediaPlayer extends TextureSequence {
     public void setTextureWrapST(int[] wrapST);
     
     /** 
-     * Sets the stream to be used. Initializes all stream related states inclusive OpenGL ones,
-     * if <code>gl</code> is not null.
+     * Issues asynchronous stream initialization.
+     * <p>
+     * <a href="#lifecycle">Lifecycle</a>: {@link State#Uninitialized} -> {@link State#Initialized}<sup><a href="#streamworker">1</a></sup> or {@link State#Uninitialized}
+     * </p>
+     * <p>
+     * {@link State#Initialized} is reached asynchronous, 
+     * i.e. user gets notified via {@link GLMediaEventListener#attributesChanged(GLMediaPlayer, int, long) attributesChanges(..)}.
+     * </p>
+     * <p>
+     * A possible caught asynchronous {@link StreamException} while initializing the stream off-thread
+     * will be thrown at {@link #initGL(GL)}.
+     * </p>
+     * <p>
+     * Muted audio can be achieved by passing {@link #STREAM_ID_NONE} to <code>aid</code>.
+     * </p>
      * <p>
-     * <a href="#lifecycle">GLMediaPlayer Lifecycle</a>: Uninitialized -> Paused
+     * Muted video can be achieved by passing {@link #STREAM_ID_NONE} to <code>vid</code>,
+     * in which case <code>textureCount</code> is ignored as well as the passed GL object of the subsequent {@link #initGL(GL)} call. 
      * </p>
-     * @param gl current GL object. If null, no video output and textures will be available.
-     * @param textureCount desired number of buffered textures to be decoded off-thread, use <code>1</code> for on-thread decoding.  
      * @param streamLoc the stream location
      * @param vid video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>
      * @param aid video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>
-     * @return the new state
+     * @param textureCount desired number of buffered textures to be decoded off-thread, will be validated by implementation.
+     *        The minimum value is {@link #TEXTURE_COUNT_MIN}.
+     *        Ignored if video is muted.
+     * @throws IllegalStateException if not invoked in {@link State#Uninitialized} 
+     * @throws IllegalArgumentException if arguments are invalid
+     */
+    public void initStream(URI streamLoc, int vid, int aid, int textureCount) throws IllegalStateException, IllegalArgumentException;
+    
+    /**
+     * Returns the {@link StreamException} caught in the decoder thread, or <code>null</code>.
+     * @see GLMediaEventListener#EVENT_CHANGE_ERR
+     * @see StreamException
+     */
+    public StreamException getStreamException();
+    
+    /** 
+     * Initializes OpenGL related resources.
+     * <p>
+     * <a href="#lifecycle">Lifecycle</a>: {@link State#Initialized} -> {@link State#Paused} or {@link State#Initialized}
+     * </p>
+     * Argument <code>gl</code> is ignored if video is muted, see {@link #initStream(URI, int, int, int)}.
      * 
-     * @throws IllegalStateException if not invoked in state Uninitialized 
-     * @throws IOException in case of difficulties to open or process the stream
+     * @param gl current GL object. Maybe <code>null</code>, for audio only.
+     * @throws IllegalStateException if not invoked in {@link State#Initialized}. 
+     * @throws IllegalArgumentException if arguments are invalid
+     * @throws StreamException forwarded from the off-thread stream initialization
      * @throws GLException in case of difficulties to initialize the GL resources
      */
-    public State initGLStream(GL gl, int textureCount, URI streamLoc, int vid, int aid) throws IllegalStateException, GLException, IOException;
+    public void initGL(GL gl) throws IllegalStateException, IllegalArgumentException, StreamException, GLException;
     
     /** 
      * If implementation uses a {@link AudioSink}, it's instance will be returned.
      * <p> 
-     * The {@link AudioSink} instance is available after {@link #initGLStream(GL, int, URI, int, int)}, 
+     * The {@link AudioSink} instance is available after {@link #initStream(URI, int, int, int)}, 
      * if used by implementation.
      * </p> 
      */
@@ -232,7 +344,7 @@ public interface GLMediaPlayer extends TextureSequence {
     /**
      * Releases the GL and stream resources.
      * <p>
-     * <a href="#lifecycle">GLMediaPlayer Lifecycle</a>: <code>ANY</code> -> Uninitialized
+     * <a href="#lifecycle">Lifecycle</a>: <code>ANY</code> -> {@link State#Uninitialized}
      * </p>
      */
     public State destroy(GL gl);
@@ -250,18 +362,18 @@ public interface GLMediaPlayer extends TextureSequence {
     public float getPlaySpeed();
 
     /**
-     * <a href="#lifecycle">GLMediaPlayer Lifecycle</a>: Paused -> Playing
+     * <a href="#lifecycle">Lifecycle</a>: {@link State#Paused} -> {@link State#Playing}
      */
     public State play();
 
     /**
-     * <a href="#lifecycle">GLMediaPlayer Lifecycle</a>: Playing -> Paused
+     * <a href="#lifecycle">Lifecycle</a>: {@link State#Playing} -> {@link State#Paused}
      */
     public State pause();
 
     /**
-     * Allowed in state Playing and Paused, otherwise ignored,
-     * see <a href="#lifecycle">GLMediaPlayer Lifecycle</a>. 
+     * Allowed in state {@link State#Playing} and {@link State#Paused}, otherwise ignored,
+     * see <a href="#lifecycle">Lifecycle</a>. 
      * 
      * @param msec absolute desired time position in milliseconds 
      * @return time current position in milliseconds, after seeking to the desired position  
@@ -269,8 +381,8 @@ public interface GLMediaPlayer extends TextureSequence {
     public int seek(int msec);
 
     /**
-     * See <a href="#lifecycle">GLMediaPlayer Lifecycle</a>.
-     * @return the current state, either Uninitialized, Playing, Paused
+     * See <a href="#lifecycle">Lifecycle</a>.
+     * @return the current state, either {@link State#Uninitialized}, {@link State#Initialized}, {@link State#Playing} or {@link State#Paused}
      */
     public State getState();
     
@@ -286,13 +398,13 @@ public interface GLMediaPlayer extends TextureSequence {
     
     /**
      * @return the current decoded frame count since {@link #play()} and {@link #seek(int)} 
-     *         as increased by {@link #getNextTexture(GL, boolean)} or the decoding thread.
+     *         as increased by {@link #getNextTexture(GL)} or the decoding thread.
      */
     public int getDecodedFrameCount();
     
     /**
      * @return the current presented frame count since {@link #play()} and {@link #seek(int)} 
-     *         as increased by {@link #getNextTexture(GL, boolean)} for new frames.
+     *         as increased by {@link #getNextTexture(GL)} for new frames.
      */
     public int getPresentedFrameCount();
     
@@ -311,6 +423,7 @@ public interface GLMediaPlayer extends TextureSequence {
      * <p>
      * See <a href="#synchronization">audio and video synchronization</a>.
      * </p>
+     * @throws IllegalStateException if not invoked in {@link State#Paused} or {@link State#Playing}
      */
     @Override
     public TextureSequence.TextureFrame getLastTexture() throws IllegalStateException;
@@ -324,14 +437,15 @@ public interface GLMediaPlayer extends TextureSequence {
      * <p>
      * See <a href="#synchronization">audio and video synchronization</a>.
      * </p>
+     * @throws IllegalStateException if not invoked in {@link State#Paused} or {@link State#Playing}
      * 
      * @see #addEventListener(GLMediaEventListener)
      * @see GLMediaEventListener#newFrameAvailable(GLMediaPlayer, TextureFrame, long)
      */
     @Override
-    public TextureSequence.TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException;
+    public TextureSequence.TextureFrame getNextTexture(GL gl) throws IllegalStateException;
     
-    /** Return the stream location, as set by {@link #initGLStream(GL, int, URI, int, int)}. */
+    /** Return the stream location, as set by {@link #initStream(URI, int, int, int)}. */
     public URI getURI();
 
     /**
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index f87df950c..578a219e9 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -31,6 +31,7 @@ import java.io.IOException;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GLES2;
+import javax.media.opengl.GLException;
 
 import com.jogamp.common.os.AndroidVersion;
 import com.jogamp.common.os.Platform;
@@ -179,14 +180,14 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
         public final Surface getSurface() { return surface; }
         
         public String toString() {
-            return "SurfaceTextureFrame[" + pts + "ms: " + texture + ", " + surfaceTex + "]";
+            return "SurfaceTextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ texture.getTextureObject() + ", " + surfaceTex + "]";
         }
         private final SurfaceTexture surfaceTex;
         private final Surface surface; 
     }
     
     @Override
-    protected final void initGLStreamImpl(GL gl, int vid, int aid) throws IOException {
+    protected final void initStreamImpl(int vid, int aid) throws IOException {
         if(null!=mp && null!=streamLoc) {
             if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
                 mp.setVolume(0f, 0f);
@@ -220,9 +221,13 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                              0, 0, mp.getDuration(), icodec, icodec);
         }
     }
+    @Override
+    protected final void initGLImpl(GL gl) throws IOException, GLException {
+        // NOP
+    }
     
     @Override
-    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost) {
+    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         if(null != stex && null != mp) {
             final SurfaceTextureFrame nextSFrame = (SurfaceTextureFrame) nextFrame;
             final Surface nextSurface = nextSFrame.getSurface();
@@ -232,7 +237,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             // Only block once, no while-loop. 
             // This relaxes locking code of non crucial resources/events.
             boolean update = updateSurface;
-            if(!update && blocking) {
+            if( !update ) {
                 synchronized(updateSurfaceLock) {
                     if(!updateSurface) { // volatile OK.
                         try {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
index db2146cdc..ec375406d 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
@@ -69,7 +69,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
         public final long getSync() { return sync; }
         
         public String toString() {
-            return "EGLTextureFrame[" + texture + ", img "+ image + ", sync "+ sync+", clientBuffer "+clientBuffer+"]";
+            return "EGLTextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ texture.getTextureObject() + ", img "+ image + ", sync "+ sync+", clientBuffer "+clientBuffer+"]";
         }
         protected final Buffer clientBuffer;
         protected final long image;
@@ -82,10 +82,6 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
         this.texType = texType;
         this.useKHRSync = useKHRSync;
     }
-    @Override
-    protected final int validateTextureCount(int desiredTextureCount) {
-        return desiredTextureCount>2 ? Math.max(4, desiredTextureCount) : 2;
-    }
 
     @Override
     protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index a82c84d17..8193175b7 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -43,6 +43,8 @@ import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 
 import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.LFRingbuffer;
+import com.jogamp.common.util.Ringbuffer;
 import com.jogamp.opengl.util.av.AudioSink;
 import com.jogamp.opengl.util.av.AudioSink.AudioFrame;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
@@ -65,9 +67,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
     protected static final String unknown = "unknown";
 
-    /** Default texture count w/o threading, value {@value}. */
-    protected static final int TEXTURE_COUNT_DEFAULT = 2;
-    
     protected volatile State state;
     private Object stateLock = new Object();
     
@@ -86,33 +85,33 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     
     protected volatile float playSpeed = 1.0f;
     
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int vid = GLMediaPlayer.STREAM_ID_AUTO;
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int aid = GLMediaPlayer.STREAM_ID_AUTO;
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int width = 0;
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int height = 0;
-    /** Video avg. fps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Video avg. fps. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected float fps = 0;
-    /** Video avg. frame duration in ms. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Video avg. frame duration in ms. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected float frame_duration = 0f;
-    /** Stream bps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Stream bps. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int bps_stream = 0;
-    /** Video bps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Video bps. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int bps_video = 0;
-    /** Audio bps. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Audio bps. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int bps_audio = 0;
-    /** In frames. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** In frames. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int videoFrames = 0;
-    /** In frames. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** In frames. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int audioFrames = 0;
-    /** In ms. Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** In ms. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int duration = 0;
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected String acodec = unknown;
-    /** Shall be set by the {@link #initGLStreamImpl(GL, int, int)} method implementation. */
+    /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected String vcodec = unknown;
     
     protected volatile int decodedFrameCount = 0;
@@ -120,7 +119,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected int displayedFrameCount = 0;
     protected volatile int video_pts_last = 0;
     
-    /** See {@link #getAudioSink()}. Set by implementation if used from within {@link #initGLStreamImpl(GL, int, int)}! */
+    /** See {@link #getAudioSink()}. Set by implementation if used from within {@link #initStreamImpl(int, int)}! */
     protected AudioSink audioSink = null;
     protected boolean audioSinkPlaySpeedSet = false;
     
@@ -145,12 +144,20 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     /** Trigger video PTS reset with given cause as bitfield. */
     private boolean videoSCR_reset = false;
     
-    protected SyncedRingbuffer<TextureFrame> videoFramesFree =  null;
-    protected SyncedRingbuffer<TextureFrame> videoFramesDecoded =  null;
+    protected TextureFrame[] videoFramesOrig = null;
+    protected Ringbuffer<TextureFrame> videoFramesFree =  null;
+    protected Ringbuffer<TextureFrame> videoFramesDecoded =  null;
     protected volatile TextureFrame lastFrame = null;
 
     private ArrayList<GLMediaEventListener> eventListeners = new ArrayList<GLMediaEventListener>();
 
+    private static Ringbuffer.AllocEmptyArray<TextureFrame> rbAllocTextureFrameArray = new Ringbuffer.AllocEmptyArray<TextureFrame>() {
+        @Override
+        public TextureFrame[] newArray(int size) {
+            return new TextureFrame[size];
+        }        
+    };
+    
     protected GLMediaPlayerImpl() {
         this.textureCount=0;
         this.textureTarget=GL.GL_TEXTURE_2D;
@@ -186,11 +193,21 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final void setTextureWrapST(int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
     public final int[] getTextureWrapST() { return texWrapST; }    
     
+    private final void checkStreamInit() {
+        if(State.Uninitialized == state ) {
+            throw new IllegalStateException("Stream not initialized: "+this);
+        }        
+    }
+    
+    private final void checkGLInit() {
+        if(State.Uninitialized == state || State.Initialized == state ) {
+            throw new IllegalStateException("GL not initialized: "+this);
+        }        
+    }
+    
     @Override
     public String getRequiredExtensionsShaderStub() throws IllegalStateException {
-        if(State.Uninitialized == state) {
-            throw new IllegalStateException("Instance not initialized: "+this);
-        }
+        checkGLInit();
         if(GLES2.GL_TEXTURE_EXTERNAL_OES == textureTarget) {
             return TextureSequence.GL_OES_EGL_image_external_Required_Prelude;
         }
@@ -199,9 +216,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         
     @Override
     public String getTextureSampler2DType() throws IllegalStateException {
-        if(State.Uninitialized == state) {
-            throw new IllegalStateException("Instance not initialized: "+this);
-        }
+        checkGLInit();
         switch(textureTarget) {
             case GL.GL_TEXTURE_2D:
             case GL2.GL_TEXTURE_RECTANGLE: 
@@ -221,9 +236,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      */
     @Override
     public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException {
-        if(State.Uninitialized == state) {
-            throw new IllegalStateException("Instance not initialized: "+this);
-        }
+        checkGLInit();
         return "texture2D";
     }
     
@@ -236,9 +249,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      */
     @Override
     public String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
-        if(State.Uninitialized == state) {
-            throw new IllegalStateException("Instance not initialized: "+this);
-        }
+        checkGLInit();
         return ""; 
     }
     
@@ -246,7 +257,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final int getDecodedFrameCount() { return decodedFrameCount; }
     
     @Override
-    public final int getPresentedFrameCount() { return this.presentedFrameCount; }
+    public final int getPresentedFrameCount() { return presentedFrameCount; }
     
     @Override
     public final int getVideoPTS() { return video_pts_last; }
@@ -267,20 +278,21 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
     
+    @Override
     public final State getState() { return state; }
     
+    @Override
     public final State play() {
         synchronized( stateLock ) {
             switch( state ) {
                 case Paused:
                     if( playImpl() ) {
-                        // FIXME
                         resetAudioVideoPTS();
                         if( null != audioSink ) {
                             audioSink.play(); // cont. w/ new data
-                        }                        
-                        resumeFramePusher();
-                        state = State.Playing;
+                        }
+                        streamWorker.doResume();
+                        changeState(0, State.Playing);
                     }
                 default:
             }
@@ -290,15 +302,20 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     protected abstract boolean playImpl();
     
+    @Override
     public final State pause() {
+        return pauseImpl(0);
+    }
+    private final State pauseImpl(int event_mask) {
         synchronized( stateLock ) {
             if( State.Playing == state ) {
+                event_mask = addStateEventMask(event_mask, GLMediaPlayer.State.Paused);
                 state = State.Paused;
-                // FIXME
-                pauseFramePusher();
+                streamWorker.doPause();
                 if( null != audioSink ) {
                     audioSink.pause();
                 }
+                attributesUpdated( event_mask );
                 if( !pauseImpl() ) {
                     play();
                 }
@@ -309,6 +326,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     protected abstract boolean pauseImpl();
     
+    @Override
     public final int seek(int msec) {
         synchronized( stateLock ) {
             final int pts1;
@@ -317,14 +335,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 case Paused:
                     final State _state = state;
                     state = State.Paused;
-                    // FIXME
-                    pauseFramePusher();
+                    streamWorker.doPause();
                     pts1 = seekImpl(msec);
                     resetAllAudioVideoSync();
                     if( null != audioSink && State.Playing == _state ) {
                         audioSink.play(); // cont. w/ new data
                     }
-                    resumeFramePusher();
+                    System.err.println("SEEK XXX: "+getPerfString());
+                    streamWorker.doResume();
                     state = _state;
                     break;
                 default:
@@ -378,41 +396,31 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
-    public final State initGLStream(GL gl, int reqTextureCount, URI streamLoc, int vid, int aid) throws IllegalStateException, GLException, IOException {
+    public final void initStream(URI streamLoc, int vid, int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
         synchronized( stateLock ) {
             if(State.Uninitialized != state) {
-                throw new IllegalStateException("Instance not in state "+State.Uninitialized+", but "+state+", "+this);
+                throw new IllegalStateException("Instance not unintialized: "+this);
+            }
+            if(null == streamLoc) {
+                throw new IllegalArgumentException("streamLock is null");
+            }
+            if( STREAM_ID_NONE != vid ) {
+                textureCount = validateTextureCount(reqTextureCount);
+                if( textureCount < TEXTURE_COUNT_MIN ) {
+                    throw new InternalError("Validated texture count < "+TEXTURE_COUNT_MIN+": "+textureCount);
+                }
+            } else {
+                textureCount = 0;
             }
             decodedFrameCount = 0;
             presentedFrameCount = 0;
-            displayedFrameCount = 0;
+            displayedFrameCount = 0;            
             this.streamLoc = streamLoc;
+            this.vid = vid;
+            this.aid = aid;
             if (this.streamLoc != null) {
-                try {                
-                    if( null != gl ) {
-                        removeAllTextureFrames(gl);
-                        textureCount = validateTextureCount(reqTextureCount);
-                        if( textureCount < TEXTURE_COUNT_DEFAULT ) {
-                            throw new InternalError("Validated texture count < "+TEXTURE_COUNT_DEFAULT+": "+textureCount);
-                        }
-                        initGLStreamImpl(gl, vid, aid); // also initializes width, height, .. etc
-                        videoFramesFree = new SyncedRingbuffer<TextureFrame>(createTexFrames(gl, textureCount), true /* full */);
-                        if( TEXTURE_COUNT_DEFAULT < textureCount ) {
-                            videoFramesDecoded = new SyncedRingbuffer<TextureFrame>(new TextureFrame[textureCount], false /* full */);
-                            framePusher = new FramePusher(gl);
-                            framePusher.doStart();
-                        } else {
-                            videoFramesDecoded = null;
-                        }
-                        lastFrame = videoFramesFree.getBlocking(false /* clearRef */ );
-                        state = State.Paused;
-                    }
-                    return state;
-                } catch (Throwable t) {
-                    throw new GLException("Error initializing GL resources", t);
-                }
+                streamWorker = new StreamWorker();
             }
-            return state;
         }
     }
     /**
@@ -428,19 +436,62 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * @see #acodec
      * @see #vcodec
     */
-    protected abstract void initGLStreamImpl(GL gl, int vid, int aid) throws IOException;
+    protected abstract void initStreamImpl(int vid, int aid) throws Exception;
+    
+    @Override
+    public final StreamException getStreamException() {
+        synchronized( stateLock ) {
+            if( null != streamWorker ) {
+                return streamWorker.getStreamErr();
+            } else {
+                return null;
+            }
+        }
+    }
+    
+    @Override
+    public final void initGL(GL gl) throws IllegalStateException, StreamException, GLException {
+        synchronized( stateLock ) {
+            checkStreamInit();
+            final StreamException streamInitErr = streamWorker.getStreamErr();
+            if( null != streamInitErr ) {
+                streamWorker = null;
+                destroy(null);
+                throw streamInitErr;
+            }
+            try {                
+                if( STREAM_ID_NONE != vid ) {
+                    removeAllTextureFrames(gl);
+                    initGLImpl(gl);
+                    videoFramesOrig = createTexFrames(gl, textureCount);
+                    videoFramesFree = new LFRingbuffer<TextureFrame>(videoFramesOrig, rbAllocTextureFrameArray);
+                    videoFramesDecoded = new LFRingbuffer<TextureFrame>(textureCount, rbAllocTextureFrameArray);
+                    lastFrame = videoFramesFree.getBlocking( );
+                    streamWorker.initGL(gl);
+                } else {
+                    initGLImpl(null);
+                    setTextureFormat(-1, -1);
+                    setTextureType(-1);
+                    videoFramesFree = null;
+                    videoFramesDecoded = null;
+                    lastFrame = null;
+                }
+                changeState(0, State.Paused);
+            } catch (Throwable t) {
+                throw new GLException("Error initializing GL resources", t);
+            }
+        }
+    }
+    protected abstract void initGLImpl(GL gl) throws IOException, GLException;
     
     /** 
      * Returns the validated number of textures to be handled.
      * <p>
-     * Default is 2 textures w/o threading, last texture and the decoding texture. 
-     * </p>
-     * <p>
-     * &gt; 2 textures is used for threaded decoding, a minimum of 4 textures seems reasonable in this case.
+     * Default is {@link #TEXTURE_COUNT_MIN} textures, last texture and the decoding texture.
      * </p>
      */
     protected int validateTextureCount(int desiredTextureCount) {
-        return TEXTURE_COUNT_DEFAULT;
+        return desiredTextureCount < TEXTURE_COUNT_MIN ? TEXTURE_COUNT_MIN : desiredTextureCount;
     }
     
     private final TextureFrame[] createTexFrames(GL gl, final int count) {
@@ -512,42 +563,43 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
     @Override
     public final TextureFrame getLastTexture() throws IllegalStateException {
-        if(State.Uninitialized == state) {
-            throw new IllegalStateException("Instance not initialized: "+this);
+        if( State.Paused != state && State.Playing != state ) {
+            throw new IllegalStateException("Instance not paused or playing: "+this);
         }
         return lastFrame;
     }
     
     private final void removeAllTextureFrames(GL gl) {
-        if( null != videoFramesFree ) {
-            final TextureFrame[] texFrames = videoFramesFree.getArray(); 
+        if( null != videoFramesOrig ) {
+            final TextureFrame[] texFrames = videoFramesOrig;
+            videoFramesOrig = null;
             videoFramesFree = null;
             videoFramesDecoded = null;
             lastFrame = null;
             for(int i=0; i<texFrames.length; i++) {
                 final TextureFrame frame = texFrames[i];
                 if(null != frame) {
-                    destroyTexFrame(gl, frame);
+                    if( null != gl ) {
+                        destroyTexFrame(gl, frame);
+                    }
                     texFrames[i] = null;
                 }
                 System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null");            
             }        
         }
-        textureCount=0;
     }
     
     protected TextureFrame cachedFrame = null;
     protected long lastTimeMillis = 0;
     
     @Override
-    public final TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException {
+    public final TextureFrame getNextTexture(GL gl) throws IllegalStateException {
         synchronized( stateLock ) {
-            if(State.Uninitialized == state) {
-                throw new IllegalStateException("Instance not initialized: "+this);
+            if( State.Paused != state && State.Playing != state ) {
+                throw new IllegalStateException("Instance not paused or playing: "+this);
             }
             if(State.Playing == state) {
                 TextureFrame nextFrame = null;
-                boolean ok = true;
                 boolean dropFrame = false;
                 try {
                     do {
@@ -561,23 +613,16 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             nextFrame = cachedFrame;
                             cachedFrame = null;
                             presentedFrameCount--;
-                            currentTimeMillis = Platform.currentTimeMillis();
-                        } else if( TEXTURE_COUNT_DEFAULT < textureCount ) {
-                            nextFrame = videoFramesDecoded.getBlocking(false /* clearRef */ );
-                            currentTimeMillis = Platform.currentTimeMillis();
-                        } else {
-                            nextFrame = videoFramesFree.getBlocking(false /* clearRef */ );
-                            nextFrame.setPTS( TextureFrame.INVALID_PTS ); // mark invalid until processed!
-                            ok = getNextTextureImpl(gl, nextFrame, blocking, true /* issuePreAndPost */);
-                            currentTimeMillis = Platform.currentTimeMillis();
-                            if( ok ) {
-                                newFrameAvailable(nextFrame, currentTimeMillis);
-                            }
+                        } else if( STREAM_ID_NONE != vid ) {
+                            nextFrame = videoFramesDecoded.getBlocking();
                         }
-                        if( ok ) {
+                        currentTimeMillis = Platform.currentTimeMillis();
+                        if( null != nextFrame ) {
                             presentedFrameCount++;
                             final int video_pts = nextFrame.getPTS();
-                            if( video_pts != TextureFrame.INVALID_PTS ) {
+                            if( video_pts == TextureFrame.END_OF_STREAM_PTS ) {
+                                pauseImpl(GLMediaEventListener.EVENT_CHANGE_EOS);
+                            } else if( video_pts != TextureFrame.INVALID_PTS ) {
                                 final int audio_pts = getAudioPTSImpl();
                                 final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
                                 final int d_apts;
@@ -613,6 +658,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                     final int dt = (int) ( video_dpts_avg_diff / playSpeed + 0.5f );
                                     // final int dt = (int) ( d_vpts  / playSpeed + 0.5f );
                                     // final int dt = (int) ( d_avpts / playSpeed + 0.5f );
+                                    final TextureFrame _nextFrame = nextFrame;
                                     if( dt > maxVideoDelay ) {
                                         cachedFrame = nextFrame;
                                         nextFrame = null;
@@ -625,7 +671,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                                 getPerfStringImpl( video_scr, video_pts, d_vpts,
                                                                    audio_scr, audio_pts, d_apts,
                                                                    video_dpts_avg_diff ) + 
-                                                                   ", avg dpy-fps "+avg_dpy_duration+" ms/f, maxD "+maxVideoDelay+" ms, "+nextFrame+", playCached " + playCached + ", dropFrame "+dropFrame);
+                                                                   ", avg dpy-fps "+avg_dpy_duration+" ms/f, maxD "+maxVideoDelay+" ms, "+_nextFrame+", playCached " + playCached + ", dropFrame "+dropFrame);
                                     }
                                 }
                             } else if( DEBUG ) {
@@ -640,14 +686,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         lastTimeMillis = currentTimeMillis;
                     } while( dropFrame );
                 } catch (InterruptedException e) {
-                    ok = false;
                     e.printStackTrace();
-                } finally {
-                    if( !ok && null != nextFrame ) { // put back
-                        if( !videoFramesFree.put(nextFrame) ) {
-                            throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); 
-                        }
-                    }
                 }
             }
             displayedFrameCount++;
@@ -656,8 +695,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     protected void preNextTextureImpl(GL gl) {}
     protected void postNextTextureImpl(GL gl) {}
-    protected abstract boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost);
-    protected boolean syncAVRequired() { return false; }
+    /**
+     * Implementation shall care of OpenGL synchronization as required, e.g. glFinish()/glFlush()!
+     * @param gl
+     * @param nextFrame
+     * @return
+     */
+    protected abstract boolean getNextTextureImpl(GL gl, TextureFrame nextFrame);
     
     /** 
      * {@inheritDoc}
@@ -667,7 +711,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * </p>
      * <p>
      * Implementations using an {@link AudioSink} shall write it's instance to {@link #audioSink}
-     * from within their {@link #initGLStreamImpl(GL, int, int)} implementation.
+     * from within their {@link #initStreamImpl(int, int)} implementation.
      * </p>
      */
     @Override
@@ -686,12 +730,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     private void flushAllVideoFrames() {
         if( null != videoFramesFree ) {
-            videoFramesFree.reset(true);
+            videoFramesFree.resetFull(videoFramesOrig);
         }
         if( null != videoFramesDecoded ) {
-            videoFramesDecoded.reset(false);
+            videoFramesDecoded.clear();
         }
-        lastFrame = videoFramesFree.get(false /* clearRef */ );
+        lastFrame = videoFramesFree.get( );
         if( null == lastFrame ) { throw new InternalError("XXX"); }
         cachedFrame = null;
     }
@@ -727,7 +771,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
     
-    class FramePusher extends Thread {
+    class StreamWorker extends Thread {
         private volatile boolean isRunning = false;
         private volatile boolean isActive = false;
         private volatile boolean isBlocked = false;
@@ -735,28 +779,21 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         private volatile boolean shallPause = true;
         private volatile boolean shallStop = false;
         
-        private final GL gl;
+        private volatile StreamException streamErr = null;
+        private volatile GLContext sharedGLCtx = null;
+        private boolean sharedGLCtxCurrent = false;
         private GLDrawable dummyDrawable = null;
-        private GLContext sharedGLCtx = null;
         
-        FramePusher(GL gl) {
+        /** 
+         * Starts this daemon thread, 
+         * which initializes the stream first via {@link GLMediaPlayerImpl#initStreamImpl(int, int)} first.
+         * <p>
+         * After stream initialization, this thread pauses!
+         * </p>
+         **/ 
+        StreamWorker() {
             setDaemon(true);
-            
-            final GLContext glCtx = gl.getContext();
-            final boolean glCtxCurrent = glCtx.isCurrent();
-            final GLProfile glp = gl.getGLProfile();
-            final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
-            final AbstractGraphicsDevice device = glCtx.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
-            dummyDrawable = factory.createDummyDrawable(device, true, glp); // own device!
-            dummyDrawable.setRealized(true);
-            sharedGLCtx = dummyDrawable.createContext(glCtx);
-            makeCurrent(sharedGLCtx);
-            if( glCtxCurrent ) {
-                makeCurrent(glCtx);
-            } else {
-                sharedGLCtx.release();
-            }
-            this.gl = sharedGLCtx.getGL();
+            start();
         }
         
         private void makeCurrent(GLContext ctx) {
@@ -767,7 +804,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         
         private void destroySharedGL() {
             if( null != sharedGLCtx ) {
-                postNextTextureImpl(gl);
                 if( sharedGLCtx.isCreated() ) {
                     // Catch dispose GLExceptions by GLEventListener, just 'print' them
                     // so we can continue with the destruction.
@@ -787,6 +823,22 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }            
         }
         
+        public synchronized void initGL(GL gl) {
+            final GLContext glCtx = gl.getContext();
+            final boolean glCtxCurrent = glCtx.isCurrent();
+            final GLProfile glp = gl.getGLProfile();
+            final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+            final AbstractGraphicsDevice device = glCtx.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+            dummyDrawable = factory.createDummyDrawable(device, true, glp); // own device!
+            dummyDrawable.setRealized(true);
+            sharedGLCtx = dummyDrawable.createContext(glCtx);
+            makeCurrent(sharedGLCtx);
+            if( glCtxCurrent ) {
+                makeCurrent(glCtx);
+            } else {
+                sharedGLCtx.release();
+            }
+        }
         public synchronized void doPause() {
             if( isActive ) {
                 shallPause = true;
@@ -815,16 +867,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 }
             }
         }
-        public synchronized void doStart() {
-            start();
-            while( !isRunning ) {
-                try {
-                    this.wait();  // wait until started
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
         public synchronized void doStop() {
             if( isRunning ) {
                 shallStop = true;
@@ -843,28 +885,38 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
         public boolean isRunning() { return isRunning; }
         public boolean isActive() { return isActive; }
+        public StreamException getStreamErr() { return streamErr; } 
         
         public void run() {
-            setName(getName()+"-FramePusher_"+FramePusherInstanceId);
-            FramePusherInstanceId++;
+            setName(getName()+"-StreamWorker_"+StreamWorkerInstanceId);
+            StreamWorkerInstanceId++;
             
             synchronized ( this ) {
-                makeCurrent( sharedGLCtx );
-                preNextTextureImpl(gl);
                 isRunning = true;
-                this.notify();   // wake-up doStart()
+                try {
+                    isBlocked = true;
+                    initStreamImpl(vid, aid);
+                    isBlocked = false;
+                } catch (Throwable t) {
+                    streamErr = new StreamException(t.getClass().getSimpleName()+" while initializing: "+GLMediaPlayerImpl.this.toString(), t);
+                    isBlocked = false;
+                    isRunning = false;
+                    changeState(GLMediaEventListener.EVENT_CHANGE_ERR, GLMediaPlayer.State.Uninitialized);
+                    return; // end of thread!
+                } // also initializes width, height, .. etc
             }
             
             while( !shallStop ){
                 if( shallPause ) {
                     synchronized ( this ) {
-                        postNextTextureImpl(gl);
-                        sharedGLCtx.release();
+                        if( sharedGLCtxCurrent ) {
+                            postNextTextureImpl(sharedGLCtx.getGL());
+                            sharedGLCtx.release();
+                        }
                         while( shallPause && !shallStop ) {
                             isActive = false;
                             this.notify();   // wake-up doPause()
                             try {
-                                System.err.println("!!! PAUSE ON"); // FIXME
                                 this.wait(); // wait until resumed
                             } catch (InterruptedException e) {
                                 if( !shallPause ) {
@@ -872,70 +924,119 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 }
                             }
                         }
-                        makeCurrent(sharedGLCtx);
-                        preNextTextureImpl(gl);
-                        System.err.println("!!! PAUSE OFF"); // FIXME
+                        if( sharedGLCtxCurrent ) {
+                            makeCurrent(sharedGLCtx);
+                            preNextTextureImpl(sharedGLCtx.getGL());
+                        }
                         isActive = true;
                         this.notify(); // wake-up doResume()
                     }
                 }
+                if( !sharedGLCtxCurrent && null != sharedGLCtx ) {
+                    synchronized ( this ) {
+                        if( null != sharedGLCtx ) {
+                            makeCurrent( sharedGLCtx );
+                            preNextTextureImpl(sharedGLCtx.getGL());
+                            sharedGLCtxCurrent = true;
+                        }
+                    }
+                }
                 
                 if( !shallStop ) {
                     TextureFrame nextFrame = null;
-                    try {
-                        isBlocked = true;
-                        nextFrame = videoFramesFree.getBlocking(false /* clearRef */ );
-                        isBlocked = false;
-                        nextFrame.setPTS( TextureFrame.INVALID_PTS ); // mark invalid until processed!
-                        if( getNextTextureImpl(gl, nextFrame, true, false /* issuePreAndPost */) ) {
-                            // gl.glFinish();
-                            gl.glFlush(); // even better: sync object!
-                            if( !videoFramesDecoded.put(nextFrame) ) { 
-                                throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); 
+                    if( null != sharedGLCtx ) {
+                        try {
+                            isBlocked = true;
+                            nextFrame = videoFramesFree.getBlocking( );
+                            isBlocked = false;
+                            nextFrame.setPTS( TextureFrame.INVALID_PTS ); // mark invalid until processed!
+                            final GL gl = sharedGLCtxCurrent ? sharedGLCtx.getGL() : null;
+                            if( getNextTextureImpl(gl, nextFrame) ) {
+                                if( !videoFramesDecoded.put(nextFrame) ) {
+                                    throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); 
+                                }
+                                newFrameAvailable(nextFrame, Platform.currentTimeMillis());
+                                nextFrame = null;
+                            }
+                        } catch (InterruptedException e) {
+                            isBlocked = false;
+                            if( !shallStop && !shallPause ) {
+                                streamErr = new StreamException("InterruptedException while decoding: "+GLMediaPlayerImpl.this.toString(), e);
+                            }
+                        } catch (Throwable t) {
+                            streamErr = new StreamException(t.getClass().getSimpleName()+" while decoding: "+GLMediaPlayerImpl.this.toString(), t);
+                        } finally {
+                            if( null != nextFrame ) { // put back
+                                videoFramesFree.put(nextFrame);
+                            }
+                            if( null != streamErr ) {
+                                if( DEBUG ) {
+                                    final Throwable t = null != streamErr.getCause() ? streamErr.getCause() : streamErr;
+                                    System.err.println("Caught StreamException: "+t.getMessage());
+                                    t.printStackTrace();
+                                }
+                                // state transition incl. notification
+                                shallPause = true;
+                                isActive = false;
+                                pause();
                             }
-                            newFrameAvailable(nextFrame, Platform.currentTimeMillis());
-                            nextFrame = null;
-                        }
-                    } catch (InterruptedException e) {
-                        isBlocked = false;
-                        if( !shallStop && !shallPause ) {
-                            e.printStackTrace(); // oops
-                            shallPause = false;
-                            shallStop = true;
-                        }
-                    } finally {
-                        if( null != nextFrame ) { // put back
-                            videoFramesFree.put(nextFrame);
                         }
+                    } else {
+                        // audio only
+                        getNextTextureImpl(null, null);
                     }
                 }
             }
-            postNextTextureImpl(gl);
-            destroySharedGL();
             synchronized ( this ) {
+                if( sharedGLCtxCurrent ) {
+                    postNextTextureImpl(sharedGLCtx.getGL());
+                }
+                destroySharedGL();
                 isRunning = false;
                 isActive = false;
                 this.notify(); // wake-up doStop()
             }
         }
     }    
-    static int FramePusherInstanceId = 0;    
-    private FramePusher framePusher = null;
-
-    private final void pauseFramePusher() {
-        if( null != framePusher ) {
-            framePusher.doPause();
+    static int StreamWorkerInstanceId = 0;    
+    private StreamWorker streamWorker = null;
+    
+    protected final int addStateEventMask(int event_mask, State newState) {
+        if( state != newState ) {
+            switch( newState ) {
+                case Uninitialized:
+                    event_mask |= GLMediaEventListener.EVENT_CHANGE_UNINIT;
+                    break;
+                case Initialized:
+                    event_mask |= GLMediaEventListener.EVENT_CHANGE_INIT;
+                    break;
+                case Playing:
+                    event_mask |= GLMediaEventListener.EVENT_CHANGE_PLAY;
+                    break;
+                case Paused:
+                    event_mask |= GLMediaEventListener.EVENT_CHANGE_PAUSE;
+                    break;
+            }
         }
+        return event_mask;
     }
-    private final void resumeFramePusher() {
-        if( null != framePusher ) {
-            framePusher.doResume();
+    
+    protected final void attributesUpdated(int event_mask) {
+        if( 0 != event_mask ) {
+            final long now = Platform.currentTimeMillis();
+            synchronized(eventListenersLock) {
+                for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
+                    i.next().attributesChanged(this, event_mask, now);
+                }
+            }
         }
     }
-    private final void destroyFramePusher() {
-        if( null != framePusher ) {
-            framePusher.doStop();
-            framePusher = null;
+    
+    protected final void changeState(int event_mask, State newState) {
+        event_mask = addStateEventMask(event_mask, newState);
+        if( 0 != event_mask ) {
+            state = newState;
+            attributesUpdated( event_mask );
         }
     }
     
@@ -943,10 +1044,20 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                           int bps_video, int bps_audio, float fps, 
                                           int videoFrames, int audioFrames, int duration, String vcodec, String acodec) {
         int event_mask = 0;
+        if( state == State.Uninitialized ) {
+            event_mask |= GLMediaEventListener.EVENT_CHANGE_INIT;
+            state = State.Initialized;
+        }
+        if( STREAM_ID_AUTO == vid ) {
+            vid = STREAM_ID_NONE;
+        }
         if( this.vid != vid ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_VID;
             this.vid = vid;
         }   
+        if( STREAM_ID_AUTO == vid ) {
+            vid = STREAM_ID_NONE;
+        }
         if( this.aid != aid ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_AID;
             this.aid = aid;
@@ -984,30 +1095,24 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         if(0==event_mask) {
             return;
         }
-        attributesUpdated(event_mask);    
+        attributesUpdated(event_mask);
     }
 
-    protected final void attributesUpdated(int event_mask) {
-        synchronized(eventListenersLock) {
-            for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
-                i.next().attributesChanges(this, event_mask, Platform.currentTimeMillis());
-            }
-        }
-    }
-    
     @Override
     public final State destroy(GL gl) {
         synchronized( stateLock ) {
-            destroyFramePusher();
+            streamWorker.doStop();
+            streamWorker = null;
             destroyImpl(gl);
             removeAllTextureFrames(gl);
+            textureCount=0;
             if( null != videoFramesFree ) {
                 videoFramesFree.clear();
             }
             if( null != videoFramesDecoded ) {
                 videoFramesDecoded.clear();
             }
-            state = State.Uninitialized;
+            changeState(0, State.Uninitialized);            
             return state;
         }
     }
@@ -1039,6 +1144,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         return videoFrames;
     }
     
+    @Override
     public final int getAudioFrames() {
         return audioFrames;
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index ad8587e6b..31ac55ec3 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -32,6 +32,7 @@ import java.net.URLConnection;
 import java.nio.ByteBuffer;
 
 import javax.media.opengl.GL;
+import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 
 import jogamp.opengl.util.av.GLMediaPlayerImpl;
@@ -82,7 +83,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost) {
+    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         nextFrame.setPTS( getAudioPTSImpl() );
         return true;
     }
@@ -103,7 +104,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
         
     @Override
-    protected final void initGLStreamImpl(GL gl, int vid, int aid) throws IOException {
+    protected final void initStreamImpl(int vid, int aid) throws IOException {
         try {
             URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-160x90.png", this.getClass().getClassLoader());
             if(null != urlConn) {
@@ -137,6 +138,10 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
                          _w, _h, 0, 
                          0, 0, _fps, 
                          _totalFrames, 0, _duration, "png-static", null);
+    }    
+    @Override
+    protected final void initGLImpl(GL gl) throws IOException, GLException {
+        // NOP
     }
     
     @Override
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index cf864daa2..8865d47be 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -59,7 +59,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     
     private static final List<String> glueLibNames = new ArrayList<String>(); // none
     
-    private static final int symbolCount = 38;
+    private static final int symbolCount = 42;
     private static final String[] symbolNames = {
          "avcodec_version",
          "avformat_version",
@@ -71,22 +71,26 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avcodec_find_decoder", 
          "avcodec_open2",             // 53.6.0    (opt) 
          "avcodec_open", 
-         "avcodec_alloc_frame", 
+         "avcodec_alloc_frame",
+         "avcodec_get_frame_defaults",
+         "avcodec_free_frame",        // 54.28.0   (opt)
          "avcodec_default_get_buffer", 
          "avcodec_default_release_buffer",
+         "avcodec_flush_buffers",
          "av_init_packet",
          "av_new_packet",
          "av_destruct_packet",
          "av_free_packet", 
          "avcodec_decode_audio4",     // 53.25.0   (opt)
          "avcodec_decode_audio3",     // 52.23.0
-/* 18 */ "avcodec_decode_video2",     // 52.23.0
+/* 21 */ "avcodec_decode_video2",     // 52.23.0
         
          // libavutil
-         "av_pix_fmt_descriptors", 
-         "av_free", 
+         "av_pix_fmt_descriptors",
+         "av_frame_unref",            // 55.0.0 (opt)
+         "av_free",
          "av_get_bits_per_pixel",
-/* 22 */ "av_samples_get_buffer_size",
+/* 26 */ "av_samples_get_buffer_size",
         
          // libavformat
          "avformat_alloc_context",
@@ -98,13 +102,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "av_dump_format", 
          "av_read_frame",
          "av_seek_frame",
-         "avformat_seek_file",
+         "avformat_seek_file",        // ???       (opt)
          "av_read_play",
          "av_read_pause",
          "avformat_network_init",     // 53.13.0   (opt)
          "avformat_network_deinit",   // 53.13.0   (opt)
          "avformat_find_stream_info", // 53.3.0    (opt)
-/* 38 */ "av_find_stream_info",
+/* 42 */ "av_find_stream_info",
     };
     
     // alternate symbol names
@@ -120,6 +124,9 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avformat_free_context",     // 52.96.0   (opt)
          "avformat_network_init",     // 53.13.0   (opt)
          "avformat_network_deinit",   // 53.13.0   (opt)
+         "avformat_seek_file",        // ???       (opt)
+         "avcodec_free_frame",        // 54.28.0   (opt)
+         "av_frame_unref",            // 55.0.0 (opt)
     };
     
     private static long[] symbolAddr;
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 9838181ab..11073b2e3 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -108,14 +108,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     /** POSIX ENOSYS {@value}: Function not implemented. FIXME: Move to GlueGen ?!*/
     private static final int ENOSYS = 38;
     
-    /** Count of zeroed buffers to return before switching to real sample provider */
-    private static final int TEMP_BUFFER_COUNT = 20;
+    /** Default number of audio frames per video frame */
+    private static final int AV_DEFAULT_AFRAMES = 8;
 
     // Instance data
-    public static final VersionNumber avUtilVersion;
-    public static final VersionNumber avFormatVersion;
-    public static final VersionNumber avCodecVersion;    
-    static final boolean available;
+    private static final VersionNumber avUtilVersion;
+    private static final VersionNumber avFormatVersion;
+    private static final VersionNumber avCodecVersion;    
+    private static final boolean available;
     
     static {
         final boolean libAVGood = FFMPEGDynamicLibraryBundleInfo.initSingleton();
@@ -146,31 +146,33 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     // General
     //
     
-    protected long moviePtr = 0;    
+    private long moviePtr = 0;    
     
     //
     // Video
     //
     
-    protected PixelFormat vPixelFmt = null;
-    protected int vPlanes = 0;
-    protected int vBitsPerPixel = 0;
-    protected int vBytesPerPixelPerPlane = 0;    
-    protected int[] vLinesize = { 0, 0, 0 }; // per plane
-    protected int[] vTexWidth = { 0, 0, 0 }; // per plane
-    protected int texWidth, texHeight; // overall (stuffing planes in one texture)
-    protected String singleTexComp = "r";
-    protected GLPixelStorageModes psm;
+    private PixelFormat vPixelFmt = null;
+    private int vPlanes = 0;
+    private int vBitsPerPixel = 0;
+    private int vBytesPerPixelPerPlane = 0;    
+    private int[] vLinesize = { 0, 0, 0 }; // per plane
+    private int[] vTexWidth = { 0, 0, 0 }; // per plane
+    private int texWidth, texHeight; // overall (stuffing planes in one texture)
+    private String singleTexComp = "r";
+    private GLPixelStorageModes psm;
 
     //
     // Audio
     //
     
-    protected static final int AFRAMES_PER_VFRAME = 8;
-    protected int aFrameCount = 0;
-    protected SampleFormat aSampleFmt = null;
-    protected AudioSink.AudioDataFormat avChosenAudioFormat;
-    protected AudioSink.AudioDataFormat sinkChosenAudioFormat;
+    /** Initial audio frame count, ALAudioSink may grow buffer! */
+    private int initialAudioFrameCount = AV_DEFAULT_AFRAMES;
+    private final int audioFrameGrowAmount = 8;
+    private final int audioFrameLimit = 128;
+    private SampleFormat aSampleFmt = null;
+    private AudioSink.AudioDataFormat avChosenAudioFormat;
+    private AudioSink.AudioDataFormat sinkChosenAudioFormat;
     
     public FFMPEGMediaPlayer() {
         if(!available) {
@@ -183,10 +185,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         psm = new GLPixelStorageModes();
         audioSink = null;
     }
-    @Override
-    protected final int validateTextureCount(int desiredTextureCount) {
-        return desiredTextureCount>2 ? Math.max(4, desiredTextureCount) : 2;
-    }
 
     @Override
     protected final void destroyImpl(GL gl) {
@@ -205,101 +203,108 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final void initGLStreamImpl(GL gl, int vid, int aid) throws IOException {
+    protected final void initStreamImpl(int vid, int aid) throws IOException {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
-        {
-            final GLContextImpl ctx = (GLContextImpl)gl.getContext();
-            final ProcAddressTable pt = ctx.getGLProcAddressTable();
-            final long procAddrGLTexSubImage2D = getAddressFor(pt, "glTexSubImage2D");
-            if( 0 == procAddrGLTexSubImage2D ) {
-                throw new InternalError("glTexSubImage2D n/a in ProcAddressTable: "+pt.getClass().getName()+" of "+ctx.getGLVersion());
-            }
-            final long procAddrGLGetError = getAddressFor(pt, "glGetError");
-            if( 0 == procAddrGLGetError ) {
-                throw new InternalError("glGetError n/a in ProcAddressTable: "+pt.getClass().getName()+" of "+ctx.getGLVersion());
-            }
-            setGLFuncs0(moviePtr, procAddrGLTexSubImage2D, procAddrGLGetError);
-        }
-        
-        final String streamLocS=streamLoc.toString();
-        
-        aFrameCount = AFRAMES_PER_VFRAME * textureCount + AFRAMES_PER_VFRAME/2;
-    
         if(DEBUG) {
-            System.err.println("initGLStream: p1 "+this);
+            System.err.println("initStream: p1 "+this);
         }
+        
+        final String streamLocS=streamLoc.toString();        
         destroyAudioSink();
-        AudioSink _audioSink;
         if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
-            _audioSink = AudioSinkFactory.createNull();
+            audioSink = AudioSinkFactory.createNull();
         } else {
-            _audioSink = AudioSinkFactory.createDefault();
+            audioSink = AudioSinkFactory.createDefault();
         }
-        final AudioDataFormat preferredAudioFormat = _audioSink.getPreferredFormat();
-         // setStream(..) issues updateAttributes*(..), and defines avChosenAudioFormat, vid, aid, .. etc
-        setStream0(moviePtr, streamLocS, vid, aid, aFrameCount, preferredAudioFormat.channelCount, preferredAudioFormat.sampleRate);
-        // final int audioBytesPerFrame = bps_audio/8000 * frame_period * textureCount;
-        
+        final AudioDataFormat preferredAudioFormat = audioSink.getPreferredFormat();
         if(DEBUG) {
-            System.err.println("initGLStream: p2 preferred "+preferredAudioFormat+", avChosen "+avChosenAudioFormat+", "+this);
+            System.err.println("initStream: p2 preferred "+preferredAudioFormat+", "+this);
+        }
+         // setStream(..) issues updateAttributes*(..), and defines avChosenAudioFormat, vid, aid, .. etc
+        final int snoopVideoFrameCount = 0; // 10*textureCount
+        setStream0(moviePtr, streamLocS, vid, aid, snoopVideoFrameCount, preferredAudioFormat.channelCount, preferredAudioFormat.sampleRate);
+    }
+
+    @Override
+    protected final void initGLImpl(GL gl) throws IOException, GLException {
+        if(0==moviePtr) {
+            throw new GLException("FFMPEG native instance null");
+        }
+        if(null == audioSink) {
+            throw new GLException("AudioSink null");
         }
-        sinkChosenAudioFormat = _audioSink.initSink(avChosenAudioFormat, aFrameCount);
+        if( null != gl ) {
+            final GLContextImpl ctx = (GLContextImpl)gl.getContext();
+            AccessController.doPrivileged(new PrivilegedAction<Object>() {
+                public Object run() {
+                    final ProcAddressTable pt = ctx.getGLProcAddressTable();
+                    final long procAddrGLTexSubImage2D = pt.getAddressFor("glTexSubImage2D");
+                    final long procAddrGLGetError = pt.getAddressFor("glGetError");
+                    final long procAddrGLFlush = pt.getAddressFor("glFlush");
+                    final long procAddrGLFinish = pt.getAddressFor("glFinish");
+                    setGLFuncs0(moviePtr, procAddrGLTexSubImage2D, procAddrGLGetError, procAddrGLFlush, procAddrGLFinish);
+                    return null;
+            } } );
+        }            
+
+        sinkChosenAudioFormat = audioSink.initSink(avChosenAudioFormat, initialAudioFrameCount, audioFrameGrowAmount, audioFrameLimit);
         if(DEBUG) {
-            System.err.println("initGLStream: p3 avChosen "+avChosenAudioFormat+", chosen "+sinkChosenAudioFormat);
+            System.err.println("initGL: p3 avChosen "+avChosenAudioFormat+", chosen "+sinkChosenAudioFormat);
         }
         if( null == sinkChosenAudioFormat ) {
-            System.err.println("AudioSink "+_audioSink.getClass().getName()+" does not support "+avChosenAudioFormat+", using Null");
-            _audioSink.destroy();
-            _audioSink = AudioSinkFactory.createNull();
-            sinkChosenAudioFormat = _audioSink.initSink(avChosenAudioFormat, aFrameCount);
+            System.err.println("AudioSink "+audioSink.getClass().getName()+" does not support "+avChosenAudioFormat+", using Null");
+            audioSink.destroy();
+            audioSink = AudioSinkFactory.createNull();
+            sinkChosenAudioFormat = audioSink.initSink(avChosenAudioFormat, initialAudioFrameCount, audioFrameGrowAmount, audioFrameLimit);
         }
-        audioSink = _audioSink;
         
-        int tf, tif=GL.GL_RGBA; // texture format and internal format
-        switch(vBytesPerPixelPerPlane) {
-            case 1:
-                if( gl.isGL3ES3() ) {
-                    // RED is supported on ES3 and >= GL3 [core]; ALPHA is deprecated on core
-                    tf = GL2ES2.GL_RED;   tif=GL2ES2.GL_RED; singleTexComp = "r";
-                } else {
-                    // ALPHA is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
-                    tf = GL2ES2.GL_ALPHA; tif=GL2ES2.GL_ALPHA; singleTexComp = "a";
-                }
-                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);
-        }        
-        setTextureFormat(tif, tf);
-        setTextureType(GL.GL_UNSIGNED_BYTE);
-    }
+        if( null != gl ) {
+            int tf, tif=GL.GL_RGBA; // texture format and internal format
+            switch(vBytesPerPixelPerPlane) {
+                case 1:
+                    if( gl.isGL3ES3() ) {
+                        // RED is supported on ES3 and >= GL3 [core]; ALPHA is deprecated on core
+                        tf = GL2ES2.GL_RED;   tif=GL2ES2.GL_RED; singleTexComp = "r";
+                    } else {
+                        // ALPHA is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
+                        tf = GL2ES2.GL_ALPHA; tif=GL2ES2.GL_ALPHA; singleTexComp = "a";
+                    }
+                    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);
+            }        
+            setTextureFormat(tif, tf);
+            setTextureType(GL.GL_UNSIGNED_BYTE);
+        }
+    }    
     @Override
     protected final TextureFrame createTexImage(GL gl, int texName) {
         return new TextureFrame( createTexImageImpl(gl, texName, texWidth, texHeight, true) );
     }
     
     /**
-     * Catches IllegalArgumentException and returns 0 if functionName is n/a,
-     * otherwise the ProcAddressTable's field value. 
+     * @param pixFmt
+     * @param planes
+     * @param bitsPerPixel
+     * @param bytesPerPixelPerPlane
+     * @param lSz0
+     * @param lSz1
+     * @param lSz2
+     * @param tWd0
+     * @param tWd1
+     * @param tWd2
+     * @param audioFrameCount snooped audio-frame-count per video-frame, maybe 0
+     * @param sampleFmt
+     * @param sampleRate
+     * @param channels
      */
-    private final long getAddressFor(final ProcAddressTable table, final String functionName) {
-        return AccessController.doPrivileged(new PrivilegedAction<Long>() {
-            public Long run() {
-                try {
-                    return Long.valueOf( table.getAddressFor(functionName) );
-                } catch (IllegalArgumentException iae) { 
-                    return Long.valueOf(0);
-                }
-            }
-        } ).longValue();
-    }
-
     private void updateAttributes2(int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
                                    int lSz0, int lSz1, int lSz2,
                                    int tWd0, int tWd1, int tWd2,
-                                   int sampleFmt, int sampleRate, int channels) {
+                                   int audioFrameCount, int sampleFmt, int sampleRate, int channels) {
         vPixelFmt = PixelFormat.valueOf(pixFmt);
         vPlanes = planes;
         vBitsPerPixel = bitsPerPixel;
@@ -329,7 +334,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             default: // FIXME: Add more formats !
                 throw new RuntimeException("Unsupported pixelformat: "+vPixelFmt);
         }
-
+        initialAudioFrameCount = audioFrameCount > 0 ? audioFrameCount : AV_DEFAULT_AFRAMES * 2;
         aSampleFmt = SampleFormat.valueOf(sampleFmt);
         final int sampleSize;
         final boolean signed, fixedP;
@@ -370,7 +375,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         avChosenAudioFormat = new AudioDataFormat(AudioDataType.PCM, sampleRate, sampleSize, channels, signed, fixedP, true /* littleEndian */);  
         
         if(DEBUG) {
-            System.err.println("audio: fmt "+aSampleFmt+", "+avChosenAudioFormat);
+            System.err.println("audio: fmt "+aSampleFmt+", "+avChosenAudioFormat+", aFrameCount "+audioFrameCount+" -> "+initialAudioFrameCount);
             System.err.println("video: fmt "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane);
             for(int i=0; i<3; i++) {
                 System.err.println("video: "+i+": "+vTexWidth[i]+"/"+vLinesize[i]);
@@ -473,6 +478,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     @Override
     protected void preNextTextureImpl(GL gl) {
         psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
+        gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
     }
     
     @Override
@@ -481,31 +487,25 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost) {
+    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
-        if( issuePreAndPost ) {
-            preNextTextureImpl(gl);
-        }
         int vPTS = TextureFrame.INVALID_PTS;
-        try {
+        if( null != nextFrame ) {
             final Texture tex = nextFrame.getTexture();
-            gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
             tex.enable(gl);
             tex.bind(gl);
+        }
 
-            /** Try decode up to 10 packets to find one containing video. */
-            for(int i=0; TextureFrame.INVALID_PTS == vPTS && 10 > i; i++) {
-               vPTS = readNextPacket0(moviePtr, textureTarget, textureFormat, textureType);
-            }
-        } finally {
-            if( issuePreAndPost ) {
-                postNextTextureImpl(gl);
-            }
+        /** Try decode up to 10 packets to find one containing video. */
+        for(int i=0; TextureFrame.INVALID_PTS == vPTS && 10 > i; i++) {
+           vPTS = readNextPacket0(moviePtr, textureTarget, textureFormat, textureType);
         }
         if( TextureFrame.INVALID_PTS != vPTS ) {
-            nextFrame.setPTS(vPTS);
+            if( null != nextFrame ) {
+                nextFrame.setPTS(vPTS);
+            }
             return true;
         } else {
             return false;
@@ -524,9 +524,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         return time * ( sinkChosenAudioFormat.channelCount * bytesPerSample * ( sinkChosenAudioFormat.sampleRate / 1000 ) );        
     }
     
-    @Override
-    protected final boolean syncAVRequired() { return true; }
-    
     private static native int getAvUtilVersion0();
     private static native int getAvFormatVersion0();
     private static native int getAvCodecVersion0();
@@ -543,10 +540,18 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      *   [type PCM, sampleRate [10000(?)..44100..48000], sampleSize 16, channelCount 1-2, signed, littleEndian]
      * </pre>
      * </p>
+     * 
+     * @param moviePtr
+     * @param url
+     * @param vid
+     * @param aid
+     * @param snoopVideoFrameCount snoop this number of video-frames to gather audio-frame-count per video-frame. 
+     *        If zero, gathering audio-frame-count is disabled!   
+     * @param aChannelCount
+     * @param aSampleRate
      */
-    private native void setStream0(long moviePtr, String url, int vid, int aid, int audioFrameCount,
-                                   int aChannelCount, int aSampleRate);
-    private native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError);
+    private native void setStream0(long moviePtr, String url, int vid, int aid, int snoopVideoFrameCount, int aChannelCount, int aSampleRate);
+    private native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
 
     private native int getVideoPTS0(long moviePtr);    
     
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index d0517fc5f..e1b773e9b 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -96,7 +96,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
     
     @Override
-    protected void initGLStreamImpl(GL gl, int vid, int aid) throws IOException {
+    protected void initStreamImpl(int vid, int aid) throws IOException {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
@@ -116,6 +116,10 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
             System.out.println("initGLStream: p2 "+this);
         }
     }
+    @Override
+    protected final void initGLImpl(GL gl) throws IOException, GLException {
+        // NOP
+    }
     
     @Override
     protected int getAudioPTSImpl() {
@@ -160,11 +164,11 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     @Override
-    protected boolean getNextTextureImpl(GL gl, TextureFrame nextFrame, boolean blocking, boolean issuePreAndPost) {
+    protected boolean getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
-        final int nextTex = _getNextTextureID(moviePtr, blocking);
+        final int nextTex = _getNextTextureID(moviePtr, true);
         if(0 < nextTex) {
             /* FIXME 
             final TextureSequence.TextureFrame eglImgTex = 
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index 06c3862db..76de406ae 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -52,6 +52,8 @@
 
 typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
 typedef GLenum (APIENTRYP PFNGLGETERRORPROC) (void);
+typedef void (APIENTRYP PFNGLFLUSH) (void);
+typedef void (APIENTRYP PFNGLFINISH) (void);
 
 /**
  *  AV_TIME_BASE   1000000
@@ -68,11 +70,21 @@ typedef GLenum (APIENTRYP PFNGLGETERRORPROC) (void);
 /** Sync w/ GLMediaPlayer.STREAM_ID_AUTO */
 #define AV_STREAM_ID_AUTO -1
 
-/** Constant marking an invalid PTS, i.e. Integer.MIN_VALUE 0x80000000 {@value}. Sync w/ TextureFrame.INVALID_PTS */
+/** Default number of audio frames per video frame. Sync w/ FFMPEGMediaPlayer.AV_DEFAULT_AFRAMES. */
+#define AV_DEFAULT_AFRAMES 8
+
+/** Constant PTS marking an invalid PTS, i.e. Integer.MIN_VALUE == 0x80000000 == {@value}. Sync w/ TextureFrame.INVALID_PTS */
 #define INVALID_PTS 0x80000000
 
+/** Constant PTS marking the end of the stream, i.e. Integer.MIN_VALUE - 1 == 0x7FFFFFFF == {@value}. Sync w/ TextureFrame.END_OF_STREAM_PTS */
+#define END_OF_STREAM_PTS 0x7FFFFFFF
+
+/** Until 55.0.0 */
 #define AV_HAS_API_REQUEST_CHANNELS(pAV) (AV_VERSION_MAJOR(pAV->avcodecVersion) < 55)
 
+/** Since 55.0.0 */
+#define AV_HAS_API_REFCOUNTED_FRAMES(pAV) (AV_VERSION_MAJOR(pAV->avcodecVersion) >= 55)
+
 static inline float my_av_q2f(AVRational a){
     return a.num / (float) a.den;
 }
@@ -80,6 +92,20 @@ static inline int32_t my_av_q2i32(int64_t snum, AVRational a){
     return (int32_t) ( ( snum * (int64_t) a.num ) / (int64_t)a.den );
 }
 
+typedef struct {
+    void *origPtr;
+    jobject nioRef;
+    int32_t size;
+} NIOBuffer_t;
+
+typedef struct {
+    int64_t ptsError; // Number of backward PTS values (earlier than last PTS, excluding AV_NOPTS_VALUE)
+    int64_t dtsError; // Number of backward DTS values (earlier than last PTS, excluding AV_NOPTS_VALUE)
+    int64_t ptsLast;  // PTS of the last frame
+    int64_t dtsLast;  // DTS of the last frame
+} PTSStats;
+
+
 typedef struct {
     int32_t          verbose;
 
@@ -87,8 +113,12 @@ typedef struct {
     uint32_t         avformatVersion;
     uint32_t         avutilVersion;
 
+    int32_t          useRefCountedFrames;
+
     PFNGLTEXSUBIMAGE2DPROC procAddrGLTexSubImage2D;
     PFNGLGETERRORPROC procAddrGLGetError;
+    PFNGLFLUSH procAddrGLFlush;
+    PFNGLFINISH procAddrGLFinish;
 
     AVFormatContext* pFormatCtx;
     int32_t          vid;
@@ -101,6 +131,7 @@ typedef struct {
     uint32_t         vBytesPerPixelPerPlane;
     enum PixelFormat vPixFmt;    // native decoder fmt
     int32_t          vPTS;       // msec - overall last video PTS
+    PTSStats         vPTSStats;
     int32_t          vLinesize[3];  // decoded video linesize in bytes for each plane
     int32_t          vTexWidth[3];  // decoded video tex width in bytes for each plane
 
@@ -110,6 +141,7 @@ typedef struct {
     AVCodecContext*  pACodecCtx;
     AVCodec*         pACodec;
     AVFrame**        pAFrames;
+    NIOBuffer_t*     pANIOBuffers;
     int32_t          aFrameCount;
     int32_t          aFrameCurrent;
     int32_t          aSampleRate;
@@ -117,6 +149,8 @@ typedef struct {
     int32_t          aFrameSize;
     enum AVSampleFormat aSampleFmt; // native decoder fmt
     int32_t          aPTS;       // msec - overall last audio PTS
+    PTSStats         aPTSStats;
+    int32_t          aFramesPerVideoFrame; // is 'snooped'
 
     float            fps;        // frames per seconds
     int32_t          bps_stream; // bits per seconds
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
index 99b385e3c..99ef02da5 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
+++ b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
@@ -60,8 +60,11 @@ typedef AVCodec *(APIENTRYP AVCODEC_FIND_DECODER)(enum CodecID id);
 typedef int (APIENTRYP AVCODEC_OPEN2)(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options);                          // 53.6.0
 typedef int (APIENTRYP AVCODEC_OPEN)(AVCodecContext *avctx, AVCodec *codec);
 typedef AVFrame *(APIENTRYP AVCODEC_ALLOC_FRAME)(void);
+typedef void (APIENTRYP AVCODEC_GET_FRAME_DEFAULTS)(AVFrame *frame);
+typedef void (APIENTRYP AVCODEC_FREE_FRAME)(AVFrame **frame);
 typedef int (APIENTRYP AVCODEC_DEFAULT_GET_BUFFER)(AVCodecContext *s, AVFrame *pic);
 typedef void (APIENTRYP AVCODEC_DEFAULT_RELEASE_BUFFER)(AVCodecContext *s, AVFrame *pic);
+typedef void (APIENTRYP AVCODEC_FLUSH_BUFFERS)(AVCodecContext *avctx);
 typedef void (APIENTRYP AV_INIT_PACKET)(AVPacket *pkt);
 typedef int (APIENTRYP AV_NEW_PACKET)(AVPacket *pkt, int size);
 typedef void (APIENTRYP AV_DESTRUCT_PACKET)(AVPacket *pkt);
@@ -76,8 +79,11 @@ static AVCODEC_FIND_DECODER sp_avcodec_find_decoder;
 static AVCODEC_OPEN2 sp_avcodec_open2;                    // 53.6.0
 static AVCODEC_OPEN sp_avcodec_open;
 static AVCODEC_ALLOC_FRAME sp_avcodec_alloc_frame;
+static AVCODEC_GET_FRAME_DEFAULTS sp_avcodec_get_frame_defaults;
+static AVCODEC_FREE_FRAME sp_avcodec_free_frame;
 static AVCODEC_DEFAULT_GET_BUFFER sp_avcodec_default_get_buffer;
 static AVCODEC_DEFAULT_RELEASE_BUFFER sp_avcodec_default_release_buffer;
+static AVCODEC_FLUSH_BUFFERS sp_avcodec_flush_buffers;
 static AV_INIT_PACKET sp_av_init_packet;
 static AV_NEW_PACKET sp_av_new_packet;
 static AV_DESTRUCT_PACKET sp_av_destruct_packet;
@@ -85,17 +91,19 @@ static AV_FREE_PACKET sp_av_free_packet;
 static AVCODEC_DECODE_AUDIO4 sp_avcodec_decode_audio4;    // 53.25.0
 static AVCODEC_DECODE_AUDIO3 sp_avcodec_decode_audio3;    // 52.23.0
 static AVCODEC_DECODE_VIDEO2 sp_avcodec_decode_video2;    // 52.23.0
-// count: 15
+// count: 21
 
 // libavutil
+typedef void (APIENTRYP AV_FRAME_UNREF)(AVFrame *frame);
 typedef void (APIENTRYP AV_FREE)(void *ptr);
 typedef int (APIENTRYP AV_GET_BITS_PER_PIXEL)(const AVPixFmtDescriptor *pixdesc);
 typedef int (APIENTRYP AV_SAMPLES_GET_BUFFER_SIZE)(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align);
 static const AVPixFmtDescriptor* sp_av_pix_fmt_descriptors;
+static AV_FRAME_UNREF sp_av_frame_unref;
 static AV_FREE sp_av_free;
 static AV_GET_BITS_PER_PIXEL sp_av_get_bits_per_pixel;
 static AV_SAMPLES_GET_BUFFER_SIZE sp_av_samples_get_buffer_size;
-// count: 22
+// count: 26
 
 // libavformat
 typedef AVFormatContext *(APIENTRYP AVFORMAT_ALLOC_CONTEXT)(void);
@@ -131,9 +139,9 @@ static AVFORMAT_NETWORK_INIT sp_avformat_network_init;            // 53.13.0
 static AVFORMAT_NETWORK_DEINIT sp_avformat_network_deinit;        // 53.13.0
 static AVFORMAT_FIND_STREAM_INFO sp_avformat_find_stream_info;    // 53.3.0
 static AV_FIND_STREAM_INFO sp_av_find_stream_info;
-// count: 38
+// count: 42
 
-#define SYMBOL_COUNT 38
+#define SYMBOL_COUNT 42
 
 JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGDynamicLibraryBundleInfo_initSymbols0
   (JNIEnv *env, jclass clazz, jobject jSymbols, jint count)
@@ -162,8 +170,11 @@ JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGDynamicLibraryB
     sp_avcodec_open2 = (AVCODEC_OPEN2) (intptr_t) symbols[i++];
     sp_avcodec_open  = (AVCODEC_OPEN) (intptr_t) symbols[i++];
     sp_avcodec_alloc_frame = (AVCODEC_ALLOC_FRAME) (intptr_t) symbols[i++];
+    sp_avcodec_get_frame_defaults = (AVCODEC_GET_FRAME_DEFAULTS) (intptr_t) symbols[i++];
+    sp_avcodec_free_frame = (AVCODEC_FREE_FRAME) (intptr_t) symbols[i++];
     sp_avcodec_default_get_buffer = (AVCODEC_DEFAULT_GET_BUFFER) (intptr_t) symbols[i++];
     sp_avcodec_default_release_buffer = (AVCODEC_DEFAULT_RELEASE_BUFFER) (intptr_t) symbols[i++];
+    sp_avcodec_flush_buffers = (AVCODEC_FLUSH_BUFFERS) (intptr_t) symbols[i++];
     sp_av_init_packet = (AV_INIT_PACKET) (intptr_t) symbols[i++];
     sp_av_new_packet = (AV_NEW_PACKET) (intptr_t) symbols[i++];
     sp_av_destruct_packet = (AV_DESTRUCT_PACKET) (intptr_t) symbols[i++];
@@ -174,6 +185,7 @@ JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGDynamicLibraryB
     // count: 18
 
     sp_av_pix_fmt_descriptors = (const AVPixFmtDescriptor*)  (intptr_t) symbols[i++];
+    sp_av_frame_unref = (AV_FRAME_UNREF) (intptr_t) symbols[i++];
     sp_av_free = (AV_FREE) (intptr_t) symbols[i++];
     sp_av_get_bits_per_pixel = (AV_GET_BITS_PER_PIXEL) (intptr_t) symbols[i++];
     sp_av_samples_get_buffer_size = (AV_SAMPLES_GET_BUFFER_SIZE) (intptr_t) symbols[i++];
@@ -234,11 +246,11 @@ static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasic
                                pAV->vBitsPerPixel, pAV->vBytesPerPixelPerPlane,
                                pAV->vLinesize[0], pAV->vLinesize[1], pAV->vLinesize[2],
                                pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2],
-                               pAV->aSampleFmt, pAV->aSampleRate, pAV->aChannels);
+                               pAV->aFramesPerVideoFrame, pAV->aSampleFmt, pAV->aSampleRate, pAV->aChannels);
     }
 }
 
-static void freeInstance(FFMPEGToolBasicAV_t* pAV) {
+static void freeInstance(JNIEnv *env, FFMPEGToolBasicAV_t* pAV) {
     int i;
     if(NULL != pAV) {
         // Close the V codec
@@ -257,12 +269,34 @@ static void freeInstance(FFMPEGToolBasicAV_t* pAV) {
 
         // Close the frames
         if(NULL != pAV->pVFrame) {
-            sp_av_free(pAV->pVFrame);
+            if(HAS_FUNC(sp_avcodec_free_frame)) {
+                sp_avcodec_free_frame(&pAV->pVFrame);
+            } else {
+                sp_av_free(pAV->pVFrame);
+            }
             pAV->pVFrame = NULL;
         }
+        if(NULL != pAV->pANIOBuffers) {
+            for(i=0; i<pAV->aFrameCount; i++) {
+                NIOBuffer_t * pNIOBuffer = &pAV->pANIOBuffers[i];
+                if( NULL != pNIOBuffer->nioRef ) {
+                    if(pAV->verbose) {
+                        fprintf(stderr, "A NIO: Free.X ptr %p / ref %p, %d bytes\n", 
+                            pNIOBuffer->origPtr, pNIOBuffer->nioRef, pNIOBuffer->size);
+                    }
+                    (*env)->DeleteGlobalRef(env, pNIOBuffer->nioRef);
+                }
+            }
+            free(pAV->pANIOBuffers);
+            pAV->pANIOBuffers = NULL;
+        }
         if(NULL != pAV->pAFrames) {
             for(i=0; i<pAV->aFrameCount; i++) {
-                sp_av_free(pAV->pAFrames[i]);
+                if(HAS_FUNC(sp_avcodec_free_frame)) {
+                    sp_avcodec_free_frame(&pAV->pAFrames[i]);
+                } else {
+                    sp_av_free(pAV->pAFrames[i]);
+                }
             }
             free(pAV->pAFrames);
             pAV->pAFrames = NULL;
@@ -358,7 +392,7 @@ JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_ini
 
     jni_mid_pushSound = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "pushSound", "(Ljava/nio/ByteBuffer;II)V");
     jni_mid_updateAttributes1 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIIIFIIILjava/lang/String;Ljava/lang/String;)V");
-    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIII)V");
+    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIII)V");
 
     if(jni_mid_pushSound == NULL ||
        jni_mid_updateAttributes1 == NULL ||
@@ -380,6 +414,16 @@ JNIEXPORT jlong JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_create
     pAV->avformatVersion = sp_avformat_version(); 
     pAV->avutilVersion = sp_avutil_version();
 
+    #if LIBAVCODEC_VERSION_MAJOR >= 55
+        // TODO: We keep code on using 1 a/v frame per decoding cycle now.
+        //       This is compatible w/ OpenAL's alBufferData(..)
+        //       and w/ OpenGL's texture update command, both copy data immediatly.
+        // pAV->useRefCountedFrames = AV_HAS_API_REFCOUNTED_FRAMES(pAV);
+        pAV->useRefCountedFrames = 0;
+    #else
+        pAV->useRefCountedFrames = 0;
+    #endif
+
     // Register all formats and codecs
     sp_av_register_all();
     // Network too ..
@@ -400,7 +444,7 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_destroy
   FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
   if (pAV != NULL) {
       // stop assumed ..
-      freeInstance(pAV);
+      freeInstance(env, pAV);
   }
 }
 
@@ -418,9 +462,14 @@ static uint64_t getDefaultAudioChannelLayout(int channelCount) {
     }
 }
 
+static int countAudioPacketsTillVideo(const int maxPackets, FFMPEGToolBasicAV_t *pAV, AVPacket* pPacket, int packetFull, AVFrame* pAFrame, int * pAudioFrames, int *pMaxDataSize);
+static int countVideoPacketsTillAudio(const int maxPackets, FFMPEGToolBasicAV_t *pAV, AVPacket* pPacket, int packetFull, int * pVideoFrames);
+static void initPTSStats(PTSStats *ptsStats);
+static int64_t evalPTS(PTSStats *ptsStats, int64_t inPTS, int64_t inDTS);
+
 JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStream0
-  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jint vid, jint aid, jint audioFrameCount,
-   jint aChannelCount, jint aSampleRate)
+  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jint vid, jint aid,
+   jint snoopVideoFrameCount, jint aChannelCount, jint aSampleRate)
 {
     int res, i;
     jboolean iscopy;
@@ -437,8 +486,8 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
     const char *urlPath = (*env)->GetStringUTFChars(env, jURL, &iscopy);
     res = sp_avformat_open_input(&pAV->pFormatCtx, urlPath, NULL, NULL);
     if(res != 0) {
+        JoglCommon_throwNewRuntimeException(env, "Couldn't open URI: %s", urlPath);
         (*env)->ReleaseStringChars(env, jURL, (const jchar *)urlPath);
-        JoglCommon_throwNewRuntimeException(env, "Couldn't open URL");
         return;
     }
 
@@ -508,6 +557,12 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
     }
 
     if(0<=pAV->aid) {
+        AVFrame * pAFrame0 = sp_avcodec_alloc_frame();
+        if( NULL == pAFrame0 ) {
+            JoglCommon_throwNewRuntimeException(env, "Couldn't alloc 1st audio frame\n");
+            return;
+        }
+
         // Get a pointer to the codec context for the audio stream
         // FIXME: Libav Binary compatibility! JAU01
         pAV->pACodecCtx=pAV->pAStream->codec;
@@ -543,6 +598,9 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
         }
 
         // Open codec
+        #if LIBAVCODEC_VERSION_MAJOR >= 55
+            pAV->pACodecCtx->refcounted_frames = pAV->useRefCountedFrames;
+        #endif
         if(HAS_FUNC(sp_avcodec_open2)) {
             res = sp_avcodec_open2(pAV->pACodecCtx, pAV->pACodec, NULL);
         } else {
@@ -553,14 +611,11 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
             return;
         }
 
-        // Allocate audio frames
-        // FIXME: Libav Binary compatibility! JAU01
         pAV->aSampleRate = pAV->pACodecCtx->sample_rate;
         pAV->aChannels = pAV->pACodecCtx->channels;
         pAV->aFrameSize = pAV->pACodecCtx->frame_size; // in samples!
         pAV->aSampleFmt = pAV->pACodecCtx->sample_fmt;
         pAV->frames_audio = pAV->pAStream->nb_frames;
-
         if( pAV->verbose ) {
             fprintf(stderr, "A channels %d, sample_rate %d, frame_size %d, frame_number %d, r_frame_rate %f, avg_frame_rate %f, nb_frames %d, \n", 
                 pAV->aChannels, pAV->aSampleRate, pAV->aFrameSize, pAV->pACodecCtx->frame_number,
@@ -569,12 +624,97 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
                 pAV->pAStream->nb_frames);
         }
 
-        pAV->aFrameCount = audioFrameCount;
-        pAV->pAFrames = calloc(audioFrameCount, sizeof(AVFrame*));
-        for(i=0; i<pAV->aFrameCount; i++) {
-            pAV->pAFrames[i]=sp_avcodec_alloc_frame();
-            if(pAV->pAFrames[i]==NULL) {
-                JoglCommon_throwNewRuntimeException(env, "Couldn't alloc audio frame %d / %d", i, audioFrameCount);
+        if( 0 >= snoopVideoFrameCount ) {
+            pAV->aFramesPerVideoFrame = 0;
+        } else {
+            if( 0<=pAV->vid ) {
+                int aFramesPerVideoFrame;
+                int aFramesSequential = 0;
+                int aMaxDataSize = 0;
+                AVPacket packet;
+                int packetFull = 0;
+                int _aFramesBeforeVideo;
+                int _audioFramesOverlap=0;
+                int _aMaxDataSize;
+                int _vFrames;
+                int _vFramesOverlap=0;
+                int _packetCount;
+                int totalVFrames = 0;
+                int totalAFrames = 0;
+                int totalPackets = 0;
+
+                while( totalVFrames < snoopVideoFrameCount ) {
+                    int _packetCount = countAudioPacketsTillVideo(40, pAV, &packet, packetFull, pAFrame0, &_aFramesBeforeVideo, &_aMaxDataSize);
+                    if( _packetCount >= 0 ) {
+                        totalPackets += _packetCount;
+                        if( _aFramesBeforeVideo > 0 ) {
+                            // one video frame!
+                            _vFramesOverlap=1;
+                            packetFull = 1;
+                        }
+                        _aFramesBeforeVideo += _audioFramesOverlap;
+                        totalAFrames += _aFramesBeforeVideo;
+                        if( _aFramesBeforeVideo > aFramesSequential ) {
+                            aFramesSequential = _aFramesBeforeVideo;
+                        }
+                        if( _aMaxDataSize > aMaxDataSize ) {
+                            aMaxDataSize = _aMaxDataSize;
+                        }
+                        _packetCount = countVideoPacketsTillAudio(40, pAV, &packet, packetFull, &_vFrames);
+                        if( _packetCount >= 0 ) {
+                            totalPackets += _packetCount;
+                            if( _vFrames > 0 ) {
+                                // one audio frame!
+                                _audioFramesOverlap=1;
+                                packetFull = 1;
+                            }
+                            _vFrames += _vFramesOverlap;
+                            totalVFrames += _vFrames;
+                        }
+                        if( pAV->verbose ) {
+                            fprintf(stderr, "Snoop Packet #%d, V-Frames: %d, A-frames %d Seq(now %d, max %d), max-size (now %d, max %d)\n", 
+                                totalPackets, totalVFrames, totalAFrames, _aFramesBeforeVideo, aFramesSequential, _aMaxDataSize, aMaxDataSize);
+                        }
+                    }
+                }
+                const int audioFramesReadAhead = totalAFrames - totalVFrames;
+                if( audioFramesReadAhead > aFramesSequential ) {
+                    aFramesPerVideoFrame = audioFramesReadAhead;
+                } else {
+                    aFramesPerVideoFrame = aFramesSequential;
+                }
+                if( AV_DEFAULT_AFRAMES > aFramesPerVideoFrame || aFramesPerVideoFrame > 10*AV_DEFAULT_AFRAMES ) {
+                    aFramesPerVideoFrame = AV_DEFAULT_AFRAMES;
+                }
+                pAV->aFramesPerVideoFrame = aFramesPerVideoFrame;
+                sp_av_seek_frame(pAV->pFormatCtx, -1, 0, AVSEEK_FLAG_BACKWARD);
+                sp_avcodec_flush_buffers( pAV->pACodecCtx );
+                if( pAV->verbose ) {
+                    fprintf(stderr, "Snooped Packets %d, V-Frames: %d, A-frames %d Seq %d, readAhead %d -> Cached %d/%d, max-size %d\n", 
+                        totalPackets, totalVFrames, totalAFrames, aFramesSequential, audioFramesReadAhead, aFramesPerVideoFrame, pAV->aFramesPerVideoFrame, aMaxDataSize);
+                }
+            } else {
+                pAV->aFramesPerVideoFrame = AV_DEFAULT_AFRAMES;
+                if( pAV->verbose ) {
+                    fprintf(stderr, "A-frame Count %d\n", pAV->aFramesPerVideoFrame);
+                }
+            }
+        }
+
+        // Allocate audio frames
+        // FIXME: Libav Binary compatibility! JAU01
+        if( pAV->useRefCountedFrames && pAV->aFramesPerVideoFrame > 0 ) {
+            pAV->aFrameCount = pAV->aFramesPerVideoFrame;
+        } else {
+            pAV->aFrameCount = 1;
+        }
+        pAV->pANIOBuffers = calloc(pAV->aFrameCount, sizeof(NIOBuffer_t));
+        pAV->pAFrames = calloc(pAV->aFrameCount, sizeof(AVFrame*));
+        pAV->pAFrames[0] = pAFrame0;
+        for(i=1; i<pAV->aFrameCount; i++) {
+            pAV->pAFrames[i] = sp_avcodec_alloc_frame();
+            if( NULL == pAV->pAFrames[i] ) {
+                JoglCommon_throwNewRuntimeException(env, "Couldn't alloc audio frame %d / %d", i, pAV->aFrameCount);
                 return;
             }
         }
@@ -612,6 +752,9 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
         }
 
         // Open codec
+        #if LIBAVCODEC_VERSION_MAJOR >= 55
+            pAV->pVCodecCtx->refcounted_frames = pAV->useRefCountedFrames;
+        #endif
         if(HAS_FUNC(sp_avcodec_open2)) {
             res = sp_avcodec_open2(pAV->pVCodecCtx, pAV->pVCodec, NULL);
         } else {
@@ -643,7 +786,7 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
                 pAV->pVStream->nb_frames);
         }
 
-        // Allocate video frames
+        // Allocate video frame
         // FIXME: Libav Binary compatibility! JAU01
         pAV->vPixFmt = pAV->pVCodecCtx->pix_fmt;
         {   
@@ -677,15 +820,19 @@ JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setStre
     }
     pAV->vPTS=0;
     pAV->aPTS=0;
+    initPTSStats(&pAV->vPTSStats);
+    initPTSStats(&pAV->aPTSStats);
     _updateJavaAttributes(env, instance, pAV);
 }
 
 JNIEXPORT void JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_setGLFuncs0
-  (JNIEnv *env, jobject instance, jlong ptr, jlong jProcAddrGLTexSubImage2D, jlong jProcAddrGLGetError)
+  (JNIEnv *env, jobject instance, jlong ptr, jlong jProcAddrGLTexSubImage2D, jlong jProcAddrGLGetError, jlong jProcAddrGLFlush, jlong jProcAddrGLFinish)
 {
     FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
     pAV->procAddrGLTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) (intptr_t)jProcAddrGLTexSubImage2D;
     pAV->procAddrGLGetError = (PFNGLGETERRORPROC) (intptr_t)jProcAddrGLGetError;
+    pAV->procAddrGLFlush = (PFNGLFLUSH) (intptr_t)jProcAddrGLFlush;
+    pAV->procAddrGLFinish = (PFNGLFINISH) (intptr_t)jProcAddrGLFinish;
 }
 
 #if 0
@@ -707,15 +854,19 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
 
     sp_av_init_packet(&packet);
 
-    if( sp_av_read_frame(pAV->pFormatCtx, &packet) >= 0 ) {
+    const int avRes = sp_av_read_frame(pAV->pFormatCtx, &packet);
+    if( AVERROR_EOF == avRes || ( pAV->pFormatCtx->pb && pAV->pFormatCtx->pb->eof_reached ) ) {
+        resPTS = END_OF_STREAM_PTS;
+    } else if( 0 <= avRes ) {
+        if( pAV->verbose ) {
+            fprintf(stderr, "P: ptr %p, size %d\n", packet.data, packet.size);
+        }
         if(packet.stream_index==pAV->aid) {
             // Decode audio frame
             if(NULL == pAV->pAFrames) { // no audio registered
                 sp_av_free_packet(&packet);
                 return 0;
             }
-            AVFrame* pAFrameCurrent = pAV->pAFrames[pAV->aFrameCurrent];
-            pAV->aFrameCurrent = ( pAV->aFrameCurrent + 1 ) % pAV->aFrameCount ;
             int frameCount;
             int flush_complete = 0;
             for ( frameCount=0; 0 < packet.size || 0 == frameCount; frameCount++ ) {
@@ -723,6 +874,13 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 if (flush_complete) {
                     break;
                 }
+                NIOBuffer_t * pNIOBufferCurrent = &pAV->pANIOBuffers[pAV->aFrameCurrent];
+                AVFrame* pAFrameCurrent = pAV->pAFrames[pAV->aFrameCurrent];
+                if( pAV->useRefCountedFrames ) {
+                    sp_av_frame_unref(pAFrameCurrent);
+                    pAV->aFrameCurrent = ( pAV->aFrameCurrent + 1 ) % pAV->aFrameCount ;
+                }
+                sp_avcodec_get_frame_defaults(pAFrameCurrent);
                 if(HAS_FUNC(sp_avcodec_decode_audio4)) {
                     len1 = sp_avcodec_decode_audio4(pAV->pACodecCtx, pAFrameCurrent, &frameDecoded, &packet);
                 } else {
@@ -763,24 +921,41 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
 
                 const AVRational time_base = pAV->pAStream->time_base;
                 const int64_t pkt_pts = pAFrameCurrent->pkt_pts;
-                int aptsMode;
                 if( 0 == frameCount && AV_NOPTS_VALUE != pkt_pts ) { // 1st frame only, discard invalid PTS ..
                     pAV->aPTS = my_av_q2i32( pkt_pts * 1000, time_base);
-                    aptsMode = 0;
                 } else { // subsequent frames or invalid PTS ..
                     const int32_t bytesPerSample = 2; // av_get_bytes_per_sample( pAV->pACodecCtx->sample_fmt );
                     pAV->aPTS += data_size / ( pAV->aChannels * bytesPerSample * ( pAV->aSampleRate / 1000 ) );
-                    aptsMode = 1;
                 }
                 if( pAV->verbose ) {
                     int32_t aDTS = my_av_q2i32( pAFrameCurrent->pkt_dts * 1000, time_base);
 
-                    fprintf(stderr, "A pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], dataSize %d, f# %d, pts-mode %d\n", 
-                        pAV->aPTS, pkt_pts, aDTS, pAFrameCurrent->pkt_dts, data_size, frameCount, aptsMode);
+                    fprintf(stderr, "A pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], f# %d, aFrame %d/%d %p, dataPtr %p, dataSize %d\n", 
+                        pAV->aPTS, pkt_pts, aDTS, pAFrameCurrent->pkt_dts, frameCount,
+                        pAV->aFrameCurrent, pAV->aFrameCount, pAFrameCurrent, pAFrameCurrent->data[0], data_size);
                 }
                 if( NULL != env ) {
-                    jobject jSampleData = (*env)->NewDirectByteBuffer(env, pAFrameCurrent->data[0], data_size);
-                    (*env)->CallVoidMethod(env, instance, jni_mid_pushSound, jSampleData, data_size, pAV->aPTS);
+                    NIOBuffer_t * pNIOBufferCurrent = &pAV->pANIOBuffers[pAV->aFrameCurrent];
+                    int newNIO = NULL == pNIOBufferCurrent->nioRef;
+                    if( !newNIO && ( pAFrameCurrent->data[0] != pNIOBufferCurrent->origPtr || data_size > pNIOBufferCurrent->size ) ) {
+                        if(pAV->verbose) {
+                            fprintf(stderr, "A NIO: Free.0 ptr %p / ref %p, %d bytes\n", 
+                                pNIOBufferCurrent->origPtr, pNIOBufferCurrent->nioRef, pNIOBufferCurrent->size);
+                        }
+                        (*env)->DeleteGlobalRef(env, pNIOBufferCurrent->nioRef);
+                        newNIO = 1;
+                    }
+                    if( newNIO ) {
+                        jobject jSampleData = (*env)->NewDirectByteBuffer(env, pAFrameCurrent->data[0], data_size);
+                        pNIOBufferCurrent->nioRef = (*env)->NewGlobalRef(env, jSampleData);
+                        pNIOBufferCurrent->origPtr = pAFrameCurrent->data[0];
+                        pNIOBufferCurrent->size = data_size;
+                        if(pAV->verbose) {
+                            fprintf(stderr, "A NIO: Alloc ptr %p / ref %p, %d bytes\n", 
+                                pNIOBufferCurrent->origPtr, pNIOBufferCurrent->nioRef, pNIOBufferCurrent->size);
+                        }
+                    }
+                    (*env)->CallVoidMethod(env, instance, jni_mid_pushSound, pNIOBufferCurrent->nioRef, data_size, pAV->aPTS);
                 }
             }
         } else if(packet.stream_index==pAV->vid) {
@@ -796,6 +971,7 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 if (flush_complete) {
                     break;
                 }
+                sp_avcodec_get_frame_defaults(pAV->pVFrame);
                 len1 = sp_avcodec_decode_video2(pAV->pVCodecCtx, pAV->pVFrame, &frameDecoded, &packet);
                 if (len1 < 0) {
                     // if error, we skip the frame
@@ -816,26 +992,27 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                 // FIXME: Libav Binary compatibility! JAU01
                 const AVRational time_base = pAV->pVStream->time_base;
                 const int64_t pkt_pts = pAV->pVFrame->pkt_pts;
-                if(AV_NOPTS_VALUE != pkt_pts) { // discard invalid PTS ..
-                    pAV->vPTS =  my_av_q2i32( pkt_pts * 1000, time_base);
-                    if( pAV->verbose ) {
-                        int32_t vDTS = my_av_q2i32( pAV->pVFrame->pkt_dts * 1000, time_base);
+                const int64_t pkt_dts = pAV->pVFrame->pkt_dts;
+                const int64_t fix_pts = evalPTS(&pAV->vPTSStats, pkt_pts, pkt_dts);
+                if( AV_NOPTS_VALUE != fix_pts ) { // discard invalid PTS ..
+                    pAV->vPTS =  my_av_q2i32( fix_pts * 1000, time_base);
+                }
+                if( pAV->verbose ) {
+                    const int32_t vPTS = AV_NOPTS_VALUE != pkt_pts ? my_av_q2i32( pkt_pts * 1000, time_base) : 0;
+                    const int32_t vDTS = AV_NOPTS_VALUE != pkt_dts ? my_av_q2i32( pkt_dts * 1000, time_base) : 0;
 
-                        double frame_delay_d = av_q2d(pAV->pVCodecCtx->time_base);
-                        double frame_repeat_d = pAV->pVFrame->repeat_pict * (frame_delay_d * 0.5);
+                    const double frame_delay_d = av_q2d(pAV->pVCodecCtx->time_base);
+                    const double frame_repeat_d = pAV->pVFrame->repeat_pict * (frame_delay_d * 0.5);
 
-                        int32_t frame_delay_i = my_av_q2i32(1000, pAV->pVCodecCtx->time_base);
-                        int32_t frame_repeat_i = pAV->pVFrame->repeat_pict * (frame_delay_i / 2);
+                    const int32_t frame_delay_i = my_av_q2i32(1000, pAV->pVCodecCtx->time_base);
+                    const int32_t frame_repeat_i = pAV->pVFrame->repeat_pict * (frame_delay_i / 2);
 
-                        const char * warn = frame_repeat_i > 0 ? "REPEAT" : "NORMAL" ;
+                    const char * warn = frame_repeat_i > 0 ? "REPEAT" : "NORMAL" ;
 
-                        fprintf(stderr, "V pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], time d(%lf s + r %lf = %lf s), i(%d ms + r %d = %d ms) - %s - f# %d\n", 
-                                pAV->vPTS, pkt_pts, vDTS, pAV->pVFrame->pkt_dts, 
-                                frame_delay_d, frame_repeat_d, (frame_delay_d + frame_repeat_d),
-                                frame_delay_i, frame_repeat_i, (frame_delay_i + frame_repeat_i), warn, frameCount);
-                    }
-                } else if( pAV->verbose ) {
-                    fprintf(stderr, "V pts ?? [pkt_pts %ld], pts2 ?? [pkt_dts %ld], f# %d\n", pkt_pts, pAV->pVFrame->pkt_dts, frameCount);
+                    fprintf(stderr, "V fix_pts %d, pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], time d(%lf s + r %lf = %lf s), i(%d ms + r %d = %d ms) - %s - f# %d\n", 
+                            pAV->vPTS, vPTS, pkt_pts, vDTS, pkt_dts, 
+                            frame_delay_d, frame_repeat_d, (frame_delay_d + frame_repeat_d),
+                            frame_delay_i, frame_repeat_i, (frame_delay_i + frame_repeat_i), warn, frameCount);
                 }
                 resPTS = pAV->vPTS; // Video Frame!
 
@@ -866,6 +1043,11 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
                                             texFmt, texType, pAV->pVFrame->data[2]);
                     DBG_TEXSUBIMG2D_b(pAV);
                 } // FIXME: Add more planar formats !
+                pAV->procAddrGLFinish();
+                //pAV->procAddrGLFlush();
+                if( pAV->useRefCountedFrames ) {
+                    sp_av_frame_unref(pAV->pVFrame);
+                }
             }
         }
 
@@ -877,6 +1059,135 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
     return resPTS;
 }
 
+static int countAudioPacketsTillVideo(const int maxPackets, FFMPEGToolBasicAV_t *pAV, AVPacket* pPacket, int packetFull, AVFrame* pAFrame, int * pAudioFrames, int *pMaxDataSize) {
+    int frameDecoded;
+    int audioFrames = 0;
+    int maxDataSize = 0;
+    int packetCount = 0;
+
+    for( packetCount = 0; packetCount < maxPackets; packetCount++ ) {
+        int readRes;
+        if( !packetFull ) {
+            sp_av_init_packet(pPacket);
+            readRes = sp_av_read_frame(pAV->pFormatCtx, pPacket);
+        } else {
+            readRes = 1;
+            packetFull = 0;
+        }
+        if( readRes >= 0 ) {
+            if(pPacket->stream_index==pAV->aid) {
+                // Decode audio frame
+                int frameCount;
+                int flush_complete = 0;
+                for ( frameCount=0; 0 < pPacket->size || 0 == frameCount; frameCount++ ) {
+                    int len1;
+                    if (flush_complete) {
+                        break;
+                    }
+                    if(HAS_FUNC(sp_avcodec_decode_audio4)) {
+                        len1 = sp_avcodec_decode_audio4(pAV->pACodecCtx, pAFrame, &frameDecoded, pPacket);
+                    } else {
+                        #if 0
+                        len1 = sp_avcodec_decode_audio3(pAV->pACodecCtx, int16_t *samples, int *frame_size_ptr, &frameDecoded, pPacket);
+                        #endif
+                        return -1;
+                    }
+                    if (len1 < 0) {
+                        // if error, we skip the frame 
+                        pPacket->size = 0;
+                        break;
+                    }
+                    pPacket->data += len1;
+                    pPacket->size -= len1;
+
+                    if (!frameDecoded) {
+                        // stop sending empty packets if the decoder is finished 
+                        if (!pPacket->data && pAV->pACodecCtx->codec->capabilities & CODEC_CAP_DELAY) {
+                            flush_complete = 1;
+                        }
+                        continue;
+                    }
+
+                    int32_t data_size = 0;
+                    if(HAS_FUNC(sp_av_samples_get_buffer_size)) {
+                        data_size = sp_av_samples_get_buffer_size(NULL /* linesize, may be NULL */,
+                                                                  pAV->aChannels,
+                                                                  pAFrame->nb_samples,
+                                                                  pAFrame->format,
+                                                                  1 /* align */);
+                        if( data_size > maxDataSize ) {
+                            maxDataSize = data_size;
+                        }
+                    }
+                    if( pAV->useRefCountedFrames ) {
+                        sp_av_frame_unref(pAFrame);
+                    }
+                    audioFrames++;
+                }
+            } else if(pPacket->stream_index==pAV->vid) {
+                if( 0 < audioFrames ) {
+                    break; // done!
+                }
+            }
+        }
+    }
+    *pAudioFrames = audioFrames;
+    *pMaxDataSize = maxDataSize;
+    return packetCount;
+}
+static int countVideoPacketsTillAudio(const int maxPackets, FFMPEGToolBasicAV_t *pAV, AVPacket* pPacket, int packetFull, int * pVideoFrames) {
+    int videoFrames = 0;
+    int packetCount = 0;
+
+    for( packetCount = 0; packetCount < maxPackets; packetCount++ ) {
+        int readRes;
+        if( !packetFull ) {
+            sp_av_init_packet(pPacket);
+            readRes = sp_av_read_frame(pAV->pFormatCtx, pPacket);
+        } else {
+            readRes = 1;
+            packetFull = 0;
+        }
+        if( readRes >= 0 ) {
+            if(pPacket->stream_index==pAV->aid) {
+                if( 0 < videoFrames ) {
+                    break; // done!
+                }
+            } else if(pPacket->stream_index==pAV->vid) {
+                videoFrames++;
+            }
+        }
+    }
+    *pVideoFrames = videoFrames;
+    return packetCount;
+}
+static void initPTSStats(PTSStats *ptsStats) {
+    ptsStats->ptsError = 0;
+    ptsStats->dtsError = 0;
+    ptsStats->ptsLast = INT64_MIN;
+    ptsStats->dtsLast = INT64_MIN;
+}
+static int64_t evalPTS(PTSStats *ptsStats, int64_t inPTS, int64_t inDTS) {
+    int64_t resPTS = AV_NOPTS_VALUE;
+            
+    if ( inDTS != AV_NOPTS_VALUE ) {
+        ptsStats->dtsError += inDTS <= ptsStats->dtsLast;
+        ptsStats->dtsLast = inDTS;
+    }       
+    if ( inPTS != AV_NOPTS_VALUE ) {
+        ptsStats->ptsError += inPTS <= ptsStats->ptsLast;
+        ptsStats->ptsLast = inPTS;
+    }       
+    if ( inPTS != AV_NOPTS_VALUE &&
+         ( ptsStats->ptsError<=ptsStats->dtsError || inDTS == AV_NOPTS_VALUE ) ) {
+        resPTS = inPTS;
+    } else {
+        resPTS = inDTS;
+    }
+    return resPTS;
+}           
+
+
 JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_play0
   (JNIEnv *env, jobject instance, jlong ptr)
 {
@@ -893,21 +1204,51 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_pause0
 JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_seek0
   (JNIEnv *env, jobject instance, jlong ptr, jint pos1)
 {
-    FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
-    int64_t pos0 = pAV->vPTS;
-    int64_t pts0 = pAV->pVFrame->pkt_pts;
-    int64_t pts1 = (int64_t) (pos1 * (int64_t) pAV->pVStream->time_base.den)
-                             / (1000 * (int64_t) pAV->pVStream->time_base.num);
-
+    const FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
+    const int64_t pos0 = pAV->vPTS;
+    const int64_t pts0 = pAV->pVFrame->pkt_pts;
+    int streamID;
+    AVRational time_base;
+    if( pAV->vid >= 0 ) {
+        streamID = pAV->vid;
+        time_base = pAV->pVStream->time_base;
+    } else if( pAV->aid >= 0 ) {
+        streamID = pAV->aid;
+        time_base = pAV->pAStream->time_base;
+    } else {
+        return pAV->vPTS;
+    }
+    int64_t pts1 = (int64_t) (pos1 * (int64_t) time_base.den)
+                           / (1000 * (int64_t) time_base.num);
     int flags = 0;
     if(pos1 < pos0) {
         flags |= AVSEEK_FLAG_BACKWARD;
     }
-    fprintf(stderr, "SEEK: pre  : u %ld, p %ld -> u %ld, p %ld\n", pos0, pts0, pos1, pts1);
-    sp_av_seek_frame(pAV->pFormatCtx, pAV->vid, pts1, flags);
-    pAV->vPTS =  my_av_q2i32( pAV->pVFrame->pkt_pts * 1000, pAV->pVStream->time_base);
-    fprintf(stderr, "SEEK: post : u %ld, p %ld\n", pAV->vPTS, pAV->pVFrame->pkt_pts);
-    return pAV->vPTS;
+    int res;
+    if(HAS_FUNC(sp_av_seek_frame)) {
+        if(pos1 < pos0) {
+            flags |= AVSEEK_FLAG_BACKWARD;
+        }
+        fprintf(stderr, "SEEK.0: pre  : s %ld / %ld -> t %ld / %ld\n", pos0, pts0, pos1, pts1);
+        sp_av_seek_frame(pAV->pFormatCtx, streamID, pts1, flags);
+
+    } else if(HAS_FUNC(sp_avformat_seek_file)) {
+        int64_t ptsD = pts1 - pts0;
+        int64_t seek_min    = ptsD > 0 ? pts1 - ptsD : INT64_MIN;
+        int64_t seek_max    = ptsD < 0 ? pts1 - ptsD : INT64_MAX;
+        fprintf(stderr, "SEEK.1: pre  : s %ld / %ld -> t %ld / %ld [%ld .. %ld]\n", 
+            pos0, pts0, pos1, pts1, seek_min, seek_max);
+        res = sp_avformat_seek_file(pAV->pFormatCtx, -1, seek_min, pts1, seek_max, flags);
+    }
+    if(NULL != pAV->pVCodecCtx) {
+        sp_avcodec_flush_buffers( pAV->pVCodecCtx );
+    }
+    if(NULL != pAV->pACodecCtx) {
+        sp_avcodec_flush_buffers( pAV->pACodecCtx );
+    }
+    const jint vPTS =  my_av_q2i32( pAV->pVFrame->pkt_pts * 1000, pAV->pVStream->time_base);
+    fprintf(stderr, "SEEK: post : res %d, u %ld, p %ld\n", res, vPTS, pAV->pVFrame->pkt_pts);
+    return vPTS;
 }
 
 JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_getVideoPTS0
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
index 2c434f38a..c9acab64b 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
@@ -48,6 +48,9 @@ import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube;
 import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
+import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 import android.os.Bundle;
 import android.util.Log;
@@ -85,21 +88,45 @@ public class MovieCubeActivity0 extends NewtBaseActivity {
        scrn.addReference();
               
        try {
-           final Animator animator = new Animator();
+           final Animator anim = new Animator();
            
            // Main           
-           final MovieCube demoMain = new MovieCube(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, -2.3f, 0f, 0f);
            final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
            glWindowMain.setFullscreen(true);
            setContentView(getWindow(), glWindowMain);
-           glWindowMain.addMouseListener(showKeyboardMouseListener);
-           glWindowMain.addGLEventListener(demoMain);
-           animator.add(glWindowMain);
+           anim.add(glWindowMain);
            glWindowMain.setVisible(true);
+           glWindowMain.addMouseListener(showKeyboardMouseListener);
            
-           // animator.setUpdateFPSFrames(60, System.err);
-           animator.setUpdateFPSFrames(-1, null);
-           animator.resetFPSCounter();
+           final MovieCube demoMain = new MovieCube(-2.3f, 0f, 0f);
+           final GLMediaPlayer mPlayer = demoMain.getGLMediaPlayer();
+           mPlayer.addEventListener(new GLMediaEventListener() {
+                @Override
+                public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+                }
+    
+                @Override
+                public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+                    System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                    System.err.println("Player State: "+mp);
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                        glWindowMain.addGLEventListener(demoMain);
+                        anim.setUpdateFPSFrames(60, System.err);
+                        anim.resetFPSCounter();
+                    }
+                    if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
+                        final StreamException se = mPlayer.getStreamException();
+                        if( null != se ) {
+                            se.printStackTrace();                        
+                        }
+                        new Thread() {
+                            public void run() {
+                                glWindowMain.destroy();
+                            } }.start();
+                    }
+                }            
+            });        
+           demoMain.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
        } catch (IOException e) {
            e.printStackTrace();
        }
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
index 2c8f0eb50..d4cb226f2 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
@@ -27,7 +27,6 @@
  */
 package com.jogamp.opengl.test.android;
 
-import java.io.IOException;
 import java.net.HttpURLConnection;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -49,6 +48,9 @@ import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple;
 import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
+import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 import android.os.Bundle;
 import android.util.Log;
@@ -84,25 +86,44 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
        final com.jogamp.newt.Screen scrn = NewtFactory.createScreen(dpy, 0);
        scrn.addReference();
               
-       try {
-           final Animator animator = new Animator();
-           
-           // Main           
-           final MovieSimple demoMain = new MovieSimple(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO);
-           demoMain.setScaleOrig(true);
-           final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
-           glWindowMain.setFullscreen(true);
-           setContentView(getWindow(), glWindowMain);
-           glWindowMain.addGLEventListener(demoMain);
-           animator.add(glWindowMain);
-           glWindowMain.setVisible(true);
-           
-           animator.setUpdateFPSFrames(60, System.err);
-           // animator.setUpdateFPSFrames(-1, null);
-           animator.resetFPSCounter();
-       } catch (IOException e) {
-           e.printStackTrace();
-       }
+       final Animator anim = new Animator();
+       
+       // Main           
+       final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
+       glWindowMain.setFullscreen(true);
+       setContentView(getWindow(), glWindowMain);
+       anim.add(glWindowMain);
+       glWindowMain.setVisible(true);
+       
+       final MovieSimple demoMain = new MovieSimple();
+       demoMain.setScaleOrig(true);
+       final GLMediaPlayer mPlayer = demoMain.getGLMediaPlayer();
+       mPlayer.addEventListener( new GLMediaPlayer.GLMediaEventListener() {            
+           @Override
+           public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+            
+           @Override
+           public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
+               System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+               System.err.println("Player State: "+mp);
+               if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                   glWindowMain.addGLEventListener(demoMain);
+                   anim.setUpdateFPSFrames(60, System.err);
+                   anim.resetFPSCounter();
+               }
+               if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
+                   final StreamException se = mPlayer.getStreamException();
+                   if( null != se ) {
+                       se.printStackTrace();                        
+                   }
+                   new Thread() {
+                       public void run() {
+                           glWindowMain.destroy();
+                       } }.start();
+               }
+           }
+       });
+       demoMain.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
        
        scrn.removeReference();
 
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
index df6b91582..4e86883e4 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
@@ -27,7 +27,6 @@
  */
 package com.jogamp.opengl.test.android;
 
-import java.io.IOException;
 import java.net.HttpURLConnection;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -51,6 +50,9 @@ import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple;
 import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
+import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 import android.os.Bundle;
 import android.util.Log;
@@ -110,82 +112,123 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
        final com.jogamp.newt.Screen scrn = NewtFactory.createScreen(dpy, 0);
        scrn.addReference();
               
-       try {
-           final Animator animator = new Animator();
-           
-           // Main           
-           final MovieSimple demoMain = new MovieSimple(streamLoc0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO);
-           if(mPlayerHUD) {
-               demoMain.setEffects(MovieSimple.EFFECT_GRADIENT_BOTTOM2TOP);
-               demoMain.setTransparency(0.9f);
-           }
-           demoMain.setScaleOrig(mPlayerNoZoom);
-           final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
-           {
-               final int padding = mPlayerHUD ? 32 : 0;
-               final android.view.View androidView = ((jogamp.newt.driver.android.WindowDriver)glWindowMain.getDelegatedWindow()).getAndroidView();
-               glWindowMain.setSize(scrn.getWidth()-padding, scrn.getHeight()-padding);
-               glWindowMain.setUndecorated(true);
-               // setContentView(getWindow(), glWindowMain);
-               viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowMain.getWidth(), glWindowMain.getHeight(), Gravity.BOTTOM|Gravity.RIGHT));
-               registerNEWTWindow(glWindowMain);
+       final Animator anim = new Animator();
+       
+       // Main           
+       final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
+       {
+           final int padding = mPlayerHUD ? 32 : 0;
+           final android.view.View androidView = ((jogamp.newt.driver.android.WindowDriver)glWindowMain.getDelegatedWindow()).getAndroidView();
+           glWindowMain.setSize(scrn.getWidth()-padding, scrn.getHeight()-padding);
+           glWindowMain.setUndecorated(true);
+           // setContentView(getWindow(), glWindowMain);
+           viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowMain.getWidth(), glWindowMain.getHeight(), Gravity.BOTTOM|Gravity.RIGHT));
+           registerNEWTWindow(glWindowMain);
+       }
+       anim.add(glWindowMain);
+       glWindowMain.setVisible(true);
+       
+       final MovieSimple demoMain = new MovieSimple();
+       final GLMediaPlayer mPlayerMain = demoMain.getGLMediaPlayer();       
+       if(mPlayerHUD) {
+           demoMain.setEffects(MovieSimple.EFFECT_GRADIENT_BOTTOM2TOP);
+           demoMain.setTransparency(0.9f);
+       }
+       demoMain.setScaleOrig(mPlayerNoZoom);
+       mPlayerMain.addEventListener( new GLMediaPlayer.GLMediaEventListener() {            
+           @Override
+           public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+            
+           @Override
+           public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
+               System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+               System.err.println("Player State: "+mp);
+               if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                   glWindowMain.addGLEventListener(demoMain);
+                   anim.setUpdateFPSFrames(60, System.err);
+                   anim.resetFPSCounter();
+               }
+               if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
+                   final StreamException se = mPlayerMain.getStreamException();
+                   if( null != se ) {
+                       se.printStackTrace();                        
+                   }
+                   new Thread() {
+                       public void run() {
+                           glWindowMain.destroy();
+                       } }.start();
+               }
            }
-           
-           glWindowMain.addGLEventListener(demoMain);
-           animator.add(glWindowMain);
-           glWindowMain.setVisible(true);
-           
-           if(mPlayerHUD) {
-                final GLMediaPlayer sharedPlayer = mPlayerSharedHUD ? demoMain.getGLMediaPlayer() : null; 
-                final GLCapabilities capsHUD = new GLCapabilities(GLProfile.getGL2ES2());
-                capsHUD.setBackgroundOpaque(false);
-                final GLWindow glWindowHUD = GLWindow.create(scrn, capsHUD);
-                glWindowMain.invoke(false, new GLRunnable() {
-                    @Override
-                    public boolean run(GLAutoDrawable drawable) {
-                        int x2 = scrn.getX();
-                        int y2 = scrn.getY();
-                        int w2 = scrn.getWidth()/3;
-                        int h2 = scrn.getHeight()/3;
-                        if(null != sharedPlayer) {
-                           if(0 < sharedPlayer.getWidth() && sharedPlayer.getWidth()<scrn.getWidth()/2 &&
-                              0 < sharedPlayer.getHeight() && sharedPlayer.getHeight()<scrn.getHeight()/2) {
-                               w2 = sharedPlayer.getWidth();
-                               h2 = sharedPlayer.getHeight();
-                           }
-                           glWindowHUD.setSharedContext(glWindowMain.getContext());
-                           glWindowHUD.addGLEventListener(new MovieSimple(sharedPlayer));                            
-                        } else {
-                           try {
-                               glWindowHUD.addGLEventListener(new MovieSimple(streamLoc1, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO));
-                           } catch (IOException e) {
-                               e.printStackTrace();
+       });
+       demoMain.initStream(streamLoc0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
+              
+       if(mPlayerHUD) {
+            final GLMediaPlayer mPlayerShared = mPlayerSharedHUD ? mPlayerMain : null; 
+            final GLCapabilities capsHUD = new GLCapabilities(GLProfile.getGL2ES2());
+            capsHUD.setBackgroundOpaque(false);
+            final GLWindow glWindowHUD = GLWindow.create(scrn, capsHUD);
+            glWindowMain.invoke(false, new GLRunnable() {
+                @Override
+                public boolean run(GLAutoDrawable drawable) {
+                    final GLMediaPlayer mPlayerSub;
+                    final MovieSimple demoHUD;
+                    int x2 = scrn.getX();
+                    int y2 = scrn.getY();
+                    int w2 = scrn.getWidth()/3;
+                    int h2 = scrn.getHeight()/3;
+                    if(null != mPlayerShared) {
+                       if(0 < mPlayerShared.getWidth() && mPlayerShared.getWidth()<scrn.getWidth()/2 &&
+                          0 < mPlayerShared.getHeight() && mPlayerShared.getHeight()<scrn.getHeight()/2) {
+                           w2 = mPlayerShared.getWidth();
+                           h2 = mPlayerShared.getHeight();
+                       }
+                       glWindowHUD.setSharedContext(glWindowMain.getContext());
+                       demoHUD = new MovieSimple(mPlayerShared);
+                       mPlayerSub = mPlayerShared;
+                    } else {
+                       demoHUD = new MovieSimple();
+                       mPlayerSub = demoHUD.getGLMediaPlayer();
+                    }
+                    mPlayerSub.addEventListener( new GLMediaPlayer.GLMediaEventListener() {            
+                       @Override
+                       public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+                        
+                       @Override
+                       public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
+                            if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                                glWindowHUD.addGLEventListener(demoHUD);
+                            }
+                           if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
+                               final StreamException se = mPlayerMain.getStreamException();
+                               if( null != se ) {
+                                   se.printStackTrace();                        
+                               }
+                               new Thread() {
+                                   public void run() {
+                                       glWindowHUD.destroy();
+                                   } }.start();
                            }
-                        }
-                        glWindowHUD.setPosition(x2, y2);
-                        glWindowHUD.setSize(w2, h2);
-                        System.err.println("HUD: "+mPlayerHUD);
-                        System.err.println("HUD: "+w2+"x"+h2);                            
-                        glWindowHUD.addMouseListener(toFrontMouseListener);               
+                       }
+                    });
+                    demoHUD.initStream(streamLoc1, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
+                   
+                    glWindowHUD.setPosition(x2, y2);
+                    glWindowHUD.setSize(w2, h2);
+                    System.err.println("HUD: "+mPlayerHUD);
+                    System.err.println("HUD: "+w2+"x"+h2);                            
+                    glWindowHUD.addMouseListener(toFrontMouseListener);               
 
-                        viewGroup.post(new Runnable() {
-                            public void run() {
-                                final android.view.View androidView = ((jogamp.newt.driver.android.WindowDriver)glWindowHUD.getDelegatedWindow()).getAndroidView();
-                                // addContentView(getWindow(), glWindowHUD, new android.view.ViewGroup.LayoutParams(glWindowHUD.getWidth(), glWindowHUD.getHeight()));
-                                viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowHUD.getWidth(), glWindowHUD.getHeight(), Gravity.TOP|Gravity.LEFT));
-                                registerNEWTWindow(glWindowHUD);  
-                                animator.add(glWindowHUD);
-                                glWindowHUD.setVisible(true);
-                            } } );
-                        return true;
-                    } } );
-           }
-           
-           animator.setUpdateFPSFrames(60, System.err);
-           // animator.setUpdateFPSFrames(-1, null);
-           animator.resetFPSCounter();
-       } catch (IOException e) {
-           e.printStackTrace();
+                    viewGroup.post(new Runnable() {
+                        public void run() {
+                            final android.view.View androidView = ((jogamp.newt.driver.android.WindowDriver)glWindowHUD.getDelegatedWindow()).getAndroidView();
+                            // addContentView(getWindow(), glWindowHUD, new android.view.ViewGroup.LayoutParams(glWindowHUD.getWidth(), glWindowHUD.getHeight()));
+                            viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowHUD.getWidth(), glWindowHUD.getHeight(), Gravity.TOP|Gravity.LEFT));
+                            registerNEWTWindow(glWindowHUD);  
+                            anim.add(glWindowHUD);
+                            glWindowHUD.setVisible(true);
+                        } } );
+                    return true;
+                } } );
        }
        
        scrn.removeReference();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index a9c200943..c48c53189 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -1,34 +1,29 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+/**
+ * Copyright 2012 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
  * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
  * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
  * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
  */
 
 package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
@@ -58,38 +53,55 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
+import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException;
 import com.jogamp.opengl.util.av.GLMediaPlayerFactory;
 import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
+/**
+ * Simple cube movie player w/ aspect ration true projection on a cube. 
+ */
 public class MovieCube implements GLEventListener, GLMediaEventListener {
-    static boolean waitForKey = false;
-    int textureCount = 3; // default - threaded
-    final URI streamLoc;
-    final int vid, aid;
-    final float zoom0, rotx, roty;
-    TextureSequenceCubeES2 cube=null;
-    GLMediaPlayer mPlayer=null;
+    private static boolean waitForKey = false;
+    private final float zoom0, rotx, roty;
+    private TextureSequenceCubeES2 cube=null;
+    private GLMediaPlayer mPlayer=null;
+    private int swapInterval = 1;
+    private long lastPerfPos = 0;
     
+    /** Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream. */
+    public static final URI defURI;
+    static {
+        URI _defURI = null;
+        try {
+            _defURI = new URI("http://video.webmfiles.org/big-buck-bunny_trailer.webm");
+        } catch (URISyntaxException e) {
+            e.printStackTrace();
+        }
+        defURI = _defURI;
+    }
+        
     public MovieCube() throws IOException, URISyntaxException {
-        this(new URI("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4"), 
-             GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, -2.3f, 0f, 0f);        
+        this(-2.3f, 0f, 0f);        
     }
     
-    public MovieCube(URI streamLoc, int vid, int aid, float zoom0, float rotx, float roty) throws IOException {
-        this.streamLoc = streamLoc;
+    public MovieCube(float zoom0, float rotx, float roty) throws IOException {
         this.zoom0 = zoom0;
         this.rotx = rotx;
         this.roty = roty;
-        this.vid = vid;
-        this.aid = aid;
         mPlayer = GLMediaPlayerFactory.createDefault();
         mPlayer.addEventListener(this);        
     }
 
-    public void setTextureCount(int v) {
-        textureCount = v;
+    public void initStream(URI streamLoc, int vid, int aid, int textureCount) {
+        mPlayer.addEventListener(this);
+        mPlayer.initStream(streamLoc, vid, aid, textureCount);
+        System.out.println("pC.1b "+mPlayer);
     }
     
+    public void setSwapInterval(int v) { this.swapInterval = v; }
+    
+    public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
+    
     private final KeyListener keyAction = new KeyAdapter() {
         public void keyReleased(KeyEvent e)  {
             if( e.isAutoRepeat() ) {
@@ -149,7 +161,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
     };
     
     @Override
-    public void attributesChanges(GLMediaPlayer mp, int event_mask, long when) {
+    public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
         System.out.println("attributesChanges: "+mp+", 0x"+Integer.toHexString(event_mask)+", when "+when);        
     }
 
@@ -160,6 +172,16 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
 
     @Override
     public void init(GLAutoDrawable drawable) {
+        if(null == mPlayer) {
+            throw new InternalError("mPlayer null");
+        }
+        if( GLMediaPlayer.State.Initialized != mPlayer.getState() ) {
+            throw new IllegalStateException("mPlayer not in state initialized: "+mPlayer);
+        }
+        if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
+            System.err.println("MovieCube: No VID/stream selected - no GL: "+mPlayer);
+            return;
+        }
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
 
@@ -168,19 +190,20 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         if(waitForKey) {
             UITestCase.waitForKey("Init>");
         }
+        
         try {
-            mPlayer.initGLStream(gl, textureCount, streamLoc, vid, aid);
-        } catch (Exception e) { 
-            e.printStackTrace(); 
+            mPlayer.initGL(gl);
+        } catch (Exception e) {
+            e.printStackTrace();
             if(null != mPlayer) {
                 mPlayer.destroy(gl);
                 mPlayer = null;
             }
             throw new GLException(e);
         }
-        
         cube.init(drawable);
         mPlayer.play();
+        System.out.println("pStart "+mPlayer);
 
         boolean added;
         final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -194,6 +217,10 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
 
     @Override
     public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        if(-1 != swapInterval) {
+            gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
+        }
         if(null == mPlayer) { return; }
         cube.reshape(drawable, x, y, width, height);
     }
@@ -209,8 +236,6 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         cube=null;
     }
 
-    long lastPerfPos = 0;
-    
     @Override
     public void display(GLAutoDrawable drawable) {
         if(null == mPlayer) { return; }
@@ -225,6 +250,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
     }
 
     public static void main(String[] args) throws IOException, InterruptedException, URISyntaxException {
+        int swapInterval = 1;
         int width = 510;
         int height = 300;
         int textureCount = 3; // default - threaded
@@ -237,7 +263,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         int aid = GLMediaPlayer.STREAM_ID_AUTO;
         final boolean origSize;
         
-        String url_s="http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4";
+        String url_s=null;
         {
             boolean _origSize = false;        
             for(int i=0; i<args.length; i++) {
@@ -269,20 +295,32 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
                     forceGL3 = true;
                 } else if(args[i].equals("-gldef")) {
                     forceGLDef = true;
+                } else if(args[i].equals("-vsync")) {
+                    i++;
+                    swapInterval = MiscUtils.atoi(args[i], swapInterval);
                 } else if(args[i].equals("-wait")) {
                     waitForKey = true;
                 }
             }
             origSize = _origSize;
         }
+        final URI streamLoc;
+        if( null == url_s ) {
+            streamLoc = defURI;
+        } else {
+            streamLoc = new URI(url_s);
+        }
+        System.err.println("stream "+streamLoc);
         System.err.println("vid "+vid+", aid "+aid);
         System.err.println("textureCount "+textureCount);
         System.err.println("forceES2   "+forceES2);
         System.err.println("forceES3   "+forceES3);
         System.err.println("forceGL3   "+forceGL3);
         System.err.println("forceGLDef "+forceGLDef);
+        System.err.println("swapInterval "+swapInterval);
         
-        final MovieCube mc = new MovieCube(new URI(url_s), vid, aid, -2.3f, 0f, 0f);
+        final MovieCube mc = new MovieCube(-2.3f, 0f, 0f);
+        mc.setSwapInterval(swapInterval);
         
         final GLProfile glp;
         if(forceGLDef) {
@@ -298,9 +336,15 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         }        
         System.err.println("GLProfile: "+glp);
         final GLWindow window = GLWindow.create(new GLCapabilities(glp));
-        // Size OpenGL to Video Surface
+        final Animator anim = new Animator(window);
+        window.addWindowListener(new WindowAdapter() {
+            public void windowDestroyed(WindowEvent e) {
+                anim.stop();
+            }                
+        });
         window.setSize(width, height);
-        window.addGLEventListener(mc);
+        window.setVisible(true);
+        anim.start();
         
         mc.mPlayer.addEventListener(new GLMediaEventListener() {
             @Override
@@ -308,22 +352,30 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
             }
 
             @Override
-            public void attributesChanges(final GLMediaPlayer mp, int event_mask, long when) {
+            public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+                System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                System.err.println("Player State: "+mp);
                 if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) && origSize ) {
                     window.setSize(mp.getWidth(), mp.getHeight());
                 }
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                    window.addGLEventListener(mc);
+                    anim.setUpdateFPSFrames(60, System.err);
+                    anim.resetFPSCounter();
+                }
+                if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
+                    final StreamException se = mc.mPlayer.getStreamException();
+                    if( null != se ) {
+                        se.printStackTrace();                        
+                    }
+                    new Thread() {
+                        public void run() {
+                            window.destroy();
+                        } }.start();
+                }
             }            
-        });
-        
-        final Animator anim = new Animator(window);
-        window.addWindowListener(new WindowAdapter() {
-            public void windowDestroyed(WindowEvent e) {
-                anim.stop();
-            }                
-        });
-        window.setVisible(true);
-        anim.setUpdateFPSFrames(60, System.err);
-        anim.start();
+        });        
+        mc.initStream(streamLoc, vid, aid, textureCount);
     }
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 9d91ce8c8..ecf95f069 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -62,6 +62,7 @@ import com.jogamp.opengl.util.GLArrayDataServer;
 import com.jogamp.opengl.util.PMVMatrix;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
+import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException;
 import com.jogamp.opengl.util.av.GLMediaPlayerFactory;
 import com.jogamp.opengl.util.glsl.ShaderCode;
 import com.jogamp.opengl.util.glsl.ShaderProgram;
@@ -72,12 +73,15 @@ import com.jogamp.opengl.util.texture.TextureSequence;
 import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 /**
- *
+ * Simple planar movie player w/ orthogonal 1:1 projection. 
  */
 public class MovieSimple implements GLEventListener, GLMediaEventListener {
-    static boolean waitForKey = false;
+    public static final int EFFECT_NORMAL                  =    0;
+    public static final int EFFECT_GRADIENT_BOTTOM2TOP     = 1<<1;
+    public static final int EFFECT_TRANSPARENT             = 1<<3; 
+
+    private static boolean waitForKey = false;
     private int winWidth, winHeight;
-    int textureCount = 3; // default - threaded
     private int prevMouseX; // , prevMouseY;
     private int rotate = 0;
     private boolean  orthoProjection = true;
@@ -88,30 +92,32 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
     private long startTime;
     private int effects = EFFECT_NORMAL;
     private float alpha = 1.0f;
-
-    public static final int EFFECT_NORMAL                  =    0;
-    public static final int EFFECT_GRADIENT_BOTTOM2TOP     = 1<<1;
-    public static final int EFFECT_TRANSPARENT             = 1<<3; 
-
-    /** defaults to true */
-    public void setOrthoProjection(boolean v) { orthoProjection=v; }
-    public boolean getOrthoProjection() { return orthoProjection; }
+    private int swapInterval = 1;
+
+    private GLMediaPlayer mPlayer;
+    private boolean mPlayerExternal;
+    private boolean mPlayerShared;
+    private boolean mPlayerScaleOrig;
+    private GLArrayDataServer interleavedVBO;
+
+    private ShaderState st;
+    private PMVMatrix pmvMatrix;
+    private GLUniformData pmvMatrixUniform;
+    private static final String shaderBasename = "texsequence_xxx";
+    private static final String myTextureLookupName = "myTexture2D";
+    
+    /** Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream. */
+    public static final URI defURI;
+    static {
+        URI _defURI = null;
+        try {
+            _defURI = new URI("http://video.webmfiles.org/big-buck-bunny_trailer.webm");
+        } catch (URISyntaxException e) {
+            e.printStackTrace();
+        }
+        defURI = _defURI;
+    }
     
-    public boolean hasEffect(int e) { return 0 != ( effects & e ) ; }
-    public void setEffects(int e) { effects = e; };
-    public void setTransparency(float alpha) {
-        this.effects |= EFFECT_TRANSPARENT;
-        this.alpha = alpha;
-    }    
-
-    GLMediaPlayer mPlayer;
-    final URI stream;
-    final int vid, aid;
-    boolean mPlayerExternal;
-    boolean mPlayerShared;
-    boolean mPlayerScaleOrig;
-    GLArrayDataServer interleavedVBO;
-
     private final MouseListener mouseAction = new MouseAdapter() {
         public void mousePressed(MouseEvent e) {
             if(e.getY()<=winHeight/2 && null!=mPlayer && 1 == e.getClickCount()) {
@@ -215,16 +221,12 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         }        
     };
     
-    public MovieSimple(URI streamLoc, int vid, int aid) throws IOException {
+    public MovieSimple() {
         mPlayerScaleOrig = false;
         mPlayerShared = false;
         mPlayerExternal = false;
         mPlayer = GLMediaPlayerFactory.createDefault();
-        mPlayer.addEventListener(this);
-        this.stream = streamLoc;
-        this.vid = vid;
-        this.aid = aid;
-        System.out.println("pC.1 "+mPlayer);
+        System.out.println("pC.1a "+mPlayer);
     }
 
     public MovieSimple(GLMediaPlayer sharedMediaPlayer) throws IllegalStateException {
@@ -233,23 +235,36 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         mPlayerExternal = true;
         mPlayer = sharedMediaPlayer;
         mPlayer.addEventListener(this);
-        this.stream = null;
-        this.vid = sharedMediaPlayer.getVID();
-        this.aid = sharedMediaPlayer.getAID();
         System.out.println("pC.2 shared "+mPlayerShared+", "+mPlayer);
     }
     
+    public void initStream(URI streamLoc, int vid, int aid, int textureCount) {
+        mPlayer.addEventListener(this);
+        mPlayer.initStream(streamLoc, vid, aid, textureCount);
+        System.out.println("pC.1b "+mPlayer);
+    }
+    
+    public void setSwapInterval(int v) { this.swapInterval = v; }
+    
     public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
     
-    public void setTextureCount(int v) {
-        textureCount = v;
-    }
     public void setScaleOrig(boolean v) {
         mPlayerScaleOrig = v;
     }
     
+    /** defaults to true */
+    public void setOrthoProjection(boolean v) { orthoProjection=v; }
+    public boolean getOrthoProjection() { return orthoProjection; }
+    
+    public boolean hasEffect(int e) { return 0 != ( effects & e ) ; }
+    public void setEffects(int e) { effects = e; };
+    public void setTransparency(float alpha) {
+        this.effects |= EFFECT_TRANSPARENT;
+        this.alpha = alpha;
+    }    
+
     @Override
-    public void attributesChanges(GLMediaPlayer mp, int event_mask, long when) {
+    public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
         System.out.println("attributesChanges: "+mp+", 0x"+Integer.toHexString(event_mask)+", when "+when);        
     }
 
@@ -258,19 +273,6 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         // System.out.println("newFrameAvailable: "+mp+", when "+when);        
     }
 
-    public void play() {
-        if(null!=mPlayer) {
-            mPlayer.play();
-            System.out.println("pStart "+mPlayer);
-        }        
-    }
-
-    ShaderState st;
-    PMVMatrix pmvMatrix;
-    GLUniformData pmvMatrixUniform;
-    static final String shaderBasename = "texsequence_xxx";
-    static final String myTextureLookupName = "myTexture2D";
-    
     private void initShader(GL2ES2 gl) {
         // Create & Compile the shader objects
         ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MovieSimple.class, 
@@ -307,6 +309,16 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
 
     @Override
     public void init(GLAutoDrawable drawable) {
+        if(null == mPlayer) { 
+            throw new InternalError("mPlayer null");
+        }
+        if( GLMediaPlayer.State.Initialized != mPlayer.getState() ) {
+            throw new IllegalStateException("mPlayer not in state initialized: "+mPlayer);
+        }
+        if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
+            System.err.println("MovieSimple: No VID/stream selected - no GL: "+mPlayer);
+            return;
+        }
         zoom0 =  orthoProjection ? 0f : -2.5f;
         zoom1 = orthoProjection ? 0f : -5f;
         zoom = zoom0;        
@@ -324,7 +336,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         try {
             System.out.println("p0 "+mPlayer+", shared "+mPlayerShared);
             if(!mPlayerShared) {
-                mPlayer.initGLStream(gl, textureCount, stream, vid, aid);
+                mPlayer.initGL(gl);
             }
             tex = mPlayer.getLastTexture().getTexture();
             System.out.println("p1 "+mPlayer+", shared "+mPlayerShared);
@@ -405,9 +417,9 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
             final TextureCoords tc = tex.getImageTexCoords();                                   
             final float aspect = tex.getAspectRatio();
+            System.err.println("XXX0: "+tc);
             System.err.println("XXX0: tex aspect: "+aspect);
             System.err.println("XXX0: tex y-flip: "+tex.getMustFlipVertically());
-            System.err.println("XXX0: "+tex.getImageTexCoords());
             
              // left-bottom
             ib.put(verts[0]);  ib.put(verts[1]);  ib.put(verts[2]);
@@ -458,11 +470,10 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         System.out.println("iVBO: "+interleavedVBO);
         System.out.println(st);
 
-        if(null!=mPlayer) {
-            play();
-            System.out.println("p2 "+mPlayer);
-        }
-        
+        if(!mPlayerShared) {
+            mPlayer.play();
+            System.out.println("pStart "+mPlayer);
+        }        
         startTime = System.currentTimeMillis();
         
         final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -477,13 +488,19 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
     
     @Override
     public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        if(-1 != swapInterval) {
+            gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
+        }
         if(null == mPlayer) { return; }
+        if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
+            return;
+        }
         winWidth = width;
         winHeight = height;
                 
         if(null != st) {
             reshapePMV(width, height);
-            GL2ES2 gl = drawable.getGL().getGL2ES2();
             st.useProgram(gl, true);
             st.uniform(gl, pmvMatrixUniform);
             st.useProgram(gl, false);
@@ -548,6 +565,10 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             lastPerfPos = currentPos;  
         }
         
+        if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
+            return;
+        }
+                
         GL2ES2 gl = drawable.getGL().getGL2ES2();        
 
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
@@ -575,7 +596,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             if(mPlayerShared) {
                 texFrame=mPlayer.getLastTexture();
             } else {
-                texFrame=mPlayer.getNextTexture(gl, true);
+                texFrame=mPlayer.getNextTexture(gl);
             }
             if(null != texFrame) {
                 tex = texFrame.getTexture();
@@ -593,6 +614,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
     }
 
     public static void main(String[] args) throws IOException, URISyntaxException {
+        int swapInterval = 1;
         int width = 640;
         int height = 600;
         int textureCount = 3; // default - threaded
@@ -607,7 +629,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         int aid = GLMediaPlayer.STREAM_ID_AUTO;
         final boolean origSize;
         
-        String url_s="http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4";
+        String url_s=null;
         {
             boolean _origSize = false;        
             for(int i=0; i<args.length; i++) {
@@ -636,6 +658,9 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
                     forceGL3 = true;
                 } else if(args[i].equals("-gldef")) {
                     forceGLDef = true;
+                } else if(args[i].equals("-vsync")) {
+                    i++;
+                    swapInterval = MiscUtils.atoi(args[i], swapInterval);
                 } else if(args[i].equals("-projection")) {
                     ortho=false;
                 } else if(args[i].equals("-zoom")) {
@@ -649,16 +674,23 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             }
             origSize = _origSize;
         }
+        final URI streamLoc;
+        if( null == url_s ) {
+            streamLoc = defURI;
+        } else {
+            streamLoc = new URI(url_s);
+        }
+        System.err.println("stream "+streamLoc);
         System.err.println("vid "+vid+", aid "+aid);
         System.err.println("textureCount "+textureCount);
         System.err.println("forceES2   "+forceES2);
         System.err.println("forceES3   "+forceES3);
         System.err.println("forceGL3   "+forceGL3);
         System.err.println("forceGLDef "+forceGLDef);
+        System.err.println("swapInterval "+swapInterval);
         
-        final URI streamURI = new URI(url_s);
-        final MovieSimple ms = new MovieSimple(streamURI, vid, aid);
-        ms.setTextureCount(textureCount);
+        final MovieSimple ms = new MovieSimple();
+        ms.setSwapInterval(swapInterval);
         ms.setScaleOrig(!zoom);
         ms.setOrthoProjection(ortho);
         
@@ -678,31 +710,46 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             System.err.println("GLProfile: "+glp);
             GLCapabilities caps = new GLCapabilities(glp);
             final GLWindow window = GLWindow.create(caps);            
+            final Animator anim = new Animator(window);
+            window.addWindowListener(new WindowAdapter() {
+                public void windowDestroyed(WindowEvent e) {
+                    anim.stop();
+                }                
+            });
+            window.setSize(width, height);
+            window.setVisible(true);
+            anim.start();
 
-            window.addGLEventListener(ms);
             ms.mPlayer.addEventListener(new GLMediaEventListener() {
                 @Override
                 public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
                 }
     
                 @Override
-                public void attributesChanges(final GLMediaPlayer mp, int event_mask, long when) {
+                public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+                    System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                    System.err.println("Player State: "+mp);
                     if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) && origSize ) {
                         window.setSize(mp.getWidth(), mp.getHeight());
                     }
-                }            
-            });
-
-            window.setSize(width, height);
-            window.setVisible(true);
-            final Animator anim = new Animator(window);
-            anim.setUpdateFPSFrames(60, System.err);
-            anim.start();
-            window.addWindowListener(new WindowAdapter() {
-                public void windowDestroyed(WindowEvent e) {
-                    anim.stop();
-                }                
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                        window.addGLEventListener(ms);
+                        anim.setUpdateFPSFrames(60, System.err);
+                        anim.resetFPSCounter();
+                    }
+                    if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
+                        final StreamException se = ms.mPlayer.getStreamException();
+                        if( null != se ) {
+                            se.printStackTrace();                        
+                        }
+                        new Thread() {
+                            public void run() {
+                                window.destroy();
+                            } }.start();
+                    }
+                }
             });
+            ms.initStream(streamLoc, vid, aid, textureCount);
         } catch (Throwable t) {
             t.printStackTrace();
         }
-- 
cgit v1.2.3


From d0e01cb5c0ec3e48b8a9b9b79a7795b214c6e3ea Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sat, 24 Aug 2013 17:56:49 +0200
Subject: GLMediaPlayer Multithreaded Decoding: GLMediaPlayer* (Part-6) - DONE

Multithreaded decoding and API should be considered stable by now,
minor changes may apply if Android/OMX impl. requires it.

We still need to solve TODO's as listed below, copied from 474ce65081ecd452215bc07ab866666cb11ca8b1.

+++

- *TextureFrame OO changes:
  - TextureFrame extends TimeFrameI

- GLMediaPlayerImpl*
  - Adapt to Ringbuffer changes of GlueGen commit f9f881e59c78e3036cb3f956bc97cfc3197f620d

  - Fix impl. method's API doc
    - getNextTextureImpl(..) returns video PTS

  - Fix audio-only playback

  - frame dropping shall only happen if:
     - previous frame has not been dropped
     - frame is too later
     - one decoded frame is already available

  - Don't block for decoder anymore:
     - nextFrame = "videoFramesDecoded.getBlocking() -> videoFramesDecoded.get()";
     No 'next decoded frame avail' only could mean:
       - slow decoding/hardware
       - slow transport
     hence we shall not block rendering.

  - Add DEBUG output if using last frame

  - Add integer property 'jogl.debug.GLMediaPlayer.StreamWorker.delay' in milliseconds
    to simulate slow decoding, i.e. delay is added in StreamWorker after decoding
    before pushing new frame to Ringbuffer.

  - FFMPEGMediaPlayer:
    - audioFrameLimitWithVideo 128 -> 64
    - audioFrameLimitAudioOnly 128 -> 32
    - uses AudioSink's 'enqueueData(int pts, ByteBuffer bytes, int byteCount)'
    - fixes for audio-only playback

+++

Working Tests: MovieSimple and MovieCube

TODO-1: Fix
  - Android
  - OMXGLMediaPlayer

TODO-2:
  - Fix issue where async audio frames arrive much later than 1st video frame, i.e. around 300ms.
  - Default TextureCount .. maybe 3 ?
  - Adding Audio synchronization ?
  - Find 'truth' about correlation of audio and video PTS values,
    currently, we assume both to be unrelated ?
---
 make/scripts/tests.sh                              |   5 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |  12 +-
 .../opengl/util/texture/TextureSequence.java       |  28 +--
 .../android/av/AndroidGLMediaPlayerAPI14.java      |   9 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 253 +++++++++++++--------
 .../jogamp/opengl/util/av/NullGLMediaPlayer.java   |  41 ++--
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     |  43 ++--
 .../opengl/util/av/impl/OMXGLMediaPlayer.java      |   5 +-
 src/jogl/native/libav/ffmpeg_tool.h                |   4 +-
 .../jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c |  44 ++--
 .../opengl/test/android/MovieCubeActivity0.java    |   4 +-
 .../opengl/test/android/MovieSimpleActivity0.java  |   4 +-
 .../opengl/test/android/MovieSimpleActivity1.java  |   4 +-
 .../jogl/demos/es2/TextureSequenceCubeES2.java     |  35 +--
 .../test/junit/jogl/demos/es2/av/MovieCube.java    |  24 +-
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  |  74 +++---
 16 files changed, 322 insertions(+), 267 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 6475f06b4..c7207bbcf 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -134,6 +134,7 @@ function jrun() {
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
     #D_ARGS="-Djogl.debug.GLMediaPlayer"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
     #D_ARGS="-Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.GLArrayData"
@@ -318,8 +319,8 @@ function testawtswt() {
 # 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.MovieSimple $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
 
 #
 # core/newt (testnoawt and testawt)
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 726eddb01..02fbd721c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -35,6 +35,7 @@ import javax.media.opengl.GLException;
 import jogamp.opengl.Debug;
 
 import com.jogamp.opengl.util.texture.TextureSequence;
+import com.jogamp.opengl.util.TimeFrameI;
 
 /**
  * GLMediaPlayer interface specifies a {@link TextureSequence} state machine
@@ -116,14 +117,11 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  * to be properly considered by {@link GLMediaPlayerFactory#create(ClassLoader, String)}
  * and {@link GLMediaPlayerFactory#createDefault()}.
  * </p>
+ * <a name="timestampaccuracy"><h5>Timestamp Accuracy</h5></a>
  * <p>
- * Variable type, value range and dimension has been chosen to suit embedded CPUs
- * and characteristics of audio and video streaming.
- * Milliseconds of type integer with a maximum value of {@link Integer#MAX_VALUE} 
- * will allow tracking time up 2,147,483.647 seconds or
- * 24 days 20 hours 31 minutes and 23 seconds.
- * Milliseconds granularity is also more than enough to deal with A-V synchronization,
- * where the threshold usually lies within 22ms. 
+ * <p>
+ * Timestamp type and value range has been chosen to suit embedded CPUs
+ * and characteristics of audio and video streaming. See {@link TimeFrameI}.
  * </p>
  * 
  * <a name="synchronization"><h5>Audio and video synchronization</h5></a>
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index e13e5ff13..8b6cc1bf9 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -29,6 +29,8 @@ package com.jogamp.opengl.util.texture;
 
 import javax.media.opengl.GL;
 
+import com.jogamp.opengl.util.TimeFrameI;
+
 /**
  * Protocol for texture sequences, like animations, movies, etc.
  * <p>
@@ -109,35 +111,21 @@ public interface TextureSequence {
      * Texture holder interface, maybe specialized by implementation
      * to associated related data. 
      */
-    public static class TextureFrame {
-        /** Constant marking an invalid PTS, i.e. Integer.MIN_VALUE == 0x80000000 == {@value}. Sync w/ native code. */
-        public static final int INVALID_PTS = 0x80000000;
-        
-        /** Constant marking the end of the stream PTS, i.e. Integer.MIN_VALUE - 1 == 0x7FFFFFFF == {@value}. Sync w/ native code. */
-        public static final int END_OF_STREAM_PTS = 0x7FFFFFFF;    
-        
+    public static class TextureFrame extends TimeFrameI {
+        public TextureFrame(Texture t, int pts, int duration) {
+            super(pts, duration);
+            texture = t;
+        }
         public TextureFrame(Texture t) {
             texture = t;
-            pts = INVALID_PTS;
-            duration = 0;
         }
         
         public final Texture getTexture() { return texture; }
-        /** Get this frame's presentation timestamp (PTS) in milliseconds. */
-        public final int getPTS() { return pts; }
-        /** Set this frame's presentation timestamp (PTS) in milliseconds. */
-        public final void setPTS(int pts) { this.pts = pts; }
-        /** Get this frame's duration in milliseconds. */
-        public final int getDuration() { return duration; }
-        /** Set this frame's duration in milliseconds. */
-        public final void setDuration(int duration) { this.duration = duration; }
         
         public String toString() {
-            return "TextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ texture.getTextureObject() + "]";
+            return "TextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ (null != texture ? texture.getTextureObject() : 0) + "]";
         }
         protected final Texture texture;
-        protected int pts;
-        protected int duration;
     }
 
     public interface TexSeqEventListener<T extends TextureSequence> {
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 578a219e9..63d9c8d22 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -35,6 +35,7 @@ import javax.media.opengl.GLException;
 
 import com.jogamp.common.os.AndroidVersion;
 import com.jogamp.common.os.Platform;
+import com.jogamp.opengl.util.TimeFrameI;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
@@ -227,7 +228,8 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+    protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+        int pts = TimeFrameI.INVALID_PTS;
         if(null != stex && null != mp) {
             final SurfaceTextureFrame nextSFrame = (SurfaceTextureFrame) nextFrame;
             final Surface nextSurface = nextSFrame.getSurface();
@@ -254,11 +256,12 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                 final SurfaceTexture nextSTex = nextSFrame.getSurfaceTexture(); 
                 nextSTex.updateTexImage();
                 // nextFrame.setPTS( (int) ( nextSTex.getTimestamp() / 1000000L ) ); // nano -9 -> milli -3
-                nextFrame.setPTS( mp.getCurrentPosition() );
+                pts = mp.getCurrentPosition();
+                nextFrame.setPTS( pts );
                 // stex.getTransformMatrix(atex.getSTMatrix());
             }
         }
-        return true;
+        return pts;
     }
     
     @Override
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 8193175b7..238595d45 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -42,14 +42,17 @@ import javax.media.opengl.GLES2;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 
+import jogamp.opengl.Debug;
+
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.LFRingbuffer;
 import com.jogamp.common.util.Ringbuffer;
+import com.jogamp.opengl.util.TimeFrameI;
 import com.jogamp.opengl.util.av.AudioSink;
-import com.jogamp.opengl.util.av.AudioSink.AudioFrame;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 /**
  * After object creation an implementation may customize the behavior:
@@ -64,6 +67,7 @@ import com.jogamp.opengl.util.texture.TextureSequence;
  * </p>
  */
 public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
+    private static final int STREAM_WORKER_DELAY = Debug.getIntProperty("jogl.debug.GLMediaPlayer.StreamWorker.delay", false, 0);
 
     protected static final String unknown = "unknown";
 
@@ -151,13 +155,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
     private ArrayList<GLMediaEventListener> eventListeners = new ArrayList<GLMediaEventListener>();
 
-    private static Ringbuffer.AllocEmptyArray<TextureFrame> rbAllocTextureFrameArray = new Ringbuffer.AllocEmptyArray<TextureFrame>() {
-        @Override
-        public TextureFrame[] newArray(int size) {
-            return new TextureFrame[size];
-        }        
-    };
-    
     protected GLMediaPlayerImpl() {
         this.textureCount=0;
         this.textureTarget=GL.GL_TEXTURE_2D;
@@ -284,6 +281,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     @Override
     public final State play() {
         synchronized( stateLock ) {
+            final State preState = state;
             switch( state ) {
                 case Paused:
                     if( playImpl() ) {
@@ -296,7 +294,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     }
                 default:
             }
-            if(DEBUG) { System.err.println("Play: "+toString()); }
+            if(DEBUG) { System.err.println("Play: "+preState+" -> "+state+", "+toString()); }
             return state;
         }
     }
@@ -308,6 +306,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     private final State pauseImpl(int event_mask) {
         synchronized( stateLock ) {
+            final State preState = state;
             if( State.Playing == state ) {
                 event_mask = addStateEventMask(event_mask, GLMediaPlayer.State.Paused);
                 state = State.Paused;
@@ -320,7 +319,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     play();
                 }
             }
-            if(DEBUG) { System.err.println("Pause: "+toString()); }            
+            if(DEBUG) { System.err.println("Pause: "+preState+" -> "+state+", "+toString()); }
             return state;
         }
     }
@@ -329,6 +328,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     @Override
     public final int seek(int msec) {
         synchronized( stateLock ) {
+            final State preState = state;
             final int pts1;
             switch(state) {
                 case Playing:
@@ -348,7 +348,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 default:
                     pts1 = 0;
             }
-            if(DEBUG) { System.err.println("Seek("+msec+"): "+toString()); }
+            if(DEBUG) { System.err.println("Seek("+msec+"): "+preState+" -> "+state+", "+toString()); }
             return pts1;
         }
     }
@@ -362,6 +362,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     @Override
     public final boolean setPlaySpeed(float rate) {
         synchronized( stateLock ) {
+            final State preState = state;
+            final float preSpeed = playSpeed;
             boolean res = false;
             if(State.Uninitialized != state ) {
                 if( rate > 0.01f ) {
@@ -371,11 +373,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     if( setPlaySpeedImpl(rate) ) {
                         resetAudioVideoPTS();
                         playSpeed = rate;
-                        if(DEBUG) { System.err.println("SetPlaySpeed: "+toString()); }
                         res = true;
                     }
                 }
             }
+            if(DEBUG) { System.err.println("setPlaySpeed("+rate+"): "+preState+"/"+preSpeed+" -> "+state+"/"+playSpeed+", "+toString()); }
             return res;
         }
     }
@@ -464,14 +466,16 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     removeAllTextureFrames(gl);
                     initGLImpl(gl);
                     videoFramesOrig = createTexFrames(gl, textureCount);
-                    videoFramesFree = new LFRingbuffer<TextureFrame>(videoFramesOrig, rbAllocTextureFrameArray);
-                    videoFramesDecoded = new LFRingbuffer<TextureFrame>(textureCount, rbAllocTextureFrameArray);
+                    videoFramesFree = new LFRingbuffer<TextureFrame>(videoFramesOrig);
+                    videoFramesDecoded = new LFRingbuffer<TextureFrame>(TextureFrame[].class, textureCount);
                     lastFrame = videoFramesFree.getBlocking( );
                     streamWorker.initGL(gl);
                 } else {
+                    removeAllTextureFrames(null);
                     initGLImpl(null);
                     setTextureFormat(-1, -1);
                     setTextureType(-1);
+                    videoFramesOrig = null;
                     videoFramesFree = null;
                     videoFramesDecoded = null;
                     lastFrame = null;
@@ -482,6 +486,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
         }
     }
+    /** 
+     * Shall initialize all GL related resources, if not audio-only.
+     * <p>
+     * Shall also take care of {@link AudioSink} initialization if appropriate.
+     * </p>
+     * @param gl null for audio-only, otherwise a valid and current GL object.
+     * @throws IOException
+     * @throws GLException
+     */
     protected abstract void initGLImpl(GL gl) throws IOException, GLException;
     
     /** 
@@ -570,12 +583,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     
     private final void removeAllTextureFrames(GL gl) {
-        if( null != videoFramesOrig ) {
-            final TextureFrame[] texFrames = videoFramesOrig;
-            videoFramesOrig = null;
-            videoFramesFree = null;
-            videoFramesDecoded = null;
-            lastFrame = null;
+        final TextureFrame[] texFrames = videoFramesOrig;
+        videoFramesOrig = null;
+        videoFramesFree = null;
+        videoFramesDecoded = null;
+        lastFrame = null;
+        if( null != texFrames ) {
             for(int i=0; i<texFrames.length; i++) {
                 final TextureFrame frame = texFrames[i];
                 if(null != frame) {
@@ -605,28 +618,32 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     do {
                         final long currentTimeMillis;
                         final boolean playCached = null != cachedFrame;
+                        final boolean droppedFrame;
                         if( dropFrame ) {
                             presentedFrameCount--;
                             dropFrame = false;
+                            droppedFrame = true;
+                        } else {
+                            droppedFrame = false;
                         }
                         if( playCached ) {
                             nextFrame = cachedFrame;
                             cachedFrame = null;
                             presentedFrameCount--;
                         } else if( STREAM_ID_NONE != vid ) {
-                            nextFrame = videoFramesDecoded.getBlocking();
+                            nextFrame = videoFramesDecoded.get();
                         }
                         currentTimeMillis = Platform.currentTimeMillis();
                         if( null != nextFrame ) {
                             presentedFrameCount++;
                             final int video_pts = nextFrame.getPTS();
-                            if( video_pts == TextureFrame.END_OF_STREAM_PTS ) {
+                            if( video_pts == TimeFrameI.END_OF_STREAM_PTS ) {
                                 pauseImpl(GLMediaEventListener.EVENT_CHANGE_EOS);
-                            } else if( video_pts != TextureFrame.INVALID_PTS ) {
+                            } else if( video_pts != TimeFrameI.INVALID_PTS ) {
                                 final int audio_pts = getAudioPTSImpl();
                                 final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
                                 final int d_apts;
-                                if( audio_pts != AudioFrame.INVALID_PTS ) {
+                                if( audio_pts != TimeFrameI.INVALID_PTS ) {
                                     d_apts = audio_pts - audio_scr;
                                 } else {
                                     d_apts = 0;
@@ -662,7 +679,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                     if( dt > maxVideoDelay ) {
                                         cachedFrame = nextFrame;
                                         nextFrame = null;
-                                    } else if ( dt < -maxVideoDelay ) {
+                                    } else if ( !droppedFrame && dt < -maxVideoDelay && videoFramesDecoded.size() > 0 ) {
+                                        // only drop if prev. frame has not been dropped and 
+                                        // frame is too late and one decoded frame is already available.
                                         dropFrame = true;
                                     }
                                     video_pts_last = video_pts;
@@ -682,6 +701,20 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 lastFrame = nextFrame;
                                 videoFramesFree.putBlocking(_lastFrame);
                             }
+                        } else if( DEBUG ) {                            
+                            final int video_pts = lastFrame.getPTS();
+                            final int audio_pts = getAudioPTSImpl();
+                            final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
+                            final int d_apts;
+                            if( audio_pts != TimeFrameI.INVALID_PTS ) {
+                                d_apts = audio_pts - audio_scr;
+                            } else {
+                                d_apts = 0;
+                            }
+                            final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed );
+                            final int d_vpts = video_pts - video_scr;
+                            System.err.println( "AV~: dT "+(currentTimeMillis-lastTimeMillis)+", "+
+                                    getPerfStringImpl( video_scr, video_pts, d_vpts, audio_scr, audio_pts, d_apts, 0 ) + ", droppedFrame "+droppedFrame);
                         }
                         lastTimeMillis = currentTimeMillis;
                     } while( dropFrame );
@@ -696,12 +729,27 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected void preNextTextureImpl(GL gl) {}
     protected void postNextTextureImpl(GL gl) {}
     /**
+     * Process stream until the next video frame, i.e. {@link TextureFrame}, has been reached.
+     * Audio frames, i.e. {@link AudioSink.AudioFrame}, shall be handled in the process.
+     * <p>
+     * Video frames shall be ignored, if {@link #getVID()} is {@link #STREAM_ID_NONE}.
+     * </p> 
+     * <p>
+     * Audio frames shall be ignored, if {@link #getAID()} is {@link #STREAM_ID_NONE}.
+     * </p>
+     * <p>
+     * Methods is invoked on the <a href="#streamworker"><i>StreamWorker</i> decoding thread</a>.
+     * </p> 
+     * <p>
      * Implementation shall care of OpenGL synchronization as required, e.g. glFinish()/glFlush()!
-     * @param gl
-     * @param nextFrame
-     * @return
+     * </p>
+     * @param gl valid and current GL instance, shall be <code>null</code> for audio only. 
+     * @param nextFrame the {@link TextureFrame} to store the video PTS and texture data,
+     *                  shall be <code>null</code> for audio only.
+     * @return the last processed video PTS value, maybe {@link TimeFrameI#INVALID_PTS} if video frame is invalid or n/a.
+     *         Will be {@link TimeFrameI#END_OF_STREAM_PTS} if end of stream reached. 
      */
-    protected abstract boolean getNextTextureImpl(GL gl, TextureFrame nextFrame);
+    protected abstract int getNextTextureImpl(GL gl, TextureFrame nextFrame);
     
     /** 
      * {@inheritDoc}
@@ -731,12 +779,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     private void flushAllVideoFrames() {
         if( null != videoFramesFree ) {
             videoFramesFree.resetFull(videoFramesOrig);
+            lastFrame = videoFramesFree.get();
+            if( null == lastFrame ) { throw new InternalError("XXX"); }
         }
         if( null != videoFramesDecoded ) {
             videoFramesDecoded.clear();
         }
-        lastFrame = videoFramesFree.get( );
-        if( null == lastFrame ) { throw new InternalError("XXX"); }
         cachedFrame = null;
     }
     private void resetAllAudioVideoSync() {
@@ -842,14 +890,16 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         public synchronized void doPause() {
             if( isActive ) {
                 shallPause = true;
-                if( isBlocked && isActive ) {
-                    this.interrupt();
-                }
-                while( isActive ) {
-                    try {
-                        this.wait(); // wait until paused
-                    } catch (InterruptedException e) {
-                        e.printStackTrace();
+                if( Thread.currentThread() != this ) {
+                    if( isBlocked && isActive ) {
+                        this.interrupt();
+                    }
+                    while( isActive ) {
+                        try {
+                            this.wait(); // wait until paused
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
                     }
                 }
             }
@@ -857,12 +907,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         public synchronized void doResume() {
             if( isRunning && !isActive ) {
                 shallPause = false;
-                while( !isActive ) {
-                    this.notify();  // wake-up pause-block
-                    try {
-                        this.wait(); // wait until resumed 
-                    } catch (InterruptedException e) {
-                        e.printStackTrace();
+                if( Thread.currentThread() != this ) {
+                    while( !isActive ) {
+                        this.notify();  // wake-up pause-block
+                        try {
+                            this.wait(); // wait until resumed 
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
                     }
                 }
             }
@@ -870,15 +922,17 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         public synchronized void doStop() {
             if( isRunning ) {
                 shallStop = true;
-                if( isBlocked && isRunning ) {
-                    this.interrupt();
-                }
-                while( isRunning ) {
-                    this.notify();  // wake-up pause-block (opt)
-                    try {
-                        this.wait();  // wait until stopped
-                    } catch (InterruptedException e) {
-                        e.printStackTrace();
+                if( Thread.currentThread() != this ) {
+                    if( isBlocked && isRunning ) {
+                        this.interrupt();
+                    }
+                    while( isRunning ) {
+                        this.notify();  // wake-up pause-block (opt)
+                        try {
+                            this.wait();  // wait until stopped
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
                     }
                 }
             }
@@ -939,51 +993,68 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             preNextTextureImpl(sharedGLCtx.getGL());
                             sharedGLCtxCurrent = true;
                         }
+                        if( null == videoFramesFree ) {
+                            throw new InternalError("XXX videoFramesFree is null");
+                        }
                     }
                 }
                 
                 if( !shallStop ) {
                     TextureFrame nextFrame = null;
-                    if( null != sharedGLCtx ) {
-                        try {
-                            isBlocked = true;
-                            nextFrame = videoFramesFree.getBlocking( );
-                            isBlocked = false;
-                            nextFrame.setPTS( TextureFrame.INVALID_PTS ); // mark invalid until processed!
-                            final GL gl = sharedGLCtxCurrent ? sharedGLCtx.getGL() : null;
-                            if( getNextTextureImpl(gl, nextFrame) ) {
+                    try {
+                        final GL gl;
+                        isBlocked = true;
+                        if( null != videoFramesFree ) {
+                            nextFrame = videoFramesFree.getBlocking();
+                            nextFrame.setPTS( TimeFrameI.INVALID_PTS ); // mark invalid until processed!
+                            gl = sharedGLCtx.getGL();
+                        } else {
+                            gl = null;
+                        }
+                        isBlocked = false;
+                        final int vPTS = getNextTextureImpl(gl, nextFrame);
+                        if( TimeFrameI.INVALID_PTS != vPTS ) {
+                            if( null != nextFrame ) {
+                                if( STREAM_WORKER_DELAY > 0 ) {
+                                    Thread.sleep(STREAM_WORKER_DELAY);
+                                }
                                 if( !videoFramesDecoded.put(nextFrame) ) {
                                     throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); 
                                 }
                                 newFrameAvailable(nextFrame, Platform.currentTimeMillis());
                                 nextFrame = null;
-                            }
-                        } catch (InterruptedException e) {
-                            isBlocked = false;
-                            if( !shallStop && !shallPause ) {
-                                streamErr = new StreamException("InterruptedException while decoding: "+GLMediaPlayerImpl.this.toString(), e);
-                            }
-                        } catch (Throwable t) {
-                            streamErr = new StreamException(t.getClass().getSimpleName()+" while decoding: "+GLMediaPlayerImpl.this.toString(), t);
-                        } finally {
-                            if( null != nextFrame ) { // put back
-                                videoFramesFree.put(nextFrame);
-                            }
-                            if( null != streamErr ) {
-                                if( DEBUG ) {
-                                    final Throwable t = null != streamErr.getCause() ? streamErr.getCause() : streamErr;
-                                    System.err.println("Caught StreamException: "+t.getMessage());
-                                    t.printStackTrace();
+                            } else {
+                                // audio only
+                                if( TimeFrameI.END_OF_STREAM_PTS == vPTS ) {
+                                    // state transition incl. notification
+                                    shallPause = true;
+                                    isActive = false;
+                                    pauseImpl(GLMediaEventListener.EVENT_CHANGE_EOS);
                                 }
-                                // state transition incl. notification
-                                shallPause = true;
-                                isActive = false;
-                                pause();
                             }
                         }
-                    } else {
-                        // audio only
-                        getNextTextureImpl(null, null);
+                    } catch (InterruptedException e) {
+                        isBlocked = false;
+                        if( !shallStop && !shallPause ) {
+                            streamErr = new StreamException("InterruptedException while decoding: "+GLMediaPlayerImpl.this.toString(), e);
+                        }
+                    } catch (Throwable t) {
+                        streamErr = new StreamException(t.getClass().getSimpleName()+" while decoding: "+GLMediaPlayerImpl.this.toString(), t);
+                    } finally {
+                        if( null != nextFrame ) { // put back
+                            videoFramesFree.put(nextFrame);
+                        }
+                        if( null != streamErr ) {
+                            if( DEBUG ) {
+                                final Throwable t = null != streamErr.getCause() ? streamErr.getCause() : streamErr;
+                                System.err.println("Caught StreamException: "+t.getMessage());
+                                t.printStackTrace();
+                            }
+                            // state transition incl. notification
+                            shallPause = true;
+                            isActive = false;
+                            pauseImpl(GLMediaEventListener.EVENT_CHANGE_ERR);
+                        }
                     }
                 }
             }
@@ -1106,13 +1177,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             destroyImpl(gl);
             removeAllTextureFrames(gl);
             textureCount=0;
-            if( null != videoFramesFree ) {
-                videoFramesFree.clear();
-            }
-            if( null != videoFramesDecoded ) {
-                videoFramesDecoded.clear();
-            }
-            changeState(0, State.Uninitialized);            
+            changeState(0, State.Uninitialized);
             return state;
         }
     }
@@ -1215,7 +1280,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         final String audioSinkInfo;
         final AudioSink audioSink = getAudioSink();
         if( null != audioSink ) {
-            audioSinkInfo = "AudioSink[frames [d "+audioSink.getEnqueuedFrameCount()+", q "+audioSink.getQueuedFrameCount()+", f "+audioSink.getFreeFrameCount()+"], time "+audioSink.getQueuedTime()+", bytes "+audioSink.getQueuedByteCount()+"]";
+            audioSinkInfo = "AudioSink[frames [p "+audioSink.getEnqueuedFrameCount()+", q "+audioSink.getQueuedFrameCount()+", f "+audioSink.getFreeFrameCount()+", c "+audioSink.getFrameCount()+"], time "+audioSink.getQueuedTime()+", bytes "+audioSink.getQueuedByteCount()+"]";
         } else {
             audioSinkInfo = "";
         }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index 31ac55ec3..9066f3dd1 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -83,9 +83,10 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame) {
-        nextFrame.setPTS( getAudioPTSImpl() );
-        return true;
+    protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+        final int pts = getAudioPTSImpl();
+        nextFrame.setPTS( pts );
+        return pts;
     }
     
     @Override
@@ -102,40 +103,42 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
             texData = null;
         }                      
     }
-        
-    @Override
-    protected final void initStreamImpl(int vid, int aid) throws IOException {
+    
+    public final static TextureData createTestTextureData() {
+        TextureData res = null;
         try {
-            URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-160x90.png", this.getClass().getClassLoader());
+            URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-160x90.png", NullGLMediaPlayer.class.getClassLoader());
             if(null != urlConn) {
-                texData = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, TextureIO.PNG);
+                res = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, TextureIO.PNG);
             }
         } catch (Exception e) {
             e.printStackTrace();
         }
-        final int _w, _h;
-        if(null != texData) {
-            _w = texData.getWidth();
-            _h = texData.getHeight();            
-        } else {
-            _w = 640;
-            _h = 480;
-            ByteBuffer buffer = Buffers.newDirectByteBuffer(_w*_h*4);
+        if(null == res) {
+            final int w = 160;
+            final int h =  90;
+            ByteBuffer buffer = Buffers.newDirectByteBuffer(w*h*4);
             while(buffer.hasRemaining()) {
                 buffer.put((byte) 0xEA); buffer.put((byte) 0xEA); buffer.put((byte) 0xEA); buffer.put((byte) 0xEA);
             }
             buffer.rewind();
-            texData = new TextureData(GLProfile.getGL2ES2(),
-                   GL.GL_RGBA, _w, _h, 0,
+            res = new TextureData(GLProfile.getGL2ES2(),
+                   GL.GL_RGBA, w, h, 0,
                    GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, false, 
                    false, false, buffer, null);
         }
+        return res;
+    }
+        
+    @Override
+    protected final void initStreamImpl(int vid, int aid) throws IOException {
+        texData = createTestTextureData();
         final int r_aid = GLMediaPlayer.STREAM_ID_NONE == aid ? GLMediaPlayer.STREAM_ID_NONE : GLMediaPlayer.STREAM_ID_AUTO; 
         final float _fps = 24f;
         final int _duration = 10*60*1000; // msec
         final int _totalFrames = (int) ( (_duration/1000)*_fps );
         updateAttributes(GLMediaPlayer.STREAM_ID_AUTO, r_aid, 
-                         _w, _h, 0, 
+                         texData.getWidth(), texData.getHeight(), 0, 
                          0, 0, _fps, 
                          _totalFrames, 0, _duration, "png-static", null);
     }    
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 f1213d751..a800f2a31 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -40,6 +40,7 @@ import javax.media.opengl.GLException;
 
 import com.jogamp.common.util.VersionNumber;
 import com.jogamp.gluegen.runtime.ProcAddressTable;
+import com.jogamp.opengl.util.TimeFrameI;
 import com.jogamp.opengl.util.GLPixelStorageModes;
 import com.jogamp.opengl.util.av.AudioSink;
 import com.jogamp.opengl.util.av.AudioSink.AudioDataFormat;
@@ -169,7 +170,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     /** Initial audio frame count, ALAudioSink may grow buffer! */
     private int initialAudioFrameCount = AV_DEFAULT_AFRAMES;
     private final int audioFrameGrowAmount = 8;
-    private final int audioFrameLimit = 128;
+    private final int audioFrameLimitWithVideo =  64; // 128;
+    private final int audioFrameLimitAudioOnly =  32; // 64;
     private SampleFormat aSampleFmt = null;
     private AudioSink.AudioDataFormat avChosenAudioFormat;
     private AudioSink.AudioDataFormat sinkChosenAudioFormat;
@@ -235,6 +237,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if(null == audioSink) {
             throw new GLException("AudioSink null");
         }
+        final int audioFrameLimit;
         if( null != gl ) {
             final GLContextImpl ctx = (GLContextImpl)gl.getContext();
             AccessController.doPrivileged(new PrivilegedAction<Object>() {
@@ -247,7 +250,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                     setGLFuncs0(moviePtr, procAddrGLTexSubImage2D, procAddrGLGetError, procAddrGLFlush, procAddrGLFinish);
                     return null;
             } } );
-        }            
+            audioFrameLimit = audioFrameLimitWithVideo;
+        } else {
+            audioFrameLimit = audioFrameLimitAudioOnly;
+        }
 
         sinkChosenAudioFormat = audioSink.initSink(avChosenAudioFormat, initialAudioFrameCount, audioFrameGrowAmount, audioFrameLimit);
         if(DEBUG) {
@@ -303,7 +309,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      */
     private void updateAttributes2(int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
                                    int lSz0, int lSz1, int lSz2,
-                                   int tWd0, int tWd1, int tWd2,
+                                   int tWd0, int tWd1, int tWd2, int tH,
                                    int audioFrameCount, int sampleFmt, int sampleRate, int channels) {
         vPixelFmt = PixelFormat.valueOf(pixFmt);
         vPlanes = planes;
@@ -320,7 +326,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                 // w*h + 2 ( w/2 * h/2 ) 
                 // w*h + w*h/2
                 // 2*w/2 * h 
-                texWidth = vTexWidth[0] + vTexWidth[1]; texHeight = height; 
+                texWidth = vTexWidth[0] + vTexWidth[1]; texHeight = tH; 
                 break;
             // case PIX_FMT_YUYV422:
             case RGB24:
@@ -329,7 +335,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             case RGBA:
             case ABGR:
             case BGRA:
-                texWidth = vTexWidth[0]; texHeight = height; 
+                texWidth = vTexWidth[0]; texHeight = tH; 
                 break;
             default: // FIXME: Add more formats !
                 throw new RuntimeException("Unsupported pixelformat: "+vPixelFmt);
@@ -487,42 +493,33 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
     
     @Override
-    protected final boolean getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+    protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
-        int vPTS = TextureFrame.INVALID_PTS;
-        if( null != nextFrame ) {
+        int vPTS = TimeFrameI.INVALID_PTS;
+        if( null != gl ) {
             final Texture tex = nextFrame.getTexture();
             tex.enable(gl);
             tex.bind(gl);
         }
 
         /** Try decode up to 10 packets to find one containing video. */
-        for(int i=0; TextureFrame.INVALID_PTS == vPTS && 10 > i; i++) {
+        for(int i=0; TimeFrameI.INVALID_PTS == vPTS && 10 > i; i++) {
            vPTS = readNextPacket0(moviePtr, textureTarget, textureFormat, textureType);
         }
-        if( TextureFrame.INVALID_PTS != vPTS ) {
-            if( null != nextFrame ) {
-                nextFrame.setPTS(vPTS);
-            }
-            return true;
-        } else {
-            return false;
+        if( null != nextFrame ) {
+            nextFrame.setPTS(vPTS);
         }
-    }
+        return vPTS;
+    }    
     
     private final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
         setFirstAudioPTS2SCR( audio_pts );
         if( 1.0f == playSpeed || audioSinkPlaySpeedSet ) {
-            audioSink.enqueueData( new AudioSink.AudioFrame(sampleData, data_size, audio_pts ) );
+            audioSink.enqueueData( audio_pts, sampleData, data_size);
         }
     }
-
-    private final int getBytesPerMS(int time) {
-        final int bytesPerSample = sinkChosenAudioFormat.sampleSize >>> 3; // /8
-        return time * ( sinkChosenAudioFormat.channelCount * bytesPerSample * ( sinkChosenAudioFormat.sampleRate / 1000 ) );        
-    }
     
     private static native int getAvUtilVersion0();
     private static native int getAvFormatVersion0();
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index e1b773e9b..faa6a56c4 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -164,12 +164,13 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     @Override
-    protected boolean getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+    protected int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
         final int nextTex = _getNextTextureID(moviePtr, true);
         if(0 < nextTex) {
+            // FIXME set pts !
             /* FIXME 
             final TextureSequence.TextureFrame eglImgTex = 
                     texFrameMap.get(new Integer(_getNextTextureID(moviePtr, blocking)));
@@ -177,7 +178,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
                 lastTex = eglImgTex;
             } */
         }
-        return true;
+        return 0; // FIXME: return pts
     }
     
     private String replaceAll(String orig, String search, String repl) {
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index 76de406ae..013cc0cf2 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -73,10 +73,10 @@ typedef void (APIENTRYP PFNGLFINISH) (void);
 /** Default number of audio frames per video frame. Sync w/ FFMPEGMediaPlayer.AV_DEFAULT_AFRAMES. */
 #define AV_DEFAULT_AFRAMES 8
 
-/** Constant PTS marking an invalid PTS, i.e. Integer.MIN_VALUE == 0x80000000 == {@value}. Sync w/ TextureFrame.INVALID_PTS */
+/** Constant PTS marking an invalid PTS, i.e. Integer.MIN_VALUE == 0x80000000 == {@value}. Sync w/ TimeFrameI.INVALID_PTS */
 #define INVALID_PTS 0x80000000
 
-/** Constant PTS marking the end of the stream, i.e. Integer.MIN_VALUE - 1 == 0x7FFFFFFF == {@value}. Sync w/ TextureFrame.END_OF_STREAM_PTS */
+/** Constant PTS marking the end of the stream, i.e. Integer.MIN_VALUE - 1 == 0x7FFFFFFF == {@value}. Sync w/ TimeFrameI.END_OF_STREAM_PTS */
 #define END_OF_STREAM_PTS 0x7FFFFFFF
 
 /** Until 55.0.0 */
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
index 99ef02da5..63164e547 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
+++ b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
@@ -234,6 +234,12 @@ static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasic
             w = 0;                      h = 0;
         }
 
+        (*env)->CallVoidMethod(env, instance, jni_mid_updateAttributes2,
+                               pAV->vPixFmt, pAV->vBufferPlanes, 
+                               pAV->vBitsPerPixel, pAV->vBytesPerPixelPerPlane,
+                               pAV->vLinesize[0], pAV->vLinesize[1], pAV->vLinesize[2],
+                               pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2], h,
+                               pAV->aFramesPerVideoFrame, pAV->aSampleFmt, pAV->aSampleRate, pAV->aChannels);
         (*env)->CallVoidMethod(env, instance, jni_mid_updateAttributes1,
                                pAV->vid, pAV->aid,
                                w, h, 
@@ -241,12 +247,6 @@ static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasic
                                pAV->fps, pAV->frames_video, pAV->frames_audio, pAV->duration,
                                (*env)->NewStringUTF(env, pAV->vcodec),
                                (*env)->NewStringUTF(env, pAV->acodec) );
-        (*env)->CallVoidMethod(env, instance, jni_mid_updateAttributes2,
-                               pAV->vPixFmt, pAV->vBufferPlanes, 
-                               pAV->vBitsPerPixel, pAV->vBytesPerPixelPerPlane,
-                               pAV->vLinesize[0], pAV->vLinesize[1], pAV->vLinesize[2],
-                               pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2],
-                               pAV->aFramesPerVideoFrame, pAV->aSampleFmt, pAV->aSampleRate, pAV->aChannels);
     }
 }
 
@@ -392,7 +392,7 @@ JNIEXPORT jboolean JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_ini
 
     jni_mid_pushSound = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "pushSound", "(Ljava/nio/ByteBuffer;II)V");
     jni_mid_updateAttributes1 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIIIFIIILjava/lang/String;Ljava/lang/String;)V");
-    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIII)V");
+    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIIII)V");
 
     if(jni_mid_pushSound == NULL ||
        jni_mid_updateAttributes1 == NULL ||
@@ -858,9 +858,10 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex
     if( AVERROR_EOF == avRes || ( pAV->pFormatCtx->pb && pAV->pFormatCtx->pb->eof_reached ) ) {
         resPTS = END_OF_STREAM_PTS;
     } else if( 0 <= avRes ) {
+        /**
         if( pAV->verbose ) {
             fprintf(stderr, "P: ptr %p, size %d\n", packet.data, packet.size);
-        }
+        } */
         if(packet.stream_index==pAV->aid) {
             // Decode audio frame
             if(NULL == pAV->pAFrames) { // no audio registered
@@ -1206,38 +1207,43 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_seek0
 {
     const FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
     const int64_t pos0 = pAV->vPTS;
-    const int64_t pts0 = pAV->pVFrame->pkt_pts;
+    int64_t pts0;
     int streamID;
     AVRational time_base;
     if( pAV->vid >= 0 ) {
         streamID = pAV->vid;
         time_base = pAV->pVStream->time_base;
+        pts0 = pAV->pVFrame->pkt_pts;
     } else if( pAV->aid >= 0 ) {
         streamID = pAV->aid;
         time_base = pAV->pAStream->time_base;
+        pts0 = pAV->pAFrames[pAV->aFrameCurrent]->pkt_pts;
     } else {
         return pAV->vPTS;
     }
     int64_t pts1 = (int64_t) (pos1 * (int64_t) time_base.den)
                            / (1000 * (int64_t) time_base.num);
+    if(pAV->verbose) {
+        fprintf(stderr, "SEEK: vid %d, aid %d, pos1 %d, pts: %ld -> %ld\n", pAV->vid, pAV->aid, pos1, pts0, pts1);
+    }
     int flags = 0;
     if(pos1 < pos0) {
         flags |= AVSEEK_FLAG_BACKWARD;
     }
     int res;
     if(HAS_FUNC(sp_av_seek_frame)) {
-        if(pos1 < pos0) {
-            flags |= AVSEEK_FLAG_BACKWARD;
+        if(pAV->verbose) {
+            fprintf(stderr, "SEEK.0: pre  : s %ld / %ld -> t %d / %ld\n", pos0, pts0, pos1, pts1);
         }
-        fprintf(stderr, "SEEK.0: pre  : s %ld / %ld -> t %ld / %ld\n", pos0, pts0, pos1, pts1);
         sp_av_seek_frame(pAV->pFormatCtx, streamID, pts1, flags);
-
     } else if(HAS_FUNC(sp_avformat_seek_file)) {
         int64_t ptsD = pts1 - pts0;
         int64_t seek_min    = ptsD > 0 ? pts1 - ptsD : INT64_MIN;
         int64_t seek_max    = ptsD < 0 ? pts1 - ptsD : INT64_MAX;
-        fprintf(stderr, "SEEK.1: pre  : s %ld / %ld -> t %ld / %ld [%ld .. %ld]\n", 
-            pos0, pts0, pos1, pts1, seek_min, seek_max);
+        if(pAV->verbose) {
+            fprintf(stderr, "SEEK.1: pre  : s %ld / %ld -> t %d / %ld [%ld .. %ld]\n", 
+                pos0, pts0, pos1, pts1, seek_min, seek_max);
+        }
         res = sp_avformat_seek_file(pAV->pFormatCtx, -1, seek_min, pts1, seek_max, flags);
     }
     if(NULL != pAV->pVCodecCtx) {
@@ -1246,9 +1252,11 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_seek0
     if(NULL != pAV->pACodecCtx) {
         sp_avcodec_flush_buffers( pAV->pACodecCtx );
     }
-    const jint vPTS =  my_av_q2i32( pAV->pVFrame->pkt_pts * 1000, pAV->pVStream->time_base);
-    fprintf(stderr, "SEEK: post : res %d, u %ld, p %ld\n", res, vPTS, pAV->pVFrame->pkt_pts);
-    return vPTS;
+    const jint rPTS =  my_av_q2i32( ( pAV->vid >= 0 ? pAV->pVFrame->pkt_pts : pAV->pAFrames[pAV->aFrameCurrent]->pkt_pts ) * 1000, time_base);
+    if(pAV->verbose) {
+        fprintf(stderr, "SEEK: post : res %d, u %ld\n", res, rPTS);
+    }
+    return rPTS;
 }
 
 JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_getVideoPTS0
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
index c9acab64b..783742fec 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
@@ -107,8 +107,8 @@ public class MovieCubeActivity0 extends NewtBaseActivity {
     
                 @Override
                 public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
-                    System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
-                    System.err.println("Player State: "+mp);
+                    System.err.println("MovieCubeActivity0 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                    System.err.println("MovieCubeActivity0 State: "+mp);
                     if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
                         glWindowMain.addGLEventListener(demoMain);
                         anim.setUpdateFPSFrames(60, System.err);
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
index d4cb226f2..467ad1e75 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
@@ -104,8 +104,8 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
             
            @Override
            public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
-               System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
-               System.err.println("Player State: "+mp);
+               System.err.println("MovieSimpleActivity0 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+               System.err.println("MovieSimpleActivity0 State: "+mp);
                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
                    glWindowMain.addGLEventListener(demoMain);
                    anim.setUpdateFPSFrames(60, System.err);
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
index 4e86883e4..84e691e76 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
@@ -141,8 +141,8 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
             
            @Override
            public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
-               System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
-               System.err.println("Player State: "+mp);
+               System.err.println("MovieSimpleActivity1 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+               System.err.println("MovieSimpleActivity1 State: "+mp);
                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
                    glWindowMain.addGLEventListener(demoMain);
                    anim.setUpdateFPSFrames(60, System.err);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
index 4172a2c20..e38b9c6e3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
@@ -52,6 +52,7 @@ import com.jogamp.opengl.util.glsl.ShaderState;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureCoords;
 import com.jogamp.opengl.util.texture.TextureSequence;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 public class TextureSequenceCubeES2 implements GLEventListener {
     public TextureSequenceCubeES2 (TextureSequence texSource, boolean innerCube, float zoom0, float rotx, float roty) {
@@ -188,7 +189,11 @@ public class TextureSequenceCubeES2 implements GLEventListener {
     public void init(GLAutoDrawable drawable) {
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
-        final Texture tex= texSeq.getLastTexture().getTexture();
+        final TextureFrame frame = texSeq.getLastTexture();
+        if( null == frame ) {
+            return;
+        }
+        final Texture tex= frame.getTexture();
         
         final boolean useExternalTexture = GLES2.GL_TEXTURE_EXTERNAL_OES == tex.getTarget();
         if(useExternalTexture && !gl.isExtensionAvailable("GL_OES_EGL_image_external")) {
@@ -315,20 +320,22 @@ public class TextureSequenceCubeES2 implements GLEventListener {
     
     
     private void reshapePMV(int width, int height) {
-        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
-        pmvMatrix.glLoadIdentity();
-        if(!innerCube) {
-            pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, 1f, 10.0f);
-            nearPlaneNormalized = 1f/(100f-1f);
-        } else {
-            pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 10.0f);
-            nearPlaneNormalized = 0f;
+        if(null != pmvMatrix) {
+            pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+            pmvMatrix.glLoadIdentity();
+            if(!innerCube) {
+                pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, 1f, 10.0f);
+                nearPlaneNormalized = 1f/(100f-1f);
+            } else {
+                pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 10.0f);
+                nearPlaneNormalized = 0f;
+            }
+            System.err.println("XXX0: Perspective nearPlaneNormalized: "+nearPlaneNormalized);
+    
+            pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+            pmvMatrix.glLoadIdentity();
+            pmvMatrix.glTranslatef(0, 0, zoom);
         }
-        System.err.println("XXX0: Perspective nearPlaneNormalized: "+nearPlaneNormalized);
-
-        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();
-        pmvMatrix.glTranslatef(0, 0, zoom);
     }
 
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index c48c53189..7fa55f861 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -60,7 +60,7 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 /**
  * Simple cube movie player w/ aspect ration true projection on a cube. 
  */
-public class MovieCube implements GLEventListener, GLMediaEventListener {
+public class MovieCube implements GLEventListener {
     private static boolean waitForKey = false;
     private final float zoom0, rotx, roty;
     private TextureSequenceCubeES2 cube=null;
@@ -89,11 +89,9 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         this.rotx = rotx;
         this.roty = roty;
         mPlayer = GLMediaPlayerFactory.createDefault();
-        mPlayer.addEventListener(this);        
     }
 
     public void initStream(URI streamLoc, int vid, int aid, int textureCount) {
-        mPlayer.addEventListener(this);
         mPlayer.initStream(streamLoc, vid, aid, textureCount);
         System.out.println("pC.1b "+mPlayer);
     }
@@ -160,16 +158,6 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         }        
     };
     
-    @Override
-    public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
-        System.out.println("attributesChanges: "+mp+", 0x"+Integer.toHexString(event_mask)+", when "+when);        
-    }
-
-    @Override
-    public void newFrameAvailable(GLMediaPlayer mp, TextureFrame newFrame, long when) {
-        // System.out.println("newFrameAvailable: "+mp+", when "+when);
-    }
-
     @Override
     public void init(GLAutoDrawable drawable) {
         if(null == mPlayer) {
@@ -179,8 +167,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
             throw new IllegalStateException("mPlayer not in state initialized: "+mPlayer);
         }
         if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
-            System.err.println("MovieCube: No VID/stream selected - no GL: "+mPlayer);
-            return;
+            // throw new IllegalStateException("mPlayer has no VID/stream selected: "+mPlayer);
         }
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
@@ -203,7 +190,7 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
         }
         cube.init(drawable);
         mPlayer.play();
-        System.out.println("pStart "+mPlayer);
+        System.out.println("play.0 "+mPlayer);
 
         boolean added;
         final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -245,7 +232,6 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
             System.err.println( mPlayer.getPerfString() );
             lastPerfPos = currentPos;  
         }
-        
         cube.display(drawable);
     }
 
@@ -353,8 +339,8 @@ public class MovieCube implements GLEventListener, GLMediaEventListener {
 
             @Override
             public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
-                System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
-                System.err.println("Player State: "+mp);
+                System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                System.err.println("MovieCube State: "+mp);
                 if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) && origSize ) {
                     window.setSize(mp.getWidth(), mp.getHeight());
                 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index ecf95f069..672500b1b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -75,7 +75,7 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 /**
  * Simple planar movie player w/ orthogonal 1:1 projection. 
  */
-public class MovieSimple implements GLEventListener, GLMediaEventListener {
+public class MovieSimple implements GLEventListener {
     public static final int EFFECT_NORMAL                  =    0;
     public static final int EFFECT_GRADIENT_BOTTOM2TOP     = 1<<1;
     public static final int EFFECT_TRANSPARENT             = 1<<3; 
@@ -234,12 +234,10 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         mPlayerShared = true;
         mPlayerExternal = true;
         mPlayer = sharedMediaPlayer;
-        mPlayer.addEventListener(this);
         System.out.println("pC.2 shared "+mPlayerShared+", "+mPlayer);
     }
     
     public void initStream(URI streamLoc, int vid, int aid, int textureCount) {
-        mPlayer.addEventListener(this);
         mPlayer.initStream(streamLoc, vid, aid, textureCount);
         System.out.println("pC.1b "+mPlayer);
     }
@@ -263,16 +261,6 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         this.alpha = alpha;
     }    
 
-    @Override
-    public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
-        System.out.println("attributesChanges: "+mp+", 0x"+Integer.toHexString(event_mask)+", when "+when);        
-    }
-
-    @Override
-    public void newFrameAvailable(GLMediaPlayer mp, TextureFrame newFrame, long when) {
-        // System.out.println("newFrameAvailable: "+mp+", when "+when);        
-    }
-
     private void initShader(GL2ES2 gl) {
         // Create & Compile the shader objects
         ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MovieSimple.class, 
@@ -316,8 +304,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             throw new IllegalStateException("mPlayer not in state initialized: "+mPlayer);
         }
         if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
-            System.err.println("MovieSimple: No VID/stream selected - no GL: "+mPlayer);
-            return;
+            throw new IllegalStateException("mPlayer has no VID/stream selected: "+mPlayer);
         }
         zoom0 =  orthoProjection ? 0f : -2.5f;
         zoom1 = orthoProjection ? 0f : -5f;
@@ -338,8 +325,12 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             if(!mPlayerShared) {
                 mPlayer.initGL(gl);
             }
-            tex = mPlayer.getLastTexture().getTexture();
             System.out.println("p1 "+mPlayer+", shared "+mPlayerShared);
+            final TextureFrame frame = mPlayer.getLastTexture();
+            if( null == frame ) {
+                throw new InternalError("XXX: "+mPlayer);
+            }
+            tex = mPlayer.getLastTexture().getTexture();
             useExternalTexture = GLES2.GL_TEXTURE_EXTERNAL_OES == tex.getTarget();
             if(useExternalTexture && !gl.isExtensionAvailable("GL_OES_EGL_image_external")) {
                 throw new GLException("GL_OES_EGL_image_external requested but not available");
@@ -415,10 +406,9 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
             
             final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
-            final TextureCoords tc = tex.getImageTexCoords();                                   
-            final float aspect = tex.getAspectRatio();
+            final TextureCoords tc = tex.getImageTexCoords();
             System.err.println("XXX0: "+tc);
-            System.err.println("XXX0: tex aspect: "+aspect);
+            System.err.println("XXX0: tex aspect: "+tex.getAspectRatio());
             System.err.println("XXX0: tex y-flip: "+tex.getMustFlipVertically());
             
              // left-bottom
@@ -472,7 +462,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
 
         if(!mPlayerShared) {
             mPlayer.play();
-            System.out.println("pStart "+mPlayer);
+            System.out.println("play.0 "+mPlayer);
         }        
         startTime = System.currentTimeMillis();
         
@@ -493,9 +483,6 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
         }
         if(null == mPlayer) { return; }
-        if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
-            return;
-        }
         winWidth = width;
         winHeight = height;
                 
@@ -535,7 +522,6 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         System.out.println("pD.1 "+mPlayer);        
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         if( null != mPlayer ) {
-            mPlayer.removeEventListener(this);
             if(!mPlayerExternal) {
                 mPlayer.destroy(gl);
             }
@@ -563,11 +549,7 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
         if( currentPos - lastPerfPos > 2000 ) {
             System.err.println( mPlayer.getPerfString() );
             lastPerfPos = currentPos;  
-        }
-        
-        if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
-            return;
-        }
+        }        
                 
         GL2ES2 gl = drawable.getGL().getGL2ES2();        
 
@@ -721,31 +703,47 @@ public class MovieSimple implements GLEventListener, GLMediaEventListener {
             anim.start();
 
             ms.mPlayer.addEventListener(new GLMediaEventListener() {
+                void destroyWindow() {
+                    new Thread() {
+                        public void run() {
+                            window.destroy();
+                        } }.start();                    
+                }
+                
                 @Override
                 public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
                 }
     
                 @Override
                 public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
-                    System.err.println("Player AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
-                    System.err.println("Player State: "+mp);
+                    System.err.println("MovieSimple AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                    System.err.println("MovieSimple State: "+mp);
                     if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) && origSize ) {
                         window.setSize(mp.getWidth(), mp.getHeight());
                     }
                     if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
-                        window.addGLEventListener(ms);
-                        anim.setUpdateFPSFrames(60, System.err);
-                        anim.resetFPSCounter();
+                        if( GLMediaPlayer.STREAM_ID_NONE != ms.mPlayer.getVID() ) {
+                            window.addGLEventListener(ms);
+                            anim.setUpdateFPSFrames(60, System.err);
+                            anim.resetFPSCounter();
+                        } else {
+                            try {
+                                ms.mPlayer.initGL(null);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                destroyWindow();
+                                return;
+                            }
+                            ms.mPlayer.play();
+                            System.out.println("play.1 "+ms.mPlayer);
+                        }
                     }
                     if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
                         final StreamException se = ms.mPlayer.getStreamException();
                         if( null != se ) {
                             se.printStackTrace();                        
                         }
-                        new Thread() {
-                            public void run() {
-                                window.destroy();
-                            } }.start();
+                        destroyWindow();
                     }
                 }
             });
-- 
cgit v1.2.3


From 8cdbfb676ea31c6719e6f6e8ae7a44e060a5987f Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sun, 25 Aug 2013 02:47:49 +0200
Subject: GLMediaPlayer/AudioSink: Add set[Audio]Volume(float
 v)/get[Audio]Volume() allowing to change the audio volume.

---
 .../com/jogamp/opengl/util/av/AudioSink.java       | 22 +++++++++-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   | 23 +++++++++-
 .../android/av/AndroidGLMediaPlayerAPI14.java      | 16 +++++++
 .../jogamp/opengl/openal/av/ALAudioSink.java       | 31 +++++++++++++-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 49 +++++++++++++++++++++-
 .../jogamp/opengl/util/av/JavaSoundAudioSink.java  | 14 +++++++
 .../jogamp/opengl/util/av/NullAudioSink.java       | 16 ++++++-
 .../test/junit/jogl/demos/es2/av/MovieCube.java    |  9 ++++
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  |  9 ++++
 9 files changed, 181 insertions(+), 8 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
index 2b8da8af9..7f477a57d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
@@ -201,13 +201,31 @@ public interface AudioSink {
     /** 
      * Sets the playback speed.
      * <p>
-     * Play speed is set to <i>normal</i>, i.e. <code>1.0f</code>
-     * if <code> abs(1.0f - rate) < 0.01f</code> to simplify test.
+     * To simplify test, play speed is  <i>normalized</i>, i.e.
+     * <ul> 
+     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - rate) < 0.01f </code></li> 
+     * </ul>
      * </p>
      * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation. 
      */
     public boolean setPlaySpeed(float s);
     
+    /** Returns the volume. */
+    public float getVolume();
+    
+    /** 
+     * Sets the volume [0f..1f].
+     * <p>
+     * To simplify test, volume is <i>normalized</i>, i.e.
+     * <ul> 
+     *   <li><code>0.0f</code>: if <code> Math.abs(v) < 0.01f </code></li> 
+     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - v) < 0.01f </code></li> 
+     * </ul>
+     * </p>
+     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation. 
+     */
+    public boolean setVolume(float v);
+    
     /** 
      * Returns the preferred {@link AudioDataFormat} by this sink.
      * <p>
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 02fbd721c..6235bdeb0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -350,15 +350,34 @@ public interface GLMediaPlayer extends TextureSequence {
     /**
      * Sets the playback speed.
      * <p>
-     * Play speed is set to <i>normal</i>, i.e. <code>1.0f</code>
-     * if <code> abs(1.0f - rate) < 0.01f</code> to simplify test.
+     * To simplify test, play speed is  <i>normalized</i>, i.e.
+     * <ul> 
+     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - rate) < 0.01f </code></li> 
+     * </ul>
      * </p>
      * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation. 
      */
     public boolean setPlaySpeed(float rate);
 
+    /** Returns the playback speed. */
     public float getPlaySpeed();
 
+    /**
+     * Sets the audio volume, [0f..1f].
+     * <p>
+     * To simplify test, volume is <i>normalized</i>, i.e.
+     * <ul> 
+     *   <li><code>0.0f</code>: if <code> Math.abs(v) < 0.01f </code></li> 
+     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - v) < 0.01f </code></li> 
+     * </ul>
+     * </p>
+     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation. 
+     */
+    public boolean setAudioVolume(float v);
+    
+    /** Returns the audio volume. */
+    public float getAudioVolume();
+    
     /**
      * <a href="#lifecycle">Lifecycle</a>: {@link State#Paused} -> {@link State#Playing}
      */
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 63d9c8d22..3ff156ae3 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -98,6 +98,22 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
 
     @Override
     protected final boolean setPlaySpeedImpl(float rate) {
+        // FIXME
+        return false;
+    }
+
+    @Override
+    protected final boolean setAudioVolumeImpl(float v) {
+        if(null != mp) {        
+            try {
+                mp.setVolume(v, v);
+                return true;
+            } catch (IllegalStateException ise) {
+                if(DEBUG) {
+                    ise.printStackTrace();
+                }
+            }
+        }
         return false;
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
index f9ca0c028..d3964a2cf 100644
--- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
@@ -58,7 +58,8 @@ public class ALAudioSink implements AudioSink {
 
     /** Playback speed, range [0.5 - 2.0], default 1.0. */
     private float playSpeed;
-    
+    private float volume = 1.0f;
+        
     static class ALAudioFrame extends AudioFrame {
         private final int alBuffer;
         
@@ -685,6 +686,34 @@ public class ALAudioSink implements AudioSink {
         return false; 
     }
     
+    @Override
+    public final float getVolume() {
+        return volume;        
+    }
+    
+    @Override
+    public final boolean setVolume(float v) {
+        if( !initialized || null == chosenFormat ) {
+            return false;
+        }
+        lockContext();
+        try {
+            if( Math.abs(v) < 0.01f ) {
+                v = 0.0f;
+            } else if( Math.abs(1.0f - v) < 0.01f ) {
+                v = 1.0f;
+            }
+            if( 0.0f <= v && v <= 1.0f ) { // OpenAL limits 
+                volume = v;
+                al.alSourcef(alSource[0], AL.AL_GAIN, v);
+                return true;
+            } 
+        } finally {
+            unlockContext();
+        }
+        return false; 
+    }
+    
     @Override
     public final void flush() {
         if( !initialized || null == chosenFormat ) {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 238595d45..05cc997ca 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -88,6 +88,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected URI streamLoc = null;
     
     protected volatile float playSpeed = 1.0f;
+    protected float audioVolume = 1.0f;
     
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int vid = GLMediaPlayer.STREAM_ID_AUTO;
@@ -362,7 +363,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     @Override
     public final boolean setPlaySpeed(float rate) {
         synchronized( stateLock ) {
-            final State preState = state;
             final float preSpeed = playSpeed;
             boolean res = false;
             if(State.Uninitialized != state ) {
@@ -377,7 +377,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     }
                 }
             }
-            if(DEBUG) { System.err.println("setPlaySpeed("+rate+"): "+preState+"/"+preSpeed+" -> "+state+"/"+playSpeed+", "+toString()); }
+            if(DEBUG) { System.err.println("setPlaySpeed("+rate+"): "+state+", "+preSpeed+" -> "+playSpeed+", "+toString()); }
             return res;
         }
     }
@@ -397,6 +397,51 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         return true;
     }
 
+    @Override
+    public final float getAudioVolume() {
+        getAudioVolumeImpl();
+        return audioVolume;
+    }
+    /** 
+     * Override if not using AudioSink, or AudioSink's {@link AudioSink#getVolume()} is not sufficient!
+     */
+    protected void getAudioVolumeImpl() {
+        if( null != audioSink ) {
+            audioVolume = audioSink.getVolume();
+        }
+    }
+    
+    @Override
+    public boolean setAudioVolume(float v) {
+        synchronized( stateLock ) {
+            final float preVolume = audioVolume;
+            boolean res = false;
+            if(State.Uninitialized != state ) {
+                if( Math.abs(v) < 0.01f ) {
+                    v = 0.0f;
+                } else if( Math.abs(1.0f - v) < 0.01f ) {
+                    v = 1.0f;
+                }
+                if( setAudioVolumeImpl(v) ) {
+                    audioVolume = v;
+                    res = true;
+                }
+            }
+            if(DEBUG) { System.err.println("setAudioVolume("+v+"): "+state+", "+preVolume+" -> "+audioVolume+", "+toString()); }
+            return res;
+        }
+    }
+    /** 
+     * Override if not using AudioSink, or AudioSink's {@link AudioSink#setVolume(float)} is not sufficient!
+     */
+    protected boolean setAudioVolumeImpl(float v) {
+        if( null != audioSink ) {
+            return audioSink.setVolume(v);
+        }
+        // still true, even if audioSink rejects command ..
+        return true;
+    }
+    
     @Override
     public final void initStream(URI streamLoc, int vid, int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
         synchronized( stateLock ) {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
index b46b64748..b1b9c1b6c 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
@@ -36,6 +36,7 @@ public class JavaSoundAudioSink implements AudioSink {
     private AudioDataFormat chosenFormat = null;
     
     private volatile boolean playRequested = false;
+    private float volume = 1.0f;
     
     static {
         boolean ok = false;
@@ -62,6 +63,19 @@ public class JavaSoundAudioSink implements AudioSink {
         return false; // FIXME 
     }
     
+    @Override
+    public final float getVolume() {
+        // FIXME
+        return volume;        
+    }
+    
+    @Override
+    public final boolean setVolume(float v) {
+        // FIXME
+        volume = v;
+        return true;
+    }
+    
     @Override
     public AudioDataFormat getPreferredFormat() {
         return DefaultFormat;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
index 067322819..83799b074 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
@@ -14,7 +14,8 @@ public class NullAudioSink implements AudioSink {
 
     private volatile float playSpeed = 1.0f;
     private volatile boolean playRequested = false;
-    
+    private float volume = 1.0f;
+        
     @Override
     public final float getPlaySpeed() { return playSpeed; }
     
@@ -27,6 +28,19 @@ public class NullAudioSink implements AudioSink {
         return true;
     }
     
+    @Override
+    public final float getVolume() {
+        // FIXME
+        return volume;        
+    }
+    
+    @Override
+    public final boolean setVolume(float v) {
+        // FIXME
+        volume = v;        
+        return true;
+    }
+    
     @Override
     public AudioDataFormat getPreferredFormat() {
         return DefaultFormat;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index 7fa55f861..7647421a0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -150,6 +150,15 @@ public class MovieCube implements GLEventListener {
                       }
                       mPlayer.setPlaySpeed(playSpeed); 
                     } break;
+                case KeyEvent.VK_M: {
+                      float audioVolume = mPlayer.getAudioVolume();
+                      if( audioVolume > 0.5f ) {
+                          audioVolume = 0f;
+                      } else {
+                          audioVolume = 1f;
+                      }
+                      mPlayer.setAudioVolume(audioVolume); 
+                    } break;
             }
             
             if( 0 != pts1 ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 672500b1b..f0a11820e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -213,6 +213,15 @@ public class MovieSimple implements GLEventListener {
                       }
                       mPlayer.setPlaySpeed(playSpeed); 
                     } break;
+                case KeyEvent.VK_M: {
+                      float audioVolume = mPlayer.getAudioVolume();
+                      if( audioVolume > 0.5f ) {
+                          audioVolume = 0f;
+                      } else {
+                          audioVolume = 1f;
+                      }
+                      mPlayer.setAudioVolume(audioVolume); 
+                    } break;
             }
             
             if( 0 != pts1 ) {
-- 
cgit v1.2.3


From 8130f54fa3d7cdde59f4a88af081c44ddfb2c7f0 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sun, 25 Aug 2013 05:12:51 +0200
Subject: AndroidGLMediaPlayerAPI14: Fix implementation to coop w/ threaded
 decoder / Add EOS detection, setAudioVolume(..)

GLMediaPlayerImpl.initStreamGL(..):
  Only require a minimum texture count of 2,
  which is the bare minimum to allow our algorithm to work,
  i.e. having a 'lastFrame' and avail/playing ringbuffer have each one frame.

Android's MediaPlayer API can only deal w/ one SurfaceTexture,
hence we have to fake a second SurfaceTextureFrame w/ same content
to allow our implementation to work w/ the threaded decoder (min 2 frames).
---
 .../android/av/AndroidGLMediaPlayerAPI14.java      | 171 ++++++++++++++-------
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   |  13 +-
 .../opengl/test/android/MovieCubeActivity0.java    |   5 +-
 .../opengl/test/android/MovieSimpleActivity0.java  |   5 +-
 .../opengl/test/android/MovieSimpleActivity1.java  |  10 +-
 .../android/MovieSimpleActivityLauncher00a.java    |   2 +-
 .../android/MovieSimpleActivityLauncher00b.java    |   2 +-
 7 files changed, 133 insertions(+), 75 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 3ff156ae3..39489cff4 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -46,6 +46,7 @@ import jogamp.opengl.util.av.GLMediaPlayerImpl;
 import android.graphics.SurfaceTexture;
 import android.graphics.SurfaceTexture.OnFrameAvailableListener;
 import android.media.MediaPlayer;
+import android.media.MediaPlayer.OnCompletionListener;
 import android.net.Uri;
 import android.view.Surface;
 
@@ -61,6 +62,12 @@ import android.view.Surface;
  *   <li>Android API Level 14: {@link MediaPlayer#setSurface(Surface)}</li>
  *   <li>Android API Level 14: {@link Surface#Surface(android.graphics.SurfaceTexture)}</li>
  * </ul>
+ * <p>
+ * Since the MediaPlayer API can only deal w/ <i>one</i> SurfaceTexture, 
+ * we enforce <code>textureCount</code> = 2 via {@link #validateTextureCount(int)}
+ * and duplicate the single texture via {@link #createTexFrames(GL, int)} .. etc.
+ * Two instanceds of TextureFrame are required due our framework implementation w/ Ringbuffer and 'lastFrame' access.
+ * </p>
  */
 public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     static final boolean available;
@@ -77,9 +84,13 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     
     public static final boolean isAvailable() { return available; }
     
-    MediaPlayer mp;
-    volatile boolean updateSurface = false;
-    Object updateSurfaceLock = new Object();
+    private MediaPlayer mp;
+    private volatile boolean updateSurface = false;
+    private Object updateSurfaceLock = new Object();
+    private SurfaceTextureFrame singleSTexFrame = null;
+    private int sTexFrameCount = 0;
+    private boolean sTexFrameAttached = false;
+    private volatile boolean eos = false;    
 
     /**
     private static String toString(MediaPlayer m) {
@@ -122,6 +133,8 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
         if(null != mp) {        
             try {
                 mp.start();
+                eos = false;
+                mp.setOnCompletionListener(onCompletionListener);
                 return true;
             } catch (IllegalStateException ise) {
                 if(DEBUG) {
@@ -185,22 +198,16 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
         }
     }
     
-    SurfaceTexture stex = null;
     public static class SurfaceTextureFrame extends TextureSequence.TextureFrame {        
         public SurfaceTextureFrame(Texture t, SurfaceTexture stex) {
             super(t);
             this.surfaceTex = stex;
-            this.surface = new Surface(stex);
         }
         
-        public final SurfaceTexture getSurfaceTexture() { return surfaceTex; }
-        public final Surface getSurface() { return surface; }
-        
         public String toString() {
             return "SurfaceTextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ texture.getTextureObject() + ", " + surfaceTex + "]";
         }
-        private final SurfaceTexture surfaceTex;
-        private final Surface surface; 
+        public final SurfaceTexture surfaceTex;
     }
     
     @Override
@@ -221,18 +228,15 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             } catch (IllegalStateException e) {
                 throw new RuntimeException(e);
             }
-            if( null == stex ) {
-                throw new InternalError("XXX");
-            }
             mp.setSurface(null);
             try {
                 mp.prepare();
             } catch (IOException ioe) {
                 throw new IOException("MediaPlayer failed to process stream <"+streamLoc.toString()+">: "+ioe.getMessage(), ioe);
             }
-            final int r_aid = GLMediaPlayer.STREAM_ID_NONE == aid ? GLMediaPlayer.STREAM_ID_NONE : GLMediaPlayer.STREAM_ID_AUTO;
+            final int r_aid = GLMediaPlayer.STREAM_ID_NONE == aid ? GLMediaPlayer.STREAM_ID_NONE : 1 /* fake */;
             final String icodec = "android";
-            updateAttributes(GLMediaPlayer.STREAM_ID_AUTO, r_aid, 
+            updateAttributes(0 /* fake */, r_aid, 
                              mp.getVideoWidth(), mp.getVideoHeight(), 0, 
                              0, 0, 0f, 
                              0, 0, mp.getDuration(), icodec, icodec);
@@ -243,66 +247,129 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
         // NOP
     }
     
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Returns 2 - implementation duplicates single texture
+     * </p>
+     */
+    @Override
+    protected int validateTextureCount(int desiredTextureCount) {
+        return 2;
+    }
+    
     @Override
     protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         int pts = TimeFrameI.INVALID_PTS;
-        if(null != stex && null != mp) {
-            final SurfaceTextureFrame nextSFrame = (SurfaceTextureFrame) nextFrame;
-            final Surface nextSurface = nextSFrame.getSurface();
-            mp.setSurface(nextSurface);
-            nextSurface.release();
-            
-            // Only block once, no while-loop. 
-            // This relaxes locking code of non crucial resources/events.
-            boolean update = updateSurface;
-            if( !update ) {
-                synchronized(updateSurfaceLock) {
-                    if(!updateSurface) { // volatile OK.
-                        try {
-                            updateSurfaceLock.wait();
-                        } catch (InterruptedException e) {
-                            e.printStackTrace();
+        if(null != mp) {
+            final SurfaceTextureFrame sTexFrame = (SurfaceTextureFrame) nextFrame;
+            final SurfaceTexture surfTex = sTexFrame.surfaceTex;
+            if( sTexFrame != singleSTexFrame ) {
+                throw new InternalError("XXX: sTexFrame: "+sTexFrame+", singleSTexFrame "+singleSTexFrame);
+            }
+            if( !sTexFrameAttached ) {
+                sTexFrameAttached = true;
+                final Surface surface = new Surface(sTexFrame.surfaceTex);
+                mp.setSurface(surface);
+                surface.release();
+                surfTex.setOnFrameAvailableListener(onFrameAvailableListener);
+            }
+            if( eos || !mp.isPlaying() ) {
+                eos = true;
+                pts = TimeFrameI.END_OF_STREAM_PTS;
+            } else {
+                // Only block once, no while-loop. 
+                // This relaxes locking code of non crucial resources/events.
+                boolean update = updateSurface;
+                if( !update ) {
+                    synchronized(updateSurfaceLock) {
+                        if(!updateSurface) { // volatile OK.
+                            try {
+                                updateSurfaceLock.wait();
+                            } catch (InterruptedException e) {
+                                e.printStackTrace();
+                            }
                         }
+                        update = updateSurface;
+                        updateSurface = false;
                     }
-                    update = updateSurface;
-                    updateSurface = false;
+                }
+                if(update) {
+                    surfTex.updateTexImage();
+                    // nextFrame.setPTS( (int) ( nextSTex.getTimestamp() / 1000000L ) ); // nano -9 -> milli -3
+                    pts = mp.getCurrentPosition();
+                    // stex.getTransformMatrix(atex.getSTMatrix());
                 }
             }
-            if(update) {
-                final SurfaceTexture nextSTex = nextSFrame.getSurfaceTexture(); 
-                nextSTex.updateTexImage();
-                // nextFrame.setPTS( (int) ( nextSTex.getTimestamp() / 1000000L ) ); // nano -9 -> milli -3
-                pts = mp.getCurrentPosition();
-                nextFrame.setPTS( pts );
-                // stex.getTransformMatrix(atex.getSTMatrix());
-            }
+            nextFrame.setPTS( pts );
         }
         return pts;
     }
     
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Creates only one single texture and duplicated content to 2 TextureFrames
+     * </p>
+     */
+    @Override
+    protected TextureFrame[] createTexFrames(GL gl, final int count) {
+        final int[] texNames = new int[1];
+        gl.glGenTextures(1, texNames, 0);
+        final int err = gl.glGetError();
+        if( GL.GL_NO_ERROR != err ) {
+            throw new RuntimeException("TextureNames creation failed (num: 1/"+count+"): err "+toHexString(err));
+        }
+        final TextureFrame[] texFrames = new TextureFrame[count];
+        for(int i=0; i<count; i++) {
+            texFrames[i] = createTexImage(gl, texNames[0]);
+        }
+        return texFrames;
+    }
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Returns the single texture, which is created at 1st call.
+     * </p>
+     */
     @Override
     protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
-        if( null != stex ) {
-            throw new InternalError("XXX");
+        sTexFrameCount++;
+        if( 1 == sTexFrameCount ) {
+            singleSTexFrame = new SurfaceTextureFrame( createTexImageImpl(gl, texName, width, height, true), new SurfaceTexture(texName) );
         }
-        stex = new SurfaceTexture(texName); // only 1 texture
-        stex.setOnFrameAvailableListener(onFrameAvailableListener);
-        return new TextureSequence.TextureFrame( createTexImageImpl(gl, texName, width, height, true) );
+        return singleSTexFrame;
     }
     
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Destroys the single texture at last call.
+     * </p>
+     */
     @Override
-    protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame imgTex) {
-        if(null != stex) {
-            stex.release();
-            stex = null;
+    protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
+        sTexFrameCount--;
+        if( 0 == sTexFrameCount ) {
+            singleSTexFrame = null;
+            sTexFrameAttached = false;
+            final SurfaceTextureFrame sFrame = (SurfaceTextureFrame) frame;
+            sFrame.surfaceTex.release();
+            super.destroyTexFrame(gl, frame);
         }
-        super.destroyTexFrame(gl, imgTex);
     }
     
-    protected OnFrameAvailableListener onFrameAvailableListener = new OnFrameAvailableListener() {
+    private OnFrameAvailableListener onFrameAvailableListener = new OnFrameAvailableListener() {
         @Override
         public void onFrameAvailable(SurfaceTexture surfaceTexture) {
             wakeUp(true);
         }        
     };
+    
+    private OnCompletionListener onCompletionListener = new OnCompletionListener() {
+        @Override
+        public void onCompletion(MediaPlayer mp) {
+            eos = true;
+        }        
+    };
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 05cc997ca..73d5e7748 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -453,8 +453,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
             if( STREAM_ID_NONE != vid ) {
                 textureCount = validateTextureCount(reqTextureCount);
-                if( textureCount < TEXTURE_COUNT_MIN ) {
-                    throw new InternalError("Validated texture count < "+TEXTURE_COUNT_MIN+": "+textureCount);
+                if( textureCount < 2 ) {
+                    throw new InternalError("Validated texture count < 2: "+textureCount);
                 }
             } else {
                 textureCount = 0;
@@ -545,14 +545,17 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     /** 
      * Returns the validated number of textures to be handled.
      * <p>
-     * Default is {@link #TEXTURE_COUNT_MIN} textures, last texture and the decoding texture.
+     * Default is {@link #TEXTURE_COUNT_MIN} minimum textures.
+     * </p>
+     * <p>
+     * Implementation must at least return a texture count of <i>two</i>, the last texture and the decoding texture.
      * </p>
      */
     protected int validateTextureCount(int desiredTextureCount) {
         return desiredTextureCount < TEXTURE_COUNT_MIN ? TEXTURE_COUNT_MIN : desiredTextureCount;
     }
     
-    private final TextureFrame[] createTexFrames(GL gl, final int count) {
+    protected TextureFrame[] createTexFrames(GL gl, final int count) {
         final int[] texNames = new int[count];
         gl.glGenTextures(count, texNames, 0);
         final int err = gl.glGetError();
@@ -783,7 +786,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * Audio frames shall be ignored, if {@link #getAID()} is {@link #STREAM_ID_NONE}.
      * </p>
      * <p>
-     * Methods is invoked on the <a href="#streamworker"><i>StreamWorker</i> decoding thread</a>.
+     * Method may be invoked on the <a href="#streamworker"><i>StreamWorker</i> decoding thread</a>.
      * </p> 
      * <p>
      * Implementation shall care of OpenGL synchronization as required, e.g. glFinish()/glFlush()!
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
index 783742fec..3d83bfd2c 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
@@ -119,10 +119,7 @@ public class MovieCubeActivity0 extends NewtBaseActivity {
                         if( null != se ) {
                             se.printStackTrace();                        
                         }
-                        new Thread() {
-                            public void run() {
-                                glWindowMain.destroy();
-                            } }.start();
+                        getActivity().finish();
                     }
                 }            
             });        
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
index 467ad1e75..db73673a7 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
@@ -116,10 +116,7 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
                    if( null != se ) {
                        se.printStackTrace();                        
                    }
-                   new Thread() {
-                       public void run() {
-                           glWindowMain.destroy();
-                       } }.start();
+                   getActivity().finish();
                }
            }
        });
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
index 84e691e76..f94390dcd 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
@@ -153,10 +153,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
                    if( null != se ) {
                        se.printStackTrace();                        
                    }
-                   new Thread() {
-                       public void run() {
-                           glWindowMain.destroy();
-                       } }.start();
+                   getActivity().finish();
                }
            }
        });
@@ -203,10 +200,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
                                if( null != se ) {
                                    se.printStackTrace();                        
                                }
-                               new Thread() {
-                                   public void run() {
-                                       glWindowHUD.destroy();
-                                   } }.start();
+                               getActivity().finish();
                            }
                        }
                     });
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00a.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00a.java
index de4238fad..e70e48ca3 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00a.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00a.java
@@ -45,7 +45,7 @@ public class MovieSimpleActivityLauncher00a extends LauncherUtil.BaseActivityLau
        props.setProperty("jnlp.mplayer.hud",        "false");
        props.setProperty("jnlp.mplayer.hud.shared", "false");
        // props.setProperty("jnlp.media0_url2", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v");
-       props.setProperty("jnlp.media0_url2", "");
+       props.setProperty("jnlp.media0_url2", "http://video.webmfiles.org/big-buck-bunny_trailer.webm");
        props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
        props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
        props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java
index 3decf393f..b0e7fdb33 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java
@@ -45,7 +45,7 @@ public class MovieSimpleActivityLauncher00b extends LauncherUtil.BaseActivityLau
        props.setProperty("jnlp.mplayer.hud",        "false");
        props.setProperty("jnlp.mplayer.hud.shared", "false");
        // props.setProperty("jnlp.media0_url2", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v");
-       props.setProperty("jnlp.media0_url2", "");
+       props.setProperty("jnlp.media0_url2", "http://video.webmfiles.org/big-buck-bunny_trailer.webm");
        props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
        props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
        props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
-- 
cgit v1.2.3


From 554ec0576432194f050191bdf248a1462d542a6d Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Tue, 27 Aug 2013 19:21:17 +0200
Subject: GLMediaPlayer: Add camera input / FFMPEG: Fix 'av_packet' leak and
 add missing symbol 'av_realloc'.

- Add camera input
  - Use URI w/ scheme 'camera' to determine camera input is desired,
    use URI host as camera id.
    E.g. 'camera://0' for 1st camera.

  - AndroidGLMediaPlayerAPI14: Via 'Camera'

  - FFMPEG*: Via libavdevice, device name and input format

  - TODO: Add controls to manipulate camera if available

- FFMPEG*
  - Add symbols
    - avcodec_register_all
    - av_realloc (was missing)
    - avdevice_register_all

  - Load libavdevice (opt)

  - Camera:
    - Use <ID> (windows) and /dev/video<ID> other OS
    - simply find the input format in native code

  - Support YUYV422 (used in video4linux2, etc.)
    - Stuff 2x 16bpp (YUYV) into one RGBA pixel!
    - Add texture format for 16bpp
    - Add texture lookup shader

  - Fix av_packet leak in readNextImpl(..)
    - Restore orig pointer and size values,
      we may have moved along within packet.
      Then call av_free_packet().

  - Use null AudioSink if audio-id is NONE
---
 make/build-jogl.xml                                |   1 +
 make/resources/android/AndroidManifest-jogl.xml    |   3 +-
 make/resources/android/AndroidManifest-test.xml    |  31 +++-
 make/resources/android/res-test/values/strings.xml |   4 +-
 make/scripts/tests.sh                              |   6 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |  15 ++
 .../android/av/AndroidGLMediaPlayerAPI14.java      | 115 +++++++++++--
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   |  25 ++-
 .../av/impl/FFMPEGDynamicLibraryBundleInfo.java    |  40 +++--
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     | 126 ++++++++++-----
 .../jogamp/opengl/util/av/impl/FFMPEGNatives.java  |   2 +-
 .../opengl/util/av/impl/FFMPEGv08Natives.java      |   2 +-
 .../opengl/util/av/impl/FFMPEGv09Natives.java      |   2 +-
 src/jogl/native/libav/ffmpeg_tool.h                |   3 +-
 .../jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c  | 180 ++++++++++++++-------
 .../test/android/MovieCubeActivityLauncher1a.java  |  87 ++++++++++
 .../test/android/MovieCubeActivityLauncher1b.java  |  87 ++++++++++
 .../android/MovieSimpleActivityLauncher00a.java    |  87 ----------
 .../android/MovieSimpleActivityLauncher00c.java    |  86 ++++++++++
 19 files changed, 677 insertions(+), 225 deletions(-)
 create mode 100644 src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
 create mode 100644 src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java
 delete mode 100644 src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00a.java
 create mode 100644 src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index b384aebc2..ee40c7e10 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -1479,6 +1479,7 @@
         <outofdate>
           <sourcefiles>
             <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+            <fileset dir="${project.root}" includes="${rootrel.src.c.libav}/jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c"/>
           </sourcefiles>
           <targetfiles>
             <fileset dir="${obj.jogl}" includes="lib@{output.lib.name}.so"/>
diff --git a/make/resources/android/AndroidManifest-jogl.xml b/make/resources/android/AndroidManifest-jogl.xml
index 1c08cc484..c07ee041b 100644
--- a/make/resources/android/AndroidManifest-jogl.xml
+++ b/make/resources/android/AndroidManifest-jogl.xml
@@ -4,7 +4,8 @@
       package="javax.media.opengl">
 
     <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
-    <!-- uses-feature android:name="android.hardware.camera" android:required="false" / --> <!-- not yet -->
+    <uses-feature android:name="android.hardware.camera" android:required="false" />
+    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
 
     <uses-library android:name="com.jogamp.common" android:required="true" />
 
diff --git a/make/resources/android/AndroidManifest-test.xml b/make/resources/android/AndroidManifest-test.xml
index 5357d0a18..d57913638 100644
--- a/make/resources/android/AndroidManifest-test.xml
+++ b/make/resources/android/AndroidManifest-test.xml
@@ -4,7 +4,8 @@
       package="com.jogamp.opengl.test">
 
     <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
-    <!-- uses-feature android:name="android.hardware.camera" android:required="false" / --> <!-- not yet -->
+    <uses-feature android:name="android.hardware.camera" android:required="false" />
+    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
 
     <uses-library android:name="com.jogamp.common" android:required="true" />
     <uses-library android:name="javax.media.opengl" android:required="true" />
@@ -120,8 +121,8 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity android:name="com.jogamp.opengl.test.android.MovieSimpleActivityLauncher00a"
-                  android:label="@string/activity_moviesimple0a_name"
+        <activity android:name="com.jogamp.opengl.test.android.MovieSimpleActivityLauncher00b"
+                  android:label="@string/activity_moviesimple0b_name"
                   android:description="@string/activity_moviesimple_descr"
                   android:theme="@android:style/Theme.NoDisplay"
                   >
@@ -130,8 +131,8 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity android:name="com.jogamp.opengl.test.android.MovieSimpleActivityLauncher00b"
-                  android:label="@string/activity_moviesimple0b_name"
+        <activity android:name="com.jogamp.opengl.test.android.MovieSimpleActivityLauncher00c"
+                  android:label="@string/activity_moviesimple0c_name"
                   android:description="@string/activity_moviesimple_descr"
                   android:theme="@android:style/Theme.NoDisplay"
                   >
@@ -180,6 +181,26 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
+        <activity android:name="com.jogamp.opengl.test.android.MovieCubeActivityLauncher1a"
+                  android:label="@string/activity_moviecube1a_name"
+                  android:description="@string/activity_moviecube_descr"
+                  android:theme="@android:style/Theme.NoDisplay"
+                  >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity android:name="com.jogamp.opengl.test.android.MovieCubeActivityLauncher1b"
+                  android:label="@string/activity_moviecube1b_name"
+                  android:description="@string/activity_moviecube_descr"
+                  android:theme="@android:style/Theme.NoDisplay"
+                  >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
     </application>
 
 </manifest>
diff --git a/make/resources/android/res-test/values/strings.xml b/make/resources/android/res-test/values/strings.xml
index 0b7bd2d51..072cf47e6 100644
--- a/make/resources/android/res-test/values/strings.xml
+++ b/make/resources/android/res-test/values/strings.xml
@@ -23,12 +23,14 @@
     <string name="activity_graphui2p_descr">GraphUI 2-pass</string>
     <string name="activity_elektro_name">Elektro</string>
     <string name="activity_elektro_descr">Elektro</string>
-    <string name="activity_moviesimple0a_name">MovieSimple0a</string>
     <string name="activity_moviesimple0b_name">MovieSimple0b</string>
+    <string name="activity_moviesimple0c_name">CamSimple0</string>
     <string name="activity_moviesimple1a_name">MovieSimple1a</string>
     <string name="activity_moviesimple1b_name">MovieSimple1b</string>
     <string name="activity_moviesimple2_name">MovieSimple2</string>
     <string name="activity_moviesimple_descr">MovieSimple</string>
     <string name="activity_moviecube0_name">MovieCube0</string>
+    <string name="activity_moviecube1a_name">CamCube0</string>
+    <string name="activity_moviecube1b_name">CamCube1</string>
     <string name="activity_moviecube_descr">MovieCube</string>
 </resources>
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index c7207bbcf..2be4d76b2 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -133,7 +133,7 @@ function jrun() {
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
-    #D_ARGS="-Djogl.debug.GLMediaPlayer"
+    D_ARGS="-Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
     #D_ARGS="-Djogl.debug.AudioSink"
@@ -319,8 +319,8 @@ function testawtswt() {
 # 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.MovieSimple $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
 
 #
 # core/newt (testnoawt and testawt)
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 6235bdeb0..0feca9f45 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -47,6 +47,9 @@ import com.jogamp.opengl.util.TimeFrameI;
  * Audio and video streams can be selected or muted via {@link #initStream(URI, int, int, int)}
  * using the appropriate <a href="#streamIDs">stream id</a>'s.
  * </p>
+ * <p>
+ * Camera input can be selected using the {@link #CameraInputScheme} URI. 
+ * </p>
  *   
  * <a name="streamworker"><h5><i>StreamWorker</i> Decoding Thread</h5></a>
  * <p>
@@ -190,6 +193,18 @@ public interface GLMediaPlayer extends TextureSequence {
     /** Constant {@value} for <i>auto</i> or <i>unspecified</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
     public static final int STREAM_ID_AUTO = -1;
     
+    /** 
+     * {@link URI#getScheme() URI scheme} name {@value} for camera input. E.g. <code>camera://0</code>
+     * for the 1st camera device.
+     * <p>
+     * Note: the {@link URI#getHost() URI host} is being used to identify the camera:
+     * <pre>
+     *    camera://<id>
+     * </pre>
+     * </p> 
+     */
+    public static final String CameraInputScheme = "camera";
+    
     /** Maximum video frame async of {@value} milliseconds. */
     public static final int MAXIMUM_VIDEO_ASYNC = 22;
         
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 39489cff4..056998c0c 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -28,6 +28,7 @@
 package jogamp.opengl.android.av;
 
 import java.io.IOException;
+import java.util.List;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GLES2;
@@ -45,6 +46,7 @@ import jogamp.opengl.util.av.GLMediaPlayerImpl;
 
 import android.graphics.SurfaceTexture;
 import android.graphics.SurfaceTexture.OnFrameAvailableListener;
+import android.hardware.Camera;
 import android.media.MediaPlayer;
 import android.media.MediaPlayer.OnCompletionListener;
 import android.net.Uri;
@@ -85,6 +87,8 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     public static final boolean isAvailable() { return available; }
     
     private MediaPlayer mp;
+    private Camera cam;
+    private long playStart = 0;
     private volatile boolean updateSurface = false;
     private Object updateSurfaceLock = new Object();
     private SurfaceTextureFrame singleSTexFrame = null;
@@ -104,7 +108,6 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             throw new RuntimeException("AndroidGLMediaPlayerAPI14 not available");
         }
         this.setTextureTarget(GLES2.GL_TEXTURE_EXTERNAL_OES);
-        mp = new MediaPlayer();
     }
 
     @Override
@@ -130,10 +133,11 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
 
     @Override
     protected final boolean playImpl() {
+        playStart = Platform.currentTimeMillis();
         if(null != mp) {        
             try {
                 mp.start();
-                eos = false;
+                eos = false;                
                 mp.setOnCompletionListener(onCompletionListener);
                 return true;
             } catch (IllegalStateException ise) {
@@ -141,6 +145,17 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                     ise.printStackTrace();
                 }
             }
+        } else if( null != cam ) {
+            try {
+                if( sTexFrameAttached ) {
+                    cam.startPreview();
+                }
+                return true;
+            } catch (IllegalStateException ise) {
+                if(DEBUG) {
+                    ise.printStackTrace();
+                }
+            }
         }
         return false;
     }
@@ -157,6 +172,16 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                     ise.printStackTrace();
                 }
             }
+        } else if( null != cam ) {
+            wakeUp(false);
+            try {
+                cam.stopPreview();
+                return true;
+            } catch (IllegalStateException ise) {
+                if(DEBUG) {
+                    ise.printStackTrace();
+                }
+            }
         }
         return false;
     }
@@ -196,6 +221,18 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             mp.release();
             mp = null;
         }
+        if( null != cam ) {
+            wakeUp(false);
+            try {
+                cam.stopPreview();
+            } catch (IllegalStateException ise) {
+                if(DEBUG) {
+                    ise.printStackTrace();
+                }
+            }
+            cam.release();
+            cam = null;
+        }
     }
     
     public static class SurfaceTextureFrame extends TextureSequence.TextureFrame {        
@@ -212,7 +249,27 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     
     @Override
     protected final void initStreamImpl(int vid, int aid) throws IOException {
-        if(null!=mp && null!=streamLoc) {
+
+        if( null == streamLoc ) {
+            return;
+        }
+        if( null == mp && null == cam ) {
+            if( null == cameraHostPart ) {
+                mp = new MediaPlayer();
+            } else {
+                int cameraId = 0;
+                try {                    
+                    cameraId = Integer.valueOf(cameraHostPart);
+                } catch (NumberFormatException nfe) {}
+                if( 0 <= cameraId && cameraId < Camera.getNumberOfCameras() ) {
+                    cam = Camera.open(cameraId);
+                } else {
+                    cam = Camera.open();
+                }
+            }
+        }
+
+        if(null!=mp) {
             if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
                 mp.setVolume(0f, 0f);
                 // FIXME: Disable audio handling
@@ -240,8 +297,31 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                              mp.getVideoWidth(), mp.getVideoHeight(), 0, 
                              0, 0, 0f, 
                              0, 0, mp.getDuration(), icodec, icodec);
+        } else if( null != cam ) {
+            final String icodec = "android";
+            final int[] fpsRange = { 0, 0 };
+            final Camera.Parameters p = cam.getParameters();
+            p.getPreviewFpsRange(fpsRange);
+            final Camera.Size size = p.getPreviewSize();
+            if( DEBUG ) {
+                final int picFmt = p.getPictureFormat();
+                final Camera.Size prefSize = p.getPreferredPreviewSizeForVideo();
+                System.err.println("MediaPlayer.Camera: fps "+fpsRange[0]+".."+fpsRange[1]+", size[pref "+camSz2Str(prefSize)+", cur "+camSz2Str(size)+"], fmt "+picFmt);
+                List<Camera.Size> supSizes = p.getSupportedVideoSizes();
+                for(int i=0; i<supSizes.size(); i++) {
+                    System.err.println("size #"+i+": "+camSz2Str(supSizes.get(i)));
+                }
+            }
+            updateAttributes(0 /* fake */, GLMediaPlayer.STREAM_ID_NONE, 
+                             size.width, size.height, 
+                             0, 0, 0, 
+                             fpsRange[1]/1000f, 
+                             0, 0, 0, icodec, icodec);
         }
     }
+    private static String camSz2Str(Camera.Size csize) {
+        return csize.width+"x"+csize.height;
+    }
     @Override
     protected final void initGLImpl(GL gl) throws IOException, GLException {
         // NOP
@@ -261,7 +341,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     @Override
     protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         int pts = TimeFrameI.INVALID_PTS;
-        if(null != mp) {
+        if(null != mp || null != cam) {
             final SurfaceTextureFrame sTexFrame = (SurfaceTextureFrame) nextFrame;
             final SurfaceTexture surfTex = sTexFrame.surfaceTex;
             if( sTexFrame != singleSTexFrame ) {
@@ -269,12 +349,25 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             }
             if( !sTexFrameAttached ) {
                 sTexFrameAttached = true;
-                final Surface surface = new Surface(sTexFrame.surfaceTex);
-                mp.setSurface(surface);
-                surface.release();
+                final Surface surface;
+                if( null != mp ) {
+                    surface = new Surface(sTexFrame.surfaceTex);
+                    mp.setSurface(surface);
+                } else {
+                    surface = null;
+                    try {
+                        cam.setPreviewTexture(sTexFrame.surfaceTex);
+                        cam.startPreview();
+                    } catch (IOException ioe) {
+                        throw new RuntimeException("MediaPlayer failed to process stream <"+streamLoc.toString()+">: "+ioe.getMessage(), ioe);
+                    }
+                }
+                if( null != surface ) {
+                    surface.release();
+                }
                 surfTex.setOnFrameAvailableListener(onFrameAvailableListener);
             }
-            if( eos || !mp.isPlaying() ) {
+            if( eos || (null != mp && !mp.isPlaying() ) ) {
                 eos = true;
                 pts = TimeFrameI.END_OF_STREAM_PTS;
             } else {
@@ -297,7 +390,11 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                 if(update) {
                     surfTex.updateTexImage();
                     // nextFrame.setPTS( (int) ( nextSTex.getTimestamp() / 1000000L ) ); // nano -9 -> milli -3
-                    pts = mp.getCurrentPosition();
+                    if( null != mp ) {
+                        pts = mp.getCurrentPosition();
+                    } else {
+                        pts = (int) ( Platform.currentTimeMillis() - playStart );
+                    }
                     // stex.getTransformMatrix(atex.getSTMatrix());
                 }
             }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 73d5e7748..5286c86b8 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -85,7 +85,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected int[] texMinMagFilter = { GL.GL_NEAREST, GL.GL_NEAREST };
     protected int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE };
     
+    /** User requested URI stream location. */
     protected URI streamLoc = null;
+    /** 
+     * In case {@link #streamLoc} is a {@link GLMediaPlayer#CameraInputScheme},
+     * {@link #cameraHostPart} holds the URI's path portion
+     * as parsed in {@link #initStream(URI, int, int, int)}.
+     */
+    protected String cameraHostPart = null;
     
     protected volatile float playSpeed = 1.0f;
     protected float audioVolume = 1.0f;
@@ -463,6 +470,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             presentedFrameCount = 0;
             displayedFrameCount = 0;            
             this.streamLoc = streamLoc;
+
+            // Pre-parse for camera-input scheme
+            final String streamLocScheme = streamLoc.getScheme();
+            if( null != streamLocScheme && streamLocScheme.equals(CameraInputScheme) ) {
+                cameraHostPart = streamLoc.getHost();
+            } else {
+                cameraHostPart = null; 
+            }
+            
             this.vid = vid;
             this.aid = aid;
             if (this.streamLoc != null) {
@@ -598,7 +614,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             {
                 final int err = gl.glGetError();
                 if( GL.GL_NO_ERROR != err ) {
-                    throw new RuntimeException("Couldn't create TexImage2D RGBA "+tWidth+"x"+tHeight+", err "+toHexString(err));
+                    throw new RuntimeException("Couldn't create TexImage2D RGBA "+tWidth+"x"+tHeight+", target "+toHexString(textureTarget)+
+                                   ", ifmt "+toHexString(GL.GL_RGBA)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+
+                                   ", err "+toHexString(err));
                 }
             }
             if(DEBUG) {
@@ -1303,12 +1321,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         final String loc = ( null != streamLoc ) ? streamLoc.toString() : "<undefined stream>" ;
         final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
         final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
-        final int video_scr = video_scr_pts + (int) ( ( Platform.currentTimeMillis() - video_scr_t0 ) * playSpeed );        
+        final int video_scr = video_scr_pts + (int) ( ( Platform.currentTimeMillis() - video_scr_t0 ) * playSpeed );
+        final String camPath = null != cameraHostPart ? ", camera: "+cameraHostPart : "";
         return "GLMediaPlayer["+state+", vSCR "+video_scr+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
                "speed "+playSpeed+", "+bps_stream+" bps, "+
                "Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", target "+toHexString(textureTarget)+", format "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+               
                "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
-               "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+"]";
+               "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]";
     }
     
     @Override
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index ab16c5e5e..040d152f5 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -60,7 +60,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     
     private static final List<String> glueLibNames = new ArrayList<String>(); // none
     
-    private static final int symbolCount = 51;
+    private static final int symbolCount = 54;
     private static final String[] symbolNames = {
          "avcodec_version",
          "avformat_version",
@@ -68,6 +68,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
 /* 4 */  "avresample_version",
 
          // libavcodec
+         "avcodec_register_all",
          "avcodec_close", 
          "avcodec_string", 
          "avcodec_find_decoder", 
@@ -85,16 +86,17 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "av_free_packet", 
          "avcodec_decode_audio4",     // 53.25.0   (opt)
          "avcodec_decode_audio3",     // 52.23.0
-/* 22 */ "avcodec_decode_video2",     // 52.23.0
+/* 23 */ "avcodec_decode_video2",     // 52.23.0
         
          // libavutil
          "av_pix_fmt_descriptors",
          "av_frame_unref",            // 55.0.0 (opt)
+         "av_realloc",
          "av_free",
          "av_get_bits_per_pixel",
          "av_samples_get_buffer_size",
          "av_get_bytes_per_sample",   // 51.4.0
-/* 29 */ "av_opt_set_int",            // 51.12.0
+/* 31 */ "av_opt_set_int",            // 51.12.0
          
          // libavformat
          "avformat_alloc_context",
@@ -113,14 +115,17 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avformat_network_init",     // 53.13.0   (opt)
          "avformat_network_deinit",   // 53.13.0   (opt)
          "avformat_find_stream_info", // 53.3.0    (opt)
-/* 46 */ "av_find_stream_info",
+/* 48 */ "av_find_stream_info",
 
+         // libavdevice
+/* 49 */ "avdevice_register_all",     // ??? 
+         
          // libavresample
          "avresample_alloc_context",  //  1.0.1
          "avresample_open",
          "avresample_close",
          "avresample_free",
-/* 51 */ "avresample_convert"
+/* 54 */ "avresample_convert"
     };
     
     // alternate symbol names
@@ -139,7 +144,8 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avformat_seek_file",        // ???       (opt)
          "avcodec_free_frame",        // 54.28.0   (opt)
          "av_frame_unref",            // 55.0.0 (opt)
-         
+         // libavdevice
+         "avdevice_register_all",     // 53.0.0 (opt)
          // libavresample
          "avresample_version",        //  1.0.1
          "avresample_alloc_context",  //  1.0.1
@@ -153,6 +159,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     private static final boolean ready;
     private static final boolean libsLoaded;
     private static final boolean avresampleLoaded;  // optional
+    private static final boolean avdeviceLoaded; // optional
     static final VersionNumber avCodecVersion;    
     static final VersionNumber avFormatVersion;
     static final VersionNumber avUtilVersion;
@@ -164,14 +171,16 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         GLProfile.initSingleton();
         boolean _ready = false;
         boolean[] _libsLoaded= { false };
+        boolean[] _avdeviceLoaded= { false };
         boolean[] _avresampleLoaded= { false };
         VersionNumber[] _versions = new VersionNumber[4];
         try {
-            _ready = initSymbols(_libsLoaded, _avresampleLoaded, _versions);
+            _ready = initSymbols(_libsLoaded, _avdeviceLoaded, _avresampleLoaded, _versions);
         } catch (Throwable t) {
             t.printStackTrace();
         }
         libsLoaded = _libsLoaded[0];
+        avdeviceLoaded = _avdeviceLoaded[0];
         avresampleLoaded = _avresampleLoaded[0];
         avCodecVersion = _versions[0];    
         avFormatVersion = _versions[1];
@@ -205,11 +214,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     }
     
     static boolean libsLoaded() { return libsLoaded; }
+    static boolean avDeviceLoaded() { return avdeviceLoaded; }
     static boolean avResampleLoaded() { return avresampleLoaded; }
     static FFMPEGNatives getNatives() { return natives; }
     static boolean initSingleton() { return ready; }
     
-    private static final boolean initSymbols(boolean[] libsLoaded, boolean[] avresampleLoaded, VersionNumber[] versions) {
+    private static final boolean initSymbols(boolean[] libsLoaded, boolean[] avdeviceLoaded, boolean[] avresampleLoaded,
+                                             VersionNumber[] versions) {
         libsLoaded[0] = false;
         final DynamicLibraryBundle dl = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() {
                                           public DynamicLibraryBundle run() {
@@ -221,7 +232,8 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         if(!avutilLoaded || !avformatLoaded || !avcodecLoaded) {
             throw new RuntimeException("FFMPEG Tool library incomplete: [ avutil "+avutilLoaded+", avformat "+avformatLoaded+", avcodec "+avcodecLoaded+"]");
         }
-        avresampleLoaded[0] = dl.isToolLibLoaded(3);
+        avdeviceLoaded[0] = dl.isToolLibLoaded(3);
+        avresampleLoaded[0] = dl.isToolLibLoaded(4);
         libsLoaded[0] = true;
         
         if(symbolNames.length != symbolCount) {
@@ -361,6 +373,16 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         avcodec.add("avcodec-52");   // 0.7
         libsList.add(avcodec);
         
+        final List<String> avdevice = new ArrayList<String>();
+        avdevice.add("avdevice");        // default
+
+        avdevice.add("libavdevice.so.54");     // dummy future proof
+        avdevice.add("libavdevice.so.53");     // 8 && 9
+        
+        avdevice.add("avdevice-54");     // dummy future proof
+        avdevice.add("avdevice-53");     // 8 && 9
+        libsList.add(avdevice);
+        
         final List<String> avresample = new ArrayList<String>();
         avresample.add("avresample");        // default
 
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 bcf4994b5..f46c5900c 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -129,7 +129,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("LIB_AV Util    : "+FFMPEGDynamicLibraryBundleInfo.avUtilVersion+" [cc "+avUtilMajorVersionCC+"]");
             System.err.println("LIB_AV Format  : "+FFMPEGDynamicLibraryBundleInfo.avFormatVersion+" [cc "+avFormatMajorVersionCC+"]");
             System.err.println("LIB_AV Codec   : "+FFMPEGDynamicLibraryBundleInfo.avCodecVersion+" [cc "+avCodecMajorVersionCC+"]");
-            System.err.println("LIB_AV Resample: "+FFMPEGDynamicLibraryBundleInfo.avResampleVersion+" [cc "+avResampleMajorVersionCC+"]");
+            System.err.println("LIB_AV Device  : [loaded "+FFMPEGDynamicLibraryBundleInfo.avDeviceLoaded()+"]");
+            System.err.println("LIB_AV Resample: "+FFMPEGDynamicLibraryBundleInfo.avResampleVersion+" [cc "+avResampleMajorVersionCC+", loaded "+FFMPEGDynamicLibraryBundleInfo.avResampleLoaded()+"]");
             libAVVersionGood = avUtilMajorVersionCC   == FFMPEGDynamicLibraryBundleInfo.avUtilVersion.getMajor() &&
                                avFormatMajorVersionCC == FFMPEGDynamicLibraryBundleInfo.avFormatVersion.getMajor() &&
                                avCodecMajorVersionCC  == FFMPEGDynamicLibraryBundleInfo.avCodecVersion.getMajor() &&
@@ -160,6 +161,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     // Video
     //
     
+    private String texLookupFuncName = "ffmpegTexture2D";
+    private boolean usesTexLookupShader = false;    
     private PixelFormat vPixelFmt = null;
     private int vPlanes = 0;
     private int vBitsPerPixel = 0;
@@ -205,8 +208,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
     }
     
-    public static final String dev_video = "/dev/video";
-    private static final int dev_video_len = dev_video.length();
+    public static final String dev_video_linux = "/dev/video";
     
     @Override
     protected final void initStreamImpl(int vid, int aid) throws IOException {
@@ -229,40 +231,34 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("initStream: p2 preferred "+preferredAudioFormat+", "+this);
         }
         
-        final int streamLocSLen = streamLocS.length();
-        final String inFormat;
+        final boolean isCameraInput = null != cameraHostPart;
         final String resStreamLocS;
-        if( streamLocSLen == dev_video_len + 1 && streamLocS.startsWith(dev_video) ) {            
-            final int index = Integer.valueOf( streamLocS.substring(streamLocSLen-1) ).intValue();
+        if( isCameraInput ) {
             switch(Platform.OS_TYPE) {
-            case ANDROID:
-                // ??
-            case FREEBSD:
-            case HPUX:
-            case LINUX:
-            case SUNOS:
-                resStreamLocS = streamLocS;
-                inFormat = "video4linux2";
-                break;
-            case WINDOWS:
-                resStreamLocS = String.valueOf(index);
-                inFormat = "vfwcap";
-                break;
-            case MACOS:
-            case OPENKODE:
-            default:
-                resStreamLocS = streamLocS;
-                inFormat = null;
-                break;            
+                case ANDROID:
+                    // ??
+                case FREEBSD:
+                case HPUX:
+                case LINUX:
+                case SUNOS:
+                    resStreamLocS = dev_video_linux + cameraHostPart;
+                    break;
+                case WINDOWS:
+                    resStreamLocS = cameraHostPart;
+                    break;
+                case MACOS:
+                case OPENKODE:
+                default:
+                    resStreamLocS = streamLocS; // FIXME: ??
+                    break;            
             }
         } else {
             resStreamLocS = streamLocS;
-            inFormat = null;            
         }
         final int aMaxChannelCount = audioSink.getMaxSupportedChannels();
         final int aPrefSampleRate = preferredAudioFormat.sampleRate;
          // setStream(..) issues updateAttributes*(..), and defines avChosenAudioFormat, vid, aid, .. etc
-        natives.setStream0(moviePtr, resStreamLocS, inFormat, vid, aid, aMaxChannelCount, aPrefSampleRate);
+        natives.setStream0(moviePtr, resStreamLocS, isCameraInput, vid, aid, aMaxChannelCount, aPrefSampleRate);
     }
 
     @Override
@@ -300,6 +296,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("initGL: p3 avChosen "+avChosenAudioFormat);
         }
         
+        if( STREAM_ID_NONE == aid ) {
+            audioSink.destroy();
+            audioSink = AudioSinkFactory.createNull();
+        }
         final boolean audioSinkOK = audioSink.init(avChosenAudioFormat, frameDuration, AudioSink.DefaultInitialQueueSize, AudioSink.DefaultQueueGrowAmount, audioQueueLimit);
         if( !audioSinkOK ) {
             System.err.println("AudioSink "+audioSink.getClass().getName()+" does not support "+avChosenAudioFormat+", using Null");
@@ -314,6 +314,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         
         if( null != gl ) {
             int tf, tif=GL.GL_RGBA; // texture format and internal format
+            int tt = GL.GL_UNSIGNED_BYTE;
             switch(vBytesPerPixelPerPlane) {
                 case 1:
                     if( gl.isGL3ES3() ) {
@@ -324,12 +325,20 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                         tf = GL2ES2.GL_ALPHA; tif=GL2ES2.GL_ALPHA; singleTexComp = "a";
                     }
                     break;
-                case 3: tf = GL2ES2.GL_RGB;   tif=GL.GL_RGB;     break;
-                case 4: tf = GL2ES2.GL_RGBA;  tif=GL.GL_RGBA;    break;
+                
+                case 2: if( vPixelFmt == PixelFormat.YUYV422 ) {
+                            // YUYV422: // < packed YUV 4:2:2, 2x 16bpp, Y0 Cb Y1 Cr
+                            // Stuffed into RGBA half width texture
+                            tf = GL2ES2.GL_RGBA; tif=GL2ES2.GL_RGBA; break;
+                        } else {
+                            tf = GL2ES2.GL_RG;   tif=GL2ES2.GL_RG; 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);
             }        
             setTextureFormat(tif, tf);
-            setTextureType(GL.GL_UNSIGNED_BYTE);
+            setTextureType(tt);
         }
     }    
     @Override
@@ -435,7 +444,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      */
     void updateAttributes2(int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
                            int lSz0, int lSz1, int lSz2,
-                           int tWd0, int tWd1, int tWd2, int tH,
+                           int tWd0, int tWd1, int tWd2, int vW, int vH,
                            int audioSampleFmt, int audioSampleRate, 
                            int audioChannels, int audioSamplesPerFrameAndChannel) {
         vPixelFmt = PixelFormat.valueOf(pixFmt);
@@ -446,23 +455,28 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         vTexWidth[0] = tWd0; vTexWidth[1] = tWd1; vTexWidth[2] = tWd2;
         
         switch(vPixelFmt) {
-            case YUV420P:
+            case YUV420P: // < planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+                usesTexLookupShader = true;
                 // YUV420P: Adding U+V on right side of fixed height texture,
                 //          since width is already aligned by decoder.
                 // Y=w*h, Y=w/2*h/2, U=w/2*h/2
                 // w*h + 2 ( w/2 * h/2 ) 
                 // w*h + w*h/2
                 // 2*w/2 * h 
-                texWidth = vTexWidth[0] + vTexWidth[1]; texHeight = tH; 
+                texWidth = vTexWidth[0] + vTexWidth[1]; texHeight = vH;
+                break;
+            case YUYV422: // < packed YUV 4:2:2, 2x 16bpp, Y0 Cb Y1 Cr - stuffed into RGBA half width texture
+                usesTexLookupShader = true;
+                texWidth = vTexWidth[0]; texHeight = vH; 
                 break;
-            // case PIX_FMT_YUYV422:
             case RGB24:
             case BGR24:
             case ARGB:
             case RGBA:
             case ABGR:
             case BGRA:
-                texWidth = vTexWidth[0]; texHeight = tH; 
+                usesTexLookupShader = false;
+                texWidth = vTexWidth[0]; texHeight = vH; 
                 break;
             default: // FIXME: Add more formats !
                 throw new RuntimeException("Unsupported pixelformat: "+vPixelFmt);
@@ -474,7 +488,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         
         if(DEBUG) {
             System.err.println("audio: fmt "+aSampleFmt+", "+avChosenAudioFormat+", aFrameSize/fc "+audioSamplesPerFrameAndChannel);
-            System.err.println("video: fmt "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane);
+            System.err.println("video: fmt "+vW+"x"+vH+", "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane+", usesTexLookupShader "+usesTexLookupShader);
             for(int i=0; i<3; i++) {
                 System.err.println("video: "+i+": "+vTexWidth[i]+"/"+vLinesize[i]);
             }
@@ -494,15 +508,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if(State.Uninitialized == state) {
             throw new IllegalStateException("Instance not initialized: "+this);
         }
-        if(PixelFormat.YUV420P == vPixelFmt) {
+        if( usesTexLookupShader ) {
             if(null != desiredFuncName && desiredFuncName.length()>0) {
-                textureLookupFunctionName = desiredFuncName;
+                texLookupFuncName = desiredFuncName;
             }
-            return textureLookupFunctionName;
+            return texLookupFuncName;
         }
         return super.getTextureLookupFunctionName(desiredFuncName);        
     }
-    private String textureLookupFunctionName = "ffmpegTexture2D";
     
     /**
      * {@inheritDoc}
@@ -515,11 +528,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
       if(State.Uninitialized == state) {
           throw new IllegalStateException("Instance not initialized: "+this);
       }
+      if( !usesTexLookupShader ) {
+          return super.getTextureLookupFragmentShaderImpl();
+      }
       final float tc_w_1 = (float)getWidth() / (float)texWidth;
       switch(vPixelFmt) {
-        case YUV420P:
+        case YUV420P: // < planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
           return
-              "vec4 "+textureLookupFunctionName+"(in "+getTextureSampler2DType()+" image, in vec2 texCoord) {\n"+
+              "vec4 "+texLookupFuncName+"(in "+getTextureSampler2DType()+" image, in vec2 texCoord) {\n"+
               "  vec2 u_off = vec2("+tc_w_1+", 0.0);\n"+
               "  vec2 v_off = vec2("+tc_w_1+", 0.5);\n"+
               "  vec2 tc_half = texCoord*0.5;\n"+
@@ -536,8 +552,30 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
               "  return vec4(r, g, b, 1);\n"+
               "}\n"
           ;
+        case YUYV422: // < packed YUV 4:2:2, 2 x 16bpp, [Y0 Cb] [Y1 Cr]
+                      // Stuffed into RGBA half width texture
+          return
+              "vec4 "+texLookupFuncName+"(in "+getTextureSampler2DType()+" image, in vec2 texCoord) {\n"+
+              "  "+
+              "  float y1,u,y2,v,y,r,g,b;\n"+
+              "  vec2 tc_halfw = vec2(texCoord.x*0.5, texCoord.y);\n"+
+              "  vec4 yuyv = texture2D(image, tc_halfw).rgba;\n"+
+              "  y1 = yuyv.r;\n"+
+              "  u  = yuyv.g;\n"+
+              "  y2 = yuyv.b;\n"+
+              "  v  = yuyv.a;\n"+
+              "  y = mix( y1, y2, mod(gl_FragCoord.x, 2) ); /* avoid branching! */\n"+
+              "  y = 1.1643*(y-0.0625);\n"+
+              "  u = u-0.5;\n"+
+              "  v = v-0.5;\n"+
+              "  r = y+1.5958*v;\n"+
+              "  g = y-0.39173*u-0.81290*v;\n"+
+              "  b = y+2.017*u;\n"+
+              "  return vec4(r, g, b, 1);\n"+
+              "}\n"
+          ;
         default: // FIXME: Add more formats !
-          return super.getTextureLookupFragmentShaderImpl();
+          throw new InternalError("Add proper mapping of: vPixelFmt "+vPixelFmt+", usesTexLookupShader "+usesTexLookupShader);
       }        
     }
     
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
index 89cefbf17..9dd1ac74a 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
@@ -59,7 +59,7 @@ interface FFMPEGNatives {
      * @param aPrefChannelCount
      * @param aPrefSampleRate
      */
-    void setStream0(long moviePtr, String url, String inFormat, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
+    void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
     void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
 
     int getVideoPTS0(long moviePtr);    
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
index 1c0f66e0c..3b2567655 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
@@ -53,7 +53,7 @@ class FFMPEGv08Natives implements FFMPEGNatives {
     public native void destroyInstance0(long moviePtr);
 
     @Override
-    public native void setStream0(long moviePtr, String url, String inFormat, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
+    public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
 
     @Override
     public native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
index 0bc26923c..6c56d3ccb 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
@@ -53,7 +53,7 @@ class FFMPEGv09Natives implements FFMPEGNatives {
     public native void destroyInstance0(long moviePtr);
 
     @Override
-    public native void setStream0(long moviePtr, String url, String inFormat, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
+    public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
 
     @Override
     public native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index d62cff60f..90d795b91 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -154,7 +154,8 @@ typedef struct {
     PTSStats         vPTSStats;
     int32_t          vLinesize[3];  // decoded video linesize in bytes for each plane
     int32_t          vTexWidth[3];  // decoded video tex width in bytes for each plane
-
+    int32_t          vWidth;
+    int32_t          vHeight;
 
     int32_t          aid;
     AVStream*        pAStream;
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c
index 54615c4b9..aaa26cfb1 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c
+++ b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c
@@ -62,6 +62,7 @@ static AVRESAMPLE_VERSION sp_avresample_version;
 // count: 4
 
 // libavcodec
+typedef int (APIENTRYP AVCODEC_REGISTER_ALL)(void);
 typedef int (APIENTRYP AVCODEC_CLOSE)(AVCodecContext *avctx);
 typedef void (APIENTRYP AVCODEC_STRING)(char *buf, int buf_size, AVCodecContext *enc, int encode);
 typedef AVCodec *(APIENTRYP AVCODEC_FIND_DECODER)(enum CodecID id);
@@ -81,6 +82,7 @@ typedef int (APIENTRYP AVCODEC_DECODE_AUDIO4)(AVCodecContext *avctx, AVFrame *fr
 typedef int (APIENTRYP AVCODEC_DECODE_AUDIO3)(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt);  // 52.23.0
 typedef int (APIENTRYP AVCODEC_DECODE_VIDEO2)(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt); // 52.23.0
 
+static AVCODEC_REGISTER_ALL sp_avcodec_register_all;
 static AVCODEC_CLOSE sp_avcodec_close;
 static AVCODEC_STRING sp_avcodec_string;
 static AVCODEC_FIND_DECODER sp_avcodec_find_decoder;
@@ -99,10 +101,11 @@ static AV_FREE_PACKET sp_av_free_packet;
 static AVCODEC_DECODE_AUDIO4 sp_avcodec_decode_audio4;    // 53.25.0
 static AVCODEC_DECODE_AUDIO3 sp_avcodec_decode_audio3;    // 52.23.0
 static AVCODEC_DECODE_VIDEO2 sp_avcodec_decode_video2;    // 52.23.0
-// count: 22
+// count: 23
 
 // libavutil
 typedef void (APIENTRYP AV_FRAME_UNREF)(AVFrame *frame);
+typedef void* (APIENTRYP AV_REALLOC)(void *ptr, size_t size);
 typedef void (APIENTRYP AV_FREE)(void *ptr);
 typedef int (APIENTRYP AV_GET_BITS_PER_PIXEL)(const AVPixFmtDescriptor *pixdesc);
 typedef int (APIENTRYP AV_SAMPLES_GET_BUFFER_SIZE)(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align);
@@ -110,12 +113,13 @@ typedef int (APIENTRYP AV_GET_BYTES_PER_SAMPLE)(enum AVSampleFormat sample_fmt);
 typedef int (APIENTRYP AV_OPT_SET_INT)(void *obj, const char *name, int64_t val, int search_flags);
 static const AVPixFmtDescriptor* sp_av_pix_fmt_descriptors;
 static AV_FRAME_UNREF sp_av_frame_unref;
+static AV_REALLOC sp_av_realloc;
 static AV_FREE sp_av_free;
 static AV_GET_BITS_PER_PIXEL sp_av_get_bits_per_pixel;
 static AV_SAMPLES_GET_BUFFER_SIZE sp_av_samples_get_buffer_size;
 static AV_GET_BYTES_PER_SAMPLE sp_av_get_bytes_per_sample;
 static AV_OPT_SET_INT sp_av_opt_set_int;
-// count: 28
+// count: 30
 
 // libavformat
 typedef AVFormatContext *(APIENTRYP AVFORMAT_ALLOC_CONTEXT)(void);
@@ -153,7 +157,12 @@ static AVFORMAT_NETWORK_INIT sp_avformat_network_init;            // 53.13.0
 static AVFORMAT_NETWORK_DEINIT sp_avformat_network_deinit;        // 53.13.0
 static AVFORMAT_FIND_STREAM_INFO sp_avformat_find_stream_info;    // 53.3.0
 static AV_FIND_STREAM_INFO sp_av_find_stream_info;
-// count: 46
+// count: 47
+
+// libavdevice [53.0.0]
+typedef int (APIENTRYP AVDEVICE_REGISTER_ALL)(void);
+static AVDEVICE_REGISTER_ALL sp_avdevice_register_all;
+// count: 49
 
 // libavresample [1.0.1]
 typedef AVAudioResampleContext* (APIENTRYP AVRESAMPLE_ALLOC_CONTEXT)(void);  // 1.0.1
@@ -168,9 +177,9 @@ static AVRESAMPLE_OPEN sp_avresample_open;
 static AVRESAMPLE_CLOSE sp_avresample_close;
 static AVRESAMPLE_FREE sp_avresample_free;
 static AVRESAMPLE_CONVERT sp_avresample_convert;
-// count: 51
+// count: 54
 
-#define SYMBOL_COUNT 51
+#define SYMBOL_COUNT 54
 
 JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
   (JNIEnv *env, jobject instance, jobject jSymbols, jint count)
@@ -194,6 +203,7 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
     sp_avresample_version = (AVRESAMPLE_VERSION) (intptr_t) symbols[i++];
     // count:  4
 
+    sp_avcodec_register_all = (AVCODEC_REGISTER_ALL)  (intptr_t) symbols[i++];
     sp_avcodec_close = (AVCODEC_CLOSE)  (intptr_t) symbols[i++];
     sp_avcodec_string = (AVCODEC_STRING) (intptr_t) symbols[i++];
     sp_avcodec_find_decoder = (AVCODEC_FIND_DECODER) (intptr_t) symbols[i++];
@@ -212,16 +222,17 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
     sp_avcodec_decode_audio4 = (AVCODEC_DECODE_AUDIO4) (intptr_t) symbols[i++];
     sp_avcodec_decode_audio3 = (AVCODEC_DECODE_AUDIO3) (intptr_t) symbols[i++];
     sp_avcodec_decode_video2 = (AVCODEC_DECODE_VIDEO2) (intptr_t) symbols[i++];
-    // count: 22
+    // count: 23
 
     sp_av_pix_fmt_descriptors = (const AVPixFmtDescriptor*)  (intptr_t) symbols[i++];
     sp_av_frame_unref = (AV_FRAME_UNREF) (intptr_t) symbols[i++];
+    sp_av_realloc = (AV_REALLOC) (intptr_t) symbols[i++];
     sp_av_free = (AV_FREE) (intptr_t) symbols[i++];
     sp_av_get_bits_per_pixel = (AV_GET_BITS_PER_PIXEL) (intptr_t) symbols[i++];
     sp_av_samples_get_buffer_size = (AV_SAMPLES_GET_BUFFER_SIZE) (intptr_t) symbols[i++];
     sp_av_get_bytes_per_sample = (AV_GET_BYTES_PER_SAMPLE) (intptr_t) symbols[i++];
     sp_av_opt_set_int = (AV_OPT_SET_INT) (intptr_t) symbols[i++];
-    // count: 29
+    // count: 31
 
     sp_avformat_alloc_context = (AVFORMAT_ALLOC_CONTEXT) (intptr_t) symbols[i++];;
     sp_avformat_free_context = (AVFORMAT_FREE_CONTEXT) (intptr_t) symbols[i++];
@@ -240,14 +251,17 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
     sp_avformat_network_deinit = (AVFORMAT_NETWORK_DEINIT) (intptr_t) symbols[i++];
     sp_avformat_find_stream_info = (AVFORMAT_FIND_STREAM_INFO) (intptr_t) symbols[i++];
     sp_av_find_stream_info = (AV_FIND_STREAM_INFO) (intptr_t) symbols[i++];
-    // count: 46
+    // count: 48
+
+    sp_avdevice_register_all = (AVDEVICE_REGISTER_ALL) (intptr_t) symbols[i++];
+    // count: 49
 
     sp_avresample_alloc_context = (AVRESAMPLE_ALLOC_CONTEXT) (intptr_t) symbols[i++];
     sp_avresample_open = (AVRESAMPLE_OPEN) (intptr_t) symbols[i++];
     sp_avresample_close = (AVRESAMPLE_CLOSE) (intptr_t) symbols[i++];
     sp_avresample_free = (AVRESAMPLE_FREE) (intptr_t) symbols[i++];
     sp_avresample_convert = (AVRESAMPLE_CONVERT) (intptr_t) symbols[i++];
-    // count: 51
+    // count: 54
 
     (*env)->ReleasePrimitiveArrayCritical(env, jSymbols, symbols, 0);
 
@@ -270,23 +284,16 @@ static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasic
     // int shallBeDetached = 0;
     // JNIEnv  * env = JoglCommon_GetJNIEnv (&shallBeDetached); 
     if(NULL!=env) {
-        int32_t w, h;
-        if( NULL != pAV->pVCodecCtx ) {
-            // FIXME: Libav Binary compatibility! JAU01
-            w = pAV->pVCodecCtx->width; h = pAV->pVCodecCtx->height;
-        } else {
-            w = 0;                      h = 0;
-        }
-
         (*env)->CallVoidMethod(env, pAV->ffmpegMediaPlayer, jni_mid_updateAttributes2,
                                pAV->vPixFmt, pAV->vBufferPlanes, 
                                pAV->vBitsPerPixel, pAV->vBytesPerPixelPerPlane,
                                pAV->vLinesize[0], pAV->vLinesize[1], pAV->vLinesize[2],
-                               pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2], h,
+                               pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2],
+                               pAV->vWidth, pAV->vHeight,
                                pAV->aSampleFmtOut, pAV->aSampleRateOut, pAV->aChannelsOut, pAV->aFrameSize);
         (*env)->CallVoidMethod(env, pAV->ffmpegMediaPlayer, jni_mid_updateAttributes1,
                                pAV->vid, pAV->aid,
-                               w, h, 
+                               pAV->vWidth, pAV->vHeight,
                                pAV->bps_stream, pAV->bps_video, pAV->bps_audio,
                                pAV->fps, pAV->frames_video, pAV->frames_audio, pAV->duration,
                                (*env)->NewStringUTF(env, pAV->vcodec),
@@ -455,7 +462,7 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initIDs0)
 
     jni_mid_pushSound = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "pushSound", "(Ljava/nio/ByteBuffer;II)V");
     jni_mid_updateAttributes1 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIIIFIIILjava/lang/String;Ljava/lang/String;)V");
-    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIIII)V");
+    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIIIII)V");
     jni_mid_isAudioFormatSupported = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "isAudioFormatSupported", "(III)Z");
 
     if(jni_mid_pushSound == NULL ||
@@ -495,6 +502,10 @@ JNIEXPORT jlong JNICALL FF_FUNC(createInstance0)
     #endif
 
     // Register all formats and codecs
+    sp_avcodec_register_all();
+    if(HAS_FUNC(sp_avdevice_register_all)) {
+        sp_avdevice_register_all();
+    }
     sp_av_register_all();
     // Network too ..
     if(HAS_FUNC(sp_avformat_network_init)) {
@@ -536,8 +547,47 @@ static uint64_t getDefaultAudioChannelLayout(int channelCount) {
 static void initPTSStats(PTSStats *ptsStats);
 static int64_t evalPTS(PTSStats *ptsStats, int64_t inPTS, int64_t inDTS);
 
+static AVInputFormat* tryAVInputFormat(const char * name, int verbose) {
+    AVInputFormat* inFmt = sp_av_find_input_format(name);
+    if( verbose) {
+        if ( inFmt == NULL ) {
+            fprintf(stderr, "Warning: Could not find input format '%s'\n", name);
+        } else {
+            fprintf(stderr, "Info: Found input format '%s'\n", name);
+        }
+    }
+    return inFmt;
+}
+static const char * inFmtNames[] = {
+    "video4linux2",
+    "video4linux",
+    "vfwcap",
+    "dshow",
+    "mpg",
+    "yuv2",
+    "mjpeg",
+    "avi",
+    "wmv",
+    "libx264",
+    "h264",
+    "mpegts"
+};
+static AVInputFormat* findAVInputFormat(int verbose) {
+    AVInputFormat* inFmt = NULL;
+    const char *inFmtName;
+    int i=0;
+    do {
+        inFmtName = inFmtNames[i++];
+        if( NULL == inFmtName ) {
+            break;
+        }
+        inFmt = tryAVInputFormat(inFmtName, verbose);
+    } while ( NULL == inFmt );
+    return inFmt;
+}
+
 JNIEXPORT void JNICALL FF_FUNC(setStream0)
-  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jstring jInFmtStr, jint vid, jint aid,
+  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jboolean jIsCameraInput, jint vid, jint aid,
    jint aMaxChannelCount, jint aPrefSampleRate)
 {
     int res, i;
@@ -552,15 +602,8 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
     pAV->pFormatCtx = sp_avformat_alloc_context();
 
     // Open video file
-    AVInputFormat *inFmt = NULL;
-    const char *inFmtStr = NULL != jInFmtStr ? (*env)->GetStringUTFChars(env, jInFmtStr, &iscopy) : NULL;
-    if( NULL != inFmtStr ) {
-        inFmt = sp_av_find_input_format(inFmtStr);
-        if( NULL == inFmt ) {
-            fprintf(stderr, "Warning: Could not find input format '%s'\n", inFmtStr);
-        }
-        (*env)->ReleaseStringChars(env, jInFmtStr, (const jchar *)inFmtStr);
-    }
+    AVInputFormat* inFmt = jIsCameraInput ? findAVInputFormat(pAV->verbose) : NULL;
+
     const char *urlPath = (*env)->GetStringUTFChars(env, jURL, &iscopy);
     res = sp_avformat_open_input(&pAV->pFormatCtx, urlPath, inFmt, NULL);
     if(res != 0) {
@@ -838,22 +881,26 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
         }
         pAV->frames_video = pAV->pVStream->nb_frames;
             
-        if( pAV->verbose ) {
-            fprintf(stderr, "V frame_size %d, frame_number %d, r_frame_rate %f %d/%d, avg_frame_rate %f %d/%d, nb_frames %d, \n", 
-                pAV->pVCodecCtx->frame_size, pAV->pVCodecCtx->frame_number, 
-                my_av_q2f(pAV->pVStream->r_frame_rate), pAV->pVStream->r_frame_rate.num, pAV->pVStream->r_frame_rate.den, 
-                my_av_q2f(pAV->pVStream->avg_frame_rate), pAV->pVStream->avg_frame_rate.num, pAV->pVStream->avg_frame_rate.den,
-                pAV->pVStream->nb_frames);
-        }
-
         // Allocate video frame
         // FIXME: Libav Binary compatibility! JAU01
+        pAV->vWidth = pAV->pVCodecCtx->width;
+        pAV->vHeight = pAV->pVCodecCtx->height;
         pAV->vPixFmt = pAV->pVCodecCtx->pix_fmt;
         {   
             AVPixFmtDescriptor pixDesc = sp_av_pix_fmt_descriptors[pAV->vPixFmt];
             pAV->vBitsPerPixel = sp_av_get_bits_per_pixel(&pixDesc);
             pAV->vBufferPlanes = my_getPlaneCount(&pixDesc);
         }
+
+        if( pAV->verbose ) {
+            fprintf(stderr, "V frame_size %d, frame_number %d, r_frame_rate %f %d/%d, avg_frame_rate %f %d/%d, nb_frames %d, size %dx%d, fmt 0x%X, bpp %d, planes %d\n", 
+                pAV->pVCodecCtx->frame_size, pAV->pVCodecCtx->frame_number, 
+                my_av_q2f(pAV->pVStream->r_frame_rate), pAV->pVStream->r_frame_rate.num, pAV->pVStream->r_frame_rate.den, 
+                my_av_q2f(pAV->pVStream->avg_frame_rate), pAV->pVStream->avg_frame_rate.num, pAV->pVStream->avg_frame_rate.den,
+                pAV->pVStream->nb_frames,
+                pAV->vWidth, pAV->vHeight, pAV->vPixFmt, pAV->vBitsPerPixel, pAV->vBufferPlanes);
+        }
+
         pAV->pVFrame=sp_avcodec_alloc_frame();
         if( pAV->pVFrame == NULL ) {
             JoglCommon_throwNewRuntimeException(env, "Couldn't alloc video frame");
@@ -867,10 +914,20 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
             } else {
                 pAV->vBytesPerPixelPerPlane = 1;
             }
-            for(i=0; i<3; i++) {
-                // FIXME: Libav Binary compatibility! JAU01
-                pAV->vLinesize[i] = pAV->pVFrame->linesize[i];
-                pAV->vTexWidth[i] = pAV->vLinesize[i] / pAV->vBytesPerPixelPerPlane ;
+            if( pAV->vBufferPlanes > 1 ) {
+                for(i=0; i<3; i++) {
+                    // FIXME: Libav Binary compatibility! JAU01
+                    pAV->vLinesize[i] = pAV->pVFrame->linesize[i];
+                    pAV->vTexWidth[i] = pAV->vLinesize[i] / pAV->vBytesPerPixelPerPlane ;
+                }
+            } else {
+                pAV->vLinesize[0] = pAV->pVCodecCtx->width * pAV->vBytesPerPixelPerPlane;
+                if( pAV->vPixFmt == PIX_FMT_YUYV422 ) {
+                    // Stuff 2x 16bpp (YUYV) into one RGBA pixel!
+                    pAV->vTexWidth[0] = pAV->pVCodecCtx->width / 2;
+                } else {
+                    pAV->vTexWidth[0] = pAV->pVCodecCtx->width;
+                }
             }
             sp_avcodec_default_release_buffer(pAV->pVCodecCtx, pAV->pVFrame);
         } else {
@@ -896,10 +953,10 @@ JNIEXPORT void JNICALL FF_FUNC(setGLFuncs0)
 }
 
 #if 0
-#define DBG_TEXSUBIMG2D_a(c,p,i) fprintf(stderr, "TexSubImage2D.%c offset %d / %d, size %d x %d, ", c, p->pVCodecCtx->width, p->pVCodecCtx->height/2, p->vTexWidth[i], p->pVCodecCtx->height/2)
+#define DBG_TEXSUBIMG2D_a(c,p,d,i) fprintf(stderr, "TexSubImage2D.%c offset %d / %d, size %d x %d, ", c, p->pVCodecCtx->width, p->pVCodecCtx->height/d, p->vTexWidth[i], p->pVCodecCtx->height/d)
 #define DBG_TEXSUBIMG2D_b(p) fprintf(stderr, "err 0x%X\n", pAV->procAddrGLGetError())
 #else
-#define DBG_TEXSUBIMG2D_a(c,p,i)
+#define DBG_TEXSUBIMG2D_a(c,p,d,i)
 #define DBG_TEXSUBIMG2D_b(p)
 #endif
 
@@ -911,17 +968,22 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
     AVPacket packet;
     int frameDecoded;
     jint resPTS = INVALID_PTS;
+    uint8_t * pkt_odata;
+    int pkt_osize;
 
+    packet.data = NULL; // minimum
+    packet.size = 0;    // requirement
     sp_av_init_packet(&packet);
 
     const int avRes = sp_av_read_frame(pAV->pFormatCtx, &packet);
+    pkt_odata = packet.data;
+    pkt_osize = packet.size;
     if( AVERROR_EOF == avRes || ( pAV->pFormatCtx->pb && pAV->pFormatCtx->pb->eof_reached ) ) {
         resPTS = END_OF_STREAM_PTS;
     } else if( 0 <= avRes ) {
-        /**
         if( pAV->verbose ) {
             fprintf(stderr, "P: ptr %p, size %d\n", packet.data, packet.size);
-        } */
+        }
         if(packet.stream_index==pAV->aid) {
             // Decode audio frame
             if(NULL == pAV->pAFrames) { // no audio registered
@@ -932,9 +994,6 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
             int flush_complete = 0;
             for ( frameCount=0; 0 < packet.size || 0 == frameCount; frameCount++ ) {
                 int len1;
-                if (flush_complete) {
-                    break;
-                }
                 NIOBuffer_t * pNIOBufferCurrent = &pAV->pANIOBuffers[pAV->aFrameCurrent];
                 AVFrame* pAFrameCurrent = pAV->pAFrames[pAV->aFrameCurrent];
                 if( pAV->useRefCountedFrames ) {
@@ -942,6 +1001,10 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
                     pAV->aFrameCurrent = ( pAV->aFrameCurrent + 1 ) % pAV->aFrameCount ;
                 }
                 sp_avcodec_get_frame_defaults(pAFrameCurrent);
+
+                if (flush_complete) {
+                    break;
+                }
                 if(HAS_FUNC(sp_avcodec_decode_audio4)) {
                     len1 = sp_avcodec_decode_audio4(pAV->pACodecCtx, pAFrameCurrent, &frameDecoded, &packet);
                 } else {
@@ -1013,7 +1076,7 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
                                                                  nb_samples,
                                                                  pAV->aSampleFmtOut, 0 /* align */);
 
-                        tmp_out = av_realloc(pAV->aResampleBuffer, out_size);
+                        tmp_out = sp_av_realloc(pAV->aResampleBuffer, out_size);
                         if (!tmp_out) {
                             JoglCommon_throwNewRuntimeException(env, "Couldn't alloc resample buffer of size %d", out_size);
                             return;
@@ -1066,10 +1129,10 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
             int flush_complete = 0;
             for ( frameCount=0; 0 < packet.size || 0 == frameCount; frameCount++ ) {
                 int len1;
+                sp_avcodec_get_frame_defaults(pAV->pVFrame);
                 if (flush_complete) {
                     break;
                 }
-                sp_avcodec_get_frame_defaults(pAV->pVFrame);
                 len1 = sp_avcodec_decode_video2(pAV->pVCodecCtx, pAV->pVFrame, &frameDecoded, &packet);
                 if (len1 < 0) {
                     // if error, we skip the frame
@@ -1116,7 +1179,7 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
 
                 // 1st plane or complete packed frame
                 // FIXME: Libav Binary compatibility! JAU01
-                DBG_TEXSUBIMG2D_a('Y',pAV,0);
+                DBG_TEXSUBIMG2D_a('Y',pAV,1,0);
                 pAV->procAddrGLTexSubImage2D(texTarget, 0, 
                                         0,                 0, 
                                         pAV->vTexWidth[0], pAV->pVCodecCtx->height, 
@@ -1126,7 +1189,7 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
                 if(pAV->vPixFmt == PIX_FMT_YUV420P) {
                     // U plane
                     // FIXME: Libav Binary compatibility! JAU01
-                    DBG_TEXSUBIMG2D_a('U',pAV,1);
+                    DBG_TEXSUBIMG2D_a('U',pAV,2,1);
                     pAV->procAddrGLTexSubImage2D(texTarget, 0, 
                                             pAV->pVCodecCtx->width, 0,
                                             pAV->vTexWidth[1],      pAV->pVCodecCtx->height/2, 
@@ -1134,7 +1197,7 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
                     DBG_TEXSUBIMG2D_b(pAV);
                     // V plane
                     // FIXME: Libav Binary compatibility! JAU01
-                    DBG_TEXSUBIMG2D_a('V',pAV,2);
+                    DBG_TEXSUBIMG2D_a('V',pAV,2,2);
                     pAV->procAddrGLTexSubImage2D(texTarget, 0, 
                                             pAV->pVCodecCtx->width, pAV->pVCodecCtx->height/2,
                                             pAV->vTexWidth[2],      pAV->pVCodecCtx->height/2, 
@@ -1148,11 +1211,10 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
                 }
             }
         }
-
-        // Free the packet that was allocated by av_read_frame
-        // This code cause a double free and have been commented out.
-        // TODO: check what release the packets memory. 
-        // sp_av_free_packet(&packet);
+        // restore orig pointer and size values, we may have moved along within packet
+        packet.data = pkt_odata;
+        packet.size = pkt_osize;
+        sp_av_free_packet(&packet);
     }
     return resPTS;
 }
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
new file mode 100644
index 000000000..87e8d7ecc
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
@@ -0,0 +1,87 @@
+/**
+ * Copyright 2012 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.android;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+
+public class MovieCubeActivityLauncher1a extends LauncherUtil.BaseActivityLauncher {
+
+    static String demo = "com.jogamp.opengl.test.android.MovieCubeActivity0";
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
+    
+    @Override
+    public void init() {
+       final OrderedProperties props = getProperties();       
+       props.setProperty("jnlp.media0_url2", "camera://0");
+       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
+       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
+       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       // props.setProperty("jogamp.debug.JNILibLoader", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
+       // props.setProperty("jogamp.debug.IOUtil", "true");       
+       // props.setProperty("jogamp.debug.Lock", "true");
+       // props.setProperty("jogamp.debug.Lock.TraceLock", "true");
+       // props.setProperty("nativewindow.debug", "all");
+       // props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
+       // props.setProperty("jogl.debug", "all");
+       // props.setProperty("jogl.debug.GLProfile", "true");
+       // props.setProperty("jogl.debug.GLDrawable", "true");
+       // props.setProperty("jogl.debug.GLContext", "true");
+       props.setProperty("jogl.debug.GLSLCode", "true");
+       props.setProperty("jogl.debug.GLMediaPlayer", "true");
+       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+       // props.setProperty("jogl.debug.GLSLState", "true");
+       // props.setProperty("jogl.debug.DebugGL", "true");
+       // props.setProperty("jogl.debug.TraceGL", "true");
+       // props.setProperty("newt.debug", "all");
+       // props.setProperty("newt.debug.Window", "true");
+       // props.setProperty("newt.debug.Window.MouseEvent", "true");
+       // props.setProperty("newt.debug.Window.KeyEvent", "true");   
+       // props.setProperty("jogamp.debug.IOUtil", "true");
+    }
+    
+    @Override
+    public String getActivityName() {
+        return demo;
+    }
+    
+    @Override
+    public List<String> getSysPackages() {
+        return Arrays.asList(sys_pkgs);
+    }
+    
+    @Override
+    public List<String> getUsrPackages() {
+        return Arrays.asList(usr_pkgs);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java
new file mode 100644
index 000000000..f7a896a90
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java
@@ -0,0 +1,87 @@
+/**
+ * Copyright 2012 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.android;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+
+public class MovieCubeActivityLauncher1b extends LauncherUtil.BaseActivityLauncher {
+
+    static String demo = "com.jogamp.opengl.test.android.MovieCubeActivity0";
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
+    
+    @Override
+    public void init() {
+       final OrderedProperties props = getProperties();       
+       props.setProperty("jnlp.media0_url2", "camera://1");
+       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
+       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
+       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       // props.setProperty("jogamp.debug.JNILibLoader", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
+       // props.setProperty("jogamp.debug.IOUtil", "true");       
+       // props.setProperty("jogamp.debug.Lock", "true");
+       // props.setProperty("jogamp.debug.Lock.TraceLock", "true");
+       // props.setProperty("nativewindow.debug", "all");
+       // props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
+       // props.setProperty("jogl.debug", "all");
+       // props.setProperty("jogl.debug.GLProfile", "true");
+       // props.setProperty("jogl.debug.GLDrawable", "true");
+       // props.setProperty("jogl.debug.GLContext", "true");
+       props.setProperty("jogl.debug.GLSLCode", "true");
+       props.setProperty("jogl.debug.GLMediaPlayer", "true");
+       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+       // props.setProperty("jogl.debug.GLSLState", "true");
+       // props.setProperty("jogl.debug.DebugGL", "true");
+       // props.setProperty("jogl.debug.TraceGL", "true");
+       // props.setProperty("newt.debug", "all");
+       // props.setProperty("newt.debug.Window", "true");
+       // props.setProperty("newt.debug.Window.MouseEvent", "true");
+       // props.setProperty("newt.debug.Window.KeyEvent", "true");   
+       // props.setProperty("jogamp.debug.IOUtil", "true");
+    }
+    
+    @Override
+    public String getActivityName() {
+        return demo;
+    }
+    
+    @Override
+    public List<String> getSysPackages() {
+        return Arrays.asList(sys_pkgs);
+    }
+    
+    @Override
+    public List<String> getUsrPackages() {
+        return Arrays.asList(usr_pkgs);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00a.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00a.java
deleted file mode 100644
index e70e48ca3..000000000
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00a.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Copyright 2012 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.opengl.test.android;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
-
-public class MovieSimpleActivityLauncher00a extends LauncherUtil.BaseActivityLauncher {
-
-    static String demo = "com.jogamp.opengl.test.android.MovieSimpleActivity0";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
-    static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
-    @Override
-    public void init() {
-       final OrderedProperties props = getProperties();       
-       props.setProperty("jnlp.mplayer.nozoom",     "true");
-       props.setProperty("jnlp.mplayer.hud",        "false");
-       props.setProperty("jnlp.mplayer.hud.shared", "false");
-       // props.setProperty("jnlp.media0_url2", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v");
-       props.setProperty("jnlp.media0_url2", "http://video.webmfiles.org/big-buck-bunny_trailer.webm");
-       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
-       // props.setProperty("jogamp.debug.JNILibLoader", "true");
-       // props.setProperty("jogamp.debug.NativeLibrary", "true");
-       // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
-       // props.setProperty("jogamp.debug.IOUtil", "true");       
-       // props.setProperty("nativewindow.debug", "all");
-       props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
-       // props.setProperty("jogl.debug", "all");
-       // props.setProperty("jogl.debug.GLProfile", "true");
-       props.setProperty("jogl.debug.GLDrawable", "true");
-       props.setProperty("jogl.debug.GLContext", "true");
-       props.setProperty("jogl.debug.GLSLCode", "true");
-       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
-       // props.setProperty("jogl.debug.GLSLState", "true");
-       // props.setProperty("jogl.debug.DebugGL", "true");
-       // props.setProperty("jogl.debug.TraceGL", "true");
-       // props.setProperty("newt.debug", "all");
-       // props.setProperty("newt.debug.Window", "true");
-       // props.setProperty("newt.debug.Window.MouseEvent", "true");
-       // props.setProperty("newt.debug.Window.KeyEvent", "true");
-       props.setProperty("jogamp.debug.IOUtil", "true");
-    }
-    
-    @Override
-    public String getActivityName() {
-        return demo;
-    }
-    @Override
-    public List<String> getSysPackages() {
-        return Arrays.asList(sys_pkgs);
-    }
-    
-    @Override
-    public List<String> getUsrPackages() {
-        return Arrays.asList(usr_pkgs);
-    }
-}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java
new file mode 100644
index 000000000..2254b649a
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright 2012 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.android;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+
+public class MovieSimpleActivityLauncher00c extends LauncherUtil.BaseActivityLauncher {
+
+    static String demo = "com.jogamp.opengl.test.android.MovieSimpleActivity1";
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
+    
+    @Override
+    public void init() {
+       final OrderedProperties props = getProperties();       
+       props.setProperty("jnlp.mplayer.nozoom",     "false");
+       props.setProperty("jnlp.mplayer.hud",        "false");
+       props.setProperty("jnlp.mplayer.hud.shared", "false");
+       props.setProperty("jnlp.media0_url2", "camera://0");
+       props.setProperty("jnlp.media0_url1", "http://video.webmfiles.org/big-buck-bunny_trailer.webm");
+       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
+       // props.setProperty("jogamp.debug.JNILibLoader", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
+       // props.setProperty("jogamp.debug.IOUtil", "true");       
+       // props.setProperty("nativewindow.debug", "all");
+       // props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
+       // props.setProperty("jogl.debug", "all");
+       // props.setProperty("jogl.debug.GLProfile", "true");
+       // props.setProperty("jogl.debug.GLDrawable", "true");
+       // props.setProperty("jogl.debug.GLContext", "true");
+       props.setProperty("jogl.debug.GLSLCode", "true");
+       props.setProperty("jogl.debug.GLMediaPlayer", "true");
+       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       // props.setProperty("jogl.debug.GLSLState", "true");
+       // props.setProperty("jogl.debug.DebugGL", "true");
+       // props.setProperty("jogl.debug.TraceGL", "true");
+       // props.setProperty("newt.debug", "all");
+       // props.setProperty("newt.debug.Window", "true");
+       // props.setProperty("newt.debug.Window.MouseEvent", "true");
+       // props.setProperty("newt.debug.Window.KeyEvent", "true");
+       // props.setProperty("jogamp.debug.IOUtil", "true");
+    }
+    
+    @Override
+    public String getActivityName() {
+        return demo;
+    }
+    @Override
+    public List<String> getSysPackages() {
+        return Arrays.asList(sys_pkgs);
+    }
+    
+    @Override
+    public List<String> getUsrPackages() {
+        return Arrays.asList(usr_pkgs);
+    }
+}
-- 
cgit v1.2.3


From eca6a5cb1e2beda84dfbafc31ed225e272f4f3fb Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 29 Aug 2013 22:46:57 +0200
Subject: Enhance GLMediaPlayer: Full FFMPeg support, 'dshow' camera support on
 windows, 2 more pixel formats, fail-safe data handling

- add support for ffmpeg 2 / libav 10 -> lavc55_lavf55_lavu52_lavr01

- add support for ffmpeg libswresample (similar to libavresample)

- handle BGRA (GL type) and BGR24 (texture shader)

- Change Camera URI semantics, drop 'host' and use 'path' for camera ID
  and use 'query' for options.

- add support for Window's DShow camera selection
  - our camera id -> index of list of video-input devices,
    this gives us same behavior as w/ Linux
  - requires windows libs: strmiids, uuid, ole32, oleaut32
  - Compiles w/ MingW64, works w/ libav/ffmpeg
  - TODO: test compilation w/ MingW 32bit !

- don't push data to texture if (linesize <= 0)
  this may happen due to buggy decoder / setup ..

Tested manually on GNU/Linux x64 and Windows x64:
  - GNU/Linux libav 0.8, libav 9, libav 10, ffmpeg 1.2, ffmpeg 2.0
  - Windows   libav 0.8, libav 9, ffmpeg 2.0
  - videos and camera
---
 make/build-jogl.xml                                |   22 +-
 make/scripts/make.jogl.all.linux-x86_64.sh         |    1 -
 make/scripts/tests-x64-dbg.bat                     |    5 +-
 make/scripts/tests-x64.bat                         |    5 +-
 make/scripts/tests-x64.sh                          |    9 +-
 make/scripts/tests.sh                              |    4 +-
 .../libswresample/swresample.h                     |  311 ++
 .../libswresample/version.h                        |   45 +
 .../libavcodec/avcodec.h                           | 4277 ++++++++++++++++++++
 .../lavc55_lavf55_lavu52_lavr01/libavcodec/avfft.h |  116 +
 .../lavc55_lavf55_lavu52_lavr01/libavcodec/dxva2.h |   88 +
 .../lavc55_lavf55_lavu52_lavr01/libavcodec/vaapi.h |  173 +
 .../lavc55_lavf55_lavu52_lavr01/libavcodec/vda.h   |  142 +
 .../lavc55_lavf55_lavu52_lavr01/libavcodec/vdpau.h |  160 +
 .../libavcodec/version.h                           |   77 +
 .../lavc55_lavf55_lavu52_lavr01/libavcodec/xvmc.h  |  168 +
 .../libavformat/avformat.h                         | 1708 ++++++++
 .../lavc55_lavf55_lavu52_lavr01/libavformat/avio.h |  433 ++
 .../libavformat/version.h                          |   52 +
 .../libavresample/avresample.h                     |  409 ++
 .../libavresample/version.h                        |   52 +
 .../libavutil/adler32.h                            |   43 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/aes.h    |   67 +
 .../libavutil/attributes.h                         |  122 +
 .../libavutil/audio_fifo.h                         |  146 +
 .../libavutil/audioconvert.h                       |    6 +
 .../libavutil/avassert.h                           |   66 +
 .../libavutil/avconfig.h                           |    6 +
 .../libavutil/avstring.h                           |  226 ++
 .../lavc55_lavf55_lavu52_lavr01/libavutil/avutil.h |  308 ++
 .../lavc55_lavf55_lavu52_lavr01/libavutil/base64.h |   65 +
 .../libavutil/blowfish.h                           |   76 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/bswap.h  |  109 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/buffer.h |  267 ++
 .../libavutil/channel_layout.h                     |  182 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/common.h |  405 ++
 .../lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h    |   84 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/crc.h    |   74 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/dict.h   |  146 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/error.h  |   83 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/eval.h   |  113 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h   |  131 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/file.h   |   54 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/frame.h  |  491 +++
 .../lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h   |   95 +
 .../libavutil/imgutils.h                           |  138 +
 .../libavutil/intfloat.h                           |   77 +
 .../libavutil/intfloat_readwrite.h                 |   40 +
 .../libavutil/intreadwrite.h                       |  549 +++
 .../lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h    |   62 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/log.h    |  173 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h    |   66 +
 .../libavutil/mathematics.h                        |  111 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/md5.h    |   51 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/mem.h    |  209 +
 .../libavutil/old_pix_fmts.h                       |  132 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/opt.h    |  516 +++
 .../libavutil/parseutils.h                         |  124 +
 .../libavutil/pixdesc.h                            |  276 ++
 .../lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h |  277 ++
 .../libavutil/random_seed.h                        |   44 +
 .../libavutil/rational.h                           |  155 +
 .../libavutil/samplefmt.h                          |  220 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/sha.h    |   76 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/time.h   |   39 +
 .../libavutil/version.h                            |   96 +
 .../lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h   |   61 +
 .../libswresample/swresample.h                     |  311 ++
 .../libswresample/version.h                        |   45 +
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |   24 +-
 .../android/av/AndroidGLMediaPlayerAPI14.java      |    4 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   |   45 +-
 .../av/impl/FFMPEGDynamicLibraryBundleInfo.java    |  231 +-
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     |  105 +-
 .../jogamp/opengl/util/av/impl/FFMPEGNatives.java  |   19 +-
 .../opengl/util/av/impl/FFMPEGStaticNatives.java   |    5 +-
 .../opengl/util/av/impl/FFMPEGv08Natives.java      |    5 +-
 .../opengl/util/av/impl/FFMPEGv09Natives.java      |    5 +-
 .../opengl/util/av/impl/FFMPEGv10Natives.java      |   81 +
 src/jogl/native/libav/ffmpeg_dshow.c               |  209 +
 src/jogl/native/libav/ffmpeg_dshow.h               |   47 +
 src/jogl/native/libav/ffmpeg_impl_template.c       |  416 +-
 .../libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c     |   33 +
 src/jogl/native/libav/ffmpeg_static.c              |   32 +-
 src/jogl/native/libav/ffmpeg_tool.h                |   37 +-
 85 files changed, 16459 insertions(+), 309 deletions(-)
 create mode 100644 make/stub_includes/libav/lavc54_lavf54_lavu52_lavr01/libswresample/swresample.h
 create mode 100644 make/stub_includes/libav/lavc54_lavf54_lavu52_lavr01/libswresample/version.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avcodec.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avfft.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/dxva2.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vaapi.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vda.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vdpau.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/version.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/xvmc.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avformat.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avio.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/version.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/avresample.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/version.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/adler32.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/aes.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/attributes.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audio_fifo.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audioconvert.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avassert.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avconfig.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avstring.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avutil.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/base64.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/blowfish.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/bswap.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/buffer.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/channel_layout.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/common.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/crc.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/eval.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/file.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/imgutils.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intreadwrite.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mathematics.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/md5.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/opt.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/parseutils.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/random_seed.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/rational.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/samplefmt.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/sha.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/time.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h
 create mode 100644 make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h
 create mode 100644 src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
 create mode 100644 src/jogl/native/libav/ffmpeg_dshow.c
 create mode 100644 src/jogl/native/libav/ffmpeg_dshow.h
 create mode 100644 src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index 582e8b654..5a461359a 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -1225,12 +1225,12 @@
 
       <linker id="linker.cfg.win32.mingw.jogl" extends="linker.cfg.win32.mingw">
         <linkerarg value="-Wl,--kill-at" />        <!-- remove @ from function names -->
-        <syslibset libs="gdi32, kernel32"/>
+        <syslibset libs="gdi32, kernel32, strmiids, uuid, ole32, oleaut32"/> <!-- last 4 for dshow video input query! -->
       </linker>
 
       <linker id="linker.cfg.win64.mingw.jogl" extends="linker.cfg.win64.mingw">
         <linkerarg value="-Wl,--kill-at" />        <!-- remove @ from function names -->
-        <syslibset libs="gdi32, kernel32"/>
+        <syslibset libs="gdi32, kernel32, strmiids, uuid, ole32, oleaut32"/> <!-- last 4 for dshow video input query! -->
       </linker>
 
       <linker id="linker.cfg.win32.msvc.jogl" extends="linker.cfg.win32.msvc">
@@ -1425,6 +1425,7 @@
 
         <patternset id="c.src.files.@{version.lav}">
           <include name="${rootrel.src.c}/JoglCommon.c"/>
+          <include name="${rootrel.src.c.libav}/ffmpeg_dshow.c"/>
           <include name="${rootrel.src.c.libav}/ffmpeg_@{version.lav}.c"/>
         </patternset>
 
@@ -1469,6 +1470,9 @@
                 <!-- This must come last to not override real include paths -->
                 <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
               </compiler>
+
+              <linker extends="@{linker.cfg.id}">
+              </linker>
             </cc>
           </sequential>
         </outofdate>
@@ -1492,6 +1496,7 @@
         <patternset id="c.obj.files.ffmpeg.inject">
           <include name="${rootrel.obj.joglsub}/ffmpeg_lavc53_lavf53_lavu51.*"/>
           <include name="${rootrel.obj.joglsub}/ffmpeg_lavc54_lavf54_lavu52_lavr01.*"/>
+          <include name="${rootrel.obj.joglsub}/ffmpeg_lavc55_lavf55_lavu52_lavr01.*"/>
         </patternset>
 
         <patternset id="c.src.files.jogl.desktop">
@@ -1507,6 +1512,7 @@
           <!-- FIXME: the Mixer should be moved to another library -->
           <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/-->
           <include name="${rootrel.src.c.libav}/ffmpeg_static.c"/>
+          <include name="${rootrel.src.c.libav}/ffmpeg_dshow.c"/>
           <include name="${rootrel.src.c.openmax}/omx_tool.c"  if="setup.addNativeOpenMAX"/>
           <include name="${rootrel.src.c.openmax}/jogamp_opengl_util_av_impl_OMXGLMediaPlayer.c"  if="setup.addNativeOpenMAX"/>
 
@@ -1525,6 +1531,7 @@
           <include name="${rootrel.src.c}/GLDebugMessageHandler.c"/>
           <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/>
           <include name="${rootrel.src.c.libav}/ffmpeg_static.c"/>
+          <include name="${rootrel.src.c.libav}/ffmpeg_dshow.c"/>
           <include name="${rootrel.src.c.openmax}/omx_tool.c"  if="setup.addNativeOpenMAX"/>
           <include name="${rootrel.src.c.openmax}/jogamp_opengl_util_av_impl_OMXGLMediaPlayer.c"  if="setup.addNativeOpenMAX"/>
 
@@ -1548,7 +1555,7 @@
         <outofdate>
           <sourcefiles>
             <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
-            <fileset dir="${obj.joglsub}" includes="*jogl_ffmpegv08*, *jogl_ffmpegv09*"/> <!-- requires linkage -->
+            <fileset dir="${obj.joglsub}" includes="*jogl_ffmpegv08*, *jogl_ffmpegv09*, *jogl_ffmpegv10*"/> <!-- requires linkage -->
           </sourcefiles>
           <targetfiles>
             <fileset dir="${obj.jogl}" includes="lib@{output.lib.name}.so"/>
@@ -1629,9 +1636,7 @@
     <target name="c.build.jogl.prepare">
       <javah destdir="${build.jogl}/gensrc/native/jogl" classpath="${javah.classpath}" class="jogamp.opengl.GLDebugMessageHandler" />
       <javah destdir="${build.jogl}/gensrc/native/jogl" classpath="${javah.classpath}" class="jogamp.opengl.GLContextImpl" />
-      <javah destdir="${src.generated.c.libav}" classpath="${javah.classpath}" class="jogamp.opengl.util.av.impl.FFMPEGStaticNatives" />
-      <javah destdir="${src.generated.c.libav}" classpath="${javah.classpath}" class="jogamp.opengl.util.av.impl.FFMPEGv08Natives" />
-      <javah destdir="${src.generated.c.libav}" classpath="${javah.classpath}" class="jogamp.opengl.util.av.impl.FFMPEGv09Natives" />
+      <javah destdir="${src.generated.c.libav}" classpath="${javah.classpath}" class="jogamp.opengl.util.av.impl.FFMPEGStaticNatives,jogamp.opengl.util.av.impl.FFMPEGv08Natives,jogamp.opengl.util.av.impl.FFMPEGv09Natives,jogamp.opengl.util.av.impl.FFMPEGv10Natives" />
       <javah destdir="${src.generated.c.openmax}" classpath="${javah.classpath}" class="jogamp.opengl.util.av.impl.OMXGLMediaPlayer" />
       <!-- Generate the waveout Mixer header -->
       <!-- FIXME: this is temporary until we move this to another workspace -->
@@ -1646,6 +1651,11 @@
                output.lib.name="jogl_ffmpegv09"
                compiler.cfg.id="${compiler.cfg.id}"
                linker.cfg.id="${linker.cfg.id.os}"/>
+
+      <c.build.ffmpeg version.lav="lavc55_lavf55_lavu52_lavr01"
+               output.lib.name="jogl_ffmpegv10"
+               compiler.cfg.id="${compiler.cfg.id}"
+               linker.cfg.id="${linker.cfg.id.os}"/>
     </target>
 
     <target name="c.build.jogl.desktop" unless="setup.noNativeDesktop">
diff --git a/make/scripts/make.jogl.all.linux-x86_64.sh b/make/scripts/make.jogl.all.linux-x86_64.sh
index f59d6eabb..2488a7d4c 100755
--- a/make/scripts/make.jogl.all.linux-x86_64.sh
+++ b/make/scripts/make.jogl.all.linux-x86_64.sh
@@ -54,7 +54,6 @@ export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet"
 
 # BUILD_ARCHIVE=true \
 ant  \
-    -Dc.compiler.debug=true \
     $CUSTOMLIBDIR \
     -Drootrel.build=build-x86_64 \
     $* 2>&1 | tee -a $LOGF
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index fb2a94e95..986aba8ec 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -7,8 +7,9 @@ set ANT_PATH=C:\apache-ant-1.8.2
 set PROJECT_ROOT=D:\projects\jogamp\jogl
 set BLD_DIR=..\%BLD_SUB%
 
-set FFMPEG_LIB=C:\ffmpeg_libav\lavc54_lavf54_lavu52_lavr01\x64
-REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc53_lavf53_lavu51\x64
+REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc53_lavf53_lavu51-ffmpeg\x64
+set FFMPEG_LIB=C:\ffmpeg_libav\lavc55_lavf55_lavu52-ffmpeg\x64
+REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc54_lavf54_lavu52_lavr01-libav\x64
 
 REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
 REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%PROJECT_ROOT%\make\lib\external\PVRVFrame\OGLES-2.0\Windows_x86_64;%PATH%
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat
index 7ed47f635..38ba28fa0 100755
--- a/make/scripts/tests-x64.bat
+++ b/make/scripts/tests-x64.bat
@@ -4,8 +4,9 @@ set J2RE_HOME=c:\jre1.7.0_25_x64
 set JAVA_HOME=c:\jdk1.7.0_25_x64
 set ANT_PATH=C:\apache-ant-1.8.2
 
-set FFMPEG_LIB=C:\ffmpeg_libav\lavc54_lavf54_lavu52_lavr01\x64
-REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc53_lavf53_lavu51\x64
+REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc53_lavf53_lavu51-ffmpeg\x64
+set FFMPEG_LIB=C:\ffmpeg_libav\lavc55_lavf55_lavu52-ffmpeg\x64
+REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc54_lavf54_lavu52_lavr01-libav\x64
 
 REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
 REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%PROJECT_ROOT%\make\lib\external\PVRVFrame\OGLES-2.0\Windows_x86_64;%PATH%
diff --git a/make/scripts/tests-x64.sh b/make/scripts/tests-x64.sh
index 7370d06aa..68937ca4b 100755
--- a/make/scripts/tests-x64.sh
+++ b/make/scripts/tests-x64.sh
@@ -2,8 +2,13 @@
 
 SDIR=`dirname $0` 
 
-#export LD_LIBRARY_PATH=/home/sven/libav/lib:$LD_LIBRARY_PATH
-#export LD_LIBRARY_PATH=/home/sven/libav-0.X/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=/home/sven/libav-0.8/lib:$LD_LIBRARY_PATH
+
+#export LD_LIBRARY_PATH=/home/sven/libav-9.x/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=/home/sven/ffmpeg-1.2/lib:$LD_LIBRARY_PATH
+
+#export LD_LIBRARY_PATH=/home/sven/libav-10.x/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=/home/sven/ffmpeg-2.x/lib:$LD_LIBRARY_PATH
 
 if [ -e $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh ] ; then
     . $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index aa17c2163..493fa2744 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -132,8 +132,8 @@ function jrun() {
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
-    #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native -Djogl.debug.GLSLCode"
-    D_ARGS="-Djogl.debug.GLMediaPlayer"
+    D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
     #D_ARGS="-Djogl.debug.AudioSink"
diff --git a/make/stub_includes/libav/lavc54_lavf54_lavu52_lavr01/libswresample/swresample.h b/make/stub_includes/libav/lavc54_lavf54_lavu52_lavr01/libswresample/swresample.h
new file mode 100644
index 000000000..95e8a5a09
--- /dev/null
+++ b/make/stub_includes/libav/lavc54_lavf54_lavu52_lavr01/libswresample/swresample.h
@@ -0,0 +1,311 @@
+/*
+ * Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
+ *
+ * This file is part of libswresample
+ *
+ * libswresample is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * libswresample is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with libswresample; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SWRESAMPLE_SWRESAMPLE_H
+#define SWRESAMPLE_SWRESAMPLE_H
+
+/**
+ * @file
+ * @ingroup lswr
+ * libswresample public header
+ */
+
+/**
+ * @defgroup lswr Libswresample
+ * @{
+ *
+ * Libswresample (lswr) is a library that handles audio resampling, sample
+ * format conversion and mixing.
+ *
+ * Interaction with lswr is done through SwrContext, which is
+ * allocated with swr_alloc() or swr_alloc_set_opts(). It is opaque, so all parameters
+ * must be set with the @ref avoptions API.
+ *
+ * For example the following code will setup conversion from planar float sample
+ * format to interleaved signed 16-bit integer, downsampling from 48kHz to
+ * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
+ * matrix):
+ * @code
+ * SwrContext *swr = swr_alloc();
+ * av_opt_set_int(swr, "in_channel_layout",  AV_CH_LAYOUT_5POINT1, 0);
+ * av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
+ * av_opt_set_int(swr, "in_sample_rate",     48000,                0);
+ * av_opt_set_int(swr, "out_sample_rate",    44100,                0);
+ * av_opt_set_sample_fmt(swr, "in_sample_fmt",  AV_SAMPLE_FMT_FLTP, 0);
+ * av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16,  0);
+ * @endcode
+ *
+ * Once all values have been set, it must be initialized with swr_init(). If
+ * you need to change the conversion parameters, you can change the parameters
+ * as described above, or by using swr_alloc_set_opts(), then call swr_init()
+ * again.
+ *
+ * The conversion itself is done by repeatedly calling swr_convert().
+ * Note that the samples may get buffered in swr if you provide insufficient
+ * output space or if sample rate conversion is done, which requires "future"
+ * samples. Samples that do not require future input can be retrieved at any
+ * time by using swr_convert() (in_count can be set to 0).
+ * At the end of conversion the resampling buffer can be flushed by calling
+ * swr_convert() with NULL in and 0 in_count.
+ *
+ * The delay between input and output, can at any time be found by using
+ * swr_get_delay().
+ *
+ * The following code demonstrates the conversion loop assuming the parameters
+ * from above and caller-defined functions get_input() and handle_output():
+ * @code
+ * uint8_t **input;
+ * int in_samples;
+ *
+ * while (get_input(&input, &in_samples)) {
+ *     uint8_t *output;
+ *     int out_samples = av_rescale_rnd(swr_get_delay(swr, 48000) +
+ *                                      in_samples, 44100, 48000, AV_ROUND_UP);
+ *     av_samples_alloc(&output, NULL, 2, out_samples,
+ *                      AV_SAMPLE_FMT_S16, 0);
+ *     out_samples = swr_convert(swr, &output, out_samples,
+ *                                      input, in_samples);
+ *     handle_output(output, out_samples);
+ *     av_freep(&output);
+ *  }
+ *  @endcode
+ *
+ * When the conversion is finished, the conversion
+ * context and everything associated with it must be freed with swr_free().
+ * There will be no memory leak if the data is not completely flushed before
+ * swr_free().
+ */
+
+#include <stdint.h>
+#include "libavutil/samplefmt.h"
+
+#include "libswresample/version.h"
+
+#if LIBSWRESAMPLE_VERSION_MAJOR < 1
+#define SWR_CH_MAX 32   ///< Maximum number of channels
+#endif
+
+#define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate
+//TODO use int resample ?
+//long term TODO can we enable this dynamically?
+
+enum SwrDitherType {
+    SWR_DITHER_NONE = 0,
+    SWR_DITHER_RECTANGULAR,
+    SWR_DITHER_TRIANGULAR,
+    SWR_DITHER_TRIANGULAR_HIGHPASS,
+
+    SWR_DITHER_NS = 64,         ///< not part of API/ABI
+    SWR_DITHER_NS_LIPSHITZ,
+    SWR_DITHER_NS_F_WEIGHTED,
+    SWR_DITHER_NS_MODIFIED_E_WEIGHTED,
+    SWR_DITHER_NS_IMPROVED_E_WEIGHTED,
+    SWR_DITHER_NS_SHIBATA,
+    SWR_DITHER_NS_LOW_SHIBATA,
+    SWR_DITHER_NS_HIGH_SHIBATA,
+    SWR_DITHER_NB,              ///< not part of API/ABI
+};
+
+/** Resampling Engines */
+enum SwrEngine {
+    SWR_ENGINE_SWR,             /**< SW Resampler */
+    SWR_ENGINE_SOXR,            /**< SoX Resampler */
+    SWR_ENGINE_NB,              ///< not part of API/ABI
+};
+
+/** Resampling Filter Types */
+enum SwrFilterType {
+    SWR_FILTER_TYPE_CUBIC,              /**< Cubic */
+    SWR_FILTER_TYPE_BLACKMAN_NUTTALL,   /**< Blackman Nuttall Windowed Sinc */
+    SWR_FILTER_TYPE_KAISER,             /**< Kaiser Windowed Sinc */
+};
+
+typedef struct SwrContext SwrContext;
+
+/**
+ * Get the AVClass for swrContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *swr_get_class(void);
+
+/**
+ * Allocate SwrContext.
+ *
+ * If you use this function you will need to set the parameters (manually or
+ * with swr_alloc_set_opts()) before calling swr_init().
+ *
+ * @see swr_alloc_set_opts(), swr_init(), swr_free()
+ * @return NULL on error, allocated context otherwise
+ */
+struct SwrContext *swr_alloc(void);
+
+/**
+ * Initialize context after user parameters have been set.
+ *
+ * @return AVERROR error code in case of failure.
+ */
+int swr_init(struct SwrContext *s);
+
+/**
+ * Allocate SwrContext if needed and set/reset common parameters.
+ *
+ * This function does not require s to be allocated with swr_alloc(). On the
+ * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters
+ * on the allocated context.
+ *
+ * @param s               Swr context, can be NULL
+ * @param out_ch_layout   output channel layout (AV_CH_LAYOUT_*)
+ * @param out_sample_fmt  output sample format (AV_SAMPLE_FMT_*).
+ * @param out_sample_rate output sample rate (frequency in Hz)
+ * @param in_ch_layout    input channel layout (AV_CH_LAYOUT_*)
+ * @param in_sample_fmt   input sample format (AV_SAMPLE_FMT_*).
+ * @param in_sample_rate  input sample rate (frequency in Hz)
+ * @param log_offset      logging level offset
+ * @param log_ctx         parent logging context, can be NULL
+ *
+ * @see swr_init(), swr_free()
+ * @return NULL on error, allocated context otherwise
+ */
+struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
+                                      int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
+                                      int64_t  in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
+                                      int log_offset, void *log_ctx);
+
+/**
+ * Free the given SwrContext and set the pointer to NULL.
+ */
+void swr_free(struct SwrContext **s);
+
+/**
+ * Convert audio.
+ *
+ * in and in_count can be set to 0 to flush the last few samples out at the
+ * end.
+ *
+ * If more input is provided than output space then the input will be buffered.
+ * You can avoid this buffering by providing more output space than input.
+ * Convertion will run directly without copying whenever possible.
+ *
+ * @param s         allocated Swr context, with parameters set
+ * @param out       output buffers, only the first one need be set in case of packed audio
+ * @param out_count amount of space available for output in samples per channel
+ * @param in        input buffers, only the first one need to be set in case of packed audio
+ * @param in_count  number of input samples available in one channel
+ *
+ * @return number of samples output per channel, negative value on error
+ */
+int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
+                                const uint8_t **in , int in_count);
+
+/**
+ * Convert the next timestamp from input to output
+ * timestamps are in 1/(in_sample_rate * out_sample_rate) units.
+ *
+ * @note There are 2 slightly differently behaving modes.
+ *       First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX)
+ *              in this case timestamps will be passed through with delays compensated
+ *       Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX)
+ *              in this case the output timestamps will match output sample numbers
+ *
+ * @param pts   timestamp for the next input sample, INT64_MIN if unknown
+ * @return the output timestamp for the next output sample
+ */
+int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
+
+/**
+ * Activate resampling compensation.
+ */
+int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
+
+/**
+ * Set a customized input channel mapping.
+ *
+ * @param s           allocated Swr context, not yet initialized
+ * @param channel_map customized input channel mapping (array of channel
+ *                    indexes, -1 for a muted channel)
+ * @return AVERROR error code in case of failure.
+ */
+int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
+
+/**
+ * Set a customized remix matrix.
+ *
+ * @param s       allocated Swr context, not yet initialized
+ * @param matrix  remix coefficients; matrix[i + stride * o] is
+ *                the weight of input channel i in output channel o
+ * @param stride  offset between lines of the matrix
+ * @return  AVERROR error code in case of failure.
+ */
+int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
+
+/**
+ * Drops the specified number of output samples.
+ */
+int swr_drop_output(struct SwrContext *s, int count);
+
+/**
+ * Injects the specified number of silence samples.
+ */
+int swr_inject_silence(struct SwrContext *s, int count);
+
+/**
+ * Gets the delay the next input sample will experience relative to the next output sample.
+ *
+ * Swresample can buffer data if more input has been provided than available
+ * output space, also converting between sample rates needs a delay.
+ * This function returns the sum of all such delays.
+ * The exact delay is not necessarily an integer value in either input or
+ * output sample rate. Especially when downsampling by a large value, the
+ * output sample rate may be a poor choice to represent the delay, similarly
+ * for upsampling and the input sample rate.
+ *
+ * @param s     swr context
+ * @param base  timebase in which the returned delay will be
+ *              if its set to 1 the returned delay is in seconds
+ *              if its set to 1000 the returned delay is in milli seconds
+ *              if its set to the input sample rate then the returned delay is in input samples
+ *              if its set to the output sample rate then the returned delay is in output samples
+ *              an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate)
+ * @returns     the delay in 1/base units.
+ */
+int64_t swr_get_delay(struct SwrContext *s, int64_t base);
+
+/**
+ * Return the LIBSWRESAMPLE_VERSION_INT constant.
+ */
+unsigned swresample_version(void);
+
+/**
+ * Return the swr build-time configuration.
+ */
+const char *swresample_configuration(void);
+
+/**
+ * Return the swr license.
+ */
+const char *swresample_license(void);
+
+/**
+ * @}
+ */
+
+#endif /* SWRESAMPLE_SWRESAMPLE_H */
diff --git a/make/stub_includes/libav/lavc54_lavf54_lavu52_lavr01/libswresample/version.h b/make/stub_includes/libav/lavc54_lavf54_lavu52_lavr01/libswresample/version.h
new file mode 100644
index 000000000..df9df480c
--- /dev/null
+++ b/make/stub_includes/libav/lavc54_lavf54_lavu52_lavr01/libswresample/version.h
@@ -0,0 +1,45 @@
+/*
+ * Version macros.
+ *
+ * This file is part of libswresample
+ *
+ * libswresample is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * libswresample is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with libswresample; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SWR_VERSION_H
+#define SWR_VERSION_H
+
+/**
+ * @file
+ * Libswresample version macros
+ */
+
+#include "libavutil/avutil.h"
+
+#define LIBSWRESAMPLE_VERSION_MAJOR 0
+#define LIBSWRESAMPLE_VERSION_MINOR 17
+#define LIBSWRESAMPLE_VERSION_MICRO 102
+
+#define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
+                                                  LIBSWRESAMPLE_VERSION_MINOR, \
+                                                  LIBSWRESAMPLE_VERSION_MICRO)
+#define LIBSWRESAMPLE_VERSION      AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \
+                                              LIBSWRESAMPLE_VERSION_MINOR, \
+                                              LIBSWRESAMPLE_VERSION_MICRO)
+#define LIBSWRESAMPLE_BUILD        LIBSWRESAMPLE_VERSION_INT
+
+#define LIBSWRESAMPLE_IDENT        "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
+
+#endif /* SWR_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avcodec.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avcodec.h
new file mode 100644
index 000000000..caf828496
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avcodec.h
@@ -0,0 +1,4277 @@
+/*
+ * copyright (c) 2001 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AVCODEC_H
+#define AVCODEC_AVCODEC_H
+
+/**
+ * @file
+ * @ingroup libavc
+ * Libavcodec external API header
+ */
+
+#include <errno.h>
+#include "libavutil/samplefmt.h"
+#include "libavutil/attributes.h"
+#include "libavutil/avutil.h"
+#include "libavutil/buffer.h"
+#include "libavutil/cpu.h"
+#include "libavutil/dict.h"
+#include "libavutil/frame.h"
+#include "libavutil/log.h"
+#include "libavutil/pixfmt.h"
+#include "libavutil/rational.h"
+
+#include "libavcodec/version.h"
+/**
+ * @defgroup libavc Encoding/Decoding Library
+ * @{
+ *
+ * @defgroup lavc_decoding Decoding
+ * @{
+ * @}
+ *
+ * @defgroup lavc_encoding Encoding
+ * @{
+ * @}
+ *
+ * @defgroup lavc_codec Codecs
+ * @{
+ * @defgroup lavc_codec_native Native Codecs
+ * @{
+ * @}
+ * @defgroup lavc_codec_wrappers External library wrappers
+ * @{
+ * @}
+ * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge
+ * @{
+ * @}
+ * @}
+ * @defgroup lavc_internal Internal
+ * @{
+ * @}
+ * @}
+ *
+ */
+
+/**
+ * @defgroup lavc_core Core functions/structures.
+ * @ingroup libavc
+ *
+ * Basic definitions, functions for querying libavcodec capabilities,
+ * allocating core structures, etc.
+ * @{
+ */
+
+
+/**
+ * Identify the syntax and semantics of the bitstream.
+ * The principle is roughly:
+ * Two decoders with the same ID can decode the same streams.
+ * Two encoders with the same ID can encode compatible streams.
+ * There may be slight deviations from the principle due to implementation
+ * details.
+ *
+ * If you add a codec ID to this list, add it so that
+ * 1. no value of a existing codec ID changes (that would break ABI),
+ * 2. it is as close as possible to similar codecs.
+ *
+ * After adding new codec IDs, do not forget to add an entry to the codec
+ * descriptor list and bump libavcodec minor version.
+ */
+enum AVCodecID {
+    AV_CODEC_ID_NONE,
+
+    /* video codecs */
+    AV_CODEC_ID_MPEG1VIDEO,
+    AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+    AV_CODEC_ID_MPEG2VIDEO_XVMC,
+    AV_CODEC_ID_H261,
+    AV_CODEC_ID_H263,
+    AV_CODEC_ID_RV10,
+    AV_CODEC_ID_RV20,
+    AV_CODEC_ID_MJPEG,
+    AV_CODEC_ID_MJPEGB,
+    AV_CODEC_ID_LJPEG,
+    AV_CODEC_ID_SP5X,
+    AV_CODEC_ID_JPEGLS,
+    AV_CODEC_ID_MPEG4,
+    AV_CODEC_ID_RAWVIDEO,
+    AV_CODEC_ID_MSMPEG4V1,
+    AV_CODEC_ID_MSMPEG4V2,
+    AV_CODEC_ID_MSMPEG4V3,
+    AV_CODEC_ID_WMV1,
+    AV_CODEC_ID_WMV2,
+    AV_CODEC_ID_H263P,
+    AV_CODEC_ID_H263I,
+    AV_CODEC_ID_FLV1,
+    AV_CODEC_ID_SVQ1,
+    AV_CODEC_ID_SVQ3,
+    AV_CODEC_ID_DVVIDEO,
+    AV_CODEC_ID_HUFFYUV,
+    AV_CODEC_ID_CYUV,
+    AV_CODEC_ID_H264,
+    AV_CODEC_ID_INDEO3,
+    AV_CODEC_ID_VP3,
+    AV_CODEC_ID_THEORA,
+    AV_CODEC_ID_ASV1,
+    AV_CODEC_ID_ASV2,
+    AV_CODEC_ID_FFV1,
+    AV_CODEC_ID_4XM,
+    AV_CODEC_ID_VCR1,
+    AV_CODEC_ID_CLJR,
+    AV_CODEC_ID_MDEC,
+    AV_CODEC_ID_ROQ,
+    AV_CODEC_ID_INTERPLAY_VIDEO,
+    AV_CODEC_ID_XAN_WC3,
+    AV_CODEC_ID_XAN_WC4,
+    AV_CODEC_ID_RPZA,
+    AV_CODEC_ID_CINEPAK,
+    AV_CODEC_ID_WS_VQA,
+    AV_CODEC_ID_MSRLE,
+    AV_CODEC_ID_MSVIDEO1,
+    AV_CODEC_ID_IDCIN,
+    AV_CODEC_ID_8BPS,
+    AV_CODEC_ID_SMC,
+    AV_CODEC_ID_FLIC,
+    AV_CODEC_ID_TRUEMOTION1,
+    AV_CODEC_ID_VMDVIDEO,
+    AV_CODEC_ID_MSZH,
+    AV_CODEC_ID_ZLIB,
+    AV_CODEC_ID_QTRLE,
+    AV_CODEC_ID_TSCC,
+    AV_CODEC_ID_ULTI,
+    AV_CODEC_ID_QDRAW,
+    AV_CODEC_ID_VIXL,
+    AV_CODEC_ID_QPEG,
+    AV_CODEC_ID_PNG,
+    AV_CODEC_ID_PPM,
+    AV_CODEC_ID_PBM,
+    AV_CODEC_ID_PGM,
+    AV_CODEC_ID_PGMYUV,
+    AV_CODEC_ID_PAM,
+    AV_CODEC_ID_FFVHUFF,
+    AV_CODEC_ID_RV30,
+    AV_CODEC_ID_RV40,
+    AV_CODEC_ID_VC1,
+    AV_CODEC_ID_WMV3,
+    AV_CODEC_ID_LOCO,
+    AV_CODEC_ID_WNV1,
+    AV_CODEC_ID_AASC,
+    AV_CODEC_ID_INDEO2,
+    AV_CODEC_ID_FRAPS,
+    AV_CODEC_ID_TRUEMOTION2,
+    AV_CODEC_ID_BMP,
+    AV_CODEC_ID_CSCD,
+    AV_CODEC_ID_MMVIDEO,
+    AV_CODEC_ID_ZMBV,
+    AV_CODEC_ID_AVS,
+    AV_CODEC_ID_SMACKVIDEO,
+    AV_CODEC_ID_NUV,
+    AV_CODEC_ID_KMVC,
+    AV_CODEC_ID_FLASHSV,
+    AV_CODEC_ID_CAVS,
+    AV_CODEC_ID_JPEG2000,
+    AV_CODEC_ID_VMNC,
+    AV_CODEC_ID_VP5,
+    AV_CODEC_ID_VP6,
+    AV_CODEC_ID_VP6F,
+    AV_CODEC_ID_TARGA,
+    AV_CODEC_ID_DSICINVIDEO,
+    AV_CODEC_ID_TIERTEXSEQVIDEO,
+    AV_CODEC_ID_TIFF,
+    AV_CODEC_ID_GIF,
+    AV_CODEC_ID_DXA,
+    AV_CODEC_ID_DNXHD,
+    AV_CODEC_ID_THP,
+    AV_CODEC_ID_SGI,
+    AV_CODEC_ID_C93,
+    AV_CODEC_ID_BETHSOFTVID,
+    AV_CODEC_ID_PTX,
+    AV_CODEC_ID_TXD,
+    AV_CODEC_ID_VP6A,
+    AV_CODEC_ID_AMV,
+    AV_CODEC_ID_VB,
+    AV_CODEC_ID_PCX,
+    AV_CODEC_ID_SUNRAST,
+    AV_CODEC_ID_INDEO4,
+    AV_CODEC_ID_INDEO5,
+    AV_CODEC_ID_MIMIC,
+    AV_CODEC_ID_RL2,
+    AV_CODEC_ID_ESCAPE124,
+    AV_CODEC_ID_DIRAC,
+    AV_CODEC_ID_BFI,
+    AV_CODEC_ID_CMV,
+    AV_CODEC_ID_MOTIONPIXELS,
+    AV_CODEC_ID_TGV,
+    AV_CODEC_ID_TGQ,
+    AV_CODEC_ID_TQI,
+    AV_CODEC_ID_AURA,
+    AV_CODEC_ID_AURA2,
+    AV_CODEC_ID_V210X,
+    AV_CODEC_ID_TMV,
+    AV_CODEC_ID_V210,
+    AV_CODEC_ID_DPX,
+    AV_CODEC_ID_MAD,
+    AV_CODEC_ID_FRWU,
+    AV_CODEC_ID_FLASHSV2,
+    AV_CODEC_ID_CDGRAPHICS,
+    AV_CODEC_ID_R210,
+    AV_CODEC_ID_ANM,
+    AV_CODEC_ID_BINKVIDEO,
+    AV_CODEC_ID_IFF_ILBM,
+    AV_CODEC_ID_IFF_BYTERUN1,
+    AV_CODEC_ID_KGV1,
+    AV_CODEC_ID_YOP,
+    AV_CODEC_ID_VP8,
+    AV_CODEC_ID_PICTOR,
+    AV_CODEC_ID_ANSI,
+    AV_CODEC_ID_A64_MULTI,
+    AV_CODEC_ID_A64_MULTI5,
+    AV_CODEC_ID_R10K,
+    AV_CODEC_ID_MXPEG,
+    AV_CODEC_ID_LAGARITH,
+    AV_CODEC_ID_PRORES,
+    AV_CODEC_ID_JV,
+    AV_CODEC_ID_DFA,
+    AV_CODEC_ID_WMV3IMAGE,
+    AV_CODEC_ID_VC1IMAGE,
+    AV_CODEC_ID_UTVIDEO,
+    AV_CODEC_ID_BMV_VIDEO,
+    AV_CODEC_ID_VBLE,
+    AV_CODEC_ID_DXTORY,
+    AV_CODEC_ID_V410,
+    AV_CODEC_ID_XWD,
+    AV_CODEC_ID_CDXL,
+    AV_CODEC_ID_XBM,
+    AV_CODEC_ID_ZEROCODEC,
+    AV_CODEC_ID_MSS1,
+    AV_CODEC_ID_MSA1,
+    AV_CODEC_ID_TSCC2,
+    AV_CODEC_ID_MTS2,
+    AV_CODEC_ID_CLLC,
+    AV_CODEC_ID_MSS2,
+    AV_CODEC_ID_VP9,
+    AV_CODEC_ID_AIC,
+    AV_CODEC_ID_ESCAPE130,
+    AV_CODEC_ID_G2M,
+
+    /* various PCM "codecs" */
+    AV_CODEC_ID_FIRST_AUDIO = 0x10000,     ///< A dummy id pointing at the start of audio codecs
+    AV_CODEC_ID_PCM_S16LE = 0x10000,
+    AV_CODEC_ID_PCM_S16BE,
+    AV_CODEC_ID_PCM_U16LE,
+    AV_CODEC_ID_PCM_U16BE,
+    AV_CODEC_ID_PCM_S8,
+    AV_CODEC_ID_PCM_U8,
+    AV_CODEC_ID_PCM_MULAW,
+    AV_CODEC_ID_PCM_ALAW,
+    AV_CODEC_ID_PCM_S32LE,
+    AV_CODEC_ID_PCM_S32BE,
+    AV_CODEC_ID_PCM_U32LE,
+    AV_CODEC_ID_PCM_U32BE,
+    AV_CODEC_ID_PCM_S24LE,
+    AV_CODEC_ID_PCM_S24BE,
+    AV_CODEC_ID_PCM_U24LE,
+    AV_CODEC_ID_PCM_U24BE,
+    AV_CODEC_ID_PCM_S24DAUD,
+    AV_CODEC_ID_PCM_ZORK,
+    AV_CODEC_ID_PCM_S16LE_PLANAR,
+    AV_CODEC_ID_PCM_DVD,
+    AV_CODEC_ID_PCM_F32BE,
+    AV_CODEC_ID_PCM_F32LE,
+    AV_CODEC_ID_PCM_F64BE,
+    AV_CODEC_ID_PCM_F64LE,
+    AV_CODEC_ID_PCM_BLURAY,
+    AV_CODEC_ID_PCM_LXF,
+    AV_CODEC_ID_S302M,
+    AV_CODEC_ID_PCM_S8_PLANAR,
+
+    /* various ADPCM codecs */
+    AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
+    AV_CODEC_ID_ADPCM_IMA_WAV,
+    AV_CODEC_ID_ADPCM_IMA_DK3,
+    AV_CODEC_ID_ADPCM_IMA_DK4,
+    AV_CODEC_ID_ADPCM_IMA_WS,
+    AV_CODEC_ID_ADPCM_IMA_SMJPEG,
+    AV_CODEC_ID_ADPCM_MS,
+    AV_CODEC_ID_ADPCM_4XM,
+    AV_CODEC_ID_ADPCM_XA,
+    AV_CODEC_ID_ADPCM_ADX,
+    AV_CODEC_ID_ADPCM_EA,
+    AV_CODEC_ID_ADPCM_G726,
+    AV_CODEC_ID_ADPCM_CT,
+    AV_CODEC_ID_ADPCM_SWF,
+    AV_CODEC_ID_ADPCM_YAMAHA,
+    AV_CODEC_ID_ADPCM_SBPRO_4,
+    AV_CODEC_ID_ADPCM_SBPRO_3,
+    AV_CODEC_ID_ADPCM_SBPRO_2,
+    AV_CODEC_ID_ADPCM_THP,
+    AV_CODEC_ID_ADPCM_IMA_AMV,
+    AV_CODEC_ID_ADPCM_EA_R1,
+    AV_CODEC_ID_ADPCM_EA_R3,
+    AV_CODEC_ID_ADPCM_EA_R2,
+    AV_CODEC_ID_ADPCM_IMA_EA_SEAD,
+    AV_CODEC_ID_ADPCM_IMA_EA_EACS,
+    AV_CODEC_ID_ADPCM_EA_XAS,
+    AV_CODEC_ID_ADPCM_EA_MAXIS_XA,
+    AV_CODEC_ID_ADPCM_IMA_ISS,
+    AV_CODEC_ID_ADPCM_G722,
+    AV_CODEC_ID_ADPCM_IMA_APC,
+
+    /* AMR */
+    AV_CODEC_ID_AMR_NB = 0x12000,
+    AV_CODEC_ID_AMR_WB,
+
+    /* RealAudio codecs*/
+    AV_CODEC_ID_RA_144 = 0x13000,
+    AV_CODEC_ID_RA_288,
+
+    /* various DPCM codecs */
+    AV_CODEC_ID_ROQ_DPCM = 0x14000,
+    AV_CODEC_ID_INTERPLAY_DPCM,
+    AV_CODEC_ID_XAN_DPCM,
+    AV_CODEC_ID_SOL_DPCM,
+
+    /* audio codecs */
+    AV_CODEC_ID_MP2 = 0x15000,
+    AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+    AV_CODEC_ID_AAC,
+    AV_CODEC_ID_AC3,
+    AV_CODEC_ID_DTS,
+    AV_CODEC_ID_VORBIS,
+    AV_CODEC_ID_DVAUDIO,
+    AV_CODEC_ID_WMAV1,
+    AV_CODEC_ID_WMAV2,
+    AV_CODEC_ID_MACE3,
+    AV_CODEC_ID_MACE6,
+    AV_CODEC_ID_VMDAUDIO,
+    AV_CODEC_ID_FLAC,
+    AV_CODEC_ID_MP3ADU,
+    AV_CODEC_ID_MP3ON4,
+    AV_CODEC_ID_SHORTEN,
+    AV_CODEC_ID_ALAC,
+    AV_CODEC_ID_WESTWOOD_SND1,
+    AV_CODEC_ID_GSM, ///< as in Berlin toast format
+    AV_CODEC_ID_QDM2,
+    AV_CODEC_ID_COOK,
+    AV_CODEC_ID_TRUESPEECH,
+    AV_CODEC_ID_TTA,
+    AV_CODEC_ID_SMACKAUDIO,
+    AV_CODEC_ID_QCELP,
+    AV_CODEC_ID_WAVPACK,
+    AV_CODEC_ID_DSICINAUDIO,
+    AV_CODEC_ID_IMC,
+    AV_CODEC_ID_MUSEPACK7,
+    AV_CODEC_ID_MLP,
+    AV_CODEC_ID_GSM_MS, /* as found in WAV */
+    AV_CODEC_ID_ATRAC3,
+#if FF_API_VOXWARE
+    AV_CODEC_ID_VOXWARE,
+#endif
+    AV_CODEC_ID_APE,
+    AV_CODEC_ID_NELLYMOSER,
+    AV_CODEC_ID_MUSEPACK8,
+    AV_CODEC_ID_SPEEX,
+    AV_CODEC_ID_WMAVOICE,
+    AV_CODEC_ID_WMAPRO,
+    AV_CODEC_ID_WMALOSSLESS,
+    AV_CODEC_ID_ATRAC3P,
+    AV_CODEC_ID_EAC3,
+    AV_CODEC_ID_SIPR,
+    AV_CODEC_ID_MP1,
+    AV_CODEC_ID_TWINVQ,
+    AV_CODEC_ID_TRUEHD,
+    AV_CODEC_ID_MP4ALS,
+    AV_CODEC_ID_ATRAC1,
+    AV_CODEC_ID_BINKAUDIO_RDFT,
+    AV_CODEC_ID_BINKAUDIO_DCT,
+    AV_CODEC_ID_AAC_LATM,
+    AV_CODEC_ID_QDMC,
+    AV_CODEC_ID_CELT,
+    AV_CODEC_ID_G723_1,
+    AV_CODEC_ID_G729,
+    AV_CODEC_ID_8SVX_EXP,
+    AV_CODEC_ID_8SVX_FIB,
+    AV_CODEC_ID_BMV_AUDIO,
+    AV_CODEC_ID_RALF,
+    AV_CODEC_ID_IAC,
+    AV_CODEC_ID_ILBC,
+    AV_CODEC_ID_OPUS,
+    AV_CODEC_ID_COMFORT_NOISE,
+    AV_CODEC_ID_TAK,
+    AV_CODEC_ID_METASOUND,
+
+    /* subtitle codecs */
+    AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,          ///< A dummy ID pointing at the start of subtitle codecs.
+    AV_CODEC_ID_DVD_SUBTITLE = 0x17000,
+    AV_CODEC_ID_DVB_SUBTITLE,
+    AV_CODEC_ID_TEXT,  ///< raw UTF-8 text
+    AV_CODEC_ID_XSUB,
+    AV_CODEC_ID_SSA,
+    AV_CODEC_ID_MOV_TEXT,
+    AV_CODEC_ID_HDMV_PGS_SUBTITLE,
+    AV_CODEC_ID_DVB_TELETEXT,
+    AV_CODEC_ID_SRT,
+
+    /* other specific kind of codecs (generally used for attachments) */
+    AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,           ///< A dummy ID pointing at the start of various fake codecs.
+    AV_CODEC_ID_TTF = 0x18000,
+
+    AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
+
+    AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+                                * stream (only used by libavformat) */
+    AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
+                                * stream (only used by libavformat) */
+    AV_CODEC_ID_FFMETADATA = 0x21000,   ///< Dummy codec for streams containing only metadata information.
+};
+
+/**
+ * This struct describes the properties of a single codec described by an
+ * AVCodecID.
+ * @see avcodec_get_descriptor()
+ */
+typedef struct AVCodecDescriptor {
+    enum AVCodecID     id;
+    enum AVMediaType type;
+    /**
+     * Name of the codec described by this descriptor. It is non-empty and
+     * unique for each codec descriptor. It should contain alphanumeric
+     * characters and '_' only.
+     */
+    const char      *name;
+    /**
+     * A more descriptive name for this codec. May be NULL.
+     */
+    const char *long_name;
+    /**
+     * Codec properties, a combination of AV_CODEC_PROP_* flags.
+     */
+    int             props;
+} AVCodecDescriptor;
+
+/**
+ * Codec uses only intra compression.
+ * Video codecs only.
+ */
+#define AV_CODEC_PROP_INTRA_ONLY    (1 << 0)
+/**
+ * Codec supports lossy compression. Audio and video codecs only.
+ * @note a codec may support both lossy and lossless
+ * compression modes
+ */
+#define AV_CODEC_PROP_LOSSY         (1 << 1)
+/**
+ * Codec supports lossless compression. Audio and video codecs only.
+ */
+#define AV_CODEC_PROP_LOSSLESS      (1 << 2)
+
+/**
+ * @ingroup lavc_decoding
+ * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
+ * This is mainly needed because some optimized bitstream readers read
+ * 32 or 64 bit at once and could read over the end.<br>
+ * Note: If the first 23 bits of the additional bytes are not 0, then damaged
+ * MPEG bitstreams could cause overread and segfault.
+ */
+#define FF_INPUT_BUFFER_PADDING_SIZE 8
+
+/**
+ * @ingroup lavc_encoding
+ * minimum encoding buffer size
+ * Used to avoid some checks during header writing.
+ */
+#define FF_MIN_BUFFER_SIZE 16384
+
+
+/**
+ * @ingroup lavc_encoding
+ * motion estimation type.
+ */
+enum Motion_Est_ID {
+    ME_ZERO = 1,    ///< no search, that is use 0,0 vector whenever one is needed
+    ME_FULL,
+    ME_LOG,
+    ME_PHODS,
+    ME_EPZS,        ///< enhanced predictive zonal search
+    ME_X1,          ///< reserved for experiments
+    ME_HEX,         ///< hexagon based search
+    ME_UMH,         ///< uneven multi-hexagon search
+    ME_TESA,        ///< transformed exhaustive search algorithm
+};
+
+/**
+ * @ingroup lavc_decoding
+ */
+enum AVDiscard{
+    /* We leave some space between them for extensions (drop some
+     * keyframes for intra-only or drop just some bidir frames). */
+    AVDISCARD_NONE    =-16, ///< discard nothing
+    AVDISCARD_DEFAULT =  0, ///< discard useless packets like 0 size packets in avi
+    AVDISCARD_NONREF  =  8, ///< discard all non reference
+    AVDISCARD_BIDIR   = 16, ///< discard all bidirectional frames
+    AVDISCARD_NONKEY  = 32, ///< discard all frames except keyframes
+    AVDISCARD_ALL     = 48, ///< discard all
+};
+
+enum AVColorPrimaries{
+    AVCOL_PRI_BT709       = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
+    AVCOL_PRI_UNSPECIFIED = 2,
+    AVCOL_PRI_BT470M      = 4,
+    AVCOL_PRI_BT470BG     = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
+    AVCOL_PRI_SMPTE170M   = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
+    AVCOL_PRI_SMPTE240M   = 7, ///< functionally identical to above
+    AVCOL_PRI_FILM        = 8,
+    AVCOL_PRI_NB             , ///< Not part of ABI
+};
+
+enum AVColorTransferCharacteristic{
+    AVCOL_TRC_BT709       = 1, ///< also ITU-R BT1361
+    AVCOL_TRC_UNSPECIFIED = 2,
+    AVCOL_TRC_GAMMA22     = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
+    AVCOL_TRC_GAMMA28     = 5, ///< also ITU-R BT470BG
+    AVCOL_TRC_SMPTE240M   = 7,
+    AVCOL_TRC_NB             , ///< Not part of ABI
+};
+
+enum AVColorSpace{
+    AVCOL_SPC_RGB         = 0,
+    AVCOL_SPC_BT709       = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
+    AVCOL_SPC_UNSPECIFIED = 2,
+    AVCOL_SPC_FCC         = 4,
+    AVCOL_SPC_BT470BG     = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
+    AVCOL_SPC_SMPTE170M   = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
+    AVCOL_SPC_SMPTE240M   = 7,
+    AVCOL_SPC_YCOCG       = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
+    AVCOL_SPC_NB             , ///< Not part of ABI
+};
+
+enum AVColorRange{
+    AVCOL_RANGE_UNSPECIFIED = 0,
+    AVCOL_RANGE_MPEG        = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
+    AVCOL_RANGE_JPEG        = 2, ///< the normal     2^n-1   "JPEG" YUV ranges
+    AVCOL_RANGE_NB             , ///< Not part of ABI
+};
+
+/**
+ *  X   X      3 4 X      X are luma samples,
+ *             1 2        1-6 are possible chroma positions
+ *  X   X      5 6 X      0 is undefined/unknown position
+ */
+enum AVChromaLocation{
+    AVCHROMA_LOC_UNSPECIFIED = 0,
+    AVCHROMA_LOC_LEFT        = 1, ///< mpeg2/4, h264 default
+    AVCHROMA_LOC_CENTER      = 2, ///< mpeg1, jpeg, h263
+    AVCHROMA_LOC_TOPLEFT     = 3, ///< DV
+    AVCHROMA_LOC_TOP         = 4,
+    AVCHROMA_LOC_BOTTOMLEFT  = 5,
+    AVCHROMA_LOC_BOTTOM      = 6,
+    AVCHROMA_LOC_NB             , ///< Not part of ABI
+};
+
+enum AVAudioServiceType {
+    AV_AUDIO_SERVICE_TYPE_MAIN              = 0,
+    AV_AUDIO_SERVICE_TYPE_EFFECTS           = 1,
+    AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
+    AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED  = 3,
+    AV_AUDIO_SERVICE_TYPE_DIALOGUE          = 4,
+    AV_AUDIO_SERVICE_TYPE_COMMENTARY        = 5,
+    AV_AUDIO_SERVICE_TYPE_EMERGENCY         = 6,
+    AV_AUDIO_SERVICE_TYPE_VOICE_OVER        = 7,
+    AV_AUDIO_SERVICE_TYPE_KARAOKE           = 8,
+    AV_AUDIO_SERVICE_TYPE_NB                   , ///< Not part of ABI
+};
+
+/**
+ * @ingroup lavc_encoding
+ */
+typedef struct RcOverride{
+    int start_frame;
+    int end_frame;
+    int qscale; // If this is 0 then quality_factor will be used instead.
+    float quality_factor;
+} RcOverride;
+
+#define FF_MAX_B_FRAMES 16
+
+/* encoding support
+   These flags can be passed in AVCodecContext.flags before initialization.
+   Note: Not everything is supported yet.
+*/
+
+/**
+ * Allow decoders to produce frames with data planes that are not aligned
+ * to CPU requirements (e.g. due to cropping).
+ */
+#define CODEC_FLAG_UNALIGNED 0x0001
+#define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
+#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
+#define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
+#define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
+#define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
+/**
+ * The parent program guarantees that the input for B-frames containing
+ * streams is not written to for at least s->max_b_frames+1 frames, if
+ * this is not set the input will be copied.
+ */
+#define CODEC_FLAG_INPUT_PRESERVED 0x0100
+#define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
+#define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
+#define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
+#define CODEC_FLAG_EMU_EDGE        0x4000   ///< Don't draw edges.
+#define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
+#define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
+                                                  location instead of only at frame boundaries. */
+#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
+#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
+#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
+#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
+#define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
+/* Fx : Flag for h263+ extra options */
+#define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
+#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
+#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
+#define CODEC_FLAG_CLOSED_GOP     0x80000000
+#define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
+#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
+#define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
+#define CODEC_FLAG2_IGNORE_CROP   0x00010000 ///< Discard cropping information from SPS.
+
+#define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
+
+/* Unsupported options :
+ *              Syntax Arithmetic coding (SAC)
+ *              Reference Picture Selection
+ *              Independent Segment Decoding */
+/* /Fx */
+/* codec capabilities */
+
+#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
+/**
+ * Codec uses get_buffer() for allocating buffers and supports custom allocators.
+ * If not set, it might not use get_buffer() at all or use operations that
+ * assume the buffer was allocated by avcodec_default_get_buffer.
+ */
+#define CODEC_CAP_DR1             0x0002
+#define CODEC_CAP_TRUNCATED       0x0008
+/* Codec can export data for HW decoding (XvMC). */
+#define CODEC_CAP_HWACCEL         0x0010
+/**
+ * Encoder or decoder requires flushing with NULL input at the end in order to
+ * give the complete and correct output.
+ *
+ * NOTE: If this flag is not set, the codec is guaranteed to never be fed with
+ *       with NULL data. The user can still send NULL data to the public encode
+ *       or decode function, but libavcodec will not pass it along to the codec
+ *       unless this flag is set.
+ *
+ * Decoders:
+ * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
+ * avpkt->size=0 at the end to get the delayed data until the decoder no longer
+ * returns frames.
+ *
+ * Encoders:
+ * The encoder needs to be fed with NULL data at the end of encoding until the
+ * encoder no longer returns data.
+ *
+ * NOTE: For encoders implementing the AVCodec.encode2() function, setting this
+ *       flag also means that the encoder must set the pts and duration for
+ *       each output packet. If this flag is not set, the pts and duration will
+ *       be determined by libavcodec from the input frame.
+ */
+#define CODEC_CAP_DELAY           0x0020
+/**
+ * Codec can be fed a final frame with a smaller size.
+ * This can be used to prevent truncation of the last audio samples.
+ */
+#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
+#if FF_API_CAP_VDPAU
+/**
+ * Codec can export data for HW decoding (VDPAU).
+ */
+#define CODEC_CAP_HWACCEL_VDPAU    0x0080
+#endif
+/**
+ * Codec can output multiple frames per AVPacket
+ * Normally demuxers return one frame at a time, demuxers which do not do
+ * are connected to a parser to split what they return into proper frames.
+ * This flag is reserved to the very rare category of codecs which have a
+ * bitstream that cannot be split into frames without timeconsuming
+ * operations like full decoding. Demuxers carring such bitstreams thus
+ * may return multiple frames in a packet. This has many disadvantages like
+ * prohibiting stream copy in many cases thus it should only be considered
+ * as a last resort.
+ */
+#define CODEC_CAP_SUBFRAMES        0x0100
+/**
+ * Codec is experimental and is thus avoided in favor of non experimental
+ * encoders
+ */
+#define CODEC_CAP_EXPERIMENTAL     0x0200
+/**
+ * Codec should fill in channel configuration and samplerate instead of container
+ */
+#define CODEC_CAP_CHANNEL_CONF     0x0400
+/**
+ * Codec is able to deal with negative linesizes
+ */
+#define CODEC_CAP_NEG_LINESIZES    0x0800
+/**
+ * Codec supports frame-level multithreading.
+ */
+#define CODEC_CAP_FRAME_THREADS    0x1000
+/**
+ * Codec supports slice-based (or partition-based) multithreading.
+ */
+#define CODEC_CAP_SLICE_THREADS    0x2000
+/**
+ * Codec supports changed parameters at any point.
+ */
+#define CODEC_CAP_PARAM_CHANGE     0x4000
+/**
+ * Codec supports avctx->thread_count == 0 (auto).
+ */
+#define CODEC_CAP_AUTO_THREADS     0x8000
+/**
+ * Audio encoder supports receiving a different number of samples in each call.
+ */
+#define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
+
+//The following defines may change, don't expect compatibility if you use them.
+#define MB_TYPE_INTRA4x4   0x0001
+#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
+#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
+#define MB_TYPE_16x16      0x0008
+#define MB_TYPE_16x8       0x0010
+#define MB_TYPE_8x16       0x0020
+#define MB_TYPE_8x8        0x0040
+#define MB_TYPE_INTERLACED 0x0080
+#define MB_TYPE_DIRECT2    0x0100 //FIXME
+#define MB_TYPE_ACPRED     0x0200
+#define MB_TYPE_GMC        0x0400
+#define MB_TYPE_SKIP       0x0800
+#define MB_TYPE_P0L0       0x1000
+#define MB_TYPE_P1L0       0x2000
+#define MB_TYPE_P0L1       0x4000
+#define MB_TYPE_P1L1       0x8000
+#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
+#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
+#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
+#define MB_TYPE_QUANT      0x00010000
+#define MB_TYPE_CBP        0x00020000
+//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
+
+/**
+ * Pan Scan area.
+ * This specifies the area which should be displayed.
+ * Note there may be multiple such areas for one frame.
+ */
+typedef struct AVPanScan{
+    /**
+     * id
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int id;
+
+    /**
+     * width and height in 1/16 pel
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int width;
+    int height;
+
+    /**
+     * position of the top left corner in 1/16 pel for up to 3 fields/frames
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int16_t position[3][2];
+}AVPanScan;
+
+#define FF_QSCALE_TYPE_MPEG1 0
+#define FF_QSCALE_TYPE_MPEG2 1
+#define FF_QSCALE_TYPE_H264  2
+#define FF_QSCALE_TYPE_VP56  3
+
+#if FF_API_GET_BUFFER
+#define FF_BUFFER_TYPE_INTERNAL 1
+#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
+#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
+#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
+
+#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
+#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
+#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
+#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
+#endif
+
+/**
+ * The decoder will keep a reference to the frame and may reuse it later.
+ */
+#define AV_GET_BUFFER_FLAG_REF (1 << 0)
+
+/**
+ * @defgroup lavc_packet AVPacket
+ *
+ * Types and functions for working with AVPacket.
+ * @{
+ */
+enum AVPacketSideDataType {
+    AV_PKT_DATA_PALETTE,
+    AV_PKT_DATA_NEW_EXTRADATA,
+
+    /**
+     * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
+     * @code
+     * u32le param_flags
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
+     *     s32le channel_count
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
+     *     u64le channel_layout
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
+     *     s32le sample_rate
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
+     *     s32le width
+     *     s32le height
+     * @endcode
+     */
+    AV_PKT_DATA_PARAM_CHANGE,
+
+    /**
+     * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of
+     * structures with info about macroblocks relevant to splitting the
+     * packet into smaller packets on macroblock edges (e.g. as for RFC 2190).
+     * That is, it does not necessarily contain info about all macroblocks,
+     * as long as the distance between macroblocks in the info is smaller
+     * than the target payload size.
+     * Each MB info structure is 12 bytes, and is laid out as follows:
+     * @code
+     * u32le bit offset from the start of the packet
+     * u8    current quantizer at the start of the macroblock
+     * u8    GOB number
+     * u16le macroblock address within the GOB
+     * u8    horizontal MV predictor
+     * u8    vertical MV predictor
+     * u8    horizontal MV predictor for block number 3
+     * u8    vertical MV predictor for block number 3
+     * @endcode
+     */
+    AV_PKT_DATA_H263_MB_INFO,
+};
+
+/**
+ * This structure stores compressed data. It is typically exported by demuxers
+ * and then passed as input to decoders, or received as output from encoders and
+ * then passed to muxers.
+ *
+ * For video, it should typically contain one compressed frame. For audio it may
+ * contain several compressed frames.
+ *
+ * AVPacket is one of the few structs in Libav, whose size is a part of public
+ * ABI. Thus it may be allocated on stack and no new fields can be added to it
+ * without libavcodec and libavformat major bump.
+ *
+ * The semantics of data ownership depends on the buf or destruct (deprecated)
+ * fields. If either is set, the packet data is dynamically allocated and is
+ * valid indefinitely until av_free_packet() is called (which in turn calls
+ * av_buffer_unref()/the destruct callback to free the data). If neither is set,
+ * the packet data is typically backed by some static buffer somewhere and is
+ * only valid for a limited time (e.g. until the next read call when demuxing).
+ *
+ * The side data is always allocated with av_malloc() and is freed in
+ * av_free_packet().
+ */
+typedef struct AVPacket {
+    /**
+     * A reference to the reference-counted buffer where the packet data is
+     * stored.
+     * May be NULL, then the packet data is not reference-counted.
+     */
+    AVBufferRef *buf;
+    /**
+     * Presentation timestamp in AVStream->time_base units; the time at which
+     * the decompressed packet will be presented to the user.
+     * Can be AV_NOPTS_VALUE if it is not stored in the file.
+     * pts MUST be larger or equal to dts as presentation cannot happen before
+     * decompression, unless one wants to view hex dumps. Some formats misuse
+     * the terms dts and pts/cts to mean something different. Such timestamps
+     * must be converted to true pts/dts before they are stored in AVPacket.
+     */
+    int64_t pts;
+    /**
+     * Decompression timestamp in AVStream->time_base units; the time at which
+     * the packet is decompressed.
+     * Can be AV_NOPTS_VALUE if it is not stored in the file.
+     */
+    int64_t dts;
+    uint8_t *data;
+    int   size;
+    int   stream_index;
+    /**
+     * A combination of AV_PKT_FLAG values
+     */
+    int   flags;
+    /**
+     * Additional packet data that can be provided by the container.
+     * Packet can contain several types of side information.
+     */
+    struct {
+        uint8_t *data;
+        int      size;
+        enum AVPacketSideDataType type;
+    } *side_data;
+    int side_data_elems;
+
+    /**
+     * Duration of this packet in AVStream->time_base units, 0 if unknown.
+     * Equals next_pts - this_pts in presentation order.
+     */
+    int   duration;
+#if FF_API_DESTRUCT_PACKET
+    attribute_deprecated
+    void  (*destruct)(struct AVPacket *);
+    attribute_deprecated
+    void  *priv;
+#endif
+    int64_t pos;                            ///< byte position in stream, -1 if unknown
+
+    /**
+     * Time difference in AVStream->time_base units from the pts of this
+     * packet to the point at which the output from the decoder has converged
+     * independent from the availability of previous frames. That is, the
+     * frames are virtually identical no matter if decoding started from
+     * the very first frame or from this keyframe.
+     * Is AV_NOPTS_VALUE if unknown.
+     * This field is not the display duration of the current packet.
+     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+     * set.
+     *
+     * The purpose of this field is to allow seeking in streams that have no
+     * keyframes in the conventional sense. It corresponds to the
+     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
+     * essential for some types of subtitle streams to ensure that all
+     * subtitles are correctly displayed after seeking.
+     */
+    int64_t convergence_duration;
+} AVPacket;
+#define AV_PKT_FLAG_KEY     0x0001 ///< The packet contains a keyframe
+#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
+
+enum AVSideDataParamChangeFlags {
+    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT  = 0x0001,
+    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002,
+    AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE    = 0x0004,
+    AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS     = 0x0008,
+};
+/**
+ * @}
+ */
+
+struct AVCodecInternal;
+
+enum AVFieldOrder {
+    AV_FIELD_UNKNOWN,
+    AV_FIELD_PROGRESSIVE,
+    AV_FIELD_TT,          //< Top coded_first, top displayed first
+    AV_FIELD_BB,          //< Bottom coded first, bottom displayed first
+    AV_FIELD_TB,          //< Top coded first, bottom displayed first
+    AV_FIELD_BT,          //< Bottom coded first, top displayed first
+};
+
+/**
+ * main external API structure.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVCodecContext) must not be used outside libav*.
+ */
+typedef struct AVCodecContext {
+    /**
+     * information on struct for av_log
+     * - set by avcodec_alloc_context3
+     */
+    const AVClass *av_class;
+    int log_level_offset;
+
+    enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
+    const struct AVCodec  *codec;
+    char             codec_name[32];
+    enum AVCodecID     codec_id; /* see AV_CODEC_ID_xxx */
+
+    /**
+     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
+     * This is used to work around some encoder bugs.
+     * A demuxer should set this to what is stored in the field used to identify the codec.
+     * If there are multiple such fields in a container then the demuxer should choose the one
+     * which maximizes the information about the used codec.
+     * If the codec tag field in a container is larger than 32 bits then the demuxer should
+     * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
+     * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
+     * first.
+     * - encoding: Set by user, if not then the default based on codec_id will be used.
+     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
+     */
+    unsigned int codec_tag;
+
+    /**
+     * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
+     * This is used to work around some encoder bugs.
+     * - encoding: unused
+     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
+     */
+    unsigned int stream_codec_tag;
+
+    void *priv_data;
+
+    /**
+     * Private context used for internal data.
+     *
+     * Unlike priv_data, this is not codec-specific. It is used in general
+     * libavcodec functions.
+     */
+    struct AVCodecInternal *internal;
+
+    /**
+     * Private data of the user, can be used to carry app specific stuff.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    void *opaque;
+
+    /**
+     * the average bitrate
+     * - encoding: Set by user; unused for constant quantizer encoding.
+     * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
+     */
+    int bit_rate;
+
+    /**
+     * number of bits the bitstream is allowed to diverge from the reference.
+     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
+     * - encoding: Set by user; unused for constant quantizer encoding.
+     * - decoding: unused
+     */
+    int bit_rate_tolerance;
+
+    /**
+     * Global quality for codecs which cannot change it per frame.
+     * This should be proportional to MPEG-1/2/4 qscale.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int global_quality;
+
+    /**
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int compression_level;
+#define FF_COMPRESSION_DEFAULT -1
+
+    /**
+     * CODEC_FLAG_*.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int flags;
+
+    /**
+     * CODEC_FLAG2_*
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int flags2;
+
+    /**
+     * some codecs need / can use extradata like Huffman tables.
+     * mjpeg: Huffman tables
+     * rv10: additional flags
+     * mpeg4: global headers (they can be in the bitstream or here)
+     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
+     * than extradata_size to avoid prolems if it is read with the bitstream reader.
+     * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
+     * - encoding: Set/allocated/freed by libavcodec.
+     * - decoding: Set/allocated/freed by user.
+     */
+    uint8_t *extradata;
+    int extradata_size;
+
+    /**
+     * This is the fundamental unit of time (in seconds) in terms
+     * of which frame timestamps are represented. For fixed-fps content,
+     * timebase should be 1/framerate and timestamp increments should be
+     * identically 1.
+     * - encoding: MUST be set by user.
+     * - decoding: Set by libavcodec.
+     */
+    AVRational time_base;
+
+    /**
+     * For some codecs, the time base is closer to the field rate than the frame rate.
+     * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
+     * if no telecine is used ...
+     *
+     * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
+     */
+    int ticks_per_frame;
+
+    /**
+     * Codec delay.
+     *
+     * Video:
+     *   Number of frames the decoded output will be delayed relative to the
+     *   encoded input.
+     *
+     * Audio:
+     *   For encoding, this is the number of "priming" samples added to the
+     *   beginning of the stream. The decoded output will be delayed by this
+     *   many samples relative to the input to the encoder. Note that this
+     *   field is purely informational and does not directly affect the pts
+     *   output by the encoder, which should always be based on the actual
+     *   presentation time, including any delay.
+     *   For decoding, this is the number of samples the decoder needs to
+     *   output before the decoder's output is valid. When seeking, you should
+     *   start decoding this many samples prior to your desired seek point.
+     *
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int delay;
+
+
+    /* video only */
+    /**
+     * picture width / height.
+     * - encoding: MUST be set by user.
+     * - decoding: May be set by the user before opening the decoder if known e.g.
+     *             from the container. Some decoders will require the dimensions
+     *             to be set by the caller. During decoding, the decoder may
+     *             overwrite those values as required.
+     */
+    int width, height;
+
+    /**
+     * Bitstream width / height, may be different from width/height e.g. when
+     * the decoded frame is cropped before being output.
+     * - encoding: unused
+     * - decoding: May be set by the user before opening the decoder if known
+     *             e.g. from the container. During decoding, the decoder may
+     *             overwrite those values as required.
+     */
+    int coded_width, coded_height;
+
+#define FF_ASPECT_EXTENDED 15
+
+    /**
+     * the number of pictures in a group of pictures, or 0 for intra_only
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int gop_size;
+
+    /**
+     * Pixel format, see AV_PIX_FMT_xxx.
+     * May be set by the demuxer if known from headers.
+     * May be overriden by the decoder if it knows better.
+     * - encoding: Set by user.
+     * - decoding: Set by user if known, overridden by libavcodec if known
+     */
+    enum AVPixelFormat pix_fmt;
+
+    /**
+     * Motion estimation algorithm used for video coding.
+     * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
+     * 8 (umh), 10 (tesa) [7, 8, 10 are x264 specific]
+     * - encoding: MUST be set by user.
+     * - decoding: unused
+     */
+    int me_method;
+
+    /**
+     * If non NULL, 'draw_horiz_band' is called by the libavcodec
+     * decoder to draw a horizontal band. It improves cache usage. Not
+     * all codecs can do that. You must check the codec capabilities
+     * beforehand.
+     * When multithreading is used, it may be called from multiple threads
+     * at the same time; threads might draw different parts of the same AVFrame,
+     * or multiple AVFrames, and there is no guarantee that slices will be drawn
+     * in order.
+     * The function is also used by hardware acceleration APIs.
+     * It is called at least once during frame decoding to pass
+     * the data needed for hardware render.
+     * In that mode instead of pixel data, AVFrame points to
+     * a structure specific to the acceleration API. The application
+     * reads the structure and can change some fields to indicate progress
+     * or mark state.
+     * - encoding: unused
+     * - decoding: Set by user.
+     * @param height the height of the slice
+     * @param y the y position of the slice
+     * @param type 1->top field, 2->bottom field, 3->frame
+     * @param offset offset into the AVFrame.data from which the slice should be read
+     */
+    void (*draw_horiz_band)(struct AVCodecContext *s,
+                            const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
+                            int y, int type, int height);
+
+    /**
+     * callback to negotiate the pixelFormat
+     * @param fmt is the list of formats which are supported by the codec,
+     * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
+     * The first is always the native one.
+     * @return the chosen format
+     * - encoding: unused
+     * - decoding: Set by user, if not set the native format will be chosen.
+     */
+    enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
+
+    /**
+     * maximum number of B-frames between non-B-frames
+     * Note: The output will be delayed by max_b_frames+1 relative to the input.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int max_b_frames;
+
+    /**
+     * qscale factor between IP and B-frames
+     * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
+     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float b_quant_factor;
+
+    /** obsolete FIXME remove */
+    int rc_strategy;
+#define FF_RC_STRATEGY_XVID 1
+
+    int b_frame_strategy;
+
+    /**
+     * qscale offset between IP and B-frames
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float b_quant_offset;
+
+    /**
+     * Size of the frame reordering buffer in the decoder.
+     * For MPEG-2 it is 1 IPB or 0 low delay IP.
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int has_b_frames;
+
+    /**
+     * 0-> h263 quant 1-> mpeg quant
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mpeg_quant;
+
+    /**
+     * qscale factor between P and I-frames
+     * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
+     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float i_quant_factor;
+
+    /**
+     * qscale offset between P and I-frames
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float i_quant_offset;
+
+    /**
+     * luminance masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float lumi_masking;
+
+    /**
+     * temporary complexity masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float temporal_cplx_masking;
+
+    /**
+     * spatial complexity masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float spatial_cplx_masking;
+
+    /**
+     * p block masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float p_masking;
+
+    /**
+     * darkness masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float dark_masking;
+
+    /**
+     * slice count
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by user (or 0).
+     */
+    int slice_count;
+    /**
+     * prediction method (needed for huffyuv)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+     int prediction_method;
+#define FF_PRED_LEFT   0
+#define FF_PRED_PLANE  1
+#define FF_PRED_MEDIAN 2
+
+    /**
+     * slice offsets in the frame in bytes
+     * - encoding: Set/allocated by libavcodec.
+     * - decoding: Set/allocated by user (or NULL).
+     */
+    int *slice_offset;
+
+    /**
+     * sample aspect ratio (0 if unknown)
+     * That is the width of a pixel divided by the height of the pixel.
+     * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    AVRational sample_aspect_ratio;
+
+    /**
+     * motion estimation comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_cmp;
+    /**
+     * subpixel motion estimation comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_sub_cmp;
+    /**
+     * macroblock comparison function (not supported yet)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_cmp;
+    /**
+     * interlaced DCT comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int ildct_cmp;
+#define FF_CMP_SAD    0
+#define FF_CMP_SSE    1
+#define FF_CMP_SATD   2
+#define FF_CMP_DCT    3
+#define FF_CMP_PSNR   4
+#define FF_CMP_BIT    5
+#define FF_CMP_RD     6
+#define FF_CMP_ZERO   7
+#define FF_CMP_VSAD   8
+#define FF_CMP_VSSE   9
+#define FF_CMP_NSSE   10
+#define FF_CMP_DCTMAX 13
+#define FF_CMP_DCT264 14
+#define FF_CMP_CHROMA 256
+
+    /**
+     * ME diamond size & shape
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int dia_size;
+
+    /**
+     * amount of previous MV predictors (2a+1 x 2a+1 square)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int last_predictor_count;
+
+    /**
+     * prepass for motion estimation
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int pre_me;
+
+    /**
+     * motion estimation prepass comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_pre_cmp;
+
+    /**
+     * ME prepass diamond size & shape
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int pre_dia_size;
+
+    /**
+     * subpel ME quality
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_subpel_quality;
+
+    /**
+     * DTG active format information (additional aspect ratio
+     * information only used in DVB MPEG-2 transport streams)
+     * 0 if not set.
+     *
+     * - encoding: unused
+     * - decoding: Set by decoder.
+     */
+    int dtg_active_format;
+#define FF_DTG_AFD_SAME         8
+#define FF_DTG_AFD_4_3          9
+#define FF_DTG_AFD_16_9         10
+#define FF_DTG_AFD_14_9         11
+#define FF_DTG_AFD_4_3_SP_14_9  13
+#define FF_DTG_AFD_16_9_SP_14_9 14
+#define FF_DTG_AFD_SP_4_3       15
+
+    /**
+     * maximum motion estimation search range in subpel units
+     * If 0 then no limit.
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_range;
+
+    /**
+     * intra quantizer bias
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int intra_quant_bias;
+#define FF_DEFAULT_QUANT_BIAS 999999
+
+    /**
+     * inter quantizer bias
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int inter_quant_bias;
+
+    /**
+     * slice flags
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int slice_flags;
+#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
+#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
+#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
+
+    /**
+     * XVideo Motion Acceleration
+     * - encoding: forbidden
+     * - decoding: set by decoder
+     */
+    int xvmc_acceleration;
+
+    /**
+     * macroblock decision mode
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_decision;
+#define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
+#define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
+#define FF_MB_DECISION_RD     2        ///< rate distortion
+
+    /**
+     * custom intra quantization matrix
+     * - encoding: Set by user, can be NULL.
+     * - decoding: Set by libavcodec.
+     */
+    uint16_t *intra_matrix;
+
+    /**
+     * custom inter quantization matrix
+     * - encoding: Set by user, can be NULL.
+     * - decoding: Set by libavcodec.
+     */
+    uint16_t *inter_matrix;
+
+    /**
+     * scene change detection threshold
+     * 0 is default, larger means fewer detected scene changes.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int scenechange_threshold;
+
+    /**
+     * noise reduction strength
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int noise_reduction;
+
+    /**
+     * Motion estimation threshold below which no motion estimation is
+     * performed, but instead the user specified motion vectors are used.
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_threshold;
+
+    /**
+     * Macroblock threshold below which the user specified macroblock types will be used.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_threshold;
+
+    /**
+     * precision of the intra DC coefficient - 8
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int intra_dc_precision;
+
+    /**
+     * Number of macroblock rows at the top which are skipped.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int skip_top;
+
+    /**
+     * Number of macroblock rows at the bottom which are skipped.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int skip_bottom;
+
+    /**
+     * Border processing masking, raises the quantizer for mbs on the borders
+     * of the picture.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float border_masking;
+
+    /**
+     * minimum MB lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_lmin;
+
+    /**
+     * maximum MB lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_lmax;
+
+    /**
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_penalty_compensation;
+
+    /**
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int bidir_refine;
+
+    /**
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int brd_scale;
+
+    /**
+     * minimum GOP size
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int keyint_min;
+
+    /**
+     * number of reference frames
+     * - encoding: Set by user.
+     * - decoding: Set by lavc.
+     */
+    int refs;
+
+    /**
+     * chroma qp offset from luma
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int chromaoffset;
+
+    /**
+     * Multiplied by qscale for each frame and added to scene_change_score.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int scenechange_factor;
+
+    /**
+     *
+     * Note: Value depends upon the compare function used for fullpel ME.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mv0_threshold;
+
+    /**
+     * Adjust sensitivity of b_frame_strategy 1.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int b_sensitivity;
+
+    /**
+     * Chromaticity coordinates of the source primaries.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorPrimaries color_primaries;
+
+    /**
+     * Color Transfer Characteristic.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorTransferCharacteristic color_trc;
+
+    /**
+     * YUV colorspace type.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorSpace colorspace;
+
+    /**
+     * MPEG vs JPEG YUV range.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorRange color_range;
+
+    /**
+     * This defines the location of chroma samples.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVChromaLocation chroma_sample_location;
+
+    /**
+     * Number of slices.
+     * Indicates number of picture subdivisions. Used for parallelized
+     * decoding.
+     * - encoding: Set by user
+     * - decoding: unused
+     */
+    int slices;
+
+    /** Field order
+     * - encoding: set by libavcodec
+     * - decoding: Set by libavcodec
+     */
+    enum AVFieldOrder field_order;
+
+    /* audio only */
+    int sample_rate; ///< samples per second
+    int channels;    ///< number of audio channels
+
+    /**
+     * audio sample format
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    enum AVSampleFormat sample_fmt;  ///< sample format
+
+    /* The following data should not be initialized. */
+    /**
+     * Number of samples per channel in an audio frame.
+     *
+     * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame
+     *   except the last must contain exactly frame_size samples per channel.
+     *   May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the
+     *   frame size is not restricted.
+     * - decoding: may be set by some decoders to indicate constant frame size
+     */
+    int frame_size;
+
+    /**
+     * Frame counter, set by libavcodec.
+     *
+     * - decoding: total number of frames returned from the decoder so far.
+     * - encoding: total number of frames passed to the encoder so far.
+     *
+     *   @note the counter is not incremented if encoding/decoding resulted in
+     *   an error.
+     */
+    int frame_number;
+
+    /**
+     * number of bytes per packet if constant and known or 0
+     * Used by some WAV based audio codecs.
+     */
+    int block_align;
+
+    /**
+     * Audio cutoff bandwidth (0 means "automatic")
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int cutoff;
+
+#if FF_API_REQUEST_CHANNELS
+    /**
+     * Decoder should decode to this many channels if it can (0 for default)
+     * - encoding: unused
+     * - decoding: Set by user.
+     * @deprecated Deprecated in favor of request_channel_layout.
+     */
+    attribute_deprecated int request_channels;
+#endif
+
+    /**
+     * Audio channel layout.
+     * - encoding: set by user.
+     * - decoding: set by libavcodec.
+     */
+    uint64_t channel_layout;
+
+    /**
+     * Request decoder to use this channel layout if it can (0 for default)
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    uint64_t request_channel_layout;
+
+    /**
+     * Type of service that the audio stream conveys.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    enum AVAudioServiceType audio_service_type;
+
+    /**
+     * Used to request a sample format from the decoder.
+     * - encoding: unused.
+     * - decoding: Set by user.
+     */
+    enum AVSampleFormat request_sample_fmt;
+
+#if FF_API_GET_BUFFER
+    /**
+     * Called at the beginning of each frame to get a buffer for it.
+     *
+     * The function will set AVFrame.data[], AVFrame.linesize[].
+     * AVFrame.extended_data[] must also be set, but it should be the same as
+     * AVFrame.data[] except for planar audio with more channels than can fit
+     * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
+     * many data pointers as it can hold.
+     *
+     * if CODEC_CAP_DR1 is not set then get_buffer() must call
+     * avcodec_default_get_buffer() instead of providing buffers allocated by
+     * some other means.
+     *
+     * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
+     * need it. avcodec_default_get_buffer() aligns the output buffer properly,
+     * but if get_buffer() is overridden then alignment considerations should
+     * be taken into account.
+     *
+     * @see avcodec_default_get_buffer()
+     *
+     * Video:
+     *
+     * If pic.reference is set then the frame will be read later by libavcodec.
+     * avcodec_align_dimensions2() should be used to find the required width and
+     * height, as they normally need to be rounded up to the next multiple of 16.
+     *
+     * If frame multithreading is used and thread_safe_callbacks is set,
+     * it may be called from a different thread, but not from more than one at
+     * once. Does not need to be reentrant.
+     *
+     * @see release_buffer(), reget_buffer()
+     * @see avcodec_align_dimensions2()
+     *
+     * Audio:
+     *
+     * Decoders request a buffer of a particular size by setting
+     * AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
+     * however, utilize only part of the buffer by setting AVFrame.nb_samples
+     * to a smaller value in the output frame.
+     *
+     * Decoders cannot use the buffer after returning from
+     * avcodec_decode_audio4(), so they will not call release_buffer(), as it
+     * is assumed to be released immediately upon return. In some rare cases,
+     * a decoder may need to call get_buffer() more than once in a single
+     * call to avcodec_decode_audio4(). In that case, when get_buffer() is
+     * called again after it has already been called once, the previously
+     * acquired buffer is assumed to be released at that time and may not be
+     * reused by the decoder.
+     *
+     * As a convenience, av_samples_get_buffer_size() and
+     * av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
+     * functions to find the required data size and to fill data pointers and
+     * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
+     * since all planes must be the same size.
+     *
+     * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     *
+     * @deprecated use get_buffer2()
+     */
+    attribute_deprecated
+    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
+
+    /**
+     * Called to release buffers which were allocated with get_buffer.
+     * A released buffer can be reused in get_buffer().
+     * pic.data[*] must be set to NULL.
+     * May be called from a different thread if frame multithreading is used,
+     * but not by more than one thread at once, so does not need to be reentrant.
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     *
+     * @deprecated custom freeing callbacks should be set from get_buffer2()
+     */
+    attribute_deprecated
+    void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
+
+    /**
+     * Called at the beginning of a frame to get cr buffer for it.
+     * Buffer type (size, hints) must be the same. libavcodec won't check it.
+     * libavcodec will pass previous buffer in pic, function should return
+     * same buffer or new buffer with old frame "painted" into it.
+     * If pic.data[0] == NULL must behave like get_buffer().
+     * if CODEC_CAP_DR1 is not set then reget_buffer() must call
+     * avcodec_default_reget_buffer() instead of providing buffers allocated by
+     * some other means.
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     */
+    attribute_deprecated
+    int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
+#endif
+
+    /**
+     * This callback is called at the beginning of each frame to get data
+     * buffer(s) for it. There may be one contiguous buffer for all the data or
+     * there may be a buffer per each data plane or anything in between. What
+     * this means is, you may set however many entries in buf[] you feel necessary.
+     * Each buffer must be reference-counted using the AVBuffer API (see description
+     * of buf[] below).
+     *
+     * The following fields will be set in the frame before this callback is
+     * called:
+     * - format
+     * - width, height (video only)
+     * - sample_rate, channel_layout, nb_samples (audio only)
+     * Their values may differ from the corresponding values in
+     * AVCodecContext. This callback must use the frame values, not the codec
+     * context values, to calculate the required buffer size.
+     *
+     * This callback must fill the following fields in the frame:
+     * - data[]
+     * - linesize[]
+     * - extended_data:
+     *   * if the data is planar audio with more than 8 channels, then this
+     *     callback must allocate and fill extended_data to contain all pointers
+     *     to all data planes. data[] must hold as many pointers as it can.
+     *     extended_data must be allocated with av_malloc() and will be freed in
+     *     av_frame_unref().
+     *   * otherwise exended_data must point to data
+     * - buf[] must contain one or more pointers to AVBufferRef structures. Each of
+     *   the frame's data and extended_data pointers must be contained in these. That
+     *   is, one AVBufferRef for each allocated chunk of memory, not necessarily one
+     *   AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(),
+     *   and av_buffer_ref().
+     * - extended_buf and nb_extended_buf must be allocated with av_malloc() by
+     *   this callback and filled with the extra buffers if there are more
+     *   buffers than buf[] can hold. extended_buf will be freed in
+     *   av_frame_unref().
+     *
+     * If CODEC_CAP_DR1 is not set then get_buffer2() must call
+     * avcodec_default_get_buffer2() instead of providing buffers allocated by
+     * some other means.
+     *
+     * Each data plane must be aligned to the maximum required by the target
+     * CPU.
+     *
+     * @see avcodec_default_get_buffer2()
+     *
+     * Video:
+     *
+     * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused
+     * (read and/or written to if it is writable) later by libavcodec.
+     *
+     * If CODEC_FLAG_EMU_EDGE is not set in s->flags, the buffer must contain an
+     * edge of the size returned by avcodec_get_edge_width() on all sides.
+     *
+     * avcodec_align_dimensions2() should be used to find the required width and
+     * height, as they normally need to be rounded up to the next multiple of 16.
+     *
+     * If frame multithreading is used and thread_safe_callbacks is set,
+     * this callback may be called from a different thread, but not from more
+     * than one at once. Does not need to be reentrant.
+     *
+     * @see avcodec_align_dimensions2()
+     *
+     * Audio:
+     *
+     * Decoders request a buffer of a particular size by setting
+     * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may,
+     * however, utilize only part of the buffer by setting AVFrame.nb_samples
+     * to a smaller value in the output frame.
+     *
+     * As a convenience, av_samples_get_buffer_size() and
+     * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2()
+     * functions to find the required data size and to fill data pointers and
+     * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
+     * since all planes must be the same size.
+     *
+     * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
+
+    /**
+     * If non-zero, the decoded audio and video frames returned from
+     * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted
+     * and are valid indefinitely. The caller must free them with
+     * av_frame_unref() when they are not needed anymore.
+     * Otherwise, the decoded frames must not be freed by the caller and are
+     * only valid until the next decode call.
+     *
+     * - encoding: unused
+     * - decoding: set by the caller before avcodec_open2().
+     */
+    int refcounted_frames;
+
+    /* - encoding parameters */
+    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
+    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
+
+    /**
+     * minimum quantizer
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int qmin;
+
+    /**
+     * maximum quantizer
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int qmax;
+
+    /**
+     * maximum quantizer difference between frames
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int max_qdiff;
+
+    /**
+     * ratecontrol qmin qmax limiting method
+     * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float rc_qsquish;
+
+    float rc_qmod_amp;
+    int rc_qmod_freq;
+
+    /**
+     * decoder bitstream buffer size
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_buffer_size;
+
+    /**
+     * ratecontrol override, see RcOverride
+     * - encoding: Allocated/set/freed by user.
+     * - decoding: unused
+     */
+    int rc_override_count;
+    RcOverride *rc_override;
+
+    /**
+     * rate control equation
+     * - encoding: Set by user
+     * - decoding: unused
+     */
+    const char *rc_eq;
+
+    /**
+     * maximum bitrate
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_max_rate;
+
+    /**
+     * minimum bitrate
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_min_rate;
+
+    float rc_buffer_aggressivity;
+
+    /**
+     * initial complexity for pass1 ratecontrol
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float rc_initial_cplx;
+
+    /**
+     * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
+     * - encoding: Set by user.
+     * - decoding: unused.
+     */
+    float rc_max_available_vbv_use;
+
+    /**
+     * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
+     * - encoding: Set by user.
+     * - decoding: unused.
+     */
+    float rc_min_vbv_overflow_use;
+
+    /**
+     * Number of bits which should be loaded into the rc buffer before decoding starts.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_initial_buffer_occupancy;
+
+#define FF_CODER_TYPE_VLC       0
+#define FF_CODER_TYPE_AC        1
+#define FF_CODER_TYPE_RAW       2
+#define FF_CODER_TYPE_RLE       3
+#define FF_CODER_TYPE_DEFLATE   4
+    /**
+     * coder type
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int coder_type;
+
+    /**
+     * context model
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int context_model;
+
+    /**
+     * minimum Lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int lmin;
+
+    /**
+     * maximum Lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int lmax;
+
+    /**
+     * frame skip threshold
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_threshold;
+
+    /**
+     * frame skip factor
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_factor;
+
+    /**
+     * frame skip exponent
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_exp;
+
+    /**
+     * frame skip comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_cmp;
+
+    /**
+     * trellis RD quantization
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int trellis;
+
+    /**
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int min_prediction_order;
+
+    /**
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int max_prediction_order;
+
+    /**
+     * GOP timecode frame start number, in non drop frame format
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int64_t timecode_frame_start;
+
+    /* The RTP callback: This function is called    */
+    /* every time the encoder has a packet to send. */
+    /* It depends on the encoder if the data starts */
+    /* with a Start Code (it should). H.263 does.   */
+    /* mb_nb contains the number of macroblocks     */
+    /* encoded in the RTP payload.                  */
+    void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
+
+    int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
+                            /* do its best to deliver a chunk with size     */
+                            /* below rtp_payload_size, the chunk will start */
+                            /* with a start code on some codecs like H.263. */
+                            /* This doesn't take account of any particular  */
+                            /* headers inside the transmitted RTP payload.  */
+
+    /* statistics, used for 2-pass encoding */
+    int mv_bits;
+    int header_bits;
+    int i_tex_bits;
+    int p_tex_bits;
+    int i_count;
+    int p_count;
+    int skip_count;
+    int misc_bits;
+
+    /**
+     * number of bits used for the previously encoded frame
+     * - encoding: Set by libavcodec.
+     * - decoding: unused
+     */
+    int frame_bits;
+
+    /**
+     * pass1 encoding statistics output buffer
+     * - encoding: Set by libavcodec.
+     * - decoding: unused
+     */
+    char *stats_out;
+
+    /**
+     * pass2 encoding statistics input buffer
+     * Concatenated stuff from stats_out of pass1 should be placed here.
+     * - encoding: Allocated/set/freed by user.
+     * - decoding: unused
+     */
+    char *stats_in;
+
+    /**
+     * Work around bugs in encoders which sometimes cannot be detected automatically.
+     * - encoding: Set by user
+     * - decoding: Set by user
+     */
+    int workaround_bugs;
+#define FF_BUG_AUTODETECT       1  ///< autodetection
+#define FF_BUG_OLD_MSMPEG4      2
+#define FF_BUG_XVID_ILACE       4
+#define FF_BUG_UMP4             8
+#define FF_BUG_NO_PADDING       16
+#define FF_BUG_AMV              32
+#define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
+#define FF_BUG_QPEL_CHROMA      64
+#define FF_BUG_STD_QPEL         128
+#define FF_BUG_QPEL_CHROMA2     256
+#define FF_BUG_DIRECT_BLOCKSIZE 512
+#define FF_BUG_EDGE             1024
+#define FF_BUG_HPEL_CHROMA      2048
+#define FF_BUG_DC_CLIP          4096
+#define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
+#define FF_BUG_TRUNCATED       16384
+
+    /**
+     * strictly follow the standard (MPEG4, ...).
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     * Setting this to STRICT or higher means the encoder and decoder will
+     * generally do stupid things, whereas setting it to unofficial or lower
+     * will mean the encoder might produce output that is not supported by all
+     * spec-compliant decoders. Decoders don't differentiate between normal,
+     * unofficial and experimental (that is, they always try to decode things
+     * when they can) unless they are explicitly asked to behave stupidly
+     * (=strictly conform to the specs)
+     */
+    int strict_std_compliance;
+#define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to an older more strict version of the spec or reference software.
+#define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
+#define FF_COMPLIANCE_NORMAL        0
+#define FF_COMPLIANCE_UNOFFICIAL   -1 ///< Allow unofficial extensions
+#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
+
+    /**
+     * error concealment flags
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int error_concealment;
+#define FF_EC_GUESS_MVS   1
+#define FF_EC_DEBLOCK     2
+
+    /**
+     * debug
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int debug;
+#define FF_DEBUG_PICT_INFO   1
+#define FF_DEBUG_RC          2
+#define FF_DEBUG_BITSTREAM   4
+#define FF_DEBUG_MB_TYPE     8
+#define FF_DEBUG_QP          16
+#define FF_DEBUG_MV          32
+#define FF_DEBUG_DCT_COEFF   0x00000040
+#define FF_DEBUG_SKIP        0x00000080
+#define FF_DEBUG_STARTCODE   0x00000100
+#define FF_DEBUG_PTS         0x00000200
+#define FF_DEBUG_ER          0x00000400
+#define FF_DEBUG_MMCO        0x00000800
+#define FF_DEBUG_BUGS        0x00001000
+#define FF_DEBUG_VIS_QP      0x00002000
+#define FF_DEBUG_VIS_MB_TYPE 0x00004000
+#define FF_DEBUG_BUFFERS     0x00008000
+#define FF_DEBUG_THREADS     0x00010000
+
+    /**
+     * debug
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int debug_mv;
+#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
+#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
+#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
+
+    /**
+     * Error recognition; may misdetect some more or less valid parts as errors.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int err_recognition;
+#define AV_EF_CRCCHECK  (1<<0)
+#define AV_EF_BITSTREAM (1<<1)
+#define AV_EF_BUFFER    (1<<2)
+#define AV_EF_EXPLODE   (1<<3)
+
+    /**
+     * opaque 64bit number (generally a PTS) that will be reordered and
+     * output in AVFrame.reordered_opaque
+     * @deprecated in favor of pkt_pts
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int64_t reordered_opaque;
+
+    /**
+     * Hardware accelerator in use
+     * - encoding: unused.
+     * - decoding: Set by libavcodec
+     */
+    struct AVHWAccel *hwaccel;
+
+    /**
+     * Hardware accelerator context.
+     * For some hardware accelerators, a global context needs to be
+     * provided by the user. In that case, this holds display-dependent
+     * data Libav cannot instantiate itself. Please refer to the
+     * Libav HW accelerator documentation to know how to fill this
+     * is. e.g. for VA API, this is a struct vaapi_context.
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    void *hwaccel_context;
+
+    /**
+     * error
+     * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
+     * - decoding: unused
+     */
+    uint64_t error[AV_NUM_DATA_POINTERS];
+
+    /**
+     * DCT algorithm, see FF_DCT_* below
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int dct_algo;
+#define FF_DCT_AUTO    0
+#define FF_DCT_FASTINT 1
+#define FF_DCT_INT     2
+#define FF_DCT_MMX     3
+#define FF_DCT_ALTIVEC 5
+#define FF_DCT_FAAN    6
+
+    /**
+     * IDCT algorithm, see FF_IDCT_* below.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int idct_algo;
+#define FF_IDCT_AUTO          0
+#define FF_IDCT_INT           1
+#define FF_IDCT_SIMPLE        2
+#define FF_IDCT_SIMPLEMMX     3
+#define FF_IDCT_ARM           7
+#define FF_IDCT_ALTIVEC       8
+#define FF_IDCT_SH4           9
+#define FF_IDCT_SIMPLEARM     10
+#define FF_IDCT_IPP           13
+#define FF_IDCT_XVIDMMX       14
+#define FF_IDCT_SIMPLEARMV5TE 16
+#define FF_IDCT_SIMPLEARMV6   17
+#define FF_IDCT_SIMPLEVIS     18
+#define FF_IDCT_FAAN          20
+#define FF_IDCT_SIMPLENEON    22
+#define FF_IDCT_SIMPLEALPHA   23
+
+    /**
+     * bits per sample/pixel from the demuxer (needed for huffyuv).
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by user.
+     */
+     int bits_per_coded_sample;
+
+    /**
+     * Bits per sample/pixel of internal libavcodec pixel/sample format.
+     * - encoding: set by user.
+     * - decoding: set by libavcodec.
+     */
+    int bits_per_raw_sample;
+
+#if FF_API_LOWRES
+    /**
+     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
+     * - encoding: unused
+     * - decoding: Set by user.
+     *
+     * @deprecated use decoder private options instead
+     */
+    attribute_deprecated int lowres;
+#endif
+
+    /**
+     * the picture in the bitstream
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    AVFrame *coded_frame;
+
+    /**
+     * thread count
+     * is used to decide how many independent tasks should be passed to execute()
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int thread_count;
+
+    /**
+     * Which multithreading methods to use.
+     * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread,
+     * so clients which cannot provide future frames should not use it.
+     *
+     * - encoding: Set by user, otherwise the default is used.
+     * - decoding: Set by user, otherwise the default is used.
+     */
+    int thread_type;
+#define FF_THREAD_FRAME   1 ///< Decode more than one frame at once
+#define FF_THREAD_SLICE   2 ///< Decode more than one part of a single frame at once
+
+    /**
+     * Which multithreading methods are in use by the codec.
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int active_thread_type;
+
+    /**
+     * Set by the client if its custom get_buffer() callback can be called
+     * synchronously from another thread, which allows faster multithreaded decoding.
+     * draw_horiz_band() will be called from other threads regardless of this setting.
+     * Ignored if the default get_buffer() is used.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int thread_safe_callbacks;
+
+    /**
+     * The codec may call this to execute several independent things.
+     * It will return only after finishing all tasks.
+     * The user may replace this with some multithreaded implementation,
+     * the default implementation will execute the parts serially.
+     * @param count the number of things to execute
+     * - encoding: Set by libavcodec, user can override.
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
+
+    /**
+     * The codec may call this to execute several independent things.
+     * It will return only after finishing all tasks.
+     * The user may replace this with some multithreaded implementation,
+     * the default implementation will execute the parts serially.
+     * Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
+     * @param c context passed also to func
+     * @param count the number of things to execute
+     * @param arg2 argument passed unchanged to func
+     * @param ret return values of executed functions, must have space for "count" values. May be NULL.
+     * @param func function that will be called count times, with jobnr from 0 to count-1.
+     *             threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
+     *             two instances of func executing at the same time will have the same threadnr.
+     * @return always 0 currently, but code should handle a future improvement where when any call to func
+     *         returns < 0 no further calls to func may be done and < 0 is returned.
+     * - encoding: Set by libavcodec, user can override.
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
+
+    /**
+     * thread opaque
+     * Can be used by execute() to store some per AVCodecContext stuff.
+     * - encoding: set by execute()
+     * - decoding: set by execute()
+     */
+    void *thread_opaque;
+
+    /**
+     * noise vs. sse weight for the nsse comparsion function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+     int nsse_weight;
+
+    /**
+     * profile
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+     int profile;
+#define FF_PROFILE_UNKNOWN -99
+#define FF_PROFILE_RESERVED -100
+
+#define FF_PROFILE_AAC_MAIN 0
+#define FF_PROFILE_AAC_LOW  1
+#define FF_PROFILE_AAC_SSR  2
+#define FF_PROFILE_AAC_LTP  3
+#define FF_PROFILE_AAC_HE   4
+#define FF_PROFILE_AAC_HE_V2 28
+#define FF_PROFILE_AAC_LD   22
+#define FF_PROFILE_AAC_ELD  38
+#define FF_PROFILE_MPEG2_AAC_LOW 128
+#define FF_PROFILE_MPEG2_AAC_HE  131
+
+#define FF_PROFILE_DTS         20
+#define FF_PROFILE_DTS_ES      30
+#define FF_PROFILE_DTS_96_24   40
+#define FF_PROFILE_DTS_HD_HRA  50
+#define FF_PROFILE_DTS_HD_MA   60
+
+#define FF_PROFILE_MPEG2_422    0
+#define FF_PROFILE_MPEG2_HIGH   1
+#define FF_PROFILE_MPEG2_SS     2
+#define FF_PROFILE_MPEG2_SNR_SCALABLE  3
+#define FF_PROFILE_MPEG2_MAIN   4
+#define FF_PROFILE_MPEG2_SIMPLE 5
+
+#define FF_PROFILE_H264_CONSTRAINED  (1<<9)  // 8+1; constraint_set1_flag
+#define FF_PROFILE_H264_INTRA        (1<<11) // 8+3; constraint_set3_flag
+
+#define FF_PROFILE_H264_BASELINE             66
+#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
+#define FF_PROFILE_H264_MAIN                 77
+#define FF_PROFILE_H264_EXTENDED             88
+#define FF_PROFILE_H264_HIGH                 100
+#define FF_PROFILE_H264_HIGH_10              110
+#define FF_PROFILE_H264_HIGH_10_INTRA        (110|FF_PROFILE_H264_INTRA)
+#define FF_PROFILE_H264_HIGH_422             122
+#define FF_PROFILE_H264_HIGH_422_INTRA       (122|FF_PROFILE_H264_INTRA)
+#define FF_PROFILE_H264_HIGH_444             144
+#define FF_PROFILE_H264_HIGH_444_PREDICTIVE  244
+#define FF_PROFILE_H264_HIGH_444_INTRA       (244|FF_PROFILE_H264_INTRA)
+#define FF_PROFILE_H264_CAVLC_444            44
+
+#define FF_PROFILE_VC1_SIMPLE   0
+#define FF_PROFILE_VC1_MAIN     1
+#define FF_PROFILE_VC1_COMPLEX  2
+#define FF_PROFILE_VC1_ADVANCED 3
+
+#define FF_PROFILE_MPEG4_SIMPLE                     0
+#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE            1
+#define FF_PROFILE_MPEG4_CORE                       2
+#define FF_PROFILE_MPEG4_MAIN                       3
+#define FF_PROFILE_MPEG4_N_BIT                      4
+#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE           5
+#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION      6
+#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE     7
+#define FF_PROFILE_MPEG4_HYBRID                     8
+#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME         9
+#define FF_PROFILE_MPEG4_CORE_SCALABLE             10
+#define FF_PROFILE_MPEG4_ADVANCED_CODING           11
+#define FF_PROFILE_MPEG4_ADVANCED_CORE             12
+#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
+#define FF_PROFILE_MPEG4_SIMPLE_STUDIO             14
+#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE           15
+
+#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0   0
+#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1   1
+#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION  2
+#define FF_PROFILE_JPEG2000_DCINEMA_2K              3
+#define FF_PROFILE_JPEG2000_DCINEMA_4K              4
+
+    /**
+     * level
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+     int level;
+#define FF_LEVEL_UNKNOWN -99
+
+    /**
+     *
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    enum AVDiscard skip_loop_filter;
+
+    /**
+     *
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    enum AVDiscard skip_idct;
+
+    /**
+     *
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    enum AVDiscard skip_frame;
+
+    /**
+     * Header containing style information for text subtitles.
+     * For SUBTITLE_ASS subtitle type, it should contain the whole ASS
+     * [Script Info] and [V4+ Styles] section, plus the [Events] line and
+     * the Format line following. It shouldn't include any Dialogue line.
+     * - encoding: Set/allocated/freed by user (before avcodec_open2())
+     * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
+     */
+    uint8_t *subtitle_header;
+    int subtitle_header_size;
+
+    /**
+     * Simulates errors in the bitstream to test error concealment.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int error_rate;
+
+    /**
+     * Current packet as passed into the decoder, to avoid having
+     * to pass the packet into every function. Currently only valid
+     * inside lavc and get/release_buffer callbacks.
+     * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
+     * - encoding: unused
+     */
+    AVPacket *pkt;
+
+    /**
+     * VBV delay coded in the last frame (in periods of a 27 MHz clock).
+     * Used for compliant TS muxing.
+     * - encoding: Set by libavcodec.
+     * - decoding: unused.
+     */
+    uint64_t vbv_delay;
+} AVCodecContext;
+
+/**
+ * AVProfile.
+ */
+typedef struct AVProfile {
+    int profile;
+    const char *name; ///< short name for the profile
+} AVProfile;
+
+typedef struct AVCodecDefault AVCodecDefault;
+
+struct AVSubtitle;
+
+/**
+ * AVCodec.
+ */
+typedef struct AVCodec {
+    /**
+     * Name of the codec implementation.
+     * The name is globally unique among encoders and among decoders (but an
+     * encoder and a decoder can share the same name).
+     * This is the primary way to find a codec from the user perspective.
+     */
+    const char *name;
+    /**
+     * Descriptive name for the codec, meant to be more human readable than name.
+     * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
+     */
+    const char *long_name;
+    enum AVMediaType type;
+    enum AVCodecID id;
+    /**
+     * Codec capabilities.
+     * see CODEC_CAP_*
+     */
+    int capabilities;
+    const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
+    const enum AVPixelFormat *pix_fmts;     ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
+    const int *supported_samplerates;       ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
+    const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
+    const uint64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
+    attribute_deprecated uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
+    const AVClass *priv_class;              ///< AVClass for the private context
+    const AVProfile *profiles;              ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
+
+    /*****************************************************************
+     * No fields below this line are part of the public API. They
+     * may not be used outside of libavcodec and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+    int priv_data_size;
+    struct AVCodec *next;
+    /**
+     * @name Frame-level threading support functions
+     * @{
+     */
+    /**
+     * If defined, called on thread contexts when they are created.
+     * If the codec allocates writable tables in init(), re-allocate them here.
+     * priv_data will be set to a copy of the original.
+     */
+    int (*init_thread_copy)(AVCodecContext *);
+    /**
+     * Copy necessary context variables from a previous thread context to the current one.
+     * If not defined, the next thread will start automatically; otherwise, the codec
+     * must call ff_thread_finish_setup().
+     *
+     * dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
+     */
+    int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
+    /** @} */
+
+    /**
+     * Private codec-specific defaults.
+     */
+    const AVCodecDefault *defaults;
+
+    /**
+     * Initialize codec static data, called from avcodec_register().
+     */
+    void (*init_static_data)(struct AVCodec *codec);
+
+    int (*init)(AVCodecContext *);
+    int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
+                      const struct AVSubtitle *sub);
+    /**
+     * Encode data to an AVPacket.
+     *
+     * @param      avctx          codec context
+     * @param      avpkt          output AVPacket (may contain a user-provided buffer)
+     * @param[in]  frame          AVFrame containing the raw data to be encoded
+     * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
+     *                            non-empty packet was returned in avpkt.
+     * @return 0 on success, negative error code on failure
+     */
+    int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
+                   int *got_packet_ptr);
+    int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
+    int (*close)(AVCodecContext *);
+    /**
+     * Flush buffers.
+     * Will be called when seeking
+     */
+    void (*flush)(AVCodecContext *);
+} AVCodec;
+
+/**
+ * AVHWAccel.
+ */
+typedef struct AVHWAccel {
+    /**
+     * Name of the hardware accelerated codec.
+     * The name is globally unique among encoders and among decoders (but an
+     * encoder and a decoder can share the same name).
+     */
+    const char *name;
+
+    /**
+     * Type of codec implemented by the hardware accelerator.
+     *
+     * See AVMEDIA_TYPE_xxx
+     */
+    enum AVMediaType type;
+
+    /**
+     * Codec implemented by the hardware accelerator.
+     *
+     * See AV_CODEC_ID_xxx
+     */
+    enum AVCodecID id;
+
+    /**
+     * Supported pixel format.
+     *
+     * Only hardware accelerated formats are supported here.
+     */
+    enum AVPixelFormat pix_fmt;
+
+    /**
+     * Hardware accelerated codec capabilities.
+     * see FF_HWACCEL_CODEC_CAP_*
+     */
+    int capabilities;
+
+    struct AVHWAccel *next;
+
+    /**
+     * Called at the beginning of each frame or field picture.
+     *
+     * Meaningful frame information (codec specific) is guaranteed to
+     * be parsed at this point. This function is mandatory.
+     *
+     * Note that buf can be NULL along with buf_size set to 0.
+     * Otherwise, this means the whole frame is available at this point.
+     *
+     * @param avctx the codec context
+     * @param buf the frame data buffer base
+     * @param buf_size the size of the frame in bytes
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
+
+    /**
+     * Callback for each slice.
+     *
+     * Meaningful slice information (codec specific) is guaranteed to
+     * be parsed at this point. This function is mandatory.
+     *
+     * @param avctx the codec context
+     * @param buf the slice data buffer base
+     * @param buf_size the size of the slice in bytes
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
+
+    /**
+     * Called at the end of each frame or field picture.
+     *
+     * The whole picture is parsed at this point and can now be sent
+     * to the hardware accelerator. This function is mandatory.
+     *
+     * @param avctx the codec context
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*end_frame)(AVCodecContext *avctx);
+
+    /**
+     * Size of HW accelerator private data.
+     *
+     * Private data is allocated with av_mallocz() before
+     * AVCodecContext.get_buffer() and deallocated after
+     * AVCodecContext.release_buffer().
+     */
+    int priv_data_size;
+} AVHWAccel;
+
+/**
+ * @defgroup lavc_picture AVPicture
+ *
+ * Functions for working with AVPicture
+ * @{
+ */
+
+/**
+ * four components are given, that's all.
+ * the last component is alpha
+ */
+typedef struct AVPicture {
+    uint8_t *data[AV_NUM_DATA_POINTERS];
+    int linesize[AV_NUM_DATA_POINTERS];     ///< number of bytes per line
+} AVPicture;
+
+/**
+ * @}
+ */
+
+#define AVPALETTE_SIZE 1024
+#define AVPALETTE_COUNT 256
+
+enum AVSubtitleType {
+    SUBTITLE_NONE,
+
+    SUBTITLE_BITMAP,                ///< A bitmap, pict will be set
+
+    /**
+     * Plain text, the text field must be set by the decoder and is
+     * authoritative. ass and pict fields may contain approximations.
+     */
+    SUBTITLE_TEXT,
+
+    /**
+     * Formatted text, the ass field must be set by the decoder and is
+     * authoritative. pict and text fields may contain approximations.
+     */
+    SUBTITLE_ASS,
+};
+
+#define AV_SUBTITLE_FLAG_FORCED 0x00000001
+
+typedef struct AVSubtitleRect {
+    int x;         ///< top left corner  of pict, undefined when pict is not set
+    int y;         ///< top left corner  of pict, undefined when pict is not set
+    int w;         ///< width            of pict, undefined when pict is not set
+    int h;         ///< height           of pict, undefined when pict is not set
+    int nb_colors; ///< number of colors in pict, undefined when pict is not set
+
+    /**
+     * data+linesize for the bitmap of this subtitle.
+     * can be set for text/ass as well once they where rendered
+     */
+    AVPicture pict;
+    enum AVSubtitleType type;
+
+    char *text;                     ///< 0 terminated plain UTF-8 text
+
+    /**
+     * 0 terminated ASS/SSA compatible event line.
+     * The pressentation of this is unaffected by the other values in this
+     * struct.
+     */
+    char *ass;
+    int flags;
+} AVSubtitleRect;
+
+typedef struct AVSubtitle {
+    uint16_t format; /* 0 = graphics */
+    uint32_t start_display_time; /* relative to packet pts, in ms */
+    uint32_t end_display_time; /* relative to packet pts, in ms */
+    unsigned num_rects;
+    AVSubtitleRect **rects;
+    int64_t pts;    ///< Same as packet pts, in AV_TIME_BASE
+} AVSubtitle;
+
+/**
+ * If c is NULL, returns the first registered codec,
+ * if c is non-NULL, returns the next registered codec after c,
+ * or NULL if c is the last one.
+ */
+AVCodec *av_codec_next(const AVCodec *c);
+
+/**
+ * Return the LIBAVCODEC_VERSION_INT constant.
+ */
+unsigned avcodec_version(void);
+
+/**
+ * Return the libavcodec build-time configuration.
+ */
+const char *avcodec_configuration(void);
+
+/**
+ * Return the libavcodec license.
+ */
+const char *avcodec_license(void);
+
+/**
+ * Register the codec codec and initialize libavcodec.
+ *
+ * @warning either this function or avcodec_register_all() must be called
+ * before any other libavcodec functions.
+ *
+ * @see avcodec_register_all()
+ */
+void avcodec_register(AVCodec *codec);
+
+/**
+ * Register all the codecs, parsers and bitstream filters which were enabled at
+ * configuration time. If you do not call this function you can select exactly
+ * which formats you want to support, by using the individual registration
+ * functions.
+ *
+ * @see avcodec_register
+ * @see av_register_codec_parser
+ * @see av_register_bitstream_filter
+ */
+void avcodec_register_all(void);
+
+/**
+ * Allocate an AVCodecContext and set its fields to default values.  The
+ * resulting struct can be deallocated by calling avcodec_close() on it followed
+ * by av_free().
+ *
+ * @param codec if non-NULL, allocate private data and initialize defaults
+ *              for the given codec. It is illegal to then call avcodec_open2()
+ *              with a different codec.
+ *              If NULL, then the codec-specific defaults won't be initialized,
+ *              which may result in suboptimal default settings (this is
+ *              important mainly for encoders, e.g. libx264).
+ *
+ * @return An AVCodecContext filled with default values or NULL on failure.
+ * @see avcodec_get_context_defaults
+ */
+AVCodecContext *avcodec_alloc_context3(const AVCodec *codec);
+
+/**
+ * Set the fields of the given AVCodecContext to default values corresponding
+ * to the given codec (defaults may be codec-dependent).
+ *
+ * Do not call this function if a non-NULL codec has been passed
+ * to avcodec_alloc_context3() that allocated this AVCodecContext.
+ * If codec is non-NULL, it is illegal to call avcodec_open2() with a
+ * different codec on this AVCodecContext.
+ */
+int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec);
+
+/**
+ * Get the AVClass for AVCodecContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avcodec_get_class(void);
+
+/**
+ * Copy the settings of the source AVCodecContext into the destination
+ * AVCodecContext. The resulting destination codec context will be
+ * unopened, i.e. you are required to call avcodec_open2() before you
+ * can use this AVCodecContext to decode/encode video/audio data.
+ *
+ * @param dest target codec context, should be initialized with
+ *             avcodec_alloc_context3(), but otherwise uninitialized
+ * @param src source codec context
+ * @return AVERROR() on error (e.g. memory allocation error), 0 on success
+ */
+int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
+
+/**
+ * Allocate an AVFrame and set its fields to default values.  The resulting
+ * struct must be freed using avcodec_free_frame().
+ *
+ * @return An AVFrame filled with default values or NULL on failure.
+ * @see avcodec_get_frame_defaults
+ */
+AVFrame *avcodec_alloc_frame(void);
+
+/**
+ * Set the fields of the given AVFrame to default values.
+ *
+ * @param frame The AVFrame of which the fields should be set to default values.
+ */
+void avcodec_get_frame_defaults(AVFrame *frame);
+
+/**
+ * Free the frame and any dynamically allocated objects in it,
+ * e.g. extended_data.
+ *
+ * @param frame frame to be freed. The pointer will be set to NULL.
+ *
+ * @warning this function does NOT free the data buffers themselves
+ * (it does not know how, since they might have been allocated with
+ *  a custom get_buffer()).
+ */
+void avcodec_free_frame(AVFrame **frame);
+
+/**
+ * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
+ * function the context has to be allocated with avcodec_alloc_context3().
+ *
+ * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
+ * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
+ * retrieving a codec.
+ *
+ * @warning This function is not thread safe!
+ *
+ * @code
+ * avcodec_register_all();
+ * av_dict_set(&opts, "b", "2.5M", 0);
+ * codec = avcodec_find_decoder(AV_CODEC_ID_H264);
+ * if (!codec)
+ *     exit(1);
+ *
+ * context = avcodec_alloc_context3(codec);
+ *
+ * if (avcodec_open2(context, codec, opts) < 0)
+ *     exit(1);
+ * @endcode
+ *
+ * @param avctx The context to initialize.
+ * @param codec The codec to open this context for. If a non-NULL codec has been
+ *              previously passed to avcodec_alloc_context3() or
+ *              avcodec_get_context_defaults3() for this context, then this
+ *              parameter MUST be either NULL or equal to the previously passed
+ *              codec.
+ * @param options A dictionary filled with AVCodecContext and codec-private options.
+ *                On return this object will be filled with options that were not found.
+ *
+ * @return zero on success, a negative value on error
+ * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(),
+ *      av_dict_set(), av_opt_find().
+ */
+int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
+
+/**
+ * Close a given AVCodecContext and free all the data associated with it
+ * (but not the AVCodecContext itself).
+ *
+ * Calling this function on an AVCodecContext that hasn't been opened will free
+ * the codec-specific data allocated in avcodec_alloc_context3() /
+ * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will
+ * do nothing.
+ */
+int avcodec_close(AVCodecContext *avctx);
+
+/**
+ * Free all allocated data in the given subtitle struct.
+ *
+ * @param sub AVSubtitle to free.
+ */
+void avsubtitle_free(AVSubtitle *sub);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_packet
+ * @{
+ */
+
+#if FF_API_DESTRUCT_PACKET
+/**
+ * Default packet destructor.
+ * @deprecated use the AVBuffer API instead
+ */
+attribute_deprecated
+void av_destruct_packet(AVPacket *pkt);
+#endif
+
+/**
+ * Initialize optional fields of a packet with default values.
+ *
+ * Note, this does not touch the data and size members, which have to be
+ * initialized separately.
+ *
+ * @param pkt packet
+ */
+void av_init_packet(AVPacket *pkt);
+
+/**
+ * Allocate the payload of a packet and initialize its fields with
+ * default values.
+ *
+ * @param pkt packet
+ * @param size wanted payload size
+ * @return 0 if OK, AVERROR_xxx otherwise
+ */
+int av_new_packet(AVPacket *pkt, int size);
+
+/**
+ * Reduce packet size, correctly zeroing padding
+ *
+ * @param pkt packet
+ * @param size new size
+ */
+void av_shrink_packet(AVPacket *pkt, int size);
+
+/**
+ * Increase packet size, correctly zeroing padding
+ *
+ * @param pkt packet
+ * @param grow_by number of bytes by which to increase the size of the packet
+ */
+int av_grow_packet(AVPacket *pkt, int grow_by);
+
+/**
+ * Initialize a reference-counted packet from av_malloc()ed data.
+ *
+ * @param pkt packet to be initialized. This function will set the data, size,
+ *        buf and destruct fields, all others are left untouched.
+ * @param data Data allocated by av_malloc() to be used as packet data. If this
+ *        function returns successfully, the data is owned by the underlying AVBuffer.
+ *        The caller may not access the data through other means.
+ * @param size size of data in bytes, without the padding. I.e. the full buffer
+ *        size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE.
+ *
+ * @return 0 on success, a negative AVERROR on error
+ */
+int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
+
+/**
+ * @warning This is a hack - the packet memory allocation stuff is broken. The
+ * packet is allocated if it was not really allocated.
+ */
+int av_dup_packet(AVPacket *pkt);
+
+/**
+ * Free a packet.
+ *
+ * @param pkt packet to free
+ */
+void av_free_packet(AVPacket *pkt);
+
+/**
+ * Allocate new information of a packet.
+ *
+ * @param pkt packet
+ * @param type side information type
+ * @param size side information size
+ * @return pointer to fresh allocated data or NULL otherwise
+ */
+uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
+                                 int size);
+
+/**
+ * Shrink the already allocated side data buffer
+ *
+ * @param pkt packet
+ * @param type side information type
+ * @param size new side information size
+ * @return 0 on success, < 0 on failure
+ */
+int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
+                               int size);
+
+/**
+ * Get side information from packet.
+ *
+ * @param pkt packet
+ * @param type desired side information type
+ * @param size pointer for side information size to store (optional)
+ * @return pointer to data if present or NULL otherwise
+ */
+uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
+                                 int *size);
+
+/**
+ * Convenience function to free all the side data stored.
+ * All the other fields stay untouched.
+ *
+ * @param pkt packet
+ */
+void av_packet_free_side_data(AVPacket *pkt);
+
+/**
+ * Setup a new reference to the data described by a given packet
+ *
+ * If src is reference-counted, setup dst as a new reference to the
+ * buffer in src. Otherwise allocate a new buffer in dst and copy the
+ * data from src into it.
+ *
+ * All the other fields are copied from src.
+ *
+ * @see av_packet_unref
+ *
+ * @param dst Destination packet
+ * @param src Source packet
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ */
+int av_packet_ref(AVPacket *dst, AVPacket *src);
+
+/**
+ * Wipe the packet.
+ *
+ * Unreference the buffer referenced by the packet and reset the
+ * remaining packet fields to their default values.
+ *
+ * @param pkt The packet to be unreferenced.
+ */
+void av_packet_unref(AVPacket *pkt);
+
+/**
+ * Move every field in src to dst and reset src.
+ *
+ * @see av_packet_unref
+ *
+ * @param src Source packet, will be reset
+ * @param dst Destination packet
+ */
+void av_packet_move_ref(AVPacket *dst, AVPacket *src);
+
+/**
+ * Copy only "properties" fields from src to dst.
+ *
+ * Properties for the purpose of this function are all the fields
+ * beside those related to the packet data (buf, data, size)
+ *
+ * @param dst Destination packet
+ * @param src Source packet
+ *
+ * @return 0 on success AVERROR on failure.
+ *
+ */
+int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_decoding
+ * @{
+ */
+
+/**
+ * Find a registered decoder with a matching codec ID.
+ *
+ * @param id AVCodecID of the requested decoder
+ * @return A decoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_decoder(enum AVCodecID id);
+
+/**
+ * Find a registered decoder with the specified name.
+ *
+ * @param name name of the requested decoder
+ * @return A decoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_decoder_by_name(const char *name);
+
+#if FF_API_GET_BUFFER
+attribute_deprecated int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
+attribute_deprecated void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
+attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
+#endif
+
+/**
+ * The default callback for AVCodecContext.get_buffer2(). It is made public so
+ * it can be called by custom get_buffer2() implementations for decoders without
+ * CODEC_CAP_DR1 set.
+ */
+int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
+
+/**
+ * Return the amount of padding in pixels which the get_buffer callback must
+ * provide around the edge of the image for codecs which do not have the
+ * CODEC_FLAG_EMU_EDGE flag.
+ *
+ * @return Required padding in pixels.
+ */
+unsigned avcodec_get_edge_width(void);
+
+/**
+ * Modify width and height values so that they will result in a memory
+ * buffer that is acceptable for the codec if you do not use any horizontal
+ * padding.
+ *
+ * May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
+ * according to avcodec_get_edge_width() before.
+ */
+void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
+
+/**
+ * Modify width and height values so that they will result in a memory
+ * buffer that is acceptable for the codec if you also ensure that all
+ * line sizes are a multiple of the respective linesize_align[i].
+ *
+ * May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
+ * according to avcodec_get_edge_width() before.
+ */
+void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
+                               int linesize_align[AV_NUM_DATA_POINTERS]);
+
+/**
+ * Decode the audio frame of size avpkt->size from avpkt->data into frame.
+ *
+ * Some decoders may support multiple frames in a single AVPacket. Such
+ * decoders would then just decode the first frame. In this case,
+ * avcodec_decode_audio4 has to be called again with an AVPacket containing
+ * the remaining data in order to decode the second frame, etc...
+ * Even if no frames are returned, the packet needs to be fed to the decoder
+ * with remaining data until it is completely consumed or an error occurs.
+ *
+ * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
+ *          larger than the actual read bytes because some optimized bitstream
+ *          readers read 32 or 64 bits at once and could read over the end.
+ *
+ * @note You might have to align the input buffer. The alignment requirements
+ *       depend on the CPU and the decoder.
+ *
+ * @param      avctx the codec context
+ * @param[out] frame The AVFrame in which to store decoded audio samples.
+ *                   The decoder will allocate a buffer for the decoded frame by
+ *                   calling the AVCodecContext.get_buffer2() callback.
+ *                   When AVCodecContext.refcounted_frames is set to 1, the frame is
+ *                   reference counted and the returned reference belongs to the
+ *                   caller. The caller must release the frame using av_frame_unref()
+ *                   when the frame is no longer needed. The caller may safely write
+ *                   to the frame if av_frame_is_writable() returns 1.
+ *                   When AVCodecContext.refcounted_frames is set to 0, the returned
+ *                   reference belongs to the decoder and is valid only until the
+ *                   next call to this function or until closing the decoder.
+ *                   The caller may not write to it.
+ * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
+ *                           non-zero.
+ * @param[in]  avpkt The input AVPacket containing the input buffer.
+ *                   At least avpkt->data and avpkt->size should be set. Some
+ *                   decoders might also require additional fields to be set.
+ * @return A negative error code is returned if an error occurred during
+ *         decoding, otherwise the number of bytes consumed from the input
+ *         AVPacket is returned.
+ */
+int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
+                          int *got_frame_ptr, AVPacket *avpkt);
+
+/**
+ * Decode the video frame of size avpkt->size from avpkt->data into picture.
+ * Some decoders may support multiple frames in a single AVPacket, such
+ * decoders would then just decode the first frame.
+ *
+ * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
+ * the actual read bytes because some optimized bitstream readers read 32 or 64
+ * bits at once and could read over the end.
+ *
+ * @warning The end of the input buffer buf should be set to 0 to ensure that
+ * no overreading happens for damaged MPEG streams.
+ *
+ * @note You might have to align the input buffer avpkt->data.
+ * The alignment requirements depend on the CPU: on some CPUs it isn't
+ * necessary at all, on others it won't work at all if not aligned and on others
+ * it will work but it will have an impact on performance.
+ *
+ * In practice, avpkt->data should have 4 byte alignment at minimum.
+ *
+ * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
+ * between input and output, these need to be fed with avpkt->data=NULL,
+ * avpkt->size=0 at the end to return the remaining frames.
+ *
+ * @param avctx the codec context
+ * @param[out] picture The AVFrame in which the decoded video frame will be stored.
+ *             Use av_frame_alloc() to get an AVFrame. The codec will
+ *             allocate memory for the actual bitmap by calling the
+ *             AVCodecContext.get_buffer2() callback.
+ *             When AVCodecContext.refcounted_frames is set to 1, the frame is
+ *             reference counted and the returned reference belongs to the
+ *             caller. The caller must release the frame using av_frame_unref()
+ *             when the frame is no longer needed. The caller may safely write
+ *             to the frame if av_frame_is_writable() returns 1.
+ *             When AVCodecContext.refcounted_frames is set to 0, the returned
+ *             reference belongs to the decoder and is valid only until the
+ *             next call to this function or until closing the decoder. The
+ *             caller may not write to it.
+ *
+ * @param[in] avpkt The input AVpacket containing the input buffer.
+ *            You can create such packet with av_init_packet() and by then setting
+ *            data and size, some decoders might in addition need other fields like
+ *            flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
+ *            fields possible.
+ * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
+ * @return On error a negative value is returned, otherwise the number of bytes
+ * used or zero if no frame could be decompressed.
+ */
+int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
+                         int *got_picture_ptr,
+                         AVPacket *avpkt);
+
+/**
+ * Decode a subtitle message.
+ * Return a negative value on error, otherwise return the number of bytes used.
+ * If no subtitle could be decompressed, got_sub_ptr is zero.
+ * Otherwise, the subtitle is stored in *sub.
+ * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
+ * simplicity, because the performance difference is expect to be negligible
+ * and reusing a get_buffer written for video codecs would probably perform badly
+ * due to a potentially very different allocation pattern.
+ *
+ * @param avctx the codec context
+ * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
+                   freed with avsubtitle_free if *got_sub_ptr is set.
+ * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
+ * @param[in] avpkt The input AVPacket containing the input buffer.
+ */
+int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
+                            int *got_sub_ptr,
+                            AVPacket *avpkt);
+
+/**
+ * @defgroup lavc_parsing Frame parsing
+ * @{
+ */
+
+enum AVPictureStructure {
+    AV_PICTURE_STRUCTURE_UNKNOWN,      //< unknown
+    AV_PICTURE_STRUCTURE_TOP_FIELD,    //< coded as top field
+    AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field
+    AV_PICTURE_STRUCTURE_FRAME,        //< coded as frame
+};
+
+typedef struct AVCodecParserContext {
+    void *priv_data;
+    struct AVCodecParser *parser;
+    int64_t frame_offset; /* offset of the current frame */
+    int64_t cur_offset; /* current offset
+                           (incremented by each av_parser_parse()) */
+    int64_t next_frame_offset; /* offset of the next frame */
+    /* video info */
+    int pict_type; /* XXX: Put it back in AVCodecContext. */
+    /**
+     * This field is used for proper frame duration computation in lavf.
+     * It signals, how much longer the frame duration of the current frame
+     * is compared to normal frame duration.
+     *
+     * frame_duration = (1 + repeat_pict) * time_base
+     *
+     * It is used by codecs like H.264 to display telecined material.
+     */
+    int repeat_pict; /* XXX: Put it back in AVCodecContext. */
+    int64_t pts;     /* pts of the current frame */
+    int64_t dts;     /* dts of the current frame */
+
+    /* private data */
+    int64_t last_pts;
+    int64_t last_dts;
+    int fetch_timestamp;
+
+#define AV_PARSER_PTS_NB 4
+    int cur_frame_start_index;
+    int64_t cur_frame_offset[AV_PARSER_PTS_NB];
+    int64_t cur_frame_pts[AV_PARSER_PTS_NB];
+    int64_t cur_frame_dts[AV_PARSER_PTS_NB];
+
+    int flags;
+#define PARSER_FLAG_COMPLETE_FRAMES           0x0001
+#define PARSER_FLAG_ONCE                      0x0002
+/// Set if the parser has a valid file offset
+#define PARSER_FLAG_FETCHED_OFFSET            0x0004
+
+    int64_t offset;      ///< byte offset from starting packet start
+    int64_t cur_frame_end[AV_PARSER_PTS_NB];
+
+    /**
+     * Set by parser to 1 for key frames and 0 for non-key frames.
+     * It is initialized to -1, so if the parser doesn't set this flag,
+     * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
+     * will be used.
+     */
+    int key_frame;
+
+    /**
+     * Time difference in stream time base units from the pts of this
+     * packet to the point at which the output from the decoder has converged
+     * independent from the availability of previous frames. That is, the
+     * frames are virtually identical no matter if decoding started from
+     * the very first frame or from this keyframe.
+     * Is AV_NOPTS_VALUE if unknown.
+     * This field is not the display duration of the current frame.
+     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+     * set.
+     *
+     * The purpose of this field is to allow seeking in streams that have no
+     * keyframes in the conventional sense. It corresponds to the
+     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
+     * essential for some types of subtitle streams to ensure that all
+     * subtitles are correctly displayed after seeking.
+     */
+    int64_t convergence_duration;
+
+    // Timestamp generation support:
+    /**
+     * Synchronization point for start of timestamp generation.
+     *
+     * Set to >0 for sync point, 0 for no sync point and <0 for undefined
+     * (default).
+     *
+     * For example, this corresponds to presence of H.264 buffering period
+     * SEI message.
+     */
+    int dts_sync_point;
+
+    /**
+     * Offset of the current timestamp against last timestamp sync point in
+     * units of AVCodecContext.time_base.
+     *
+     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+     * contain a valid timestamp offset.
+     *
+     * Note that the timestamp of sync point has usually a nonzero
+     * dts_ref_dts_delta, which refers to the previous sync point. Offset of
+     * the next frame after timestamp sync point will be usually 1.
+     *
+     * For example, this corresponds to H.264 cpb_removal_delay.
+     */
+    int dts_ref_dts_delta;
+
+    /**
+     * Presentation delay of current frame in units of AVCodecContext.time_base.
+     *
+     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+     * contain valid non-negative timestamp delta (presentation time of a frame
+     * must not lie in the past).
+     *
+     * This delay represents the difference between decoding and presentation
+     * time of the frame.
+     *
+     * For example, this corresponds to H.264 dpb_output_delay.
+     */
+    int pts_dts_delta;
+
+    /**
+     * Position of the packet in file.
+     *
+     * Analogous to cur_frame_pts/dts
+     */
+    int64_t cur_frame_pos[AV_PARSER_PTS_NB];
+
+    /**
+     * Byte position of currently parsed frame in stream.
+     */
+    int64_t pos;
+
+    /**
+     * Previous frame byte position.
+     */
+    int64_t last_pos;
+
+    /**
+     * Duration of the current frame.
+     * For audio, this is in units of 1 / AVCodecContext.sample_rate.
+     * For all other types, this is in units of AVCodecContext.time_base.
+     */
+    int duration;
+
+    enum AVFieldOrder field_order;
+
+    /**
+     * Indicate whether a picture is coded as a frame, top field or bottom field.
+     *
+     * For example, H.264 field_pic_flag equal to 0 corresponds to
+     * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag
+     * equal to 1 and bottom_field_flag equal to 0 corresponds to
+     * AV_PICTURE_STRUCTURE_TOP_FIELD.
+     */
+    enum AVPictureStructure picture_structure;
+
+    /**
+     * Picture number incremented in presentation or output order.
+     * This field may be reinitialized at the first picture of a new sequence.
+     *
+     * For example, this corresponds to H.264 PicOrderCnt.
+     */
+    int output_picture_number;
+} AVCodecParserContext;
+
+typedef struct AVCodecParser {
+    int codec_ids[5]; /* several codec IDs are permitted */
+    int priv_data_size;
+    int (*parser_init)(AVCodecParserContext *s);
+    int (*parser_parse)(AVCodecParserContext *s,
+                        AVCodecContext *avctx,
+                        const uint8_t **poutbuf, int *poutbuf_size,
+                        const uint8_t *buf, int buf_size);
+    void (*parser_close)(AVCodecParserContext *s);
+    int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
+    struct AVCodecParser *next;
+} AVCodecParser;
+
+AVCodecParser *av_parser_next(AVCodecParser *c);
+
+void av_register_codec_parser(AVCodecParser *parser);
+AVCodecParserContext *av_parser_init(int codec_id);
+
+/**
+ * Parse a packet.
+ *
+ * @param s             parser context.
+ * @param avctx         codec context.
+ * @param poutbuf       set to pointer to parsed buffer or NULL if not yet finished.
+ * @param poutbuf_size  set to size of parsed buffer or zero if not yet finished.
+ * @param buf           input buffer.
+ * @param buf_size      input length, to signal EOF, this should be 0 (so that the last frame can be output).
+ * @param pts           input presentation timestamp.
+ * @param dts           input decoding timestamp.
+ * @param pos           input byte position in stream.
+ * @return the number of bytes of the input bitstream used.
+ *
+ * Example:
+ * @code
+ *   while(in_len){
+ *       len = av_parser_parse2(myparser, AVCodecContext, &data, &size,
+ *                                        in_data, in_len,
+ *                                        pts, dts, pos);
+ *       in_data += len;
+ *       in_len  -= len;
+ *
+ *       if(size)
+ *          decode_frame(data, size);
+ *   }
+ * @endcode
+ */
+int av_parser_parse2(AVCodecParserContext *s,
+                     AVCodecContext *avctx,
+                     uint8_t **poutbuf, int *poutbuf_size,
+                     const uint8_t *buf, int buf_size,
+                     int64_t pts, int64_t dts,
+                     int64_t pos);
+
+/**
+ * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
+ * @deprecated use AVBitstreamFilter
+ */
+int av_parser_change(AVCodecParserContext *s,
+                     AVCodecContext *avctx,
+                     uint8_t **poutbuf, int *poutbuf_size,
+                     const uint8_t *buf, int buf_size, int keyframe);
+void av_parser_close(AVCodecParserContext *s);
+
+/**
+ * @}
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_encoding
+ * @{
+ */
+
+/**
+ * Find a registered encoder with a matching codec ID.
+ *
+ * @param id AVCodecID of the requested encoder
+ * @return An encoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_encoder(enum AVCodecID id);
+
+/**
+ * Find a registered encoder with the specified name.
+ *
+ * @param name name of the requested encoder
+ * @return An encoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_encoder_by_name(const char *name);
+
+/**
+ * Encode a frame of audio.
+ *
+ * Takes input samples from frame and writes the next output packet, if
+ * available, to avpkt. The output packet does not necessarily contain data for
+ * the most recent frame, as encoders can delay, split, and combine input frames
+ * internally as needed.
+ *
+ * @param avctx     codec context
+ * @param avpkt     output AVPacket.
+ *                  The user can supply an output buffer by setting
+ *                  avpkt->data and avpkt->size prior to calling the
+ *                  function, but if the size of the user-provided data is not
+ *                  large enough, encoding will fail. All other AVPacket fields
+ *                  will be reset by the encoder using av_init_packet(). If
+ *                  avpkt->data is NULL, the encoder will allocate it.
+ *                  The encoder will set avpkt->size to the size of the
+ *                  output packet.
+ *
+ *                  If this function fails or produces no output, avpkt will be
+ *                  freed using av_free_packet() (i.e. avpkt->destruct will be
+ *                  called to free the user supplied buffer).
+ * @param[in] frame AVFrame containing the raw audio data to be encoded.
+ *                  May be NULL when flushing an encoder that has the
+ *                  CODEC_CAP_DELAY capability set.
+ *                  If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
+ *                  can have any number of samples.
+ *                  If it is not set, frame->nb_samples must be equal to
+ *                  avctx->frame_size for all frames except the last.
+ *                  The final frame may be smaller than avctx->frame_size.
+ * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
+ *                            output packet is non-empty, and to 0 if it is
+ *                            empty. If the function returns an error, the
+ *                            packet can be assumed to be invalid, and the
+ *                            value of got_packet_ptr is undefined and should
+ *                            not be used.
+ * @return          0 on success, negative error code on failure
+ */
+int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
+                          const AVFrame *frame, int *got_packet_ptr);
+
+/**
+ * Encode a frame of video.
+ *
+ * Takes input raw video data from frame and writes the next output packet, if
+ * available, to avpkt. The output packet does not necessarily contain data for
+ * the most recent frame, as encoders can delay and reorder input frames
+ * internally as needed.
+ *
+ * @param avctx     codec context
+ * @param avpkt     output AVPacket.
+ *                  The user can supply an output buffer by setting
+ *                  avpkt->data and avpkt->size prior to calling the
+ *                  function, but if the size of the user-provided data is not
+ *                  large enough, encoding will fail. All other AVPacket fields
+ *                  will be reset by the encoder using av_init_packet(). If
+ *                  avpkt->data is NULL, the encoder will allocate it.
+ *                  The encoder will set avpkt->size to the size of the
+ *                  output packet. The returned data (if any) belongs to the
+ *                  caller, he is responsible for freeing it.
+ *
+ *                  If this function fails or produces no output, avpkt will be
+ *                  freed using av_free_packet() (i.e. avpkt->destruct will be
+ *                  called to free the user supplied buffer).
+ * @param[in] frame AVFrame containing the raw video data to be encoded.
+ *                  May be NULL when flushing an encoder that has the
+ *                  CODEC_CAP_DELAY capability set.
+ * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
+ *                            output packet is non-empty, and to 0 if it is
+ *                            empty. If the function returns an error, the
+ *                            packet can be assumed to be invalid, and the
+ *                            value of got_packet_ptr is undefined and should
+ *                            not be used.
+ * @return          0 on success, negative error code on failure
+ */
+int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
+                          const AVFrame *frame, int *got_packet_ptr);
+
+int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+                            const AVSubtitle *sub);
+
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_picture
+ * @{
+ */
+
+/**
+ * Allocate memory for a picture.  Call avpicture_free() to free it.
+ *
+ * @see avpicture_fill()
+ *
+ * @param picture the picture to be filled in
+ * @param pix_fmt the format of the picture
+ * @param width the width of the picture
+ * @param height the height of the picture
+ * @return zero if successful, a negative value if not
+ */
+int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Free a picture previously allocated by avpicture_alloc().
+ * The data buffer used by the AVPicture is freed, but the AVPicture structure
+ * itself is not.
+ *
+ * @param picture the AVPicture to be freed
+ */
+void avpicture_free(AVPicture *picture);
+
+/**
+ * Fill in the AVPicture fields.
+ * The fields of the given AVPicture are filled in by using the 'ptr' address
+ * which points to the image data buffer. Depending on the specified picture
+ * format, one or multiple image data pointers and line sizes will be set.
+ * If a planar format is specified, several pointers will be set pointing to
+ * the different picture planes and the line sizes of the different planes
+ * will be stored in the lines_sizes array.
+ * Call with ptr == NULL to get the required size for the ptr buffer.
+ *
+ * To allocate the buffer and fill in the AVPicture fields in one call,
+ * use avpicture_alloc().
+ *
+ * @param picture AVPicture whose fields are to be filled in
+ * @param ptr Buffer which will contain or contains the actual image data
+ * @param pix_fmt The format in which the picture data is stored.
+ * @param width the width of the image in pixels
+ * @param height the height of the image in pixels
+ * @return size of the image data in bytes
+ */
+int avpicture_fill(AVPicture *picture, uint8_t *ptr,
+                   enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Copy pixel data from an AVPicture into a buffer.
+ * The data is stored compactly, without any gaps for alignment or padding
+ * which may be applied by avpicture_fill().
+ *
+ * @see avpicture_get_size()
+ *
+ * @param[in] src AVPicture containing image data
+ * @param[in] pix_fmt The format in which the picture data is stored.
+ * @param[in] width the width of the image in pixels.
+ * @param[in] height the height of the image in pixels.
+ * @param[out] dest A buffer into which picture data will be copied.
+ * @param[in] dest_size The size of 'dest'.
+ * @return The number of bytes written to dest, or a negative value (error code) on error.
+ */
+int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
+                     int width, int height,
+                     unsigned char *dest, int dest_size);
+
+/**
+ * Calculate the size in bytes that a picture of the given width and height
+ * would occupy if stored in the given picture format.
+ * Note that this returns the size of a compact representation as generated
+ * by avpicture_layout(), which can be smaller than the size required for e.g.
+ * avpicture_fill().
+ *
+ * @param pix_fmt the given picture format
+ * @param width the width of the image
+ * @param height the height of the image
+ * @return Image data size in bytes or -1 on error (e.g. too large dimensions).
+ */
+int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
+
+#if FF_API_DEINTERLACE
+/**
+ *  deinterlace - if not supported return -1
+ *
+ * @deprecated - use yadif (in libavfilter) instead
+ */
+attribute_deprecated
+int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
+                          enum AVPixelFormat pix_fmt, int width, int height);
+#endif
+/**
+ * Copy image src to dst. Wraps av_picture_data_copy() above.
+ */
+void av_picture_copy(AVPicture *dst, const AVPicture *src,
+                     enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Crop image top and left side.
+ */
+int av_picture_crop(AVPicture *dst, const AVPicture *src,
+                    enum AVPixelFormat pix_fmt, int top_band, int left_band);
+
+/**
+ * Pad image.
+ */
+int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
+            int padtop, int padbottom, int padleft, int padright, int *color);
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup lavc_misc Utility functions
+ * @ingroup libavc
+ *
+ * Miscellaneous utility functions related to both encoding and decoding
+ * (or neither).
+ * @{
+ */
+
+/**
+ * @defgroup lavc_misc_pixfmt Pixel formats
+ *
+ * Functions for working with pixel formats.
+ * @{
+ */
+
+/**
+ * @deprecated Use av_pix_fmt_get_chroma_sub_sample
+ */
+
+void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
+
+/**
+ * Return a value representing the fourCC code associated to the
+ * pixel format pix_fmt, or 0 if no associated fourCC code can be
+ * found.
+ */
+unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
+
+#define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
+#define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
+#define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
+#define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
+#define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
+#define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
+
+/**
+ * Compute what kind of losses will occur when converting from one specific
+ * pixel format to another.
+ * When converting from one pixel format to another, information loss may occur.
+ * For example, when converting from RGB24 to GRAY, the color information will
+ * be lost. Similarly, other losses occur when converting from some formats to
+ * other formats. These losses can involve loss of chroma, but also loss of
+ * resolution, loss of color depth, loss due to the color space conversion, loss
+ * of the alpha bits or loss due to color quantization.
+ * avcodec_get_fix_fmt_loss() informs you about the various types of losses
+ * which will occur when converting from one pixel format to another.
+ *
+ * @param[in] dst_pix_fmt destination pixel format
+ * @param[in] src_pix_fmt source pixel format
+ * @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ * @return Combination of flags informing you what kind of losses will occur.
+ */
+int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
+                             int has_alpha);
+
+/**
+ * Find the best pixel format to convert to given a certain source pixel
+ * format.  When converting from one pixel format to another, information loss
+ * may occur.  For example, when converting from RGB24 to GRAY, the color
+ * information will be lost. Similarly, other losses occur when converting from
+ * some formats to other formats. avcodec_find_best_pix_fmt2() searches which of
+ * the given pixel formats should be used to suffer the least amount of loss.
+ * The pixel formats from which it chooses one, are determined by the
+ * pix_fmt_list parameter.
+ *
+ *
+ * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from
+ * @param[in] src_pix_fmt source pixel format
+ * @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
+ * @return The best pixel format to convert to or -1 if none was found.
+ */
+enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
+                                              enum AVPixelFormat src_pix_fmt,
+                                              int has_alpha, int *loss_ptr);
+
+enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
+
+/**
+ * @}
+ */
+
+void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
+
+/**
+ * Put a string representing the codec tag codec_tag in buf.
+ *
+ * @param buf_size size in bytes of buf
+ * @return the length of the string that would have been generated if
+ * enough space had been available, excluding the trailing null
+ */
+size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
+
+void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
+
+/**
+ * Return a name for the specified profile, if available.
+ *
+ * @param codec the codec that is searched for the given profile
+ * @param profile the profile value for which a name is requested
+ * @return A name for the profile if found, NULL otherwise.
+ */
+const char *av_get_profile_name(const AVCodec *codec, int profile);
+
+int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
+int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
+//FIXME func typedef
+
+/**
+ * Fill audio frame data and linesize.
+ * AVFrame extended_data channel pointers are allocated if necessary for
+ * planar audio.
+ *
+ * @param frame       the AVFrame
+ *                    frame->nb_samples must be set prior to calling the
+ *                    function. This function fills in frame->data,
+ *                    frame->extended_data, frame->linesize[0].
+ * @param nb_channels channel count
+ * @param sample_fmt  sample format
+ * @param buf         buffer to use for frame data
+ * @param buf_size    size of buffer
+ * @param align       plane size sample alignment (0 = default)
+ * @return            0 on success, negative error code on failure
+ */
+int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
+                             enum AVSampleFormat sample_fmt, const uint8_t *buf,
+                             int buf_size, int align);
+
+/**
+ * Flush buffers, should be called when seeking or when switching to a different stream.
+ */
+void avcodec_flush_buffers(AVCodecContext *avctx);
+
+/**
+ * Return codec bits per sample.
+ *
+ * @param[in] codec_id the codec
+ * @return Number of bits per sample or zero if unknown for the given codec.
+ */
+int av_get_bits_per_sample(enum AVCodecID codec_id);
+
+/**
+ * Return codec bits per sample.
+ * Only return non-zero if the bits per sample is exactly correct, not an
+ * approximation.
+ *
+ * @param[in] codec_id the codec
+ * @return Number of bits per sample or zero if unknown for the given codec.
+ */
+int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
+
+/**
+ * Return audio frame duration.
+ *
+ * @param avctx        codec context
+ * @param frame_bytes  size of the frame, or 0 if unknown
+ * @return             frame duration, in samples, if known. 0 if not able to
+ *                     determine.
+ */
+int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
+
+
+typedef struct AVBitStreamFilterContext {
+    void *priv_data;
+    struct AVBitStreamFilter *filter;
+    AVCodecParserContext *parser;
+    struct AVBitStreamFilterContext *next;
+} AVBitStreamFilterContext;
+
+
+typedef struct AVBitStreamFilter {
+    const char *name;
+    int priv_data_size;
+    int (*filter)(AVBitStreamFilterContext *bsfc,
+                  AVCodecContext *avctx, const char *args,
+                  uint8_t **poutbuf, int *poutbuf_size,
+                  const uint8_t *buf, int buf_size, int keyframe);
+    void (*close)(AVBitStreamFilterContext *bsfc);
+    struct AVBitStreamFilter *next;
+} AVBitStreamFilter;
+
+void av_register_bitstream_filter(AVBitStreamFilter *bsf);
+AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
+int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
+                               AVCodecContext *avctx, const char *args,
+                               uint8_t **poutbuf, int *poutbuf_size,
+                               const uint8_t *buf, int buf_size, int keyframe);
+void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
+
+AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
+
+/* memory */
+
+/**
+ * Reallocate the given block if it is not large enough, otherwise do nothing.
+ *
+ * @see av_realloc
+ */
+void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Allocate a buffer, reusing the given one if large enough.
+ *
+ * Contrary to av_fast_realloc the current buffer contents might not be
+ * preserved and on error the old buffer is freed, thus no special
+ * handling to avoid memleaks is necessary.
+ *
+ * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
+ * @param size size of the buffer *ptr points to
+ * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
+ *                 *size 0 if an error occurred.
+ */
+void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Allocate a buffer with padding, reusing the given one if large enough.
+ *
+ * Same behaviour av_fast_malloc but the buffer has additional
+ * FF_INPUT_PADDING_SIZE at the end which will always memset to 0.
+ *
+ */
+void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Encode extradata length to a buffer. Used by xiph codecs.
+ *
+ * @param s buffer to write to; must be at least (v/255+1) bytes long
+ * @param v size of extradata in bytes
+ * @return number of bytes written to the buffer.
+ */
+unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
+
+#if FF_API_MISSING_SAMPLE
+/**
+ * Log a generic warning message about a missing feature. This function is
+ * intended to be used internally by Libav (libavcodec, libavformat, etc.)
+ * only, and would normally not be used by applications.
+ * @param[in] avc a pointer to an arbitrary struct of which the first field is
+ * a pointer to an AVClass struct
+ * @param[in] feature string containing the name of the missing feature
+ * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
+ * If want_sample is non-zero, additional verbage will be added to the log
+ * message which tells the user how to report samples to the development
+ * mailing list.
+ * @deprecated Use avpriv_report_missing_feature() instead.
+ */
+attribute_deprecated
+void av_log_missing_feature(void *avc, const char *feature, int want_sample);
+
+/**
+ * Log a generic warning message asking for a sample. This function is
+ * intended to be used internally by Libav (libavcodec, libavformat, etc.)
+ * only, and would normally not be used by applications.
+ * @param[in] avc a pointer to an arbitrary struct of which the first field is
+ * a pointer to an AVClass struct
+ * @param[in] msg string containing an optional message, or NULL if no message
+ * @deprecated Use avpriv_request_sample() instead.
+ */
+attribute_deprecated
+void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
+#endif /* FF_API_MISSING_SAMPLE */
+
+/**
+ * Register the hardware accelerator hwaccel.
+ */
+void av_register_hwaccel(AVHWAccel *hwaccel);
+
+/**
+ * If hwaccel is NULL, returns the first registered hardware accelerator,
+ * if hwaccel is non-NULL, returns the next registered hardware accelerator
+ * after hwaccel, or NULL if hwaccel is the last one.
+ */
+AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
+
+
+/**
+ * Lock operation used by lockmgr
+ */
+enum AVLockOp {
+  AV_LOCK_CREATE,  ///< Create a mutex
+  AV_LOCK_OBTAIN,  ///< Lock the mutex
+  AV_LOCK_RELEASE, ///< Unlock the mutex
+  AV_LOCK_DESTROY, ///< Free mutex resources
+};
+
+/**
+ * Register a user provided lock manager supporting the operations
+ * specified by AVLockOp. mutex points to a (void *) where the
+ * lockmgr should store/get a pointer to a user allocated mutex. It's
+ * NULL upon AV_LOCK_CREATE and != NULL for all other ops.
+ *
+ * @param cb User defined callback. Note: Libav may invoke calls to this
+ *           callback during the call to av_lockmgr_register().
+ *           Thus, the application must be prepared to handle that.
+ *           If cb is set to NULL the lockmgr will be unregistered.
+ *           Also note that during unregistration the previously registered
+ *           lockmgr callback may also be invoked.
+ */
+int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
+
+/**
+ * Get the type of the given codec.
+ */
+enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
+
+/**
+ * @return a positive value if s is open (i.e. avcodec_open2() was called on it
+ * with no corresponding avcodec_close()), 0 otherwise.
+ */
+int avcodec_is_open(AVCodecContext *s);
+
+/**
+ * @return a non-zero number if codec is an encoder, zero otherwise
+ */
+int av_codec_is_encoder(const AVCodec *codec);
+
+/**
+ * @return a non-zero number if codec is a decoder, zero otherwise
+ */
+int av_codec_is_decoder(const AVCodec *codec);
+
+/**
+ * @return descriptor for given codec ID or NULL if no descriptor exists.
+ */
+const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
+
+/**
+ * Iterate over all codec descriptors known to libavcodec.
+ *
+ * @param prev previous descriptor. NULL to get the first descriptor.
+ *
+ * @return next descriptor or NULL after the last descriptor
+ */
+const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
+
+/**
+ * @return codec descriptor with the given name or NULL if no such descriptor
+ *         exists.
+ */
+const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name);
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_AVCODEC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avfft.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avfft.h
new file mode 100644
index 000000000..b89618258
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avfft.h
@@ -0,0 +1,116 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AVFFT_H
+#define AVCODEC_AVFFT_H
+
+/**
+ * @file
+ * @ingroup lavc_fft
+ * FFT functions
+ */
+
+/**
+ * @defgroup lavc_fft FFT functions
+ * @ingroup lavc_misc
+ *
+ * @{
+ */
+
+typedef float FFTSample;
+
+typedef struct FFTComplex {
+    FFTSample re, im;
+} FFTComplex;
+
+typedef struct FFTContext FFTContext;
+
+/**
+ * Set up a complex FFT.
+ * @param nbits           log2 of the length of the input array
+ * @param inverse         if 0 perform the forward transform, if 1 perform the inverse
+ */
+FFTContext *av_fft_init(int nbits, int inverse);
+
+/**
+ * Do the permutation needed BEFORE calling ff_fft_calc().
+ */
+void av_fft_permute(FFTContext *s, FFTComplex *z);
+
+/**
+ * Do a complex FFT with the parameters defined in av_fft_init(). The
+ * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
+ */
+void av_fft_calc(FFTContext *s, FFTComplex *z);
+
+void av_fft_end(FFTContext *s);
+
+FFTContext *av_mdct_init(int nbits, int inverse, double scale);
+void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_mdct_end(FFTContext *s);
+
+/* Real Discrete Fourier Transform */
+
+enum RDFTransformType {
+    DFT_R2C,
+    IDFT_C2R,
+    IDFT_R2C,
+    DFT_C2R,
+};
+
+typedef struct RDFTContext RDFTContext;
+
+/**
+ * Set up a real FFT.
+ * @param nbits           log2 of the length of the input array
+ * @param trans           the type of transform
+ */
+RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
+void av_rdft_calc(RDFTContext *s, FFTSample *data);
+void av_rdft_end(RDFTContext *s);
+
+/* Discrete Cosine Transform */
+
+typedef struct DCTContext DCTContext;
+
+enum DCTTransformType {
+    DCT_II = 0,
+    DCT_III,
+    DCT_I,
+    DST_I,
+};
+
+/**
+ * Set up DCT.
+ * @param nbits           size of the input array:
+ *                        (1 << nbits)     for DCT-II, DCT-III and DST-I
+ *                        (1 << nbits) + 1 for DCT-I
+ *
+ * @note the first element of the input of DST-I is ignored
+ */
+DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
+void av_dct_calc(DCTContext *s, FFTSample *data);
+void av_dct_end (DCTContext *s);
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_AVFFT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/dxva2.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/dxva2.h
new file mode 100644
index 000000000..d161eb9f5
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/dxva2.h
@@ -0,0 +1,88 @@
+/*
+ * DXVA2 HW acceleration
+ *
+ * copyright (c) 2009 Laurent Aimar
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_DXVA_H
+#define AVCODEC_DXVA_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_dxva2
+ * Public libavcodec DXVA2 header.
+ */
+
+#define _WIN32_WINNT 0x0600
+#include <stdint.h>
+#include <d3d9.h>
+#include <dxva2api.h>
+
+/**
+ * @defgroup lavc_codec_hwaccel_dxva2 DXVA2
+ * @ingroup lavc_codec_hwaccel
+ *
+ * @{
+ */
+
+#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
+
+/**
+ * This structure is used to provides the necessary configurations and data
+ * to the DXVA2 Libav HWAccel implementation.
+ *
+ * The application must make it available as AVCodecContext.hwaccel_context.
+ */
+struct dxva_context {
+    /**
+     * DXVA2 decoder object
+     */
+    IDirectXVideoDecoder *decoder;
+
+    /**
+     * DXVA2 configuration used to create the decoder
+     */
+    const DXVA2_ConfigPictureDecode *cfg;
+
+    /**
+     * The number of surface in the surface array
+     */
+    unsigned surface_count;
+
+    /**
+     * The array of Direct3D surfaces used to create the decoder
+     */
+    LPDIRECT3DSURFACE9 *surface;
+
+    /**
+     * A bit field configuring the workarounds needed for using the decoder
+     */
+    uint64_t workaround;
+
+    /**
+     * Private to the Libav AVHWAccel implementation
+     */
+    unsigned report_id;
+};
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_DXVA_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vaapi.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vaapi.h
new file mode 100644
index 000000000..39e88259d
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vaapi.h
@@ -0,0 +1,173 @@
+/*
+ * Video Acceleration API (shared data between Libav and the video player)
+ * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
+ *
+ * Copyright (C) 2008-2009 Splitted-Desktop Systems
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VAAPI_H
+#define AVCODEC_VAAPI_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_vaapi
+ * Public libavcodec VA API header.
+ */
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
+ * @ingroup lavc_codec_hwaccel
+ * @{
+ */
+
+/**
+ * This structure is used to share data between the Libav library and
+ * the client video application.
+ * This shall be zero-allocated and available as
+ * AVCodecContext.hwaccel_context. All user members can be set once
+ * during initialization or through each AVCodecContext.get_buffer()
+ * function call. In any case, they must be valid prior to calling
+ * decoding functions.
+ */
+struct vaapi_context {
+    /**
+     * Window system dependent data
+     *
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    void *display;
+
+    /**
+     * Configuration ID
+     *
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    uint32_t config_id;
+
+    /**
+     * Context ID (video decode pipeline)
+     *
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    uint32_t context_id;
+
+    /**
+     * VAPictureParameterBuffer ID
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t pic_param_buf_id;
+
+    /**
+     * VAIQMatrixBuffer ID
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t iq_matrix_buf_id;
+
+    /**
+     * VABitPlaneBuffer ID (for VC-1 decoding)
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t bitplane_buf_id;
+
+    /**
+     * Slice parameter/data buffer IDs
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t *slice_buf_ids;
+
+    /**
+     * Number of effective slice buffer IDs to send to the HW
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int n_slice_buf_ids;
+
+    /**
+     * Size of pre-allocated slice_buf_ids
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_buf_ids_alloc;
+
+    /**
+     * Pointer to VASliceParameterBuffers
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    void *slice_params;
+
+    /**
+     * Size of a VASliceParameterBuffer element
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_param_size;
+
+    /**
+     * Size of pre-allocated slice_params
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_params_alloc;
+
+    /**
+     * Number of slices currently filled in
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_count;
+
+    /**
+     * Pointer to slice data buffer base
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    const uint8_t *slice_data;
+
+    /**
+     * Current size of slice data
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t slice_data_size;
+};
+
+/* @} */
+
+#endif /* AVCODEC_VAAPI_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vda.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vda.h
new file mode 100644
index 000000000..987b94f1f
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vda.h
@@ -0,0 +1,142 @@
+/*
+ * VDA HW acceleration
+ *
+ * copyright (c) 2011 Sebastien Zwickert
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VDA_H
+#define AVCODEC_VDA_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_vda
+ * Public libavcodec VDA header.
+ */
+
+#include "libavcodec/version.h"
+
+#include <stdint.h>
+
+// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
+// http://openradar.appspot.com/8026390
+#undef __GNUC_STDC_INLINE__
+
+#define Picture QuickdrawPicture
+#include <VideoDecodeAcceleration/VDADecoder.h>
+#undef Picture
+
+/**
+ * @defgroup lavc_codec_hwaccel_vda VDA
+ * @ingroup lavc_codec_hwaccel
+ *
+ * @{
+ */
+
+/**
+ * This structure is used to provide the necessary configurations and data
+ * to the VDA Libav HWAccel implementation.
+ *
+ * The application must make it available as AVCodecContext.hwaccel_context.
+ */
+struct vda_context {
+    /**
+     * VDA decoder object.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by libavcodec.
+     */
+    VDADecoder          decoder;
+
+    /**
+     * The Core Video pixel buffer that contains the current image data.
+     *
+     * encoding: unused
+     * decoding: Set by libavcodec. Unset by user.
+     */
+    CVPixelBufferRef    cv_buffer;
+
+    /**
+     * Use the hardware decoder in synchronous mode.
+     *
+     * encoding: unused
+     * decoding: Set by user.
+     */
+    int                 use_sync_decoding;
+
+    /**
+     * The frame width.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by user.
+     */
+    int                 width;
+
+    /**
+     * The frame height.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by user.
+     */
+    int                 height;
+
+    /**
+     * The frame format.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by user.
+     */
+    int                 format;
+
+    /**
+     * The pixel format for output image buffers.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by user.
+     */
+    OSType              cv_pix_fmt_type;
+
+    /**
+     * The current bitstream buffer.
+     */
+    uint8_t             *priv_bitstream;
+
+    /**
+     * The current size of the bitstream.
+     */
+    int                 priv_bitstream_size;
+
+    /**
+     * The reference size used for fast reallocation.
+     */
+    int                 priv_allocated_size;
+};
+
+/** Create the video decoder. */
+int ff_vda_create_decoder(struct vda_context *vda_ctx,
+                          uint8_t *extradata,
+                          int extradata_size);
+
+/** Destroy the video decoder. */
+int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_VDA_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vdpau.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vdpau.h
new file mode 100644
index 000000000..8bedea54b
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vdpau.h
@@ -0,0 +1,160 @@
+/*
+ * The Video Decode and Presentation API for UNIX (VDPAU) is used for
+ * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
+ *
+ * Copyright (C) 2008 NVIDIA
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VDPAU_H
+#define AVCODEC_VDPAU_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_vdpau
+ * Public libavcodec VDPAU header.
+ */
+
+
+/**
+ * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
+ * @ingroup lavc_codec_hwaccel
+ *
+ * VDPAU hardware acceleration has two modules
+ * - VDPAU decoding
+ * - VDPAU presentation
+ *
+ * The VDPAU decoding module parses all headers using Libav
+ * parsing mechanisms and uses VDPAU for the actual decoding.
+ *
+ * As per the current implementation, the actual decoding
+ * and rendering (API calls) are done as part of the VDPAU
+ * presentation (vo_vdpau.c) module.
+ *
+ * @{
+ */
+
+#include <vdpau/vdpau.h>
+#include <vdpau/vdpau_x11.h>
+
+#if FF_API_BUFS_VDPAU
+union AVVDPAUPictureInfo {
+    VdpPictureInfoH264        h264;
+    VdpPictureInfoMPEG1Or2    mpeg;
+    VdpPictureInfoVC1          vc1;
+    VdpPictureInfoMPEG4Part2 mpeg4;
+};
+#endif
+
+/**
+ * This structure is used to share data between the libavcodec library and
+ * the client video application.
+ * The user shall zero-allocate the structure and make it available as
+ * AVCodecContext.hwaccel_context. Members can be set by the user once
+ * during initialization or through each AVCodecContext.get_buffer()
+ * function call. In any case, they must be valid prior to calling
+ * decoding functions.
+ */
+typedef struct AVVDPAUContext {
+    /**
+     * VDPAU decoder handle
+     *
+     * Set by user.
+     */
+    VdpDecoder decoder;
+
+    /**
+     * VDPAU decoder render callback
+     *
+     * Set by the user.
+     */
+    VdpDecoderRender *render;
+
+#if FF_API_BUFS_VDPAU
+    /**
+     * VDPAU picture information
+     *
+     * Set by libavcodec.
+     */
+    attribute_deprecated
+    union AVVDPAUPictureInfo info;
+
+    /**
+     * Allocated size of the bitstream_buffers table.
+     *
+     * Set by libavcodec.
+     */
+    attribute_deprecated
+    int bitstream_buffers_allocated;
+
+    /**
+     * Useful bitstream buffers in the bitstream buffers table.
+     *
+     * Set by libavcodec.
+     */
+    attribute_deprecated
+    int bitstream_buffers_used;
+
+   /**
+     * Table of bitstream buffers.
+     * The user is responsible for freeing this buffer using av_freep().
+     *
+     * Set by libavcodec.
+     */
+    attribute_deprecated
+    VdpBitstreamBuffer *bitstream_buffers;
+#endif
+} AVVDPAUContext;
+
+#if FF_API_CAP_VDPAU
+/** @brief The videoSurface is used for rendering. */
+#define FF_VDPAU_STATE_USED_FOR_RENDER 1
+
+/**
+ * @brief The videoSurface is needed for reference/prediction.
+ * The codec manipulates this.
+ */
+#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
+
+/**
+ * @brief This structure is used as a callback between the Libav
+ * decoder (vd_) and presentation (vo_) module.
+ * This is used for defining a video frame containing surface,
+ * picture parameter, bitstream information etc which are passed
+ * between the Libav decoder and its clients.
+ */
+struct vdpau_render_state {
+    VdpVideoSurface surface; ///< Used as rendered surface, never changed.
+
+    int state; ///< Holds FF_VDPAU_STATE_* values.
+
+    /** picture parameter information for all supported codecs */
+    union AVVDPAUPictureInfo info;
+
+    /** Describe size/location of the compressed video data.
+        Set to 0 when freeing bitstream_buffers. */
+    int bitstream_buffers_allocated;
+    int bitstream_buffers_used;
+    /** The user is responsible for freeing this buffer using av_freep(). */
+    VdpBitstreamBuffer *bitstream_buffers;
+};
+#endif
+
+/* @}*/
+
+#endif /* AVCODEC_VDPAU_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/version.h
new file mode 100644
index 000000000..1c6efe6fe
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/version.h
@@ -0,0 +1,77 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VERSION_H
+#define AVCODEC_VERSION_H
+
+/**
+ * @file
+ * @ingroup libavc
+ * Libavcodec version macros.
+ */
+
+#define LIBAVCODEC_VERSION_MAJOR 55
+#define LIBAVCODEC_VERSION_MINOR 17
+#define LIBAVCODEC_VERSION_MICRO  0
+
+#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
+                                               LIBAVCODEC_VERSION_MINOR, \
+                                               LIBAVCODEC_VERSION_MICRO)
+#define LIBAVCODEC_VERSION      AV_VERSION(LIBAVCODEC_VERSION_MAJOR,    \
+                                           LIBAVCODEC_VERSION_MINOR,    \
+                                           LIBAVCODEC_VERSION_MICRO)
+#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
+
+#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
+
+/**
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ */
+
+#ifndef FF_API_REQUEST_CHANNELS
+#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_DEINTERLACE
+#define FF_API_DEINTERLACE       (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_DESTRUCT_PACKET
+#define FF_API_DESTRUCT_PACKET   (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_GET_BUFFER
+#define FF_API_GET_BUFFER        (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_MISSING_SAMPLE
+#define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_LOWRES
+#define FF_API_LOWRES            (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_CAP_VDPAU
+#define FF_API_CAP_VDPAU         (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_BUFS_VDPAU
+#define FF_API_BUFS_VDPAU        (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_VOXWARE
+#define FF_API_VOXWARE           (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+
+#endif /* AVCODEC_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/xvmc.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/xvmc.h
new file mode 100644
index 000000000..1f77e4efc
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/xvmc.h
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2003 Ivan Kalvachev
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_XVMC_H
+#define AVCODEC_XVMC_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_xvmc
+ * Public libavcodec XvMC header.
+ */
+
+#include <X11/extensions/XvMC.h>
+
+#include "avcodec.h"
+
+/**
+ * @defgroup lavc_codec_hwaccel_xvmc XvMC
+ * @ingroup lavc_codec_hwaccel
+ *
+ * @{
+ */
+
+#define AV_XVMC_ID                    0x1DC711C0  /**< special value to ensure that regular pixel routines haven't corrupted the struct
+                                                       the number is 1337 speak for the letters IDCT MCo (motion compensation) */
+
+struct xvmc_pix_fmt {
+    /** The field contains the special constant value AV_XVMC_ID.
+        It is used as a test that the application correctly uses the API,
+        and that there is no corruption caused by pixel routines.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             xvmc_id;
+
+    /** Pointer to the block array allocated by XvMCCreateBlocks().
+        The array has to be freed by XvMCDestroyBlocks().
+        Each group of 64 values represents one data block of differential
+        pixel information (in MoCo mode) or coefficients for IDCT.
+        - application - set the pointer during initialization
+        - libavcodec  - fills coefficients/pixel data into the array
+    */
+    short*          data_blocks;
+
+    /** Pointer to the macroblock description array allocated by
+        XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
+        - application - set the pointer during initialization
+        - libavcodec  - fills description data into the array
+    */
+    XvMCMacroBlock* mv_blocks;
+
+    /** Number of macroblock descriptions that can be stored in the mv_blocks
+        array.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             allocated_mv_blocks;
+
+    /** Number of blocks that can be stored at once in the data_blocks array.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             allocated_data_blocks;
+
+    /** Indicate that the hardware would interpret data_blocks as IDCT
+        coefficients and perform IDCT on them.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             idct;
+
+    /** In MoCo mode it indicates that intra macroblocks are assumed to be in
+        unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             unsigned_intra;
+
+    /** Pointer to the surface allocated by XvMCCreateSurface().
+        It has to be freed by XvMCDestroySurface() on application exit.
+        It identifies the frame and its state on the video hardware.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    XvMCSurface*    p_surface;
+
+/** Set by the decoder before calling ff_draw_horiz_band(),
+    needed by the XvMCRenderSurface function. */
+//@{
+    /** Pointer to the surface used as past reference
+        - application - unchanged
+        - libavcodec  - set
+    */
+    XvMCSurface*    p_past_surface;
+
+    /** Pointer to the surface used as future reference
+        - application - unchanged
+        - libavcodec  - set
+    */
+    XvMCSurface*    p_future_surface;
+
+    /** top/bottom field or frame
+        - application - unchanged
+        - libavcodec  - set
+    */
+    unsigned int    picture_structure;
+
+    /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
+        - application - unchanged
+        - libavcodec  - set
+    */
+    unsigned int    flags;
+//}@
+
+    /** Number of macroblock descriptions in the mv_blocks array
+        that have already been passed to the hardware.
+        - application - zeroes it on get_buffer().
+                        A successful ff_draw_horiz_band() may increment it
+                        with filled_mb_block_num or zero both.
+        - libavcodec  - unchanged
+    */
+    int             start_mv_blocks_num;
+
+    /** Number of new macroblock descriptions in the mv_blocks array (after
+        start_mv_blocks_num) that are filled by libavcodec and have to be
+        passed to the hardware.
+        - application - zeroes it on get_buffer() or after successful
+                        ff_draw_horiz_band().
+        - libavcodec  - increment with one of each stored MB
+    */
+    int             filled_mv_blocks_num;
+
+    /** Number of the next free data block; one data block consists of
+        64 short values in the data_blocks array.
+        All blocks before this one have already been claimed by placing their
+        position into the corresponding block description structure field,
+        that are part of the mv_blocks array.
+        - application - zeroes it on get_buffer().
+                        A successful ff_draw_horiz_band() may zero it together
+                        with start_mb_blocks_num.
+        - libavcodec  - each decoded macroblock increases it by the number
+                        of coded blocks it contains.
+    */
+    int             next_free_data_block_num;
+};
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_XVMC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avformat.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avformat.h
new file mode 100644
index 000000000..1399de052
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avformat.h
@@ -0,0 +1,1708 @@
+/*
+ * copyright (c) 2001 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFORMAT_AVFORMAT_H
+#define AVFORMAT_AVFORMAT_H
+
+/**
+ * @file
+ * @ingroup libavf
+ * Main libavformat public API header
+ */
+
+/**
+ * @defgroup libavf I/O and Muxing/Demuxing Library
+ * @{
+ *
+ * Libavformat (lavf) is a library for dealing with various media container
+ * formats. Its main two purposes are demuxing - i.e. splitting a media file
+ * into component streams, and the reverse process of muxing - writing supplied
+ * data in a specified container format. It also has an @ref lavf_io
+ * "I/O module" which supports a number of protocols for accessing the data (e.g.
+ * file, tcp, http and others). Before using lavf, you need to call
+ * av_register_all() to register all compiled muxers, demuxers and protocols.
+ * Unless you are absolutely sure you won't use libavformat's network
+ * capabilities, you should also call avformat_network_init().
+ *
+ * A supported input format is described by an AVInputFormat struct, conversely
+ * an output format is described by AVOutputFormat. You can iterate over all
+ * registered input/output formats using the av_iformat_next() /
+ * av_oformat_next() functions. The protocols layer is not part of the public
+ * API, so you can only get the names of supported protocols with the
+ * avio_enum_protocols() function.
+ *
+ * Main lavf structure used for both muxing and demuxing is AVFormatContext,
+ * which exports all information about the file being read or written. As with
+ * most Libav structures, its size is not part of public ABI, so it cannot be
+ * allocated on stack or directly with av_malloc(). To create an
+ * AVFormatContext, use avformat_alloc_context() (some functions, like
+ * avformat_open_input() might do that for you).
+ *
+ * Most importantly an AVFormatContext contains:
+ * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat
+ * "output" format. It is either autodetected or set by user for input;
+ * always set by user for output.
+ * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all
+ * elementary streams stored in the file. AVStreams are typically referred to
+ * using their index in this array.
+ * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or
+ * set by user for input, always set by user for output (unless you are dealing
+ * with an AVFMT_NOFILE format).
+ *
+ * @section lavf_options Passing options to (de)muxers
+ * Lavf allows to configure muxers and demuxers using the @ref avoptions
+ * mechanism. Generic (format-independent) libavformat options are provided by
+ * AVFormatContext, they can be examined from a user program by calling
+ * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass
+ * from avformat_get_class()). Private (format-specific) options are provided by
+ * AVFormatContext.priv_data if and only if AVInputFormat.priv_class /
+ * AVOutputFormat.priv_class of the corresponding format struct is non-NULL.
+ * Further options may be provided by the @ref AVFormatContext.pb "I/O context",
+ * if its AVClass is non-NULL, and the protocols layer. See the discussion on
+ * nesting in @ref avoptions documentation to learn how to access those.
+ *
+ * @defgroup lavf_decoding Demuxing
+ * @{
+ * Demuxers read a media file and split it into chunks of data (@em packets). A
+ * @ref AVPacket "packet" contains one or more encoded frames which belongs to a
+ * single elementary stream. In the lavf API this process is represented by the
+ * avformat_open_input() function for opening a file, av_read_frame() for
+ * reading a single packet and finally avformat_close_input(), which does the
+ * cleanup.
+ *
+ * @section lavf_decoding_open Opening a media file
+ * The minimum information required to open a file is its URL or filename, which
+ * is passed to avformat_open_input(), as in the following code:
+ * @code
+ * const char    *url = "in.mp3";
+ * AVFormatContext *s = NULL;
+ * int ret = avformat_open_input(&s, url, NULL, NULL);
+ * if (ret < 0)
+ *     abort();
+ * @endcode
+ * The above code attempts to allocate an AVFormatContext, open the
+ * specified file (autodetecting the format) and read the header, exporting the
+ * information stored there into s. Some formats do not have a header or do not
+ * store enough information there, so it is recommended that you call the
+ * avformat_find_stream_info() function which tries to read and decode a few
+ * frames to find missing information.
+ *
+ * In some cases you might want to preallocate an AVFormatContext yourself with
+ * avformat_alloc_context() and do some tweaking on it before passing it to
+ * avformat_open_input(). One such case is when you want to use custom functions
+ * for reading input data instead of lavf internal I/O layer.
+ * To do that, create your own AVIOContext with avio_alloc_context(), passing
+ * your reading callbacks to it. Then set the @em pb field of your
+ * AVFormatContext to newly created AVIOContext.
+ *
+ * Since the format of the opened file is in general not known until after
+ * avformat_open_input() has returned, it is not possible to set demuxer private
+ * options on a preallocated context. Instead, the options should be passed to
+ * avformat_open_input() wrapped in an AVDictionary:
+ * @code
+ * AVDictionary *options = NULL;
+ * av_dict_set(&options, "video_size", "640x480", 0);
+ * av_dict_set(&options, "pixel_format", "rgb24", 0);
+ *
+ * if (avformat_open_input(&s, url, NULL, &options) < 0)
+ *     abort();
+ * av_dict_free(&options);
+ * @endcode
+ * This code passes the private options 'video_size' and 'pixel_format' to the
+ * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it
+ * cannot know how to interpret raw video data otherwise. If the format turns
+ * out to be something different than raw video, those options will not be
+ * recognized by the demuxer and therefore will not be applied. Such unrecognized
+ * options are then returned in the options dictionary (recognized options are
+ * consumed). The calling program can handle such unrecognized options as it
+ * wishes, e.g.
+ * @code
+ * AVDictionaryEntry *e;
+ * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
+ *     fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key);
+ *     abort();
+ * }
+ * @endcode
+ *
+ * After you have finished reading the file, you must close it with
+ * avformat_close_input(). It will free everything associated with the file.
+ *
+ * @section lavf_decoding_read Reading from an opened file
+ * Reading data from an opened AVFormatContext is done by repeatedly calling
+ * av_read_frame() on it. Each call, if successful, will return an AVPacket
+ * containing encoded data for one AVStream, identified by
+ * AVPacket.stream_index. This packet may be passed straight into the libavcodec
+ * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or
+ * avcodec_decode_subtitle2() if the caller wishes to decode the data.
+ *
+ * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be
+ * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for
+ * pts/dts, 0 for duration) if the stream does not provide them. The timing
+ * information will be in AVStream.time_base units, i.e. it has to be
+ * multiplied by the timebase to convert them to seconds.
+ *
+ * If AVPacket.buf is set on the returned packet, then the packet is
+ * allocated dynamically and the user may keep it indefinitely.
+ * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a
+ * static storage somewhere inside the demuxer and the packet is only valid
+ * until the next av_read_frame() call or closing the file. If the caller
+ * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy
+ * of it.
+ * In both cases, the packet must be freed with av_free_packet() when it is no
+ * longer needed.
+ *
+ * @section lavf_decoding_seek Seeking
+ * @}
+ *
+ * @defgroup lavf_encoding Muxing
+ * @{
+ * @}
+ *
+ * @defgroup lavf_io I/O Read/Write
+ * @{
+ * @}
+ *
+ * @defgroup lavf_codec Demuxers
+ * @{
+ * @defgroup lavf_codec_native Native Demuxers
+ * @{
+ * @}
+ * @defgroup lavf_codec_wrappers External library wrappers
+ * @{
+ * @}
+ * @}
+ * @defgroup lavf_protos I/O Protocols
+ * @{
+ * @}
+ * @defgroup lavf_internal Internal
+ * @{
+ * @}
+ * @}
+ *
+ */
+
+#include <time.h>
+#include <stdio.h>  /* FILE */
+#include "libavcodec/avcodec.h"
+#include "libavutil/dict.h"
+#include "libavutil/log.h"
+
+#include "avio.h"
+#include "libavformat/version.h"
+
+struct AVFormatContext;
+
+
+/**
+ * @defgroup metadata_api Public Metadata API
+ * @{
+ * @ingroup libavf
+ * The metadata API allows libavformat to export metadata tags to a client
+ * application when demuxing. Conversely it allows a client application to
+ * set metadata when muxing.
+ *
+ * Metadata is exported or set as pairs of key/value strings in the 'metadata'
+ * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs
+ * using the @ref lavu_dict "AVDictionary" API. Like all strings in Libav,
+ * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata
+ * exported by demuxers isn't checked to be valid UTF-8 in most cases.
+ *
+ * Important concepts to keep in mind:
+ * -  Keys are unique; there can never be 2 tags with the same key. This is
+ *    also meant semantically, i.e., a demuxer should not knowingly produce
+ *    several keys that are literally different but semantically identical.
+ *    E.g., key=Author5, key=Author6. In this example, all authors must be
+ *    placed in the same tag.
+ * -  Metadata is flat, not hierarchical; there are no subtags. If you
+ *    want to store, e.g., the email address of the child of producer Alice
+ *    and actor Bob, that could have key=alice_and_bobs_childs_email_address.
+ * -  Several modifiers can be applied to the tag name. This is done by
+ *    appending a dash character ('-') and the modifier name in the order
+ *    they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng.
+ *    -  language -- a tag whose value is localized for a particular language
+ *       is appended with the ISO 639-2/B 3-letter language code.
+ *       For example: Author-ger=Michael, Author-eng=Mike
+ *       The original/default language is in the unqualified "Author" tag.
+ *       A demuxer should set a default if it sets any translated tag.
+ *    -  sorting  -- a modified version of a tag that should be used for
+ *       sorting will have '-sort' appended. E.g. artist="The Beatles",
+ *       artist-sort="Beatles, The".
+ *
+ * -  Demuxers attempt to export metadata in a generic format, however tags
+ *    with no generic equivalents are left as they are stored in the container.
+ *    Follows a list of generic tag names:
+ *
+ @verbatim
+ album        -- name of the set this work belongs to
+ album_artist -- main creator of the set/album, if different from artist.
+                 e.g. "Various Artists" for compilation albums.
+ artist       -- main creator of the work
+ comment      -- any additional description of the file.
+ composer     -- who composed the work, if different from artist.
+ copyright    -- name of copyright holder.
+ creation_time-- date when the file was created, preferably in ISO 8601.
+ date         -- date when the work was created, preferably in ISO 8601.
+ disc         -- number of a subset, e.g. disc in a multi-disc collection.
+ encoder      -- name/settings of the software/hardware that produced the file.
+ encoded_by   -- person/group who created the file.
+ filename     -- original name of the file.
+ genre        -- <self-evident>.
+ language     -- main language in which the work is performed, preferably
+                 in ISO 639-2 format. Multiple languages can be specified by
+                 separating them with commas.
+ performer    -- artist who performed the work, if different from artist.
+                 E.g for "Also sprach Zarathustra", artist would be "Richard
+                 Strauss" and performer "London Philharmonic Orchestra".
+ publisher    -- name of the label/publisher.
+ service_name     -- name of the service in broadcasting (channel name).
+ service_provider -- name of the service provider in broadcasting.
+ title        -- name of the work.
+ track        -- number of this work in the set, can be in form current/total.
+ variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
+ @endverbatim
+ *
+ * Look in the examples section for an application example how to use the Metadata API.
+ *
+ * @}
+ */
+
+/* packet functions */
+
+
+/**
+ * Allocate and read the payload of a packet and initialize its
+ * fields with default values.
+ *
+ * @param pkt packet
+ * @param size desired payload size
+ * @return >0 (read size) if OK, AVERROR_xxx otherwise
+ */
+int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
+
+
+/**
+ * Read data and append it to the current content of the AVPacket.
+ * If pkt->size is 0 this is identical to av_get_packet.
+ * Note that this uses av_grow_packet and thus involves a realloc
+ * which is inefficient. Thus this function should only be used
+ * when there is no reasonable way to know (an upper bound of)
+ * the final size.
+ *
+ * @param pkt packet
+ * @param size amount of data to read
+ * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
+ *         will not be lost even if an error occurs.
+ */
+int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
+
+/*************************************************/
+/* fractional numbers for exact pts handling */
+
+/**
+ * The exact value of the fractional number is: 'val + num / den'.
+ * num is assumed to be 0 <= num < den.
+ */
+typedef struct AVFrac {
+    int64_t val, num, den;
+} AVFrac;
+
+/*************************************************/
+/* input/output formats */
+
+struct AVCodecTag;
+
+/**
+ * This structure contains the data a format has to probe a file.
+ */
+typedef struct AVProbeData {
+    const char *filename;
+    unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */
+    int buf_size;       /**< Size of buf except extra allocated bytes */
+} AVProbeData;
+
+#define AVPROBE_SCORE_EXTENSION  50 ///< score for file extension
+#define AVPROBE_SCORE_MAX       100 ///< maximum score
+
+#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
+
+/// Demuxer will use avio_open, no opened file should be provided by the caller.
+#define AVFMT_NOFILE        0x0001
+#define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */
+#define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */
+#define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for
+                                      raw picture data. */
+#define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */
+#define AVFMT_NOTIMESTAMPS  0x0080 /**< Format does not need / have any timestamps. */
+#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
+#define AVFMT_TS_DISCONT    0x0200 /**< Format allows timestamp discontinuities. Note, muxers always require valid (monotone) timestamps */
+#define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
+#define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height */
+#define AVFMT_NOSTREAMS     0x1000 /**< Format does not require any streams */
+#define AVFMT_NOBINSEARCH   0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */
+#define AVFMT_NOGENSEARCH   0x4000 /**< Format does not allow to fall back on generic search */
+#define AVFMT_NO_BYTE_SEEK  0x8000 /**< Format does not allow seeking by bytes */
+#define AVFMT_ALLOW_FLUSH  0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */
+#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly
+                                        increasing timestamps, but they must
+                                        still be monotonic */
+#define AVFMT_TS_NEGATIVE  0x40000 /**< Format allows muxing negative
+                                        timestamps. If not set the timestamp
+                                        will be shifted in av_write_frame and
+                                        av_interleaved_write_frame so they
+                                        start from 0. */
+
+/**
+ * @addtogroup lavf_encoding
+ * @{
+ */
+typedef struct AVOutputFormat {
+    const char *name;
+    /**
+     * Descriptive name for the format, meant to be more human-readable
+     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
+     * to define it.
+     */
+    const char *long_name;
+    const char *mime_type;
+    const char *extensions; /**< comma-separated filename extensions */
+    /* output support */
+    enum AVCodecID audio_codec;    /**< default audio codec */
+    enum AVCodecID video_codec;    /**< default video codec */
+    enum AVCodecID subtitle_codec; /**< default subtitle codec */
+    /**
+     * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
+     * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
+     * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH,
+     * AVFMT_TS_NONSTRICT
+     */
+    int flags;
+
+    /**
+     * List of supported codec_id-codec_tag pairs, ordered by "better
+     * choice first". The arrays are all terminated by AV_CODEC_ID_NONE.
+     */
+    const struct AVCodecTag * const *codec_tag;
+
+
+    const AVClass *priv_class; ///< AVClass for the private context
+
+    /*****************************************************************
+     * No fields below this line are part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+    struct AVOutputFormat *next;
+    /**
+     * size of private data so that it can be allocated in the wrapper
+     */
+    int priv_data_size;
+
+    int (*write_header)(struct AVFormatContext *);
+    /**
+     * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
+     * pkt can be NULL in order to flush data buffered in the muxer.
+     * When flushing, return 0 if there still is more data to flush,
+     * or 1 if everything was flushed and there is no more buffered
+     * data.
+     */
+    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
+    int (*write_trailer)(struct AVFormatContext *);
+    /**
+     * Currently only used to set pixel format if not YUV420P.
+     */
+    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
+                             AVPacket *in, int flush);
+    /**
+     * Test if the given codec can be stored in this container.
+     *
+     * @return 1 if the codec is supported, 0 if it is not.
+     *         A negative number if unknown.
+     */
+    int (*query_codec)(enum AVCodecID id, int std_compliance);
+} AVOutputFormat;
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavf_decoding
+ * @{
+ */
+typedef struct AVInputFormat {
+    /**
+     * A comma separated list of short names for the format. New names
+     * may be appended with a minor bump.
+     */
+    const char *name;
+
+    /**
+     * Descriptive name for the format, meant to be more human-readable
+     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
+     * to define it.
+     */
+    const char *long_name;
+
+    /**
+     * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
+     * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
+     * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
+     */
+    int flags;
+
+    /**
+     * If extensions are defined, then no probe is done. You should
+     * usually not use extension format guessing because it is not
+     * reliable enough
+     */
+    const char *extensions;
+
+    const struct AVCodecTag * const *codec_tag;
+
+    const AVClass *priv_class; ///< AVClass for the private context
+
+    /*****************************************************************
+     * No fields below this line are part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+    struct AVInputFormat *next;
+
+    /**
+     * Raw demuxers store their codec ID here.
+     */
+    int raw_codec_id;
+
+    /**
+     * Size of private data so that it can be allocated in the wrapper.
+     */
+    int priv_data_size;
+
+    /**
+     * Tell if a given file has a chance of being parsed as this format.
+     * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
+     * big so you do not have to check for that unless you need more.
+     */
+    int (*read_probe)(AVProbeData *);
+
+    /**
+     * Read the format header and initialize the AVFormatContext
+     * structure. Return 0 if OK. Only used in raw format right
+     * now. 'avformat_new_stream' should be called to create new streams.
+     */
+    int (*read_header)(struct AVFormatContext *);
+
+    /**
+     * Read one packet and put it in 'pkt'. pts and flags are also
+     * set. 'avformat_new_stream' can be called only if the flag
+     * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a
+     * background thread).
+     * @return 0 on success, < 0 on error.
+     *         When returning an error, pkt must not have been allocated
+     *         or must be freed before returning
+     */
+    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
+
+    /**
+     * Close the stream. The AVFormatContext and AVStreams are not
+     * freed by this function
+     */
+    int (*read_close)(struct AVFormatContext *);
+
+    /**
+     * Seek to a given timestamp relative to the frames in
+     * stream component stream_index.
+     * @param stream_index Must not be -1.
+     * @param flags Selects which direction should be preferred if no exact
+     *              match is available.
+     * @return >= 0 on success (but not necessarily the new offset)
+     */
+    int (*read_seek)(struct AVFormatContext *,
+                     int stream_index, int64_t timestamp, int flags);
+
+    /**
+     * Get the next timestamp in stream[stream_index].time_base units.
+     * @return the timestamp or AV_NOPTS_VALUE if an error occurred
+     */
+    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
+                              int64_t *pos, int64_t pos_limit);
+
+    /**
+     * Start/resume playing - only meaningful if using a network-based format
+     * (RTSP).
+     */
+    int (*read_play)(struct AVFormatContext *);
+
+    /**
+     * Pause playing - only meaningful if using a network-based format
+     * (RTSP).
+     */
+    int (*read_pause)(struct AVFormatContext *);
+
+    /**
+     * Seek to timestamp ts.
+     * Seeking will be done so that the point from which all active streams
+     * can be presented successfully will be closest to ts and within min/max_ts.
+     * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
+     */
+    int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+} AVInputFormat;
+/**
+ * @}
+ */
+
+enum AVStreamParseType {
+    AVSTREAM_PARSE_NONE,
+    AVSTREAM_PARSE_FULL,       /**< full parsing and repack */
+    AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */
+    AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
+    AVSTREAM_PARSE_FULL_ONCE,  /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
+};
+
+typedef struct AVIndexEntry {
+    int64_t pos;
+    int64_t timestamp;
+#define AVINDEX_KEYFRAME 0x0001
+    int flags:2;
+    int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
+    int min_distance;         /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
+} AVIndexEntry;
+
+#define AV_DISPOSITION_DEFAULT   0x0001
+#define AV_DISPOSITION_DUB       0x0002
+#define AV_DISPOSITION_ORIGINAL  0x0004
+#define AV_DISPOSITION_COMMENT   0x0008
+#define AV_DISPOSITION_LYRICS    0x0010
+#define AV_DISPOSITION_KARAOKE   0x0020
+
+/**
+ * Track should be used during playback by default.
+ * Useful for subtitle track that should be displayed
+ * even when user did not explicitly ask for subtitles.
+ */
+#define AV_DISPOSITION_FORCED    0x0040
+#define AV_DISPOSITION_HEARING_IMPAIRED  0x0080  /**< stream for hearing impaired audiences */
+#define AV_DISPOSITION_VISUAL_IMPAIRED   0x0100  /**< stream for visual impaired audiences */
+#define AV_DISPOSITION_CLEAN_EFFECTS     0x0200  /**< stream without voice */
+/**
+ * The stream is stored in the file as an attached picture/"cover art" (e.g.
+ * APIC frame in ID3v2). The single packet associated with it will be returned
+ * among the first few packets read from the file unless seeking takes place.
+ * It can also be accessed at any time in AVStream.attached_pic.
+ */
+#define AV_DISPOSITION_ATTACHED_PIC      0x0400
+
+/**
+ * Stream structure.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVStream) must not be used outside libav*.
+ */
+typedef struct AVStream {
+    int index;    /**< stream index in AVFormatContext */
+    /**
+     * Format-specific stream ID.
+     * decoding: set by libavformat
+     * encoding: set by the user, replaced by libavformat if left unset
+     */
+    int id;
+    /**
+     * Codec context associated with this stream. Allocated and freed by
+     * libavformat.
+     *
+     * - decoding: The demuxer exports codec information stored in the headers
+     *             here.
+     * - encoding: The user sets codec information, the muxer writes it to the
+     *             output. Mandatory fields as specified in AVCodecContext
+     *             documentation must be set even if this AVCodecContext is
+     *             not actually used for encoding.
+     */
+    AVCodecContext *codec;
+    void *priv_data;
+
+    /**
+     * encoding: pts generation when outputting stream
+     */
+    struct AVFrac pts;
+
+    /**
+     * This is the fundamental unit of time (in seconds) in terms
+     * of which frame timestamps are represented.
+     *
+     * decoding: set by libavformat
+     * encoding: set by libavformat in avformat_write_header. The muxer may use the
+     * user-provided value of @ref AVCodecContext.time_base "codec->time_base"
+     * as a hint.
+     */
+    AVRational time_base;
+
+    /**
+     * Decoding: pts of the first frame of the stream, in stream time base.
+     * Only set this if you are absolutely 100% sure that the value you set
+     * it to really is the pts of the first frame.
+     * This may be undefined (AV_NOPTS_VALUE).
+     */
+    int64_t start_time;
+
+    /**
+     * Decoding: duration of the stream, in stream time base.
+     * If a source file does not specify a duration, but does specify
+     * a bitrate, this value will be estimated from bitrate and file size.
+     */
+    int64_t duration;
+
+    int64_t nb_frames;                 ///< number of frames in this stream if known or 0
+
+    int disposition; /**< AV_DISPOSITION_* bit field */
+
+    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
+
+    /**
+     * sample aspect ratio (0 if unknown)
+     * - encoding: Set by user.
+     * - decoding: Set by libavformat.
+     */
+    AVRational sample_aspect_ratio;
+
+    AVDictionary *metadata;
+
+    /**
+     * Average framerate
+     */
+    AVRational avg_frame_rate;
+
+    /**
+     * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet
+     * will contain the attached picture.
+     *
+     * decoding: set by libavformat, must not be modified by the caller.
+     * encoding: unused
+     */
+    AVPacket attached_pic;
+
+    /*****************************************************************
+     * All fields below this line are not part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+
+    /**
+     * Stream information used internally by av_find_stream_info()
+     */
+#define MAX_STD_TIMEBASES (60*12+5)
+    struct {
+        int nb_decoded_frames;
+        int found_decoder;
+
+        /**
+         * Those are used for average framerate estimation.
+         */
+        int64_t fps_first_dts;
+        int     fps_first_dts_idx;
+        int64_t fps_last_dts;
+        int     fps_last_dts_idx;
+
+    } *info;
+
+    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
+
+    // Timestamp generation support:
+    /**
+     * Timestamp corresponding to the last dts sync point.
+     *
+     * Initialized when AVCodecParserContext.dts_sync_point >= 0 and
+     * a DTS is received from the underlying container. Otherwise set to
+     * AV_NOPTS_VALUE by default.
+     */
+    int64_t reference_dts;
+    int64_t first_dts;
+    int64_t cur_dts;
+    int64_t last_IP_pts;
+    int last_IP_duration;
+
+    /**
+     * Number of packets to buffer for codec probing
+     */
+#define MAX_PROBE_PACKETS 2500
+    int probe_packets;
+
+    /**
+     * Number of frames that have been demuxed during av_find_stream_info()
+     */
+    int codec_info_nb_frames;
+
+    /* av_read_frame() support */
+    enum AVStreamParseType need_parsing;
+    struct AVCodecParserContext *parser;
+
+    /**
+     * last packet in packet_buffer for this stream when muxing.
+     */
+    struct AVPacketList *last_in_packet_buffer;
+    AVProbeData probe_data;
+#define MAX_REORDER_DELAY 16
+    int64_t pts_buffer[MAX_REORDER_DELAY+1];
+
+    AVIndexEntry *index_entries; /**< Only used if the format does not
+                                    support seeking natively. */
+    int nb_index_entries;
+    unsigned int index_entries_allocated_size;
+} AVStream;
+
+#define AV_PROGRAM_RUNNING 1
+
+/**
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVProgram) must not be used outside libav*.
+ */
+typedef struct AVProgram {
+    int            id;
+    int            flags;
+    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
+    unsigned int   *stream_index;
+    unsigned int   nb_stream_indexes;
+    AVDictionary *metadata;
+} AVProgram;
+
+#define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
+                                         (streams are added dynamically) */
+
+typedef struct AVChapter {
+    int id;                 ///< unique ID to identify the chapter
+    AVRational time_base;   ///< time base in which the start/end timestamps are specified
+    int64_t start, end;     ///< chapter start/end time in time_base units
+    AVDictionary *metadata;
+} AVChapter;
+
+/**
+ * Format I/O context.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVFormatContext) must not be used outside libav*, use
+ * avformat_alloc_context() to create an AVFormatContext.
+ */
+typedef struct AVFormatContext {
+    /**
+     * A class for logging and AVOptions. Set by avformat_alloc_context().
+     * Exports (de)muxer private options if they exist.
+     */
+    const AVClass *av_class;
+
+    /**
+     * Can only be iformat or oformat, not both at the same time.
+     *
+     * decoding: set by avformat_open_input().
+     * encoding: set by the user.
+     */
+    struct AVInputFormat *iformat;
+    struct AVOutputFormat *oformat;
+
+    /**
+     * Format private data. This is an AVOptions-enabled struct
+     * if and only if iformat/oformat.priv_class is not NULL.
+     */
+    void *priv_data;
+
+    /**
+     * I/O context.
+     *
+     * decoding: either set by the user before avformat_open_input() (then
+     * the user must close it manually) or set by avformat_open_input().
+     * encoding: set by the user.
+     *
+     * Do NOT set this field if AVFMT_NOFILE flag is set in
+     * iformat/oformat.flags. In such a case, the (de)muxer will handle
+     * I/O in some other way and this field will be NULL.
+     */
+    AVIOContext *pb;
+
+    /* stream info */
+    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
+
+    /**
+     * A list of all streams in the file. New streams are created with
+     * avformat_new_stream().
+     *
+     * decoding: streams are created by libavformat in avformat_open_input().
+     * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also
+     * appear in av_read_frame().
+     * encoding: streams are created by the user before avformat_write_header().
+     */
+    unsigned int nb_streams;
+    AVStream **streams;
+
+    char filename[1024]; /**< input or output filename */
+
+    /**
+     * Decoding: position of the first frame of the component, in
+     * AV_TIME_BASE fractional seconds. NEVER set this value directly:
+     * It is deduced from the AVStream values.
+     */
+    int64_t start_time;
+
+    /**
+     * Decoding: duration of the stream, in AV_TIME_BASE fractional
+     * seconds. Only set this value if you know none of the individual stream
+     * durations and also do not set any of them. This is deduced from the
+     * AVStream values if not set.
+     */
+    int64_t duration;
+
+    /**
+     * Decoding: total stream bitrate in bit/s, 0 if not
+     * available. Never set it directly if the file_size and the
+     * duration are known as Libav can compute it automatically.
+     */
+    int bit_rate;
+
+    unsigned int packet_size;
+    int max_delay;
+
+    int flags;
+#define AVFMT_FLAG_GENPTS       0x0001 ///< Generate missing pts even if it requires parsing future frames.
+#define AVFMT_FLAG_IGNIDX       0x0002 ///< Ignore index.
+#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input.
+#define AVFMT_FLAG_IGNDTS       0x0008 ///< Ignore DTS on frames that contain both DTS & PTS
+#define AVFMT_FLAG_NOFILLIN     0x0010 ///< Do not infer any values from other values, just return what is stored in the container
+#define AVFMT_FLAG_NOPARSE      0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled
+#define AVFMT_FLAG_NOBUFFER     0x0040 ///< Do not buffer frames when possible
+#define AVFMT_FLAG_CUSTOM_IO    0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
+#define AVFMT_FLAG_DISCARD_CORRUPT  0x0100 ///< Discard frames marked corrupted
+
+    /**
+     * decoding: size of data to probe; encoding: unused.
+     */
+    unsigned int probesize;
+
+    /**
+     * decoding: maximum time (in AV_TIME_BASE units) during which the input should
+     * be analyzed in avformat_find_stream_info().
+     */
+    int max_analyze_duration;
+
+    const uint8_t *key;
+    int keylen;
+
+    unsigned int nb_programs;
+    AVProgram **programs;
+
+    /**
+     * Forced video codec_id.
+     * Demuxing: Set by user.
+     */
+    enum AVCodecID video_codec_id;
+
+    /**
+     * Forced audio codec_id.
+     * Demuxing: Set by user.
+     */
+    enum AVCodecID audio_codec_id;
+
+    /**
+     * Forced subtitle codec_id.
+     * Demuxing: Set by user.
+     */
+    enum AVCodecID subtitle_codec_id;
+
+    /**
+     * Maximum amount of memory in bytes to use for the index of each stream.
+     * If the index exceeds this size, entries will be discarded as
+     * needed to maintain a smaller size. This can lead to slower or less
+     * accurate seeking (depends on demuxer).
+     * Demuxers for which a full in-memory index is mandatory will ignore
+     * this.
+     * muxing  : unused
+     * demuxing: set by user
+     */
+    unsigned int max_index_size;
+
+    /**
+     * Maximum amount of memory in bytes to use for buffering frames
+     * obtained from realtime capture devices.
+     */
+    unsigned int max_picture_buffer;
+
+    unsigned int nb_chapters;
+    AVChapter **chapters;
+
+    AVDictionary *metadata;
+
+    /**
+     * Start time of the stream in real world time, in microseconds
+     * since the unix epoch (00:00 1st January 1970). That is, pts=0
+     * in the stream was captured at this real world time.
+     * - encoding: Set by user.
+     * - decoding: Unused.
+     */
+    int64_t start_time_realtime;
+
+    /**
+     * decoding: number of frames used to probe fps
+     */
+    int fps_probe_size;
+
+    /**
+     * Error recognition; higher values will detect more errors but may
+     * misdetect some more or less valid parts as errors.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int error_recognition;
+
+    /**
+     * Custom interrupt callbacks for the I/O layer.
+     *
+     * decoding: set by the user before avformat_open_input().
+     * encoding: set by the user before avformat_write_header()
+     * (mainly useful for AVFMT_NOFILE formats). The callback
+     * should also be passed to avio_open2() if it's used to
+     * open the file.
+     */
+    AVIOInterruptCB interrupt_callback;
+
+    /**
+     * Flags to enable debugging.
+     */
+    int debug;
+#define FF_FDEBUG_TS        0x0001
+    /*****************************************************************
+     * All fields below this line are not part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+
+    /**
+     * This buffer is only needed when packets were already buffered but
+     * not decoded, for example to get the codec parameters in MPEG
+     * streams.
+     */
+    struct AVPacketList *packet_buffer;
+    struct AVPacketList *packet_buffer_end;
+
+    /* av_seek_frame() support */
+    int64_t data_offset; /**< offset of the first packet */
+
+    /**
+     * Raw packets from the demuxer, prior to parsing and decoding.
+     * This buffer is used for buffering packets until the codec can
+     * be identified, as parsing cannot be done without knowing the
+     * codec.
+     */
+    struct AVPacketList *raw_packet_buffer;
+    struct AVPacketList *raw_packet_buffer_end;
+    /**
+     * Packets split by the parser get queued here.
+     */
+    struct AVPacketList *parse_queue;
+    struct AVPacketList *parse_queue_end;
+    /**
+     * Remaining size available for raw_packet_buffer, in bytes.
+     */
+#define RAW_PACKET_BUFFER_SIZE 2500000
+    int raw_packet_buffer_remaining_size;
+
+    /**
+     * Offset to remap timestamps to be non-negative.
+     * Expressed in timebase units.
+     */
+    int64_t offset;
+
+    /**
+     * Timebase for the timestamp offset.
+     */
+    AVRational offset_timebase;
+
+} AVFormatContext;
+
+typedef struct AVPacketList {
+    AVPacket pkt;
+    struct AVPacketList *next;
+} AVPacketList;
+
+
+/**
+ * @defgroup lavf_core Core functions
+ * @ingroup libavf
+ *
+ * Functions for querying libavformat capabilities, allocating core structures,
+ * etc.
+ * @{
+ */
+
+/**
+ * Return the LIBAVFORMAT_VERSION_INT constant.
+ */
+unsigned avformat_version(void);
+
+/**
+ * Return the libavformat build-time configuration.
+ */
+const char *avformat_configuration(void);
+
+/**
+ * Return the libavformat license.
+ */
+const char *avformat_license(void);
+
+/**
+ * Initialize libavformat and register all the muxers, demuxers and
+ * protocols. If you do not call this function, then you can select
+ * exactly which formats you want to support.
+ *
+ * @see av_register_input_format()
+ * @see av_register_output_format()
+ * @see av_register_protocol()
+ */
+void av_register_all(void);
+
+void av_register_input_format(AVInputFormat *format);
+void av_register_output_format(AVOutputFormat *format);
+
+/**
+ * Do global initialization of network components. This is optional,
+ * but recommended, since it avoids the overhead of implicitly
+ * doing the setup for each session.
+ *
+ * Calling this function will become mandatory if using network
+ * protocols at some major version bump.
+ */
+int avformat_network_init(void);
+
+/**
+ * Undo the initialization done by avformat_network_init.
+ */
+int avformat_network_deinit(void);
+
+/**
+ * If f is NULL, returns the first registered input format,
+ * if f is non-NULL, returns the next registered input format after f
+ * or NULL if f is the last one.
+ */
+AVInputFormat  *av_iformat_next(AVInputFormat  *f);
+
+/**
+ * If f is NULL, returns the first registered output format,
+ * if f is non-NULL, returns the next registered output format after f
+ * or NULL if f is the last one.
+ */
+AVOutputFormat *av_oformat_next(AVOutputFormat *f);
+
+/**
+ * Allocate an AVFormatContext.
+ * avformat_free_context() can be used to free the context and everything
+ * allocated by the framework within it.
+ */
+AVFormatContext *avformat_alloc_context(void);
+
+/**
+ * Free an AVFormatContext and all its streams.
+ * @param s context to free
+ */
+void avformat_free_context(AVFormatContext *s);
+
+/**
+ * Get the AVClass for AVFormatContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avformat_get_class(void);
+
+/**
+ * Add a new stream to a media file.
+ *
+ * When demuxing, it is called by the demuxer in read_header(). If the
+ * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
+ * be called in read_packet().
+ *
+ * When muxing, should be called by the user before avformat_write_header().
+ *
+ * @param c If non-NULL, the AVCodecContext corresponding to the new stream
+ * will be initialized to use this codec. This is needed for e.g. codec-specific
+ * defaults to be set, so codec should be provided if it is known.
+ *
+ * @return newly created stream or NULL on error.
+ */
+AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
+
+AVProgram *av_new_program(AVFormatContext *s, int id);
+
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup lavf_decoding
+ * @{
+ */
+
+/**
+ * Find AVInputFormat based on the short name of the input format.
+ */
+AVInputFormat *av_find_input_format(const char *short_name);
+
+/**
+ * Guess the file format.
+ *
+ * @param is_opened Whether the file is already opened; determines whether
+ *                  demuxers with or without AVFMT_NOFILE are probed.
+ */
+AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
+
+/**
+ * Guess the file format.
+ *
+ * @param is_opened Whether the file is already opened; determines whether
+ *                  demuxers with or without AVFMT_NOFILE are probed.
+ * @param score_max A probe score larger that this is required to accept a
+ *                  detection, the variable is set to the actual detection
+ *                  score afterwards.
+ *                  If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
+ *                  to retry with a larger probe buffer.
+ */
+AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
+
+/**
+ * Probe a bytestream to determine the input format. Each time a probe returns
+ * with a score that is too low, the probe buffer size is increased and another
+ * attempt is made. When the maximum probe size is reached, the input format
+ * with the highest score is returned.
+ *
+ * @param pb the bytestream to probe
+ * @param fmt the input format is put here
+ * @param filename the filename of the stream
+ * @param logctx the log context
+ * @param offset the offset within the bytestream to probe from
+ * @param max_probe_size the maximum probe buffer size (zero for default)
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
+                          const char *filename, void *logctx,
+                          unsigned int offset, unsigned int max_probe_size);
+
+/**
+ * Open an input stream and read the header. The codecs are not opened.
+ * The stream must be closed with avformat_close_input().
+ *
+ * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
+ *           May be a pointer to NULL, in which case an AVFormatContext is allocated by this
+ *           function and written into ps.
+ *           Note that a user-supplied AVFormatContext will be freed on failure.
+ * @param filename Name of the stream to open.
+ * @param fmt If non-NULL, this parameter forces a specific input format.
+ *            Otherwise the format is autodetected.
+ * @param options  A dictionary filled with AVFormatContext and demuxer-private options.
+ *                 On return this parameter will be destroyed and replaced with a dict containing
+ *                 options that were not found. May be NULL.
+ *
+ * @return 0 on success, a negative AVERROR on failure.
+ *
+ * @note If you want to use custom IO, preallocate the format context and set its pb field.
+ */
+int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);
+
+/**
+ * Read packets of a media file to get stream information. This
+ * is useful for file formats with no headers such as MPEG. This
+ * function also computes the real framerate in case of MPEG-2 repeat
+ * frame mode.
+ * The logical file position is not changed by this function;
+ * examined packets may be buffered for later processing.
+ *
+ * @param ic media file handle
+ * @param options  If non-NULL, an ic.nb_streams long array of pointers to
+ *                 dictionaries, where i-th member contains options for
+ *                 codec corresponding to i-th stream.
+ *                 On return each dictionary will be filled with options that were not found.
+ * @return >=0 if OK, AVERROR_xxx on error
+ *
+ * @note this function isn't guaranteed to open all the codecs, so
+ *       options being non-empty at return is a perfectly normal behavior.
+ *
+ * @todo Let the user decide somehow what information is needed so that
+ *       we do not waste time getting stuff the user does not need.
+ */
+int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options);
+
+/**
+ * Find the "best" stream in the file.
+ * The best stream is determined according to various heuristics as the most
+ * likely to be what the user expects.
+ * If the decoder parameter is non-NULL, av_find_best_stream will find the
+ * default decoder for the stream's codec; streams for which no decoder can
+ * be found are ignored.
+ *
+ * @param ic                media file handle
+ * @param type              stream type: video, audio, subtitles, etc.
+ * @param wanted_stream_nb  user-requested stream number,
+ *                          or -1 for automatic selection
+ * @param related_stream    try to find a stream related (eg. in the same
+ *                          program) to this one, or -1 if none
+ * @param decoder_ret       if non-NULL, returns the decoder for the
+ *                          selected stream
+ * @param flags             flags; none are currently defined
+ * @return  the non-negative stream number in case of success,
+ *          AVERROR_STREAM_NOT_FOUND if no stream with the requested type
+ *          could be found,
+ *          AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
+ * @note  If av_find_best_stream returns successfully and decoder_ret is not
+ *        NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
+ */
+int av_find_best_stream(AVFormatContext *ic,
+                        enum AVMediaType type,
+                        int wanted_stream_nb,
+                        int related_stream,
+                        AVCodec **decoder_ret,
+                        int flags);
+
+/**
+ * Return the next frame of a stream.
+ * This function returns what is stored in the file, and does not validate
+ * that what is there are valid frames for the decoder. It will split what is
+ * stored in the file into frames and return one for each call. It will not
+ * omit invalid data between valid frames so as to give the decoder the maximum
+ * information possible for decoding.
+ *
+ * If pkt->buf is NULL, then the packet is valid until the next
+ * av_read_frame() or until avformat_close_input(). Otherwise the packet
+ * is valid indefinitely. In both cases the packet must be freed with
+ * av_free_packet when it is no longer needed. For video, the packet contains
+ * exactly one frame. For audio, it contains an integer number of frames if each
+ * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames
+ * have a variable size (e.g. MPEG audio), then it contains one frame.
+ *
+ * pkt->pts, pkt->dts and pkt->duration are always set to correct
+ * values in AVStream.time_base units (and guessed if the format cannot
+ * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format
+ * has B-frames, so it is better to rely on pkt->dts if you do not
+ * decompress the payload.
+ *
+ * @return 0 if OK, < 0 on error or end of file
+ */
+int av_read_frame(AVFormatContext *s, AVPacket *pkt);
+
+/**
+ * Seek to the keyframe at timestamp.
+ * 'timestamp' in 'stream_index'.
+ * @param stream_index If stream_index is (-1), a default
+ * stream is selected, and timestamp is automatically converted
+ * from AV_TIME_BASE units to the stream specific time_base.
+ * @param timestamp Timestamp in AVStream.time_base units
+ *        or, if no stream is specified, in AV_TIME_BASE units.
+ * @param flags flags which select direction and seeking mode
+ * @return >= 0 on success
+ */
+int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
+                  int flags);
+
+/**
+ * Seek to timestamp ts.
+ * Seeking will be done so that the point from which all active streams
+ * can be presented successfully will be closest to ts and within min/max_ts.
+ * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
+ *
+ * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and
+ * are the file position (this may not be supported by all demuxers).
+ * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames
+ * in the stream with stream_index (this may not be supported by all demuxers).
+ * Otherwise all timestamps are in units of the stream selected by stream_index
+ * or if stream_index is -1, in AV_TIME_BASE units.
+ * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as
+ * keyframes (this may not be supported by all demuxers).
+ *
+ * @param stream_index index of the stream which is used as time base reference
+ * @param min_ts smallest acceptable timestamp
+ * @param ts target timestamp
+ * @param max_ts largest acceptable timestamp
+ * @param flags flags
+ * @return >=0 on success, error code otherwise
+ *
+ * @note This is part of the new seek API which is still under construction.
+ *       Thus do not use this yet. It may change at any time, do not expect
+ *       ABI compatibility yet!
+ */
+int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+
+/**
+ * Start playing a network-based stream (e.g. RTSP stream) at the
+ * current position.
+ */
+int av_read_play(AVFormatContext *s);
+
+/**
+ * Pause a network-based stream (e.g. RTSP stream).
+ *
+ * Use av_read_play() to resume it.
+ */
+int av_read_pause(AVFormatContext *s);
+
+/**
+ * Close an opened input AVFormatContext. Free it and all its contents
+ * and set *s to NULL.
+ */
+void avformat_close_input(AVFormatContext **s);
+/**
+ * @}
+ */
+
+#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
+#define AVSEEK_FLAG_BYTE     2 ///< seeking based on position in bytes
+#define AVSEEK_FLAG_ANY      4 ///< seek to any frame, even non-keyframes
+#define AVSEEK_FLAG_FRAME    8 ///< seeking based on frame number
+
+/**
+ * @addtogroup lavf_encoding
+ * @{
+ */
+/**
+ * Allocate the stream private data and write the stream header to
+ * an output media file.
+ *
+ * @param s Media file handle, must be allocated with avformat_alloc_context().
+ *          Its oformat field must be set to the desired output format;
+ *          Its pb field must be set to an already opened AVIOContext.
+ * @param options  An AVDictionary filled with AVFormatContext and muxer-private options.
+ *                 On return this parameter will be destroyed and replaced with a dict containing
+ *                 options that were not found. May be NULL.
+ *
+ * @return 0 on success, negative AVERROR on failure.
+ *
+ * @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
+ */
+int avformat_write_header(AVFormatContext *s, AVDictionary **options);
+
+/**
+ * Write a packet to an output media file.
+ *
+ * The packet shall contain one audio or video frame.
+ * The packet must be correctly interleaved according to the container
+ * specification, if not then av_interleaved_write_frame must be used.
+ *
+ * @param s media file handle
+ * @param pkt The packet, which contains the stream_index, buf/buf_size,
+ *            dts/pts, ...
+ *            This can be NULL (at any time, not just at the end), in
+ *            order to immediately flush data buffered within the muxer,
+ *            for muxers that buffer up data internally before writing it
+ *            to the output.
+ * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush
+ */
+int av_write_frame(AVFormatContext *s, AVPacket *pkt);
+
+/**
+ * Write a packet to an output media file ensuring correct interleaving.
+ *
+ * The packet must contain one audio or video frame.
+ * If the packets are already correctly interleaved, the application should
+ * call av_write_frame() instead as it is slightly faster. It is also important
+ * to keep in mind that completely non-interleaved input will need huge amounts
+ * of memory to interleave with this, so it is preferable to interleave at the
+ * demuxer level.
+ *
+ * @param s media file handle
+ * @param pkt The packet containing the data to be written. pkt->buf must be set
+ * to a valid AVBufferRef describing the packet data. Libavformat takes
+ * ownership of this reference and will unref it when it sees fit. The caller
+ * must not access the data through this reference after this function returns.
+ * This can be NULL (at any time, not just at the end), to flush the
+ * interleaving queues.
+ * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the
+ * index of the corresponding stream in @ref AVFormatContext.streams
+ * "s.streams".
+ * It is very strongly recommended that timing information (@ref AVPacket.pts
+ * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to
+ * correct values.
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ */
+int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
+
+/**
+ * Write the stream trailer to an output media file and free the
+ * file private data.
+ *
+ * May only be called after a successful call to avformat_write_header.
+ *
+ * @param s media file handle
+ * @return 0 if OK, AVERROR_xxx on error
+ */
+int av_write_trailer(AVFormatContext *s);
+
+/**
+ * Return the output format in the list of registered output formats
+ * which best matches the provided parameters, or return NULL if
+ * there is no match.
+ *
+ * @param short_name if non-NULL checks if short_name matches with the
+ * names of the registered formats
+ * @param filename if non-NULL checks if filename terminates with the
+ * extensions of the registered formats
+ * @param mime_type if non-NULL checks if mime_type matches with the
+ * MIME type of the registered formats
+ */
+AVOutputFormat *av_guess_format(const char *short_name,
+                                const char *filename,
+                                const char *mime_type);
+
+/**
+ * Guess the codec ID based upon muxer and filename.
+ */
+enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
+                            const char *filename, const char *mime_type,
+                            enum AVMediaType type);
+
+/**
+ * @}
+ */
+
+
+/**
+ * @defgroup lavf_misc Utility functions
+ * @ingroup libavf
+ * @{
+ *
+ * Miscellaneous utility functions related to both muxing and demuxing
+ * (or neither).
+ */
+
+/**
+ * Send a nice hexadecimal dump of a buffer to the specified file stream.
+ *
+ * @param f The file stream pointer where the dump should be sent to.
+ * @param buf buffer
+ * @param size buffer size
+ *
+ * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
+ */
+void av_hex_dump(FILE *f, const uint8_t *buf, int size);
+
+/**
+ * Send a nice hexadecimal dump of a buffer to the log.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param buf buffer
+ * @param size buffer size
+ *
+ * @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
+ */
+void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size);
+
+/**
+ * Send a nice dump of a packet to the specified file stream.
+ *
+ * @param f The file stream pointer where the dump should be sent to.
+ * @param pkt packet to dump
+ * @param dump_payload True if the payload must be displayed, too.
+ * @param st AVStream that the packet belongs to
+ */
+void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st);
+
+
+/**
+ * Send a nice dump of a packet to the log.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param pkt packet to dump
+ * @param dump_payload True if the payload must be displayed, too.
+ * @param st AVStream that the packet belongs to
+ */
+void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
+                      AVStream *st);
+
+/**
+ * Get the AVCodecID for the given codec tag tag.
+ * If no codec id is found returns AV_CODEC_ID_NONE.
+ *
+ * @param tags list of supported codec_id-codec_tag pairs, as stored
+ * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+ */
+enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
+
+/**
+ * Get the codec tag for the given codec id id.
+ * If no codec tag is found returns 0.
+ *
+ * @param tags list of supported codec_id-codec_tag pairs, as stored
+ * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+ */
+unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id);
+
+int av_find_default_stream_index(AVFormatContext *s);
+
+/**
+ * Get the index for a specific timestamp.
+ * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond
+ *                 to the timestamp which is <= the requested one, if backward
+ *                 is 0, then it will be >=
+ *              if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
+ * @return < 0 if no such timestamp could be found
+ */
+int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
+
+/**
+ * Add an index entry into a sorted list. Update the entry if the list
+ * already contains it.
+ *
+ * @param timestamp timestamp in the time base of the given stream
+ */
+int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
+                       int size, int distance, int flags);
+
+
+/**
+ * Split a URL string into components.
+ *
+ * The pointers to buffers for storing individual components may be null,
+ * in order to ignore that component. Buffers for components not found are
+ * set to empty strings. If the port is not found, it is set to a negative
+ * value.
+ *
+ * @param proto the buffer for the protocol
+ * @param proto_size the size of the proto buffer
+ * @param authorization the buffer for the authorization
+ * @param authorization_size the size of the authorization buffer
+ * @param hostname the buffer for the host name
+ * @param hostname_size the size of the hostname buffer
+ * @param port_ptr a pointer to store the port number in
+ * @param path the buffer for the path
+ * @param path_size the size of the path buffer
+ * @param url the URL to split
+ */
+void av_url_split(char *proto,         int proto_size,
+                  char *authorization, int authorization_size,
+                  char *hostname,      int hostname_size,
+                  int *port_ptr,
+                  char *path,          int path_size,
+                  const char *url);
+
+
+void av_dump_format(AVFormatContext *ic,
+                    int index,
+                    const char *url,
+                    int is_output);
+
+/**
+ * Return in 'buf' the path with '%d' replaced by a number.
+ *
+ * Also handles the '%0nd' format where 'n' is the total number
+ * of digits and '%%'.
+ *
+ * @param buf destination buffer
+ * @param buf_size destination buffer size
+ * @param path numbered sequence string
+ * @param number frame number
+ * @return 0 if OK, -1 on format error
+ */
+int av_get_frame_filename(char *buf, int buf_size,
+                          const char *path, int number);
+
+/**
+ * Check whether filename actually is a numbered sequence generator.
+ *
+ * @param filename possible numbered sequence string
+ * @return 1 if a valid numbered sequence string, 0 otherwise
+ */
+int av_filename_number_test(const char *filename);
+
+/**
+ * Generate an SDP for an RTP session.
+ *
+ * Note, this overwrites the id values of AVStreams in the muxer contexts
+ * for getting unique dynamic payload types.
+ *
+ * @param ac array of AVFormatContexts describing the RTP streams. If the
+ *           array is composed by only one context, such context can contain
+ *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
+ *           all the contexts in the array (an AVCodecContext per RTP stream)
+ *           must contain only one AVStream.
+ * @param n_files number of AVCodecContexts contained in ac
+ * @param buf buffer where the SDP will be stored (must be allocated by
+ *            the caller)
+ * @param size the size of the buffer
+ * @return 0 if OK, AVERROR_xxx on error
+ */
+int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size);
+
+/**
+ * Return a positive value if the given filename has one of the given
+ * extensions, 0 otherwise.
+ *
+ * @param extensions a comma-separated list of filename extensions
+ */
+int av_match_ext(const char *filename, const char *extensions);
+
+/**
+ * Test if the given container can store a codec.
+ *
+ * @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
+ *
+ * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
+ *         A negative number if this information is not available.
+ */
+int avformat_query_codec(AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance);
+
+/**
+ * @defgroup riff_fourcc RIFF FourCCs
+ * @{
+ * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are
+ * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the
+ * following code:
+ * @code
+ * uint32_t tag = MKTAG('H', '2', '6', '4');
+ * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 };
+ * enum AVCodecID id = av_codec_get_id(table, tag);
+ * @endcode
+ */
+/**
+ * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID.
+ */
+const struct AVCodecTag *avformat_get_riff_video_tags(void);
+/**
+ * @return the table mapping RIFF FourCCs for audio to AVCodecID.
+ */
+const struct AVCodecTag *avformat_get_riff_audio_tags(void);
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+#endif /* AVFORMAT_AVFORMAT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avio.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avio.h
new file mode 100644
index 000000000..b6d3cb33b
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avio.h
@@ -0,0 +1,433 @@
+/*
+ * copyright (c) 2001 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef AVFORMAT_AVIO_H
+#define AVFORMAT_AVIO_H
+
+/**
+ * @file
+ * @ingroup lavf_io
+ * Buffered I/O operations
+ */
+
+#include <stdint.h>
+
+#include "libavutil/common.h"
+#include "libavutil/dict.h"
+#include "libavutil/log.h"
+
+#include "libavformat/version.h"
+
+
+#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
+
+/**
+ * Callback for checking whether to abort blocking functions.
+ * AVERROR_EXIT is returned in this case by the interrupted
+ * function. During blocking operations, callback is called with
+ * opaque as parameter. If the callback returns 1, the
+ * blocking operation will be aborted.
+ *
+ * No members can be added to this struct without a major bump, if
+ * new elements have been added after this struct in AVFormatContext
+ * or AVIOContext.
+ */
+typedef struct AVIOInterruptCB {
+    int (*callback)(void*);
+    void *opaque;
+} AVIOInterruptCB;
+
+/**
+ * Bytestream IO Context.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVIOContext) must not be used outside libav*.
+ *
+ * @note None of the function pointers in AVIOContext should be called
+ *       directly, they should only be set by the client application
+ *       when implementing custom I/O. Normally these are set to the
+ *       function pointers specified in avio_alloc_context()
+ */
+typedef struct AVIOContext {
+    /**
+     * A class for private options.
+     *
+     * If this AVIOContext is created by avio_open2(), av_class is set and
+     * passes the options down to protocols.
+     *
+     * If this AVIOContext is manually allocated, then av_class may be set by
+     * the caller.
+     *
+     * warning -- this field can be NULL, be sure to not pass this AVIOContext
+     * to any av_opt_* functions in that case.
+     */
+    const AVClass *av_class;
+    unsigned char *buffer;  /**< Start of the buffer. */
+    int buffer_size;        /**< Maximum buffer size */
+    unsigned char *buf_ptr; /**< Current position in the buffer */
+    unsigned char *buf_end; /**< End of the data, may be less than
+                                 buffer+buffer_size if the read function returned
+                                 less data than requested, e.g. for streams where
+                                 no more data has been received yet. */
+    void *opaque;           /**< A private pointer, passed to the read/write/seek/...
+                                 functions. */
+    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
+    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
+    int64_t (*seek)(void *opaque, int64_t offset, int whence);
+    int64_t pos;            /**< position in the file of the current buffer */
+    int must_flush;         /**< true if the next seek should flush */
+    int eof_reached;        /**< true if eof reached */
+    int write_flag;         /**< true if open for writing */
+    int max_packet_size;
+    unsigned long checksum;
+    unsigned char *checksum_ptr;
+    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
+    int error;              /**< contains the error code or 0 if no error happened */
+    /**
+     * Pause or resume playback for network streaming protocols - e.g. MMS.
+     */
+    int (*read_pause)(void *opaque, int pause);
+    /**
+     * Seek to a given timestamp in stream with the specified stream_index.
+     * Needed for some network streaming protocols which don't support seeking
+     * to byte position.
+     */
+    int64_t (*read_seek)(void *opaque, int stream_index,
+                         int64_t timestamp, int flags);
+    /**
+     * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
+     */
+    int seekable;
+} AVIOContext;
+
+/* unbuffered I/O */
+
+/**
+ * Return AVIO_FLAG_* access flags corresponding to the access permissions
+ * of the resource in url, or a negative value corresponding to an
+ * AVERROR code in case of failure. The returned access flags are
+ * masked by the value in flags.
+ *
+ * @note This function is intrinsically unsafe, in the sense that the
+ * checked resource may change its existence or permission status from
+ * one call to another. Thus you should not trust the returned value,
+ * unless you are sure that no other processes are accessing the
+ * checked resource.
+ */
+int avio_check(const char *url, int flags);
+
+/**
+ * Allocate and initialize an AVIOContext for buffered I/O. It must be later
+ * freed with av_free().
+ *
+ * @param buffer Memory block for input/output operations via AVIOContext.
+ *        The buffer must be allocated with av_malloc() and friends.
+ * @param buffer_size The buffer size is very important for performance.
+ *        For protocols with fixed blocksize it should be set to this blocksize.
+ *        For others a typical size is a cache page, e.g. 4kb.
+ * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
+ * @param opaque An opaque pointer to user-specific data.
+ * @param read_packet  A function for refilling the buffer, may be NULL.
+ * @param write_packet A function for writing the buffer contents, may be NULL.
+ * @param seek A function for seeking to specified byte position, may be NULL.
+ *
+ * @return Allocated AVIOContext or NULL on failure.
+ */
+AVIOContext *avio_alloc_context(
+                  unsigned char *buffer,
+                  int buffer_size,
+                  int write_flag,
+                  void *opaque,
+                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
+
+void avio_w8(AVIOContext *s, int b);
+void avio_write(AVIOContext *s, const unsigned char *buf, int size);
+void avio_wl64(AVIOContext *s, uint64_t val);
+void avio_wb64(AVIOContext *s, uint64_t val);
+void avio_wl32(AVIOContext *s, unsigned int val);
+void avio_wb32(AVIOContext *s, unsigned int val);
+void avio_wl24(AVIOContext *s, unsigned int val);
+void avio_wb24(AVIOContext *s, unsigned int val);
+void avio_wl16(AVIOContext *s, unsigned int val);
+void avio_wb16(AVIOContext *s, unsigned int val);
+
+/**
+ * Write a NULL-terminated string.
+ * @return number of bytes written.
+ */
+int avio_put_str(AVIOContext *s, const char *str);
+
+/**
+ * Convert an UTF-8 string to UTF-16LE and write it.
+ * @return number of bytes written.
+ */
+int avio_put_str16le(AVIOContext *s, const char *str);
+
+/**
+ * Passing this as the "whence" parameter to a seek function causes it to
+ * return the filesize without seeking anywhere. Supporting this is optional.
+ * If it is not supported then the seek function will return <0.
+ */
+#define AVSEEK_SIZE 0x10000
+
+/**
+ * Oring this flag as into the "whence" parameter to a seek function causes it to
+ * seek by any means (like reopening and linear reading) or other normally unreasonble
+ * means that can be extreemly slow.
+ * This may be ignored by the seek code.
+ */
+#define AVSEEK_FORCE 0x20000
+
+/**
+ * fseek() equivalent for AVIOContext.
+ * @return new position or AVERROR.
+ */
+int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
+
+/**
+ * Skip given number of bytes forward
+ * @return new position or AVERROR.
+ */
+static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
+{
+    return avio_seek(s, offset, SEEK_CUR);
+}
+
+/**
+ * ftell() equivalent for AVIOContext.
+ * @return position or AVERROR.
+ */
+static av_always_inline int64_t avio_tell(AVIOContext *s)
+{
+    return avio_seek(s, 0, SEEK_CUR);
+}
+
+/**
+ * Get the filesize.
+ * @return filesize or AVERROR
+ */
+int64_t avio_size(AVIOContext *s);
+
+/** @warning currently size is limited */
+int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
+
+void avio_flush(AVIOContext *s);
+
+
+/**
+ * Read size bytes from AVIOContext into buf.
+ * @return number of bytes read or AVERROR
+ */
+int avio_read(AVIOContext *s, unsigned char *buf, int size);
+
+/**
+ * @name Functions for reading from AVIOContext
+ * @{
+ *
+ * @note return 0 if EOF, so you cannot use it if EOF handling is
+ *       necessary
+ */
+int          avio_r8  (AVIOContext *s);
+unsigned int avio_rl16(AVIOContext *s);
+unsigned int avio_rl24(AVIOContext *s);
+unsigned int avio_rl32(AVIOContext *s);
+uint64_t     avio_rl64(AVIOContext *s);
+unsigned int avio_rb16(AVIOContext *s);
+unsigned int avio_rb24(AVIOContext *s);
+unsigned int avio_rb32(AVIOContext *s);
+uint64_t     avio_rb64(AVIOContext *s);
+/**
+ * @}
+ */
+
+/**
+ * Read a string from pb into buf. The reading will terminate when either
+ * a NULL character was encountered, maxlen bytes have been read, or nothing
+ * more can be read from pb. The result is guaranteed to be NULL-terminated, it
+ * will be truncated if buf is too small.
+ * Note that the string is not interpreted or validated in any way, it
+ * might get truncated in the middle of a sequence for multi-byte encodings.
+ *
+ * @return number of bytes read (is always <= maxlen).
+ * If reading ends on EOF or error, the return value will be one more than
+ * bytes actually read.
+ */
+int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
+
+/**
+ * Read a UTF-16 string from pb and convert it to UTF-8.
+ * The reading will terminate when either a null or invalid character was
+ * encountered or maxlen bytes have been read.
+ * @return number of bytes read (is always <= maxlen)
+ */
+int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
+int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
+
+
+/**
+ * @name URL open modes
+ * The flags argument to avio_open must be one of the following
+ * constants, optionally ORed with other flags.
+ * @{
+ */
+#define AVIO_FLAG_READ  1                                      /**< read-only */
+#define AVIO_FLAG_WRITE 2                                      /**< write-only */
+#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE)  /**< read-write pseudo flag */
+/**
+ * @}
+ */
+
+/**
+ * Use non-blocking mode.
+ * If this flag is set, operations on the context will return
+ * AVERROR(EAGAIN) if they can not be performed immediately.
+ * If this flag is not set, operations on the context will never return
+ * AVERROR(EAGAIN).
+ * Note that this flag does not affect the opening/connecting of the
+ * context. Connecting a protocol will always block if necessary (e.g. on
+ * network protocols) but never hang (e.g. on busy devices).
+ * Warning: non-blocking protocols is work-in-progress; this flag may be
+ * silently ignored.
+ */
+#define AVIO_FLAG_NONBLOCK 8
+
+/**
+ * Create and initialize a AVIOContext for accessing the
+ * resource indicated by url.
+ * @note When the resource indicated by url has been opened in
+ * read+write mode, the AVIOContext can be used only for writing.
+ *
+ * @param s Used to return the pointer to the created AVIOContext.
+ * In case of failure the pointed to value is set to NULL.
+ * @param flags flags which control how the resource indicated by url
+ * is to be opened
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code in case of failure
+ */
+int avio_open(AVIOContext **s, const char *url, int flags);
+
+/**
+ * Create and initialize a AVIOContext for accessing the
+ * resource indicated by url.
+ * @note When the resource indicated by url has been opened in
+ * read+write mode, the AVIOContext can be used only for writing.
+ *
+ * @param s Used to return the pointer to the created AVIOContext.
+ * In case of failure the pointed to value is set to NULL.
+ * @param flags flags which control how the resource indicated by url
+ * is to be opened
+ * @param int_cb an interrupt callback to be used at the protocols level
+ * @param options  A dictionary filled with protocol-private options. On return
+ * this parameter will be destroyed and replaced with a dict containing options
+ * that were not found. May be NULL.
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code in case of failure
+ */
+int avio_open2(AVIOContext **s, const char *url, int flags,
+               const AVIOInterruptCB *int_cb, AVDictionary **options);
+
+/**
+ * Close the resource accessed by the AVIOContext s and free it.
+ * This function can only be used if s was opened by avio_open().
+ *
+ * The internal buffer is automatically flushed before closing the
+ * resource.
+ *
+ * @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_closep
+ */
+int avio_close(AVIOContext *s);
+
+/**
+ * Close the resource accessed by the AVIOContext *s, free it
+ * and set the pointer pointing to it to NULL.
+ * This function can only be used if s was opened by avio_open().
+ *
+ * The internal buffer is automatically flushed before closing the
+ * resource.
+ *
+ * @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_close
+ */
+int avio_closep(AVIOContext **s);
+
+
+/**
+ * Open a write only memory stream.
+ *
+ * @param s new IO context
+ * @return zero if no error.
+ */
+int avio_open_dyn_buf(AVIOContext **s);
+
+/**
+ * Return the written size and a pointer to the buffer. The buffer
+ * must be freed with av_free().
+ * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
+ *
+ * @param s IO context
+ * @param pbuffer pointer to a byte buffer
+ * @return the length of the byte buffer
+ */
+int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
+
+/**
+ * Iterate through names of available protocols.
+ *
+ * @param opaque A private pointer representing current protocol.
+ *        It must be a pointer to NULL on first iteration and will
+ *        be updated by successive calls to avio_enum_protocols.
+ * @param output If set to 1, iterate over output protocols,
+ *               otherwise over input protocols.
+ *
+ * @return A static string containing the name of current protocol or NULL
+ */
+const char *avio_enum_protocols(void **opaque, int output);
+
+/**
+ * Pause and resume playing - only meaningful if using a network streaming
+ * protocol (e.g. MMS).
+ * @param pause 1 for pause, 0 for resume
+ */
+int     avio_pause(AVIOContext *h, int pause);
+
+/**
+ * Seek to a given timestamp relative to some component stream.
+ * Only meaningful if using a network streaming protocol (e.g. MMS.).
+ * @param stream_index The stream index that the timestamp is relative to.
+ *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
+ *        units from the beginning of the presentation.
+ *        If a stream_index >= 0 is used and the protocol does not support
+ *        seeking based on component streams, the call will fail with ENOTSUP.
+ * @param timestamp timestamp in AVStream.time_base units
+ *        or if there is no stream specified then in AV_TIME_BASE units.
+ * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
+ *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
+ *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
+ *        fail with ENOTSUP if used and not supported.
+ * @return >= 0 on success
+ * @see AVInputFormat::read_seek
+ */
+int64_t avio_seek_time(AVIOContext *h, int stream_index,
+                       int64_t timestamp, int flags);
+
+#endif /* AVFORMAT_AVIO_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/version.h
new file mode 100644
index 000000000..ac675ce95
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/version.h
@@ -0,0 +1,52 @@
+/*
+ * Version macros.
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFORMAT_VERSION_H
+#define AVFORMAT_VERSION_H
+
+/**
+ * @file
+ * @ingroup libavf
+ * Libavformat version macros
+ */
+
+#include "libavutil/avutil.h"
+
+#define LIBAVFORMAT_VERSION_MAJOR 55
+#define LIBAVFORMAT_VERSION_MINOR  3
+#define LIBAVFORMAT_VERSION_MICRO  0
+
+#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
+                                               LIBAVFORMAT_VERSION_MINOR, \
+                                               LIBAVFORMAT_VERSION_MICRO)
+#define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \
+                                           LIBAVFORMAT_VERSION_MINOR,   \
+                                           LIBAVFORMAT_VERSION_MICRO)
+#define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
+
+#define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
+
+/**
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ */
+
+#endif /* AVFORMAT_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/avresample.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/avresample.h
new file mode 100644
index 000000000..d26f2ca22
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/avresample.h
@@ -0,0 +1,409 @@
+/*
+ * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVRESAMPLE_AVRESAMPLE_H
+#define AVRESAMPLE_AVRESAMPLE_H
+
+/**
+ * @file
+ * @ingroup lavr
+ * external API header
+ */
+
+/**
+ * @defgroup lavr Libavresample
+ * @{
+ *
+ * Libavresample (lavr) is a library that handles audio resampling, sample
+ * format conversion and mixing.
+ *
+ * Interaction with lavr is done through AVAudioResampleContext, which is
+ * allocated with avresample_alloc_context(). It is opaque, so all parameters
+ * must be set with the @ref avoptions API.
+ *
+ * For example the following code will setup conversion from planar float sample
+ * format to interleaved signed 16-bit integer, downsampling from 48kHz to
+ * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
+ * matrix):
+ * @code
+ * AVAudioResampleContext *avr = avresample_alloc_context();
+ * av_opt_set_int(avr, "in_channel_layout",  AV_CH_LAYOUT_5POINT1, 0);
+ * av_opt_set_int(avr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
+ * av_opt_set_int(avr, "in_sample_rate",     48000,                0);
+ * av_opt_set_int(avr, "out_sample_rate",    44100,                0);
+ * av_opt_set_int(avr, "in_sample_fmt",      AV_SAMPLE_FMT_FLTP,   0);
+ * av_opt_set_int(avr, "out_sample_fmt",     AV_SAMPLE_FMT_S16,    0);
+ * @endcode
+ *
+ * Once the context is initialized, it must be opened with avresample_open(). If
+ * you need to change the conversion parameters, you must close the context with
+ * avresample_close(), change the parameters as described above, then reopen it
+ * again.
+ *
+ * The conversion itself is done by repeatedly calling avresample_convert().
+ * Note that the samples may get buffered in two places in lavr. The first one
+ * is the output FIFO, where the samples end up if the output buffer is not
+ * large enough. The data stored in there may be retrieved at any time with
+ * avresample_read(). The second place is the resampling delay buffer,
+ * applicable only when resampling is done. The samples in it require more input
+ * before they can be processed. Their current amount is returned by
+ * avresample_get_delay(). At the end of conversion the resampling buffer can be
+ * flushed by calling avresample_convert() with NULL input.
+ *
+ * The following code demonstrates the conversion loop assuming the parameters
+ * from above and caller-defined functions get_input() and handle_output():
+ * @code
+ * uint8_t **input;
+ * int in_linesize, in_samples;
+ *
+ * while (get_input(&input, &in_linesize, &in_samples)) {
+ *     uint8_t *output
+ *     int out_linesize;
+ *     int out_samples = avresample_available(avr) +
+ *                       av_rescale_rnd(avresample_get_delay(avr) +
+ *                                      in_samples, 44100, 48000, AV_ROUND_UP);
+ *     av_samples_alloc(&output, &out_linesize, 2, out_samples,
+ *                      AV_SAMPLE_FMT_S16, 0);
+ *     out_samples = avresample_convert(avr, &output, out_linesize, out_samples,
+ *                                      input, in_linesize, in_samples);
+ *     handle_output(output, out_linesize, out_samples);
+ *     av_freep(&output);
+ *  }
+ *  @endcode
+ *
+ *  When the conversion is finished and the FIFOs are flushed if required, the
+ *  conversion context and everything associated with it must be freed with
+ *  avresample_free().
+ */
+
+#include "libavutil/avutil.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/dict.h"
+#include "libavutil/log.h"
+
+#include "libavresample/version.h"
+
+#define AVRESAMPLE_MAX_CHANNELS 32
+
+typedef struct AVAudioResampleContext AVAudioResampleContext;
+
+/** Mixing Coefficient Types */
+enum AVMixCoeffType {
+    AV_MIX_COEFF_TYPE_Q8,   /** 16-bit 8.8 fixed-point                      */
+    AV_MIX_COEFF_TYPE_Q15,  /** 32-bit 17.15 fixed-point                    */
+    AV_MIX_COEFF_TYPE_FLT,  /** floating-point                              */
+    AV_MIX_COEFF_TYPE_NB,   /** Number of coeff types. Not part of ABI      */
+};
+
+/** Resampling Filter Types */
+enum AVResampleFilterType {
+    AV_RESAMPLE_FILTER_TYPE_CUBIC,              /**< Cubic */
+    AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL,   /**< Blackman Nuttall Windowed Sinc */
+    AV_RESAMPLE_FILTER_TYPE_KAISER,             /**< Kaiser Windowed Sinc */
+};
+
+enum AVResampleDitherMethod {
+    AV_RESAMPLE_DITHER_NONE,            /**< Do not use dithering */
+    AV_RESAMPLE_DITHER_RECTANGULAR,     /**< Rectangular Dither */
+    AV_RESAMPLE_DITHER_TRIANGULAR,      /**< Triangular Dither*/
+    AV_RESAMPLE_DITHER_TRIANGULAR_HP,   /**< Triangular Dither with High Pass */
+    AV_RESAMPLE_DITHER_TRIANGULAR_NS,   /**< Triangular Dither with Noise Shaping */
+    AV_RESAMPLE_DITHER_NB,              /**< Number of dither types. Not part of ABI. */
+};
+
+/**
+ * Return the LIBAVRESAMPLE_VERSION_INT constant.
+ */
+unsigned avresample_version(void);
+
+/**
+ * Return the libavresample build-time configuration.
+ * @return  configure string
+ */
+const char *avresample_configuration(void);
+
+/**
+ * Return the libavresample license.
+ */
+const char *avresample_license(void);
+
+/**
+ * Get the AVClass for AVAudioResampleContext.
+ *
+ * Can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options
+ * without allocating a context.
+ *
+ * @see av_opt_find().
+ *
+ * @return AVClass for AVAudioResampleContext
+ */
+const AVClass *avresample_get_class(void);
+
+/**
+ * Allocate AVAudioResampleContext and set options.
+ *
+ * @return  allocated audio resample context, or NULL on failure
+ */
+AVAudioResampleContext *avresample_alloc_context(void);
+
+/**
+ * Initialize AVAudioResampleContext.
+ *
+ * @param avr  audio resample context
+ * @return     0 on success, negative AVERROR code on failure
+ */
+int avresample_open(AVAudioResampleContext *avr);
+
+/**
+ * Close AVAudioResampleContext.
+ *
+ * This closes the context, but it does not change the parameters. The context
+ * can be reopened with avresample_open(). It does, however, clear the output
+ * FIFO and any remaining leftover samples in the resampling delay buffer. If
+ * there was a custom matrix being used, that is also cleared.
+ *
+ * @see avresample_convert()
+ * @see avresample_set_matrix()
+ *
+ * @param avr  audio resample context
+ */
+void avresample_close(AVAudioResampleContext *avr);
+
+/**
+ * Free AVAudioResampleContext and associated AVOption values.
+ *
+ * This also calls avresample_close() before freeing.
+ *
+ * @param avr  audio resample context
+ */
+void avresample_free(AVAudioResampleContext **avr);
+
+/**
+ * Generate a channel mixing matrix.
+ *
+ * This function is the one used internally by libavresample for building the
+ * default mixing matrix. It is made public just as a utility function for
+ * building custom matrices.
+ *
+ * @param in_layout           input channel layout
+ * @param out_layout          output channel layout
+ * @param center_mix_level    mix level for the center channel
+ * @param surround_mix_level  mix level for the surround channel(s)
+ * @param lfe_mix_level       mix level for the low-frequency effects channel
+ * @param normalize           if 1, coefficients will be normalized to prevent
+ *                            overflow. if 0, coefficients will not be
+ *                            normalized.
+ * @param[out] matrix         mixing coefficients; matrix[i + stride * o] is
+ *                            the weight of input channel i in output channel o.
+ * @param stride              distance between adjacent input channels in the
+ *                            matrix array
+ * @param matrix_encoding     matrixed stereo downmix mode (e.g. dplii)
+ * @return                    0 on success, negative AVERROR code on failure
+ */
+int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
+                            double center_mix_level, double surround_mix_level,
+                            double lfe_mix_level, int normalize, double *matrix,
+                            int stride, enum AVMatrixEncoding matrix_encoding);
+
+/**
+ * Get the current channel mixing matrix.
+ *
+ * If no custom matrix has been previously set or the AVAudioResampleContext is
+ * not open, an error is returned.
+ *
+ * @param avr     audio resample context
+ * @param matrix  mixing coefficients; matrix[i + stride * o] is the weight of
+ *                input channel i in output channel o.
+ * @param stride  distance between adjacent input channels in the matrix array
+ * @return        0 on success, negative AVERROR code on failure
+ */
+int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
+                          int stride);
+
+/**
+ * Set channel mixing matrix.
+ *
+ * Allows for setting a custom mixing matrix, overriding the default matrix
+ * generated internally during avresample_open(). This function can be called
+ * anytime on an allocated context, either before or after calling
+ * avresample_open(), as long as the channel layouts have been set.
+ * avresample_convert() always uses the current matrix.
+ * Calling avresample_close() on the context will clear the current matrix.
+ *
+ * @see avresample_close()
+ *
+ * @param avr     audio resample context
+ * @param matrix  mixing coefficients; matrix[i + stride * o] is the weight of
+ *                input channel i in output channel o.
+ * @param stride  distance between adjacent input channels in the matrix array
+ * @return        0 on success, negative AVERROR code on failure
+ */
+int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
+                          int stride);
+
+/**
+ * Set a customized input channel mapping.
+ *
+ * This function can only be called when the allocated context is not open.
+ * Also, the input channel layout must have already been set.
+ *
+ * Calling avresample_close() on the context will clear the channel mapping.
+ *
+ * The map for each input channel specifies the channel index in the source to
+ * use for that particular channel, or -1 to mute the channel. Source channels
+ * can be duplicated by using the same index for multiple input channels.
+ *
+ * Examples:
+ *
+ * Reordering 5.1 AAC order (C,L,R,Ls,Rs,LFE) to Libav order (L,R,C,LFE,Ls,Rs):
+ * { 1, 2, 0, 5, 3, 4 }
+ *
+ * Muting the 3rd channel in 4-channel input:
+ * { 0, 1, -1, 3 }
+ *
+ * Duplicating the left channel of stereo input:
+ * { 0, 0 }
+ *
+ * @param avr         audio resample context
+ * @param channel_map customized input channel mapping
+ * @return            0 on success, negative AVERROR code on failure
+ */
+int avresample_set_channel_mapping(AVAudioResampleContext *avr,
+                                   const int *channel_map);
+
+/**
+ * Set compensation for resampling.
+ *
+ * This can be called anytime after avresample_open(). If resampling is not
+ * automatically enabled because of a sample rate conversion, the
+ * "force_resampling" option must have been set to 1 when opening the context
+ * in order to use resampling compensation.
+ *
+ * @param avr                    audio resample context
+ * @param sample_delta           compensation delta, in samples
+ * @param compensation_distance  compensation distance, in samples
+ * @return                       0 on success, negative AVERROR code on failure
+ */
+int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
+                                int compensation_distance);
+
+/**
+ * Convert input samples and write them to the output FIFO.
+ *
+ * The upper bound on the number of output samples is given by
+ * avresample_available() + (avresample_get_delay() + number of input samples) *
+ * output sample rate / input sample rate.
+ *
+ * The output data can be NULL or have fewer allocated samples than required.
+ * In this case, any remaining samples not written to the output will be added
+ * to an internal FIFO buffer, to be returned at the next call to this function
+ * or to avresample_read().
+ *
+ * If converting sample rate, there may be data remaining in the internal
+ * resampling delay buffer. avresample_get_delay() tells the number of remaining
+ * samples. To get this data as output, call avresample_convert() with NULL
+ * input.
+ *
+ * At the end of the conversion process, there may be data remaining in the
+ * internal FIFO buffer. avresample_available() tells the number of remaining
+ * samples. To get this data as output, either call avresample_convert() with
+ * NULL input or call avresample_read().
+ *
+ * @see avresample_available()
+ * @see avresample_read()
+ * @see avresample_get_delay()
+ *
+ * @param avr             audio resample context
+ * @param output          output data pointers
+ * @param out_plane_size  output plane size, in bytes.
+ *                        This can be 0 if unknown, but that will lead to
+ *                        optimized functions not being used directly on the
+ *                        output, which could slow down some conversions.
+ * @param out_samples     maximum number of samples that the output buffer can hold
+ * @param input           input data pointers
+ * @param in_plane_size   input plane size, in bytes
+ *                        This can be 0 if unknown, but that will lead to
+ *                        optimized functions not being used directly on the
+ *                        input, which could slow down some conversions.
+ * @param in_samples      number of input samples to convert
+ * @return                number of samples written to the output buffer,
+ *                        not including converted samples added to the internal
+ *                        output FIFO
+ */
+int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
+                       int out_plane_size, int out_samples, uint8_t **input,
+                       int in_plane_size, int in_samples);
+
+/**
+ * Return the number of samples currently in the resampling delay buffer.
+ *
+ * When resampling, there may be a delay between the input and output. Any
+ * unconverted samples in each call are stored internally in a delay buffer.
+ * This function allows the user to determine the current number of samples in
+ * the delay buffer, which can be useful for synchronization.
+ *
+ * @see avresample_convert()
+ *
+ * @param avr  audio resample context
+ * @return     number of samples currently in the resampling delay buffer
+ */
+int avresample_get_delay(AVAudioResampleContext *avr);
+
+/**
+ * Return the number of available samples in the output FIFO.
+ *
+ * During conversion, if the user does not specify an output buffer or
+ * specifies an output buffer that is smaller than what is needed, remaining
+ * samples that are not written to the output are stored to an internal FIFO
+ * buffer. The samples in the FIFO can be read with avresample_read() or
+ * avresample_convert().
+ *
+ * @see avresample_read()
+ * @see avresample_convert()
+ *
+ * @param avr  audio resample context
+ * @return     number of samples available for reading
+ */
+int avresample_available(AVAudioResampleContext *avr);
+
+/**
+ * Read samples from the output FIFO.
+ *
+ * During conversion, if the user does not specify an output buffer or
+ * specifies an output buffer that is smaller than what is needed, remaining
+ * samples that are not written to the output are stored to an internal FIFO
+ * buffer. This function can be used to read samples from that internal FIFO.
+ *
+ * @see avresample_available()
+ * @see avresample_convert()
+ *
+ * @param avr         audio resample context
+ * @param output      output data pointers. May be NULL, in which case
+ *                    nb_samples of data is discarded from output FIFO.
+ * @param nb_samples  number of samples to read from the FIFO
+ * @return            the number of samples written to output
+ */
+int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples);
+
+/**
+ * @}
+ */
+
+#endif /* AVRESAMPLE_AVRESAMPLE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/version.h
new file mode 100644
index 000000000..3cc4441d8
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/version.h
@@ -0,0 +1,52 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVRESAMPLE_VERSION_H
+#define AVRESAMPLE_VERSION_H
+
+/**
+ * @file
+ * @ingroup lavr
+ * Libavresample version macros.
+ */
+
+#define LIBAVRESAMPLE_VERSION_MAJOR  1
+#define LIBAVRESAMPLE_VERSION_MINOR  1
+#define LIBAVRESAMPLE_VERSION_MICRO  0
+
+#define LIBAVRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \
+                                                  LIBAVRESAMPLE_VERSION_MINOR, \
+                                                  LIBAVRESAMPLE_VERSION_MICRO)
+#define LIBAVRESAMPLE_VERSION          AV_VERSION(LIBAVRESAMPLE_VERSION_MAJOR, \
+                                                  LIBAVRESAMPLE_VERSION_MINOR, \
+                                                  LIBAVRESAMPLE_VERSION_MICRO)
+#define LIBAVRESAMPLE_BUILD        LIBAVRESAMPLE_VERSION_INT
+
+#define LIBAVRESAMPLE_IDENT        "Lavr" AV_STRINGIFY(LIBAVRESAMPLE_VERSION)
+
+/**
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ */
+
+#ifndef FF_API_RESAMPLE_CLOSE_OPEN
+#define FF_API_RESAMPLE_CLOSE_OPEN (LIBAVRESAMPLE_VERSION_MAJOR < 2)
+#endif
+
+#endif /* AVRESAMPLE_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/adler32.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/adler32.h
new file mode 100644
index 000000000..a8ff6f9d4
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/adler32.h
@@ -0,0 +1,43 @@
+/*
+ * copyright (c) 2006 Mans Rullgard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_ADLER32_H
+#define AVUTIL_ADLER32_H
+
+#include <stdint.h>
+#include "attributes.h"
+
+/**
+ * @ingroup lavu_crypto
+ * Calculate the Adler32 checksum of a buffer.
+ *
+ * Passing the return value to a subsequent av_adler32_update() call
+ * allows the checksum of multiple buffers to be calculated as though
+ * they were concatenated.
+ *
+ * @param adler initial checksum value
+ * @param buf   pointer to input buffer
+ * @param len   size of input buffer
+ * @return      updated checksum
+ */
+unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
+                                unsigned int len) av_pure;
+
+#endif /* AVUTIL_ADLER32_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/aes.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/aes.h
new file mode 100644
index 000000000..edff275b7
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/aes.h
@@ -0,0 +1,67 @@
+/*
+ * copyright (c) 2007 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_AES_H
+#define AVUTIL_AES_H
+
+#include <stdint.h>
+
+#include "attributes.h"
+#include "version.h"
+
+/**
+ * @defgroup lavu_aes AES
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_aes_size;
+#endif
+
+struct AVAES;
+
+/**
+ * Allocate an AVAES context.
+ */
+struct AVAES *av_aes_alloc(void);
+
+/**
+ * Initialize an AVAES context.
+ * @param key_bits 128, 192 or 256
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ * @param count number of 16 byte blocks
+ * @param dst destination array, can be equal to src
+ * @param src source array, can be equal to dst
+ * @param iv initialization vector for CBC mode, if NULL then ECB will be used
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_AES_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/attributes.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/attributes.h
new file mode 100644
index 000000000..292a0a1a8
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/attributes.h
@@ -0,0 +1,122 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Macro definitions for various function/variable attributes
+ */
+
+#ifndef AVUTIL_ATTRIBUTES_H
+#define AVUTIL_ATTRIBUTES_H
+
+#ifdef __GNUC__
+#    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
+#else
+#    define AV_GCC_VERSION_AT_LEAST(x,y) 0
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_always_inline __attribute__((always_inline)) inline
+#elif defined(_MSC_VER)
+#    define av_always_inline __forceinline
+#else
+#    define av_always_inline inline
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_noinline __attribute__((noinline))
+#else
+#    define av_noinline
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_pure __attribute__((pure))
+#else
+#    define av_pure
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(2,6)
+#    define av_const __attribute__((const))
+#else
+#    define av_const
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,3)
+#    define av_cold __attribute__((cold))
+#else
+#    define av_cold
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,1)
+#    define av_flatten __attribute__((flatten))
+#else
+#    define av_flatten
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define attribute_deprecated __attribute__((deprecated))
+#else
+#    define attribute_deprecated
+#endif
+
+#if defined(__GNUC__)
+#    define av_unused __attribute__((unused))
+#else
+#    define av_unused
+#endif
+
+/**
+ * Mark a variable as used and prevent the compiler from optimizing it
+ * away.  This is useful for variables accessed only from inline
+ * assembler without the compiler being aware.
+ */
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_used __attribute__((used))
+#else
+#    define av_used
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,3)
+#   define av_alias __attribute__((may_alias))
+#else
+#   define av_alias
+#endif
+
+#if defined(__GNUC__) && !defined(__ICC)
+#    define av_uninit(x) x=x
+#else
+#    define av_uninit(x) x
+#endif
+
+#ifdef __GNUC__
+#    define av_builtin_constant_p __builtin_constant_p
+#    define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
+#else
+#    define av_builtin_constant_p(x) 0
+#    define av_printf_format(fmtpos, attrpos)
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(2,5)
+#    define av_noreturn __attribute__((noreturn))
+#else
+#    define av_noreturn
+#endif
+
+#endif /* AVUTIL_ATTRIBUTES_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audio_fifo.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audio_fifo.h
new file mode 100644
index 000000000..8c7638825
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audio_fifo.h
@@ -0,0 +1,146 @@
+/*
+ * Audio FIFO
+ * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Audio FIFO Buffer
+ */
+
+#ifndef AVUTIL_AUDIO_FIFO_H
+#define AVUTIL_AUDIO_FIFO_H
+
+#include "avutil.h"
+#include "fifo.h"
+#include "samplefmt.h"
+
+/**
+ * @addtogroup lavu_audio
+ * @{
+ */
+
+/**
+ * Context for an Audio FIFO Buffer.
+ *
+ * - Operates at the sample level rather than the byte level.
+ * - Supports multiple channels with either planar or packed sample format.
+ * - Automatic reallocation when writing to a full buffer.
+ */
+typedef struct AVAudioFifo AVAudioFifo;
+
+/**
+ * Free an AVAudioFifo.
+ *
+ * @param af  AVAudioFifo to free
+ */
+void av_audio_fifo_free(AVAudioFifo *af);
+
+/**
+ * Allocate an AVAudioFifo.
+ *
+ * @param sample_fmt  sample format
+ * @param channels    number of channels
+ * @param nb_samples  initial allocation size, in samples
+ * @return            newly allocated AVAudioFifo, or NULL on error
+ */
+AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
+                                 int nb_samples);
+
+/**
+ * Reallocate an AVAudioFifo.
+ *
+ * @param af          AVAudioFifo to reallocate
+ * @param nb_samples  new allocation size, in samples
+ * @return            0 if OK, or negative AVERROR code on failure
+ */
+int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
+
+/**
+ * Write data to an AVAudioFifo.
+ *
+ * The AVAudioFifo will be reallocated automatically if the available space
+ * is less than nb_samples.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param af          AVAudioFifo to write to
+ * @param data        audio data plane pointers
+ * @param nb_samples  number of samples to write
+ * @return            number of samples actually written, or negative AVERROR
+ *                    code on failure.
+ */
+int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
+
+/**
+ * Read data from an AVAudioFifo.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param af          AVAudioFifo to read from
+ * @param data        audio data plane pointers
+ * @param nb_samples  number of samples to read
+ * @return            number of samples actually read, or negative AVERROR code
+ *                    on failure.
+ */
+int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples);
+
+/**
+ * Drain data from an AVAudioFifo.
+ *
+ * Removes the data without reading it.
+ *
+ * @param af          AVAudioFifo to drain
+ * @param nb_samples  number of samples to drain
+ * @return            0 if OK, or negative AVERROR code on failure
+ */
+int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples);
+
+/**
+ * Reset the AVAudioFifo buffer.
+ *
+ * This empties all data in the buffer.
+ *
+ * @param af  AVAudioFifo to reset
+ */
+void av_audio_fifo_reset(AVAudioFifo *af);
+
+/**
+ * Get the current number of samples in the AVAudioFifo available for reading.
+ *
+ * @param af  the AVAudioFifo to query
+ * @return    number of samples available for reading
+ */
+int av_audio_fifo_size(AVAudioFifo *af);
+
+/**
+ * Get the current number of samples in the AVAudioFifo available for writing.
+ *
+ * @param af  the AVAudioFifo to query
+ * @return    number of samples available for writing
+ */
+int av_audio_fifo_space(AVAudioFifo *af);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_AUDIO_FIFO_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audioconvert.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audioconvert.h
new file mode 100644
index 000000000..300a67cd3
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audioconvert.h
@@ -0,0 +1,6 @@
+
+#include "version.h"
+
+#if FF_API_AUDIOCONVERT
+#include "channel_layout.h"
+#endif
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avassert.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avassert.h
new file mode 100644
index 000000000..b223d26e8
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avassert.h
@@ -0,0 +1,66 @@
+/*
+ * copyright (c) 2010 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * simple assert() macros that are a bit more flexible than ISO C assert().
+ * @author Michael Niedermayer <michaelni@gmx.at>
+ */
+
+#ifndef AVUTIL_AVASSERT_H
+#define AVUTIL_AVASSERT_H
+
+#include <stdlib.h>
+#include "avutil.h"
+#include "log.h"
+
+/**
+ * assert() equivalent, that is always enabled.
+ */
+#define av_assert0(cond) do {                                           \
+    if (!(cond)) {                                                      \
+        av_log(NULL, AV_LOG_FATAL, "Assertion %s failed at %s:%d\n",    \
+               AV_STRINGIFY(cond), __FILE__, __LINE__);                 \
+        abort();                                                        \
+    }                                                                   \
+} while (0)
+
+
+/**
+ * assert() equivalent, that does not lie in speed critical code.
+ * These asserts() thus can be enabled without fearing speedloss.
+ */
+#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
+#define av_assert1(cond) av_assert0(cond)
+#else
+#define av_assert1(cond) ((void)0)
+#endif
+
+
+/**
+ * assert() equivalent, that does lie in speed critical code.
+ */
+#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
+#define av_assert2(cond) av_assert0(cond)
+#else
+#define av_assert2(cond) ((void)0)
+#endif
+
+#endif /* AVUTIL_AVASSERT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avconfig.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avconfig.h
new file mode 100644
index 000000000..f10aa6186
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avconfig.h
@@ -0,0 +1,6 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 1
+#endif /* AVUTIL_AVCONFIG_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avstring.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avstring.h
new file mode 100644
index 000000000..b7d10983c
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avstring.h
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2007 Mans Rullgard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_AVSTRING_H
+#define AVUTIL_AVSTRING_H
+
+#include <stddef.h>
+#include "attributes.h"
+
+/**
+ * @addtogroup lavu_string
+ * @{
+ */
+
+/**
+ * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
+ * the address of the first character in str after the prefix.
+ *
+ * @param str input string
+ * @param pfx prefix to test
+ * @param ptr updated if the prefix is matched inside str
+ * @return non-zero if the prefix matches, zero otherwise
+ */
+int av_strstart(const char *str, const char *pfx, const char **ptr);
+
+/**
+ * Return non-zero if pfx is a prefix of str independent of case. If
+ * it is, *ptr is set to the address of the first character in str
+ * after the prefix.
+ *
+ * @param str input string
+ * @param pfx prefix to test
+ * @param ptr updated if the prefix is matched inside str
+ * @return non-zero if the prefix matches, zero otherwise
+ */
+int av_stristart(const char *str, const char *pfx, const char **ptr);
+
+/**
+ * Locate the first case-independent occurrence in the string haystack
+ * of the string needle.  A zero-length string needle is considered to
+ * match at the start of haystack.
+ *
+ * This function is a case-insensitive version of the standard strstr().
+ *
+ * @param haystack string to search in
+ * @param needle   string to search for
+ * @return         pointer to the located match within haystack
+ *                 or a null pointer if no match
+ */
+char *av_stristr(const char *haystack, const char *needle);
+
+/**
+ * Locate the first occurrence of the string needle in the string haystack
+ * where not more than hay_length characters are searched. A zero-length
+ * string needle is considered to match at the start of haystack.
+ *
+ * This function is a length-limited version of the standard strstr().
+ *
+ * @param haystack   string to search in
+ * @param needle     string to search for
+ * @param hay_length length of string to search in
+ * @return           pointer to the located match within haystack
+ *                   or a null pointer if no match
+ */
+char *av_strnstr(const char *haystack, const char *needle, size_t hay_length);
+
+/**
+ * Copy the string src to dst, but no more than size - 1 bytes, and
+ * null-terminate dst.
+ *
+ * This function is the same as BSD strlcpy().
+ *
+ * @param dst destination buffer
+ * @param src source string
+ * @param size size of destination buffer
+ * @return the length of src
+ *
+ * @warning since the return value is the length of src, src absolutely
+ * _must_ be a properly 0-terminated string, otherwise this will read beyond
+ * the end of the buffer and possibly crash.
+ */
+size_t av_strlcpy(char *dst, const char *src, size_t size);
+
+/**
+ * Append the string src to the string dst, but to a total length of
+ * no more than size - 1 bytes, and null-terminate dst.
+ *
+ * This function is similar to BSD strlcat(), but differs when
+ * size <= strlen(dst).
+ *
+ * @param dst destination buffer
+ * @param src source string
+ * @param size size of destination buffer
+ * @return the total length of src and dst
+ *
+ * @warning since the return value use the length of src and dst, these
+ * absolutely _must_ be a properly 0-terminated strings, otherwise this
+ * will read beyond the end of the buffer and possibly crash.
+ */
+size_t av_strlcat(char *dst, const char *src, size_t size);
+
+/**
+ * Append output to a string, according to a format. Never write out of
+ * the destination buffer, and always put a terminating 0 within
+ * the buffer.
+ * @param dst destination buffer (string to which the output is
+ *  appended)
+ * @param size total size of the destination buffer
+ * @param fmt printf-compatible format string, specifying how the
+ *  following parameters are used
+ * @return the length of the string that would have been generated
+ *  if enough space had been available
+ */
+size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
+
+/**
+ * Convert a number to a av_malloced string.
+ */
+char *av_d2str(double d);
+
+/**
+ * Unescape the given string until a non escaped terminating char,
+ * and return the token corresponding to the unescaped string.
+ *
+ * The normal \ and ' escaping is supported. Leading and trailing
+ * whitespaces are removed, unless they are escaped with '\' or are
+ * enclosed between ''.
+ *
+ * @param buf the buffer to parse, buf will be updated to point to the
+ * terminating char
+ * @param term a 0-terminated list of terminating chars
+ * @return the malloced unescaped string, which must be av_freed by
+ * the user, NULL in case of allocation failure
+ */
+char *av_get_token(const char **buf, const char *term);
+
+/**
+ * Locale-independent conversion of ASCII isdigit.
+ */
+int av_isdigit(int c);
+
+/**
+ * Locale-independent conversion of ASCII isgraph.
+ */
+int av_isgraph(int c);
+
+/**
+ * Locale-independent conversion of ASCII isspace.
+ */
+int av_isspace(int c);
+
+/**
+ * Locale-independent conversion of ASCII characters to uppercase.
+ */
+static inline int av_toupper(int c)
+{
+    if (c >= 'a' && c <= 'z')
+        c ^= 0x20;
+    return c;
+}
+
+/**
+ * Locale-independent conversion of ASCII characters to lowercase.
+ */
+static inline int av_tolower(int c)
+{
+    if (c >= 'A' && c <= 'Z')
+        c ^= 0x20;
+    return c;
+}
+
+/**
+ * Locale-independent conversion of ASCII isxdigit.
+ */
+int av_isxdigit(int c);
+
+/*
+ * Locale-independent case-insensitive compare.
+ * @note This means only ASCII-range characters are case-insensitive
+ */
+int av_strcasecmp(const char *a, const char *b);
+
+/**
+ * Locale-independent case-insensitive compare.
+ * @note This means only ASCII-range characters are case-insensitive
+ */
+int av_strncasecmp(const char *a, const char *b, size_t n);
+
+
+/**
+ * Thread safe basename.
+ * @param path the path, on DOS both \ and / are considered separators.
+ * @return pointer to the basename substring.
+ */
+const char *av_basename(const char *path);
+
+/**
+ * Thread safe dirname.
+ * @param path the path, on DOS both \ and / are considered separators.
+ * @return the path with the separator replaced by the string terminator or ".".
+ * @note the function may change the input string.
+ */
+const char *av_dirname(char *path);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_AVSTRING_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avutil.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avutil.h
new file mode 100644
index 000000000..ddb34a1dd
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avutil.h
@@ -0,0 +1,308 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_AVUTIL_H
+#define AVUTIL_AVUTIL_H
+
+/**
+ * @file
+ * external API header
+ */
+
+/**
+ * @mainpage
+ *
+ * @section libav_intro Introduction
+ *
+ * This document describes the usage of the different libraries
+ * provided by Libav.
+ *
+ * @li @ref libavc "libavcodec" encoding/decoding library
+ * @li @ref lavfi "libavfilter" graph-based frame editing library
+ * @li @ref libavf "libavformat" I/O and muxing/demuxing library
+ * @li @ref lavd "libavdevice" special devices muxing/demuxing library
+ * @li @ref lavu "libavutil" common utility library
+ * @li @ref lavr "libavresample" audio resampling, format conversion and mixing
+ * @li @subpage libswscale  color conversion and scaling library
+ *
+ * @section libav_versioning Versioning and compatibility
+ *
+ * Each of the Libav libraries contains a version.h header, which defines a
+ * major, minor and micro version number with the
+ * <em>LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO}</em> macros. The major version
+ * number is incremented with backward incompatible changes - e.g. removing
+ * parts of the public API, reordering public struct members, etc. The minor
+ * version number is incremented for backward compatible API changes or major
+ * new features - e.g. adding a new public function or a new decoder. The micro
+ * version number is incremented for smaller changes that a calling program
+ * might still want to check for - e.g. changing behavior in a previously
+ * unspecified situation.
+ *
+ * Libav guarantees backward API and ABI compatibility for each library as long
+ * as its major version number is unchanged. This means that no public symbols
+ * will be removed or renamed. Types and names of the public struct members and
+ * values of public macros and enums will remain the same (unless they were
+ * explicitly declared as not part of the public API). Documented behavior will
+ * not change.
+ *
+ * In other words, any correct program that works with a given Libav snapshot
+ * should work just as well without any changes with any later snapshot with the
+ * same major versions. This applies to both rebuilding the program against new
+ * Libav versions or to replacing the dynamic Libav libraries that a program
+ * links against.
+ *
+ * However, new public symbols may be added and new members may be appended to
+ * public structs whose size is not part of public ABI (most public structs in
+ * Libav). New macros and enum values may be added. Behavior in undocumented
+ * situations may change slightly (and be documented). All those are accompanied
+ * by an entry in doc/APIchanges and incrementing either the minor or micro
+ * version number.
+ */
+
+/**
+ * @defgroup lavu Common utility functions
+ *
+ * @brief
+ * libavutil contains the code shared across all the other Libav
+ * libraries
+ *
+ * @note In order to use the functions provided by avutil you must include
+ * the specific header.
+ *
+ * @{
+ *
+ * @defgroup lavu_crypto Crypto and Hashing
+ *
+ * @{
+ * @}
+ *
+ * @defgroup lavu_math Maths
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_string String Manipulation
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_mem Memory Management
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_data Data Structures
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_audio Audio related
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_error Error Codes
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_misc Other
+ *
+ * @{
+ *
+ * @defgroup lavu_internal Internal
+ *
+ * Not exported functions, for internal usage only
+ *
+ * @{
+ *
+ * @}
+ */
+
+
+/**
+ * @defgroup preproc_misc Preprocessor String Macros
+ *
+ * String manipulation macros
+ *
+ * @{
+ */
+
+#define AV_STRINGIFY(s)         AV_TOSTRING(s)
+#define AV_TOSTRING(s) #s
+
+#define AV_GLUE(a, b) a ## b
+#define AV_JOIN(a, b) AV_GLUE(a, b)
+
+#define AV_PRAGMA(s) _Pragma(#s)
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup version_utils Library Version Macros
+ *
+ * Useful to check and match library version in order to maintain
+ * backward compatibility.
+ *
+ * @{
+ */
+
+#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
+#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
+#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavu_ver
+ * @{
+ */
+
+/**
+ * Return the LIBAVUTIL_VERSION_INT constant.
+ */
+unsigned avutil_version(void);
+
+/**
+ * Return the libavutil build-time configuration.
+ */
+const char *avutil_configuration(void);
+
+/**
+ * Return the libavutil license.
+ */
+const char *avutil_license(void);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavu_media Media Type
+ * @brief Media Type
+ */
+
+enum AVMediaType {
+    AVMEDIA_TYPE_UNKNOWN = -1,  ///< Usually treated as AVMEDIA_TYPE_DATA
+    AVMEDIA_TYPE_VIDEO,
+    AVMEDIA_TYPE_AUDIO,
+    AVMEDIA_TYPE_DATA,          ///< Opaque data information usually continuous
+    AVMEDIA_TYPE_SUBTITLE,
+    AVMEDIA_TYPE_ATTACHMENT,    ///< Opaque data information usually sparse
+    AVMEDIA_TYPE_NB
+};
+
+/**
+ * @defgroup lavu_const Constants
+ * @{
+ *
+ * @defgroup lavu_enc Encoding specific
+ *
+ * @note those definition should move to avcodec
+ * @{
+ */
+
+#define FF_LAMBDA_SHIFT 7
+#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
+#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
+#define FF_LAMBDA_MAX (256*128-1)
+
+#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
+
+/**
+ * @}
+ * @defgroup lavu_time Timestamp specific
+ *
+ * Libav internal timebase and timestamp definitions
+ *
+ * @{
+ */
+
+/**
+ * @brief Undefined timestamp value
+ *
+ * Usually reported by demuxer that work on containers that do not provide
+ * either pts or dts.
+ */
+
+#define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
+
+/**
+ * Internal time base represented as integer
+ */
+
+#define AV_TIME_BASE            1000000
+
+/**
+ * Internal time base represented as fractional value
+ */
+
+#define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
+
+/**
+ * @}
+ * @}
+ * @defgroup lavu_picture Image related
+ *
+ * AVPicture types, pixel formats and basic image planes manipulation.
+ *
+ * @{
+ */
+
+enum AVPictureType {
+    AV_PICTURE_TYPE_I = 1, ///< Intra
+    AV_PICTURE_TYPE_P,     ///< Predicted
+    AV_PICTURE_TYPE_B,     ///< Bi-dir predicted
+    AV_PICTURE_TYPE_S,     ///< S(GMC)-VOP MPEG4
+    AV_PICTURE_TYPE_SI,    ///< Switching Intra
+    AV_PICTURE_TYPE_SP,    ///< Switching Predicted
+    AV_PICTURE_TYPE_BI,    ///< BI type
+};
+
+/**
+ * Return a single letter to describe the given picture type
+ * pict_type.
+ *
+ * @param[in] pict_type the picture type @return a single character
+ * representing the picture type, '?' if pict_type is unknown
+ */
+char av_get_picture_type_char(enum AVPictureType pict_type);
+
+/**
+ * @}
+ */
+
+#include "error.h"
+#include "version.h"
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* AVUTIL_AVUTIL_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/base64.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/base64.h
new file mode 100644
index 000000000..4750cf5c7
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/base64.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_BASE64_H
+#define AVUTIL_BASE64_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavu_base64 Base64
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+
+/**
+ * Decode a base64-encoded string.
+ *
+ * @param out      buffer for decoded data
+ * @param in       null-terminated input string
+ * @param out_size size in bytes of the out buffer, must be at
+ *                 least 3/4 of the length of in
+ * @return         number of bytes written, or a negative value in case of
+ *                 invalid input
+ */
+int av_base64_decode(uint8_t *out, const char *in, int out_size);
+
+/**
+ * Encode data to base64 and null-terminate.
+ *
+ * @param out      buffer for encoded data
+ * @param out_size size in bytes of the output buffer, must be at
+ *                 least AV_BASE64_SIZE(in_size)
+ * @param in_size  size in bytes of the 'in' buffer
+ * @return         'out' or NULL in case of error
+ */
+char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
+
+/**
+ * Calculate the output size needed to base64-encode x bytes.
+ */
+#define AV_BASE64_SIZE(x)  (((x)+2) / 3 * 4 + 1)
+
+ /**
+  * @}
+  */
+
+#endif /* AVUTIL_BASE64_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/blowfish.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/blowfish.h
new file mode 100644
index 000000000..8c29536cf
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/blowfish.h
@@ -0,0 +1,76 @@
+/*
+ * Blowfish algorithm
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_BLOWFISH_H
+#define AVUTIL_BLOWFISH_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavu_blowfish Blowfish
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#define AV_BF_ROUNDS 16
+
+typedef struct AVBlowfish {
+    uint32_t p[AV_BF_ROUNDS + 2];
+    uint32_t s[4][256];
+} AVBlowfish;
+
+/**
+ * Initialize an AVBlowfish context.
+ *
+ * @param ctx an AVBlowfish context
+ * @param key a key
+ * @param key_len length of the key
+ */
+void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ *
+ * @param ctx an AVBlowfish context
+ * @param xl left four bytes halves of input to be encrypted
+ * @param xr right four bytes halves of input to be encrypted
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
+                           int decrypt);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ *
+ * @param ctx an AVBlowfish context
+ * @param dst destination array, can be equal to src
+ * @param src source array, can be equal to dst
+ * @param count number of 8 byte blocks
+ * @param iv initialization vector for CBC mode, if NULL ECB will be used
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
+                       int count, uint8_t *iv, int decrypt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_BLOWFISH_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/bswap.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/bswap.h
new file mode 100644
index 000000000..8a350e1cd
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/bswap.h
@@ -0,0 +1,109 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * byte swapping routines
+ */
+
+#ifndef AVUTIL_BSWAP_H
+#define AVUTIL_BSWAP_H
+
+#include <stdint.h>
+#include "libavutil/avconfig.h"
+#include "attributes.h"
+
+#ifdef HAVE_AV_CONFIG_H
+
+#include "config.h"
+
+#if   ARCH_ARM
+#   include "arm/bswap.h"
+#elif ARCH_AVR32
+#   include "avr32/bswap.h"
+#elif ARCH_BFIN
+#   include "bfin/bswap.h"
+#elif ARCH_SH4
+#   include "sh4/bswap.h"
+#elif ARCH_X86
+#   include "x86/bswap.h"
+#endif
+
+#endif /* HAVE_AV_CONFIG_H */
+
+#define AV_BSWAP16C(x) (((x) << 8 & 0xff00)  | ((x) >> 8 & 0x00ff))
+#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
+#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
+
+#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
+
+#ifndef av_bswap16
+static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
+{
+    x= (x>>8) | (x<<8);
+    return x;
+}
+#endif
+
+#ifndef av_bswap32
+static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
+{
+    return AV_BSWAP32C(x);
+}
+#endif
+
+#ifndef av_bswap64
+static inline uint64_t av_const av_bswap64(uint64_t x)
+{
+    return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
+}
+#endif
+
+// be2ne ... big-endian to native-endian
+// le2ne ... little-endian to native-endian
+
+#if AV_HAVE_BIGENDIAN
+#define av_be2ne16(x) (x)
+#define av_be2ne32(x) (x)
+#define av_be2ne64(x) (x)
+#define av_le2ne16(x) av_bswap16(x)
+#define av_le2ne32(x) av_bswap32(x)
+#define av_le2ne64(x) av_bswap64(x)
+#define AV_BE2NEC(s, x) (x)
+#define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
+#else
+#define av_be2ne16(x) av_bswap16(x)
+#define av_be2ne32(x) av_bswap32(x)
+#define av_be2ne64(x) av_bswap64(x)
+#define av_le2ne16(x) (x)
+#define av_le2ne32(x) (x)
+#define av_le2ne64(x) (x)
+#define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
+#define AV_LE2NEC(s, x) (x)
+#endif
+
+#define AV_BE2NE16C(x) AV_BE2NEC(16, x)
+#define AV_BE2NE32C(x) AV_BE2NEC(32, x)
+#define AV_BE2NE64C(x) AV_BE2NEC(64, x)
+#define AV_LE2NE16C(x) AV_LE2NEC(16, x)
+#define AV_LE2NE32C(x) AV_LE2NEC(32, x)
+#define AV_LE2NE64C(x) AV_LE2NEC(64, x)
+
+#endif /* AVUTIL_BSWAP_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/buffer.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/buffer.h
new file mode 100644
index 000000000..56b4d020e
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/buffer.h
@@ -0,0 +1,267 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * @ingroup lavu_buffer
+ * refcounted data buffer API
+ */
+
+#ifndef AVUTIL_BUFFER_H
+#define AVUTIL_BUFFER_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavu_buffer AVBuffer
+ * @ingroup lavu_data
+ *
+ * @{
+ * AVBuffer is an API for reference-counted data buffers.
+ *
+ * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer
+ * represents the data buffer itself; it is opaque and not meant to be accessed
+ * by the caller directly, but only through AVBufferRef. However, the caller may
+ * e.g. compare two AVBuffer pointers to check whether two different references
+ * are describing the same data buffer. AVBufferRef represents a single
+ * reference to an AVBuffer and it is the object that may be manipulated by the
+ * caller directly.
+ *
+ * There are two functions provided for creating a new AVBuffer with a single
+ * reference -- av_buffer_alloc() to just allocate a new buffer, and
+ * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing
+ * reference, additional references may be created with av_buffer_ref().
+ * Use av_buffer_unref() to free a reference (this will automatically free the
+ * data once all the references are freed).
+ *
+ * The convention throughout this API and the rest of Libav is such that the
+ * buffer is considered writable if there exists only one reference to it (and
+ * it has not been marked as read-only). The av_buffer_is_writable() function is
+ * provided to check whether this is true and av_buffer_make_writable() will
+ * automatically create a new writable buffer when necessary.
+ * Of course nothing prevents the calling code from violating this convention,
+ * however that is safe only when all the existing references are under its
+ * control.
+ *
+ * @note Referencing and unreferencing the buffers is thread-safe and thus
+ * may be done from multiple threads simultaneously without any need for
+ * additional locking.
+ *
+ * @note Two different references to the same buffer can point to different
+ * parts of the buffer (i.e. their AVBufferRef.data will not be equal).
+ */
+
+/**
+ * A reference counted buffer type. It is opaque and is meant to be used through
+ * references (AVBufferRef).
+ */
+typedef struct AVBuffer AVBuffer;
+
+/**
+ * A reference to a data buffer.
+ *
+ * The size of this struct is not a part of the public ABI and it is not meant
+ * to be allocated directly.
+ */
+typedef struct AVBufferRef {
+    AVBuffer *buffer;
+
+    /**
+     * The data buffer. It is considered writable if and only if
+     * this is the only reference to the buffer, in which case
+     * av_buffer_is_writable() returns 1.
+     */
+    uint8_t *data;
+    /**
+     * Size of data in bytes.
+     */
+    int      size;
+} AVBufferRef;
+
+/**
+ * Allocate an AVBuffer of the given size using av_malloc().
+ *
+ * @return an AVBufferRef of given size or NULL when out of memory
+ */
+AVBufferRef *av_buffer_alloc(int size);
+
+/**
+ * Same as av_buffer_alloc(), except the returned buffer will be initialized
+ * to zero.
+ */
+AVBufferRef *av_buffer_allocz(int size);
+
+/**
+ * Always treat the buffer as read-only, even when it has only one
+ * reference.
+ */
+#define AV_BUFFER_FLAG_READONLY (1 << 0)
+
+/**
+ * Create an AVBuffer from an existing array.
+ *
+ * If this function is successful, data is owned by the AVBuffer. The caller may
+ * only access data through the returned AVBufferRef and references derived from
+ * it.
+ * If this function fails, data is left untouched.
+ * @param data   data array
+ * @param size   size of data in bytes
+ * @param free   a callback for freeing this buffer's data
+ * @param opaque parameter to be passed to free
+ * @param flags  a combination of AV_BUFFER_FLAG_*
+ *
+ * @return an AVBufferRef referring to data on success, NULL on failure.
+ */
+AVBufferRef *av_buffer_create(uint8_t *data, int size,
+                              void (*free)(void *opaque, uint8_t *data),
+                              void *opaque, int flags);
+
+/**
+ * Default free callback, which calls av_free() on the buffer data.
+ * This function is meant to be passed to av_buffer_create(), not called
+ * directly.
+ */
+void av_buffer_default_free(void *opaque, uint8_t *data);
+
+/**
+ * Create a new reference to an AVBuffer.
+ *
+ * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on
+ * failure.
+ */
+AVBufferRef *av_buffer_ref(AVBufferRef *buf);
+
+/**
+ * Free a given reference and automatically free the buffer if there are no more
+ * references to it.
+ *
+ * @param buf the reference to be freed. The pointer is set to NULL on return.
+ */
+void av_buffer_unref(AVBufferRef **buf);
+
+/**
+ * @return 1 if the caller may write to the data referred to by buf (which is
+ * true if and only if buf is the only reference to the underlying AVBuffer).
+ * Return 0 otherwise.
+ * A positive answer is valid until av_buffer_ref() is called on buf.
+ */
+int av_buffer_is_writable(const AVBufferRef *buf);
+
+/**
+ * Create a writable reference from a given buffer reference, avoiding data copy
+ * if possible.
+ *
+ * @param buf buffer reference to make writable. On success, buf is either left
+ *            untouched, or it is unreferenced and a new writable AVBufferRef is
+ *            written in its place. On failure, buf is left untouched.
+ * @return 0 on success, a negative AVERROR on failure.
+ */
+int av_buffer_make_writable(AVBufferRef **buf);
+
+/**
+ * Reallocate a given buffer.
+ *
+ * @param buf  a buffer reference to reallocate. On success, buf will be
+ *             unreferenced and a new reference with the required size will be
+ *             written in its place. On failure buf will be left untouched. *buf
+ *             may be NULL, then a new buffer is allocated.
+ * @param size required new buffer size.
+ * @return 0 on success, a negative AVERROR on failure.
+ *
+ * @note the buffer is actually reallocated with av_realloc() only if it was
+ * initially allocated through av_buffer_realloc(NULL) and there is only one
+ * reference to it (i.e. the one passed to this function). In all other cases
+ * a new buffer is allocated and the data is copied.
+ */
+int av_buffer_realloc(AVBufferRef **buf, int size);
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup lavu_bufferpool AVBufferPool
+ * @ingroup lavu_data
+ *
+ * @{
+ * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers.
+ *
+ * Frequently allocating and freeing large buffers may be slow. AVBufferPool is
+ * meant to solve this in cases when the caller needs a set of buffers of the
+ * same size (the most obvious use case being buffers for raw video or audio
+ * frames).
+ *
+ * At the beginning, the user must call av_buffer_pool_init() to create the
+ * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to
+ * get a reference to a new buffer, similar to av_buffer_alloc(). This new
+ * reference works in all aspects the same way as the one created by
+ * av_buffer_alloc(). However, when the last reference to this buffer is
+ * unreferenced, it is returned to the pool instead of being freed and will be
+ * reused for subsequent av_buffer_pool_get() calls.
+ *
+ * When the caller is done with the pool and no longer needs to allocate any new
+ * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable.
+ * Once all the buffers are released, it will automatically be freed.
+ *
+ * Allocating and releasing buffers with this API is thread-safe as long as
+ * either the default alloc callback is used, or the user-supplied one is
+ * thread-safe.
+ */
+
+/**
+ * The buffer pool. This structure is opaque and not meant to be accessed
+ * directly. It is allocated with av_buffer_pool_init() and freed with
+ * av_buffer_pool_uninit().
+ */
+typedef struct AVBufferPool AVBufferPool;
+
+/**
+ * Allocate and initialize a buffer pool.
+ *
+ * @param size size of each buffer in this pool
+ * @param alloc a function that will be used to allocate new buffers when the
+ * pool is empty. May be NULL, then the default allocator will be used
+ * (av_buffer_alloc()).
+ * @return newly created buffer pool on success, NULL on error.
+ */
+AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size));
+
+/**
+ * Mark the pool as being available for freeing. It will actually be freed only
+ * once all the allocated buffers associated with the pool are released. Thus it
+ * is safe to call this function while some of the allocated buffers are still
+ * in use.
+ *
+ * @param pool pointer to the pool to be freed. It will be set to NULL.
+ * @see av_buffer_pool_can_uninit()
+ */
+void av_buffer_pool_uninit(AVBufferPool **pool);
+
+/**
+ * Allocate a new AVBuffer, reusing an old buffer from the pool when available.
+ * This function may be called simultaneously from multiple threads.
+ *
+ * @return a reference to the new buffer on success, NULL on error.
+ */
+AVBufferRef *av_buffer_pool_get(AVBufferPool *pool);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_BUFFER_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/channel_layout.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/channel_layout.h
new file mode 100644
index 000000000..15b6887a6
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/channel_layout.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ * Copyright (c) 2008 Peter Ross
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_CHANNEL_LAYOUT_H
+#define AVUTIL_CHANNEL_LAYOUT_H
+
+#include <stdint.h>
+
+/**
+ * @file
+ * audio channel layout utility functions
+ */
+
+/**
+ * @addtogroup lavu_audio
+ * @{
+ */
+
+/**
+ * @defgroup channel_masks Audio channel masks
+ * @{
+ */
+#define AV_CH_FRONT_LEFT             0x00000001
+#define AV_CH_FRONT_RIGHT            0x00000002
+#define AV_CH_FRONT_CENTER           0x00000004
+#define AV_CH_LOW_FREQUENCY          0x00000008
+#define AV_CH_BACK_LEFT              0x00000010
+#define AV_CH_BACK_RIGHT             0x00000020
+#define AV_CH_FRONT_LEFT_OF_CENTER   0x00000040
+#define AV_CH_FRONT_RIGHT_OF_CENTER  0x00000080
+#define AV_CH_BACK_CENTER            0x00000100
+#define AV_CH_SIDE_LEFT              0x00000200
+#define AV_CH_SIDE_RIGHT             0x00000400
+#define AV_CH_TOP_CENTER             0x00000800
+#define AV_CH_TOP_FRONT_LEFT         0x00001000
+#define AV_CH_TOP_FRONT_CENTER       0x00002000
+#define AV_CH_TOP_FRONT_RIGHT        0x00004000
+#define AV_CH_TOP_BACK_LEFT          0x00008000
+#define AV_CH_TOP_BACK_CENTER        0x00010000
+#define AV_CH_TOP_BACK_RIGHT         0x00020000
+#define AV_CH_STEREO_LEFT            0x20000000  ///< Stereo downmix.
+#define AV_CH_STEREO_RIGHT           0x40000000  ///< See AV_CH_STEREO_LEFT.
+#define AV_CH_WIDE_LEFT              0x0000000080000000ULL
+#define AV_CH_WIDE_RIGHT             0x0000000100000000ULL
+#define AV_CH_SURROUND_DIRECT_LEFT   0x0000000200000000ULL
+#define AV_CH_SURROUND_DIRECT_RIGHT  0x0000000400000000ULL
+#define AV_CH_LOW_FREQUENCY_2        0x0000000800000000ULL
+
+/** Channel mask value used for AVCodecContext.request_channel_layout
+    to indicate that the user requests the channel order of the decoder output
+    to be the native codec channel order. */
+#define AV_CH_LAYOUT_NATIVE          0x8000000000000000ULL
+
+/**
+ * @}
+ * @defgroup channel_mask_c Audio channel convenience macros
+ * @{
+ * */
+#define AV_CH_LAYOUT_MONO              (AV_CH_FRONT_CENTER)
+#define AV_CH_LAYOUT_STEREO            (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
+#define AV_CH_LAYOUT_2POINT1           (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_2_1               (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_SURROUND          (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
+#define AV_CH_LAYOUT_3POINT1           (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_4POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_4POINT1           (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_2_2               (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
+#define AV_CH_LAYOUT_QUAD              (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_5POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
+#define AV_CH_LAYOUT_5POINT1           (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_5POINT0_BACK      (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_5POINT1_BACK      (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_6POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT0_FRONT     (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_HEXAGONAL         (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT1_BACK      (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT1_FRONT     (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_7POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_7POINT0_FRONT     (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_OCTAGONAL         (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_STEREO_DOWNMIX    (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
+
+enum AVMatrixEncoding {
+    AV_MATRIX_ENCODING_NONE,
+    AV_MATRIX_ENCODING_DOLBY,
+    AV_MATRIX_ENCODING_DPLII,
+    AV_MATRIX_ENCODING_NB
+};
+
+/**
+ * @}
+ */
+
+/**
+ * Return a channel layout id that matches name, or 0 if no match is found.
+ *
+ * name can be one or several of the following notations,
+ * separated by '+' or '|':
+ * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
+ *   5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
+ * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
+ *   SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
+ * - a number of channels, in decimal, optionally followed by 'c', yielding
+ *   the default channel layout for that number of channels (@see
+ *   av_get_default_channel_layout);
+ * - a channel layout mask, in hexadecimal starting with "0x" (see the
+ *   AV_CH_* macros).
+ *
+ * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
+ */
+uint64_t av_get_channel_layout(const char *name);
+
+/**
+ * Return a description of a channel layout.
+ * If nb_channels is <= 0, it is guessed from the channel_layout.
+ *
+ * @param buf put here the string containing the channel layout
+ * @param buf_size size in bytes of the buffer
+ */
+void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
+
+/**
+ * Return the number of channels in the channel layout.
+ */
+int av_get_channel_layout_nb_channels(uint64_t channel_layout);
+
+/**
+ * Return default channel layout for a given number of channels.
+ */
+uint64_t av_get_default_channel_layout(int nb_channels);
+
+/**
+ * Get the index of a channel in channel_layout.
+ *
+ * @param channel a channel layout describing exactly one channel which must be
+ *                present in channel_layout.
+ *
+ * @return index of channel in channel_layout on success, a negative AVERROR
+ *         on error.
+ */
+int av_get_channel_layout_channel_index(uint64_t channel_layout,
+                                        uint64_t channel);
+
+/**
+ * Get the channel with the given index in channel_layout.
+ */
+uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
+
+/**
+ * Get the name of a given channel.
+ *
+ * @return channel name on success, NULL on error.
+ */
+const char *av_get_channel_name(uint64_t channel);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_CHANNEL_LAYOUT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/common.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/common.h
new file mode 100644
index 000000000..caa6b1963
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/common.h
@@ -0,0 +1,405 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * common internal and external API header
+ */
+
+#ifndef AVUTIL_COMMON_H
+#define AVUTIL_COMMON_H
+
+#include <errno.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "attributes.h"
+#include "version.h"
+#include "libavutil/avconfig.h"
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_NE(be, le) (be)
+#else
+#   define AV_NE(be, le) (le)
+#endif
+
+//rounded division & shift
+#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
+/* assume b>0 */
+#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
+#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
+#define FFSIGN(a) ((a) > 0 ? 1 : -1)
+
+#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
+#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
+#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
+
+#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
+#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
+#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
+
+/* misc math functions */
+
+#if FF_API_AV_REVERSE
+extern attribute_deprecated const uint8_t av_reverse[256];
+#endif
+
+#ifdef HAVE_AV_CONFIG_H
+#   include "config.h"
+#   include "intmath.h"
+#endif
+
+/* Pull in unguarded fallback defines at the end of this file. */
+#include "common.h"
+
+#ifndef av_log2
+av_const int av_log2(unsigned v);
+#endif
+
+#ifndef av_log2_16bit
+av_const int av_log2_16bit(unsigned v);
+#endif
+
+/**
+ * Clip a signed integer value into the amin-amax range.
+ * @param a value to clip
+ * @param amin minimum value of the clip range
+ * @param amax maximum value of the clip range
+ * @return clipped value
+ */
+static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
+{
+    if      (a < amin) return amin;
+    else if (a > amax) return amax;
+    else               return a;
+}
+
+/**
+ * Clip a signed integer value into the 0-255 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
+{
+    if (a&(~0xFF)) return (-a)>>31;
+    else           return a;
+}
+
+/**
+ * Clip a signed integer value into the -128,127 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int8_t av_clip_int8_c(int a)
+{
+    if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
+    else                  return a;
+}
+
+/**
+ * Clip a signed integer value into the 0-65535 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
+{
+    if (a&(~0xFFFF)) return (-a)>>31;
+    else             return a;
+}
+
+/**
+ * Clip a signed integer value into the -32768,32767 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int16_t av_clip_int16_c(int a)
+{
+    if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
+    else                      return a;
+}
+
+/**
+ * Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
+{
+    if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
+    else                                         return a;
+}
+
+/**
+ * Clip a signed integer to an unsigned power of two range.
+ * @param  a value to clip
+ * @param  p bit position to clip at
+ * @return clipped value
+ */
+static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
+{
+    if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
+    else                   return  a;
+}
+
+/**
+ * Add two signed 32-bit values with saturation.
+ *
+ * @param  a one value
+ * @param  b another value
+ * @return sum with signed saturation
+ */
+static av_always_inline int av_sat_add32_c(int a, int b)
+{
+    return av_clipl_int32((int64_t)a + b);
+}
+
+/**
+ * Add a doubled value to another value with saturation at both stages.
+ *
+ * @param  a first value
+ * @param  b value doubled and added to a
+ * @return sum with signed saturation
+ */
+static av_always_inline int av_sat_dadd32_c(int a, int b)
+{
+    return av_sat_add32(a, av_sat_add32(b, b));
+}
+
+/**
+ * Clip a float value into the amin-amax range.
+ * @param a value to clip
+ * @param amin minimum value of the clip range
+ * @param amax maximum value of the clip range
+ * @return clipped value
+ */
+static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
+{
+    if      (a < amin) return amin;
+    else if (a > amax) return amax;
+    else               return a;
+}
+
+/** Compute ceil(log2(x)).
+ * @param x value used to compute ceil(log2(x))
+ * @return computed ceiling of log2(x)
+ */
+static av_always_inline av_const int av_ceil_log2_c(int x)
+{
+    return av_log2((x - 1) << 1);
+}
+
+/**
+ * Count number of bits set to one in x
+ * @param x value to count bits of
+ * @return the number of bits set to one in x
+ */
+static av_always_inline av_const int av_popcount_c(uint32_t x)
+{
+    x -= (x >> 1) & 0x55555555;
+    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+    x = (x + (x >> 4)) & 0x0F0F0F0F;
+    x += x >> 8;
+    return (x + (x >> 16)) & 0x3F;
+}
+
+/**
+ * Count number of bits set to one in x
+ * @param x value to count bits of
+ * @return the number of bits set to one in x
+ */
+static av_always_inline av_const int av_popcount64_c(uint64_t x)
+{
+    return av_popcount(x) + av_popcount(x >> 32);
+}
+
+#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
+#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
+
+/**
+ * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
+ *
+ * @param val      Output value, must be an lvalue of type uint32_t.
+ * @param GET_BYTE Expression reading one byte from the input.
+ *                 Evaluated up to 7 times (4 for the currently
+ *                 assigned Unicode range).  With a memory buffer
+ *                 input, this could be *ptr++.
+ * @param ERROR    Expression to be evaluated on invalid input,
+ *                 typically a goto statement.
+ */
+#define GET_UTF8(val, GET_BYTE, ERROR)\
+    val= GET_BYTE;\
+    {\
+        uint32_t top = (val & 128) >> 1;\
+        if ((val & 0xc0) == 0x80)\
+            ERROR\
+        while (val & top) {\
+            int tmp= GET_BYTE - 128;\
+            if(tmp>>6)\
+                ERROR\
+            val= (val<<6) + tmp;\
+            top <<= 5;\
+        }\
+        val &= (top << 1) - 1;\
+    }
+
+/**
+ * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
+ *
+ * @param val       Output value, must be an lvalue of type uint32_t.
+ * @param GET_16BIT Expression returning two bytes of UTF-16 data converted
+ *                  to native byte order.  Evaluated one or two times.
+ * @param ERROR     Expression to be evaluated on invalid input,
+ *                  typically a goto statement.
+ */
+#define GET_UTF16(val, GET_16BIT, ERROR)\
+    val = GET_16BIT;\
+    {\
+        unsigned int hi = val - 0xD800;\
+        if (hi < 0x800) {\
+            val = GET_16BIT - 0xDC00;\
+            if (val > 0x3FFU || hi > 0x3FFU)\
+                ERROR\
+            val += (hi<<10) + 0x10000;\
+        }\
+    }\
+
+/**
+ * @def PUT_UTF8(val, tmp, PUT_BYTE)
+ * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
+ * @param val is an input-only argument and should be of type uint32_t. It holds
+ * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
+ * val is given as a function it is executed only once.
+ * @param tmp is a temporary variable and should be of type uint8_t. It
+ * represents an intermediate value during conversion that is to be
+ * output by PUT_BYTE.
+ * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
+ * It could be a function or a statement, and uses tmp as the input byte.
+ * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
+ * executed up to 4 times for values in the valid UTF-8 range and up to
+ * 7 times in the general case, depending on the length of the converted
+ * Unicode character.
+ */
+#define PUT_UTF8(val, tmp, PUT_BYTE)\
+    {\
+        int bytes, shift;\
+        uint32_t in = val;\
+        if (in < 0x80) {\
+            tmp = in;\
+            PUT_BYTE\
+        } else {\
+            bytes = (av_log2(in) + 4) / 5;\
+            shift = (bytes - 1) * 6;\
+            tmp = (256 - (256 >> bytes)) | (in >> shift);\
+            PUT_BYTE\
+            while (shift >= 6) {\
+                shift -= 6;\
+                tmp = 0x80 | ((in >> shift) & 0x3f);\
+                PUT_BYTE\
+            }\
+        }\
+    }
+
+/**
+ * @def PUT_UTF16(val, tmp, PUT_16BIT)
+ * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
+ * @param val is an input-only argument and should be of type uint32_t. It holds
+ * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
+ * val is given as a function it is executed only once.
+ * @param tmp is a temporary variable and should be of type uint16_t. It
+ * represents an intermediate value during conversion that is to be
+ * output by PUT_16BIT.
+ * @param PUT_16BIT writes the converted UTF-16 data to any proper destination
+ * in desired endianness. It could be a function or a statement, and uses tmp
+ * as the input byte.  For example, PUT_BYTE could be "*output++ = tmp;"
+ * PUT_BYTE will be executed 1 or 2 times depending on input character.
+ */
+#define PUT_UTF16(val, tmp, PUT_16BIT)\
+    {\
+        uint32_t in = val;\
+        if (in < 0x10000) {\
+            tmp = in;\
+            PUT_16BIT\
+        } else {\
+            tmp = 0xD800 | ((in - 0x10000) >> 10);\
+            PUT_16BIT\
+            tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
+            PUT_16BIT\
+        }\
+    }\
+
+
+
+#include "mem.h"
+
+#ifdef HAVE_AV_CONFIG_H
+#    include "internal.h"
+#endif /* HAVE_AV_CONFIG_H */
+
+#endif /* AVUTIL_COMMON_H */
+
+/*
+ * The following definitions are outside the multiple inclusion guard
+ * to ensure they are immediately available in intmath.h.
+ */
+
+#ifndef av_ceil_log2
+#   define av_ceil_log2     av_ceil_log2_c
+#endif
+#ifndef av_clip
+#   define av_clip          av_clip_c
+#endif
+#ifndef av_clip_uint8
+#   define av_clip_uint8    av_clip_uint8_c
+#endif
+#ifndef av_clip_int8
+#   define av_clip_int8     av_clip_int8_c
+#endif
+#ifndef av_clip_uint16
+#   define av_clip_uint16   av_clip_uint16_c
+#endif
+#ifndef av_clip_int16
+#   define av_clip_int16    av_clip_int16_c
+#endif
+#ifndef av_clipl_int32
+#   define av_clipl_int32   av_clipl_int32_c
+#endif
+#ifndef av_clip_uintp2
+#   define av_clip_uintp2   av_clip_uintp2_c
+#endif
+#ifndef av_sat_add32
+#   define av_sat_add32     av_sat_add32_c
+#endif
+#ifndef av_sat_dadd32
+#   define av_sat_dadd32    av_sat_dadd32_c
+#endif
+#ifndef av_clipf
+#   define av_clipf         av_clipf_c
+#endif
+#ifndef av_popcount
+#   define av_popcount      av_popcount_c
+#endif
+#ifndef av_popcount64
+#   define av_popcount64    av_popcount64_c
+#endif
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h
new file mode 100644
index 000000000..8f2af2854
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_CPU_H
+#define AVUTIL_CPU_H
+
+#include "version.h"
+
+#define AV_CPU_FLAG_FORCE    0x80000000 /* force usage of selected flags (OR) */
+
+    /* lower 16 bits - CPU features */
+#define AV_CPU_FLAG_MMX          0x0001 ///< standard MMX
+#define AV_CPU_FLAG_MMXEXT       0x0002 ///< SSE integer functions or AMD MMX ext
+#if FF_API_CPU_FLAG_MMX2
+#define AV_CPU_FLAG_MMX2         0x0002 ///< SSE integer functions or AMD MMX ext
+#endif
+#define AV_CPU_FLAG_3DNOW        0x0004 ///< AMD 3DNOW
+#define AV_CPU_FLAG_SSE          0x0008 ///< SSE functions
+#define AV_CPU_FLAG_SSE2         0x0010 ///< PIV SSE2 functions
+#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
+#define AV_CPU_FLAG_3DNOWEXT     0x0020 ///< AMD 3DNowExt
+#define AV_CPU_FLAG_SSE3         0x0040 ///< Prescott SSE3 functions
+#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
+#define AV_CPU_FLAG_SSSE3        0x0080 ///< Conroe SSSE3 functions
+#define AV_CPU_FLAG_ATOM     0x10000000 ///< Atom processor, some SSSE3 instructions are slower
+#define AV_CPU_FLAG_SSE4         0x0100 ///< Penryn SSE4.1 functions
+#define AV_CPU_FLAG_SSE42        0x0200 ///< Nehalem SSE4.2 functions
+#define AV_CPU_FLAG_AVX          0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
+#define AV_CPU_FLAG_XOP          0x0400 ///< Bulldozer XOP functions
+#define AV_CPU_FLAG_FMA4         0x0800 ///< Bulldozer FMA4 functions
+#define AV_CPU_FLAG_CMOV         0x1000 ///< i686 cmov
+
+#define AV_CPU_FLAG_ALTIVEC      0x0001 ///< standard
+
+#define AV_CPU_FLAG_ARMV5TE      (1 << 0)
+#define AV_CPU_FLAG_ARMV6        (1 << 1)
+#define AV_CPU_FLAG_ARMV6T2      (1 << 2)
+#define AV_CPU_FLAG_VFP          (1 << 3)
+#define AV_CPU_FLAG_VFPV3        (1 << 4)
+#define AV_CPU_FLAG_NEON         (1 << 5)
+
+/**
+ * Return the flags which specify extensions supported by the CPU.
+ */
+int av_get_cpu_flags(void);
+
+/**
+ * Set a mask on flags returned by av_get_cpu_flags().
+ * This function is mainly useful for testing.
+ *
+ * @warning this function is not thread safe.
+ */
+void av_set_cpu_flags_mask(int mask);
+
+/**
+ * Parse CPU flags from a string.
+ *
+ * @return a combination of AV_CPU_* flags, negative on error.
+ */
+int av_parse_cpu_flags(const char *s);
+
+/**
+ * @return the number of logical CPU cores present.
+ */
+int av_cpu_count(void);
+
+#endif /* AVUTIL_CPU_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/crc.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/crc.h
new file mode 100644
index 000000000..0540619d2
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/crc.h
@@ -0,0 +1,74 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_CRC_H
+#define AVUTIL_CRC_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "attributes.h"
+
+typedef uint32_t AVCRC;
+
+typedef enum {
+    AV_CRC_8_ATM,
+    AV_CRC_16_ANSI,
+    AV_CRC_16_CCITT,
+    AV_CRC_32_IEEE,
+    AV_CRC_32_IEEE_LE,  /*< reversed bitorder version of AV_CRC_32_IEEE */
+    AV_CRC_MAX,         /*< Not part of public API! Do not use outside libavutil. */
+}AVCRCId;
+
+/**
+ * Initialize a CRC table.
+ * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
+ * @param le If 1, the lowest bit represents the coefficient for the highest
+ *           exponent of the corresponding polynomial (both for poly and
+ *           actual CRC).
+ *           If 0, you must swap the CRC parameter and the result of av_crc
+ *           if you need the standard representation (can be simplified in
+ *           most cases to e.g. bswap16):
+ *           av_bswap32(crc << (32-bits))
+ * @param bits number of bits for the CRC
+ * @param poly generator polynomial without the x**bits coefficient, in the
+ *             representation as specified by le
+ * @param ctx_size size of ctx in bytes
+ * @return <0 on failure
+ */
+int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
+
+/**
+ * Get an initialized standard CRC table.
+ * @param crc_id ID of a standard CRC
+ * @return a pointer to the CRC table or NULL on failure
+ */
+const AVCRC *av_crc_get_table(AVCRCId crc_id);
+
+/**
+ * Calculate the CRC of a block.
+ * @param crc CRC of previous blocks if any or initial value for CRC
+ * @return CRC updated with the data from the given block
+ *
+ * @see av_crc_init() "le" parameter
+ */
+uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
+                const uint8_t *buffer, size_t length) av_pure;
+
+#endif /* AVUTIL_CRC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h
new file mode 100644
index 000000000..ab23f26e6
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h
@@ -0,0 +1,146 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Public dictionary API.
+ */
+
+#ifndef AVUTIL_DICT_H
+#define AVUTIL_DICT_H
+
+/**
+ * @addtogroup lavu_dict AVDictionary
+ * @ingroup lavu_data
+ *
+ * @brief Simple key:value store
+ *
+ * @{
+ * Dictionaries are used for storing key:value pairs. To create
+ * an AVDictionary, simply pass an address of a NULL pointer to
+ * av_dict_set(). NULL can be used as an empty dictionary wherever
+ * a pointer to an AVDictionary is required.
+ * Use av_dict_get() to retrieve an entry or iterate over all
+ * entries and finally av_dict_free() to free the dictionary
+ * and all its contents.
+ *
+ * @code
+ * AVDictionary *d = NULL;                // "create" an empty dictionary
+ * av_dict_set(&d, "foo", "bar", 0);      // add an entry
+ *
+ * char *k = av_strdup("key");            // if your strings are already allocated,
+ * char *v = av_strdup("value");          // you can avoid copying them like this
+ * av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
+ *
+ * AVDictionaryEntry *t = NULL;
+ * while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
+ *     <....>                             // iterate over all entries in d
+ * }
+ *
+ * av_dict_free(&d);
+ * @endcode
+ *
+ */
+
+#define AV_DICT_MATCH_CASE      1
+#define AV_DICT_IGNORE_SUFFIX   2
+#define AV_DICT_DONT_STRDUP_KEY 4   /**< Take ownership of a key that's been
+                                         allocated with av_malloc() and children. */
+#define AV_DICT_DONT_STRDUP_VAL 8   /**< Take ownership of a value that's been
+                                         allocated with av_malloc() and chilren. */
+#define AV_DICT_DONT_OVERWRITE 16   ///< Don't overwrite existing entries.
+#define AV_DICT_APPEND         32   /**< If the entry already exists, append to it.  Note that no
+                                      delimiter is added, the strings are simply concatenated. */
+
+typedef struct AVDictionaryEntry {
+    char *key;
+    char *value;
+} AVDictionaryEntry;
+
+typedef struct AVDictionary AVDictionary;
+
+/**
+ * Get a dictionary entry with matching key.
+ *
+ * @param prev Set to the previous matching element to find the next.
+ *             If set to NULL the first matching element is returned.
+ * @param flags Allows case as well as suffix-insensitive comparisons.
+ * @return Found entry or NULL, changing key or value leads to undefined behavior.
+ */
+AVDictionaryEntry *
+av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
+
+/**
+ * Get number of entries in dictionary.
+ *
+ * @param m dictionary
+ * @return  number of entries in dictionary
+ */
+int av_dict_count(const AVDictionary *m);
+
+/**
+ * Set the given entry in *pm, overwriting an existing entry.
+ *
+ * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL
+ * a dictionary struct is allocated and put in *pm.
+ * @param key entry key to add to *pm (will be av_strduped depending on flags)
+ * @param value entry value to add to *pm (will be av_strduped depending on flags).
+ *        Passing a NULL value will cause an existing entry to be deleted.
+ * @return >= 0 on success otherwise an error code <0
+ */
+int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
+
+/**
+ * Parse the key/value pairs list and add to a dictionary.
+ *
+ * @param key_val_sep  a 0-terminated list of characters used to separate
+ *                     key from value
+ * @param pairs_sep    a 0-terminated list of characters used to separate
+ *                     two pairs from each other
+ * @param flags        flags to use when adding to dictionary.
+ *                     AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL
+ *                     are ignored since the key/value tokens will always
+ *                     be duplicated.
+ * @return             0 on success, negative AVERROR code on failure
+ */
+int av_dict_parse_string(AVDictionary **pm, const char *str,
+                         const char *key_val_sep, const char *pairs_sep,
+                         int flags);
+
+/**
+ * Copy entries from one AVDictionary struct into another.
+ * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
+ *            this function will allocate a struct for you and put it in *dst
+ * @param src pointer to source AVDictionary struct
+ * @param flags flags to use when setting entries in *dst
+ * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+ */
+void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
+
+/**
+ * Free all the memory allocated for an AVDictionary struct
+ * and all keys and values.
+ */
+void av_dict_free(AVDictionary **m);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_DICT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h
new file mode 100644
index 000000000..3dfd8807f
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h
@@ -0,0 +1,83 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * error code definitions
+ */
+
+#ifndef AVUTIL_ERROR_H
+#define AVUTIL_ERROR_H
+
+#include <errno.h>
+#include <stddef.h>
+#include "avutil.h"
+
+/**
+ * @addtogroup lavu_error
+ *
+ * @{
+ */
+
+
+/* error handling */
+#if EDOM > 0
+#define AVERROR(e) (-(e))   ///< Returns a negative error code from a POSIX error code, to return from library functions.
+#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
+#else
+/* Some platforms have E* and errno already negated. */
+#define AVERROR(e) (e)
+#define AVUNERROR(e) (e)
+#endif
+
+#define AVERROR_BSF_NOT_FOUND      (-0x39acbd08) ///< Bitstream filter not found
+#define AVERROR_DECODER_NOT_FOUND  (-0x3cbabb08) ///< Decoder not found
+#define AVERROR_DEMUXER_NOT_FOUND  (-0x32babb08) ///< Demuxer not found
+#define AVERROR_ENCODER_NOT_FOUND  (-0x3cb1ba08) ///< Encoder not found
+#define AVERROR_EOF                (-0x5fb9b0bb) ///< End of file
+#define AVERROR_EXIT               (-0x2bb6a7bb) ///< Immediate exit was requested; the called function should not be restarted
+#define AVERROR_FILTER_NOT_FOUND   (-0x33b6b908) ///< Filter not found
+#define AVERROR_INVALIDDATA        (-0x3ebbb1b7) ///< Invalid data found when processing input
+#define AVERROR_MUXER_NOT_FOUND    (-0x27aab208) ///< Muxer not found
+#define AVERROR_OPTION_NOT_FOUND   (-0x2bafb008) ///< Option not found
+#define AVERROR_PATCHWELCOME       (-0x3aa8beb0) ///< Not yet implemented in Libav, patches welcome
+#define AVERROR_PROTOCOL_NOT_FOUND (-0x30adaf08) ///< Protocol not found
+#define AVERROR_STREAM_NOT_FOUND   (-0x2dabac08) ///< Stream not found
+#define AVERROR_BUG                (-0x5fb8aabe) ///< Bug detected, please report the issue
+#define AVERROR_UNKNOWN            (-0x31b4b1ab) ///< Unknown error, typically from an external library
+#define AVERROR_EXPERIMENTAL       (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
+
+/**
+ * Put a description of the AVERROR code errnum in errbuf.
+ * In case of failure the global variable errno is set to indicate the
+ * error. Even in case of failure av_strerror() will print a generic
+ * error message indicating the errnum provided to errbuf.
+ *
+ * @param errnum      error code to describe
+ * @param errbuf      buffer to which description is written
+ * @param errbuf_size the size in bytes of errbuf
+ * @return 0 on success, a negative value if a description for errnum
+ * cannot be found
+ */
+int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_ERROR_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/eval.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/eval.h
new file mode 100644
index 000000000..ccb29e7a3
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/eval.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2002 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * simple arithmetic expression evaluator
+ */
+
+#ifndef AVUTIL_EVAL_H
+#define AVUTIL_EVAL_H
+
+#include "avutil.h"
+
+typedef struct AVExpr AVExpr;
+
+/**
+ * Parse and evaluate an expression.
+ * Note, this is significantly slower than av_expr_eval().
+ *
+ * @param res a pointer to a double where is put the result value of
+ * the expression, or NAN in case of error
+ * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
+ * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
+ * @param const_values a zero terminated array of values for the identifiers from const_names
+ * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
+ * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
+ * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
+ * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
+ * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
+ * @param log_ctx parent logging context
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_expr_parse_and_eval(double *res, const char *s,
+                           const char * const *const_names, const double *const_values,
+                           const char * const *func1_names, double (* const *funcs1)(void *, double),
+                           const char * const *func2_names, double (* const *funcs2)(void *, double, double),
+                           void *opaque, int log_offset, void *log_ctx);
+
+/**
+ * Parse an expression.
+ *
+ * @param expr a pointer where is put an AVExpr containing the parsed
+ * value in case of successful parsing, or NULL otherwise.
+ * The pointed to AVExpr must be freed with av_expr_free() by the user
+ * when it is not needed anymore.
+ * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
+ * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
+ * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
+ * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
+ * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
+ * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
+ * @param log_ctx parent logging context
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_expr_parse(AVExpr **expr, const char *s,
+                  const char * const *const_names,
+                  const char * const *func1_names, double (* const *funcs1)(void *, double),
+                  const char * const *func2_names, double (* const *funcs2)(void *, double, double),
+                  int log_offset, void *log_ctx);
+
+/**
+ * Evaluate a previously parsed expression.
+ *
+ * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
+ * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
+ * @return the value of the expression
+ */
+double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
+
+/**
+ * Free a parsed expression previously created with av_expr_parse().
+ */
+void av_expr_free(AVExpr *e);
+
+/**
+ * Parse the string in numstr and return its value as a double. If
+ * the string is empty, contains only whitespaces, or does not contain
+ * an initial substring that has the expected syntax for a
+ * floating-point number, no conversion is performed. In this case,
+ * returns a value of zero and the value returned in tail is the value
+ * of numstr.
+ *
+ * @param numstr a string representing a number, may contain one of
+ * the International System number postfixes, for example 'K', 'M',
+ * 'G'. If 'i' is appended after the postfix, powers of 2 are used
+ * instead of powers of 10. The 'B' postfix multiplies the value for
+ * 8, and can be appended after another postfix or used alone. This
+ * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
+ * @param tail if non-NULL puts here the pointer to the char next
+ * after the last parsed character
+ */
+double av_strtod(const char *numstr, char **tail);
+
+#endif /* AVUTIL_EVAL_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h
new file mode 100644
index 000000000..ea30f5d2b
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h
@@ -0,0 +1,131 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * a very simple circular buffer FIFO implementation
+ */
+
+#ifndef AVUTIL_FIFO_H
+#define AVUTIL_FIFO_H
+
+#include <stdint.h>
+#include "avutil.h"
+#include "attributes.h"
+
+typedef struct AVFifoBuffer {
+    uint8_t *buffer;
+    uint8_t *rptr, *wptr, *end;
+    uint32_t rndx, wndx;
+} AVFifoBuffer;
+
+/**
+ * Initialize an AVFifoBuffer.
+ * @param size of FIFO
+ * @return AVFifoBuffer or NULL in case of memory allocation failure
+ */
+AVFifoBuffer *av_fifo_alloc(unsigned int size);
+
+/**
+ * Free an AVFifoBuffer.
+ * @param f AVFifoBuffer to free
+ */
+void av_fifo_free(AVFifoBuffer *f);
+
+/**
+ * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
+ * @param f AVFifoBuffer to reset
+ */
+void av_fifo_reset(AVFifoBuffer *f);
+
+/**
+ * Return the amount of data in bytes in the AVFifoBuffer, that is the
+ * amount of data you can read from it.
+ * @param f AVFifoBuffer to read from
+ * @return size
+ */
+int av_fifo_size(AVFifoBuffer *f);
+
+/**
+ * Return the amount of space in bytes in the AVFifoBuffer, that is the
+ * amount of data you can write into it.
+ * @param f AVFifoBuffer to write into
+ * @return size
+ */
+int av_fifo_space(AVFifoBuffer *f);
+
+/**
+ * Feed data from an AVFifoBuffer to a user-supplied callback.
+ * @param f AVFifoBuffer to read from
+ * @param buf_size number of bytes to read
+ * @param func generic read function
+ * @param dest data destination
+ */
+int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
+
+/**
+ * Feed data from a user-supplied callback to an AVFifoBuffer.
+ * @param f AVFifoBuffer to write to
+ * @param src data source; non-const since it may be used as a
+ * modifiable context by the function defined in func
+ * @param size number of bytes to write
+ * @param func generic write function; the first parameter is src,
+ * the second is dest_buf, the third is dest_buf_size.
+ * func must return the number of bytes written to dest_buf, or <= 0 to
+ * indicate no more data available to write.
+ * If func is NULL, src is interpreted as a simple byte array for source data.
+ * @return the number of bytes written to the FIFO
+ */
+int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
+
+/**
+ * Resize an AVFifoBuffer.
+ * @param f AVFifoBuffer to resize
+ * @param size new AVFifoBuffer size in bytes
+ * @return <0 for failure, >=0 otherwise
+ */
+int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
+
+/**
+ * Read and discard the specified amount of data from an AVFifoBuffer.
+ * @param f AVFifoBuffer to read from
+ * @param size amount of data to read in bytes
+ */
+void av_fifo_drain(AVFifoBuffer *f, int size);
+
+/**
+ * Return a pointer to the data stored in a FIFO buffer at a certain offset.
+ * The FIFO buffer is not modified.
+ *
+ * @param f    AVFifoBuffer to peek at, f must be non-NULL
+ * @param offs an offset in bytes, its absolute value must be less
+ *             than the used buffer size or the returned pointer will
+ *             point outside to the buffer data.
+ *             The used buffer size can be checked with av_fifo_size().
+ */
+static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
+{
+    uint8_t *ptr = f->rptr + offs;
+    if (ptr >= f->end)
+        ptr = f->buffer + (ptr - f->end);
+    else if (ptr < f->buffer)
+        ptr = f->end - (f->buffer - ptr);
+    return ptr;
+}
+
+#endif /* AVUTIL_FIFO_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/file.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/file.h
new file mode 100644
index 000000000..e3f02a830
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/file.h
@@ -0,0 +1,54 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_FILE_H
+#define AVUTIL_FILE_H
+
+#include <stdint.h>
+
+#include "avutil.h"
+
+/**
+ * @file
+ * Misc file utilities.
+ */
+
+/**
+ * Read the file with name filename, and put its content in a newly
+ * allocated buffer or map it with mmap() when available.
+ * In case of success set *bufptr to the read or mmapped buffer, and
+ * *size to the size in bytes of the buffer in *bufptr.
+ * The returned buffer must be released with av_file_unmap().
+ *
+ * @param log_offset loglevel offset used for logging
+ * @param log_ctx context used for logging
+ * @return a non negative number in case of success, a negative value
+ * corresponding to an AVERROR error code in case of failure
+ */
+int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
+                int log_offset, void *log_ctx);
+
+/**
+ * Unmap or free the buffer bufptr created by av_file_map().
+ *
+ * @param size size in bytes of bufptr, must be the same as returned
+ * by av_file_map()
+ */
+void av_file_unmap(uint8_t *bufptr, size_t size);
+
+#endif /* AVUTIL_FILE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h
new file mode 100644
index 000000000..d71948db0
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h
@@ -0,0 +1,491 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_FRAME_H
+#define AVUTIL_FRAME_H
+
+#include <stdint.h>
+
+#include "libavcodec/version.h"
+
+#include "avutil.h"
+#include "buffer.h"
+#include "dict.h"
+#include "rational.h"
+#include "samplefmt.h"
+
+enum AVFrameSideDataType {
+    /**
+     * The data is the AVPanScan struct defined in libavcodec.
+     */
+    AV_FRAME_DATA_PANSCAN,
+};
+
+typedef struct AVFrameSideData {
+    enum AVFrameSideDataType type;
+    uint8_t *data;
+    int      size;
+    AVDictionary *metadata;
+} AVFrameSideData;
+
+/**
+ * This structure describes decoded (raw) audio or video data.
+ *
+ * AVFrame must be allocated using av_frame_alloc(). Not that this only
+ * allocates the AVFrame itself, the buffers for the data must be managed
+ * through other means (see below).
+ * AVFrame must be freed with av_frame_free().
+ *
+ * AVFrame is typically allocated once and then reused multiple times to hold
+ * different data (e.g. a single AVFrame to hold frames received from a
+ * decoder). In such a case, av_frame_unref() will free any references held by
+ * the frame and reset it to its original clean state before it
+ * is reused again.
+ *
+ * The data described by an AVFrame is usually reference counted through the
+ * AVBuffer API. The underlying buffer references are stored in AVFrame.buf /
+ * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at
+ * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case,
+ * every single data plane must be contained in one of the buffers in
+ * AVFrame.buf or AVFrame.extended_buf.
+ * There may be a single buffer for all the data, or one separate buffer for
+ * each plane, or anything in between.
+ *
+ * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added
+ * to the end with a minor bump.
+ */
+typedef struct AVFrame {
+#define AV_NUM_DATA_POINTERS 8
+    /**
+     * pointer to the picture/channel planes.
+     * This might be different from the first allocated byte
+     */
+    uint8_t *data[AV_NUM_DATA_POINTERS];
+
+    /**
+     * For video, size in bytes of each picture line.
+     * For audio, size in bytes of each plane.
+     *
+     * For audio, only linesize[0] may be set. For planar audio, each channel
+     * plane must be the same size.
+     */
+    int linesize[AV_NUM_DATA_POINTERS];
+
+    /**
+     * pointers to the data planes/channels.
+     *
+     * For video, this should simply point to data[].
+     *
+     * For planar audio, each channel has a separate data pointer, and
+     * linesize[0] contains the size of each channel buffer.
+     * For packed audio, there is just one data pointer, and linesize[0]
+     * contains the total size of the buffer for all channels.
+     *
+     * Note: Both data and extended_data should always be set in a valid frame,
+     * but for planar audio with more channels that can fit in data,
+     * extended_data must be used in order to access all channels.
+     */
+    uint8_t **extended_data;
+
+    /**
+     * width and height of the video frame
+     */
+    int width, height;
+
+    /**
+     * number of audio samples (per channel) described by this frame
+     */
+    int nb_samples;
+
+    /**
+     * format of the frame, -1 if unknown or unset
+     * Values correspond to enum AVPixelFormat for video frames,
+     * enum AVSampleFormat for audio)
+     */
+    int format;
+
+    /**
+     * 1 -> keyframe, 0-> not
+     */
+    int key_frame;
+
+    /**
+     * Picture type of the frame.
+     */
+    enum AVPictureType pict_type;
+
+#if FF_API_AVFRAME_LAVC
+    attribute_deprecated
+    uint8_t *base[AV_NUM_DATA_POINTERS];
+#endif
+
+    /**
+     * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
+     */
+    AVRational sample_aspect_ratio;
+
+    /**
+     * Presentation timestamp in time_base units (time when frame should be shown to user).
+     */
+    int64_t pts;
+
+    /**
+     * PTS copied from the AVPacket that was decoded to produce this frame.
+     */
+    int64_t pkt_pts;
+
+    /**
+     * DTS copied from the AVPacket that triggered returning this frame.
+     */
+    int64_t pkt_dts;
+
+    /**
+     * picture number in bitstream order
+     */
+    int coded_picture_number;
+    /**
+     * picture number in display order
+     */
+    int display_picture_number;
+
+    /**
+     * quality (between 1 (good) and FF_LAMBDA_MAX (bad))
+     */
+    int quality;
+
+#if FF_API_AVFRAME_LAVC
+    attribute_deprecated
+    int reference;
+
+    /**
+     * QP table
+     */
+    attribute_deprecated
+    int8_t *qscale_table;
+    /**
+     * QP store stride
+     */
+    attribute_deprecated
+    int qstride;
+
+    attribute_deprecated
+    int qscale_type;
+
+    /**
+     * mbskip_table[mb]>=1 if MB didn't change
+     * stride= mb_width = (width+15)>>4
+     */
+    attribute_deprecated
+    uint8_t *mbskip_table;
+
+    /**
+     * motion vector table
+     * @code
+     * example:
+     * int mv_sample_log2= 4 - motion_subsample_log2;
+     * int mb_width= (width+15)>>4;
+     * int mv_stride= (mb_width << mv_sample_log2) + 1;
+     * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
+     * @endcode
+     */
+    attribute_deprecated
+    int16_t (*motion_val[2])[2];
+
+    /**
+     * macroblock type table
+     * mb_type_base + mb_width + 2
+     */
+    attribute_deprecated
+    uint32_t *mb_type;
+
+    /**
+     * DCT coefficients
+     */
+    attribute_deprecated
+    short *dct_coeff;
+
+    /**
+     * motion reference frame index
+     * the order in which these are stored can depend on the codec.
+     */
+    attribute_deprecated
+    int8_t *ref_index[2];
+#endif
+
+    /**
+     * for some private data of the user
+     */
+    void *opaque;
+
+    /**
+     * error
+     */
+    uint64_t error[AV_NUM_DATA_POINTERS];
+
+#if FF_API_AVFRAME_LAVC
+    attribute_deprecated
+    int type;
+#endif
+
+    /**
+     * When decoding, this signals how much the picture must be delayed.
+     * extra_delay = repeat_pict / (2*fps)
+     */
+    int repeat_pict;
+
+    /**
+     * The content of the picture is interlaced.
+     */
+    int interlaced_frame;
+
+    /**
+     * If the content is interlaced, is top field displayed first.
+     */
+    int top_field_first;
+
+    /**
+     * Tell user application that palette has changed from previous frame.
+     */
+    int palette_has_changed;
+
+#if FF_API_AVFRAME_LAVC
+    attribute_deprecated
+    int buffer_hints;
+
+    /**
+     * Pan scan.
+     */
+    attribute_deprecated
+    struct AVPanScan *pan_scan;
+#endif
+
+    /**
+     * reordered opaque 64bit (generally an integer or a double precision float
+     * PTS but can be anything).
+     * The user sets AVCodecContext.reordered_opaque to represent the input at
+     * that time,
+     * the decoder reorders values as needed and sets AVFrame.reordered_opaque
+     * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
+     * @deprecated in favor of pkt_pts
+     */
+    int64_t reordered_opaque;
+
+#if FF_API_AVFRAME_LAVC
+    /**
+     * @deprecated this field is unused
+     */
+    attribute_deprecated void *hwaccel_picture_private;
+
+    attribute_deprecated
+    struct AVCodecContext *owner;
+    attribute_deprecated
+    void *thread_opaque;
+
+    /**
+     * log2 of the size of the block which a single vector in motion_val represents:
+     * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
+     */
+    attribute_deprecated
+    uint8_t motion_subsample_log2;
+#endif
+
+    /**
+     * Sample rate of the audio data.
+     */
+    int sample_rate;
+
+    /**
+     * Channel layout of the audio data.
+     */
+    uint64_t channel_layout;
+
+    /**
+     * AVBuffer references backing the data for this frame. If all elements of
+     * this array are NULL, then this frame is not reference counted.
+     *
+     * There may be at most one AVBuffer per data plane, so for video this array
+     * always contains all the references. For planar audio with more than
+     * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
+     * this array. Then the extra AVBufferRef pointers are stored in the
+     * extended_buf array.
+     */
+    AVBufferRef *buf[AV_NUM_DATA_POINTERS];
+
+    /**
+     * For planar audio which requires more than AV_NUM_DATA_POINTERS
+     * AVBufferRef pointers, this array will hold all the references which
+     * cannot fit into AVFrame.buf.
+     *
+     * Note that this is different from AVFrame.extended_data, which always
+     * contains all the pointers. This array only contains the extra pointers,
+     * which cannot fit into AVFrame.buf.
+     *
+     * This array is always allocated using av_malloc() by whoever constructs
+     * the frame. It is freed in av_frame_unref().
+     */
+    AVBufferRef **extended_buf;
+    /**
+     * Number of elements in extended_buf.
+     */
+    int        nb_extended_buf;
+
+    AVFrameSideData **side_data;
+    int            nb_side_data;
+} AVFrame;
+
+/**
+ * Allocate an AVFrame and set its fields to default values.  The resulting
+ * struct must be freed using av_frame_free().
+ *
+ * @return An AVFrame filled with default values or NULL on failure.
+ *
+ * @note this only allocates the AVFrame itself, not the data buffers. Those
+ * must be allocated through other means, e.g. with av_frame_get_buffer() or
+ * manually.
+ */
+AVFrame *av_frame_alloc(void);
+
+/**
+ * Free the frame and any dynamically allocated objects in it,
+ * e.g. extended_data. If the frame is reference counted, it will be
+ * unreferenced first.
+ *
+ * @param frame frame to be freed. The pointer will be set to NULL.
+ */
+void av_frame_free(AVFrame **frame);
+
+/**
+ * Setup a new reference to the data described by an given frame.
+ *
+ * Copy frame properties from src to dst and create a new reference for each
+ * AVBufferRef from src.
+ *
+ * If src is not reference counted, new buffers are allocated and the data is
+ * copied.
+ *
+ * @return 0 on success, a negative AVERROR on error
+ */
+int av_frame_ref(AVFrame *dst, AVFrame *src);
+
+/**
+ * Create a new frame that references the same data as src.
+ *
+ * This is a shortcut for av_frame_alloc()+av_frame_ref().
+ *
+ * @return newly created AVFrame on success, NULL on error.
+ */
+AVFrame *av_frame_clone(AVFrame *src);
+
+/**
+ * Unreference all the buffers referenced by frame and reset the frame fields.
+ */
+void av_frame_unref(AVFrame *frame);
+
+/**
+ * Move everythnig contained in src to dst and reset src.
+ */
+void av_frame_move_ref(AVFrame *dst, AVFrame *src);
+
+/**
+ * Allocate new buffer(s) for audio or video data.
+ *
+ * The following fields must be set on frame before calling this function:
+ * - format (pixel format for video, sample format for audio)
+ * - width and height for video
+ * - nb_samples and channel_layout for audio
+ *
+ * This function will fill AVFrame.data and AVFrame.buf arrays and, if
+ * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf.
+ * For planar formats, one buffer will be allocated for each plane.
+ *
+ * @param frame frame in which to store the new buffers.
+ * @param align required buffer size alignment
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ */
+int av_frame_get_buffer(AVFrame *frame, int align);
+
+/**
+ * Check if the frame data is writable.
+ *
+ * @return A positive value if the frame data is writable (which is true if and
+ * only if each of the underlying buffers has only one reference, namely the one
+ * stored in this frame). Return 0 otherwise.
+ *
+ * If 1 is returned the answer is valid until av_buffer_ref() is called on any
+ * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly).
+ *
+ * @see av_frame_make_writable(), av_buffer_is_writable()
+ */
+int av_frame_is_writable(AVFrame *frame);
+
+/**
+ * Ensure that the frame data is writable, avoiding data copy if possible.
+ *
+ * Do nothing if the frame is writable, allocate new buffers and copy the data
+ * if it is not.
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ *
+ * @see av_frame_is_writable(), av_buffer_is_writable(),
+ * av_buffer_make_writable()
+ */
+int av_frame_make_writable(AVFrame *frame);
+
+/**
+ * Copy only "metadata" fields from src to dst.
+ *
+ * Metadata for the purpose of this function are those fields that do not affect
+ * the data layout in the buffers.  E.g. pts, sample rate (for audio) or sample
+ * aspect ratio (for video), but not width/height or channel layout.
+ * Side data is also copied.
+ */
+int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
+
+/**
+ * Get the buffer reference a given data plane is stored in.
+ *
+ * @param plane index of the data plane of interest in frame->extended_data.
+ *
+ * @return the buffer reference that contains the plane or NULL if the input
+ * frame is not valid.
+ */
+AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
+
+/**
+ * Add a new side data to a frame.
+ *
+ * @param frame a frame to which the side data should be added
+ * @param type type of the added side data
+ * @param size size of the side data
+ *
+ * @return newly added side data on success, NULL on error
+ */
+AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
+                                        enum AVFrameSideDataType type,
+                                        int size);
+
+/**
+ * @return a pointer to the side data of a given type on success, NULL if there
+ * is no side data with such type in this frame.
+ */
+AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
+                                        enum AVFrameSideDataType type);
+
+#endif /* AVUTIL_FRAME_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h
new file mode 100644
index 000000000..28c2062b1
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2012 Martin Storsjo
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_HMAC_H
+#define AVUTIL_HMAC_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavu_hmac HMAC
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+enum AVHMACType {
+    AV_HMAC_MD5,
+    AV_HMAC_SHA1,
+};
+
+typedef struct AVHMAC AVHMAC;
+
+/**
+ * Allocate an AVHMAC context.
+ * @param type The hash function used for the HMAC.
+ */
+AVHMAC *av_hmac_alloc(enum AVHMACType type);
+
+/**
+ * Free an AVHMAC context.
+ * @param ctx The context to free, may be NULL
+ */
+void av_hmac_free(AVHMAC *ctx);
+
+/**
+ * Initialize an AVHMAC context with an authentication key.
+ * @param ctx    The HMAC context
+ * @param key    The authentication key
+ * @param keylen The length of the key, in bytes
+ */
+void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen);
+
+/**
+ * Hash data with the HMAC.
+ * @param ctx  The HMAC context
+ * @param data The data to hash
+ * @param len  The length of the data, in bytes
+ */
+void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len);
+
+/**
+ * Finish hashing and output the HMAC digest.
+ * @param ctx    The HMAC context
+ * @param out    The output buffer to write the digest into
+ * @param outlen The length of the out buffer, in bytes
+ * @return       The number of bytes written to out, or a negative error code.
+ */
+int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen);
+
+/**
+ * Hash an array of data with a key.
+ * @param ctx    The HMAC context
+ * @param data   The data to hash
+ * @param len    The length of the data, in bytes
+ * @param key    The authentication key
+ * @param keylen The length of the key, in bytes
+ * @param out    The output buffer to write the digest into
+ * @param outlen The length of the out buffer, in bytes
+ * @return       The number of bytes written to out, or a negative error code.
+ */
+int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len,
+                 const uint8_t *key, unsigned int keylen,
+                 uint8_t *out, unsigned int outlen);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_HMAC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/imgutils.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/imgutils.h
new file mode 100644
index 000000000..71510132a
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/imgutils.h
@@ -0,0 +1,138 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_IMGUTILS_H
+#define AVUTIL_IMGUTILS_H
+
+/**
+ * @file
+ * misc image utilities
+ *
+ * @addtogroup lavu_picture
+ * @{
+ */
+
+#include "avutil.h"
+#include "pixdesc.h"
+
+/**
+ * Compute the max pixel step for each plane of an image with a
+ * format described by pixdesc.
+ *
+ * The pixel step is the distance in bytes between the first byte of
+ * the group of bytes which describe a pixel component and the first
+ * byte of the successive group in the same plane for the same
+ * component.
+ *
+ * @param max_pixsteps an array which is filled with the max pixel step
+ * for each plane. Since a plane may contain different pixel
+ * components, the computed max_pixsteps[plane] is relative to the
+ * component in the plane with the max pixel step.
+ * @param max_pixstep_comps an array which is filled with the component
+ * for each plane which has the max pixel step. May be NULL.
+ */
+void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
+                                const AVPixFmtDescriptor *pixdesc);
+
+/**
+ * Compute the size of an image line with format pix_fmt and width
+ * width for the plane plane.
+ *
+ * @return the computed size in bytes
+ */
+int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane);
+
+/**
+ * Fill plane linesizes for an image with pixel format pix_fmt and
+ * width width.
+ *
+ * @param linesizes array to be filled with the linesize for each plane
+ * @return >= 0 in case of success, a negative error code otherwise
+ */
+int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width);
+
+/**
+ * Fill plane data pointers for an image with pixel format pix_fmt and
+ * height height.
+ *
+ * @param data pointers array to be filled with the pointer for each image plane
+ * @param ptr the pointer to a buffer which will contain the image
+ * @param linesizes the array containing the linesize for each
+ * plane, should be filled by av_image_fill_linesizes()
+ * @return the size in bytes required for the image buffer, a negative
+ * error code in case of failure
+ */
+int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height,
+                           uint8_t *ptr, const int linesizes[4]);
+
+/**
+ * Allocate an image with size w and h and pixel format pix_fmt, and
+ * fill pointers and linesizes accordingly.
+ * The allocated image buffer has to be freed by using
+ * av_freep(&pointers[0]).
+ *
+ * @param align the value to use for buffer size alignment
+ * @return the size in bytes required for the image buffer, a negative
+ * error code in case of failure
+ */
+int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
+                   int w, int h, enum AVPixelFormat pix_fmt, int align);
+
+/**
+ * Copy image plane from src to dst.
+ * That is, copy "height" number of lines of "bytewidth" bytes each.
+ * The first byte of each successive line is separated by *_linesize
+ * bytes.
+ *
+ * @param dst_linesize linesize for the image plane in dst
+ * @param src_linesize linesize for the image plane in src
+ */
+void av_image_copy_plane(uint8_t       *dst, int dst_linesize,
+                         const uint8_t *src, int src_linesize,
+                         int bytewidth, int height);
+
+/**
+ * Copy image in src_data to dst_data.
+ *
+ * @param dst_linesizes linesizes for the image in dst_data
+ * @param src_linesizes linesizes for the image in src_data
+ */
+void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
+                   const uint8_t *src_data[4], const int src_linesizes[4],
+                   enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Check if the given dimension of an image is valid, meaning that all
+ * bytes of the image can be addressed with a signed int.
+ *
+ * @param w the width of the picture
+ * @param h the height of the picture
+ * @param log_offset the offset to sum to the log level for logging with log_ctx
+ * @param log_ctx the parent logging context, it may be NULL
+ * @return >= 0 if valid, a negative error code otherwise
+ */
+int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
+
+int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt);
+
+/**
+ * @}
+ */
+
+
+#endif /* AVUTIL_IMGUTILS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat.h
new file mode 100644
index 000000000..38d26ad87
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011 Mans Rullgard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTFLOAT_H
+#define AVUTIL_INTFLOAT_H
+
+#include <stdint.h>
+#include "attributes.h"
+
+union av_intfloat32 {
+    uint32_t i;
+    float    f;
+};
+
+union av_intfloat64 {
+    uint64_t i;
+    double   f;
+};
+
+/**
+ * Reinterpret a 32-bit integer as a float.
+ */
+static av_always_inline float av_int2float(uint32_t i)
+{
+    union av_intfloat32 v;
+    v.i = i;
+    return v.f;
+}
+
+/**
+ * Reinterpret a float as a 32-bit integer.
+ */
+static av_always_inline uint32_t av_float2int(float f)
+{
+    union av_intfloat32 v;
+    v.f = f;
+    return v.i;
+}
+
+/**
+ * Reinterpret a 64-bit integer as a double.
+ */
+static av_always_inline double av_int2double(uint64_t i)
+{
+    union av_intfloat64 v;
+    v.i = i;
+    return v.f;
+}
+
+/**
+ * Reinterpret a double as a 64-bit integer.
+ */
+static av_always_inline uint64_t av_double2int(double f)
+{
+    union av_intfloat64 v;
+    v.f = f;
+    return v.i;
+}
+
+#endif /* AVUTIL_INTFLOAT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h
new file mode 100644
index 000000000..f093b92cd
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h
@@ -0,0 +1,40 @@
+/*
+ * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTFLOAT_READWRITE_H
+#define AVUTIL_INTFLOAT_READWRITE_H
+
+#include <stdint.h>
+#include "attributes.h"
+
+/* IEEE 80 bits extended float */
+typedef struct AVExtFloat  {
+    uint8_t exponent[2];
+    uint8_t mantissa[8];
+} AVExtFloat;
+
+attribute_deprecated double av_int2dbl(int64_t v) av_const;
+attribute_deprecated float av_int2flt(int32_t v) av_const;
+attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
+attribute_deprecated int64_t av_dbl2int(double d) av_const;
+attribute_deprecated int32_t av_flt2int(float d) av_const;
+attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
+
+#endif /* AVUTIL_INTFLOAT_READWRITE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intreadwrite.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intreadwrite.h
new file mode 100644
index 000000000..f77fd60f3
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intreadwrite.h
@@ -0,0 +1,549 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTREADWRITE_H
+#define AVUTIL_INTREADWRITE_H
+
+#include <stdint.h>
+#include "libavutil/avconfig.h"
+#include "attributes.h"
+#include "bswap.h"
+
+typedef union {
+    uint64_t u64;
+    uint32_t u32[2];
+    uint16_t u16[4];
+    uint8_t  u8 [8];
+    double   f64;
+    float    f32[2];
+} av_alias av_alias64;
+
+typedef union {
+    uint32_t u32;
+    uint16_t u16[2];
+    uint8_t  u8 [4];
+    float    f32;
+} av_alias av_alias32;
+
+typedef union {
+    uint16_t u16;
+    uint8_t  u8 [2];
+} av_alias av_alias16;
+
+/*
+ * Arch-specific headers can provide any combination of
+ * AV_[RW][BLN](16|24|32|64) and AV_(COPY|SWAP|ZERO)(64|128) macros.
+ * Preprocessor symbols must be defined, even if these are implemented
+ * as inline functions.
+ */
+
+#ifdef HAVE_AV_CONFIG_H
+
+#include "config.h"
+
+#if   ARCH_ARM
+#   include "arm/intreadwrite.h"
+#elif ARCH_AVR32
+#   include "avr32/intreadwrite.h"
+#elif ARCH_MIPS
+#   include "mips/intreadwrite.h"
+#elif ARCH_PPC
+#   include "ppc/intreadwrite.h"
+#elif ARCH_TOMI
+#   include "tomi/intreadwrite.h"
+#elif ARCH_X86
+#   include "x86/intreadwrite.h"
+#endif
+
+#endif /* HAVE_AV_CONFIG_H */
+
+/*
+ * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers.
+ */
+
+#if AV_HAVE_BIGENDIAN
+
+#   if    defined(AV_RN16) && !defined(AV_RB16)
+#       define AV_RB16(p) AV_RN16(p)
+#   elif !defined(AV_RN16) &&  defined(AV_RB16)
+#       define AV_RN16(p) AV_RB16(p)
+#   endif
+
+#   if    defined(AV_WN16) && !defined(AV_WB16)
+#       define AV_WB16(p, v) AV_WN16(p, v)
+#   elif !defined(AV_WN16) &&  defined(AV_WB16)
+#       define AV_WN16(p, v) AV_WB16(p, v)
+#   endif
+
+#   if    defined(AV_RN24) && !defined(AV_RB24)
+#       define AV_RB24(p) AV_RN24(p)
+#   elif !defined(AV_RN24) &&  defined(AV_RB24)
+#       define AV_RN24(p) AV_RB24(p)
+#   endif
+
+#   if    defined(AV_WN24) && !defined(AV_WB24)
+#       define AV_WB24(p, v) AV_WN24(p, v)
+#   elif !defined(AV_WN24) &&  defined(AV_WB24)
+#       define AV_WN24(p, v) AV_WB24(p, v)
+#   endif
+
+#   if    defined(AV_RN32) && !defined(AV_RB32)
+#       define AV_RB32(p) AV_RN32(p)
+#   elif !defined(AV_RN32) &&  defined(AV_RB32)
+#       define AV_RN32(p) AV_RB32(p)
+#   endif
+
+#   if    defined(AV_WN32) && !defined(AV_WB32)
+#       define AV_WB32(p, v) AV_WN32(p, v)
+#   elif !defined(AV_WN32) &&  defined(AV_WB32)
+#       define AV_WN32(p, v) AV_WB32(p, v)
+#   endif
+
+#   if    defined(AV_RN64) && !defined(AV_RB64)
+#       define AV_RB64(p) AV_RN64(p)
+#   elif !defined(AV_RN64) &&  defined(AV_RB64)
+#       define AV_RN64(p) AV_RB64(p)
+#   endif
+
+#   if    defined(AV_WN64) && !defined(AV_WB64)
+#       define AV_WB64(p, v) AV_WN64(p, v)
+#   elif !defined(AV_WN64) &&  defined(AV_WB64)
+#       define AV_WN64(p, v) AV_WB64(p, v)
+#   endif
+
+#else /* AV_HAVE_BIGENDIAN */
+
+#   if    defined(AV_RN16) && !defined(AV_RL16)
+#       define AV_RL16(p) AV_RN16(p)
+#   elif !defined(AV_RN16) &&  defined(AV_RL16)
+#       define AV_RN16(p) AV_RL16(p)
+#   endif
+
+#   if    defined(AV_WN16) && !defined(AV_WL16)
+#       define AV_WL16(p, v) AV_WN16(p, v)
+#   elif !defined(AV_WN16) &&  defined(AV_WL16)
+#       define AV_WN16(p, v) AV_WL16(p, v)
+#   endif
+
+#   if    defined(AV_RN24) && !defined(AV_RL24)
+#       define AV_RL24(p) AV_RN24(p)
+#   elif !defined(AV_RN24) &&  defined(AV_RL24)
+#       define AV_RN24(p) AV_RL24(p)
+#   endif
+
+#   if    defined(AV_WN24) && !defined(AV_WL24)
+#       define AV_WL24(p, v) AV_WN24(p, v)
+#   elif !defined(AV_WN24) &&  defined(AV_WL24)
+#       define AV_WN24(p, v) AV_WL24(p, v)
+#   endif
+
+#   if    defined(AV_RN32) && !defined(AV_RL32)
+#       define AV_RL32(p) AV_RN32(p)
+#   elif !defined(AV_RN32) &&  defined(AV_RL32)
+#       define AV_RN32(p) AV_RL32(p)
+#   endif
+
+#   if    defined(AV_WN32) && !defined(AV_WL32)
+#       define AV_WL32(p, v) AV_WN32(p, v)
+#   elif !defined(AV_WN32) &&  defined(AV_WL32)
+#       define AV_WN32(p, v) AV_WL32(p, v)
+#   endif
+
+#   if    defined(AV_RN64) && !defined(AV_RL64)
+#       define AV_RL64(p) AV_RN64(p)
+#   elif !defined(AV_RN64) &&  defined(AV_RL64)
+#       define AV_RN64(p) AV_RL64(p)
+#   endif
+
+#   if    defined(AV_WN64) && !defined(AV_WL64)
+#       define AV_WL64(p, v) AV_WN64(p, v)
+#   elif !defined(AV_WN64) &&  defined(AV_WL64)
+#       define AV_WN64(p, v) AV_WL64(p, v)
+#   endif
+
+#endif /* !AV_HAVE_BIGENDIAN */
+
+/*
+ * Define AV_[RW]N helper macros to simplify definitions not provided
+ * by per-arch headers.
+ */
+
+#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
+
+union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
+union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
+union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
+
+#   define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
+#   define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
+
+#elif defined(__DECC)
+
+#   define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
+#   define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
+
+#elif AV_HAVE_FAST_UNALIGNED
+
+#   define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
+#   define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v))
+
+#else
+
+#ifndef AV_RB16
+#   define AV_RB16(x)                           \
+    ((((const uint8_t*)(x))[0] << 8) |          \
+      ((const uint8_t*)(x))[1])
+#endif
+#ifndef AV_WB16
+#   define AV_WB16(p, d) do {                   \
+        ((uint8_t*)(p))[1] = (d);               \
+        ((uint8_t*)(p))[0] = (d)>>8;            \
+    } while(0)
+#endif
+
+#ifndef AV_RL16
+#   define AV_RL16(x)                           \
+    ((((const uint8_t*)(x))[1] << 8) |          \
+      ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL16
+#   define AV_WL16(p, d) do {                   \
+        ((uint8_t*)(p))[0] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+    } while(0)
+#endif
+
+#ifndef AV_RB32
+#   define AV_RB32(x)                                \
+    (((uint32_t)((const uint8_t*)(x))[0] << 24) |    \
+               (((const uint8_t*)(x))[1] << 16) |    \
+               (((const uint8_t*)(x))[2] <<  8) |    \
+                ((const uint8_t*)(x))[3])
+#endif
+#ifndef AV_WB32
+#   define AV_WB32(p, d) do {                   \
+        ((uint8_t*)(p))[3] = (d);               \
+        ((uint8_t*)(p))[2] = (d)>>8;            \
+        ((uint8_t*)(p))[1] = (d)>>16;           \
+        ((uint8_t*)(p))[0] = (d)>>24;           \
+    } while(0)
+#endif
+
+#ifndef AV_RL32
+#   define AV_RL32(x)                                \
+    (((uint32_t)((const uint8_t*)(x))[3] << 24) |    \
+               (((const uint8_t*)(x))[2] << 16) |    \
+               (((const uint8_t*)(x))[1] <<  8) |    \
+                ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL32
+#   define AV_WL32(p, d) do {                   \
+        ((uint8_t*)(p))[0] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+        ((uint8_t*)(p))[2] = (d)>>16;           \
+        ((uint8_t*)(p))[3] = (d)>>24;           \
+    } while(0)
+#endif
+
+#ifndef AV_RB64
+#   define AV_RB64(x)                                   \
+    (((uint64_t)((const uint8_t*)(x))[0] << 56) |       \
+     ((uint64_t)((const uint8_t*)(x))[1] << 48) |       \
+     ((uint64_t)((const uint8_t*)(x))[2] << 40) |       \
+     ((uint64_t)((const uint8_t*)(x))[3] << 32) |       \
+     ((uint64_t)((const uint8_t*)(x))[4] << 24) |       \
+     ((uint64_t)((const uint8_t*)(x))[5] << 16) |       \
+     ((uint64_t)((const uint8_t*)(x))[6] <<  8) |       \
+      (uint64_t)((const uint8_t*)(x))[7])
+#endif
+#ifndef AV_WB64
+#   define AV_WB64(p, d) do {                   \
+        ((uint8_t*)(p))[7] = (d);               \
+        ((uint8_t*)(p))[6] = (d)>>8;            \
+        ((uint8_t*)(p))[5] = (d)>>16;           \
+        ((uint8_t*)(p))[4] = (d)>>24;           \
+        ((uint8_t*)(p))[3] = (d)>>32;           \
+        ((uint8_t*)(p))[2] = (d)>>40;           \
+        ((uint8_t*)(p))[1] = (d)>>48;           \
+        ((uint8_t*)(p))[0] = (d)>>56;           \
+    } while(0)
+#endif
+
+#ifndef AV_RL64
+#   define AV_RL64(x)                                   \
+    (((uint64_t)((const uint8_t*)(x))[7] << 56) |       \
+     ((uint64_t)((const uint8_t*)(x))[6] << 48) |       \
+     ((uint64_t)((const uint8_t*)(x))[5] << 40) |       \
+     ((uint64_t)((const uint8_t*)(x))[4] << 32) |       \
+     ((uint64_t)((const uint8_t*)(x))[3] << 24) |       \
+     ((uint64_t)((const uint8_t*)(x))[2] << 16) |       \
+     ((uint64_t)((const uint8_t*)(x))[1] <<  8) |       \
+      (uint64_t)((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL64
+#   define AV_WL64(p, d) do {                   \
+        ((uint8_t*)(p))[0] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+        ((uint8_t*)(p))[2] = (d)>>16;           \
+        ((uint8_t*)(p))[3] = (d)>>24;           \
+        ((uint8_t*)(p))[4] = (d)>>32;           \
+        ((uint8_t*)(p))[5] = (d)>>40;           \
+        ((uint8_t*)(p))[6] = (d)>>48;           \
+        ((uint8_t*)(p))[7] = (d)>>56;           \
+    } while(0)
+#endif
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_RN(s, p)    AV_RB##s(p)
+#   define AV_WN(s, p, v) AV_WB##s(p, v)
+#else
+#   define AV_RN(s, p)    AV_RL##s(p)
+#   define AV_WN(s, p, v) AV_WL##s(p, v)
+#endif
+
+#endif /* HAVE_FAST_UNALIGNED */
+
+#ifndef AV_RN16
+#   define AV_RN16(p) AV_RN(16, p)
+#endif
+
+#ifndef AV_RN32
+#   define AV_RN32(p) AV_RN(32, p)
+#endif
+
+#ifndef AV_RN64
+#   define AV_RN64(p) AV_RN(64, p)
+#endif
+
+#ifndef AV_WN16
+#   define AV_WN16(p, v) AV_WN(16, p, v)
+#endif
+
+#ifndef AV_WN32
+#   define AV_WN32(p, v) AV_WN(32, p, v)
+#endif
+
+#ifndef AV_WN64
+#   define AV_WN64(p, v) AV_WN(64, p, v)
+#endif
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_RB(s, p)    AV_RN##s(p)
+#   define AV_WB(s, p, v) AV_WN##s(p, v)
+#   define AV_RL(s, p)    av_bswap##s(AV_RN##s(p))
+#   define AV_WL(s, p, v) AV_WN##s(p, av_bswap##s(v))
+#else
+#   define AV_RB(s, p)    av_bswap##s(AV_RN##s(p))
+#   define AV_WB(s, p, v) AV_WN##s(p, av_bswap##s(v))
+#   define AV_RL(s, p)    AV_RN##s(p)
+#   define AV_WL(s, p, v) AV_WN##s(p, v)
+#endif
+
+#define AV_RB8(x)     (((const uint8_t*)(x))[0])
+#define AV_WB8(p, d)  do { ((uint8_t*)(p))[0] = (d); } while(0)
+
+#define AV_RL8(x)     AV_RB8(x)
+#define AV_WL8(p, d)  AV_WB8(p, d)
+
+#ifndef AV_RB16
+#   define AV_RB16(p)    AV_RB(16, p)
+#endif
+#ifndef AV_WB16
+#   define AV_WB16(p, v) AV_WB(16, p, v)
+#endif
+
+#ifndef AV_RL16
+#   define AV_RL16(p)    AV_RL(16, p)
+#endif
+#ifndef AV_WL16
+#   define AV_WL16(p, v) AV_WL(16, p, v)
+#endif
+
+#ifndef AV_RB32
+#   define AV_RB32(p)    AV_RB(32, p)
+#endif
+#ifndef AV_WB32
+#   define AV_WB32(p, v) AV_WB(32, p, v)
+#endif
+
+#ifndef AV_RL32
+#   define AV_RL32(p)    AV_RL(32, p)
+#endif
+#ifndef AV_WL32
+#   define AV_WL32(p, v) AV_WL(32, p, v)
+#endif
+
+#ifndef AV_RB64
+#   define AV_RB64(p)    AV_RB(64, p)
+#endif
+#ifndef AV_WB64
+#   define AV_WB64(p, v) AV_WB(64, p, v)
+#endif
+
+#ifndef AV_RL64
+#   define AV_RL64(p)    AV_RL(64, p)
+#endif
+#ifndef AV_WL64
+#   define AV_WL64(p, v) AV_WL(64, p, v)
+#endif
+
+#ifndef AV_RB24
+#   define AV_RB24(x)                           \
+    ((((const uint8_t*)(x))[0] << 16) |         \
+     (((const uint8_t*)(x))[1] <<  8) |         \
+      ((const uint8_t*)(x))[2])
+#endif
+#ifndef AV_WB24
+#   define AV_WB24(p, d) do {                   \
+        ((uint8_t*)(p))[2] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+        ((uint8_t*)(p))[0] = (d)>>16;           \
+    } while(0)
+#endif
+
+#ifndef AV_RL24
+#   define AV_RL24(x)                           \
+    ((((const uint8_t*)(x))[2] << 16) |         \
+     (((const uint8_t*)(x))[1] <<  8) |         \
+      ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL24
+#   define AV_WL24(p, d) do {                   \
+        ((uint8_t*)(p))[0] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+        ((uint8_t*)(p))[2] = (d)>>16;           \
+    } while(0)
+#endif
+
+/*
+ * The AV_[RW]NA macros access naturally aligned data
+ * in a type-safe way.
+ */
+
+#define AV_RNA(s, p)    (((const av_alias##s*)(p))->u##s)
+#define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v))
+
+#ifndef AV_RN16A
+#   define AV_RN16A(p) AV_RNA(16, p)
+#endif
+
+#ifndef AV_RN32A
+#   define AV_RN32A(p) AV_RNA(32, p)
+#endif
+
+#ifndef AV_RN64A
+#   define AV_RN64A(p) AV_RNA(64, p)
+#endif
+
+#ifndef AV_WN16A
+#   define AV_WN16A(p, v) AV_WNA(16, p, v)
+#endif
+
+#ifndef AV_WN32A
+#   define AV_WN32A(p, v) AV_WNA(32, p, v)
+#endif
+
+#ifndef AV_WN64A
+#   define AV_WN64A(p, v) AV_WNA(64, p, v)
+#endif
+
+/*
+ * The AV_COPYxxU macros are suitable for copying data to/from unaligned
+ * memory locations.
+ */
+
+#define AV_COPYU(n, d, s) AV_WN##n(d, AV_RN##n(s));
+
+#ifndef AV_COPY16U
+#   define AV_COPY16U(d, s) AV_COPYU(16, d, s)
+#endif
+
+#ifndef AV_COPY32U
+#   define AV_COPY32U(d, s) AV_COPYU(32, d, s)
+#endif
+
+#ifndef AV_COPY64U
+#   define AV_COPY64U(d, s) AV_COPYU(64, d, s)
+#endif
+
+#ifndef AV_COPY128U
+#   define AV_COPY128U(d, s)                                    \
+    do {                                                        \
+        AV_COPY64U(d, s);                                       \
+        AV_COPY64U((char *)(d) + 8, (const char *)(s) + 8);     \
+    } while(0)
+#endif
+
+/* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be
+ * naturally aligned. They may be implemented using MMX,
+ * so emms_c() must be called before using any float code
+ * afterwards.
+ */
+
+#define AV_COPY(n, d, s) \
+    (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n)
+
+#ifndef AV_COPY16
+#   define AV_COPY16(d, s) AV_COPY(16, d, s)
+#endif
+
+#ifndef AV_COPY32
+#   define AV_COPY32(d, s) AV_COPY(32, d, s)
+#endif
+
+#ifndef AV_COPY64
+#   define AV_COPY64(d, s) AV_COPY(64, d, s)
+#endif
+
+#ifndef AV_COPY128
+#   define AV_COPY128(d, s)                    \
+    do {                                       \
+        AV_COPY64(d, s);                       \
+        AV_COPY64((char*)(d)+8, (char*)(s)+8); \
+    } while(0)
+#endif
+
+#define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b))
+
+#ifndef AV_SWAP64
+#   define AV_SWAP64(a, b) AV_SWAP(64, a, b)
+#endif
+
+#define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0)
+
+#ifndef AV_ZERO16
+#   define AV_ZERO16(d) AV_ZERO(16, d)
+#endif
+
+#ifndef AV_ZERO32
+#   define AV_ZERO32(d) AV_ZERO(32, d)
+#endif
+
+#ifndef AV_ZERO64
+#   define AV_ZERO64(d) AV_ZERO(64, d)
+#endif
+
+#ifndef AV_ZERO128
+#   define AV_ZERO128(d)         \
+    do {                         \
+        AV_ZERO64(d);            \
+        AV_ZERO64((char*)(d)+8); \
+    } while(0)
+#endif
+
+#endif /* AVUTIL_INTREADWRITE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h
new file mode 100644
index 000000000..5e526c1da
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h
@@ -0,0 +1,62 @@
+/*
+ * Lagged Fibonacci PRNG
+ * Copyright (c) 2008 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LFG_H
+#define AVUTIL_LFG_H
+
+typedef struct AVLFG {
+    unsigned int state[64];
+    int index;
+} AVLFG;
+
+void av_lfg_init(AVLFG *c, unsigned int seed);
+
+/**
+ * Get the next random unsigned 32-bit number using an ALFG.
+ *
+ * Please also consider a simple LCG like state= state*1664525+1013904223,
+ * it may be good enough and faster for your specific use case.
+ */
+static inline unsigned int av_lfg_get(AVLFG *c){
+    c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
+    return c->state[c->index++ & 63];
+}
+
+/**
+ * Get the next random unsigned 32-bit number using a MLFG.
+ *
+ * Please also consider av_lfg_get() above, it is faster.
+ */
+static inline unsigned int av_mlfg_get(AVLFG *c){
+    unsigned int a= c->state[(c->index-55) & 63];
+    unsigned int b= c->state[(c->index-24) & 63];
+    return c->state[c->index++ & 63] = 2*a*b+a+b;
+}
+
+/**
+ * Get the next two numbers generated by a Box-Muller Gaussian
+ * generator using the random numbers issued by lfg.
+ *
+ * @param out array where the two generated numbers are placed
+ */
+void av_bmg_get(AVLFG *lfg, double out[2]);
+
+#endif /* AVUTIL_LFG_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h
new file mode 100644
index 000000000..7b173302f
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h
@@ -0,0 +1,173 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LOG_H
+#define AVUTIL_LOG_H
+
+#include <stdarg.h>
+#include "avutil.h"
+#include "attributes.h"
+
+/**
+ * Describe the class of an AVClass context structure. That is an
+ * arbitrary struct of which the first field is a pointer to an
+ * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
+ */
+typedef struct AVClass {
+    /**
+     * The name of the class; usually it is the same name as the
+     * context structure type to which the AVClass is associated.
+     */
+    const char* class_name;
+
+    /**
+     * A pointer to a function which returns the name of a context
+     * instance ctx associated with the class.
+     */
+    const char* (*item_name)(void* ctx);
+
+    /**
+     * a pointer to the first option specified in the class if any or NULL
+     *
+     * @see av_set_default_options()
+     */
+    const struct AVOption *option;
+
+    /**
+     * LIBAVUTIL_VERSION with which this structure was created.
+     * This is used to allow fields to be added without requiring major
+     * version bumps everywhere.
+     */
+
+    int version;
+
+    /**
+     * Offset in the structure where log_level_offset is stored.
+     * 0 means there is no such variable
+     */
+    int log_level_offset_offset;
+
+    /**
+     * Offset in the structure where a pointer to the parent context for
+     * logging is stored. For example a decoder could pass its AVCodecContext
+     * to eval as such a parent context, which an av_log() implementation
+     * could then leverage to display the parent context.
+     * The offset can be NULL.
+     */
+    int parent_log_context_offset;
+
+    /**
+     * Return next AVOptions-enabled child or NULL
+     */
+    void* (*child_next)(void *obj, void *prev);
+
+    /**
+     * Return an AVClass corresponding to the next potential
+     * AVOptions-enabled child.
+     *
+     * The difference between child_next and this is that
+     * child_next iterates over _already existing_ objects, while
+     * child_class_next iterates over _all possible_ children.
+     */
+    const struct AVClass* (*child_class_next)(const struct AVClass *prev);
+} AVClass;
+
+/* av_log API */
+
+#define AV_LOG_QUIET    -8
+
+/**
+ * Something went really wrong and we will crash now.
+ */
+#define AV_LOG_PANIC     0
+
+/**
+ * Something went wrong and recovery is not possible.
+ * For example, no header was found for a format which depends
+ * on headers or an illegal combination of parameters is used.
+ */
+#define AV_LOG_FATAL     8
+
+/**
+ * Something went wrong and cannot losslessly be recovered.
+ * However, not all future data is affected.
+ */
+#define AV_LOG_ERROR    16
+
+/**
+ * Something somehow does not look correct. This may or may not
+ * lead to problems. An example would be the use of '-vstrict -2'.
+ */
+#define AV_LOG_WARNING  24
+
+#define AV_LOG_INFO     32
+#define AV_LOG_VERBOSE  40
+
+/**
+ * Stuff which is only useful for libav* developers.
+ */
+#define AV_LOG_DEBUG    48
+
+/**
+ * Send the specified message to the log if the level is less than or equal
+ * to the current av_log_level. By default, all logging messages are sent to
+ * stderr. This behavior can be altered by setting a different av_vlog callback
+ * function.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param fmt The format string (printf-compatible) that specifies how
+ * subsequent arguments are converted to output.
+ * @see av_vlog
+ */
+void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
+
+void av_vlog(void *avcl, int level, const char *fmt, va_list);
+int av_log_get_level(void);
+void av_log_set_level(int);
+void av_log_set_callback(void (*)(void*, int, const char*, va_list));
+void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
+const char* av_default_item_name(void* ctx);
+
+/**
+ * av_dlog macros
+ * Useful to print debug messages that shouldn't get compiled in normally.
+ */
+
+#ifdef DEBUG
+#    define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
+#else
+#    define av_dlog(pctx, ...)
+#endif
+
+/**
+ * Skip repeated messages, this requires the user app to use av_log() instead of
+ * (f)printf as the 2 would otherwise interfere and lead to
+ * "Last message repeated x times" messages below (f)printf messages with some
+ * bad luck.
+ * Also to receive the last, "last repeated" line if any, the user app must
+ * call av_log(NULL, AV_LOG_QUIET, ""); at the end
+ */
+#define AV_LOG_SKIP_REPEATED 1
+void av_log_set_flags(int arg);
+
+#endif /* AVUTIL_LOG_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h
new file mode 100644
index 000000000..9d7e8f1dc
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h
@@ -0,0 +1,66 @@
+/*
+ * LZO 1x decompression
+ * copyright (c) 2006 Reimar Doeffinger
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LZO_H
+#define AVUTIL_LZO_H
+
+/**
+ * @defgroup lavu_lzo LZO
+ * @ingroup lavu_crypto
+ *
+ * @{
+ */
+
+#include <stdint.h>
+
+/** @name Error flags returned by av_lzo1x_decode
+ * @{ */
+/// end of the input buffer reached before decoding finished
+#define AV_LZO_INPUT_DEPLETED  1
+/// decoded data did not fit into output buffer
+#define AV_LZO_OUTPUT_FULL     2
+/// a reference to previously decoded data was wrong
+#define AV_LZO_INVALID_BACKPTR 4
+/// a non-specific error in the compressed bitstream
+#define AV_LZO_ERROR           8
+/** @} */
+
+#define AV_LZO_INPUT_PADDING   8
+#define AV_LZO_OUTPUT_PADDING 12
+
+/**
+ * @brief Decodes LZO 1x compressed data.
+ * @param out output buffer
+ * @param outlen size of output buffer, number of bytes left are returned here
+ * @param in input buffer
+ * @param inlen size of input buffer, number of bytes left are returned here
+ * @return 0 on success, otherwise a combination of the error flags above
+ *
+ * Make sure all buffers are appropriately padded, in must provide
+ * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
+ */
+int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_LZO_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mathematics.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mathematics.h
new file mode 100644
index 000000000..043dd0faf
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mathematics.h
@@ -0,0 +1,111 @@
+/*
+ * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_MATHEMATICS_H
+#define AVUTIL_MATHEMATICS_H
+
+#include <stdint.h>
+#include <math.h>
+#include "attributes.h"
+#include "rational.h"
+#include "intfloat.h"
+
+#ifndef M_LOG2_10
+#define M_LOG2_10      3.32192809488736234787  /* log_2 10 */
+#endif
+#ifndef M_PHI
+#define M_PHI          1.61803398874989484820   /* phi / golden ratio */
+#endif
+#ifndef NAN
+#define NAN            av_int2float(0x7fc00000)
+#endif
+#ifndef INFINITY
+#define INFINITY       av_int2float(0x7f800000)
+#endif
+
+/**
+ * @addtogroup lavu_math
+ * @{
+ */
+
+
+enum AVRounding {
+    AV_ROUND_ZERO     = 0, ///< Round toward zero.
+    AV_ROUND_INF      = 1, ///< Round away from zero.
+    AV_ROUND_DOWN     = 2, ///< Round toward -infinity.
+    AV_ROUND_UP       = 3, ///< Round toward +infinity.
+    AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
+};
+
+/**
+ * Return the greatest common divisor of a and b.
+ * If both a and b are 0 or either or both are <0 then behavior is
+ * undefined.
+ */
+int64_t av_const av_gcd(int64_t a, int64_t b);
+
+/**
+ * Rescale a 64-bit integer with rounding to nearest.
+ * A simple a*b/c isn't possible as it can overflow.
+ */
+int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
+
+/**
+ * Rescale a 64-bit integer with specified rounding.
+ * A simple a*b/c isn't possible as it can overflow.
+ */
+int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
+
+/**
+ * Rescale a 64-bit integer by 2 rational numbers.
+ */
+int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
+
+/**
+ * Rescale a 64-bit integer by 2 rational numbers with specified rounding.
+ */
+int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
+                         enum AVRounding) av_const;
+
+/**
+ * Compare 2 timestamps each in its own timebases.
+ * The result of the function is undefined if one of the timestamps
+ * is outside the int64_t range when represented in the others timebase.
+ * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
+ */
+int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
+
+/**
+ * Compare 2 integers modulo mod.
+ * That is we compare integers a and b for which only the least
+ * significant log2(mod) bits are known.
+ *
+ * @param mod must be a power of 2
+ * @return a negative value if a is smaller than b
+ *         a positive value if a is greater than b
+ *         0                if a equals          b
+ */
+int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MATHEMATICS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/md5.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/md5.h
new file mode 100644
index 000000000..29e4e7c2b
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/md5.h
@@ -0,0 +1,51 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_MD5_H
+#define AVUTIL_MD5_H
+
+#include <stdint.h>
+
+#include "attributes.h"
+#include "version.h"
+
+/**
+ * @defgroup lavu_md5 MD5
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_md5_size;
+#endif
+
+struct AVMD5;
+
+struct AVMD5 *av_md5_alloc(void);
+void av_md5_init(struct AVMD5 *ctx);
+void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
+void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
+void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MD5_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h
new file mode 100644
index 000000000..8a4fcd90a
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h
@@ -0,0 +1,209 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * memory handling functions
+ */
+
+#ifndef AVUTIL_MEM_H
+#define AVUTIL_MEM_H
+
+#include <limits.h>
+#include <stdint.h>
+
+#include "attributes.h"
+#include "avutil.h"
+
+/**
+ * @addtogroup lavu_mem
+ * @{
+ */
+
+
+#if defined(__ICC) && __ICC < 1200 || defined(__SUNPRO_C)
+    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
+    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
+#elif defined(__TI_COMPILER_VERSION__)
+    #define DECLARE_ALIGNED(n,t,v)                      \
+        AV_PRAGMA(DATA_ALIGN(v,n))                      \
+        t __attribute__((aligned(n))) v
+    #define DECLARE_ASM_CONST(n,t,v)                    \
+        AV_PRAGMA(DATA_ALIGN(v,n))                      \
+        static const t __attribute__((aligned(n))) v
+#elif defined(__GNUC__)
+    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t av_used __attribute__ ((aligned (n))) v
+#elif defined(_MSC_VER)
+    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
+    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
+#else
+    #define DECLARE_ALIGNED(n,t,v)      t v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+    #define av_malloc_attrib __attribute__((__malloc__))
+#else
+    #define av_malloc_attrib
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,3)
+    #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
+#else
+    #define av_alloc_size(...)
+#endif
+
+/**
+ * Allocate a block of size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU).
+ * @param size Size in bytes for the memory block to be allocated.
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_mallocz()
+ */
+void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
+
+/**
+ * Helper function to allocate a block of size * nmemb bytes with
+ * using av_malloc()
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_malloc()
+ */
+av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
+{
+    if (size <= 0 || nmemb >= INT_MAX / size)
+        return NULL;
+    return av_malloc(nmemb * size);
+}
+
+/**
+ * Allocate or reallocate a block of memory.
+ * If ptr is NULL and size > 0, allocate a new block. If
+ * size is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a memory block already allocated with
+ * av_malloc(z)() or av_realloc() or NULL.
+ * @param size Size in bytes for the memory block to be allocated or
+ * reallocated.
+ * @return Pointer to a newly reallocated block or NULL if the block
+ * cannot be reallocated or the function is used to free the memory block.
+ * @see av_fast_realloc()
+ */
+void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
+
+/**
+ * Allocate or reallocate an array.
+ * If ptr is NULL and nmemb > 0, allocate a new block. If
+ * nmemb is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a memory block already allocated with
+ * av_malloc(z)() or av_realloc() or NULL.
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to a newly reallocated block or NULL if the block
+ * cannot be reallocated or the function is used to free the memory block.
+ */
+av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size);
+
+/**
+ * Allocate or reallocate an array.
+ * If *ptr is NULL and nmemb > 0, allocate a new block. If
+ * nmemb is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a pointer to a memory block already allocated
+ * with av_malloc(z)() or av_realloc(), or pointer to a pointer to NULL.
+ * The pointer is updated on success, or freed on failure.
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Zero on success, an AVERROR error code on failure.
+ */
+av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
+
+/**
+ * Free a memory block which has been allocated with av_malloc(z)() or
+ * av_realloc().
+ * @param ptr Pointer to the memory block which should be freed.
+ * @note ptr = NULL is explicitly allowed.
+ * @note It is recommended that you use av_freep() instead.
+ * @see av_freep()
+ */
+void av_free(void *ptr);
+
+/**
+ * Allocate a block of size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU) and
+ * zero all the bytes of the block.
+ * @param size Size in bytes for the memory block to be allocated.
+ * @return Pointer to the allocated block, NULL if it cannot be allocated.
+ * @see av_malloc()
+ */
+void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
+
+/**
+ * Helper function to allocate a block of size * nmemb bytes with
+ * using av_mallocz()
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_mallocz()
+ * @see av_malloc_array()
+ */
+av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
+{
+    if (size <= 0 || nmemb >= INT_MAX / size)
+        return NULL;
+    return av_mallocz(nmemb * size);
+}
+
+/**
+ * Duplicate the string s.
+ * @param s string to be duplicated
+ * @return Pointer to a newly allocated string containing a
+ * copy of s or NULL if the string cannot be allocated.
+ */
+char *av_strdup(const char *s) av_malloc_attrib;
+
+/**
+ * Free a memory block which has been allocated with av_malloc(z)() or
+ * av_realloc() and set the pointer pointing to it to NULL.
+ * @param ptr Pointer to the pointer to the memory block which should
+ * be freed.
+ * @see av_free()
+ */
+void av_freep(void *ptr);
+
+/**
+ * @brief deliberately overlapping memcpy implementation
+ * @param dst destination buffer
+ * @param back how many bytes back we start (the initial size of the overlapping window)
+ * @param cnt number of bytes to copy, must be >= 0
+ *
+ * cnt > back is valid, this will copy the bytes we just copied,
+ * thus creating a repeating pattern with a period length of back.
+ */
+void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MEM_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h
new file mode 100644
index 000000000..a0ae06b89
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h
@@ -0,0 +1,132 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_OLD_PIX_FMTS_H
+#define AVUTIL_OLD_PIX_FMTS_H
+
+/*
+ * This header exists to prevent new pixel formats from being accidentally added
+ * to the deprecated list.
+ * Do not include it directly. It will be removed on next major bump
+ *
+ * Do not add new items to this list. Use the AVPixelFormat enum instead.
+ */
+    PIX_FMT_NONE = AV_PIX_FMT_NONE,
+    PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+    PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+    PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+    PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+    PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+    PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+    PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+    PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
+    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
+    PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+    PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+    PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+    PIX_FMT_XVMC_MPEG2_IDCT,
+    PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+    PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+    PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
+    PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
+    PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
+    PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
+    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
+
+    PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+    PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+    PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+    PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
+    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
+    PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+    PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+    PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+#if FF_API_VDPAU
+    PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+    PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+    PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+
+    PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
+    PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
+    PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+    PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+    PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
+    PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
+    PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+    PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+    PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+    PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+    PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+    PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+#if FF_API_VDPAU
+    PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+    PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+
+    PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+    PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+    PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+    PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+    PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
+    PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+    PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+    PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
+    PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
+    PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big endian
+    PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little endian
+    PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big endian
+    PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little endian
+    PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big endian
+    PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
+    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+
+#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/opt.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/opt.h
new file mode 100644
index 000000000..0181379b7
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/opt.h
@@ -0,0 +1,516 @@
+/*
+ * AVOptions
+ * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_OPT_H
+#define AVUTIL_OPT_H
+
+/**
+ * @file
+ * AVOptions
+ */
+
+#include "rational.h"
+#include "avutil.h"
+#include "dict.h"
+#include "log.h"
+
+/**
+ * @defgroup avoptions AVOptions
+ * @ingroup lavu_data
+ * @{
+ * AVOptions provide a generic system to declare options on arbitrary structs
+ * ("objects"). An option can have a help text, a type and a range of possible
+ * values. Options may then be enumerated, read and written to.
+ *
+ * @section avoptions_implement Implementing AVOptions
+ * This section describes how to add AVOptions capabilities to a struct.
+ *
+ * All AVOptions-related information is stored in an AVClass. Therefore
+ * the first member of the struct must be a pointer to an AVClass describing it.
+ * The option field of the AVClass must be set to a NULL-terminated static array
+ * of AVOptions. Each AVOption must have a non-empty name, a type, a default
+ * value and for number-type AVOptions also a range of allowed values. It must
+ * also declare an offset in bytes from the start of the struct, where the field
+ * associated with this AVOption is located. Other fields in the AVOption struct
+ * should also be set when applicable, but are not required.
+ *
+ * The following example illustrates an AVOptions-enabled struct:
+ * @code
+ * typedef struct test_struct {
+ *     AVClass *class;
+ *     int      int_opt;
+ *     char    *str_opt;
+ *     uint8_t *bin_opt;
+ *     int      bin_len;
+ * } test_struct;
+ *
+ * static const AVOption test_options[] = {
+ *   { "test_int", "This is a test option of int type.", offsetof(test_struct, int_opt),
+ *     AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX },
+ *   { "test_str", "This is a test option of string type.", offsetof(test_struct, str_opt),
+ *     AV_OPT_TYPE_STRING },
+ *   { "test_bin", "This is a test option of binary type.", offsetof(test_struct, bin_opt),
+ *     AV_OPT_TYPE_BINARY },
+ *   { NULL },
+ * };
+ *
+ * static const AVClass test_class = {
+ *     .class_name = "test class",
+ *     .item_name  = av_default_item_name,
+ *     .option     = test_options,
+ *     .version    = LIBAVUTIL_VERSION_INT,
+ * };
+ * @endcode
+ *
+ * Next, when allocating your struct, you must ensure that the AVClass pointer
+ * is set to the correct value. Then, av_opt_set_defaults() must be called to
+ * initialize defaults. After that the struct is ready to be used with the
+ * AVOptions API.
+ *
+ * When cleaning up, you may use the av_opt_free() function to automatically
+ * free all the allocated string and binary options.
+ *
+ * Continuing with the above example:
+ *
+ * @code
+ * test_struct *alloc_test_struct(void)
+ * {
+ *     test_struct *ret = av_malloc(sizeof(*ret));
+ *     ret->class = &test_class;
+ *     av_opt_set_defaults(ret);
+ *     return ret;
+ * }
+ * void free_test_struct(test_struct **foo)
+ * {
+ *     av_opt_free(*foo);
+ *     av_freep(foo);
+ * }
+ * @endcode
+ *
+ * @subsection avoptions_implement_nesting Nesting
+ *      It may happen that an AVOptions-enabled struct contains another
+ *      AVOptions-enabled struct as a member (e.g. AVCodecContext in
+ *      libavcodec exports generic options, while its priv_data field exports
+ *      codec-specific options). In such a case, it is possible to set up the
+ *      parent struct to export a child's options. To do that, simply
+ *      implement AVClass.child_next() and AVClass.child_class_next() in the
+ *      parent struct's AVClass.
+ *      Assuming that the test_struct from above now also contains a
+ *      child_struct field:
+ *
+ *      @code
+ *      typedef struct child_struct {
+ *          AVClass *class;
+ *          int flags_opt;
+ *      } child_struct;
+ *      static const AVOption child_opts[] = {
+ *          { "test_flags", "This is a test option of flags type.",
+ *            offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX },
+ *          { NULL },
+ *      };
+ *      static const AVClass child_class = {
+ *          .class_name = "child class",
+ *          .item_name  = av_default_item_name,
+ *          .option     = child_opts,
+ *          .version    = LIBAVUTIL_VERSION_INT,
+ *      };
+ *
+ *      void *child_next(void *obj, void *prev)
+ *      {
+ *          test_struct *t = obj;
+ *          if (!prev && t->child_struct)
+ *              return t->child_struct;
+ *          return NULL
+ *      }
+ *      const AVClass child_class_next(const AVClass *prev)
+ *      {
+ *          return prev ? NULL : &child_class;
+ *      }
+ *      @endcode
+ *      Putting child_next() and child_class_next() as defined above into
+ *      test_class will now make child_struct's options accessible through
+ *      test_struct (again, proper setup as described above needs to be done on
+ *      child_struct right after it is created).
+ *
+ *      From the above example it might not be clear why both child_next()
+ *      and child_class_next() are needed. The distinction is that child_next()
+ *      iterates over actually existing objects, while child_class_next()
+ *      iterates over all possible child classes. E.g. if an AVCodecContext
+ *      was initialized to use a codec which has private options, then its
+ *      child_next() will return AVCodecContext.priv_data and finish
+ *      iterating. OTOH child_class_next() on AVCodecContext.av_class will
+ *      iterate over all available codecs with private options.
+ *
+ * @subsection avoptions_implement_named_constants Named constants
+ *      It is possible to create named constants for options. Simply set the unit
+ *      field of the option the constants should apply to to a string and
+ *      create the constants themselves as options of type AV_OPT_TYPE_CONST
+ *      with their unit field set to the same string.
+ *      Their default_val field should contain the value of the named
+ *      constant.
+ *      For example, to add some named constants for the test_flags option
+ *      above, put the following into the child_opts array:
+ *      @code
+ *      { "test_flags", "This is a test option of flags type.",
+ *        offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX, "test_unit" },
+ *      { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { .i64 = 16 }, 0, 0, "test_unit" },
+ *      @endcode
+ *
+ * @section avoptions_use Using AVOptions
+ * This section deals with accessing options in an AVOptions-enabled struct.
+ * Such structs in Libav are e.g. AVCodecContext in libavcodec or
+ * AVFormatContext in libavformat.
+ *
+ * @subsection avoptions_use_examine Examining AVOptions
+ * The basic functions for examining options are av_opt_next(), which iterates
+ * over all options defined for one object, and av_opt_find(), which searches
+ * for an option with the given name.
+ *
+ * The situation is more complicated with nesting. An AVOptions-enabled struct
+ * may have AVOptions-enabled children. Passing the AV_OPT_SEARCH_CHILDREN flag
+ * to av_opt_find() will make the function search children recursively.
+ *
+ * For enumerating there are basically two cases. The first is when you want to
+ * get all options that may potentially exist on the struct and its children
+ * (e.g.  when constructing documentation). In that case you should call
+ * av_opt_child_class_next() recursively on the parent struct's AVClass.  The
+ * second case is when you have an already initialized struct with all its
+ * children and you want to get all options that can be actually written or read
+ * from it. In that case you should call av_opt_child_next() recursively (and
+ * av_opt_next() on each result).
+ *
+ * @subsection avoptions_use_get_set Reading and writing AVOptions
+ * When setting options, you often have a string read directly from the
+ * user. In such a case, simply passing it to av_opt_set() is enough. For
+ * non-string type options, av_opt_set() will parse the string according to the
+ * option type.
+ *
+ * Similarly av_opt_get() will read any option type and convert it to a string
+ * which will be returned. Do not forget that the string is allocated, so you
+ * have to free it with av_free().
+ *
+ * In some cases it may be more convenient to put all options into an
+ * AVDictionary and call av_opt_set_dict() on it. A specific case of this
+ * are the format/codec open functions in lavf/lavc which take a dictionary
+ * filled with option as a parameter. This allows to set some options
+ * that cannot be set otherwise, since e.g. the input file format is not known
+ * before the file is actually opened.
+ */
+
+enum AVOptionType{
+    AV_OPT_TYPE_FLAGS,
+    AV_OPT_TYPE_INT,
+    AV_OPT_TYPE_INT64,
+    AV_OPT_TYPE_DOUBLE,
+    AV_OPT_TYPE_FLOAT,
+    AV_OPT_TYPE_STRING,
+    AV_OPT_TYPE_RATIONAL,
+    AV_OPT_TYPE_BINARY,  ///< offset must point to a pointer immediately followed by an int for the length
+    AV_OPT_TYPE_CONST = 128,
+};
+
+/**
+ * AVOption
+ */
+typedef struct AVOption {
+    const char *name;
+
+    /**
+     * short English help text
+     * @todo What about other languages?
+     */
+    const char *help;
+
+    /**
+     * The offset relative to the context structure where the option
+     * value is stored. It should be 0 for named constants.
+     */
+    int offset;
+    enum AVOptionType type;
+
+    /**
+     * the default value for scalar options
+     */
+    union {
+        int64_t i64;
+        double dbl;
+        const char *str;
+        /* TODO those are unused now */
+        AVRational q;
+    } default_val;
+    double min;                 ///< minimum valid value for the option
+    double max;                 ///< maximum valid value for the option
+
+    int flags;
+#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
+#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
+#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
+#define AV_OPT_FLAG_AUDIO_PARAM     8
+#define AV_OPT_FLAG_VIDEO_PARAM     16
+#define AV_OPT_FLAG_SUBTITLE_PARAM  32
+//FIXME think about enc-audio, ... style flags
+
+    /**
+     * The logical unit to which the option belongs. Non-constant
+     * options and corresponding named constants share the same
+     * unit. May be NULL.
+     */
+    const char *unit;
+} AVOption;
+
+/**
+ * Show the obj options.
+ *
+ * @param req_flags requested flags for the options to show. Show only the
+ * options for which it is opt->flags & req_flags.
+ * @param rej_flags rejected flags for the options to show. Show only the
+ * options for which it is !(opt->flags & req_flags).
+ * @param av_log_obj log context to use for showing the options
+ */
+int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
+
+/**
+ * Set the values of all AVOption fields to their default values.
+ *
+ * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass)
+ */
+void av_opt_set_defaults(void *s);
+
+/**
+ * Parse the key/value pairs list in opts. For each key/value pair
+ * found, stores the value in the field in ctx that is named like the
+ * key. ctx must be an AVClass context, storing is done using
+ * AVOptions.
+ *
+ * @param key_val_sep a 0-terminated list of characters used to
+ * separate key from value
+ * @param pairs_sep a 0-terminated list of characters used to separate
+ * two pairs from each other
+ * @return the number of successfully set key/value pairs, or a negative
+ * value corresponding to an AVERROR code in case of error:
+ * AVERROR(EINVAL) if opts cannot be parsed,
+ * the error code issued by av_set_string3() if a key/value pair
+ * cannot be set
+ */
+int av_set_options_string(void *ctx, const char *opts,
+                          const char *key_val_sep, const char *pairs_sep);
+
+/**
+ * Free all string and binary options in obj.
+ */
+void av_opt_free(void *obj);
+
+/**
+ * Check whether a particular flag is set in a flags field.
+ *
+ * @param field_name the name of the flag field option
+ * @param flag_name the name of the flag to check
+ * @return non-zero if the flag is set, zero if the flag isn't set,
+ *         isn't of the right type, or the flags field doesn't exist.
+ */
+int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
+
+/*
+ * Set all the options from a given dictionary on an object.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass
+ * @param options options to process. This dictionary will be freed and replaced
+ *                by a new one containing all options not found in obj.
+ *                Of course this new dictionary needs to be freed by caller
+ *                with av_dict_free().
+ *
+ * @return 0 on success, a negative AVERROR if some option was found in obj,
+ *         but could not be set.
+ *
+ * @see av_dict_copy()
+ */
+int av_opt_set_dict(void *obj, struct AVDictionary **options);
+
+/**
+ * @defgroup opt_eval_funcs Evaluating option strings
+ * @{
+ * This group of functions can be used to evaluate option strings
+ * and get numbers out of them. They do the same thing as av_opt_set(),
+ * except the result is written into the caller-supplied pointer.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass.
+ * @param o an option for which the string is to be evaluated.
+ * @param val string to be evaluated.
+ * @param *_out value of the string will be written here.
+ *
+ * @return 0 on success, a negative number on failure.
+ */
+int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int        *flags_out);
+int av_opt_eval_int   (void *obj, const AVOption *o, const char *val, int        *int_out);
+int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t    *int64_out);
+int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float      *float_out);
+int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double     *double_out);
+int av_opt_eval_q     (void *obj, const AVOption *o, const char *val, AVRational *q_out);
+/**
+ * @}
+ */
+
+#define AV_OPT_SEARCH_CHILDREN   0x0001 /**< Search in possible children of the
+                                             given object first. */
+/**
+ *  The obj passed to av_opt_find() is fake -- only a double pointer to AVClass
+ *  instead of a required pointer to a struct containing AVClass. This is
+ *  useful for searching for options without needing to allocate the corresponding
+ *  object.
+ */
+#define AV_OPT_SEARCH_FAKE_OBJ   0x0002
+
+/**
+ * Look for an option in an object. Consider only options which
+ * have all the specified flags set.
+ *
+ * @param[in] obj A pointer to a struct whose first element is a
+ *                pointer to an AVClass.
+ *                Alternatively a double pointer to an AVClass, if
+ *                AV_OPT_SEARCH_FAKE_OBJ search flag is set.
+ * @param[in] name The name of the option to look for.
+ * @param[in] unit When searching for named constants, name of the unit
+ *                 it belongs to.
+ * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
+ * @param search_flags A combination of AV_OPT_SEARCH_*.
+ *
+ * @return A pointer to the option found, or NULL if no option
+ *         was found.
+ *
+ * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable
+ * directly with av_set_string3(). Use special calls which take an options
+ * AVDictionary (e.g. avformat_open_input()) to set options found with this
+ * flag.
+ */
+const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
+                            int opt_flags, int search_flags);
+
+/**
+ * Look for an option in an object. Consider only options which
+ * have all the specified flags set.
+ *
+ * @param[in] obj A pointer to a struct whose first element is a
+ *                pointer to an AVClass.
+ *                Alternatively a double pointer to an AVClass, if
+ *                AV_OPT_SEARCH_FAKE_OBJ search flag is set.
+ * @param[in] name The name of the option to look for.
+ * @param[in] unit When searching for named constants, name of the unit
+ *                 it belongs to.
+ * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
+ * @param search_flags A combination of AV_OPT_SEARCH_*.
+ * @param[out] target_obj if non-NULL, an object to which the option belongs will be
+ * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present
+ * in search_flags. This parameter is ignored if search_flags contain
+ * AV_OPT_SEARCH_FAKE_OBJ.
+ *
+ * @return A pointer to the option found, or NULL if no option
+ *         was found.
+ */
+const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
+                             int opt_flags, int search_flags, void **target_obj);
+
+/**
+ * Iterate over all AVOptions belonging to obj.
+ *
+ * @param obj an AVOptions-enabled struct or a double pointer to an
+ *            AVClass describing it.
+ * @param prev result of the previous call to av_opt_next() on this object
+ *             or NULL
+ * @return next AVOption or NULL
+ */
+const AVOption *av_opt_next(void *obj, const AVOption *prev);
+
+/**
+ * Iterate over AVOptions-enabled children of obj.
+ *
+ * @param prev result of a previous call to this function or NULL
+ * @return next AVOptions-enabled child or NULL
+ */
+void *av_opt_child_next(void *obj, void *prev);
+
+/**
+ * Iterate over potential AVOptions-enabled children of parent.
+ *
+ * @param prev result of a previous call to this function or NULL
+ * @return AVClass corresponding to next potential child or NULL
+ */
+const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
+
+/**
+ * @defgroup opt_set_funcs Option setting functions
+ * @{
+ * Those functions set the field of obj with the given name to value.
+ *
+ * @param[in] obj A struct whose first element is a pointer to an AVClass.
+ * @param[in] name the name of the field to set
+ * @param[in] val The value to set. In case of av_opt_set() if the field is not
+ * of a string type, then the given string is parsed.
+ * SI postfixes and some named scalars are supported.
+ * If the field is of a numeric type, it has to be a numeric or named
+ * scalar. Behavior with more than one scalar and +- infix operators
+ * is undefined.
+ * If the field is of a flags type, it has to be a sequence of numeric
+ * scalars or named flags separated by '+' or '-'. Prefixing a flag
+ * with '+' causes it to be set without affecting the other flags;
+ * similarly, '-' unsets a flag.
+ * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
+ * is passed here, then the option may be set on a child of obj.
+ *
+ * @return 0 if the value has been set, or an AVERROR code in case of
+ * error:
+ * AVERROR_OPTION_NOT_FOUND if no matching option exists
+ * AVERROR(ERANGE) if the value is out of range
+ * AVERROR(EINVAL) if the value is not valid
+ */
+int av_opt_set       (void *obj, const char *name, const char *val, int search_flags);
+int av_opt_set_int   (void *obj, const char *name, int64_t     val, int search_flags);
+int av_opt_set_double(void *obj, const char *name, double      val, int search_flags);
+int av_opt_set_q     (void *obj, const char *name, AVRational  val, int search_flags);
+int av_opt_set_bin   (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
+/**
+ * @}
+ */
+
+/**
+ * @defgroup opt_get_funcs Option getting functions
+ * @{
+ * Those functions get a value of the option with the given name from an object.
+ *
+ * @param[in] obj a struct whose first element is a pointer to an AVClass.
+ * @param[in] name name of the option to get.
+ * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
+ * is passed here, then the option may be found in a child of obj.
+ * @param[out] out_val value of the option will be written here
+ * @return 0 on success, a negative error code otherwise
+ */
+/**
+ * @note the returned string will av_malloc()ed and must be av_free()ed by the caller
+ */
+int av_opt_get       (void *obj, const char *name, int search_flags, uint8_t   **out_val);
+int av_opt_get_int   (void *obj, const char *name, int search_flags, int64_t    *out_val);
+int av_opt_get_double(void *obj, const char *name, int search_flags, double     *out_val);
+int av_opt_get_q     (void *obj, const char *name, int search_flags, AVRational *out_val);
+/**
+ * @}
+ * @}
+ */
+
+#endif /* AVUTIL_OPT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/parseutils.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/parseutils.h
new file mode 100644
index 000000000..0844abb2f
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/parseutils.h
@@ -0,0 +1,124 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PARSEUTILS_H
+#define AVUTIL_PARSEUTILS_H
+
+#include <time.h>
+
+#include "rational.h"
+
+/**
+ * @file
+ * misc parsing utilities
+ */
+
+/**
+ * Parse str and put in width_ptr and height_ptr the detected values.
+ *
+ * @param[in,out] width_ptr pointer to the variable which will contain the detected
+ * width value
+ * @param[in,out] height_ptr pointer to the variable which will contain the detected
+ * height value
+ * @param[in] str the string to parse: it has to be a string in the format
+ * width x height or a valid video size abbreviation.
+ * @return >= 0 on success, a negative error code otherwise
+ */
+int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str);
+
+/**
+ * Parse str and store the detected values in *rate.
+ *
+ * @param[in,out] rate pointer to the AVRational which will contain the detected
+ * frame rate
+ * @param[in] str the string to parse: it has to be a string in the format
+ * rate_num / rate_den, a float number or a valid video rate abbreviation
+ * @return >= 0 on success, a negative error code otherwise
+ */
+int av_parse_video_rate(AVRational *rate, const char *str);
+
+/**
+ * Put the RGBA values that correspond to color_string in rgba_color.
+ *
+ * @param color_string a string specifying a color. It can be the name of
+ * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence,
+ * possibly followed by "@" and a string representing the alpha
+ * component.
+ * The alpha component may be a string composed by "0x" followed by an
+ * hexadecimal number or a decimal number between 0.0 and 1.0, which
+ * represents the opacity value (0x00/0.0 means completely transparent,
+ * 0xff/1.0 completely opaque).
+ * If the alpha component is not specified then 0xff is assumed.
+ * The string "random" will result in a random color.
+ * @param slen length of the initial part of color_string containing the
+ * color. It can be set to -1 if color_string is a null terminated string
+ * containing nothing else than the color.
+ * @return >= 0 in case of success, a negative value in case of
+ * failure (for example if color_string cannot be parsed).
+ */
+int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
+                   void *log_ctx);
+
+/**
+ * Parse timestr and return in *time a corresponding number of
+ * microseconds.
+ *
+ * @param timeval puts here the number of microseconds corresponding
+ * to the string in timestr. If the string represents a duration, it
+ * is the number of microseconds contained in the time interval.  If
+ * the string is a date, is the number of microseconds since 1st of
+ * January, 1970 up to the time of the parsed date.  If timestr cannot
+ * be successfully parsed, set *time to INT64_MIN.
+
+ * @param timestr a string representing a date or a duration.
+ * - If a date the syntax is:
+ * @code
+ * [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z]
+ * now
+ * @endcode
+ * If the value is "now" it takes the current time.
+ * Time is local time unless Z is appended, in which case it is
+ * interpreted as UTC.
+ * If the year-month-day part is not specified it takes the current
+ * year-month-day.
+ * - If a duration the syntax is:
+ * @code
+ * [-]HH[:MM[:SS[.m...]]]
+ * [-]S+[.m...]
+ * @endcode
+ * @param duration flag which tells how to interpret timestr, if not
+ * zero timestr is interpreted as a duration, otherwise as a date
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_parse_time(int64_t *timeval, const char *timestr, int duration);
+
+/**
+ * Attempt to find a specific tag in a URL.
+ *
+ * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
+ * Return 1 if found.
+ */
+int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
+
+/**
+ * Convert the decomposed UTC time in tm to a time_t value.
+ */
+time_t av_timegm(struct tm *tm);
+
+#endif /* AVUTIL_PARSEUTILS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h
new file mode 100644
index 000000000..b1ba03f08
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h
@@ -0,0 +1,276 @@
+/*
+ * pixel format descriptor
+ * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PIXDESC_H
+#define AVUTIL_PIXDESC_H
+
+#include <inttypes.h>
+
+#include "attributes.h"
+#include "pixfmt.h"
+
+typedef struct AVComponentDescriptor{
+    uint16_t plane        :2;            ///< which of the 4 planes contains the component
+
+    /**
+     * Number of elements between 2 horizontally consecutive pixels minus 1.
+     * Elements are bits for bitstream formats, bytes otherwise.
+     */
+    uint16_t step_minus1  :3;
+
+    /**
+     * Number of elements before the component of the first pixel plus 1.
+     * Elements are bits for bitstream formats, bytes otherwise.
+     */
+    uint16_t offset_plus1 :3;
+    uint16_t shift        :3;            ///< number of least significant bits that must be shifted away to get the value
+    uint16_t depth_minus1 :4;            ///< number of bits in the component minus 1
+}AVComponentDescriptor;
+
+/**
+ * Descriptor that unambiguously describes how the bits of a pixel are
+ * stored in the up to 4 data planes of an image. It also stores the
+ * subsampling factors and number of components.
+ *
+ * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV
+ *       and all the YUV variants) AVPixFmtDescriptor just stores how values
+ *       are stored not what these values represent.
+ */
+typedef struct AVPixFmtDescriptor{
+    const char *name;
+    uint8_t nb_components;      ///< The number of components each pixel has, (1-4)
+
+    /**
+     * Amount to shift the luma width right to find the chroma width.
+     * For YV12 this is 1 for example.
+     * chroma_width = -((-luma_width) >> log2_chroma_w)
+     * The note above is needed to ensure rounding up.
+     * This value only refers to the chroma components.
+     */
+    uint8_t log2_chroma_w;      ///< chroma_width = -((-luma_width )>>log2_chroma_w)
+
+    /**
+     * Amount to shift the luma height right to find the chroma height.
+     * For YV12 this is 1 for example.
+     * chroma_height= -((-luma_height) >> log2_chroma_h)
+     * The note above is needed to ensure rounding up.
+     * This value only refers to the chroma components.
+     */
+    uint8_t log2_chroma_h;
+    uint8_t flags;
+
+    /**
+     * Parameters that describe how pixels are packed. If the format
+     * has chroma components, they must be stored in comp[1] and
+     * comp[2].
+     */
+    AVComponentDescriptor comp[4];
+}AVPixFmtDescriptor;
+
+/**
+ * Pixel format is big-endian.
+ */
+#define AV_PIX_FMT_FLAG_BE           (1 << 0)
+/**
+ * Pixel format has a palette in data[1], values are indexes in this palette.
+ */
+#define AV_PIX_FMT_FLAG_PAL          (1 << 1)
+/**
+ * All values of a component are bit-wise packed end to end.
+ */
+#define AV_PIX_FMT_FLAG_BITSTREAM    (1 << 2)
+/**
+ * Pixel format is an HW accelerated format.
+ */
+#define AV_PIX_FMT_FLAG_HWACCEL      (1 << 3)
+/**
+ * At least one pixel component is not in the first data plane.
+ */
+#define AV_PIX_FMT_FLAG_PLANAR       (1 << 4)
+/**
+ * The pixel format contains RGB-like data (as opposed to YUV/grayscale).
+ */
+#define AV_PIX_FMT_FLAG_RGB          (1 << 5)
+/**
+ * The pixel format is "pseudo-paletted". This means that Libav treats it as
+ * paletted internally, but the palette is generated by the decoder and is not
+ * stored in the file.
+ */
+#define AV_PIX_FMT_FLAG_PSEUDOPAL    (1 << 6)
+/**
+ * The pixel format has an alpha channel.
+ */
+#define AV_PIX_FMT_FLAG_ALPHA        (1 << 7)
+
+#if FF_API_PIX_FMT
+/**
+ * @deprecate use the AV_PIX_FMT_FLAG_* flags
+ */
+#define PIX_FMT_BE        AV_PIX_FMT_FLAG_BE
+#define PIX_FMT_PAL       AV_PIX_FMT_FLAG_PAL
+#define PIX_FMT_BITSTREAM AV_PIX_FMT_FLAG_BITSTREAM
+#define PIX_FMT_HWACCEL   AV_PIX_FMT_FLAG_HWACCEL
+#define PIX_FMT_PLANAR    AV_PIX_FMT_FLAG_PLANAR
+#define PIX_FMT_RGB       AV_PIX_FMT_FLAG_RGB
+#define PIX_FMT_PSEUDOPAL AV_PIX_FMT_FLAG_PSEUDOPAL
+#define PIX_FMT_ALPHA     AV_PIX_FMT_FLAG_ALPHA
+#endif
+
+#if FF_API_PIX_FMT_DESC
+/**
+ * The array of all the pixel format descriptors.
+ */
+extern attribute_deprecated const AVPixFmtDescriptor av_pix_fmt_descriptors[];
+#endif
+
+/**
+ * Read a line from an image, and write the values of the
+ * pixel format component c to dst.
+ *
+ * @param data the array containing the pointers to the planes of the image
+ * @param linesize the array containing the linesizes of the image
+ * @param desc the pixel format descriptor for the image
+ * @param x the horizontal coordinate of the first pixel to read
+ * @param y the vertical coordinate of the first pixel to read
+ * @param w the width of the line to read, that is the number of
+ * values to write to dst
+ * @param read_pal_component if not zero and the format is a paletted
+ * format writes the values corresponding to the palette
+ * component c in data[1] to dst, rather than the palette indexes in
+ * data[0]. The behavior is undefined if the format is not paletted.
+ */
+void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
+                        const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
+
+/**
+ * Write the values from src to the pixel format component c of an
+ * image line.
+ *
+ * @param src array containing the values to write
+ * @param data the array containing the pointers to the planes of the
+ * image to write into. It is supposed to be zeroed.
+ * @param linesize the array containing the linesizes of the image
+ * @param desc the pixel format descriptor for the image
+ * @param x the horizontal coordinate of the first pixel to write
+ * @param y the vertical coordinate of the first pixel to write
+ * @param w the width of the line to write, that is the number of
+ * values to write to the image line
+ */
+void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
+                         const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
+
+/**
+ * Return the pixel format corresponding to name.
+ *
+ * If there is no pixel format with name name, then looks for a
+ * pixel format with the name corresponding to the native endian
+ * format of name.
+ * For example in a little-endian system, first looks for "gray16",
+ * then for "gray16le".
+ *
+ * Finally if no pixel format has been found, returns PIX_FMT_NONE.
+ */
+enum AVPixelFormat av_get_pix_fmt(const char *name);
+
+/**
+ * Return the short name for a pixel format, NULL in case pix_fmt is
+ * unknown.
+ *
+ * @see av_get_pix_fmt(), av_get_pix_fmt_string()
+ */
+const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
+
+/**
+ * Print in buf the string corresponding to the pixel format with
+ * number pix_fmt, or an header if pix_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param pix_fmt the number of the pixel format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ */
+char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
+
+/**
+ * Return the number of bits per pixel used by the pixel format
+ * described by pixdesc. Note that this is not the same as the number
+ * of bits per sample.
+ *
+ * The returned number of bits refers to the number of bits actually
+ * used for storing the pixel information, that is padding bits are
+ * not counted.
+ */
+int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
+
+/**
+ * @return a pixel format descriptor for provided pixel format or NULL if
+ * this pixel format is unknown.
+ */
+const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt);
+
+/**
+ * Iterate over all pixel format descriptors known to libavutil.
+ *
+ * @param prev previous descriptor. NULL to get the first descriptor.
+ *
+ * @return next descriptor or NULL after the last descriptor
+ */
+const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
+
+/**
+ * @return an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc
+ * is not a valid pointer to a pixel format descriptor.
+ */
+enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
+
+/**
+ * Utility function to access log2_chroma_w log2_chroma_h from
+ * the pixel format AVPixFmtDescriptor.
+ *
+ * @param[in]  pix_fmt the pixel format
+ * @param[out] h_shift store log2_chroma_h
+ * @param[out] v_shift store log2_chroma_w
+ *
+ * @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
+ */
+int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
+                                     int *h_shift, int *v_shift);
+
+/**
+ * @return number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a
+ * valid pixel format.
+ */
+int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt);
+
+
+/**
+ * Utility function to swap the endianness of a pixel format.
+ *
+ * @param[in]  pix_fmt the pixel format
+ *
+ * @return pixel format with swapped endianness if it exists,
+ * otherwise AV_PIX_FMT_NONE
+ */
+enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt);
+
+
+#endif /* AVUTIL_PIXDESC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h
new file mode 100644
index 000000000..77305cacd
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h
@@ -0,0 +1,277 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PIXFMT_H
+#define AVUTIL_PIXFMT_H
+
+/**
+ * @file
+ * pixel format definitions
+ *
+ */
+
+#include "libavutil/avconfig.h"
+#include "libavutil/version.h"
+
+/**
+ * Pixel format.
+ *
+ * @note
+ * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
+ * color is put together as:
+ *  (A << 24) | (R << 16) | (G << 8) | B
+ * This is stored as BGRA on little-endian CPU architectures and ARGB on
+ * big-endian CPUs.
+ *
+ * @par
+ * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
+ * image data is stored in AVFrame.data[0]. The palette is transported in
+ * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
+ * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
+ * also endian-specific). Note also that the individual RGB palette
+ * components stored in AVFrame.data[1] should be in the range 0..255.
+ * This is important as many custom PAL8 video codecs that were designed
+ * to run on the IBM VGA graphics adapter use 6-bit palette components.
+ *
+ * @par
+ * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
+ * for pal8. This palette is filled in automatically by the function
+ * allocating the picture.
+ *
+ * @note
+ * Make sure that all newly added big-endian formats have pix_fmt & 1 == 1
+ * and that all newly added little-endian formats have pix_fmt & 1 == 0.
+ * This allows simpler detection of big vs little-endian.
+ */
+enum AVPixelFormat {
+    AV_PIX_FMT_NONE = -1,
+    AV_PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+    AV_PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+    AV_PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+    AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+    AV_PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+    AV_PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+    AV_PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+    AV_PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+    AV_PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
+    AV_PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+    AV_PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+    AV_PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
+    AV_PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+    AV_PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+    AV_PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+    AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+    AV_PIX_FMT_XVMC_MPEG2_IDCT,
+    AV_PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+    AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+    AV_PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
+    AV_PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
+    AV_PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
+    AV_PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
+    AV_PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+    AV_PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
+
+    AV_PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+    AV_PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+    AV_PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+    AV_PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+    AV_PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
+    AV_PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
+    AV_PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+    AV_PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+    AV_PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+#if FF_API_VDPAU
+    AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+    AV_PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+    AV_PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+
+    AV_PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
+    AV_PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
+    AV_PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+    AV_PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+    AV_PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
+    AV_PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
+    AV_PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+    AV_PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+    AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+    AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+    AV_PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+    AV_PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    AV_PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    AV_PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    AV_PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+#if FF_API_VDPAU
+    AV_PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+    AV_PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+
+    AV_PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+    AV_PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+    AV_PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+    AV_PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+    AV_PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
+    AV_PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+    AV_PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+    AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
+    AV_PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
+    AV_PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big-endian
+    AV_PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little-endian
+    AV_PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big-endian
+    AV_PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little-endian
+    AV_PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big-endian
+    AV_PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little-endian
+    AV_PIX_FMT_YUVA422P,  ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
+    AV_PIX_FMT_YUVA444P,  ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
+    AV_PIX_FMT_YUVA420P9BE,  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
+    AV_PIX_FMT_YUVA420P9LE,  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
+    AV_PIX_FMT_YUVA422P9BE,  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
+    AV_PIX_FMT_YUVA422P9LE,  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
+    AV_PIX_FMT_YUVA444P9BE,  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
+    AV_PIX_FMT_YUVA444P9LE,  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
+    AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
+    AV_PIX_FMT_VDPAU,     ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface
+    AV_PIX_FMT_XYZ12LE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0
+    AV_PIX_FMT_XYZ12BE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0
+    AV_PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+
+#if FF_API_PIX_FMT
+#include "old_pix_fmts.h"
+#endif
+};
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be
+#else
+#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le
+#endif
+
+#define AV_PIX_FMT_RGB32   AV_PIX_FMT_NE(ARGB, BGRA)
+#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR)
+#define AV_PIX_FMT_BGR32   AV_PIX_FMT_NE(ABGR, RGBA)
+#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
+
+#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
+#define AV_PIX_FMT_RGB48  AV_PIX_FMT_NE(RGB48BE,  RGB48LE)
+#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
+#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
+#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
+#define AV_PIX_FMT_BGR48  AV_PIX_FMT_NE(BGR48BE,  BGR48LE)
+#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
+#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
+#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
+
+#define AV_PIX_FMT_YUV420P9  AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
+#define AV_PIX_FMT_YUV422P9  AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
+#define AV_PIX_FMT_YUV444P9  AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
+#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
+#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
+#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
+#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
+#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
+#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
+
+#define AV_PIX_FMT_GBRP9     AV_PIX_FMT_NE(GBRP9BE ,    GBRP9LE)
+#define AV_PIX_FMT_GBRP10    AV_PIX_FMT_NE(GBRP10BE,    GBRP10LE)
+#define AV_PIX_FMT_GBRP16    AV_PIX_FMT_NE(GBRP16BE,    GBRP16LE)
+
+#define AV_PIX_FMT_YUVA420P9  AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
+#define AV_PIX_FMT_YUVA422P9  AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
+#define AV_PIX_FMT_YUVA444P9  AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
+#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE)
+#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE)
+#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE)
+#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE)
+#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE)
+#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE)
+
+#define AV_PIX_FMT_XYZ12      AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
+
+#if FF_API_PIX_FMT
+#define PixelFormat AVPixelFormat
+
+#define PIX_FMT_NE(be, le) AV_PIX_FMT_NE(be, le)
+
+#define PIX_FMT_RGB32   AV_PIX_FMT_RGB32
+#define PIX_FMT_RGB32_1 AV_PIX_FMT_RGB32_1
+#define PIX_FMT_BGR32   AV_PIX_FMT_BGR32
+#define PIX_FMT_BGR32_1 AV_PIX_FMT_BGR32_1
+
+#define PIX_FMT_GRAY16 AV_PIX_FMT_GRAY16
+#define PIX_FMT_RGB48  AV_PIX_FMT_RGB48
+#define PIX_FMT_RGB565 AV_PIX_FMT_RGB565
+#define PIX_FMT_RGB555 AV_PIX_FMT_RGB555
+#define PIX_FMT_RGB444 AV_PIX_FMT_RGB444
+#define PIX_FMT_BGR48  AV_PIX_FMT_BGR48
+#define PIX_FMT_BGR565 AV_PIX_FMT_BGR565
+#define PIX_FMT_BGR555 AV_PIX_FMT_BGR555
+#define PIX_FMT_BGR444 AV_PIX_FMT_BGR444
+
+#define PIX_FMT_YUV420P9  AV_PIX_FMT_YUV420P9
+#define PIX_FMT_YUV422P9  AV_PIX_FMT_YUV422P9
+#define PIX_FMT_YUV444P9  AV_PIX_FMT_YUV444P9
+#define PIX_FMT_YUV420P10 AV_PIX_FMT_YUV420P10
+#define PIX_FMT_YUV422P10 AV_PIX_FMT_YUV422P10
+#define PIX_FMT_YUV444P10 AV_PIX_FMT_YUV444P10
+#define PIX_FMT_YUV420P16 AV_PIX_FMT_YUV420P16
+#define PIX_FMT_YUV422P16 AV_PIX_FMT_YUV422P16
+#define PIX_FMT_YUV444P16 AV_PIX_FMT_YUV444P16
+
+#define PIX_FMT_GBRP9  AV_PIX_FMT_GBRP9
+#define PIX_FMT_GBRP10 AV_PIX_FMT_GBRP10
+#define PIX_FMT_GBRP16 AV_PIX_FMT_GBRP16
+#endif
+
+#endif /* AVUTIL_PIXFMT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/random_seed.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/random_seed.h
new file mode 100644
index 000000000..b1fad13d0
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/random_seed.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier@gmail.com>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_RANDOM_SEED_H
+#define AVUTIL_RANDOM_SEED_H
+
+#include <stdint.h>
+/**
+ * @addtogroup lavu_crypto
+ * @{
+ */
+
+/**
+ * Get random data.
+ *
+ * This function can be called repeatedly to generate more random bits
+ * as needed. It is generally quite slow, and usually used to seed a
+ * PRNG.  As it uses /dev/urandom and /dev/random, the quality of the
+ * returned random data depends on the platform.
+ */
+uint32_t av_get_random_seed(void);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_RANDOM_SEED_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/rational.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/rational.h
new file mode 100644
index 000000000..5d7dab7fd
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/rational.h
@@ -0,0 +1,155 @@
+/*
+ * rational numbers
+ * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * rational numbers
+ * @author Michael Niedermayer <michaelni@gmx.at>
+ */
+
+#ifndef AVUTIL_RATIONAL_H
+#define AVUTIL_RATIONAL_H
+
+#include <stdint.h>
+#include <limits.h>
+#include "attributes.h"
+
+/**
+ * @addtogroup lavu_math
+ * @{
+ */
+
+/**
+ * rational number numerator/denominator
+ */
+typedef struct AVRational{
+    int num; ///< numerator
+    int den; ///< denominator
+} AVRational;
+
+/**
+ * Compare two rationals.
+ * @param a first rational
+ * @param b second rational
+ * @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the
+ * values is of the form 0/0
+ */
+static inline int av_cmp_q(AVRational a, AVRational b){
+    const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
+
+    if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
+    else if(b.den && a.den) return 0;
+    else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
+    else                    return INT_MIN;
+}
+
+/**
+ * Convert rational to double.
+ * @param a rational to convert
+ * @return (double) a
+ */
+static inline double av_q2d(AVRational a){
+    return a.num / (double) a.den;
+}
+
+/**
+ * Reduce a fraction.
+ * This is useful for framerate calculations.
+ * @param dst_num destination numerator
+ * @param dst_den destination denominator
+ * @param num source numerator
+ * @param den source denominator
+ * @param max the maximum allowed for dst_num & dst_den
+ * @return 1 if exact, 0 otherwise
+ */
+int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
+
+/**
+ * Multiply two rationals.
+ * @param b first rational
+ * @param c second rational
+ * @return b*c
+ */
+AVRational av_mul_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Divide one rational by another.
+ * @param b first rational
+ * @param c second rational
+ * @return b/c
+ */
+AVRational av_div_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Add two rationals.
+ * @param b first rational
+ * @param c second rational
+ * @return b+c
+ */
+AVRational av_add_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Subtract one rational from another.
+ * @param b first rational
+ * @param c second rational
+ * @return b-c
+ */
+AVRational av_sub_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Invert a rational.
+ * @param q value
+ * @return 1 / q
+ */
+static av_always_inline AVRational av_inv_q(AVRational q)
+{
+    AVRational r = { q.den, q.num };
+    return r;
+}
+
+/**
+ * Convert a double precision floating point number to a rational.
+ * inf is expressed as {1,0} or {-1,0} depending on the sign.
+ *
+ * @param d double to convert
+ * @param max the maximum allowed numerator and denominator
+ * @return (AVRational) d
+ */
+AVRational av_d2q(double d, int max) av_const;
+
+/**
+ * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
+ * than q1, 0 if they have the same distance.
+ */
+int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
+
+/**
+ * Find the nearest value in q_list to q.
+ * @param q_list an array of rationals terminated by {0, 0}
+ * @return the index of the nearest value found in the array
+ */
+int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_RATIONAL_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/samplefmt.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/samplefmt.h
new file mode 100644
index 000000000..33cbdedf5
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/samplefmt.h
@@ -0,0 +1,220 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_SAMPLEFMT_H
+#define AVUTIL_SAMPLEFMT_H
+
+#include <stdint.h>
+
+#include "avutil.h"
+#include "attributes.h"
+
+/**
+ * Audio Sample Formats
+ *
+ * @par
+ * The data described by the sample format is always in native-endian order.
+ * Sample values can be expressed by native C types, hence the lack of a signed
+ * 24-bit sample format even though it is a common raw audio data format.
+ *
+ * @par
+ * The floating-point formats are based on full volume being in the range
+ * [-1.0, 1.0]. Any values outside this range are beyond full volume level.
+ *
+ * @par
+ * The data layout as used in av_samples_fill_arrays() and elsewhere in Libav
+ * (such as AVFrame in libavcodec) is as follows:
+ *
+ * For planar sample formats, each audio channel is in a separate data plane,
+ * and linesize is the buffer size, in bytes, for a single plane. All data
+ * planes must be the same size. For packed sample formats, only the first data
+ * plane is used, and samples for each channel are interleaved. In this case,
+ * linesize is the buffer size, in bytes, for the 1 plane.
+ */
+enum AVSampleFormat {
+    AV_SAMPLE_FMT_NONE = -1,
+    AV_SAMPLE_FMT_U8,          ///< unsigned 8 bits
+    AV_SAMPLE_FMT_S16,         ///< signed 16 bits
+    AV_SAMPLE_FMT_S32,         ///< signed 32 bits
+    AV_SAMPLE_FMT_FLT,         ///< float
+    AV_SAMPLE_FMT_DBL,         ///< double
+
+    AV_SAMPLE_FMT_U8P,         ///< unsigned 8 bits, planar
+    AV_SAMPLE_FMT_S16P,        ///< signed 16 bits, planar
+    AV_SAMPLE_FMT_S32P,        ///< signed 32 bits, planar
+    AV_SAMPLE_FMT_FLTP,        ///< float, planar
+    AV_SAMPLE_FMT_DBLP,        ///< double, planar
+
+    AV_SAMPLE_FMT_NB           ///< Number of sample formats. DO NOT USE if linking dynamically
+};
+
+/**
+ * Return the name of sample_fmt, or NULL if sample_fmt is not
+ * recognized.
+ */
+const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
+
+/**
+ * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
+ * on error.
+ */
+enum AVSampleFormat av_get_sample_fmt(const char *name);
+
+/**
+ * Get the packed alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in packed format, the format returned is
+ * the same as the input.
+ *
+ * @return  the packed alternative form of the given sample format or
+            AV_SAMPLE_FMT_NONE on error.
+ */
+enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt);
+
+/**
+ * Get the planar alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in planar format, the format returned is
+ * the same as the input.
+ *
+ * @return  the planar alternative form of the given sample format or
+            AV_SAMPLE_FMT_NONE on error.
+ */
+enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt);
+
+/**
+ * Generate a string corresponding to the sample format with
+ * sample_fmt, or a header if sample_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param sample_fmt the number of the sample format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ * @return the pointer to the filled buffer or NULL if sample_fmt is
+ * unknown or in case of other errors
+ */
+char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
+
+/**
+ * Return number of bytes per sample.
+ *
+ * @param sample_fmt the sample format
+ * @return number of bytes per sample or zero if unknown for the given
+ * sample format
+ */
+int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
+
+/**
+ * Check if the sample format is planar.
+ *
+ * @param sample_fmt the sample format to inspect
+ * @return 1 if the sample format is planar, 0 if it is interleaved
+ */
+int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
+
+/**
+ * Get the required buffer size for the given audio parameters.
+ *
+ * @param[out] linesize calculated linesize, may be NULL
+ * @param nb_channels   the number of channels
+ * @param nb_samples    the number of samples in a single channel
+ * @param sample_fmt    the sample format
+ * @param align         buffer size alignment (0 = default, 1 = no alignment)
+ * @return              required buffer size, or negative error code on failure
+ */
+int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
+                               enum AVSampleFormat sample_fmt, int align);
+
+/**
+ * Fill channel data pointers and linesize for samples with sample
+ * format sample_fmt.
+ *
+ * The pointers array is filled with the pointers to the samples data:
+ * for planar, set the start point of each channel's data within the buffer,
+ * for packed, set the start point of the entire buffer only.
+ *
+ * The linesize array is filled with the aligned size of each channel's data
+ * buffer for planar layout, or the aligned size of the buffer for all channels
+ * for packed layout.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param[out] audio_data  array to be filled with the pointer for each channel
+ * @param[out] linesize    calculated linesize, may be NULL
+ * @param buf              the pointer to a buffer containing the samples
+ * @param nb_channels      the number of channels
+ * @param nb_samples       the number of samples in a single channel
+ * @param sample_fmt       the sample format
+ * @param align            buffer size alignment (0 = default, 1 = no alignment)
+ * @return                 0 on success or a negative error code on failure
+ */
+int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
+                           const uint8_t *buf,
+                           int nb_channels, int nb_samples,
+                           enum AVSampleFormat sample_fmt, int align);
+
+/**
+ * Allocate a samples buffer for nb_samples samples, and fill data pointers and
+ * linesize accordingly.
+ * The allocated samples buffer can be freed by using av_freep(&audio_data[0])
+ * Allocated data will be initialized to silence.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param[out] audio_data  array to be filled with the pointer for each channel
+ * @param[out] linesize    aligned size for audio buffer(s), may be NULL
+ * @param nb_channels      number of audio channels
+ * @param nb_samples       number of samples per channel
+ * @param align            buffer size alignment (0 = default, 1 = no alignment)
+ * @return                 0 on success or a negative error code on failure
+ * @see av_samples_fill_arrays()
+ */
+int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
+                     int nb_samples, enum AVSampleFormat sample_fmt, int align);
+
+/**
+ * Copy samples from src to dst.
+ *
+ * @param dst destination array of pointers to data planes
+ * @param src source array of pointers to data planes
+ * @param dst_offset offset in samples at which the data will be written to dst
+ * @param src_offset offset in samples at which the data will be read from src
+ * @param nb_samples number of samples to be copied
+ * @param nb_channels number of audio channels
+ * @param sample_fmt audio sample format
+ */
+int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
+                    int src_offset, int nb_samples, int nb_channels,
+                    enum AVSampleFormat sample_fmt);
+
+/**
+ * Fill an audio buffer with silence.
+ *
+ * @param audio_data  array of pointers to data planes
+ * @param offset      offset in samples at which to start filling
+ * @param nb_samples  number of samples to fill
+ * @param nb_channels number of audio channels
+ * @param sample_fmt  audio sample format
+ */
+int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
+                           int nb_channels, enum AVSampleFormat sample_fmt);
+
+#endif /* AVUTIL_SAMPLEFMT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/sha.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/sha.h
new file mode 100644
index 000000000..4c9a0c909
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/sha.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_SHA_H
+#define AVUTIL_SHA_H
+
+#include <stdint.h>
+
+#include "attributes.h"
+#include "version.h"
+
+/**
+ * @defgroup lavu_sha SHA
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_sha_size;
+#endif
+
+struct AVSHA;
+
+/**
+ * Allocate an AVSHA context.
+ */
+struct AVSHA *av_sha_alloc(void);
+
+/**
+ * Initialize SHA-1 or SHA-2 hashing.
+ *
+ * @param context pointer to the function context (of size av_sha_size)
+ * @param bits    number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
+ * @return        zero if initialization succeeded, -1 otherwise
+ */
+int av_sha_init(struct AVSHA* context, int bits);
+
+/**
+ * Update hash value.
+ *
+ * @param context hash function context
+ * @param data    input data to update hash with
+ * @param len     input data length
+ */
+void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len);
+
+/**
+ * Finish hashing and output digest value.
+ *
+ * @param context hash function context
+ * @param digest  buffer where output digest value is stored
+ */
+void av_sha_final(struct AVSHA* context, uint8_t *digest);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_SHA_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/time.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/time.h
new file mode 100644
index 000000000..b01a97d77
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/time.h
@@ -0,0 +1,39 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_TIME_H
+#define AVUTIL_TIME_H
+
+#include <stdint.h>
+
+/**
+ * Get the current time in microseconds.
+ */
+int64_t av_gettime(void);
+
+/**
+ * Sleep for a period of time.  Although the duration is expressed in
+ * microseconds, the actual delay may be rounded to the precision of the
+ * system timer.
+ *
+ * @param  usec Number of microseconds to sleep.
+ * @return zero on success or (negative) error code.
+ */
+int av_usleep(unsigned usec);
+
+#endif /* AVUTIL_TIME_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h
new file mode 100644
index 000000000..c760d8d75
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h
@@ -0,0 +1,96 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_VERSION_H
+#define AVUTIL_VERSION_H
+
+#include "avutil.h"
+
+/**
+ * @file
+ * @ingroup lavu
+ * Libavutil version macros
+ */
+
+/**
+ * @defgroup lavu_ver Version and Build diagnostics
+ *
+ * Macros and function useful to check at compiletime and at runtime
+ * which version of libavutil is in use.
+ *
+ * @{
+ */
+
+#define LIBAVUTIL_VERSION_MAJOR 52
+#define LIBAVUTIL_VERSION_MINOR 14
+#define LIBAVUTIL_VERSION_MICRO  0
+
+#define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
+                                               LIBAVUTIL_VERSION_MINOR, \
+                                               LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_VERSION       AV_VERSION(LIBAVUTIL_VERSION_MAJOR,     \
+                                           LIBAVUTIL_VERSION_MINOR,     \
+                                           LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_BUILD         LIBAVUTIL_VERSION_INT
+
+#define LIBAVUTIL_IDENT         "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
+
+/**
+ * @}
+ *
+ * @defgroup depr_guards Deprecation guards
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ *
+ * @{
+ */
+
+#ifndef FF_API_PIX_FMT
+#define FF_API_PIX_FMT                  (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_CONTEXT_SIZE
+#define FF_API_CONTEXT_SIZE             (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_PIX_FMT_DESC
+#define FF_API_PIX_FMT_DESC             (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_AV_REVERSE
+#define FF_API_AV_REVERSE               (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_AUDIOCONVERT
+#define FF_API_AUDIOCONVERT             (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_CPU_FLAG_MMX2
+#define FF_API_CPU_FLAG_MMX2            (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_LLS_PRIVATE
+#define FF_API_LLS_PRIVATE              (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_AVFRAME_LAVC
+#define FF_API_AVFRAME_LAVC             (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_VDPAU
+#define FF_API_VDPAU                    (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h
new file mode 100644
index 000000000..7d2b07bbc
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h
@@ -0,0 +1,61 @@
+/*
+ * A 32-bit implementation of the XTEA algorithm
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_XTEA_H
+#define AVUTIL_XTEA_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavu_xtea XTEA
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+typedef struct AVXTEA {
+    uint32_t key[16];
+} AVXTEA;
+
+/**
+ * Initialize an AVXTEA context.
+ *
+ * @param ctx an AVXTEA context
+ * @param key a key of 16 bytes used for encryption/decryption
+ */
+void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ *
+ * @param ctx an AVXTEA context
+ * @param dst destination array, can be equal to src
+ * @param src source array, can be equal to dst
+ * @param count number of 8 byte blocks
+ * @param iv initialization vector for CBC mode, if NULL then ECB will be used
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
+                   int count, uint8_t *iv, int decrypt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_XTEA_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h
new file mode 100644
index 000000000..95e8a5a09
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h
@@ -0,0 +1,311 @@
+/*
+ * Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
+ *
+ * This file is part of libswresample
+ *
+ * libswresample is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * libswresample is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with libswresample; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SWRESAMPLE_SWRESAMPLE_H
+#define SWRESAMPLE_SWRESAMPLE_H
+
+/**
+ * @file
+ * @ingroup lswr
+ * libswresample public header
+ */
+
+/**
+ * @defgroup lswr Libswresample
+ * @{
+ *
+ * Libswresample (lswr) is a library that handles audio resampling, sample
+ * format conversion and mixing.
+ *
+ * Interaction with lswr is done through SwrContext, which is
+ * allocated with swr_alloc() or swr_alloc_set_opts(). It is opaque, so all parameters
+ * must be set with the @ref avoptions API.
+ *
+ * For example the following code will setup conversion from planar float sample
+ * format to interleaved signed 16-bit integer, downsampling from 48kHz to
+ * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
+ * matrix):
+ * @code
+ * SwrContext *swr = swr_alloc();
+ * av_opt_set_int(swr, "in_channel_layout",  AV_CH_LAYOUT_5POINT1, 0);
+ * av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
+ * av_opt_set_int(swr, "in_sample_rate",     48000,                0);
+ * av_opt_set_int(swr, "out_sample_rate",    44100,                0);
+ * av_opt_set_sample_fmt(swr, "in_sample_fmt",  AV_SAMPLE_FMT_FLTP, 0);
+ * av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16,  0);
+ * @endcode
+ *
+ * Once all values have been set, it must be initialized with swr_init(). If
+ * you need to change the conversion parameters, you can change the parameters
+ * as described above, or by using swr_alloc_set_opts(), then call swr_init()
+ * again.
+ *
+ * The conversion itself is done by repeatedly calling swr_convert().
+ * Note that the samples may get buffered in swr if you provide insufficient
+ * output space or if sample rate conversion is done, which requires "future"
+ * samples. Samples that do not require future input can be retrieved at any
+ * time by using swr_convert() (in_count can be set to 0).
+ * At the end of conversion the resampling buffer can be flushed by calling
+ * swr_convert() with NULL in and 0 in_count.
+ *
+ * The delay between input and output, can at any time be found by using
+ * swr_get_delay().
+ *
+ * The following code demonstrates the conversion loop assuming the parameters
+ * from above and caller-defined functions get_input() and handle_output():
+ * @code
+ * uint8_t **input;
+ * int in_samples;
+ *
+ * while (get_input(&input, &in_samples)) {
+ *     uint8_t *output;
+ *     int out_samples = av_rescale_rnd(swr_get_delay(swr, 48000) +
+ *                                      in_samples, 44100, 48000, AV_ROUND_UP);
+ *     av_samples_alloc(&output, NULL, 2, out_samples,
+ *                      AV_SAMPLE_FMT_S16, 0);
+ *     out_samples = swr_convert(swr, &output, out_samples,
+ *                                      input, in_samples);
+ *     handle_output(output, out_samples);
+ *     av_freep(&output);
+ *  }
+ *  @endcode
+ *
+ * When the conversion is finished, the conversion
+ * context and everything associated with it must be freed with swr_free().
+ * There will be no memory leak if the data is not completely flushed before
+ * swr_free().
+ */
+
+#include <stdint.h>
+#include "libavutil/samplefmt.h"
+
+#include "libswresample/version.h"
+
+#if LIBSWRESAMPLE_VERSION_MAJOR < 1
+#define SWR_CH_MAX 32   ///< Maximum number of channels
+#endif
+
+#define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate
+//TODO use int resample ?
+//long term TODO can we enable this dynamically?
+
+enum SwrDitherType {
+    SWR_DITHER_NONE = 0,
+    SWR_DITHER_RECTANGULAR,
+    SWR_DITHER_TRIANGULAR,
+    SWR_DITHER_TRIANGULAR_HIGHPASS,
+
+    SWR_DITHER_NS = 64,         ///< not part of API/ABI
+    SWR_DITHER_NS_LIPSHITZ,
+    SWR_DITHER_NS_F_WEIGHTED,
+    SWR_DITHER_NS_MODIFIED_E_WEIGHTED,
+    SWR_DITHER_NS_IMPROVED_E_WEIGHTED,
+    SWR_DITHER_NS_SHIBATA,
+    SWR_DITHER_NS_LOW_SHIBATA,
+    SWR_DITHER_NS_HIGH_SHIBATA,
+    SWR_DITHER_NB,              ///< not part of API/ABI
+};
+
+/** Resampling Engines */
+enum SwrEngine {
+    SWR_ENGINE_SWR,             /**< SW Resampler */
+    SWR_ENGINE_SOXR,            /**< SoX Resampler */
+    SWR_ENGINE_NB,              ///< not part of API/ABI
+};
+
+/** Resampling Filter Types */
+enum SwrFilterType {
+    SWR_FILTER_TYPE_CUBIC,              /**< Cubic */
+    SWR_FILTER_TYPE_BLACKMAN_NUTTALL,   /**< Blackman Nuttall Windowed Sinc */
+    SWR_FILTER_TYPE_KAISER,             /**< Kaiser Windowed Sinc */
+};
+
+typedef struct SwrContext SwrContext;
+
+/**
+ * Get the AVClass for swrContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *swr_get_class(void);
+
+/**
+ * Allocate SwrContext.
+ *
+ * If you use this function you will need to set the parameters (manually or
+ * with swr_alloc_set_opts()) before calling swr_init().
+ *
+ * @see swr_alloc_set_opts(), swr_init(), swr_free()
+ * @return NULL on error, allocated context otherwise
+ */
+struct SwrContext *swr_alloc(void);
+
+/**
+ * Initialize context after user parameters have been set.
+ *
+ * @return AVERROR error code in case of failure.
+ */
+int swr_init(struct SwrContext *s);
+
+/**
+ * Allocate SwrContext if needed and set/reset common parameters.
+ *
+ * This function does not require s to be allocated with swr_alloc(). On the
+ * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters
+ * on the allocated context.
+ *
+ * @param s               Swr context, can be NULL
+ * @param out_ch_layout   output channel layout (AV_CH_LAYOUT_*)
+ * @param out_sample_fmt  output sample format (AV_SAMPLE_FMT_*).
+ * @param out_sample_rate output sample rate (frequency in Hz)
+ * @param in_ch_layout    input channel layout (AV_CH_LAYOUT_*)
+ * @param in_sample_fmt   input sample format (AV_SAMPLE_FMT_*).
+ * @param in_sample_rate  input sample rate (frequency in Hz)
+ * @param log_offset      logging level offset
+ * @param log_ctx         parent logging context, can be NULL
+ *
+ * @see swr_init(), swr_free()
+ * @return NULL on error, allocated context otherwise
+ */
+struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
+                                      int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
+                                      int64_t  in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
+                                      int log_offset, void *log_ctx);
+
+/**
+ * Free the given SwrContext and set the pointer to NULL.
+ */
+void swr_free(struct SwrContext **s);
+
+/**
+ * Convert audio.
+ *
+ * in and in_count can be set to 0 to flush the last few samples out at the
+ * end.
+ *
+ * If more input is provided than output space then the input will be buffered.
+ * You can avoid this buffering by providing more output space than input.
+ * Convertion will run directly without copying whenever possible.
+ *
+ * @param s         allocated Swr context, with parameters set
+ * @param out       output buffers, only the first one need be set in case of packed audio
+ * @param out_count amount of space available for output in samples per channel
+ * @param in        input buffers, only the first one need to be set in case of packed audio
+ * @param in_count  number of input samples available in one channel
+ *
+ * @return number of samples output per channel, negative value on error
+ */
+int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
+                                const uint8_t **in , int in_count);
+
+/**
+ * Convert the next timestamp from input to output
+ * timestamps are in 1/(in_sample_rate * out_sample_rate) units.
+ *
+ * @note There are 2 slightly differently behaving modes.
+ *       First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX)
+ *              in this case timestamps will be passed through with delays compensated
+ *       Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX)
+ *              in this case the output timestamps will match output sample numbers
+ *
+ * @param pts   timestamp for the next input sample, INT64_MIN if unknown
+ * @return the output timestamp for the next output sample
+ */
+int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
+
+/**
+ * Activate resampling compensation.
+ */
+int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
+
+/**
+ * Set a customized input channel mapping.
+ *
+ * @param s           allocated Swr context, not yet initialized
+ * @param channel_map customized input channel mapping (array of channel
+ *                    indexes, -1 for a muted channel)
+ * @return AVERROR error code in case of failure.
+ */
+int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
+
+/**
+ * Set a customized remix matrix.
+ *
+ * @param s       allocated Swr context, not yet initialized
+ * @param matrix  remix coefficients; matrix[i + stride * o] is
+ *                the weight of input channel i in output channel o
+ * @param stride  offset between lines of the matrix
+ * @return  AVERROR error code in case of failure.
+ */
+int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
+
+/**
+ * Drops the specified number of output samples.
+ */
+int swr_drop_output(struct SwrContext *s, int count);
+
+/**
+ * Injects the specified number of silence samples.
+ */
+int swr_inject_silence(struct SwrContext *s, int count);
+
+/**
+ * Gets the delay the next input sample will experience relative to the next output sample.
+ *
+ * Swresample can buffer data if more input has been provided than available
+ * output space, also converting between sample rates needs a delay.
+ * This function returns the sum of all such delays.
+ * The exact delay is not necessarily an integer value in either input or
+ * output sample rate. Especially when downsampling by a large value, the
+ * output sample rate may be a poor choice to represent the delay, similarly
+ * for upsampling and the input sample rate.
+ *
+ * @param s     swr context
+ * @param base  timebase in which the returned delay will be
+ *              if its set to 1 the returned delay is in seconds
+ *              if its set to 1000 the returned delay is in milli seconds
+ *              if its set to the input sample rate then the returned delay is in input samples
+ *              if its set to the output sample rate then the returned delay is in output samples
+ *              an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate)
+ * @returns     the delay in 1/base units.
+ */
+int64_t swr_get_delay(struct SwrContext *s, int64_t base);
+
+/**
+ * Return the LIBSWRESAMPLE_VERSION_INT constant.
+ */
+unsigned swresample_version(void);
+
+/**
+ * Return the swr build-time configuration.
+ */
+const char *swresample_configuration(void);
+
+/**
+ * Return the swr license.
+ */
+const char *swresample_license(void);
+
+/**
+ * @}
+ */
+
+#endif /* SWRESAMPLE_SWRESAMPLE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h
new file mode 100644
index 000000000..df9df480c
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h
@@ -0,0 +1,45 @@
+/*
+ * Version macros.
+ *
+ * This file is part of libswresample
+ *
+ * libswresample is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * libswresample is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with libswresample; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SWR_VERSION_H
+#define SWR_VERSION_H
+
+/**
+ * @file
+ * Libswresample version macros
+ */
+
+#include "libavutil/avutil.h"
+
+#define LIBSWRESAMPLE_VERSION_MAJOR 0
+#define LIBSWRESAMPLE_VERSION_MINOR 17
+#define LIBSWRESAMPLE_VERSION_MICRO 102
+
+#define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
+                                                  LIBSWRESAMPLE_VERSION_MINOR, \
+                                                  LIBSWRESAMPLE_VERSION_MICRO)
+#define LIBSWRESAMPLE_VERSION      AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \
+                                              LIBSWRESAMPLE_VERSION_MINOR, \
+                                              LIBSWRESAMPLE_VERSION_MICRO)
+#define LIBSWRESAMPLE_BUILD        LIBSWRESAMPLE_VERSION_INT
+
+#define LIBSWRESAMPLE_IDENT        "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
+
+#endif /* SWR_VERSION_H */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 0feca9f45..7f57138a7 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -197,13 +197,33 @@ public interface GLMediaPlayer extends TextureSequence {
      * {@link URI#getScheme() URI scheme} name {@value} for camera input. E.g. <code>camera://0</code>
      * for the 1st camera device.
      * <p>
-     * Note: the {@link URI#getHost() URI host} is being used to identify the camera:
+     * The {@link URI#getRawPath() URI path} is being used to identify the camera,
+     * where the root fwd-slash is being cut-off.
+     * </p>
+     * <p>
+     * The {@link URI#getRawQuery() URI query} is used to pass options to the camera.
+     * </p>
+     * <pre>
+     *    camera:/<id>
+     *    camera://somewhere/<id>
+     *    camera://somewhere/<id>?width=640&height=480&rate=15
+     * </pre>
      * <pre>
-     *    camera://<id>
+     *  URI: [scheme:][//authority][path][?query][#fragment]
+     *  w/ authority: [user-info@]host[:port]
+     *  Note: 'path' starts w/ fwd slash
      * </pre>
      * </p> 
      */
     public static final String CameraInputScheme = "camera";
+    /** Camera property {@value}, size as string, e.g. <code>1280x720</code>, <code>hd720</code>. May not be supported on all platforms. See {@link #CameraInputScheme}. */
+    public static final String CameraPropSizeS = "size";
+    /** Camera property {@value}. See {@link #CameraInputScheme}. */
+    public static final String CameraPropWidth = "width";
+    /** Camera property {@value}. See {@link #CameraInputScheme}. */
+    public static final String CameraPropHeight = "height";
+    /** Camera property {@value}. See {@link #CameraInputScheme}. */
+    public static final String CameraPropRate = "rate";
     
     /** Maximum video frame async of {@value} milliseconds. */
     public static final int MAXIMUM_VIDEO_ASYNC = 22;
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 056998c0c..38faf62a6 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -254,12 +254,12 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             return;
         }
         if( null == mp && null == cam ) {
-            if( null == cameraHostPart ) {
+            if( null == cameraPath ) {
                 mp = new MediaPlayer();
             } else {
                 int cameraId = 0;
                 try {                    
-                    cameraId = Integer.valueOf(cameraHostPart);
+                    cameraId = Integer.valueOf(cameraPath);
                 } catch (NumberFormatException nfe) {}
                 if( 0 <= cameraId && cameraId < Camera.getNumberOfCameras() ) {
                     cam = Camera.open(cameraId);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 5286c86b8..ab0e2eebd 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -31,6 +31,7 @@ import java.io.IOException;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.Map;
 
 import javax.media.nativewindow.AbstractGraphicsDevice;
 import javax.media.opengl.GL;
@@ -44,6 +45,7 @@ import javax.media.opengl.GLProfile;
 
 import jogamp.opengl.Debug;
 
+import com.jogamp.common.net.URIQueryProps;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.LFRingbuffer;
 import com.jogamp.common.util.Ringbuffer;
@@ -89,10 +91,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected URI streamLoc = null;
     /** 
      * In case {@link #streamLoc} is a {@link GLMediaPlayer#CameraInputScheme},
-     * {@link #cameraHostPart} holds the URI's path portion
+     * {@link #cameraPath} holds the URI's path portion
      * as parsed in {@link #initStream(URI, int, int, int)}.
+     * @see #cameraProps
      */
-    protected String cameraHostPart = null;
+    protected String cameraPath = null;
+    /** Optional camera properties, see {@link #cameraPath}. */
+    protected Map<String, String> cameraProps = null;
     
     protected volatile float playSpeed = 1.0f;
     protected float audioVolume = 1.0f;
@@ -472,11 +477,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             this.streamLoc = streamLoc;
 
             // Pre-parse for camera-input scheme
+            cameraPath = null;
+            cameraProps = null;
             final String streamLocScheme = streamLoc.getScheme();
             if( null != streamLocScheme && streamLocScheme.equals(CameraInputScheme) ) {
-                cameraHostPart = streamLoc.getHost();
-            } else {
-                cameraHostPart = null; 
+                final String rawPath = streamLoc.getRawPath();
+                if( null != rawPath && rawPath.length() > 0 ) {
+                    // cut-off root fwd-slash 
+                    cameraPath = rawPath.substring(1);
+                    final URIQueryProps props = URIQueryProps.create(streamLoc);
+                    cameraProps = props.getProperties();
+                } else {
+                    throw new IllegalArgumentException("Camera path is empty: "+streamLoc.toString());
+                }
             }
             
             this.vid = vid;
@@ -526,6 +539,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 if( STREAM_ID_NONE != vid ) {
                     removeAllTextureFrames(gl);
                     initGLImpl(gl);
+                    if(DEBUG) {
+                        System.err.println("initGLImpl.X "+this);
+                    }                    
                     videoFramesOrig = createTexFrames(gl, textureCount);
                     videoFramesFree = new LFRingbuffer<TextureFrame>(videoFramesOrig);
                     videoFramesDecoded = new LFRingbuffer<TextureFrame>(TextureFrame[].class, textureCount);
@@ -615,13 +631,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 final int err = gl.glGetError();
                 if( GL.GL_NO_ERROR != err ) {
                     throw new RuntimeException("Couldn't create TexImage2D RGBA "+tWidth+"x"+tHeight+", target "+toHexString(textureTarget)+
-                                   ", ifmt "+toHexString(GL.GL_RGBA)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+
+                                   ", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+
                                    ", err "+toHexString(err));
                 }
             }
             if(DEBUG) {
                 System.err.println("Created TexImage2D RGBA "+tWidth+"x"+tHeight+", target "+toHexString(textureTarget)+
-                                   ", ifmt "+toHexString(GL.GL_RGBA)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType));
+                                   ", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType));
             }
         }
         gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, texMinMagFilter[0]);
@@ -1322,10 +1338,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
         final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
         final int video_scr = video_scr_pts + (int) ( ( Platform.currentTimeMillis() - video_scr_t0 ) * playSpeed );
-        final String camPath = null != cameraHostPart ? ", camera: "+cameraHostPart : "";
+        final String camPath = null != cameraPath ? ", camera: "+cameraPath : "";
         return "GLMediaPlayer["+state+", vSCR "+video_scr+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
                "speed "+playSpeed+", "+bps_stream+" bps, "+
-               "Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", target "+toHexString(textureTarget)+", format "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+               
+               "Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", tagt "+toHexString(textureTarget)+", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+
                "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
                "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]";
     }
@@ -1394,4 +1410,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected static final String toHexString(int v) {
         return "0x"+Integer.toHexString(v);
     }
+    protected static final int getPropIntVal(Map<String, String> props, String key) {
+        final String val = props.get(key);
+        try {
+            return Integer.valueOf(val).intValue();
+        } catch (NumberFormatException nfe) {
+            if(DEBUG) {
+                System.err.println("Not a valid integer for <"+key+">: <"+val+">");
+            }
+        }
+        return 0;
+    }
 }
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index f327cddd4..400788a24 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -32,10 +32,8 @@ import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import javax.media.opengl.GLProfile;
@@ -53,12 +51,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     
     private static final List<String> glueLibNames = new ArrayList<String>(); // none
     
-    private static final int symbolCount = 54;
+    private static final int symbolCount = 65;
     private static final String[] symbolNames = {
-         "avcodec_version",
-         "avformat_version",
          "avutil_version",
-/* 4 */  "avresample_version",
+         "avformat_version",
+         "avcodec_version",
+         "avresample_version",
+/* 5 */  "swresample_version",
 
          // libavcodec
          "avcodec_register_all",
@@ -69,15 +68,20 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avcodec_alloc_frame",
          "avcodec_get_frame_defaults",
          "avcodec_free_frame",        // 54.28.0   (opt)
-         "avcodec_default_get_buffer", 
-         "avcodec_default_release_buffer",
+         "avcodec_default_get_buffer",     // <= 54 (opt), else sp_avcodec_default_get_buffer2
+         "avcodec_default_release_buffer", // <= 54 (opt), else sp_av_frame_unref
+         "avcodec_default_get_buffer2",    // 55 (opt)
+         "avcodec_get_edge_width",
+         "av_image_fill_linesizes",
+         "avcodec_align_dimensions",
+         "avcodec_align_dimensions2",
          "avcodec_flush_buffers",
          "av_init_packet",
          "av_new_packet",
          "av_destruct_packet",
          "av_free_packet", 
          "avcodec_decode_audio4",     // 53.25.0   (opt)
-/* 21 */ "avcodec_decode_video2",     // 52.23.0
+/* 27 */ "avcodec_decode_video2",     // 52.23.0
         
          // libavutil
          "av_pix_fmt_descriptors",
@@ -91,7 +95,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "av_dict_get",
          "av_dict_count",             // 54.*      (opt)
          "av_dict_set",
-/* 33 */ "av_dict_free",
+/* 28 */ "av_dict_free",
 
          // libavformat
          "avformat_alloc_context",
@@ -108,22 +112,25 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "av_read_pause",
          "avformat_network_init",     // 53.13.0   (opt)
          "avformat_network_deinit",   // 53.13.0   (opt)
-/* 48 */ "avformat_find_stream_info", // 53.3.0    (opt)
+/* 54 */ "avformat_find_stream_info", // 53.3.0    (opt)
 
          // libavdevice
-/* 49 */ "avdevice_register_all",     // ??? 
+/* 55 */ "avdevice_register_all",     // ??? 
          
          // libavresample
          "avresample_alloc_context",  //  1.0.1
          "avresample_open",
          "avresample_close",
          "avresample_free",
-/* 54 */ "avresample_convert"
-    };
-    
-    // alternate symbol names
-    private static final String[][] altSymbolNames = {
-        // { "av_find_stream_info",   "avformat_find_stream_info" },  // old, 53.3.0       
+/* 60 */ "avresample_convert",
+                  
+         // libavresample
+         "av_opt_set_sample_fmt",     // actually lavu .. but exist only w/ swresample!
+         "swr_alloc",
+         "swr_init",       
+         "swr_free",
+/* 65 */ "swr_convert",
+
     };
     
     // optional symbol names
@@ -132,8 +139,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avcodec_free_frame",        // 54.28.0   (opt)
          "av_frame_unref",            // 55.0.0 (opt)
          "av_dict_count",             // 54.*   (opt)
+         "avcodec_default_get_buffer",     // <= 54 (opt), else sp_avcodec_default_get_buffer2
+         "avcodec_default_release_buffer", // <= 54 (opt), else sp_av_frame_unref
+         "avcodec_default_get_buffer2",    // 55 (opt)
+
          // libavdevice
          "avdevice_register_all",     // 53.0.0 (opt)
+         
          // libavresample
          "avresample_version",        //  1.0.1
          "avresample_alloc_context",  //  1.0.1
@@ -141,41 +153,60 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avresample_close",
          "avresample_free",
          "avresample_convert",
+         
+         // libavresample
+         "av_opt_set_sample_fmt",     // actually lavu .. but exist only w/ swresample!
+         "swresample_version",        //  0
+         "swr_alloc",
+         "swr_init",       
+         "swr_free",
+         "swr_convert",
     };
     
     private static final long[] symbolAddr = new long[symbolCount];
     private static final boolean ready;
-    private static final boolean libsLoaded;
+    private static final boolean libsUFCLoaded;
     private static final boolean avresampleLoaded;  // optional
+    private static final boolean swresampleLoaded;  // optional
     private static final boolean avdeviceLoaded; // optional
     static final VersionNumber avCodecVersion;    
     static final VersionNumber avFormatVersion;
     static final VersionNumber avUtilVersion;
     static final VersionNumber avResampleVersion;
+    static final VersionNumber swResampleVersion;
     private static final FFMPEGNatives natives;
     
+    private static final int LIB_IDX_UTI = 0;
+    private static final int LIB_IDX_FMT = 1;
+    private static final int LIB_IDX_COD = 2;
+    private static final int LIB_IDX_DEV = 3;
+    private static final int LIB_IDX_AVR = 4;
+    private static final int LIB_IDX_SWR = 5;
+    
     static {
         // native ffmpeg media player implementation is included in jogl_desktop and jogl_mobile     
         GLProfile.initSingleton();
         boolean _ready = false;
-        boolean[] _libsLoaded= { false };
-        boolean[] _avdeviceLoaded= { false };
-        boolean[] _avresampleLoaded= { false };
-        VersionNumber[] _versions = new VersionNumber[4];
+        /** util, format, codec, device, avresample, swresample */  
+        boolean[] _loaded= new boolean[6]; 
+        /** util, format, codec, avresample, swresample */  
+        VersionNumber[] _versions = new VersionNumber[5];
         try {
-            _ready = initSymbols(_libsLoaded, _avdeviceLoaded, _avresampleLoaded, _versions);
+            _ready = initSymbols(_loaded, _versions);
         } catch (Throwable t) {
             t.printStackTrace();
         }
-        libsLoaded = _libsLoaded[0];
-        avdeviceLoaded = _avdeviceLoaded[0];
-        avresampleLoaded = _avresampleLoaded[0];
-        avCodecVersion = _versions[0];    
+        libsUFCLoaded = _loaded[LIB_IDX_UTI] && _loaded[LIB_IDX_FMT] && _loaded[LIB_IDX_COD];
+        avdeviceLoaded = _loaded[LIB_IDX_DEV];
+        avresampleLoaded = _loaded[LIB_IDX_AVR];
+        swresampleLoaded = _loaded[LIB_IDX_SWR];
+        avUtilVersion = _versions[0];
         avFormatVersion = _versions[1];
-        avUtilVersion = _versions[2];
+        avCodecVersion = _versions[2];
         avResampleVersion = _versions[3];
-        if(!libsLoaded) {
-            System.err.println("LIB_AV Not Available");
+        swResampleVersion = _versions[4];
+        if(!libsUFCLoaded) {
+            System.err.println("LIB_AV Not Available: lavu, lavc, lavu");
             natives = null;
             ready = false;
         } else if(!_ready) {
@@ -183,12 +214,15 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
             natives = null;
             ready = false;
         } else {
-            if( avCodecVersion.getMajor() <= 53 && avFormatVersion.getMajor() <= 53 && avUtilVersion.getMajor() <= 51 ) {
+            if( avCodecVersion.getMajor() == 53 && avFormatVersion.getMajor() == 53 && avUtilVersion.getMajor() == 51 ) {
                 // lavc53.lavf53.lavu51
                 natives = new FFMPEGv08Natives();
-            } else if( avCodecVersion.getMajor() == 54 && avFormatVersion.getMajor() <= 54 && avUtilVersion.getMajor() <= 52 ) {
+            } else if( avCodecVersion.getMajor() == 54 && avFormatVersion.getMajor() == 54 && avUtilVersion.getMajor() == 52 ) {
                 // lavc54.lavf54.lavu52.lavr01
                 natives = new FFMPEGv09Natives();
+            } else if( avCodecVersion.getMajor() == 55 && avFormatVersion.getMajor() == 55 && avUtilVersion.getMajor() == 52 ) {
+                // lavc55.lavf55.lavu52.lavr01
+                natives = new FFMPEGv10Natives();
             } else {
                 System.err.println("LIB_AV No Version/Native-Impl Match");
                 natives = null;
@@ -201,29 +235,33 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         }
     }
     
-    static boolean libsLoaded() { return libsLoaded; }
+    static boolean libsLoaded() { return libsUFCLoaded; }
     static boolean avDeviceLoaded() { return avdeviceLoaded; }
     static boolean avResampleLoaded() { return avresampleLoaded; }
+    static boolean swResampleLoaded() { return swresampleLoaded; }
     static FFMPEGNatives getNatives() { return natives; }
     static boolean initSingleton() { return ready; }
-    
-    private static final boolean initSymbols(boolean[] libsLoaded, boolean[] avdeviceLoaded, boolean[] avresampleLoaded,
-                                             VersionNumber[] versions) {
-        libsLoaded[0] = false;
+
+    /**
+     * @param loaded 6: util, format, codec, device, avresample, swresample
+     * @param versions 5: util, format, codec, avresample, swresample
+     * @return
+     */
+    private static final boolean initSymbols(boolean[] loaded, VersionNumber[] versions) {
+        for(int i=0; i<6; i++) {
+            loaded[i] = false;
+        }
         final DynamicLibraryBundle dl = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() {
                                           public DynamicLibraryBundle run() {
                                               return new DynamicLibraryBundle(new FFMPEGDynamicLibraryBundleInfo());
                                           } } );
-        final boolean avutilLoaded = dl.isToolLibLoaded(0); 
-        final boolean avformatLoaded = dl.isToolLibLoaded(1);
-        final boolean avcodecLoaded = dl.isToolLibLoaded(2);
-        if(!avutilLoaded || !avformatLoaded || !avcodecLoaded) {
-            throw new RuntimeException("FFMPEG Tool library incomplete: [ avutil "+avutilLoaded+", avformat "+avformatLoaded+", avcodec "+avcodecLoaded+"]");
+        dl.toString();
+        for(int i=0; i<6; i++) {
+            loaded[i] = dl.isToolLibLoaded(i);
+        }
+        if( !loaded[LIB_IDX_UTI] || !loaded[LIB_IDX_FMT] || !loaded[LIB_IDX_COD] ) {
+            throw new RuntimeException("FFMPEG Tool library incomplete: [ avutil "+loaded[LIB_IDX_UTI]+", avformat "+loaded[LIB_IDX_FMT]+", avcodec "+loaded[LIB_IDX_COD]+"]");
         }
-        avdeviceLoaded[0] = dl.isToolLibLoaded(3);
-        avresampleLoaded[0] = dl.isToolLibLoaded(4);
-        libsLoaded[0] = true;
-        
         if(symbolNames.length != symbolCount) {
             throw new InternalError("XXX0 "+symbolNames.length+" != "+symbolCount);
         }
@@ -232,20 +270,6 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         final Set<String> optionalSymbolNameSet = new HashSet<String>();
         optionalSymbolNameSet.addAll(Arrays.asList(optionalSymbolNames));
         
-        // alternate symbol name mapping to indexed array
-        final Map<String, Integer> mAltSymbolNames = new HashMap<String, Integer>();
-        final int[][] iAltSymbolNames = new int[altSymbolNames.length][];
-        {
-            final List<String> symbolNameList = Arrays.asList(symbolNames);
-            for(int i=0; i<altSymbolNames.length; i++) {
-                iAltSymbolNames[i] = new int[altSymbolNames[i].length];        
-                for(int j=0; j<altSymbolNames[i].length; j++) {
-                    mAltSymbolNames.put(altSymbolNames[i][j], new Integer(i));
-                    iAltSymbolNames[i][j] = symbolNameList.indexOf(altSymbolNames[i][j]); 
-                }            
-            }
-        }
-        
         // lookup
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
@@ -262,33 +286,18 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
                 // no symbol, check optional and alternative symbols
                 final String symbol = symbolNames[i];
                 if ( !optionalSymbolNameSet.contains(symbol) ) {
-                    // check for API changed symbols
-                    boolean ok = false;                    
-                    final Integer cI = mAltSymbolNames.get(symbol);
-                    if ( null != cI ) {
-                        // check whether alternative symbol is available
-                        final int ci = cI.intValue();
-                        for(int j=0; !ok && j<iAltSymbolNames[ci].length; j++) {
-                            final int si = iAltSymbolNames[ci][j];
-                            ok = 0 != symbolAddr[si];
-                            if(ok && DEBUG) {
-                                System.err.println("OK: Unresolved symbol <"+symbol+">, but has alternative <"+symbolNames[si]+">");
-                            }
-                        }
-                    }
-                    if(!ok) {
-                        System.err.println("Fail: Could not resolve symbol <"+symbolNames[i]+">: not optional, no alternatives.");
-                        res = false;
-                    }
+                    System.err.println("Fail: Could not resolve symbol <"+symbolNames[i]+">: not optional, no alternatives.");
+                    res = false;
                 } else if(DEBUG) {
                     System.err.println("OK: Unresolved optional symbol <"+symbolNames[i]+">");
                 }
             }
         }
-        versions[0] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvCodecVersion0(symbolAddr[0]));
-        versions[1] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvFormatVersion0(symbolAddr[1]));
-        versions[2] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvUtilVersion0(symbolAddr[2]));
-        versions[3] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvResampleVersion0(symbolAddr[3]));
+        versions[0] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[0]));
+        versions[1] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[1]));
+        versions[2] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[2]));
+        versions[3] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[3]));
+        versions[4] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[4]));
         
         return res;
     }
@@ -319,16 +328,18 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     public final List<List<String>> getToolLibNames() {
         List<List<String>> libsList = new ArrayList<List<String>>();
 
+        // 6: util, format, codec, device, avresample, swresample
+        
         final List<String> avutil = new ArrayList<String>();
         avutil.add("avutil");        // default
 
         avutil.add("libavutil.so.53");     // dummy future proof
-        avutil.add("libavutil.so.52");     // 9
+        avutil.add("libavutil.so.52");     // ffmpeg 1.2 + 2 / libav 9 + 10
         avutil.add("libavutil.so.51");     // 0.8
         avutil.add("libavutil.so.50");     // 0.7
         
         avutil.add("avutil-53");     // dummy future proof
-        avutil.add("avutil-52");     // 9
+        avutil.add("avutil-52");     // ffmpeg 1.2 + 2 / libav 9 + 10
         avutil.add("avutil-51");     // 0.8
         avutil.add("avutil-50");     // 0.7
         libsList.add(avutil);
@@ -336,51 +347,69 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         final List<String> avformat = new ArrayList<String>();
         avformat.add("avformat");    // default
 
-        avformat.add("libavformat.so.55"); // dummy future proof
-        avformat.add("libavformat.so.54"); // 9
+        avformat.add("libavformat.so.56"); // dummy future proof
+        avformat.add("libavformat.so.55"); // ffmpeg 2 / libav 10
+        avformat.add("libavformat.so.54"); // ffmpeg 1.2 / libav 9
         avformat.add("libavformat.so.53"); // 0.8
         avformat.add("libavformat.so.52"); // 0.7
         
-        avformat.add("avformat-55"); // dummy future proof
-        avformat.add("avformat-54"); // 9
+        avformat.add("avformat-56"); // dummy future proof
+        avformat.add("avformat-55"); // ffmpeg 2 / libav 10
+        avformat.add("avformat-54"); // ffmpeg 1.2 / libav 9
         avformat.add("avformat-53"); // 0.8
-        avformat.add("avformat-52"); // 0.7
+        avformat.add("avformat-52"); // 0.7        
         libsList.add(avformat);
         
         final List<String> avcodec = new ArrayList<String>();
         avcodec.add("avcodec");      // default
 
-        avcodec.add("libavcodec.so.55");   // dummy future proof
-        avcodec.add("libavcodec.so.54");   // 9
+        avcodec.add("libavcodec.so.56");   // dummy future proof
+        avcodec.add("libavcodec.so.55");   // ffmpeg 2/ libav 10
+        avcodec.add("libavcodec.so.54");   // ffmpeg 1.2 / libav 9
         avcodec.add("libavcodec.so.53");   // 0.8
         avcodec.add("libavcodec.so.52");   // 0.7        
         
-        avcodec.add("avcodec-55");   // dummy future proof
-        avcodec.add("avcodec-54");   // 9
+        avcodec.add("avcodec-56");   // dummy future proof
+        avcodec.add("avcodec-55");   // ffmpeg 2/ libav 10
+        avcodec.add("avcodec-54");   // ffmpeg 1.2 / libav 9
         avcodec.add("avcodec-53");   // 0.8
-        avcodec.add("avcodec-52");   // 0.7
+        avcodec.add("avcodec-52");   // 0.7 
         libsList.add(avcodec);
         
         final List<String> avdevice = new ArrayList<String>();
         avdevice.add("avdevice");        // default
 
-        avdevice.add("libavdevice.so.54");     // dummy future proof
-        avdevice.add("libavdevice.so.53");     // 0.8 && 9
+        avdevice.add("libavdevice.so.56");     // dummy future proof
+        avdevice.add("libavdevice.so.55");     // ffmpeg 2
+        avdevice.add("libavdevice.so.54");     // ffmpeg 1.2 / libav 10
+        avdevice.add("libavdevice.so.53");     // 0.8 && libav 9
         
-        avdevice.add("avdevice-54");     // dummy future proof
-        avdevice.add("avdevice-53");     // 0.8 && 9
+        avdevice.add("avdevice-56");     // dummy future proof
+        avdevice.add("avdevice-55");     // ffmpeg 2
+        avdevice.add("avdevice-54");     // ffmpeg 1.2 / libav 10
+        avdevice.add("avdevice-53");     // 0.8 && libav 9
         libsList.add(avdevice);
         
         final List<String> avresample = new ArrayList<String>();
         avresample.add("avresample");        // default
 
         avresample.add("libavresample.so.2");     // dummy future proof
-        avresample.add("libavresample.so.1");     // 9
+        avresample.add("libavresample.so.1");     // libav 9 + 10
         
         avresample.add("avresample-2");     // dummy future proof
-        avresample.add("avresample-1");     // 9
+        avresample.add("avresample-1");     // libav 9 + 10
         libsList.add(avresample);
 
+        final List<String> swresample = new ArrayList<String>();
+        swresample.add("swresample");        // default
+
+        swresample.add("libswresample.so.1");     // dummy future proof
+        swresample.add("libswresample.so.0");     // ffmpeg 1.2 + 2.x
+        
+        swresample.add("swresample-1");     // dummy future proof
+        swresample.add("swresample-0");     // ffmpeg 1.2 + 2.x
+        libsList.add(swresample);
+        
         return libsList;
     }
 
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 2dd60074c..269500399 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -55,7 +55,7 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
 
 /***
  * Implementation utilizes <a href="http://libav.org/">Libav</a>
- * or  <a href="http://ffmpeg.org/">FFmpeg</a> which is ubiquitous
+ * or  <a href="http://ffmpeg.org/">FFmpeg</a> which are ubiquitous
  * available and usually pre-installed on Unix platforms.
  * <p>
  * Due to legal reasons we cannot deploy binaries of it, which contains patented codecs.
@@ -83,6 +83,7 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  *   <li>{@link PixelFormat#YUV422P}</li>
  *   <li>{@link PixelFormat#YUVJ422P}</li>
  *   <li>{@link PixelFormat#YUYV422}</li>
+ *   <li>{@link PixelFormat#BGR24}</li>
  * </ul>
  * </p>
  * <p>
@@ -104,9 +105,10 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  * <p>
  * Currently we are binary compatible w/:
  * <table border="1">
- * <tr><th>release</th><th>lavc</th><th>lavf</th><th>lavu</th><th>lavr</th> <th>FFMPEG* class</th></tr>
- * <tr><td>0.8</td>    <td>53</td><td>53</td><td>51</td><td></td>           <td>FFMPEGv08</td></tr>
- * <tr><td>9.0</td>    <td>54</td><td>54</td><td>52</td><td>01</td>         <td>FFMPEGv09</td></tr>
+ * <tr><th>libav / ffmpeg</th><th>lavc</th><th>lavf</th><th>lavu</th><th>lavr</th>    <th>FFMPEG* class</th></tr>
+ * <tr><td>0.8</td>           <td>53</td>  <td>53</td>  <td>51</td>  <td></td>        <td>FFMPEGv08</td></tr>
+ * <tr><td>9.0 / 1.2</td>     <td>54</td>  <td>54</td>  <td>52</td>  <td>01/00</td>   <td>FFMPEGv09</td></tr>
+ * <tr><td>10 / 2</td>        <td>55</td>  <td>55</td>  <td>52</td>  <td>01/00</td>   <td>FFMPEGv10</td></tr>
  * </table>
  * </p>
  * <p>
@@ -122,14 +124,19 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  * <a name="todo"><h5>TODO:</h5></a>
  * <p>
  * <ul>
- *   <li>better pts sync handling</li>
+ *   <li>better audio synchronization handling? (video is synchronized)</li>
  * </ul> 
  * </p>
  * 
- * <a name="libavavail"><h5>LibAV Availability</h5></a>
+ * <a name="libavavail"><h5>FFMPEG / LibAV Availability</h5></a>
  * <p>
  * <ul>
- *   <li>Windows: http://win32.libav.org/releases/</li>
+ *   <li>GNU/Linux: ffmpeg or libav are deployed in most distributions.</li>
+ *   <li>Windows: 
+ *   <ul>
+ *     <li>http://ffmpeg.zeranoe.com/builds/ (ffmpeg)</li>
+ *     <li>http://win32.libav.org/releases/  (libav)</li>
+ *   </ul></li>
  *   <li>MacOSX: http://ffmpegmac.net/</li>
  *   <li>OpenIndiana/Solaris:<pre>
  *       pkg set-publisher -p http://pkg.openindiana.org/sfe-encumbered.
@@ -148,7 +155,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     private static final int avUtilMajorVersionCC;
     private static final int avFormatMajorVersionCC;
     private static final int avCodecMajorVersionCC;    
-    private static final int avResampleMajorVersionCC;    
+    private static final int avResampleMajorVersionCC;
+    private static final int swResampleMajorVersionCC;
     private static final boolean available;
     
     static {
@@ -156,24 +164,38 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         final boolean libAVVersionGood;
         if( FFMPEGDynamicLibraryBundleInfo.libsLoaded() ) {
             natives = FFMPEGDynamicLibraryBundleInfo.getNatives();
-            avCodecMajorVersionCC = natives.getAvCodecMajorVersionCC0();
-            avFormatMajorVersionCC = natives.getAvFormatMajorVersionCC0();
-            avUtilMajorVersionCC = natives.getAvUtilMajorVersionCC0();
-            avResampleMajorVersionCC = natives.getAvResampleMajorVersionCC0();
+            if( null != natives ) {
+                avCodecMajorVersionCC = natives.getAvCodecMajorVersionCC0();
+                avFormatMajorVersionCC = natives.getAvFormatMajorVersionCC0();
+                avUtilMajorVersionCC = natives.getAvUtilMajorVersionCC0();
+                avResampleMajorVersionCC = natives.getAvResampleMajorVersionCC0();
+                swResampleMajorVersionCC = natives.getSwResampleMajorVersionCC0();
+            } else {            
+                avUtilMajorVersionCC = 0;
+                avFormatMajorVersionCC = 0;
+                avCodecMajorVersionCC = 0;
+                avResampleMajorVersionCC = 0;
+                swResampleMajorVersionCC = 0;
+            }
             final VersionNumber avCodecVersion = FFMPEGDynamicLibraryBundleInfo.avCodecVersion;
             final VersionNumber avFormatVersion = FFMPEGDynamicLibraryBundleInfo.avFormatVersion;
             final VersionNumber avUtilVersion = FFMPEGDynamicLibraryBundleInfo.avUtilVersion;
-            final VersionNumber avResampleVersion = FFMPEGDynamicLibraryBundleInfo.avResampleVersion;            
+            final VersionNumber avResampleVersion = FFMPEGDynamicLibraryBundleInfo.avResampleVersion;
+            final boolean avResampleLoaded = FFMPEGDynamicLibraryBundleInfo.avResampleLoaded();
+            final VersionNumber swResampleVersion = FFMPEGDynamicLibraryBundleInfo.swResampleVersion;
+            final boolean swResampleLoaded = FFMPEGDynamicLibraryBundleInfo.swResampleLoaded();
             System.err.println("LIB_AV Codec   : "+avCodecVersion+" [cc "+avCodecMajorVersionCC+"]");
             System.err.println("LIB_AV Format  : "+avFormatVersion+" [cc "+avFormatMajorVersionCC+"]");
             System.err.println("LIB_AV Util    : "+avUtilVersion+" [cc "+avUtilMajorVersionCC+"]");
-            System.err.println("LIB_AV Resample: "+FFMPEGDynamicLibraryBundleInfo.avResampleVersion+" [cc "+avResampleMajorVersionCC+", loaded "+FFMPEGDynamicLibraryBundleInfo.avResampleLoaded()+"]");
+            System.err.println("LIB_AV Resample: "+avResampleVersion+" [cc "+avResampleMajorVersionCC+", loaded "+avResampleLoaded+"]");
+            System.err.println("LIB_SW Resample: "+swResampleVersion+" [cc "+swResampleMajorVersionCC+", loaded "+swResampleLoaded+"]");
             System.err.println("LIB_AV Device  : [loaded "+FFMPEGDynamicLibraryBundleInfo.avDeviceLoaded()+"]");
-            System.err.println("LIB_AV Class   : "+natives.getClass().getSimpleName());
+            System.err.println("LIB_AV Class   : "+(null!= natives ? natives.getClass().getSimpleName() : "n/a"));
             libAVVersionGood = avCodecMajorVersionCC  == avCodecVersion.getMajor() &&
                                avFormatMajorVersionCC == avFormatVersion.getMajor() &&
                                avUtilMajorVersionCC   == avUtilVersion.getMajor() &&
-                               avResampleMajorVersionCC  == avResampleVersion.getMajor();
+                               ( !avResampleLoaded || avResampleMajorVersionCC  == avResampleVersion.getMajor() ) &&
+                               ( !swResampleLoaded || swResampleMajorVersionCC  == swResampleVersion.getMajor() ) ;
             if( !libAVVersionGood ) {
                 System.err.println("LIB_AV Not Matching Compile-Time / Runtime Major-Version");
             }
@@ -183,6 +205,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             avFormatMajorVersionCC = 0;
             avCodecMajorVersionCC = 0;
             avResampleMajorVersionCC = 0;
+            swResampleMajorVersionCC = 0;
             libAVVersionGood = false;
         }
         available = libAVGood && libAVVersionGood && null != natives ? natives.initIDs0() : false;
@@ -268,8 +291,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("initStream: p2 preferred "+preferredAudioFormat+", "+this);
         }
         
-        final boolean isCameraInput = null != cameraHostPart;
+        final boolean isCameraInput = null != cameraPath;
         final String resStreamLocS;
+        int rw=640, rh=480, rr=15;
+        String sizes = null;
         if( isCameraInput ) {
             switch(Platform.OS_TYPE) {
                 case ANDROID:
@@ -278,10 +303,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                 case HPUX:
                 case LINUX:
                 case SUNOS:
-                    resStreamLocS = dev_video_linux + cameraHostPart;
+                    resStreamLocS = dev_video_linux + cameraPath;
                     break;
                 case WINDOWS:
-                    resStreamLocS = cameraHostPart;
+                    resStreamLocS = cameraPath;
                     break;
                 case MACOS:
                 case OPENKODE:
@@ -289,13 +314,22 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                     resStreamLocS = streamLocS; // FIXME: ??
                     break;            
             }
+            if( null != cameraProps ) {
+                sizes = cameraProps.get(CameraPropSizeS);
+                int v = getPropIntVal(cameraProps, CameraPropWidth);
+                if( v > 0 ) { rw = v; }
+                v = getPropIntVal(cameraProps, CameraPropHeight);
+                if( v > 0 ) { rh = v; }
+                v = getPropIntVal(cameraProps, CameraPropRate);
+                if( v > 0 ) { rr = v; }
+            }
         } else {
             resStreamLocS = streamLocS;
         }
         final int aMaxChannelCount = audioSink.getMaxSupportedChannels();
         final int aPrefSampleRate = preferredAudioFormat.sampleRate;
          // setStream(..) issues updateAttributes*(..), and defines avChosenAudioFormat, vid, aid, .. etc
-        natives.setStream0(moviePtr, resStreamLocS, isCameraInput, vid, aid, aMaxChannelCount, aPrefSampleRate);
+        natives.setStream0(moviePtr, resStreamLocS, isCameraInput, vid, sizes, rw, rh, rr, aid, aMaxChannelCount, aPrefSampleRate);
     }
 
     @Override
@@ -373,11 +407,19 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                             tf = GL2ES2.GL_RG;   tif=GL2ES2.GL_RG; break;
                         }
                 case 3: tf = GL2ES2.GL_RGB;   tif=GL.GL_RGB;   break;
-                case 4: tf = GL2ES2.GL_RGBA;  tif=GL.GL_RGBA;  break;
+                case 4: if( vPixelFmt == PixelFormat.BGRA ) {
+                            tf = GL2ES2.GL_BGRA;  tif=GL.GL_RGBA;  break;
+                        } else {
+                            tf = GL2ES2.GL_RGBA;  tif=GL.GL_RGBA;  break;
+                        }                    
                 default: throw new RuntimeException("Unsupported bytes-per-pixel / plane "+vBytesPerPixelPerPlane);
             }        
             setTextureFormat(tif, tf);
             setTextureType(tt);
+            if(DEBUG) {
+                System.err.println("initGL: p5: video "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane+
+                                   ", tex "+texWidth+"x"+texHeight+", usesTexLookupShader "+usesTexLookupShader);
+            }
         }
     }    
     @Override
@@ -470,9 +512,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      * @param planes
      * @param bitsPerPixel
      * @param bytesPerPixelPerPlane
-     * @param lSz0
-     * @param lSz1
-     * @param lSz2
      * @param tWd0
      * @param tWd1
      * @param tWd2
@@ -483,7 +522,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      * @param audioSamplesPerFrameAndChannel in audio samples per frame and channel
      */
     void updateAttributes2(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
-                           int lSz0, int lSz1, int lSz2,
                            int tWd0, int tWd1, int tWd2, int vW, int vH,
                            int aid, int audioSampleFmt, int audioSampleRate, 
                            int audioChannels, int audioSamplesPerFrameAndChannel) {
@@ -495,7 +533,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         usesTexLookupShader = false;
         texWidth = 0; texHeight = 0;
         
-        final int[] vLinesize = { 0, 0, 0 }; // per plane
         final int[] vTexWidth = { 0, 0, 0 }; // per plane
         
         if( STREAM_ID_NONE != vid ) {
@@ -503,7 +540,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             vPlanes = planes;
             vBitsPerPixel = bitsPerPixel;
             vBytesPerPixelPerPlane = bytesPerPixelPerPlane;                        
-            vLinesize[0] = lSz0; vLinesize[1] = lSz1; vLinesize[2] = lSz2;
             vTexWidth[0] = tWd0; vTexWidth[1] = tWd1; vTexWidth[2] = tWd2;
             
             switch(vPixelFmt) {
@@ -533,11 +569,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                     texWidth = vTexWidth[0] + vTexWidth[1] + vTexWidth[2]; texHeight = vH;
                     break;
                 case YUYV422: // < packed YUV 4:2:2, 2x 16bpp, Y0 Cb Y1 Cr - stuffed into RGBA half width texture
+                case BGR24:
                     usesTexLookupShader = true;
                     texWidth = vTexWidth[0]; texHeight = vH; 
                     break;
+                    
                 case RGB24:
-                case BGR24:
                 case ARGB:
                 case RGBA:
                 case ABGR:
@@ -567,9 +604,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("audio: id "+aid+", fmt "+aSampleFmt+", "+avChosenAudioFormat+", aFrameSize/fc "+audioSamplesPerFrameAndChannel);
             System.err.println("video: id "+vid+", fmt "+vW+"x"+vH+", "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane+", usesTexLookupShader "+usesTexLookupShader);
             for(int i=0; i<3; i++) {
-                System.err.println("video: "+i+": "+vTexWidth[i]+"/"+vLinesize[i]);
+                System.err.println("video: p["+i+"]: "+vTexWidth[i]);
             }
             System.err.println("video: total tex "+texWidth+"x"+texHeight);
+            System.err.println(this.toString());
         }
     }
     
@@ -674,6 +712,15 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
               "  return vec4(r, g, b, 1);\n"+
               "}\n"
           ;
+        case BGR24:
+          return
+              "vec4 "+texLookupFuncName+"(in "+getTextureSampler2DType()+" image, in vec2 texCoord) {\n"+
+              "  "+
+              "  vec3 bgr = texture2D(image, texCoord).rgb;\n"+
+              "  return vec4(bgr.b, bgr.g, bgr.r, 1);\n"+ /* just swizzle */
+              "}\n"
+          ;
+
         default: // FIXME: Add more formats !
           throw new InternalError("Add proper mapping of: vPixelFmt "+vPixelFmt+", usesTexLookupShader "+usesTexLookupShader);
       }        
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
index 3ee87b5da..b919f22c7 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
@@ -27,7 +27,6 @@
  */
 package jogamp.opengl.util.av.impl;
 
-import com.jogamp.opengl.util.av.AudioSink;
 import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 interface FFMPEGNatives {
@@ -37,6 +36,7 @@ interface FFMPEGNatives {
     int getAvFormatMajorVersionCC0();
     int getAvCodecMajorVersionCC0();
     int getAvResampleMajorVersionCC0();
+    int getSwResampleMajorVersionCC0();
     boolean initIDs0();
     
     long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
@@ -45,21 +45,22 @@ interface FFMPEGNatives {
     /**
      * Issues {@link #updateAttributes(int, int, int, int, int, int, int, float, int, int, String, String)}
      * and {@link #updateAttributes2(int, int, int, int, int, int, int, int, int, int)}.
-     * <p>
-     * Always uses {@link AudioSink.AudioFormat}:
-     * <pre>
-     *   [type PCM, sampleRate [10000(?)..44100..48000], sampleSize 16, channelCount 1-2, signed, littleEndian]
-     * </pre>
-     * </p>
      * 
      * @param moviePtr
      * @param url
      * @param vid
+     * @param sizes requested video size as string, i.e. 'hd720'. May be null to favor vWidth and vHeight.
+     * @param vWidth requested video width (for camera mode)
+     * @param vHeight requested video width (for camera mode)
+     * @param vRate requested video framerate (for camera mode)
      * @param aid
-     * @param aPrefChannelCount
      * @param aPrefSampleRate
+     * @param aPrefChannelCount
      */
-    void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
+    void setStream0(long moviePtr, String url, boolean isCameraInput, 
+                    int vid, String sizes, int vWidth, int vHeight, 
+                    int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
+    
     void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
 
     int getVideoPTS0(long moviePtr);    
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
index 9ee0198f4..16ee2dd4b 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
@@ -35,8 +35,5 @@ class FFMPEGStaticNatives {
                                   ( vers >>  8 ) & 0xFF,
                                   ( vers >>  0 ) & 0xFF );
     }
-    static native int getAvUtilVersion0(long func);
-    static native int getAvFormatVersion0(long func);
-    static native int getAvCodecVersion0(long func);
-    static native int getAvResampleVersion0(long func);
+    static native int getAvVersion0(long func);
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
index 3b2567655..2a0c9dc3d 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
@@ -43,6 +43,9 @@ class FFMPEGv08Natives implements FFMPEGNatives {
     @Override
     public native int getAvResampleMajorVersionCC0();
 
+    @Override
+    public native int getSwResampleMajorVersionCC0();
+    
     @Override
     public native boolean initIDs0();
 
@@ -53,7 +56,7 @@ class FFMPEGv08Natives implements FFMPEGNatives {
     public native void destroyInstance0(long moviePtr);
 
     @Override
-    public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
+    public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, String sizes, int vWidth, int vHeight, int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
 
     @Override
     public native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
index 6c56d3ccb..422f1ceb0 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
@@ -43,6 +43,9 @@ class FFMPEGv09Natives implements FFMPEGNatives {
     @Override
     public native int getAvResampleMajorVersionCC0();
 
+    @Override
+    public native int getSwResampleMajorVersionCC0();
+    
     @Override
     public native boolean initIDs0();
 
@@ -53,7 +56,7 @@ class FFMPEGv09Natives implements FFMPEGNatives {
     public native void destroyInstance0(long moviePtr);
 
     @Override
-    public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
+    public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, String sizes, int vWidth, int vHeight, int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
 
     @Override
     public native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
new file mode 100644
index 000000000..e3007ab69
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
@@ -0,0 +1,81 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.util.av.impl;
+
+class FFMPEGv10Natives implements FFMPEGNatives {
+    @Override
+    public native boolean initSymbols0(long[] symbols, int count);
+
+    @Override
+    public native int getAvUtilMajorVersionCC0();
+
+    @Override
+    public native int getAvFormatMajorVersionCC0();
+
+    @Override
+    public native int getAvCodecMajorVersionCC0();
+
+    @Override
+    public native int getAvResampleMajorVersionCC0();
+
+    @Override
+    public native int getSwResampleMajorVersionCC0();
+    
+    @Override
+    public native boolean initIDs0();
+
+    @Override
+    public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
+
+    @Override
+    public native void destroyInstance0(long moviePtr);
+
+    @Override
+    public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, String sizes, int vWidth, int vHeight, int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
+
+    @Override
+    public native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
+
+    @Override
+    public native int getVideoPTS0(long moviePtr);
+
+    @Override
+    public native int getAudioPTS0(long moviePtr);
+
+    @Override
+    public native int readNextPacket0(long moviePtr, int texTarget, int texFmt, int texType);
+
+    @Override
+    public native int play0(long moviePtr);
+
+    @Override
+    public native int pause0(long moviePtr);
+
+    @Override
+    public native int seek0(long moviePtr, int position);
+}
diff --git a/src/jogl/native/libav/ffmpeg_dshow.c b/src/jogl/native/libav/ffmpeg_dshow.c
new file mode 100644
index 000000000..4f8fedb9f
--- /dev/null
+++ b/src/jogl/native/libav/ffmpeg_dshow.c
@@ -0,0 +1,209 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+#include "ffmpeg_dshow.h"
+
+#ifdef _WIN32
+
+#include <stdio.h>
+#include <string.h>
+#include <dshow.h>
+#include <tchar.h>
+
+static HRESULT EnumerateDevices(REFGUID category, IEnumMoniker **ppEnum)
+{
+    // Create the System Device Enumerator.
+    ICreateDevEnum *pDevEnum;
+    void *pv = NULL;
+
+    HRESULT hr = CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, &IID_ICreateDevEnum, (void**)&pDevEnum);
+
+    if (SUCCEEDED(hr)) {
+        // Create an enumerator for the category.
+        hr = pDevEnum->lpVtbl->CreateClassEnumerator(pDevEnum, category, ppEnum,0);
+        if (hr == S_FALSE)
+        {
+            hr = VFW_E_NOT_FOUND;  // The category is empty. Treat as an error.
+        }
+        pDevEnum->lpVtbl->Release(pDevEnum);
+    }
+    return hr;
+}
+
+static void getBSTRChars(BSTR bstr, char *pDest, int destLen) {
+
+ #ifdef UNICODE
+     _sntprintf(pDest, destLen, _T("%s"), bstr);
+ #else
+     _sntprintf(pDest, destLen, _T("%S"), bstr);
+ #endif 
+}
+
+
+static int GetDeviceInformation(IEnumMoniker *pEnum, int verbose, int devIdx,
+                                char *pDescr, int descrSize,  
+                                char *pName, int nameSize, 
+                                char *pPath, int pathSize, int *pWaveID) {
+    IMoniker *pMoniker = NULL;
+    int i=0;
+    int res = devIdx >= 0 ? -1 : 0;
+
+    if( NULL != pDescr ) {
+        *pDescr=0;
+    }
+    if( NULL != pName ) {
+        *pName=0;
+    }
+    if( NULL != pPath ) {
+        *pPath=0;
+    }
+    if( NULL != pWaveID ) {
+        *pWaveID=0;
+    }
+
+    while (pEnum->lpVtbl->Next(pEnum, 1, &pMoniker, NULL) == S_OK) {
+        IPropertyBag *pPropBag;
+        HRESULT hr;
+        
+        hr = pMoniker->lpVtbl->BindToStorage(pMoniker, 0, 0, &IID_IPropertyBag, (void**)&pPropBag);
+        if (FAILED(hr)) {
+            if( verbose ) {
+                fprintf(stderr, "DShowParser: Dev[%d]: bind failed ...\n", i);
+            }
+            pMoniker->lpVtbl->Release(pMoniker);
+            continue;  
+        } 
+        VARIANT var;
+        VariantInit(&var);
+
+        // Get description or friendly name.
+        hr = pPropBag->lpVtbl->Read(pPropBag, L"Description", &var, 0);
+        if (SUCCEEDED(hr)) {
+            if( i == devIdx && NULL != pDescr ) {
+                res = 0;
+                getBSTRChars(var.bstrVal, pDescr, descrSize);
+            }
+            if( verbose ) {
+                fprintf(stderr, "DShowParser: Dev[%d]: Descr %S\n", i, var.bstrVal);
+            }
+            VariantClear(&var); 
+        } else if( verbose ) {
+            fprintf(stderr, "DShowParser: Dev[%d]: cannot read Descr..\n", i);
+        }
+
+        hr = pPropBag->lpVtbl->Read(pPropBag, L"FriendlyName", &var, 0);
+        if (SUCCEEDED(hr)) {
+            if( i == devIdx && NULL != pName ) {
+                res = 0;
+                getBSTRChars(var.bstrVal, pName, nameSize);
+            }
+            if( verbose ) {
+                fprintf(stderr, "DShowParser: Dev[%d]: FName %S\n", i, var.bstrVal);
+            }
+            VariantClear(&var); 
+        } else if( verbose ) {
+            fprintf(stderr, "DShowParser: Dev[%d]: cannot read FName..\n", i);
+        }
+
+        hr = pPropBag->lpVtbl->Write(pPropBag, L"FriendlyName", &var);
+
+        // WaveInID applies only to audio capture devices.
+        hr = pPropBag->lpVtbl->Read(pPropBag, L"WaveInID", &var, 0);
+        if (SUCCEEDED(hr)) {
+            if( i == devIdx && NULL != pWaveID ) {
+                res = 0;
+                *pWaveID=(int)var.lVal;
+            }
+            if( verbose ) {
+                fprintf(stderr, "DShowParser: Dev[%d]: WaveInID %d\n", i, var.lVal);
+            }
+            VariantClear(&var); 
+        }
+
+        hr = pPropBag->lpVtbl->Read(pPropBag, L"DevicePath", &var, 0);
+        if (SUCCEEDED(hr)) {
+            if( i == devIdx && NULL != pPath ) {
+                res = 0;
+                getBSTRChars(var.bstrVal, pPath, pathSize);
+            }
+            if( verbose ) {
+                fprintf(stderr, "DShowParser: Dev[%d]: Path %S\n", i, var.bstrVal);
+            }
+            VariantClear(&var); 
+        }
+
+        pPropBag->lpVtbl->Release(pPropBag);
+        pMoniker->lpVtbl->Release(pMoniker);
+
+        if( devIdx >= 0 && i == devIdx ) {
+            break; // done!
+        }
+        i++;
+    }
+    return res;
+}
+
+int findDShowVideoDevice(char * dest, int destSize, int devIdx, int verbose) {
+    int res = -1;
+
+    HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
+    if (SUCCEEDED(hr)) {
+        IEnumMoniker *pEnum;
+
+        hr = EnumerateDevices(&CLSID_VideoInputDeviceCategory, &pEnum);
+        if (SUCCEEDED(hr)) {
+            res = GetDeviceInformation(pEnum, verbose, devIdx, NULL /* pDescr */, 0, dest, destSize, NULL /* pPath */, 0, NULL /* pWaveID */);
+            pEnum->lpVtbl->Release(pEnum);
+            if( verbose ) {
+                fprintf(stderr, "DShowParser: Get VideoInputDevice: res %d, '%s'\n", res, dest);
+            }
+        } else if( verbose ) {
+            fprintf(stderr, "DShowParser: Get VideoInputDevice failed\n");
+        }
+        /**
+        hr = EnumerateDevices(&CLSID_AudioInputDeviceCategory, &pEnum);
+        if (SUCCEEDED(hr)) {
+            res = GetDeviceInformation(pEnum, verbose, devIdx, NULL, 0, NULL, 0, NULL, 0, NULL);
+            pEnum->lpVtbl->Release(pEnum);
+        } else if( verbose ) {
+            fprintf(stderr, "DShowParser: Get AudioInputDevice failed\n");
+        } */
+        CoUninitialize();
+    } else if( verbose ) {
+        fprintf(stderr, "DShowParser: CoInit failed\n");
+    }
+    return res;
+}
+
+#else
+
+int findDShowVideoDevice(char * dest, int destSize, int devIdx, int verbose) {
+    return -1;
+}
+
+#endif
diff --git a/src/jogl/native/libav/ffmpeg_dshow.h b/src/jogl/native/libav/ffmpeg_dshow.h
new file mode 100644
index 000000000..e4ef7096b
--- /dev/null
+++ b/src/jogl/native/libav/ffmpeg_dshow.h
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+#ifndef _FFMPEG_TOOL_H
+#define _FFMPEG_TOOL_H
+
+#ifdef _WIN32
+
+#include <windows.h>
+
+#endif // _WIN32 
+
+#include <gluegen_stdint.h>
+#include <gluegen_inttypes.h>
+#include <gluegen_stddef.h>
+#include <gluegen_stdint.h>
+
+extern int findDShowVideoDevice(char * dest, int destSize, int devIdx, int verbose);
+
+
+#endif // _FFMPEG_TOOL_H
+
diff --git a/src/jogl/native/libav/ffmpeg_impl_template.c b/src/jogl/native/libav/ffmpeg_impl_template.c
index 822007136..9f371a720 100644
--- a/src/jogl/native/libav/ffmpeg_impl_template.c
+++ b/src/jogl/native/libav/ffmpeg_impl_template.c
@@ -30,6 +30,7 @@
 
 #include "JoglCommon.h"
 #include "ffmpeg_tool.h"
+#include "ffmpeg_dshow.h"
 
 #include "libavutil/pixdesc.h"
 #include "libavutil/samplefmt.h"
@@ -50,28 +51,35 @@ static jmethodID jni_mid_isAudioFormatSupported = NULL;
 
 #define HAS_FUNC(f) (NULL!=(f))
 
-typedef unsigned (APIENTRYP AVCODEC_VERSION)(void);
 typedef unsigned (APIENTRYP AVUTIL_VERSION)(void);
 typedef unsigned (APIENTRYP AVFORMAT_VERSION)(void);
+typedef unsigned (APIENTRYP AVCODEC_VERSION)(void);
 typedef unsigned (APIENTRYP AVRESAMPLE_VERSION)(void);
+typedef unsigned (APIENTRYP SWRESAMPLE_VERSION)(void);
 
-static AVCODEC_VERSION sp_avcodec_version;
-static AVFORMAT_VERSION sp_avformat_version; 
 static AVUTIL_VERSION sp_avutil_version;
+static AVFORMAT_VERSION sp_avformat_version; 
+static AVCODEC_VERSION sp_avcodec_version;
 static AVRESAMPLE_VERSION sp_avresample_version;
-// count: 4
+static SWRESAMPLE_VERSION sp_swresample_version;
+// count: 5
 
 // libavcodec
 typedef int (APIENTRYP AVCODEC_REGISTER_ALL)(void);
 typedef int (APIENTRYP AVCODEC_CLOSE)(AVCodecContext *avctx);
 typedef void (APIENTRYP AVCODEC_STRING)(char *buf, int buf_size, AVCodecContext *enc, int encode);
-typedef AVCodec *(APIENTRYP AVCODEC_FIND_DECODER)(enum CodecID id);
+typedef AVCodec *(APIENTRYP AVCODEC_FIND_DECODER)(int avCodecID); // lavc 53: 'enum CodecID id', lavc 54: 'enum AVCodecID id'
 typedef int (APIENTRYP AVCODEC_OPEN2)(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options);                          // 53.6.0
 typedef AVFrame *(APIENTRYP AVCODEC_ALLOC_FRAME)(void);
 typedef void (APIENTRYP AVCODEC_GET_FRAME_DEFAULTS)(AVFrame *frame);
 typedef void (APIENTRYP AVCODEC_FREE_FRAME)(AVFrame **frame);
-typedef int (APIENTRYP AVCODEC_DEFAULT_GET_BUFFER)(AVCodecContext *s, AVFrame *pic);
-typedef void (APIENTRYP AVCODEC_DEFAULT_RELEASE_BUFFER)(AVCodecContext *s, AVFrame *pic);
+typedef int (APIENTRYP AVCODEC_DEFAULT_GET_BUFFER)(AVCodecContext *s, AVFrame *pic); // <= 54 (opt), else AVCODEC_DEFAULT_GET_BUFFER2
+typedef void (APIENTRYP AVCODEC_DEFAULT_RELEASE_BUFFER)(AVCodecContext *s, AVFrame *pic); // <= 54 (opt), else AV_FRAME_UNREF
+typedef int (APIENTRYP AVCODEC_DEFAULT_GET_BUFFER2)(AVCodecContext *s, AVFrame *frame, int flags); // 55. (opt)
+typedef int (APIENTRYP AVCODEC_GET_EDGE_WIDTH)();
+typedef int (APIENTRYP AV_IMAGE_FILL_LINESIZES)(int linesizes[4], int pix_fmt, int width); // lavu 51: 'enum PixelFormat pix_fmt', lavu 53: 'enum AVPixelFormat pix_fmt'
+typedef void (APIENTRYP AVCODEC_ALIGN_DIMENSIONS)(AVCodecContext *s, int *width, int *height);
+typedef void (APIENTRYP AVCODEC_ALIGN_DIMENSIONS2)(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]);
 typedef void (APIENTRYP AVCODEC_FLUSH_BUFFERS)(AVCodecContext *avctx);
 typedef void (APIENTRYP AV_INIT_PACKET)(AVPacket *pkt);
 typedef int (APIENTRYP AV_NEW_PACKET)(AVPacket *pkt, int size);
@@ -88,8 +96,13 @@ static AVCODEC_OPEN2 sp_avcodec_open2;                    // 53.6.0
 static AVCODEC_ALLOC_FRAME sp_avcodec_alloc_frame;
 static AVCODEC_GET_FRAME_DEFAULTS sp_avcodec_get_frame_defaults;
 static AVCODEC_FREE_FRAME sp_avcodec_free_frame;
-static AVCODEC_DEFAULT_GET_BUFFER sp_avcodec_default_get_buffer;
-static AVCODEC_DEFAULT_RELEASE_BUFFER sp_avcodec_default_release_buffer;
+static AVCODEC_DEFAULT_GET_BUFFER sp_avcodec_default_get_buffer; // <= 54 (opt), else sp_avcodec_default_get_buffer2
+static AVCODEC_DEFAULT_RELEASE_BUFFER sp_avcodec_default_release_buffer; // <= 54 (opt), else sp_av_frame_unref
+static AVCODEC_DEFAULT_GET_BUFFER2 sp_avcodec_default_get_buffer2; // 55. (opt)
+static AVCODEC_GET_EDGE_WIDTH sp_avcodec_get_edge_width;
+static AV_IMAGE_FILL_LINESIZES sp_av_image_fill_linesizes;
+static AVCODEC_ALIGN_DIMENSIONS sp_avcodec_align_dimensions;
+static AVCODEC_ALIGN_DIMENSIONS2 sp_avcodec_align_dimensions2;
 static AVCODEC_FLUSH_BUFFERS sp_avcodec_flush_buffers;
 static AV_INIT_PACKET sp_av_init_packet;
 static AV_NEW_PACKET sp_av_new_packet;
@@ -97,7 +110,7 @@ static AV_DESTRUCT_PACKET sp_av_destruct_packet;
 static AV_FREE_PACKET sp_av_free_packet;
 static AVCODEC_DECODE_AUDIO4 sp_avcodec_decode_audio4;    // 53.25.0
 static AVCODEC_DECODE_VIDEO2 sp_avcodec_decode_video2;    // 52.23.0
-// count: 21
+// count: 27
 
 // libavutil
 typedef void (APIENTRYP AV_FRAME_UNREF)(AVFrame *frame);
@@ -108,7 +121,7 @@ typedef int (APIENTRYP AV_SAMPLES_GET_BUFFER_SIZE)(int *linesize, int nb_channel
 typedef int (APIENTRYP AV_GET_BYTES_PER_SAMPLE)(enum AVSampleFormat sample_fmt);
 typedef int (APIENTRYP AV_OPT_SET_INT)(void *obj, const char *name, int64_t val, int search_flags);
 typedef AVDictionaryEntry* (APIENTRYP AV_DICT_GET)(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
-typedef int (APIENTRYP AV_DICT_COUNT)(AVDictionary **m);
+typedef int (APIENTRYP AV_DICT_COUNT)(AVDictionary *m);
 typedef int (APIENTRYP AV_DICT_SET)(AVDictionary **pm, const char *key, const char *value, int flags);
 typedef void (APIENTRYP AV_DICT_FREE)(AVDictionary **m);
 
@@ -124,7 +137,7 @@ static AV_DICT_GET sp_av_dict_get;
 static AV_DICT_COUNT sp_av_dict_count;
 static AV_DICT_SET sp_av_dict_set;
 static AV_DICT_FREE sp_av_dict_free;
-// count: 33
+// count: 39
 
 // libavformat
 typedef AVFormatContext *(APIENTRYP AVFORMAT_ALLOC_CONTEXT)(void);
@@ -158,12 +171,12 @@ static AV_READ_PAUSE sp_av_read_pause;
 static AVFORMAT_NETWORK_INIT sp_avformat_network_init;            // 53.13.0
 static AVFORMAT_NETWORK_DEINIT sp_avformat_network_deinit;        // 53.13.0
 static AVFORMAT_FIND_STREAM_INFO sp_avformat_find_stream_info;    // 53.3.0
-// count: 48
+// count: 54
 
 // libavdevice [53.0.0]
 typedef int (APIENTRYP AVDEVICE_REGISTER_ALL)(void);
 static AVDEVICE_REGISTER_ALL sp_avdevice_register_all;
-// count: 49
+// count: 55
 
 // libavresample [1.0.1]
 typedef AVAudioResampleContext* (APIENTRYP AVRESAMPLE_ALLOC_CONTEXT)(void);  // 1.0.1
@@ -178,9 +191,23 @@ static AVRESAMPLE_OPEN sp_avresample_open;
 static AVRESAMPLE_CLOSE sp_avresample_close;
 static AVRESAMPLE_FREE sp_avresample_free;
 static AVRESAMPLE_CONVERT sp_avresample_convert;
-// count: 54
+// count: 60
+
+// libswresample [1...]
+typedef int (APIENTRYP AV_OPT_SET_SAMPLE_FMT)(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags); // actually lavu .. but exist only w/ swresample!
+typedef struct SwrContext *(APIENTRYP SWR_ALLOC)(void);
+typedef int (APIENTRYP SWR_INIT)(struct SwrContext *s);
+typedef void (APIENTRYP SWR_FREE)(struct SwrContext **s);
+typedef int (APIENTRYP SWR_CONVERT)(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count);
 
-#define SYMBOL_COUNT 54
+static AV_OPT_SET_SAMPLE_FMT sp_av_opt_set_sample_fmt;
+static SWR_ALLOC sp_swr_alloc;
+static SWR_INIT sp_swr_init;
+static SWR_FREE sp_swr_free;
+static SWR_CONVERT sp_swr_convert;
+// count: 65
+
+#define SYMBOL_COUNT 65
 
 JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
   (JNIEnv *env, jobject instance, jobject jSymbols, jint count)
@@ -198,10 +225,11 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
     i = 0;
     symbols = (int64_t *) (*env)->GetPrimitiveArrayCritical(env, jSymbols, NULL);
 
-    sp_avcodec_version = (AVCODEC_VERSION) (intptr_t) symbols[i++];
-    sp_avformat_version = (AVFORMAT_VERSION) (intptr_t) symbols[i++];
     sp_avutil_version = (AVUTIL_VERSION) (intptr_t) symbols[i++];
+    sp_avformat_version = (AVFORMAT_VERSION) (intptr_t) symbols[i++];
+    sp_avcodec_version = (AVCODEC_VERSION) (intptr_t) symbols[i++];
     sp_avresample_version = (AVRESAMPLE_VERSION) (intptr_t) symbols[i++];
+    sp_swresample_version = (SWRESAMPLE_VERSION) (intptr_t) symbols[i++];
 
     sp_avcodec_register_all = (AVCODEC_REGISTER_ALL)  (intptr_t) symbols[i++];
     sp_avcodec_close = (AVCODEC_CLOSE)  (intptr_t) symbols[i++];
@@ -213,6 +241,11 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
     sp_avcodec_free_frame = (AVCODEC_FREE_FRAME) (intptr_t) symbols[i++];
     sp_avcodec_default_get_buffer = (AVCODEC_DEFAULT_GET_BUFFER) (intptr_t) symbols[i++];
     sp_avcodec_default_release_buffer = (AVCODEC_DEFAULT_RELEASE_BUFFER) (intptr_t) symbols[i++];
+    sp_avcodec_default_get_buffer2 = (AVCODEC_DEFAULT_GET_BUFFER2) (intptr_t) symbols[i++];
+    sp_avcodec_get_edge_width = (AVCODEC_GET_EDGE_WIDTH) (intptr_t) symbols[i++];
+    sp_av_image_fill_linesizes = (AV_IMAGE_FILL_LINESIZES) (intptr_t) symbols[i++];
+    sp_avcodec_align_dimensions = (AVCODEC_ALIGN_DIMENSIONS) (intptr_t) symbols[i++];
+    sp_avcodec_align_dimensions2 = (AVCODEC_ALIGN_DIMENSIONS2) (intptr_t) symbols[i++];
     sp_avcodec_flush_buffers = (AVCODEC_FLUSH_BUFFERS) (intptr_t) symbols[i++];
     sp_av_init_packet = (AV_INIT_PACKET) (intptr_t) symbols[i++];
     sp_av_new_packet = (AV_NEW_PACKET) (intptr_t) symbols[i++];
@@ -258,6 +291,12 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
     sp_avresample_free = (AVRESAMPLE_FREE) (intptr_t) symbols[i++];
     sp_avresample_convert = (AVRESAMPLE_CONVERT) (intptr_t) symbols[i++];
 
+    sp_av_opt_set_sample_fmt = (AV_OPT_SET_SAMPLE_FMT) (intptr_t) symbols[i++];
+    sp_swr_alloc = (SWR_ALLOC) (intptr_t) symbols[i++];
+    sp_swr_init = (SWR_INIT) (intptr_t) symbols[i++];
+    sp_swr_free = (SWR_FREE) (intptr_t) symbols[i++];
+    sp_swr_convert = (SWR_CONVERT) (intptr_t) symbols[i++];
+
     (*env)->ReleasePrimitiveArrayCritical(env, jSymbols, symbols, 0);
 
     if(SYMBOL_COUNT != i) {
@@ -282,7 +321,6 @@ static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasic
         (*env)->CallVoidMethod(env, pAV->ffmpegMediaPlayer, jni_mid_updateAttributes2,
                                pAV->vid, pAV->vPixFmt, pAV->vBufferPlanes, 
                                pAV->vBitsPerPixel, pAV->vBytesPerPixelPerPlane,
-                               pAV->vLinesize[0], pAV->vLinesize[1], pAV->vLinesize[2],
                                pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2],
                                pAV->vWidth, pAV->vHeight,
                                pAV->aid, pAV->aSampleFmtOut, pAV->aSampleRateOut, pAV->aChannelsOut, pAV->aFrameSize);
@@ -300,9 +338,13 @@ static void freeInstance(JNIEnv *env, FFMPEGToolBasicAV_t* pAV) {
     int i;
     if(NULL != pAV) {
         // Close the A resampler
-        if( NULL != pAV->aResampleCtx ) {
-            sp_avresample_free(&pAV->aResampleCtx);
-            pAV->aResampleCtx = NULL;
+        if( NULL != pAV->avResampleCtx ) {
+            sp_avresample_free(&pAV->avResampleCtx);
+            pAV->avResampleCtx = NULL;
+        }
+        if( NULL != pAV->swResampleCtx ) {
+            sp_swr_free(&pAV->swResampleCtx);
+            pAV->swResampleCtx = NULL;
         }
         if( NULL != pAV->aResampleBuffer ) {
             sp_av_free(pAV->aResampleBuffer);
@@ -430,9 +472,15 @@ JNIEXPORT jint JNICALL FF_FUNC(getAvResampleMajorVersionCC0)
     return (jint) LIBAVRESAMPLE_VERSION_MAJOR;
 }
 
+JNIEXPORT jint JNICALL FF_FUNC(getSwResampleMajorVersionCC0)
+  (JNIEnv *env, jobject instance) {
+    return (jint) LIBSWRESAMPLE_VERSION_MAJOR;
+}
+
 JNIEXPORT jboolean JNICALL FF_FUNC(initIDs0)
   (JNIEnv *env, jobject instance)
 {
+    jboolean res = JNI_TRUE;
     JoglCommon_init(env);
 
     jclass c;
@@ -452,7 +500,7 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initIDs0)
 
     jni_mid_pushSound = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "pushSound", "(Ljava/nio/ByteBuffer;II)V");
     jni_mid_updateAttributes1 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIIIFIIILjava/lang/String;Ljava/lang/String;)V");
-    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIIIIIII)V");
+    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIIII)V");
     jni_mid_isAudioFormatSupported = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "isAudioFormatSupported", "(III)Z");
 
     if(jni_mid_pushSound == NULL ||
@@ -461,7 +509,22 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initIDs0)
        jni_mid_isAudioFormatSupported == NULL) {
         return JNI_FALSE;
     }
-    return JNI_TRUE;
+    #if LIBAVCODEC_VERSION_MAJOR >= 55
+        if(!HAS_FUNC(sp_avcodec_default_get_buffer2) || 
+           !HAS_FUNC(sp_av_frame_unref) ) {
+            fprintf(stderr, "avcodec >= 55: avcodec_default_get_buffer2 %p, av_frame_unref %p\n", 
+                sp_avcodec_default_get_buffer2, sp_av_frame_unref);
+            res = JNI_FALSE;
+        }
+    #else
+        if(!HAS_FUNC(sp_avcodec_default_get_buffer) || 
+           !HAS_FUNC(sp_avcodec_default_release_buffer)) {
+            fprintf(stderr, "avcodec < 55: avcodec_default_get_buffer %p, sp_avcodec_default_release_buffer %p\n", 
+                sp_avcodec_default_get_buffer2, sp_avcodec_default_release_buffer);
+            res = JNI_FALSE;
+        }
+    #endif
+    return res;
 }
 
 JNIEXPORT jlong JNICALL FF_FUNC(createInstance0)
@@ -480,6 +543,11 @@ JNIEXPORT jlong JNICALL FF_FUNC(createInstance0)
     } else {
         pAV->avresampleVersion = 0;
     }
+    if(HAS_FUNC(sp_swresample_version)) {
+        pAV->swresampleVersion = sp_swresample_version();
+    } else {
+        pAV->swresampleVersion = 0;
+    }
 
     #if LIBAVCODEC_VERSION_MAJOR >= 55
         // TODO: We keep code on using 1 a/v frame per decoding cycle now.
@@ -496,6 +564,10 @@ JNIEXPORT jlong JNICALL FF_FUNC(createInstance0)
     pAV->vid=AV_STREAM_ID_AUTO;
     pAV->aid=AV_STREAM_ID_AUTO;
 
+    if(pAV->verbose) {
+        fprintf(stderr, "Info: Use avresample %d, swresample %d, device %d, refCount %d\n", 
+            AV_HAS_API_AVRESAMPLE(pAV), AV_HAS_API_SWRESAMPLE(pAV), HAS_FUNC(sp_avdevice_register_all), pAV->useRefCountedFrames);
+    }
     return (jlong) (intptr_t) pAV;
 }
 
@@ -529,7 +601,7 @@ static int64_t evalPTS(PTSStats *ptsStats, int64_t inPTS, int64_t inDTS);
 static AVInputFormat* tryAVInputFormat(const char * name, int verbose) {
     AVInputFormat* inFmt = sp_av_find_input_format(name);
     if( verbose) {
-        if ( inFmt == NULL ) {
+        if ( NULL == inFmt ) {
             fprintf(stderr, "Warning: Could not find input format '%s'\n", name);
         } else {
             fprintf(stderr, "Info: Found input format '%s'\n", name);
@@ -565,10 +637,41 @@ static AVInputFormat* findAVInputFormat(int verbose) {
     return inFmt;
 }
 
+#if 0
+static void getAlignedLinesizes(AVCodecContext *avctx, int linesize[/*4*/]) {
+    int stride_align[AV_NUM_DATA_POINTERS];
+    int w = avctx->width;
+    int h = avctx->height;
+    int unaligned;
+    int i;
+
+    sp_avcodec_align_dimensions2(avctx, &w, &h, stride_align);
+
+    if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
+        int edge_width = sp_avcodec_get_edge_width();
+        w += edge_width * 2;
+        h += edge_width * 2;
+    }
+
+    do {
+        // Get alignment for all planes (-> YUVP .. etc)
+        sp_av_image_fill_linesizes(linesize, avctx->pix_fmt, w);
+        // increase alignment of w for next try (rhs gives the lowest bit set in w)
+        w += w & ~(w - 1);
+
+        unaligned = 0;
+        for (i = 0; i < 4; i++)
+            unaligned |= linesize[i] % stride_align[i];
+    } while (unaligned);
+}
+#endif
+
 JNIEXPORT void JNICALL FF_FUNC(setStream0)
-  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jboolean jIsCameraInput, jint vid, jint aid,
-   jint aMaxChannelCount, jint aPrefSampleRate)
+  (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jboolean jIsCameraInput, 
+   jint vid, jstring jSizeS, jint vWidth, jint vHeight, jint vRate,
+   jint aid, jint aMaxChannelCount, jint aPrefSampleRate)
 {
+    char cameraName[256];
     int res, i;
     jboolean iscopy;
     FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)(intptr_t)ptr;
@@ -592,31 +695,59 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
     pAV->pFormatCtx = sp_avformat_alloc_context();
 
     const char *urlPath = (*env)->GetStringUTFChars(env, jURL, &iscopy);
+    const char *filename = urlPath; // allow changing path for camera ..
 
     // Open video file
     AVDictionary *inOpts = NULL;
     AVInputFormat* inFmt = NULL;
     if( jIsCameraInput ) {
+        char buffer[256];
         inFmt = findAVInputFormat(pAV->verbose);
         if( NULL == inFmt ) {
             JoglCommon_throwNewRuntimeException(env, "Couldn't find input format for camera: %s", urlPath);
             (*env)->ReleaseStringChars(env, jURL, (const jchar *)urlPath);
             return;
         }
-        // set maximum values, driver shall 'degrade' ..
-        // sp_av_dict_set(&inOpts, "video_size", "640x480", 0);
-        // sp_av_dict_set(&inOpts, "video_size", "1280x720", 0);
-        sp_av_dict_set(&inOpts, "video_size", "hd720", 0); // video4linux, vfwcap, ..
-        // sp_av_dict_set(&inOpts, "video_size", "1280x1024", 0);
-        // sp_av_dict_set(&inOpts, "video_size", "320x240", 0);
-        sp_av_dict_set(&inOpts, "framerate", "60", 0); // not setting a framerate causes some drivers to crash!
+        if(pAV->verbose) {
+            fprintf(stderr, "Camera: Format: %s (%s)\n", inFmt->long_name, inFmt->name);
+        }
+        if( 0 == strncmp(inFmt->name, "dshow", 255) ) {
+            int devIdx = atoi(urlPath);
+            strncpy(cameraName, "video=", sizeof(cameraName));
+            res = findDShowVideoDevice(cameraName+6, sizeof(cameraName)-6, devIdx, pAV->verbose);
+            if( 0 == res ) {
+                if(pAV->verbose) {
+                    fprintf(stderr, "Camera %d found: %s\n", devIdx, cameraName);
+                }
+                filename = cameraName;
+            } else if(pAV->verbose) {
+                fprintf(stderr, "Camera %d not found\n", devIdx);
+            }
+        }
+
+        const char *sizeS = NULL != jSizeS ? (*env)->GetStringUTFChars(env, jSizeS, &iscopy) : NULL;
+        if( NULL != sizeS ) {
+            snprintf(buffer, sizeof(buffer), "%s", sizeS);
+            (*env)->ReleaseStringChars(env, jSizeS, (const jchar *)sizeS);
+        } else {
+            snprintf(buffer, sizeof(buffer), "%dx%d", vWidth, vHeight);
+        }
+        if(pAV->verbose) {
+            fprintf(stderr, "Camera: Size: %s\n", buffer);
+        }
+        sp_av_dict_set(&inOpts, "video_size", buffer, 0);
+        snprintf(buffer, sizeof(buffer), "%d", vRate);
+        if(pAV->verbose) {
+            fprintf(stderr, "Camera: FPS: %s\n", buffer);
+        }
+        sp_av_dict_set(&inOpts, "framerate", buffer, 0); // not setting a framerate causes some drivers to crash!
     }
-    res = sp_avformat_open_input(&pAV->pFormatCtx, urlPath, inFmt, NULL != inOpts ? &inOpts : NULL);
+    res = sp_avformat_open_input(&pAV->pFormatCtx, filename, inFmt, NULL != inOpts ? &inOpts : NULL);
     if( NULL != inOpts ) {
         sp_av_dict_free(&inOpts);
     }
     if(res != 0) {
-        JoglCommon_throwNewRuntimeException(env, "Couldn't open URI: %s, err %d", urlPath, res);
+        JoglCommon_throwNewRuntimeException(env, "Couldn't open URI: %s [%dx%d @ %d hz], err %d", filename, vWidth, vHeight, vRate, res);
         (*env)->ReleaseStringChars(env, jURL, (const jchar *)urlPath);
         return;
     }
@@ -630,9 +761,11 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
 
     if(pAV->verbose) {
         // Dump information about file onto standard error
-        sp_av_dump_format(pAV->pFormatCtx, 0, urlPath, JNI_FALSE);
+        sp_av_dump_format(pAV->pFormatCtx, 0, filename, JNI_FALSE);
     }
     (*env)->ReleaseStringChars(env, jURL, (const jchar *)urlPath);
+
+
     // FIXME: Libav Binary compatibility! JAU01
     if (pAV->pFormatCtx->duration != AV_NOPTS_VALUE) {
         pAV->duration = pAV->pFormatCtx->duration / AV_TIME_BASE_MSEC;
@@ -707,9 +840,10 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
         pAV->pACodecCtx->request_sample_fmt=AV_SAMPLE_FMT_S16;
         if( 1 <= aMaxChannelCount && aMaxChannelCount <= 2 ) {
             pAV->pACodecCtx->request_channel_layout=getDefaultAudioChannelLayout(aMaxChannelCount);
-            if( AV_HAS_API_REQUEST_CHANNELS(pAV) ) {
+            #if LIBAVCODEC_VERSION_MAJOR < 54
+                /** Until 55.0.0, but stopped working w/ 54 already :( */
                 pAV->pACodecCtx->request_channels=aMaxChannelCount;
-            }
+            #endif
         }
         pAV->pACodecCtx->skip_frame=AVDISCARD_DEFAULT;
 
@@ -745,12 +879,23 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
         pAV->frames_audio = pAV->pAStream->nb_frames;
         pAV->aSinkSupport = _isAudioFormatSupported(env, pAV->ffmpegMediaPlayer, pAV->aSampleFmt, pAV->aSampleRate, pAV->aChannels);
         if( pAV->verbose ) {
-            fprintf(stderr, "A channels %d [l %d], sample_rate %d, frame_size %d, frame_number %d, r_frame_rate %f, avg_frame_rate %f, nb_frames %d, [maxChan %d, prefRate %d, req_chan_layout %d, req_chan %d], sink-support %d \n", 
+            fprintf(stderr, "A channels %d [l %d], sample_rate %d, frame_size %d, frame_number %d, [afps %f, rfps %f, cfps %f, sfps %f], nb_frames %d, [maxChan %d, prefRate %d, req_chan_layout %d, req_chan %d], sink-support %d \n", 
                 pAV->aChannels, pAV->pACodecCtx->channel_layout, pAV->aSampleRate, pAV->aFrameSize, pAV->pACodecCtx->frame_number,
-                my_av_q2f(pAV->pAStream->r_frame_rate),
                 my_av_q2f(pAV->pAStream->avg_frame_rate),
+                #if LIBAVCODEC_VERSION_MAJOR < 55
+                    my_av_q2f(pAV->pVStream->r_frame_rate),
+                #else
+                    0.0f,
+                #endif
+                my_av_q2f_r(pAV->pAStream->codec->time_base),
+                my_av_q2f_r(pAV->pAStream->time_base),
                 pAV->pAStream->nb_frames,
-                aMaxChannelCount, aPrefSampleRate, pAV->pACodecCtx->request_channel_layout, pAV->pACodecCtx->request_channels,
+                aMaxChannelCount, aPrefSampleRate, pAV->pACodecCtx->request_channel_layout,
+                #if LIBAVCODEC_VERSION_MAJOR < 54
+                    pAV->pACodecCtx->request_channels,
+                #else
+                    0,
+                #endif
                 pAV->aSinkSupport);
         }
 
@@ -759,11 +904,11 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
         pAV->aChannelsOut = pAV->aChannels;
         pAV->aSampleRateOut = pAV->aSampleRate;
 
-        if( AV_HAS_API_AVRESAMPLE(pAV) && 
+        if( ( AV_HAS_API_AVRESAMPLE(pAV) || AV_HAS_API_SWRESAMPLE(pAV) ) && 
             ( pAV->aSampleFmt != AV_SAMPLE_FMT_S16 || 
-              ( 0 != aPrefSampleRate && pAV->aSampleRate != aPrefSampleRate ) || 
-              !pAV->aSinkSupport ) 
-          ) {
+            ( 0 != aPrefSampleRate && pAV->aSampleRate != aPrefSampleRate ) || 
+              !pAV->aSinkSupport ) ) {
+
             if( 0 == aPrefSampleRate ) {
                 aPrefSampleRate = pAV->aSampleRate;
             }
@@ -782,25 +927,48 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
                 aSampleRateOut = aPrefSampleRate;
                 aSinkSupport = 1;
             }
+
             if( aSinkSupport ) {
-                pAV->aResampleCtx = sp_avresample_alloc_context();
-                sp_av_opt_set_int(pAV->aResampleCtx, "in_channel_layout",  pAV->pACodecCtx->channel_layout,            0);
-                sp_av_opt_set_int(pAV->aResampleCtx, "out_channel_layout", getDefaultAudioChannelLayout(aChannelsOut), 0);
-                sp_av_opt_set_int(pAV->aResampleCtx, "in_sample_rate",     pAV->aSampleRate,                           0);
-                sp_av_opt_set_int(pAV->aResampleCtx, "out_sample_rate",    aSampleRateOut,                             0);
-                sp_av_opt_set_int(pAV->aResampleCtx, "in_sample_fmt",      pAV->aSampleFmt,                            0);
-                sp_av_opt_set_int(pAV->aResampleCtx, "out_sample_fmt",     aSampleFmtOut,                              0);
-
-                if ( sp_avresample_open(pAV->aResampleCtx) < 0 ) {
-                    sp_avresample_free(&pAV->aResampleCtx);
-                    pAV->aResampleCtx = NULL;
-                    fprintf(stderr, "error initializing libavresample\n");
-                } else {
-                    // OK
-                    pAV->aSampleFmtOut = aSampleFmtOut;
-                    pAV->aChannelsOut = aChannelsOut;
-                    pAV->aSampleRateOut = aSampleRateOut;
-                    pAV->aSinkSupport = 1;
+                if( AV_HAS_API_AVRESAMPLE(pAV) ) {
+                    pAV->avResampleCtx = sp_avresample_alloc_context();
+                    sp_av_opt_set_int(pAV->avResampleCtx, "in_channel_layout",  pAV->pACodecCtx->channel_layout,            0);
+                    sp_av_opt_set_int(pAV->avResampleCtx, "out_channel_layout", getDefaultAudioChannelLayout(aChannelsOut), 0);
+                    sp_av_opt_set_int(pAV->avResampleCtx, "in_sample_rate",     pAV->aSampleRate,                           0);
+                    sp_av_opt_set_int(pAV->avResampleCtx, "out_sample_rate",    aSampleRateOut,                             0);
+                    sp_av_opt_set_int(pAV->avResampleCtx, "in_sample_fmt",      pAV->aSampleFmt,                            0);
+                    sp_av_opt_set_int(pAV->avResampleCtx, "out_sample_fmt",     aSampleFmtOut,                              0);
+
+                    if ( sp_avresample_open(pAV->avResampleCtx) < 0 ) {
+                        sp_avresample_free(&pAV->avResampleCtx);
+                        pAV->avResampleCtx = NULL;
+                        fprintf(stderr, "error initializing avresample ctx\n");
+                    } else {
+                        // OK
+                        pAV->aSampleFmtOut = aSampleFmtOut;
+                        pAV->aChannelsOut = aChannelsOut;
+                        pAV->aSampleRateOut = aSampleRateOut;
+                        pAV->aSinkSupport = 1;
+                    }
+                } else if( AV_HAS_API_SWRESAMPLE(pAV) ) {
+                    pAV->swResampleCtx = sp_swr_alloc();
+                    sp_av_opt_set_int(pAV->swResampleCtx,        "in_channel_layout",  pAV->pACodecCtx->channel_layout,            0);
+                    sp_av_opt_set_int(pAV->swResampleCtx,        "out_channel_layout", getDefaultAudioChannelLayout(aChannelsOut), 0);
+                    sp_av_opt_set_int(pAV->swResampleCtx,        "in_sample_rate",     pAV->aSampleRate,                           0);
+                    sp_av_opt_set_int(pAV->swResampleCtx,        "out_sample_rate",    aSampleRateOut,                             0);
+                    sp_av_opt_set_sample_fmt(pAV->swResampleCtx, "in_sample_fmt",      pAV->aSampleFmt,                            0);
+                    sp_av_opt_set_sample_fmt(pAV->swResampleCtx, "out_sample_fmt",     aSampleFmtOut,                              0);
+
+                    if ( sp_swr_init(pAV->swResampleCtx) < 0 ) {
+                        sp_swr_free(&pAV->swResampleCtx);
+                        pAV->swResampleCtx = NULL;
+                        fprintf(stderr, "error initializing swresample ctx\n");
+                    } else {
+                        // OK
+                        pAV->aSampleFmtOut = aSampleFmtOut;
+                        pAV->aChannelsOut = aChannelsOut;
+                        pAV->aSampleRateOut = aSampleRateOut;
+                        pAV->aSinkSupport = 1;
+                    }
                 }
             }
         }
@@ -867,10 +1035,18 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
             pAV->pVCodecCtx->time_base.den=1000;
         }
         // FIXME: Libav Binary compatibility! JAU01
-        if( 0 < pAV->pVStream->avg_frame_rate.den ) {
+        if( pAV->pVStream->avg_frame_rate.den && pAV->pVStream->avg_frame_rate.num ) {
             pAV->fps = my_av_q2f(pAV->pVStream->avg_frame_rate);
-        } else {
+        #if LIBAVCODEC_VERSION_MAJOR < 55
+        } else if( pAV->pVStream->r_frame_rate.den && pAV->pVStream->r_frame_rate.num ) {
             pAV->fps = my_av_q2f(pAV->pVStream->r_frame_rate);
+        #endif
+        } else if( pAV->pVStream->codec->time_base.den && pAV->pVStream->codec->time_base.num ) {
+            pAV->fps = my_av_q2f_r(pAV->pVStream->codec->time_base);
+        } else if( pAV->pVStream->time_base.den && pAV->pVStream->time_base.num ) {
+            pAV->fps = my_av_q2f_r(pAV->pVStream->time_base);
+        } else {
+            pAV->fps = 0.0f; // duh!
         }
         pAV->frames_video = pAV->pVStream->nb_frames;
             
@@ -886,35 +1062,78 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
         }
 
         if( pAV->verbose ) {
-            fprintf(stderr, "V frame_size %d, frame_number %d, r_frame_rate %f %d/%d, avg_frame_rate %f %d/%d, nb_frames %d, size %dx%d, fmt 0x%X, bpp %d, planes %d\n", 
+            fprintf(stderr, "V frame_size %d, frame_number %d, [afps %f, rfps %f, cfps %f, sfps %f] -> %f fps, nb_frames %d, size %dx%d, fmt 0x%X, bpp %d, planes %d, codecCaps 0x%X\n", 
                 pAV->pVCodecCtx->frame_size, pAV->pVCodecCtx->frame_number, 
-                my_av_q2f(pAV->pVStream->r_frame_rate), pAV->pVStream->r_frame_rate.num, pAV->pVStream->r_frame_rate.den, 
-                my_av_q2f(pAV->pVStream->avg_frame_rate), pAV->pVStream->avg_frame_rate.num, pAV->pVStream->avg_frame_rate.den,
+                my_av_q2f(pAV->pVStream->avg_frame_rate),
+                #if LIBAVCODEC_VERSION_MAJOR < 55
+                    my_av_q2f(pAV->pVStream->r_frame_rate),
+                #else
+                    0.0f,
+                #endif
+                my_av_q2f_r(pAV->pVStream->codec->time_base),
+                my_av_q2f_r(pAV->pVStream->time_base),
+                pAV->fps,
                 pAV->pVStream->nb_frames,
-                pAV->vWidth, pAV->vHeight, pAV->vPixFmt, pAV->vBitsPerPixel, pAV->vBufferPlanes);
+                pAV->vWidth, pAV->vHeight, pAV->vPixFmt, pAV->vBitsPerPixel, pAV->vBufferPlanes, pAV->pVCodecCtx->codec->capabilities);
+        }
+        #if 0
+        // Check CODEC_CAP_DR1, i.e. codec must handle get_buffer(), i.e. allocs 'em.
+        {
+            int codecHandlesBuffers = 0 != ( pAV->pVCodecCtx->codec->capabilities & CODEC_CAP_DR1 );
+            if( !codecHandlesBuffers ) {
+                JoglCommon_throwNewRuntimeException(env, "Codec does not handle buffers (!CODEC_CAP_DR1)");
+                return;
+            }
         }
+        #endif
 
         pAV->pVFrame=sp_avcodec_alloc_frame();
         if( pAV->pVFrame == NULL ) {
             JoglCommon_throwNewRuntimeException(env, "Couldn't alloc video frame");
             return;
         }
-        res = sp_avcodec_default_get_buffer(pAV->pVCodecCtx, pAV->pVFrame);
-        if(0==res) {
+        {
             const int32_t bytesPerPixel = ( pAV->vBitsPerPixel + 7 ) / 8 ;
             if(1 == pAV->vBufferPlanes) {
                 pAV->vBytesPerPixelPerPlane = bytesPerPixel;
             } else {
                 pAV->vBytesPerPixelPerPlane = 1;
             }
+            int32_t vLinesize[4];
             if( pAV->vBufferPlanes > 1 ) {
-                for(i=0; i<3; i++) {
-                    // FIXME: Libav Binary compatibility! JAU01
-                    pAV->vLinesize[i] = pAV->pVFrame->linesize[i];
-                    pAV->vTexWidth[i] = pAV->vLinesize[i] / pAV->vBytesPerPixelPerPlane ;
-                }
+                #if 0
+                    getAlignedLinesizes(pAV->pVCodecCtx, vLinesize);
+                    for(i=0; i<pAV->vBufferPlanes; i++) {
+                        // FIXME: Libav Binary compatibility! JAU01
+                        pAV->vTexWidth[i] = vLinesize[i] / pAV->vBytesPerPixelPerPlane ;
+                    }
+                #else
+                    // Min. requirement for 'get_buffer2' !
+                    pAV->pVFrame->width = pAV->pVCodecCtx->width;
+                    pAV->pVFrame->height = pAV->pVCodecCtx->height;
+                    pAV->pVFrame->format = pAV->pVCodecCtx->pix_fmt;
+                    #if LIBAVCODEC_VERSION_MAJOR >= 55
+                        res = sp_avcodec_default_get_buffer2(pAV->pVCodecCtx, pAV->pVFrame, 0);
+                    #else
+                        res = sp_avcodec_default_get_buffer(pAV->pVCodecCtx, pAV->pVFrame);
+                    #endif
+                    if(0!=res) {
+                        JoglCommon_throwNewRuntimeException(env, "Couldn't peek video buffer dimension");
+                        return;
+                    }
+                    for(i=0; i<pAV->vBufferPlanes; i++) {
+                        // FIXME: Libav Binary compatibility! JAU01
+                        vLinesize[i] = pAV->pVFrame->linesize[i];
+                        pAV->vTexWidth[i] = vLinesize[i] / pAV->vBytesPerPixelPerPlane ;
+                    }
+                    #if LIBAVCODEC_VERSION_MAJOR >= 55
+                        sp_av_frame_unref(pAV->pVFrame);
+                    #else
+                        sp_avcodec_default_release_buffer(pAV->pVCodecCtx, pAV->pVFrame);
+                    #endif
+                #endif
             } else {
-                pAV->vLinesize[0] = pAV->pVCodecCtx->width * pAV->vBytesPerPixelPerPlane;
+                vLinesize[0] = pAV->pVCodecCtx->width * pAV->vBytesPerPixelPerPlane;
                 if( pAV->vPixFmt == PIX_FMT_YUYV422 ) {
                     // Stuff 2x 16bpp (YUYV) into one RGBA pixel!
                     pAV->vTexWidth[0] = pAV->pVCodecCtx->width / 2;
@@ -922,10 +1141,11 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
                     pAV->vTexWidth[0] = pAV->pVCodecCtx->width;
                 }
             }
-            sp_avcodec_default_release_buffer(pAV->pVCodecCtx, pAV->pVFrame);
-        } else {
-            JoglCommon_throwNewRuntimeException(env, "Couldn't peek video buffer dimension");
-            return;
+            if( pAV->verbose ) {
+                for(i=0; i<pAV->vBufferPlanes; i++) {
+                    fprintf(stderr, "P[%d]: %d texw * %d bytesPP -> %d line\n", i, pAV->vTexWidth[i], pAV->vBytesPerPixelPerPlane, vLinesize[i]);
+                }
+            }
         }
     }
     pAV->vPTS=0;
@@ -945,7 +1165,7 @@ JNIEXPORT void JNICALL FF_FUNC(setGLFuncs0)
     pAV->procAddrGLFinish = (PFNGLFINISH) (intptr_t)jProcAddrGLFinish;
 }
 
-#if 0
+#if 1
 #define DBG_TEXSUBIMG2D_a(c,p,w1,w2,h,i) fprintf(stderr, "TexSubImage2D.%c offset %d / %d, size %d x %d, ", c, (w1*p->pVCodecCtx->width)/w2, p->pVCodecCtx->height/h, p->vTexWidth[i], p->pVCodecCtx->height/h)
 #define DBG_TEXSUBIMG2D_b(p) fprintf(stderr, "err 0x%X\n", pAV->procAddrGLGetError())
 #else
@@ -1046,7 +1266,7 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
                 if( NULL != env ) {
                     void* data_ptr = pAFrameCurrent->data[0]; // default
 
-                    if( NULL != pAV->aResampleCtx ) {
+                    if( NULL != pAV->avResampleCtx || NULL != pAV->swResampleCtx ) {
                         enum AVSampleFormat aSampleFmtOut; // out fmt
                         int32_t          aChannelsOut;
                         int32_t          aSampleRateOut;
@@ -1068,12 +1288,18 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
                         }
                         pAV->aResampleBuffer = tmp_out;
 
-                        out_samples = sp_avresample_convert(pAV->aResampleCtx,
-                                                            &pAV->aResampleBuffer,
-                                                            out_linesize, nb_samples,
-                                                            pAFrameCurrent->data,
-                                                            pAFrameCurrent->linesize[0],
-                                                            pAFrameCurrent->nb_samples);
+                        if( NULL != pAV->avResampleCtx ) {
+                            out_samples = sp_avresample_convert(pAV->avResampleCtx,
+                                                                &pAV->aResampleBuffer,
+                                                                out_linesize, nb_samples,
+                                                                pAFrameCurrent->data,
+                                                                pAFrameCurrent->linesize[0],
+                                                                pAFrameCurrent->nb_samples);
+                        } else if( NULL != pAV->swResampleCtx ) {
+                            out_samples =  sp_swr_convert(pAV->swResampleCtx, 
+                                                          &pAV->aResampleBuffer, nb_samples,
+                                                          (const uint8_t **)pAFrameCurrent->data, pAFrameCurrent->nb_samples);
+                        }
                         if (out_samples < 0) {
                             JoglCommon_throwNewRuntimeException(env, "avresample_convert() failed");
                             return;
@@ -1154,11 +1380,17 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
                     const int32_t frame_repeat_i = pAV->pVFrame->repeat_pict * (frame_delay_i / 2);
 
                     const char * warn = frame_repeat_i > 0 ? "REPEAT" : "NORMAL" ;
+                    const char * oopsLsz = pAV->pVFrame->linesize[0] <= 0 ? "Ooops LSZ" : "OK" ;
 
-                    fprintf(stderr, "V fix_pts %d, pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], time d(%lf s + r %lf = %lf s), i(%d ms + r %d = %d ms) - %s - f# %d\n", 
+                    fprintf(stderr, "V fix_pts %d, pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], time d(%lf s + r %lf = %lf s), i(%d ms + r %d = %d ms) - %s - f# %d, data %p, lsz %d (%s)\n", 
                             pAV->vPTS, vPTS, pkt_pts, vDTS, pkt_dts, 
                             frame_delay_d, frame_repeat_d, (frame_delay_d + frame_repeat_d),
-                            frame_delay_i, frame_repeat_i, (frame_delay_i + frame_repeat_i), warn, frameCount);
+                            frame_delay_i, frame_repeat_i, (frame_delay_i + frame_repeat_i), warn, frameCount,
+                                        pAV->pVFrame->data[0], pAV->pVFrame->linesize[0], oopsLsz);
+                }
+                if( pAV->pVFrame->linesize[0] <= 0 ) {
+                    // Ooops !
+                    continue;
                 }
                 resPTS = pAV->vPTS; // Video Frame!
 
diff --git a/src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c b/src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c
new file mode 100644
index 000000000..277100398
--- /dev/null
+++ b/src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+#include "jogamp_opengl_util_av_impl_FFMPEGv10Natives.h"
+
+#define FF_FUNC(METHOD) Java_jogamp_opengl_util_av_impl_FFMPEGv10Natives_ ## METHOD
+
+#include "ffmpeg_impl_template.c"
diff --git a/src/jogl/native/libav/ffmpeg_static.c b/src/jogl/native/libav/ffmpeg_static.c
index 171dda6a7..f079ee841 100644
--- a/src/jogl/native/libav/ffmpeg_static.c
+++ b/src/jogl/native/libav/ffmpeg_static.c
@@ -28,9 +28,6 @@
  
 #ifdef _WIN32
     #include <windows.h>
-    // __declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds);
-
-    #define usleep(t)    Sleep((t) / 1000)
 #endif
 
 #include <gluegen_stdint.h>
@@ -46,34 +43,7 @@
 
 typedef unsigned (APIENTRYP AV_GET_VERSION)(void);
 
-JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvUtilVersion0
-  (JNIEnv *env, jclass clazz, jlong func) {
-    if( 0 != func ) {
-        return (jint) ((AV_GET_VERSION)func)();
-    } else {
-        return 0;
-    }
-}
-
-JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvFormatVersion0
-  (JNIEnv *env, jclass clazz, jlong func) {
-    if( 0 != func ) {
-        return (jint) ((AV_GET_VERSION)func)();
-    } else {
-        return 0;
-    }
-}
-
-JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvCodecVersion0
-  (JNIEnv *env, jclass clazz, jlong func) {
-    if( 0 != func ) {
-        return (jint) ((AV_GET_VERSION)func)();
-    } else {
-        return 0;
-    }
-}
-
-JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvResampleVersion0
+JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvVersion0
   (JNIEnv *env, jclass clazz, jlong func) {
     if( 0 != func ) {
         return (jint) ((AV_GET_VERSION)func)();
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index ea9625da6..e4b10f95f 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -45,13 +45,20 @@
 #include "libavformat/avformat.h"
 #include "libavutil/avutil.h"
 #if LIBAVCODEC_VERSION_MAJOR >= 54
-#include "libavresample/avresample.h"
+    #include "libavresample/avresample.h"
+    #include "libswresample/swresample.h"
 #endif
 
 #ifndef LIBAVRESAMPLE_VERSION_MAJOR
-#define LIBAVRESAMPLE_VERSION_MAJOR 0
+#define LIBAVRESAMPLE_VERSION_MAJOR -1
+// Opaque
 typedef void* AVAudioResampleContext;
 #endif
+#ifndef LIBSWRESAMPLE_VERSION_MAJOR
+#define LIBSWRESAMPLE_VERSION_MAJOR -1
+// Opaque
+typedef struct SwrContext SwrContext;
+#endif
 
 #include <stdarg.h>
 #include <stdio.h>
@@ -88,24 +95,27 @@ typedef void (APIENTRYP PFNGLFINISH) (void);
 /** Constant PTS marking the end of the stream, i.e. Integer.MIN_VALUE - 1 == 0x7FFFFFFF == {@value}. Sync w/ TimeFrameI.END_OF_STREAM_PTS */
 #define END_OF_STREAM_PTS 0x7FFFFFFF
 
-/** Until 55.0.0, but stopped working w/ 54 already :( */
-#define AV_HAS_API_REQUEST_CHANNELS(pAV) (AV_VERSION_MAJOR(pAV->avcodecVersion) < 54)
-
-/** Since 55.0.0 */
-#define AV_HAS_API_REFCOUNTED_FRAMES(pAV) (AV_VERSION_MAJOR(pAV->avcodecVersion) >= 55)
-
 /** Since 54.0.0.1 */
-#define AV_HAS_API_AVRESAMPLE(pAV) (AV_VERSION_MAJOR(pAV->avresampleVersion) >= 1)
+#define AV_HAS_API_AVRESAMPLE(pAV) ( pAV->avresampleVersion != 0 )
+
+/** Since 55.0.0.1 */
+#define AV_HAS_API_SWRESAMPLE(pAV) ( pAV->swresampleVersion != 0 )
 
 #define MAX_INT(a,b) ( (a >= b) ? a : b )
 #define MIN_INT(a,b) ( (a <= b) ? a : b )
 
 static inline float my_av_q2f(AVRational a){
-    return a.num / (float) a.den;
+    return (float)a.num / (float)a.den;
+}
+static inline float my_av_q2f_r(AVRational a){
+    return (float)a.den / (float)a.num;
 }
 static inline int32_t my_av_q2i32(int64_t snum, AVRational a){
     return (int32_t) ( ( snum * (int64_t) a.num ) / (int64_t)a.den );
 }
+static inline int my_align(int v, int a){
+    return ( v + a - 1 ) & ~( a - 1 );
+}
 
 typedef struct {
     void *origPtr;
@@ -129,6 +139,7 @@ typedef struct {
     uint32_t         avformatVersion;
     uint32_t         avutilVersion;
     uint32_t         avresampleVersion;
+    uint32_t         swresampleVersion;
 
     int32_t          useRefCountedFrames;
 
@@ -149,8 +160,7 @@ typedef struct {
     enum PixelFormat vPixFmt;    // native decoder fmt
     int32_t          vPTS;       // msec - overall last video PTS
     PTSStats         vPTSStats;
-    int32_t          vLinesize[3];  // decoded video linesize in bytes for each plane
-    int32_t          vTexWidth[3];  // decoded video tex width in bytes for each plane
+    int32_t          vTexWidth[AV_NUM_DATA_POINTERS];  // decoded video tex width in bytes for each plane
     int32_t          vWidth;
     int32_t          vHeight;
 
@@ -167,7 +177,8 @@ typedef struct {
     int32_t          aSampleRate;
     int32_t          aChannels;
     int32_t          aSinkSupport; // supported by AudioSink
-    AVAudioResampleContext *aResampleCtx;
+    AVAudioResampleContext* avResampleCtx;
+    struct SwrContext*      swResampleCtx;
     uint8_t*         aResampleBuffer;
     enum AVSampleFormat aSampleFmtOut; // out fmt
     int32_t          aChannelsOut;
-- 
cgit v1.2.3


From 4cb3763415bb5f82520fd02f56412076f80a84e6 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Fri, 30 Aug 2013 17:31:34 +0200
Subject: GLMediaPlayer enhancements: State, Camera options, detect and act on
 orientation change (flipped), API-doc,

- State
  - Fix state transition (initGL() error)

- Camera options
  - options uses ';' as query separator
  - don't use 'default' options, driver should know

- Detect and act on orientation change (flipped)
  - ffmpeg impl detects if flipped changes and triggers a SIZE update event.
    This allows application to react, i.e. re-init GL and use new TextureCoord's.
    Test: Works well on Windows w/ rawvideo dshow camera driver/codec.

- API-doc
  - TexSeqEventListener/GLMediaEventListener usage / constraints (GL, ..)
  - State transition fix
---
 make/scripts/tests-x64.sh                          |   4 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |  50 +++++++--
 .../opengl/util/texture/TextureSequence.java       |  23 +++-
 .../android/av/AndroidGLMediaPlayerAPI14.java      |   2 +-
 .../jogamp/opengl/util/av/EGLMediaPlayerImpl.java  |   2 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   |  72 ++++++++-----
 .../jogamp/opengl/util/av/NullGLMediaPlayer.java   |   5 +-
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     |  28 +++--
 .../opengl/util/av/impl/OMXGLMediaPlayer.java      |   1 +
 src/jogl/native/libav/ffmpeg_impl_template.c       |  80 ++++++++------
 src/jogl/native/libav/ffmpeg_tool.h                |   1 +
 .../test/junit/jogl/demos/es2/av/MovieCube.java    |  65 ++++++++---
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  | 119 ++++++++++++++-------
 13 files changed, 318 insertions(+), 134 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests-x64.sh b/make/scripts/tests-x64.sh
index 68937ca4b..442458603 100755
--- a/make/scripts/tests-x64.sh
+++ b/make/scripts/tests-x64.sh
@@ -7,8 +7,8 @@ SDIR=`dirname $0`
 #export LD_LIBRARY_PATH=/home/sven/libav-9.x/lib:$LD_LIBRARY_PATH
 #export LD_LIBRARY_PATH=/home/sven/ffmpeg-1.2/lib:$LD_LIBRARY_PATH
 
-#export LD_LIBRARY_PATH=/home/sven/libav-10.x/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=/home/sven/ffmpeg-2.x/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=/home/sven/libav-10.x/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=/home/sven/ffmpeg-2.x/lib:$LD_LIBRARY_PATH
 
 if [ -e $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh ] ; then
     . $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 1fb0608fb..5072c410d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -34,6 +34,7 @@ import javax.media.opengl.GLException;
 
 import jogamp.opengl.Debug;
 
+import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
 import com.jogamp.opengl.util.TimeFrameI;
 
@@ -81,8 +82,8 @@ import com.jogamp.opengl.util.TimeFrameI;
  * <p>
  * <table border="1">
  *   <tr><th>Action</th>                                               <th>{@link State} Before</th>                                        <th>{@link State} After</th>                                                                                                       <th>{@link GLMediaEventListener Event}</th></tr>
- *   <tr><td>{@link #initStream(URI, int, int, int)}</td>              <td>{@link State#Uninitialized Uninitialized}</td>                   <td>{@link State#Initialized Initialized}<sup><a href="#streamworker">1</a></sup>, {@link State#Uninitialized Uninitialized}</td> <td>{@link GLMediaEventListener#EVENT_CHANGE_INIT EVENT_CHANGE_INIT} or ( {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} )</td></tr>
- *   <tr><td>{@link #initGL(GL)}</td>                                  <td>{@link State#Initialized Initialized}</td>                       <td>{@link State#Paused Paused}, {@link State#Initialized Initialized}</td>                                                        <td>{@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE}</td></tr>
+ *   <tr><td>{@link #initStream(URI, int, int, int)}</td>              <td>{@link State#Uninitialized Uninitialized}</td>                   <td>{@link State#Initialized Initialized}<sup><a href="#streamworker">1</a></sup>, {@link State#Uninitialized Uninitialized}</td>  <td>{@link GLMediaEventListener#EVENT_CHANGE_INIT EVENT_CHANGE_INIT} or ( {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} )</td></tr>
+ *   <tr><td>{@link #initGL(GL)}</td>                                  <td>{@link State#Initialized Initialized}</td>                       <td>{@link State#Paused Paused}, , {@link State#Uninitialized Uninitialized}</td>                                                  <td>{@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} or ( {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} )</td></tr>
  *   <tr><td>{@link #play()}</td>                                      <td>{@link State#Paused Paused}</td>                                 <td>{@link State#Playing Playing}</td>                                                                                             <td>{@link GLMediaEventListener#EVENT_CHANGE_PLAY EVENT_CHANGE_PLAY}</td></tr>
  *   <tr><td>{@link #pause()}</td>                                     <td>{@link State#Playing Playing}</td>                               <td>{@link State#Paused Paused}</td>                                                                                               <td>{@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE}</td></tr>
  *   <tr><td>{@link #seek(int)}</td>                                   <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>  <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>                                                                <td>none</td></tr>
@@ -205,12 +206,14 @@ public interface GLMediaPlayer extends TextureSequence {
      * ranging from [0..<i>max-number</i>]. 
      * </p>
      * <p>
-     * The {@link URI#getRawQuery() URI query} is used to pass options to the camera.
+     * The {@link URI#getRawQuery() URI query} is used to pass options to the camera
+     * using <i>;</i> as the separator. The latter avoids trouble w/ escaping.
      * </p>
      * <pre>
      *    camera:/<id>
      *    camera://somewhere/<id>
-     *    camera://somewhere/<id>?width=640&height=480&rate=15
+     *    camera://somewhere/<id>?width=640;height=480;rate=15
+     *    camera://somewhere/<id>?size=640x480;rate=15
      * </pre>
      * <pre>
      *  URI: [scheme:][//authority][path][?query][#fragment]
@@ -245,6 +248,13 @@ public interface GLMediaPlayer extends TextureSequence {
             super(message, cause);
         }
     }
+    
+    /**
+     * {@inheritDoc}
+     * <p>
+     * See {@link TexSeqEventListener} for semantics and usage.
+     * </p>
+     */    
     public interface GLMediaEventListener extends TexSeqEventListener<GLMediaPlayer> {
     
         /** State changed to {@link State#Initialized}. See <a href="#lifecycle">Lifecycle</a>.*/
@@ -264,7 +274,7 @@ public interface GLMediaPlayer extends TextureSequence {
         static final int EVENT_CHANGE_VID    = 1<<16;
         /** Stream audio id change. */
         static final int EVENT_CHANGE_AID    = 1<<17;
-        /** TextureFrame size change. */
+        /** TextureFrame size or vertical flip change. */
         static final int EVENT_CHANGE_SIZE   = 1<<18;
         /** Stream fps change. */
         static final int EVENT_CHANGE_FPS    = 1<<19;
@@ -556,18 +566,44 @@ public interface GLMediaPlayer extends TextureSequence {
      */
     public float getFramerate();
 
+    /**
+     * Returns <code>true</code> if the video frame is oriented in 
+     * OpenGL's coordinate system, <i>origin at bottom left</i>.
+     * <p>
+     * Otherwise returns <code>false</code>, i.e. 
+     * video frame is oriented <i>origin at top left</i>.
+     * </p>
+     * <p>
+     * <code>false</code> is the default assumption for videos,
+     * but user shall not rely on.
+     * </p>
+     * <p>
+     * <code>false</code> GL orientation leads to 
+     * {@link Texture#getMustFlipVertically()} == <code>true</code>,
+     * as reflected by all {@link TextureFrame}'s {@link Texture}s
+     * retrieved via {@link #getLastTexture()} or {@link #getNextTexture(GL)}. 
+     * </p>
+     */
+    public boolean isGLOriented();
+    
+    /** Returns the width of the video. */
     public int getWidth();
 
+    /** Returns the height of the video. */
     public int getHeight();
 
+    /** Returns a string represantation of this player, incl. state and audio/video details. */
     public String toString();
 
+    /** Returns a string represantation of this player's performance values. */
     public String getPerfString();
     
+    /** Adds a {@link GLMediaEventListener} to this player. */
     public void addEventListener(GLMediaEventListener l);
 
+    /** Removes a {@link GLMediaEventListener} to this player. */
     public void removeEventListener(GLMediaEventListener l);
 
-    public GLMediaEventListener[] getEventListeners();    
-
+    /** Return all {@link GLMediaEventListener} of this player. */
+    public GLMediaEventListener[] getEventListeners();
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index 8b6cc1bf9..5c6b63535 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -28,7 +28,9 @@
 package com.jogamp.opengl.util.texture;
 
 import javax.media.opengl.GL;
-
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLRunnable;
+import javax.media.opengl.GLEventListener;
 import com.jogamp.opengl.util.TimeFrameI;
 
 /**
@@ -128,6 +130,25 @@ public interface TextureSequence {
         protected final Texture texture;
     }
 
+    /**
+     * Event listener to notify users of updates regarding the {@link TextureSequence}.
+     * <p>
+     * The implementation sending the events, and hence calling down to all listeners,
+     * does not necessarily make the user's OpenGL context current.
+     * </p>
+     * <p>
+     * Further more, the call may happen off-thread, possibly holding another, possibly shared, OpenGL context current.
+     * </p>
+     * Hence a user shall not issue <i>any</i> OpenGL, time consuming 
+     * or {@link TextureSequence} lifecycle operations directly.<br>
+     * Instead, the user shall:
+     * <ul>
+     *   <li>issue commands off-thread via spawning off another thread, or</li>
+     *   <li>injecting {@link GLRunnable} objects via {@link GLAutoDrawable#invoke(boolean, GLRunnable)}, or</li>
+     *   <li>simply changing a volatile state of their {@link GLEventListener} implementation.</li>
+     * </ul> 
+     * </p>
+     * */
     public interface TexSeqEventListener<T extends TextureSequence> {
         /** 
          * Signaling listeners that a new {@link TextureFrame} is available.
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 38faf62a6..35084f1c5 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -433,7 +433,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
         sTexFrameCount++;
         if( 1 == sTexFrameCount ) {
-            singleSTexFrame = new SurfaceTextureFrame( createTexImageImpl(gl, texName, width, height, true), new SurfaceTexture(texName) );
+            singleSTexFrame = new SurfaceTextureFrame( createTexImageImpl(gl, texName, width, height), new SurfaceTexture(texName) );
         }
         return singleSTexFrame;
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
index ec375406d..31af8e4db 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
@@ -85,7 +85,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
 
     @Override
     protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
-        final Texture texture = super.createTexImageImpl(gl, texName, width, height, false);
+        final Texture texture = super.createTexImageImpl(gl, texName, width, height);
         final Buffer clientBuffer;
         final long image;
         final long sync;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index ab0e2eebd..205642eb0 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -165,6 +165,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected Ringbuffer<TextureFrame> videoFramesFree =  null;
     protected Ringbuffer<TextureFrame> videoFramesDecoded =  null;
     protected volatile TextureFrame lastFrame = null;
+    /**
+     * @see #isGLOriented()
+     */
+    protected boolean isInGLOrientation = false;
 
     private ArrayList<GLMediaEventListener> eventListeners = new ArrayList<GLMediaEventListener>();
 
@@ -203,12 +207,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final void setTextureWrapST(int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
     public final int[] getTextureWrapST() { return texWrapST; }    
     
-    private final void checkStreamInit() {
-        if(State.Uninitialized == state ) {
-            throw new IllegalStateException("Stream not initialized: "+this);
-        }        
-    }
-    
     private final void checkGLInit() {
         if(State.Uninitialized == state || State.Initialized == state ) {
             throw new IllegalStateException("GL not initialized: "+this);
@@ -338,6 +336,23 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     protected abstract boolean pauseImpl();
     
+    @Override
+    public final State destroy(GL gl) {
+        return destroyImpl(gl, 0);
+    }
+    private final State destroyImpl(GL gl, int event_mask) {
+        synchronized( stateLock ) {
+            streamWorker.doStop();
+            streamWorker = null;
+            destroyImpl(gl);
+            removeAllTextureFrames(gl);
+            textureCount=0;
+            changeState(event_mask, State.Uninitialized);
+            return state;
+        }
+    }
+    protected abstract void destroyImpl(GL gl);
+    
     @Override
     public final int seek(int msec) {
         synchronized( stateLock ) {
@@ -458,7 +473,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final void initStream(URI streamLoc, int vid, int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
         synchronized( stateLock ) {
             if(State.Uninitialized != state) {
-                throw new IllegalStateException("Instance not unintialized: "+this);
+                throw new IllegalStateException("Instance not in state unintialized: "+this);
             }
             if(null == streamLoc) {
                 throw new IllegalArgumentException("streamLock is null");
@@ -485,7 +500,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 if( null != rawPath && rawPath.length() > 0 ) {
                     // cut-off root fwd-slash 
                     cameraPath = rawPath.substring(1);
-                    final URIQueryProps props = URIQueryProps.create(streamLoc);
+                    final URIQueryProps props = URIQueryProps.create(streamLoc, ';');
                     cameraProps = props.getProperties();
                 } else {
                     throw new IllegalArgumentException("Camera path is empty: "+streamLoc.toString());
@@ -528,10 +543,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     @Override
     public final void initGL(GL gl) throws IllegalStateException, StreamException, GLException {
         synchronized( stateLock ) {
-            checkStreamInit();
+            if(State.Initialized != state ) {
+                throw new IllegalStateException("Stream not in state initialized: "+this);
+            }        
             final StreamException streamInitErr = streamWorker.getStreamErr();
             if( null != streamInitErr ) {
-                streamWorker = null;
+                streamWorker = null; // already terminated!
                 destroy(null);
                 throw streamInitErr;
             }
@@ -559,6 +576,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 }
                 changeState(0, State.Paused);
             } catch (Throwable t) {
+                destroyImpl(gl, GLMediaEventListener.EVENT_CHANGE_ERR); // -> GLMediaPlayer.State.Uninitialized
                 throw new GLException("Error initializing GL resources", t);
             }
         }
@@ -602,7 +620,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     protected abstract TextureFrame createTexImage(GL gl, int texName);
     
-    protected final Texture createTexImageImpl(GL gl, int texName, int tWidth, int tHeight, boolean mustFlipVertically) {
+    protected final Texture createTexImageImpl(GL gl, int texName, int tWidth, int tHeight) {
         if( 0 > texName ) {
             throw new RuntimeException("TextureName "+toHexString(texName)+" invalid.");
         }
@@ -649,7 +667,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                      texName, textureTarget,
                      tWidth, tHeight,
                      width,  height,
-                     mustFlipVertically);        
+                     !isInGLOrientation);        
     }
         
     protected void destroyTexFrame(GL gl, TextureFrame frame) {
@@ -1251,20 +1269,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         attributesUpdated(event_mask);
     }
 
-    @Override
-    public final State destroy(GL gl) {
-        synchronized( stateLock ) {
-            streamWorker.doStop();
-            streamWorker = null;
-            destroyImpl(gl);
-            removeAllTextureFrames(gl);
-            textureCount=0;
-            changeState(0, State.Uninitialized);
-            return state;
+    protected void setIsGLOriented(boolean isGLOriented) {
+        if( isInGLOrientation != isGLOriented ) {
+            if( DEBUG ) {
+                System.err.println("XXX gl-orient "+isInGLOrientation+" -> "+isGLOriented);
+            }
+            isInGLOrientation = isGLOriented;
+            for(int i=0; i<videoFramesOrig.length; i++) {
+                videoFramesOrig[i].getTexture().setMustFlipVertically(!isGLOriented);
+            }
+            attributesUpdated(GLMediaEventListener.EVENT_CHANGE_SIZE);
         }
     }
-    protected abstract void destroyImpl(GL gl);
-
+    
     @Override
     public final URI getURI() {
         return streamLoc;
@@ -1321,6 +1338,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         return fps;
     }
 
+    @Override
+    public final boolean isGLOriented() {
+        return isInGLOrientation;
+    }
+    
     @Override
     public final int getWidth() {
         return width;
@@ -1342,7 +1364,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         return "GLMediaPlayer["+state+", vSCR "+video_scr+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
                "speed "+playSpeed+", "+bps_stream+" bps, "+
                "Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", tagt "+toHexString(textureTarget)+", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+
-               "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
+               "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", glOrient "+isInGLOrientation+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
                "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]";
     }
     
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index 6fa7c7a54..1cddaa9cf 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -57,6 +57,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     
     public NullGLMediaPlayer() {
         super();
+        
     }
 
     @Override
@@ -143,7 +144,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }    
     @Override
     protected final void initGLImpl(GL gl) throws IOException, GLException {
-        // NOP
+        isInGLOrientation = true;
     }
     
     /**
@@ -159,7 +160,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     
     @Override
     protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
-        final Texture texture = super.createTexImageImpl(gl, texName, width, height, false);
+        final Texture texture = super.createTexImageImpl(gl, texName, width, height);
         if(null != texData) {
             texture.updateImage(gl, texData);
         }                      
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 2737a0b6a..c329e880f 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -293,7 +293,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         
         final boolean isCameraInput = null != cameraPath;
         final String resStreamLocS;
-        int rw=640, rh=480, rr=15;
+        // int rw=640, rh=480, rr=15;
+        int rw=-1, rh=-1, rr=-1;
         String sizes = null;
         if( isCameraInput ) {
             switch(Platform.OS_TYPE) {
@@ -424,7 +425,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }    
     @Override
     protected final TextureFrame createTexImage(GL gl, int texName) {
-        return new TextureFrame( createTexImageImpl(gl, texName, texWidth, texHeight, true) );
+        return new TextureFrame( createTexImageImpl(gl, texName, texWidth, texHeight) );
     }
     
     /**
@@ -521,10 +522,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      * @param audioChannels
      * @param audioSamplesPerFrameAndChannel in audio samples per frame and channel
      */
-    void updateAttributes2(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
-                           int tWd0, int tWd1, int tWd2, int vW, int vH,
-                           int aid, int audioSampleFmt, int audioSampleRate, 
-                           int audioChannels, int audioSamplesPerFrameAndChannel) {
+    void setupFFAttributes(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,              
+                          int tWd0, int tWd1, int tWd2, int vW, int vH,
+                          int aid, int audioSampleFmt, int audioSampleRate, 
+                          int audioChannels, int audioSamplesPerFrameAndChannel) {
         // defaults ..
         vPixelFmt = null;
         vPlanes = 0;
@@ -611,6 +612,21 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
     }
     
+    /**
+     * Native callback
+     * @param isInGLOrientation
+     * @param pixFmt
+     * @param planes
+     * @param bitsPerPixel
+     * @param bytesPerPixelPerPlane
+     * @param tWd0
+     * @param tWd1
+     * @param tWd2
+     */
+    void updateVidAttributes(boolean isInGLOrientation, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,              
+                             int tWd0, int tWd1, int tWd2, int vW, int vH) {
+    }
+    
     /**
      * {@inheritDoc}
      * 
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index faa6a56c4..a5a701a4f 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -119,6 +119,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     @Override
     protected final void initGLImpl(GL gl) throws IOException, GLException {
         // NOP
+        isInGLOrientation = true;
     }
     
     @Override
diff --git a/src/jogl/native/libav/ffmpeg_impl_template.c b/src/jogl/native/libav/ffmpeg_impl_template.c
index 6d28e77b6..7035545d0 100644
--- a/src/jogl/native/libav/ffmpeg_impl_template.c
+++ b/src/jogl/native/libav/ffmpeg_impl_template.c
@@ -45,8 +45,9 @@ static const char * const ClazzNameFFMPEGMediaPlayer = "jogamp/opengl/util/av/im
 
 static jclass ffmpegMediaPlayerClazz = NULL;
 static jmethodID jni_mid_pushSound = NULL;
-static jmethodID jni_mid_updateAttributes1 = NULL;
-static jmethodID jni_mid_updateAttributes2 = NULL;
+static jmethodID jni_mid_updateAttributes = NULL;
+static jmethodID jni_mid_setIsGLOriented = NULL;
+static jmethodID jni_mid_setupFFAttributes = NULL;
 static jmethodID jni_mid_isAudioFormatSupported = NULL;
 
 #define HAS_FUNC(f) (NULL!=(f))
@@ -309,22 +310,18 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
     return JNI_TRUE;
 }
 
-static int _isAudioFormatSupported(JNIEnv *env, jobject ffmpegMediaPlayer, enum AVSampleFormat aSampleFmt, int32_t aSampleRate, int32_t aChannels)
-{
+static int _isAudioFormatSupported(JNIEnv *env, jobject ffmpegMediaPlayer, enum AVSampleFormat aSampleFmt, int32_t aSampleRate, int32_t aChannels) {
     return JNI_TRUE == (*env)->CallBooleanMethod(env, ffmpegMediaPlayer, jni_mid_isAudioFormatSupported, aSampleFmt, aSampleRate, aChannels);
 }
-static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasicAV_t* pAV)
-{
-    // int shallBeDetached = 0;
-    // JNIEnv  * env = JoglCommon_GetJNIEnv (&shallBeDetached); 
+static void _updateJavaAttributes(JNIEnv *env, FFMPEGToolBasicAV_t* pAV) {
     if(NULL!=env) {
-        (*env)->CallVoidMethod(env, pAV->ffmpegMediaPlayer, jni_mid_updateAttributes2,
+        (*env)->CallVoidMethod(env, pAV->ffmpegMediaPlayer, jni_mid_setupFFAttributes,
                                pAV->vid, pAV->vPixFmt, pAV->vBufferPlanes, 
                                pAV->vBitsPerPixel, pAV->vBytesPerPixelPerPlane,
                                pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2],
                                pAV->vWidth, pAV->vHeight,
                                pAV->aid, pAV->aSampleFmtOut, pAV->aSampleRateOut, pAV->aChannelsOut, pAV->aFrameSize);
-        (*env)->CallVoidMethod(env, pAV->ffmpegMediaPlayer, jni_mid_updateAttributes1,
+        (*env)->CallVoidMethod(env, pAV->ffmpegMediaPlayer, jni_mid_updateAttributes,
                                pAV->vid, pAV->aid,
                                pAV->vWidth, pAV->vHeight,
                                pAV->bps_stream, pAV->bps_video, pAV->bps_audio,
@@ -333,6 +330,11 @@ static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasic
                                (*env)->NewStringUTF(env, pAV->acodec) );
     }
 }
+static void _setIsGLOriented(JNIEnv *env, FFMPEGToolBasicAV_t* pAV) {
+    if(NULL!=env) {
+        (*env)->CallVoidMethod(env, pAV->ffmpegMediaPlayer, jni_mid_setIsGLOriented, pAV->vFlipped);
+    }
+}
 
 static void freeInstance(JNIEnv *env, FFMPEGToolBasicAV_t* pAV) {
     int i;
@@ -499,13 +501,15 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initIDs0)
     }
 
     jni_mid_pushSound = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "pushSound", "(Ljava/nio/ByteBuffer;II)V");
-    jni_mid_updateAttributes1 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIIIFIIILjava/lang/String;Ljava/lang/String;)V");
-    jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIIII)V");
+    jni_mid_updateAttributes = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIIIFIIILjava/lang/String;Ljava/lang/String;)V");
+    jni_mid_setIsGLOriented = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "setIsGLOriented", "(Z)V");
+    jni_mid_setupFFAttributes = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "setupFFAttributes", "(IIIIIIIIIIIIIII)V");
     jni_mid_isAudioFormatSupported = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "isAudioFormatSupported", "(III)Z");
 
     if(jni_mid_pushSound == NULL ||
-       jni_mid_updateAttributes1 == NULL ||
-       jni_mid_updateAttributes2 == NULL ||
+       jni_mid_updateAttributes == NULL ||
+       jni_mid_setIsGLOriented == NULL ||
+       jni_mid_setupFFAttributes == NULL ||
        jni_mid_isAudioFormatSupported == NULL) {
         return JNI_FALSE;
     }
@@ -726,21 +730,28 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
         }
 
         const char *sizeS = NULL != jSizeS ? (*env)->GetStringUTFChars(env, jSizeS, &iscopy) : NULL;
+        int hasSize = 0;
         if( NULL != sizeS ) {
             snprintf(buffer, sizeof(buffer), "%s", sizeS);
             (*env)->ReleaseStringChars(env, jSizeS, (const jchar *)sizeS);
-        } else {
+            hasSize = 1;
+        } else if( vWidth > 0 && vHeight > 0 ) {
             snprintf(buffer, sizeof(buffer), "%dx%d", vWidth, vHeight);
+            hasSize = 1;
         }
-        if(pAV->verbose) {
-            fprintf(stderr, "Camera: Size: %s\n", buffer);
+        if( hasSize ) {
+            if(pAV->verbose) {
+                fprintf(stderr, "Camera: Size: %s\n", buffer);
+            }
+            sp_av_dict_set(&inOpts, "video_size", buffer, 0);
         }
-        sp_av_dict_set(&inOpts, "video_size", buffer, 0);
-        snprintf(buffer, sizeof(buffer), "%d", vRate);
-        if(pAV->verbose) {
-            fprintf(stderr, "Camera: FPS: %s\n", buffer);
+        if( vRate > 0 ) {
+            snprintf(buffer, sizeof(buffer), "%d", vRate);
+            if(pAV->verbose) {
+                fprintf(stderr, "Camera: FPS: %s\n", buffer);
+            }
+            sp_av_dict_set(&inOpts, "framerate", buffer, 0);
         }
-        sp_av_dict_set(&inOpts, "framerate", buffer, 0); // not setting a framerate causes some drivers to crash!
     }
     res = sp_avformat_open_input(&pAV->pFormatCtx, filename, inFmt, NULL != inOpts ? &inOpts : NULL);
     if( NULL != inOpts ) {
@@ -1055,6 +1066,7 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
         pAV->vWidth = pAV->pVCodecCtx->width;
         pAV->vHeight = pAV->pVCodecCtx->height;
         pAV->vPixFmt = pAV->pVCodecCtx->pix_fmt;
+        pAV->vFlipped = JNI_FALSE;
         {   
             AVPixFmtDescriptor pixDesc = sp_av_pix_fmt_descriptors[pAV->vPixFmt];
             pAV->vBitsPerPixel = sp_av_get_bits_per_pixel(&pixDesc);
@@ -1076,16 +1088,6 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
                 pAV->pVStream->nb_frames,
                 pAV->vWidth, pAV->vHeight, pAV->vPixFmt, pAV->vBitsPerPixel, pAV->vBufferPlanes, pAV->pVCodecCtx->codec->capabilities);
         }
-        #if 0
-        // Check CODEC_CAP_DR1, i.e. codec must handle get_buffer(), i.e. allocs 'em.
-        {
-            int codecHandlesBuffers = 0 != ( pAV->pVCodecCtx->codec->capabilities & CODEC_CAP_DR1 );
-            if( !codecHandlesBuffers ) {
-                JoglCommon_throwNewRuntimeException(env, "Codec does not handle buffers (!CODEC_CAP_DR1)");
-                return;
-            }
-        }
-        #endif
 
         pAV->pVFrame=sp_avcodec_alloc_frame();
         if( pAV->pVFrame == NULL ) {
@@ -1152,7 +1154,7 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
     pAV->aPTS=0;
     initPTSStats(&pAV->vPTSStats);
     initPTSStats(&pAV->aPTSStats);
-    _updateJavaAttributes(env, instance, pAV);
+    _updateJavaAttributes(env, pAV);
 }
 
 JNIEXPORT void JNICALL FF_FUNC(setGLFuncs0)
@@ -1179,7 +1181,6 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
     FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
 
     AVPacket packet;
-    int frameDecoded;
     jint resPTS = INVALID_PTS;
     uint8_t * pkt_odata;
     int pkt_osize;
@@ -1206,6 +1207,7 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
             int frameCount;
             int flush_complete = 0;
             for ( frameCount=0; 0 < packet.size || 0 == frameCount; frameCount++ ) {
+                int frameDecoded;
                 int len1;
                 NIOBuffer_t * pNIOBufferCurrent = &pAV->pANIOBuffers[pAV->aFrameCurrent];
                 AVFrame* pAFrameCurrent = pAV->pAFrames[pAV->aFrameCurrent];
@@ -1339,6 +1341,7 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
             int frameCount;
             int flush_complete = 0;
             for ( frameCount=0; 0 < packet.size || 0 == frameCount; frameCount++ ) {
+                int frameDecoded;
                 int len1;
                 sp_avcodec_get_frame_defaults(pAV->pVFrame);
                 if (flush_complete) {
@@ -1398,6 +1401,11 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
 
                 int p_offset[] = { 0, 0, 0, 0 };
                 if( pAV->pVFrame->linesize[0] < 0 ) {
+                    if( JNI_FALSE == pAV->vFlipped ) {
+                        pAV->vFlipped = JNI_TRUE;
+                        _setIsGLOriented(env, pAV);
+                    }
+
                     // image bottom-up
                     int h_1 = pAV->pVCodecCtx->height - 1;
                     p_offset[0] = pAV->pVFrame->linesize[0] * h_1;
@@ -1411,7 +1419,11 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
                     if( pAV->vBufferPlanes > 3 ) {
                         p_offset[3] = pAV->pVFrame->linesize[3] * h_1;
                     } */
+                } else if( JNI_TRUE == pAV->vFlipped ) {
+                    pAV->vFlipped = JNI_FALSE;
+                    _setIsGLOriented(env, pAV);
                 }
+
                 // 1st plane or complete packed frame
                 // FIXME: Libav Binary compatibility! JAU01
                 DBG_TEXSUBIMG2D_a('Y',pAV,1,1,1,0);
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index 72345fbb7..61d121f24 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -163,6 +163,7 @@ typedef struct {
     int32_t          vTexWidth[4];  // decoded video tex width in bytes for each plane (max 4)
     int32_t          vWidth;
     int32_t          vHeight;
+    jboolean         vFlipped;      // false: !GL-Orientation, true: GL-Orientation
 
     int32_t          aid;
     AVStream*        pAStream;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index 7647421a0..57da78131 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -67,6 +67,7 @@ public class MovieCube implements GLEventListener {
     private GLMediaPlayer mPlayer=null;
     private int swapInterval = 1;
     private long lastPerfPos = 0;
+    private volatile boolean resetGLState = false;
     
     /** Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream. */
     public static final URI defURI;
@@ -100,6 +101,10 @@ public class MovieCube implements GLEventListener {
     
     public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
     
+    public void resetGLState() {
+        resetGLState = true;
+    }
+    
     private final KeyListener keyAction = new KeyAdapter() {
         public void keyReleased(KeyEvent e)  {
             if( e.isAutoRepeat() ) {
@@ -172,12 +177,14 @@ public class MovieCube implements GLEventListener {
         if(null == mPlayer) {
             throw new InternalError("mPlayer null");
         }
-        if( GLMediaPlayer.State.Initialized != mPlayer.getState() ) {
-            throw new IllegalStateException("mPlayer not in state initialized: "+mPlayer);
+        if( GLMediaPlayer.State.Uninitialized == mPlayer.getState() ) {
+            throw new IllegalStateException("mPlayer in uninitialized state: "+mPlayer);
         }
         if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
             // throw new IllegalStateException("mPlayer has no VID/stream selected: "+mPlayer);
         }
+        resetGLState = false;
+        
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
 
@@ -186,16 +193,18 @@ public class MovieCube implements GLEventListener {
         if(waitForKey) {
             UITestCase.waitForKey("Init>");
         }
-        
-        try {
-            mPlayer.initGL(gl);
-        } catch (Exception e) {
-            e.printStackTrace();
-            if(null != mPlayer) {
-                mPlayer.destroy(gl);
-                mPlayer = null;
+    
+        if( GLMediaPlayer.State.Initialized == mPlayer.getState() ) {
+            try {
+                mPlayer.initGL(gl);
+            } catch (Exception e) {
+                e.printStackTrace();
+                if(null != mPlayer) {
+                    mPlayer.destroy(gl);
+                    mPlayer = null;
+                }
+                throw new GLException(e);
             }
-            throw new GLException(e);
         }
         cube.init(drawable);
         mPlayer.play();
@@ -224,18 +233,38 @@ public class MovieCube implements GLEventListener {
     @Override
     public void dispose(GLAutoDrawable drawable) {
         System.err.println(Thread.currentThread()+" MovieCube.dispose ... ");
+        disposeImpl(drawable, true);
+    }
+    
+    private void disposeImpl(GLAutoDrawable drawable, boolean disposePlayer) {
         if(null == mPlayer) { return; }
+        final Object upstreamWidget = drawable.getUpstreamWidget();
+        if (upstreamWidget instanceof Window) {            
+            final Window window = (Window) upstreamWidget;
+            window.removeKeyListener(keyAction);
+        }
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
-        mPlayer.destroy(gl);
-        mPlayer=null;
+        if( disposePlayer ) {
+            mPlayer.destroy(gl);
+            mPlayer=null;
+        }
         cube.dispose(drawable);
-        cube=null;
+        cube=null;        
     }
+    
 
     @Override
     public void display(GLAutoDrawable drawable) {
         if(null == mPlayer) { return; }
         
+        if( resetGLState ) {
+            resetGLState = false;
+            System.err.println("XXX resetGLState");
+            disposeImpl(drawable, false);
+            init(drawable);
+            reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
+        }
+        
         final long currentPos = System.currentTimeMillis();
         if( currentPos - lastPerfPos > 2000 ) {
             System.err.println( mPlayer.getPerfString() );
@@ -350,8 +379,12 @@ public class MovieCube implements GLEventListener {
             public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
                 System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
                 System.err.println("MovieCube State: "+mp);
-                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) && origSize ) {
-                    window.setSize(mp.getWidth(), mp.getHeight());
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
+                    if( origSize ) {
+                        window.setSize(mp.getWidth(), mp.getHeight());
+                    }
+                    // window.disposeGLEventListener(ms, false /* remove */ );
+                    mc.resetGLState();
                 }
                 if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
                     window.addGLEventListener(mc);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index f0a11820e..b52e1fb21 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -98,7 +98,9 @@ public class MovieSimple implements GLEventListener {
     private boolean mPlayerExternal;
     private boolean mPlayerShared;
     private boolean mPlayerScaleOrig;
+    private float[] verts = null;    
     private GLArrayDataServer interleavedVBO;
+    private volatile boolean resetGLState = false;
 
     private ShaderState st;
     private PMVMatrix pmvMatrix;
@@ -270,6 +272,10 @@ public class MovieSimple implements GLEventListener {
         this.alpha = alpha;
     }    
 
+    public void resetGLState() {
+        resetGLState = true;
+    }
+    
     private void initShader(GL2ES2 gl) {
         // Create & Compile the shader objects
         ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MovieSimple.class, 
@@ -309,12 +315,14 @@ public class MovieSimple implements GLEventListener {
         if(null == mPlayer) { 
             throw new InternalError("mPlayer null");
         }
-        if( GLMediaPlayer.State.Initialized != mPlayer.getState() ) {
-            throw new IllegalStateException("mPlayer not in state initialized: "+mPlayer);
+        if( GLMediaPlayer.State.Uninitialized == mPlayer.getState() ) {
+            throw new IllegalStateException("mPlayer in uninitialized state: "+mPlayer);
         }
         if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
             throw new IllegalStateException("mPlayer has no VID/stream selected: "+mPlayer);
         }
+        resetGLState = false;
+        
         zoom0 =  orthoProjection ? 0f : -2.5f;
         zoom1 = orthoProjection ? 0f : -5f;
         zoom = zoom0;        
@@ -331,7 +339,7 @@ public class MovieSimple implements GLEventListener {
         boolean useExternalTexture = false;
         try {
             System.out.println("p0 "+mPlayer+", shared "+mPlayerShared);
-            if(!mPlayerShared) {
+            if(!mPlayerShared && GLMediaPlayer.State.Initialized == mPlayer.getState() ) {
                 mPlayer.initGL(gl);
             }
             System.out.println("p1 "+mPlayer+", shared "+mPlayerShared);
@@ -378,7 +386,6 @@ public class MovieSimple implements GLEventListener {
         float mHeight = mPlayer.getHeight();        
         float mAspect = mWidth/mHeight;
         System.err.println("XXX0: mov aspect: "+mAspect);
-        float[] verts;
         float xs, ys;
         if(orthoProjection) {
             if(mPlayerScaleOrig && mWidth < dWidth && mHeight < dHeight) {
@@ -406,14 +413,48 @@ public class MovieSimple implements GLEventListener {
             System.err.println("XXX0: win   LB: "+winLB[0]+", "+winLB[1]+", "+winLB[2]);
             System.err.println("XXX0: win   RT: "+winRT[0]+", "+winRT[1]+", "+winRT[2]);
         }
-        final float ss = 1f, ts = 1f; // scale tex-coord
 
         interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
         {        
             interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);            
             interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);            
-            interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
-            
+            interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);            
+        }
+        updateInterleavedVBO(gl, tex);
+        
+        st.ownAttribute(interleavedVBO, true);
+        gl.glClearColor(0.3f, 0.3f, 0.3f, 0.3f);
+        
+        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+
+        st.useProgram(gl, false);
+
+        // Let's show the completed shader state ..
+        System.out.println("iVBO: "+interleavedVBO);
+        System.out.println(st);
+
+        if(!mPlayerShared) {
+            mPlayer.play();
+            System.out.println("play.0 "+mPlayer);
+        }        
+        startTime = System.currentTimeMillis();
+        
+        final Object upstreamWidget = drawable.getUpstreamWidget();
+        if (upstreamWidget instanceof Window) {            
+            final Window window = (Window) upstreamWidget;
+            window.addMouseListener(mouseAction);
+            window.addKeyListener(keyAction);
+            winWidth = window.getWidth();
+            winHeight = window.getHeight();
+        }
+    }
+    
+    protected void updateInterleavedVBO(GL gl, Texture tex) {
+        final float ss = 1f, ts = 1f; // scale tex-coord
+        final boolean wasEnabled = interleavedVBO.enabled();
+        interleavedVBO.seal(gl, false);
+        interleavedVBO.rewind();
+        {
             final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
             final TextureCoords tc = tex.getImageTexCoords();
             System.err.println("XXX0: "+tc);
@@ -457,31 +498,8 @@ public class MovieSimple implements GLEventListener {
             ib.put( tc.right()  *ss);  ib.put( tc.top()    *ts);            
         }
         interleavedVBO.seal(gl, true);
-        interleavedVBO.enableBuffer(gl, false);
-        st.ownAttribute(interleavedVBO, true);
-        gl.glClearColor(0.3f, 0.3f, 0.3f, 0.3f);
-        
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-
-        st.useProgram(gl, false);
-
-        // Let's show the completed shader state ..
-        System.out.println("iVBO: "+interleavedVBO);
-        System.out.println(st);
-
-        if(!mPlayerShared) {
-            mPlayer.play();
-            System.out.println("play.0 "+mPlayer);
-        }        
-        startTime = System.currentTimeMillis();
-        
-        final Object upstreamWidget = drawable.getUpstreamWidget();
-        if (upstreamWidget instanceof Window) {            
-            final Window window = (Window) upstreamWidget;
-            window.addMouseListener(mouseAction);
-            window.addKeyListener(keyAction);
-            winWidth = window.getWidth();
-            winHeight = window.getHeight();
+        if( !wasEnabled ) {
+            interleavedVBO.enableBuffer(gl, false);
         }
     }
     
@@ -526,17 +544,28 @@ public class MovieSimple implements GLEventListener {
 
     @Override
     public void dispose(GLAutoDrawable drawable) {
+        disposeImpl(drawable, true);
+    }
+    
+    private void disposeImpl(GLAutoDrawable drawable, boolean disposePlayer) {
         if(null == mPlayer) { return; }
         
-        System.out.println("pD.1 "+mPlayer);        
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        if( null != mPlayer ) {
+        final Object upstreamWidget = drawable.getUpstreamWidget();
+        if (upstreamWidget instanceof Window) {            
+            final Window window = (Window) upstreamWidget;
+            window.removeMouseListener(mouseAction);
+            window.removeKeyListener(keyAction);
+        }
+        
+        System.out.println("pD.1 "+mPlayer+", disposePlayer "+disposePlayer);        
+        GL2ES2 gl = drawable.getGL().getGL2ES2();        
+        if( disposePlayer ) {
             if(!mPlayerExternal) {
                 mPlayer.destroy(gl);
             }
+            System.out.println("pD.X "+mPlayer);
+            mPlayer=null;
         }
-        System.out.println("pD.X "+mPlayer);
-        mPlayer=null;
         pmvMatrixUniform = null;
         if(null != pmvMatrix) {
             pmvMatrix.destroy();
@@ -554,6 +583,14 @@ public class MovieSimple implements GLEventListener {
     public void display(GLAutoDrawable drawable) {
         if(null == mPlayer) { return; }
         
+        if( resetGLState ) {
+            resetGLState = false;
+            System.err.println("XXX resetGLState");
+            disposeImpl(drawable, false);
+            init(drawable);
+            reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
+        }
+        
         final long currentPos = System.currentTimeMillis();
         if( currentPos - lastPerfPos > 2000 ) {
             System.err.println( mPlayer.getPerfString() );
@@ -727,8 +764,12 @@ public class MovieSimple implements GLEventListener {
                 public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
                     System.err.println("MovieSimple AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
                     System.err.println("MovieSimple State: "+mp);
-                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) && origSize ) {
-                        window.setSize(mp.getWidth(), mp.getHeight());
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
+                        if( origSize ) {
+                            window.setSize(mp.getWidth(), mp.getHeight());
+                        }
+                        // window.disposeGLEventListener(ms, false /* remove */ );
+                        ms.resetGLState();
                     }
                     if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
                         if( GLMediaPlayer.STREAM_ID_NONE != ms.mPlayer.getVID() ) {
-- 
cgit v1.2.3


From 14d2d6865ebcfd8f4c1bdb1600f29fc2b1a4366d Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sat, 31 Aug 2013 16:40:44 +0200
Subject: GLMediaPlayer: pause() -> pause(boolean flush): Allowing to flush
 buffers, next frame after play() will provide new frame. Added API doc.

---
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   | 22 +++++++++++++---
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 30 ++++++++++++----------
 .../test/junit/jogl/demos/es2/av/MovieCube.java    |  2 +-
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  |  4 +--
 4 files changed, 38 insertions(+), 20 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 5072c410d..63fc693ca 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -85,7 +85,7 @@ import com.jogamp.opengl.util.TimeFrameI;
  *   <tr><td>{@link #initStream(URI, int, int, int)}</td>              <td>{@link State#Uninitialized Uninitialized}</td>                   <td>{@link State#Initialized Initialized}<sup><a href="#streamworker">1</a></sup>, {@link State#Uninitialized Uninitialized}</td>  <td>{@link GLMediaEventListener#EVENT_CHANGE_INIT EVENT_CHANGE_INIT} or ( {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} )</td></tr>
  *   <tr><td>{@link #initGL(GL)}</td>                                  <td>{@link State#Initialized Initialized}</td>                       <td>{@link State#Paused Paused}, , {@link State#Uninitialized Uninitialized}</td>                                                  <td>{@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} or ( {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} )</td></tr>
  *   <tr><td>{@link #play()}</td>                                      <td>{@link State#Paused Paused}</td>                                 <td>{@link State#Playing Playing}</td>                                                                                             <td>{@link GLMediaEventListener#EVENT_CHANGE_PLAY EVENT_CHANGE_PLAY}</td></tr>
- *   <tr><td>{@link #pause()}</td>                                     <td>{@link State#Playing Playing}</td>                               <td>{@link State#Paused Paused}</td>                                                                                               <td>{@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE}</td></tr>
+ *   <tr><td>{@link #pause(boolean)}</td>                              <td>{@link State#Playing Playing}</td>                               <td>{@link State#Paused Paused}</td>                                                                                               <td>{@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE}</td></tr>
  *   <tr><td>{@link #seek(int)}</td>                                   <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>  <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>                                                                <td>none</td></tr>
  *   <tr><td>{@link #getNextTexture(GL)}</td>                          <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>  <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>                                                                <td>none</td></tr>
  *   <tr><td>{@link #getLastTexture()}</td>                            <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>  <td>{@link State#Paused Paused}, {@link State#Playing Playing}</td>                                                                <td>none</td></tr>
@@ -427,18 +427,34 @@ public interface GLMediaPlayer extends TextureSequence {
     public float getAudioVolume();
     
     /**
+     * Starts or resumes the <i>StreamWorker</i> decoding thread.
+     * <p>
      * <a href="#lifecycle">Lifecycle</a>: {@link State#Paused} -> {@link State#Playing}
+     * </p>
      */
     public State play();
 
     /**
+     * Pauses the <i>StreamWorker</i> decoding thread.
+     * <p>
      * <a href="#lifecycle">Lifecycle</a>: {@link State#Playing} -> {@link State#Paused}
+     * </p>
+     * <p>
+     * If a <i>new</i> frame is desired after the next {@link #play()} call,
+     * e.g. to make a snapshot of a camera input stream, 
+     * <code>flush</code> shall be set to <code>true</code>.
+     * </p> 
+     * @param flush if <code>true</code> flushes the video and audio buffers, otherwise keep them intact.
      */
-    public State pause();
+    public State pause(boolean flush);
 
     /**
+     * Seeks to the new absolute position. The <i>StreamWorker</i> decoding thread
+     * is paused while doing so and the A/V buffers are flushed.
+     * <p>
      * Allowed in state {@link State#Playing} and {@link State#Paused}, otherwise ignored,
-     * see <a href="#lifecycle">Lifecycle</a>. 
+     * see <a href="#lifecycle">Lifecycle</a>.
+     * </p> 
      * 
      * @param msec absolute desired time position in milliseconds 
      * @return time current position in milliseconds, after seeking to the desired position  
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 205642eb0..40fa9c9d6 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -296,7 +296,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             switch( state ) {
                 case Paused:
                     if( playImpl() ) {
-                        resetAudioVideoPTS();
+                        resetAVPTS();
                         if( null != audioSink ) {
                             audioSink.play(); // cont. w/ new data
                         }
@@ -312,17 +312,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected abstract boolean playImpl();
     
     @Override
-    public final State pause() {
-        return pauseImpl(0);
+    public final State pause(boolean flush) {
+        return pauseImpl(flush, 0);
     }
-    private final State pauseImpl(int event_mask) {
+    private final State pauseImpl(boolean flush, int event_mask) {
         synchronized( stateLock ) {
             final State preState = state;
             if( State.Playing == state ) {
                 event_mask = addStateEventMask(event_mask, GLMediaPlayer.State.Paused);
                 state = State.Paused;
                 streamWorker.doPause();
-                if( null != audioSink ) {
+                if( flush ) {
+                    resetAVPTSAndFlush();
+                } else if( null != audioSink ) {
                     audioSink.pause();
                 }
                 attributesUpdated( event_mask );
@@ -365,7 +367,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     state = State.Paused;
                     streamWorker.doPause();
                     pts1 = seekImpl(msec);
-                    resetAllAudioVideoSync();
+                    resetAVPTSAndFlush();
                     if( null != audioSink && State.Playing == _state ) {
                         audioSink.play(); // cont. w/ new data
                     }
@@ -398,7 +400,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         rate = 1.0f;
                     }
                     if( setPlaySpeedImpl(rate) ) {
-                        resetAudioVideoPTS();
+                        resetAVPTS();
                         playSpeed = rate;
                         res = true;
                     }
@@ -738,7 +740,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             presentedFrameCount++;
                             final int video_pts = nextFrame.getPTS();
                             if( video_pts == TimeFrameI.END_OF_STREAM_PTS ) {
-                                pauseImpl(GLMediaEventListener.EVENT_CHANGE_EOS);
+                                pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
                             } else if( video_pts != TimeFrameI.INVALID_PTS ) {
                                 final int audio_pts = getAudioPTSImpl();
                                 final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
@@ -855,7 +857,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * {@inheritDoc}
      * <p>
      * Note: All {@link AudioSink} operations are performed from {@link GLMediaPlayerImpl},
-     * i.e. {@link #play()}, {@link #pause()}, {@link #seek(int)}, {@link #setPlaySpeed(float)}, {@link #getAudioPTS()}.
+     * i.e. {@link #play()}, {@link #pause(boolean)}, {@link #seek(int)}, {@link #setPlaySpeed(float)}, {@link #getAudioPTS()}.
      * </p>
      * <p>
      * Implementations using an {@link AudioSink} shall write it's instance to {@link #audioSink}
@@ -887,16 +889,16 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
         cachedFrame = null;
     }
-    private void resetAllAudioVideoSync() {
+    private void resetAVPTSAndFlush() {
         video_dpts_cum = 0;
         video_dpts_count = 0;
-        resetAudioVideoPTS();
+        resetAVPTS();
         flushAllVideoFrames();
         if( null != audioSink ) {
             audioSink.flush();
         }
     }
-    private void resetAudioVideoPTS() {
+    private void resetAVPTS() {
         presentedFrameCount = 0;
         displayedFrameCount = 0;
         decodedFrameCount = 0;
@@ -1129,7 +1131,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                     // state transition incl. notification
                                     shallPause = true;
                                     isActive = false;
-                                    pauseImpl(GLMediaEventListener.EVENT_CHANGE_EOS);
+                                    pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
                                 }
                             }
                         }
@@ -1153,7 +1155,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             // state transition incl. notification
                             shallPause = true;
                             isActive = false;
-                            pauseImpl(GLMediaEventListener.EVENT_CHANGE_ERR);
+                            pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_ERR);
                         }
                     }
                 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index 57da78131..d10bba8c7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -130,7 +130,7 @@ public class MovieCube implements GLEventListener {
                     if(GLMediaPlayer.State.Paused == mPlayer.getState()) {
                         mPlayer.play();
                     } else {
-                        mPlayer.pause();
+                        mPlayer.pause(false);
                     }
                     break;
                 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index b52e1fb21..907813191 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -124,7 +124,7 @@ public class MovieSimple implements GLEventListener {
         public void mousePressed(MouseEvent e) {
             if(e.getY()<=winHeight/2 && null!=mPlayer && 1 == e.getClickCount()) {
                 if(GLMediaPlayer.State.Playing == mPlayer.getState()) {
-                    mPlayer.pause();
+                    mPlayer.pause(false);
                 } else {
                     mPlayer.play();
                 }
@@ -190,7 +190,7 @@ public class MovieSimple implements GLEventListener {
                     if(GLMediaPlayer.State.Paused == mPlayer.getState()) {
                         mPlayer.play();
                     } else {
-                        mPlayer.pause();
+                        mPlayer.pause(false);
                     }
                     break;
                 }
-- 
cgit v1.2.3


From 5e9c02bce7b241a0bf95c8abca9a91cd25e51ed3 Mon Sep 17 00:00:00 2001
From: Harvey Harrison <harvey.harrison@gmail.com>
Date: Thu, 17 Oct 2013 22:27:27 -0700
Subject: jogl: remove all trailing whitespace

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 .../com/jogamp/audio/windows/waveout/Audio.java    |  10 +-
 .../com/jogamp/audio/windows/waveout/Mixer.java    |  12 +-
 .../jogamp/audio/windows/waveout/SoundBuffer.java  |  10 +-
 .../com/jogamp/audio/windows/waveout/Track.java    |  12 +-
 .../com/jogamp/audio/windows/waveout/Vec3f.java    |  10 +-
 .../gluegen/opengl/BuildComposablePipeline.java    |  18 +-
 .../jogamp/gluegen/opengl/BuildStaticGLInfo.java   |  38 +-
 .../com/jogamp/gluegen/opengl/GLConfiguration.java |  28 +-
 .../com/jogamp/gluegen/opengl/GLEmitter.java       |  34 +-
 .../gluegen/opengl/GLJavaMethodBindingEmitter.java |  16 +-
 .../jogamp/gluegen/opengl/ant/StaticGLGenTask.java |  72 +-
 .../opengl/nativesig/NativeSignatureEmitter.java   |  18 +-
 .../NativeSignatureJavaMethodBindingEmitter.java   |  26 +-
 .../gluegen/runtime/opengl/GLNameResolver.java     |  20 +-
 .../runtime/opengl/GLProcAddressResolver.java      |  10 +-
 .../com/jogamp/graph/curve/OutlineShape.java       | 124 ++--
 .../classes/com/jogamp/graph/curve/Region.java     |  68 +-
 .../com/jogamp/graph/curve/opengl/GLRegion.java    |  42 +-
 .../jogamp/graph/curve/opengl/RegionRenderer.java  |  24 +-
 .../com/jogamp/graph/curve/opengl/RenderState.java |  32 +-
 .../com/jogamp/graph/curve/opengl/Renderer.java    |  84 +--
 .../jogamp/graph/curve/opengl/TextRenderer.java    |  60 +-
 .../com/jogamp/graph/curve/tess/Triangulation.java |   2 +-
 .../com/jogamp/graph/curve/tess/Triangulator.java  |  12 +-
 src/jogl/classes/com/jogamp/graph/font/Font.java   |  34 +-
 .../classes/com/jogamp/graph/font/FontFactory.java |  20 +-
 .../classes/com/jogamp/graph/font/FontSet.java     |  16 +-
 .../classes/com/jogamp/graph/geom/Outline.java     |  36 +-
 .../classes/com/jogamp/graph/geom/Triangle.java    |  10 +-
 src/jogl/classes/com/jogamp/graph/geom/Vertex.java |  22 +-
 .../com/jogamp/graph/geom/opengl/SVertex.java      |  40 +-
 src/jogl/classes/com/jogamp/opengl/FBObject.java   | 786 ++++++++++-----------
 .../com/jogamp/opengl/GLAutoDrawableDelegate.java  |  56 +-
 .../com/jogamp/opengl/GLEventListenerState.java    | 118 ++--
 .../classes/com/jogamp/opengl/GLExtensions.java    |  22 +-
 .../com/jogamp/opengl/GLRendererQuirks.java        |  64 +-
 .../classes/com/jogamp/opengl/GLStateKeeper.java   |  38 +-
 .../opengl/GenericGLCapabilitiesChooser.java       |  10 +-
 .../classes/com/jogamp/opengl/JoglVersion.java     |  40 +-
 .../opengl/cg/CgDynamicLibraryBundleInfo.java      |  24 +-
 .../classes/com/jogamp/opengl/cg/CgException.java  |  14 +-
 .../classes/com/jogamp/opengl/math/FixedPoint.java |  12 +-
 .../classes/com/jogamp/opengl/math/FloatUtil.java  |  88 +--
 .../classes/com/jogamp/opengl/math/Quaternion.java |  38 +-
 .../classes/com/jogamp/opengl/math/VectorUtil.java |  46 +-
 .../com/jogamp/opengl/math/Vert2fImmutable.java    |   4 +-
 .../com/jogamp/opengl/math/geom/AABBox.java        |  84 +--
 .../com/jogamp/opengl/math/geom/Frustum.java       |  82 +--
 .../classes/com/jogamp/opengl/swt/GLCanvas.java    | 134 ++--
 .../com/jogamp/opengl/util/AWTAnimatorImpl.java    |  10 +-
 .../classes/com/jogamp/opengl/util/Animator.java   |  34 +-
 .../com/jogamp/opengl/util/AnimatorBase.java       | 106 +--
 .../jogamp/opengl/util/DefaultAnimatorImpl.java    |  10 +-
 .../com/jogamp/opengl/util/FPSAnimator.java        |  66 +-
 .../com/jogamp/opengl/util/GLArrayDataClient.java  |  80 +--
 .../jogamp/opengl/util/GLArrayDataEditable.java    |  28 +-
 .../com/jogamp/opengl/util/GLArrayDataServer.java  | 122 ++--
 .../com/jogamp/opengl/util/GLArrayDataWrapper.java | 112 +--
 .../classes/com/jogamp/opengl/util/GLBuffers.java  | 388 +++++-----
 .../com/jogamp/opengl/util/GLDrawableUtil.java     |  50 +-
 .../com/jogamp/opengl/util/GLPixelBuffer.java      | 126 ++--
 .../jogamp/opengl/util/GLPixelStorageModes.java    |  48 +-
 .../com/jogamp/opengl/util/GLReadBufferUtil.java   |  62 +-
 src/jogl/classes/com/jogamp/opengl/util/Gamma.java |  14 +-
 .../com/jogamp/opengl/util/ImmModeSink.java        | 382 +++++-----
 .../classes/com/jogamp/opengl/util/PMVMatrix.java  | 276 ++++----
 .../com/jogamp/opengl/util/RandomTileRenderer.java |  56 +-
 .../classes/com/jogamp/opengl/util/TGAWriter.java  |  16 +-
 .../com/jogamp/opengl/util/TileRenderer.java       |  78 +-
 .../com/jogamp/opengl/util/TileRendererBase.java   | 148 ++--
 .../classes/com/jogamp/opengl/util/TimeFrameI.java |  30 +-
 .../com/jogamp/opengl/util/av/AudioSink.java       | 188 ++---
 .../jogamp/opengl/util/av/AudioSinkFactory.java    |  10 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   | 192 ++---
 .../opengl/util/av/GLMediaPlayerFactory.java       |  12 +-
 .../jogamp/opengl/util/awt/AWTGLPixelBuffer.java   |  78 +-
 .../opengl/util/awt/AWTGLReadBufferUtil.java       |  12 +-
 .../com/jogamp/opengl/util/awt/ImageUtil.java      |  26 +-
 .../com/jogamp/opengl/util/awt/Overlay.java        |  14 +-
 .../com/jogamp/opengl/util/awt/Screenshot.java     |  28 +-
 .../com/jogamp/opengl/util/awt/TextRenderer.java   |  12 +-
 .../jogamp/opengl/util/awt/TextureRenderer.java    |  28 +-
 .../com/jogamp/opengl/util/gl2/BitmapCharRec.java  |  18 +-
 .../com/jogamp/opengl/util/gl2/BitmapFontRec.java  |  18 +-
 .../com/jogamp/opengl/util/gl2/CoordRec.java       |  18 +-
 .../classes/com/jogamp/opengl/util/gl2/GLUT.java   |  52 +-
 .../com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java |  14 +-
 .../com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java |  14 +-
 .../opengl/util/gl2/GLUTBitmapHelvetica10.java     |  14 +-
 .../opengl/util/gl2/GLUTBitmapHelvetica12.java     |  14 +-
 .../opengl/util/gl2/GLUTBitmapHelvetica18.java     |  14 +-
 .../opengl/util/gl2/GLUTBitmapTimesRoman10.java    |  14 +-
 .../opengl/util/gl2/GLUTBitmapTimesRoman24.java    |  14 +-
 .../opengl/util/gl2/GLUTStrokeMonoRoman.java       |  14 +-
 .../jogamp/opengl/util/gl2/GLUTStrokeRoman.java    |  14 +-
 .../com/jogamp/opengl/util/gl2/StrokeCharRec.java  |  18 +-
 .../com/jogamp/opengl/util/gl2/StrokeFontRec.java  |  18 +-
 .../com/jogamp/opengl/util/gl2/StrokeRec.java      |  20 +-
 .../com/jogamp/opengl/util/glsl/ShaderCode.java    | 208 +++---
 .../com/jogamp/opengl/util/glsl/ShaderProgram.java |  42 +-
 .../com/jogamp/opengl/util/glsl/ShaderState.java   | 232 +++---
 .../com/jogamp/opengl/util/glsl/ShaderUtil.java    |  54 +-
 .../opengl/util/glsl/fixedfunc/FixedFuncUtil.java  |  12 +-
 .../util/glsl/fixedfunc/ShaderSelectionMode.java   |  18 +-
 .../jogamp/opengl/util/glsl/sdk/CompileShader.java |   4 +-
 .../opengl/util/packrect/BackingStoreManager.java  |  14 +-
 .../com/jogamp/opengl/util/packrect/Level.java     |  16 +-
 .../com/jogamp/opengl/util/packrect/LevelSet.java  |  16 +-
 .../com/jogamp/opengl/util/packrect/Rect.java      |  16 +-
 .../jogamp/opengl/util/packrect/RectVisitor.java   |  14 +-
 .../opengl/util/packrect/RectanglePacker.java      |  16 +-
 .../com/jogamp/opengl/util/texture/Texture.java    |  86 +--
 .../jogamp/opengl/util/texture/TextureCoords.java  |  16 +-
 .../jogamp/opengl/util/texture/TextureData.java    |  94 +--
 .../com/jogamp/opengl/util/texture/TextureIO.java  |  74 +-
 .../opengl/util/texture/TextureSequence.java       | 120 ++--
 .../jogamp/opengl/util/texture/TextureState.java   |  52 +-
 .../opengl/util/texture/awt/AWTTextureData.java    |  28 +-
 .../opengl/util/texture/awt/AWTTextureIO.java      |  18 +-
 .../jogamp/opengl/util/texture/spi/DDSImage.java   |  22 +-
 .../jogamp/opengl/util/texture/spi/JPEGImage.java  |  40 +-
 .../opengl/util/texture/spi/LEDataInputStream.java |  22 +-
 .../util/texture/spi/LEDataOutputStream.java       |  14 +-
 .../util/texture/spi/NetPbmTextureWriter.java      |  36 +-
 .../jogamp/opengl/util/texture/spi/PNGImage.java   |  66 +-
 .../jogamp/opengl/util/texture/spi/SGIImage.java   |  38 +-
 .../jogamp/opengl/util/texture/spi/TGAImage.java   |  34 +-
 .../opengl/util/texture/spi/TextureProvider.java   |  14 +-
 .../opengl/util/texture/spi/TextureWriter.java     |  14 +-
 .../util/texture/spi/awt/IIOTextureProvider.java   |  14 +-
 .../util/texture/spi/awt/IIOTextureWriter.java     |  16 +-
 src/jogl/classes/javax/media/opengl/DebugGL2.java  |   2 +-
 src/jogl/classes/javax/media/opengl/DebugGL3.java  |   2 +-
 .../classes/javax/media/opengl/DebugGL3bc.java     |   2 +-
 src/jogl/classes/javax/media/opengl/DebugGL4.java  |   2 +-
 .../classes/javax/media/opengl/DebugGLES2.java     |   2 +-
 .../media/opengl/DefaultGLCapabilitiesChooser.java |  32 +-
 .../classes/javax/media/opengl/FPSCounter.java     |  32 +-
 .../javax/media/opengl/GLAnimatorControl.java      |  16 +-
 .../classes/javax/media/opengl/GLArrayData.java    |  20 +-
 .../classes/javax/media/opengl/GLAutoDrawable.java | 120 ++--
 src/jogl/classes/javax/media/opengl/GLBase.java    | 108 +--
 .../classes/javax/media/opengl/GLCapabilities.java |  16 +-
 .../javax/media/opengl/GLCapabilitiesChooser.java  |  16 +-
 .../media/opengl/GLCapabilitiesImmutable.java      |  10 +-
 src/jogl/classes/javax/media/opengl/GLContext.java | 320 ++++-----
 .../javax/media/opengl/GLDebugListener.java        |   8 +-
 .../classes/javax/media/opengl/GLDebugMessage.java | 114 +--
 .../classes/javax/media/opengl/GLDrawable.java     |  22 +-
 .../javax/media/opengl/GLDrawableFactory.java      | 152 ++--
 .../javax/media/opengl/GLEventListener.java        |  22 +-
 .../classes/javax/media/opengl/GLException.java    |  14 +-
 .../classes/javax/media/opengl/GLFBODrawable.java  |  76 +-
 .../media/opengl/GLOffscreenAutoDrawable.java      |  20 +-
 src/jogl/classes/javax/media/opengl/GLPbuffer.java |   4 +-
 .../javax/media/opengl/GLPipelineFactory.java      |  22 +-
 src/jogl/classes/javax/media/opengl/GLProfile.java | 282 ++++----
 .../classes/javax/media/opengl/GLRunnable.java     |  20 +-
 .../classes/javax/media/opengl/GLRunnable2.java    |  14 +-
 .../classes/javax/media/opengl/GLUniformData.java  |  14 +-
 src/jogl/classes/javax/media/opengl/Threading.java |  52 +-
 src/jogl/classes/javax/media/opengl/TraceGL2.java  |   2 +-
 src/jogl/classes/javax/media/opengl/TraceGL3.java  |   2 +-
 .../classes/javax/media/opengl/TraceGL3bc.java     |   2 +-
 src/jogl/classes/javax/media/opengl/TraceGL4.java  |   2 +-
 .../classes/javax/media/opengl/TraceGLES2.java     |   2 +-
 .../javax/media/opengl/awt/ComponentEvents.java    |  14 +-
 .../classes/javax/media/opengl/awt/GLCanvas.java   | 104 +--
 .../classes/javax/media/opengl/awt/GLJPanel.java   | 192 ++---
 .../javax/media/opengl/fixedfunc/GLMatrixFunc.java |  18 +-
 .../media/opengl/fixedfunc/GLPointerFunc.java      |   2 +-
 .../media/opengl/fixedfunc/GLPointerFuncUtil.java  |  10 +-
 .../jogamp/graph/curve/opengl/RegionFactory.java   |  20 +-
 .../graph/curve/opengl/RegionRendererImpl01.java   |  24 +-
 .../jogamp/graph/curve/opengl/RenderStateImpl.java |  14 +-
 .../graph/curve/opengl/TextRendererImpl01.java     |  26 +-
 .../jogamp/graph/curve/opengl/VBORegion2PES2.java  | 178 ++---
 .../jogamp/graph/curve/opengl/VBORegionSPES2.java  |  34 +-
 .../graph/curve/opengl/shader/AttributeNames.java  |  12 +-
 .../graph/curve/opengl/shader/UniformNames.java    |   2 +-
 .../jogamp/graph/curve/tess/CDTriangulator2D.java  |  30 +-
 .../jogamp/graph/curve/tess/GraphOutline.java      |  10 +-
 .../jogamp/graph/curve/tess/GraphVertex.java       |  12 +-
 .../classes/jogamp/graph/curve/tess/HEdge.java     |  12 +-
 src/jogl/classes/jogamp/graph/curve/tess/Loop.java |  30 +-
 .../jogamp/graph/curve/text/GlyphShape.java        |  20 +-
 .../jogamp/graph/curve/text/GlyphString.java       |  58 +-
 src/jogl/classes/jogamp/graph/font/FontInt.java    |   2 +-
 .../classes/jogamp/graph/font/JavaFontLoader.java  |  46 +-
 .../jogamp/graph/font/UbuntuFontLoader.java        |  36 +-
 .../jogamp/graph/font/typecast/TypecastFont.java   |  56 +-
 .../font/typecast/TypecastFontConstructor.java     |  10 +-
 .../jogamp/graph/font/typecast/TypecastGlyph.java  |  88 +--
 .../graph/font/typecast/TypecastHMetrics.java      |  14 +-
 .../graph/font/typecast/TypecastRenderer.java      |  26 +-
 .../graph/font/typecast/ot/Disassembler.java       |   8 +-
 .../jogamp/graph/font/typecast/ot/Fixed.java       |   4 +-
 .../jogamp/graph/font/typecast/ot/Mnemonic.java    |   8 +-
 .../jogamp/graph/font/typecast/ot/OTFont.java      |  36 +-
 .../graph/font/typecast/ot/OTFontCollection.java   |   4 +-
 .../jogamp/graph/font/typecast/ot/OTGlyph.java     |   8 +-
 .../graph/font/typecast/ot/mac/ResourceData.java   |   2 +-
 .../graph/font/typecast/ot/mac/ResourceFile.java   |  10 +-
 .../graph/font/typecast/ot/mac/ResourceHeader.java |   6 +-
 .../graph/font/typecast/ot/mac/ResourceMap.java    |  10 +-
 .../font/typecast/ot/mac/ResourceReference.java    |  12 +-
 .../graph/font/typecast/ot/mac/ResourceType.java   |  10 +-
 .../graph/font/typecast/ot/table/BaseTable.java    |  98 +--
 .../graph/font/typecast/ot/table/CffTable.java     | 122 ++--
 .../graph/font/typecast/ot/table/Charstring.java   |   2 +-
 .../font/typecast/ot/table/CharstringType2.java    |  18 +-
 .../graph/font/typecast/ot/table/ClassDef.java     |   8 +-
 .../font/typecast/ot/table/ClassDefFormat1.java    |   8 +-
 .../font/typecast/ot/table/ClassDefFormat2.java    |   8 +-
 .../graph/font/typecast/ot/table/CmapFormat.java   |  14 +-
 .../graph/font/typecast/ot/table/CmapFormat0.java  |   2 +-
 .../graph/font/typecast/ot/table/CmapFormat2.java  |  28 +-
 .../graph/font/typecast/ot/table/CmapFormat4.java  |   4 +-
 .../graph/font/typecast/ot/table/CmapFormat6.java  |   4 +-
 .../font/typecast/ot/table/CmapFormatUnknown.java  |   6 +-
 .../font/typecast/ot/table/CmapIndexEntry.java     |   2 +-
 .../graph/font/typecast/ot/table/CmapTable.java    |  10 +-
 .../graph/font/typecast/ot/table/Coverage.java     |   2 +-
 .../graph/font/typecast/ot/table/CvtTable.java     |  12 +-
 .../graph/font/typecast/ot/table/Device.java       |   8 +-
 .../font/typecast/ot/table/DirectoryEntry.java     |   4 +-
 .../graph/font/typecast/ot/table/DsigEntry.java    |  14 +-
 .../graph/font/typecast/ot/table/DsigTable.java    |  12 +-
 .../graph/font/typecast/ot/table/FeatureList.java  |   8 +-
 .../font/typecast/ot/table/FeatureRecord.java      |   2 +-
 .../graph/font/typecast/ot/table/FpgmTable.java    |  12 +-
 .../graph/font/typecast/ot/table/GaspRange.java    |  12 +-
 .../graph/font/typecast/ot/table/GaspTable.java    |  14 +-
 .../typecast/ot/table/GlyfCompositeDescript.java   |   2 +-
 .../graph/font/typecast/ot/table/GlyfDescript.java |   2 +-
 .../font/typecast/ot/table/GlyfSimpleDescript.java |   4 +-
 .../graph/font/typecast/ot/table/GlyfTable.java    |   6 +-
 .../font/typecast/ot/table/GlyphDescription.java   |  24 +-
 .../graph/font/typecast/ot/table/GposTable.java    |   4 +-
 .../graph/font/typecast/ot/table/GsubTable.java    |  20 +-
 .../graph/font/typecast/ot/table/HdmxTable.java    |  20 +-
 .../graph/font/typecast/ot/table/HeadTable.java    |   4 +-
 .../graph/font/typecast/ot/table/HheaTable.java    |  12 +-
 .../jogamp/graph/font/typecast/ot/table/ID.java    |   4 +-
 .../graph/font/typecast/ot/table/KernSubtable.java |  12 +-
 .../typecast/ot/table/KernSubtableFormat0.java     |  10 +-
 .../typecast/ot/table/KernSubtableFormat2.java     |   8 +-
 .../graph/font/typecast/ot/table/KernTable.java    |  14 +-
 .../graph/font/typecast/ot/table/KerningPair.java  |   8 +-
 .../graph/font/typecast/ot/table/LangSys.java      |  10 +-
 .../font/typecast/ot/table/LangSysRecord.java      |   2 +-
 .../graph/font/typecast/ot/table/Ligature.java     |   4 +-
 .../typecast/ot/table/LigatureSubstFormat1.java    |   2 +-
 .../graph/font/typecast/ot/table/LocaTable.java    |  10 +-
 .../graph/font/typecast/ot/table/Lookup.java       |   2 +-
 .../graph/font/typecast/ot/table/LookupList.java   |   8 +-
 .../typecast/ot/table/LookupSubtableFactory.java   |   4 +-
 .../graph/font/typecast/ot/table/LtshTable.java    |  16 +-
 .../graph/font/typecast/ot/table/MaxpTable.java    |  14 +-
 .../graph/font/typecast/ot/table/NameRecord.java   |  18 +-
 .../graph/font/typecast/ot/table/NameTable.java    |  14 +-
 .../graph/font/typecast/ot/table/Os2Table.java     |  14 +-
 .../graph/font/typecast/ot/table/Panose.java       |  26 +-
 .../graph/font/typecast/ot/table/PcltTable.java    |  14 +-
 .../graph/font/typecast/ot/table/PostTable.java    |  18 +-
 .../graph/font/typecast/ot/table/PrepTable.java    |  12 +-
 .../graph/font/typecast/ot/table/Program.java      |   8 +-
 .../graph/font/typecast/ot/table/RangeRecord.java  |   2 +-
 .../graph/font/typecast/ot/table/Script.java       |   6 +-
 .../graph/font/typecast/ot/table/ScriptList.java   |  12 +-
 .../graph/font/typecast/ot/table/ScriptRecord.java |   4 +-
 .../font/typecast/ot/table/SignatureBlock.java     |  10 +-
 .../graph/font/typecast/ot/table/SingleSubst.java  |   2 +-
 .../font/typecast/ot/table/SingleSubstFormat1.java |   2 +-
 .../font/typecast/ot/table/SingleSubstFormat2.java |   2 +-
 .../graph/font/typecast/ot/table/TTCHeader.java    |  12 +-
 .../jogamp/graph/font/typecast/ot/table/Table.java |  12 +-
 .../font/typecast/ot/table/TableDirectory.java     |   2 +-
 .../font/typecast/ot/table/TableException.java     |   6 +-
 .../graph/font/typecast/ot/table/TableFactory.java |  10 +-
 .../graph/font/typecast/ot/table/VdmxTable.java    |  40 +-
 .../graph/font/typecast/ot/table/VheaTable.java    |   2 +-
 .../graph/font/typecast/t2/T2Interpreter.java      | 146 ++--
 .../graph/font/typecast/tt/engine/Interpreter.java |   4 +-
 .../jogamp/graph/geom/plane/AffineTransform.java   |  50 +-
 .../classes/jogamp/graph/geom/plane/Crossing.java  |  26 +-
 .../classes/jogamp/graph/geom/plane/Path2D.java    |  42 +-
 src/jogl/classes/jogamp/opengl/Debug.java          |  20 +-
 .../opengl/DesktopGLDynamicLibraryBundleInfo.java  |  14 +-
 .../opengl/DesktopGLDynamicLookupHelper.java       |  10 +-
 .../jogamp/opengl/ExtensionAvailabilityCache.java  |  38 +-
 src/jogl/classes/jogamp/opengl/FPSCounterImpl.java |  50 +-
 .../classes/jogamp/opengl/GLAutoDrawableBase.java  | 144 ++--
 .../classes/jogamp/opengl/GLBufferSizeTracker.java |  18 +-
 .../jogamp/opengl/GLBufferStateTracker.java        |  30 +-
 src/jogl/classes/jogamp/opengl/GLContextImpl.java  | 296 ++++----
 .../classes/jogamp/opengl/GLContextShareSet.java   |  50 +-
 .../jogamp/opengl/GLDebugMessageHandler.java       | 126 ++--
 .../jogamp/opengl/GLDrawableFactoryImpl.java       |  58 +-
 .../classes/jogamp/opengl/GLDrawableHelper.java    | 198 +++---
 src/jogl/classes/jogamp/opengl/GLDrawableImpl.java |  64 +-
 .../jogamp/opengl/GLDynamicLibraryBundleInfo.java  |  18 +-
 .../jogamp/opengl/GLDynamicLookupHelper.java       |  10 +-
 .../classes/jogamp/opengl/GLFBODrawableImpl.java   | 142 ++--
 .../jogamp/opengl/GLGraphicsConfigurationUtil.java |  60 +-
 .../jogamp/opengl/GLOffscreenAutoDrawableImpl.java |  42 +-
 src/jogl/classes/jogamp/opengl/GLPbufferImpl.java  |  16 +-
 src/jogl/classes/jogamp/opengl/GLRunnableTask.java |  28 +-
 src/jogl/classes/jogamp/opengl/GLStateTracker.java |  52 +-
 .../classes/jogamp/opengl/GLVersionNumber.java     |  20 +-
 src/jogl/classes/jogamp/opengl/GLWorkerThread.java |  24 +-
 src/jogl/classes/jogamp/opengl/GLXExtensions.java  |   4 +-
 .../jogamp/opengl/ListenerSyncedImplStub.java      |  12 +-
 src/jogl/classes/jogamp/opengl/ProjectFloat.java   | 120 ++--
 .../jogamp/opengl/SharedResourceRunner.java        |  44 +-
 src/jogl/classes/jogamp/opengl/ThreadingImpl.java  |  38 +-
 .../jogamp/opengl/ToolkitThreadingPlugin.java      |  16 +-
 .../jogamp/opengl/awt/AWTThreadingPlugin.java      |  16 +-
 .../classes/jogamp/opengl/awt/AWTTilePainter.java  |  74 +-
 src/jogl/classes/jogamp/opengl/awt/AWTUtil.java    |  16 +-
 src/jogl/classes/jogamp/opengl/awt/Java2D.java     |  46 +-
 .../classes/jogamp/opengl/awt/VersionApplet.java   |   6 +-
 .../egl/DesktopES2DynamicLibraryBundleInfo.java    |  26 +-
 src/jogl/classes/jogamp/opengl/egl/EGLContext.java |  20 +-
 .../classes/jogamp/opengl/egl/EGLDisplayUtil.java  |  62 +-
 .../classes/jogamp/opengl/egl/EGLDrawable.java     |  20 +-
 .../jogamp/opengl/egl/EGLDrawableFactory.java      | 136 ++--
 .../opengl/egl/EGLDummyUpstreamSurfaceHook.java    |  12 +-
 .../opengl/egl/EGLDynamicLibraryBundleInfo.java    |  30 +-
 .../opengl/egl/EGLES1DynamicLibraryBundleInfo.java |  28 +-
 .../opengl/egl/EGLES2DynamicLibraryBundleInfo.java |  38 +-
 .../opengl/egl/EGLGraphicsConfiguration.java       |  58 +-
 .../egl/EGLGraphicsConfigurationFactory.java       |  68 +-
 .../jogamp/opengl/egl/EGLOnscreenDrawable.java     |   4 +-
 .../jogamp/opengl/egl/EGLUpstreamSurfaceHook.java  |  50 +-
 .../jogamp/opengl/egl/EGLWrappedSurface.java       |  10 +-
 .../classes/jogamp/opengl/gl2/ProjectDouble.java   |  92 +--
 .../classes/jogamp/opengl/glu/GLUquadricImpl.java  |  82 +--
 src/jogl/classes/jogamp/opengl/glu/Glue.java       |  16 +-
 .../classes/jogamp/opengl/glu/error/Error.java     |  16 +-
 .../opengl/glu/gl2/nurbs/GL2CurveEvaluator.java    |   2 +-
 .../opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java      |  38 +-
 .../jogamp/opengl/glu/mipmap/BuildMipmap.java      | 198 +++---
 .../classes/jogamp/opengl/glu/mipmap/Extract.java  |   8 +-
 .../jogamp/opengl/glu/mipmap/Extract1010102.java   |  24 +-
 .../jogamp/opengl/glu/mipmap/Extract1555rev.java   |  24 +-
 .../opengl/glu/mipmap/Extract2101010rev.java       |  24 +-
 .../jogamp/opengl/glu/mipmap/Extract233rev.java    |  18 +-
 .../jogamp/opengl/glu/mipmap/Extract332.java       |  18 +-
 .../jogamp/opengl/glu/mipmap/Extract4444.java      |  24 +-
 .../jogamp/opengl/glu/mipmap/Extract4444rev.java   |  24 +-
 .../jogamp/opengl/glu/mipmap/Extract5551.java      |  24 +-
 .../jogamp/opengl/glu/mipmap/Extract565.java       |  24 +-
 .../jogamp/opengl/glu/mipmap/Extract565rev.java    |  24 +-
 .../jogamp/opengl/glu/mipmap/Extract8888.java      |  24 +-
 .../jogamp/opengl/glu/mipmap/Extract8888rev.java   |  24 +-
 .../jogamp/opengl/glu/mipmap/ExtractFloat.java     |  14 +-
 .../jogamp/opengl/glu/mipmap/ExtractPrimitive.java |   8 +-
 .../jogamp/opengl/glu/mipmap/ExtractSByte.java     |  14 +-
 .../jogamp/opengl/glu/mipmap/ExtractSInt.java      |  14 +-
 .../jogamp/opengl/glu/mipmap/ExtractSShort.java    |  14 +-
 .../jogamp/opengl/glu/mipmap/ExtractUByte.java     |  14 +-
 .../jogamp/opengl/glu/mipmap/ExtractUInt.java      |  14 +-
 .../jogamp/opengl/glu/mipmap/ExtractUShort.java    |  14 +-
 .../jogamp/opengl/glu/mipmap/HalveImage.java       | 276 ++++----
 .../classes/jogamp/opengl/glu/mipmap/Image.java    | 120 ++--
 .../classes/jogamp/opengl/glu/mipmap/Mipmap.java   | 200 +++---
 .../opengl/glu/mipmap/PixelStorageModes.java       |  14 +-
 .../jogamp/opengl/glu/mipmap/ScaleInternal.java    | 364 +++++-----
 .../jogamp/opengl/glu/mipmap/Type_Widget.java      |  80 +--
 src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java  |  18 +-
 .../jogamp/opengl/glu/nurbs/ArcSdirSorter.java     |   2 +-
 .../jogamp/opengl/glu/nurbs/ArcTdirSorter.java     |   2 +-
 .../classes/jogamp/opengl/glu/nurbs/Backend.java   |   2 +-
 src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java  |   2 +-
 .../classes/jogamp/opengl/glu/nurbs/Breakpt.java   |   4 +-
 .../jogamp/opengl/glu/nurbs/CArrayOfArcs.java      |  32 +-
 .../jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java  |  22 +-
 .../jogamp/opengl/glu/nurbs/CArrayOfFloats.java    |  32 +-
 .../opengl/glu/nurbs/CArrayOfQuiltspecs.java       |  28 +-
 .../classes/jogamp/opengl/glu/nurbs/Curve.java     |   6 +-
 .../classes/jogamp/opengl/glu/nurbs/Flist.java     |   6 +-
 .../classes/jogamp/opengl/glu/nurbs/Knotspec.java  |  20 +-
 .../jogamp/opengl/glu/nurbs/Knotvector.java        |  14 +-
 .../classes/jogamp/opengl/glu/nurbs/Mapdesc.java   |  12 +-
 .../jogamp/opengl/glu/nurbs/O_nurbscurve.java      |   2 +-
 .../classes/jogamp/opengl/glu/nurbs/Patchlist.java |   2 +-
 .../classes/jogamp/opengl/glu/nurbs/Property.java  |   6 +-
 .../jogamp/opengl/glu/nurbs/Renderhints.java       |   2 +-
 .../jogamp/opengl/glu/nurbs/Subdivider.java        |   6 +-
 .../jogamp/opengl/glu/nurbs/TrimVertex.java        |   4 +-
 .../jogamp/opengl/glu/registry/Registry.java       |  14 +-
 .../jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 144 ++--
 .../opengl/macosx/cgl/MacOSXCGLDrawable.java       |  10 +-
 .../macosx/cgl/MacOSXCGLDrawableFactory.java       |  28 +-
 .../cgl/MacOSXCGLDynamicLibraryBundleInfo.java     |  18 +-
 .../macosx/cgl/MacOSXCGLGraphicsConfiguration.java |  44 +-
 .../cgl/MacOSXCGLGraphicsConfigurationFactory.java |  18 +-
 .../macosx/cgl/MacOSXPbufferCGLDrawable.java       |   4 +-
 .../MacOSXAWTCGLGraphicsConfigurationFactory.java  |  12 +-
 .../classes/jogamp/opengl/util/GLArrayHandler.java |  24 +-
 .../jogamp/opengl/util/GLArrayHandlerFlat.java     |  14 +-
 .../opengl/util/GLArrayHandlerInterleaved.java     |  20 +-
 .../jogamp/opengl/util/GLDataArrayHandler.java     |  10 +-
 .../jogamp/opengl/util/GLFixedArrayHandler.java    |  16 +-
 .../opengl/util/GLFixedArrayHandlerFlat.java       |   8 +-
 .../jogamp/opengl/util/GLVBOArrayHandler.java      |  10 +-
 .../jogamp/opengl/util/av/EGLMediaPlayerImpl.java  |  46 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 284 ++++----
 .../jogamp/opengl/util/av/JavaSoundAudioSink.java  |  70 +-
 .../jogamp/opengl/util/av/NullAudioSink.java       |  54 +-
 .../jogamp/opengl/util/av/NullGLMediaPlayer.java   |  44 +-
 .../av/impl/FFMPEGDynamicLibraryBundleInfo.java    | 118 ++--
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     | 174 ++---
 .../jogamp/opengl/util/av/impl/FFMPEGNatives.java  |  92 +--
 .../opengl/util/av/impl/FFMPEGStaticNatives.java   |  10 +-
 .../opengl/util/av/impl/FFMPEGv08Natives.java      |  10 +-
 .../opengl/util/av/impl/FFMPEGv09Natives.java      |  10 +-
 .../opengl/util/av/impl/FFMPEGv10Natives.java      |  10 +-
 .../opengl/util/av/impl/OMXGLMediaPlayer.java      |  48 +-
 .../jogamp/opengl/util/glsl/GLSLArrayHandler.java  |  24 +-
 .../opengl/util/glsl/GLSLArrayHandlerFlat.java     |  10 +-
 .../util/glsl/GLSLArrayHandlerInterleaved.java     |  18 +-
 .../jogamp/opengl/util/glsl/GLSLTextureRaster.java |  70 +-
 .../opengl/util/glsl/fixedfunc/FixedFuncHook.java  |  60 +-
 .../util/glsl/fixedfunc/FixedFuncPipeline.java     | 236 +++----
 .../jogamp/opengl/util/jpeg/JPEGDecoder.java       | 132 ++--
 .../jogamp/opengl/util/pngj/FilterType.java        |   2 +-
 .../classes/jogamp/opengl/util/pngj/ImageInfo.java |   2 +-
 .../classes/jogamp/opengl/util/pngj/ImageLine.java |  30 +-
 .../jogamp/opengl/util/pngj/ImageLineHelper.java   |   8 +-
 .../jogamp/opengl/util/pngj/ImageLines.java        |   8 +-
 .../jogamp/opengl/util/pngj/PngHelperInternal.java |   2 +-
 .../classes/jogamp/opengl/util/pngj/PngReader.java |  56 +-
 .../classes/jogamp/opengl/util/pngj/PngWriter.java |  28 +-
 .../jogamp/opengl/util/pngj/PngjException.java     |   4 +-
 .../opengl/util/pngj/PngjExceptionInternal.java    |   4 +-
 .../opengl/util/pngj/chunks/ChunkHelper.java       |  14 +-
 .../util/pngj/chunks/ChunkLoadBehaviour.java       |   2 +-
 .../opengl/util/pngj/chunks/ChunkPredicate.java    |   2 +-
 .../jogamp/opengl/util/pngj/chunks/ChunksList.java |  12 +-
 .../util/pngj/chunks/ChunksListForWrite.java       |   6 +-
 .../jogamp/opengl/util/pngj/chunks/PngChunk.java   |   2 +-
 .../opengl/util/pngj/chunks/PngChunkBKGD.java      |   6 +-
 .../opengl/util/pngj/chunks/PngChunkMultiple.java  |   4 +-
 .../opengl/util/pngj/chunks/PngChunkSBIT.java      |   2 +-
 .../opengl/util/pngj/chunks/PngChunkTRNS.java      |   2 +-
 .../opengl/util/pngj/chunks/PngMetadata.java       |  10 +-
 .../opengl/windows/wgl/WGLGLCapabilities.java      |   8 +-
 .../classes/jogamp/opengl/windows/wgl/WGLUtil.java |  22 +-
 .../windows/wgl/WindowsBitmapWGLDrawable.java      |   4 +-
 .../windows/wgl/WindowsExternalWGLContext.java     |   2 +-
 .../windows/wgl/WindowsPbufferWGLDrawable.java     |   6 +-
 .../opengl/windows/wgl/WindowsWGLContext.java      |  10 +-
 .../opengl/windows/wgl/WindowsWGLDrawable.java     |   8 +-
 .../windows/wgl/WindowsWGLDrawableFactory.java     |  30 +-
 .../wgl/WindowsWGLDynamicLibraryBundleInfo.java    |  14 +-
 .../wgl/WindowsWGLGraphicsConfiguration.java       |  72 +-
 .../WindowsWGLGraphicsConfigurationFactory.java    |  42 +-
 .../WindowsAWTWGLGraphicsConfigurationFactory.java |  22 +-
 .../classes/jogamp/opengl/x11/glx/GLXUtil.java     |  44 +-
 .../opengl/x11/glx/X11ExternalGLXContext.java      |   6 +-
 .../opengl/x11/glx/X11ExternalGLXDrawable.java     |   2 +-
 .../jogamp/opengl/x11/glx/X11GLXContext.java       |  18 +-
 .../opengl/x11/glx/X11GLXDrawableFactory.java      |  30 +-
 .../x11/glx/X11GLXDynamicLibraryBundleInfo.java    |  22 +-
 .../x11/glx/X11GLXGraphicsConfiguration.java       |  60 +-
 .../glx/X11GLXGraphicsConfigurationFactory.java    |  46 +-
 .../DelegatedUpstreamSurfaceHookMutableSize.java   |   6 +-
 ...elegatedUpstreamSurfaceHookWithSurfaceSize.java |   8 +-
 .../nativewindow/MutableGraphicsConfiguration.java |   4 +-
 .../jogamp/nativewindow/NativeWindowVersion.java   |  10 +-
 .../UpstreamSurfaceHookMutableSize.java            |  10 +-
 .../nativewindow/awt/AWTGraphicsConfiguration.java |  26 +-
 .../jogamp/nativewindow/awt/AWTGraphicsDevice.java |  14 +-
 .../jogamp/nativewindow/awt/AWTGraphicsScreen.java |  14 +-
 .../jogamp/nativewindow/awt/AWTPrintLifecycle.java |  26 +-
 .../nativewindow/awt/AWTWindowClosingProtocol.java |   2 +-
 .../nativewindow/awt/DirectDataBufferInt.java      |  62 +-
 .../com/jogamp/nativewindow/awt/JAWTWindow.java    |  52 +-
 .../jogamp/nativewindow/egl/EGLGraphicsDevice.java |  30 +-
 .../nativewindow/macosx/MacOSXGraphicsDevice.java  |  10 +-
 .../com/jogamp/nativewindow/swt/SWTAccessor.java   | 164 ++---
 .../windows/WindowsGraphicsDevice.java             |  12 +-
 .../nativewindow/x11/X11GraphicsConfiguration.java |  16 +-
 .../jogamp/nativewindow/x11/X11GraphicsDevice.java |  30 +-
 .../jogamp/nativewindow/x11/X11GraphicsScreen.java |  12 +-
 .../AbstractGraphicsConfiguration.java             |  16 +-
 .../media/nativewindow/AbstractGraphicsDevice.java |  46 +-
 .../media/nativewindow/AbstractGraphicsScreen.java |  16 +-
 .../javax/media/nativewindow/Capabilities.java     |  46 +-
 .../media/nativewindow/CapabilitiesChooser.java    |  16 +-
 .../media/nativewindow/CapabilitiesImmutable.java  |   8 +-
 .../nativewindow/DefaultCapabilitiesChooser.java   |  24 +-
 .../nativewindow/DefaultGraphicsConfiguration.java |  18 +-
 .../media/nativewindow/DefaultGraphicsDevice.java  |  34 +-
 .../media/nativewindow/DefaultGraphicsScreen.java  |  12 +-
 .../nativewindow/GraphicsConfigurationFactory.java |  84 +--
 .../javax/media/nativewindow/MutableSurface.java   |   4 +-
 .../javax/media/nativewindow/NativeSurface.java    |  40 +-
 .../media/nativewindow/NativeWindowException.java  |  14 +-
 .../media/nativewindow/NativeWindowFactory.java    | 134 ++--
 .../media/nativewindow/OffscreenLayerOption.java   |  12 +-
 .../media/nativewindow/OffscreenLayerSurface.java  |  22 +-
 .../javax/media/nativewindow/ProxySurface.java     |  60 +-
 .../media/nativewindow/SurfaceUpdatedListener.java |  12 +-
 .../javax/media/nativewindow/ToolkitLock.java      |  14 +-
 .../media/nativewindow/UpstreamSurfaceHook.java    |  18 +-
 .../javax/media/nativewindow/VisualIDHolder.java   |  36 +-
 .../media/nativewindow/WindowClosingProtocol.java  |   4 +-
 .../javax/media/nativewindow/util/Dimension.java   |  18 +-
 .../nativewindow/util/DimensionImmutable.java      |   4 +-
 .../javax/media/nativewindow/util/Insets.java      |  18 +-
 .../media/nativewindow/util/InsetsImmutable.java   |   4 +-
 .../javax/media/nativewindow/util/Point.java       |   8 +-
 .../media/nativewindow/util/PointImmutable.java    |   6 +-
 .../javax/media/nativewindow/util/Rectangle.java   |  28 +-
 .../nativewindow/util/RectangleImmutable.java      |  10 +-
 .../javax/media/nativewindow/util/SurfaceSize.java |  18 +-
 .../classes/jogamp/nativewindow/Debug.java         |  16 +-
 .../DefaultGraphicsConfigurationFactoryImpl.java   |  10 +-
 .../jogamp/nativewindow/GlobalToolkitLock.java     |  14 +-
 .../jogamp/nativewindow/NWJNILibLoader.java        |  12 +-
 .../nativewindow/NativeWindowFactoryImpl.java      |  16 +-
 .../jogamp/nativewindow/NullToolkitLock.java       |  10 +-
 .../jogamp/nativewindow/ProxySurfaceImpl.java      |  42 +-
 .../jogamp/nativewindow/ResourceToolkitLock.java   |   8 +-
 .../nativewindow/SharedResourceToolkitLock.java    |  18 +-
 .../jogamp/nativewindow/SurfaceUpdatedHelper.java  |  22 +-
 .../jogamp/nativewindow/ToolkitProperties.java     |  20 +-
 .../jogamp/nativewindow/WrappedSurface.java        |  10 +-
 .../classes/jogamp/nativewindow/awt/AWTMisc.java   |  20 +-
 .../jogamp/nativewindow/jawt/JAWTJNILibLoader.java |  24 +-
 .../classes/jogamp/nativewindow/jawt/JAWTUtil.java | 112 +--
 .../nativewindow/jawt/JAWT_PlatformInfo.java       |  14 +-
 .../nativewindow/jawt/macosx/MacOSXJAWTWindow.java |  82 +--
 .../jawt/windows/Win32SunJDKReflection.java        |  14 +-
 .../jawt/windows/WindowsJAWTWindow.java            |  16 +-
 .../nativewindow/jawt/x11/X11JAWTWindow.java       |  18 +-
 .../nativewindow/jawt/x11/X11SunJDKReflection.java |  14 +-
 .../macosx/OSXDummyUpstreamSurfaceHook.java        |  14 +-
 .../jogamp/nativewindow/macosx/OSXUtil.java        |  94 +--
 .../windows/GDIDummyUpstreamSurfaceHook.java       |  18 +-
 .../jogamp/nativewindow/windows/GDISurface.java    |  14 +-
 .../jogamp/nativewindow/windows/GDIUtil.java       |  36 +-
 .../nativewindow/windows/RegisteredClass.java      |   2 +-
 .../windows/RegisteredClassFactory.java            |  16 +-
 .../x11/X11DummyUpstreamSurfaceHook.java           |  14 +-
 .../x11/X11GraphicsConfigurationFactory.java       |  16 +-
 .../classes/jogamp/nativewindow/x11/X11Util.java   |  94 +--
 .../awt/X11AWTGraphicsConfigurationFactory.java    |  36 +-
 src/newt/classes/com/jogamp/newt/Display.java      |  32 +-
 .../classes/com/jogamp/newt/MonitorDevice.java     |  46 +-
 src/newt/classes/com/jogamp/newt/MonitorMode.java  |  84 +--
 src/newt/classes/com/jogamp/newt/NewtFactory.java  |  24 +-
 src/newt/classes/com/jogamp/newt/NewtVersion.java  |  10 +-
 src/newt/classes/com/jogamp/newt/Screen.java       |  34 +-
 src/newt/classes/com/jogamp/newt/Window.java       |  32 +-
 .../classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 158 ++---
 .../jogamp/newt/awt/applet/JOGLNewtApplet1Run.java |  24 +-
 .../jogamp/newt/awt/applet/JOGLNewtAppletBase.java |  22 +-
 .../jogamp/newt/event/DoubleTapScrollGesture.java  |  66 +-
 .../com/jogamp/newt/event/GestureHandler.java      |  60 +-
 .../classes/com/jogamp/newt/event/InputEvent.java  |  56 +-
 .../classes/com/jogamp/newt/event/KeyAdapter.java  |  10 +-
 .../classes/com/jogamp/newt/event/KeyEvent.java    | 256 +++----
 .../classes/com/jogamp/newt/event/KeyListener.java |  22 +-
 .../com/jogamp/newt/event/MonitorEvent.java        |  12 +-
 .../com/jogamp/newt/event/MouseAdapter.java        |  10 +-
 .../classes/com/jogamp/newt/event/MouseEvent.java  | 164 ++---
 .../com/jogamp/newt/event/MouseListener.java       |  20 +-
 .../classes/com/jogamp/newt/event/NEWTEvent.java   |  30 +-
 .../com/jogamp/newt/event/NEWTEventConsumer.java   |  14 +-
 .../com/jogamp/newt/event/NEWTEventFiFo.java       |  10 +-
 .../com/jogamp/newt/event/NEWTEventListener.java   |  12 +-
 .../classes/com/jogamp/newt/event/OutputEvent.java |   2 +-
 .../com/jogamp/newt/event/PinchToZoomGesture.java  |  48 +-
 .../com/jogamp/newt/event/TraceKeyAdapter.java     |  10 +-
 .../com/jogamp/newt/event/TraceMouseAdapter.java   |  10 +-
 .../com/jogamp/newt/event/TraceWindowAdapter.java  |  10 +-
 .../com/jogamp/newt/event/WindowAdapter.java       |  10 +-
 .../classes/com/jogamp/newt/event/WindowEvent.java |  16 +-
 .../com/jogamp/newt/event/WindowListener.java      |  18 +-
 .../com/jogamp/newt/event/WindowUpdateEvent.java   |  10 +-
 .../com/jogamp/newt/event/awt/AWTAdapter.java      |  36 +-
 .../com/jogamp/newt/event/awt/AWTKeyAdapter.java   |  12 +-
 .../com/jogamp/newt/event/awt/AWTMouseAdapter.java |  12 +-
 .../jogamp/newt/event/awt/AWTWindowAdapter.java    |  24 +-
 .../classes/com/jogamp/newt/opengl/GLWindow.java   |  38 +-
 .../classes/com/jogamp/newt/swt/NewtCanvasSWT.java | 130 ++--
 src/newt/classes/com/jogamp/newt/util/EDTUtil.java |  30 +-
 .../classes/com/jogamp/newt/util/MainThread.java   |  90 +--
 .../com/jogamp/newt/util/MonitorModeUtil.java      |  18 +-
 src/newt/classes/jogamp/newt/Debug.java            |  18 +-
 src/newt/classes/jogamp/newt/DefaultEDTUtil.java   |  36 +-
 src/newt/classes/jogamp/newt/DisplayImpl.java      |  66 +-
 .../classes/jogamp/newt/MonitorDeviceImpl.java     |  28 +-
 src/newt/classes/jogamp/newt/MonitorModeProps.java |  44 +-
 src/newt/classes/jogamp/newt/NEWTJNILibLoader.java |  16 +-
 src/newt/classes/jogamp/newt/OffscreenWindow.java  |  28 +-
 src/newt/classes/jogamp/newt/ScreenImpl.java       |  98 +--
 .../classes/jogamp/newt/ScreenMonitorState.java    |  18 +-
 src/newt/classes/jogamp/newt/WindowImpl.java       | 554 +++++++--------
 .../classes/jogamp/newt/awt/NewtFactoryAWT.java    |  16 +-
 .../jogamp/newt/awt/event/AWTNewtEventFactory.java |  74 +-
 .../newt/awt/event/AWTParentWindowAdapter.java     |  20 +-
 .../jogamp/newt/driver/DriverClearFocus.java       |   6 +-
 .../jogamp/newt/driver/DriverUpdatePosition.java   |   8 +-
 .../classes/jogamp/newt/driver/awt/AWTCanvas.java  |  40 +-
 .../classes/jogamp/newt/driver/awt/AWTEDTUtil.java |  32 +-
 .../jogamp/newt/driver/awt/DisplayDriver.java      |  16 +-
 .../jogamp/newt/driver/awt/ScreenDriver.java       |  28 +-
 .../jogamp/newt/driver/awt/WindowDriver.java       |  50 +-
 .../jogamp/newt/driver/bcm/egl/DisplayDriver.java  |  12 +-
 .../jogamp/newt/driver/bcm/egl/ScreenDriver.java   |  20 +-
 .../jogamp/newt/driver/bcm/egl/WindowDriver.java   |  22 +-
 .../newt/driver/bcm/vc/iv/DisplayDriver.java       |  10 +-
 .../jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java |  22 +-
 .../jogamp/newt/driver/bcm/vc/iv/WindowDriver.java |  30 +-
 .../newt/driver/intel/gdl/DisplayDriver.java       |  12 +-
 .../jogamp/newt/driver/intel/gdl/ScreenDriver.java |  22 +-
 .../jogamp/newt/driver/intel/gdl/WindowDriver.java |  18 +-
 .../jogamp/newt/driver/kd/DisplayDriver.java       |  12 +-
 .../jogamp/newt/driver/kd/ScreenDriver.java        |  26 +-
 .../jogamp/newt/driver/kd/WindowDriver.java        |  22 +-
 .../newt/driver/linux/LinuxEventDeviceTracker.java |  16 +-
 .../newt/driver/linux/LinuxMouseTracker.java       |  46 +-
 .../jogamp/newt/driver/macosx/DisplayDriver.java   |  18 +-
 .../jogamp/newt/driver/macosx/MacKeyUtil.java      |  38 +-
 .../jogamp/newt/driver/macosx/ScreenDriver.java    |  32 +-
 .../jogamp/newt/driver/macosx/WindowDriver.java    | 126 ++--
 .../jogamp/newt/driver/windows/DisplayDriver.java  |  18 +-
 .../jogamp/newt/driver/windows/ScreenDriver.java   |  28 +-
 .../jogamp/newt/driver/windows/WindowDriver.java   |  90 +--
 .../jogamp/newt/driver/x11/DisplayDriver.java      |  28 +-
 src/newt/classes/jogamp/newt/driver/x11/RandR.java |  22 +-
 .../classes/jogamp/newt/driver/x11/RandR11.java    |  66 +-
 .../classes/jogamp/newt/driver/x11/RandR13.java    |  60 +-
 .../jogamp/newt/driver/x11/ScreenDriver.java       |  68 +-
 .../jogamp/newt/driver/x11/WindowDriver.java       |  92 +--
 .../classes/jogamp/newt/event/NEWTEventTask.java   |  10 +-
 src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java   |  46 +-
 .../jogamp/newt/swt/event/SWTNewtEventFactory.java |  48 +-
 643 files changed, 12269 insertions(+), 12269 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
index 2b51be164..83f5e4ebd 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
index 60972873e..0a502c123 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -344,7 +344,7 @@ public class Mixer {
                 e.printStackTrace();
             }
         }
-        
+
         if (directByteBufferConstructor != null) {
             try {
                 return (ByteBuffer)
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
index c45430d23..01346553c 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
index b57bf1dc6..98a787478 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -151,7 +151,7 @@ public class Track {
     // These are only for use by the Mixer
     private float leftGain;
     private float rightGain;
-    
+
     void setLeftGain(float leftGain) {
         this.leftGain = leftGain;
     }
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
index 1afdaf081..0726e5762 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
index b04f35230..8429fbcfd 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -67,7 +67,7 @@ public class BuildComposablePipeline {
      * By extra command-line argument: <code>prolog_xor_downstream</code>.
      * <p>
      * If true, either prolog (if exist) is called or downstream's method, but not both.
-     * By default, both methods would be called. 
+     * By default, both methods would be called.
      * </p>
      * <p>Default: false</p>
      */
@@ -81,7 +81,7 @@ public class BuildComposablePipeline {
      * <p>Default: false</p>
      */
     public static final int GEN_GL_IDENTITY_BY_ASSIGNABLE_CLASS = 1 << 4;
-    
+
     int mode;
     private String outputDir;
     private String outputPackage;
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
index 5298cc357..a5a26d18f 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -68,7 +68,7 @@ import java.util.regex.Pattern;
    * <br>
    *
    * <pre>
-   * 
+   *
    * #ifndef GL_XXXX
    * GLAPI <returnType> <APIENTRY|GLAPIENTRY> glFuncName(<params>)
    * #endif GL_XXXX
@@ -78,7 +78,7 @@ import java.util.regex.Pattern;
    * For example, if it parses the following data:
    *
    * <pre>
-   * 
+   *
    * #ifndef GL_VERSION_1_3
    * GLAPI void APIENTRY glActiveTexture (GLenum);
    * GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
@@ -89,7 +89,7 @@ import java.util.regex.Pattern;
    * GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
    * GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
    * #endif
-   * 
+   *
    * </pre>
    *
    * It will associate
@@ -105,7 +105,7 @@ import java.util.regex.Pattern;
    * */
 public class BuildStaticGLInfo {
 
-  // Handles function pointer 
+  // Handles function pointer
   protected static final int funcIdentifierGroup = 9;
   protected static Pattern funcPattern =
     Pattern.compile("^(GLAPI|GL_API|GL_APICALL|EGLAPI|extern)?(\\s*)((unsigned|const)\\s+)?(\\w+)(\\s+\\*\\s*|\\s*\\*\\s+|\\s+)?(GLAPIENTRY|GL_APIENTRY|APIENTRY|EGLAPIENTRY|WINAPI)?(\\s*)([ew]?gl\\w+)\\s?(\\(.*)");
@@ -119,7 +119,7 @@ public class BuildStaticGLInfo {
     Pattern.compile("\\#(elif|else)(.*)");
   protected static Pattern endifPattern =
     Pattern.compile("\\#endif(.*)");
-  
+
   protected static final int defineIdentifierGroup = 1;
   protected static Pattern definePattern =
     Pattern.compile("\\#define ([CEW]?GL[XU]?_[A-Za-z0-9_]+)\\s*([A-Za-z0-9_]+)(.*)");
@@ -203,7 +203,7 @@ public class BuildStaticGLInfo {
         Matcher m = null;
         int block = 0;
         while ((line = reader.readLine()) != null) {
-            int type = 0; // 1-define, 2-function            
+            int type = 0; // 1-define, 2-function
             if ( 0 < block ) { // inside a #ifndef GL_XXX block and matching a function, if block > 0
                 String identifier = null;
                 if( 2 >= block ) {  // not within sub-blocks > 2, i.e. further typedefs
@@ -216,9 +216,9 @@ public class BuildStaticGLInfo {
                     }
                 }
                 if ( identifier != null &&
-                     activeAssociation != null &&                     
-                     !identifier.equals(activeAssociation) // Handles #ifndef GL_... #define GL_... 
-                   ) 
+                     activeAssociation != null &&
+                     !identifier.equals(activeAssociation) // Handles #ifndef GL_... #define GL_...
+                   )
                 {
                     addAssociation(identifier, activeAssociation);
                     if (DEBUG) {
@@ -243,7 +243,7 @@ public class BuildStaticGLInfo {
                             if (DEBUG) {
                                 System.err.println("<"+block+"> END ASSOCIATION BLOCK: <" + activeAssociation + " <-> " + comment + ">");
                             }
-                            activeAssociation = null;                
+                            activeAssociation = null;
                         } else {
                             if (DEBUG) {
                                 System.err.println("<"+block+"> END IF BLOCK: <" + comment + ">");
@@ -251,7 +251,7 @@ public class BuildStaticGLInfo {
                         }
                     }
                 }
-            } else if ((m = associationPattern.matcher(line)).matches()) {                
+            } else if ((m = associationPattern.matcher(line)).matches()) {
                 // found a new #ifndef GL_XXX block
                 activeAssociation = m.group(1).trim();
                 block++;
@@ -387,7 +387,7 @@ public class BuildStaticGLInfo {
             declarationToExtensionMap.put(identifier, extensions);
         }
         extensions.add(association);
-        
+
         Set<String> identifiers = extensionToDeclarationMap.get(association);
         if (identifiers == null) {
             identifiers = new HashSet<String>();
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
index a00b19abc..f1a32fa9c 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -241,7 +241,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
                     }
                 }
                 if( ignoredExtension ) {
-                    ignoredExtension = !shouldForceExtension( symbol, true, symbol );                        
+                    ignoredExtension = !shouldForceExtension( symbol, true, symbol );
                     if( ignoredExtension ) {
                         final Set<String> origSymbols = getRenamedJavaSymbols( symbol );
                         if(null != origSymbols) {
@@ -251,7 +251,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
                                     break;
                                 }
                             }
-                        }                    
+                        }
                     }
                 }
                 if( ignoredExtension ) {
@@ -274,7 +274,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
         }
         return false;
     }
-    
+
     public boolean shouldForceExtension(final String symbol, final boolean criteria, final String renamedSymbol) {
         if (criteria && glInfo != null) {
             final Set<String> extensionNames = glInfo.getExtension(symbol);
@@ -292,7 +292,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
                         }
                         return true;
                     }
-                }            
+                }
             }
         }
         return false;
@@ -343,9 +343,9 @@ public class GLConfiguration extends ProcAddressConfiguration {
     public boolean isBufferObjectFunction(String name) {
         return (getBufferObjectKind(name) != null);
     }
-    
-    public boolean isBufferObjectOnly(String name) { 
-        return bufferObjectOnly.contains(name); 
+
+    public boolean isBufferObjectOnly(String name) {
+        return bufferObjectOnly.contains(name);
     }
 
     /** Parses any GL headers specified in the configuration file for
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
index fa95049cc..1af632682 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -125,7 +125,7 @@ public class GLEmitter extends ProcAddressEmitter {
             }
             if(JavaConfiguration.DEBUG_RENAMES) {
                 System.err.println("RenameExtensionIntoCore: "+extension+" END>");
-            }            
+            }
         }
     }
 
@@ -279,7 +279,7 @@ public class GLEmitter extends ProcAddressEmitter {
         int j=0;
         while( j < bindings.size() ) {
             final MethodBinding cur = bindings.get(j);
-            
+
             // Some of these routines (glBitmap) take strongly-typed
             // primitive pointers as arguments which are expanded into
             // non-void* arguments
@@ -306,7 +306,7 @@ public class GLEmitter extends ProcAddressEmitter {
             // Now need to flag this MethodBinding so that we generate the
             // correct flags in the emitters later
             bufferObjectMethodBindings.put(result, result);
-            
+
             if( bufferObjectOnly ) {
                 bindings.remove(j);
             } else {
@@ -397,7 +397,7 @@ public class GLEmitter extends ProcAddressEmitter {
     }
     private int addExtensionListOfAliasedSymbols2Buffer(BuildStaticGLInfo glInfo, StringBuilder buf, String sep1, String sep2, String name, Collection<String> exclude) {
         int num = 0;
-        if(null != name) { 
+        if(null != name) {
             num += addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, name); // extensions of given name
             boolean needsSep2 = 0<num;
             Set<String> origNames = cfg.getRenamedJavaSymbols(name);
@@ -406,7 +406,7 @@ public class GLEmitter extends ProcAddressEmitter {
                     if(!exclude.contains(origName)) {
                         if (needsSep2) {
                             buf.append(sep2); // diff-name seperator
-                        }            
+                        }
                         int num2 = addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, origName); // extensions of orig-name
                         needsSep2 = num<num2;
                         num += num2;
@@ -416,7 +416,7 @@ public class GLEmitter extends ProcAddressEmitter {
         }
         return num;
     }
-    
+
     public int addExtensionsOfSymbols2Buffer(StringBuilder buf, String sep1, String sep2, String first, Collection<String> col) {
         BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
         if (null == glInfo) {
@@ -469,16 +469,16 @@ public class GLEmitter extends ProcAddressEmitter {
 
     /**
      * {@inheritDoc}
-     */   
+     */
     @Override
     protected void endProcAddressTable() throws Exception {
         PrintWriter w = tableWriter;
-        
+
         w.println("  @Override");
         w.println("  protected boolean isFunctionAvailableImpl(String functionNameUsr) throws IllegalArgumentException  {");
         w.println("    final String functionNameBase = "+GLNameResolver.class.getName()+".normalizeVEN(com.jogamp.gluegen.runtime.opengl.GLNameResolver.normalizeARB(functionNameUsr, true), true);");
         w.println("    final String addressFieldNameBase = \"" + PROCADDRESS_VAR_PREFIX + "\" + functionNameBase;");
-        w.println("    final int funcNamePermNum = "+GLNameResolver.class.getName()+".getFuncNamePermutationNumber(functionNameBase);");        
+        w.println("    final int funcNamePermNum = "+GLNameResolver.class.getName()+".getFuncNamePermutationNumber(functionNameBase);");
         w.println("    final java.lang.reflect.Field addressField = java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<java.lang.reflect.Field>() {");
         w.println("        public final java.lang.reflect.Field run() {");
         w.println("            java.lang.reflect.Field addressField = null;");
@@ -510,7 +510,7 @@ public class GLEmitter extends ProcAddressEmitter {
         w.println("          \"function\", e);");
         w.println("    }");
         w.println("  }");
-        
+
         w.println("  @Override");
         w.println("  public long getAddressFor(String functionNameUsr) throws SecurityException, IllegalArgumentException {");
         w.println("    SecurityUtil.checkAllLinkPermission();");
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
index fdfaee8a6..389d35f99 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -111,7 +111,7 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
             writer.print("<code> ");
             writer.print(funcSym.getType().toString(symbolRenamed, tagNativeBinding));
             writer.print(" </code> ");
-            
+
             newComment.append("<br>Part of ");
             if (0 == glEmitter.addExtensionsOfSymbols2Buffer(newComment, ", ", "; ", symbolRenamed, binding.getAliasedNames())) {
                 if (glEmitter.getGLConfig().getAllowNonGLExtensions()) {
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
index e3e7cb970..b98f17117 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
@@ -55,13 +55,13 @@ import org.apache.tools.ant.util.JavaEnvUtils;
 /**
  * <p>An <a href="http://ant.apache.org">ANT</a> {@link org.apache.tools.ant.Task}
  * for using {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo}.</p>
- * 
+ *
  * <p>Usage:</p>
  * <pre>
-    &lt;staticglgen package="[generated files package]" 
+    &lt;staticglgen package="[generated files package]"
                     headers="[file pattern of GL headers]"
                     outputdir="[directory to output the generated files]" /&gt;
- * </pre> 
+ * </pre>
  *
  * @author Rob Grzywinski <a href="mailto:rgrzywinski@realityinteractive.com">rgrzywinski@yahoo.com</a>
  */
@@ -72,7 +72,7 @@ public class StaticGLGenTask extends Task
      * <p>The {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo} classname.</p>
      */
     private static final String GL_GEN = "com.jogamp.gluegen.opengl.BuildStaticGLInfo";
-    
+
     // =========================================================================
     /**
      * <p>The {@link org.apache.tools.ant.types.CommandlineJava} that is used
@@ -90,12 +90,12 @@ public class StaticGLGenTask extends Task
      * <p>The output directory.</p>
      */
     private String outputDirectory;
-    
+
     /**
      * <p>The {@link org.apache.tools.ant.types.FileSet} of GL headers.</p>
      */
     private FileSet headerSet = new FileSet();
-    
+
     // =========================================================================
     /**
      * <p>Create and add the VM and classname to {@link org.apache.tools.ant.types.CommandlineJava}.</p>
@@ -104,7 +104,7 @@ public class StaticGLGenTask extends Task
     {
         // create the CommandlineJava that will be used to call BuildStaticGLInfo
         glgenCommandline = new CommandlineJava();
-        
+
         // set the VM and classname in the commandline
         glgenCommandline.setVm(JavaEnvUtils.getJreExecutable("java"));
         glgenCommandline.setClassname(GL_GEN);
@@ -114,7 +114,7 @@ public class StaticGLGenTask extends Task
     // ANT getters and setters
     /**
      * <p>Set the package name for the generated files.  This is called by ANT.</p>
-     * 
+     *
      * @param  packageName the name of the package for the generated files
      */
     public void setPackage(String packageName)
@@ -125,12 +125,12 @@ public class StaticGLGenTask extends Task
 
     /**
      * <p>Set the output directory.  This is called by ANT.</p>
-     * 
+     *
      * @param  directory the output directory
      */
     public void setOutputDir(String directory)
     {
-        log( ("Setting output directory to: " + directory), 
+        log( ("Setting output directory to: " + directory),
               Project.MSG_VERBOSE);
         this.outputDirectory = directory;
     }
@@ -138,7 +138,7 @@ public class StaticGLGenTask extends Task
     /**
      * <p>Add a header file to the list.  This is called by ANT for a nested
      * element.</p>
-     * 
+     *
      * @return {@link org.apache.tools.ant.types.PatternSet.NameEntry}
      */
     public PatternSet.NameEntry createHeader()
@@ -149,7 +149,7 @@ public class StaticGLGenTask extends Task
     /**
      * <p>Add a header file to the list.  This is called by ANT for a nested
      * element.</p>
-     * 
+     *
      * @return {@link org.apache.tools.ant.types.PatternSet.NameEntry}
      */
     public PatternSet.NameEntry createHeadersFile()
@@ -171,7 +171,7 @@ public class StaticGLGenTask extends Task
     /**
      * <p>Add an optional classpath that defines the location of {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo}
      * and <code>BuildStaticGLInfo</code>'s dependencies.</p>
-     * 
+     *
      * @returns {@link org.apache.tools.ant.types.Path}
      */
      public Path createClasspath()
@@ -183,23 +183,23 @@ public class StaticGLGenTask extends Task
     /**
      * <p>Run the task.  This involves validating the set attributes, creating
      * the command line to be executed and finally executing the command.</p>
-     * 
+     *
      * @see  org.apache.tools.ant.Task#execute()
      */
-    public void execute() 
-        throws BuildException 
+    public void execute()
+        throws BuildException
     {
         // validate that all of the required attributes have been set
         validateAttributes();
-        
+
         // TODO:  add logic to determine if the generated file needs to be
         //        regenerated
-        
+
         // add the attributes to the CommandlineJava
         addAttributes();
 
         log(glgenCommandline.describeCommand(), Project.MSG_VERBOSE);
-        
+
         // execute the command and throw on error
         final int error = execute(glgenCommandline.getCommandline());
         if(error == 1)
@@ -208,11 +208,11 @@ public class StaticGLGenTask extends Task
 
     /**
      * <p>Ensure that the user specified all required arguments.</p>
-     * 
-     * @throws BuildException if there are required arguments that are not 
+     *
+     * @throws BuildException if there are required arguments that are not
      *         present or not valid
      */
-    private void validateAttributes() 
+    private void validateAttributes()
         throws BuildException
     {
         // validate that the package name is set
@@ -223,29 +223,29 @@ public class StaticGLGenTask extends Task
         // TODO:  switch to file and ensure that it exists
         if(!isValid(outputDirectory))
             throw new BuildException("Invalid output directory name: " + outputDirectory);
-            
+
         // TODO:  validate that there are headers set
     }
 
     /**
      * <p>Is the specified string valid?  A valid string is non-<code>null</code>
      * and has a non-zero length.</p>
-     * 
+     *
      * @param  string the string to be tested for validity
      * @return <code>true</code> if the string is valid.  <code>false</code>
-     *         otherwise. 
+     *         otherwise.
      */
     private boolean isValid(String string)
     {
         // check for null
         if(string == null)
             return false;
-            
+
         // ensure that the string has a non-zero length
         // NOTE:  must trim() to remove leading and trailing whitespace
         if(string.trim().length() < 1)
             return false;
-            
+
         // the string is valid
         return true;
     }
@@ -258,10 +258,10 @@ public class StaticGLGenTask extends Task
     {
         // add the package name
         glgenCommandline.createArgument().setValue(packageName);
-        
+
         // add the output directory name
         glgenCommandline.createArgument().setValue(outputDirectory);
-        
+
         // add the header -files- from the FileSet
         headerSet.setDir(getProject().getBaseDir());
         DirectoryScanner directoryScanner = headerSet.getDirectoryScanner(getProject());
@@ -272,25 +272,25 @@ public class StaticGLGenTask extends Task
         }
     }
 
-    /** 
-     * <p>Execute {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo} in a 
+    /**
+     * <p>Execute {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo} in a
      * forked JVM.</p>
-     * 
+     *
      * @throws BuildException
      */
-    private int execute(String[] command) 
+    private int execute(String[] command)
         throws BuildException
     {
         // create the object that will perform the command execution
         Execute execute = new Execute(new LogStreamHandler(this, Project.MSG_INFO,
-                                                           Project.MSG_WARN), 
+                                                           Project.MSG_WARN),
                                       null);
-                                      
+
         // set the project and command line
         execute.setAntRun(project);
         execute.setCommandline(command);
         execute.setWorkingDirectory( project.getBaseDir() );
-        
+
         // execute the command
         try
         {
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
index adb1c2ae0..4ac9ae3f3 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -55,8 +55,8 @@ import java.util.Set;
 
 /**
  * Emitter producing NativeSignature attributes.
- * 
- * Review: This Package/Class is not used and subject to be deleted. 
+ *
+ * Review: This Package/Class is not used and subject to be deleted.
  */
 public class NativeSignatureEmitter extends GLEmitter {
 
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
index e98478b6e..a17657382 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -182,14 +182,14 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
 
       // Always emit outgoing "this" argument
       writer.print("long ");
-      writer.print(javaThisArgumentName());      
+      writer.print(javaThisArgumentName());
       ++numEmitted;
       needComma = true;
     }
 
     for (int i = 0; i < binding.getNumArguments(); i++) {
       JavaType type = binding.getJavaArgumentType(i);
-      if (type.isVoid()) { 
+      if (type.isVoid()) {
         // Make sure this is the only param to the method; if it isn't,
         // there's something wrong with our parsing of the headers.
         if (binding.getNumArguments() != 1) {
@@ -198,7 +198,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
             "multi-argument function \"" + binding + "\"");
         }
         continue;
-      } 
+      }
 
       if (type.isJNIEnv() || binding.isArgumentThisPointer(i)) {
         // Don't need to expose these at the Java level
@@ -229,7 +229,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
         if (type.isNIOBuffer()) {
           writer.print(", int " + byteOffsetArgName(i));
         } else if (type.isNIOBufferArray()) {
-          writer.print(", int[] " + 
+          writer.print(", int[] " +
                        byteOffsetArrayArgName(i));
         }
       }
@@ -246,7 +246,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     writer.print("    ");
     JavaType returnType = binding.getJavaReturnType();
     boolean needsResultAssignment = false;
-    
+
     if (!returnType.isVoid()) {
       if (returnType.isCompoundTypeWrapper() ||
           returnType.isNIOByteBuffer()) {
@@ -375,7 +375,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
         // there's something wrong with our parsing of the headers.
         assert(binding.getNumArguments() == 1);
         continue;
-      } 
+      }
 
       if (needComma) {
         writer.print(", ");
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
index 92554776a..9b57a2f2d 100644
--- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
+++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  */
 package com.jogamp.gluegen.runtime.opengl;
 
@@ -43,12 +43,12 @@ public class GLNameResolver {
     //GL_XYZ : GL_XYZ, GL_GL2_XYZ, GL_ARB_XYZ, GL_OES_XYZ, GL_OML_XYZ
     //
     // Pass-1 Unify ARB extensions with the same value
-    // Pass-2 Unify vendor extensions, 
+    // Pass-2 Unify vendor extensions,
     //        if exist as an ARB extension with the same value.
     // Pass-3 Emit
 
     public static final String[] extensionsARB = { "ARB", "GL2", "OES", "KHR", "OML" };
-    public static final String[] extensionsVEN = { "3DFX", 
+    public static final String[] extensionsVEN = { "3DFX",
                                                    "AMD",
                                                    "ANGLE",
                                                    "ARM",
@@ -158,7 +158,7 @@ public class GLNameResolver {
         return str;
     }
     public static final boolean isExtension(String str, boolean isGLFunc) {
-        return isExtension(extensionsARB, str, isGLFunc) || 
+        return isExtension(extensionsARB, str, isGLFunc) ||
                isExtension(extensionsVEN, str, isGLFunc);
     }
 
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
index 9775de491..f8406075c 100644
--- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
+++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 /*
  * Created on Saturday, April 24 2010 16:44
  */
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
index a3749788b..cb2885e0f 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
@@ -42,13 +42,13 @@ import com.jogamp.opengl.math.geom.AABBox;
 /** A Generic shape objects which is defined by a list of Outlines.
  * This Shape can be transformed to Triangulations.
  * The list of triangles generated are render-able by a Region object.
- * The triangulation produced by this Shape will define the 
+ * The triangulation produced by this Shape will define the
  * closed region defined by the outlines.
- * 
+ *
  * One or more OutlineShape Object can be associated to a region
  * this is left as a high-level representation of the Objects. For
  * optimizations, flexibility requirements for future features.
- * 
+ *
  * <br><br>
  * Example to creating an Outline Shape:
  * <pre>
@@ -60,18 +60,18 @@ import com.jogamp.opengl.math.geom.AABBox;
       addVertex(...)
       addVertex(...)
  * </pre>
- * 
- * The above will create two outlines each with three vertices. By adding these two outlines to 
+ *
+ * The above will create two outlines each with three vertices. By adding these two outlines to
  * the OutlineShape, we are stating that the combination of the two outlines represent the shape.
  * <br>
- * 
- * To specify that the shape is curved at a region, the on-curve flag should be set to false 
+ *
+ * To specify that the shape is curved at a region, the on-curve flag should be set to false
  * for the vertex that is in the middle of the curved region (if the curved region is defined by 3
  * vertices (quadratic curve).
  * <br>
- * In case the curved region is defined by 4 or more vertices the middle vertices should both have 
+ * In case the curved region is defined by 4 or more vertices the middle vertices should both have
  * the on-curve flag set to false.
- * 
+ *
  * <br>Example: <br>
  * <pre>
       addVertex(0,0, true);
@@ -79,16 +79,16 @@ import com.jogamp.opengl.math.geom.AABBox;
       addVertex(1,1, false);
       addVertex(1,0, true);
  * </pre>
- * 
- * The above snippet defines a cubic nurbs curve where (0,1 and 1,1) 
+ *
+ * The above snippet defines a cubic nurbs curve where (0,1 and 1,1)
  * do not belong to the final rendered shape.
- *  
+ *
  * <i>Implementation Notes:</i><br>
  * <ul>
  *    <li> The first vertex of any outline belonging to the shape should be on-curve</li>
  *    <li> Intersections between off-curved parts of the outline is not handled</li>
  * </ul>
- * 
+ *
  * @see Outline
  * @see Region
  */
@@ -104,21 +104,21 @@ public class OutlineShape implements Comparable<OutlineShape> {
         VerticesState(int state){
             this.state = state;
         }
-    } 
+    }
 
     public static final int DIRTY_BOUNDS = 1 << 0;
 
     private final Vertex.Factory<? extends Vertex> vertexFactory;
     private VerticesState outlineState;
 
-    /** The list of {@link Outline}s that are part of this 
+    /** The list of {@link Outline}s that are part of this
      *  outline shape.
      */
     private ArrayList<Outline> outlines;
     private AABBox bbox;
 
     /** dirty bits DIRTY_BOUNDS */
-    private int dirtyBits;  
+    private int dirtyBits;
 
     /** Create a new Outline based Shape
      */
@@ -128,7 +128,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
         this.outlines.add(new Outline());
         this.outlineState = VerticesState.UNDEFINED;
         this.bbox = new AABBox();
-        this.dirtyBits = 0;    
+        this.dirtyBits = 0;
     }
 
     /** Clears all data and reset all states as if this instance was newly created */
@@ -137,7 +137,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
         outlines.add(new Outline());
         outlineState = VerticesState.UNDEFINED;
         bbox.reset();
-        dirtyBits = 0;    
+        dirtyBits = 0;
     }
 
     /** Returns the associated vertex factory of this outline shape
@@ -149,10 +149,10 @@ public class OutlineShape implements Comparable<OutlineShape> {
         return outlines.size();
     }
 
-    /** Add a new empty {@link Outline} 
+    /** Add a new empty {@link Outline}
      * to the end of this shape's outline list.
      * <p>If the {@link #getLastOutline()} is empty already, no new one will be added.</p>
-     * 
+     *
      * After a call to this function all new vertices added
      * will belong to the new outline
      */
@@ -164,26 +164,26 @@ public class OutlineShape implements Comparable<OutlineShape> {
 
     /** Appends the {@link Outline} element to the end,
      * ensuring a clean tail.
-     * 
+     *
      * <p>A clean tail is ensured, no double empty Outlines are produced
      * and a pre-existing empty outline will be replaced with the given one. </p>
-     * 
+     *
      * @param outline Outline object to be added
-     * @throws NullPointerException if the  {@link Outline} element is null 
+     * @throws NullPointerException if the  {@link Outline} element is null
      */
     public void addOutline(Outline outline) throws NullPointerException {
         addOutline(outlines.size(), outline);
     }
 
     /** Insert the {@link Outline} element at the given {@code position}.
-     * 
+     *
      * <p>If the {@code position} indicates the end of this list,
      * a clean tail is ensured, no double empty Outlines are produced
      * and a pre-existing empty outline will be replaced with the given one. </p>
-     * 
+     *
      * @param position of the added Outline
      * @param outline Outline object to be added
-     * @throws NullPointerException if the  {@link Outline} element is null 
+     * @throws NullPointerException if the  {@link Outline} element is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber())
      */
     public void addOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException {
@@ -213,7 +213,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
      * using {@link #addOutline(Outline)} for each element.
      * <p>Closes the current last outline via {@link #closeLastOutline()} before adding the new ones.</p>
      * @param outlineShape OutlineShape elements to be added.
-     * @throws NullPointerException if the  {@link OutlineShape} is null 
+     * @throws NullPointerException if the  {@link OutlineShape} is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber())
      */
     public void addOutlineShape(OutlineShape outlineShape) throws NullPointerException {
@@ -228,10 +228,10 @@ public class OutlineShape implements Comparable<OutlineShape> {
 
     /** Replaces the {@link Outline} element at the given {@code position}.
      * <p>Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.</p>
-     * 
+     *
      * @param position of the replaced Outline
-     * @param outline replacement Outline object 
-     * @throws NullPointerException if the  {@link Outline} element is null 
+     * @param outline replacement Outline object
+     * @throws NullPointerException if the  {@link Outline} element is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
      */
     public void setOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException {
@@ -244,7 +244,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
 
     /** Removes the {@link Outline} element at the given {@code position}.
      * <p>Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.</p>
-     * 
+     *
      * @param position of the to be removed Outline
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
      */
@@ -261,15 +261,15 @@ public class OutlineShape implements Comparable<OutlineShape> {
         return outlines.get(outlines.size()-1);
     }
 
-    /** @return the {@code Outline} at {@code position} 
+    /** @return the {@code Outline} at {@code position}
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
      */
     public Outline getOutline(int position) throws IndexOutOfBoundsException {
         return outlines.get(position);
-    }    
+    }
 
     /** Adds a vertex to the last open outline in the
-     *  shape. 
+     *  shape.
      * @param v the vertex to be added to the OutlineShape
      */
     public final void addVertex(Vertex v) {
@@ -280,9 +280,9 @@ public class OutlineShape implements Comparable<OutlineShape> {
         }
     }
 
-    /** Adds a vertex to the last open outline in the shape. 
-     * at {@code position} 
-     * @param position indx at which the vertex will be added 
+    /** Adds a vertex to the last open outline in the shape.
+     * at {@code position}
+     * @param position indx at which the vertex will be added
      * @param v the vertex to be added to the OutlineShape
      */
     public final void addVertex(int position, Vertex v) {
@@ -295,7 +295,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
 
     /** Add a 2D {@link Vertex} to the last outline by defining the coordniate attribute
      * of the vertex. The 2D vertex will be represented as Z=0.
-     * 
+     *
      * @param x the x coordinate
      * @param y the y coordniate
      * @param onCurve flag if this vertex is on the final curve or defines a curved region
@@ -317,10 +317,10 @@ public class OutlineShape implements Comparable<OutlineShape> {
         addVertex(vertexFactory.create(x, y, z, onCurve));
     }
 
-    /** Add a vertex to the last outline by passing a float array and specifying the 
-     * offset and length in which. The attributes of the vertex are located. 
+    /** Add a vertex to the last outline by passing a float array and specifying the
+     * offset and length in which. The attributes of the vertex are located.
      * The attributes should be continuous (stride = 0).
-     * Attributes which value are not set (when length less than 3) 
+     * Attributes which value are not set (when length less than 3)
      * are set implicitly to zero.
      * @param coordsBuffer the coordinate array where the vertex attributes are to be picked from
      * @param offset the offset in the buffer to the x coordinate
@@ -330,11 +330,11 @@ public class OutlineShape implements Comparable<OutlineShape> {
      */
     public final void addVertex(float[] coordsBuffer, int offset, int length, boolean onCurve) {
         addVertex(vertexFactory.create(coordsBuffer, offset, length, onCurve));
-    }    
+    }
 
     /** Closes the last outline in the shape.
      * <p>If last vertex is not equal to first vertex.
-     * A new temp vertex is added at the end which 
+     * A new temp vertex is added at the end which
      * is equal to the first.</p>
      */
     public void closeLastOutline() {
@@ -351,7 +351,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
     /** Ensure the outlines represent
      * the specified destinationType.
      * and removes all overlaps in boundary triangles
-     * @param destinationType the target outline's vertices state. Currently only 
+     * @param destinationType the target outline's vertices state. Currently only
      * {@link OutlineShape.VerticesState#QUADRATIC_NURBS} are supported.
      */
     public void transformOutlines(VerticesState destinationType) {
@@ -371,7 +371,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
         float[] v2 = VectorUtil.mid(v1, v3);
 
         //drop off-curve vertex to image on the curve
-        b.setCoord(v2, 0, 3); 
+        b.setCoord(v2, 0, 3);
         b.setOnCurve(true);
 
         outline.addVertex(index, vertexFactory.create(v1, 0, 3, false));
@@ -379,19 +379,19 @@ public class OutlineShape implements Comparable<OutlineShape> {
     }
 
     /** Check overlaps between curved triangles
-     *  first check if any vertex in triangle a is in triangle b 
+     *  first check if any vertex in triangle a is in triangle b
      *  second check if edges of triangle a intersect segments of triangle b
      *  if any of the two tests is true we divide current triangle
      *  and add the other to the list of overlaps
-     *  
+     *
      *  Loop until overlap array is empty. (check only in first pass)
      */
-    private void checkOverlaps() { 
+    private void checkOverlaps() {
         ArrayList<Vertex> overlaps = new ArrayList<Vertex>(3);
         int count = getOutlineNumber();
         boolean firstpass = true;
         do {
-            for (int cc = 0; cc < count; cc++) { 
+            for (int cc = 0; cc < count; cc++) {
                 final Outline outline = getOutline(cc);
                 int vertexCount = outline.getVertexCount();
                 for(int i=0; i < outline.getVertexCount(); i++) {
@@ -429,7 +429,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
 
     private Vertex checkTriOverlaps(Vertex a, Vertex b, Vertex c) {
         int count = getOutlineNumber();
-        for (int cc = 0; cc < count; cc++) { 
+        for (int cc = 0; cc < count; cc++) {
             final Outline outline = getOutline(cc);
             int vertexCount = outline.getVertexCount();
             for(int i=0; i < vertexCount; i++) {
@@ -451,7 +451,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
 
                     return current;
                 }
-                if(VectorUtil.tri2SegIntersection(a, b, c, prevV, current) 
+                if(VectorUtil.tri2SegIntersection(a, b, c, prevV, current)
                         || VectorUtil.tri2SegIntersection(a, b, c, current, nextV)
                         || VectorUtil.tri2SegIntersection(a, b, c, prevV, nextV)) {
                     return current;
@@ -463,7 +463,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
 
     private void transformOutlines2Quadratic() {
         int count = getOutlineNumber();
-        for (int cc = 0; cc < count; cc++) {            
+        for (int cc = 0; cc < count; cc++) {
             final Outline outline = getOutline(cc);
             int vertexCount = outline.getVertexCount();
 
@@ -471,13 +471,13 @@ public class OutlineShape implements Comparable<OutlineShape> {
                 final Vertex currentVertex = outline.getVertex(i);
                 final Vertex nextVertex = outline.getVertex((i+1)%vertexCount);
                 if ( !currentVertex.isOnCurve() && !nextVertex.isOnCurve() ) {
-                    final float[] newCoords = VectorUtil.mid(currentVertex.getCoord(), 
+                    final float[] newCoords = VectorUtil.mid(currentVertex.getCoord(),
                             nextVertex.getCoord());
                     final Vertex v = vertexFactory.create(newCoords, 0, 3, true);
                     i++;
                     vertexCount++;
                     outline.addVertex(i, v);
-                }                
+                }
             }
             if(vertexCount <= 0) {
                 outlines.remove(outline);
@@ -487,7 +487,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
             }
 
             if( vertexCount > 0 ) {
-                if(VectorUtil.checkEquality(outline.getVertex(0).getCoord(), 
+                if(VectorUtil.checkEquality(outline.getVertex(0).getCoord(),
                         outline.getLastVertex().getCoord())) {
                     outline.removeVertex(vertexCount-1);
                 }
@@ -508,7 +508,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
         }
     }
 
-    /** @return the list of concatenated vertices associated with all 
+    /** @return the list of concatenated vertices associated with all
      * {@code Outline}s of this object
      */
     public ArrayList<Vertex> getVertices() {
@@ -551,7 +551,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
     }
 
     /** Compare two outline shapes with Bounding Box area
-     * as criteria. 
+     * as criteria.
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
     public final int compareTo(OutlineShape outline) {
@@ -579,12 +579,12 @@ public class OutlineShape implements Comparable<OutlineShape> {
             validateBoundingBox();
         }
         return bbox;
-    }    
+    }
 
     /**
      * @param obj the Object to compare this OutlineShape with
-     * @return true if {@code obj} is an OutlineShape, not null, 
-     *                 same outlineState, equal bounds and equal outlines in the same order 
+     * @return true if {@code obj} is an OutlineShape, not null,
+     *                 same outlineState, equal bounds and equal outlines in the same order
      */
     public boolean equals(Object obj) {
         if( obj == this) {
@@ -592,7 +592,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
         }
         if( null == obj || !(obj instanceof OutlineShape) ) {
             return false;
-        }        
+        }
         final OutlineShape o = (OutlineShape) obj;
         if(getOutlineState() != o.getOutlineState()) {
             return false;
@@ -625,5 +625,5 @@ public class OutlineShape implements Comparable<OutlineShape> {
             o.outlines.add(outlines.get(i).clone());
         }
         return o;
-    }                
+    }
 }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/Region.java b/src/jogl/classes/com/jogamp/graph/curve/Region.java
index 8b6d000fa..a9779523a 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/Region.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/Region.java
@@ -38,48 +38,48 @@ import com.jogamp.opengl.math.geom.AABBox;
 /** Abstract Outline shape GL representation
  *  define the method an OutlineShape(s) is
  *  binded rendered.
- *  
+ *
  *  @see GLRegion
  */
 public abstract class Region {
-    
+
     /** Debug flag for region impl (graph.curve)
      */
     public static final boolean DEBUG = Debug.debug("graph.curve");
-    
+
     public static final boolean DEBUG_INSTANCE = false;
 
-    /** View based Anti-Aliasing, A Two pass region rendering, slower 
-     *  and more resource hungry (FBO), but AA is perfect. 
-     *  Otherwise the default fast one pass MSAA region rendering is being used. 
+    /** View based Anti-Aliasing, A Two pass region rendering, slower
+     *  and more resource hungry (FBO), but AA is perfect.
+     *  Otherwise the default fast one pass MSAA region rendering is being used.
      */
     public static final int VBAA_RENDERING_BIT = 1 << 0;
 
     /** Use non uniform weights [0.0 .. 1.9] for curve region rendering.
-     *  Otherwise the default weight 1.0 for uniform curve region rendering is being applied.  
+     *  Otherwise the default weight 1.0 for uniform curve region rendering is being applied.
      */
     public static final int VARIABLE_CURVE_WEIGHT_BIT = 1 << 1;
 
     public static final int TWO_PASS_DEFAULT_TEXTURE_UNIT = 0;
 
     private final int renderModes;
-    private boolean dirty = true;    
-    protected int numVertices = 0;    
+    private boolean dirty = true;
+    protected int numVertices = 0;
     protected final AABBox box = new AABBox();
     protected ArrayList<Triangle> triangles = new ArrayList<Triangle>();
     protected ArrayList<Vertex> vertices = new ArrayList<Vertex>();
 
-    public static boolean isVBAA(int renderModes) { 
-        return 0 != ( renderModes & Region.VBAA_RENDERING_BIT ); 
+    public static boolean isVBAA(int renderModes) {
+        return 0 != ( renderModes & Region.VBAA_RENDERING_BIT );
     }
 
     /** Check if render mode capable of non uniform weights
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, 
-     * {@link Region#VBAA_RENDERING_BIT} 
+     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
+     * {@link Region#VBAA_RENDERING_BIT}
      * @return true of capable of non uniform weights
      */
-    public static boolean isNonUniformWeight(int renderModes) { 
-        return 0 != ( renderModes & Region.VARIABLE_CURVE_WEIGHT_BIT ); 
+    public static boolean isNonUniformWeight(int renderModes) {
+        return 0 != ( renderModes & Region.VARIABLE_CURVE_WEIGHT_BIT );
     }
 
     protected Region(int regionRenderModes) {
@@ -87,28 +87,28 @@ public abstract class Region {
     }
 
     /** Get current Models
-     * @return bit-field of render modes 
+     * @return bit-field of render modes
      */
-    public final int getRenderModes() { 
-        return renderModes; 
+    public final int getRenderModes() {
+        return renderModes;
     }
 
     /** Check if current Region is using VBAA
      * @return true if capable of two pass rendering - VBAA
      */
-    public boolean isVBAA() { 
-        return Region.isVBAA(renderModes);  
+    public boolean isVBAA() {
+        return Region.isVBAA(renderModes);
     }
 
-    /** Check if current instance uses non uniform weights 
+    /** Check if current instance uses non uniform weights
      * @return true if capable of nonuniform weights
      */
-    public boolean isNonUniformWeight() { 
-        return Region.isNonUniformWeight(renderModes); 
+    public boolean isNonUniformWeight() {
+        return Region.isNonUniformWeight(renderModes);
     }
 
     /** Get the current number of vertices associated
-     * with this region. This number is not necessary equal to 
+     * with this region. This number is not necessary equal to
      * the OGL bound number of vertices.
      * @return vertices count
      */
@@ -117,10 +117,10 @@ public abstract class Region {
     }
 
     /** Adds a {@link Triangle} object to the Region
-     * This triangle will be bound to OGL objects 
+     * This triangle will be bound to OGL objects
      * on the next call to {@code update}
      * @param tri a triangle object
-     * 
+     *
      * @see update(GL2ES2)
      */
     public void addTriangle(Triangle tri) {
@@ -129,10 +129,10 @@ public abstract class Region {
     }
 
     /** Adds a list of {@link Triangle} objects to the Region
-     * These triangles are to be binded to OGL objects 
+     * These triangles are to be binded to OGL objects
      * on the next call to {@code update}
      * @param tris an arraylist of triangle objects
-     * 
+     *
      * @see update(GL2ES2)
      */
     public void addTriangles(ArrayList<Triangle> tris) {
@@ -141,10 +141,10 @@ public abstract class Region {
     }
 
     /** Adds a {@link Vertex} object to the Region
-     * This vertex will be bound to OGL objects 
+     * This vertex will be bound to OGL objects
      * on the next call to {@code update}
      * @param vert a vertex objects
-     * 
+     *
      * @see update(GL2ES2)
      */
     public void addVertex(Vertex vert) {
@@ -154,10 +154,10 @@ public abstract class Region {
     }
 
     /** Adds a list of {@link Vertex} objects to the Region
-     * These vertices are to be binded to OGL objects 
+     * These vertices are to be binded to OGL objects
      * on the next call to {@code update}
      * @param verts an arraylist of vertex objects
-     * 
+     *
      * @see update(GL2ES2)
      */
     public void addVertices(ArrayList<Vertex> verts) {
@@ -175,10 +175,10 @@ public abstract class Region {
     }
 
     /** Check if this region is dirty. A region is marked dirty
-     * when new Vertices, Triangles, and or Lines are added after a 
+     * when new Vertices, Triangles, and or Lines are added after a
      * call to update()
      * @return true if region is Dirty, false otherwise
-     * 
+     *
      * @see update(GL2ES2)
      */
     public final boolean isDirty() {
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
index 63713887b..dfb7a95b3 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
@@ -41,32 +41,32 @@ import jogamp.graph.curve.opengl.RegionFactory;
 
 /** A GLRegion is the OGL binding of one or more OutlineShapes
  *  Defined by its vertices and generated triangles. The Region
- *  defines the final shape of the OutlineShape(s), which shall produced a shaded 
+ *  defines the final shape of the OutlineShape(s), which shall produced a shaded
  *  region on the screen.
- *  
- *  Implementations of the GLRegion shall take care of the OGL 
+ *
+ *  Implementations of the GLRegion shall take care of the OGL
  *  binding of the depending on its context, profile.
- * 
+ *
  * @see Region, RegionFactory, OutlineShape
  */
-public abstract class GLRegion extends Region {    
-    
+public abstract class GLRegion extends Region {
+
     /** Create an ogl {@link GLRegion} defining the list of {@link OutlineShape}.
      * Combining the Shapes into single buffers.
      * @return the resulting Region inclusive the generated region
      */
     public static GLRegion create(OutlineShape[] outlineShapes, int renderModes) {
         final GLRegion region = RegionFactory.create(renderModes);
-        
+
         int numVertices = region.getNumVertices();
-        
+
         for(int index=0; index<outlineShapes.length; index++) {
             OutlineShape outlineShape = outlineShapes[index];
             outlineShape.transformOutlines(OutlineShape.VerticesState.QUADRATIC_NURBS);
-    
+
             ArrayList<Triangle> triangles = outlineShape.triangulate();
             region.addTriangles(triangles);
-            
+
             ArrayList<Vertex> vertices = outlineShape.getVertices();
             for(int pos=0; pos < vertices.size(); pos++){
                 Vertex vert = vertices.get(pos);
@@ -74,42 +74,42 @@ public abstract class GLRegion extends Region {
             }
             region.addVertices(vertices);
         }
-        
+
         return region;
     }
 
-    /** 
+    /**
      * Create an ogl {@link GLRegion} defining this {@link OutlineShape}
      * @return the resulting Region.
      */
     public static GLRegion create(OutlineShape outlineShape, int renderModes) {
         final GLRegion region = RegionFactory.create(renderModes);
-        
+
         outlineShape.transformOutlines(OutlineShape.VerticesState.QUADRATIC_NURBS);
         ArrayList<Triangle> triangles = (ArrayList<Triangle>) outlineShape.triangulate();
         ArrayList<Vertex> vertices = (ArrayList<Vertex>) outlineShape.getVertices();
         region.addVertices(vertices);
         region.addTriangles(triangles);
         return region;
-    }        
-    
+    }
+
     protected GLRegion(int renderModes) {
         super(renderModes);
     }
-    
+
     /** Updates a graph region by updating the ogl related
      *  objects for use in rendering if {@link #isDirty()}.
-     *  <p>Allocates the ogl related data and initializes it the 1st time.<p>  
+     *  <p>Allocates the ogl related data and initializes it the 1st time.<p>
      *  <p>Called by {@link #draw(GL2ES2, RenderState, int, int, int)}.</p>
      * @param rs TODO
      */
     protected abstract void update(GL2ES2 gl, RenderState rs);
-    
+
     /** Delete and clean the associated OGL
      *  objects
      */
     public abstract void destroy(GL2ES2 gl, RenderState rs);
-    
+
     /** Renders the associated OGL objects specifying
      * current width/hight of window for multi pass rendering
      * of the region.
@@ -117,13 +117,13 @@ public abstract class GLRegion extends Region {
      * @param rs the RenderState to be used
      * @param vp_width current screen width
      * @param vp_height current screen height
-     * @param texWidth desired texture width for multipass-rendering. 
+     * @param texWidth desired texture width for multipass-rendering.
      *        The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
      */
     public final void draw(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
         update(gl, rs);
         drawImpl(gl, rs, vp_width, vp_height, texWidth);
     }
-    
+
     protected abstract void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth);
 }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
index 2f078d7bb..f7d4bfd2f 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
@@ -35,26 +35,26 @@ import com.jogamp.graph.curve.Region;
 
 public abstract class RegionRenderer extends Renderer {
 
-    /** 
+    /**
      * Create a Hardware accelerated Region Renderer.
-     * @param rs the used {@link RenderState} 
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT} 
+     * @param rs the used {@link RenderState}
+     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
      * @return an instance of Region Renderer
      */
     public static RegionRenderer create(RenderState rs, int renderModes) {
         return new jogamp.graph.curve.opengl.RegionRendererImpl01(rs, renderModes);
     }
-    
+
     protected RegionRenderer(RenderState rs, int renderModes) {
         super(rs, renderModes);
     }
-    
-    
+
+
     /** Render an {@link OutlineShape} in 3D space at the position provided
      *  the triangles of the shapes will be generated, if not yet generated
      * @param region the OutlineShape to Render.
-     * @param position the initial translation of the outlineShape. 
-     * @param texWidth desired texture width for multipass-rendering. 
+     * @param position the initial translation of the outlineShape.
+     * @param texWidth desired texture width for multipass-rendering.
      *        The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
      * @throws Exception if HwRegionRenderer not initialized
      */
@@ -65,10 +65,10 @@ public abstract class RegionRenderer extends Renderer {
         if( !areRenderModesCompatible(region) ) {
             throw new GLException("Incompatible render modes, : region modes "+region.getRenderModes()+
                                   " doesn't contain renderer modes "+this.getRenderModes());
-        }        
+        }
         drawImpl(gl, region, position, texWidth);
     }
-    
+
     /**
      * Usually just dispatched the draw call to the Region's draw implementation,
      * e.g. {@link com.jogamp.graph.curve.opengl.GLRegion#draw(GL2ES2, RenderState, int, int, int[]) GLRegion#draw(GL2ES2, RenderState, int, int, int[])}.
@@ -79,6 +79,6 @@ public abstract class RegionRenderer extends Renderer {
     protected void destroyImpl(GL2ES2 gl) {
         // nop
     }
-    
-    
+
+
 }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
index 5e305d664..9c833fd24 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
@@ -40,7 +40,7 @@ import com.jogamp.opengl.util.glsl.ShaderState;
 
 public abstract class RenderState {
     private static final String thisKey = "jogamp.graph.curve.RenderState" ;
-    
+
     public static RenderState createRenderState(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory) {
         return new RenderStateImpl(st, pointFactory);
     }
@@ -48,42 +48,42 @@ public abstract class RenderState {
     public static RenderState createRenderState(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix) {
         return new RenderStateImpl(st, pointFactory, pmvMatrix);
     }
-    
+
     public static final RenderState getRenderState(GL2ES2 gl) {
         return (RenderState) gl.getContext().getAttachedObject(thisKey);
     }
-    
+
     protected final ShaderState st;
     protected final Vertex.Factory<? extends Vertex> vertexFactory;
     protected final PMVMatrix pmvMatrix;
-    protected final GLUniformData gcu_PMVMatrix;                    
-        
+    protected final GLUniformData gcu_PMVMatrix;
+
     protected RenderState(ShaderState st, Vertex.Factory<? extends Vertex> vertexFactory, PMVMatrix pmvMatrix) {
         this.st = st;
         this.vertexFactory = vertexFactory;
-        this.pmvMatrix = pmvMatrix;        
+        this.pmvMatrix = pmvMatrix;
         this.gcu_PMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, pmvMatrix.glGetPMvMatrixf());
-        st.ownUniform(gcu_PMVMatrix);        
+        st.ownUniform(gcu_PMVMatrix);
     }
-        
+
     public final ShaderState getShaderState() { return st; }
     public final Vertex.Factory<? extends Vertex> getVertexFactory() { return vertexFactory; }
     public final PMVMatrix pmvMatrix() { return pmvMatrix; }
     public final GLUniformData getPMVMatrix() { return gcu_PMVMatrix; }
-    
+
     public void destroy(GL2ES2 gl) {
         st.destroy(gl);
     }
-    
+
     public abstract GLUniformData getWeight();
     public abstract GLUniformData getAlpha();
     public abstract GLUniformData getColorStatic();
     // public abstract GLUniformData getStrength();
-    
+
     public final RenderState attachTo(GL2ES2 gl) {
         return (RenderState) gl.getContext().attachObject(thisKey, this);
     }
-    
+
     public final boolean detachFrom(GL2ES2 gl) {
         RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey);
         if(_rs == this) {
@@ -91,8 +91,8 @@ public abstract class RenderState {
             return true;
         }
         return false;
-    }    
-    
+    }
+
     public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) {
         if(null==sb) {
             sb = new StringBuilder();
@@ -104,8 +104,8 @@ public abstract class RenderState {
 
         return sb;
     }
-    
+
     public String toString() {
         return toString(null, false).toString();
-    }    
+    }
 }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
index 998129551..c642fb652 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
@@ -52,8 +52,8 @@ public abstract class Renderer {
     protected int vp_height;
     protected boolean initialized;
     protected final RenderState rs;
-    private boolean vboSupported = false; 
-    
+    private boolean vboSupported = false;
+
     public final boolean isInitialized() { return initialized; }
 
     public final int getWidth() { return vp_width; }
@@ -62,29 +62,29 @@ public abstract class Renderer {
     public float getWeight() { return rs.getWeight().floatValue(); }
     public float getAlpha() { return rs.getAlpha().floatValue(); }
     public final PMVMatrix getMatrix() { return rs.pmvMatrix(); }
-    
+
     /**
      * Implementation shall load, compile and link the shader program and leave it active.
      * @param gl referencing the current GLContext to which the ShaderState is bound to
      * @return
      */
     protected abstract boolean initShaderProgram(GL2ES2 gl);
-    
+
     protected abstract void destroyImpl(GL2ES2 gl);
-   
+
     /**
-     * @param rs the used {@link RenderState} 
+     * @param rs the used {@link RenderState}
      * @param renderModes bit-field of modes
      */
     protected Renderer(RenderState rs, int renderModes) {
         this.rs = rs;
         this.renderModes = renderModes;
     }
-    
+
     public final int getRenderModes() {
         return renderModes;
     }
-    
+
     public boolean usesVariableCurveWeight() { return Region.isNonUniformWeight(renderModes); }
 
     /**
@@ -93,17 +93,17 @@ public abstract class Renderer {
      */
     public final boolean areRenderModesCompatible(Region region) {
         final int cleanRenderModes = getRenderModes() & ( Region.VARIABLE_CURVE_WEIGHT_BIT );
-        return cleanRenderModes == ( region.getRenderModes() & cleanRenderModes ); 
+        return cleanRenderModes == ( region.getRenderModes() & cleanRenderModes );
     }
-    
+
     public final boolean isVBOSupported() { return vboSupported; }
-    
-    /** 
+
+    /**
      * Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext
      * if not initialized yet.
      * <p>Leaves the renderer enabled, ie ShaderState.</p>
      * <p>Shall be called by a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region, float[], int)}</p>
-     *  
+     *
      * @param gl referencing the current GLContext to which the ShaderState is bound to
      * @throws GLException if initialization failed
      */
@@ -117,48 +117,48 @@ public abstract class Renderer {
                         gl.isFunctionAvailable("glDrawElements") &&
                         gl.isFunctionAvailable("glVertexAttribPointer") &&
                         gl.isFunctionAvailable("glDeleteBuffers");
-    
+
         if(DEBUG) {
             System.err.println("TextRendererImpl01: VBO Supported = " + isVBOSupported());
         }
-        
+
         if(!vboSupported){
             throw new GLException("VBO not supported");
         }
-        
+
         rs.attachTo(gl);
-        
+
         gl.glEnable(GL2ES2.GL_BLEND);
         gl.glBlendFunc(GL2ES2.GL_SRC_ALPHA, GL2ES2.GL_ONE_MINUS_SRC_ALPHA); // FIXME: alpha blending stage ?
-        
+
         initialized = initShaderProgram(gl);
         if(!initialized) {
             throw new GLException("Shader initialization failed");
         }
-        
+
         if(!rs.getShaderState().uniform(gl, rs.getPMVMatrix())) {
             throw new GLException("Error setting PMVMatrix in shader: "+rs.getShaderState());
         }
-        
+
         if( Region.isNonUniformWeight( getRenderModes() ) ) {
             if(!rs.getShaderState().uniform(gl, rs.getWeight())) {
                 throw new GLException("Error setting weight in shader: "+rs.getShaderState());
             }
         }
-                
+
         if(!rs.getShaderState().uniform(gl, rs.getAlpha())) {
             throw new GLException("Error setting global alpha in shader: "+rs.getShaderState());
-        }        
-        
+        }
+
         if(!rs.getShaderState().uniform(gl, rs.getColorStatic())) {
             throw new GLException("Error setting global color in shader: "+rs.getShaderState());
-        }        
+        }
     }
 
-    public final void flushCache(GL2ES2 gl) {  
+    public final void flushCache(GL2ES2 gl) {
         // FIXME: REMOVE !
     }
-        
+
     public void destroy(GL2ES2 gl) {
         if(!initialized){
             if(DEBUG_INSTANCE) {
@@ -169,13 +169,13 @@ public abstract class Renderer {
         rs.getShaderState().useProgram(gl, false);
         destroyImpl(gl);
         rs.destroy(gl);
-        initialized = false;        
+        initialized = false;
     }
-    
+
     public final RenderState getRenderState() { return rs; }
     public final ShaderState getShaderState() { return rs.getShaderState(); }
-    
-    public final void enable(GL2ES2 gl, boolean enable) { 
+
+    public final void enable(GL2ES2 gl, boolean enable) {
         rs.getShaderState().useProgram(gl, enable);
     }
 
@@ -188,7 +188,7 @@ public abstract class Renderer {
             rs.getShaderState().uniform(gl, rs.getWeight());
         }
     }
-    
+
     public void setAlpha(GL2ES2 gl, float alpha_t) {
         rs.getAlpha().setData(alpha_t);
         if(null != gl && rs.getShaderState().inUse()) {
@@ -199,11 +199,11 @@ public abstract class Renderer {
 
     public void getColorStatic(GL2ES2 gl, float[] rgb) {
         FloatBuffer fb = (FloatBuffer) rs.getColorStatic().getBuffer();
-        rgb[0] = fb.get(0); 
-        rgb[1] = fb.get(1); 
-        rgb[2] = fb.get(2); 
+        rgb[0] = fb.get(0);
+        rgb[1] = fb.get(1);
+        rgb[2] = fb.get(2);
     }
-    
+
     public void setColorStatic(GL2ES2 gl, float r, float g, float b){
         FloatBuffer fb = (FloatBuffer) rs.getColorStatic().getBuffer();
         fb.put(0, r);
@@ -213,7 +213,7 @@ public abstract class Renderer {
             rs.getShaderState().uniform(gl, rs.getColorStatic());
         }
     }
-    
+
     public void rotate(GL2ES2 gl, float angle, float x, float y, float z) {
         rs.pmvMatrix().glRotatef(angle, x, y, z);
         updateMatrix(gl);
@@ -223,7 +223,7 @@ public abstract class Renderer {
         rs.pmvMatrix().glTranslatef(x, y, z);
         updateMatrix(gl);
     }
-    
+
     public void scale(GL2ES2 gl, float x, float y, float z) {
         rs.pmvMatrix().glScalef(x, y, z);
         updateMatrix(gl);
@@ -261,15 +261,15 @@ public abstract class Renderer {
         p.glLoadIdentity();
         p.glOrthof(0, width, 0, height, near, far);
         updateMatrix(gl);
-        return true;        
+        return true;
     }
 
     protected String getVertexShaderName() {
         return "curverenderer" + getImplVersion();
     }
-    
+
     protected String getFragmentShaderName() {
-        final String version = getImplVersion(); 
+        final String version = getImplVersion();
         final String pass = Region.isVBAA(renderModes) ? "-2pass" : "-1pass" ;
         final String weight = Region.isNonUniformWeight(renderModes) ? "-weight" : "" ;
         return "curverenderer" + version + pass + weight;
@@ -277,7 +277,7 @@ public abstract class Renderer {
 
     // FIXME: Really required to have sampler2D def. precision ? If not, we can drop getFragmentShaderPrecision(..) and use default ShaderCode ..
     public static final String es2_precision_fp = "\nprecision mediump float;\nprecision mediump int;\nprecision mediump sampler2D;\n";
-    
+
     protected String getFragmentShaderPrecision(GL2ES2 gl) {
         if( gl.isGLES2() ) {
             return es2_precision_fp;
@@ -287,7 +287,7 @@ public abstract class Renderer {
         }
         return null;
     }
-    
+
     protected String getImplVersion() {
         return "01";
     }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java
index 8dc41b0c0..f6ce852d8 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java
@@ -38,28 +38,28 @@ import jogamp.graph.curve.text.GlyphString;
 import com.jogamp.graph.font.Font;
 
 public abstract class TextRenderer extends Renderer {
-    /** 
+    /**
      * Create a Hardware accelerated Text Renderer.
-     * @param rs the used {@link RenderState} 
+     * @param rs the used {@link RenderState}
      * @param renderModes either {@link com.jogamp.graph.curve.opengl.GLRegion#SINGLE_PASS} or {@link com.jogamp.graph.curve.Region#VBAA_RENDERING_BIT}
      */
     public static TextRenderer create(RenderState rs, int renderModes) {
         return new jogamp.graph.curve.opengl.TextRendererImpl01(rs, renderModes);
     }
-    
+
     protected TextRenderer(RenderState rs, int type) {
         super(rs, type);
     }
-    
+
 
     /** Render the String in 3D space wrt to the font provided at the position provided
      * the outlines will be generated, if not yet generated
      * @param gl the current GL state
      * @param font {@link Font} to be used
-     * @param str text to be rendered 
-     * @param position the lower left corner of the string 
+     * @param str text to be rendered
+     * @param position the lower left corner of the string
      * @param fontSize font size
-     * @param texWidth desired texture width for multipass-rendering. 
+     * @param texWidth desired texture width for multipass-rendering.
      *        The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
      * @throws Exception if TextRenderer not initialized
      */
@@ -77,11 +77,11 @@ public abstract class TextRenderer extends Renderer {
         if(DEBUG_INSTANCE) {
             System.err.println("createString: "+getCacheSize()+"/"+getCacheLimit()+" - "+Font.NAME_UNIQUNAME + " - " + str + " - " + size);
         }
-        final GlyphString glyphString = GlyphString.createString(null, rs.getVertexFactory(), font, size, str);        
-        glyphString.createRegion(gl, renderModes);        
+        final GlyphString glyphString = GlyphString.createString(null, rs.getVertexFactory(), font, size, str);
+        glyphString.createRegion(gl, renderModes);
         return glyphString;
     }
-    
+
     /** FIXME
    public void flushCache(GL2ES2 gl) {
        Iterator<GlyphString> iterator = stringCacheMap.values().iterator();
@@ -89,10 +89,10 @@ public abstract class TextRenderer extends Renderer {
            GlyphString glyphString = iterator.next();
            glyphString.destroy(gl, rs);
        }
-       stringCacheMap.clear();    
+       stringCacheMap.clear();
        stringCacheArray.clear();
    } */
-   
+
    @Override
    protected void destroyImpl(GL2ES2 gl) {
        // fluchCache(gl) already called
@@ -101,42 +101,42 @@ public abstract class TextRenderer extends Renderer {
            GlyphString glyphString = iterator.next();
            glyphString.destroy(gl, rs);
        }
-       stringCacheMap.clear();    
+       stringCacheMap.clear();
        stringCacheArray.clear();
    }
-   
+
    /**
     * <p>Sets the cache limit for reusing GlyphString's and their Region.
     * Default is {@link #DEFAULT_CACHE_LIMIT}, -1 unlimited, 0 turns cache off, >0 limited </p>
-    * 
+    *
     * <p>The cache will be validate when the next string rendering happens.</p>
-    *  
+    *
     * @param newLimit new cache size
-    * 
+    *
     * @see #DEFAULT_CACHE_LIMIT
     */
    public final void setCacheLimit(int newLimit ) { stringCacheLimit = newLimit; }
-   
+
    /**
     * Sets the cache limit, see {@link #setCacheLimit(int)} and validates the cache.
-    * 
+    *
     * @see #setCacheLimit(int)
-    * 
+    *
     * @param gl current GL used to remove cached objects if required
     * @param newLimit new cache size
     */
    public final void setCacheLimit(GL2ES2 gl, int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); }
-   
+
    /**
     * @return the current cache limit
     */
    public final int getCacheLimit() { return stringCacheLimit; }
-   
-   /** 
+
+   /**
     * @return the current utilized cache size, <= {@link #getCacheLimit()}
     */
    public final int getCacheSize() { return stringCacheArray.size(); }
-   
+
    protected final void validateCache(GL2ES2 gl, int space) {
        if ( getCacheLimit() > 0 ) {
            while ( getCacheSize() + space > getCacheLimit() ) {
@@ -144,7 +144,7 @@ public abstract class TextRenderer extends Renderer {
            }
        }
    }
-   
+
    protected final GlyphString getCachedGlyphString(Font font, String str, int fontSize) {
        return stringCacheMap.get(getKey(font, str, fontSize));
    }
@@ -160,13 +160,13 @@ public abstract class TextRenderer extends Renderer {
            } /// else overwrite is nop ..
        }
    }
-   
+
    protected final void removeCachedGlyphString(GL2ES2 gl, Font font, String str, int fontSize) {
        final String key = getKey(font, str, fontSize);
        GlyphString glyphString = stringCacheMap.remove(key);
        if(null != glyphString) {
            glyphString.destroy(gl, rs);
-       }       
+       }
        stringCacheArray.remove(key);
    }
 
@@ -177,7 +177,7 @@ public abstract class TextRenderer extends Renderer {
            glyphString.destroy(gl, rs);
        }
    }
-      
+
    protected final String getKey(Font font, String str, int fontSize) {
        final StringBuilder sb = new StringBuilder();
        return font.getName(sb, Font.NAME_UNIQUNAME)
@@ -186,8 +186,8 @@ public abstract class TextRenderer extends Renderer {
 
    /** Default cache limit, see {@link #setCacheLimit(int)} */
    public static final int DEFAULT_CACHE_LIMIT = 256;
-   
+
    private HashMap<String, GlyphString> stringCacheMap = new HashMap<String, GlyphString>(DEFAULT_CACHE_LIMIT);
    private ArrayList<String> stringCacheArray = new ArrayList<String>(DEFAULT_CACHE_LIMIT);
-   private int stringCacheLimit = DEFAULT_CACHE_LIMIT;      
+   private int stringCacheLimit = DEFAULT_CACHE_LIMIT;
 }
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulation.java b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulation.java
index 7728efcaf..ae2849536 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulation.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulation.java
@@ -33,7 +33,7 @@ import jogamp.graph.curve.tess.CDTriangulator2D;
 
 public class Triangulation {
     /** Create a new instance of a triangulation.
-     *  Currently only a modified version of Constraint Delaunay 
+     *  Currently only a modified version of Constraint Delaunay
      *  is implemented.
      * @return instance of a triangulator
      * @see Triangulator
diff --git a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java
index 1ffaccebc..4e8c400e0 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java
@@ -36,32 +36,32 @@ import com.jogamp.graph.geom.Triangle;
 /** Interface to the triangulation algorithms provided
  *  A triangulation of 2D outlines where you can
  *  provides an easy one or more outlines to be triangulated
- *  
+ *
  *  example usage:
  *      addCurve(o1);
  *      addCurve(o2);
  *      addCurve(o3);
  *      generate();
  *      reset();
- *      
+ *
  * @see Outline
  * @see Triangulation
  */
 public interface Triangulator {
-    
+
     /** Add a curve to the list of Outlines
      * describing the shape
      * @param outline a bounding {@link Outline}
      */
     public void addCurve(Outline outline);
-    
-    /** Generate the triangulation of the provided 
+
+    /** Generate the triangulation of the provided
      *  List of {@link Outline}s
      * @return an arraylist of {@link Triangle}s resembling the
      * final shape.
      */
     public ArrayList<Triangle> generate();
-    
+
     /** Reset the triangulation to initial state
      *  Clearing cached data
      */
diff --git a/src/jogl/classes/com/jogamp/graph/font/Font.java b/src/jogl/classes/com/jogamp/graph/font/Font.java
index 64a3a3e6c..82211da92 100644
--- a/src/jogl/classes/com/jogamp/graph/font/Font.java
+++ b/src/jogl/classes/com/jogamp/graph/font/Font.java
@@ -31,10 +31,10 @@ import com.jogamp.opengl.math.geom.AABBox;
 
 /**
  * Interface wrapper for font implementation.
- * 
+ *
  * TrueType Font Specification:
  *   http://developer.apple.com/fonts/ttrefman/rm06/Chap6.html
- *   
+ *
  * TrueType Font Table Introduction:
  *   http://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08
  */
@@ -50,22 +50,22 @@ public interface Font {
     public static final int NAME_VERSION = 5;
     public static final int NAME_MANUFACTURER = 8;
     public static final int NAME_DESIGNER = 9;
-    
-    
+
+
     /**
      * Metrics for font
-     * 
+     *
      * Depending on the font's direction, horizontal or vertical,
      * the following tables shall be used:
-     * 
+     *
      * Vertical http://developer.apple.com/fonts/TTRefMan/RM06/Chap6vhea.html
      * Horizontal http://developer.apple.com/fonts/TTRefMan/RM06/Chap6hhea.html
      */
-    public interface Metrics {  
+    public interface Metrics {
         float getAscent(float pixelSize);
         float getDescent(float pixelSize);
         float getLineGap(float pixelSize);
-        float getMaxExtend(float pixelSize);        
+        float getMaxExtend(float pixelSize);
         float getScale(float pixelSize);
         AABBox getBBox(float pixelSize);
     }
@@ -74,12 +74,12 @@ public interface Font {
      * Glyph for font
      */
     public interface Glyph {
-        // reserved special glyph IDs 
+        // reserved special glyph IDs
         // http://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08#ba57949e
         public static final int ID_UNKNOWN = 0;
         public static final int ID_CR = 2;
         public static final int ID_SPACE = 3;
-                
+
         public Font getFont();
         public char getSymbol();
         public AABBox getBBox(float pixelSize);
@@ -89,25 +89,25 @@ public interface Font {
 
     public String getName(int nameIndex);
     public StringBuilder getName(StringBuilder string, int nameIndex);
-    
+
     /** Shall return the family and subfamily name, separated a dash.
      * <p>{@link #getName(StringBuilder, int)} w/ {@link #NAME_FAMILY} and {@link #NAME_SUBFAMILY}</p>
      * <p>Example: "{@code Ubuntu-Regular}"</p>  */
     public StringBuilder getFullFamilyName(StringBuilder buffer);
-    
+
     public StringBuilder getAllNames(StringBuilder string, String separator);
-    
+
     public float getAdvanceWidth(int i, float pixelSize);
     public Metrics getMetrics();
     public Glyph getGlyph(char symbol);
     public int getNumGlyphs();
-    
+
     public float getStringWidth(CharSequence string, float pixelSize);
     public float getStringHeight(CharSequence string, float pixelSize);
     public AABBox getStringBounds(CharSequence string, float pixelSize);
-    
-    public boolean isPrintableChar( char c );  
-    
+
+    public boolean isPrintableChar( char c );
+
     /** Shall return {@link #getFullFamilyName()} */
     public String toString();
 }
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
index d2824b9dc..884662e6e 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
@@ -49,13 +49,13 @@ import jogamp.graph.font.UbuntuFontLoader;
 public class FontFactory {
     private static final String FontConstructorPropKey = "jogamp.graph.font.ctor";
     private static final String DefaultFontConstructor = "jogamp.graph.font.typecast.TypecastFontConstructor";
-    
+
     /** Ubuntu is the default font family */
     public static final int UBUNTU = 0;
-    
+
     /** Java fonts are optional */
     public static final int JAVA = 1;
-    
+
     private static final FontConstructor fontConstr;
 
     static {
@@ -63,18 +63,18 @@ public class FontFactory {
          * For example:
          *   "jogamp.graph.font.typecast.TypecastFontFactory" (default)
          *   "jogamp.graph.font.ttf.TTFFontImpl"
-         */        
+         */
         String fontImplName = PropertyAccess.getProperty(FontConstructorPropKey, true);
         if(null == fontImplName) {
             fontImplName = DefaultFontConstructor;
         }
         fontConstr = (FontConstructor) ReflectionUtil.createInstance(fontImplName, FontFactory.class.getClassLoader());
     }
-    
+
     public static final FontSet getDefault() {
         return get(UBUNTU);
     }
-    
+
     public static final FontSet get(int font) {
         switch (font) {
             case JAVA:
@@ -83,15 +83,15 @@ public class FontFactory {
                 return UbuntuFontLoader.get();
         }
     }
-    
+
     public static final Font get(File file) throws IOException {
         return fontConstr.create(file);
     }
 
     public static final Font get(final URLConnection conn) throws IOException {
         return fontConstr.create(conn);
-    }    
-    
+    }
+
     public static boolean isPrintableChar( char c ) {
         if( Character.isWhitespace(c) ) {
             return true;
@@ -101,5 +101,5 @@ public class FontFactory {
         }
         final Character.UnicodeBlock block = Character.UnicodeBlock.of( c );
         return block != null && block != Character.UnicodeBlock.SPECIALS;
-    }    
+    }
 }
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontSet.java b/src/jogl/classes/com/jogamp/graph/font/FontSet.java
index d376922ab..17b8b2136 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontSet.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontSet.java
@@ -34,29 +34,29 @@ public interface FontSet {
 
     /** Font family REGULAR **/
     public static final int FAMILY_REGULAR    = 0;
-    
+
     /** Font family LIGHT **/
     public static final int FAMILY_LIGHT      = 1;
-    
+
     /** Font family MEDIUM **/
     public static final int FAMILY_MEDIUM     = 2;
-    
+
     /** Font family CONDENSED **/
     public static final int FAMILY_CONDENSED  = 3;
-    
+
     /** Font family MONO **/
     public static final int FAMILY_MONOSPACED = 4;
-    
+
     /** SERIF style/family bit flag. Fallback to Sans Serif. */
     public static final int STYLE_SERIF       = 1 << 1;
-    
+
     /** BOLD style bit flag */
     public static final int STYLE_BOLD        = 1 << 2;
-    
+
     /** ITALIC style bit flag */
     public static final int STYLE_ITALIC      = 1 << 3;
 
     Font getDefault() throws IOException ;
-    
+
     Font get(int family, int stylebits) throws IOException ;
 }
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
index 12c45860b..dfa6a8635 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
@@ -36,12 +36,12 @@ import com.jogamp.opengl.math.geom.AABBox;
 
 
 /** Define a single continuous stroke by control vertices.
- *  The vertices define the shape of the region defined by this 
+ *  The vertices define the shape of the region defined by this
  *  outline. The Outline can contain a list of off-curve and on-curve
  *  vertices which define curved regions.
- *  
+ *
  *  Note: An outline should be closed to be rendered as a region.
- *  
+ *
  *  @see OutlineShape, Region
  */
 public class Outline implements Cloneable, Comparable<Outline> {
@@ -55,7 +55,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
      * An outline can contain off Curve vertices which define curved
      * regions in the outline.
      */
-    public Outline() {        
+    public Outline() {
     }
 
     public final int getVertexCount() {
@@ -64,7 +64,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
 
     /** Appends a vertex to the outline loop/strip.
      * @param vertex Vertex to be added
-     * @throws NullPointerException if the  {@link Vertex} element is null 
+     * @throws NullPointerException if the  {@link Vertex} element is null
      */
     public final void addVertex(Vertex vertex) throws NullPointerException {
         addVertex(vertices.size(), vertex);
@@ -73,7 +73,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
     /** Insert the {@link Vertex} element at the given {@code position} to the outline loop/strip.
      * @param position of the added Vertex
      * @param vertex Vertex object to be added
-     * @throws NullPointerException if the  {@link Vertex} element is null 
+     * @throws NullPointerException if the  {@link Vertex} element is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getVertexNumber())
      */
     public final void addVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
@@ -88,10 +88,10 @@ public class Outline implements Cloneable, Comparable<Outline> {
 
     /** Replaces the {@link Vertex} element at the given {@code position}.
      * <p>Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.</p>
-     * 
+     *
      * @param position of the replaced Vertex
-     * @param vertex replacement Vertex object 
-     * @throws NullPointerException if the  {@link Outline} element is null 
+     * @param vertex replacement Vertex object
+     * @throws NullPointerException if the  {@link Outline} element is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
      */
     public final void setVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
@@ -112,12 +112,12 @@ public class Outline implements Cloneable, Comparable<Outline> {
 
     /** Removes the {@link Vertex} element at the given {@code position}.
      * <p>Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.</p>
-     * 
+     *
      * @param position of the to be removed Vertex
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
      */
     public final Vertex removeVertex(int position) throws IndexOutOfBoundsException {
-        dirtyBBox = true;        
+        dirtyBBox = true;
         return vertices.remove(position);
     }
 
@@ -139,7 +139,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
     /**
      * Use the given outline loop/strip.
      * <p>Validates the bounding box.</p>
-     * 
+     *
      * @param vertices the new outline loop/strip
      */
     public final void setVertices(ArrayList<Vertex> vertices) {
@@ -152,7 +152,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
     }
 
     /** define if this outline is closed or not.
-     * if set to closed, checks if the last vertex is 
+     * if set to closed, checks if the last vertex is
      * equal to the first vertex. If not Equal adds a
      * vertex at the end to the list.
      * @param closed
@@ -170,7 +170,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
     }
 
     /** Compare two outlines with Bounding Box area
-     * as criteria. 
+     * as criteria.
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
     public final int compareTo(Outline outline) {
@@ -198,11 +198,11 @@ public class Outline implements Cloneable, Comparable<Outline> {
             validateBoundingBox();
         }
         return bbox;
-    }    
+    }
 
     /**
      * @param obj the Object to compare this Outline with
-     * @return true if {@code obj} is an Outline, not null, equals bounds and equal vertices in the same order 
+     * @return true if {@code obj} is an Outline, not null, equals bounds and equal vertices in the same order
      */
     public boolean equals(Object obj) {
         if( obj == this) {
@@ -210,7 +210,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
         }
         if( null == obj || !(obj instanceof Outline) ) {
             return false;
-        }        
+        }
         final Outline o = (Outline) obj;
         if(getVertexCount() != o.getVertexCount()) {
             return false;
@@ -240,5 +240,5 @@ public class Outline implements Cloneable, Comparable<Outline> {
             o.vertices.add(vertices.get(i).clone());
         }
         return o;
-    }       
+    }
 }
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
index fb34de221..bd0900495 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
@@ -48,11 +48,11 @@ public class Triangle {
     public Vertex[] getVertices() {
         return vertices;
     }
-    
+
     public boolean isEdgesBoundary() {
         return boundaryEdges[0] || boundaryEdges[1] || boundaryEdges[2];
     }
-    
+
     public boolean isVerticesBoundary() {
         return boundaryVertices[0] || boundaryVertices[1] || boundaryVertices[2];
     }
@@ -60,11 +60,11 @@ public class Triangle {
     public void setEdgesBoundary(boolean[] boundary) {
         this.boundaryEdges = boundary;
     }
-    
+
     public boolean[] getEdgeBoundary() {
         return boundaryEdges;
     }
-    
+
     public boolean[] getVerticesBoundary() {
         return boundaryVertices;
     }
@@ -72,7 +72,7 @@ public class Triangle {
     public void setVerticesBoundary(boolean[] boundaryVertices) {
         this.boundaryVertices = boundaryVertices;
     }
-    
+
     public String toString() {
         return "Tri ID: " + id + "\n" +  vertices[0]  + "\n" +  vertices[1] + "\n" +  vertices[2];
     }
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
index e3df86de1..40048235e 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
@@ -30,7 +30,7 @@ package com.jogamp.graph.geom;
 import com.jogamp.opengl.math.Vert3fImmutable;
 
 /**
- * A Vertex with custom memory layout using custom factory. 
+ * A Vertex with custom memory layout using custom factory.
  */
 public interface Vertex extends Vert3fImmutable, Cloneable {
 
@@ -39,16 +39,16 @@ public interface Vertex extends Vert3fImmutable, Cloneable {
 
         T create(float x, float y, float z, boolean onCurve);
 
-        T create(float[] coordsBuffer, int offset, int length, boolean onCurve);    
+        T create(float[] coordsBuffer, int offset, int length, boolean onCurve);
     }
-    
+
     void setCoord(float x, float y, float z);
 
     /**
      * @see System#arraycopy(Object, int, Object, int, int) for thrown IndexOutOfBoundsException
      */
     void setCoord(float[] coordsBuffer, int offset, int length);
-    
+
     void setX(float x);
 
     void setY(float y);
@@ -60,24 +60,24 @@ public interface Vertex extends Vert3fImmutable, Cloneable {
     void setOnCurve(boolean onCurve);
 
     int getId();
-    
+
     void setId(int id);
-    
+
     float[] getTexCoord();
-    
+
     void setTexCoord(float s, float t);
-    
+
     /**
      * @see System#arraycopy(Object, int, Object, int, int) for thrown IndexOutOfBoundsException
      */
     void setTexCoord(float[] texCoordsBuffer, int offset, int length);
-    
+
     /**
      * @param obj the Object to compare this Vertex with
-     * @return true if {@code obj} is a Vertex and not null, on-curve flag is equal and has same vertex- and tex-coords. 
+     * @return true if {@code obj} is a Vertex and not null, on-curve flag is equal and has same vertex- and tex-coords.
      */
     boolean equals(Object obj);
-    
+
     /**
      * @return deep clone of this Vertex
      */
diff --git a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java b/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
index 97e438b63..6b07688a7 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
@@ -39,11 +39,11 @@ public class SVertex implements Vertex {
     protected float[] coord = new float[3];
     protected boolean onCurve;
     private float[] texCoord = new float[2];
-    
+
     static final Factory factory = new Factory();
-    
-    public static Factory factory() { return factory; } 
-    
+
+    public static Factory factory() { return factory; }
+
     public static class Factory implements Vertex.Factory<SVertex> {
         public SVertex create() {
             return new SVertex();
@@ -55,9 +55,9 @@ public class SVertex implements Vertex {
 
         public SVertex create(float[] coordsBuffer, int offset, int length, boolean onCurve) {
             return new SVertex(coordsBuffer, offset, length, onCurve);
-        }        
+        }
     }
-    
+
     public SVertex() {
     }
 
@@ -65,19 +65,19 @@ public class SVertex implements Vertex {
         setCoord(x, y, z);
         setOnCurve(onCurve);
     }
-    
+
     public SVertex(float[] coordsBuffer, int offset, int length, boolean onCurve) {
         setCoord(coordsBuffer, offset, length);
         setOnCurve(onCurve);
     }
-        
-    public SVertex(float[] coordsBuffer, int offset, int length, 
+
+    public SVertex(float[] coordsBuffer, int offset, int length,
                    float[] texCoordsBuffer, int offsetTC, int lengthTC, boolean onCurve) {
         setCoord(coordsBuffer, offset, length);
         setTexCoord(texCoordsBuffer, offsetTC, lengthTC);
         setOnCurve(onCurve);
     }
-    
+
     public final void setCoord(float x, float y, float z) {
         this.coord[0] = x;
         this.coord[1] = y;
@@ -87,12 +87,12 @@ public class SVertex implements Vertex {
     public final void setCoord(float[] coordsBuffer, int offset, int length) {
         System.arraycopy(coordsBuffer, offset, coord, 0, length);
     }
-        
+
     @Override
     public int getCoordCount() {
         return 3;
     }
-    
+
     @Override
     public final float[] getCoord() {
         return coord;
@@ -133,11 +133,11 @@ public class SVertex implements Vertex {
     public final int getId(){
         return id;
     }
-    
+
     public final void setId(int id){
         this.id = id;
     }
-    
+
     public boolean equals(Object obj) {
         if( obj == this) {
             return true;
@@ -146,12 +146,12 @@ public class SVertex implements Vertex {
             return false;
         }
         final Vertex v = (Vertex) obj;
-        return this == v || 
-               isOnCurve() == v.isOnCurve() && 
+        return this == v ||
+               isOnCurve() == v.isOnCurve() &&
                VectorUtil.checkEqualityVec2(getTexCoord(), v.getTexCoord()) &&
                VectorUtil.checkEquality(getCoord(), v.getCoord()) ;
     }
-    
+
     public final float[] getTexCoord() {
         return texCoord;
     }
@@ -164,16 +164,16 @@ public class SVertex implements Vertex {
     public final void setTexCoord(float[] texCoordsBuffer, int offset, int length) {
         System.arraycopy(texCoordsBuffer, offset, texCoord, 0, length);
     }
-        
+
     /**
      * @return deep clone of this Vertex, but keeping the id blank
      */
     public SVertex clone(){
         return new SVertex(this.coord, 0, 3, this.texCoord, 0, 2, this.onCurve);
     }
-    
+
     public String toString() {
-        return "[ID: " + id + ", onCurve: " + onCurve + 
+        return "[ID: " + id + ", onCurve: " + onCurve +
                ": p " + coord[0] + ", " + coord[1] + ", " + coord[2] +
                ", t " + texCoord[0] + ", " + texCoord[1] + "]";
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/FBObject.java b/src/jogl/classes/com/jogamp/opengl/FBObject.java
index 7060bb7d1..c78b2b83d 100644
--- a/src/jogl/classes/com/jogamp/opengl/FBObject.java
+++ b/src/jogl/classes/com/jogamp/opengl/FBObject.java
@@ -46,7 +46,7 @@ import com.jogamp.opengl.FBObject.Attachment.Type;
 
 /**
  * Core utility class simplifying usage of framebuffer objects (FBO)
- * with all {@link GLProfile}s. 
+ * with all {@link GLProfile}s.
  * <p>
  * Supports on-the-fly reconfiguration of dimension and multisample buffers via {@link #reset(GL, int, int, int, boolean)}
  * while preserving the {@link Attachment} references.
@@ -55,50 +55,50 @@ import com.jogamp.opengl.FBObject.Attachment.Type;
  * Integrates default read/write framebuffers via {@link GLContext#getDefaultReadFramebuffer()} and {@link GLContext#getDefaultReadFramebuffer()},
  * which is being hooked at {@link GL#glBindFramebuffer(int, int)} when the default (<code>zero</code>) framebuffer is selected.
  * </p>
- * 
+ *
  * <p>FIXME: Implement support for {@link Type#DEPTH_TEXTURE}, {@link Type#STENCIL_TEXTURE} .</p>
  */
 public class FBObject {
     protected static final boolean DEBUG = Debug.debug("FBObject");
     private static final boolean FBOResizeQuirk = false;
-    
+
     private static enum DetachAction { NONE, DISPOSE, RECREATE };
-    
-    /** 
+
+    /**
      * Marker interface, denotes a color buffer attachment.
      * <p>Always an instance of {@link Attachment}.</p>
-     * <p>Either an instance of {@link ColorAttachment} or {@link TextureAttachment}.</b> 
+     * <p>Either an instance of {@link ColorAttachment} or {@link TextureAttachment}.</b>
      */
-    public static interface Colorbuffer {        
-        /** 
+    public static interface Colorbuffer {
+        /**
          * Initializes the color buffer and set it's parameter, if uninitialized, i.e. name is <code>zero</code>.
          * @return <code>true</code> if newly initialized, otherwise <code>false</code>.
-         * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case. 
+         * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case.
          */
         public boolean initialize(GL gl) throws GLException;
-        
-        /** 
+
+        /**
          * Releases the color buffer if initialized, i.e. name is not <code>zero</code>.
-         * @throws GLException if buffer release fails. 
+         * @throws GLException if buffer release fails.
          */
         public void free(GL gl) throws GLException;
-        
+
         /**
          * Writes the internal format to the given GLCapabilities object.
          * @param caps the destination for format bits
          * @param rgba8Avail whether rgba8 is available
          */
-        public void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail);        
+        public void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail);
     }
-    
+
     /** Common super class of all attachments */
     public static abstract class Attachment {
-        public enum Type { 
+        public enum Type {
             NONE, DEPTH, STENCIL, DEPTH_STENCIL, COLOR, COLOR_TEXTURE, DEPTH_TEXTURE, STENCIL_TEXTURE;
-            
-            /** 
+
+            /**
              * Returns {@link #COLOR}, {@link #DEPTH}, {@link #STENCIL} or {@link #DEPTH_STENCIL}
-             * @throws IllegalArgumentException if <code>format</code> cannot be handled. 
+             * @throws IllegalArgumentException if <code>format</code> cannot be handled.
              */
             public static Type determine(int format) throws IllegalArgumentException {
                 switch(format) {
@@ -120,20 +120,20 @@ public class FBObject {
                         return Type.DEPTH_STENCIL;
                     default:
                         throw new IllegalArgumentException("format invalid: "+toHexString(format));
-                }        
+                }
             }
         };
-                
+
         /** immutable type [{@link #COLOR}, {@link #DEPTH}, {@link #STENCIL}, {@link #COLOR_TEXTURE}, {@link #DEPTH_TEXTURE}, {@link #STENCIL_TEXTURE} ] */
         public final Type type;
-        
+
         /** immutable the internal format */
         public final int format;
-        
+
         private int width, height;
-        
+
         private int name;
-        
+
         protected Attachment(Type type, int iFormat, int width, int height, int name) {
             this.type = type;
             this.format = iFormat;
@@ -141,18 +141,18 @@ public class FBObject {
             this.height = height;
             this.name = name;
         }
-        
+
         /**
          * Writes the internal format to the given GLCapabilities object.
          * @param caps the destination for format bits
          * @param rgba8Avail whether rgba8 is available
          */
-        public final void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail) {        
+        public final void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail) {
             final int _format;
             switch(format) {
                 case GL.GL_RGBA:
                 case 4:
-                    _format = rgba8Avail ? GL.GL_RGBA8 : GL.GL_RGBA4;  
+                    _format = rgba8Avail ? GL.GL_RGBA8 : GL.GL_RGBA4;
                     break;
                 case GL.GL_RGB:
                 case 3:
@@ -191,7 +191,7 @@ public class FBObject {
                     caps.setGreenBits(8);
                     caps.setBlueBits(8);
                     caps.setAlphaBits(8);
-                    break;                    
+                    break;
                 case GL.GL_DEPTH_COMPONENT16:
                     caps.setDepthBits(16);
                     break;
@@ -218,18 +218,18 @@ public class FBObject {
                     throw new IllegalArgumentException("format invalid: "+toHexString(format));
             }
         }
-                
+
         /** width of attachment */
         public final int getWidth() { return width; }
         /** height of attachment */
         public final int getHeight() { return height; }
         /* pp */ final void setSize(int w, int h) { width = w; height = h; }
-        
+
         /** buffer name [1..max], maybe a texture or renderbuffer name, depending on type. */
-        public final int getName() { return name; }        
+        public final int getName() { return name; }
         /* pp */ final void setName(int n) { name = n; }
-        
-        /** 
+
+        /**
          * Initializes the attachment and set it's parameter, if uninitialized, i.e. name is <code>zero</code>.
          * <pre>
             final boolean init = 0 == name;
@@ -239,11 +239,11 @@ public class FBObject {
             return init;
          * </pre>
          * @return <code>true</code> if newly initialized, otherwise <code>false</code>.
-         * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case. 
+         * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case.
          */
         public abstract boolean initialize(GL gl) throws GLException;
-        
-        /** 
+
+        /**
          * Releases the attachment if initialized, i.e. name is not <code>zero</code>.
          * <pre>
             if(0 != name) {
@@ -251,10 +251,10 @@ public class FBObject {
                 name = 0;
             }
          * </pre>
-         * @throws GLException if buffer release fails. 
+         * @throws GLException if buffer release fails.
          */
         public abstract void free(GL gl) throws GLException;
-        
+
         /**
          * <p>
          * Comparison by {@link #type}, {@link #format}, {@link #width}, {@link #height} and {@link #name}.
@@ -272,7 +272,7 @@ public class FBObject {
                    height== a.height  &&
                    name == a.name     ;
         }
-        
+
         /**
          * <p>
          * Hashed by {@link #type}, {@link #format}, {@link #width}, {@link #height} and {@link #name}.
@@ -289,14 +289,14 @@ public class FBObject {
             hash = ((hash << 5) - hash) + name;
             return hash;
         }
-        
+
         int objectHashCode() { return super.hashCode(); }
-        
+
         public String toString() {
             return getClass().getSimpleName()+"[type "+type+", format "+toHexString(format)+", "+width+"x"+height+
                    "; name "+toHexString(name)+", obj "+toHexString(objectHashCode())+"]";
         }
-        
+
         public static Type getType(int attachmentPoint, int maxColorAttachments) {
             if( GL.GL_COLOR_ATTACHMENT0 <= attachmentPoint && attachmentPoint < GL.GL_COLOR_ATTACHMENT0+maxColorAttachments ) {
                 return Type.COLOR;
@@ -304,9 +304,9 @@ public class FBObject {
             switch(attachmentPoint) {
                 case GL.GL_DEPTH_ATTACHMENT:
                     return Type.DEPTH;
-                case GL.GL_STENCIL_ATTACHMENT:            
+                case GL.GL_STENCIL_ATTACHMENT:
                     return Type.STENCIL;
-                default: 
+                default:
                     throw new IllegalArgumentException("Invalid attachment point "+toHexString(attachmentPoint));
             }
         }
@@ -315,7 +315,7 @@ public class FBObject {
     /** Other renderbuffer attachment which maybe a colorbuffer, depth or stencil. */
     public static class RenderAttachment extends Attachment {
         private int samples;
-        
+
         /**
          * @param type allowed types are {@link Type#DEPTH_STENCIL} {@link Type#DEPTH}, {@link Type#STENCIL} or {@link Type#COLOR}
          * @param iFormat
@@ -328,11 +328,11 @@ public class FBObject {
             super(validateType(type), iFormat, width, height, name);
             this.samples = samples;
         }
-        
+
         /** number of samples, or zero for no multisampling */
         public final int getSamples() { return samples; }
         /* pp */ final void setSamples(int s) { samples = s; }
-        
+
         private static Type validateType(Type type) {
             switch(type) {
                 case DEPTH_STENCIL:
@@ -340,11 +340,11 @@ public class FBObject {
                 case STENCIL:
                 case COLOR:
                     return type;
-                default: 
+                default:
                     throw new IllegalArgumentException("Invalid type: "+type);
             }
         }
-        
+
         /**
          * <p>
          * Comparison by {@link #type}, {@link #format}, {@link #samples}, {@link #width}, {@link #height} and {@link #name}.
@@ -358,7 +358,7 @@ public class FBObject {
             return super.equals(o) &&
                    samples == ((RenderAttachment)o).samples;
         }
-        
+
         /**
          * <p>
          * Hashed by {@link #type}, {@link #format}, {@link #samples}, {@link #width}, {@link #height} and {@link #name}.
@@ -378,14 +378,14 @@ public class FBObject {
             final boolean init = 0 == getName();
             if( init ) {
                 checkPreGLError(gl);
-                
+
                 final int[] name = new int[] { -1 };
                 gl.glGenRenderbuffers(1, name, 0);
                 setName(name[0]);
-                
+
                 gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, getName());
                 if( samples > 0 ) {
-                    ((GL2GL3)gl).glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, samples, format, getWidth(), getHeight());            
+                    ((GL2GL3)gl).glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, samples, format, getWidth(), getHeight());
                 } else {
                     gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, format, getWidth(), getHeight());
                 }
@@ -401,7 +401,7 @@ public class FBObject {
             }
             return init;
         }
-        
+
         @Override
         public void free(GL gl) {
             final int[] name = new int[] { getName() };
@@ -413,20 +413,20 @@ public class FBObject {
                 setName(0);
             }
         }
-        
+
         public String toString() {
             return getClass().getSimpleName()+"[type "+type+", format "+toHexString(format)+", samples "+samples+", "+getWidth()+"x"+getHeight()+
                    ", name "+toHexString(getName())+", obj "+toHexString(objectHashCode())+"]";
         }
     }
-    
+
     /** Color render buffer attachment  */
     public static class ColorAttachment extends RenderAttachment implements Colorbuffer {
         public ColorAttachment(int iFormat, int samples, int width, int height, int name) {
             super(Type.COLOR, iFormat, samples, width, height, name);
-        }    
+        }
     }
-    
+
     /** Texture attachment */
     public static class TextureAttachment extends Attachment implements Colorbuffer  {
         /** details of the texture setup */
@@ -445,7 +445,7 @@ public class FBObject {
          * @param wrapT
          * @param name
          */
-        public TextureAttachment(Type type, int iFormat, int width, int height, int dataFormat, int dataType, 
+        public TextureAttachment(Type type, int iFormat, int width, int height, int dataFormat, int dataType,
                                  int magFilter, int minFilter, int wrapS, int wrapT, int name) {
             super(validateType(type), iFormat, width, height, name);
             this.dataFormat = dataFormat;
@@ -455,35 +455,35 @@ public class FBObject {
             this.wrapS = wrapS;
             this.wrapT = wrapT;
         }
-        
+
         private static Type validateType(Type type) {
             switch(type) {
                 case COLOR_TEXTURE:
                 case DEPTH_TEXTURE:
                 case STENCIL_TEXTURE:
                     return type;
-                default: 
+                default:
                     throw new IllegalArgumentException("Invalid type: "+type);
             }
         }
-        
-        /** 
+
+        /**
          * Initializes the texture and set it's parameter, if uninitialized, i.e. name is <code>zero</code>.
-         * @throws GLException if texture generation and setup fails. The just created texture name will be deleted in this case. 
+         * @throws GLException if texture generation and setup fails. The just created texture name will be deleted in this case.
          */
         @Override
         public boolean initialize(GL gl) throws GLException {
             final boolean init = 0 == getName();
             if( init ) {
                 checkPreGLError(gl);
-                
-                final int[] name = new int[] { -1 };            
+
+                final int[] name = new int[] { -1 };
                 gl.glGenTextures(1, name, 0);
                 if(0 == name[0]) {
                     throw new GLException("null texture, "+this);
                 }
                 setName(name[0]);
-                
+
                 gl.glBindTexture(GL.GL_TEXTURE_2D, name[0]);
                 if( 0 < magFilter ) {
                     gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, magFilter);
@@ -495,7 +495,7 @@ public class FBObject {
                     gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, wrapS);
                 }
                 if( 0 < wrapT ) {
-                    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, wrapT);            
+                    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, wrapT);
                 }
                 boolean preTexImage2D = true;
                 int glerr = gl.glGetError();
@@ -534,50 +534,50 @@ public class FBObject {
                                               "; min/mag "+toHexString(minFilter)+"/"+toHexString(magFilter)+
                                               ", wrap S/T "+toHexString(wrapS)+"/"+toHexString(wrapT)+
                                               "; name "+toHexString(getName())+", obj "+toHexString(objectHashCode())+"]";
-        }               
+        }
     }
     static String toHexString(int v) {
         return "0x"+Integer.toHexString(v);
     }
-    
+
     /**
-     * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE}, 
+     * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE},
      * selecting the texture data type and format automatically.
-     * 
+     *
      * <p>Using default min/mag filter {@link GL#GL_NEAREST} and default wrapS/wrapT {@link GL#GL_CLAMP_TO_EDGE}.</p>
-     * 
+     *
      * @param glp the chosen {@link GLProfile}
      * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
-     * @param width texture width 
+     * @param width texture width
      * @param height texture height
      * @return the created and uninitialized color {@link TextureAttachment}
      */
     public static final TextureAttachment createColorTextureAttachment(GLProfile glp, boolean alpha, int width, int height) {
         return createColorTextureAttachment(glp, alpha, width, height, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
     }
-    
+
     /**
-     * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE}, 
+     * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE},
      * selecting the texture data type and format automatically.
-     * 
+     *
      * @param glp the chosen {@link GLProfile}
      * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
-     * @param width texture width 
+     * @param width texture width
      * @param height texture height
      * @param magFilter if > 0 value for {@link GL#GL_TEXTURE_MAG_FILTER}
-     * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER} 
+     * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
      * @param wrapS if > 0 value for {@link GL#GL_TEXTURE_WRAP_S}
      * @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
      * @return the created and uninitialized color {@link TextureAttachment}
      */
-    public static final TextureAttachment createColorTextureAttachment(GLProfile glp, boolean alpha, int width, int height, 
+    public static final TextureAttachment createColorTextureAttachment(GLProfile glp, boolean alpha, int width, int height,
                                                                        int magFilter, int minFilter, int wrapS, int wrapT) {
         final int textureInternalFormat, textureDataFormat, textureDataType;
-        if(glp.isGLES()) { 
+        if(glp.isGLES()) {
             textureInternalFormat = alpha ? GL.GL_RGBA : GL.GL_RGB;
             textureDataFormat = alpha ? GL.GL_RGBA : GL.GL_RGB;
             textureDataType = GL.GL_UNSIGNED_BYTE;
-        } else { 
+        } else {
             textureInternalFormat = alpha ? GL.GL_RGBA8 : GL.GL_RGB8;
             // textureInternalFormat = alpha ? GL.GL_RGBA : GL.GL_RGB;
             // textureInternalFormat = alpha ? 4 : 3;
@@ -586,27 +586,27 @@ public class FBObject {
         }
         return createColorTextureAttachment(textureInternalFormat, width, height, textureDataFormat, textureDataType, magFilter, minFilter, wrapS, wrapT);
     }
-    
+
     /**
-     * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE}. 
+     * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE}.
      *
      * @param internalFormat internalFormat parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
-     * @param width texture width 
+     * @param width texture width
      * @param height texture height
      * @param dataFormat format parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
      * @param dataType type parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
      * @param magFilter if > 0 value for {@link GL#GL_TEXTURE_MAG_FILTER}
-     * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER} 
+     * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
      * @param wrapS if > 0 value for {@link GL#GL_TEXTURE_WRAP_S}
      * @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
      * @return the created and uninitialized color {@link TextureAttachment}
      */
     public static final TextureAttachment createColorTextureAttachment(int internalFormat, int width, int height, int dataFormat, int dataType,
                                                                        int magFilter, int minFilter, int wrapS, int wrapT) {
-        return new TextureAttachment(Type.COLOR_TEXTURE, internalFormat, width, height, dataFormat, dataType, 
+        return new TextureAttachment(Type.COLOR_TEXTURE, internalFormat, width, height, dataFormat, dataType,
                                      magFilter, minFilter, wrapS, wrapT, 0 /* name */);
     }
-    
+
     private static boolean hasAlpha(int format) {
         switch(format) {
             case GL.GL_RGBA8:
@@ -619,7 +619,7 @@ public class FBObject {
                 return false;
         }
     }
-    
+
     private boolean initialized;
     private boolean fullFBOSupport;
     private boolean rgba8Avail;
@@ -629,7 +629,7 @@ public class FBObject {
     private boolean stencil04Avail;
     private boolean stencil08Avail;
     private boolean stencil16Avail;
-    private boolean packedDepthStencilAvail;            
+    private boolean packedDepthStencilAvail;
     private int maxColorAttachments, maxSamples, maxTextureSize, maxRenderbufferSize;
 
     private int width, height, samples;
@@ -639,21 +639,21 @@ public class FBObject {
     private boolean bound;
 
     private int colorAttachmentCount;
-    private Colorbuffer[] colorAttachmentPoints; // colorbuffer attachment points 
+    private Colorbuffer[] colorAttachmentPoints; // colorbuffer attachment points
     private RenderAttachment depth, stencil; // depth and stencil maybe equal in case of packed-depth-stencil
 
     private FBObject samplingSink; // MSAA sink
-    private TextureAttachment samplingSinkTexture; 
+    private TextureAttachment samplingSinkTexture;
     private boolean samplingSinkDirty;
 
     //
     // ColorAttachment helper ..
     //
-    
+
     private final void validateColorAttachmentPointRange(int point) {
         if(!initialized) {
             throw new GLException("FBO not initialized");
-        }                
+        }
         if(maxColorAttachments != colorAttachmentPoints.length) {
             throw new InternalError("maxColorAttachments "+maxColorAttachments+", array.lenght "+colorAttachmentPoints);
         }
@@ -661,14 +661,14 @@ public class FBObject {
             throw new IllegalArgumentException("attachment point out of range: "+point+", should be within [0.."+(maxColorAttachments-1)+"], "+this);
         }
     }
-    
+
     private final void validateAddColorAttachment(int point, Colorbuffer ca) {
         validateColorAttachmentPointRange(point);
         if( null != colorAttachmentPoints[point] ) {
             throw new IllegalArgumentException("Cannot attach "+ca+", attachment point already in use by "+colorAttachmentPoints[point]+", "+this);
-        }        
+        }
     }
-    
+
     private final void addColorAttachment(int point, Colorbuffer ca) {
         validateColorAttachmentPointRange(point);
         final Colorbuffer c = colorAttachmentPoints[point];
@@ -678,7 +678,7 @@ public class FBObject {
         colorAttachmentPoints[point] = ca;
         colorAttachmentCount++;
     }
-    
+
     private final void removeColorAttachment(int point, Colorbuffer ca) {
         validateColorAttachmentPointRange(point);
         final Colorbuffer c = colorAttachmentPoints[point];
@@ -688,20 +688,20 @@ public class FBObject {
         colorAttachmentPoints[point] = null;
         colorAttachmentCount--;
     }
-    
+
     /**
      * Return the {@link Colorbuffer} attachment at <code>attachmentPoint</code> if it is attached to this FBO, otherwise null.
-     * 
+     *
      * @see #attachColorbuffer(GL, boolean)
      * @see #attachColorbuffer(GL, boolean)
      * @see #attachTexture2D(GL, int, boolean, int, int, int, int)
-     * @see #attachTexture2D(GL, int, int, int, int, int, int, int, int) 
+     * @see #attachTexture2D(GL, int, int, int, int, int, int, int, int)
      */
     public final Colorbuffer getColorbuffer(int attachmentPoint) {
-        validateColorAttachmentPointRange(attachmentPoint);        
+        validateColorAttachmentPointRange(attachmentPoint);
         return colorAttachmentPoints[attachmentPoint];
     }
-    
+
     /**
      * Finds the passed {@link Colorbuffer} within the valid range of attachment points
      * using <i>reference</i> comparison only.
@@ -709,36 +709,36 @@ public class FBObject {
      * Note: Slow. Implementation uses a logN array search to save resources, i.e. not using a HashMap.
      * </p>
      * @param ca the {@link Colorbuffer} to look for.
-     * @return -1 if the {@link Colorbuffer} could not be found, otherwise [0..{@link #getMaxColorAttachments()}-1] 
+     * @return -1 if the {@link Colorbuffer} could not be found, otherwise [0..{@link #getMaxColorAttachments()}-1]
      */
     public final int getColorbufferAttachmentPoint(Colorbuffer ca) {
         for(int i=0; i<colorAttachmentPoints.length; i++) {
             if( colorAttachmentPoints[i] == ca ) {
-                return i; 
+                return i;
             }
         }
         return -1;
     }
-    
+
     /**
      * Returns the passed {@link Colorbuffer} if it is attached to this FBO, otherwise null.
      * Implementation compares the <i>reference</i> only.
-     * 
+     *
      * <p>
      * Note: Slow. Uses {@link #getColorbufferAttachmentPoint(Colorbuffer)} to determine it's attachment point
      *       to be used for {@link #getColorbuffer(int)}
      * </p>
-     * 
+     *
      * @see #attachColorbuffer(GL, boolean)
      * @see #attachColorbuffer(GL, boolean)
      * @see #attachTexture2D(GL, int, boolean, int, int, int, int)
-     * @see #attachTexture2D(GL, int, int, int, int, int, int, int, int) 
+     * @see #attachTexture2D(GL, int, int, int, int, int, int, int, int)
      */
     public final Colorbuffer getColorbuffer(Colorbuffer ca) {
         final int p = getColorbufferAttachmentPoint(ca);
         return p>=0 ? getColorbuffer(p) : null;
     }
-        
+
     /**
      * Creates an uninitialized FBObject instance.
      * <p>
@@ -747,7 +747,7 @@ public class FBObject {
      */
     public FBObject() {
         this.initialized = false;
-        
+
         // TBD @ init
         this.fullFBOSupport = false;
         this.rgba8Avail = false;
@@ -762,7 +762,7 @@ public class FBObject {
         this.maxSamples=-1;
         this.maxTextureSize = 0;
         this.maxRenderbufferSize = 0;
-        
+
         this.width = 0;
         this.height = 0;
         this.samples = 0;
@@ -770,17 +770,17 @@ public class FBObject {
         this.ignoreStatus = false;
         this.fbName = 0;
         this.bound = false;
-        
+
         this.colorAttachmentPoints = null; // at init ..
         this.colorAttachmentCount = 0;
         this.depth = null;
-        this.stencil = null;                
-        
+        this.stencil = null;
+
         this.samplingSink = null;
         this.samplingSinkTexture = null;
         this.samplingSinkDirty = true;
     }
-    
+
     private void init(GL gl, int width, int height, int samples) throws GLException {
         if(initialized) {
             throw new GLException("FBO already initialized");
@@ -788,8 +788,8 @@ public class FBObject {
         if( !gl.hasBasicFBOSupport() ) {
             throw new GLException("FBO not supported w/ context: "+gl.getContext()+", "+this);
         }
-        fullFBOSupport = gl.hasFullFBOSupport();        
-        
+        fullFBOSupport = gl.hasFullFBOSupport();
+
         rgba8Avail = gl.isGL2GL3() || gl.isExtensionAvailable(GLExtensions.OES_rgb8_rgba8);
         depth24Avail = fullFBOSupport || gl.isExtensionAvailable(GLExtensions.OES_depth24);
         depth32Avail = fullFBOSupport || gl.isExtensionAvailable(GLExtensions.OES_depth32);
@@ -797,15 +797,15 @@ public class FBObject {
         stencil04Avail = fullFBOSupport || gl.isExtensionAvailable(GLExtensions.OES_stencil4);
         stencil08Avail = fullFBOSupport || gl.isExtensionAvailable(GLExtensions.OES_stencil8);
         stencil16Avail = fullFBOSupport;
-        
+
         packedDepthStencilAvail = fullFBOSupport ||
                                   gl.isExtensionAvailable(GLExtensions.OES_packed_depth_stencil) ||
                                   gl.isExtensionAvailable(GLExtensions.EXT_packed_depth_stencil) ;
-        
+
         final boolean NV_fbo_color_attachments = gl.isExtensionAvailable(GLExtensions.NV_fbo_color_attachments);
-                                
+
         int val[] = new int[1];
-        
+
         checkPreGLError(gl);
 
         int realMaxColorAttachments = 1;
@@ -818,24 +818,24 @@ public class FBObject {
             } catch (GLException gle) { gle.printStackTrace(); }
         }
         maxColorAttachments = realMaxColorAttachments <= 8 ? realMaxColorAttachments : 8; // cap to limit array size
-        
+
         colorAttachmentPoints = new Colorbuffer[maxColorAttachments];
         colorAttachmentCount = 0;
-        
+
         maxSamples = gl.getMaxRenderbufferSamples();
         gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, val, 0);
         maxTextureSize = val[0];
         gl.glGetIntegerv(GL.GL_MAX_RENDERBUFFER_SIZE, val, 0);
         maxRenderbufferSize = val[0];
-        
+
         checkPreGLError(gl);
-        
+
         if( 0 >= width )  { width = 1; }
         if( 0 >= height ) { height = 1; }
         this.width = width;
         this.height = height;
         this.samples = samples <= maxSamples ? samples : maxSamples;
-        
+
         if(DEBUG) {
             System.err.println("FBObject "+width+"x"+height+", "+samples+" -> "+this.samples+" samples");
             System.err.println("fullFBOSupport:           "+fullFBOSupport);
@@ -856,16 +856,16 @@ public class FBObject {
             System.err.println(JoglVersion.getGLStrings(gl, null).toString());
             System.err.println(gl.getContext());
         }
-        
+
         checkNoError(null, gl.glGetError(), "FBObject Init.pre"); // throws GLException if error
-        
+
         if(width > 2 + maxTextureSize  || height> 2 + maxTextureSize ||
            width > maxRenderbufferSize || height> maxRenderbufferSize  ) {
             throw new GLException("size "+width+"x"+height+" exceeds on of the maxima [texture "+maxTextureSize+", renderbuffer "+maxRenderbufferSize+"]");
         }
 
         resetSamplingSink(gl);
-        
+
         // generate fbo ..
         gl.glGenFramebuffers(1, val, 0);
         fbName = val[0];
@@ -874,15 +874,15 @@ public class FBObject {
         }
 
         // bind fbo ..
-        gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, fbName);        
-        checkNoError(gl, gl.glGetError(), "FBObject Init.bindFB");  // throws GLException if error        
+        gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, fbName);
+        checkNoError(gl, gl.glGetError(), "FBObject Init.bindFB");  // throws GLException if error
         if(!gl.glIsFramebuffer(fbName)) {
             checkNoError(gl, GL.GL_INVALID_VALUE, "FBObject Init.isFB"); // throws GLException
         }
         bound = true;
         samplingSinkDirty = true;
         initialized = true;
-        
+
         vStatus = GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; // always incomplete w/o attachments!
         if(DEBUG) {
             System.err.println("FBObject.init(): "+this);
@@ -900,9 +900,9 @@ public class FBObject {
      * Incompatibility and hence recreation is forced if
      * the size or sample count doesn't match for subsequent calls.
      * </p>
-     * 
+     *
      * <p>Leaves the FBO bound state untouched</p>
-     * 
+     *
      * @param gl the current GL context
      * @param newWidth
      * @param newHeight
@@ -911,7 +911,7 @@ public class FBObject {
     public final void reset(GL gl, int newWidth, int newHeight) {
         reset(gl, newWidth, newHeight, 0, false);
     }
-    
+
     /**
      * Initializes or resets this FBO's instance.
      * <p>
@@ -920,21 +920,21 @@ public class FBObject {
      * to match the new given parameters.
      * </p>
      * <p>
-     * Currently incompatibility and hence recreation of the attachments will be performed 
+     * Currently incompatibility and hence recreation of the attachments will be performed
      * if the size or sample count doesn't match for subsequent calls.
      * </p>
-     * 
+     *
      * <p>Leaves the FBO bound state untouched</p>
-     * 
+     *
      * @param gl the current GL context
      * @param newWidth the new width, it's minimum is capped to 1
      * @param newHeight the new height, it's minimum is capped to 1
      * @param newSamples if > 0, MSAA will be used, otherwise no multisampling. Will be capped to {@link #getMaxSamples()}.
-     * @param resetSamplingSink <code>true</code> calls {@link #resetSamplingSink(GL)} immediatly. 
+     * @param resetSamplingSink <code>true</code> calls {@link #resetSamplingSink(GL)} immediatly.
      *                          <code>false</code> postpones resetting the sampling sink until {@link #use(GL, TextureAttachment)} or {@link #syncSamplingSink(GL)},
-     *                          allowing to use the samples sink's FBO and texture until then. The latter is useful to benefit 
-     *                          from implicit double buffering while resetting the sink just before it's being used, eg. at swap-buffer. 
-     *                          
+     *                          allowing to use the samples sink's FBO and texture until then. The latter is useful to benefit
+     *                          from implicit double buffering while resetting the sink just before it's being used, eg. at swap-buffer.
+     *
      * @throws GLException in case of an error, i.e. size too big, etc ..
      */
     public final void reset(GL gl, int newWidth, int newHeight, int newSamples, boolean resetSamplingSink) {
@@ -942,9 +942,9 @@ public class FBObject {
             init(gl, newWidth, newHeight, newSamples);
             return;
         }
-        
+
         newSamples = newSamples <= maxSamples ? newSamples : maxSamples; // clamp
-        
+
         if( newWidth !=  width || newHeight !=  height || newSamples != samples ) {
             if( 0 >= newWidth )  { newWidth = 1; }
             if( 0 >= newHeight ) { newHeight = 1; }
@@ -952,39 +952,39 @@ public class FBObject {
                 newWidth > maxRenderbufferSize || newHeight > maxRenderbufferSize  ) {
                 throw new GLException("size "+width+"x"+height+" exceeds on of the maxima [texture "+maxTextureSize+", renderbuffer "+maxRenderbufferSize+"]");
             }
-        
+
             if(DEBUG) {
                 System.err.println("FBObject.reset - START - "+width+"x"+height+", "+samples+" -> "+newWidth+"x"+newHeight+", "+newSamples+"; "+this);
-            }        
-            
+            }
+
             final boolean wasBound = isBound();
-            
+
             width = newWidth;
             height = newHeight;
             samples = newSamples;
-            
+
             if(0 < samples && null == samplingSink ) {
                 // needs valid samplingSink for detach*() -> bind()
                 samplingSink = new FBObject();
                 samplingSink.init(gl, width, height, 0);
             }
-            detachAllImpl(gl, true , true);            
+            detachAllImpl(gl, true , true);
             if(resetSamplingSink) {
                 resetSamplingSink(gl);
             }
-            
+
             samplingSinkDirty = true;
 
             if(!wasBound) {
                 unbind(gl);
             }
-            
+
             if(DEBUG) {
                 System.err.println("FBObject.reset - END - "+this);
             }
-        }        
+        }
     }
-            
+
     /**
      * Writes the internal format of the attachments to the given GLCapabilities object.
      * @param caps the destination for format bits
@@ -994,11 +994,11 @@ public class FBObject {
         caps.setNumSamples(samples);
         caps.setDepthBits(0);
         caps.setStencilBits(0);
-        
+
         final Colorbuffer cb = samples > 0 ? getSamplingSink() : getColorbuffer(0);
         if(null != cb) {
             cb.formatToGLCapabilities(caps, rgba8Avail);
-        }        
+        }
         if(null != depth) {
             depth.formatToGLCapabilities(caps, rgba8Avail);
         }
@@ -1006,11 +1006,11 @@ public class FBObject {
             stencil.formatToGLCapabilities(caps, rgba8Avail);
         }
     }
-    
-    /** 
+
+    /**
      * Note that the status may reflect an incomplete state during transition of attachments.
      * @return The FB status. {@link GL.GL_FRAMEBUFFER_COMPLETE} if ok, otherwise return GL FBO error state or -1
-     * @see #validateStatus() 
+     * @see #validateStatus()
      */
     public final int getStatus() {
         return vStatus;
@@ -1020,15 +1020,15 @@ public class FBObject {
     public final String getStatusString() {
         return getStatusString(vStatus);
     }
-    
+
     public static final String getStatusString(int fbStatus) {
         switch(fbStatus) {
             case -1:
                 return "NOT A FBO";
-                
+
             case GL.GL_FRAMEBUFFER_COMPLETE:
                 return "OK";
-                
+
             case GL.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
                 return("FBO incomplete attachment\n");
             case GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
@@ -1043,21 +1043,21 @@ public class FBObject {
                 return("FBO missing read buffer");
             case GL2GL3.GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
                 return("FBO missing multisample buffer");
-            case GL3.GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:                
+            case GL3.GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
                 return("FBO missing layer targets");
-                
+
             case GL.GL_FRAMEBUFFER_UNSUPPORTED:
                 return("Unsupported FBO format");
             case GL2GL3.GL_FRAMEBUFFER_UNDEFINED:
                  return("FBO undefined");
-                 
+
             case 0:
                 return("FBO implementation fault");
             default:
                 return("FBO incomplete, implementation ERROR "+toHexString(fbStatus));
         }
     }
-    
+
     /**
      * The status may even be valid if incomplete during transition of attachments.
      * @see #getStatus()
@@ -1066,7 +1066,7 @@ public class FBObject {
         switch(vStatus) {
             case GL.GL_FRAMEBUFFER_COMPLETE:
                 return true;
-                
+
             case GL.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
             case GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
             case GL.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
@@ -1079,29 +1079,29 @@ public class FBObject {
                     // we are in transition
                     return true;
                 }
-         
+
             case GL.GL_FRAMEBUFFER_UNSUPPORTED:
             case GL2GL3.GL_FRAMEBUFFER_UNDEFINED:
-                
-            case 0:                
+
+            case 0:
             default:
                 if(DEBUG) {
-                    System.err.println("Framebuffer " + fbName + " is incomplete, status = " + toHexString(vStatus) + 
+                    System.err.println("Framebuffer " + fbName + " is incomplete, status = " + toHexString(vStatus) +
                             " : " + getStatusString(vStatus));
                 }
                 return false;
         }
     }
-        
+
     private static int checkPreGLError(GL gl) {
         int glerr = gl.glGetError();
         if(DEBUG && GL.GL_NO_ERROR != glerr) {
             System.err.println("Pre-existing GL error: "+toHexString(glerr));
             Thread.dumpStack();
         }
-        return glerr;        
+        return glerr;
     }
-    
+
     private final boolean checkNoError(GL gl, int err, String exceptionMessage) throws GLException {
         if(GL.GL_NO_ERROR != err) {
             if(null != gl) {
@@ -1118,17 +1118,17 @@ public class FBObject {
     private final void checkInitialized() throws GLException {
         if(!initialized) {
             throw new GLException("FBO not initialized, call init(GL) first.");
-        }                
+        }
     }
-    
+
     /**
      * Attaches a {@link Colorbuffer}, i.e. {@link TextureAttachment}, to this FBO's instance at the given attachment point,
      * selecting the texture data type and format automatically.
-     * 
+     *
      * <p>Using default min/mag filter {@link GL#GL_NEAREST} and default wrapS/wrapT {@link GL#GL_CLAMP_TO_EDGE}.</p>
-     * 
+     *
      * <p>Leaves the FBO bound.</p>
-     * 
+     *
      * @param gl the current GL context
      * @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
      * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
@@ -1140,18 +1140,18 @@ public class FBObject {
         return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
                      createColorTextureAttachment(gl.getGLProfile(), alpha, width, height));
     }
-    
+
     /**
      * Attaches a {@link Colorbuffer}, i.e. {@link TextureAttachment}, to this FBO's instance at the given attachment point,
      * selecting the texture data type and format automatically.
-     * 
+     *
      * <p>Leaves the FBO bound.</p>
-     * 
+     *
      * @param gl the current GL context
      * @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
      * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
      * @param magFilter if > 0 value for {@link GL#GL_TEXTURE_MAG_FILTER}
-     * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER} 
+     * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
      * @param wrapS if > 0 value for {@link GL#GL_TEXTURE_WRAP_S}
      * @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
      * @return TextureAttachment instance describing the new attached texture colorbuffer if bound and configured successfully, otherwise GLException is thrown
@@ -1162,19 +1162,19 @@ public class FBObject {
         return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
                      createColorTextureAttachment(gl.getGLProfile(), alpha, width, height, magFilter, minFilter, wrapS, wrapT));
     }
-    
+
     /**
      * Attaches a {@link Colorbuffer}, i.e. {@link TextureAttachment}, to this FBO's instance at the given attachment point.
-     * 
+     *
      * <p>Leaves the FBO bound.</p>
-     * 
+     *
      * @param gl the current GL context
      * @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
      * @param internalFormat internalFormat parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
      * @param dataFormat format parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
      * @param dataType type parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
      * @param magFilter if > 0 value for {@link GL#GL_TEXTURE_MAG_FILTER}
-     * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER} 
+     * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
      * @param wrapS if > 0 value for {@link GL#GL_TEXTURE_WRAP_S}
      * @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
      * @return TextureAttachment instance describing the new attached texture colorbuffer if bound and configured successfully, otherwise GLException is thrown
@@ -1187,10 +1187,10 @@ public class FBObject {
         return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
                      createColorTextureAttachment(internalFormat, width, height, dataFormat, dataType, magFilter, minFilter, wrapS, wrapT));
     }
-    
+
     /**
      * Creates a {@link ColorAttachment}, selecting the format automatically.
-     *  
+     *
      * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
      * @return uninitialized ColorAttachment instance describing the new attached colorbuffer
      */
@@ -1203,13 +1203,13 @@ public class FBObject {
         }
         return new ColorAttachment(internalFormat, samples, width, height, 0);
     }
-        
+
     /**
      * Attaches a {@link Colorbuffer}, i.e. {@link ColorAttachment}, to this FBO's instance at the given attachment point,
      * selecting the format automatically.
-     *  
+     *
      * <p>Leaves the FBO bound.</p>
-     * 
+     *
      * @param gl the current GL context
      * @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
      * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
@@ -1220,15 +1220,15 @@ public class FBObject {
     public final ColorAttachment attachColorbuffer(GL gl, int attachmentPoint, boolean alpha) throws GLException {
         return (ColorAttachment) attachColorbuffer(gl, attachmentPoint, createColorAttachment(alpha));
     }
-    
+
     /**
      * Attaches a {@link Colorbuffer}, i.e. {@link ColorAttachment}, to this FBO's instance at the given attachment point.
-     *  
+     *
      * <p>Leaves the FBO bound.</p>
-     * 
+     *
      * @param gl the current GL context
      * @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
-     * @param internalFormat usually {@link GL#GL_RGBA4}, {@link GL#GL_RGB5_A1}, {@link GL#GL_RGB565}, {@link GL#GL_RGB8} or {@link GL#GL_RGBA8}  
+     * @param internalFormat usually {@link GL#GL_RGBA4}, {@link GL#GL_RGB5_A1}, {@link GL#GL_RGB565}, {@link GL#GL_RGB8} or {@link GL#GL_RGBA8}
      * @return ColorAttachment instance describing the new attached colorbuffer if bound and configured successfully, otherwise GLException is thrown
      * @throws GLException in case the colorbuffer couldn't be allocated
      * @throws IllegalArgumentException if <code>internalFormat</code> doesn't reflect a colorbuffer
@@ -1238,28 +1238,28 @@ public class FBObject {
         if( Attachment.Type.COLOR != atype ) {
             throw new IllegalArgumentException("colorformat invalid: "+toHexString(internalFormat)+", "+this);
         }
-        
+
         return (ColorAttachment) attachColorbuffer(gl, attachmentPoint, new ColorAttachment(internalFormat, samples, width, height, 0));
     }
-    
+
     /**
-     * Attaches a {@link Colorbuffer}, i.e. {@link ColorAttachment} or {@link TextureAttachment},  
+     * Attaches a {@link Colorbuffer}, i.e. {@link ColorAttachment} or {@link TextureAttachment},
      * to this FBO's instance at the given attachment point.
-     *  
+     *
      * <p>
      * If {@link Colorbuffer} is a {@link TextureAttachment} and is uninitialized, i.e. it's texture name is <code>zero</code>,
      * a new texture name is generated and setup w/ the texture parameter.<br/>
      * Otherwise, i.e. texture name is not <code>zero</code>, the passed TextureAttachment <code>texA</code> is
-     * considered complete and assumed matching this FBO requirement. A GL error may occur is the latter is untrue. 
+     * considered complete and assumed matching this FBO requirement. A GL error may occur is the latter is untrue.
      * </p>
-     * 
+     *
      * <p>Leaves the FBO bound.</p>
-     * 
+     *
      * @param gl
      * @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
-     * @param colbuf the to be attached {@link Colorbuffer}   
+     * @param colbuf the to be attached {@link Colorbuffer}
      * @return newly attached {@link Colorbuffer} instance if bound and configured successfully, otherwise GLException is thrown
-     * @throws GLException in case the colorbuffer couldn't be allocated or MSAA has been chosen in case of a {@link TextureAttachment} 
+     * @throws GLException in case the colorbuffer couldn't be allocated or MSAA has been chosen in case of a {@link TextureAttachment}
      */
     public final Colorbuffer attachColorbuffer(GL gl, int attachmentPoint, Colorbuffer colbuf) throws GLException {
         bind(gl);
@@ -1268,13 +1268,13 @@ public class FBObject {
 
     private final Colorbuffer attachColorbufferImpl(GL gl, int attachmentPoint, Colorbuffer colbuf) throws GLException {
         validateAddColorAttachment(attachmentPoint, colbuf);
-        
+
         final boolean initializedColorbuf = colbuf.initialize(gl);
         addColorAttachment(attachmentPoint, colbuf);
-                
+
         if(colbuf instanceof TextureAttachment) {
             final TextureAttachment texA = (TextureAttachment) colbuf;
-            
+
             if(samples>0) {
                 removeColorAttachment(attachmentPoint, texA);
                 if(initializedColorbuf) {
@@ -1282,14 +1282,14 @@ public class FBObject {
                 }
                 throw new GLException("Texture2D not supported w/ MSAA. If you have enabled MSAA with exisiting texture attachments, you may want to detach them via detachAllTexturebuffer(gl).");
             }
-            
+
             // Set up the color buffer for use as a renderable texture:
             gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER,
                                       GL.GL_COLOR_ATTACHMENT0 + attachmentPoint,
                                       GL.GL_TEXTURE_2D, texA.getName(), 0);
-            
+
             if(!ignoreStatus) {
-                updateStatus(gl);        
+                updateStatus(gl);
                 if(!isStatusValid()) {
                     detachColorbuffer(gl, attachmentPoint, true);
                     throw new GLException("attachTexture2D "+texA+" at "+attachmentPoint+" failed "+getStatusString()+", "+this);
@@ -1297,12 +1297,12 @@ public class FBObject {
             }
         } else if(colbuf instanceof ColorAttachment) {
             final ColorAttachment colA = (ColorAttachment) colbuf;
-            
+
             // Attach the color buffer
-            gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, 
-                                         GL.GL_COLOR_ATTACHMENT0 + attachmentPoint, 
+            gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
+                                         GL.GL_COLOR_ATTACHMENT0 + attachmentPoint,
                                          GL.GL_RENDERBUFFER, colA.getName());
-    
+
             if(!ignoreStatus) {
                 updateStatus(gl);
                 if(!isStatusValid()) {
@@ -1316,7 +1316,7 @@ public class FBObject {
         }
         return colbuf;
     }
-    
+
     /**
      * Attaches one depth, stencil or packed-depth-stencil buffer to this FBO's instance,
      * selecting the internalFormat automatically.
@@ -1325,30 +1325,30 @@ public class FBObject {
      * </p>
      * <p>
      * In case the desired type or bit-number is not supported, the next available one is chosen.
-     * </p>  
+     * </p>
      * <p>
      * Use {@link #getDepthAttachment()} and/or {@link #getStencilAttachment()} to retrieve details
      * about the attached buffer. The details cannot be returned, since it's possible 2 buffers
      * are being created, depth and stencil.
      * </p>
-     * 
+     *
      * <p>Leaves the FBO bound.</p>
-     * 
+     *
      * @param gl
-     * @param atype either {@link Type#DEPTH}, {@link Type#STENCIL} or {@link Type#DEPTH_STENCIL}  
+     * @param atype either {@link Type#DEPTH}, {@link Type#STENCIL} or {@link Type#DEPTH_STENCIL}
      * @param reqBits desired bits for depth or -1 for default (24 bits)
      * @throws GLException in case the renderbuffer couldn't be allocated or one is already attached.
      * @throws IllegalArgumentException
      * @see #getDepthAttachment()
      * @see #getStencilAttachment()
      */
-    public final void attachRenderbuffer(GL gl, Attachment.Type atype, int reqBits) throws GLException, IllegalArgumentException {        
+    public final void attachRenderbuffer(GL gl, Attachment.Type atype, int reqBits) throws GLException, IllegalArgumentException {
         if( 0 > reqBits ) {
             reqBits = 24;
-        }        
+        }
         final int internalFormat;
         int internalStencilFormat = -1;
-        
+
         switch ( atype ) {
             case DEPTH:
                 if( 32 <= reqBits && depth32Avail ) {
@@ -1356,10 +1356,10 @@ public class FBObject {
                 } else if( 24 <= reqBits && depth24Avail ) {
                     internalFormat = GL.GL_DEPTH_COMPONENT24;
                 } else {
-                    internalFormat = GL.GL_DEPTH_COMPONENT16;                    
+                    internalFormat = GL.GL_DEPTH_COMPONENT16;
                 }
                 break;
-                
+
             case STENCIL:
                 if( 16 <= reqBits && stencil16Avail ) {
                     internalFormat = GL2GL3.GL_STENCIL_INDEX16;
@@ -1370,10 +1370,10 @@ public class FBObject {
                 } else if( 1 <= reqBits && stencil01Avail ) {
                     internalFormat = GL.GL_STENCIL_INDEX1;
                 } else {
-                    throw new GLException("stencil buffer n/a");        
+                    throw new GLException("stencil buffer n/a");
                 }
                 break;
-                
+
             case DEPTH_STENCIL:
                 if( packedDepthStencilAvail ) {
                     internalFormat = GL.GL_DEPTH24_STENCIL8;
@@ -1381,7 +1381,7 @@ public class FBObject {
                     if( 24 <= reqBits && depth24Avail ) {
                         internalFormat = GL.GL_DEPTH_COMPONENT24;
                     } else {
-                        internalFormat = GL.GL_DEPTH_COMPONENT16;                    
+                        internalFormat = GL.GL_DEPTH_COMPONENT16;
                     }
                     if( stencil08Avail ) {
                         internalStencilFormat = GL.GL_STENCIL_INDEX8;
@@ -1397,17 +1397,17 @@ public class FBObject {
             default:
                 throw new IllegalArgumentException("only depth/stencil types allowed, was "+atype+", "+this);
         }
-        
+
         attachRenderbufferImpl(gl, atype, internalFormat);
-        
+
         if(0<=internalStencilFormat) {
             attachRenderbufferImpl(gl, Attachment.Type.STENCIL, internalStencilFormat);
         }
     }
-    
+
     /**
      * Attaches one depth, stencil or packed-depth-stencil buffer to this FBO's instance,
-     * depending on the <code>internalFormat</code>. 
+     * depending on the <code>internalFormat</code>.
      * <p>
      * Stencil and depth buffer can be attached only once.
      * </p>
@@ -1416,9 +1416,9 @@ public class FBObject {
      * about the attached buffer. The details cannot be returned, since it's possible 2 buffers
      * are being created, depth and stencil.
      * </p>
-     * 
+     *
      * <p>Leaves the FBO bound.</p>
-     * 
+     *
      * @param gl the current GL context
      * @param internalFormat {@link GL#GL_DEPTH_COMPONENT16}, {@link GL#GL_DEPTH_COMPONENT24}, {@link GL#GL_DEPTH_COMPONENT32},
      *                       {@link GL#GL_STENCIL_INDEX1}, {@link GL#GL_STENCIL_INDEX4}, {@link GL#GL_STENCIL_INDEX8}
@@ -1435,19 +1435,19 @@ public class FBObject {
         }
         attachRenderbufferImpl(gl, atype, internalFormat);
     }
-    
+
     protected final void attachRenderbufferImpl(GL gl, Attachment.Type atype, int internalFormat) throws GLException {
         if( null != depth && ( Attachment.Type.DEPTH == atype || Attachment.Type.DEPTH_STENCIL == atype ) ) {
             throw new GLException("FBO depth buffer already attached (rb "+depth+"), type is "+atype+", "+toHexString(internalFormat)+", "+this);
-        }        
+        }
         if( null != stencil && ( Attachment.Type.STENCIL== atype || Attachment.Type.DEPTH_STENCIL == atype ) ) {
             throw new GLException("FBO stencil buffer already attached (rb "+stencil+"), type is "+atype+", "+toHexString(internalFormat)+", "+this);
         }
         bind(gl);
-        
+
         attachRenderbufferImpl2(gl, atype, internalFormat);
     }
-        
+
     private final void attachRenderbufferImpl2(GL gl, Attachment.Type atype, int internalFormat) throws GLException {
         if( Attachment.Type.DEPTH == atype ) {
             if(null == depth) {
@@ -1486,10 +1486,10 @@ public class FBObject {
         } else if( Attachment.Type.STENCIL == atype ) {
             gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_STENCIL_ATTACHMENT, GL.GL_RENDERBUFFER, stencil.getName());
         } else if( Attachment.Type.DEPTH_STENCIL == atype ) {
-            gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_DEPTH_ATTACHMENT, GL.GL_RENDERBUFFER, depth.getName());            
+            gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_DEPTH_ATTACHMENT, GL.GL_RENDERBUFFER, depth.getName());
             gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_STENCIL_ATTACHMENT, GL.GL_RENDERBUFFER, stencil.getName());
         }
-        
+
         if(!ignoreStatus) {
             updateStatus(gl);
             if( !isStatusValid() ) {
@@ -1500,13 +1500,13 @@ public class FBObject {
 
         if(DEBUG) {
             System.err.println("FBObject.attachRenderbuffer.X: [attachmentType "+atype+", iformat "+toHexString(internalFormat)+"]: "+this);
-        }        
+        }
     }
-    
+
     /**
-     * Detaches a {@link Colorbuffer}, i.e. {@link ColorAttachment} or {@link TextureAttachment}. 
+     * Detaches a {@link Colorbuffer}, i.e. {@link ColorAttachment} or {@link TextureAttachment}.
      * <p>Leaves the FBO bound!</p>
-     * 
+     *
      * @param gl
      * @param attachmentPoint
      * @param dispose true if the Colorbuffer shall be disposed
@@ -1515,26 +1515,26 @@ public class FBObject {
      */
     public final Colorbuffer detachColorbuffer(GL gl, int attachmentPoint, boolean dispose) throws IllegalArgumentException {
         bind(gl);
-        
+
         final Colorbuffer res = detachColorbufferImpl(gl, attachmentPoint, dispose ? DetachAction.DISPOSE : DetachAction.NONE);
         if(null == res) {
-            throw new IllegalArgumentException("ColorAttachment at "+attachmentPoint+", not attached, "+this);            
+            throw new IllegalArgumentException("ColorAttachment at "+attachmentPoint+", not attached, "+this);
         }
         if(DEBUG) {
             System.err.println("FBObject.detachColorbuffer.X: [attachmentPoint "+attachmentPoint+", dispose "+dispose+"]: "+res+", "+this);
         }
         return res;
     }
-    
+
     private final Colorbuffer detachColorbufferImpl(GL gl, int attachmentPoint, DetachAction detachAction) {
         Colorbuffer colbuf = colorAttachmentPoints[attachmentPoint]; // shortcut, don't validate here
-        
+
         if(null == colbuf) {
             return null;
         }
-        
+
         removeColorAttachment(attachmentPoint, colbuf);
-        
+
         if(colbuf instanceof TextureAttachment) {
             final TextureAttachment texA = (TextureAttachment) colbuf;
             if( 0 != texA.getName() ) {
@@ -1553,7 +1553,7 @@ public class FBObject {
             if(DetachAction.RECREATE == detachAction) {
                 if(samples == 0) {
                     // stay non MSAA
-                    texA.setSize(width, height);                        
+                    texA.setSize(width, height);
                 } else {
                     // switch to MSAA
                     colbuf = createColorAttachment(hasAlpha(texA.format));
@@ -1563,8 +1563,8 @@ public class FBObject {
         } else if(colbuf instanceof ColorAttachment) {
             final ColorAttachment colA = (ColorAttachment) colbuf;
             if( 0 != colA.getName() ) {
-                gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, 
-                                             GL.GL_COLOR_ATTACHMENT0+attachmentPoint, 
+                gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
+                                             GL.GL_COLOR_ATTACHMENT0+attachmentPoint,
                                              GL.GL_RENDERBUFFER, 0);
                 switch(detachAction) {
                     case DISPOSE:
@@ -1582,9 +1582,9 @@ public class FBObject {
                 } else {
                     // switch to non MSAA
                     if(null != samplingSinkTexture) {
-                        colbuf = createColorTextureAttachment(samplingSinkTexture.format, width, height, 
-                                                              samplingSinkTexture.dataFormat, samplingSinkTexture.dataType, 
-                                                              samplingSinkTexture.magFilter, samplingSinkTexture.minFilter, 
+                        colbuf = createColorTextureAttachment(samplingSinkTexture.format, width, height,
+                                                              samplingSinkTexture.dataFormat, samplingSinkTexture.dataType,
+                                                              samplingSinkTexture.magFilter, samplingSinkTexture.minFilter,
                                                               samplingSinkTexture.wrapS, samplingSinkTexture.wrapT);
                     } else {
                         colbuf = createColorTextureAttachment(gl.getGLProfile(), true, width, height);
@@ -1595,15 +1595,15 @@ public class FBObject {
         }
         return colbuf;
     }
-    
+
     private final void freeAllColorbufferImpl(GL gl) {
         for(int i=0; i<maxColorAttachments; i++) {
             final Colorbuffer colbuf = colorAttachmentPoints[i]; // shortcut, don't validate here
-            
+
             if(null == colbuf) {
                 return;
             }
-            
+
             if(colbuf instanceof TextureAttachment) {
                 final TextureAttachment texA = (TextureAttachment) colbuf;
                 if( 0 != texA.getName() ) {
@@ -1616,29 +1616,29 @@ public class FBObject {
             } else if(colbuf instanceof ColorAttachment) {
                 final ColorAttachment colA = (ColorAttachment) colbuf;
                 if( 0 != colA.getName() ) {
-                    gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, 
-                                                 GL.GL_COLOR_ATTACHMENT0 + i, 
+                    gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
+                                                 GL.GL_COLOR_ATTACHMENT0 + i,
                                                  GL.GL_RENDERBUFFER, 0);
                 }
                 colA.free(gl);
             }
         }
     }
-    
+
     /**
-     * 
+     *
      * @param gl
      * @param dispose true if the Colorbuffer shall be disposed
-     * @param reqAType {@link Type#DEPTH}, {@link Type#DEPTH} or {@link Type#DEPTH_STENCIL} 
+     * @param reqAType {@link Type#DEPTH}, {@link Type#DEPTH} or {@link Type#DEPTH_STENCIL}
      */
     public final void detachRenderbuffer(GL gl, Attachment.Type atype, boolean dispose) throws IllegalArgumentException {
-        bind(gl);        
+        bind(gl);
         detachRenderbufferImpl(gl, atype, dispose ? DetachAction.DISPOSE : DetachAction.NONE);
         if(DEBUG) {
             System.err.println("FBObject.detachRenderbuffer.X: [attachmentType "+atype+", dispose "+dispose+"]: "+this);
-        }        
+        }
     }
-    
+
     public final boolean isDepthStencilPackedFormat() {
         final boolean res = null != depth && null != stencil &&
                             depth.format == stencil.format ;
@@ -1652,19 +1652,19 @@ public class FBObject {
         }
         return res;
     }
-        
+
     private final void detachRenderbufferImpl(GL gl, Attachment.Type atype, DetachAction detachAction) throws IllegalArgumentException {
         switch ( atype ) {
             case DEPTH:
             case STENCIL:
-            case DEPTH_STENCIL:             
+            case DEPTH_STENCIL:
              break;
              default:
                  throw new IllegalArgumentException("only depth/stencil types allowed, was "+atype+", "+this);
-        }        
+        }
         if( null == depth && null == stencil ) {
             return ; // nop
-        } 
+        }
         final boolean packed = isDepthStencilPackedFormat();
         if( packed ) {
             // Note: DEPTH_STENCIL shares buffer w/ depth and stencil
@@ -1734,7 +1734,7 @@ public class FBObject {
                         if(packed) {
                             stencil = null;
                         }
-                    }                    
+                    }
                 }
                 if( !packed && null != stencil ) {
                     final int format = stencil.format;
@@ -1756,17 +1756,17 @@ public class FBObject {
                 }
                 break;
              default: // handled
-        }        
+        }
     }
-        
+
     private final void freeAllRenderbufferImpl(GL gl) throws IllegalArgumentException {
         // Note: DEPTH_STENCIL shares buffer w/ depth and stencil
         final boolean packed = isDepthStencilPackedFormat();
-        if( null != depth ) { 
+        if( null != depth ) {
             if(0 != depth.getName()) {
                 gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_DEPTH_ATTACHMENT, GL.GL_RENDERBUFFER, 0);
                 if(packed) {
-                    gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_STENCIL_ATTACHMENT, GL.GL_RENDERBUFFER, 0);                    
+                    gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_STENCIL_ATTACHMENT, GL.GL_RENDERBUFFER, 0);
                 }
                 depth.free(gl);
             }
@@ -1774,49 +1774,49 @@ public class FBObject {
         if( !packed && null != stencil ) {
             if(0 != stencil.getName()) {
                 gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_STENCIL_ATTACHMENT, GL.GL_RENDERBUFFER, 0);
-                stencil.free(gl);                    
+                stencil.free(gl);
             }
         }
     }
-    
-    /** 
+
+    /**
      * Detaches all {@link ColorAttachment}s, {@link TextureAttachment}s and {@link RenderAttachment}s
      * and disposes them.
      * <p>Leaves the FBO bound, if initialized!</p>
      * <p>
      * An attached sampling sink texture will be detached as well, see {@link #getSamplingSink()}.
-     * </p> 
+     * </p>
      * @param gl the current GL context
      */
     public final void detachAll(GL gl) {
         if(null != samplingSink) {
             samplingSink.detachAll(gl);
-        }        
+        }
         detachAllImpl(gl, true/* detachNonColorbuffer */, false /* recreate */);
     }
-    
-    /** 
-     * Detaches all {@link ColorAttachment}s and {@link TextureAttachment}s 
+
+    /**
+     * Detaches all {@link ColorAttachment}s and {@link TextureAttachment}s
      * and disposes them.
      * <p>Leaves the FBO bound, if initialized!</p>
      * <p>
      * An attached sampling sink texture will be detached as well, see {@link #getSamplingSink()}.
-     * </p> 
+     * </p>
      * @param gl the current GL context
      */
     public final void detachAllColorbuffer(GL gl) {
         if(null != samplingSink) {
             samplingSink.detachAllColorbuffer(gl);
-        }        
+        }
         detachAllImpl(gl, false/* detachNonColorbuffer */, false /* recreate */);
     }
-    
-    /** 
+
+    /**
      * Detaches all {@link TextureAttachment}s and disposes them.
      * <p>Leaves the FBO bound, if initialized!</p>
      * <p>
      * An attached sampling sink texture will be detached as well, see {@link #getSamplingSink()}.
-     * </p> 
+     * </p>
      * @param gl the current GL context
      */
     public final void detachAllTexturebuffer(GL gl) {
@@ -1826,7 +1826,7 @@ public class FBObject {
         if(null != samplingSink) {
             samplingSink.detachAllTexturebuffer(gl);
         }
-        bind(gl);        
+        bind(gl);
         for(int i=0; i<maxColorAttachments; i++) {
             if(colorAttachmentPoints[i] instanceof TextureAttachment) {
                 detachColorbufferImpl(gl, i, DetachAction.DISPOSE);
@@ -1836,7 +1836,7 @@ public class FBObject {
             System.err.println("FBObject.detachAllTexturebuffer.X: "+this);
         }
     }
-    
+
     public final void detachAllRenderbuffer(GL gl) {
         if( !isInitialized() ) {
             return;
@@ -1844,10 +1844,10 @@ public class FBObject {
         if(null != samplingSink) {
             samplingSink.detachAllRenderbuffer(gl);
         }
-        bind(gl);        
+        bind(gl);
         detachRenderbufferImpl(gl, Attachment.Type.DEPTH_STENCIL, DetachAction.DISPOSE);
     }
-    
+
     private final void detachAllImpl(GL gl, boolean detachNonColorbuffer, boolean recreate) {
         if( !isInitialized() ) {
             return;
@@ -1868,7 +1868,7 @@ public class FBObject {
             if( !recreate && colorAttachmentCount>0 ) {
                 throw new InternalError("Non zero ColorAttachments "+this);
             }
-            
+
             if(detachNonColorbuffer) {
                 detachRenderbufferImpl(gl, Attachment.Type.DEPTH_STENCIL, recreate ? DetachAction.RECREATE : DetachAction.DISPOSE);
             }
@@ -1888,7 +1888,7 @@ public class FBObject {
             System.err.println("FBObject.detachAll.X: [resetNonColorbuffer "+detachNonColorbuffer+", recreate "+recreate+"]: "+this);
         }
     }
-        
+
     /**
      * @param gl the current GL context
      */
@@ -1903,9 +1903,9 @@ public class FBObject {
         if( null != samplingSink && samplingSink.isInitialized() ) {
             samplingSink.destroy(gl);
         }
-        
+
         detachAllImpl(gl, true /* detachNonColorbuffer */, false /* recreate */);
-        
+
         // cache FB names, preset exposed to zero,
         // braking ties w/ GL/GLContext link to getReadFramebuffer()/getWriteFramebuffer()
         final int fb_cache = fbName;
@@ -1915,7 +1915,7 @@ public class FBObject {
         if(0!=fb_cache) {
             name[0] = fb_cache;
             gl.glDeleteFramebuffers(1, name, 0);
-        }        
+        }
         initialized = false;
         bound = false;
         if(DEBUG) {
@@ -1933,14 +1933,14 @@ public class FBObject {
         final boolean depthMismatch   = ( null != depth && null == samplingSink.depth ) ||
                                         ( null != depth && null != samplingSink.depth &&
                                           depth.format != samplingSink.depth.format );
-        
+
         final boolean stencilMismatch = ( null != stencil && null == samplingSink.stencil ) ||
                                         ( null != stencil && null != samplingSink.stencil &&
-                                          stencil.format != samplingSink.stencil.format );        
-        
-        return depthMismatch || stencilMismatch;                
+                                          stencil.format != samplingSink.stencil.format );
+
+        return depthMismatch || stencilMismatch;
     }
-        
+
     /**
      * Manually reset the MSAA sampling sink, if used.
      * <p>
@@ -1948,7 +1948,7 @@ public class FBObject {
      * a new sampling sink is being created.
      * </p>
      * <p>
-     * Automatically called by {@link #reset(GL, int, int, int, boolean)} 
+     * Automatically called by {@link #reset(GL, int, int, int, boolean)}
      * and {@link #syncSamplingSink(GL)}.
      * </p>
      * <p>
@@ -1967,58 +1967,58 @@ public class FBObject {
             }
             return;
         }
-        
+
         if(null == samplingSink ) {
             samplingSink = new FBObject();
         }
-        
+
         if(!samplingSink.initialized) {
             samplingSink.init(gl, width, height, 0);
         }
-        
+
         boolean sampleSinkSizeMismatch = sampleSinkSizeMismatch();
         boolean sampleSinkTexMismatch = sampleSinkTexMismatch();
         boolean sampleSinkDepthStencilMismatch = sampleSinkDepthStencilMismatch();
-        
+
         /** if(DEBUG) {
             System.err.println("FBObject.resetSamplingSink.0: \n\tTHIS "+this+",\n\tSINK "+samplesSink+
                                "\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
         } */
-        
+
         if(!sampleSinkSizeMismatch && !sampleSinkTexMismatch && !sampleSinkDepthStencilMismatch) {
-            // all properties match .. 
-            return;            
+            // all properties match ..
+            return;
         }
-        
+
         unbind(gl);
-        
+
         if(DEBUG) {
             System.err.println("FBObject.resetSamplingSink: BEGIN\n\tTHIS "+this+",\n\tSINK "+samplingSink+
                                "\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
         }
-                
+
         if( sampleSinkDepthStencilMismatch ) {
             samplingSink.detachAllRenderbuffer(gl);
         }
-        
+
         if( sampleSinkSizeMismatch ) {
             samplingSink.reset(gl, width, height);
         }
-        
+
         if(null == samplingSinkTexture) {
             samplingSinkTexture = samplingSink.attachTexture2D(gl, 0, true);
         } else if( 0 == samplingSinkTexture.getName() ) {
             samplingSinkTexture.setSize(width, height);
             samplingSink.attachColorbuffer(gl, 0, samplingSinkTexture);
         }
-        
+
         if( sampleSinkDepthStencilMismatch ) {
             samplingSink.attachRenderbuffer(gl, depth.format);
             if( null != stencil && !isDepthStencilPackedFormat() ) {
                 samplingSink.attachRenderbuffer(gl, stencil.format);
             }
-        }        
-        
+        }
+
         sampleSinkSizeMismatch = sampleSinkSizeMismatch();
         sampleSinkTexMismatch = sampleSinkTexMismatch();
         sampleSinkDepthStencilMismatch = sampleSinkDepthStencilMismatch();
@@ -2026,21 +2026,21 @@ public class FBObject {
             throw new InternalError("Samples sink mismatch after reset: \n\tTHIS "+this+",\n\t SINK "+samplingSink+
                                     "\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
         }
-        
+
         if(DEBUG) {
             System.err.println("FBObject.resetSamplingSink: END\n\tTHIS "+this+",\n\tSINK "+samplingSink+
                                "\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
         }
     }
-    
+
     /**
      * Setting this FBO sampling sink.
      * @param newSamplingSink the new FBO sampling sink to use, or null to remove current sampling sink
-     * @return the previous sampling sink or null if none was attached 
+     * @return the previous sampling sink or null if none was attached
      * @throws GLException if this FBO doesn't use MSAA or the given sink uses MSAA itself
      */
     public FBObject setSamplingSink(FBObject newSamplingSink) throws GLException {
-        final FBObject prev = samplingSink; 
+        final FBObject prev = samplingSink;
         if( null == newSamplingSink) {
             samplingSink = null;
             samplingSinkTexture = null;
@@ -2056,14 +2056,14 @@ public class FBObject {
         samplingSinkDirty = true;
         return prev;
     }
-    
-    /** 
+
+    /**
      * Bind this FBO, i.e. bind write framebuffer to {@link #getWriteFramebuffer()}.
-     * 
-     * <p>If multisampling is used, it sets the read framebuffer to the sampling sink {@link #getWriteFramebuffer()}, 
+     *
+     * <p>If multisampling is used, it sets the read framebuffer to the sampling sink {@link #getWriteFramebuffer()},
      * if full FBO is supported.</p>
-     *  
-     * <p> 
+     *
+     * <p>
      * In case you have attached more than one color buffer,
      * you may want to setup {@link GL2GL3#glDrawBuffers(int, int[], int)}.
      * </p>
@@ -2079,7 +2079,7 @@ public class FBObject {
                 gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, getReadFramebuffer());
             } else {
                 // one for all
-                gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, getWriteFramebuffer());                
+                gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, getWriteFramebuffer());
             }
 
             bound = true;
@@ -2087,29 +2087,29 @@ public class FBObject {
         }
     }
 
-    /** 
+    /**
      * Unbind this FBO, i.e. bind read and write framebuffer to default, see {@link GLBase#getDefaultDrawFramebuffer()}.
-     * 
-     * <p>If full FBO is supported, sets the read and write framebuffer individually to default, hence not disturbing 
+     *
+     * <p>If full FBO is supported, sets the read and write framebuffer individually to default, hence not disturbing
      * an optional operating MSAA FBO, see {@link GLBase#getDefaultReadFramebuffer()} and {@link GLBase#getDefaultDrawFramebuffer()}</p>
-     *  
+     *
      * @param gl the current GL context
      * @throws GLException
      */
     public final void unbind(GL gl) throws GLException {
         if(bound) {
             if(fullFBOSupport) {
-                // default read/draw buffers, may utilize GLContext/GLDrawable override of 
+                // default read/draw buffers, may utilize GLContext/GLDrawable override of
                 // GLContext.getDefaultDrawFramebuffer() and GLContext.getDefaultReadFramebuffer()
                 gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, 0);
                 gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, 0);
             } else {
-                gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0); // default draw buffer                
+                gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0); // default draw buffer
             }
             bound = false;
         }
     }
-    
+
     /**
      * Method simply marks this FBO unbound w/o interfering w/ the bound framebuffer as perfomed by {@link #unbind(GL)}.
      * <p>
@@ -2121,22 +2121,22 @@ public class FBObject {
         bound = false;
     }
 
-    /** 
+    /**
      * Returns <code>true</code> if framebuffer object is bound via {@link #bind(GL)}, otherwise <code>false</code>.
      * <p>
      * Method verifies the bound state via {@link GL#getBoundFramebuffer(int)}.
      * </p>
      * @param gl the current GL context
      */
-    public final boolean isBound(GL gl) { 
+    public final boolean isBound(GL gl) {
         bound = bound &&  fbName != gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER) ;
         return bound;
     }
-    
+
     /** Returns <code>true</code> if framebuffer object is bound via {@link #bind(GL)}, otherwise <code>false</code>. */
     public final boolean isBound() { return bound; }
-    
-    /** 
+
+    /**
      * If multisampling is being used and flagged dirty by a previous call of {@link #bind(GL)} or after initialization,
      * the msaa-buffers are sampled to it's sink {@link #getSamplingSink()}.
      * <p>
@@ -2147,7 +2147,7 @@ public class FBObject {
      * </p>
      * <p>
      * Method always resets the framebuffer binding to default in the end.
-     * If full FBO is supported, sets the read and write framebuffer individually to default after sampling, hence not disturbing 
+     * If full FBO is supported, sets the read and write framebuffer individually to default after sampling, hence not disturbing
      * an optional operating MSAA FBO, see {@link GLBase#getDefaultReadFramebuffer()} and {@link GLBase#getDefaultDrawFramebuffer()}
      * </p>
      * <p>
@@ -2155,10 +2155,10 @@ public class FBObject {
      * you may want to call {@link GL#glBindFramebuffer(int, int) glBindFramebuffer}({@link GL2GL3#GL_READ_FRAMEBUFFER}, {@link #getReadFramebuffer()});
      * </p>
      * <p>Leaves the FBO unbound.</p>
-     * 
+     *
      * @param gl the current GL context
      * @param ta {@link TextureAttachment} to use, prev. attached w/  {@link #attachTexture2D(GL, int, boolean, int, int, int, int) attachTexture2D(..)}
-     * @throws IllegalArgumentException  
+     * @throws IllegalArgumentException
      */
     public final void syncSamplingSink(GL gl) {
         markUnbound();
@@ -2170,30 +2170,30 @@ public class FBObject {
             gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, samplingSink.getWriteFramebuffer());
             ((GL2GL3)gl).glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, // since MSAA is supported, casting to GL2GL3 is OK
                                            GL.GL_COLOR_BUFFER_BIT, GL.GL_NEAREST);
-            checkNoError(null, gl.glGetError(), "FBObject syncSampleSink"); // throws GLException if error            
+            checkNoError(null, gl.glGetError(), "FBObject syncSampleSink"); // throws GLException if error
         }
         if(fullFBOSupport) {
-            // default read/draw buffers, may utilize GLContext/GLDrawable override of 
+            // default read/draw buffers, may utilize GLContext/GLDrawable override of
             // GLContext.getDefaultDrawFramebuffer() and GLContext.getDefaultReadFramebuffer()
             gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, 0);
             gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, 0);
         } else {
-            gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0); // default draw buffer                
+            gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0); // default draw buffer
         }
     }
-    
-    /** 
+
+    /**
      * Bind the given texture colorbuffer.
-     * 
+     *
      * <p>If using multiple texture units, ensure you call {@link GL#glActiveTexture(int)} first!</p>
-     * 
+     *
      * <p>{@link #syncSamplingSink(GL)} is being called</p>
-     *  
+     *
      * <p>Leaves the FBO unbound!</p>
-     * 
+     *
      * @param gl the current GL context
      * @param ta {@link TextureAttachment} to use, prev. attached w/  {@link #attachTexture2D(GL, int, boolean, int, int, int, int) attachTexture2D(..)}
-     * @throws IllegalArgumentException  
+     * @throws IllegalArgumentException
      */
     public final void use(GL gl, TextureAttachment ta) throws IllegalArgumentException {
         if(null == ta) { throw new IllegalArgumentException("Null TextureAttachment, this: "+toString()); }
@@ -2201,26 +2201,26 @@ public class FBObject {
         gl.glBindTexture(GL.GL_TEXTURE_2D, ta.getName()); // use it ..
     }
 
-    /** 
+    /**
      * Unbind texture, ie bind 'non' texture 0
-     *  
+     *
      * <p>Leaves the FBO unbound.</p>
-     */    
+     */
     public final void unuse(GL gl) {
         unbind(gl);
         gl.glBindTexture(GL.GL_TEXTURE_2D, 0); // don't use it
     }
 
-    /** @see GL#hasFullFBOSupport() */    
+    /** @see GL#hasFullFBOSupport() */
     public final boolean hasFullFBOSupport() throws GLException { checkInitialized(); return this.fullFBOSupport; }
-    
-    /** 
+
+    /**
      * Returns <code>true</code> if renderbuffer accepts internal format {@link GL#GL_RGB8} and {@link GL#GL_RGBA8}, otherwise <code>false</code>.
      * @throws GLException if {@link #init(GL)} hasn't been called.
      */
     public final boolean supportsRGBA8() throws GLException { checkInitialized(); return rgba8Avail; }
-    
-    /** 
+
+    /**
      * Returns <code>true</code> if {@link GL#GL_DEPTH_COMPONENT16}, {@link GL#GL_DEPTH_COMPONENT24} or {@link GL#GL_DEPTH_COMPONENT32} is supported, otherwise <code>false</code>.
      * @param bits 16, 24 or 32 bits
      * @throws GLException if {@link #init(GL)} hasn't been called.
@@ -2228,14 +2228,14 @@ public class FBObject {
     public final boolean supportsDepth(int bits) throws GLException {
         checkInitialized();
         switch(bits) {
-            case 16: return true; 
+            case 16: return true;
             case 24: return depth24Avail;
             case 32: return depth32Avail;
-            default: return false;            
+            default: return false;
         }
     }
-    
-    /** 
+
+    /**
      * Returns <code>true</code> if {@link GL#GL_STENCIL_INDEX1}, {@link GL#GL_STENCIL_INDEX4}, {@link GL#GL_STENCIL_INDEX8} or {@link GL2GL3#GL_STENCIL_INDEX16} is supported, otherwise <code>false</code>.
      * @param bits 1, 4, 8 or 16 bits
      * @throws GLException if {@link #init(GL)} hasn't been called.
@@ -2243,34 +2243,34 @@ public class FBObject {
     public final boolean supportsStencil(int bits) throws GLException {
         checkInitialized();
         switch(bits) {
-            case  1: return stencil01Avail; 
+            case  1: return stencil01Avail;
             case  4: return stencil04Avail;
             case  8: return stencil08Avail;
             case 16: return stencil16Avail;
-            default: return false;            
+            default: return false;
         }
     }
-    
-    /** 
+
+    /**
      * Returns <code>true</code> if {@link GL#GL_DEPTH24_STENCIL8} is supported, otherwise <code>false</code>.
      * @throws GLException if {@link #init(GL)} hasn't been called.
      */
     public final boolean supportsPackedDepthStencil() throws GLException { checkInitialized(); return packedDepthStencilAvail; }
-    
+
     /**
      * Returns the maximum number of colorbuffer attachments.
      * @throws GLException if {@link #init(GL)} hasn't been called.
      */
     public final int getMaxColorAttachments() throws GLException { checkInitialized(); return maxColorAttachments; }
-    
+
     public final int getMaxTextureSize() throws GLException { checkInitialized(); return this.maxTextureSize; }
     public final int getMaxRenderbufferSize() throws GLException { checkInitialized(); return this.maxRenderbufferSize; }
-    
+
     /** @see GL#getMaxRenderbufferSamples() */
     public final int getMaxSamples() throws GLException { checkInitialized(); return this.maxSamples; }
-    
+
     /**
-     * Returns <code>true</code> if this instance has been initialized with {@link #reset(GL, int, int)} 
+     * Returns <code>true</code> if this instance has been initialized with {@link #reset(GL, int, int)}
      * or {@link #reset(GL, int, int, int, boolean)}, otherwise <code>false</code>
      */
     public final boolean isInitialized() { return initialized; }
@@ -2283,43 +2283,43 @@ public class FBObject {
     /** Returns the framebuffer name to render to. */
     public final int getWriteFramebuffer() { return fbName; }
     /** Returns the framebuffer name to read from. Depending on multisampling, this may be a different framebuffer. */
-    public final int getReadFramebuffer() { return ( samples > 0 ) ? samplingSink.getReadFramebuffer() : fbName; }    
-    public final int getDefaultReadBuffer() { return GL.GL_COLOR_ATTACHMENT0; }    
+    public final int getReadFramebuffer() { return ( samples > 0 ) ? samplingSink.getReadFramebuffer() : fbName; }
+    public final int getDefaultReadBuffer() { return GL.GL_COLOR_ATTACHMENT0; }
     /** Return the number of color/texture attachments */
     public final int getColorAttachmentCount() { return colorAttachmentCount; }
-    /** Return the stencil {@link RenderAttachment} attachment, if exist. Maybe share the same {@link Attachment#getName()} as {@link #getDepthAttachment()}, if packed depth-stencil is being used. */ 
+    /** Return the stencil {@link RenderAttachment} attachment, if exist. Maybe share the same {@link Attachment#getName()} as {@link #getDepthAttachment()}, if packed depth-stencil is being used. */
     public final RenderAttachment getStencilAttachment() { return stencil; }
-    /** Return the depth {@link RenderAttachment} attachment. Maybe share the same {@link Attachment#getName()} as {@link #getStencilAttachment()}, if packed depth-stencil is being used. */ 
+    /** Return the depth {@link RenderAttachment} attachment. Maybe share the same {@link Attachment#getName()} as {@link #getStencilAttachment()}, if packed depth-stencil is being used. */
     public final RenderAttachment getDepthAttachment() { return depth; }
-    
-    /** Return the complete multisampling {@link FBObject} sink, if using multisampling. */ 
+
+    /** Return the complete multisampling {@link FBObject} sink, if using multisampling. */
     public final FBObject getSamplingSinkFBO() { return samplingSink; }
-    
-    /** Return the multisampling {@link TextureAttachment} sink, if using multisampling. */ 
+
+    /** Return the multisampling {@link TextureAttachment} sink, if using multisampling. */
     public final TextureAttachment getSamplingSink() { return samplingSinkTexture; }
-    /** 
-     * Returns <code>true</code> if the multisampling colorbuffer (msaa-buffer) 
+    /**
+     * Returns <code>true</code> if the multisampling colorbuffer (msaa-buffer)
      * has been flagged dirty by a previous call of {@link #bind(GL)},
      * otherwise <code>false</code>.
      */
     public final boolean isSamplingBufferDirty() { return samplingSinkDirty; }
-    
+
     int objectHashCode() { return super.hashCode(); }
-    
+
     public final String toString() {
-        final String caps = null != colorAttachmentPoints ? Arrays.asList(colorAttachmentPoints).toString() : null ; 
+        final String caps = null != colorAttachmentPoints ? Arrays.asList(colorAttachmentPoints).toString() : null ;
         return "FBO[name r/w "+fbName+"/"+getReadFramebuffer()+", init "+initialized+", bound "+bound+", size "+width+"x"+height+
                ", samples "+samples+"/"+maxSamples+", depth "+depth+", stencil "+stencil+
                ", color attachments: "+colorAttachmentCount+"/"+maxColorAttachments+
                ": "+caps+", msaa-sink "+samplingSinkTexture+", hasSamplesSink "+(null != samplingSink)+
                ", state "+getStatusString()+", obj "+toHexString(objectHashCode())+"]";
     }
-    
+
     private final void updateStatus(GL gl) {
         if( 0 == fbName ) {
             vStatus = -1;
         } else {
             vStatus = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
         }
-    }       
+    }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java b/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
index bec05a0bd..ce58d29c1 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl;
 
 import javax.media.nativewindow.AbstractGraphicsDevice;
@@ -58,14 +58,14 @@ import jogamp.opengl.GLDrawableImpl;
  * </ul>
  * and setup a {@link com.jogamp.newt.Window#setWindowDestroyNotifyAction(Runnable) custom toolkit destruction} issuing {@link #windowDestroyNotifyOp()}.
  * </p>
- * <p> 
+ * <p>
  * See example {@link com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateNEWT TestGLAutoDrawableDelegateNEWT}.
  * </p>
  */
 public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAutoDrawable {
     /**
      * @param drawable a valid {@link GLDrawable}, may not be {@link GLDrawable#isRealized() realized} yet.
-     * @param context a valid {@link GLContext}, 
+     * @param context a valid {@link GLContext},
      *                may not have been made current (created) yet,
      *                may not be associated w/ <code>drawable<code> yet,
      *                may be <code>null</code> for lazy initialization
@@ -84,7 +84,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
         this.upstreamWidget = upstreamWidget;
         this.lock = ( null != lock ) ? lock : LockFactory.createRecursiveLock() ;
     }
-    
+
     //
     // expose default methods
     //
@@ -93,40 +93,40 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
     public final void windowRepaintOp() {
         super.defaultWindowRepaintOp();
     }
-    
+
     /** Implementation to handle resize events from the windowing system. All required locks are being claimed. */
     public final void windowResizedOp(int newWidth, int newHeight) {
         super.defaultWindowResizedOp(newWidth, newHeight);
     }
-    
-    /** 
+
+    /**
      * Implementation to handle destroy notifications from the windowing system.
-     * 
+     *
      * <p>
-     * If the {@link NativeSurface} does not implement {@link WindowClosingProtocol} 
+     * If the {@link NativeSurface} does not implement {@link WindowClosingProtocol}
      * or {@link WindowClosingMode#DISPOSE_ON_CLOSE} is enabled (default),
      * a thread safe destruction is being induced.
-     * </p> 
+     * </p>
      */
     public final void windowDestroyNotifyOp() {
         super.defaultWindowDestroyNotifyOp();
     }
-    
+
     //
     // Complete GLAutoDrawable
     //
-    
+
     private Object upstreamWidget;
     private final RecursiveLock lock;
-    
+
     @Override
     protected final RecursiveLock getLock() { return lock; }
-    
+
     @Override
     public final Object getUpstreamWidget() {
         return upstreamWidget;
     }
-    
+
     /**
      * Set the upstream UI toolkit object.
      * @see #getUpstreamWidget()
@@ -134,7 +134,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
     public final void setUpstreamWidget(Object newUpstreamWidget) {
         upstreamWidget = newUpstreamWidget;
     }
-    
+
     /**
      * {@inheritDoc}
      * <p>
@@ -142,7 +142,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
      * </p>
      * <p>
      * User still needs to destroy the upstream window, which details are hidden from this aspect.
-     * This can be performed by overriding {@link #destroyImplInLock()}. 
+     * This can be performed by overriding {@link #destroyImplInLock()}.
      * </p>
      */
     @Override
@@ -154,29 +154,29 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
     protected void destroyImplInLock() {
         super.destroyImplInLock();
     }
-    
+
     @Override
-    public void display() {        
+    public void display() {
         defaultDisplay();
     }
-    
+
     //
     // GLDrawable delegation
     //
-    
+
     @Override
     public final GLDrawableFactory getFactory() {
         return drawable.getFactory();
     }
-    
+
     @Override
     public final void swapBuffers() throws GLException {
          defaultSwapBuffers();
     }
-     
+
     @Override
     public String toString() {
         return getClass().getSimpleName()+"[ \n\tHelper: " + helper + ", \n\tDrawable: " + drawable +
                ", \n\tContext: " + context + ", \n\tUpstreamWidget: "+upstreamWidget+ /** ", \n\tFactory: "+factory+ */ "]";
-    }    
+    }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java b/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
index 21dafecb1..1b4187668 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -48,7 +48,7 @@ import jogamp.opengl.Debug;
 import com.jogamp.nativewindow.MutableGraphicsConfiguration;
 
 /**
- * GLEventListenerState is holding {@link GLAutoDrawable} components crucial 
+ * GLEventListenerState is holding {@link GLAutoDrawable} components crucial
  * to relocating all its {@link GLEventListener} w/ their operating {@link GLContext}, etc.
  * The components are:
  * <ul>
@@ -69,8 +69,8 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
  */
 public class GLEventListenerState {
     private static final boolean DEBUG = Debug.debug("GLDrawable") || Debug.debug("GLEventListenerState");
-    
-    private GLEventListenerState(AbstractGraphicsDevice upstreamDevice, boolean proxyOwnsUpstreamDevice, AbstractGraphicsDevice device, 
+
+    private GLEventListenerState(AbstractGraphicsDevice upstreamDevice, boolean proxyOwnsUpstreamDevice, AbstractGraphicsDevice device,
                                  GLCapabilitiesImmutable caps,
                                  GLContext context, int count, GLAnimatorControl anim, boolean animStarted) {
         this.upstreamDevice = upstreamDevice;
@@ -82,19 +82,19 @@ public class GLEventListenerState {
         this.listenersInit = new boolean[count];
         this.anim = anim;
         this.animStarted = animStarted;
-        
+
         this.owner = true;
     }
     /**
-     * Returns <code>true</code>, if this instance is the current owner of the components, 
+     * Returns <code>true</code>, if this instance is the current owner of the components,
      * otherwise <code>false</code>.
      * <p>
      * Ownership is lost if {@link #moveTo(GLAutoDrawable)} is being called successfully
-     * and all components are transferred to the new {@link GLAutoDrawable}. 
+     * and all components are transferred to the new {@link GLAutoDrawable}.
      * </p>
      */
     public final boolean isOwner() { return owner; }
-    
+
     public final int listenerCount() { return listeners.length; }
 
     public final AbstractGraphicsDevice upstreamDevice;
@@ -103,10 +103,10 @@ public class GLEventListenerState {
     public final GLCapabilitiesImmutable caps;
     public final GLContext context;
     public final GLEventListener[] listeners;
-    public final boolean[] listenersInit;    
+    public final boolean[] listenersInit;
     public final GLAnimatorControl anim;
     public final boolean animStarted;
-    
+
     private boolean owner;
 
     /**
@@ -127,25 +127,25 @@ public class GLEventListenerState {
     private static AbstractGraphicsDevice cloneDevice(AbstractGraphicsDevice aDevice) {
         return (AbstractGraphicsDevice) aDevice.clone();
     }
-    
+
     /**
-     * Moves all GLEventListenerState components from the given {@link GLAutoDrawable} 
+     * Moves all GLEventListenerState components from the given {@link GLAutoDrawable}
      * to a newly created instance.
      * <p>
      * Note that all components are removed from the {@link GLAutoDrawable},
      * i.e. the {@link GLContext}, all {@link GLEventListener}.
      * </p>
-     * <p> 
+     * <p>
      * If the {@link GLAutoDrawable} was added to a {@link GLAnimatorControl}, it is removed
      * and the {@link GLAnimatorControl} added to the GLEventListenerState.
      * </p>
      * <p>
-     * The returned GLEventListenerState instance is the {@link #isOwner() owner of the components}. 
+     * The returned GLEventListenerState instance is the {@link #isOwner() owner of the components}.
      * </p>
-     * 
+     *
      * @param a {@link GLAutoDrawable} source to move components from
      * @return new GLEventListenerState instance {@link #isOwner() owning} moved components.
-     * 
+     *
      * @see #moveTo(GLAutoDrawable)
      */
     public static GLEventListenerState moveFrom(GLAutoDrawable a) {
@@ -154,16 +154,16 @@ public class GLEventListenerState {
         if( null != aAnim ) {
             aAnimStarted = aAnim.isStarted();
             aAnim.remove(a); // also handles ECT
-        } else {        
+        } else {
             aAnimStarted = false;
         }
-        
+
         final GLEventListenerState glls;
         final NativeSurface aSurface = a.getNativeSurface();
         final boolean surfaceLocked = false; // NativeSurface.LOCK_SURFACE_NOT_READY < aSurface.lockSurface();
         try {
             final int aSz = a.getGLEventListenerCount();
-    
+
             // Create new AbstractGraphicsScreen w/ cloned AbstractGraphicsDevice for future GLAutoDrawable
             // allowing this AbstractGraphicsDevice to loose ownership -> not closing display/device!
             final AbstractGraphicsConfiguration aCfg = aSurface.getGraphicsConfiguration();
@@ -171,7 +171,7 @@ public class GLEventListenerState {
             final AbstractGraphicsDevice aDevice1 = aCfg.getScreen().getDevice();
             final AbstractGraphicsDevice aDevice2 = cloneDevice(aDevice1);
             aDevice1.clearHandleOwner();  // don't close device handle
-            if( DEBUG ) {            
+            if( DEBUG ) {
                 System.err.println("GLEventListenerState.moveFrom.0a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
                 System.err.println("GLEventListenerState.moveFrom.0b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
                 System.err.println("GLEventListenerState.moveFrom.1: "+aSurface.getClass().getName()/*+", "+aSurface*/);
@@ -203,9 +203,9 @@ public class GLEventListenerState {
                 }
                 aUpDevice2 = _aUpDevice2;
             }
-            
-            glls = new GLEventListenerState(aUpDevice2, proxyOwnsUpstreamDevice, aDevice2, caps, a.getContext(), aSz, aAnim, aAnimStarted); 
-    
+
+            glls = new GLEventListenerState(aUpDevice2, proxyOwnsUpstreamDevice, aDevice2, caps, a.getContext(), aSz, aAnim, aAnimStarted);
+
             //
             // remove and cache all GLEventListener and their init-state
             //
@@ -213,41 +213,41 @@ public class GLEventListenerState {
                 final GLEventListener l = a.getGLEventListener(0);
                 glls.listenersInit[i] = a.getGLEventListenerInitState(l);
                 glls.listeners[i] = a.removeGLEventListener( l );
-            }    
-    
+            }
+
             //
             // trigger glFinish to sync GL ctx
             //
             a.invoke(true, glFinish);
-    
+
             a.setContext( null, false );
-            
+
         } finally {
             if( surfaceLocked ) {
                 aSurface.unlockSurface();
             }
-        }        
-        
+        }
+
         return glls;
     }
 
     /**
-     * Moves all GLEventListenerState components to the given {@link GLAutoDrawable} 
+     * Moves all GLEventListenerState components to the given {@link GLAutoDrawable}
      * from this instance, while loosing {@link #isOwner() ownership}.
-     * <p> 
+     * <p>
      * If the previous {@link GLAutoDrawable} was removed from a {@link GLAnimatorControl} by previous {@link #moveFrom(GLAutoDrawable)},
      * the given {@link GLAutoDrawable} is added to the cached {@link GLAnimatorControl}.
-     * This operation is skipped, if the given {@link GLAutoDrawable} is already added to a {@link GLAnimatorControl} instance.  
+     * This operation is skipped, if the given {@link GLAutoDrawable} is already added to a {@link GLAnimatorControl} instance.
      * </p>
      * <p>
-     * Note: After this operation, the GLEventListenerState reference should be released. 
+     * Note: After this operation, the GLEventListenerState reference should be released.
      * </p>
-     * 
+     *
      * @param a {@link GLAutoDrawable} destination to move GLEventListenerState components to
-     * 
+     *
      * <!-- @throws GLException if the {@link GLAutoDrawable}'s configuration is incompatible, i.e. different {@link GLCapabilitiesImmutable}. -->
      * @throws GLException if this preserved {@link AbstractGraphicsDevice} is incompatible w/ the given destination one.
-     * 
+     *
      * @see #moveFrom(GLAutoDrawable)
      * @see #isOwner()
      */
@@ -261,22 +261,22 @@ public class GLEventListenerState {
             if( aPaused ) {
                 aAnim.resume();
             }
-        } else {        
+        } else {
             aPaused = false;
         }
-        
+
         final List<GLRunnable> aGLCmds = new ArrayList<GLRunnable>();
         final int aSz = listenerCount();
-        
+
         final NativeSurface aSurface = a.getNativeSurface();
         final boolean surfaceLocked = false; // NativeSurface.LOCK_SURFACE_NOT_READY < aSurface.lockSurface();
         final boolean aRealized;
         try {
-            
+
             final MutableGraphicsConfiguration aCfg = (MutableGraphicsConfiguration) aSurface.getGraphicsConfiguration();
             /**
             final GLCapabilitiesImmutable aCaps = (GLCapabilitiesImmutable) aCfg.getChosenCapabilities();
-            if( caps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) != aCaps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) || 
+            if( caps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) != aCaps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) ||
                 caps.getVisualID(VisualIDHolder.VIDType.NATIVE) != aCaps.getVisualID(VisualIDHolder.VIDType.NATIVE) ) {
                 throw new GLException("Incompatible Capabilities - Prev-Holder: "+caps+", New-Holder "+caps);
             } */
@@ -285,8 +285,8 @@ public class GLEventListenerState {
             if( !aDevice1.getUniqueID().equals( aDevice2.getUniqueID() ) ) {
                 throw new GLException("Incompatible devices: Preserved <"+aDevice2.getUniqueID()+">, target <"+aDevice1.getUniqueID()+">");
             }
-            
-            // collect optional upstream surface info 
+
+            // collect optional upstream surface info
             final ProxySurface aProxy;
             final NativeSurface aUpSurface;
             if(aSurface instanceof ProxySurface) {
@@ -302,8 +302,8 @@ public class GLEventListenerState {
             }
             if( null==aUpSurface && null != upstreamDevice ) {
                 throw new GLException("Incompatible Surface config - Has Upstream-Surface: Prev-Holder = true, New-Holder = false");
-            }            
-            
+            }
+
             // Destroy and remove currently associated GLContext, if any (will be replaced)
             a.setContext( null, true );
             aRealized = a.isRealized();
@@ -311,7 +311,7 @@ public class GLEventListenerState {
                 // Unrealize due to device dependencies of an upstream surface, e.g. EGLUpstreamSurfaceHook
                 a.getDelegatedDrawable().setRealized(false);
             }
-            
+
             // Set new Screen and close previous one
             {
                 if( DEBUG ) {
@@ -319,13 +319,13 @@ public class GLEventListenerState {
                     System.err.println("GLEventListenerState.moveTo.0b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
                 }
                 DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aDevice1, aDevice2);
-                aDevice2.close();                
+                aDevice2.close();
                 if( DEBUG ) {
                     System.err.println("GLEventListenerState.moveTo.1a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
                     System.err.println("GLEventListenerState.moveTo.1b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
                 }
             }
-            
+
             // If using a ProxySurface w/ an upstream surface, set new Screen and close previous one on it
             if( null != aUpSurface ) {
                 final MutableGraphicsConfiguration aUpCfg = (MutableGraphicsConfiguration) aUpSurface.getGraphicsConfiguration();
@@ -339,9 +339,9 @@ public class GLEventListenerState {
                         System.err.println("GLEventListenerState.moveTo.2a: up-orig 0x"+Integer.toHexString(aUpDevice1.hashCode())+", "+aUpDevice1);
                         System.err.println("GLEventListenerState.moveTo.2b: up-pres 0x"+Integer.toHexString(aUpDevice2.hashCode())+", "+aUpDevice2);
                         System.err.println("GLEventListenerState.moveTo.2c:  "+aUpSurface.getClass().getName()/*+", "+aUpSurface+", "*/+aProxy.getUpstreamOptionBits(null).toString());
-                    }                            
+                    }
                     DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aUpDevice1, aUpDevice2);
-                    aUpDevice2.close();                            
+                    aUpDevice2.close();
                     if( proxyOwnsUpstreamDevice ) {
                         aProxy.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
                     }
@@ -354,7 +354,7 @@ public class GLEventListenerState {
                     throw new GLException("Incompatible Surface config - Has Upstream-Surface: Prev-Holder = false, New-Holder = true");
                 }
             }
-            
+
             if( aRealized && null != aUpSurface ) {
                 a.getDelegatedDrawable().setRealized(true);
             }
@@ -369,7 +369,7 @@ public class GLEventListenerState {
             }
         }
         owner = false;
-        
+
         //
         // Trigger GL-Viewport reset and reshape of all initialized GLEventListeners
         //
@@ -389,7 +389,7 @@ public class GLEventListenerState {
             a.setGLEventListenerInitState(l, listenersInit[i]);
             listeners[i] = null;
         }
-        
+
         if( hasAnimator ) {
             // prefer already bound animator
             aAnim.add(a);
@@ -410,7 +410,7 @@ public class GLEventListenerState {
         public boolean run(GLAutoDrawable drawable) {
             drawable.getGL().glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
             return true;
-        }            
+        }
     };
 
     public static GLRunnable glFinish = new GLRunnable() {
@@ -418,7 +418,7 @@ public class GLEventListenerState {
         public boolean run(GLAutoDrawable drawable) {
             drawable.getGL().glFinish();
             return true;
-        }            
+        }
     };
 
     public static class ReshapeGLEventListener implements GLRunnable {
@@ -430,6 +430,6 @@ public class GLEventListenerState {
         public boolean run(GLAutoDrawable drawable) {
             listener.reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
             return true;
-        }      
+        }
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
index 14f4be96a..c7aadcd14 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
@@ -28,17 +28,17 @@
 package com.jogamp.opengl;
 
 /**
- * Class holding OpenGL extension strings, commonly used by JOGL's implementation. 
+ * Class holding OpenGL extension strings, commonly used by JOGL's implementation.
  */
 public class GLExtensions {
   public static final String VERSION_1_2                     = "GL_VERSION_1_2";
   public static final String VERSION_1_4                     = "GL_VERSION_1_4";
   public static final String VERSION_1_5                     = "GL_VERSION_1_5";
   public static final String VERSION_2_0                     = "GL_VERSION_2_0";
-  
+
   public static final String ARB_debug_output                = "GL_ARB_debug_output";
   public static final String AMD_debug_output                = "GL_AMD_debug_output";
-    
+
   public static final String ARB_framebuffer_object          = "GL_ARB_framebuffer_object";
   public static final String OES_framebuffer_object          = "GL_OES_framebuffer_object";
   public static final String EXT_framebuffer_object          = "GL_EXT_framebuffer_object";
@@ -49,17 +49,17 @@ public class GLExtensions {
   public static final String OES_depth32                     = "GL_OES_depth32";
   public static final String OES_packed_depth_stencil        = "GL_OES_packed_depth_stencil";
   public static final String NV_fbo_color_attachments        = "GL_NV_fbo_color_attachments";
-  
+
   public static final String ARB_ES2_compatibility           = "GL_ARB_ES2_compatibility";
   public static final String ARB_ES3_compatibility           = "GL_ARB_ES3_compatibility";
-  
+
   public static final String EXT_abgr                        = "GL_EXT_abgr";
   public static final String OES_rgb8_rgba8                  = "GL_OES_rgb8_rgba8";
   public static final String OES_stencil1                    = "GL_OES_stencil1";
   public static final String OES_stencil4                    = "GL_OES_stencil4";
   public static final String OES_stencil8                    = "GL_OES_stencil8";
   public static final String APPLE_float_pixels              = "GL_APPLE_float_pixels";
-  
+
   public static final String ARB_texture_non_power_of_two    = "GL_ARB_texture_non_power_of_two";
   public static final String ARB_texture_rectangle           = "GL_ARB_texture_rectangle";
   public static final String EXT_texture_rectangle           = "GL_EXT_texture_rectangle";
@@ -72,15 +72,15 @@ public class GLExtensions {
   public static final String OES_read_format                 = "GL_OES_read_format";
   public static final String OES_single_precision            = "GL_OES_single_precision";
   public static final String OES_EGL_image_external          = "GL_OES_EGL_image_external";
-  
+
   public static final String ARB_gpu_shader_fp64             = "GL_ARB_gpu_shader_fp64";
-  public static final String ARB_shader_objects              = "GL_ARB_shader_objects"; 
+  public static final String ARB_shader_objects              = "GL_ARB_shader_objects";
   public static final String ARB_geometry_shader4            = "GL_ARB_geometry_shader4";
-  
+
   //
   // Aliased GLX/WGL/.. extensions
   //
-  
-  public static final String ARB_pixel_format                = "GL_ARB_pixel_format"; 
+
+  public static final String ARB_pixel_format                = "GL_ARB_pixel_format";
   public static final String ARB_pbuffer                     = "GL_ARB_pbuffer";
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
index 6ef1e0805..ee77f8d2d 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
@@ -29,20 +29,20 @@ package com.jogamp.opengl;
 
 import java.util.List;
 
-/** 
- * GLRendererQuirks contains information of known bugs of various GL renderer. 
+/**
+ * GLRendererQuirks contains information of known bugs of various GL renderer.
  * This information allows us to workaround them.
  * <p>
  * Using centralized quirk identifier enables us to
- * locate code dealing w/ it and hence eases it's maintenance.   
+ * locate code dealing w/ it and hence eases it's maintenance.
  * </p>
  * <p>
  * <i>Some</i> <code>GL_VENDOR</code> and <code>GL_RENDERER</code> strings are
- * listed here <http://feedback.wildfiregames.com/report/opengl/feature/GL_VENDOR>. 
+ * listed here <http://feedback.wildfiregames.com/report/opengl/feature/GL_VENDOR>.
  * </p>
  */
 public class GLRendererQuirks {
-    /** 
+    /**
      * Crashes XServer when using double buffered PBuffer with GL_RENDERER:
      * <ul>
      *  <li>Mesa DRI Intel(R) Sandybridge Desktop</li>
@@ -52,23 +52,23 @@ public class GLRendererQuirks {
      * For now, it is safe to disable it w/ hw-acceleration.
      */
     public static final int NoDoubleBufferedPBuffer = 0;
-    
+
     /** On Windows no double buffered bitmaps are guaranteed to be available. */
     public static final int NoDoubleBufferedBitmap  = 1;
 
     /** Crashes application when trying to set EGL swap interval on Android 4.0.3 / Pandaboard ES / PowerVR SGX 540 */
     public static final int NoSetSwapInterval       = 2;
-    
+
     /** No offscreen bitmap available, currently true for JOGL's OSX implementation. */
     public static final int NoOffscreenBitmap       = 3;
-    
+
     /** SIGSEGV on setSwapInterval() after changing the context's drawable w/ 'Mesa 8.0.4' dri2SetSwapInterval/DRI2 (soft & intel) */
     public static final int NoSetSwapIntervalPostRetarget = 4;
 
     /** GLSL <code>discard</code> command leads to undefined behavior or won't get compiled if being used. Appears to <i>have</i> happened on Nvidia Tegra2, but seems to be fine now. FIXME: Constrain version. */
     public static final int GLSLBuggyDiscard = 5;
-    
-    /** 
+
+    /**
      * Non compliant GL context due to a buggy implementation not suitable for use.
      * <p>
      * Currently, Mesa >= 9.1.3 (may extend back as far as 9.0) OpenGL 3.1 compatibility
@@ -82,19 +82,19 @@ public class GLRendererQuirks {
      * </ul>
      * </p>
      * <p>
-     * It still has to be verified whether the AMD OpenGL 3.1 core driver is compliant enought. 
+     * It still has to be verified whether the AMD OpenGL 3.1 core driver is compliant enought.
      */
     public static final int GLNonCompliant = 6;
-    
+
     /**
      * The OpenGL Context needs a <code>glFlush()</code> before releasing it, otherwise driver may freeze:
      * <ul>
      *   <li>OSX < 10.7.3 - NVidia Driver. Bug 533 and Bug 548 @ https://jogamp.org/bugzilla/.</li>
-     * </ul>  
+     * </ul>
      */
     public static final int GLFlushBeforeRelease = 7;
-    
-    /** 
+
+    /**
      * Closing X11 displays may cause JVM crashes or X11 errors with some buggy drivers
      * while being used in concert w/ OpenGL.
      * <p>
@@ -123,14 +123,14 @@ public class GLRendererQuirks {
      * </p>
      */
     public static final int DontCloseX11Display = 8;
-    
+
     /**
-     * Need current GL Context when calling new ARB <i>pixel format query</i> functions, 
+     * Need current GL Context when calling new ARB <i>pixel format query</i> functions,
      * otherwise driver crashes the VM.
      * <p>
      * Drivers known exposing such bug:
      * <ul>
-     *   <li>ATI proprietary Catalyst driver on Windows version &le; XP. 
+     *   <li>ATI proprietary Catalyst driver on Windows version &le; XP.
      *       TODO: Validate if bug actually relates to 'old' ATI Windows drivers for old GPU's like X300
      *             regardless of the Windows version.</li>
      * </ul>
@@ -139,7 +139,7 @@ public class GLRendererQuirks {
      * </p>
      */
     public static final int NeedCurrCtx4ARBPixFmtQueries = 9;
-    
+
     /**
      * Need current GL Context when calling new ARB <i>CreateContext</i> function,
      * otherwise driver crashes the VM.
@@ -159,14 +159,14 @@ public class GLRendererQuirks {
      * </p>
      */
     public static final int NeedCurrCtx4ARBCreateContext = 10;
-    
+
     /**
      * No full FBO support, i.e. not compliant w/
-     * <ul> 
+     * <ul>
      *   <li>GL_ARB_framebuffer_object</li>
-     *   <li>EXT_framebuffer_object</li> 
-     *   <li>EXT_framebuffer_multisample</li> 
-     *   <li>EXT_framebuffer_blit</li> 
+     *   <li>EXT_framebuffer_object</li>
+     *   <li>EXT_framebuffer_multisample</li>
+     *   <li>EXT_framebuffer_blit</li>
      *   <li>EXT_packed_depth_stencil</li>
      * </ul>.
      * Drivers known exposing such bug:
@@ -180,18 +180,18 @@ public class GLRendererQuirks {
      * Quirk can also be enabled via property: <code>jogl.fbo.force.min</code>.
      */
     public static final int NoFullFBOSupport = 11;
-    
+
     /**
      * GLSL is not compliant or even not stable (crash)
      * <ul>
      *   <li>OSX < 10.7.0 (?) - NVidia Driver. Bug 818 @ https://jogamp.org/bugzilla/.</li>
-     * </ul>  
+     * </ul>
      */
     public static final int GLSLNonCompliant = 12;
-        
+
     /** Number of quirks known. */
     public static final int COUNT = 13;
-    
+
     private static final String[] _names = new String[] { "NoDoubleBufferedPBuffer", "NoDoubleBufferedBitmap", "NoSetSwapInterval",
                                                           "NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget", "GLSLBuggyDiscard",
                                                           "GLNonCompliant", "GLFlushBeforeRelease", "DontCloseX11Display",
@@ -218,7 +218,7 @@ public class GLRendererQuirks {
             bitmask |= 1 << quirk;
         }
         _bitmask = bitmask;
-    }      
+    }
 
     /**
      * @param quirks a list of valid quirks
@@ -233,7 +233,7 @@ public class GLRendererQuirks {
         }
         _bitmask = bitmask;
     }
-    
+
     /**
      * @param quirk the quirk to be tested
      * @return true if quirk exist, otherwise false
@@ -261,7 +261,7 @@ public class GLRendererQuirks {
         sb.append("]");
         return sb;
     }
-    
+
     public final String toString() {
         return toString(null).toString();
     }
@@ -273,7 +273,7 @@ public class GLRendererQuirks {
     public static void validateQuirk(int quirk) throws IllegalArgumentException {
         if( !( 0 <= quirk && quirk < COUNT ) ) {
             throw new IllegalArgumentException("Quirks must be in range [0.."+COUNT+"[, but quirk: "+quirk);
-        }        
+        }
     }
 
     /**
diff --git a/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java b/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java
index 321d4ee57..b98c4431d 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -31,12 +31,12 @@ package com.jogamp.opengl;
  * Interface adding a {@link GLEventListenerState} protocol to {@link GLAutoDrawable}s
  * or other self-contained compound types combining {@link GLDrawable}, {@link GLContext} and {@link GLEventListener}.
  * <p>
- * Implementing classes {@link #isGLStatePreservationSupported() may support} preservation 
- * of the {@link GLContext} state and it's associated {@link GLEventListener}. 
- * </p> 
+ * Implementing classes {@link #isGLStatePreservationSupported() may support} preservation
+ * of the {@link GLContext} state and it's associated {@link GLEventListener}.
+ * </p>
  */
 public interface GLStateKeeper {
-    
+
     /** Listener for preserve and restore notifications. */
     public static interface Listener {
         /** Invoked before preservation. */
@@ -44,14 +44,14 @@ public interface GLStateKeeper {
         /** Invoked after restoration. */
         void glStateRestored(GLStateKeeper glsk);
     }
-    
-    /** 
+
+    /**
      * Sets a {@link Listener}, overriding the old one.
      * @param l the new {@link Listener}.
      * @return the previous {@link Listener}.
      */
     public Listener setGLStateKeeperListener(Listener l);
-    
+
     /**
      * @return <code>true</code> if GL state preservation is supported in implementation and on current platform, <code>false</code> otherwise.
      * @see #preserveGLStateAtDestroy(boolean)
@@ -59,7 +59,7 @@ public interface GLStateKeeper {
      * @see #clearPreservedGLState()
      */
     public boolean isGLStatePreservationSupported();
-    
+
     /**
      * If set to <code>true</code>, the next {@link GLAutoDrawable#destroy()} operation will
      * {@link #pullGLEventListenerState() pull} to preserve the {@link GLEventListenerState}.
@@ -68,8 +68,8 @@ public interface GLStateKeeper {
      * the flag is cleared.
      * </p>
      * <p>
-     * A preserved {@link GLEventListenerState} will be {@link #pushGLEventListenerState() pushed} 
-     * if realized again. 
+     * A preserved {@link GLEventListenerState} will be {@link #pushGLEventListenerState() pushed}
+     * if realized again.
      * </p>
      * @return <code>true</code> if supported and successful, <code>false</code> otherwise.
      * @see #isGLStatePreservationSupported()
@@ -77,21 +77,21 @@ public interface GLStateKeeper {
      * @see #clearPreservedGLState()
      */
     public boolean preserveGLStateAtDestroy(boolean value);
-    
+
     /**
      * Returns the preserved {@link GLEventListenerState} if preservation was performed,
-     * otherwise <code>null</code>. 
+     * otherwise <code>null</code>.
      * @see #isGLStatePreservationSupported()
      * @see #preserveGLStateAtDestroy(boolean)
      * @see #clearPreservedGLState()
      */
     public GLEventListenerState getPreservedGLState();
-    
+
     /**
      * Clears the preserved {@link GLEventListenerState} from this {@link GLStateKeeper}, without destroying it.
-     *  
+     *
      * @return the preserved and cleared {@link GLEventListenerState} if preservation was performed,
-     *         otherwise <code>null</code>. 
+     *         otherwise <code>null</code>.
      * @see #isGLStatePreservationSupported()
      * @see #preserveGLStateAtDestroy(boolean)
      * @see #getPreservedGLState()
diff --git a/src/jogl/classes/com/jogamp/opengl/GenericGLCapabilitiesChooser.java b/src/jogl/classes/com/jogamp/opengl/GenericGLCapabilitiesChooser.java
index 73ec10886..3693f647a 100644
--- a/src/jogl/classes/com/jogamp/opengl/GenericGLCapabilitiesChooser.java
+++ b/src/jogl/classes/com/jogamp/opengl/GenericGLCapabilitiesChooser.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -37,7 +37,7 @@ import javax.media.opengl.DefaultGLCapabilitiesChooser;
  * otherwise uses {@link DefaultGLCapabilitiesChooser} implementation.
  */
 public class GenericGLCapabilitiesChooser extends DefaultGLCapabilitiesChooser {
-    
+
   @Override
   public int chooseCapabilities(final CapabilitiesImmutable desired,
                                 final List<? extends CapabilitiesImmutable> available,
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
index 1f0189aa3..1f715c21a 100644
--- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
+++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl;
 
 import com.jogamp.common.GlueGenVersion;
@@ -90,16 +90,16 @@ public class JoglVersion extends JogampVersion {
             sb.append("\tnone").append(Platform.getNewline());
         }
         sb.append(Platform.getNewline());
-        return sb;        
+        return sb;
     }
-    
+
     public static StringBuilder getAllAvailableCapabilitiesInfo(AbstractGraphicsDevice device, StringBuilder sb) {
         if(null==sb) {
             sb = new StringBuilder();
         }
         if(null == device) {
             device = GLProfile.getDefaultDevice();
-        }        
+        }
         sb.append(Platform.getNewline()).append(Platform.getNewline());
         sb.append("Desktop Capabilities: ").append(Platform.getNewline());
         getAvailableCapabilitiesInfo(GLDrawableFactory.getDesktopFactory(), device, sb);
@@ -107,7 +107,7 @@ public class JoglVersion extends JogampVersion {
         getAvailableCapabilitiesInfo(GLDrawableFactory.getEGLFactory(), device, sb);
         return sb;
     }
-    
+
     public static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, boolean withCapabilitiesInfo) {
         if(null==sb) {
             sb = new StringBuilder();
@@ -126,7 +126,7 @@ public class JoglVersion extends JogampVersion {
         }
         return sb;
     }
-    
+
     public static StringBuilder getGLInfo(GL gl, StringBuilder sb) {
         return getGLInfo(gl, sb, false);
     }
@@ -136,26 +136,26 @@ public class JoglVersion extends JogampVersion {
         if(null==sb) {
             sb = new StringBuilder();
         }
-        
+
         sb.append(VersionUtil.SEPERATOR).append(Platform.getNewline());
         sb.append(device.getClass().getSimpleName()).append("[type ")
                 .append(device.getType()).append(", connection ").append(device.getConnection()).append("]: ").append(Platform.getNewline());
-        GLProfile.glAvailabilityToString(device, sb, "\t", 1);        
+        GLProfile.glAvailabilityToString(device, sb, "\t", 1);
         sb.append(Platform.getNewline());
 
         sb = getGLStrings(gl, sb, withCapabilitiesAndExtensionInfo);
-        
+
         if( withCapabilitiesAndExtensionInfo ) {
-            sb = getAllAvailableCapabilitiesInfo(device, sb);            
+            sb = getAllAvailableCapabilitiesInfo(device, sb);
         }
         return sb;
     }
-    
+
     public static StringBuilder getGLStrings(GL gl, StringBuilder sb) {
         return getGLStrings(gl, sb, true);
     }
-    
-    public static StringBuilder getGLStrings(GL gl, StringBuilder sb, boolean withExtensions) {        
+
+    public static StringBuilder getGLStrings(GL gl, StringBuilder sb, boolean withExtensions) {
         if(null==sb) {
             sb = new StringBuilder();
         }
@@ -175,7 +175,7 @@ public class JoglVersion extends JogampVersion {
         sb.append("GL_RENDERER    ").append(gl.glGetString(GL.GL_RENDERER));
         sb.append(Platform.getNewline());
         sb.append("GL_VERSION     ").append(gl.glGetString(GL.GL_VERSION));
-        sb.append(Platform.getNewline());        
+        sb.append(Platform.getNewline());
         sb.append("GLSL           ").append(gl.hasGLSL()).append(", has-compiler-func: ").append(gl.isFunctionAvailable("glCompileShader"));
         if(gl.hasGLSL()) {
             sb.append(", version: ").append(gl.glGetString(GL2ES2.GL_SHADING_LANGUAGE_VERSION)).append(" / ").append(ctx.getGLSLVersionNumber());
@@ -200,7 +200,7 @@ public class JoglVersion extends JogampVersion {
         return sb;
     }
 
-    public StringBuilder getBriefOSGLBuildInfo(GL gl, StringBuilder sb) {        
+    public StringBuilder getBriefOSGLBuildInfo(GL gl, StringBuilder sb) {
         if(null==sb) {
             sb = new StringBuilder();
         }
@@ -216,7 +216,7 @@ public class JoglVersion extends JogampVersion {
         sb.append(Platform.getNewline());
         return sb;
     }
-    
+
     public static void main(String args[]) {
         System.err.println(VersionUtil.getPlatformInfo());
         System.err.println(GlueGenVersion.getInstance());
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
index ca4846939..8d2d07d58 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.cg;
 
 import com.jogamp.common.jvm.JNILibLoaderBase;
@@ -45,15 +45,15 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 Platform.initSingleton();
-                
+
                 if(TempJarCache.isInitialized()) {
                    // only: jogl-cg.jar -> jogl-cg-natives-<os.and.arch>.jar [atomic JAR files only]
-                   JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { CgDynamicLibraryBundleInfo.class }, null, null );                   
+                   JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { CgDynamicLibraryBundleInfo.class }, null, null );
                 }
                 return null;
             }
         });
-        
+
         glueLibNames = new ArrayList<String>();
         // glueLibNames.addAll(getGlueLibNamesPreload());
         glueLibNames.add("jogl_cg");
@@ -76,7 +76,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
      * <p>
      * Returns <code>false</code>.
      * </p>
-     */ 
+     */
     @Override
     public final boolean shallLookupGlobal() { return false; }
 
@@ -91,7 +91,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
     public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
         return 0;
     }
-    
+
     @Override
     public final boolean useToolGetProcAdressFirst(String funcName) {
         return false;
@@ -103,7 +103,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
         final List<String> libsCg = new ArrayList<String>();
         libsCg.add("Cg");
         libsList.add(libsCg);
-        
+
         final List<String> libsCgGL = new ArrayList<String>();
         libsCgGL.add("CgGL");
         libsList.add(libsCgGL);
@@ -119,7 +119,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
     @Override
     public final RunnableExecutor getLibLoaderExecutor() {
         return DynamicLibraryBundle.getDefaultRunnableExecutor();
-    }    
+    }
 }
 
 
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgException.java b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
index 8bfd9e23e..3e42f4d70 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java b/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
index e0acfec28..b7dbf183f 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,7 +28,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.opengl.math;
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
index f3f44f15a..191a83241 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
@@ -40,7 +40,7 @@ import com.jogamp.common.os.Platform;
  * <p>
  * Derived from ProjectFloat.java - Created 11-jan-2004
  * </p>
- * 
+ *
  * @author Erik Duijs
  * @author Kenneth Russell
  * @author Sven Gothel
@@ -95,7 +95,7 @@ public class FloatUtil {
     m.put(ZERO_MATRIX);
     m.position(oldPos);
   }
-  
+
   /**
    * @param a 4x4 matrix in column-major order
    * @param b 4x4 matrix in column-major order
@@ -111,7 +111,7 @@ public class FloatUtil {
         d[d_off+i+3*4] = ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] ;
      }
   }
-  
+
   /**
    * @param a 4x4 matrix in column-major order (also result)
    * @param b 4x4 matrix in column-major order
@@ -127,7 +127,7 @@ public class FloatUtil {
         a[a_off_i+3*4] = ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] ;
      }
   }
-  
+
   /**
    * @param a 4x4 matrix in column-major order
    * @param b 4x4 matrix in column-major order
@@ -151,7 +151,7 @@ public class FloatUtil {
    * @param d result a*b in column-major order
    */
   public static final void multMatrixf(final FloatBuffer a, final float[] b, int b_off, FloatBuffer d) {
-     final int aP = a.position(); 
+     final int aP = a.position();
      final int dP = d.position();
      for (int i = 0; i < 4; i++) {
         // one row in column-major order
@@ -162,13 +162,13 @@ public class FloatUtil {
         d.put(dP+i+3*4 , ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] );
      }
   }
-  
+
   /**
    * @param a 4x4 matrix in column-major order (also result)
    * @param b 4x4 matrix in column-major order
    */
   public static final void multMatrixf(final FloatBuffer a, final float[] b, int b_off) {
-     final int aP = a.position(); 
+     final int aP = a.position();
      for (int i = 0; i < 4; i++) {
         // one row in column-major order
         final int aP_i = aP+i;
@@ -186,7 +186,7 @@ public class FloatUtil {
    * @param d result a*b in column-major order
    */
   public static final void multMatrixf(final FloatBuffer a, final FloatBuffer b, FloatBuffer d) {
-     final int aP = a.position(); 
+     final int aP = a.position();
      final int bP = b.position();
      final int dP = d.position();
      for (int i = 0; i < 4; i++) {
@@ -198,13 +198,13 @@ public class FloatUtil {
         d.put(dP+i+3*4 , ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) );
      }
   }
-  
+
   /**
    * @param a 4x4 matrix in column-major order (also result)
    * @param b 4x4 matrix in column-major order
    */
   public static final void multMatrixf(final FloatBuffer a, final FloatBuffer b) {
-     final int aP = a.position(); 
+     final int aP = a.position();
      final int bP = b.position();
      for (int i = 0; i < 4; i++) {
         // one row in column-major order
@@ -216,14 +216,14 @@ public class FloatUtil {
         a.put(aP_i+3*4 , ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) );
      }
   }
-  
+
   /**
    * @param a 4x4 matrix in column-major order
    * @param b 4x4 matrix in column-major order
    * @param d result a*b in column-major order
    */
   public static final void multMatrixf(final FloatBuffer a, final FloatBuffer b, float[] d, int d_off) {
-     final int aP = a.position(); 
+     final int aP = a.position();
      final int bP = b.position();
      for (int i = 0; i < 4; i++) {
         // one row in column-major order
@@ -234,7 +234,7 @@ public class FloatUtil {
         d[d_off+i+3*4] = ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) ;
      }
   }
-  
+
   /**
    * Normalize vector
    *
@@ -242,7 +242,7 @@ public class FloatUtil {
    */
   public static final void normalize(float[] v) {
     float r = (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-    
+
     if ( r == 0.0 || r == 1.0) {
       return;
     }
@@ -265,7 +265,7 @@ public class FloatUtil {
     float r = (float) Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
                                 v.get(1+vPos) * v.get(1+vPos) +
                                 v.get(2+vPos) * v.get(2+vPos));
-    
+
     if ( r == 0.0 || r == 1.0) {
       return;
     }
@@ -341,7 +341,7 @@ public class FloatUtil {
         v_in[3] * m_in[3*4+i];
     }
   }
-  
+
   /**
    * @param m_in 4x4 matrix in column-major order
    * @param v_in 4-component column-vector
@@ -355,10 +355,10 @@ public class FloatUtil {
         v_in[0+v_in_off] * m_in.get(0*4+i+matrixPos) +
         v_in[1+v_in_off] * m_in.get(1*4+i+matrixPos) +
         v_in[2+v_in_off] * m_in.get(2*4+i+matrixPos) +
-        v_in[3+v_in_off] * m_in.get(3*4+i+matrixPos);      
+        v_in[3+v_in_off] * m_in.get(3*4+i+matrixPos);
     }
   }
-  
+
   /**
    * @param m_in 4x4 matrix in column-major order
    * @param v_in 4-component column-vector
@@ -372,10 +372,10 @@ public class FloatUtil {
         v_in[0] * m_in.get(0*4+i+matrixPos) +
         v_in[1] * m_in.get(1*4+i+matrixPos) +
         v_in[2] * m_in.get(2*4+i+matrixPos) +
-        v_in[3] * m_in.get(3*4+i+matrixPos);      
+        v_in[3] * m_in.get(3*4+i+matrixPos);
     }
   }
-  
+
   /**
    * @param m_in 4x4 matrix in column-major order
    * @param v_in 4-component column-vector
@@ -395,7 +395,7 @@ public class FloatUtil {
     }
   }
 
-  /** 
+  /**
    * @param sb optional passed StringBuilder instance to be used
    * @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
    * @param a mxn matrix (rows x columns)
@@ -403,7 +403,7 @@ public class FloatUtil {
    * @param rows
    * @param columns
    * @param rowMajorOrder if true floats are layed out in row-major-order, otherwise column-major-order (OpenGL)
-   * @param row row number to print 
+   * @param row row number to print
    * @return matrix row string representation
    */
   public static StringBuilder matrixRowToString(StringBuilder sb, String f, FloatBuffer a, int aOffset, int rows, int columns, boolean rowMajorOrder, int row) {
@@ -413,17 +413,17 @@ public class FloatUtil {
       final int a0 = aOffset + a.position();
       if(rowMajorOrder) {
           for(int c=0; c<columns; c++) {
-              sb.append( String.format( f+" ", a.get( a0 + row*columns + c ) ) ); 
+              sb.append( String.format( f+" ", a.get( a0 + row*columns + c ) ) );
           }
       } else {
           for(int r=0; r<columns; r++) {
-              sb.append( String.format( f+" ", a.get( a0 + row + r*rows ) ) ); 
+              sb.append( String.format( f+" ", a.get( a0 + row + r*rows ) ) );
           }
       }
       return sb;
   }
 
-  /** 
+  /**
    * @param sb optional passed StringBuilder instance to be used
    * @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
    * @param a mxn matrix (rows x columns)
@@ -431,7 +431,7 @@ public class FloatUtil {
    * @param rows
    * @param columns
    * @param rowMajorOrder if true floats are layed out in row-major-order, otherwise column-major-order (OpenGL)
-   * @param row row number to print 
+   * @param row row number to print
    * @return matrix row string representation
    */
   public static StringBuilder matrixRowToString(StringBuilder sb, String f, float[] a, int aOffset, int rows, int columns, boolean rowMajorOrder, int row) {
@@ -440,19 +440,19 @@ public class FloatUtil {
       }
       if(rowMajorOrder) {
           for(int c=0; c<columns; c++) {
-              sb.append( String.format( f+" ", a[ aOffset + row*columns + c ] ) ); 
+              sb.append( String.format( f+" ", a[ aOffset + row*columns + c ] ) );
           }
       } else {
           for(int r=0; r<columns; r++) {
-              sb.append( String.format( f+" ", a[ aOffset + row + r*rows ] ) ); 
+              sb.append( String.format( f+" ", a[ aOffset + row + r*rows ] ) );
           }
       }
       return sb;
   }
-  
-  /** 
+
+  /**
    * @param sb optional passed StringBuilder instance to be used
-   * @param rowPrefix optional prefix for each row 
+   * @param rowPrefix optional prefix for each row
    * @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
    * @param a mxn matrix (rows x columns)
    * @param aOffset offset to <code>a</code>'s current position
@@ -469,14 +469,14 @@ public class FloatUtil {
       for(int i=0; i<rows; i++) {
           sb.append(prefix).append("[ ");
           matrixRowToString(sb, f, a, aOffset, rows, columns, rowMajorOrder, i);
-          sb.append("]").append(Platform.getNewline());      
+          sb.append("]").append(Platform.getNewline());
       }
       return sb;
   }
 
-  /** 
+  /**
    * @param sb optional passed StringBuilder instance to be used
-   * @param rowPrefix optional prefix for each row 
+   * @param rowPrefix optional prefix for each row
    * @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
    * @param a mxn matrix (rows x columns)
    * @param aOffset offset to <code>a</code>'s current position
@@ -493,14 +493,14 @@ public class FloatUtil {
       for(int i=0; i<rows; i++) {
           sb.append(prefix).append("[ ");
           matrixRowToString(sb, f, a, aOffset, rows, columns, rowMajorOrder, i);
-          sb.append("]").append(Platform.getNewline());      
+          sb.append("]").append(Platform.getNewline());
       }
       return sb;
   }
-  
-  /** 
+
+  /**
    * @param sb optional passed StringBuilder instance to be used
-   * @param rowPrefix optional prefix for each row 
+   * @param rowPrefix optional prefix for each row
    * @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
    * @param a 4x4 matrix in column major order (OpenGL)
    * @param aOffset offset to <code>a</code>'s current position
@@ -521,14 +521,14 @@ public class FloatUtil {
           matrixRowToString(sb, f, a, aOffset, rows, columns, rowMajorOrder, i);
           sb.append("=?= ");
           matrixRowToString(sb, f, b, bOffset, rows, columns, rowMajorOrder, i);
-          sb.append("]").append(Platform.getNewline());      
+          sb.append("]").append(Platform.getNewline());
       }
       return sb;
   }
 
-  /** 
+  /**
    * @param sb optional passed StringBuilder instance to be used
-   * @param rowPrefix optional prefix for each row 
+   * @param rowPrefix optional prefix for each row
    * @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
    * @param a 4x4 matrix in column major order (OpenGL)
    * @param aOffset offset to <code>a</code>'s current position
@@ -549,11 +549,11 @@ public class FloatUtil {
           matrixRowToString(sb, f, a, aOffset, rows, columns, rowMajorOrder, i);
           sb.append("=?= ");
           matrixRowToString(sb, f, b, bOffset, rows, columns, rowMajorOrder, i);
-          sb.append("]").append(Platform.getNewline());      
+          sb.append("]").append(Platform.getNewline());
       }
       return sb;
   }
-  
+
   public static final float E = 2.7182818284590452354f;
 
   public static final float PI = 3.14159265358979323846f;
@@ -569,5 +569,5 @@ public class FloatUtil {
   public static float acos(float a) { return (float) java.lang.Math.acos(a);  }
 
   public static float sqrt(float a) { return (float) java.lang.Math.sqrt(a);  }
-  
+
 }
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
index c6bf44f6d..78cbb18cf 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
@@ -33,7 +33,7 @@ public class Quaternion {
     public Quaternion() {
         setIdentity();
     }
-    
+
     public Quaternion(Quaternion q) {
         x = q.x;
         y = q.y;
@@ -50,7 +50,7 @@ public class Quaternion {
 
     /**
      * Constructor to create a rotation based quaternion from two vectors
-     * 
+     *
      * @param vector1
      * @param vector2
      */
@@ -59,7 +59,7 @@ public class Quaternion {
         final float[] cross = VectorUtil.cross(vector1, vector2);
         fromAxis(cross, theta);
     }
-    
+
     /***
      * Constructor to create a rotation based quaternion from axis vector and angle
      * @param vector axis vector
@@ -69,10 +69,10 @@ public class Quaternion {
     public Quaternion(float[] vector, float angle) {
         fromAxis(vector, angle);
     }
-    
+
     /***
      * Initialize this quaternion with given axis vector and rotation angle
-     * 
+     *
      * @param vector axis vector
      * @param angle rotation angle (rads)
      */
@@ -88,7 +88,7 @@ public class Quaternion {
 
     /**
      * Transform the rotational quaternion to axis based rotation angles
-     * 
+     *
      * @return new float[4] with ,theta,Rx,Ry,Rz
      */
     public float[] toAxis() {
@@ -135,7 +135,7 @@ public class Quaternion {
 
     /**
      * Add a quaternion
-     * 
+     *
      * @param q quaternion
      */
     public void add(Quaternion q) {
@@ -146,7 +146,7 @@ public class Quaternion {
 
     /**
      * Subtract a quaternion
-     * 
+     *
      * @param q quaternion
      */
     public void subtract(Quaternion q) {
@@ -157,7 +157,7 @@ public class Quaternion {
 
     /**
      * Divide a quaternion by a constant
-     * 
+     *
      * @param n a float to divide by
      */
     public void divide(float n) {
@@ -168,7 +168,7 @@ public class Quaternion {
 
     /**
      * Multiply this quaternion by the param quaternion
-     * 
+     *
      * @param q a quaternion to multiply with
      */
     public void mult(Quaternion q) {
@@ -186,7 +186,7 @@ public class Quaternion {
 
     /**
      * Multiply a quaternion by a constant
-     * 
+     *
      * @param n a float constant
      */
     public void mult(float n) {
@@ -194,10 +194,10 @@ public class Quaternion {
         y *= n;
         z *= n;
     }
-    
+
     /***
      * Rotate given vector by this quaternion
-     * 
+     *
      * @param vector input vector
      * @return rotated vector
      */
@@ -250,7 +250,7 @@ public class Quaternion {
     /**
      * Transform this quaternion to a 4x4 column matrix representing the
      * rotation
-     * 
+     *
      * @return new float[16] column matrix 4x4
      */
     public float[] toMatrix() {
@@ -287,7 +287,7 @@ public class Quaternion {
      * See http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/
      * quaternions/slerp/
      * </p>
-     * 
+     *
      * @param a initial quaternion
      * @param b target quaternion
      * @param t float between 0 and 1 representing interp.
@@ -332,13 +332,13 @@ public class Quaternion {
     /**
      * Check if this quaternion represents an identity matrix for rotation,
      * , ie (0,0,0,1).
-     * 
+     *
      * @return true if it is an identity rep., false otherwise
      */
     public boolean isIdentity() {
         return w == 1 && x == 0 && y == 0 && z == 0;
     }
-    
+
     /***
      * Set this quaternion to identity (x=0,y=0,z=0,w=1)
      */
@@ -349,7 +349,7 @@ public class Quaternion {
 
     /**
      * compute the quaternion from a 3x3 column matrix
-     * 
+     *
      * @param m 3x3 column matrix
      */
     public void setFromMatrix(float[] m) {
@@ -386,7 +386,7 @@ public class Quaternion {
     /**
      * Check if the the 3x3 matrix (param) is in fact an affine rotational
      * matrix
-     * 
+     *
      * @param m 3x3 column matrix
      * @return true if representing a rotational matrix, false otherwise
      */
diff --git a/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java b/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java
index 0033afeaa..508f1aafd 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java
@@ -39,7 +39,7 @@ public class VectorUtil {
         Winding(int dir) {
             this.dir = dir;
         }
-    } 
+    }
 
     public static final int COLLINEAR = 0;
 
@@ -119,15 +119,15 @@ public class VectorUtil {
     /** Column Matrix Vector multiplication
      * @param colMatrix column matrix (4x4)
      * @param vec vector(x,y,z)
-     * @return result new float[3] 
+     * @return result new float[3]
      */
     public static float[] colMatrixVectorMult(float[] colMatrix, float[] vec)
     {
         final float[] out = new float[3];
 
-        out[0] = vec[0]*colMatrix[0] + vec[1]*colMatrix[4] + vec[2]*colMatrix[8] + colMatrix[12]; 
-        out[1] = vec[0]*colMatrix[1] + vec[1]*colMatrix[5] + vec[2]*colMatrix[9] + colMatrix[13]; 
-        out[2] = vec[0]*colMatrix[2] + vec[1]*colMatrix[6] + vec[2]*colMatrix[10] + colMatrix[14]; 
+        out[0] = vec[0]*colMatrix[0] + vec[1]*colMatrix[4] + vec[2]*colMatrix[8] + colMatrix[12];
+        out[1] = vec[0]*colMatrix[1] + vec[1]*colMatrix[5] + vec[2]*colMatrix[9] + colMatrix[13];
+        out[2] = vec[0]*colMatrix[2] + vec[1]*colMatrix[6] + vec[2]*colMatrix[10] + colMatrix[14];
 
         return out;
     }
@@ -135,15 +135,15 @@ public class VectorUtil {
     /** Matrix Vector multiplication
      * @param rawMatrix column matrix (4x4)
      * @param vec vector(x,y,z)
-     * @return result new float[3] 
+     * @return result new float[3]
      */
     public static float[] rowMatrixVectorMult(float[] rawMatrix, float[] vec)
     {
         final float[] out = new float[3];
 
-        out[0] = vec[0]*rawMatrix[0] + vec[1]*rawMatrix[1] + vec[2]*rawMatrix[2] + rawMatrix[3]; 
-        out[1] = vec[0]*rawMatrix[4] + vec[1]*rawMatrix[5] + vec[2]*rawMatrix[6] + rawMatrix[7]; 
-        out[2] = vec[0]*rawMatrix[8] + vec[1]*rawMatrix[9] + vec[2]*rawMatrix[10] + rawMatrix[11]; 
+        out[0] = vec[0]*rawMatrix[0] + vec[1]*rawMatrix[1] + vec[2]*rawMatrix[2] + rawMatrix[3];
+        out[1] = vec[0]*rawMatrix[4] + vec[1]*rawMatrix[5] + vec[2]*rawMatrix[6] + rawMatrix[7];
+        out[2] = vec[0]*rawMatrix[8] + vec[1]*rawMatrix[9] + vec[2]*rawMatrix[10] + rawMatrix[11];
 
         return out;
     }
@@ -157,7 +157,7 @@ public class VectorUtil {
     {
         return (p1+p2)/2.0f;
     }
-    
+
     /** Calculate the midpoint of two points
      * @param p1 first point
      * @param p2 second point
@@ -172,7 +172,7 @@ public class VectorUtil {
 
         return midPoint;
     }
-    
+
     /** Compute the norm of a vector
      * @param vec vector
      * @return vorm
@@ -181,7 +181,7 @@ public class VectorUtil {
     {
         return FloatUtil.sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]);
     }
-    
+
     /** Compute distance between 2 points
      * @param p0 a ref point on the line
      * @param vec vector representing the direction of the line
@@ -216,7 +216,7 @@ public class VectorUtil {
      */
     public static boolean checkEqualityVec2(float[] v1, float[] v2)
     {
-        return Float.compare(v1[0], v2[0]) == 0 && 
+        return Float.compare(v1[0], v2[0]) == 0 &&
                Float.compare(v1[1], v2[1]) == 0 ;
     }
 
@@ -261,7 +261,7 @@ public class VectorUtil {
      * @param b triangle vertex 2
      * @param c triangle vertex 3
      * @param d vertex in question
-     * @return true if the vertex d is inside the circle defined by the 
+     * @return true if the vertex d is inside the circle defined by the
      * vertices a, b, c. from paper by Guibas and Stolfi (1985).
      */
     public static boolean inCircle(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d){
@@ -282,8 +282,8 @@ public class VectorUtil {
         return (b.getX() - a.getX()) * (c.getY() - a.getY()) - (b.getY() - a.getY())*(c.getX() - a.getX());
     }
 
-    /** Check if a vertex is in triangle using 
-     * barycentric coordinates computation. 
+    /** Check if a vertex is in triangle using
+     * barycentric coordinates computation.
      * @param a first triangle vertex
      * @param b second triangle vertex
      * @param c third triangle vertex
@@ -291,7 +291,7 @@ public class VectorUtil {
      * @return true if p is in triangle (a, b, c), false otherwise.
      */
     public static boolean vertexInTriangle(float[] a, float[]  b, float[]  c, float[]  p){
-        // Compute vectors        
+        // Compute vectors
         final float[] ac = computeVector(a, c); //v0
         final float[] ab = computeVector(a, b); //v1
         final float[] ap = computeVector(a, p); //v2
@@ -362,13 +362,13 @@ public class VectorUtil {
      * @param b vertex 2 of first segment
      * @param c vertex 1 of second segment
      * @param d vertex 2 of second segment
-     * @return the intersection coordinates if the segments intersect, otherwise 
-     * returns null 
+     * @return the intersection coordinates if the segments intersect, otherwise
+     * returns null
      */
     public static float[] seg2SegIntersection(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d) {
         final float determinant = (a.getX()-b.getX())*(c.getY()-d.getY()) - (a.getY()-b.getY())*(c.getX()-d.getX());
 
-        if (determinant == 0) 
+        if (determinant == 0)
             return null;
 
         final float alpha = (a.getX()*b.getY()-a.getY()*b.getX());
@@ -389,13 +389,13 @@ public class VectorUtil {
      * @param b vertex 2 of first line
      * @param c vertex 1 of second line
      * @param d vertex 2 of second line
-     * @return the intersection coordinates if the lines intersect, otherwise 
-     * returns null 
+     * @return the intersection coordinates if the lines intersect, otherwise
+     * returns null
      */
     public static float[] line2lineIntersection(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d) {
         final float determinant = (a.getX()-b.getX())*(c.getY()-d.getY()) - (a.getY()-b.getY())*(c.getX()-d.getX());
 
-        if (determinant == 0) 
+        if (determinant == 0)
             return null;
 
         final float alpha = (a.getX()*b.getY()-a.getY()*b.getX());
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Vert2fImmutable.java b/src/jogl/classes/com/jogamp/opengl/math/Vert2fImmutable.java
index 13349884c..ec90b401f 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Vert2fImmutable.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Vert2fImmutable.java
@@ -33,7 +33,7 @@ public interface Vert2fImmutable {
     float getY();
 
     int getCoordCount();
-    
+
     float[] getCoord();
-    
+
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
index b6e8ede2e..f1880a61b 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
@@ -32,23 +32,23 @@ import com.jogamp.opengl.math.VectorUtil;
 
 /**
  * Axis Aligned Bounding Box. Defined by two 3D coordinates (low and high)
- * The low being the the lower left corner of the box, and the high being the upper 
+ * The low being the the lower left corner of the box, and the high being the upper
  * right corner of the box.
- * 
+ *
  */
 public class AABBox implements Cloneable {
     private float[] low = new float[3];
     private float[] high = new float[3];
     private float[] center = new float[3];
 
-    /** Create a Axis Aligned bounding box (AABBox) 
+    /** Create a Axis Aligned bounding box (AABBox)
      * where the low and and high MAX float Values.
      */
     public AABBox() {
         reset();
     }
 
-    /** Create an AABBox specifying the coordinates 
+    /** Create an AABBox specifying the coordinates
      * of the low and high
      * @param lx min x-coordinate
      * @param ly min y-coordnate
@@ -61,7 +61,7 @@ public class AABBox implements Cloneable {
                   float hx, float hy, float hz) {
         setSize(lx, ly, lz, hx, hy, hz);
     }
-    
+
     /** Create a AABBox defining the low and high
      * @param low min xyz-coordinates
      * @param high max xyz-coordinates
@@ -78,27 +78,27 @@ public class AABBox implements Cloneable {
         center[1] = 0f;
         center[2] = 0f;
     }
-    
+
     /** Get the max xyz-coordinates
      * @return a float array containing the max xyz coordinates
      */
     public final float[] getHigh() {
         return high;
     }
-    
+
     private final void setHigh(float hx, float hy, float hz) {
         this.high[0] = hx;
         this.high[1] = hy;
         this.high[2] = hz;
     }
-    
+
     /** Get the min xyz-coordinates
      * @return a float array containing the min xyz coordinates
      */
     public final float[] getLow() {
         return low;
     }
-    
+
     private final void setLow(float lx, float ly, float lz) {
         this.low[0] = lx;
         this.low[1] = ly;
@@ -111,10 +111,10 @@ public class AABBox implements Cloneable {
         center[2] = (high[2] + low[2])/2;
     }
 
-    /** 
-     * Set size of the AABBox specifying the coordinates 
+    /**
+     * Set size of the AABBox specifying the coordinates
      * of the low and high.
-     * 
+     *
      * @param lx min x-coordinate
      * @param ly min y-coordnate
      * @param lz min z-coordinate
@@ -123,7 +123,7 @@ public class AABBox implements Cloneable {
      * @param hz max z-coordinate
      */
     public final void setSize(float lx, float ly, float lz,
-                              float hx, float hy, float hz) {        
+                              float hx, float hy, float hz) {
         this.low[0] = lx;
         this.low[1] = ly;
         this.low[2] = lz;
@@ -132,7 +132,7 @@ public class AABBox implements Cloneable {
         this.high[2] = hz;
         computeCenter();
     }
-    
+
     /** Resize the AABBox to encapsulate another AABox
      * @param newBox AABBox to be encapsulated in
      */
@@ -160,12 +160,12 @@ public class AABBox implements Cloneable {
     }
 
     /** Resize the AABBox to encapsulate the passed
-     * xyz-coordinates. 
+     * xyz-coordinates.
      * @param x x-axis coordinate value
      * @param y y-axis coordinate value
      * @param z z-axis coordinate value
      */
-    public final void resize(float x, float y, float z) {    
+    public final void resize(float x, float y, float z) {
         /** test low */
         if (x < low[0])
             low[0] = x;
@@ -181,12 +181,12 @@ public class AABBox implements Cloneable {
             high[1] = y;
         if (z > high[2])
             high[2] = z;
-        
+
         computeCenter();
     }
 
     /** Resize the AABBox to encapsulate the passed
-     * xyz-coordinates. 
+     * xyz-coordinates.
      * @param xyz xyz-axis coordinate values
      * @param offset of the array
      */
@@ -210,7 +210,7 @@ public class AABBox implements Cloneable {
         }
         return true;
     }
-    
+
     /** Check if the xyz coordinates are bounded/contained
      *  by this AABBox.
      * @param x x-axis coordinate value
@@ -231,7 +231,7 @@ public class AABBox implements Cloneable {
         }
         return true;
     }
-    
+
     /** Check if there is a common region between this AABBox and the passed
      *     2D region irrespective of z range
      * @param x lower left x-coord
@@ -244,13 +244,13 @@ public class AABBox implements Cloneable {
         if (w <= 0 || h <= 0) {
             return false;
         }
-        
+
         final float _w = getWidth();
-        final float _h = getHeight();        
+        final float _h = getHeight();
         if (_w <= 0 || _h <= 0) {
             return false;
         }
-        
+
         final float x0 = getMinX();
         final float y0 = getMinY();
         return (x + w > x0 &&
@@ -259,8 +259,8 @@ public class AABBox implements Cloneable {
                 y < y0 + _h);
     }
 
-    
-    /** Get the size of the Box where the size is represented by the 
+
+    /** Get the size of the Box where the size is represented by the
      * length of the vector between low and high.
      * @return a float representing the size of the AABBox
      */
@@ -283,16 +283,16 @@ public class AABBox implements Cloneable {
         diffH[0] = high[0] - center[0];
         diffH[1] = high[1] - center[1];
         diffH[2] = high[2] - center[2];
-        
+
         diffH = VectorUtil.scale(diffH, size);
-        
+
         float[] diffL = new float[3];
         diffL[0] = low[0] - center[0];
         diffL[1] = low[1] - center[1];
         diffL[2] = low[2] - center[2];
-        
+
         diffL = VectorUtil.scale(diffL, size);
-        
+
         high = VectorUtil.vectorAdd(center, diffH);
         low = VectorUtil.vectorAdd(center, diffL);
     }
@@ -300,43 +300,43 @@ public class AABBox implements Cloneable {
     public final float getMinX() {
         return low[0];
     }
-    
+
     public final float getMinY() {
         return low[1];
     }
-    
+
     public final float getMinZ() {
         return low[2];
     }
-    
+
     public final float getMaxX() {
         return high[0];
     }
-    
+
     public final float getMaxY() {
         return high[1];
     }
-    
+
     public final float getMaxZ() {
         return high[2];
     }
-    
+
     public final float getWidth(){
         return high[0] - low[0];
     }
-    
+
     public final float getHeight() {
         return high[1] - low[1];
     }
-    
+
     public final float getDepth() {
         return high[2] - low[2];
     }
-    
+
     public final AABBox clone() {
         return new AABBox(this.low, this.high);
     }
-    
+
     public final boolean equals(Object obj) {
         if( obj == this ) {
             return true;
@@ -344,11 +344,11 @@ public class AABBox implements Cloneable {
         if( null == obj || !(obj instanceof AABBox) ) {
             return false;
         }
-        final AABBox other = (AABBox) obj; 
-        return VectorUtil.checkEquality(low, other.low) &&          
+        final AABBox other = (AABBox) obj;
+        return VectorUtil.checkEquality(low, other.low) &&
                VectorUtil.checkEquality(high, other.high) ;
     }
-    
+
     public final String toString() {
         return "[ "+low[0]+"/"+low[1]+"/"+low[1]+" .. "+high[0]+"/"+high[0]+"/"+high[0]+", ctr "+
                     center[0]+"/"+center[1]+"/"+center[1]+" ]";
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
index 93e68a1d6..fb311083f 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
@@ -30,11 +30,11 @@ package com.jogamp.opengl.math.geom;
 import com.jogamp.common.os.Platform;
 
 /**
- * Providing frustum {@link #getPlanes() planes} derived by different inputs 
+ * Providing frustum {@link #getPlanes() planes} derived by different inputs
  * ({@link #updateByPMV(float[], int) P*MV}, ..)
- * used to {@link #classifySphere(float[], float) classify objects} and to test 
+ * used to {@link #classifySphere(float[], float) classify objects} and to test
  * whether they are {@link #isOutside(AABBox) outside}.
- * 
+ *
  * <p>
  * Extracting the world-frustum planes from the P*Mv:
  * <pre>
@@ -54,7 +54,7 @@ import com.jogamp.common.os.Platform;
  * Lighthouse3d.com
  * http://www.lighthouse3d.com/tutorials/view-frustum-culling/
  * </pre>
- * 
+ *
  * Fundamentals about Planes, Half-Spaces and Frustum-Culling:<br/>
  * <pre>
  * Planes and Half-Spaces,  Max Wagner <mwagner@digipen.edu>
@@ -69,7 +69,7 @@ import com.jogamp.common.os.Platform;
 public class Frustum {
     /** Normalized planes[l, r, b, t, n, f] */
 	protected Plane[] planes = new Plane[6];
-	
+
 	/**
 	 * Creates an undefined instance w/o calculating the frustum.
 	 * <p>
@@ -83,35 +83,35 @@ public class Frustum {
             planes[i] = new Plane();
         }
     }
-    
-	/** 
+
+	/**
 	 * Plane equation := dot(n, x - p) = 0 ->  ax + bc + cx + d == 0
 	 * <p>
 	 * In order to work w/ {@link Frustum#isOutside(AABBox) isOutside(..)} methods,
 	 * the normals have to point to the inside of the frustum.
-	 * </p> 
+	 * </p>
 	 */
     public static class Plane {
         /** Normal of the plane */
         public final float[] n = new float[3];
-        
+
         /** Distance to origin */
         public float d;
 
-        /** 
+        /**
          * Return signed distance of plane to given point.
          * <ul>
          *   <li>If dist &lt; 0 , then the point p lies in the negative halfspace.</li>
          *   <li>If dist = 0 , then the point p lies in the plane.</li>
          *   <li>If dist &gt; 0 , then the point p lies in the positive halfspace.</li>
-         * </ul> 
+         * </ul>
          * A plane cuts 3D space into 2 half spaces.
          * <p>
          * Positive halfspace is where the plane’s normals vector points into.
-         * </p> 
+         * </p>
          * <p>
          * Negative halfspace is the <i>other side</i> of the plane, i.e. *-1
-         * </p> 
+         * </p>
          **/
         public final float distanceTo(float x, float y, float z) {
             return n[0] * x + n[1] * y + n[2] * z + d;
@@ -121,13 +121,13 @@ public class Frustum {
         public final float distanceTo(float[] p) {
             return n[0] * p[0] + n[1] * p[1] + n[2] * p[2] + d;
         }
-        
+
         @Override
         public String toString() {
             return "Plane[ [ " + n[0] + ", " + n[1] + ", " + n[2] + " ], " + d + "]";
         }
     }
-    
+
     /** Index for left plane: {@value} */
     public static final int LEFT   = 0;
     /** Index for right plane: {@value} */
@@ -140,7 +140,7 @@ public class Frustum {
     public static final int NEAR   = 4;
     /** Index for far plane: {@value} */
     public static final int FAR    = 5;
-    
+
     /**
      * {@link Plane}s are ordered in the returned array as follows:
      * <ul>
@@ -154,17 +154,17 @@ public class Frustum {
      * <p>
      * {@link Plane}'s normals are pointing to the inside of the frustum
      * in order to work w/ {@link #isOutside(AABBox) isOutside(..)} methods.
-     * </p> 
-     * 
-     * @return array of normalized {@link Plane}s, order see above. 
+     * </p>
+     *
+     * @return array of normalized {@link Plane}s, order see above.
      */
     public final Plane[] getPlanes() { return planes; }
-    
+
     /**
      * Copy the given <code>src</code> planes into this this instance's planes.
      * @param src the 6 source planes
      */
-    public final void updateByPlanes(Plane[] src) { 
+    public final void updateByPlanes(Plane[] src) {
         for (int i = 0; i < 6; ++i) {
             final Plane p0 = planes[i];
             final float[] p0_n = p0.n;
@@ -176,7 +176,7 @@ public class Frustum {
             p0.d = p1.d;
         }
     }
-    
+
     /**
      * Calculate the frustum planes in world coordinates
      * using the passed float[16] as premultiplied P*MV (column major order).
@@ -185,7 +185,7 @@ public class Frustum {
      * as required by this class.
      * </p>
      */
-    public void updateByPMV(float[] pmv, int pmv_off) {        
+    public void updateByPMV(float[] pmv, int pmv_off) {
         // Left:   a = m41 + m11, b = m42 + m12, c = m43 + m13, d = m44 + m14  - [1..4] row-major
         // Left:   a = m30 + m00, b = m31 + m01, c = m32 + m02, d = m33 + m03  - [0..3] row-major
         {
@@ -264,11 +264,11 @@ public class Frustum {
             p.d /= invl;
         }
     }
-    
+
 	private static final boolean isOutsideImpl(Plane p, AABBox box) {
 	    final float[] low = box.getLow();
 	    final float[] high = box.getHigh();
-	    
+
 		if ( p.distanceTo(low[0],  low[1],  low[2])  > 0.0f ||
 		     p.distanceTo(high[0], low[1],  low[2])  > 0.0f ||
 		     p.distanceTo(low[0],  high[1], low[2])  > 0.0f ||
@@ -298,19 +298,19 @@ public class Frustum {
         // We make no attempt to determine whether it's fully inside or not.
         return false;
     }
-    
-    
+
+
     public static enum Location { OUTSIDE, INSIDE, INTERSECT };
-    
+
     /**
      * Check to see if a point is outside, inside or on a plane of the frustum.
-     * 
+     *
      * @param p the point
      * @return {@link Location} of point related to frustum planes
      */
     public final Location classifyPoint(float[] p) {
         Location res = Location.INSIDE;
-        
+
         for (int i = 0; i < 6; ++i) {
             final float d = planes[i].distanceTo(p);
             if ( d < 0.0f ) {
@@ -321,43 +321,43 @@ public class Frustum {
         }
         return res;
     }
-    
+
     /**
      * Check to see if a point is outside of the frustum.
-     * 
+     *
      * @param p the point
      * @return true if outside of the frustum, otherwise inside or on a plane
      */
     public final boolean isPointOutside(float[] p) {
         return Location.OUTSIDE == classifyPoint(p);
     }
-    
+
     /**
      * Check to see if a sphere is outside, intersecting or inside of the frustum.
-     * 
+     *
      * @param p center of the sphere
      * @param radius radius of the sphere
      * @return {@link Location} of point related to frustum planes
      */
     public final Location classifySphere(float[] p, float radius) {
         Location res = Location.INSIDE; // fully inside
-        
+
         for (int i = 0; i < 6; ++i) {
             final float d = planes[i].distanceTo(p);
-            if ( d < -radius ) { 
+            if ( d < -radius ) {
                 // fully outside
                 return Location.OUTSIDE;
             } else if (d < radius ) {
                 // intersecting
                 res = Location.INTERSECT;
             }
-        }        
+        }
         return res;
     }
-    
+
     /**
      * Check to see if a sphere is outside of the frustum.
-     * 
+     *
      * @param p center of the sphere
      * @param radius radius of the sphere
      * @return true if outside of the frustum, otherwise inside or intersecting
@@ -365,7 +365,7 @@ public class Frustum {
     public final boolean isSphereOutside(float[] p, float radius) {
         return Location.OUTSIDE == classifySphere(p, radius);
     }
-    
+
     public StringBuilder toString(StringBuilder sb) {
         if( null == sb ) {
             sb = new StringBuilder();
@@ -380,7 +380,7 @@ public class Frustum {
         .append("]");
         return sb;
     }
-    
+
 	@Override
 	public String toString() {
 	    return toString(null).toString();
diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
index ff764d849..33941a407 100644
--- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
+++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
@@ -102,11 +102,11 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
    /* GL Stuff */
    private final RecursiveLock lock = LockFactory.createRecursiveLock();
    private final GLDrawableHelper helper = new GLDrawableHelper();
-   
+
    private final GLContext shareWith;
    private final GLCapabilitiesImmutable capsRequested;
-   private final GLCapabilitiesChooser capsChooser; 
-   
+   private final GLCapabilitiesChooser capsChooser;
+
    private volatile Rectangle clientArea;
    private volatile GLDrawableImpl drawable; // volatile: avoid locking for read-only access
    private volatile GLContextImpl context;
@@ -156,7 +156,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
       public void run() {
         final RecursiveLock _lock = lock;
         _lock.lock();
-        try {        
+        try {
             if( !GLCanvas.this.isDisposed() ) {
                 helper.invokeGL(drawable, context, displayAction, initAction);
             }
@@ -215,7 +215,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
                          gle.printStackTrace();
                      }
                  }
-                 context = null;        
+                 context = null;
              }
              if ( null != drawable ) {
                  drawable.setRealized(false);
@@ -261,11 +261,11 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
            }
        }
    };
-   
-   /** 
-    * Creates an instance using {@link #GLCanvas(Composite, int, GLCapabilitiesImmutable, GLCapabilitiesChooser, GLContext)} 
+
+   /**
+    * Creates an instance using {@link #GLCanvas(Composite, int, GLCapabilitiesImmutable, GLCapabilitiesChooser, GLContext)}
     * on the SWT thread.
-    * 
+    *
     * @param parent
     *           Required (non-null) parent Composite.
     * @param style
@@ -284,7 +284,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
     */
    public static GLCanvas create(final Composite parent, final int style, final GLCapabilitiesImmutable caps,
                                  final GLCapabilitiesChooser chooser, final GLContext shareWith) {
-       final GLCanvas[] res = new GLCanvas[] { null }; 
+       final GLCanvas[] res = new GLCanvas[] { null };
        parent.getDisplay().syncExec(new Runnable() {
            public void run() {
                res[0] = new GLCanvas( parent, style, caps, chooser, shareWith );
@@ -319,22 +319,22 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
       GLProfile.initSingleton(); // ensure JOGL is completly initialized
 
       SWTAccessor.setRealized(this, true);
-      
+
       clientArea = GLCanvas.this.getClientArea();
 
-      /* Get the nativewindow-Graphics Device associated with this control (which is determined by the parent Composite). 
+      /* Get the nativewindow-Graphics Device associated with this control (which is determined by the parent Composite).
        * Note: SWT is owner of the native handle, hence closing operation will be a NOP. */
       final AbstractGraphicsDevice swtDevice = SWTAccessor.getDevice(this);
-      
+
       useX11GTK = SWTAccessor.useX11GTK();
       if(useX11GTK) {
-          // Decoupled X11 Device/Screen allowing X11 display lock-free off-thread rendering 
+          // Decoupled X11 Device/Screen allowing X11 display lock-free off-thread rendering
           final long x11DeviceHandle = X11Util.openDisplay(swtDevice.getConnection());
           if( 0 == x11DeviceHandle ) {
               throw new RuntimeException("Error creating display(EDT): "+swtDevice.getConnection());
           }
           final AbstractGraphicsDevice x11Device = new X11GraphicsDevice(x11DeviceHandle, AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
-          screen = SWTAccessor.getScreen(x11Device, -1 /* default */);          
+          screen = SWTAccessor.getScreen(x11Device, -1 /* default */);
       } else {
           screen = SWTAccessor.getScreen(swtDevice, -1 /* default */);
       }
@@ -343,7 +343,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
       if(null == capsReqUser) {
           capsReqUser = new GLCapabilities(GLProfile.getDefault(screen.getDevice()));
       }
-            
+
       this.capsRequested = capsReqUser;
       this.capsChooser = capsChooser;
       this.shareWith = shareWith;
@@ -353,7 +353,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
       x11Window = 0;
       drawable = null;
       context = null;
-      
+
       final Listener listener = new Listener () {
           @Override
           public void handleEvent (Event event) {
@@ -374,7 +374,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
       addListener (SWT.Paint, listener);
       addListener (SWT.Dispose, listener);
    }
-   
+
    private final UpstreamSurfaceHook swtCanvasUpStreamHook = new UpstreamSurfaceHook() {
        @Override
        public final void create(ProxySurface s) { /* nop */ }
@@ -401,11 +401,11 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
    protected final void updateSizeCheck() {
       final Rectangle oClientArea = clientArea;
       final Rectangle nClientArea = GLCanvas.this.getClientArea();
-      if ( nClientArea != null && 
+      if ( nClientArea != null &&
            ( nClientArea.width != oClientArea.width || nClientArea.height != oClientArea.height )
          ) {
           clientArea = nClientArea; // write back new value
-          
+
           final GLDrawableImpl _drawable = drawable;
           final boolean drawableOK = null != _drawable && _drawable.isRealized();
           if(DEBUG) {
@@ -419,14 +419,14 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
                   try {
                       final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, nClientArea.width, nClientArea.height);
                       if(_drawable != _drawableNew) {
-                          // write back 
+                          // write back
                           drawable = _drawableNew;
                       }
                   } finally {
                       _lock.unlock();
                   }
-              }              
-          }    
+              }
+          }
           if(0 != x11Window) {
               SWTAccessor.resizeX11Window(screen.getDevice(), clientArea, x11Window);
           } else if(0 != gdkWindow) {
@@ -435,36 +435,36 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
           sendReshape = true; // async if display() doesn't get called below, but avoiding deadlock
       }
    }
-   
+
    private boolean isValidAndVisibleOnEDTActionResult;
    private final Runnable isValidAndVisibleOnEDTAction = new Runnable() {
        @Override
-       public void run() {           
+       public void run() {
            isValidAndVisibleOnEDTActionResult = !GLCanvas.this.isDisposed() && GLCanvas.this.isVisible();
        } };
-       
+
    private final boolean isValidAndVisibleOnEDT() {
        synchronized(isValidAndVisibleOnEDTAction) {
            runOnEDTIfAvail(true, isValidAndVisibleOnEDTAction);
            return isValidAndVisibleOnEDTActionResult;
        }
    }
-   
+
    /** assumes drawable == null || !drawable.isRealized() !  Checks of !isDispose() and isVisible() */
    protected final boolean validateDrawableAndContextWithCheck() {
       if( !isValidAndVisibleOnEDT() ) {
           return false;
       }
-      return validateDrawableAndContextPostCheck();       
+      return validateDrawableAndContextPostCheck();
    }
-   
+
    /** assumes drawable == null || !drawable.isRealized() ! No check of !isDispose() and isVisible() */
    protected final boolean validateDrawableAndContextPostCheck() {
       final Rectangle nClientArea = clientArea;
       if(0 >= nClientArea.width || 0 >= nClientArea.height) {
           return false;
       }
-               
+
       final boolean res;
       final RecursiveLock _lock = lock;
       _lock.lock();
@@ -480,18 +480,18 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
           }
       } finally {
           _lock.unlock();
-      }  
-            
+      }
+
       if(res) {
           sendReshape = true;
           if(DEBUG) {
               System.err.println("SWT GLCanvas realized! "+this+", "+drawable);
               // Thread.dumpStack();
-          }          
+          }
       }
-      return res;      
+      return res;
    }
-   
+
    private final void createDrawableAndContext() {
        final AbstractGraphicsDevice device = screen.getDevice();
        device.open();
@@ -503,14 +503,14 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
                    capsRequested, capsRequested, capsChooser, screen, VisualIDHolder.VID_UNDEFINED);
            if(DEBUG) {
                System.err.println("SWT.GLCanvas.X11 factory: "+factory+", chosen config: "+cfg);
-           }        
+           }
            if (null == cfg) {
                throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
            }
            final int visualID = cfg.getVisualID(VIDType.NATIVE);
            if( VisualIDHolder.VID_UNDEFINED != visualID ) {
                // gdkWindow = SWTAccessor.createCompatibleGDKChildWindow(this, visualID, clientArea.width, clientArea.height);
-               // nativeWindowHandle = SWTAccessor.gdk_window_get_xwindow(gdkWindow); 
+               // nativeWindowHandle = SWTAccessor.gdk_window_get_xwindow(gdkWindow);
                x11Window = SWTAccessor.createCompatibleX11ChildWindow(screen, this, visualID, clientArea.width, clientArea.height);
                nativeWindowHandle = x11Window;
            } else {
@@ -520,16 +520,16 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
            nativeWindowHandle = SWTAccessor.getWindowHandle(this);
        }
        final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(capsRequested.getGLProfile());
-       
+
        // Create a NativeWindow proxy for the SWT canvas
-       ProxySurface proxySurface = glFactory.createProxySurface(device, screen.getIndex(), nativeWindowHandle, 
+       ProxySurface proxySurface = glFactory.createProxySurface(device, screen.getIndex(), nativeWindowHandle,
                                                                 capsRequested, capsChooser, swtCanvasUpStreamHook);
        // Associate a GL surface with the proxy
        drawable = (GLDrawableImpl) glFactory.createGLDrawable(proxySurface);
        context = (GLContextImpl) drawable.createContext(shareWith);
-       context.setContextCreationFlags(additionalCtxCreationFlags);       
+       context.setContextCreationFlags(additionalCtxCreationFlags);
    }
-   
+
    @Override
    public void update() {
        // don't paint background etc .. nop avoids flickering
@@ -543,13 +543,13 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
        if(r && 0 != gdkWindow) {
            SWTGTKUtil.focusGDKWindow(gdkWindow);
        }
-       return r;       
+       return r;
    } */
-   
+
    @Override
    public void dispose() {
      runInGLThread(disposeOnEDTGLAction);
-     super.dispose();          
+     super.dispose();
    }
 
    private final void displayIfNoAnimatorNoCheck() {
@@ -557,14 +557,14 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
            final boolean drawableOK = null != drawable && drawable.isRealized();
            if( drawableOK || validateDrawableAndContextPostCheck() ) {
                runInGLThread(makeCurrentAndDisplayOnGLAction);
-           }                
+           }
        }
    }
-   
+
    //
    // GL[Auto]Drawable
    //
-   
+
    @Override
    public void display() {
       final boolean drawableOK = null != drawable && drawable.isRealized();
@@ -577,7 +577,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
    public final Object getUpstreamWidget() {
        return this;
    }
-   
+
    @Override
    public int getWidth() {
       return clientArea.width;
@@ -593,7 +593,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
       final GLDrawable _drawable = drawable;
       return null != _drawable ? _drawable.isGLOriented() : true;
    }
-    
+
    @Override
    public void addGLEventListener(final GLEventListener listener) {
       helper.addGLEventListener(listener);
@@ -608,29 +608,29 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
    public int getGLEventListenerCount() {
       return helper.getGLEventListenerCount();
    }
-   
+
    @Override
    public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
       return helper.getGLEventListener(index);
    }
-   
+
    @Override
    public boolean getGLEventListenerInitState(GLEventListener listener) {
        return helper.getGLEventListenerInitState(listener);
    }
-   
+
    @Override
    public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
        helper.setGLEventListenerInitState(listener, initialized);
    }
-   
+
    @Override
    public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
        final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
        runInGLThread(r);
        return r.listener;
    }
-   
+
    @Override
    public GLEventListener removeGLEventListener(final GLEventListener listener) {
       return helper.removeGLEventListener(listener);
@@ -673,7 +673,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
    public final GLDrawable getDelegatedDrawable() {
       return drawable;
    }
-   
+
    @Override
    public GLContext getContext() {
       return null != drawable ? context : null;
@@ -694,12 +694,12 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
    public boolean invoke(final boolean wait, final GLRunnable runnable) {
       return helper.invoke(this, wait, runnable);
    }
-   
+
    @Override
    public boolean invoke(final boolean wait, final List<GLRunnable> runnables) {
       return helper.invoke(this, wait, runnables);
    }
-   
+
    @Override
    public void setAnimator(final GLAnimatorControl arg0) throws GLException {
       helper.setAnimator(arg0);
@@ -714,7 +714,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
    public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
       final RecursiveLock _lock = lock;
       _lock.lock();
-      try {            
+      try {
           final GLContext oldCtx = context;
           GLDrawableHelper.switchContext(drawable, oldCtx, destroyPrevCtx, newCtx, additionalCtxCreationFlags);
           context=(GLContextImpl)newCtx;
@@ -761,7 +761,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
 
    @Override
    public GLCapabilitiesImmutable getChosenGLCapabilities() {
-      final GLDrawable _drawable = drawable; 
+      final GLDrawable _drawable = drawable;
       return null != _drawable ? (GLCapabilitiesImmutable)_drawable.getChosenGLCapabilities() : null;
    }
 
@@ -771,7 +771,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
     * @return Non-null GLCapabilities.
     */
    public GLCapabilitiesImmutable getRequestedGLCapabilities() {
-      final GLDrawable _drawable = drawable; 
+      final GLDrawable _drawable = drawable;
       return null != _drawable ? (GLCapabilitiesImmutable)_drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities() : null;
    }
 
@@ -788,7 +788,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
 
    @Override
    public long getHandle() {
-      final GLDrawable _drawable = drawable; 
+      final GLDrawable _drawable = drawable;
       return (_drawable != null) ? _drawable.getHandle() : 0;
    }
 
@@ -827,12 +827,12 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
     *   <ul>
     *     <!--li>Use {@link Threading#invokeOnOpenGLThread(boolean, Runnable)}</li-->
     *     <li>Current thread</li>
-    *   </ul></li>  
+    *   </ul></li>
     * </ul>
-    * The current thread seems to be valid for all platforms, 
+    * The current thread seems to be valid for all platforms,
     * since no SWT lifecycle tasks are being performed w/ this call.
     * Only GL task, which are independent from the SWT threading model.
-    *   
+    *
     * @see Platform#AWT_AVAILABLE
     * @see Platform#getOSType()
     */
@@ -854,8 +854,8 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
       } */
       action.run();
    }
-   
-   private void runOnEDTIfAvail(boolean wait, final Runnable action) {       
+
+   private void runOnEDTIfAvail(boolean wait, final Runnable action) {
        final Display d = isDisposed() ? null : getDisplay();
        if( null == d || d.isDisposed() || d.getThread() == Thread.currentThread() ) {
            action.run();
@@ -879,7 +879,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
                ",\n\tDrawable size "+dw+"x"+dh+
                ",\n\tSWT size "+getWidth()+"x"+getHeight()+"]";
    }
-   
+
    public static void main(final String[] args) {
        System.err.println(VersionUtil.getPlatformInfo());
        System.err.println(GlueGenVersion.getInstance());
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
index 8de178e49..80289acf3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index 80d980492..cdfb73b21 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -57,7 +57,7 @@ import javax.media.opengl.GLException;
  * Call {@link #stop() } to terminate the animation and it's execution thread.
  * </p>
  */
-public class Animator extends AnimatorBase {    
+public class Animator extends AnimatorBase {
     protected ThreadGroup threadGroup;
     private Runnable runnable;
     private boolean runAsFastAsPossible;
@@ -75,7 +75,7 @@ public class Animator extends AnimatorBase {
         }
     }
 
-    /** 
+    /**
      * Creates a new Animator w/ an associated ThreadGroup.
      */
     public Animator(ThreadGroup tg) {
@@ -86,7 +86,7 @@ public class Animator extends AnimatorBase {
         }
     }
 
-    /** 
+    /**
      * Creates a new Animator for a particular drawable.
      */
     public Animator(GLAutoDrawable drawable) {
@@ -97,7 +97,7 @@ public class Animator extends AnimatorBase {
         }
     }
 
-    /** 
+    /**
      * Creates a new Animator w/ an associated ThreadGroup for a particular drawable.
      */
     public Animator(ThreadGroup tg, GLAutoDrawable drawable) {
@@ -127,7 +127,7 @@ public class Animator extends AnimatorBase {
             stateSync.unlock();
         }
     }
-    
+
     private final void setIsAnimatingSynced(boolean v) {
         stateSync.lock();
         try {
@@ -185,7 +185,7 @@ public class Animator extends AnimatorBase {
                         }
                         if (!stopIssued && !isAnimating) {
                             // Wakes up 'waitForStartedCondition' sync
-                            // - and - 
+                            // - and -
                             // Resume from pause or drawablesEmpty,
                             // implies !pauseIssued and !drawablesEmpty
                             setIsAnimatingSynced(true); // barrier
@@ -251,7 +251,7 @@ public class Animator extends AnimatorBase {
 
     /**
      * Set a {@link ThreadGroup} for the {@link #getThread() animation thread}.
-     * 
+     *
      * @param tg the {@link ThreadGroup}
      * @throws GLException if the animator has already been started
      */
@@ -261,7 +261,7 @@ public class Animator extends AnimatorBase {
         }
         threadGroup = tg;
     }
-    
+
     public synchronized boolean start() {
         if ( isStartedImpl() ) {
             return false;
@@ -277,7 +277,7 @@ public class Animator extends AnimatorBase {
         } else {
             thread = new Thread(threadGroup, runnable, threadName);
         }
-        thread.setDaemon(false); // force to be non daemon, regardless of parent thread 
+        thread.setDaemon(false); // force to be non daemon, regardless of parent thread
         if(DEBUG) {
             final Thread ct = Thread.currentThread();
             System.err.println("Animator "+ct.getName()+"[daemon "+ct.isDaemon()+"]: starting "+thread.getName()+"[daemon "+thread.isDaemon()+"]");
@@ -288,7 +288,7 @@ public class Animator extends AnimatorBase {
     private final Condition waitForStartedCondition = new Condition() {
         public boolean eval() {
             return !isStartedImpl() || (!drawablesEmpty && !isAnimating) ;
-        } };    
+        } };
 
     public synchronized boolean stop() {
         if ( !isStartedImpl() ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
index ef92100ad..b447a339b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
@@ -52,14 +52,14 @@ import javax.media.opengl.GLProfile;
  */
 public abstract class AnimatorBase implements GLAnimatorControl {
     protected static final boolean DEBUG = Debug.debug("Animator");
-    
+
     /** A 1s timeout while waiting for a native action response, limiting {@link #finishLifecycleAction(Condition, long)} */
     protected static final long TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION = 1000;
-    
+
     protected static final long POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION = 32; // 2 frames @ 60Hz
-    
+
     /**
-     * If present in <code>modeBits</code> field and 
+     * If present in <code>modeBits</code> field and
      * {@link GLProfile#isAWTAvailable() AWT is available},
      * implementation is aware of the AWT EDT, otherwise not.
      * <p>
@@ -67,8 +67,8 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      * </p>
      * @see #setModeBits(boolean, int)
      */
-    public static final int MODE_EXPECT_AWT_RENDERING_THREAD = 1 << 0; 
-    
+    public static final int MODE_EXPECT_AWT_RENDERING_THREAD = 1 << 0;
+
     public interface AnimatorImpl {
         void display(ArrayList<GLAutoDrawable> drawables, boolean ignoreExceptions, boolean printExceptions);
         boolean blockUntilDone(Thread thread);
@@ -77,7 +77,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     protected int modeBits;
     protected AnimatorImpl impl;
     protected String baseName;
-    
+
     protected ArrayList<GLAutoDrawable> drawables = new ArrayList<GLAutoDrawable>();
     protected boolean drawablesEmpty;
     protected Thread animThread;
@@ -85,10 +85,10 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     protected boolean printExceptions;
     protected boolean exclusiveContext;
     protected Thread userExclusiveContextThread;
-    protected FPSCounterImpl fpsCounter = new FPSCounterImpl();    
+    protected FPSCounterImpl fpsCounter = new FPSCounterImpl();
     protected RecursiveLock stateSync = LockFactory.createRecursiveLock();
-    
-    private final static Class<?> awtAnimatorImplClazz;    
+
+    private final static Class<?> awtAnimatorImplClazz;
     static {
         GLProfile.initSingleton();
         if( GLProfile.isAWTAvailable() ) {
@@ -96,7 +96,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
             try {
                 clazz = Class.forName("com.jogamp.opengl.util.AWTAnimatorImpl");
             } catch (Exception e) {
-                clazz = null;                
+                clazz = null;
             }
             awtAnimatorImplClazz =  clazz;
         } else {
@@ -105,29 +105,29 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     }
 
     /**
-     * Creates a new, empty Animator instance 
+     * Creates a new, empty Animator instance
      * while expecting an AWT rendering thread if AWT is available.
-     * 
+     *
      * @see GLProfile#isAWTAvailable()
      */
     public AnimatorBase() {
-        modeBits = MODE_EXPECT_AWT_RENDERING_THREAD; // default!        
+        modeBits = MODE_EXPECT_AWT_RENDERING_THREAD; // default!
         drawablesEmpty = true;
     }
-    
+
     private static final boolean useAWTAnimatorImpl(int modeBits) {
         return 0 != ( MODE_EXPECT_AWT_RENDERING_THREAD & modeBits ) && null != awtAnimatorImplClazz;
     }
-    
+
     /**
      * Initializes implementation details post setup,
      * invoked at {@link #add(GLAutoDrawable)}, {@link #start()}, ..
      * <p>
-     * Operation is a NOP if <code>force</code> is <code>false</code> 
+     * Operation is a NOP if <code>force</code> is <code>false</code>
      * and this instance is already initialized.
-     * </p> 
-     * 
-     * @throws GLException if Animator is {@link #isStarted()}  
+     * </p>
+     *
+     * @throws GLException if Animator is {@link #isStarted()}
      */
     protected synchronized void initImpl(boolean force) {
         if( force || null == impl ) {
@@ -153,8 +153,8 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      * in this Animators <code>modeBits</code>.
      * @param enable
      * @param bitValues
-     * 
-     * @throws GLException if Animator is {@link #isStarted()} and {@link #MODE_EXPECT_AWT_RENDERING_THREAD} about to change 
+     *
+     * @throws GLException if Animator is {@link #isStarted()} and {@link #MODE_EXPECT_AWT_RENDERING_THREAD} about to change
      * @see AnimatorBase#MODE_EXPECT_AWT_RENDERING_THREAD
      */
     public synchronized void setModeBits(boolean enable, int bitValues) throws GLException {
@@ -172,8 +172,8 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         }
     }
     public synchronized int getModeBits() { return modeBits; }
-    
-    
+
+
     @Override
     public synchronized void add(final GLAutoDrawable drawable) {
         if(DEBUG) {
@@ -190,7 +190,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         drawables.add(drawable);
         drawablesEmpty = drawables.size() == 0;
         drawable.setAnimator(this);
-        if( isPaused() ) { // either paused by pause() above, or if previously drawablesEmpty==true 
+        if( isPaused() ) { // either paused by pause() above, or if previously drawablesEmpty==true
             resume();
         }
         final Condition waitForAnimatingAndECTCondition = new Condition() {
@@ -213,7 +213,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         if( !drawables.contains(drawable) ) {
             throw new IllegalArgumentException("Drawable not added to animator: "+this+", "+drawable);
         }
-        
+
         if( exclusiveContext && isAnimating() ) {
             drawable.setExclusiveContextThread( null );
             final Condition waitForNullECTCondition = new Condition() {
@@ -244,7 +244,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
             return isStarted() && drawablesEmpty && isAnimating();
         } };
 
-    
+
     /**
      * Dedicate all {@link GLAutoDrawable}'s context to the given exclusive context thread.
      * <p>
@@ -252,14 +252,14 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      * </p>
      * <p>
      * If already started and disabling, method waits
-     * until change is propagated to all {@link GLAutoDrawable} if not 
+     * until change is propagated to all {@link GLAutoDrawable} if not
      * called from the animator thread or {@link #getExclusiveContextThread() exclusive context thread}.
      * </p>
      * <p>
      * Note: Utilizing this feature w/ AWT could lead to an AWT-EDT deadlock, depending on the AWT implementation.
      * Hence it is advised not to use it with native AWT GLAutoDrawable like GLCanvas.
      * </p>
-     * 
+     *
      * @param enable
      * @return previous value
      * @see #setExclusiveContext(boolean)
@@ -272,7 +272,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         final boolean enable = null != t;
         stateSync.lock();
         try {
-            old = userExclusiveContextThread;            
+            old = userExclusiveContextThread;
             if( enable && t != animThread ) { // disable: will be cleared at end after propagation && filter out own animThread usae
                 userExclusiveContextThread=t;
             }
@@ -282,7 +282,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         setExclusiveContext(enable);
         return old;
     }
-    
+
     /**
      * Dedicate all {@link GLAutoDrawable}'s context to this animator thread.
      * <p>
@@ -290,14 +290,14 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      * </p>
      * <p>
      * If already started and disabling, method waits
-     * until change is propagated to all {@link GLAutoDrawable} if not 
+     * until change is propagated to all {@link GLAutoDrawable} if not
      * called from the animator thread or {@link #getExclusiveContextThread() exclusive context thread}.
      * </p>
      * <p>
      * Note: Utilizing this feature w/ AWT could lead to an AWT-EDT deadlock, depending on the AWT implementation.
      * Hence it is advised not to use it with native AWT GLAutoDrawable like GLCanvas.
      * </p>
-     * 
+     *
      * @param enable
      * @return previous value
      * @see #setExclusiveContext(Thread)
@@ -349,24 +349,24 @@ public abstract class AnimatorBase implements GLAnimatorControl {
             System.err.println("AnimatorBase.setExclusiveContextThread: all-GLAD Ok: "+validateDrawablesExclCtxState(dECT)+", "+this);
         }
         return oldExclusiveContext;
-    }    
-    
+    }
+
     /**
      * Returns <code>true</code>, if the exclusive context thread is enabled, otherwise <code>false</code>.
-     * 
+     *
      * @see #setExclusiveContext(boolean)
      * @see #setExclusiveContext(Thread)
      */
     // @Override
-    public final boolean isExclusiveContextEnabled() { 
+    public final boolean isExclusiveContextEnabled() {
         stateSync.lock();
         try {
-            return exclusiveContext; 
+            return exclusiveContext;
         } finally {
             stateSync.unlock();
         }
     }
-    
+
     /**
      * Returns the exclusive context thread if {@link #isExclusiveContextEnabled()} and {@link #isStarted()}, otherwise <code>null</code>.
      * <p>
@@ -381,7 +381,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      * @see #setExclusiveContext(Thread)
      */
     // @Override
-    public final Thread getExclusiveContextThread() { 
+    public final Thread getExclusiveContextThread() {
         stateSync.lock();
         try {
             return ( isStartedImpl() && exclusiveContext ) ? ( null != userExclusiveContextThread ? userExclusiveContextThread : animThread ) : null ;
@@ -389,7 +389,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
             stateSync.unlock();
         }
     }
-    
+
     /**
      * Should be called at {@link #start()} and {@link #stop()}
      * from within the animator thread.
@@ -407,7 +407,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         for (int i=0; i<drawables.size(); i++) {
             try {
                 drawables.get(i).setExclusiveContextThread( enable ? ect : null );
-            } catch (RuntimeException e) { 
+            } catch (RuntimeException e) {
                 e.printStackTrace();
             }
         }
@@ -420,7 +420,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         }
         return true;
     }
-    
+
     @Override
     public final Thread getThread() {
         stateSync.lock();
@@ -445,7 +445,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     public final void setUpdateFPSFrames(int frames, PrintStream out) {
         fpsCounter.setUpdateFPSFrames(frames, out);
     }
-    
+
     @Override
     public final void resetFPSCounter() {
         fpsCounter.resetFPSCounter();
@@ -455,7 +455,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     public final int getUpdateFPSFrames() {
         return fpsCounter.getUpdateFPSFrames();
     }
-    
+
     @Override
     public final long getFPSStartTime()   {
         return fpsCounter.getFPSStartTime();
@@ -470,12 +470,12 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     public final long getLastFPSPeriod() {
         return fpsCounter.getLastFPSPeriod();
     }
-    
+
     @Override
     public final float getLastFPS() {
         return fpsCounter.getLastFPS();
     }
-    
+
     @Override
     public final int getTotalFPSFrames() {
         return fpsCounter.getTotalFPSFrames();
@@ -485,11 +485,11 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     public final long getTotalFPSDuration() {
         return fpsCounter.getTotalFPSDuration();
     }
-    
+
     @Override
     public final float getTotalFPS() {
         return fpsCounter.getTotalFPS();
-    }        
+    }
 
     /** Sets a flag causing this Animator to ignore exceptions produced
     while redrawing the drawables. By default this flag is set to
@@ -512,10 +512,10 @@ public abstract class AnimatorBase implements GLAnimatorControl {
          */
         boolean eval();
     }
-    
+
     /**
      * @param waitCondition method will wait until TO is reached or {@link Condition#eval() waitCondition.eval()} returns <code>false</code>.
-     * @param pollPeriod if <code>0</code>, method will wait until TO is reached or being notified. 
+     * @param pollPeriod if <code>0</code>, method will wait until TO is reached or being notified.
      *                   if &gt; <code>0</code>, method will wait for the given <code>pollPeriod</code> in milliseconds.
      * @return <code>true</code> if {@link Condition#eval() waitCondition.eval()} returned <code>false</code>, otherwise <code>false</code>.
      */
@@ -545,11 +545,11 @@ public abstract class AnimatorBase implements GLAnimatorControl {
             if( remaining<=0 && nok ) {
                 System.err.println("finishLifecycleAction(" + waitCondition.getClass().getName() + "): ++++++ timeout reached ++++++ " + getThreadName());
             }
-            stateSync.lock(); // avoid too many lock/unlock ops 
+            stateSync.lock(); // avoid too many lock/unlock ops
             try {
                 System.err.println("finishLifecycleAction(" + waitCondition.getClass().getName() + "): OK "+(!nok)+
                         "- pollPeriod "+pollPeriod+", blocking "+blocking+
-                        ", waited " + (blocking ? ( TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION - remaining ) : 0 ) + "/" + TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION +                         
+                        ", waited " + (blocking ? ( TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION - remaining ) : 0 ) + "/" + TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION +
                         " - " + getThreadName());
                 System.err.println(" - "+toString());
             } finally {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
index bbd2951b9..0477e1903 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
diff --git a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
index 7613efec6..b48169c27 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -45,10 +45,10 @@ import java.util.TimerTask;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLException;
 
-/** 
+/**
  * An Animator subclass which attempts to achieve a target
  * frames-per-second rate to avoid using all CPU time. The target FPS
- * is only an estimate and is not guaranteed. 
+ * is only an estimate and is not guaranteed.
  * <p>
  * The Animator execution thread does not run as a daemon thread,
  * so it is able to keep an application from terminating.<br>
@@ -105,45 +105,45 @@ public class FPSAnimator extends AnimatorBase {
      * @param fps
      * @throws GLException if the animator has already been started
      */
-    public final synchronized void setFPS(int fps) throws GLException { 
+    public final synchronized void setFPS(int fps) throws GLException {
         if ( isStartedImpl() ) {
             throw new GLException("Animator already started.");
         }
-        this.fps = fps; 
+        this.fps = fps;
     }
     public final int getFPS() { return fps; }
-    
+
     class MainTask extends TimerTask {
         private boolean justStarted;
         private boolean alreadyStopped;
         private boolean alreadyPaused;
-        
+
         public MainTask() {
         }
-        
+
         public void start(Timer timer) {
             fpsCounter.resetFPSCounter();
             shouldRun = true;
             shouldStop = false;
-            
+
             justStarted = true;
             alreadyStopped = false;
             alreadyPaused = false;
 
-            final long period = 0 < fps ? (long) (1000.0f / (float) fps) : 1; // 0 -> 1: IllegalArgumentException: Non-positive period         
+            final long period = 0 < fps ? (long) (1000.0f / (float) fps) : 1; // 0 -> 1: IllegalArgumentException: Non-positive period
             if (scheduleAtFixedRate) {
                 timer.scheduleAtFixedRate(this, 0, period);
             } else {
                 timer.schedule(this, 0, period);
             }
         }
-        
+
         public boolean isActive() { return !alreadyStopped && !alreadyPaused; }
-        
+
         public String toString() {
             return "Task[thread "+animThread+", stopped "+alreadyStopped+", paused "+alreadyPaused+" shouldRun "+shouldRun+", shouldStop "+shouldStop+" -- started "+isStartedImpl()+", animating "+isAnimatingImpl()+", paused "+isPausedImpl()+", drawable "+drawables.size()+", drawablesEmpty "+drawablesEmpty+"]";
         }
-                    
+
         public void run() {
             if( justStarted ) {
                 justStarted = false;
@@ -167,8 +167,8 @@ public class FPSAnimator extends AnimatorBase {
                 display();
             } else if( shouldStop ) { // STOP
                 System.err.println("FPSAnimator P4: "+alreadyStopped+", "+ Thread.currentThread() + ": " + toString());
-                this.cancel();                
-                
+                this.cancel();
+
                 if( !alreadyStopped ) {
                     alreadyStopped = true;
                     if( exclusiveContext && !drawablesEmpty ) {
@@ -184,23 +184,23 @@ public class FPSAnimator extends AnimatorBase {
                         FPSAnimator.this.notifyAll();
                     }
                 }
-            } else { 
+            } else {
                 System.err.println("FPSAnimator P5: "+alreadyPaused+", "+ Thread.currentThread() + ": " + toString());
                 this.cancel();
-                
+
                 if( !alreadyPaused ) { // PAUSE
                     alreadyPaused = true;
                     if( exclusiveContext && !drawablesEmpty ) {
                         setDrawablesExclCtxState(false);
                         display(); // propagate exclusive change!
                     }
-                    synchronized (FPSAnimator.this) {                        
+                    synchronized (FPSAnimator.this) {
                         if(DEBUG) {
                             System.err.println("FPSAnimator pause " + Thread.currentThread() + ": " + toString());
                         }
                         isAnimating = false;
                         FPSAnimator.this.notifyAll();
-                    }    
+                    }
                 }
             }
         }
@@ -230,7 +230,7 @@ public class FPSAnimator extends AnimatorBase {
     }
 
     static int timerNo = 0;
-    
+
     public synchronized boolean start() {
         if ( null != timer || null != task || isStartedImpl() ) {
             return false;
@@ -241,8 +241,8 @@ public class FPSAnimator extends AnimatorBase {
             System.err.println("FPSAnimator.start() START: "+task+", "+ Thread.currentThread() + ": " + toString());
         }
         task.start(timer);
-        
-        final boolean res = finishLifecycleAction( drawablesEmpty ? waitForStartedEmptyCondition : waitForStartedAddedCondition, 
+
+        final boolean res = finishLifecycleAction( drawablesEmpty ? waitForStartedEmptyCondition : waitForStartedAddedCondition,
                                                    POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION);
         if(DEBUG) {
             System.err.println("FPSAnimator.start() END: "+task+", "+ Thread.currentThread() + ": " + toString());
@@ -256,11 +256,11 @@ public class FPSAnimator extends AnimatorBase {
     private final Condition waitForStartedAddedCondition = new Condition() {
         public boolean eval() {
             return !isStartedImpl() || !isAnimating ;
-        } };    
+        } };
     private final Condition waitForStartedEmptyCondition = new Condition() {
         public boolean eval() {
             return !isStartedImpl() || isAnimating ;
-        } };    
+        } };
 
     /** Stops this FPSAnimator. Due to the implementation of the
     FPSAnimator it is not guaranteed that the FPSAnimator will be
@@ -268,7 +268,7 @@ public class FPSAnimator extends AnimatorBase {
     public synchronized boolean stop() {
         if ( null == timer || !isStartedImpl() ) {
             return false;
-        }        
+        }
         if(DEBUG) {
             System.err.println("FPSAnimator.stop() START: "+task+", "+ Thread.currentThread() + ": " + toString());
         }
@@ -281,7 +281,7 @@ public class FPSAnimator extends AnimatorBase {
             shouldStop = true;
             res = finishLifecycleAction(waitForStoppedCondition, POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION);
         }
-        
+
         if(DEBUG) {
             System.err.println("FPSAnimator.stop() END: "+task+", "+ Thread.currentThread() + ": " + toString());
         }
@@ -316,7 +316,7 @@ public class FPSAnimator extends AnimatorBase {
             shouldRun = false;
             res = finishLifecycleAction(waitForPausedCondition, POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION);
         }
-        
+
         if(DEBUG) {
             System.err.println("FPSAnimator.pause() END: "+task+", "+ Thread.currentThread() + ": " + toString());
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
index e0bbbc33c..2d685a1a8 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
@@ -53,13 +53,13 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    * and starting with a new created Buffer object with initialElementCount size
    *
    * On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
-   * On profile ES2 the fixed function emulation will transform these calls to 
+   * On profile ES2 the fixed function emulation will transform these calls to
    * EnableVertexAttribArray and VertexAttribPointer calls,
    * and a predefined vertex attribute variable name will be chosen.
-   * 
-   * The default name mapping will be used, 
+   *
+   * The default name mapping will be used,
    * see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}.
-   *              
+   *
    * @param index The GL array index
    * @param comps The array component number
    * @param dataType The array index GL data type
@@ -67,7 +67,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    * @param initialElementCount
    *
    * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
-   */  
+   */
   public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int initialElementCount)
     throws GLException
   {
@@ -82,13 +82,13 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    * and starting with a given Buffer object incl it's stride
    *
    * On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
-   * On profile ES2 the fixed function emulation will transform these calls to 
+   * On profile ES2 the fixed function emulation will transform these calls to
    * EnableVertexAttribArray and VertexAttribPointer calls,
    * and a predefined vertex attribute variable name will be chosen.
-   * 
-   * The default name mapping will be used, 
+   *
+   * The default name mapping will be used,
    * see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}.
-   *              
+   *
    * @param index The GL array index
    * @param comps The array component number
    * @param dataType The array index GL data type
@@ -97,8 +97,8 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    * @param buffer the user define data
    *
    * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
-   */  
-  public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int stride, 
+   */
+  public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int stride,
                                               Buffer buffer)
     throws GLException
   {
@@ -111,13 +111,13 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   /**
    * Create a client side buffer object, using a custom GLSL array attribute name
    * and starting with a new created Buffer object with initialElementCount size
-   * @param name  The custom name for the GL attribute. 
+   * @param name  The custom name for the GL attribute.
    * @param comps The array component number
    * @param dataType The array index GL data type
    * @param normalized Whether the data shall be normalized
    * @param initialElementCount
    */
-  public static GLArrayDataClient createGLSL(String name, int comps, 
+  public static GLArrayDataClient createGLSL(String name, int comps,
                                              int dataType, boolean normalized, int initialElementCount)
     throws GLException
   {
@@ -130,7 +130,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   /**
    * Create a client side buffer object, using a custom GLSL array attribute name
    * and starting with a given Buffer object incl it's stride
-   * @param name  The custom name for the GL attribute. 
+   * @param name  The custom name for the GL attribute.
    * @param comps The array component number
    * @param dataType The array index GL data type
    * @param normalized Whether the data shall be normalized
@@ -157,8 +157,8 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
           }
       }
   }
-  
-  // 
+
+  //
   // Data read access
   //
 
@@ -167,7 +167,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
 
   @Override
   public final boolean sealed() { return sealed; }
-  
+
   @Override
   public final boolean enabled() { return bufferEnabled; }
 
@@ -195,10 +195,10 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
     seal(seal);
     enableBuffer(gl, seal);
   }
-  
+
   @Override
   public void enableBuffer(GL gl, boolean enable) {
-    if( enableBufferAlways || bufferEnabled != enable ) { 
+    if( enableBufferAlways || bufferEnabled != enable ) {
         if(enable) {
             checkSeal(true);
             // init/generate VBO name if not done yet
@@ -208,7 +208,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
         bufferEnabled = enable;
     }
   }
-  
+
   @Override
   public boolean bindBuffer(GL gl, boolean bind) {
       if(bind) {
@@ -218,7 +218,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
       }
       return glArrayHandler.bindBuffer(gl, bind);
   }
-  
+
   @Override
   public void setEnableAlways(boolean always) {
     enableBufferAlways = always;
@@ -328,15 +328,15 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
                        ", isVertexAttribute "+isVertexAttribute+
                        ", usesGLSL "+usesGLSL+
                        ", usesShaderState "+(null!=shaderState)+
-                       ", dataType 0x"+Integer.toHexString(componentType)+ 
-                       ", bufferClazz "+componentClazz+ 
+                       ", dataType 0x"+Integer.toHexString(componentType)+
+                       ", bufferClazz "+componentClazz+
                        ", elements "+getElementCount()+
-                       ", components "+components+ 
+                       ", components "+components+
                        ", stride "+strideB+"b "+strideL+"c"+
-                       ", initialElementCount "+initialElementCount+ 
-                       ", sealed "+sealed+ 
-                       ", bufferEnabled "+bufferEnabled+ 
-                       ", bufferWritten "+bufferWritten+ 
+                       ", initialElementCount "+initialElementCount+
+                       ", sealed "+sealed+
+                       ", bufferEnabled "+bufferEnabled+
+                       ", bufferWritten "+bufferWritten+
                        ", buffer "+buffer+
                        ", alive "+alive+
                        "]";
@@ -345,16 +345,16 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   // non public matters
 
   protected final boolean growBufferIfNecessary(int spare) {
-    if(buffer==null || buffer.remaining()<spare) { 
+    if(buffer==null || buffer.remaining()<spare) {
         growBuffer(Math.max(initialElementCount, spare));
         return true;
     }
     return false;
   }
 
-  protected final void growBuffer(int additionalElements) {     
+  protected final void growBuffer(int additionalElements) {
     if(!alive || sealed) {
-       throw new GLException("Invalid state: "+this); 
+       throw new GLException("Invalid state: "+this);
     }
 
     // add the stride delta
@@ -362,7 +362,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
 
     final int osize = (buffer!=null) ? buffer.capacity() : 0;
     final int nsize = osize + ( additionalElements * components );
-    
+
     if(componentClazz==ByteBuffer.class) {
         ByteBuffer newBBuffer = Buffers.newDirectByteBuffer( nsize );
         if(buffer!=null) {
@@ -401,18 +401,18 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
 
   protected final void checkSeal(boolean test) throws GLException {
     if(!alive) {
-        throw new GLException("Invalid state: "+this); 
-    }    
+        throw new GLException("Invalid state: "+this);
+    }
     if(sealed!=test) {
         if(test) {
-            throw new GLException("Not Sealed yet, seal first:\n\t"+this); 
+            throw new GLException("Not Sealed yet, seal first:\n\t"+this);
         } else {
-            throw new GLException("Already Sealed, can't modify VBO:\n\t"+this); 
+            throw new GLException("Already Sealed, can't modify VBO:\n\t"+this);
         }
     }
   }
 
-  protected void init(String name, int index, int comps, int dataType, boolean normalized, int stride, Buffer data, 
+  protected void init(String name, int index, int comps, int dataType, boolean normalized, int stride, Buffer data,
                       int initialElementCount, boolean isVertexAttribute, GLArrayHandler handler,
                       int vboName, long vboOffset, int vboUsage, int vboTarget, boolean usesGLSL)
     throws GLException
@@ -433,12 +433,12 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   }
 
   private boolean isValidated = false;
-  
+
   protected void init_vbo(GL gl) {
       if(!isValidated ) {
           isValidated = true;
           validate(gl.getGLProfile(), true);
-      }      
+      }
   }
 
   protected GLArrayDataClient() { }
@@ -453,6 +453,6 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   protected GLArrayHandler glArrayHandler;
   protected boolean usesGLSL;
   protected ShaderState shaderState;
-    
+
 }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java
index 9b04a48aa..701f88e59 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java
@@ -40,24 +40,24 @@ public interface GLArrayDataEditable extends GLArrayData {
      *
      * @see #seal(boolean)
      * @see #enableBuffer(GL, boolean)
-     * 
+     *
      */
     public void seal(GL gl, boolean seal);
 
     /**
-     * Enables the buffer if <code>enable</code> is <code>true</code>, 
+     * Enables the buffer if <code>enable</code> is <code>true</code>,
      * and transfers the data if required.
      * In case {@link #isVBO() VBO is used}, it is bound accordingly for the data transfer and association,
      * i.e. it issued {@link #bindBuffer(GL, boolean)}.
-     * The VBO buffer is unbound when the method returns. 
+     * The VBO buffer is unbound when the method returns.
      * <p>
-     * Disables the buffer if <code>enable</code> is <code>false</code>. 
+     * Disables the buffer if <code>enable</code> is <code>false</code>.
      * </p>
-     * 
+     *
      * <p>The action will only be executed,
-     * if the internal enable state differs, 
+     * if the internal enable state differs,
      * or 'setEnableAlways' was called with 'true'.</b>
-     * 
+     *
      * <p>It is up to the user to enable/disable the array properly,
      * ie in case of multiple data sets for the same vertex attribute (VA).
      * Meaning in such case usage of one set while expecting another one
@@ -68,7 +68,7 @@ public interface GLArrayDataEditable extends GLArrayData {
     public void enableBuffer(GL gl, boolean enable);
 
     /**
-     * if <code>bind</code> is true and the data uses {@link #isVBO() VBO}, 
+     * if <code>bind</code> is true and the data uses {@link #isVBO() VBO},
      * the latter will be bound and data written to the GPU if required.
      * <p>
      * If  <code>bind</code> is false and the data uses {@link #isVBO() VBO},
@@ -79,11 +79,11 @@ public interface GLArrayDataEditable extends GLArrayData {
      * to be bounded and written while keeping the VBO bound. The latter is in contrast to {@link #enableBuffer(GL, boolean)},
      * which leaves the VBO unbound, since it's not required for vertex attributes or pointers.
      * </p>
-     * 
+     *
      * @param gl current GL object
-     * @param bind true if VBO shall be bound and data written, 
-     *        otherwise clear VBO binding. 
-     * @return true if data uses VBO and action was performed, otherwise false 
+     * @param bind true if VBO shall be bound and data written,
+     *        otherwise clear VBO binding.
+     * @return true if data uses VBO and action was performed, otherwise false
      */
     public boolean bindBuffer(GL gl, boolean bind);
 
@@ -92,7 +92,7 @@ public interface GLArrayDataEditable extends GLArrayData {
      *
      * The default is 'false'
      *
-     * This is useful when you mix up 
+     * This is useful when you mix up
      * GLArrayData usage with conventional GL array calls
      * or in case of a buggy GL VBO implementation.
      *
@@ -117,7 +117,7 @@ public interface GLArrayDataEditable extends GLArrayData {
      * ie position:=limit and limit:=capacity.</p>
      *
      * @see #seal(boolean)
-     */    
+     */
     public void seal(boolean seal);
 
     public void rewind();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
index 7e7d27b36..80639c5c7 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
@@ -57,13 +57,13 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * and starting with a given Buffer object incl it's stride
    *
    * On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
-   * On profile ES2 the fixed function emulation will transform these calls to 
+   * On profile ES2 the fixed function emulation will transform these calls to
    * EnableVertexAttribArray and VertexAttribPointer calls,
    * and a predefined vertex attribute variable name will be chosen.
-   * 
-   * The default name mapping will be used, 
+   *
+   * The default name mapping will be used,
    * see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}.
-   *              
+   *
    * @param index The GL array index
    * @param comps The array component number
    * @param dataType The array index GL data type
@@ -90,13 +90,13 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * and starting with a new created Buffer object with initialElementCount size
    *
    * On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
-   * On profile ES2 the fixed function emulation will transform these calls to 
+   * On profile ES2 the fixed function emulation will transform these calls to
    * EnableVertexAttribArray and VertexAttribPointer calls,
    * and a predefined vertex attribute variable name will be chosen.
-   * 
-   * The default name mapping will be used, 
+   *
+   * The default name mapping will be used,
    * see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}.
-   *              
+   *
    * @param index The GL array index
    * @param comps The array component number
    * @param dataType The array index GL data type
@@ -106,7 +106,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    *
    * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
    */
-  public static GLArrayDataServer createFixed(int index, int comps, int dataType, boolean normalized, int initialElementCount, 
+  public static GLArrayDataServer createFixed(int index, int comps, int dataType, boolean normalized, int initialElementCount,
                                               int vboUsage)
     throws GLException
   {
@@ -120,7 +120,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
   /**
    * Create a VBO, using a custom GLSL array attribute name
    * and starting with a new created Buffer object with initialElementCount size
-   * @param name  The custom name for the GL attribute    
+   * @param name  The custom name for the GL attribute
    * @param comps The array component number
    * @param dataType The array index GL data type
    * @param normalized Whether the data shall be normalized
@@ -128,20 +128,20 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
   public static GLArrayDataServer createGLSL(String name, int comps,
-                                             int dataType, boolean normalized, int initialElementCount, int vboUsage) 
-    throws GLException 
+                                             int dataType, boolean normalized, int initialElementCount, int vboUsage)
+    throws GLException
   {
     GLArrayDataServer ads = new GLArrayDataServer();
     GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
     ads.init(name, -1, comps, dataType, normalized, 0, null, initialElementCount,
              true, glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
     return ads;
-  }  
-  
+  }
+
   /**
    * Create a VBO, using a custom GLSL array attribute name
    * and starting with a given Buffer object incl it's stride
-   * @param name  The custom name for the GL attribute     
+   * @param name  The custom name for the GL attribute
    * @param comps The array component number
    * @param dataType The array index GL data type
    * @param normalized Whether the data shall be normalized
@@ -151,7 +151,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    */
   public static GLArrayDataServer createGLSL(String name, int comps,
                                              int dataType, boolean normalized, int stride, Buffer buffer,
-                                             int vboUsage) 
+                                             int vboUsage)
     throws GLException
   {
     GLArrayDataServer ads = new GLArrayDataServer();
@@ -160,12 +160,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
              0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
     return ads;
   }
-  
+
   /**
    * Create a VBO data object for any target w/o render pipeline association, ie {@link GL#GL_ELEMENT_ARRAY_BUFFER}.
-   * 
+   *
    * Hence no index, name for a fixed function pipeline nor vertex attribute is given.
-   * 
+   *
    * @param comps The array component number
    * @param dataType The array index GL data type
    * @param stride
@@ -187,16 +187,16 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
 
   /**
    * Create a VBO data object for any target w/o render pipeline association, ie {@link GL#GL_ELEMENT_ARRAY_BUFFER}.
-   * 
+   *
    * Hence no index, name for a fixed function pipeline nor vertex attribute is given.
-   * 
+   *
    * @param comps The array component number
    * @param dataType The array index GL data type
    * @param initialElementCount
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    * @param vboTarget {@link GL#GL_ELEMENT_ARRAY_BUFFER}, ..
    */
-  public static GLArrayDataServer createData(int comps, int dataType, int initialElementCount, 
+  public static GLArrayDataServer createData(int comps, int dataType, int initialElementCount,
                                              int vboUsage, int vboTarget)
     throws GLException
   {
@@ -207,19 +207,19 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
     return ads;
   }
 
-  
+
   /**
    * Create a VBO for fixed function interleaved array data
    * starting with a new created Buffer object with initialElementCount size.
    * <p>User needs to <i>configure</i> the interleaved segments via {@link #addFixedSubArray(int, int, int)}.</p>
-   * 
+   *
    * @param comps The total number of all interleaved components.
    * @param dataType The array index GL data type
    * @param normalized Whether the data shall be normalized
-   * @param initialElementCount 
+   * @param initialElementCount
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createFixedInterleaved(int comps, int dataType, boolean normalized, int initialElementCount, 
+  public static GLArrayDataServer createFixedInterleaved(int comps, int dataType, boolean normalized, int initialElementCount,
                                               int vboUsage)
     throws GLException
   {
@@ -239,7 +239,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * The memory of the the interleaved array is being used.</p>
    * <p>
    * Must be called before using the array, eg: {@link #seal(boolean)}, {@link #putf(float)}, .. </p>
-   * 
+   *
    * @param index The GL array index, maybe -1 if vboTarget is {@link GL#GL_ELEMENT_ARRAY_BUFFER}
    * @param comps This interleaved array segment's component number
    * @param vboTarget {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
@@ -250,32 +250,32 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
           throw new GLException("Interleaved offset > total components ("+iOffC+" > "+getComponentCount()+")");
       }
       if(usesGLSL) {
-          throw new GLException("buffer uses GLSL");          
+          throw new GLException("buffer uses GLSL");
       }
       final GLArrayDataWrapper ad = GLArrayDataWrapper.createFixed(
-              index, comps, getComponentType(), 
-              getNormalized(), getStride(), getBuffer(), 
+              index, comps, getComponentType(),
+              getNormalized(), getStride(), getBuffer(),
               getVBOName(), interleavedOffset, getVBOUsage(), vboTarget);
       ad.setVBOEnabled(isVBO());
       interleavedOffset += comps * getComponentSizeInBytes();
-      if(GL.GL_ARRAY_BUFFER == vboTarget) { 
+      if(GL.GL_ARRAY_BUFFER == vboTarget) {
           glArrayHandler.addSubHandler(new GLFixedArrayHandlerFlat(ad));
       }
       return ad;
   }
-  
+
   /**
    * Create a VBO for GLSL interleaved array data
    * starting with a new created Buffer object with initialElementCount size.
    * <p>User needs to <i>configure</i> the interleaved segments via {@link #addGLSLSubArray(int, int, int)}.</p>
-   * 
+   *
    * @param comps The total number of all interleaved components.
    * @param dataType The array index GL data type
    * @param normalized Whether the data shall be normalized
-   * @param initialElementCount 
+   * @param initialElementCount
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createGLSLInterleaved(int comps, int dataType, boolean normalized, int initialElementCount, 
+  public static GLArrayDataServer createGLSLInterleaved(int comps, int dataType, boolean normalized, int initialElementCount,
                                               int vboUsage)
     throws GLException
   {
@@ -285,7 +285,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
              0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
     return ads;
   }
-  
+
   /**
    * Configure a segment of this GLSL interleaved array (see {@link #createGLSLInterleaved(int, int, boolean, int, int)}).
    * <p>
@@ -305,20 +305,20 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
           throw new GLException("Interleaved offset > total components ("+iOffC+" > "+getComponentCount()+")");
       }
       if(!usesGLSL) {
-          throw new GLException("buffer uses fixed function");          
+          throw new GLException("buffer uses fixed function");
       }
       final GLArrayDataWrapper ad = GLArrayDataWrapper.createGLSL(
-              name, comps, getComponentType(), 
-              getNormalized(), getStride(), getBuffer(), 
-              getVBOName(), interleavedOffset, getVBOUsage(), vboTarget);      
+              name, comps, getComponentType(),
+              getNormalized(), getStride(), getBuffer(),
+              getVBOName(), interleavedOffset, getVBOUsage(), vboTarget);
       ad.setVBOEnabled(isVBO());
       interleavedOffset += comps * getComponentSizeInBytes();
-      if(GL.GL_ARRAY_BUFFER == vboTarget) { 
+      if(GL.GL_ARRAY_BUFFER == vboTarget) {
           glArrayHandler.addSubHandler(new GLSLArrayHandlerFlat(ad));
       }
       return ad;
   }
-  
+
   //
   // Data matters GLArrayData
   //
@@ -341,15 +341,15 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
   }
 
   //
-  // data matters 
+  // data matters
   //
 
   /**
-   * Convenient way do disable the VBO behavior and 
+   * Convenient way do disable the VBO behavior and
    * switch to client side data one
    * Only possible if buffer is defined.
    */
-  public void    setVBOEnabled(boolean vboUsage) { 
+  public void    setVBOEnabled(boolean vboUsage) {
     checkSeal(false);
     super.setVBOEnabled(vboUsage);
   }
@@ -361,22 +361,22 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
                        ", isVertexAttribute "+isVertexAttribute+
                        ", usesGLSL "+usesGLSL+
                        ", usesShaderState "+(null!=shaderState)+
-                       ", dataType 0x"+Integer.toHexString(componentType)+ 
-                       ", bufferClazz "+componentClazz+ 
+                       ", dataType 0x"+Integer.toHexString(componentType)+
+                       ", bufferClazz "+componentClazz+
                        ", elements "+getElementCount()+
-                       ", components "+components+ 
+                       ", components "+components+
                        ", stride "+strideB+"b "+strideL+"c"+
                        ", initialElementCount "+initialElementCount+
-                       ", vboEnabled "+vboEnabled+ 
-                       ", vboName "+vboName+ 
-                       ", vboUsage 0x"+Integer.toHexString(vboUsage)+ 
-                       ", vboTarget 0x"+Integer.toHexString(vboTarget)+ 
-                       ", vboOffset "+vboOffset+                        
-                       ", sealed "+sealed+ 
-                       ", bufferEnabled "+bufferEnabled+ 
-                       ", bufferWritten "+bufferWritten+ 
-                       ", buffer "+buffer+ 
-                       ", alive "+alive+                       
+                       ", vboEnabled "+vboEnabled+
+                       ", vboName "+vboName+
+                       ", vboUsage 0x"+Integer.toHexString(vboUsage)+
+                       ", vboTarget 0x"+Integer.toHexString(vboTarget)+
+                       ", vboOffset "+vboOffset+
+                       ", sealed "+sealed+
+                       ", bufferEnabled "+bufferEnabled+
+                       ", bufferWritten "+bufferWritten+
+                       ", buffer "+buffer+
+                       ", alive "+alive+
                        "]";
   }
 
@@ -384,7 +384,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
   // non public matters ..
   //
 
-  protected void init(String name, int index, int comps, int dataType, boolean normalized, 
+  protected void init(String name, int index, int comps, int dataType, boolean normalized,
                       int stride, Buffer data, int initialElementCount, boolean isVertexAttribute,
                       GLArrayHandler glArrayHandler,
                       int vboName, long vboOffset, int vboUsage, int vboTarget, boolean usesGLSL)
@@ -407,7 +407,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
         }
     }
   }
-  
-  private int interleavedOffset = 0;  
+
+  private int interleavedOffset = 0;
 }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
index f8b17501e..290f47a6d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
@@ -49,7 +49,7 @@ public class GLArrayDataWrapper implements GLArrayData {
 
   /**
    * Create a VBO, using a predefined fixed function array index, wrapping the given data.
-   * 
+   *
    * @param index The GL array index
    * @param comps The array component number
    * @param dataType The array index GL data type
@@ -61,23 +61,23 @@ public class GLArrayDataWrapper implements GLArrayData {
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    * @param vboTarget {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
    * @return the new create instance
-   * 
+   *
    * @throws GLException
    */
-  public static GLArrayDataWrapper createFixed(int index, int comps, int dataType, boolean normalized, int stride, 
+  public static GLArrayDataWrapper createFixed(int index, int comps, int dataType, boolean normalized, int stride,
                                                Buffer buffer, int vboName, long vboOffset, int vboUsage, int vboTarget)
     throws GLException
   {
       GLArrayDataWrapper adc = new GLArrayDataWrapper();
-      adc.init(null, index, comps, dataType, normalized, stride, buffer, false, 
+      adc.init(null, index, comps, dataType, normalized, stride, buffer, false,
                vboName, vboOffset, vboUsage, vboTarget);
       return adc;
   }
 
   /**
    * Create a VBO, using a custom GLSL array attribute name, wrapping the given data.
-   * 
-   * @param name  The custom name for the GL attribute, maybe null if gpuBufferTarget is {@link GL#GL_ELEMENT_ARRAY_BUFFER}    
+   *
+   * @param name  The custom name for the GL attribute, maybe null if gpuBufferTarget is {@link GL#GL_ELEMENT_ARRAY_BUFFER}
    * @param comps The array component number
    * @param dataType The array index GL data type
    * @param normalized Whether the data shall be normalized
@@ -90,7 +90,7 @@ public class GLArrayDataWrapper implements GLArrayData {
    * @return the new create instance
    * @throws GLException
    */
-  public static GLArrayDataWrapper createGLSL(String name, int comps, int dataType, boolean normalized, int stride, 
+  public static GLArrayDataWrapper createGLSL(String name, int comps, int dataType, boolean normalized, int stride,
                                              Buffer buffer, int vboName, long vboOffset, int vboUsage, int vboTarget)
     throws GLException
   {
@@ -102,8 +102,8 @@ public class GLArrayDataWrapper implements GLArrayData {
 
   /**
    * Validates this instance's parameter. Called automatically by {@link GLArrayDataClient} and {@link GLArrayDataServer}.
-   * {@link GLArrayDataWrapper} does not validate it's instance by itself.   
-   * 
+   * {@link GLArrayDataWrapper} does not validate it's instance by itself.
+   *
    * @param glp the GLProfile to use
    * @param throwException whether to throw an exception if this instance has invalid parameter or not
    * @return true if this instance has invalid parameter, otherwise false
@@ -113,7 +113,7 @@ public class GLArrayDataWrapper implements GLArrayData {
         if(throwException) {
             throw new GLException("Instance !alive "+this);
         }
-        return false;        
+        return false;
     }
     if(this.isVertexAttribute() && !glp.hasGLSL()) {
         if(throwException) {
@@ -123,13 +123,13 @@ public class GLArrayDataWrapper implements GLArrayData {
     }
     return glp.isValidArrayDataType(getIndex(), getComponentCount(), getComponentType(), isVertexAttribute(), throwException);
   }
-    
+
   @Override
   public void associate(Object obj, boolean enable) {
       // nop
   }
-  
-  // 
+
+  //
   // Data read access
   //
 
@@ -150,14 +150,14 @@ public class GLArrayDataWrapper implements GLArrayData {
       location = gl.glGetAttribLocation(program, name);
       return location;
   }
-  
+
   @Override
   public final int setLocation(GL2ES2 gl, int program, int location) {
       this.location = location;
       gl.glBindAttribLocation(program, location, name);
       return location;
   }
-  
+
   @Override
   public final String getName() { return name; }
 
@@ -172,10 +172,10 @@ public class GLArrayDataWrapper implements GLArrayData {
 
   @Override
   public final int getVBOUsage() { return vboEnabled?vboUsage:0; }
-  
+
   @Override
   public final int getVBOTarget() { return vboEnabled?vboTarget:0; }
-  
+
   @Override
   public final Buffer getBuffer() { return buffer; }
 
@@ -187,19 +187,19 @@ public class GLArrayDataWrapper implements GLArrayData {
 
   @Override
   public final int getComponentSizeInBytes() { return componentByteSize; }
-  
+
   @Override
   public final int getElementCount() {
     if(null==buffer) return 0;
     return ( buffer.position()==0 ) ? ( buffer.limit() / components ) : ( buffer.position() / components ) ;
   }
-  
+
   @Override
   public final int getSizeInBytes() {
     if(null==buffer) return 0;
-    return ( buffer.position()==0 ) ? ( buffer.limit() * componentByteSize ) : ( buffer.position() * componentByteSize ) ;      
+    return ( buffer.position()==0 ) ? ( buffer.limit() * componentByteSize ) : ( buffer.position() * componentByteSize ) ;
   }
-  
+
   @Override
   public final boolean getNormalized() { return normalized; }
 
@@ -223,18 +223,18 @@ public class GLArrayDataWrapper implements GLArrayData {
                        ", index "+index+
                        ", location "+location+
                        ", isVertexAttribute "+isVertexAttribute+
-                       ", dataType 0x"+Integer.toHexString(componentType)+ 
-                       ", bufferClazz "+componentClazz+ 
+                       ", dataType 0x"+Integer.toHexString(componentType)+
+                       ", bufferClazz "+componentClazz+
                        ", elements "+getElementCount()+
-                       ", components "+components+ 
+                       ", components "+components+
                        ", stride "+strideB+"b "+strideL+"c"+
-                       ", buffer "+buffer+ 
-                       ", vboEnabled "+vboEnabled+ 
-                       ", vboName "+vboName+ 
-                       ", vboUsage 0x"+Integer.toHexString(vboUsage)+ 
-                       ", vboTarget 0x"+Integer.toHexString(vboTarget)+ 
-                       ", vboOffset "+vboOffset+ 
-                       ", alive "+alive+                       
+                       ", buffer "+buffer+
+                       ", vboEnabled "+vboEnabled+
+                       ", vboName "+vboName+
+                       ", vboUsage 0x"+Integer.toHexString(vboUsage)+
+                       ", vboTarget 0x"+Integer.toHexString(vboTarget)+
+                       ", vboOffset "+vboOffset+
+                       ", alive "+alive+
                        "]";
   }
 
@@ -252,12 +252,12 @@ public class GLArrayDataWrapper implements GLArrayData {
             return IntBuffer.class;
         case GL.GL_FLOAT:
             return FloatBuffer.class;
-        default:    
+        default:
             throw new GLException("Given OpenGL data type not supported: "+dataType);
     }
   }
 
-  @Override  
+  @Override
   public void setName(String newName) {
     location = -1;
     name = newName;
@@ -267,7 +267,7 @@ public class GLArrayDataWrapper implements GLArrayData {
    * Enable or disable use of VBO.
    * Only possible if a VBO buffer name is defined.
    * @see #setVBOName(int)
-   */  
+   */
   public void setVBOEnabled(boolean vboEnabled) {
     this.vboEnabled=vboEnabled;
   }
@@ -275,31 +275,31 @@ public class GLArrayDataWrapper implements GLArrayData {
   /**
    * Set the VBO buffer name, if valid (!= 0) enable use of VBO,
    * otherwise (==0) disable VBO usage.
-   * 
+   *
    * @see #setVBOEnabled(boolean)
-   */  
+   */
   public void    setVBOName(int vboName) {
     this.vboName=vboName;
     setVBOEnabled(0!=vboName);
   }
 
- /**  
+ /**
   * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
-  */  
-  public void setVBOUsage(int vboUsage) { 
-      this.vboUsage = vboUsage; 
+  */
+  public void setVBOUsage(int vboUsage) {
+      this.vboUsage = vboUsage;
   }
-  
-  /**  
+
+  /**
    * @param vboTarget either {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
-   */  
+   */
   public void setVBOTarget(int vboTarget) {
       this.vboTarget = vboTarget;
-  }  
+  }
 
-  protected void init(String name, int index, int components, int componentType, 
-                      boolean normalized, int stride, Buffer data, 
-                      boolean isVertexAttribute, 
+  protected void init(String name, int index, int components, int componentType,
+                      boolean normalized, int stride, Buffer data,
+                      boolean isVertexAttribute,
                       int vboName, long vboOffset, int vboUsage, int vboTarget)
     throws GLException
   {
@@ -307,19 +307,19 @@ public class GLArrayDataWrapper implements GLArrayData {
     this.index = index;
     this.location = -1;
     // We can't have any dependence on the FixedFuncUtil class here for build bootstrapping reasons
-    
+
     if( GL.GL_ELEMENT_ARRAY_BUFFER == vboTarget ) {
         // OK ..
     } else if( ( 0 == vboUsage && 0 == vboTarget ) || GL.GL_ARRAY_BUFFER == vboTarget ) {
-        // Set/Check name .. - Required for GLSL case. Validation and debug-name for FFP. 
+        // Set/Check name .. - Required for GLSL case. Validation and debug-name for FFP.
         this.name = ( null == name ) ? GLPointerFuncUtil.getPredefinedArrayIndexName(index) : name ;
         if(null == this.name ) {
             throw new GLException("Not a valid array buffer index: "+index);
-        }        
+        }
     } else if( 0 < vboTarget ) {
         throw new GLException("Invalid GPUBuffer target: 0x"+Integer.toHexString(vboTarget));
     }
-    
+
     this.componentType = componentType;
     componentClazz = getBufferClass(componentType);
     if( GLBuffers.isGLTypeFixedPoint(componentType) ) {
@@ -329,7 +329,7 @@ public class GLArrayDataWrapper implements GLArrayData {
     }
     componentByteSize = GLBuffers.sizeOfGLType(componentType);
     if(0 > componentByteSize) {
-        throw new GLException("Given componentType not supported: "+componentType+":\n\t"+this);       
+        throw new GLException("Given componentType not supported: "+componentType+":\n\t"+this);
     }
     if(0 >= components) {
         throw new GLException("Invalid number of components: " + components);
@@ -348,7 +348,7 @@ public class GLArrayDataWrapper implements GLArrayData {
     this.vboName= vboName;
     this.vboEnabled= 0 != vboName ;
     this.vboOffset=vboOffset;
-    
+
     switch(vboUsage) {
         case 0: // nop
         case GL.GL_STATIC_DRAW:
@@ -356,7 +356,7 @@ public class GLArrayDataWrapper implements GLArrayData {
         case GL2ES2.GL_STREAM_DRAW:
             break;
         default:
-            throw new GLException("invalid gpuBufferUsage: "+vboUsage+":\n\t"+this); 
+            throw new GLException("invalid gpuBufferUsage: "+vboUsage+":\n\t"+this);
     }
     switch(vboTarget) {
         case 0: // nop
@@ -367,7 +367,7 @@ public class GLArrayDataWrapper implements GLArrayData {
             throw new GLException("invalid gpuBufferTarget: "+vboTarget+":\n\t"+this);
     }
     this.vboUsage=vboUsage;
-    this.vboTarget=vboTarget;    
+    this.vboTarget=vboTarget;
     this.alive=true;
   }
 
@@ -390,6 +390,6 @@ public class GLArrayDataWrapper implements GLArrayData {
   protected int vboName;
   protected boolean vboEnabled;
   protected int vboUsage;
-  protected int vboTarget;  
+  protected int vboTarget;
 }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
index 6bdea4518..418d7fa81 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -52,7 +52,7 @@ import com.jogamp.common.nio.Buffers;
 
 /**
  * Utility routines for dealing with direct buffers.
- * 
+ *
  * @author Kenneth Russel, et.al.
  */
 public class GLBuffers extends Buffers {
@@ -72,11 +72,11 @@ public class GLBuffers extends Buffers {
             case GL.GL_UNSIGNED_INT:
             case GL2.GL_HILO16_NV:
                 return false;
-                
+
         }
         return true;
     }
-    
+
     /**
      * @param glType GL primitive type
      * @return false if one of GL primitive floating point types, otherwise true
@@ -92,19 +92,19 @@ public class GLBuffers extends Buffers {
             case GLES2.GL_HALF_FLOAT_OES:
             case GL2GL3.GL_DOUBLE:
                 return false;
-                
+
             default:
                 return true;
-        }        
+        }
     }
-    
+
     /**
      * @param glType shall be one of (31) <br/>
      *              GL_BYTE, GL_UNSIGNED_BYTE, <br/>
      *              GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
      *              <br/>
      *              GL_SHORT, GL_UNSIGNED_SHORT, <br/>
-     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/> 
+     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
      *              GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
@@ -112,16 +112,16 @@ public class GLBuffers extends Buffers {
      *              <br/>
      *              GL_FIXED, GL_INT <br/>
      *              GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
-     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/> 
+     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
      *              GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
-     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/> 
+     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
      *              GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
      *              <br/>
      *              GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
      *              <br/>
-     *              GL_FLOAT, GL_DOUBLE <br/> 
-     *              
-     * @return -1 if glType is unhandled, otherwise the actual value > 0 
+     *              GL_FLOAT, GL_DOUBLE <br/>
+     *
+     * @return -1 if glType is unhandled, otherwise the actual value > 0
      */
     public static final int sizeOfGLType(int glType) {
         switch (glType) { // 29
@@ -131,7 +131,7 @@ public class GLBuffers extends Buffers {
             case GL2GL3.GL_UNSIGNED_BYTE_3_3_2:
             case GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV:
                 return SIZEOF_BYTE;
-                
+
             case GL.GL_SHORT:
             case GL.GL_UNSIGNED_SHORT:
             case GL.GL_UNSIGNED_SHORT_5_6_5:
@@ -145,40 +145,40 @@ public class GLBuffers extends Buffers {
             case GL.GL_HALF_FLOAT:
             case GLES2.GL_HALF_FLOAT_OES:
                 return SIZEOF_SHORT;
-                                
+
             case GL.GL_FIXED:
             case GL2ES2.GL_INT:
             case GL.GL_UNSIGNED_INT:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
             case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
-            case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:                
+            case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
             case GL2GL3.GL_UNSIGNED_INT_24_8:
             case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
             case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
             case GL2.GL_HILO16_NV:
             case GL2.GL_SIGNED_HILO16_NV:
                 return SIZEOF_INT;
-                
+
             case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
                 return SIZEOF_LONG;
-                
+
             case GL.GL_FLOAT:
                 return SIZEOF_FLOAT;
-                
+
             case GL2GL3.GL_DOUBLE:
                 return SIZEOF_DOUBLE;
         }
         return -1;
     }
-    
+
     /**
      * @param glType shall be one of (31) <br/>
      *              GL_BYTE, GL_UNSIGNED_BYTE, <br/>
      *              GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
      *              <br/>
      *              GL_SHORT, GL_UNSIGNED_SHORT, <br/>
-     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/> 
+     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
      *              GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
@@ -186,16 +186,16 @@ public class GLBuffers extends Buffers {
      *              <br/>
      *              GL_FIXED, GL_INT <br/>
      *              GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
-     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/> 
+     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
      *              GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
-     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/> 
+     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
      *              GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
      *              <br/>
      *              GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
      *              <br/>
-     *              GL_FLOAT, GL_DOUBLE <br/> 
-     *              
-     * @return null if glType is unhandled, otherwise the new Buffer object 
+     *              GL_FLOAT, GL_DOUBLE <br/>
+     *
+     * @return null if glType is unhandled, otherwise the new Buffer object
      */
     public static final Buffer newDirectGLBuffer(int glType, int numElements) {
         switch (glType) { // 29
@@ -204,7 +204,7 @@ public class GLBuffers extends Buffers {
             case GL2GL3.GL_UNSIGNED_BYTE_3_3_2:
             case GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV:
                 return newDirectByteBuffer(numElements);
-                
+
             case GL.GL_SHORT:
             case GL.GL_UNSIGNED_SHORT:
             case GL.GL_UNSIGNED_SHORT_5_6_5:
@@ -218,7 +218,7 @@ public class GLBuffers extends Buffers {
             case GL.GL_HALF_FLOAT:
             case GLES2.GL_HALF_FLOAT_OES:
                 return newDirectShortBuffer(numElements);
-                
+
             case GL.GL_FIXED:
             case GL2ES2.GL_INT:
             case GL.GL_UNSIGNED_INT:
@@ -232,13 +232,13 @@ public class GLBuffers extends Buffers {
             case GL2.GL_HILO16_NV:
             case GL2.GL_SIGNED_HILO16_NV:
                 return newDirectIntBuffer(numElements);
-                
+
             case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
                 return newDirectLongBuffer(numElements);
-                
+
             case GL.GL_FLOAT:
                 return newDirectFloatBuffer(numElements);
-                
+
             case GL2.GL_DOUBLE:
                 return newDirectDoubleBuffer(numElements);
         }
@@ -251,7 +251,7 @@ public class GLBuffers extends Buffers {
      *              GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
      *              <br/>
      *              GL_SHORT, GL_UNSIGNED_SHORT, <br/>
-     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/> 
+     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
      *              GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
@@ -259,15 +259,15 @@ public class GLBuffers extends Buffers {
      *              <br/>
      *              GL_FIXED, GL_INT <br/>
      *              GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
-     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/> 
+     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
      *              GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
-     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/> 
+     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
      *              GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
      *              <br/>
      *              GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
      *              <br/>
-     *              GL_FLOAT, GL_DOUBLE <br/> 
-     * @return null if glType is unhandled or parent is null or bufLen is 0, otherwise the new Buffer object 
+     *              GL_FLOAT, GL_DOUBLE <br/>
+     * @return null if glType is unhandled or parent is null or bufLen is 0, otherwise the new Buffer object
      */
     public static final Buffer sliceGLBuffer(ByteBuffer parent, int bytePos, int byteLen, int glType) {
         if (parent == null || byteLen == 0) {
@@ -275,11 +275,11 @@ public class GLBuffers extends Buffers {
         }
         final int parentPos = parent.position();
         final int parentLimit = parent.limit();
-        
+
         parent.position(bytePos);
         parent.limit(bytePos + byteLen);
         Buffer res = null;
-        
+
         switch (glType) { // 29
             case GL.GL_BYTE:
             case GL.GL_UNSIGNED_BYTE:
@@ -287,7 +287,7 @@ public class GLBuffers extends Buffers {
             case GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV:
                 res = parent.slice().order(parent.order()); // slice and duplicate may change byte order
                 break;
-                
+
             case GL.GL_SHORT:
             case GL.GL_UNSIGNED_SHORT:
             case GL.GL_UNSIGNED_SHORT_5_6_5:
@@ -302,7 +302,7 @@ public class GLBuffers extends Buffers {
             case GLES2.GL_HALF_FLOAT_OES:
                 res = parent.slice().order(parent.order()).asShortBuffer(); // slice and duplicate may change byte order
                 break;
-                
+
             case GL.GL_FIXED:
             case GL2GL3.GL_INT:
             case GL2ES2.GL_UNSIGNED_INT:
@@ -317,15 +317,15 @@ public class GLBuffers extends Buffers {
             case GL2.GL_SIGNED_HILO16_NV:
                 res = parent.slice().order(parent.order()).asIntBuffer(); // slice and duplicate may change byte order
                 break;
-                
+
             case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
                 res = parent.slice().order(parent.order()).asLongBuffer(); // slice and duplicate may change byte order
                 break;
-                
+
             case GL.GL_FLOAT:
                 res = parent.slice().order(parent.order()).asFloatBuffer(); // slice and duplicate may change byte order
                 break;
-                
+
             case GL2.GL_DOUBLE:
                 res = parent.slice().order(parent.order()).asDoubleBuffer(); // slice and duplicate may change byte order
                 break;
@@ -338,29 +338,29 @@ public class GLBuffers extends Buffers {
         gl.glGetIntegerv(pname, tmp, 0);
         return tmp[0];
     }
-    
-    /** 
+
+    /**
      * Returns the number of bytes required to read/write a memory buffer via OpenGL
      * using the current GL pixel storage state and the given parameters.
-     * 
+     *
      * <p>This method is security critical, hence it throws an exception (fail-fast)
-     * in case of an invalid alignment. In case we forgot to handle 
-     * proper values, please contact the maintainer.</p> 
-     *   
+     * in case of an invalid alignment. In case we forgot to handle
+     * proper values, please contact the maintainer.</p>
+     *
      * @param gl the current GL object
-     * 
+     *
      * @param tmp a pass through integer array of size >= 1 used to store temp data (performance)
-     * 
+     *
      * @param bytesPerPixel bytes per pixel, i.e. via {@link #bytesPerPixel(int, int)}.
      * @param width in pixels
      * @param height in pixels
      * @param depth in pixels
-     * @param pack true for read mode GPU -> CPU (pack), otherwise false for write mode CPU -> GPU (unpack)  
+     * @param pack true for read mode GPU -> CPU (pack), otherwise false for write mode CPU -> GPU (unpack)
      * @return required minimum size of the buffer in bytes
      * @throws GLException if alignment is invalid. Please contact the maintainer if this is our bug.
      */
-    public static final int sizeof(GL gl, int tmp[], 
-                                   int bytesPerPixel, int width, int height, int depth, 
+    public static final int sizeof(GL gl, int tmp[],
+                                   int bytesPerPixel, int width, int height, int depth,
                                    boolean pack) {
         int rowLength = 0;
         int skipRows = 0;
@@ -368,31 +368,31 @@ public class GLBuffers extends Buffers {
         int alignment = 1;
         int imageHeight = 0;
         int skipImages = 0;
-  
-        if (pack) {          
+
+        if (pack) {
           alignment = glGetInteger(gl, GL.GL_PACK_ALIGNMENT, tmp);
           if(gl.isGL2GL3()) {
               rowLength = glGetInteger(gl, GL2GL3.GL_PACK_ROW_LENGTH, tmp);
-              skipRows = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_ROWS, tmp);              
+              skipRows = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_ROWS, tmp);
               skipPixels = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_PIXELS, tmp);
-              if (depth > 1) {                  
-                  imageHeight = glGetInteger(gl, GL2GL3.GL_PACK_IMAGE_HEIGHT, tmp);                  
+              if (depth > 1) {
+                  imageHeight = glGetInteger(gl, GL2GL3.GL_PACK_IMAGE_HEIGHT, tmp);
                   skipImages = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_IMAGES, tmp);
               }
           }
-        } else {          
+        } else {
           alignment = glGetInteger(gl, GL.GL_UNPACK_ALIGNMENT, tmp);
-          if(gl.isGL2GL3 ()) {              
-              rowLength = glGetInteger(gl, GL2GL3.GL_UNPACK_ROW_LENGTH, tmp);              
-              skipRows = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_ROWS, tmp);              
+          if(gl.isGL2GL3 ()) {
+              rowLength = glGetInteger(gl, GL2GL3.GL_UNPACK_ROW_LENGTH, tmp);
+              skipRows = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_ROWS, tmp);
               skipPixels = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_PIXELS, tmp);
-              if (depth > 1) {                  
-                  imageHeight = glGetInteger(gl, GL2GL3.GL_UNPACK_IMAGE_HEIGHT, tmp);                  
+              if (depth > 1) {
+                  imageHeight = glGetInteger(gl, GL2GL3.GL_UNPACK_IMAGE_HEIGHT, tmp);
                   skipImages = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_IMAGES, tmp);
                }
           }
         }
-          
+
         // Try to deal somewhat correctly with potentially invalid values
         width       = Math.max(0, width );
         height      = Math.max(1, height); // min 1D
@@ -401,13 +401,13 @@ public class GLBuffers extends Buffers {
         skipPixels  = Math.max(0, skipPixels);
         alignment   = Math.max(1, alignment);
         skipImages  = Math.max(0, skipImages);
-  
+
         imageHeight = ( imageHeight > 0 ) ? imageHeight : height;
         rowLength   = ( rowLength   > 0 ) ? rowLength   : width;
-  
+
         int rowLengthInBytes = rowLength  * bytesPerPixel;
         int skipBytes        = skipPixels * bytesPerPixel;
-        
+
         switch(alignment) {
             case 1:
                 break;
@@ -423,71 +423,71 @@ public class GLBuffers extends Buffers {
                     if (remainder > 0) {
                         skipBytes += alignment - remainder;
                     }
-                } 
+                }
                 break;
             default:
-                throw new GLException("Invalid alignment "+alignment+", must be 2**n (1,2,4,8). Pls notify the maintainer in case this is our bug.");        
+                throw new GLException("Invalid alignment "+alignment+", must be 2**n (1,2,4,8). Pls notify the maintainer in case this is our bug.");
         }
-  
+
         /**
          * skipImages, depth, skipPixels and skipRows are static offsets.
          *
          * skipImages and depth are in multiples of image size.
          *
          * skipBytes and rowLengthInBytes are aligned
-         * 
-         * rowLengthInBytes is the aligned byte offset 
+         *
+         * rowLengthInBytes is the aligned byte offset
          * from line n to line n+1 at the same x-axis position.
          */
         return
             skipBytes +                                                  // aligned skipPixels * bpp
-          ( skipImages + depth  - 1 ) * imageHeight * rowLengthInBytes + // aligned whole images 
+          ( skipImages + depth  - 1 ) * imageHeight * rowLengthInBytes + // aligned whole images
           ( skipRows   + height - 1 ) * rowLengthInBytes +               // aligned lines
-            width                     * bytesPerPixel;                   // last line        
+            width                     * bytesPerPixel;                   // last line
     }
-  
-    /** 
+
+    /**
      * Returns the number of bytes required to read/write a memory buffer via OpenGL
      * using the current GL pixel storage state and the given parameters.
-     * 
+     *
      * <p>This method is security critical, hence it throws an exception (fail-fast)
-     * in case either the format, type or alignment is unhandled. In case we forgot to handle 
-     * proper values, please contact the maintainer.</p> 
-     * 
+     * in case either the format, type or alignment is unhandled. In case we forgot to handle
+     * proper values, please contact the maintainer.</p>
+     *
      * <p> See {@link #bytesPerPixel(int, int)}. </p>
-     * 
+     *
      * @param gl the current GL object
-     * 
+     *
      * @param tmp a pass through integer array of size >= 1 used to store temp data (performance)
-     * 
-     * @param format must be one of (27) <br/> 
-     *              GL_COLOR_INDEX GL_STENCIL_INDEX <br/> 
-     *              GL_DEPTH_COMPONENT GL_DEPTH_STENCIL <br/> 
-     *              GL_RED GL_RED_INTEGER <br/> 
-     *              GL_GREEN GL_GREEN_INTEGER <br/> 
-     *              GL_BLUE GL_BLUE_INTEGER <br/> 
-     *              GL_ALPHA GL_LUMINANCE (12) <br/> 
-     *              <br/> 
+     *
+     * @param format must be one of (27) <br/>
+     *              GL_COLOR_INDEX GL_STENCIL_INDEX <br/>
+     *              GL_DEPTH_COMPONENT GL_DEPTH_STENCIL <br/>
+     *              GL_RED GL_RED_INTEGER <br/>
+     *              GL_GREEN GL_GREEN_INTEGER <br/>
+     *              GL_BLUE GL_BLUE_INTEGER <br/>
+     *              GL_ALPHA GL_LUMINANCE (12) <br/>
+     *              <br/>
      *              GL_LUMINANCE_ALPHA GL_RG <br/>
-     *              GL_RG_INTEGER GL_HILO_NV <br/> 
-     *              GL_SIGNED_HILO_NV (5) <br/> 
-     *              <br/> 
-     *              GL_YCBCR_422_APPLE <br/> 
-     *              <br/> 
-     *              GL_RGB GL_RGB_INTEGER <br/> 
-     *              GL_BGR GL_BGR_INTEGER (4)<br/>  
-     *              <br/> 
-     *              GL_RGBA GL_RGBA_INTEGER <br/> 
+     *              GL_RG_INTEGER GL_HILO_NV <br/>
+     *              GL_SIGNED_HILO_NV (5) <br/>
+     *              <br/>
+     *              GL_YCBCR_422_APPLE <br/>
+     *              <br/>
+     *              GL_RGB GL_RGB_INTEGER <br/>
+     *              GL_BGR GL_BGR_INTEGER (4)<br/>
+     *              <br/>
+     *              GL_RGBA GL_RGBA_INTEGER <br/>
      *              GL_BGRA GL_BGRA_INTEGER <br/>
-     *              GL_ABGR_EXT (5)<br/> 
-     *           
-     * @param type must be one of (32) <br/>  
-     *              GL_BITMAP, <br/> 
+     *              GL_ABGR_EXT (5)<br/>
+     *
+     * @param type must be one of (32) <br/>
+     *              GL_BITMAP, <br/>
      *              GL_BYTE, GL_UNSIGNED_BYTE, <br/>
      *              GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
      *              <br/>
      *              GL_SHORT, GL_UNSIGNED_SHORT, <br/>
-     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/> 
+     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
      *              GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
@@ -495,70 +495,70 @@ public class GLBuffers extends Buffers {
      *              <br/>
      *              GL_FIXED, GL_INT <br/>
      *              GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
-     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/> 
+     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
      *              GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
-     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/> 
+     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
      *              GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
      *              <br/>
      *              GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
      *              <br/>
-     *              GL_FLOAT, GL_DOUBLE <br/> 
-     * 
+     *              GL_FLOAT, GL_DOUBLE <br/>
+     *
      * @param width in pixels
      * @param height in pixels
      * @param depth in pixels
-     * @param pack true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU  
+     * @param pack true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU
      * @return required minimum size of the buffer in bytes
      * @throws GLException if format, type or alignment is not handled. Please contact the maintainer if this is our bug.
      */
-    public static final int sizeof(GL gl, int tmp[], 
+    public static final int sizeof(GL gl, int tmp[],
                                    int format, int type, int width, int height, int depth,
                                    boolean pack) throws GLException {
         if (width < 0) return 0;
         if (height < 0) return 0;
         if (depth < 0) return 0;
-        
+
         final int bytesPerPixel = bytesPerPixel(format, type);
         return sizeof(gl, tmp, bytesPerPixel, width, height, depth, pack);
     }
-    
-    /** 
+
+    /**
      * Returns the number of bytes required for one pixel with the the given OpenGL format and type.
-     * 
+     *
      * <p>This method is security critical, hence it throws an exception (fail-fast)
-     * in case either the format, type or alignment is unhandled. In case we forgot to handle 
-     * proper values, please contact the maintainer.</p> 
-     * 
+     * in case either the format, type or alignment is unhandled. In case we forgot to handle
+     * proper values, please contact the maintainer.</p>
+     *
      * <p> See {@link #componentCount(int)}. </p>
-     * 
-     * @param format must be one of (27) <br/> 
-     *              GL_COLOR_INDEX GL_STENCIL_INDEX <br/> 
-     *              GL_DEPTH_COMPONENT GL_DEPTH_STENCIL <br/> 
-     *              GL_RED GL_RED_INTEGER <br/> 
-     *              GL_GREEN GL_GREEN_INTEGER <br/> 
-     *              GL_BLUE GL_BLUE_INTEGER <br/> 
-     *              GL_ALPHA GL_LUMINANCE (12) <br/> 
-     *              <br/> 
+     *
+     * @param format must be one of (27) <br/>
+     *              GL_COLOR_INDEX GL_STENCIL_INDEX <br/>
+     *              GL_DEPTH_COMPONENT GL_DEPTH_STENCIL <br/>
+     *              GL_RED GL_RED_INTEGER <br/>
+     *              GL_GREEN GL_GREEN_INTEGER <br/>
+     *              GL_BLUE GL_BLUE_INTEGER <br/>
+     *              GL_ALPHA GL_LUMINANCE (12) <br/>
+     *              <br/>
      *              GL_LUMINANCE_ALPHA GL_RG <br/>
-     *              GL_RG_INTEGER GL_HILO_NV <br/> 
-     *              GL_SIGNED_HILO_NV (5) <br/> 
-     *              <br/> 
-     *              GL_YCBCR_422_APPLE <br/> 
-     *              <br/> 
-     *              GL_RGB GL_RGB_INTEGER <br/> 
-     *              GL_BGR GL_BGR_INTEGER (4)<br/>  
-     *              <br/> 
-     *              GL_RGBA GL_RGBA_INTEGER <br/> 
+     *              GL_RG_INTEGER GL_HILO_NV <br/>
+     *              GL_SIGNED_HILO_NV (5) <br/>
+     *              <br/>
+     *              GL_YCBCR_422_APPLE <br/>
+     *              <br/>
+     *              GL_RGB GL_RGB_INTEGER <br/>
+     *              GL_BGR GL_BGR_INTEGER (4)<br/>
+     *              <br/>
+     *              GL_RGBA GL_RGBA_INTEGER <br/>
      *              GL_BGRA GL_BGRA_INTEGER <br/>
-     *              GL_ABGR_EXT (5)<br/> 
-     *           
-     * @param type must be one of (32) <br/>  
-     *              GL_BITMAP, <br/> 
+     *              GL_ABGR_EXT (5)<br/>
+     *
+     * @param type must be one of (32) <br/>
+     *              GL_BITMAP, <br/>
      *              GL_BYTE, GL_UNSIGNED_BYTE, <br/>
      *              GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
      *              <br/>
      *              GL_SHORT, GL_UNSIGNED_SHORT, <br/>
-     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/> 
+     *              GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
      *              GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
      *              GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
@@ -566,15 +566,15 @@ public class GLBuffers extends Buffers {
      *              <br/>
      *              GL_FIXED, GL_INT <br/>
      *              GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
-     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/> 
+     *              GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
      *              GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
-     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/> 
+     *              GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
      *              GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
      *              <br/>
      *              GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
      *              <br/>
-     *              GL_FLOAT, GL_DOUBLE <br/> 
-     * 
+     *              GL_FLOAT, GL_DOUBLE <br/>
+     *
      * @return required size of one pixel in bytes
      * @throws GLException if format or type alignment is not handled. Please contact the maintainer if this is our bug.
      */
@@ -582,14 +582,14 @@ public class GLBuffers extends Buffers {
         int compSize = 0;
 
         int compCount = componentCount(format);
-        
+
         switch (type) /* 30 */ {
             case GL2.GL_BITMAP:
               if (GL2.GL_COLOR_INDEX == format || GL2GL3.GL_STENCIL_INDEX == format) {
                   compSize = 1;
               }
             case GL.GL_BYTE:
-            case GL.GL_UNSIGNED_BYTE:                
+            case GL.GL_UNSIGNED_BYTE:
               compSize = 1;
               break;
             case GL.GL_SHORT:
@@ -607,7 +607,7 @@ public class GLBuffers extends Buffers {
             case GL2GL3.GL_DOUBLE:
               compSize = 8;
               break;
-              
+
             case GL2GL3.GL_UNSIGNED_BYTE_3_3_2:
             case GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV:
               compSize = 1;
@@ -630,7 +630,7 @@ public class GLBuffers extends Buffers {
             case GL2.GL_SIGNED_HILO16_NV:
               compSize = 2;
               compCount = 2;
-              break;                
+              break;
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
             case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
@@ -640,52 +640,52 @@ public class GLBuffers extends Buffers {
             case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
               compSize = 4;
               compCount = 1;
-              break;              
+              break;
             case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
               compSize = 8;
               compCount = 1;
-              break;              
-                
+              break;
+
             default:
               throw new GLException("type 0x"+Integer.toHexString(type)+"/"+"format 0x"+Integer.toHexString(format)+" not supported [yet], pls notify the maintainer in case this is our bug.");
-        }        
+        }
         return compCount * compSize;
     }
-    
-    /** 
+
+    /**
      * Returns the number of components required for the given OpenGL format.
-     * 
+     *
      * <p>This method is security critical, hence it throws an exception (fail-fast)
-     * in case either the format, type or alignment is unhandled. In case we forgot to handle 
-     * proper values, please contact the maintainer.</p> 
-     *   
-     * @param format must be one of (27) <br/> 
-     *              GL_COLOR_INDEX GL_STENCIL_INDEX <br/> 
-     *              GL_DEPTH_COMPONENT GL_DEPTH_STENCIL <br/> 
-     *              GL_RED GL_RED_INTEGER <br/> 
-     *              GL_GREEN GL_GREEN_INTEGER <br/> 
-     *              GL_BLUE GL_BLUE_INTEGER <br/> 
-     *              GL_ALPHA GL_LUMINANCE (12) <br/> 
-     *              <br/> 
+     * in case either the format, type or alignment is unhandled. In case we forgot to handle
+     * proper values, please contact the maintainer.</p>
+     *
+     * @param format must be one of (27) <br/>
+     *              GL_COLOR_INDEX GL_STENCIL_INDEX <br/>
+     *              GL_DEPTH_COMPONENT GL_DEPTH_STENCIL <br/>
+     *              GL_RED GL_RED_INTEGER <br/>
+     *              GL_GREEN GL_GREEN_INTEGER <br/>
+     *              GL_BLUE GL_BLUE_INTEGER <br/>
+     *              GL_ALPHA GL_LUMINANCE (12) <br/>
+     *              <br/>
      *              GL_LUMINANCE_ALPHA GL_RG <br/>
-     *              GL_RG_INTEGER GL_HILO_NV <br/> 
-     *              GL_SIGNED_HILO_NV (5) <br/> 
-     *              <br/> 
-     *              GL_YCBCR_422_APPLE <br/> 
-     *              <br/> 
-     *              GL_RGB GL_RGB_INTEGER <br/> 
-     *              GL_BGR GL_BGR_INTEGER (4)<br/>  
-     *              <br/> 
-     *              GL_RGBA GL_RGBA_INTEGER <br/> 
+     *              GL_RG_INTEGER GL_HILO_NV <br/>
+     *              GL_SIGNED_HILO_NV (5) <br/>
+     *              <br/>
+     *              GL_YCBCR_422_APPLE <br/>
+     *              <br/>
+     *              GL_RGB GL_RGB_INTEGER <br/>
+     *              GL_BGR GL_BGR_INTEGER (4)<br/>
+     *              <br/>
+     *              GL_RGBA GL_RGBA_INTEGER <br/>
      *              GL_BGRA GL_BGRA_INTEGER <br/>
-     *              GL_ABGR_EXT (5)<br/> 
-     *           
+     *              GL_ABGR_EXT (5)<br/>
+     *
      * @return number of components required for the given OpenGL format
      * @throws GLException if format is not handled. Please contact the maintainer if this is our bug.
      */
     public static final int componentCount(int format) throws GLException {
         final int compCount;
-        
+
         switch (format) /* 26 */ {
             case GL2.GL_COLOR_INDEX:
             case GL2GL3.GL_STENCIL_INDEX:
@@ -711,10 +711,10 @@ public class GLBuffers extends Buffers {
             case GL.GL_RGB:
             case GL2GL3.GL_RGB_INTEGER:
             case GL2GL3.GL_BGR:
-            case GL2GL3.GL_BGR_INTEGER: 
+            case GL2GL3.GL_BGR_INTEGER:
               compCount = 3;
               break;
-            case GL2.GL_YCBCR_422_APPLE: 
+            case GL2.GL_YCBCR_422_APPLE:
               compCount = 3;
               break;
             case GL.GL_RGBA:
@@ -724,16 +724,16 @@ public class GLBuffers extends Buffers {
             case GL2.GL_ABGR_EXT:
               compCount = 4;
               break;
-            /* FIXME ?? 
+            /* FIXME ??
              case GL.GL_HILO_NV:
               elements = 2;
-              break; */              
+              break; */
             default:
               throw new GLException("format 0x"+Integer.toHexString(format)+" not supported [yet], pls notify the maintainer in case this is our bug.");
         }
         return compCount;
     }
-    
+
     public static final int getNextPowerOf2(int number) {
         if (((number-1) & number) == 0) {
           //ex: 8 -> 0b1000; 8-1=7 -> 0b0111; 0b1000&0b0111 == 0
@@ -745,8 +745,8 @@ public class GLBuffers extends Buffers {
           power++;
         }
         return (1<<power);
-    }    
-      
+    }
+
     //----------------------------------------------------------------------
     // Conversion routines
     //
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java
index 655f6d688..ec6d54d66 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -44,7 +44,7 @@ import jogamp.opengl.Debug;
  */
 public class GLDrawableUtil {
   protected static final boolean DEBUG = Debug.debug("GLDrawable");
-  
+
   public static final boolean isAnimatorStartedOnOtherThread(GLAnimatorControl animatorCtrl) {
     return ( null != animatorCtrl ) ? animatorCtrl.isStarted() && animatorCtrl.getThread() != Thread.currentThread() : false ;
   }
@@ -56,11 +56,11 @@ public class GLDrawableUtil {
   public static final boolean isAnimatorAnimatingOnOtherThread(GLAnimatorControl animatorCtrl) {
     return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() && animatorCtrl.getThread() != Thread.currentThread() : false ;
   }
-  
+
   public static final boolean isAnimatorAnimating(GLAnimatorControl animatorCtrl) {
     return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() : false ;
   }
-  
+
   /**
    * Moves the designated {@link GLEventListener} from {@link GLAutoDrawable} <code>src</code> to <code>dest</code>.
    * If <code>preserveInitState</code> is <code>true</code>, it's initialized state is preserved
@@ -86,7 +86,7 @@ public class GLDrawableUtil {
         dest.invoke(false, new GLEventListenerState.ReshapeGLEventListener(listener));
     } // else .. !init state is default
   }
-  
+
   /**
    * Moves all {@link GLEventListener} from {@link GLAutoDrawable} <code>src</code> to <code>dest</code>.
    * If <code>preserveInitState</code> is <code>true</code>, it's initialized state is preserved
@@ -113,12 +113,12 @@ public class GLDrawableUtil {
   /**
    * Swaps the {@link GLContext} and all {@link GLEventListener} between {@link GLAutoDrawable} <code>a</code> and <code>b</code>,
    * while preserving it's initialized state, resets the GL-Viewport and issuing {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)}.
-   * <p> 
-   * The {@link GLAutoDrawable} to {@link GLAnimatorControl} association 
-   * is also swapped. 
+   * <p>
+   * The {@link GLAutoDrawable} to {@link GLAnimatorControl} association
+   * is also swapped.
    * </p>
    * <p>
-   * If an {@link GLAnimatorControl} is being attached to {@link GLAutoDrawable} <code>a</code> or <code>b</code> 
+   * If an {@link GLAnimatorControl} is being attached to {@link GLAutoDrawable} <code>a</code> or <code>b</code>
    * and the current thread is different than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
    * </p>
    * @param a
@@ -128,31 +128,31 @@ public class GLDrawableUtil {
   public static final void swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b) {
     final GLEventListenerState gllsA = GLEventListenerState.moveFrom(a);
     final GLEventListenerState gllsB = GLEventListenerState.moveFrom(b);
-    
+
     gllsA.moveTo(b);
     gllsB.moveTo(a);
   }
-  
-  /** 
-   * Swaps the {@link GLContext} of given {@link GLAutoDrawable} 
-   * and {@link GLAutoDrawable#disposeGLEventListener(GLEventListener, boolean) disposes} 
+
+  /**
+   * Swaps the {@link GLContext} of given {@link GLAutoDrawable}
+   * and {@link GLAutoDrawable#disposeGLEventListener(GLEventListener, boolean) disposes}
    * each {@link GLEventListener} w/o removing it.
    * <p>
    * The GL-Viewport is reset and {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)} issued implicit.
-   * </p> 
+   * </p>
    * <p>
-   * If an {@link GLAnimatorControl} is being attached to GLAutoDrawable src or dest and the current thread is different 
+   * If an {@link GLAnimatorControl} is being attached to GLAutoDrawable src or dest and the current thread is different
    * than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
    * </p>
    * @param src
    * @param dest
    */
-  public static final void swapGLContext(GLAutoDrawable src, GLAutoDrawable dest) {    
+  public static final void swapGLContext(GLAutoDrawable src, GLAutoDrawable dest) {
     final GLAnimatorControl aAnim = src.getAnimator();
-    final GLAnimatorControl bAnim = dest.getAnimator();    
+    final GLAnimatorControl bAnim = dest.getAnimator();
     final boolean aIsPaused = isAnimatorAnimatingOnOtherThread(aAnim) && aAnim.pause();
     final boolean bIsPaused = isAnimatorAnimatingOnOtherThread(bAnim) && bAnim.pause();
-    
+
     for(int i = src.getGLEventListenerCount() - 1; 0 <= i; i--) {
         src.disposeGLEventListener(src.getGLEventListener(i), false);
     }
@@ -160,12 +160,12 @@ public class GLDrawableUtil {
         dest.disposeGLEventListener(dest.getGLEventListener(i), false);
     }
     dest.setContext( src.setContext( dest.getContext(), false ), false );
-    
+
     src.invoke(true, GLEventListenerState.setViewport);
     dest.invoke(true, GLEventListenerState.setViewport);
-    
+
     if(aIsPaused) { aAnim.resume(); }
     if(bIsPaused) { bAnim.resume(); }
   }
-    
+
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
index 71e284101..f0c6be44f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -39,78 +39,78 @@ import javax.media.opengl.GLException;
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.opengl.util.texture.TextureData;
 
-/** 
+/**
  * OpenGL pixel data buffer, allowing user to provide buffers via their {@link GLPixelBufferProvider} implementation.
  * <p>
  * {@link GLPixelBufferProvider} produces a {@link GLPixelBuffer}.
- * </p> 
+ * </p>
  * <p>
  * You may use {@link #defaultProviderNoRowStride}.
  * </p>
  */
 public class GLPixelBuffer {
-    
-    /** Allows user to interface with another toolkit to define {@link GLPixelAttributes} and memory buffer to produce {@link TextureData}. */ 
+
+    /** Allows user to interface with another toolkit to define {@link GLPixelAttributes} and memory buffer to produce {@link TextureData}. */
     public static interface GLPixelBufferProvider {
         /** Allow {@link GL2ES3#GL_PACK_ROW_LENGTH}, or {@link GL2ES2#GL_UNPACK_ROW_LENGTH}. */
         boolean getAllowRowStride();
-        
+
         /** Called first to determine {@link GLPixelAttributes}. */
         GLPixelAttributes getAttributes(GL gl, int componentCount);
-        
-        /** 
+
+        /**
          * Allocates a new {@link GLPixelBuffer} object.
          * <p>
          * Being called to gather the initial {@link GLPixelBuffer},
          * or a new replacement {@link GLPixelBuffer} if {@link GLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
          * </p>
          * <p>
-         * The minimum required {@link Buffer#remaining() remaining} byte size equals to <code>minByteSize</code>, if &gt; 0, 
+         * The minimum required {@link Buffer#remaining() remaining} byte size equals to <code>minByteSize</code>, if &gt; 0,
          * otherwise utilize {@link GLBuffers#sizeof(GL, int[], int, int, int, int, int, boolean)}
          * to calculate it.
          * </p>
-         * 
+         *
          * @param gl the corresponding current GL context object
          * @param pixelAttributes the desired {@link GLPixelAttributes}
          * @param width in pixels
          * @param height in pixels
          * @param depth in pixels
          * @param pack true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU
-         * @param minByteSize if &gt; 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.   
+         * @param minByteSize if &gt; 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
          */
         GLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize);
     }
 
-    /** Single {@link GLPixelBuffer} provider. */ 
+    /** Single {@link GLPixelBuffer} provider. */
     public static interface SingletonGLPixelBufferProvider extends GLPixelBufferProvider {
-        /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link GLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */ 
+        /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link GLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */
         GLPixelBuffer getSingleBuffer(GLPixelAttributes pixelAttributes);
-        /** 
+        /**
          * Initializes the single {@link GLPixelBuffer} w/ a given size, if not yet {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated}.
          * @return the newly initialized single {@link GLPixelBuffer}, or null if already allocated.
          */
-        GLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack);        
+        GLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack);
     }
 
     public static class DefaultGLPixelBufferProvider implements GLPixelBufferProvider {
         private final boolean allowRowStride;
-        
+
         /**
-         * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. 
+         * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not.
          * See {@link #getAllowRowStride()} and {@link GLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
          */
         public DefaultGLPixelBufferProvider(boolean allowRowStride) {
-            this.allowRowStride = allowRowStride; 
+            this.allowRowStride = allowRowStride;
         }
-        
+
         @Override
         public boolean getAllowRowStride() { return allowRowStride; }
-        
+
         @Override
         public GLPixelAttributes getAttributes(GL gl, int componentCount) {
             final GLContext ctx = gl.getContext();
             final int dFormat, dType;
-            
+
             if( 1 == componentCount ) {
                 if( gl.isGL3ES3() ) {
                     // RED is supported on ES3 and >= GL3 [core]; ALPHA is deprecated on core
@@ -122,7 +122,7 @@ public class GLPixelBuffer {
                 dType   = GL.GL_UNSIGNED_BYTE;
             } else if( 3 == componentCount ) {
                 dFormat = GL.GL_RGB;
-                dType   = GL.GL_UNSIGNED_BYTE;            
+                dType   = GL.GL_UNSIGNED_BYTE;
             } else if( 4 == componentCount ) {
                 int _dFormat = ctx.getDefaultPixelDataFormat();
                 final int dComps = GLBuffers.componentCount(_dFormat);
@@ -131,14 +131,14 @@ public class GLPixelBuffer {
                     dType   = ctx.getDefaultPixelDataType();
                 } else {
                     dFormat = GL.GL_RGBA;
-                    dType   = GL.GL_UNSIGNED_BYTE;                                
+                    dType   = GL.GL_UNSIGNED_BYTE;
                 }
             } else {
                 throw new GLException("Unsupported componentCount "+componentCount+", contact maintainer to enhance");
             }
             return new GLPixelAttributes(componentCount, dFormat, dType);
         }
-        
+
         /**
          * {@inheritDoc}
          * <p>
@@ -148,7 +148,7 @@ public class GLPixelBuffer {
         @Override
         public GLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
             if( minByteSize > 0 ) {
-                return new GLPixelBuffer(pixelAttributes, width, height, depth, pack, Buffers.newDirectByteBuffer(minByteSize), getAllowRowStride());                
+                return new GLPixelBuffer(pixelAttributes, width, height, depth, pack, Buffers.newDirectByteBuffer(minByteSize), getAllowRowStride());
             } else {
                 int[] tmp = { 0 };
                 final int byteSize = GLBuffers.sizeof(gl, tmp, pixelAttributes.bytesPerPixel, width, height, depth, pack);
@@ -156,26 +156,26 @@ public class GLPixelBuffer {
             }
         }
     }
-    
-    /** 
+
+    /**
      * Default {@link GLPixelBufferProvider} with {@link GLPixelBufferProvider#getAllowRowStride()} == <code>false</code>,
      * utilizing best match for {@link GLPixelAttributes}
      * and {@link GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocating} a {@link ByteBuffer}.
      */
     public static GLPixelBufferProvider defaultProviderNoRowStride = new DefaultGLPixelBufferProvider(false);
-        
-    /** 
+
+    /**
      * Default {@link GLPixelBufferProvider} with {@link GLPixelBufferProvider#getAllowRowStride()} == <code>true</code>,
      * utilizing best match for {@link GLPixelAttributes}
      * and {@link GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocating} a {@link ByteBuffer}.
      */
     public static GLPixelBufferProvider defaultProviderWithRowStride = new DefaultGLPixelBufferProvider(true);
-    
-    /** Pixel attributes. */ 
+
+    /** Pixel attributes. */
     public static class GLPixelAttributes {
-        /** Undefined instance of {@link GLPixelAttributes}, having componentCount:=0, format:=0 and type:= 0. */ 
+        /** Undefined instance of {@link GLPixelAttributes}, having componentCount:=0, format:=0 and type:= 0. */
         public static final GLPixelAttributes UNDEF = new GLPixelAttributes(0, 0, 0, false);
-        
+
         /** Pixel <i>source</i> component count, i.e. number of meaningful components. */
         public final int componentCount;
         /** The OpenGL pixel data format */
@@ -184,7 +184,7 @@ public class GLPixelBuffer {
         public final int type;
         /** The OpenGL pixel size in bytes  */
         public final int bytesPerPixel;
-        
+
         /**
          * Deriving {@link #componentCount} via GL <code>dataFormat</code>, i.e. {@link GLBuffers#componentCount(int)} if &gt; 0.
          * @param dataFormat GL data format
@@ -194,7 +194,7 @@ public class GLPixelBuffer {
             this(0 < dataFormat ? GLBuffers.componentCount(dataFormat) : 0, dataFormat, dataType);
         }
         /**
-         * Using user specified source {@link #componentCount}. 
+         * Using user specified source {@link #componentCount}.
          * @param componentCount source component count
          * @param dataFormat GL data format
          * @param dataType GL data type
@@ -220,7 +220,7 @@ public class GLPixelBuffer {
             return "PixelAttributes[comp "+componentCount+", fmt 0x"+Integer.toHexString(format)+", type 0x"+Integer.toHexString(type)+", bytesPerPixel "+bytesPerPixel+"]";
         }
     }
-    
+
     /** The {@link GLPixelAttributes}. */
     public final GLPixelAttributes pixelAttributes;
     /** Width in pixels. */
@@ -233,22 +233,22 @@ public class GLPixelBuffer {
     public final boolean pack;
     /** Byte size of the buffer. Actually the number of {@link Buffer#remaining()} bytes when passed in ctor. */
     public final int byteSize;
-    /** 
-     * Buffer holding the pixel data. If {@link #rewind()}, it holds <code>byteSize</code> {@link Buffer#remaining()} bytes. 
+    /**
+     * Buffer holding the pixel data. If {@link #rewind()}, it holds <code>byteSize</code> {@link Buffer#remaining()} bytes.
      * <p>
      * By default the {@link Buffer} is a {@link ByteBuffer}, due to {@link DefProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int)}.
      * However, other {@link GLPixelBufferProvider} may utilize different {@link Buffer} types.
      * </p>
-     */   
+     */
     public final Buffer buffer;
     /** Buffer element size in bytes. */
     public final int bufferElemSize;
-    
+
     /** Allow {@link GL2ES3#GL_PACK_ROW_LENGTH}, or {@link GL2ES2#GL_UNPACK_ROW_LENGTH}. See {@link #requiresNewBuffer(GL, int, int, int)}. */
     public final boolean allowRowStride;
-    
+
     private boolean disposed = false;
-    
+
     public StringBuilder toString(StringBuilder sb) {
         if(null == sb) {
             sb = new StringBuilder();
@@ -272,7 +272,7 @@ public class GLPixelBuffer {
      * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. See {@link #requiresNewBuffer(GL, int, int, int)}.
      */
     public GLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, Buffer buffer, boolean allowRowStride) {
-        this.pixelAttributes = pixelAttributes; 
+        this.pixelAttributes = pixelAttributes;
         this.width = width;
         this.height = height;
         this.depth = depth;
@@ -282,15 +282,15 @@ public class GLPixelBuffer {
         this.bufferElemSize = Buffers.sizeOfBufferElem(buffer);
         this.allowRowStride = allowRowStride;
     }
-    
+
     /** Allow {@link GL2ES3#GL_PACK_ROW_LENGTH}, or {@link GL2ES2#GL_UNPACK_ROW_LENGTH}. */
     public final boolean getAllowRowStride() { return allowRowStride; }
-    
+
     /** Is not {@link #dispose() disposed} and has {@link #byteSize} &gt; 0. */
     public boolean isValid() {
         return !disposed && 0 < byteSize;
     }
-    
+
     /** See {@link Buffer#rewind()}. */
     public Buffer rewind() {
         return buffer.rewind();
@@ -300,40 +300,40 @@ public class GLPixelBuffer {
     public int position() {
         return buffer.position() * bufferElemSize;
     }
-    
+
     /** Sets the byte position of the {@link #buffer}. */
     public Buffer position(int bytePos) {
         return buffer.position( bytePos / bufferElemSize );
     }
-    
+
     /** Returns the byte capacity of the {@link #buffer}. */
     public int capacity() {
         return buffer.capacity() * bufferElemSize;
     }
-    
+
     /** Returns the byte limit of the {@link #buffer}. */
     public int limit() {
         return buffer.limit() * bufferElemSize;
     }
-    
+
     /** See {@link Buffer#flip()}. */
     public Buffer flip() {
-        return buffer.flip();        
+        return buffer.flip();
     }
-    
+
     /** See {@link Buffer#clear()}. */
     public Buffer clear() {
-        return buffer.clear();        
+        return buffer.clear();
     }
-    
-    /** 
+
+    /**
      * Returns true, if {@link #isValid() invalid} or implementation requires a new buffer based on the new size
      * due to pixel alignment or byte size, otherwise false.
      * <p>
      * It is assumed that <code>pixelAttributes</code>, <code>depth</code> and <code>pack</code> stays the same!
      * </p>
      * <p>
-     * The minimum required byte size equals to <code>minByteSize</code>, if &gt; 0, 
+     * The minimum required byte size equals to <code>minByteSize</code>, if &gt; 0,
      * otherwise {@link GLBuffers#sizeof(GL, int[], int, int, int, int, int, boolean) GLBuffers.sizeof(..)}
      * is being used to calculate it. This value is referred to <i>newByteSize</i>.
      * </p>
@@ -341,16 +341,16 @@ public class GLPixelBuffer {
      * If <code>{@link #allowRowStride} = false</code>,
      * method returns <code>true</code> if the <i>newByteSize</i> &gt; <i>currentByteSize</i>
      * or the <code>newWidth</code> != <code>currentWidth</code>.
-     * </p> 
+     * </p>
      * <p>
      * If <code>{@link #allowRowStride} = true</code>, see {@link GLPixelBufferProvider#getAllowRowStride()},
-     * method returns <code>true</code> only if the <i>newByteSize</i> &gt; <i>currentByteSize</i>. 
+     * method returns <code>true</code> only if the <i>newByteSize</i> &gt; <i>currentByteSize</i>.
      * Assuming user utilizes the row-stride when dealing w/ the data, i.e. {@link GL2ES3#GL_PACK_ROW_LENGTH}.
      * </p>
      * @param gl the corresponding current GL context object
      * @param newWidth new width in pixels
      * @param newHeight new height in pixels
-     * @param newByteSize if &gt; 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.   
+     * @param newByteSize if &gt; 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
      * @see GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int)
      */
     public boolean requiresNewBuffer(GL gl, int newWidth, int newHeight, int newByteSize) {
@@ -366,7 +366,7 @@ public class GLPixelBuffer {
         }
         return byteSize < newByteSize || width != newWidth;
     }
-    
+
     /** Dispose resources. See {@link #isValid()}. */
     public void dispose() {
         disposed = true;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
index f512a3aae..1c6e97450 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
@@ -46,35 +46,35 @@ public class GLPixelStorageModes {
 
     /** Create instance w/o {@link #save(GL)} */
     public GLPixelStorageModes() {}
-    
+
     /** Create instance w/ {@link #save(GL)} */
     public GLPixelStorageModes(GL gl) { save(gl); }
-    
+
     /**
      * Sets the {@link GL#GL_PACK_ALIGNMENT}.
-     * <p> 
+     * <p>
      * Saves the pixel storage modes if not saved yet.
      * </p>
      */
     public final void setPackAlignment(GL gl, int packAlignment) {
         save(gl);
-        gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);        
+        gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
     }
 
     /**
      * Sets the {@link GL#GL_UNPACK_ALIGNMENT}.
-     * <p> 
+     * <p>
      * Saves the pixel storage modes if not saved yet.
      * </p>
      */
     public final void setUnpackAlignment(GL gl, int unpackAlignment) {
         save(gl);
-        gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, unpackAlignment);        
+        gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, unpackAlignment);
     }
-    
+
     /**
-     * Sets the {@link GL#GL_PACK_ALIGNMENT} and {@link GL#GL_UNPACK_ALIGNMENT}. 
-     * <p> 
+     * Sets the {@link GL#GL_PACK_ALIGNMENT} and {@link GL#GL_UNPACK_ALIGNMENT}.
+     * <p>
      * Saves the pixel storage modes if not saved yet.
      * </p>
      */
@@ -82,32 +82,32 @@ public class GLPixelStorageModes {
         setPackAlignment(gl, packAlignment);
         setUnpackAlignment(gl, unpackAlignment);
     }
-    
+
     /**
      * Sets the {@link GL2ES3#GL_PACK_ROW_LENGTH}.
-     * <p> 
+     * <p>
      * Saves the pixel storage modes if not saved yet.
      * </p>
      */
     public final void setPackRowLength(GL2ES3 gl, int packRowLength) {
         save(gl);
-        gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, packRowLength);        
+        gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, packRowLength);
     }
 
     /**
      * Sets the {@link GL2ES2#GL_UNPACK_ROW_LENGTH}.
-     * <p> 
+     * <p>
      * Saves the pixel storage modes if not saved yet.
      * </p>
      */
     public final void setUnpackRowLength(GL2ES2 gl, int unpackRowLength) {
         save(gl);
-        gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, unpackRowLength);        
+        gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, unpackRowLength);
     }
-    
+
     /**
      * Sets the {@link GL2ES3#GL_PACK_ROW_LENGTH} and {@link GL2ES2#GL_UNPACK_ROW_LENGTH}.
-     * <p> 
+     * <p>
      * Saves the pixel storage modes if not saved yet.
      * </p>
      */
@@ -115,7 +115,7 @@ public class GLPixelStorageModes {
         setPackRowLength(gl, packRowLength);
         setUnpackRowLength(gl, unpackRowLength);
     }
-    
+
     /**
      * Save the pixel storage mode, if not saved yet.
      * <p>
@@ -126,8 +126,8 @@ public class GLPixelStorageModes {
         if(saved) {
             return;
         }
-        
-        if(gl.isGL2GL3()) {  
+
+        if(gl.isGL2GL3()) {
             if(gl.isGL2()) {
                 gl.getGL2().glPushClientAttrib(GL2.GL_CLIENT_PIXEL_STORE_BIT);
             } else {
@@ -154,7 +154,7 @@ public class GLPixelStorageModes {
             // embedded deals with pack/unpack alignment only
             gl.glGetIntegerv(GL2ES2.GL_PACK_ALIGNMENT,   savedAlignment, 0);
             gl.glGetIntegerv(GL2ES2.GL_UNPACK_ALIGNMENT, savedAlignment, 1);
-        }        
+        }
         saved = true;
     }
 
@@ -166,8 +166,8 @@ public class GLPixelStorageModes {
         if(!saved) {
             throw new GLException("pixel storage modes not saved");
         }
-        
-        if(gl.isGL2GL3()) {  
+
+        if(gl.isGL2GL3()) {
             if(gl.isGL2()) {
                 gl.getGL2().glPopClientAttrib();
             } else {
@@ -186,9 +186,9 @@ public class GLPixelStorageModes {
             // embedded deals with pack/unpack alignment only
             gl.glPixelStorei(GL2ES2.GL_PACK_ALIGNMENT,   savedAlignment[0]);
             gl.glPixelStorei(GL2ES2.GL_UNPACK_ALIGNMENT, savedAlignment[1]);
-        }        
+        }
         saved = false;
-    }      
+    }
 }
 
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
index 65d1b6906..b942c9ab2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.util;
 
 import java.io.File;
@@ -51,45 +51,45 @@ import com.jogamp.opengl.util.texture.TextureIO;
  */
 public class GLReadBufferUtil {
     protected final GLPixelBufferProvider pixelBufferProvider;
-    protected final int componentCount, alignment; 
+    protected final int componentCount, alignment;
     protected final Texture readTexture;
-    protected final GLPixelStorageModes psm;    
-    
+    protected final GLPixelStorageModes psm;
+
     protected GLPixelBuffer readPixelBuffer = null;
     protected TextureData readTextureData = null;
 
     /**
-     * @param alpha true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: Alpha maybe forced on ES platforms! 
+     * @param alpha true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: Alpha maybe forced on ES platforms!
      * @param write2Texture true if readPixel's TextureData shall be written to a 2d Texture
      */
     public GLReadBufferUtil(boolean alpha, boolean write2Texture) {
         this(GLPixelBuffer.defaultProviderNoRowStride, alpha, write2Texture);
     }
-    
+
     public GLReadBufferUtil(GLPixelBufferProvider pixelBufferProvider, boolean alpha, boolean write2Texture) {
         this.pixelBufferProvider = pixelBufferProvider;
         this.componentCount = alpha ? 4 : 3 ;
-        this.alignment = alpha ? 4 : 1 ; 
+        this.alignment = alpha ? 4 : 1 ;
         this.readTexture = write2Texture ? new Texture(GL.GL_TEXTURE_2D) : null ;
         this.psm = new GLPixelStorageModes();
     }
-    
+
     /** Returns the {@link GLPixelBufferProvider} used by this instance. */
     public GLPixelBufferProvider getPixelBufferProvider() { return pixelBufferProvider; }
-    
+
     public boolean isValid() {
       return null!=readTextureData && null!=readPixelBuffer && readPixelBuffer.isValid();
     }
-    
+
     public boolean hasAlpha() { return 4 == componentCount ? true : false ; }
-    
+
     public GLPixelStorageModes getGLPixelStorageModes() { return psm; }
-    
+
     /**
      * Returns the {@link GLPixelBuffer}, created and filled by {@link #readPixels(GLAutoDrawable, boolean)}.
      */
     public GLPixelBuffer getPixelBuffer() { return readPixelBuffer; }
-    
+
     /**
      * rewind the raw pixel ByteBuffer
      */
@@ -99,7 +99,7 @@ public class GLReadBufferUtil {
      * @return the resulting TextureData, filled by {@link #readPixels(GLAutoDrawable, boolean)}
      */
     public TextureData getTextureData() { return readTextureData; }
-    
+
     /**
      * @return the Texture object filled by {@link #readPixels(GLAutoDrawable, boolean)},
      *         if this instance writes to a 2d Texture, otherwise null.
@@ -121,27 +121,27 @@ public class GLReadBufferUtil {
 
     /**
      * Read the drawable's pixels to TextureData and Texture, if requested at construction.
-     * 
+     *
      * @param gl the current GL context object. It's read drawable is being used as the pixel source.
      * @param mustFlipVertically indicates whether to flip the data vertically or not.
      *                           The context's drawable {@link GLDrawable#isGLOriented()} state
      *                           is taken into account.
      *                           Vertical flipping is propagated to TextureData
      *                           and handled in a efficient manner there (TextureCoordinates and TextureIO writer).
-     * 
+     *
      * @see #GLReadBufferUtil(boolean, boolean)
      */
     public boolean readPixels(GL gl, boolean mustFlipVertically) {
         return readPixels(gl, 0, 0, 0, 0, mustFlipVertically);
     }
-    
+
     /**
      * Read the drawable's pixels to TextureData and Texture, if requested at construction.
-     * 
+     *
      * @param gl the current GL context object. It's read drawable is being used as the pixel source.
      * @param inX readPixel x offset
      * @param inY readPixel y offset
-     * @param inWidth optional readPixel width value, used if [1 .. drawable.width], otherwise using drawable.width  
+     * @param inWidth optional readPixel width value, used if [1 .. drawable.width], otherwise using drawable.width
      * @param inHeight optional readPixel height, used if [1 .. drawable.height], otherwise using drawable.height
      * @param mustFlipVertically indicates whether to flip the data vertically or not.
      *                           The context's drawable {@link GLDrawable#isGLOriented()} state
@@ -174,17 +174,17 @@ public class GLReadBufferUtil {
         } else {
             height= inHeight;
         }
-        
+
         final boolean flipVertically;
         if( drawable.isGLOriented() ) {
             flipVertically = mustFlipVertically;
         } else {
             flipVertically = !mustFlipVertically;
         }
-        
+
         final int tmp[] = new int[1];
         final int readPixelSize = GLBuffers.sizeof(gl, tmp, pixelAttribs.bytesPerPixel, width, height, 1, true);
-        
+
         boolean newData = false;
         if( null == readPixelBuffer || readPixelBuffer.requiresNewBuffer(gl, width, height, readPixelSize) ) {
             readPixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, width, height, 1, true, readPixelSize);
@@ -194,9 +194,9 @@ public class GLReadBufferUtil {
                            gl.getGLProfile(),
                            internalFormat,
                            width, height,
-                           0, 
+                           0,
                            pixelAttribs,
-                           false, false, 
+                           false, false,
                            flipVertically,
                            readPixelBuffer.buffer,
                            null /* Flusher */);
@@ -230,13 +230,13 @@ public class GLReadBufferUtil {
                                    " "+width+"x"+height+
                                    ", "+pixelAttribs+
                                    ", "+readPixelBuffer+", sz "+readPixelSize);
-                res = false;                
+                res = false;
             }
             if(res && null != readTexture) {
                 if(newData) {
                     readTexture.updateImage(gl, readTextureData);
                 } else {
-                    readTexture.updateSubImage(gl, readTextureData, 0, 
+                    readTexture.updateSubImage(gl, readTextureData, 0,
                                                0, 0, // src offset
                                                0, 0, // dst offset
                                                width, height);
@@ -248,7 +248,7 @@ public class GLReadBufferUtil {
         return res;
     }
 
-    public void dispose(GL gl) {  
+    public void dispose(GL gl) {
         if(null != readTexture) {
             readTexture.destroy(gl);
             readTextureData = null;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
index c649d1c6a..966781906 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
index 111e2509e..697b7cca0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
@@ -34,28 +34,28 @@ import com.jogamp.opengl.util.glsl.ShaderState;
  * to be either rendered directly via {@link #glEnd(GL)} or to be added to an internal display list
  * via {@link #glEnd(GL, boolean) glEnd(gl, false)} for deferred rendering via {@link #draw(GL, boolean)}.
  * </p>
- * <a name="storageDetails"><h5>Buffer storage and it's creation via {@link #createFixed(int, int, int, int, int, int, int, int, int, int) createFixed(..)} 
- * and {@link #createGLSL(int, int, int, int, int, int, int, int, int, int, ShaderState) createGLSL(..)}</h5></a> 
+ * <a name="storageDetails"><h5>Buffer storage and it's creation via {@link #createFixed(int, int, int, int, int, int, int, int, int, int) createFixed(..)}
+ * and {@link #createGLSL(int, int, int, int, int, int, int, int, int, int, ShaderState) createGLSL(..)}</h5></a>
  * <p>
- * If unsure whether <i>colors</i>, <i>normals</i> and <i>textures</i> will be used, 
+ * If unsure whether <i>colors</i>, <i>normals</i> and <i>textures</i> will be used,
  * simply add them with an expected component count.
  * This implementation will only render buffers which are being filled.<br/>
  * The buffer growing implementation will only grow the exceeded buffers, unused buffers are not resized.
  * </p>
  * <p>
- * Note: Optional types, i.e. color, must be either not used or used w/ the same element count as vertex, etc. 
+ * Note: Optional types, i.e. color, must be either not used or used w/ the same element count as vertex, etc.
  * This is a semantic constraint, same as in the original OpenGL spec.
  * </p>
  */
 public class ImmModeSink {
   protected static final boolean DEBUG_BEGIN_END;
-  protected static final boolean DEBUG_DRAW;  
+  protected static final boolean DEBUG_DRAW;
   protected static final boolean DEBUG_BUFFER;
-  
+
   static {
       Debug.initSingleton();
       DEBUG_BEGIN_END = Debug.isPropertyDefined("jogl.debug.ImmModeSink.BeginEnd", true);
-      DEBUG_DRAW = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Draw", true);  
+      DEBUG_DRAW = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Draw", true);
       DEBUG_BUFFER = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Buffer", true);
   }
 
@@ -68,7 +68,7 @@ public class ImmModeSink {
    * <p>
    * See <a href="#storageDetails"> buffer storage details</a>.
    * </p>
-   * 
+   *
    * @param initialElementCount initial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size.
    * @param vComps mandatory vertex component count, should be 2, 3 or 4.
    * @param vDataType mandatory vertex data type, e.g. {@link GL#GL_FLOAT}
@@ -78,17 +78,17 @@ public class ImmModeSink {
    * @param nDataType optional normal data type, e.g. {@link GL#GL_FLOAT}
    * @param tComps optional texture-coordinate  component count, may be 0, 2 or 3
    * @param tDataType optional texture-coordinate data type, e.g. {@link GL#GL_FLOAT}
-   * @param glBufferUsage VBO <code>usage</code> parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW}, 
+   * @param glBufferUsage VBO <code>usage</code> parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
    *                      set to <code>0</code> for no VBO usage
    */
-  public static ImmModeSink createFixed(int initialElementCount, 
+  public static ImmModeSink createFixed(int initialElementCount,
                                         int vComps, int vDataType,
                                         int cComps, int cDataType,
-                                        int nComps, int nDataType, 
-                                        int tComps, int tDataType, 
+                                        int nComps, int nDataType,
+                                        int tComps, int tDataType,
                                         int glBufferUsage) {
-    return new ImmModeSink(initialElementCount, 
-                           vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType, 
+    return new ImmModeSink(initialElementCount,
+                           vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                            false, glBufferUsage, null, 0);
   }
 
@@ -97,7 +97,7 @@ public class ImmModeSink {
    * <p>
    * See <a href="#storageDetails"> buffer storage details</a>.
    * </p>
-   * 
+   *
    * @param initialElementCount initial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size.
    * @param vComps mandatory vertex component count, should be 2, 3 or 4.
    * @param vDataType mandatory vertex data type, e.g. {@link GL#GL_FLOAT}
@@ -107,21 +107,21 @@ public class ImmModeSink {
    * @param nDataType optional normal data type, e.g. {@link GL#GL_FLOAT}
    * @param tComps optional texture-coordinate  component count, may be 0, 2 or 3
    * @param tDataType optional texture-coordinate data type, e.g. {@link GL#GL_FLOAT}
-   * @param glBufferUsage VBO <code>usage</code> parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW}, 
+   * @param glBufferUsage VBO <code>usage</code> parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
    *                      set to <code>0</code> for no VBO usage
    * @param st ShaderState to locate the vertex attributes
    * @see #draw(GL, boolean)
    * @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
    * @see com.jogamp.opengl.util.glsl.ShaderState#getCurrentShaderState()
    */
-  public static ImmModeSink createGLSL(int initialElementCount, 
+  public static ImmModeSink createGLSL(int initialElementCount,
                                        int vComps, int vDataType,
                                        int cComps, int cDataType,
-                                       int nComps, int nDataType, 
-                                       int tComps, int tDataType, 
+                                       int nComps, int nDataType,
+                                       int tComps, int tDataType,
                                        int glBufferUsage, ShaderState st) {
-    return new ImmModeSink(initialElementCount, 
-                           vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType, 
+    return new ImmModeSink(initialElementCount,
+                           vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                            true, glBufferUsage, st, 0);
   }
 
@@ -130,7 +130,7 @@ public class ImmModeSink {
    * <p>
    * See <a href="#storageDetails"> buffer storage details</a>.
    * </p>
-   * 
+   *
    * @param initialElementCount initial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size.
    * @param vComps mandatory vertex component count, should be 2, 3 or 4.
    * @param vDataType mandatory vertex data type, e.g. {@link GL#GL_FLOAT}
@@ -140,24 +140,24 @@ public class ImmModeSink {
    * @param nDataType optional normal data type, e.g. {@link GL#GL_FLOAT}
    * @param tComps optional texture-coordinate  component count, may be 0, 2 or 3
    * @param tDataType optional texture-coordinate data type, e.g. {@link GL#GL_FLOAT}
-   * @param glBufferUsage VBO <code>usage</code> parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW}, 
+   * @param glBufferUsage VBO <code>usage</code> parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
    *                      set to <code>0</code> for no VBO usage
    * @param shaderProgram shader-program name to locate the vertex attributes
    * @see #draw(GL, boolean)
    * @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
    * @see com.jogamp.opengl.util.glsl.ShaderState#getCurrentShaderState()
    */
-  public static ImmModeSink createGLSL(int initialElementCount, 
+  public static ImmModeSink createGLSL(int initialElementCount,
                                        int vComps, int vDataType,
                                        int cComps, int cDataType,
-                                       int nComps, int nDataType, 
-                                       int tComps, int tDataType, 
+                                       int nComps, int nDataType,
+                                       int tComps, int tDataType,
                                        int glBufferUsage, int shaderProgram) {
-    return new ImmModeSink(initialElementCount, 
-                           vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType, 
+    return new ImmModeSink(initialElementCount,
+                           vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                            true, glBufferUsage, null, shaderProgram);
   }
-  
+
   public void destroy(GL gl) {
     destroyList(gl);
 
@@ -346,7 +346,7 @@ public class ImmModeSink {
   public final void glColor3ub(byte x, byte y, byte z) {
     vboSet.glColor3ub(x,y,z);
   }
-  
+
   public final void glColor4b(byte x, byte y, byte z, byte a) {
     vboSet.glColor4b(x,y,z,a);
   }
@@ -354,7 +354,7 @@ public class ImmModeSink {
   public final void glColor4ub(byte x, byte y, byte z, byte a) {
     vboSet.glColor4ub(x,y,z,a);
   }
-  
+
   public final void glTexCoord2b(byte x, byte y) {
     vboSet.glTexCoord2b(x,y);
   }
@@ -363,26 +363,26 @@ public class ImmModeSink {
     vboSet.glTexCoord3b(x,y,z);
   }
 
-  protected ImmModeSink(int initialElementCount, 
-                        int vComps, int vDataType, 
-                        int cComps, int cDataType, 
-                        int nComps, int nDataType, 
-                        int tComps, int tDataType, 
+  protected ImmModeSink(int initialElementCount,
+                        int vComps, int vDataType,
+                        int cComps, int cDataType,
+                        int nComps, int nDataType,
+                        int tComps, int tDataType,
                         boolean useGLSL, int glBufferUsage, ShaderState st, int shaderProgram) {
-    vboSet = new VBOSet(initialElementCount, 
-                        vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType, 
+    vboSet = new VBOSet(initialElementCount,
+                        vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                         useGLSL, glBufferUsage, st, shaderProgram);
     this.vboSetList   = new ArrayList<VBOSet>();
   }
-  
+
   public boolean getUseVBO() { return vboSet.getUseVBO(); }
-  
+
   /**
    * Returns the additional element count if buffer resize is required.
    * @see #setResizeElementCount(int)
    */
   public int getResizeElementCount() { return vboSet.getResizeElementCount(); }
-  
+
   /**
    * Sets the additional element count if buffer resize is required,
    * defaults to <code>initialElementCount</code> of factory method.
@@ -390,7 +390,7 @@ public class ImmModeSink {
    * @see #createGLSL(int, int, int, int, int, int, int, int, int, int, ShaderState)
    */
   public void setResizeElementCount(int v) { vboSet.setResizeElementCount(v); }
-  
+
   private void destroyList(GL gl) {
     for(int i=0; i<vboSetList.size(); i++) {
         vboSetList.get(i).destroy(gl);
@@ -402,11 +402,11 @@ public class ImmModeSink {
   private final ArrayList<VBOSet> vboSetList;
 
   protected static class VBOSet {
-    protected VBOSet (int initialElementCount, 
-                      int vComps, int vDataType, 
-                      int cComps, int cDataType, 
-                      int nComps, int nDataType, 
-                      int tComps, int tDataType, 
+    protected VBOSet (int initialElementCount,
+                      int vComps, int vDataType,
+                      int cComps, int cDataType,
+                      int nComps, int nDataType,
+                      int tComps, int tDataType,
                       boolean useGLSL, int glBufferUsage, ShaderState st, int shaderProgram) {
         // final ..
         this.glBufferUsage=glBufferUsage;
@@ -415,7 +415,7 @@ public class ImmModeSink {
         this.useGLSL=useGLSL;
         this.shaderState = st;
         this.shaderProgram = shaderProgram;
-        
+
         if(useGLSL && null == shaderState && 0 == shaderProgram) {
             throw new IllegalArgumentException("Using GLSL but neither a valid shader-program nor ShaderState has been passed!");
         }
@@ -436,9 +436,9 @@ public class ImmModeSink {
         this.tDataType=tDataType;
         this.tDataTypeSigned=GLBuffers.isSignedGLType(tDataType);
         this.tComps=tComps;
-        this.tCompsBytes=tComps * GLBuffers.sizeOfGLType(tDataType); 
+        this.tCompsBytes=tComps * GLBuffers.sizeOfGLType(tDataType);
         this.vboName = 0;
-                
+
         this.vCount=0;
         this.cCount=0;
         this.nCount=0;
@@ -447,9 +447,9 @@ public class ImmModeSink {
         this.cElems=0;
         this.nElems=0;
         this.tElems=0;
-        
+
         this.pageSize = Platform.getMachineDescription().pageSizeInBytes();
-        
+
         reallocateBuffer(initialElementCount);
         rewind();
 
@@ -465,30 +465,30 @@ public class ImmModeSink {
 
     protected int getResizeElementCount() { return resizeElementCount; }
     protected void setResizeElementCount(int v) { resizeElementCount=v; }
-    
+
     protected boolean getUseVBO() { return useVBO; }
-    
+
     protected final VBOSet regenerate(GL gl) {
-        return new VBOSet(initialElementCount, vComps, 
-                          vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType, 
+        return new VBOSet(initialElementCount, vComps,
+                          vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                           useGLSL, glBufferUsage, shaderState, shaderProgram);
     }
 
     protected void checkSeal(boolean test) throws GLException {
         if(0==mode) {
-                throw new GLException("No mode set yet, call glBegin(mode) first:\n\t"+this); 
+                throw new GLException("No mode set yet, call glBegin(mode) first:\n\t"+this);
         }
         if(sealed!=test) {
             if(test) {
-                throw new GLException("Not Sealed yet, call glEnd() first:\n\t"+this); 
+                throw new GLException("Not Sealed yet, call glEnd() first:\n\t"+this);
             } else {
-                throw new GLException("Already Sealed, can't modify VBO after glEnd():\n\t"+this); 
+                throw new GLException("Already Sealed, can't modify VBO after glEnd():\n\t"+this);
             }
         }
     }
 
     private boolean usingShaderProgram = false;
-    
+
     protected void useShaderProgram(GL2ES2 gl, boolean force) {
         if( force || !usingShaderProgram ) {
             if(null != shaderState) {
@@ -499,19 +499,19 @@ public class ImmModeSink {
             usingShaderProgram = true;
         }
     }
-    
+
     protected void draw(GL gl, Buffer indices, boolean disableBufferAfterDraw, int i)
     {
         enableBuffer(gl, true);
-        
+
         if(null != shaderState || 0 != shaderProgram) {
             useShaderProgram(gl.getGL2ES2(), false);
         }
-        
+
         if(DEBUG_DRAW) {
             System.err.println("ImmModeSink.draw["+i+"].0 (disableBufferAfterDraw: "+disableBufferAfterDraw+"):\n\t"+this);
         }
-        
+
         if (buffer!=null) {
             if(null==indices) {
                 if ( GL_QUADS == mode && !gl.isGL2() ) {
@@ -523,7 +523,7 @@ public class ImmModeSink {
                 }
             } else {
                 // FIXME: Impl. VBO usage .. or unroll.
-                if( !gl.getContext().isCPUDataSourcingAvail() ) {                    
+                if( !gl.getContext().isCPUDataSourcingAvail() ) {
                     throw new GLException("CPU data sourcing n/a w/ "+gl.getContext());
                 }
                 final int type;
@@ -538,23 +538,23 @@ public class ImmModeSink {
                 }
                 final int idxLen = indices.remaining();
                 final int idx0 = indices.position();
-                
+
                 if ( GL_QUADS == mode && !gl.isGL2() ) {
                     if( GL.GL_UNSIGNED_BYTE == type ) {
                         final ByteBuffer b = (ByteBuffer) indices;
                         for (int j = 0; j < idxLen; j++) {
                             gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x000000ff & b.get(idx0+j)), 4);
-                        }                        
+                        }
                     } else if( GL.GL_UNSIGNED_SHORT == type ){
                         final ShortBuffer b = (ShortBuffer) indices;
                         for (int j = 0; j < idxLen; j++) {
                             gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x0000ffff & b.get(idx0+j)), 4);
-                        }                                                
+                        }
                     } else {
                         final IntBuffer b = (IntBuffer) indices;
                         for (int j = 0; j < idxLen; j++) {
                             gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4);
-                        }                                                
+                        }
                     }
                 } else {
                     ((GL2ES1)gl).glDrawElements(mode, idxLen, type, indices);
@@ -566,7 +566,7 @@ public class ImmModeSink {
         if(disableBufferAfterDraw) {
             enableBuffer(gl, false);
         }
-        
+
         if(DEBUG_DRAW) {
             System.err.println("ImmModeSink.draw["+i+"].X (disableBufferAfterDraw: "+disableBufferAfterDraw+")");
         }
@@ -592,7 +592,7 @@ public class ImmModeSink {
     public void glVertex2b(byte x, byte y) {
         checkSeal(false);
         growBuffer(VERTEX);
-        if(vComps>0) 
+        if(vComps>0)
             Buffers.putNb(vertexArray, vDataTypeSigned, x, true);
         if(vComps>1)
             Buffers.putNb(vertexArray, vDataTypeSigned, y, true);
@@ -614,7 +614,7 @@ public class ImmModeSink {
         growBuffer(VERTEX);
         if(vComps>0)
             Buffers.putNs(vertexArray, vDataTypeSigned, x, true);
-        if(vComps>1) 
+        if(vComps>1)
             Buffers.putNs(vertexArray, vDataTypeSigned, y, true);
         countAndPadding(VERTEX, vComps-2);
     }
@@ -623,16 +623,16 @@ public class ImmModeSink {
         growBuffer(VERTEX);
         if(vComps>0)
             Buffers.putNs(vertexArray, vDataTypeSigned, x, true);
-        if(vComps>1) 
+        if(vComps>1)
             Buffers.putNs(vertexArray, vDataTypeSigned, y, true);
-        if(vComps>2) 
+        if(vComps>2)
             Buffers.putNs(vertexArray, vDataTypeSigned, z, true);
         countAndPadding(VERTEX, vComps-3);
     }
     public void glVertex2f(float x, float y) {
         checkSeal(false);
         growBuffer(VERTEX);
-        if(vComps>0) 
+        if(vComps>0)
             Buffers.putNf(vertexArray, vDataTypeSigned, x);
         if(vComps>1)
             Buffers.putNf(vertexArray, vDataTypeSigned, y);
@@ -641,11 +641,11 @@ public class ImmModeSink {
     public void glVertex3f(float x, float y, float z) {
         checkSeal(false);
         growBuffer(VERTEX);
-        if(vComps>0) 
+        if(vComps>0)
             Buffers.putNf(vertexArray, vDataTypeSigned, x);
         if(vComps>1)
             Buffers.putNf(vertexArray, vDataTypeSigned, y);
-        if(vComps>2) 
+        if(vComps>2)
             Buffers.putNf(vertexArray, vDataTypeSigned, z);
         countAndPadding(VERTEX, vComps-3);
     }
@@ -653,33 +653,33 @@ public class ImmModeSink {
     public void glNormal3b(byte x, byte y, byte z) {
         checkSeal(false);
         growBuffer(NORMAL);
-        if(nComps>0)             
+        if(nComps>0)
             Buffers.putNb(normalArray, nDataTypeSigned, x, true);
-        if(nComps>1) 
+        if(nComps>1)
             Buffers.putNb(normalArray, nDataTypeSigned, y, true);
-        if(nComps>2) 
+        if(nComps>2)
             Buffers.putNb(normalArray, nDataTypeSigned, z, true);
         countAndPadding(NORMAL, nComps-3);
     }
     public void glNormal3s(short x, short y, short z) {
         checkSeal(false);
         growBuffer(NORMAL);
-        if(nComps>0) 
+        if(nComps>0)
             Buffers.putNs(normalArray, nDataTypeSigned, x, true);
-        if(nComps>1) 
+        if(nComps>1)
             Buffers.putNs(normalArray, nDataTypeSigned, y, true);
-        if(nComps>2) 
+        if(nComps>2)
             Buffers.putNs(normalArray, nDataTypeSigned, z, true);
         countAndPadding(NORMAL, nComps-3);
     }
     public void glNormal3f(float x, float y, float z) {
         checkSeal(false);
         growBuffer(NORMAL);
-        if(nComps>0) 
+        if(nComps>0)
             Buffers.putNf(normalArray, nDataTypeSigned, x);
         if(nComps>1)
             Buffers.putNf(normalArray, nDataTypeSigned, y);
-        if(nComps>2) 
+        if(nComps>2)
             Buffers.putNf(normalArray, nDataTypeSigned, z);
         countAndPadding(NORMAL, nComps-3);
     }
@@ -687,96 +687,96 @@ public class ImmModeSink {
     public void glColor3b(byte r, byte g, byte b) {
         checkSeal(false);
         growBuffer(COLOR);
-        if(cComps>0) 
+        if(cComps>0)
             Buffers.putNb(colorArray, cDataTypeSigned, r, true);
-        if(cComps>1) 
+        if(cComps>1)
             Buffers.putNb(colorArray, cDataTypeSigned, g, true);
-        if(cComps>2) 
+        if(cComps>2)
             Buffers.putNb(colorArray, cDataTypeSigned, b, true);
         countAndPadding(COLOR, cComps-3);
     }
     public void glColor3ub(byte r, byte g, byte b) {
         checkSeal(false);
         growBuffer(COLOR);
-        if(cComps>0) 
+        if(cComps>0)
             Buffers.putNb(colorArray, cDataTypeSigned, r, false);
-        if(cComps>1) 
+        if(cComps>1)
             Buffers.putNb(colorArray, cDataTypeSigned, g, false);
-        if(cComps>2) 
+        if(cComps>2)
             Buffers.putNb(colorArray, cDataTypeSigned, b, false);
         countAndPadding(COLOR, cComps-3);
     }
     public void glColor4b(byte r, byte g, byte b, byte a) {
         checkSeal(false);
         growBuffer(COLOR);
-        if(cComps>0) 
+        if(cComps>0)
             Buffers.putNb(colorArray, cDataTypeSigned, r, true);
-        if(cComps>1) 
+        if(cComps>1)
             Buffers.putNb(colorArray, cDataTypeSigned, g, true);
-        if(cComps>2) 
+        if(cComps>2)
             Buffers.putNb(colorArray, cDataTypeSigned, b, true);
-        if(cComps>3) 
+        if(cComps>3)
             Buffers.putNb(colorArray, cDataTypeSigned, a, true);
         countAndPadding(COLOR, cComps-4);
     }
     public void glColor4ub(byte r, byte g, byte b, byte a) {
         checkSeal(false);
         growBuffer(COLOR);
-        if(cComps>0) 
+        if(cComps>0)
             Buffers.putNb(colorArray, cDataTypeSigned, r, false);
-        if(cComps>1) 
+        if(cComps>1)
             Buffers.putNb(colorArray, cDataTypeSigned, g, false);
-        if(cComps>2) 
+        if(cComps>2)
             Buffers.putNb(colorArray, cDataTypeSigned, b, false);
-        if(cComps>3) 
+        if(cComps>3)
             Buffers.putNb(colorArray, cDataTypeSigned, a, false);
         countAndPadding(COLOR, cComps-4);
     }
     public void glColor3s(short r, short g, short b) {
         checkSeal(false);
         growBuffer(COLOR);
-        if(cComps>0) 
+        if(cComps>0)
             Buffers.putNs(colorArray, cDataTypeSigned, r, true);
-        if(cComps>1) 
+        if(cComps>1)
             Buffers.putNs(colorArray, cDataTypeSigned, g, true);
-        if(cComps>2) 
+        if(cComps>2)
             Buffers.putNs(colorArray, cDataTypeSigned, b, true);
         countAndPadding(COLOR, cComps-3);
     }
     public void glColor4s(short r, short g, short b, short a) {
         checkSeal(false);
         growBuffer(COLOR);
-        if(cComps>0) 
+        if(cComps>0)
             Buffers.putNs(colorArray, cDataTypeSigned, r, true);
-        if(cComps>1) 
+        if(cComps>1)
             Buffers.putNs(colorArray, cDataTypeSigned, g, true);
-        if(cComps>2) 
+        if(cComps>2)
             Buffers.putNs(colorArray, cDataTypeSigned, b, true);
-        if(cComps>3) 
+        if(cComps>3)
             Buffers.putNs(colorArray, cDataTypeSigned, a, true);
         countAndPadding(COLOR, cComps-4);
     }
     public void glColor3f(float r, float g, float b) {
         checkSeal(false);
         growBuffer(COLOR);
-        if(cComps>0) 
+        if(cComps>0)
             Buffers.putNf(colorArray, cDataTypeSigned, r);
-        if(cComps>1) 
+        if(cComps>1)
             Buffers.putNf(colorArray, cDataTypeSigned, g);
-        if(cComps>2) 
+        if(cComps>2)
             Buffers.putNf(colorArray, cDataTypeSigned, b);
         countAndPadding(COLOR, cComps-3);
     }
     public void glColor4f(float r, float g, float b, float a) {
         checkSeal(false);
         growBuffer(COLOR);
-        if(cComps>0) 
+        if(cComps>0)
             Buffers.putNf(colorArray, cDataTypeSigned, r);
-        if(cComps>1) 
+        if(cComps>1)
             Buffers.putNf(colorArray, cDataTypeSigned, g);
-        if(cComps>2) 
+        if(cComps>2)
             Buffers.putNf(colorArray, cDataTypeSigned, b);
-        if(cComps>3) 
+        if(cComps>3)
             Buffers.putNf(colorArray, cDataTypeSigned, a);
         countAndPadding(COLOR, cComps-4);
     }
@@ -784,60 +784,60 @@ public class ImmModeSink {
     public void glTexCoord2b(byte x, byte y) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
-        if(tComps>0) 
+        if(tComps>0)
             Buffers.putNb(textCoordArray, tDataTypeSigned, x, true);
-        if(tComps>1) 
+        if(tComps>1)
             Buffers.putNb(textCoordArray, tDataTypeSigned, y, true);
         countAndPadding(TEXTCOORD, tComps-2);
     }
     public void glTexCoord3b(byte x, byte y, byte z) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
-        if(tComps>0) 
+        if(tComps>0)
             Buffers.putNb(textCoordArray, tDataTypeSigned, x, true);
-        if(tComps>1) 
+        if(tComps>1)
             Buffers.putNb(textCoordArray, tDataTypeSigned, y, true);
-        if(tComps>2) 
+        if(tComps>2)
             Buffers.putNb(textCoordArray, tDataTypeSigned, z, true);
         countAndPadding(TEXTCOORD, tComps-3);
     }
     public void glTexCoord2s(short x, short y) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
-        if(tComps>0) 
+        if(tComps>0)
             Buffers.putNs(textCoordArray, tDataTypeSigned, x, true);
-        if(tComps>1) 
+        if(tComps>1)
             Buffers.putNs(textCoordArray, tDataTypeSigned, y, true);
         countAndPadding(TEXTCOORD, tComps-2);
     }
     public void glTexCoord3s(short x, short y, short z) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
-        if(tComps>0) 
+        if(tComps>0)
             Buffers.putNs(textCoordArray, tDataTypeSigned, x, true);
-        if(tComps>1) 
+        if(tComps>1)
             Buffers.putNs(textCoordArray, tDataTypeSigned, y, true);
-        if(tComps>2) 
+        if(tComps>2)
             Buffers.putNs(textCoordArray, tDataTypeSigned, z, true);
         countAndPadding(TEXTCOORD, tComps-3);
     }
     public void glTexCoord2f(float x, float y) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
-        if(tComps>0) 
+        if(tComps>0)
             Buffers.putNf(textCoordArray, tDataTypeSigned, x);
-        if(tComps>1) 
+        if(tComps>1)
             Buffers.putNf(textCoordArray, tDataTypeSigned, y);
         countAndPadding(TEXTCOORD, tComps-2);
     }
     public void glTexCoord3f(float x, float y, float z) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
-        if(tComps>0) 
+        if(tComps>0)
             Buffers.putNf(textCoordArray, tDataTypeSigned, x);
-        if(tComps>1) 
+        if(tComps>1)
             Buffers.putNf(textCoordArray, tDataTypeSigned, y);
-        if(tComps>2) 
+        if(tComps>2)
             Buffers.putNf(textCoordArray, tDataTypeSigned, z);
         countAndPadding(TEXTCOORD, tComps-3);
     }
@@ -864,20 +864,20 @@ public class ImmModeSink {
         shaderProgram = program;
         glslLocationSet = false; // enforce location reset!
     }
-    
+
     /**
      * @param gl
      * @return true if all locations for all used arrays are found (min 1 array), otherwise false.
-     *         Also sets 'glslLocationSet' to the return value! 
+     *         Also sets 'glslLocationSet' to the return value!
      */
     private boolean resetGLSLArrayLocation(GL2ES2 gl) {
         int iA = 0;
         int iL = 0;
-        
+
         if(null != vArrayData) {
             iA++;
             if( vArrayData.setLocation(gl, shaderProgram) >= 0 ) {
-                iL++;  
+                iL++;
             }
         }
         if(null != cArrayData) {
@@ -901,7 +901,7 @@ public class ImmModeSink {
         glslLocationSet = iA == iL;
         return glslLocationSet;
     }
-    
+
     public void destroy(GL gl) {
         reset(gl);
 
@@ -931,7 +931,7 @@ public class ImmModeSink {
         this.vElems=0;
         this.cElems=0;
         this.nElems=0;
-        this.tElems=0;        
+        this.tElems=0;
     }
 
     public void seal(GL glObj, boolean seal)
@@ -1016,20 +1016,20 @@ public class ImmModeSink {
         }
     } else {
         gl.glBufferData(GL.GL_ARRAY_BUFFER, buffer.limit(), buffer, glBufferUsage);
-        bufferWrittenOnce = true;                    
-    }                      
+        bufferWrittenOnce = true;
+    }
   }
-  
+
   private void enableBufferFixed(GL gl, boolean enable) {
     GL2ES1 glf = gl.getGL2ES1();
-    
+
     final boolean useV = vComps>0 && vElems>0 ;
     final boolean useC = cComps>0 && cElems>0 ;
     final boolean useN = nComps>0 && nElems>0 ;
     final boolean useT = tComps>0 && tElems>0 ;
-    
+
     if(DEBUG_DRAW) {
-        System.err.println("ImmModeSink.enableFixed.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);        
+        System.err.println("ImmModeSink.enableFixed.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);
     }
 
     if(enable) {
@@ -1038,7 +1038,7 @@ public class ImmModeSink {
                 throw new InternalError("Using VBO but no vboName");
             }
             glf.glBindBuffer(GL.GL_ARRAY_BUFFER, vboName);
-            
+
             if(!bufferWritten) {
                 writeBuffer(gl);
             }
@@ -1051,7 +1051,7 @@ public class ImmModeSink {
            glf.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
            glf.glVertexPointer(vArrayData);
        } else {
-           glf.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);               
+           glf.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
        }
     }
     if(useC) {
@@ -1082,24 +1082,24 @@ public class ImmModeSink {
     if(enable && useVBO) {
         gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
     }
-    
+
     if(DEBUG_DRAW) {
-        System.err.println("ImmModeSink.enableFixed.X ");        
+        System.err.println("ImmModeSink.enableFixed.X ");
     }
   }
 
   private void enableBufferGLSLShaderState(GL gl, boolean enable) {
     GL2ES2 glsl = gl.getGL2ES2();
- 
+
     final boolean useV = vComps>0 && vElems>0 ;
     final boolean useC = cComps>0 && cElems>0 ;
     final boolean useN = nComps>0 && nElems>0 ;
     final boolean useT = tComps>0 && tElems>0 ;
-    
+
     if(DEBUG_DRAW) {
-        System.err.println("ImmModeSink.enableGLSL.A.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);        
+        System.err.println("ImmModeSink.enableGLSL.A.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);
     }
-    
+
     if(enable) {
         if(useVBO) {
             if(0 == vboName) {
@@ -1110,9 +1110,9 @@ public class ImmModeSink {
                 writeBuffer(gl);
             }
         }
-        bufferWritten=true;        
+        bufferWritten=true;
     }
-    
+
     if(useV) {
        if(enable) {
            shaderState.enableVertexAttribArray(glsl, vArrayData);
@@ -1144,30 +1144,30 @@ public class ImmModeSink {
        } else {
            shaderState.disableVertexAttribArray(glsl, tArrayData);
        }
-    }    
+    }
     glslLocationSet = true; // ShaderState does set the location implicit
-    
+
     if(enable && useVBO) {
         glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
     }
-    
+
     if(DEBUG_DRAW) {
-        System.err.println("ImmModeSink.enableGLSL.A.X ");        
+        System.err.println("ImmModeSink.enableGLSL.A.X ");
     }
   }
 
   private void enableBufferGLSLSimple(GL gl, boolean enable) {
     GL2ES2 glsl = gl.getGL2ES2();
- 
+
     final boolean useV = vComps>0 && vElems>0 ;
     final boolean useC = cComps>0 && cElems>0 ;
     final boolean useN = nComps>0 && nElems>0 ;
     final boolean useT = tComps>0 && tElems>0 ;
-    
+
     if(DEBUG_DRAW) {
-        System.err.println("ImmModeSink.enableGLSL.B.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);        
+        System.err.println("ImmModeSink.enableGLSL.B.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);
     }
-    
+
     if(!glslLocationSet) {
         if( !resetGLSLArrayLocation(glsl) ) {
             if(DEBUG_DRAW) {
@@ -1180,7 +1180,7 @@ public class ImmModeSink {
             return;
         }
     }
-    
+
     if(enable) {
         if(useVBO) {
             if(0 == vboName) {
@@ -1226,28 +1226,28 @@ public class ImmModeSink {
            glsl.glDisableVertexAttribArray(tArrayData.getLocation());
        }
     }
-    
+
     if(enable && useVBO) {
         glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
     }
-    
+
     if(DEBUG_DRAW) {
-        System.err.println("ImmModeSink.enableGLSL.B.X ");        
+        System.err.println("ImmModeSink.enableGLSL.B.X ");
     }
   }
-  
+
     public String toString() {
-        final String glslS = useGLSL ? 
+        final String glslS = useGLSL ?
                        ", useShaderState "+(null!=shaderState)+
                        ", shaderProgram "+shaderProgram+
                        ", glslLocationSet "+glslLocationSet : "";
-        
-        return "VBOSet[mode "+mode+ 
-                       ", modeOrig "+modeOrig+ 
+
+        return "VBOSet[mode "+mode+
+                       ", modeOrig "+modeOrig+
                        ", use/count "+getElemUseCountStr()+
-                       ", sealed "+sealed+ 
+                       ", sealed "+sealed+
                        ", sealedGL "+sealedGL+
-                       ", bufferEnabled "+bufferEnabled+ 
+                       ", bufferEnabled "+bufferEnabled+
                        ", bufferWritten "+bufferWritten+" (once "+bufferWrittenOnce+")"+
                        ", useVBO "+useVBO+", vboName "+vboName+
                        ", useGLSL "+useGLSL+
@@ -1264,7 +1264,7 @@ public class ImmModeSink {
     protected String getElemUseCountStr() {
         return "[v "+vElems+"/"+vCount+", c "+cElems+"/"+cCount+", n "+nElems+"/"+nCount+", t "+tElems+"/"+tCount+"]";
     }
-    
+
     protected boolean fitElementInBuffer(int type) {
         final int addElems = 1;
         switch (type) {
@@ -1280,20 +1280,20 @@ public class ImmModeSink {
                 throw new InternalError("XXX");
         }
     }
-    
+
     protected boolean reallocateBuffer(int addElems) {
         final int vAdd = addElems - ( vCount - vElems );
         final int cAdd = addElems - ( cCount - cElems );
         final int nAdd = addElems - ( nCount - nElems );
         final int tAdd = addElems - ( tCount - tElems );
-        
+
         if( 0>=vAdd && 0>=cAdd && 0>=nAdd && 0>=tAdd) {
             if(DEBUG_BUFFER) {
                 System.err.println("ImmModeSink.realloc: "+getElemUseCountStr()+" + "+addElems+" -> NOP");
             }
             return false;
         }
-        
+
         if(DEBUG_BUFFER) {
             System.err.println("ImmModeSink.realloc: "+getElemUseCountStr()+" + "+addElems);
         }
@@ -1301,20 +1301,20 @@ public class ImmModeSink {
         cCount += cAdd;
         nCount += nAdd;
         tCount += tAdd;
-        
+
         final int vBytes  = vCount * vCompsBytes;
         final int cBytes  = cCount * cCompsBytes;
         final int nBytes  = nCount * nCompsBytes;
         final int tBytes  = tCount * tCompsBytes;
-        
+
         buffer = Buffers.newDirectByteBuffer( vBytes + cBytes + nBytes + tBytes );
         vOffset = 0;
-        
+
         if(vBytes>0) {
             vertexArray = GLBuffers.sliceGLBuffer(buffer, vOffset, vBytes, vDataType);
         } else {
             vertexArray = null;
-        }        
+        }
         cOffset=vOffset+vBytes;
 
         if(cBytes>0) {
@@ -1341,36 +1341,36 @@ public class ImmModeSink {
         buffer.flip();
 
         if(vComps>0) {
-            vArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, vComps, 
+            vArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, vComps,
                                                         vDataType, GLBuffers.isGLTypeFixedPoint(vDataType), 0,
                                                         vertexArray, 0, vOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
         } else {
             vArrayData = null;
         }
         if(cComps>0) {
-            cArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_COLOR_ARRAY, cComps, 
+            cArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_COLOR_ARRAY, cComps,
                                                         cDataType, GLBuffers.isGLTypeFixedPoint(cDataType), 0,
                                                         colorArray, 0, cOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
         } else {
             cArrayData = null;
         }
         if(nComps>0) {
-            nArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_NORMAL_ARRAY, nComps, 
+            nArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_NORMAL_ARRAY, nComps,
                                                         nDataType, GLBuffers.isGLTypeFixedPoint(nDataType), 0,
                                                         normalArray, 0, nOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
         } else {
             nArrayData = null;
         }
         if(tComps>0) {
-            tArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, tComps, 
+            tArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, tComps,
                                                         tDataType, GLBuffers.isGLTypeFixedPoint(tDataType), 0,
                                                         textCoordArray, 0, tOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
         } else {
             tArrayData = null;
         }
-        
+
         bufferWrittenOnce = false; // new buffer data storage size!
-        
+
         if(DEBUG_BUFFER) {
             System.err.println("ImmModeSink.realloc.X: "+this.toString());
             Thread.dumpStack();
@@ -1384,7 +1384,7 @@ public class ImmModeSink {
             if( !fitElementInBuffer(type) ) {
                 // save olde values ..
                 final Buffer _vertexArray=vertexArray, _colorArray=colorArray, _normalArray=normalArray, _textCoordArray=textCoordArray;
-        
+
                 if ( reallocateBuffer(resizeElementCount) ) {
                     if(null!=_vertexArray) {
                         _vertexArray.flip();
@@ -1416,7 +1416,7 @@ public class ImmModeSink {
      * vec4 v = vec4(0, 0, 0, 1);
      * vec4 c = vec4(0, 0, 0, 1);
      * </p>
-     * 
+     *
      * @param type
      * @param fill
      */
@@ -1426,7 +1426,7 @@ public class ImmModeSink {
         final Buffer dest;
         final boolean dSigned;
         final int e; // either 0 or 1
-                
+
         switch (type) {
             case VERTEX:
                 dest = vertexArray;
@@ -1459,7 +1459,7 @@ public class ImmModeSink {
 
         while( fill > e ) {
             fill--;
-            Buffers.putNf(dest, dSigned, 0f);            
+            Buffers.putNf(dest, dSigned, 0f);
         }
         if( fill > 0 ) { // e == 1, add missing '1f end component'
             Buffers.putNf(dest, dSigned, 1f);
@@ -1480,18 +1480,18 @@ public class ImmModeSink {
     private static final int NORMAL = 2;
     private static final int TEXTCOORD = 3;
 
-    private int vCount,    cCount,    nCount,    tCount;       // number of elements fit in each buffer 
+    private int vCount,    cCount,    nCount,    tCount;       // number of elements fit in each buffer
     private int vOffset,   cOffset,   nOffset,   tOffset;      // offset of specific array in common buffer
     private int vElems,    cElems,    nElems,    tElems;       // number of used elements in each buffer
-    private final int vComps,    cComps,    nComps,    tComps; // number of components for each elements [2, 3, 4] 
-    private final int vCompsBytes, cCompsBytes, nCompsBytes, tCompsBytes; // byte size of all components 
+    private final int vComps,    cComps,    nComps,    tComps; // number of components for each elements [2, 3, 4]
+    private final int vCompsBytes, cCompsBytes, nCompsBytes, tCompsBytes; // byte size of all components
     private final int vDataType, cDataType, nDataType, tDataType;
     private final boolean vDataTypeSigned, cDataTypeSigned, nDataTypeSigned, tDataTypeSigned;
     private final int pageSize;
     private Buffer vertexArray, colorArray, normalArray, textCoordArray;
     private GLArrayDataWrapper vArrayData, cArrayData, nArrayData, tArrayData;
 
-    private boolean sealed, sealedGL;    
+    private boolean sealed, sealedGL;
     private boolean bufferEnabled, bufferWritten, bufferWrittenOnce;
     private boolean glslLocationSet;
   }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
index 58151856f..b4a0156e9 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2011 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.opengl.util;
@@ -55,22 +55,22 @@ import com.jogamp.opengl.math.geom.Frustum;
  * regarding the projection (P), modelview (Mv) matrix operation
  * which is specified in {@link GLMatrixFunc}.
  * <p>
- * Further more, PMVMatrix provides the {@link #glGetMviMatrixf() inverse modelview matrix (Mvi)} and 
+ * Further more, PMVMatrix provides the {@link #glGetMviMatrixf() inverse modelview matrix (Mvi)} and
  * {@link #glGetMvitMatrixf() inverse transposed modelview matrix (Mvit)}.
  * {@link Frustum} is also provided by {@link #glGetFrustum()}.
  * To keep these derived values synchronized after mutable Mv operations like {@link #glRotatef(float, float, float, float) glRotatef(..)}
- * in {@link #glMatrixMode(int) glMatrixMode}({@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}), 
- * users have to call {@link #update()} before using Mvi and Mvit. 
+ * in {@link #glMatrixMode(int) glMatrixMode}({@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}),
+ * users have to call {@link #update()} before using Mvi and Mvit.
  * </p>
  * <p>
- * All matrices are provided in column-major order, 
- * as specified in the OpenGL fixed function pipeline, i.e. compatibility profile. 
+ * All matrices are provided in column-major order,
+ * as specified in the OpenGL fixed function pipeline, i.e. compatibility profile.
  * </p>
  * <p>
- * PMVMatrix can supplement {@link GL2ES2} applications w/ the 
+ * PMVMatrix can supplement {@link GL2ES2} applications w/ the
  * lack of the described matrix functionality.
  * </p>
- * <a name="storageDetails"><h5>Matrix storage details</h5></a> 
+ * <a name="storageDetails"><h5>Matrix storage details</h5></a>
  * <p>
  * All matrices use a common FloatBuffer storage
  * and are a {@link Buffers#slice2Float(Buffer, float[], int, int) sliced} representation of it.
@@ -78,11 +78,11 @@ import com.jogamp.opengl.math.geom.Frustum;
  * depending how the instance if {@link #PMVMatrix(boolean) being constructed}.
  * </p>
  * <p>
- * <b>Note:</b> 
- * <ul> 
+ * <b>Note:</b>
+ * <ul>
  *   <li>The matrix is a {@link Buffers#slice2Float(Buffer, float[], int, int) sliced part } of a host matrix and it's start position has been {@link FloatBuffer#mark() marked}.</li>
  *   <li>Use {@link FloatBuffer#reset() reset()} to rewind it to it's start position after relative operations, like {@link FloatBuffer#get() get()}.</li>
- *   <li>If using absolute operations like {@link FloatBuffer#get(int) get(int)}, use it's {@link FloatBuffer#reset() reset} {@link FloatBuffer#position() position} as it's offset.</li> 
+ *   <li>If using absolute operations like {@link FloatBuffer#get(int) get(int)}, use it's {@link FloatBuffer#reset() reset} {@link FloatBuffer#position() position} as it's offset.</li>
  * </ul>
  * </p>
  */
@@ -96,20 +96,20 @@ public class PMVMatrix implements GLMatrixFunc {
     public static final int MODIFIED_TEXTURE                       = 1 << 2;
     /** Bit value stating all is modified */
     public static final int MODIFIED_ALL                           = MODIFIED_PROJECTION | MODIFIED_MODELVIEW | MODIFIED_TEXTURE ;
-    
+
     /** Bit value stating a dirty {@link #glGetMviMatrixf() inverse modelview matrix (Mvi)}. */
     public static final int DIRTY_INVERSE_MODELVIEW             = 1 << 0;
     /** Bit value stating a dirty {@link #glGetMvitMatrixf() inverse transposed modelview matrix (Mvit)}. */
-    public static final int DIRTY_INVERSE_TRANSPOSED_MODELVIEW  = 1 << 1;    
+    public static final int DIRTY_INVERSE_TRANSPOSED_MODELVIEW  = 1 << 1;
     /** Bit value stating a dirty {@link #glGetFrustum() frustum}. */
-    public static final int DIRTY_FRUSTUM                       = 1 << 2;    
+    public static final int DIRTY_FRUSTUM                       = 1 << 2;
     /** Bit value stating all is dirty */
     public static final int DIRTY_ALL                           = DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW | DIRTY_FRUSTUM;
-    
+
     /**
-     * @param matrixModeName One of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}  
+     * @param matrixModeName One of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
      * @return true if the given matrix-mode name is valid, otherwise false.
-     */                     
+     */
     public static final boolean isMatrixModeName(final int matrixModeName) {
         switch(matrixModeName) {
             case GL_MODELVIEW_MATRIX:
@@ -121,9 +121,9 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     /**
-     * @param matrixModeName One of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}  
+     * @param matrixModeName One of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
      * @return The corresponding matrix-get name, one of {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX}
-     */                     
+     */
     public static final int matrixModeName2MatrixGetName(final int matrixModeName) {
         switch(matrixModeName) {
             case GL_MODELVIEW:
@@ -138,9 +138,9 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     /**
-     * @param matrixGetName One of {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX}  
+     * @param matrixGetName One of {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX}
      * @return true if the given matrix-get name is valid, otherwise false.
-     */                     
+     */
     public static final boolean isMatrixGetName(final int matrixGetName) {
         switch(matrixGetName) {
             case GL_MATRIX_MODE:
@@ -155,7 +155,7 @@ public class PMVMatrix implements GLMatrixFunc {
     /**
      * @param matrixGetName One of  {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX}
      * @return The corresponding matrix-mode name, one of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
-     */                     
+     */
     public static final int matrixGetName2MatrixModeName(final int matrixGetName) {
         switch(matrixGetName) {
             case GL_MODELVIEW_MATRIX:
@@ -168,18 +168,18 @@ public class PMVMatrix implements GLMatrixFunc {
               throw new GLException("unsupported matrixGetName: "+matrixGetName);
         }
     }
-    
-    /** 
+
+    /**
      * @param sb optional passed StringBuilder instance to be used
      * @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
      * @param a 4x4 matrix in column major order (OpenGL)
      * @return matrix string representation
      */
     public static StringBuilder matrixToString(StringBuilder sb, String f, FloatBuffer a) {
-        return FloatUtil.matrixToString(sb, null, f, a, 0, 4, 4, false);        
+        return FloatUtil.matrixToString(sb, null, f, a, 0, 4, 4, false);
     }
-    
-    /** 
+
+    /**
      * @param sb optional passed StringBuilder instance to be used
      * @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
      * @param a 4x4 matrix in column major order (OpenGL)
@@ -187,33 +187,33 @@ public class PMVMatrix implements GLMatrixFunc {
      * @return side by side representation
      */
     public static StringBuilder matrixToString(StringBuilder sb, String f, FloatBuffer a, FloatBuffer b) {
-        return FloatUtil.matrixToString(sb, null, f, a, 0, b, 0, 4, 4, false);        
+        return FloatUtil.matrixToString(sb, null, f, a, 0, b, 0, 4, 4, false);
     }
-    
+
     /**
      * Creates an instance of PMVMatrix {@link #PMVMatrix(boolean) PMVMatrix(boolean useBackingArray)},
-     * with <code>useBackingArray = true</code>. 
+     * with <code>useBackingArray = true</code>.
      */
     public PMVMatrix() {
         this(true);
     }
-    
+
     /**
      * Creates an instance of PMVMatrix.
-     * 
+     *
      * @param useBackingArray <code>true</code> for non direct NIO Buffers with guaranteed backing array,
      *                        which allows faster access in Java computation.
      *                        <p><code>false</code> for direct NIO buffers w/o a guaranteed backing array.
      *                        In most Java implementations, direct NIO buffers have no backing array
-     *                        and hence the Java computation will be throttled down by direct IO get/put 
-     *                        operations.</p> 
+     *                        and hence the Java computation will be throttled down by direct IO get/put
+     *                        operations.</p>
      *                        <p>Depending on the application, ie. whether the Java computation or
-     *                        JNI invocation and hence native data transfer part is heavier, 
+     *                        JNI invocation and hence native data transfer part is heavier,
      *                        this flag shall be set to <code>true</code> or <code>false</code></p>.
      */
     public PMVMatrix(boolean useBackingArray) {
           this.usesBackingArray = useBackingArray;
-          
+
           // I    Identity
           // T    Texture
           // P    Projection
@@ -228,24 +228,24 @@ public class PMVMatrix implements GLMatrixFunc {
               matrixBuffer = Buffers.newDirectByteBuffer( ( 6*16 + ProjectFloat.getRequiredFloatBufferSize() ) * Buffers.SIZEOF_FLOAT );
               matrixBuffer.mark();
           }
-          
+
           matrixIdent   = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  0*16, 1*16);  //  I
           matrixTex     = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  1*16, 1*16);  //      T
-          matrixPMvMvit = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  2*16, 4*16);  //          P  + Mv + Mvi + Mvit          
+          matrixPMvMvit = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  2*16, 4*16);  //          P  + Mv + Mvi + Mvit
           matrixPMvMvi  = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  2*16, 3*16);  //          P  + Mv + Mvi
           matrixPMv     = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  2*16, 2*16);  //          P  + Mv
           matrixP       = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  2*16, 1*16);  //          P
           matrixMv      = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  3*16, 1*16);  //               Mv
           matrixMvi     = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  4*16, 1*16);  //                    Mvi
           matrixMvit    = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  5*16, 1*16);  //                          Mvit
-          
+
           projectFloat  = new ProjectFloat(matrixBuffer, matrixBufferArray, 6*16);
-          
+
           if(null != matrixBuffer) {
               matrixBuffer.reset();
-          }          
+          }
           FloatUtil.makeIdentityf(matrixIdent);
-          
+
           vec3f         = new float[3];
           matrixMult    = new float[16];
           matrixTrans   = new float[16];
@@ -263,7 +263,7 @@ public class PMVMatrix implements GLMatrixFunc {
           matrixTStack = new FloatStack( 0,  2*16); // growSize: GL-min size (2)
           matrixPStack = new FloatStack( 0,  2*16); // growSize: GL-min size (2)
           matrixMvStack= new FloatStack( 0, 16*16); // growSize: half GL-min size (32)
-          
+
           // default values and mode
           glMatrixMode(GL_PROJECTION);
           glLoadIdentity();
@@ -275,22 +275,22 @@ public class PMVMatrix implements GLMatrixFunc {
           dirtyBits = DIRTY_ALL;
           requestMask = 0;
           matrixMode = GL_MODELVIEW;
-          
+
           mulPMV = null;
           frustum = null;
     }
 
     /** @see #PMVMatrix(boolean) */
-    public final boolean usesBackingArray() { return usesBackingArray; }          
-    
+    public final boolean usesBackingArray() { return usesBackingArray; }
+
     public final void destroy() {
         if(null!=projectFloat) {
             projectFloat.destroy(); projectFloat=null;
         }
 
         matrixBuffer=null;
-        matrixBuffer=null; matrixPMvMvit=null; matrixPMvMvi=null; matrixPMv=null; 
-        matrixP=null; matrixTex=null; matrixMv=null; matrixMvi=null; matrixMvit=null;        
+        matrixBuffer=null; matrixPMvMvit=null; matrixPMvMvi=null; matrixPMv=null;
+        matrixP=null; matrixTex=null; matrixMv=null; matrixMvi=null; matrixMvit=null;
 
         vec3f         = null;
         matrixMult    = null;
@@ -299,7 +299,7 @@ public class PMVMatrix implements GLMatrixFunc {
         matrixScale   = null;
         matrixOrtho   = null;
         matrixFrustum = null;
-        
+
         if(null!=matrixPStack) {
             matrixPStack=null;
         }
@@ -314,13 +314,13 @@ public class PMVMatrix implements GLMatrixFunc {
         }
     }
 
-    
+
     /** Returns the current matrix-mode, one of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}. */
     public final int  glGetMatrixMode() {
         return matrixMode;
     }
 
-    /** 
+    /**
      * Returns the {@link GLMatrixFunc#GL_TEXTURE_MATRIX texture matrix} (T).
      * <p>
      * See <a href="#storageDetails"> matrix storage details</a>.
@@ -330,7 +330,7 @@ public class PMVMatrix implements GLMatrixFunc {
         return matrixTex;
     }
 
-    /** 
+    /**
      * Returns the {@link GLMatrixFunc#GL_PROJECTION_MATRIX projection matrix} (P).
      * <p>
      * See <a href="#storageDetails"> matrix storage details</a>.
@@ -340,7 +340,7 @@ public class PMVMatrix implements GLMatrixFunc {
         return matrixP;
     }
 
-    /** 
+    /**
      * Returns the {@link GLMatrixFunc#GL_MODELVIEW_MATRIX modelview matrix} (Mv).
      * <p>
      * See <a href="#storageDetails"> matrix storage details</a>.
@@ -350,7 +350,7 @@ public class PMVMatrix implements GLMatrixFunc {
         return matrixMv;
     }
 
-    /** 
+    /**
      * Returns the inverse {@link GLMatrixFunc#GL_MODELVIEW_MATRIX modelview matrix} (Mvi).
      * <p>
      * Method enables the Mvi matrix update, and performs it's update w/o clearing the modified bits.
@@ -367,7 +367,7 @@ public class PMVMatrix implements GLMatrixFunc {
         return matrixMvi;
     }
 
-    /** 
+    /**
      * Returns the inverse transposed {@link GLMatrixFunc#GL_MODELVIEW_MATRIX modelview matrix} (Mvit).
      * <p>
      * Method enables the Mvit matrix update, and performs it's update w/o clearing the modified bits.
@@ -383,9 +383,9 @@ public class PMVMatrix implements GLMatrixFunc {
         updateImpl(false);
         return matrixMvit;
     }
-    
-    /** 
-     * Returns 2 matrices within one FloatBuffer: {@link #glGetPMatrixf() P} and {@link #glGetMvMatrixf() Mv}.  
+
+    /**
+     * Returns 2 matrices within one FloatBuffer: {@link #glGetPMatrixf() P} and {@link #glGetMvMatrixf() Mv}.
      * <p>
      * See <a href="#storageDetails"> matrix storage details</a>.
      * </p>
@@ -393,9 +393,9 @@ public class PMVMatrix implements GLMatrixFunc {
     public final FloatBuffer glGetPMvMatrixf() {
         return matrixPMv;
     }
-    
-    /** 
-     * Returns 3 matrices within one FloatBuffer: {@link #glGetPMatrixf() P}, {@link #glGetMvMatrixf() Mv} and {@link #glGetMviMatrixf() Mvi}.  
+
+    /**
+     * Returns 3 matrices within one FloatBuffer: {@link #glGetPMatrixf() P}, {@link #glGetMvMatrixf() Mv} and {@link #glGetMviMatrixf() Mvi}.
      * <p>
      * Method enables the Mvi matrix update, and performs it's update w/o clearing the modified bits.
      * </p>
@@ -410,9 +410,9 @@ public class PMVMatrix implements GLMatrixFunc {
         updateImpl(false);
         return matrixPMvMvi;
     }
-    
-    /** 
-     * Returns 4 matrices within one FloatBuffer: {@link #glGetPMatrixf() P}, {@link #glGetMvMatrixf() Mv}, {@link #glGetMviMatrixf() Mvi} and {@link #glGetMvitMatrixf() Mvit}.  
+
+    /**
+     * Returns 4 matrices within one FloatBuffer: {@link #glGetPMatrixf() P}, {@link #glGetMvMatrixf() Mv}, {@link #glGetMviMatrixf() Mvi} and {@link #glGetMvitMatrixf() Mvit}.
      * <p>
      * Method enables the Mvi and Mvit matrix update, and performs it's update w/o clearing the modified bits.
      * </p>
@@ -427,14 +427,14 @@ public class PMVMatrix implements GLMatrixFunc {
         updateImpl(false);
         return matrixPMvMvit;
     }
-    
+
     /** Returns the frustum, derived from projection * modelview */
     public Frustum glGetFrustum() {
         requestMask |= DIRTY_FRUSTUM;
         updateImpl(false);
         return frustum;
     }
-        
+
     /*
      * @return the matrix of the current matrix-mode
      */
@@ -443,7 +443,7 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     /**
-     * @param matrixName Either a matrix-get-name, i.e. 
+     * @param matrixName Either a matrix-get-name, i.e.
      *                   {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX},
      *                   or a matrix-mode-name, i.e.
      *                   {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
@@ -462,10 +462,10 @@ public class PMVMatrix implements GLMatrixFunc {
                 return matrixTex;
             default:
               throw new GLException("unsupported matrixName: "+matrixName);
-        }    
+        }
     }
 
-    // 
+    //
     // GLMatrixFunc implementation
     //
 
@@ -494,7 +494,7 @@ public class PMVMatrix implements GLMatrixFunc {
         }
         params.position(pos);
     }
-    
+
     @Override
     public final void glGetFloatv(int matrixGetName, float[] params, int params_offset) {
         if(matrixGetName==GL_MATRIX_MODE) {
@@ -505,7 +505,7 @@ public class PMVMatrix implements GLMatrixFunc {
             matrix.reset();
         }
     }
-    
+
     @Override
     public final void glGetIntegerv(int pname, IntBuffer params) {
         int pos = params.position();
@@ -516,7 +516,7 @@ public class PMVMatrix implements GLMatrixFunc {
         }
         params.position(pos);
     }
-    
+
     @Override
     public final void glGetIntegerv(int pname, int[] params, int params_offset) {
         if(pname==GL_MATRIX_MODE) {
@@ -537,12 +537,12 @@ public class PMVMatrix implements GLMatrixFunc {
             matrixP.put(values, offset, 16);
             matrixP.reset();
             dirtyBits |= DIRTY_FRUSTUM ;
-            modifiedBits |= MODIFIED_PROJECTION;            
+            modifiedBits |= MODIFIED_PROJECTION;
         } else if(matrixMode==GL.GL_TEXTURE) {
             matrixTex.put(values, offset, 16);
             matrixTex.reset();
             modifiedBits |= MODIFIED_TEXTURE;
-        } 
+        }
     }
 
     @Override
@@ -557,12 +557,12 @@ public class PMVMatrix implements GLMatrixFunc {
             matrixP.put(m);
             matrixP.reset();
             dirtyBits |= DIRTY_FRUSTUM ;
-            modifiedBits |= MODIFIED_PROJECTION;            
+            modifiedBits |= MODIFIED_PROJECTION;
         } else if(matrixMode==GL.GL_TEXTURE) {
             matrixTex.put(m);
             matrixTex.reset();
             modifiedBits |= MODIFIED_TEXTURE;
-        } 
+        }
         m.position(spos);
     }
 
@@ -584,9 +584,9 @@ public class PMVMatrix implements GLMatrixFunc {
 
     @Override
     public final void glPushMatrix() {
-        if(matrixMode==GL_MODELVIEW) { 
+        if(matrixMode==GL_MODELVIEW) {
             matrixMvStack.putOnTop(matrixMv, 16);
-            matrixMv.reset();            
+            matrixMv.reset();
         } else if(matrixMode==GL_PROJECTION) {
             matrixPStack.putOnTop(matrixP, 16);
             matrixP.reset();
@@ -612,8 +612,8 @@ public class PMVMatrix implements GLMatrixFunc {
             matrixTex.put(matrixIdent);
             matrixTex.reset();
             modifiedBits |= MODIFIED_TEXTURE;
-        } 
-        matrixIdent.reset();        
+        }
+        matrixIdent.reset();
     }
 
     @Override
@@ -629,7 +629,7 @@ public class PMVMatrix implements GLMatrixFunc {
         } else if(matrixMode==GL.GL_TEXTURE) {
             FloatUtil.multMatrixf(matrixTex, m);
             modifiedBits |= MODIFIED_TEXTURE;
-        } 
+        }
     }
 
     @Override
@@ -645,12 +645,12 @@ public class PMVMatrix implements GLMatrixFunc {
         } else if(matrixMode==GL.GL_TEXTURE) {
             FloatUtil.multMatrixf(matrixTex, m, m_offset);
             modifiedBits |= MODIFIED_TEXTURE;
-        } 
+        }
     }
 
     @Override
     public final void glTranslatef(final float x, final float y, final float z) {
-        // Translation matrix: 
+        // Translation matrix:
         //  1 0 0 x
         //  0 1 0 y
         //  0 0 1 z
@@ -665,7 +665,7 @@ public class PMVMatrix implements GLMatrixFunc {
     public final void glRotatef(final float angdeg, float x, float y, float z) {
         final float angrad = angdeg   * (float) Math.PI / 180.0f;
         final float c = (float)Math.cos(angrad);
-        final float ic= 1.0f - c; 
+        final float ic= 1.0f - c;
         final float s = (float)Math.sin(angrad);
 
         vec3f[0]=x; vec3f[1]=y; vec3f[2]=z;
@@ -700,7 +700,7 @@ public class PMVMatrix implements GLMatrixFunc {
 
     @Override
     public final void glScalef(final float x, final float y, final float z) {
-        // Scale matrix: 
+        // Scale matrix:
         //  x 0 0 0
         //  0 y 0 0
         //  0 0 z 0
@@ -714,7 +714,7 @@ public class PMVMatrix implements GLMatrixFunc {
 
     @Override
     public final void glOrthof(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
-        // Ortho matrix: 
+        // Ortho matrix:
         //  2/dx  0     0    tx
         //  0     2/dy  0    ty
         //  0     0     2/dz tz
@@ -744,7 +744,7 @@ public class PMVMatrix implements GLMatrixFunc {
         if(left==right || top==bottom) {
             throw new GLException("GL_INVALID_VALUE: top,bottom and left,right must not be equal");
         }
-        // Frustum matrix: 
+        // Frustum matrix:
         //  2*zNear/dx   0          A  0
         //  0            2*zNear/dy B  0
         //  0            0          C  D
@@ -774,7 +774,7 @@ public class PMVMatrix implements GLMatrixFunc {
     //
     // Extra functionality
     //
-    
+
     /**
      * {@link #glMultMatrixf(FloatBuffer) Multiply} the {@link #glGetMatrixMode() current matrix} with the perspective/frustum matrix.
      */
@@ -787,7 +787,7 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     /**
-     * {@link #glMultMatrixf(FloatBuffer) Multiply} and {@link #glTranslatef(float, float, float) translate} the {@link #glGetMatrixMode() current matrix} 
+     * {@link #glMultMatrixf(FloatBuffer) Multiply} and {@link #glTranslatef(float, float, float) translate} the {@link #glGetMatrixMode() current matrix}
      * with the eye, object and orientation.
      */
     public final void gluLookAt(float eyex, float eyey, float eyez,
@@ -798,7 +798,7 @@ public class PMVMatrix implements GLMatrixFunc {
 
     /**
      * Map object coordinates to window coordinates.
-     * 
+     *
      * @param objx
      * @param objy
      * @param objz
@@ -815,20 +815,20 @@ public class PMVMatrix implements GLMatrixFunc {
             return projectFloat.gluProject(objx, objy, objz,
                                            matrixMv.array(), matrixMv.position(),
                                            matrixP.array(), matrixP.position(),
-                                           viewport, viewport_offset, 
+                                           viewport, viewport_offset,
                                            win_pos, win_pos_offset);
         } else {
             return projectFloat.gluProject(objx, objy, objz,
                                            matrixMv,
                                            matrixP,
-                                           viewport, viewport_offset, 
+                                           viewport, viewport_offset,
                                            win_pos, win_pos_offset);
         }
     }
 
     /**
      * Map window coordinates to object coordinates.
-     * 
+     *
      * @param winx
      * @param winy
      * @param winz
@@ -845,23 +845,23 @@ public class PMVMatrix implements GLMatrixFunc {
             return projectFloat.gluUnProject(winx, winy, winz,
                                              matrixMv.array(), matrixMv.position(),
                                              matrixP.array(), matrixP.position(),
-                                             viewport, viewport_offset, 
+                                             viewport, viewport_offset,
                                              obj_pos, obj_pos_offset);
         } else {
             return projectFloat.gluUnProject(winx, winy, winz,
                                              matrixMv,
                                              matrixP,
-                                             viewport, viewport_offset, 
+                                             viewport, viewport_offset,
                                              obj_pos, obj_pos_offset);
-        }        
+        }
     }
-    
+
     public final void gluPickMatrix(float x, float y,
                               float deltaX, float deltaY,
                               int[] viewport, int viewport_offset) {
         projectFloat.gluPickMatrix(this, x, y, deltaX, deltaY, viewport, viewport_offset);
     }
-        
+
     public StringBuilder toString(StringBuilder sb, String f) {
         if(null == sb) {
             sb = new StringBuilder();
@@ -874,8 +874,8 @@ public class PMVMatrix implements GLMatrixFunc {
         final boolean frustumReq = 0 != (DIRTY_FRUSTUM & requestMask);
         final boolean modP = 0 != ( MODIFIED_PROJECTION & modifiedBits );
         final boolean modMv = 0 != ( MODIFIED_MODELVIEW & modifiedBits );
-        final boolean modT = 0 != ( MODIFIED_TEXTURE & modifiedBits );        
-        
+        final boolean modT = 0 != ( MODIFIED_TEXTURE & modifiedBits );
+
         sb.append("PMVMatrix[backingArray ").append(this.usesBackingArray());
         sb.append(", modified[P ").append(modP).append(", Mv ").append(modMv).append(", T ").append(modT);
         sb.append("], dirty/req[Mvi ").append(mviDirty).append("/").append(mviReq).append(", Mvit ").append(mvitDirty).append("/").append(mvitReq).append(", Frustum ").append(frustumDirty).append("/").append(frustumReq);
@@ -887,28 +887,28 @@ public class PMVMatrix implements GLMatrixFunc {
         matrixToString(sb, f, matrixTex);
         if( 0 != ( requestMask & DIRTY_INVERSE_MODELVIEW ) ) {
             sb.append(", Inverse Modelview").append(Platform.NEWLINE);
-            matrixToString(sb, f, matrixMvi);            
+            matrixToString(sb, f, matrixMvi);
         }
         if( 0 != ( requestMask & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) {
             sb.append(", Inverse Transposed Modelview").append(Platform.NEWLINE);
-            matrixToString(sb, f, matrixMvit);            
+            matrixToString(sb, f, matrixMvit);
         }
         sb.append("]");
         return sb;
     }
-    
+
     public String toString() {
         return toString(null, "%10.5f").toString();
     }
 
-    /** 
+    /**
      * Returns the modified bits due to mutable operations..
      * <p>
      * A modified bit is set, if the corresponding matrix had been modified by a mutable operation
      * since last {@link #update()} or {@link #getModifiedBits(boolean) getModifiedBits(true)} call.
      * </p>
      * @param clear if true, clears the modified bits, otherwise leaves them untouched.
-     * 
+     *
      * @see #MODIFIED_PROJECTION
      * @see #MODIFIED_MODELVIEW
      * @see #MODIFIED_TEXTURE
@@ -920,16 +920,16 @@ public class PMVMatrix implements GLMatrixFunc {
         }
         return r;
     }
-    
-    /** 
+
+    /**
      * Returns the dirty bits due to mutable operations.
      * <p>
      * A dirty bit is set , if the corresponding matrix had been modified by a mutable operation
      * since last {@link #update()} call. The latter clears the dirty state only if the dirty matrix (Mvi or Mvit) or {@link Frustum}
-     * has been requested by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get} 
+     * has been requested by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
      * or {@link #glGetFrustum() Frustum get} methods.
      * </p>
-     * 
+     *
      * @deprecated Function is exposed for debugging purposes only.
      * @see #DIRTY_INVERSE_MODELVIEW
      * @see #DIRTY_INVERSE_TRANSPOSED_MODELVIEW
@@ -944,12 +944,12 @@ public class PMVMatrix implements GLMatrixFunc {
         return dirtyBits;
     }
 
-    /** 
+    /**
      * Returns the request bit mask, which uses bit values equal to the dirty mask.
      * <p>
-     * The request bit mask is set by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get} 
+     * The request bit mask is set by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
      * or {@link #glGetFrustum() Frustum get} methods.
-     * </p> 
+     * </p>
      *
      * @deprecated Function is exposed for debugging purposes only.
      * @see #clearAllUpdateRequests()
@@ -965,16 +965,16 @@ public class PMVMatrix implements GLMatrixFunc {
     public final int getRequestMask() {
         return requestMask;
     }
-    
-    
+
+
     /**
      * Clears all {@link #update()} requests of the Mvi and Mvit matrix and Frustum
-     * after it has been enabled by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get} 
+     * after it has been enabled by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
      * or {@link #glGetFrustum() Frustum get} methods.
      * <p>
      * Allows user to disable subsequent Mvi, Mvit and {@link Frustum} updates if no more required.
-     * </p>  
-     * 
+     * </p>
+     *
      * @see #glGetMviMatrixf()
      * @see #glGetMvitMatrixf()
      * @see #glGetPMvMviMatrixf()
@@ -983,14 +983,14 @@ public class PMVMatrix implements GLMatrixFunc {
      * @see #getRequestMask()
      */
     public final void clearAllUpdateRequests() {
-        requestMask &= ~DIRTY_ALL;        
+        requestMask &= ~DIRTY_ALL;
     }
-    
+
     /**
      * Update the derived {@link #glGetMviMatrixf() inverse modelview (Mvi)},
-     * {@link #glGetMvitMatrixf() inverse transposed modelview (Mvit)} matrices and {@link Frustum} 
-     * <b>if</b> they are dirty <b>and</b> they were requested 
-     * by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get} 
+     * {@link #glGetMvitMatrixf() inverse transposed modelview (Mvit)} matrices and {@link Frustum}
+     * <b>if</b> they are dirty <b>and</b> they were requested
+     * by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
      * or {@link #glGetFrustum() Frustum get} methods.
      * <p>
      * The Mvi and Mvit matrices and {@link Frustum} are considered dirty, if their corresponding
@@ -999,7 +999,7 @@ public class PMVMatrix implements GLMatrixFunc {
      * <p>
      * Method should be called manually in case mutable operations has been called
      * and caller operates on already fetched references, i.e. not calling
-     * {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get} 
+     * {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
      * or {@link #glGetFrustum() Frustum get} etc anymore.
      * </p>
      * <p>
@@ -1007,12 +1007,12 @@ public class PMVMatrix implements GLMatrixFunc {
      * which are set by any mutable operation. The modified bits have no impact
      * on this method, but the return value.
      * </p>
-     * 
-     * @return true if any matrix has been modified since last update call or 
+     *
+     * @return true if any matrix has been modified since last update call or
      *         if the derived matrices Mvi and Mvit or {@link Frustum} were updated, otherwise false.
      *         In other words, method returns true if any matrix used by the caller must be updated,
      *         e.g. uniforms in a shader program.
-     * 
+     *
      * @see #getModifiedBits(boolean)
      * @see #MODIFIED_PROJECTION
      * @see #MODIFIED_MODELVIEW
@@ -1035,7 +1035,7 @@ public class PMVMatrix implements GLMatrixFunc {
         if(clearModBits) {
             modifiedBits = 0;
         }
-        
+
         if( 0 != ( dirtyBits & ( DIRTY_FRUSTUM & requestMask ) ) ) {
             if( null == frustum ) {
                 frustum = new Frustum();
@@ -1046,7 +1046,7 @@ public class PMVMatrix implements GLMatrixFunc {
             dirtyBits &= ~DIRTY_FRUSTUM;
             mod = true;
         }
-        
+
         if( 0 == ( dirtyBits & requestMask ) ) {
             return mod; // nothing more requested which may have been dirty
         }
@@ -1061,9 +1061,9 @@ public class PMVMatrix implements GLMatrixFunc {
         }
         return setMviMvitNIODirectAccess() || mod;
     }
-    
+
     //
-    // private 
+    // private
     //
     private int nioBackupArraySupported = 0; // -1 not supported, 0 - TBD, 1 - supported
     private final String msgCantComputeInverse = "Invalid source Mv matrix, can't compute inverse";
@@ -1080,7 +1080,7 @@ public class PMVMatrix implements GLMatrixFunc {
             res = true;
         }
         if( 0 != ( requestMask & ( dirtyBits & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) ) { // only if requested & dirty
-            // transpose matrix 
+            // transpose matrix
             final float[] _matrixMvit = matrixMvit.array();
             final int _matrixMvitOffset = matrixMvit.position();
             for (int i = 0; i < 4; i++) {
@@ -1093,7 +1093,7 @@ public class PMVMatrix implements GLMatrixFunc {
         }
         return res;
     }
-    
+
     private final boolean setMviMvitNIODirectAccess() {
         boolean res = false;
         if( 0 != ( dirtyBits & DIRTY_INVERSE_MODELVIEW ) ) { // only if dirt; always requested at this point, see update()
@@ -1104,7 +1104,7 @@ public class PMVMatrix implements GLMatrixFunc {
             res = true;
         }
         if( 0 != ( requestMask & ( dirtyBits & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) ) { // only if requested & dirty
-            // transpose matrix 
+            // transpose matrix
             for (int i = 0; i < 4; i++) {
                 for (int j = 0; j < 4; j++) {
                     matrixMvit.put(j+i*4, matrixMvi.get(i+j*4));
diff --git a/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
index a2b7ba343..b00866dd9 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -35,14 +35,14 @@ import javax.media.opengl.GLException;
 import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
 
 /**
- * Variation of {@link TileRenderer} w/o using fixed tiles but arbitrary rectangular regions. 
+ * Variation of {@link TileRenderer} w/o using fixed tiles but arbitrary rectangular regions.
  * <p>
  * See {@link TileRendererBase} for details.
  * </p>
  */
 public class RandomTileRenderer extends TileRendererBase {
     private boolean tileRectSet = false;
-    
+
     /**
      * Creates a new TileRenderer object
      */
@@ -72,15 +72,15 @@ public class RandomTileRenderer extends TileRendererBase {
 
     /**
      * Set the tile rectangle for the subsequent rendering calls.
-     * 
-     * @throws IllegalArgumentException is tile x/y are < 0 or tile size is <= 0x0                              
+     *
+     * @throws IllegalArgumentException is tile x/y are < 0 or tile size is <= 0x0
      */
     public void setTileRect(int tX, int tY, int tWidth, int tHeight) throws IllegalStateException, IllegalArgumentException {
         if( 0 > tX || 0 > tX ) {
-            throw new IllegalArgumentException("Tile pos must be >= 0/0");        
+            throw new IllegalArgumentException("Tile pos must be >= 0/0");
         }
         if( 0 >= tWidth || 0 >= tHeight ) {
-            throw new IllegalArgumentException("Tile size must be > 0x0");        
+            throw new IllegalArgumentException("Tile size must be > 0x0");
         }
         this.currentTileXPos = tX;
         this.currentTileYPos = tY;
@@ -88,57 +88,57 @@ public class RandomTileRenderer extends TileRendererBase {
         this.currentTileHeight = tHeight;
         tileRectSet = true;
     }
-    
+
     @Override
     public final boolean isSetup() {
         return 0 < imageSize.getWidth() && 0 < imageSize.getHeight() && tileRectSet;
     }
-    
+
     /**
      * {@inheritDoc}
-     * 
-     * <p> 
+     *
+     * <p>
      * <i>end of tiling</i> is never reached w/ {@link RandomRileRenderer},
      * i.e. method always returns false.
      * </p>
      */
     @Override
     public final boolean eot() { return false; }
-    
+
     /**
      * {@inheritDoc}
-     * 
+     *
      * Reset internal states of {@link RandomTileRenderer} are: <i>none</i>.
      */
     @Override
     public final void reset() { }
-    
+
     /**
      * {@inheritDoc}
-     * 
-     * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} has not been set or 
+     *
+     * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} has not been set or
      *         {@link #setTileRect(int, int, int, int) tile-rect} has not been set.
      */
     @Override
     public final void beginTile(GL gl) throws IllegalStateException, GLException {
         if( 0 >= imageSize.getWidth() || 0 >= imageSize.getHeight() ) {
-            throw new IllegalStateException("Image size has not been set");        
+            throw new IllegalStateException("Image size has not been set");
         }
         if( !tileRectSet ) {
             throw new IllegalStateException("tileRect has not been set");
         }
         validateGL(gl);
-        
+
         gl.glViewport( 0, 0, currentTileWidth, currentTileHeight );
-        
+
         if( DEBUG ) {
             System.err.println("TileRenderer.begin.X: "+this.toString());
         }
-                
+
         // Do not forget to issue:
         //    reshape( 0, 0, tW, tH );
         // which shall reflect tile renderer fileds: currentTileXPos, currentTileYPos and imageSize
-        
+
         beginCalled = true;
     }
 
@@ -148,7 +148,7 @@ public class RandomTileRenderer extends TileRendererBase {
             throw new IllegalStateException("beginTile(..) has not been called");
         }
         validateGL(gl);
-        
+
         // be sure OpenGL rendering is finished
         gl.glFlush();
 
@@ -220,13 +220,13 @@ public class RandomTileRenderer extends TileRendererBase {
 
         /* restore previous glPixelStore values */
         psm.restore(gl);
-        
+
         beginCalled = false;
     }
-    
+
     /**
      * Rendering one tile, by simply calling {@link GLAutoDrawable#display()}.
-     * 
+     *
      * @throws IllegalStateException if no {@link GLAutoDrawable} is {@link #attachAutoDrawable(GLAutoDrawable) attached}
      *                               or imageSize is not set
      */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java b/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
index b949f0e39..47d56bcb1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,7 +28,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -46,7 +46,7 @@ import java.nio.channels.*;
  * class; can also be used in conjunction with the {@link com.jogamp.opengl.util.gl2.TileRenderer} class.
  */
 public class TGAWriter {
-    
+
   private static final int TARGA_HEADER_SIZE = 18;
 
   private FileChannel ch;
@@ -91,7 +91,7 @@ public class TGAWriter {
     image.put(14, (byte) (height & 0xFF)); // height
     image.put(15, (byte) (height >> 8)); // height
     image.put(16, (byte) pixelSize); // pixel size
-             
+
     // go to image data position
     image.position(TARGA_HEADER_SIZE);
     // jogl needs a sliced buffer
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
index 999db77a9..7f86b14c6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,18 +20,18 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
- * 
+ *
  * ---------------------
- * 
+ *
  * Based on Brian Paul's tile rendering library, found
  * at <a href = "http://www.mesa3d.org/brianp/TR.html">http://www.mesa3d.org/brianp/TR.html</a>.
- * 
- * Copyright (C) 1997-2005 Brian Paul. 
- * Licensed under BSD-compatible terms with permission of the author. 
+ *
+ * Copyright (C) 1997-2005 Brian Paul.
+ * Licensed under BSD-compatible terms with permission of the author.
  * See LICENSE.txt for license information.
  */
 package com.jogamp.opengl.util;
@@ -60,7 +60,7 @@ import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
  * <p>
  * See {@link TileRendererBase} for details.
  * </p>
- * 
+ *
  * @author ryanm, sgothel
  */
 public class TileRenderer extends TileRendererBase {
@@ -150,7 +150,7 @@ public class TileRenderer extends TileRendererBase {
         .append("rowOrder "+rowOrder+", offset/size "+offsetX+"/"+offsetY+" "+tileSize.getWidth()+"x"+tileSize.getHeight()+" brd "+tileBorder+", ");
         return super.tileDetails(sb);
     }
-    
+
     /**
      * Creates a new TileRenderer object
      */
@@ -169,7 +169,7 @@ public class TileRenderer extends TileRendererBase {
         super.setImageSize(width, height);
         reset();
     }
-    
+
     /**
      * Clips the image-size this tile-renderer iterates through,
      * which can be retrieved via {@link #getClippedImageSize()}.
@@ -179,7 +179,7 @@ public class TileRenderer extends TileRendererBase {
      * <p>
      * Implementation {@link #reset()} internal states.
      * </p>
-     * 
+     *
      * @param width The image-clipping.width
      * @param height The image-clipping.height
      * @see #getClippedImageSize()
@@ -208,7 +208,7 @@ public class TileRenderer extends TileRendererBase {
      * {@link #TR_IMAGE_CLIPPING_HEIGHT}.
      * </p>
      */
-    public final DimensionImmutable getClippedImageSize() { 
+    public final DimensionImmutable getClippedImageSize() {
         if( null != imageClippingDim ) {
             return new Dimension(Math.min(imageClippingDim.getWidth(), imageSize.getWidth()),
                                  Math.min(imageClippingDim.getHeight(), imageSize.getHeight()) );
@@ -224,7 +224,7 @@ public class TileRenderer extends TileRendererBase {
      * <p>
      * Implementation {@link #reset()} internal states.
      * </p>
-     * 
+     *
      * @param width
      *           The width of the tiles. Must not be larger than the GL
      *           context
@@ -238,10 +238,10 @@ public class TileRenderer extends TileRendererBase {
      */
     public final void setTileSize(int width, int height, int border) {
         if( 0 > border ) {
-            throw new IllegalArgumentException("Tile border must be >= 0");        
+            throw new IllegalArgumentException("Tile border must be >= 0");
         }
         if( 2 * border >= width || 2 * border >= height ) {
-            throw new IllegalArgumentException("Tile size must be > 0x0 minus 2*border");        
+            throw new IllegalArgumentException("Tile size must be > 0x0 minus 2*border");
         }
         tileBorder = border;
         tileSize.set( width, height );
@@ -249,7 +249,7 @@ public class TileRenderer extends TileRendererBase {
         reset();
     }
 
-    /** 
+    /**
      * Sets an xy offset for the resulting tiles
      * {@link TileRendererBase#TR_CURRENT_TILE_X_POS x-pos} and {@link TileRendererBase#TR_CURRENT_TILE_Y_POS y-pos}.
      * @see #TR_TILE_X_OFFSET
@@ -259,12 +259,12 @@ public class TileRenderer extends TileRendererBase {
         offsetX = xoff;
         offsetY = yoff;
     }
-    
+
     /**
      * {@inheritDoc}
-     * 
+     *
      * Reset internal states of {@link TileRenderer} are:
-     * <ul> 
+     * <ul>
      *  <li>{@link #TR_ROWS}</li>
      *  <li>{@link #TR_COLUMNS}</li>
      *  <li>{@link #TR_CURRENT_COLUMN}</li>
@@ -291,13 +291,13 @@ public class TileRenderer extends TileRendererBase {
 
         assert columns >= 0;
         assert rows >= 0;
-        
+
         beginCalled = false;
         isInit = true;
     }
 
     /* pp */ final int getCurrentTile() { return currentTile; }
-    
+
     @Override
     public final int getParam(int pname) {
         switch (pname) {
@@ -346,7 +346,7 @@ public class TileRenderer extends TileRendererBase {
 
     /**
      * Sets the order of row traversal, default is {@link #TR_BOTTOM_TO_TOP}.
-     * 
+     *
      * @param order The row traversal order, must be either {@link #TR_TOP_TO_BOTTOM} or {@link #TR_BOTTOM_TO_TOP}.
      */
     public final void setRowOrder(int order) {
@@ -361,11 +361,11 @@ public class TileRenderer extends TileRendererBase {
     public final boolean isSetup() {
         return 0 < imageSize.getWidth() && 0 < imageSize.getHeight();
     }
-    
+
     /**
      * {@inheritDoc}
-     * 
-     * <p> 
+     *
+     * <p>
      * <i>end of tiling</i> is reached w/ {@link TileRenderer}, if at least one of the following is true:
      * <ul>
      *   <li>all tiles have been rendered, i.e. {@link #TR_CURRENT_TILE_NUM} is -1</li>
@@ -378,13 +378,13 @@ public class TileRenderer extends TileRendererBase {
         if ( !isInit ) { // ensure at least one reset-call
             reset();
         }
-        return 0 > currentTile || 0 >= columns*rows; 
+        return 0 > currentTile || 0 >= columns*rows;
     }
-    
+
     /**
      * {@inheritDoc}
-     * 
-     * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} has not been set or 
+     *
+     * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} has not been set or
      *         {@link #eot() end-of-tiling} has been reached.
      */
     @Override
@@ -396,7 +396,7 @@ public class TileRenderer extends TileRendererBase {
             throw new IllegalStateException("EOT reached: "+this);
         }
         validateGL(gl);
-        
+
         /* which tile (by row and column) we're about to render */
         if (rowOrder == TR_BOTTOM_TO_TOP) {
             currentRow = currentTile / columns;
@@ -434,11 +434,11 @@ public class TileRenderer extends TileRendererBase {
         currentTileHeight = tH;
 
         gl.glViewport( 0, 0, tW, tH );
-        
+
         if( DEBUG ) {
             System.err.println("TileRenderer.begin: "+this.toString());
         }
-        
+
         // Do not forget to issue:
         //    reshape( 0, 0, tW, tH );
         // which shall reflect tile renderer tiles: currentTileXPos, currentTileYPos and imageSize
@@ -454,7 +454,7 @@ public class TileRenderer extends TileRendererBase {
 
         // be sure OpenGL rendering is finished
         gl.glFlush();
-        
+
         // save current glPixelStore values
         psm.save(gl);
         psm.setPackAlignment(gl, 1);
@@ -467,13 +467,13 @@ public class TileRenderer extends TileRendererBase {
         } else {
             gl2es3 = null;
             readBuffer = 0; // undef. probably default: GL_FRONT (single buffering) GL_BACK (double buffering)
-        }        
+        }
         if( DEBUG ) {
             System.err.println("TileRenderer.end.0: readBuffer 0x"+Integer.toHexString(readBuffer)+", "+this.toString());
         }
-        
+
         final int tmp[] = new int[1];
-        
+
         if( tileBuffer != null ) {
             final GLPixelAttributes pixelAttribs = tileBuffer.pixelAttributes;
             final int srcX = tileBorder;
@@ -527,7 +527,7 @@ public class TileRenderer extends TileRendererBase {
         psm.restore(gl);
 
         beginCalled = false;
-        
+
         /* increment tile counter, return 1 if more tiles left to render */
         currentTile++;
         if( currentTile >= rows * columns ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
index 0553d5673..ff7cc5516 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,18 +20,18 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
- * 
+ *
  * ---------------------
- * 
+ *
  * Based on Brian Paul's tile rendering library, found
  * at <a href = "http://www.mesa3d.org/brianp/TR.html">http://www.mesa3d.org/brianp/TR.html</a>.
- * 
- * Copyright (C) 1997-2005 Brian Paul. 
- * Licensed under BSD-compatible terms with permission of the author. 
+ *
+ * Copyright (C) 1997-2005 Brian Paul.
+ * Licensed under BSD-compatible terms with permission of the author.
  * See LICENSE.txt for license information.
  */
 package com.jogamp.opengl.util;
@@ -66,17 +66,17 @@ import jogamp.opengl.Debug;
  * The PMV matrix needs to be reshaped in user code
  * after calling {@link #beginTile(GL)}, See {@link #beginTile(GL)}.
  * </p>
- * <p> 
+ * <p>
  * If {@link #attachAutoDrawable(GLAutoDrawable) attaching to} an {@link GLAutoDrawable},
  * the {@link TileRendererListener#reshapeTile(TileRendererBase, int, int, int, int, int, int)} method
  * is being called after {@link #beginTile(GL)} for each rendered tile.
- * It's implementation shall reshape the PMV matrix according to {@link #beginTile(GL)}. 
+ * It's implementation shall reshape the PMV matrix according to {@link #beginTile(GL)}.
  * </p>
  * <a name="glprequirement"><h5>GL Profile Requirement</h5></a>
  * <p>
- * Note that {@link #setImageBuffer(GLPixelBuffer) image buffer} can only be used 
+ * Note that {@link #setImageBuffer(GLPixelBuffer) image buffer} can only be used
  * in conjunction w/ a {@link GL} instance &ge; {@link GL2ES3} passed to {@link #beginTile(GL)} and {@link #endTile(GL)}.<br>
- * This is due to setting up the {@link GL2ES3#GL_PACK_ROW_LENGTH pack row length} 
+ * This is due to setting up the {@link GL2ES3#GL_PACK_ROW_LENGTH pack row length}
  * for an {@link #setImageSize(int, int) image width} != tile-width, which usually is the case.<br>
  * Hence a {@link GLException} is thrown in both methods,
  * if using an {@link #setImageBuffer(GLPixelBuffer) image buffer}
@@ -86,7 +86,7 @@ import jogamp.opengl.Debug;
  * Further more, reading back of MSAA buffers is only supported since {@link GL2ES3}
  * since it requires to set the {@link GL2ES3#glReadBuffer(int) read-buffer}.
  * </p>
- * 
+ *
  * @author ryanm, sgothel
  */
 public abstract class TileRendererBase {
@@ -114,16 +114,16 @@ public abstract class TileRendererBase {
      * The height of the current tile. See {@link #getParam(int)}.
      */
     public static final int TR_CURRENT_TILE_HEIGHT = 6;
-    
+
     /* pp */ static final boolean DEBUG = Debug.debug("TileRenderer");
-    
-    /** 
+
+    /**
      * Listener for tile renderer events, intended to extend {@link GLEventListener} implementations,
      * enabling tile rendering via {@link TileRendererBase#attachAutoDrawable(GLAutoDrawable)}.
      */
     public static interface TileRendererListener {
-        /** 
-         * The owning {@link GLAutoDrawable} is {@link TileRendererBase#attachAutoDrawable(GLAutoDrawable) attached} 
+        /**
+         * The owning {@link GLAutoDrawable} is {@link TileRendererBase#attachAutoDrawable(GLAutoDrawable) attached}
          * to the given {@link TileRendererBase} instance.
          * <p>
          * The {@link GLContext} of the {@link TileRendererBase}'s {@link TileRendererBase#getAttachedDrawable() attached} {@link GLAutoDrawable}
@@ -133,9 +133,9 @@ public abstract class TileRendererBase {
          * @see TileRendererBase#getAttachedDrawable()
          */
         public void addTileRendererNotify(TileRendererBase tr);
-        
-        /** 
-         * The owning {@link GLAutoDrawable} is {@link TileRendererBase#detachAutoDrawable() detached} 
+
+        /**
+         * The owning {@link GLAutoDrawable} is {@link TileRendererBase#detachAutoDrawable() detached}
          * from the given {@link TileRendererBase} instance.
          * <p>
          * The {@link GLContext} of the {@link TileRendererBase}'s {@link TileRendererBase#getAttachedDrawable() attached} {@link GLAutoDrawable}
@@ -145,10 +145,10 @@ public abstract class TileRendererBase {
          * @see TileRendererBase#getAttachedDrawable()
          */
         public void removeTileRendererNotify(TileRendererBase tr);
-        
-        /** 
+
+        /**
          * Called by the {@link TileRendererBase} during tile-rendering via an
-         * {@link TileRendererBase#getAttachedDrawable() attached} {@link GLAutoDrawable}'s 
+         * {@link TileRendererBase#getAttachedDrawable() attached} {@link GLAutoDrawable}'s
          * {@link GLAutoDrawable#display()} call for each tile before {@link #display(GLAutoDrawable)}.
          * <p>
          * The <a href="#pmvmatrix">PMV Matrix</a> shall be reshaped
@@ -175,14 +175,14 @@ public abstract class TileRendererBase {
          * @see TileRendererBase#getAttachedDrawable()
          */
         public void reshapeTile(TileRendererBase tr,
-                                int tileX, int tileY, int tileWidth, int tileHeight, 
+                                int tileX, int tileY, int tileWidth, int tileHeight,
                                 int imageWidth, int imageHeight);
 
         /**
-         * Called by the {@link TileRendererBase} during tile-rendering 
+         * Called by the {@link TileRendererBase} during tile-rendering
          * after {@link TileRendererBase#beginTile(GL)} and before {@link #reshapeTile(TileRendererBase, int, int, int, int, int, int) reshapeTile(..)}.
          * <p>
-         * If {@link TileRendererBase} is of type {@link TileRenderer}, 
+         * If {@link TileRendererBase} is of type {@link TileRenderer},
          * method is called for the first tile of all tiles.<br>
          * Otherwise, i.e. {@link RandomTileRenderer}, method is called for each particular tile.
          * </p>
@@ -193,12 +193,12 @@ public abstract class TileRendererBase {
          * @param tr the issuing {@link TileRendererBase}
          */
         public void startTileRendering(TileRendererBase tr);
-        
+
         /**
          * Called by the {@link TileRenderer} during tile-rendering
          * after {@link TileRendererBase#endTile(GL)} and {@link GLAutoDrawable#swapBuffers()}.
          * <p>
-         * If {@link TileRendererBase} is of type {@link TileRenderer}, 
+         * If {@link TileRendererBase} is of type {@link TileRenderer},
          * method is called for the last tile of all tiles.<br>
          * Otherwise, i.e. {@link RandomTileRenderer}, method is called for each particular tile.
          * </p>
@@ -210,7 +210,7 @@ public abstract class TileRendererBase {
          */
         public void endTileRendering(TileRendererBase tr);
     }
-    
+
     protected final Dimension imageSize = new Dimension(0, 0);
     protected final GLPixelStorageModes psm = new GLPixelStorageModes();
     protected GLPixelBuffer imageBuffer;
@@ -249,24 +249,24 @@ public abstract class TileRendererBase {
         return getClass().getSimpleName()+
                 "["+toString(sb).toString()+"]";
     }
-    
+
     protected TileRendererBase() {
     }
 
     /**
      * Gets the parameters of this TileRenderer object
-     * 
+     *
      * @param pname The parameter name that is to be retrieved
      * @return the value of the parameter
      * @throws IllegalArgumentException if <code>pname</code> is not handled
      */
     public abstract int getParam(int pname) throws IllegalArgumentException;
-    
+
     /**
      * Specify a buffer the tiles to be copied to. This is not
      * necessary for the creation of the final image, but useful if you
      * want to inspect each tile in turn.
-     * 
+     *
      * @param buffer The buffer itself. Must be large enough to contain a random tile
      */
     public final void setTileBuffer(GLPixelBuffer buffer) {
@@ -281,7 +281,7 @@ public abstract class TileRendererBase {
 
     /**
      * Sets the desired size of the final image
-     * 
+     *
      * @param width The width of the final image
      * @param height The height of the final image
      */
@@ -294,7 +294,7 @@ public abstract class TileRendererBase {
 
     /**
      * Sets the buffer in which to store the final image
-     * 
+     *
      * @param buffer the buffer itself, must be large enough to hold the final image
      */
     public final void setImageBuffer(GLPixelBuffer buffer) {
@@ -310,16 +310,16 @@ public abstract class TileRendererBase {
     /* pp */ final void validateGL(GL gl) throws GLException {
         if( imageBuffer != null && !gl.isGL2ES3()) {
             throw new GLException("Using image-buffer w/ inssufficient GL context: "+gl.getContext().getGLVersion()+", "+gl.getGLProfile());
-        }        
+        }
     }
-    
-    /** 
+
+    /**
      * Returns true if this instance is setup properly, i.e. {@link #setImageSize(int, int)} ..,
      * and ready for {@link #beginTile(GL)}.
      * Otherwise returns false.
      */
     public abstract boolean isSetup();
-    
+
     /**
      * Returns true if <i>end of tiling</i> has been reached, otherwise false.
      * <p>
@@ -331,7 +331,7 @@ public abstract class TileRendererBase {
      * </p>
      */
     public abstract boolean eot();
-    
+
     /**
      * Method resets implementation's internal state to <i>start of tiling</i>
      * as required for {@link #beginTile(GL)} if {@link #eot() end of tiling} has been reached.
@@ -340,7 +340,7 @@ public abstract class TileRendererBase {
      * </p>
      */
     public abstract void reset();
-    
+
     /**
      * Begins rendering a tile.
      * <p>
@@ -367,7 +367,7 @@ public abstract class TileRendererBase {
      * </p>
      * <p>
      * Use shall render the scene afterwards, concluded with a call to
-     * this renderer {@link #endTile(GL)}. 
+     * this renderer {@link #endTile(GL)}.
      * </p>
      * <p>
      * User has to comply with the <a href="#glprequirement">GL profile requirement</a>.
@@ -376,10 +376,10 @@ public abstract class TileRendererBase {
      * If {@link #eot() end of tiling} has been reached,
      * user needs to {@link #reset()} tiling before calling this method.
      * </p>
-     * 
+     *
      * @param gl The gl context
      * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} is undefined,
-     *         an {@link #isSetup() implementation related setup} has not be performed 
+     *         an {@link #isSetup() implementation related setup} has not be performed
      *         or {@ link #eot()} has been reached. See implementing classes.
      * @throws GLException if {@link #setImageBuffer(GLPixelBuffer) image buffer} is used but <code>gl</code> instance is &lt; {@link GL2ES3}
      * @see #isSetup()
@@ -387,7 +387,7 @@ public abstract class TileRendererBase {
      * @see #reset()
      */
     public abstract void beginTile(GL gl) throws IllegalStateException, GLException;
-    
+
     /**
      * Must be called after rendering the scene,
      * see {@link #beginTile(GL)}.
@@ -399,13 +399,13 @@ public abstract class TileRendererBase {
      * <p>
      * User has to comply with the <a href="#glprequirement">GL profile requirement</a>.
      * </p>
-     * 
+     *
      * @param gl the gl context
      * @throws IllegalStateException if beginTile(gl) has not been called
      * @throws GLException if {@link #setImageBuffer(GLPixelBuffer) image buffer} is used but <code>gl</code> instance is &lt; {@link GL2ES3}
      */
     public abstract void endTile( GL gl ) throws IllegalStateException, GLException;
-    
+
     /**
      * Determines whether the chosen {@link GLCapabilitiesImmutable}
      * requires a <i>pre-{@link GLDrawable#swapBuffers() swap-buffers}</i>
@@ -417,18 +417,18 @@ public abstract class TileRendererBase {
      * Here {@link GLDrawable#swapBuffers() swap-buffers} shall happen <b>after</b> calling {@link #endTile(GL)}, the default.
      * </p>
      * <p>
-     * However, <i>multisampling</i> offscreen {@link GLFBODrawable}s 
+     * However, <i>multisampling</i> offscreen {@link GLFBODrawable}s
      * utilize {@link GLDrawable#swapBuffers() swap-buffers} to <i>downsample</i>
      * the multisamples into the readable sampling sink.
-     * In this case, we require a {@link GLDrawable#swapBuffers() swap-buffers} <b>before</b> calling {@link #endTile(GL)}. 
-     * </p> 
-     * @param chosenCaps the chosen {@link GLCapabilitiesImmutable} 
+     * In this case, we require a {@link GLDrawable#swapBuffers() swap-buffers} <b>before</b> calling {@link #endTile(GL)}.
+     * </p>
+     * @param chosenCaps the chosen {@link GLCapabilitiesImmutable}
      * @return chosenCaps.isFBO() && chosenCaps.getSampleBuffers()
      */
     public final boolean reqPreSwapBuffers(GLCapabilitiesImmutable chosenCaps) {
         return chosenCaps.isFBO() && chosenCaps.getSampleBuffers();
     }
-    
+
     /**
      * Attaches the given {@link GLAutoDrawable} to this tile renderer.
      * <p>
@@ -440,17 +440,17 @@ public abstract class TileRendererBase {
      * <p>
      * The {@link GLAutoDrawable}'s {@link GLAutoDrawable#getAutoSwapBufferMode() auto-swap mode} is cached
      * and set to <code>false</code>, since {@link GLAutoDrawable#swapBuffers() swapBuffers()} maybe issued before {@link #endTile(GL)},
-     * see {@link #reqPreSwapBuffers(GLCapabilitiesImmutable)}.  
+     * see {@link #reqPreSwapBuffers(GLCapabilitiesImmutable)}.
      * </p>
      * <p>
-     * This tile renderer's internal {@link GLEventListener} is then added to the attached {@link GLAutoDrawable} 
+     * This tile renderer's internal {@link GLEventListener} is then added to the attached {@link GLAutoDrawable}
      * to handle the tile rendering, replacing the original {@link GLEventListener}.<br>
      * It's {@link GLEventListener#display(GLAutoDrawable) display} implementations issues:
      * <ul>
      *   <li>Optional {@link #setGLEventListener(GLEventListener, GLEventListener) pre-glel}.{@link GLEventListener#display(GLAutoDrawable) display(..)}</li>
      *   <li>{@link #beginTile(GL)}</li>
      *   <li>for all original {@link TileRendererListener}:
-     *   <ul> 
+     *   <ul>
      *     <li>{@link TileRendererListener#reshapeTile(TileRendererBase, int, int, int, int, int, int) reshapeTile(tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight)}</li>
      *     <li>{@link GLEventListener#display(GLAutoDrawable) display(autoDrawable)}</li>
      *   </ul></li>
@@ -468,7 +468,7 @@ public abstract class TileRendererBase {
      * since it's called after {@link #endTile(GL)}.
      * </p>
      * <p>
-     * Call {@link #detachAutoDrawable()} to remove the attached {@link GLAutoDrawable} from this tile renderer 
+     * Call {@link #detachAutoDrawable()} to remove the attached {@link GLAutoDrawable} from this tile renderer
      * and to restore it's original {@link GLEventListener}.
      * </p>
      * @param glad the {@link GLAutoDrawable} to attach.
@@ -481,7 +481,7 @@ public abstract class TileRendererBase {
             throw new IllegalStateException("GLAutoDrawable already attached");
         }
         this.glad = glad;
-        
+
         final int aSz = glad.getGLEventListenerCount();
         listeners = new GLEventListener[aSz];
         listenersInit = new boolean[aSz];
@@ -510,11 +510,11 @@ public abstract class TileRendererBase {
         }
     }
 
-    /** 
-     * Returns a previously {@link #attachAutoDrawable(GLAutoDrawable) attached} {@link GLAutoDrawable}, 
+    /**
+     * Returns a previously {@link #attachAutoDrawable(GLAutoDrawable) attached} {@link GLAutoDrawable},
      * <code>null</code> if none is attached.
      * <p>
-     * If called from {@link TileRendererListener#addTileRendererNotify(TileRendererBase)} 
+     * If called from {@link TileRendererListener#addTileRendererNotify(TileRendererBase)}
      * or {@link TileRendererListener#removeTileRendererNotify(TileRendererBase)}, method returns the
      * just attached or soon to be detached {@link GLAutoDrawable}.
      * </p>
@@ -522,9 +522,9 @@ public abstract class TileRendererBase {
      * @see #detachAutoDrawable()
      */
     public final GLAutoDrawable getAttachedDrawable() {
-        return glad;        
+        return glad;
     }
-    
+
     /**
      * Detaches the given {@link GLAutoDrawable} from this tile renderer.
      * @see #attachAutoDrawable(GLAutoDrawable)
@@ -547,16 +547,16 @@ public abstract class TileRendererBase {
                 System.err.println("TileRenderer: detached: "+glad);
                 System.err.println("TileRenderer: "+glad.getChosenGLCapabilities());
             }
-            
+
             listeners = null;
             listenersInit = null;
             glad = null;
         }
     }
-    
+
     /**
      * Set {@link GLEventListener} for pre- and post operations when used w/
-     * {@link #attachAutoDrawable(GLAutoDrawable)} 
+     * {@link #attachAutoDrawable(GLAutoDrawable)}
      * for each {@link GLEventListener} callback.
      * @param preTile the pre operations
      * @param postTile the post operations
@@ -565,10 +565,10 @@ public abstract class TileRendererBase {
         glEventListenerPre = preTile;
         glEventListenerPost = postTile;
     }
-    
+
     /**
      * Rendering one tile, by simply calling {@link GLAutoDrawable#display()}.
-     * 
+     *
      * @throws IllegalStateException if no {@link GLAutoDrawable} is {@link #attachAutoDrawable(GLAutoDrawable) attached}
      *                               or imageSize is not set
      */
@@ -578,10 +578,10 @@ public abstract class TileRendererBase {
         }
         glad.display();
     }
-    
+
     private final GLEventListener tiledGLEL = new GLEventListener() {
         final TileRenderer tileRenderer = TileRendererBase.this instanceof TileRenderer ? (TileRenderer) TileRendererBase.this : null;
-        
+
         @Override
         public void init(GLAutoDrawable drawable) {
             if( null != glEventListenerPre ) {
@@ -642,13 +642,13 @@ public abstract class TileRendererBase {
                     if( null == tileRenderer || 0 == tileRenderer.getCurrentTile() ) {
                         tl.startTileRendering(TileRendererBase.this);
                     }
-                    tl.reshapeTile(TileRendererBase.this, 
+                    tl.reshapeTile(TileRendererBase.this,
                                    currentTileXPos, currentTileYPos, currentTileWidth, currentTileHeight,
                                    imageSize.getWidth(), imageSize.getHeight());
                     l.display(drawable);
                 }
             }
-            
+
             if( gladRequiresPreSwap ) {
                 glad.swapBuffers();
                 endTile(gl);
@@ -662,7 +662,7 @@ public abstract class TileRendererBase {
                     if( l instanceof TileRendererListener ) {
                         ((TileRendererListener)l).endTileRendering(TileRendererBase.this);
                     }
-                }                
+                }
             }
             if( null != glEventListenerPost ) {
                 glEventListenerPost.reshape(drawable, 0, 0, currentTileWidth, currentTileHeight);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
index e2bca010c..45f5d2694 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,51 +20,51 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
 package com.jogamp.opengl.util;
 
-/** 
+/**
  * Integer time frame in milliseconds, maybe specialized for texture/video, audio, .. animated content.
  * <p>
  * Type and value range has been chosen to suit embedded CPUs
  * and characteristics of audio / video streaming and animations.
- * Milliseconds of type integer with a maximum value of {@link Integer#MAX_VALUE} 
+ * Milliseconds of type integer with a maximum value of {@link Integer#MAX_VALUE}
  * will allow tracking time up 2,147,483.647 seconds or
  * 24 days 20 hours 31 minutes and 23 seconds.
  * </p>
  * <p>
  * Milliseconds granularity is also more than enough to deal with A-V synchronization,
  * where the threshold usually lies within 22ms.
- * </p> 
+ * </p>
  * <p>
  * Milliseconds granularity for displaying video frames might seem inaccurate
  * for each single frame, i.e. 60Hz != 16ms, however, accumulated values diminish
- * this error and vertical sync is achieved by build-in V-Sync of the video drivers.  
+ * this error and vertical sync is achieved by build-in V-Sync of the video drivers.
  * </p>
  */
 public class TimeFrameI {
     /** Constant marking an invalid PTS, i.e. Integer.MIN_VALUE == 0x80000000 == {@value}. Sync w/ native code. */
     public static final int INVALID_PTS = 0x80000000;
-    
+
     /** Constant marking the end of the stream PTS, i.e. Integer.MIN_VALUE - 1 == 0x7FFFFFFF == {@value}. Sync w/ native code. */
-    public static final int END_OF_STREAM_PTS = 0x7FFFFFFF;    
+    public static final int END_OF_STREAM_PTS = 0x7FFFFFFF;
 
     protected int pts;
     protected int duration;
-    
+
     public TimeFrameI() {
         pts = INVALID_PTS;
-        duration = 0;        
+        duration = 0;
     }
     public TimeFrameI(int pts, int duration) {
         this.pts = pts;
-        this.duration = duration;        
+        this.duration = duration;
     }
-    
+
     /** Get this frame's presentation timestamp (PTS) in milliseconds. */
     public final int getPTS() { return pts; }
     /** Set this frame's presentation timestamp (PTS) in milliseconds. */
@@ -73,7 +73,7 @@ public class TimeFrameI {
     public final int getDuration() { return duration; }
     /** Set this frame's duration in milliseconds. */
     public final void setDuration(int duration) { this.duration = duration; }
-    
+
     public String toString() {
         return "TimeFrame[pts " + pts + " ms, l " + duration + " ms]";
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
index 8751fc816..dffdfae8e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -35,10 +35,10 @@ import jogamp.opengl.Debug;
 
 public interface AudioSink {
     public static final boolean DEBUG = Debug.debug("AudioSink");
-    
+
     /** Default frame duration in millisecond, i.e. 1 frame per {@value} ms. */
     public static final int DefaultFrameDuration = 32;
-        
+
     /** Initial audio queue size in milliseconds. {@value} ms, i.e. 16 frames per 32 ms. See {@link #init(AudioFormat, float, int, int, int)}.*/
     public static final int DefaultInitialQueueSize = 16 * 32; // 512 ms
     /** Audio queue grow size in milliseconds. {@value} ms, i.e. 16 frames per 32 ms. See {@link #init(AudioFormat, float, int, int, int)}.*/
@@ -47,7 +47,7 @@ public interface AudioSink {
     public static final int DefaultQueueLimitWithVideo =  96 * 32; // 3072 ms
     /** Audio queue limit w/o video in milliseconds. {@value} ms, i.e. 32 frames per 32 ms. See {@link #init(AudioFormat, float, int, int, int)}.*/
     public static final int DefaultQueueLimitAudioOnly =  32 * 32; // 1024 ms
-    
+
     /**
      * Specifies the linear audio PCM format.
      */
@@ -78,7 +78,7 @@ public interface AudioSink {
                 }
             }
         }
-        
+
         /** Sample rate in Hz (1/s). */
         public final int sampleRate;
         /** Sample size in bits. */
@@ -91,36 +91,36 @@ public interface AudioSink {
         /** Planar or packed samples. If planar, each channel has their own data buffer. If packed, channel data is interleaved in one buffer. */
         public final boolean planar;
         public final boolean littleEndian;
-        
-        
+
+
         //
         // Time <-> Bytes
         //
-        
-        /** 
-         * Returns the byte size of the given milliseconds 
+
+        /**
+         * Returns the byte size of the given milliseconds
          * according to {@link #sampleSize}, {@link #channelCount} and {@link #sampleRate}.
          * <p>
          * Time -> Byte Count
-         * </p> 
+         * </p>
          */
         public final int getDurationsByteSize(int millisecs) {
             final int bytesPerSample = sampleSize >>> 3; // /8
             return millisecs * ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );
         }
-        
-        /** 
-         * Returns the duration in milliseconds of the given byte count 
-         * according to {@link #sampleSize}, {@link #channelCount} and {@link #sampleRate}. 
+
+        /**
+         * Returns the duration in milliseconds of the given byte count
+         * according to {@link #sampleSize}, {@link #channelCount} and {@link #sampleRate}.
          * <p>
          * Byte Count -> Time
-         * </p> 
+         * </p>
          */
         public final int getBytesDuration(int byteCount) {
             final int bytesPerSample = sampleSize >>> 3; // /8
-            return byteCount / ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );        
+            return byteCount / ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );
         }
-        
+
         /**
          * Returns the duration in milliseconds of the given sample count per frame and channel
          * according to the {@link #sampleRate}, i.e.
@@ -129,13 +129,13 @@ public interface AudioSink {
          * </pre>
          * <p>
          * Sample Count -> Time
-         * </p> 
+         * </p>
          * @param sampleCount sample count per frame and channel
          */
         public final float getSamplesDuration(int sampleCount) {
             return ( 1000f * (float) sampleCount ) / (float)sampleRate;
         }
-        
+
         /**
          * Returns the rounded frame count of the given milliseconds and frame duration.
          * <pre>
@@ -147,36 +147,36 @@ public interface AudioSink {
          * </p>
          * <p>
          * Frame Time -> Frame Count
-         * </p> 
+         * </p>
          * @param millisecs time in milliseconds
          * @param frameDuration duration per frame in milliseconds.
          */
         public final int getFrameCount(int millisecs, float frameDuration) {
             return Math.max(1, (int) ( (float)millisecs / frameDuration + 0.5f ));
         }
-        
+
         /**
          * Returns the byte size of given sample count
-         * according to the {@link #sampleSize}, i.e.: 
+         * according to the {@link #sampleSize}, i.e.:
          * <pre>
          *  sampleCount * ( sampleSize / 8 )
          * </pre>
          * <p>
-         * Note: To retrieve the byte size for all channels, 
+         * Note: To retrieve the byte size for all channels,
          * you need to pre-multiply <code>sampleCount</code> with {@link #channelCount}.
          * </p>
          * <p>
          * Sample Count -> Byte Count
-         * </p> 
+         * </p>
          * @param sampleCount sample count
          */
         public final int getSamplesByteCount(int sampleCount) {
             return sampleCount * ( sampleSize >>> 3 );
         }
-        
+
         /**
          * Returns the sample count of given byte count
-         * according to the {@link #sampleSize}, i.e.: 
+         * according to the {@link #sampleSize}, i.e.:
          * <pre>
          *  ( byteCount * 8 ) / sampleSize
          * </pre>
@@ -186,24 +186,24 @@ public interface AudioSink {
          * </p>
          * <p>
          * Byte Count -> Sample Count
-         * </p> 
+         * </p>
          * @param sampleCount sample count
          */
         public final int getBytesSampleCount(int byteCount) {
             return ( byteCount << 3 ) / sampleSize;
         }
-        
-        public String toString() { 
+
+        public String toString() {
             return "AudioDataFormat[sampleRate "+sampleRate+", sampleSize "+sampleSize+", channelCount "+channelCount+
                    ", signed "+signed+", fixedP "+fixedP+", "+(planar?"planar":"packed")+", "+(littleEndian?"little":"big")+"-endian]"; }
     }
-    /** Default {@link AudioFormat}, [type PCM, sampleRate 44100, sampleSize 16, channelCount 2, signed, fixedP, !planar, littleEndian]. */    
-    public static final AudioFormat DefaultFormat = new AudioFormat(44100, 16, 2, true /* signed */, 
+    /** Default {@link AudioFormat}, [type PCM, sampleRate 44100, sampleSize 16, channelCount 2, signed, fixedP, !planar, littleEndian]. */
+    public static final AudioFormat DefaultFormat = new AudioFormat(44100, 16, 2, true /* signed */,
                                           true /* fixed point */, false /* planar */, true /* littleEndian */);
-    
+
     public static abstract class AudioFrame extends TimeFrameI {
         protected int byteSize;
-        
+
         public AudioFrame() {
             this.byteSize = 0;
         }
@@ -211,19 +211,19 @@ public interface AudioSink {
             super(pts, duration);
             this.byteSize=byteCount;
         }
-        
+
         /** Get this frame's size in bytes. */
         public final int getByteSize() { return byteSize; }
         /** Set this frame's size in bytes. */
         public final void setByteSize(int size) { this.byteSize=size; }
-        
-        public String toString() { 
+
+        public String toString() {
             return "AudioFrame[pts " + pts + " ms, l " + duration + " ms, "+byteSize + " bytes]";
         }
     }
     public static class AudioDataFrame extends AudioFrame {
         protected final ByteBuffer data;
-        
+
         public AudioDataFrame(int pts, int duration, ByteBuffer bytes, int byteCount) {
             super(pts, duration, byteCount);
             if( byteCount > bytes.remaining() ) {
@@ -231,62 +231,62 @@ public interface AudioSink {
             }
             this.data=bytes;
         }
-        
+
         /** Get this frame's data. */
         public final ByteBuffer getData() { return data; }
-        
-        public String toString() { 
+
+        public String toString() {
             return "AudioDataFrame[pts " + pts + " ms, l " + duration + " ms, "+byteSize + " bytes, " + data + "]";
         }
     }
-    
-    /** 
+
+    /**
      * Returns the <code>initialized state</code> of this instance.
      * <p>
      * The <code>initialized state</code> is affected by this instance
      * overall availability, i.e. after instantiation,
      * as well as by {@link #destroy()}.
-     * </p> 
+     * </p>
      */
     public boolean isInitialized();
 
     /** Returns the playback speed. */
     public float getPlaySpeed();
-    
-    /** 
+
+    /**
      * Sets the playback speed.
      * <p>
      * To simplify test, play speed is  <i>normalized</i>, i.e.
-     * <ul> 
-     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - rate) < 0.01f </code></li> 
+     * <ul>
+     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - rate) < 0.01f </code></li>
      * </ul>
      * </p>
-     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation. 
+     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
      */
     public boolean setPlaySpeed(float s);
-    
+
     /** Returns the volume. */
     public float getVolume();
-    
-    /** 
+
+    /**
      * Sets the volume [0f..1f].
      * <p>
      * To simplify test, volume is <i>normalized</i>, i.e.
-     * <ul> 
-     *   <li><code>0.0f</code>: if <code> Math.abs(v) < 0.01f </code></li> 
-     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - v) < 0.01f </code></li> 
+     * <ul>
+     *   <li><code>0.0f</code>: if <code> Math.abs(v) < 0.01f </code></li>
+     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - v) < 0.01f </code></li>
      * </ul>
      * </p>
-     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation. 
+     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
      */
     public boolean setVolume(float v);
-    
-    /** 
+
+    /**
      * Returns the preferred {@link AudioFormat} by this sink.
      * <p>
-     * The preferred format is guaranteed to be supported 
+     * The preferred format is guaranteed to be supported
      * and shall reflect this sinks most native format,
-     * i.e. best performance w/o data conversion. 
+     * i.e. best performance w/o data conversion.
      * </p>
      * <p>
      * Known {@link #AudioFormat} attributes considered by implementations:
@@ -295,20 +295,20 @@ public interface AudioSink {
      * </ul>
      * </p>
      * @see #initSink(AudioFormat)
-     * @see #isSupported(AudioFormat) 
+     * @see #isSupported(AudioFormat)
      */
     public AudioFormat getPreferredFormat();
-    
+
     /** Return the maximum number of supported channels. */
     public int getMaxSupportedChannels();
-    
+
     /**
      * Returns true if the given format is supported by the sink, otherwise false.
      * @see #initSink(AudioFormat)
-     * @see #getPreferredFormat() 
+     * @see #getPreferredFormat()
      */
     public boolean isSupported(AudioFormat format);
-    
+
     /**
      * Initializes the sink.
      * <p>
@@ -319,7 +319,7 @@ public interface AudioSink {
      * beforehand and try to find a suitable supported one.
      * {@link #getPreferredFormat()} and {@link #getMaxSupportedChannels()} may help.
      * </p>
-     * @param requestedFormat the requested {@link AudioFormat}. 
+     * @param requestedFormat the requested {@link AudioFormat}.
      * @param frameDuration average or fixed frame duration in milliseconds
      *                      helping a caching {@link AudioFrame} based implementation to determine the frame count in the queue.
      *                      See {@link #DefaultFrameDuration}.
@@ -328,31 +328,31 @@ public interface AudioSink {
      * @param queueLimit maximum time in milliseconds the queue can hold (and grow), see {@link #DefaultQueueLimitWithVideo} and {@link #DefaultQueueLimitAudioOnly}.
      * @return true if successful, otherwise false
      */
-    public boolean init(AudioFormat requestedFormat, float frameDuration, 
+    public boolean init(AudioFormat requestedFormat, float frameDuration,
                         int initialQueueSize, int queueGrowAmount, int queueLimit);
-    
+
     /**
      * Returns true, if {@link #play()} has been requested <i>and</i> the sink is still playing,
      * otherwise false.
      */
     public boolean isPlaying();
-    
-    /** 
+
+    /**
      * Play buffers queued via {@link #enqueueData(AudioFrame)} from current internal position.
      * If no buffers are yet queued or the queue runs empty, playback is being continued when buffers are enqueued later on.
      * @see #enqueueData(AudioFrame)
-     * @see #pause() 
+     * @see #pause()
      */
     public void play();
-    
-    /** 
+
+    /**
      * Pause playing buffers while keeping enqueued data incl. it's internal position.
      * @see #play()
      * @see #flush()
      * @see #enqueueData(AudioFrame)
      */
     public void pause();
-    
+
     /**
      * Flush all queued buffers, implies {@link #pause()}.
      * <p>
@@ -363,28 +363,28 @@ public interface AudioSink {
      * @see #enqueueData(AudioFrame)
      */
     public void flush();
-    
+
     /** Destroys this instance, i.e. closes all streams and devices allocated. */
     public void destroy();
-    
-    /** 
-     * Returns the number of allocated buffers as requested by 
+
+    /**
+     * Returns the number of allocated buffers as requested by
      * {@link #init(AudioFormat, float, int, int, int)}.
      */
     public int getFrameCount();
 
     /** @return the current enqueued frames count since {@link #init(AudioFormat, float, int, int, int)}. */
     public int getEnqueuedFrameCount();
-    
-    /** 
+
+    /**
      * Returns the current number of frames queued for playing.
      * <p>
      * {@link #init(AudioFormat, float, int, int, int)} must be called first.
      * </p>
      */
     public int getQueuedFrameCount();
-    
-    /** 
+
+    /**
      * Returns the current number of bytes queued for playing.
      * <p>
      * {@link #init(AudioFormat, float, int, int, int)} must be called first.
@@ -392,28 +392,28 @@ public interface AudioSink {
      */
     public int getQueuedByteCount();
 
-    /** 
+    /**
      * Returns the current queued frame time in milliseconds for playing.
      * <p>
      * {@link #init(AudioFormat, float, int, int, int)} must be called first.
      * </p>
      */
     public int getQueuedTime();
-    
-    /** 
+
+    /**
      * Return the current audio presentation timestamp (PTS) in milliseconds.
      */
     public int getPTS();
-    
-    /** 
+
+    /**
      * Returns the current number of frames in the sink available for writing.
      * <p>
      * {@link #init(AudioFormat, float, int, int, int)} must be called first.
      * </p>
      */
     public int getFreeFrameCount();
-    
-    /** 
+
+    /**
      * Enqueue the remaining bytes of the given {@link AudioDataFrame}'s direct ByteBuffer to this sink.
      * <p>
      * The data must comply with the chosen {@link AudioFormat} as returned by {@link #initSink(AudioFormat)}.
@@ -426,8 +426,8 @@ public interface AudioSink {
      *             to reuse specialized {@link AudioFrame} instances.
      */
     public AudioFrame enqueueData(AudioDataFrame audioDataFrame);
-    
-    /** 
+
+    /**
      * Enqueue <code>byteCount</code> bytes of the remaining bytes of the given NIO {@link ByteBuffer} to this sink.
      * <p>
      * The data must comply with the chosen {@link AudioFormat} as returned by {@link #initSink(AudioFormat)}.
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
index a6a14f7dd..2cfd40df7 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -58,7 +58,7 @@ public class AudioSinkFactory {
                 if( audioSink.isInitialized() ) {
                     return audioSink;
                 }
-            } catch (Throwable t) { 
+            } catch (Throwable t) {
                 if(AudioSink.DEBUG) { System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); }
             }
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 74036a3f7..db6f5fdee 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -49,9 +49,9 @@ import com.jogamp.opengl.util.TimeFrameI;
  * using the appropriate <a href="#streamIDs">stream id</a>'s.
  * </p>
  * <p>
- * Camera input can be selected using the {@link #CameraInputScheme} URI. 
+ * Camera input can be selected using the {@link #CameraInputScheme} URI.
  * </p>
- *   
+ *
  * <a name="streamworker"><h5><i>StreamWorker</i> Decoding Thread</h5></a>
  * <p>
  * Most of the stream processing is performed on the decoding thread, a.k.a. <i>StreamWorker</i>:
@@ -61,7 +61,7 @@ import com.jogamp.opengl.util.TimeFrameI;
  *   <li>Caught <a href="#streamerror">exceptions on the decoding thread</a> are delivered as {@link StreamException}s.</li>
  * </ul>
  * <i>StreamWorker</i> generates it's own {@link GLContext}, shared with the one passed to {@link #initGL(GL)}.
- * The shared {@link GLContext} allows the decoding thread to push the video frame data directly into 
+ * The shared {@link GLContext} allows the decoding thread to push the video frame data directly into
  * the designated {@link TextureFrame}, later returned via {@link #getNextTexture(GL)} and used by the user.
  * </p>
  * <a name="streamerror"><h7><i>StreamWorker</i> Error Handling</h7></a>
@@ -71,12 +71,12 @@ import com.jogamp.opengl.util.TimeFrameI;
  * </p>
  * <p>
  * An occurring {@link StreamException} triggers a {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} event,
- * which can be listened to via {@link GLMediaEventListener#attributesChanged(GLMediaPlayer, int, long)}. 
+ * which can be listened to via {@link GLMediaEventListener#attributesChanged(GLMediaPlayer, int, long)}.
  * </p>
  * <p>
- * An occurred {@link StreamException} can be read via {@link #getStreamException()}. 
+ * An occurred {@link StreamException} can be read via {@link #getStreamException()}.
  * </p>
- * 
+ *
  * </p>
  * <a name="lifecycle"><h5>GLMediaPlayer Lifecycle</h5></a>
  * <p>
@@ -94,7 +94,7 @@ import com.jogamp.opengl.util.TimeFrameI;
  *   <tr><td>{@link #destroy(GL)}</td>                                 <td>ANY</td>                                                         <td>{@link State#Uninitialized Uninitialized}</td>                                                                                 <td>{@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT}</td></tr>
  * </table>
  * </p>
- * 
+ *
  * <a name="streamIDs"><h5>Audio and video Stream IDs</h5></a>
  * <p>
  * <table border="1">
@@ -110,7 +110,7 @@ import com.jogamp.opengl.util.TimeFrameI;
  *   <li>{@link jogamp.opengl.util.av.NullGLMediaPlayer}</li>
  *   <li>{@link jogamp.opengl.util.av.impl.OMXGLMediaPlayer}</li>
  *   <li>{@link jogamp.opengl.util.av.impl.FFMPEGMediaPlayer}</li>
- *   <li>{@link jogamp.opengl.android.av.AndroidGLMediaPlayerAPI14}</li> 
+ *   <li>{@link jogamp.opengl.android.av.AndroidGLMediaPlayerAPI14}</li>
  * </ul>
  * </p>
  * <p>
@@ -127,7 +127,7 @@ import com.jogamp.opengl.util.TimeFrameI;
  * Timestamp type and value range has been chosen to suit embedded CPUs
  * and characteristics of audio and video streaming. See {@link TimeFrameI}.
  * </p>
- * 
+ *
  * <a name="synchronization"><h5>Audio and video synchronization</h5></a>
  * <p>
  * The class follows a passive A/V synchronization pattern.
@@ -158,7 +158,7 @@ import com.jogamp.opengl.util.TimeFrameI;
  *   <li>Film:       +22ms and -22ms. audio ahead video / audio after video.</li>
  * </ul>
  * </p>
- * 
+ *
  * <a name="teststreams"><h5>Test Streams</h5></a>
  * <p>
  * <table border="1">
@@ -185,16 +185,16 @@ import com.jogamp.opengl.util.TimeFrameI;
 public interface GLMediaPlayer extends TextureSequence {
     public static final boolean DEBUG = Debug.debug("GLMediaPlayer");
     public static final boolean DEBUG_NATIVE = Debug.debug("GLMediaPlayer.Native");
-    
+
     /** Minimum texture count, value {@value}. */
     public static final int TEXTURE_COUNT_MIN = 4;
-    
+
     /** Constant {@value} for <i>mute</i> or <i>not available</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
     public static final int STREAM_ID_NONE = -2;
     /** Constant {@value} for <i>auto</i> or <i>unspecified</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
     public static final int STREAM_ID_AUTO = -1;
-    
-    /** 
+
+    /**
      * {@link URI#getScheme() URI scheme} name {@value} for camera input. E.g. <code>camera:/0</code>
      * for the 1st camera device.
      * <p>
@@ -203,7 +203,7 @@ public interface GLMediaPlayer extends TextureSequence {
      * </p>
      * <p>
      * The <i>ID</i> is usually an integer value indexing the camera
-     * ranging from [0..<i>max-number</i>]. 
+     * ranging from [0..<i>max-number</i>].
      * </p>
      * <p>
      * The {@link URI#getRawQuery() URI query} is used to pass options to the camera
@@ -220,7 +220,7 @@ public interface GLMediaPlayer extends TextureSequence {
      *  w/ authority: [user-info@]host[:port]
      *  Note: 'path' starts w/ fwd slash
      * </pre>
-     * </p> 
+     * </p>
      */
     public static final String CameraInputScheme = "camera";
     /** Camera property {@value}, size as string, e.g. <code>1280x720</code>, <code>hd720</code>. May not be supported on all platforms. See {@link #CameraInputScheme}. */
@@ -231,10 +231,10 @@ public interface GLMediaPlayer extends TextureSequence {
     public static final String CameraPropHeight = "height";
     /** Camera property {@value}. See {@link #CameraInputScheme}. */
     public static final String CameraPropRate = "rate";
-    
+
     /** Maximum video frame async of {@value} milliseconds. */
     public static final int MAXIMUM_VIDEO_ASYNC = 22;
-        
+
     /**
      * A StreamException encapsulates a caught exception in the decoder thread, a.k.a <i>StreamWorker</i>,
      * see See <a href="#streamerror"><i>StreamWorker</i> Error Handling</a>.
@@ -248,15 +248,15 @@ public interface GLMediaPlayer extends TextureSequence {
             super(message, cause);
         }
     }
-    
+
     /**
      * {@inheritDoc}
      * <p>
      * See {@link TexSeqEventListener} for semantics and usage.
      * </p>
-     */    
+     */
     public interface GLMediaEventListener extends TexSeqEventListener<GLMediaPlayer> {
-    
+
         /** State changed to {@link State#Initialized}. See <a href="#lifecycle">Lifecycle</a>.*/
         static final int EVENT_CHANGE_INIT   = 1<<0;
         /** State changed to {@link State#Uninitialized}. See <a href="#lifecycle">Lifecycle</a>.*/
@@ -269,7 +269,7 @@ public interface GLMediaPlayer extends TextureSequence {
         static final int EVENT_CHANGE_EOS    = 1<<4;
         /** An error occurred, e.g. during off-thread initialization. See {@link StreamException} and <a href="#lifecycle">Lifecycle</a>. */
         static final int EVENT_CHANGE_ERR    = 1<<5;
-        
+
         /** Stream video id change. */
         static final int EVENT_CHANGE_VID    = 1<<16;
         /** Stream audio id change. */
@@ -284,55 +284,55 @@ public interface GLMediaPlayer extends TextureSequence {
         static final int EVENT_CHANGE_LENGTH = 1<<21;
         /** Stream codec change. */
         static final int EVENT_CHANGE_CODEC  = 1<<22;
-    
+
         /**
-         * @param mp the event source 
+         * @param mp the event source
          * @param event_mask the changes attributes
-         * @param when system time in msec. 
+         * @param when system time in msec.
          */
-        public void attributesChanged(GLMediaPlayer mp, int event_mask, long when);    
+        public void attributesChanged(GLMediaPlayer mp, int event_mask, long when);
     }
-    
+
     /**
      * See <a href="#lifecycle">Lifecycle</a>.
      */
     public enum State {
         /** Uninitialized player, no resources shall be hold. */
         Uninitialized(0),
-        /** Stream has been initialized, user may play or call {@link #initGL(GL)}. */ 
-        Initialized(1), 
+        /** Stream has been initialized, user may play or call {@link #initGL(GL)}. */
+        Initialized(1),
         /** Stream is playing. */
         Playing(2),
         /** Stream is pausing. */
         Paused(3);
-        
+
         public final int id;
 
         State(int id){
             this.id = id;
         }
     }
-    
+
     public int getTextureCount();
-    
+
     /** Returns the texture target used by implementation. */
     public int getTextureTarget();
 
     /** Sets the texture unit. Defaults to 0. */
     public void setTextureUnit(int u);
-    
+
     /** Sets the texture min-mag filter, defaults to {@link GL#GL_NEAREST}. */
     public void setTextureMinMagFilter(int[] minMagFilter);
     /** Sets the texture min-mag filter, defaults to {@link GL#GL_CLAMP_TO_EDGE}. */
     public void setTextureWrapST(int[] wrapST);
-    
-    /** 
+
+    /**
      * Issues asynchronous stream initialization.
      * <p>
      * <a href="#lifecycle">Lifecycle</a>: {@link State#Uninitialized} -> {@link State#Initialized}<sup><a href="#streamworker">1</a></sup> or {@link State#Uninitialized}
      * </p>
      * <p>
-     * {@link State#Initialized} is reached asynchronous, 
+     * {@link State#Initialized} is reached asynchronous,
      * i.e. user gets notified via {@link GLMediaEventListener#attributesChanged(GLMediaPlayer, int, long) attributesChanges(..)}.
      * </p>
      * <p>
@@ -344,7 +344,7 @@ public interface GLMediaPlayer extends TextureSequence {
      * </p>
      * <p>
      * Muted video can be achieved by passing {@link #STREAM_ID_NONE} to <code>vid</code>,
-     * in which case <code>textureCount</code> is ignored as well as the passed GL object of the subsequent {@link #initGL(GL)} call. 
+     * in which case <code>textureCount</code> is ignored as well as the passed GL object of the subsequent {@link #initGL(GL)} call.
      * </p>
      * @param streamLoc the stream location
      * @param vid video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>
@@ -352,41 +352,41 @@ public interface GLMediaPlayer extends TextureSequence {
      * @param textureCount desired number of buffered textures to be decoded off-thread, will be validated by implementation.
      *        The minimum value is {@link #TEXTURE_COUNT_MIN}.
      *        Ignored if video is muted.
-     * @throws IllegalStateException if not invoked in {@link State#Uninitialized} 
+     * @throws IllegalStateException if not invoked in {@link State#Uninitialized}
      * @throws IllegalArgumentException if arguments are invalid
      */
     public void initStream(URI streamLoc, int vid, int aid, int textureCount) throws IllegalStateException, IllegalArgumentException;
-    
+
     /**
      * Returns the {@link StreamException} caught in the decoder thread, or <code>null</code>.
      * @see GLMediaEventListener#EVENT_CHANGE_ERR
      * @see StreamException
      */
     public StreamException getStreamException();
-    
-    /** 
+
+    /**
      * Initializes OpenGL related resources.
      * <p>
      * <a href="#lifecycle">Lifecycle</a>: {@link State#Initialized} -> {@link State#Paused} or {@link State#Initialized}
      * </p>
      * Argument <code>gl</code> is ignored if video is muted, see {@link #initStream(URI, int, int, int)}.
-     * 
+     *
      * @param gl current GL object. Maybe <code>null</code>, for audio only.
-     * @throws IllegalStateException if not invoked in {@link State#Initialized}. 
+     * @throws IllegalStateException if not invoked in {@link State#Initialized}.
      * @throws StreamException forwarded from the off-thread stream initialization
      * @throws GLException in case of difficulties to initialize the GL resources
      */
     public void initGL(GL gl) throws IllegalStateException, StreamException, GLException;
-    
-    /** 
+
+    /**
      * If implementation uses a {@link AudioSink}, it's instance will be returned.
-     * <p> 
-     * The {@link AudioSink} instance is available after {@link #initStream(URI, int, int, int)}, 
+     * <p>
+     * The {@link AudioSink} instance is available after {@link #initStream(URI, int, int, int)},
      * if used by implementation.
-     * </p> 
+     * </p>
      */
     public AudioSink getAudioSink();
-    
+
     /**
      * Releases the GL and stream resources.
      * <p>
@@ -399,11 +399,11 @@ public interface GLMediaPlayer extends TextureSequence {
      * Sets the playback speed.
      * <p>
      * To simplify test, play speed is  <i>normalized</i>, i.e.
-     * <ul> 
-     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - rate) < 0.01f </code></li> 
+     * <ul>
+     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - rate) < 0.01f </code></li>
      * </ul>
      * </p>
-     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation. 
+     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
      */
     public boolean setPlaySpeed(float rate);
 
@@ -414,18 +414,18 @@ public interface GLMediaPlayer extends TextureSequence {
      * Sets the audio volume, [0f..1f].
      * <p>
      * To simplify test, volume is <i>normalized</i>, i.e.
-     * <ul> 
-     *   <li><code>0.0f</code>: if <code> Math.abs(v) < 0.01f </code></li> 
-     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - v) < 0.01f </code></li> 
+     * <ul>
+     *   <li><code>0.0f</code>: if <code> Math.abs(v) < 0.01f </code></li>
+     *   <li><code>1.0f</code>: if <code> Math.abs(1.0f - v) < 0.01f </code></li>
      * </ul>
      * </p>
-     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation. 
+     * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
      */
     public boolean setAudioVolume(float v);
-    
+
     /** Returns the audio volume. */
     public float getAudioVolume();
-    
+
     /**
      * Starts or resumes the <i>StreamWorker</i> decoding thread.
      * <p>
@@ -441,9 +441,9 @@ public interface GLMediaPlayer extends TextureSequence {
      * </p>
      * <p>
      * If a <i>new</i> frame is desired after the next {@link #play()} call,
-     * e.g. to make a snapshot of a camera input stream, 
+     * e.g. to make a snapshot of a camera input stream,
      * <code>flush</code> shall be set to <code>true</code>.
-     * </p> 
+     * </p>
      * @param flush if <code>true</code> flushes the video and audio buffers, otherwise keep them intact.
      */
     public State pause(boolean flush);
@@ -454,10 +454,10 @@ public interface GLMediaPlayer extends TextureSequence {
      * <p>
      * Allowed in state {@link State#Playing} and {@link State#Paused}, otherwise ignored,
      * see <a href="#lifecycle">Lifecycle</a>.
-     * </p> 
-     * 
-     * @param msec absolute desired time position in milliseconds 
-     * @return time current position in milliseconds, after seeking to the desired position  
+     * </p>
+     *
+     * @param msec absolute desired time position in milliseconds
+     * @return time current position in milliseconds, after seeking to the desired position
      **/
     public int seek(int msec);
 
@@ -466,39 +466,39 @@ public interface GLMediaPlayer extends TextureSequence {
      * @return the current state, either {@link State#Uninitialized}, {@link State#Initialized}, {@link State#Playing} or {@link State#Paused}
      */
     public State getState();
-    
+
     /**
      * Return the video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>.
      */
     public int getVID();
-    
+
     /**
      * Return the audio stream id, see <a href="#streamIDs">audio and video Stream IDs</a>.
      */
     public int getAID();
-    
+
     /**
-     * @return the current decoded frame count since {@link #play()} and {@link #seek(int)} 
+     * @return the current decoded frame count since {@link #play()} and {@link #seek(int)}
      *         as increased by {@link #getNextTexture(GL)} or the decoding thread.
      */
     public int getDecodedFrameCount();
-    
+
     /**
-     * @return the current presented frame count since {@link #play()} and {@link #seek(int)} 
+     * @return the current presented frame count since {@link #play()} and {@link #seek(int)}
      *         as increased by {@link #getNextTexture(GL)} for new frames.
      */
     public int getPresentedFrameCount();
-    
+
     /**
-     * @return current video presentation timestamp (PTS) in milliseconds of {@link #getLastTexture()} 
+     * @return current video presentation timestamp (PTS) in milliseconds of {@link #getLastTexture()}
      **/
     public int getVideoPTS();
-    
+
     /**
-     * @return current audio presentation timestamp (PTS) in milliseconds. 
+     * @return current audio presentation timestamp (PTS) in milliseconds.
      **/
     public int getAudioPTS();
-    
+
     /**
      * {@inheritDoc}
      * <p>
@@ -511,7 +511,7 @@ public interface GLMediaPlayer extends TextureSequence {
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * <p>
      * In case the current state is not {@link State#Playing}, {@link #getLastTexture()} is returned.
      * </p>
@@ -519,25 +519,25 @@ public interface GLMediaPlayer extends TextureSequence {
      * See <a href="#synchronization">audio and video synchronization</a>.
      * </p>
      * @throws IllegalStateException if not invoked in {@link State#Paused} or {@link State#Playing}
-     * 
+     *
      * @see #addEventListener(GLMediaEventListener)
      * @see GLMediaEventListener#newFrameAvailable(GLMediaPlayer, TextureFrame, long)
      */
     @Override
     public TextureSequence.TextureFrame getNextTexture(GL gl) throws IllegalStateException;
-    
+
     /** Return the stream location, as set by {@link #initStream(URI, int, int, int)}. */
     public URI getURI();
 
     /**
      * <i>Warning:</i> Optional information, may not be supported by implementation.
-     * @return the code of the video stream, if available 
+     * @return the code of the video stream, if available
      */
     public String getVideoCodec();
 
     /**
      * <i>Warning:</i> Optional information, may not be supported by implementation.
-     * @return the code of the audio stream, if available 
+     * @return the code of the audio stream, if available
      */
     public String getAudioCodec();
 
@@ -557,25 +557,25 @@ public interface GLMediaPlayer extends TextureSequence {
      * @return total duration of stream in msec.
      */
     public int getDuration();
-    
+
     /**
      * <i>Warning:</i> Optional information, may not be supported by implementation.
-     * @return the overall bitrate of the stream.  
+     * @return the overall bitrate of the stream.
      */
     public long getStreamBitrate();
 
     /**
      * <i>Warning:</i> Optional information, may not be supported by implementation.
-     * @return video bitrate  
+     * @return video bitrate
      */
     public int getVideoBitrate();
-    
+
     /**
      * <i>Warning:</i> Optional information, may not be supported by implementation.
-     * @return the audio bitrate  
+     * @return the audio bitrate
      */
     public int getAudioBitrate();
-    
+
     /**
      * <i>Warning:</i> Optional information, may not be supported by implementation.
      * @return the framerate of the video
@@ -583,10 +583,10 @@ public interface GLMediaPlayer extends TextureSequence {
     public float getFramerate();
 
     /**
-     * Returns <code>true</code> if the video frame is oriented in 
+     * Returns <code>true</code> if the video frame is oriented in
      * OpenGL's coordinate system, <i>origin at bottom left</i>.
      * <p>
-     * Otherwise returns <code>false</code>, i.e. 
+     * Otherwise returns <code>false</code>, i.e.
      * video frame is oriented <i>origin at top left</i>.
      * </p>
      * <p>
@@ -594,14 +594,14 @@ public interface GLMediaPlayer extends TextureSequence {
      * but user shall not rely on.
      * </p>
      * <p>
-     * <code>false</code> GL orientation leads to 
+     * <code>false</code> GL orientation leads to
      * {@link Texture#getMustFlipVertically()} == <code>true</code>,
      * as reflected by all {@link TextureFrame}'s {@link Texture}s
-     * retrieved via {@link #getLastTexture()} or {@link #getNextTexture(GL)}. 
+     * retrieved via {@link #getLastTexture()} or {@link #getNextTexture(GL)}.
      * </p>
      */
     public boolean isGLOriented();
-    
+
     /** Returns the width of the video. */
     public int getWidth();
 
@@ -613,7 +613,7 @@ public interface GLMediaPlayer extends TextureSequence {
 
     /** Returns a string represantation of this player's performance values. */
     public String getPerfString();
-    
+
     /** Adds a {@link GLMediaEventListener} to this player. */
     public void addEventListener(GLMediaEventListener l);
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
index c7e1ab5e6..248e265f5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -36,7 +36,7 @@ public class GLMediaPlayerFactory {
     private static final String FFMPEGMediaPlayerClazzName = "jogamp.opengl.util.av.impl.FFMPEGMediaPlayer";
     private static final String OMXGLMediaPlayerClazzName = "jogamp.opengl.util.av.impl.OMXGLMediaPlayer";
     private static final String isAvailableMethodName = "isAvailable";
-    
+
     public static GLMediaPlayer createDefault() {
         final ClassLoader cl = GLMediaPlayerFactory.class.getClassLoader();
         GLMediaPlayer sink = create(cl, OMXGLMediaPlayerClazzName);
@@ -54,7 +54,7 @@ public class GLMediaPlayerFactory {
     public static GLMediaPlayer createNull() {
         return new NullGLMediaPlayer();
     }
-    
+
     public static GLMediaPlayer create(final ClassLoader cl, String implName) {
         try {
             if(((Boolean)ReflectionUtil.callStaticMethod(implName, isAvailableMethodName, null, null, cl)).booleanValue()) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
index 9d2ef6572..fb2bdbbcb 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -41,22 +41,22 @@ import javax.media.opengl.GL;
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.opengl.util.GLPixelBuffer;
 
-/** 
- * AWT {@link GLPixelBuffer} backed by an {@link BufferedImage} of type 
+/**
+ * AWT {@link GLPixelBuffer} backed by an {@link BufferedImage} of type
  * {@link BufferedImage#TYPE_INT_ARGB} or {@link BufferedImage#TYPE_INT_RGB}.
  * <p>
  * Implementation uses an array backed  {@link IntBuffer}.
  * </p>
  * <p>
- * {@link AWTGLPixelBuffer} can be produced via {@link AWTGLPixelBufferProvider}'s 
- * {@link AWTGLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocate(..)}. 
+ * {@link AWTGLPixelBuffer} can be produced via {@link AWTGLPixelBufferProvider}'s
+ * {@link AWTGLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocate(..)}.
  * </p>
  * <p>
  * See {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int)} for {@link #allowRowStride} details.
  * </p>
  * <p>
  * If using <code>allowRowStride == true</code>, user may needs to get the {@link #getAlignedImage(int, int) aligned image}
- * since {@link #requiresNewBuffer(GL, int, int, int)} will allow different width in this case.  
+ * since {@link #requiresNewBuffer(GL, int, int, int)} will allow different width in this case.
  * </p>
  */
 public class AWTGLPixelBuffer extends GLPixelBuffer {
@@ -65,9 +65,9 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
 
     /** The underlying {@link BufferedImage}. */
     public final BufferedImage image;
-    
+
     /**
-     * 
+     *
      * @param pixelAttributes the desired {@link GLPixelAttributes}
      * @param width in pixels
      * @param height in pixels
@@ -76,26 +76,26 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
      * @param image the AWT image
      * @param buffer the backing array
      * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. See {@link #requiresNewBuffer(GL, int, int, int)}.
-     *                       If <code>true</code>, user shall decide whether to use a {@link #getAlignedImage(int, int) width-aligned image}. 
+     *                       If <code>true</code>, user shall decide whether to use a {@link #getAlignedImage(int, int) width-aligned image}.
      */
-    public AWTGLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, BufferedImage image, 
+    public AWTGLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, BufferedImage image,
                             Buffer buffer, boolean allowRowStride) {
         super(pixelAttributes, width, height, depth, pack, buffer, allowRowStride);
         this.image = image;
     }
-    
+
     @Override
     public void dispose() {
         image.flush();
         super.dispose();
     }
-    
+
     /**
      * Returns a width- and height-aligned image representation sharing data w/ {@link #image}.
      * @param width
      * @param height
      * @return
-     * @throws IllegalArgumentException if requested size exceeds image size 
+     * @throws IllegalArgumentException if requested size exceeds image size
      */
     public BufferedImage getAlignedImage(int width, int height) throws IllegalArgumentException {
         if( width * height > image.getWidth() * image.getHeight() ) {
@@ -111,12 +111,12 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
         final WritableRaster raster = image.getRaster();
         final DataBuffer dataBuffer = raster.getDataBuffer();
         final SinglePixelPackedSampleModel sppsm0 = (SinglePixelPackedSampleModel) raster.getSampleModel();
-        final SinglePixelPackedSampleModel sppsm1 = new SinglePixelPackedSampleModel(dataBuffer.getDataType(), 
+        final SinglePixelPackedSampleModel sppsm1 = new SinglePixelPackedSampleModel(dataBuffer.getDataType(),
                     width, height, width /* scanLineStride */, sppsm0.getBitMasks());
         final WritableRaster raster1 = WritableRaster.createWritableRaster(sppsm1, dataBuffer, null);
         return new BufferedImage (cm, raster1, cm.isAlphaPremultiplied(), null);
     }
-    
+
     public StringBuilder toString(StringBuilder sb) {
         sb = super.toString(sb);
         sb.append(", allowRowStride ").append(allowRowStride).append(", image [").append(image.getWidth()).append("x").append(image.getHeight()).append(", ").append(image.toString()).append("]");
@@ -125,29 +125,29 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
     public String toString() {
         return "AWTGLPixelBuffer["+toString(null).toString()+"]";
     }
-    
+
     /**
      * Provider for {@link AWTGLPixelBuffer} instances.
      */
     public static class AWTGLPixelBufferProvider implements GLPixelBufferProvider {
         private final boolean allowRowStride;
-        
+
         /**
-         * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. 
+         * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not.
          * See {@link #getAllowRowStride()} and {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
-         * If <code>true</code>, user shall decide whether to use a {@link AWTGLPixelBuffer#getAlignedImage(int, int) width-aligned image}. 
+         * If <code>true</code>, user shall decide whether to use a {@link AWTGLPixelBuffer#getAlignedImage(int, int) width-aligned image}.
          */
         public AWTGLPixelBufferProvider(boolean allowRowStride) {
-            this.allowRowStride = allowRowStride; 
+            this.allowRowStride = allowRowStride;
         }
         @Override
         public boolean getAllowRowStride() { return allowRowStride; }
-        
+
         @Override
         public GLPixelAttributes getAttributes(GL gl, int componentCount) {
             return 4 == componentCount ? awtPixelAttributesIntRGBA4 : awtPixelAttributesIntRGB3;
         }
-            
+
         /**
          * {@inheritDoc}
          * <p>
@@ -162,28 +162,28 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
             return new AWTGLPixelBuffer(pixelAttributes, width, height, depth, pack, image, ibuffer, allowRowStride);
         }
     }
-    
+
     /**
      * Provider for singleton {@link AWTGLPixelBuffer} instances.
      * <p>
      * Provider instance holds the last {@link AWTGLPixelBuffer} instance
      * {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated}.
-     * A new {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocation} 
+     * A new {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocation}
      * will return same instance, if a new buffer is not {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int) required}.
-     * The latter is true if size are compatible, hence <code>allowRowStride</code> should be enabled, if possible. 
+     * The latter is true if size are compatible, hence <code>allowRowStride</code> should be enabled, if possible.
      * </p>
-     */    
+     */
     public static class SingleAWTGLPixelBufferProvider extends AWTGLPixelBufferProvider implements SingletonGLPixelBufferProvider {
         private AWTGLPixelBuffer singleRGBA4 = null;
         private AWTGLPixelBuffer singleRGB3 = null;
-        
+
         /**
          * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. See {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
          */
         public SingleAWTGLPixelBufferProvider(boolean allowRowStride) {
             super(allowRowStride);
         }
-        
+
         /**
          * {@inheritDoc}
          * <p>
@@ -194,7 +194,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
         public AWTGLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
             if( 4 == pixelAttributes.componentCount ) {
                 if( null == singleRGBA4 || singleRGBA4.requiresNewBuffer(gl, width, height, minByteSize) ) {
-                    singleRGBA4 = allocateImpl(pixelAttributes, width, height, depth, pack, minByteSize); 
+                    singleRGBA4 = allocateImpl(pixelAttributes, width, height, depth, pack, minByteSize);
                 }
                 return singleRGBA4;
             } else {
@@ -204,33 +204,33 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
                 return singleRGB3;
             }
         }
-        
+
         private AWTGLPixelBuffer allocateImpl(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
             final BufferedImage image = new BufferedImage(width, height, 4 == pixelAttributes.componentCount ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB);
             final int[] readBackIntBuffer = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
             final Buffer ibuffer = IntBuffer.wrap( readBackIntBuffer );
             return new AWTGLPixelBuffer(pixelAttributes, width, height, depth, pack, image, ibuffer, getAllowRowStride());
         }
-        
-        /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link AWTGLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */ 
+
+        /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link AWTGLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */
         public AWTGLPixelBuffer getSingleBuffer(GLPixelAttributes pixelAttributes) {
             return 4 == pixelAttributes.componentCount ? singleRGBA4 : singleRGB3;
         }
-        
-        /** 
+
+        /**
          * Initializes the single {@link AWTGLPixelBuffer} w/ a given size, if not yet {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated}.
          * @return the newly initialized single {@link AWTGLPixelBuffer}, or null if already allocated.
          */
         public AWTGLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack) {
             if( 4 == componentCount ) {
                 if( null != singleRGBA4 ) {
-                    return null; 
+                    return null;
                 }
                 singleRGBA4 = allocateImpl(AWTGLPixelBuffer.awtPixelAttributesIntRGBA4, width, height, depth, pack, 0);
                 return singleRGBA4;
             } else {
                 if( null != singleRGB3 ) {
-                    return null; 
+                    return null;
                 }
                 singleRGB3 = allocateImpl(AWTGLPixelBuffer.awtPixelAttributesIntRGB3, width, height, depth, pack, 0);
                 return singleRGB3;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
index e85f04092..f5d31a132 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -42,7 +42,7 @@ import com.jogamp.opengl.util.GLReadBufferUtil;
 public class AWTGLReadBufferUtil extends GLReadBufferUtil {
     /**
      * {@inheritDoc}
-     * 
+     *
      * @param alpha
      */
     public AWTGLReadBufferUtil(GLProfile glp, boolean alpha) {
@@ -50,7 +50,7 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil {
     }
 
     public AWTGLPixelBuffer getAWTGLPixelBuffer() { return (AWTGLPixelBuffer)this.getPixelBuffer(); }
-    
+
     public BufferedImage readPixelsToBufferedImage(GL gl, boolean awtOrientation) {
         return readPixelsToBufferedImage(gl, 0, 0, 0, 0, awtOrientation);
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
index a3139b16a..df3cc4a39 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -54,7 +54,7 @@ public class ImageUtil {
     WritableRaster raster = image.getRaster();
     Object scanline1 = null;
     Object scanline2 = null;
-      
+
     for (int i = 0; i < image.getHeight() / 2; i++) {
       scanline1 = raster.getDataElements(0, i, image.getWidth(), 1, scanline1);
       scanline2 = raster.getDataElements(0, image.getHeight() - i - 1, image.getWidth(), 1, scanline2);
@@ -97,21 +97,21 @@ public class ImageUtil {
     if (thumbWidth > image.getWidth()) {
       throw new IllegalArgumentException("Thumbnail width must be greater than image width");
     }
-   
+
     if (thumbWidth == image.getWidth()) {
       return image;
     }
- 
+
     float ratio = (float) image.getWidth() / (float) image.getHeight();
     int width = image.getWidth();
     BufferedImage thumb = image;
-   
+
     do {
       width /= 2;
       if (width < thumbWidth) {
         width = thumbWidth;
       }
-     
+
       BufferedImage temp = createCompatibleImage(width, (int) (width / ratio));
       Graphics2D g2 = temp.createGraphics();
       g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
@@ -120,7 +120,7 @@ public class ImageUtil {
       g2.dispose();
       thumb = temp;
     } while (width != thumbWidth);
-   
+
     return thumb;
   }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
index 73d694cd9..931f59869 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
index 2ffc27260..f686b672a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2013 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -56,18 +56,18 @@ import com.jogamp.opengl.GLExtensions;
 import com.jogamp.opengl.util.GLPixelStorageModes;
 import com.jogamp.opengl.util.TGAWriter;
 
-/** 
+/**
  * Utilities for taking screenshots of OpenGL applications.
- * @deprecated Please consider using {@link com.jogamp.opengl.util.GLReadBufferUtil}, 
- *             which is AWT independent and does not require a CPU based vertical image flip 
+ * @deprecated Please consider using {@link com.jogamp.opengl.util.GLReadBufferUtil},
+ *             which is AWT independent and does not require a CPU based vertical image flip
  *             in case drawable {@link GLDrawable#isGLOriented() is in OpenGL orientation}.
- *             Further more you may use {@link AWTGLReadBufferUtil} to read out 
+ *             Further more you may use {@link AWTGLReadBufferUtil} to read out
  *             the framebuffer into a BufferedImage for further AWT processing.
  */
 public class Screenshot {
   private Screenshot() {}
 
-  /** 
+  /**
    * Takes a fast screenshot of the current OpenGL drawable to a Targa
    * file. Requires the OpenGL context for the desired drawable to be
    * current. Takes the screenshot from the last assigned read buffer,
@@ -94,7 +94,7 @@ public class Screenshot {
     writeToTargaFile(file, width, height, false);
   }
 
-  /** 
+  /**
    * Takes a fast screenshot of the current OpenGL drawable to a Targa
    * file. Requires the OpenGL context for the desired drawable to be
    * current. Takes the screenshot from the last assigned read buffer,
@@ -122,7 +122,7 @@ public class Screenshot {
     writeToTargaFile(file, 0, 0, width, height, alpha);
   }
 
-  /** 
+  /**
    * Takes a fast screenshot of the current OpenGL drawable to a Targa
    * file. Requires the OpenGL context for the desired drawable to be
    * current. Takes the screenshot from the last assigned read buffer,
@@ -410,5 +410,5 @@ public class Screenshot {
     if (!gl.isExtensionAvailable(GLExtensions.EXT_abgr)) {
       throw new IllegalArgumentException("Saving alpha channel requires GL_EXT_abgr");
     }
-  } 
+  }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
index c67141525..6e504c089 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
@@ -129,7 +129,7 @@ import jogamp.opengl.Debug;
 */
 public class TextRenderer {
     private static final boolean DEBUG;
-    
+
     static {
         Debug.initSingleton();
         DEBUG = Debug.isPropertyDefined("jogl.debug.TextRenderer", true);
@@ -200,10 +200,10 @@ public class TextRenderer {
     // Debugging purposes only
     private boolean debugged;
     Pipelined_QuadRenderer mPipelinedQuadRenderer;
-    
+
     //emzic: added boolean flag
     private boolean useVertexArrays = true;
-    
+
     //emzic: added boolean flag
     private boolean isExtensionAvailable_GL_VERSION_1_5;
     private boolean checkFor_isExtensionAvailable_GL_VERSION_1_5;
@@ -707,7 +707,7 @@ public class TextRenderer {
     /**
      * emzic: here the call to glBindBuffer crashes on certain graphicscard/driver combinations
      * this is why the ugly try-catch block has been added, which falls back to the old textrenderer
-     * 
+     *
      * @param ortho
      * @throws GLException
      */
@@ -891,7 +891,7 @@ public class TextRenderer {
         data.markUsed();
 
         Rectangle2D origRect = data.origRect();
-        
+
         // Align the leftmost point of the baseline to the (x, y, z) coordinate requested
         renderer.draw3DRect(x - (scaleFactor * data.origOriginX()),
                             y - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY())), z,
@@ -1715,7 +1715,7 @@ public class TextRenderer {
             return glyph;
         }
     }
-    
+
     private static class CharacterCache {
         private CharacterCache() {
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
index 922fc69c1..26e1eb041 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -407,7 +407,7 @@ public class TextureRenderer {
     this.a = a;
 
     gl.glColor4f(this.r, this.g, this.b, this.a);
-  }  
+  }
 
   private float[] compArray;
   /** Changes the current color of this TextureRenderer to the
@@ -437,7 +437,7 @@ public class TextureRenderer {
       @param screenx the on-screen x coordinate at which to draw the rectangle
       @param screeny the on-screen y coordinate (relative to lower left) at
         which to draw the rectangle
-      
+
       @throws GLException If an OpenGL context is not current when this method is called
   */
   public void drawOrthoRect(int screenx, int screeny) throws GLException {
@@ -459,7 +459,7 @@ public class TextureRenderer {
         rectangle to draw
       @param width the width of the rectangle to draw
       @param height the height of the rectangle to draw
-      
+
       @throws GLException If an OpenGL context is not current when this method is called
   */
   public void drawOrthoRect(int screenx, int screeny,
@@ -490,7 +490,7 @@ public class TextureRenderer {
       @param height the height in texels of the rectangle to draw
       @param scaleFactor the scale factor to apply (multiplicatively)
         to the size of the drawn rectangle
-      
+
       @throws GLException If an OpenGL context is not current when this method is called
   */
   public void draw3DRect(float x, float y, float z,
@@ -518,7 +518,7 @@ public class TextureRenderer {
       OpenGL texture to the screen, if the application intends to draw
       them as a flat overlay on to the screen. Must be used if {@link
       #beginOrthoRendering} is used to set up the rendering stage for
-      this overlay. 
+      this overlay.
 
       @throws GLException If an OpenGL context is not current when this method is called
   */
@@ -552,7 +552,7 @@ public class TextureRenderer {
 
   private void beginRendering(boolean ortho, int width, int height, boolean disableDepthTestForOrtho) {
     GL2 gl = GLContext.getCurrentGL().getGL2();
-    int attribBits = 
+    int attribBits =
       GL2.GL_ENABLE_BIT | GL2.GL_TEXTURE_BIT | GL2.GL_COLOR_BUFFER_BIT |
       (ortho ? (GL2.GL_DEPTH_BUFFER_BIT | GL2.GL_TRANSFORM_BIT) : 0);
     gl.glPushAttrib(attribBits);
@@ -622,7 +622,7 @@ public class TextureRenderer {
 
     // Infer the internal format if not an intensity texture
     int internalFormat = (intensity ? GL2.GL_INTENSITY : 0);
-    int imageType = 
+    int imageType =
       (intensity ? BufferedImage.TYPE_BYTE_GRAY :
        (alpha ?  BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_RGB));
     image = new BufferedImage(width, height, imageType);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
index 34685e1b2..e8df6aaec 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
 
 /* Copyright (c) Mark J. Kilgard, 1994, 1998. */
 
-/* This program is freely distributable without licensing fees 
-   and is provided without guarantee or warrantee expressed or 
+/* This program is freely distributable without licensing fees
+   and is provided without guarantee or warrantee expressed or
    implied. This program is -not- in the public domain. */
 
 class BitmapCharRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
index 18f7d3b28..d4ee12b32 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
 
 /* Copyright (c) Mark J. Kilgard, 1994, 1998. */
 
-/* This program is freely distributable without licensing fees 
-   and is provided without guarantee or warrantee expressed or 
+/* This program is freely distributable without licensing fees
+   and is provided without guarantee or warrantee expressed or
    implied. This program is -not- in the public domain. */
 
 class BitmapFontRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
index 9ad95ec03..5e26e0d14 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
 
 /* Copyright (c) Mark J. Kilgard, 1994, 1998. */
 
-/* This program is freely distributable without licensing fees 
-   and is provided without guarantee or warrantee expressed or 
+/* This program is freely distributable without licensing fees
+   and is provided without guarantee or warrantee expressed or
    implied. This program is -not- in the public domain. */
 
 class CoordRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
index 010ce6699..42529f3f1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -163,7 +163,7 @@ public class GLUT {
 
   public void glutSolidCylinder(double radius, double height, int slices, int stacks) {
     GL2 gl = GLUgl2.getCurrentGL2();
-      
+
     // Prepare table of points for drawing end caps
     double [] x = new double[slices];
     double [] y = new double[slices];
@@ -174,7 +174,7 @@ public class GLUT {
       x[i] = Math.cos(angle) * radius;
       y[i] = Math.sin(angle) * radius;
     }
-      
+
     // Draw bottom cap
     gl.glBegin(GL2.GL_TRIANGLE_FAN);
     gl.glNormal3d(0,0,-1);
@@ -184,7 +184,7 @@ public class GLUT {
     }
     gl.glVertex3d(x[0], y[0], 0);
     gl.glEnd();
-      
+
     // Draw top cap
     gl.glBegin(GL2.GL_TRIANGLE_FAN);
     gl.glNormal3d(0,0,1);
@@ -194,7 +194,7 @@ public class GLUT {
     }
     gl.glVertex3d(x[0], y[0], height);
     gl.glEnd();
-      
+
     // Draw walls
     quadObjInit(glu);
     glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
@@ -262,7 +262,7 @@ public class GLUT {
 /**
    * Renders the teapot as a solid shape of the specified size. The teapot is
    * created in a way that replicates the C GLUT implementation.
-   * 
+   *
    * @param scale
    *        the factor by which to scale the teapot
    */
@@ -278,7 +278,7 @@ public class GLUT {
    * instead of the y=-1 plane). Both surface normals and texture coordinates
    * for the teapot are generated. The teapot is generated with OpenGL
    * evaluators.
-   * 
+   *
    * @param scale
    *        the factor by which to scale the teapot
    * @param cStyle
@@ -292,14 +292,14 @@ public class GLUT {
   /**
    * Renders the teapot as a wireframe shape of the specified size. The teapot
    * is created in a way that replicates the C GLUT implementation.
-   * 
+   *
    * @param scale
    *        the factor by which to scale the teapot
    */
   public void glutWireTeapot(double scale) {
     glutWireTeapot(scale, true);
   }
-  
+
   /**
    * Renders the teapot as a wireframe shape of the specified size. The teapot
    * can either be created in a way that is backward-compatible with the
@@ -308,7 +308,7 @@ public class GLUT {
    * plane, instead of the y=-1 plane). Both surface normals and texture
    * coordinates for the teapot are generated. The teapot is generated with
    * OpenGL evaluators.
-   * 
+   *
    * @param scale
    *        the factor by which to scale the teapot
    * @param cStyle
@@ -356,7 +356,7 @@ public class GLUT {
     int[] skiprows   = new int[1];
     int[] skippixels = new int[1];
     int[] alignment  = new int[1];
-    beginBitmap(gl, 
+    beginBitmap(gl,
                 swapbytes,
                 lsbfirst,
                 rowlength,
@@ -367,7 +367,7 @@ public class GLUT {
     for (int i = 0; i < len; i++) {
       bitmapCharacterImpl(gl, font, string.charAt(i));
     }
-    endBitmap(gl, 
+    endBitmap(gl,
               swapbytes,
               lsbfirst,
               rowlength,
@@ -502,7 +502,7 @@ public class GLUT {
       gl.glEnd( );
     }
   }
-  
+
   /**
    This function draws a solid-shaded dodecahedron
    whose facets are rhombic and
@@ -522,7 +522,7 @@ public class GLUT {
     }
     gl.glEnd( );
   }
-  
+
   //----------------------------------------------------------------------
   // Internals only below this point
   //
@@ -879,7 +879,7 @@ public class GLUT {
   }
 
   /* rhombic dodecahedron data: */
-  
+
   private static final double rdod_r[][] =
   {
     { 0.0, 0.0, 1.0 },
@@ -897,7 +897,7 @@ public class GLUT {
     {  0.000000000000, -0.707106781187, -0.5 },
     {  0.0, 0.0, -1.0 }
   };
-  
+
   private static final int rdod_v[][] =
   {
     { 0,  1,  5,  2 },
@@ -913,7 +913,7 @@ public class GLUT {
     { 7, 11, 13, 12 },
     { 8, 12, 13,  9 }
   };
-  
+
   private static final double rdod_n[][] =
   {
     {  0.353553390594,  0.353553390594,  0.5 },
@@ -929,7 +929,7 @@ public class GLUT {
     { -0.353553390594, -0.353553390594, -0.5 },
     {  0.353553390594, -0.353553390594, -0.5 }
   };
-  
+
   /* tetrahedron data: */
 
   private static final float T = 1.73205080756887729f;
@@ -1124,7 +1124,7 @@ public class GLUT {
     float[] r = new float[4*4*3];
     float[] s = new float[4*4*3];
     int i, j, k, l;
-  
+
     gl.glPushAttrib(GL2.GL_ENABLE_BIT | GL2.GL_EVAL_BIT | GL2.GL_POLYGON_BIT);
     gl.glEnable(GL2.GL_AUTO_NORMAL);
     gl.glEnable(GL2.GL_NORMALIZE);
@@ -1183,7 +1183,7 @@ public class GLUT {
     gl.glPopMatrix();
     gl.glPopAttrib();
   }
-  
+
   private static void evaluateTeapotMesh(GL2 gl,
                                          int grid,
                                          int type,
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java
index 07ded652a..c24483777 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java
index 5d357f3f7..62af3b631 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java
index b9c7e6e50..5f06d697e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java
index bc86f6216..8326d6461 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java
index 1b2e69ba4..cb11f6bec 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java
index f753b56f7..17cbd0796 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java
index 073e6e673..9cc2bdc3a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
index b8296924e..3587ca992 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
index 94fa1c4fd..cf51ddd3c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
index af3d538ae..515212f0e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
 
 /* Copyright (c) Mark J. Kilgard, 1994, 1998. */
 
-/* This program is freely distributable without licensing fees 
-   and is provided without guarantee or warrantee expressed or 
+/* This program is freely distributable without licensing fees
+   and is provided without guarantee or warrantee expressed or
    implied. This program is -not- in the public domain. */
 
 class StrokeCharRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
index d3195f24d..5335c8523 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
 
 /* Copyright (c) Mark J. Kilgard, 1994, 1998. */
 
-/* This program is freely distributable without licensing fees 
-   and is provided without guarantee or warrantee expressed or 
+/* This program is freely distributable without licensing fees
+   and is provided without guarantee or warrantee expressed or
    implied. This program is -not- in the public domain. */
 
 class StrokeFontRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
index 8796e8b08..b0c91c696 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -41,14 +41,14 @@ package com.jogamp.opengl.util.gl2;
 
 /* Copyright (c) Mark J. Kilgard, 1994, 1998. */
 
-/* This program is freely distributable without licensing fees 
-   and is provided without guarantee or warrantee expressed or 
+/* This program is freely distributable without licensing fees
+   and is provided without guarantee or warrantee expressed or
    implied. This program is -not- in the public domain. */
 
 class StrokeRec {
   public int num_coords;
   public CoordRec[] coord;
-  
+
   public StrokeRec(int num_coords,
             CoordRec[] coord) {
     this.num_coords = num_coords;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
index edc3d2677..68c1d0fec 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -62,7 +62,7 @@ import com.jogamp.common.util.VersionNumber;
  * A documented example of how to use this code is available
  * {@link #create(GL2ES2, int, Class, String, String, String, boolean) here} and
  * {@link #create(GL2ES2, int, int, Class, String, String[], String, String) here}.
- * </p>  
+ * </p>
  */
 public class ShaderCode {
     public static final boolean DEBUG = Debug.debug("GLSLCode");
@@ -70,22 +70,22 @@ public class ShaderCode {
 
     /** Unique resource suffix for {@link GL2ES2#GL_VERTEX_SHADER} in source code: <code>vp</code> */
     public static final String SUFFIX_VERTEX_SOURCE   =  "vp" ;
-    
+
     /** Unique resource suffix for {@link GL2ES2#GL_VERTEX_SHADER} in binary: <code>bvp</code> */
     public static final String SUFFIX_VERTEX_BINARY   = "bvp" ;
-    
+
     /** Unique resource suffix for {@link GL3#GL_GEOMETRY_SHADER} in source code: <code>gp</code> */
     public static final String SUFFIX_GEOMETRY_SOURCE =  "gp" ;
-    
+
     /** Unique resource suffix for {@link GL3#GL_GEOMETRY_SHADER} in binary: <code>bgp</code> */
     public static final String SUFFIX_GEOMETRY_BINARY = "bgp" ;
-    
+
     /** Unique resource suffix for {@link GL2ES2#GL_FRAGMENT_SHADER} in source code: <code>fp</code> */
     public static final String SUFFIX_FRAGMENT_SOURCE =  "fp" ;
-    
+
     /** Unique resource suffix for {@link GL2ES2#GL_FRAGMENT_SHADER} in binary: <code>bfp</code> */
     public static final String SUFFIX_FRAGMENT_BINARY = "bfp" ;
-    
+
     /** Unique relative path for binary shader resources for {@link GLES2#GL_NVIDIA_PLATFORM_BINARY_NV NVIDIA}: <code>nvidia</code> */
     public static final String SUB_PATH_NVIDIA = "nvidia" ;
 
@@ -94,7 +94,7 @@ public class ShaderCode {
      * @param count number of shaders
      * @param source CharSequence array containing the shader sources, organized as <code>source[count][strings-per-shader]</code>.
      *               May be either an immutable <code>String</code> - or mutable <code>StringBuilder</code> array.
-     * 
+     *
      * @throws IllegalArgumentException if <code>count</count> and <code>source.length</code> do not match
      */
     public ShaderCode(int type, int count, CharSequence[][] source) {
@@ -125,7 +125,7 @@ public class ShaderCode {
     /**
      * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
      * @param count number of shaders
-     * @param binary binary buffer containing the shader binaries, 
+     * @param binary binary buffer containing the shader binaries,
      */
     public ShaderCode(int type, int count, int binFormat, Buffer binary) {
         switch (type) {
@@ -147,19 +147,19 @@ public class ShaderCode {
     /**
      * Creates a complete {@link ShaderCode} object while reading all shader source of <code>sourceFiles</code>,
      * which location is resolved using the <code>context</code> class, see {@link #readShaderSource(Class, String)}.
-     * 
+     *
      * @param gl current GL object to determine whether a shader compiler is available. If null, no validation is performed.
      * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
      * @param count number of shaders
      * @param context class used to help resolving the source location
      * @param sourceFiles array of source locations, organized as <code>sourceFiles[count]</code>
      * @param mutableStringBuilder if <code>true</code> method returns a mutable <code>StringBuilder</code> instance
-     *                        which can be edited later on at the costs of a String conversion when passing to 
+     *                        which can be edited later on at the costs of a String conversion when passing to
      *                        {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}.
      *                        If <code>false</code> method returns an immutable <code>String</code> instance,
      *                        which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}
      *                        at no additional costs.
-     * 
+     *
      * @throws IllegalArgumentException if <code>count</count> and <code>sourceFiles.length</code> do not match
      * @see #readShaderSource(Class, String)
      */
@@ -192,16 +192,16 @@ public class ShaderCode {
     /**
      * Creates a complete {@link ShaderCode} object while reading the shader binary of <code>binaryFile</code>,
      * which location is resolved using the <code>context</code> class, see {@link #readShaderBinary(Class, String)}.
-     * 
+     *
      * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
      * @param count number of shaders
      * @param context class used to help resolving the source location
      * @param binFormat a valid native binary format as they can be queried by {@link ShaderUtil#getShaderBinaryFormats(GL)}.
      * @param sourceFiles array of source locations, organized as <code>sourceFiles[count]</code>
-     * 
+     *
      * @see #readShaderBinary(Class, String)
      * @see ShaderUtil#getShaderBinaryFormats(GL)
-     */    
+     */
     public static ShaderCode create(int type, int count, Class<?> context, int binFormat, String binaryFile) {
         ByteBuffer shaderBinary = null;
         if(null!=binaryFile && 0<=binFormat) {
@@ -231,12 +231,12 @@ public class ShaderCode {
      *     <li>{@link GL2ES2#GL_VERTEX_SHADER vertex}: {@link #SUFFIX_VERTEX_BINARY}</li>
      *     <li>{@link GL2ES2#GL_FRAGMENT_SHADER fragment}: {@link #SUFFIX_FRAGMENT_BINARY}</li>
      *     <li>{@link GL3#GL_GEOMETRY_SHADER geometry}: {@link #SUFFIX_GEOMETRY_BINARY}</li></ul></li>
-     * </ul> 
-     * @param binary true for a binary resource, false for a source resource 
+     * </ul>
+     * @param binary true for a binary resource, false for a source resource
      * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
-     * 
+     *
      * @throws GLException if <code>type</code> is not supported
-     * 
+     *
      * @see #create(GL2ES2, int, Class, String, String, String, boolean)
      */
     public static String getFileSuffix(boolean binary, int type) {
@@ -252,16 +252,16 @@ public class ShaderCode {
         }
     }
 
-    /** 
+    /**
      * Returns a unique relative path for binary shader resources as follows:
      * <ul>
      *   <li>{@link GLES2#GL_NVIDIA_PLATFORM_BINARY_NV NVIDIA}: {@link #SUB_PATH_NVIDIA}</li>
      * </ul>
-     * 
+     *
      * @throws GLException if <code>binFormat</code> is not supported
-     * 
+     *
      * @see #create(GL2ES2, int, Class, String, String, String, boolean)
-     */    
+     */
     public static String getBinarySubPath(int binFormat) {
         switch (binFormat) {
             case GLES2.GL_NVIDIA_PLATFORM_BINARY_NV:
@@ -272,42 +272,42 @@ public class ShaderCode {
     }
 
     /**
-     * Convenient creation method for instantiating a complete {@link ShaderCode} object 
-     * either from source code using {@link #create(GL2ES2, int, int, Class, String[])}, 
+     * Convenient creation method for instantiating a complete {@link ShaderCode} object
+     * either from source code using {@link #create(GL2ES2, int, int, Class, String[])},
      * or from a binary code using {@link #create(int, int, Class, int, String)},
      * whatever is available first.
      * <p>
-     * The source and binary location names are expected w/o suffixes which are 
+     * The source and binary location names are expected w/o suffixes which are
      * resolved and appended using {@link #getFileSuffix(boolean, int)}.
      * </p>
      * <p>
      * Additionally, the binary resource is expected within a subfolder of <code>binRoot</code>
      * which reflects the vendor specific binary format, see {@link #getBinarySubPath(int)}.
      * All {@link ShaderUtil#getShaderBinaryFormats(GL)} are being iterated
-     * using the binary subfolder, the first existing resource is being used. 
+     * using the binary subfolder, the first existing resource is being used.
      * </p>
-     * 
+     *
      * Example:
      * <pre>
      *   Your std JVM layout (plain or within a JAR):
-     *   
+     *
      *      org/test/glsl/MyShaderTest.class
      *      org/test/glsl/shader/vertex.vp
      *      org/test/glsl/shader/fragment.fp
      *      org/test/glsl/shader/bin/nvidia/vertex.bvp
      *      org/test/glsl/shader/bin/nvidia/fragment.bfp
-     *      
+     *
      *   Your Android APK layout:
-     *   
+     *
      *      classes.dex
      *      assets/org/test/glsl/shader/vertex.vp
      *      assets/org/test/glsl/shader/fragment.fp
      *      assets/org/test/glsl/shader/bin/nvidia/vertex.bvp
      *      assets/org/test/glsl/shader/bin/nvidia/fragment.bfp
      *      ...
-     *   
+     *
      *   Your invocation in org/test/glsl/MyShaderTest.java:
-     *   
+     *
      *      ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, 1, this.getClass(),
      *                                         "shader", new String[] { "vertex" }, "shader/bin", "vertex");
      *      ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, 1, this.getClass(),
@@ -318,11 +318,11 @@ public class ShaderCode {
      *      st.attachShaderProgram(gl, sp0, true);
      * </pre>
      * A simplified entry point is {@link #create(GL2ES2, int, Class, String, String, String, boolean)}.
-     * 
+     *
      * <p>
      * The location is finally being resolved using the <code>context</code> class, see {@link #readShaderBinary(Class, String)}.
      * </p>
-     * 
+     *
      * @param gl current GL object to determine whether a shader compiler is available (if <code>source</code> is used),
      *           or to determine the shader binary format (if <code>binary</code> is used).
      * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
@@ -333,22 +333,22 @@ public class ShaderCode {
      * @param binRoot relative <i>root</i> path for <code>binBasenames</code>
      * @param binBasename basename w/o path or suffix relative to <code>binRoot</code> for the shader's binary code
      * @param mutableStringBuilder if <code>true</code> method returns a mutable <code>StringBuilder</code> instance
-     *                        which can be edited later on at the costs of a String conversion when passing to 
+     *                        which can be edited later on at the costs of a String conversion when passing to
      *                        {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}.
      *                        If <code>false</code> method returns an immutable <code>String</code> instance,
      *                        which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}
      *                        at no additional costs.
-     * 
+     *
      * @throws IllegalArgumentException if <code>count</count> and <code>srcBasenames.length</code> do not match
-     * 
+     *
      * @see #create(GL2ES2, int, int, Class, String[])
      * @see #create(int, int, Class, int, String)
      * @see #readShaderSource(Class, String)
      * @see #getFileSuffix(boolean, int)
      * @see ShaderUtil#getShaderBinaryFormats(GL)
      * @see #getBinarySubPath(int)
-     */    
-    public static ShaderCode create(GL2ES2 gl, int type, int count, Class<?> context, 
+     */
+    public static ShaderCode create(GL2ES2 gl, int type, int count, Class<?> context,
                                     String srcRoot, String[] srcBasenames, String binRoot, String binBasename,
                                     boolean mutableStringBuilder) {
         ShaderCode res = null;
@@ -391,28 +391,28 @@ public class ShaderCode {
     /**
      * Simplified variation of {@link #create(GL2ES2, int, int, Class, String, String[], String, String)}.
      * <br>
-     * 
+     *
      * Example:
      * <pre>
      *   Your std JVM layout (plain or within a JAR):
-     *   
+     *
      *      org/test/glsl/MyShaderTest.class
      *      org/test/glsl/shader/vertex.vp
      *      org/test/glsl/shader/fragment.fp
      *      org/test/glsl/shader/bin/nvidia/vertex.bvp
      *      org/test/glsl/shader/bin/nvidia/fragment.bfp
-     *      
+     *
      *   Your Android APK layout:
-     *   
+     *
      *      classes.dex
      *      assets/org/test/glsl/shader/vertex.vp
      *      assets/org/test/glsl/shader/fragment.fp
      *      assets/org/test/glsl/shader/bin/nvidia/vertex.bvp
      *      assets/org/test/glsl/shader/bin/nvidia/fragment.bfp
      *      ...
-     *   
+     *
      *   Your invocation in org/test/glsl/MyShaderTest.java:
-     *   
+     *
      *      ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
      *                                         "shader", "shader/bin", "vertex");
      *      ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
@@ -422,7 +422,7 @@ public class ShaderCode {
      *      sp0.add(gl, fp0, System.err);
      *      st.attachShaderProgram(gl, sp0, true);
      * </pre>
-     * 
+     *
      * @param gl current GL object to determine whether a shader compiler is available (if <code>source</code> is used),
      *           or to determine the shader binary format (if <code>binary</code> is used).
      * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
@@ -433,20 +433,20 @@ public class ShaderCode {
      * @param basenames basename w/o path or suffix relative to <code>srcRoot</code> and <code>binRoot</code>
      *                  for the shader's source and binary code.
      * @param mutableStringBuilder if <code>true</code> method returns a mutable <code>StringBuilder</code> instance
-     *                        which can be edited later on at the costs of a String conversion when passing to 
+     *                        which can be edited later on at the costs of a String conversion when passing to
      *                        {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}.
      *                        If <code>false</code> method returns an immutable <code>String</code> instance,
      *                        which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}
      *                        at no additional costs.
      * @throws IllegalArgumentException if <code>count</count> is not 1
-     * 
+     *
      * @see #create(GL2ES2, int, int, Class, String, String[], String, String)
-     */    
-    public static ShaderCode create(GL2ES2 gl, int type, Class<?> context, 
+     */
+    public static ShaderCode create(GL2ES2 gl, int type, Class<?> context,
                                     String srcRoot, String binRoot, String basename, boolean mutableStringBuilder) {
-        return create(gl, type, 1, context, srcRoot, new String[] { basename }, binRoot, basename, mutableStringBuilder );        
+        return create(gl, type, 1, context, srcRoot, new String[] { basename }, binRoot, basename, mutableStringBuilder );
     }
-    
+
     /**
      * returns the uniq shader id as an integer
      */
@@ -455,7 +455,7 @@ public class ShaderCode {
     public int        shaderType() { return shaderType; }
     public String     shaderTypeStr() { return shaderTypeStr(shaderType); }
 
-    public static String shaderTypeStr(int type) { 
+    public static String shaderTypeStr(int type) {
         switch (type) {
             case GL2ES2.GL_VERTEX_SHADER:
                 return "VERTEX_SHADER";
@@ -553,7 +553,7 @@ public class ShaderCode {
             } else {
                 CharSequence[] src = shaderSource[i];
                 int lineno=0;
-                
+
                 for(int j=0; j<src.length; j++) {
                     out.printf("%4d: // Segment %d/%d: \n", lineno, j, src.length);
                     final BufferedReader reader = new BufferedReader(new StringReader(src[j].toString()));
@@ -569,19 +569,19 @@ public class ShaderCode {
             out.println("--------------------------------------------------------------");
         }
     }
-    
+
     /**
      * Adds <code>data</code> after the line containing <code>tag</code>.
      * <p>
      * Note: The shader source to be edit must be created using a mutable StringBuilder.
      * </p>
-     *  
+     *
      * @param shaderIdx the shader index to be used.
      * @param tag search string
      * @param fromIndex start search <code>tag</code> begininig with this index
      * @param data the text to be inserted. Shall end with an EOL '\n' character.
      * @return index after the inserted <code>data</code>
-     * 
+     *
      * @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
      */
     public int insertShaderSource(int shaderIdx, String tag, int fromIndex, CharSequence data) {
@@ -595,7 +595,7 @@ public class ShaderCode {
         final int sourceCount = (null!=shaderSource)?shaderSource.length:0;
         if(shaderIdx>=sourceCount) {
             throw new IndexOutOfBoundsException("shaderIdx not within source bounds [0.."+(sourceCount-1)+"]: "+shaderIdx);
-        }        
+        }
         final CharSequence[] src = shaderSource[shaderIdx];
         int curEndIndex = 0;
         for(int j=0; j<src.length; j++) {
@@ -603,8 +603,8 @@ public class ShaderCode {
                 throw new IllegalStateException("shader source not a mutable StringBuilder, but CharSequence of type: "+src[j].getClass().getName());
             }
             final StringBuilder sb = (StringBuilder)src[j];
-            curEndIndex += sb.length(); 
-            if(fromIndex < curEndIndex) { 
+            curEndIndex += sb.length();
+            if(fromIndex < curEndIndex) {
                 int insertIdx = sb.indexOf(tag, fromIndex);
                 if(0<=insertIdx) {
                     insertIdx += tag.length();
@@ -630,15 +630,15 @@ public class ShaderCode {
      * Replaces <code>oldName</code> with <code>newName</code> in all shader sources.
      * <p>
      * In case <code>oldName</code> and <code>newName</code> are equal, no action is performed.
-     * </p> 
+     * </p>
      * <p>
      * Note: The shader source to be edit must be created using a mutable StringBuilder.
      * </p>
-     *  
+     *
      * @param oldName the to be replace string
      * @param newName the replacement string
      * @return the number of replacements
-     * 
+     *
      * @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
      */
     public int replaceInShaderSource(String oldName, String newName) {
@@ -675,18 +675,18 @@ public class ShaderCode {
         }
         return num;
     }
-    
+
     /**
      * Adds <code>data</code> at <code>offset</code> in shader source for shader <code>shaderIdx</code>.
      * <p>
      * Note: The shader source to be edit must be created using a mutable StringBuilder.
      * </p>
-     *  
+     *
      * @param shaderIdx the shader index to be used.
      * @param position in shader source segments of shader <code>shaderIdx</code>
      * @param data the text to be inserted. Shall end with an EOL '\n' character
      * @return index after the inserted <code>data</code>
-     * 
+     *
      * @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
      */
     public int insertShaderSource(int shaderIdx, int position, CharSequence data) {
@@ -700,7 +700,7 @@ public class ShaderCode {
         final int sourceCount = (null!=shaderSource)?shaderSource.length:0;
         if(shaderIdx>=sourceCount) {
             throw new IndexOutOfBoundsException("shaderIdx not within source bounds [0.."+(sourceCount-1)+"]: "+shaderIdx);
-        }        
+        }
         final CharSequence[] src = shaderSource[shaderIdx];
         int curEndIndex = 0;
         for(int j=0; j<src.length; j++) {
@@ -708,8 +708,8 @@ public class ShaderCode {
                 throw new IllegalStateException("shader source not a mutable StringBuilder, but CharSequence of type: "+src[j].getClass().getName());
             }
             final StringBuilder sb = (StringBuilder)src[j];
-            curEndIndex += sb.length(); 
-            if(position < curEndIndex) { 
+            curEndIndex += sb.length();
+            if(position < curEndIndex) {
                 sb.insert(position, data);
                 return position+data.length();
             }
@@ -734,12 +734,12 @@ public class ShaderCode {
                 if (line.startsWith("#include ")) {
                     String includeFile = line.substring(9).trim();
                     URLConnection nextConn = null;
-                    
+
                     // Try relative of current shader location
                     nextConn = IOUtil.openURL(IOUtil.getRelativeOf(conn.getURL(), includeFile), "ShaderCode.relativeOf ");
                     if (nextConn == null) {
                         // Try relative of class and absolute
-                        nextConn = IOUtil.getResource(context, includeFile);        
+                        nextConn = IOUtil.getResource(context, includeFile);
                     }
                     if (nextConn == null) {
                         // Fail
@@ -757,7 +757,7 @@ public class ShaderCode {
     }
 
     /**
-     * 
+     *
      * @param context
      * @param conn
      * @param result
@@ -766,7 +766,7 @@ public class ShaderCode {
     public static void readShaderSource(Class<?> context, URLConnection conn, StringBuilder result) throws IOException {
         readShaderSource(context, conn, result, 0);
     }
-    
+
     /**
      * Reads shader source located in <code>path</code>,
      * either relative to the <code>context</code> class or absolute <i>as-is</i>.
@@ -774,21 +774,21 @@ public class ShaderCode {
      * Final location lookup is performed via {@link ClassLoader#getResource(String)} and {@link ClassLoader#getSystemResource(String)},
      * see {@link IOUtil#getResource(Class, String)}.
      * </p>
-     *  
+     *
      * @param context class used to help resolve the source location
      * @param path location of shader source
      * @param mutableStringBuilder if <code>true</code> method returns a mutable <code>StringBuilder</code> instance
-     *                        which can be edited later on at the costs of a String conversion when passing to 
+     *                        which can be edited later on at the costs of a String conversion when passing to
      *                        {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}.
      *                        If <code>false</code> method returns an immutable <code>String</code> instance,
      *                        which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}
      *                        at no additional costs.
-     * @throws IOException 
-     * 
+     * @throws IOException
+     *
      * @see IOUtil#getResource(Class, String)
-     */    
+     */
     public static CharSequence readShaderSource(Class<?> context, String path, boolean mutableStringBuilder) throws IOException {
-        URLConnection conn = IOUtil.getResource(context, path);        
+        URLConnection conn = IOUtil.getResource(context, path);
         if (conn == null) {
             return null;
         }
@@ -798,17 +798,17 @@ public class ShaderCode {
     }
 
     /**
-     * Reads shader binary located in <code>path</code>, 
+     * Reads shader binary located in <code>path</code>,
      * either relative to the <code>context</code> class or absolute <i>as-is</i>.
      * <p>
      * Final location lookup is perfomed via {@link ClassLoader#getResource(String)} and {@link ClassLoader#getSystemResource(String)},
      * see {@link IOUtil#getResource(Class, String)}.
      * </p>
-     *  
+     *
      * @param context class used to help resolve the source location
      * @param path location of shader binary
-     * @throws IOException 
-     * 
+     * @throws IOException
+     *
      * @see IOUtil#getResource(Class, String)
      */
     public static ByteBuffer readShaderBinary(Class<?> context, String path) throws IOException {
@@ -824,41 +824,41 @@ public class ShaderCode {
         }
     }
 
-    // Shall we use: #ifdef GL_FRAGMENT_PRECISION_HIGH .. #endif for using highp in fragment shader if avail ?     
+    // Shall we use: #ifdef GL_FRAGMENT_PRECISION_HIGH .. #endif for using highp in fragment shader if avail ?
     /** Default precision of {@link GL#isGLES2() ES2} for {@link GL2ES2#GL_VERTEX_SHADER vertex-shader}: {@value #es2_default_precision_vp} */
     public static final String es2_default_precision_vp = "\nprecision highp float;\nprecision highp int;\n";
     /** Default precision of {@link GL#isGLES2() ES2} for {@link GL2ES2#GL_FRAGMENT_SHADER fragment-shader}: {@value #es2_default_precision_fp} */
     public static final String es2_default_precision_fp = "\nprecision mediump float;\nprecision mediump int;\n/*precision lowp sampler2D;*/\n";
-    
+
     /** Default precision of GLSL &ge; 1.30 as required until &lt; 1.50 for {@link GL2ES2#GL_VERTEX_SHADER vertex-shader} or {@link GL3#GL_GEOMETRY_SHADER geometry-shader}: {@value #gl3_default_precision_vp_gp}. See GLSL Spec 1.30-1.50 Section 4.5.3. */
     public static final String gl3_default_precision_vp_gp = "\nprecision highp float;\nprecision highp int;\n";
     /** Default precision of GLSL &ge; 1.30 as required until &lt; 1.50 for {@link GL2ES2#GL_FRAGMENT_SHADER fragment-shader}: {@value #gl3_default_precision_fp}. See GLSL Spec 1.30-1.50 Section 4.5.3. */
     public static final String gl3_default_precision_fp = "\nprecision highp float;\nprecision mediump int;\n/*precision mediump sampler2D;*/\n";
-    
+
     /** Prefer <code>enable</code> over <code>require</code>, since it won't force a failure. */
     public static final String extOESDerivativesEnable = "#extension GL_OES_standard_derivatives : enable\n";
-        
+
     /**
      * Add GLSL version at the head of this shader source code.
      * <p>
      * Note: The shader source to be edit must be created using a mutable StringBuilder.
      * </p>
-     * @param gl a GL context, which must have been made current once 
+     * @param gl a GL context, which must have been made current once
      * @return the index after the inserted data, maybe 0 if nothing has be inserted.
      */
     public final int addGLSLVersion(GL2ES2 gl) {
         return insertShaderSource(0, 0, gl.getContext().getGLSLVersionString());
     }
-    
+
     /**
      * Adds default precision to source code at given position if required, i.e.
-     * {@link #es2_default_precision_vp}, {@link #es2_default_precision_fp}, 
+     * {@link #es2_default_precision_vp}, {@link #es2_default_precision_fp},
      * {@link #gl3_default_precision_vp_gp}, {@link #gl3_default_precision_fp} or none,
      * depending on the {@link GLContext#getGLSLVersionNumber() GLSL version} being used.
      * <p>
      * Note: The shader source to be edit must be created using a mutable StringBuilder.
      * </p>
-     * @param gl a GL context, which must have been made current once 
+     * @param gl a GL context, which must have been made current once
      * @param pos position within this mutable shader source.
      * @return the index after the inserted data, maybe 0 if nothing has be inserted.
      */
@@ -871,7 +871,7 @@ public class ShaderCode {
                 case GL2ES2.GL_FRAGMENT_SHADER:
                     defaultPrecision = es2_default_precision_vp; break;
                 default:
-                    defaultPrecision = null; 
+                    defaultPrecision = null;
                     break;
             }
         } else if( requiresGL3DefaultPrecision(gl) ) {
@@ -883,7 +883,7 @@ public class ShaderCode {
                 case GL2ES2.GL_FRAGMENT_SHADER:
                     defaultPrecision = gl3_default_precision_fp; break;
                 default:
-                    defaultPrecision = null; 
+                    defaultPrecision = null;
                     break;
             }
         } else {
@@ -894,7 +894,7 @@ public class ShaderCode {
         }
         return pos;
     }
-    
+
     /** Returns true, if GLSL version requires default precision, i.e. ES2 or GLSL [1.30 .. 1.50[. */
     public static final boolean requiresDefaultPrecision(GL2ES2 gl) {
         if( gl.isGLES2() ) {
@@ -902,7 +902,7 @@ public class ShaderCode {
         }
         return requiresGL3DefaultPrecision(gl);
     }
-    
+
     /** Returns true, if GL3 GLSL version requires default precision, i.e. GLSL [1.30 .. 1.50[. */
     public static final boolean requiresGL3DefaultPrecision(GL2ES2 gl) {
         if( gl.isGL3() ) {
@@ -912,16 +912,16 @@ public class ShaderCode {
             return false;
         }
     }
-    
+
     /**
      * Default customization of this shader source code.
      * <p>
      * Note: The shader source to be edit must be created using a mutable StringBuilder.
      * </p>
-     * @param gl a GL context, which must have been made current once 
+     * @param gl a GL context, which must have been made current once
      * @param preludeVersion if true {@link GLContext#getGLSLVersionString()} is preluded, otherwise not.
-     * @param addDefaultPrecision if <code>true</code> default precision source code line(s) are added, i.e. 
-     *                            {@link #es2_default_precision_vp}, {@link #es2_default_precision_fp}, 
+     * @param addDefaultPrecision if <code>true</code> default precision source code line(s) are added, i.e.
+     *                            {@link #es2_default_precision_vp}, {@link #es2_default_precision_fp},
      *                            {@link #gl3_default_precision_vp_gp}, {@link #gl3_default_precision_fp} or none,
      *                            depending on the {@link GLContext#getGLSLVersionNumber() GLSL version} being used.
      * @return the index after the inserted data, maybe 0 if nothing has be inserted.
@@ -940,13 +940,13 @@ public class ShaderCode {
         }
         return pos;
     }
-        
+
     /**
      * Default customization of this shader source code.
      * <p>
      * Note: The shader source to be edit must be created using a mutable StringBuilder.
      * </p>
-     * @param gl a GL context, which must have been made current once 
+     * @param gl a GL context, which must have been made current once
      * @param preludeVersion if true {@link GLContext#getGLSLVersionString()} is preluded, otherwise not.
      * @param esDefaultPrecision optional default precision source code line(s) preluded if not null and if {@link GL#isGLES()}.
      *        You may use {@link #es2_default_precision_fp} for fragment shader and {@link #es2_default_precision_vp} for vertex shader.
@@ -967,8 +967,8 @@ public class ShaderCode {
             pos = addDefaultShaderPrecision(gl, pos);
         }
         return pos;
-    }    
-    
+    }
+
     //----------------------------------------------------------------------
     // Internals only below this point
     //
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
index 1337a7e2b..d737d6f4e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
@@ -37,7 +37,7 @@ import java.util.Iterator;
 import java.io.PrintStream;
 
 public class ShaderProgram {
-    
+
     public ShaderProgram() {
         id = getNextID();
     }
@@ -111,7 +111,7 @@ public class ShaderProgram {
 
     /**
      * Adds a new shader to this program.
-     * 
+     *
      * <p>This command does not compile and attach the shader,
      * use {@link #add(GL2ES2, ShaderCode)} for this purpose.</p>
      */
@@ -122,7 +122,7 @@ public class ShaderProgram {
     public synchronized boolean contains(ShaderCode shaderCode) {
         return allShaderCode.contains(shaderCode);
     }
-    
+
     /**
      * Warning slow O(n) operation ..
      * @param id
@@ -145,9 +145,9 @@ public class ShaderProgram {
     /**
      * Creates the empty GL program object using {@link GL2ES2#glCreateProgram()},
      * if not already created.
-     *  
+     *
      * @param gl
-     * @return true if shader program is valid, i.e. not zero 
+     * @return true if shader program is valid, i.e. not zero
      */
     public synchronized final boolean init(GL2ES2 gl) {
         if( 0 == shaderProgram ) {
@@ -155,12 +155,12 @@ public class ShaderProgram {
         }
         return 0 != shaderProgram;
     }
-    
+
     /**
      * Adds a new shader to a this non running program.
      *
      * <p>Compiles and attaches the shader, if not done yet.</p>
-     * 
+     *
      * @return true if the shader was successfully added, false if compilation failed.
      */
     public synchronized boolean add(GL2ES2 gl, ShaderCode shaderCode, PrintStream verboseOut) {
@@ -179,11 +179,11 @@ public class ShaderProgram {
     /**
      * Replace a shader in a program and re-links the program.
      *
-     * @param gl 
+     * @param gl
      * @param oldShader   the to be replace Shader
      * @param newShader   the new ShaderCode
      * @param verboseOut  the optional verbose output stream
-     * 
+     *
      * @return true if all steps are valid, shader compilation, attachment and linking; otherwise false.
      *
      * @see ShaderState#glEnableVertexAttribArray
@@ -199,25 +199,25 @@ public class ShaderProgram {
         if(!init(gl) || !newShader.compile(gl, verboseOut)) {
             return false;
         }
-        
+
         boolean shaderWasInUse = inUse();
         if(shaderWasInUse) {
             useProgram(gl, false);
         }
-        
+
         if(null != oldShader && allShaderCode.remove(oldShader)) {
             if(attachedShaderCode.remove(oldShader)) {
                 ShaderUtil.detachShader(gl, shaderProgram, oldShader.shader());
             }
         }
-        
+
         add(newShader);
         if(attachedShaderCode.add(newShader)) {
             ShaderUtil.attachShader(gl, shaderProgram, newShader.shader());
         }
-        
+
         gl.glLinkProgram(shaderProgram);
-        
+
         programLinked = ShaderUtil.isProgramLinkStatusValid(gl, shaderProgram, System.err);
         if ( programLinked && shaderWasInUse )  {
             useProgram(gl, true);
@@ -227,19 +227,19 @@ public class ShaderProgram {
 
     /**
      * Links the shader code to the program.
-     * 
+     *
      * <p>Compiles and attaches the shader code to the program if not done by yet</p>
-     * 
+     *
      * <p>Within this process, all GL resources (shader and program objects) are created if necessary.</p>
-     *  
+     *
      * @param gl
      * @param verboseOut
      * @return true if program was successfully linked and is valid, otherwise false
-     * 
+     *
      * @see #init(GL2ES2)
      */
     public synchronized boolean link(GL2ES2 gl, PrintStream verboseOut) {
-        if( !init(gl) ) { 
+        if( !init(gl) ) {
             programLinked = false; // mark unlinked due to user attempt to [re]link
             return false;
         }
@@ -287,7 +287,7 @@ public class ShaderProgram {
         sb.append("]");
         return sb;
     }
-        
+
     public String toString() {
         return toString(null).toString();
     }
@@ -299,7 +299,7 @@ public class ShaderProgram {
     public synchronized boolean validateProgram(GL2ES2 gl, PrintStream verboseOut) {
         return ShaderUtil.isProgramExecStatusValid(gl, shaderProgram, verboseOut);
     }
-    
+
     public synchronized void useProgram(GL2ES2 gl, boolean on) {
         if(!programLinked) { throw new GLException("Program is not linked"); }
         if(programInUse==on) { return; }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
index 8e7781f07..f60cb6088 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
@@ -48,21 +48,21 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
  * while updating the attribute and uniform locations when switching.
  * <p>
  * This allows seamless switching of programs using <i>almost</i> same data
- * but performing different artifacts. 
+ * but performing different artifacts.
  * </p>
  * <p>
  * A {@link #useProgram(GL2ES2, boolean) used} ShaderState is attached to the current GL context
  * and can be retrieved via {@link #getShaderState(GL)}.
  * </p>
  */
-public class ShaderState {    
+public class ShaderState {
     public static final boolean DEBUG;
-    
+
     static {
         Debug.initSingleton();
         DEBUG = Debug.isPropertyDefined("jogl.debug.GLSLState", true);
     }
-    
+
     public ShaderState() {
     }
 
@@ -80,7 +80,7 @@ public class ShaderState {
     /**
      * Attach user object for the given name to this ShaderState.
      * Returns the previously set object or null.
-     * 
+     *
      * @return the previous mapped object or null if none
      */
     public final Object attachObject(String name, Object obj) {
@@ -89,13 +89,13 @@ public class ShaderState {
 
     /**
      * @param name name of the mapped object to detach
-     * 
+     *
      * @return the previous mapped object or null if none
      */
     public final Object detachObject(String name) {
         return attachedObjectsByString.remove(name);
-    }    
-    
+    }
+
     /**
      * Turns the shader program on or off.<br>
      *
@@ -104,7 +104,7 @@ public class ShaderState {
      * @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
      */
     public synchronized void useProgram(GL2ES2 gl, boolean on) throws GLException {
-        if(null==shaderProgram) { throw new GLException("No program is attached"); }        
+        if(null==shaderProgram) { throw new GLException("No program is attached"); }
         if(on) {
             if(shaderProgram.linked()) {
                 shaderProgram.useProgram(gl, true);
@@ -112,7 +112,7 @@ public class ShaderState {
                     resetAllAttributes(gl);
                     resetAllUniforms(gl);
                 }
-            } else { 
+            } else {
                 if(resetAllShaderData) {
                     setAllAttributes(gl);
                 }
@@ -124,7 +124,7 @@ public class ShaderState {
                     resetAllUniforms(gl);
                 }
             }
-            resetAllShaderData = false;            
+            resetAllShaderData = false;
         } else {
             shaderProgram.useProgram(gl, false);
         }
@@ -141,17 +141,17 @@ public class ShaderState {
     /**
      * Attach or switch a shader program
      *
-     * <p>Attaching a shader program the first time, 
+     * <p>Attaching a shader program the first time,
      * as well as switching to another program on the fly,
      * while managing all attribute and uniform data.</p>
-     * 
+     *
      * <p>[Re]sets all data and use program in case of a program switch.</p>
-     *  
+     *
      * <p>Use program, {@link #useProgram(GL2ES2, boolean)},
      * if <code>enable</code> is <code>true</code>.</p>
-     * 
+     *
      * @return true if shader program was attached, otherwise false (already attached)
-     * 
+     *
      * @throws GLException if program was not linked and linking fails
      */
     public synchronized boolean attachShaderProgram(GL2ES2 gl, ShaderProgram prog, boolean enable) throws GLException {
@@ -161,7 +161,7 @@ public class ShaderState {
             System.err.println("ShaderState: attachShaderProgram: "+curId+" -> "+newId+" (enable: "+enable+")\n\t"+shaderProgram+"\n\t"+prog);
             if(DEBUG) {
                 Thread.dumpStack();
-            }                    
+            }
         }
         if(null!=shaderProgram) {
             if(shaderProgram.equals(prog)) {
@@ -190,7 +190,7 @@ public class ShaderState {
         shaderProgram = prog;
 
         if(null!=shaderProgram) {
-            // [re]set all data and use program if switching program, 
+            // [re]set all data and use program if switching program,
             // or  use program if program is linked
             if(resetAllShaderData || enable) {
                 useProgram(gl, true); // may reset all data
@@ -216,7 +216,7 @@ public class ShaderState {
      */
     public synchronized void destroy(GL2ES2 gl) {
         release(gl, true, true, true);
-        attachedObjectsByString.clear();        
+        attachedObjectsByString.clear();
     }
 
     /**
@@ -242,7 +242,7 @@ public class ShaderState {
         if(destroyBoundAttributes) {
             for(Iterator<GLArrayData> iter = managedAttributes.iterator(); iter.hasNext(); ) {
                 iter.next().destroy(gl);
-            }            
+            }
         }
         releaseAllAttributes(gl);
         releaseAllUniforms(gl);
@@ -258,7 +258,7 @@ public class ShaderState {
     /**
      * Gets the cached location of a shader attribute.
      *
-     * @return -1 if there is no such attribute available, 
+     * @return -1 if there is no such attribute available,
      *         otherwise >= 0
      *
      * @see #bindAttribLocation(GL2ES2, int, String)
@@ -270,7 +270,7 @@ public class ShaderState {
         Integer idx = activeAttribLocationMap.get(name);
         return (null!=idx)?idx.intValue():-1;
     }
-    
+
     /**
      * Get the previous cached vertex attribute data.
      *
@@ -289,27 +289,27 @@ public class ShaderState {
     public GLArrayData getAttribute(String name) {
         return activeAttribDataMap.get(name);
     }
-    
+
     public boolean isActiveAttribute(GLArrayData attribute) {
         return attribute == activeAttribDataMap.get(attribute.getName());
     }
-    
+
     /**
      * Binds or unbinds the {@link GLArrayData} lifecycle to this ShaderState.
-     *  
+     *
      * <p>If an attribute location is cached (ie {@link #bindAttribLocation(GL2ES2, int, String)})
      * it is promoted to the {@link GLArrayData} instance.</p>
-     * 
-     * <p>The attribute will be destroyed with {@link #destroy(GL2ES2)} 
+     *
+     * <p>The attribute will be destroyed with {@link #destroy(GL2ES2)}
      * and it's location will be reset when switching shader with {@link #attachShaderProgram(GL2ES2, ShaderProgram)}.</p>
-     *  
+     *
      * <p>The data will not be transfered to the GPU, use {@link #vertexAttribPointer(GL2ES2, GLArrayData)} additionally.</p>
-     * 
+     *
      * <p>The data will also be {@link GLArrayData#associate(Object, boolean) associated} with this ShaderState.</p>
-     * 
+     *
      * @param attribute the {@link GLArrayData} which lifecycle shall be managed
      * @param own true if <i>owning</i> shall be performs, false if <i>disowning</i>.
-     * 
+     *
      * @see #bindAttribLocation(GL2ES2, int, String)
      * @see #getAttribute(String)
      * @see GLArrayData#associate(Object, boolean)
@@ -326,11 +326,11 @@ public class ShaderState {
         }
         attribute.associate(this, own);
     }
-    
+
     public boolean ownsAttribute(GLArrayData attribute) {
         return managedAttributes.contains(attribute);
     }
-    
+
     /**
      * Binds a shader attribute to a location.
      * Multiple names can be bound to one location.
@@ -339,14 +339,14 @@ public class ShaderState {
      *
      * @throws GLException if no program is attached
      * @throws GLException if the program is already linked
-     * 
+     *
      * @see javax.media.opengl.GL2ES2#glBindAttribLocation(int, int, String)
      * @see #getAttribLocation(GL2ES2, String)
      * @see #getCachedAttribLocation(String)
      */
     public void bindAttribLocation(GL2ES2 gl, int location, String name) {
         if(null==shaderProgram) throw new GLException("No program is attached");
-        if(shaderProgram.linked()) throw new GLException("Program is already linked");        
+        if(shaderProgram.linked()) throw new GLException("Program is already linked");
         final Integer loc = new Integer(location);
         activeAttribLocationMap.put(name, loc);
         gl.glBindAttribLocation(shaderProgram.program(), location, name);
@@ -361,7 +361,7 @@ public class ShaderState {
      *
      * @throws GLException if no program is attached
      * @throws GLException if the program is already linked
-     * 
+     *
      * @see javax.media.opengl.GL2ES2#glBindAttribLocation(int, int, String)
      * @see #getAttribLocation(GL2ES2, String)
      * @see #getCachedAttribLocation(String)
@@ -382,7 +382,7 @@ public class ShaderState {
      * or the GLSL queried via {@link GL2ES2#glGetAttribLocation(int, String)}.<br>
      * The location will be cached.
      *
-     * @return -1 if there is no such attribute available, 
+     * @return -1 if there is no such attribute available,
      *         otherwise >= 0
      * @throws GLException if no program is attached
      * @throws GLException if the program is not linked and no location was cached.
@@ -407,22 +407,22 @@ public class ShaderState {
                 System.err.println("ShaderState: glGetAttribLocation failed, no location for: "+name+", loc: "+location);
                 if(DEBUG) {
                     Thread.dumpStack();
-                }                    
+                }
             }
         }
         return location;
     }
-    
+
     /**
      * Validates and returns the location of a shader attribute.<br>
-     * Uses either the cached value {@link #getCachedAttribLocation(String)} if valid, 
+     * Uses either the cached value {@link #getCachedAttribLocation(String)} if valid,
      * or the GLSL queried via {@link GL2ES2#glGetAttribLocation(int, String)}.<br>
-     * The location will be cached and set in the  
+     * The location will be cached and set in the
      * {@link GLArrayData} object.
      *
-     * @return -1 if there is no such attribute available, 
+     * @return -1 if there is no such attribute available,
      *         otherwise >= 0
-     *         
+     *
      * @throws GLException if no program is attached
      * @throws GLException if the program is not linked and no location was cached.
      *
@@ -451,13 +451,13 @@ public class ShaderState {
                 System.err.println("ShaderState: glGetAttribLocation failed, no location for: "+name+", loc: "+location);
                 if(DEBUG) {
                     Thread.dumpStack();
-                }                    
+                }
             }
-        }        
+        }
         activeAttribDataMap.put(data.getName(), data);
         return location;
     }
-    
+
     //
     // Enabled Vertex Arrays and its data
     //
@@ -469,14 +469,14 @@ public class ShaderState {
         final Boolean v = activedAttribEnabledMap.get(name);
         return null != v && v.booleanValue();
     }
-    
+
     /**
      * @return true if the {@link GLArrayData} attribute is enable
      */
     public final boolean isVertexAttribArrayEnabled(GLArrayData data) {
         return isVertexAttribArrayEnabled(data.getName());
     }
-    
+
     private boolean enableVertexAttribArray(GL2ES2 gl, String name, int location) {
         activedAttribEnabledMap.put(name, Boolean.TRUE);
         if(0>location) {
@@ -486,7 +486,7 @@ public class ShaderState {
                     System.err.println("ShaderState: glEnableVertexAttribArray failed, no index for: "+name);
                     if(DEBUG) {
                         Thread.dumpStack();
-                    }                    
+                    }
                 }
                 return false;
             }
@@ -497,12 +497,12 @@ public class ShaderState {
         gl.glEnableVertexAttribArray(location);
         return true;
     }
-    
+
     /**
      * Enables a vertex attribute array.
-     * 
+     *
      * This method retrieves the the location via {@link #getAttribLocation(GL2ES2, GLArrayData)}
-     * hence {@link #enableVertexAttribArray(GL2ES2, GLArrayData)} shall be preferred. 
+     * hence {@link #enableVertexAttribArray(GL2ES2, GLArrayData)} shall be preferred.
      *
      * Even if the attribute is not found in the current shader,
      * it is marked enabled in this state.
@@ -510,7 +510,7 @@ public class ShaderState {
      * @return false, if the name is not found, otherwise true
      *
      * @throws GLException if the program is not linked and no location was cached.
-     * 
+     *
      * @see #glEnableVertexAttribArray
      * @see #glDisableVertexAttribArray
      * @see #glVertexAttribPointer
@@ -519,7 +519,7 @@ public class ShaderState {
     public boolean enableVertexAttribArray(GL2ES2 gl, String name) {
         return enableVertexAttribArray(gl, name, -1);
     }
-    
+
 
     /**
      * Enables a vertex attribute array, usually invoked by {@link GLArrayDataEditable#enableBuffer(GL, boolean)}.
@@ -528,7 +528,7 @@ public class ShaderState {
      * and is the preferred alternative to {@link #enableVertexAttribArray(GL2ES2, String)}.
      * If data location is unset it will be retrieved via {@link #getAttribLocation(GL2ES2, GLArrayData)} set
      * and cached in this state.
-     *  
+     *
      * Even if the attribute is not found in the current shader,
      * it is marked enabled in this state.
      *
@@ -547,11 +547,11 @@ public class ShaderState {
             getAttribLocation(gl, data);
         } else {
             // ensure data is the current bound one
-            activeAttribDataMap.put(data.getName(), data);             
+            activeAttribDataMap.put(data.getName(), data);
         }
         return enableVertexAttribArray(gl, data.getName(), data.getLocation());
     }
-    
+
     private boolean disableVertexAttribArray(GL2ES2 gl, String name, int location) {
         activedAttribEnabledMap.put(name, Boolean.FALSE);
         if(0>location) {
@@ -572,13 +572,13 @@ public class ShaderState {
         gl.glDisableVertexAttribArray(location);
         return true;
     }
-    
+
     /**
      * Disables a vertex attribute array
      *
      * This method retrieves the the location via {@link #getAttribLocation(GL2ES2, GLArrayData)}
      * hence {@link #disableVertexAttribArray(GL2ES2, GLArrayData)} shall be preferred.
-     *  
+     *
      * Even if the attribute is not found in the current shader,
      * it is removed from this state enabled list.
      *
@@ -603,7 +603,7 @@ public class ShaderState {
      * and is the preferred alternative to {@link #disableVertexAttribArray(GL2ES2, String)}.
      * If data location is unset it will be retrieved via {@link #getAttribLocation(GL2ES2, GLArrayData)} set
      * and cached in this state.
-     *  
+     *
      * Even if the attribute is not found in the current shader,
      * it is removed from this state enabled list.
      *
@@ -623,20 +623,20 @@ public class ShaderState {
         }
         return disableVertexAttribArray(gl, data.getName(), data.getLocation());
     }
-    
+
     /**
      * Set the {@link GLArrayData} vertex attribute data, if it's location is valid, i.e. &ge; 0.
      * <p>
      * This method uses the {@link GLArrayData}'s location if valid, i.e. &ge; 0.<br/>
-     * If data's location is invalid, it will be retrieved via {@link #getAttribLocation(GL2ES2, GLArrayData)}, 
+     * If data's location is invalid, it will be retrieved via {@link #getAttribLocation(GL2ES2, GLArrayData)},
      * set and cached in this state.
      * </p>
-     * 
+     *
      * @return false, if the location could not be determined, otherwise true
      *
      * @throws GLException if no program is attached
      * @throws GLException if the program is not linked and no location was cached.
-     * 
+     *
      * @see #glEnableVertexAttribArray
      * @see #glDisableVertexAttribArray
      * @see #glVertexAttribPointer
@@ -646,7 +646,7 @@ public class ShaderState {
         int location = data.getLocation();
         if(0 > location) {
             location = getAttribLocation(gl, data);
-        } 
+        }
         if(0 <= location) {
             // only pass the data, if the attribute exists in the current shader
             if(DEBUG) {
@@ -683,16 +683,16 @@ public class ShaderState {
         activeAttribDataMap.clear();
         activedAttribEnabledMap.clear();
         activeAttribLocationMap.clear();
-        managedAttributes.clear();        
+        managedAttributes.clear();
     }
-        
+
     /**
      * Disables all vertex attribute arrays.
      *
      * Their enabled stated will be removed from this state only
      * if 'removeFromState' is true.
      *
-     * This method purpose is more for debugging. 
+     * This method purpose is more for debugging.
      *
      * @see #glEnableVertexAttribArray
      * @see #glDisableVertexAttribArray
@@ -717,7 +717,7 @@ public class ShaderState {
     }
 
     private final void relocateAttribute(GL2ES2 gl, GLArrayData attribute) {
-        // get new location .. note: 'activeAttribLocationMap' is cleared before 
+        // get new location .. note: 'activeAttribLocationMap' is cleared before
         final String name = attribute.getName();
         final int loc = attribute.setLocation(gl, shaderProgram.program());
         if(0<=loc) {
@@ -729,34 +729,34 @@ public class ShaderState {
                 // enable attrib, VBO and pass location/data
                 gl.glEnableVertexAttribArray(loc);
             }
-    
+
             if( attribute.isVBO() ) {
                 gl.glBindBuffer(GL.GL_ARRAY_BUFFER, attribute.getVBOName());
                 gl.glVertexAttribPointer(attribute);
                 gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
-            } else {   
+            } else {
                 gl.glVertexAttribPointer(attribute);
             }
         }
     }
-    
+
     /**
      * Reset all previously enabled mapped vertex attribute data.
-     * 
+     *
      * <p>
      * Attribute data is bound to the GL state, i.e. VBO data itself will not be updated.
      * </p>
-     * 
+     *
      * <p>
      * Attribute location and it's data assignment is bound to the program,
      * hence both are updated.
      * </p>
-     * 
+     *
      * <p>
-     * Note: Such update could only be prevented, 
+     * Note: Such update could only be prevented,
      * if tracking am attribute/program dirty flag.
      * </p>
-     * 
+     *
      * @throws GLException is the program is not linked
      *
      * @see #attachShaderProgram(GL2ES2, ShaderProgram)
@@ -764,7 +764,7 @@ public class ShaderState {
     private final void resetAllAttributes(GL2ES2 gl) {
         if(!shaderProgram.linked()) throw new GLException("Program is not linked");
         activeAttribLocationMap.clear();
-        
+
         for(int i=0; i<managedAttributes.size(); i++) {
             ((GLArrayData)managedAttributes.get(i)).setLocation(-1);
         }
@@ -780,22 +780,22 @@ public class ShaderState {
 
         if(0<=loc) {
             bindAttribLocation(gl, loc, name);
-            
+
             if(isVertexAttribArrayEnabled(name)) {
                 // enable attrib, VBO and pass location/data
                 gl.glEnableVertexAttribArray(loc);
             }
-    
+
             if( attribute.isVBO() ) {
                 gl.glBindBuffer(GL.GL_ARRAY_BUFFER, attribute.getVBOName());
                 gl.glVertexAttribPointer(attribute);
                 gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
-            } else {   
+            } else {
                 gl.glVertexAttribPointer(attribute);
             }
         }
     }
-    
+
     /**
      * preserves the attribute location .. (program not linked)
      */
@@ -812,7 +812,7 @@ public class ShaderState {
     /**
      * Gets the cached location of the shader uniform.
      *
-     * @return -1 if there is no such uniform available, 
+     * @return -1 if there is no such uniform available,
      *         otherwise >= 0
      */
     public final int getCachedUniformLocation(String name) {
@@ -822,38 +822,38 @@ public class ShaderState {
 
     /**
      * Bind the {@link GLUniform} lifecycle to this ShaderState.
-     *  
+     *
      * <p>If a uniform location is cached it is promoted to the {@link GLUniformData} instance.</p>
-     * 
-     * <p>The attribute will be destroyed with {@link #destroy(GL2ES2)} 
+     *
+     * <p>The attribute will be destroyed with {@link #destroy(GL2ES2)}
      * and it's location will be reset when switching shader with {@link #attachShaderProgram(GL2ES2, ShaderProgram)}.</p>
-     *  
+     *
      * <p>The data will not be transfered to the GPU, use {@link #uniform(GL2ES2, GLUniformData)} additionally.</p>
-     * 
+     *
      * @param uniform the {@link GLUniformData} which lifecycle shall be managed
-     * 
+     *
      * @see #getUniform(String)
      */
     public void ownUniform(GLUniformData uniform) {
         final int location = getCachedUniformLocation(uniform.getName());
         if(0<=location) {
             uniform.setLocation(location);
-        }        
+        }
         activeUniformDataMap.put(uniform.getName(), uniform);
-        managedUniforms.add(uniform);        
+        managedUniforms.add(uniform);
     }
-    
+
     public boolean ownsUniform(GLUniformData uniform) {
         return managedUniforms.contains(uniform);
     }
-    
+
     /**
      * Gets the location of a shader uniform with given <code>name</code>.<br>
      * Uses either the cached value {@link #getCachedUniformLocation(String)} if valid,
      * or the GLSL queried via {@link GL2ES2#glGetUniformLocation(int, String)}.<br>
      * The location will be cached.
      * <p>
-     * The current shader program ({@link #attachShaderProgram(GL2ES2, ShaderProgram)}) 
+     * The current shader program ({@link #attachShaderProgram(GL2ES2, ShaderProgram)})
      * must be in use ({@link #useProgram(GL2ES2, boolean) }) !</p>
      *
      * @return -1 if there is no such attribute available,
@@ -884,15 +884,15 @@ public class ShaderState {
         }
         return location;
     }
-   
+
     /**
      * Validates and returns the location of a shader uniform.<br>
      * Uses either the cached value {@link #getCachedUniformLocation(String)} if valid,
      * or the GLSL queried via {@link GL2ES2#glGetUniformLocation(int, String)}.<br>
-     * The location will be cached and set in the  
+     * The location will be cached and set in the
      * {@link GLUniformData} object.
      * <p>
-     * The current shader program ({@link #attachShaderProgram(GL2ES2, ShaderProgram)}) 
+     * The current shader program ({@link #attachShaderProgram(GL2ES2, ShaderProgram)})
      * must be in use ({@link #useProgram(GL2ES2, boolean) }) !</p>
      *
      * @return -1 if there is no such attribute available,
@@ -922,16 +922,16 @@ public class ShaderState {
                     Thread.dumpStack();
                 }
             }
-        }        
-        activeUniformDataMap.put(name, data);        
+        }
+        activeUniformDataMap.put(name, data);
         return location;
     }
-    
+
     /**
      * Set the uniform data, if it's location is valid, i.e. &ge; 0.
      * <p>
      * This method uses the {@link GLUniformData}'s location if valid, i.e. &ge; 0.<br/>
-     * If data's location is invalid, it will be retrieved via {@link #getUniformLocation(GL2ES2, GLUniformData)}, 
+     * If data's location is invalid, it will be retrieved via {@link #getUniformLocation(GL2ES2, GLUniformData)},
      * set and cached in this state.
      * </p>
      *
@@ -959,7 +959,7 @@ public class ShaderState {
         }
         return false;
     }
-    
+
     /**
      * Get the uniform data, previously set.
      *
@@ -978,7 +978,7 @@ public class ShaderState {
         activeUniformLocationMap.clear();
         managedUniforms.clear();
     }
-        
+
     /**
      * Reset all previously mapped uniform data
      * <p>
@@ -986,20 +986,20 @@ public class ShaderState {
      * hence both are updated.
      * </p>
      * <p>
-     * Note: Such update could only be prevented, 
+     * Note: Such update could only be prevented,
      * if tracking a uniform/program dirty flag.
      * </p>
-     * 
+     *
      * @throws GLException is the program is not in use
-     * 
+     *
      * @see #attachShaderProgram(GL2ES2, ShaderProgram)
      */
     private final void resetAllUniforms(GL2ES2 gl) {
-        if(!shaderProgram.inUse()) throw new GLException("Program is not in use");        
+        if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
         activeUniformLocationMap.clear();
         for(Iterator<GLUniformData> iter = managedUniforms.iterator(); iter.hasNext(); ) {
             iter.next().setLocation(-1);
-        }        
+        }
         for(Iterator<GLUniformData> iter = activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
             final GLUniformData data = iter.next();
             final int loc = data.setLocation(gl, shaderProgram.program());
@@ -1018,9 +1018,9 @@ public class ShaderState {
         if(null==sb) {
             sb = new StringBuilder();
         }
-        
+
         sb.append("ShaderState[ ");
-        
+
         sb.append(Platform.getNewline()).append(" ");
         if(null != shaderProgram) {
             shaderProgram.toString(sb);
@@ -1066,25 +1066,25 @@ public class ShaderState {
         sb.append(Platform.getNewline()).append(" ]").append(Platform.getNewline()).append("]");
         return sb;
     }
-    
+
     @Override
     public String toString() {
         return toString(null, DEBUG).toString();
     }
-    
+
     private boolean verbose = DEBUG;
     private ShaderProgram shaderProgram=null;
-    
+
     private HashMap<String, Boolean> activedAttribEnabledMap = new HashMap<String, Boolean>();
     private HashMap<String, Integer> activeAttribLocationMap = new HashMap<String, Integer>();
     private HashMap<String, GLArrayData> activeAttribDataMap = new HashMap<String, GLArrayData>();
     private ArrayList<GLArrayData> managedAttributes = new ArrayList<GLArrayData>();
-    
+
     private HashMap<String, Integer> activeUniformLocationMap = new HashMap<String, Integer>();
     private HashMap<String, GLUniformData> activeUniformDataMap = new HashMap<String, GLUniformData>();
     private ArrayList<GLUniformData> managedUniforms = new ArrayList<GLUniformData>();
-    
-    private HashMap<String, Object> attachedObjectsByString = new HashMap<String, Object>();    
+
+    private HashMap<String, Object> attachedObjectsByString = new HashMap<String, Object>();
     private boolean resetAllShaderData = false;
 }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
index d18fd4bae..5cd384c58 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,7 +28,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.opengl.util.glsl;
@@ -117,11 +117,11 @@ public class ShaderUtil {
         }
         return true;
     }
-    
+
     /**
      * Performs {@link GL2ES2#glValidateProgram(int)}
      * <p>
-     * One shall only call this method while debugging and only if all required 
+     * One shall only call this method while debugging and only if all required
      * resources by the shader are set.
      * </p>
      * <p>
@@ -150,7 +150,7 @@ public class ShaderUtil {
     }
 
     /**
-     * If supported, queries the natively supported shader binary formats using 
+     * If supported, queries the natively supported shader binary formats using
      * {@link GL2ES2#GL_NUM_SHADER_BINARY_FORMATS} and {@link GL2ES2#GL_SHADER_BINARY_FORMATS}
      * via {@link GL2ES2#glGetIntegerv(int, int[], int)}.
      */
@@ -172,9 +172,9 @@ public class ShaderUtil {
                             info.shaderBinaryFormats.add(new Integer(formats[i]));
                         }
                     }
-                } catch (GLException gle) { 
-                    System.err.println("Catched Exception on thread "+Thread.currentThread().getName()); 
-                    gle.printStackTrace(); 
+                } catch (GLException gle) {
+                    System.err.println("Catched Exception on thread "+Thread.currentThread().getName());
+                    gle.printStackTrace();
                 }
             }
         }
@@ -202,13 +202,13 @@ public class ShaderUtil {
                     }
                     info.shaderCompilerAvailable = new Boolean(v);
                     queryOK = true;
-                } catch (GLException gle) { 
-                    System.err.println("Catched Exception on thread "+Thread.currentThread().getName()); 
-                    gle.printStackTrace(); 
+                } catch (GLException gle) {
+                    System.err.println("Catched Exception on thread "+Thread.currentThread().getName());
+                    gle.printStackTrace();
                 }
                 if(!queryOK) {
                     info.shaderCompilerAvailable = new Boolean(true);
-                }                
+                }
             } else if( gl.isGL2ES2() ) {
                 info.shaderCompilerAvailable = new Boolean(true);
             } else {
@@ -217,8 +217,8 @@ public class ShaderUtil {
         }
         return info.shaderCompilerAvailable.booleanValue();
     }
-    
-    /** Returns true if GeometryShader is supported, i.e. whether GLContext is &ge; 3.2 or ARB_geometry_shader4 extension is available. */ 
+
+    /** Returns true if GeometryShader is supported, i.e. whether GLContext is &ge; 3.2 or ARB_geometry_shader4 extension is available. */
     public static boolean isGeometryShaderSupported(GL _gl) {
       final GLContext ctx = _gl.getContext();
       return ctx.getGLVersionNumber().compareTo(GLContext.Version320) >= 0 ||
@@ -240,7 +240,7 @@ public class ShaderUtil {
         IntBuffer lengths = Buffers.newDirectIntBuffer(count);
         for(int i=0; i<count; i++) {
             lengths.put(i, source[i].length());
-        }        
+        }
         if(source instanceof String[]) {
             // rare case ..
             gl.glShaderSource(shader, count, (String[])source, lengths);
@@ -338,7 +338,7 @@ public class ShaderUtil {
         }
 
         createShader(gl, shaderType, shader);
-        err = gl.glGetError(); 
+        err = gl.glGetError();
         if(err!=GL.GL_NO_ERROR) {
             throw new GLException("createAndLoadShader: CreateShader failed, GL Error: 0x"+Integer.toHexString(err));
         }
@@ -353,7 +353,7 @@ public class ShaderUtil {
     }
 
     public static boolean createAndCompileShader(GL _gl, IntBuffer shader, int shaderType,
-                                                 CharSequence[][] sources, 
+                                                 CharSequence[][] sources,
                                                  PrintStream verboseOut)
     {
         final GL2ES2 gl = _gl.getGL2ES2();
@@ -363,32 +363,32 @@ public class ShaderUtil {
         }
 
         createShader(gl, shaderType, shader);
-        err = gl.glGetError(); 
+        err = gl.glGetError();
         if(err!=GL.GL_NO_ERROR) {
             throw new GLException("createAndCompileShader: CreateShader failed, GL Error: 0x"+Integer.toHexString(err));
         }
 
         shaderSource(gl, shader, sources);
-        err = gl.glGetError(); 
+        err = gl.glGetError();
         if(err!=GL.GL_NO_ERROR) {
             throw new GLException("createAndCompileShader: ShaderSource failed, GL Error: 0x"+Integer.toHexString(err));
         }
 
         compileShader(gl, shader);
-        err = gl.glGetError(); 
+        err = gl.glGetError();
         if(err!=GL.GL_NO_ERROR && null!=verboseOut) {
             verboseOut.println("createAndCompileShader: CompileShader failed, GL Error: 0x"+Integer.toHexString(err));
         }
 
         return isShaderStatusValid(gl, shader, GL2ES2.GL_COMPILE_STATUS, verboseOut) && err == GL.GL_NO_ERROR;
     }
-    
+
     private static final String implObjectKey = "com.jogamp.opengl.util.glsl.ShaderUtil" ;
-    
+
     private static class ProfileInformation {
         Boolean shaderCompilerAvailable = null;
         Set<Integer> shaderBinaryFormats = null;
-    }    
+    }
 
     private static ProfileInformation getProfileInformation(GL gl) {
         final GLContext context = gl.getContext();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
index a653bd467..2f8884a3a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
@@ -24,13 +24,13 @@ import com.jogamp.opengl.util.PMVMatrix;
 public class FixedFuncUtil {
     /**
      * @param gl
-     * @param mode one of the {@link ShaderSelectionMode}s 
+     * @param mode one of the {@link ShaderSelectionMode}s
      * @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline}
      * @return If gl is a GL2ES1 and force is false, return the type cast object,
      *         otherwise create a fixed function emulation pipeline using the given GL2ES2 impl
      *         and hook it to the GLContext via {@link GLContext#setGL(GL)}.
      * @throws GLException if the GL object is neither GL2ES1 nor GL2ES2
-     * 
+     *
      * @see ShaderSelectionMode#AUTO
      * @see ShaderSelectionMode#COLOR
      * @see ShaderSelectionMode#COLOR_LIGHT_PER_VERTEX
@@ -53,13 +53,13 @@ public class FixedFuncUtil {
 
     /**
      * @param gl
-     * @param mode one of the {@link ShaderSelectionMode}s 
+     * @param mode one of the {@link ShaderSelectionMode}s
      * @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline}
      * @return If gl is a GL2ES1, return the type cast object,
      *         otherwise create a fixed function emulation pipeline using the GL2ES2 impl.
      *         and hook it to the GLContext via {@link GLContext#setGL(GL)}.
      * @throws GLException if the GL object is neither GL2ES1 nor GL2ES2
-     * 
+     *
      * @see ShaderSelectionMode#AUTO
      * @see ShaderSelectionMode#COLOR
      * @see ShaderSelectionMode#COLOR_LIGHT_PER_VERTEX
@@ -71,11 +71,11 @@ public class FixedFuncUtil {
     }
 
     /**
-     * Mapping fixed function (client) array indices to 
+     * Mapping fixed function (client) array indices to
      * GLSL array attribute names.
      *
      * Useful for uniq mapping of canonical array index names as listed.
-     * 
+     *
      * @see #mgl_Vertex
      * @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_VERTEX_ARRAY
      * @see #mgl_Normal
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/ShaderSelectionMode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/ShaderSelectionMode.java
index e6bdf702c..426fb0d85 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/ShaderSelectionMode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/ShaderSelectionMode.java
@@ -1,8 +1,8 @@
 package com.jogamp.opengl.util.glsl.fixedfunc;
 
-/** 
+/**
  * Shader selection mode
- * 
+ *
  * @see ShaderSelectionMode#AUTO
  * @see ShaderSelectionMode#COLOR
  * @see ShaderSelectionMode#COLOR_LIGHT_PER_VERTEX
@@ -11,17 +11,17 @@ package com.jogamp.opengl.util.glsl.fixedfunc;
  */
 public enum ShaderSelectionMode {
     /** Auto shader selection, based upon FFP states. */
-    AUTO, 
+    AUTO,
     /** Fixed shader selection: Simple color. */
-    COLOR, 
+    COLOR,
     /** Fixed shader selection: Multi-Textured color. 2 texture units. */
-    COLOR_TEXTURE2, 
+    COLOR_TEXTURE2,
     /** Fixed shader selection: Multi-Textured color. 4 texture units. */
-    COLOR_TEXTURE4, 
+    COLOR_TEXTURE4,
     /** Fixed shader selection: Multi-Textured color. 8 texture units. */
-    COLOR_TEXTURE8, 
+    COLOR_TEXTURE8,
     /** Fixed shader selection: Color with vertex-lighting. */
-    COLOR_LIGHT_PER_VERTEX, 
+    COLOR_LIGHT_PER_VERTEX,
     /** Fixed shader selection: Multi-Textured color with vertex-lighting. 8 texture units.*/
-    COLOR_TEXTURE8_LIGHT_PER_VERTEX 
+    COLOR_TEXTURE8_LIGHT_PER_VERTEX
 }
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
index a5b1c6687..9573ea5c3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
@@ -55,8 +55,8 @@ public abstract class CompileShader {
         URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
         String dirName = dirname(resourceURL.getPath());
 
-        outName = dirName + File.separator + "bin" + File.separator + 
-                  ShaderCode.getBinarySubPath(getBinaryFormat()) + File.separator + 
+        outName = dirName + File.separator + "bin" + File.separator +
+                  ShaderCode.getBinarySubPath(getBinaryFormat()) + File.separator +
                   outName;
         processOneShader(resourceName, outName, type);
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java
index 7b6a1b479..c1b5025f8 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
index 5ba3f7330..44b4fea9e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -128,7 +128,7 @@ public class Level {
           candidate.setSize(candidate.w() - rect.w(), height);
           freeList.add(candidate);
         }
-        
+
         coalesceFreeList();
 
         return true;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
index 6783aec3b..e14eef5ba 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -108,7 +108,7 @@ public class LevelSet {
       if (level.remove(rect))
         return true;
     }
-    
+
     return false;
   }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
index 6206c4a11..23f143b83 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -72,7 +72,7 @@ public class Rect {
   // there is no room left due either to fragmentation or just being
   // out of space)
   private Rect nextLocation;
-  
+
   public Rect() {
     this(null);
   }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java
index 49cfc82e6..5db216742 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
index 1496a04a6..a9d609745 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -203,7 +203,7 @@ public class RectanglePacker {
       }
 
       nextLevelSet = new LevelSet(newWidth, newHeight);
-      
+
       // Make copies of all existing rectangles
       List/*<Rect>*/ newRects = new ArrayList/*<Rect>*/();
       for (Iterator i1 = levels.iterator(); i1.hasNext(); ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
index 4236e22fb..fd026d76e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -53,8 +53,8 @@ import com.jogamp.opengl.util.texture.spi.*;
  * for enabling/disabling OpenGL texture state, binding this texture,
  * and computing texture coordinates for both the entire image as well
  * as a sub-image.
- * 
- * <a name="textureCallOrder"><h5>Order of Texture Commands</h5></a> 
+ *
+ * <a name="textureCallOrder"><h5>Order of Texture Commands</h5></a>
  * <p>
  * Due to many confusions w/ texture usage, following list described the order
  * and semantics of texture unit selection, binding and enabling.
@@ -67,16 +67,16 @@ import com.jogamp.opengl.util.texture.spi.*;
  *   <li>Issue draw commands</li>
  * </ul>
  * </p>
- * 
+ *
  * <p><a name="nonpow2"><b>Non-power-of-two restrictions</b></a>
  * <br> When creating an OpenGL texture object, the Texture class will
  * attempt to use <i>non-power-of-two textures</i> (NPOT) if available, see {@link GL#isNPOTTextureAvailable()}.
- * Further more, 
+ * Further more,
  * <a href="http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt">GL_ARB_texture_rectangle</a>
  * (RECT) will be attempted on OSX w/ ATI drivers.
  * If NPOT is not available or RECT not chosen, the Texture class will simply upload a non-pow2-sized
  * image into a standard pow2-sized texture (without any special
- * scaling).  
+ * scaling).
  * Since the choice of extension (or whether one is used at
  * all) depends on the user's machine configuration, developers are
  * recommended to use {@link #getImageTexCoords} and {@link
@@ -106,7 +106,7 @@ import com.jogamp.opengl.util.texture.spi.*;
  * #bind}, but when drawing many triangles all using the same texture,
  * for best performance only one call to {@link #bind} should be made.
  * User may also utilize multiple texture units,
- * see <a href="#textureCallOrder"> order of texture commands above</a>. 
+ * see <a href="#textureCallOrder"> order of texture commands above</a>.
  *
  * <p><a name="premult"><b>Alpha premultiplication and blending</b></a>
  * <p>
@@ -119,7 +119,7 @@ import com.jogamp.opengl.util.texture.spi.*;
  * <p>
  * The mathematically correct way to perform blending in OpenGL
  * with the SrcOver "source over destination" mode, or any other
- * Porter-Duff rule, is to use <i>premultiplied color components</i>, 
+ * Porter-Duff rule, is to use <i>premultiplied color components</i>,
  * which means the R/G/ B color components must have been multiplied by
  * the alpha value.  If using <i>premultiplied color components</i>
  * it is important to use the correct blending function; for
@@ -137,7 +137,7 @@ import com.jogamp.opengl.util.texture.spi.*;
     float g = g * a;
     float b = b * a;
     gl.glColor4f(r, g, b, a);
-</pre> 
+</pre>
  *
  * For reference, here is a list of the Porter-Duff compositing rules
  * and the associated OpenGL blend functions (source and destination
@@ -187,8 +187,8 @@ public class Texture {
 
     /** The texture coordinates corresponding to the entire image. */
     private TextureCoords coords;
-    
-    public String toString() { 
+
+    public String toString() {
         return "Texture[target 0x"+Integer.toHexString(target)+", name "+texID+", "+
                 imgWidth+"/"+texWidth+" x "+imgHeight+"/"+texHeight+", y-flip "+mustFlipVertically+
                 ", "+estimatedMemorySize+" bytes]";
@@ -237,7 +237,7 @@ public class Texture {
      *   gl.glEnable(texture.getTarget());
      * </pre>
      * <p>
-     * Call is ignored if the {@link GL} object's context 
+     * Call is ignored if the {@link GL} object's context
      * is using a core profile, see {@link GL#isGLcore()},
      * or if {@link #getTarget()} is {@link GLES2#GL_TEXTURE_EXTERNAL_OES}.
      * </p>
@@ -255,7 +255,7 @@ public class Texture {
             gl.glEnable(target);
         }
     }
-    
+
     /**
      * Disables this texture's target (e.g., GL_TEXTURE_2D) in the
      * given GL state. This method is a shorthand equivalent
@@ -264,7 +264,7 @@ public class Texture {
      *   gl.glDisable(texture.getTarget());
      * </pre>
      * <p>
-     * Call is ignored if the {@link GL} object's context 
+     * Call is ignored if the {@link GL} object's context
      * is using a core profile, see {@link GL#isGLcore()},
      * or if {@link #getTarget()} is {@link GLES2#GL_TEXTURE_EXTERNAL_OES}.
      * </p>
@@ -282,7 +282,7 @@ public class Texture {
             gl.glDisable(target);
         }
     }
-    
+
     /**
      * Binds this texture to the given GL context. This method is a
      * shorthand equivalent of the following OpenGL code:
@@ -292,16 +292,16 @@ public class Texture {
      *
      * See the <a href="#perftips">performance tips</a> above for hints
      * on how to maximize performance when using many Texture objects.
-     * 
+     *
      * @param gl the current GL context
      * @throws GLException if no OpenGL context was current or if any
      * OpenGL-related errors occurred
      */
     public void bind(GL gl) throws GLException {
         validateTexID(gl, true);
-        gl.glBindTexture(target, texID); 
+        gl.glBindTexture(target, texID);
     }
-    
+
     /**
      * Destroys the native resources used by this texture object.
      *
@@ -335,7 +335,7 @@ public class Texture {
     public int getWidth() {
         return texWidth;
     }
-    
+
     /**
      * Returns the height of the allocated OpenGL texture in pixels.
      * Note that the texture height will be greater than or equal to the
@@ -345,9 +345,9 @@ public class Texture {
      */
     public int getHeight() {
         return texHeight;
-    }   
-    
-    /** 
+    }
+
+    /**
      * Returns the width of the image contained within this texture.
      * Note that for non-power-of-two textures in particular this may
      * not be equal to the result of {@link #getWidth}. It is
@@ -389,7 +389,7 @@ public class Texture {
      * entire image. If the TextureData indicated that the texture
      * coordinates must be flipped vertically, the returned
      * TextureCoords will take that into account.
-     * 
+     *
      * @return the texture coordinates corresponding to the entire image
      */
     public TextureCoords getImageTexCoords() {
@@ -406,7 +406,7 @@ public class Texture {
      * flipped vertically, the returned TextureCoords will take that
      * into account; this should not be handled by the end user in the
      * specification of the y1 and y2 coordinates.
-     * 
+     *
      * @return the texture coordinates corresponding to the specified sub-image
      */
     public TextureCoords getSubImageTexCoords(int x1, int y1, int x2, int y2) {
@@ -431,9 +431,9 @@ public class Texture {
     }
 
     /**
-     * Updates the entire content area incl. {@link TextureCoords} 
+     * Updates the entire content area incl. {@link TextureCoords}
      * of this texture using the data in the given image.
-     * 
+     *
      * @throws GLException if any OpenGL-related errors occurred
      */
     public void updateImage(GL gl, TextureData data) throws GLException {
@@ -465,12 +465,12 @@ public class Texture {
             updateTexCoords();
         }
     }
-    
+
     /**
      * Updates the content area incl. {@link TextureCoords} of the specified target of this texture
      * using the data in the given image. In general this is intended
      * for construction of cube maps.
-     * 
+     *
      * @throws GLException if any OpenGL-related errors occurred
      */
     public void updateImage(GL gl, TextureData data, int targetOverride) throws GLException {
@@ -791,7 +791,7 @@ public class Texture {
      * texture's target. This gives control over parameters such as
      * GL_TEXTURE_MAX_ANISOTROPY_EXT. Causes this texture to be bound to
      * the current texture state.
-     * 
+     *
      * @throws GLException if no OpenGL context was current or if any
      * OpenGL-related errors occurred
      */
@@ -805,7 +805,7 @@ public class Texture {
      * Sets the OpenGL multi-floating-point texture parameter for the
      * texture's target. Causes this texture to be bound to the current
      * texture state.
-     * 
+     *
      * @throws GLException if any OpenGL-related errors occurred
      */
     public void setTexParameterfv(GL gl, int parameterName,
@@ -818,7 +818,7 @@ public class Texture {
      * Sets the OpenGL multi-floating-point texture parameter for the
      * texture's target. Causes this texture to be bound to the current
      * texture state.
-     * 
+     *
      * @throws GLException if any OpenGL-related errors occurred
      */
     public void setTexParameterfv(GL gl, int parameterName,
@@ -834,7 +834,7 @@ public class Texture {
      * to GL_CLAMP_TO_EDGE if OpenGL 1.2 is supported on the current
      * platform and GL_CLAMP if not. Causes this texture to be bound to
      * the current texture state.
-     * 
+     *
      * @throws GLException if any OpenGL-related errors occurred
      */
     public void setTexParameteri(GL gl, int parameterName,
@@ -847,7 +847,7 @@ public class Texture {
      * Sets the OpenGL multi-integer texture parameter for the texture's
      * target. Causes this texture to be bound to the current texture
      * state.
-     * 
+     *
      * @throws GLException if any OpenGL-related errors occurred
      */
     public void setTexParameteriv(GL gl, int parameterName,
@@ -860,7 +860,7 @@ public class Texture {
      * Sets the OpenGL multi-integer texture parameter for the texture's
      * target. Causes this texture to be bound to the current texture
      * state.
-     * 
+     *
      * @throws GLException if any OpenGL-related errors occurred
      */
     public void setTexParameteriv(GL gl, int parameterName,
@@ -886,7 +886,7 @@ public class Texture {
     }
 
     /**
-     * Returns the underlying OpenGL texture object for this texture, 
+     * Returns the underlying OpenGL texture object for this texture,
      * maybe <code>0</code> if not yet generated.
      * <p>
      * Most applications will not need to access this, since it is
@@ -967,19 +967,19 @@ public class Texture {
             }
         } else {
             if (mustFlipVertically) {
-                coords = new TextureCoords(0,                                      // l 
+                coords = new TextureCoords(0,                                      // l
                                            (float) imgHeight / (float) texHeight,  // b
                                            (float) imgWidth / (float) texWidth,    // r
                                            0                                       // t
                                           );
             } else {
-                coords = new TextureCoords(0,                                      // l 
+                coords = new TextureCoords(0,                                      // l
                                            0,                                      // b
                                            (float) imgWidth / (float) texWidth,    // r
                                            (float) imgHeight / (float) texHeight   // t
                                           );
             }
-        }        
+        }
     }
 
     private void updateSubImageImpl(GL gl, TextureData data, int newTarget, int mipmapLevel,
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
index 3931b7290..63f100630 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -77,7 +77,7 @@ public class TextureCoords {
         d[6+d_off] = right *ss;  d[7+d_off] = top   *ts;
         return d;
     }
-    
+
     /** Returns the leftmost (x) texture coordinate of this
         rectangle. */
     public float left() { return left; }
@@ -93,6 +93,6 @@ public class TextureCoords {
     /** Returns the topmost (y) texture coordinate of this
         rectangle. */
     public float top() { return top; }
-    
+
     public String toString() { return "TexCoord[h: "+left+" - "+right+", v: "+bottom+" - "+top+"]"; }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
index afc5bf70c..28029efc5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -57,8 +57,8 @@ import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
 
 public class TextureData {
     /** ColorSpace of pixel data. */
-    public static enum ColorSpace { RGB, YCbCr, YCCK, CMYK };   
-    
+    public static enum ColorSpace { RGB, YCbCr, YCCK, CMYK };
+
     protected int width;
     protected int height;
     private int border;
@@ -83,7 +83,7 @@ public class TextureData {
     protected GLProfile glProfile;
     protected ColorSpace pixelCS = ColorSpace.RGB;
 
-    /** 
+    /**
      * Constructs a new TextureData object with the specified parameters
      * and data contained in the given Buffer. The optional Flusher can
      * be used to clean up native resources associated with this
@@ -123,7 +123,7 @@ public class TextureData {
      *   data were invalid, such as requesting mipmap generation for a
      *   compressed texture
      */
-    public TextureData(GLProfile glp, 
+    public TextureData(GLProfile glp,
                        int internalFormat,
                        int width,
                        int height,
@@ -135,11 +135,11 @@ public class TextureData {
                        boolean mustFlipVertically,
                        Buffer buffer,
                        Flusher flusher) throws IllegalArgumentException {
-        this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType), 
+        this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
              mipmap, dataIsCompressed, mustFlipVertically, buffer, flusher);
     }
 
-    /** 
+    /**
      * Constructs a new TextureData object with the specified parameters
      * and data contained in the given Buffer. The optional Flusher can
      * be used to clean up native resources associated with this
@@ -178,7 +178,7 @@ public class TextureData {
      *   data were invalid, such as requesting mipmap generation for a
      *   compressed texture
      */
-    public TextureData(GLProfile glp, 
+    public TextureData(GLProfile glp,
                        int internalFormat,
                        int width,
                        int height,
@@ -207,8 +207,8 @@ public class TextureData {
         alignment = 1;  // FIXME: is this correct enough in all situations?
         estimatedMemorySize = estimatedMemorySize(buffer);
     }
-    
-    /** 
+
+    /**
      * Constructs a new TextureData object with the specified parameters
      * and data for multiple mipmap levels contained in the given array
      * of Buffers. The optional Flusher can be used to clean up native
@@ -258,11 +258,11 @@ public class TextureData {
                        boolean mustFlipVertically,
                        Buffer[] mipmapData,
                        Flusher flusher) throws IllegalArgumentException {
-        this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType), 
+        this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
              dataIsCompressed, mustFlipVertically, mipmapData, flusher);
     }
 
-    /** 
+    /**
      * Constructs a new TextureData object with the specified parameters
      * and data for multiple mipmap levels contained in the given array
      * of Buffers. The optional Flusher can be used to clean up native
@@ -325,19 +325,19 @@ public class TextureData {
             estimatedMemorySize += estimatedMemorySize(mipmapData[i]);
         }
     }
-    
-    /** 
+
+    /**
      * Returns the color space of the pixel data.
-     * @see #setColorSpace(ColorSpace) 
+     * @see #setColorSpace(ColorSpace)
      */
     public ColorSpace getColorSpace() { return pixelCS; }
 
-    /** 
+    /**
      * Set the color space of the pixel data, which defaults to {@link ColorSpace#RGB}.
-     * @see #getColorSpace() 
+     * @see #getColorSpace()
      */
     public void setColorSpace(ColorSpace cs) { pixelCS = cs; }
-    
+
     /** Used only by subclasses */
     protected TextureData(GLProfile glp) { this.glProfile = glp; this.pixelAttributes = GLPixelAttributes.UNDEF; }
 
@@ -346,8 +346,8 @@ public class TextureData {
     /** Returns the height in pixels of the texture data. */
     public int getHeight() { return height; }
     /** Returns the border in pixels of the texture data. */
-    public int getBorder() { 
-        return border; 
+    public int getBorder() {
+        return border;
     }
     /** Returns the intended OpenGL {@link GLPixelAttributes} of the texture data, i.e. format and type. */
     public GLPixelAttributes getPixelAttributes() {
@@ -362,21 +362,21 @@ public class TextureData {
         return pixelAttributes.type;
     }
     /** Returns the intended OpenGL internal format of the texture data. */
-    public int getInternalFormat() { 
-        return internalFormat; 
+    public int getInternalFormat() {
+        return internalFormat;
     }
     /** Returns whether mipmaps should be generated for the texture data. */
-    public boolean getMipmap() { 
-        return mipmap; 
+    public boolean getMipmap() {
+        return mipmap;
     }
     /** Indicates whether the texture data is in compressed form. */
-    public boolean isDataCompressed() { 
-        return dataIsCompressed; 
+    public boolean isDataCompressed() {
+        return dataIsCompressed;
     }
     /** Indicates whether the texture coordinates must be flipped
         vertically for proper display. */
-    public boolean getMustFlipVertically() { 
-        return mustFlipVertically; 
+    public boolean getMustFlipVertically() {
+        return mustFlipVertically;
     }
     /** Returns the texture data, or null if it is specified as a set of mipmaps. */
     public Buffer getBuffer() {
@@ -384,18 +384,18 @@ public class TextureData {
     }
     /** Returns all mipmap levels for the texture data, or null if it is
         specified as a single image. */
-    public Buffer[] getMipmapData() { 
-        return mipmapData; 
+    public Buffer[] getMipmapData() {
+        return mipmapData;
     }
     /** Returns the required byte alignment for the texture data. */
-    public int getAlignment() { 
-        return alignment; 
+    public int getAlignment() {
+        return alignment;
     }
     /** Returns the row length needed for correct GL_UNPACK_ROW_LENGTH
         specification. This is currently only supported for
         non-mipmapped, non-compressed textures. */
-    public int getRowLength() { 
-        return rowLength; 
+    public int getRowLength() {
+        return rowLength;
     }
 
     /** Sets the width in pixels of the texture data. */
@@ -405,25 +405,25 @@ public class TextureData {
     /** Sets the border in pixels of the texture data. */
     public void setBorder(int border) { this.border = border; }
     /** Sets the intended OpenGL pixel format of the texture data. */
-    public void setPixelAttributes(GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }     
-    /** 
+    public void setPixelAttributes(GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
+    /**
      * Sets the intended OpenGL pixel format component of {@link GLPixelAttributes} of the texture data.
      * <p>
-     * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type. 
-     * </p> 
+     * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
+     * </p>
      */
     public void setPixelFormat(int pixelFormat) {
         if( pixelAttributes.format != pixelFormat ) {
             pixelAttributes = new GLPixelAttributes(pixelFormat, pixelAttributes.type);
         }
     }
-    /** 
+    /**
      * Sets the intended OpenGL pixel type component of {@link GLPixelAttributes} of the texture data.
      * <p>
-     * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type. 
-     * </p> 
+     * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
+     * </p>
      */
-    public void setPixelType(int pixelType) { 
+    public void setPixelType(int pixelType) {
         if( pixelAttributes.type != pixelType) {
             pixelAttributes = new GLPixelAttributes(pixelAttributes.format, pixelType);
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
index 3748cd336..b6d89d6d2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2011 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -161,11 +161,11 @@ public class TextureIO {
     /** Constant which can be used as a file suffix to indicate a PAM
         file, NetPbm magic 7 - binary RGB and RGBA. Write support only. */
     public static final String PAM     = "pam";
-    
+
     /** Constant which can be used as a file suffix to indicate a PAM
         file, NetPbm magic 6 - binary RGB. Write support only. */
     public static final String PPM     = "ppm";
-    
+
     private static final boolean DEBUG = Debug.debug("TextureIO");
 
     // For manually disabling the use of the texture rectangle
@@ -421,7 +421,7 @@ public class TextureIO {
     // methods that *do* require a current context
     //
 
-    /** 
+    /**
      * Creates an OpenGL texture object from the specified TextureData
      * using the current OpenGL context.
      *
@@ -434,7 +434,7 @@ public class TextureIO {
         return newTexture(GLContext.getCurrentGL(), data);
     }
 
-    /** 
+    /**
      * Creates an OpenGL texture object from the specified TextureData
      * using the given OpenGL context.
      *
@@ -449,8 +449,8 @@ public class TextureIO {
         }
         return new Texture(gl, data);
     }
-    
-    /** 
+
+    /**
      * Creates an OpenGL texture object from the specified file using
      * the current OpenGL context.
      *
@@ -474,7 +474,7 @@ public class TextureIO {
         return texture;
     }
 
-    /** 
+    /**
      * Creates an OpenGL texture object from the specified stream using
      * the current OpenGL context.
      *
@@ -503,7 +503,7 @@ public class TextureIO {
         return texture;
     }
 
-    /** 
+    /**
      * Creates an OpenGL texture object from the specified URL using the
      * current OpenGL context.
      *
@@ -535,13 +535,13 @@ public class TextureIO {
         return texture;
     }
 
-    /** 
+    /**
      * Creates an OpenGL texture object associated with the given OpenGL
      * texture target. The texture has
      * no initial data. This is used, for example, to construct cube
      * maps out of multiple TextureData objects.
      *
-     * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D, 
+     * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D,
      *               GL.GL_TEXTURE_RECTANGLE_ARB
      */
     public static Texture newTexture(int target) {
@@ -556,7 +556,7 @@ public class TextureIO {
      * undefined results.
      *
      * @param textureID the OpenGL texture object to wrap
-     * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D, 
+     * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
      *               GL2.GL_TEXTURE_RECTANGLE
      * @param texWidth the width of the texture in pixels
      * @param texHeight the height of the texture in pixels
@@ -689,7 +689,7 @@ public class TextureIO {
             gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
             gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
             gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
-      
+
             data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
                                    false, false, false, res, null);
 
@@ -701,7 +701,7 @@ public class TextureIO {
 
         write(data, file);
     }
-  
+
     public static void write(TextureData data, File file) throws IOException, GLException {
         for (Iterator<TextureWriter> iter = textureWriters.iterator(); iter.hasNext(); ) {
             TextureWriter writer = iter.next();
@@ -712,12 +712,12 @@ public class TextureIO {
 
         throw new IOException("No suitable texture writer found for "+file.getAbsolutePath());
     }
-  
+
     //----------------------------------------------------------------------
     // SPI support
     //
 
-    /** 
+    /**
      * Adds a TextureProvider to support reading of a new file format.
      * <p>
      * The last provider added, will be the first provider to be tested.
@@ -730,7 +730,7 @@ public class TextureIO {
         textureProviders.add(0, provider);
     }
 
-    /** 
+    /**
      * Adds a TextureWriter to support writing of a new file format.
      * <p>
      * The last provider added, will be the first provider to be tested.
@@ -779,7 +779,7 @@ public class TextureIO {
     private static List<TextureProvider> textureProviders = new ArrayList<TextureProvider>();
     private static List<TextureWriter>   textureWriters   = new ArrayList<TextureWriter>();
 
-    static {        
+    static {
         // ImageIO provider, the fall-back, must be the first one added
         if(GLProfile.isAWTAvailable()) {
             try {
@@ -1221,7 +1221,7 @@ public class TextureIO {
             return null;
         }
     }
-    
+
     //----------------------------------------------------------------------
     // DDS texture writer
     //
@@ -1249,7 +1249,7 @@ public class TextureIO {
                     case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: d3dFormat = DDSImage.D3DFMT_DXT5; break;
                     default: throw new IOException("Unsupported pixel format 0x" + Integer.toHexString(pixelFormat) + " by DDS writer");
                 }
-        
+
                 ByteBuffer[] mipmaps = null;
                 if (data.getMipmapData() != null) {
                     mipmaps = new ByteBuffer[data.getMipmapData().length];
@@ -1319,7 +1319,7 @@ public class TextureIO {
 
     //----------------------------------------------------------------------
     // TGA (Targa) texture writer
-  
+
     static class TGATextureWriter implements TextureWriter {
         public boolean write(File file,
                              TextureData data) throws IOException {
@@ -1329,19 +1329,19 @@ public class TextureIO {
                 final int pixelFormat = pixelAttribs.format;
                 final int pixelType   = pixelAttribs.type;
                 if ((pixelFormat == GL.GL_RGB ||
-                     pixelFormat == GL.GL_RGBA || 
+                     pixelFormat == GL.GL_RGBA ||
                      pixelFormat == GL2.GL_BGR ||
                      pixelFormat == GL.GL_BGRA ) &&
                     (pixelType == GL.GL_BYTE ||
                      pixelType == GL.GL_UNSIGNED_BYTE)) {
-                    
+
                     ByteBuffer buf = (ByteBuffer) data.getBuffer();
                     if (null == buf) {
                         buf = (ByteBuffer) data.getMipmapData()[0];
                     }
                     buf.rewind();
-                    
-                    if( pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA ) { 
+
+                    if( pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA ) {
                         // Must reverse order of red and blue channels to get correct results
                         int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
                         for (int i = 0; i < buf.remaining(); i += skip) {
@@ -1364,12 +1364,12 @@ public class TextureIO {
             }
 
             return false;
-        }    
+        }
     }
 
     //----------------------------------------------------------------------
     // PNG texture writer
-  
+
     static class PNGTextureWriter implements TextureWriter {
         public boolean write(File file, TextureData data) throws IOException {
             if (PNG.equals(IOUtil.getFileSuffix(file))) {
@@ -1402,13 +1402,13 @@ public class TextureIO {
                         break;
                 }
                 if ( ( 1 == bytesPerPixel || 3 == bytesPerPixel || 4 == bytesPerPixel) &&
-                     ( pixelType == GL.GL_BYTE || pixelType == GL.GL_UNSIGNED_BYTE)) {                    
+                     ( pixelType == GL.GL_BYTE || pixelType == GL.GL_UNSIGNED_BYTE)) {
                     ByteBuffer buf = (ByteBuffer) data.getBuffer();
                     if (null == buf) {
                         buf = (ByteBuffer) data.getMipmapData()[0];
                     }
                     buf.rewind();
-                    
+
                     PNGImage image = PNGImage.createFromData(data.getWidth(), data.getHeight(), -1f, -1f,
                                                              bytesPerPixel, reversedChannels, !data.getMustFlipVertically(), buf);
                     image.write(file, true);
@@ -1418,9 +1418,9 @@ public class TextureIO {
                                       " / type 0x"+Integer.toHexString(pixelFormat)+" (only GL_RGB/A, GL_BGR/A + bytes)");
             }
             return false;
-        }    
+        }
     }
-    
+
     //----------------------------------------------------------------------
     // Helper routines
     //
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index 5c6b63535..e4f72abf0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -36,26 +36,26 @@ import com.jogamp.opengl.util.TimeFrameI;
 /**
  * Protocol for texture sequences, like animations, movies, etc.
  * <p>
- * Ensure to respect the texture coordinates provided by 
+ * Ensure to respect the texture coordinates provided by
  * {@link TextureFrame}.{@link TextureFrame#getTexture() getTexture()}.{@link Texture#getImageTexCoords() getImageTexCoords()}.
  * </p>
- * The user's shader shall be fitted for this implementation. 
+ * The user's shader shall be fitted for this implementation.
  * Assuming we use a base shader code w/o headers using </code>ShaderCode</code>.
  * (Code copied from unit test / demo <code>TexCubeES2</code>)
  * <pre>
- * 
+ *
     static final String[] es2_prelude = { "#version 100\n", "precision mediump float;\n" };
     static final String gl2_prelude = "#version 110\n";
     static final String shaderBasename = "texsequence_xxx";  // the base shader code w/o headers
-    static final String myTextureLookupName = "myTexture2D"; // the desired texture lookup function    
-    
+    static final String myTextureLookupName = "myTexture2D"; // the desired texture lookup function
+
     private void initShader(GL2ES2 gl, TextureSequence texSeq) {
         // Create & Compile the shader objects
-        ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, TexCubeES2.class, 
+        ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, TexCubeES2.class,
                                             "shader", "shader/bin", shaderBasename, true);
-        ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, TexCubeES2.class, 
+        ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, TexCubeES2.class,
                                             "shader", "shader/bin", shaderBasename, true);
-        
+
         // Prelude shader code w/ GLSL profile specifics [ 1. pre-proc, 2. other ]
         int rsFpPos;
         if(gl.isGLES2()) {
@@ -72,25 +72,25 @@ import com.jogamp.opengl.util.TimeFrameI;
         if(gl.isGLES2()) {
             // insert ES2 default precision declaration
             rsFpPos = rsFp.insertShaderSource(0, rsFpPos, es2_prelude[1]);
-        }        
+        }
         // negotiate the texture lookup function name
         final String texLookupFuncName = texSeq.getTextureLookupFunctionName(myTextureLookupName);
-        
-        // in case a fixed lookup function is being chosen, replace the name in our code        
+
+        // in case a fixed lookup function is being chosen, replace the name in our code
         rsFp.replaceInShaderSource(myTextureLookupName, texLookupFuncName);
-        
+
         // Cache the TextureSequence shader details in StringBuilder:
         final StringBuilder sFpIns = new StringBuilder();
-        
+
         // .. declaration of the texture sampler using the implementation specific type
         sFpIns.append("uniform ").append(texSeq.getTextureSampler2DType()).append(" mgl_ActiveTexture;\n");
-        
+
         // .. the actual texture lookup function, maybe null in case a built-in function is being used
         sFpIns.append(texSeq.getTextureLookupFragmentShaderImpl());
-        
+
         // Now insert the TextureShader details in our shader after the given tag:
         rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
-        
+
         // Create & Link the shader program
         ShaderProgram sp = new ShaderProgram();
         sp.add(rsVp);
@@ -102,16 +102,16 @@ import com.jogamp.opengl.util.TimeFrameI;
  * </pre>
  * The above procedure might look complicated, however, it allows most flexibility and
  * workarounds to also deal with GLSL bugs.
- *  
+ *
  */
 public interface TextureSequence {
     public static final String GL_OES_EGL_image_external_Required_Prelude = "#extension GL_OES_EGL_image_external : enable\n";
     public static final String samplerExternalOES = "samplerExternalOES";
     public static final String sampler2D = "sampler2D";
-    
-    /** 
+
+    /**
      * Texture holder interface, maybe specialized by implementation
-     * to associated related data. 
+     * to associated related data.
      */
     public static class TextureFrame extends TimeFrameI {
         public TextureFrame(Texture t, int pts, int duration) {
@@ -121,9 +121,9 @@ public interface TextureSequence {
         public TextureFrame(Texture t) {
             texture = t;
         }
-        
+
         public final Texture getTexture() { return texture; }
-        
+
         public String toString() {
             return "TextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ (null != texture ? texture.getTextureObject() : 0) + "]";
         }
@@ -139,30 +139,30 @@ public interface TextureSequence {
      * <p>
      * Further more, the call may happen off-thread, possibly holding another, possibly shared, OpenGL context current.
      * </p>
-     * Hence a user shall not issue <i>any</i> OpenGL, time consuming 
+     * Hence a user shall not issue <i>any</i> OpenGL, time consuming
      * or {@link TextureSequence} lifecycle operations directly.<br>
      * Instead, the user shall:
      * <ul>
      *   <li>issue commands off-thread via spawning off another thread, or</li>
      *   <li>injecting {@link GLRunnable} objects via {@link GLAutoDrawable#invoke(boolean, GLRunnable)}, or</li>
      *   <li>simply changing a volatile state of their {@link GLEventListener} implementation.</li>
-     * </ul> 
+     * </ul>
      * </p>
      * */
     public interface TexSeqEventListener<T extends TextureSequence> {
-        /** 
+        /**
          * Signaling listeners that a new {@link TextureFrame} is available.
          * <p>
-         * User shall utilize {@link TextureSequence#getNextTexture(GL)} to dequeue it to maintain 
-         * a consistent queue.  
+         * User shall utilize {@link TextureSequence#getNextTexture(GL)} to dequeue it to maintain
+         * a consistent queue.
          * </p>
-         * @param ts the event source 
+         * @param ts the event source
          * @param newFrame the newly enqueued frame
-         * @param when system time in msec. 
+         * @param when system time in msec.
          **/
         public void newFrameAvailable(T ts, TextureFrame newFrame, long when);
     }
-    
+
     /** Return the texture unit used to render the current frame. */
     public int getTextureUnit();
 
@@ -174,17 +174,17 @@ public interface TextureSequence {
      * Returns the last updated texture.
      * <p>
      * In case the instance is just initialized, it shall return a <code>TextureFrame</code>
-     * object with valid attributes. The texture content may be undefined 
+     * object with valid attributes. The texture content may be undefined
      * until the first call of {@link #getNextTexture(GL)}.<br>
-     * </p> 
+     * </p>
      * Not blocking.
-     *  
-     * @throws IllegalStateException if instance is not initialized 
+     *
+     * @throws IllegalStateException if instance is not initialized
      */
     public TextureFrame getLastTexture() throws IllegalStateException ;
 
     /**
-     * Returns the next texture to be rendered. 
+     * Returns the next texture to be rendered.
      * <p>
      * Implementation shall return the next frame if available, may block if a next frame may arrive <i>soon</i>.
      * Otherwise implementation shall return the last frame.
@@ -192,41 +192,41 @@ public interface TextureSequence {
      * <p>
      * Shall return <code>null</code> in case <i>no</i> next or last frame is available.
      * </p>
-     *  
-     * @throws IllegalStateException if instance is not initialized 
+     *
+     * @throws IllegalStateException if instance is not initialized
      */
     public TextureFrame getNextTexture(GL gl) throws IllegalStateException ;
-    
+
     /**
-     * In case a shader extension is required, based on the implementation 
+     * In case a shader extension is required, based on the implementation
      * and the runtime GL profile, this method returns the preprocessor macros, e.g.:
      * <pre>
      * #extension GL_OES_EGL_image_external : enable
-     * </pre> 
-     *  
-     * @throws IllegalStateException if instance is not initialized 
+     * </pre>
+     *
+     * @throws IllegalStateException if instance is not initialized
      */
     public String getRequiredExtensionsShaderStub() throws IllegalStateException ;
-    
-    /** 
+
+    /**
      * Returns either <code>sampler2D</code> or <code>samplerExternalOES</code>
-     * depending on {@link #getLastTexture()}.{@link TextureFrame#getTexture() getTexture()}.{@link Texture#getTarget() getTarget()}. 
-     *  
-     * @throws IllegalStateException if instance is not initialized 
+     * depending on {@link #getLastTexture()}.{@link TextureFrame#getTexture() getTexture()}.{@link Texture#getTarget() getTarget()}.
+     *
+     * @throws IllegalStateException if instance is not initialized
      **/
     public String getTextureSampler2DType() throws IllegalStateException ;
-    
+
     /**
      * @param desiredFuncName desired lookup function name. If <code>null</code> or ignored by the implementation,
-     *                        a build-in name is returned. 
+     *                        a build-in name is returned.
      * @return the final lookup function name
-     *  
+     *
      * @see {@link #getTextureLookupFragmentShaderImpl()}
-     * 
+     *
      * @throws IllegalStateException if instance is not initialized
      */
     public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException ;
-    
+
     /**
      * Returns the complete texture2D lookup function code of type
      * <pre>
@@ -239,14 +239,14 @@ public interface TextureSequence {
      * <i>funcName</i> can be negotiated and queried via {@link #getTextureLookupFunctionName(String)}.
      * </p>
      * Note: This function may return an empty string in case a build-in lookup
-     * function is being chosen. If the implementation desires so, 
+     * function is being chosen. If the implementation desires so,
      * {@link #getTextureLookupFunctionName(String)} will ignore the desired function name
      * and returns the build-in lookup function name.
      * </p>
      * @see #getTextureLookupFunctionName(String)
      * @see #getTextureSampler2DType()
-     *  
-     * @throws IllegalStateException if instance is not initialized 
+     *
+     * @throws IllegalStateException if instance is not initialized
      */
-    public String getTextureLookupFragmentShaderImpl() throws IllegalStateException ;    
+    public String getTextureLookupFragmentShaderImpl() throws IllegalStateException ;
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
index 4a5d368e3..c8437d07c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
@@ -43,55 +43,55 @@ import javax.media.opengl.GLException;
  *   - GL.GL_TEXTURE_MAG_FILTER
  *   - GL.GL_TEXTURE_MIN_FILTER
  *   - GL.GL_TEXTURE_WRAP_S
- *   - GL.GL_TEXTURE_WRAP_T            
+ *   - GL.GL_TEXTURE_WRAP_T
  * </pre>
  */
 public class TextureState {
-    /** 
+    /**
      * Returns the <code>pname</code> to query the <code>textureTarget</code> currently bound to the active texture-unit.
      * <p>
      * Returns <code>0</code> is <code>textureTarget</code> is not supported.
-     * </p> 
-     */ 
+     * </p>
+     */
     public static final int getTextureTargetQueryName(int textureTarget) {
         final int texBindQName;
         switch(textureTarget) {
-            case GL.GL_TEXTURE_2D: texBindQName = GL.GL_TEXTURE_BINDING_2D; break; 
-            case GL.GL_TEXTURE_CUBE_MAP: texBindQName = GL.GL_TEXTURE_BINDING_CUBE_MAP; break; 
-            case GL2ES2.GL_TEXTURE_3D: texBindQName = GL2ES2.GL_TEXTURE_BINDING_3D; break; 
-            case GL2GL3.GL_TEXTURE_1D: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D; break; 
-            case GL2GL3.GL_TEXTURE_1D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D_ARRAY; break; 
-            case GL2GL3.GL_TEXTURE_2D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_2D_ARRAY; break; 
-            case GL2GL3.GL_TEXTURE_RECTANGLE: texBindQName = GL2GL3.GL_TEXTURE_BINDING_RECTANGLE; break; 
-            case GL2GL3.GL_TEXTURE_BUFFER: texBindQName = GL2GL3.GL_TEXTURE_BINDING_BUFFER; break; 
-            case GL3.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break; 
+            case GL.GL_TEXTURE_2D: texBindQName = GL.GL_TEXTURE_BINDING_2D; break;
+            case GL.GL_TEXTURE_CUBE_MAP: texBindQName = GL.GL_TEXTURE_BINDING_CUBE_MAP; break;
+            case GL2ES2.GL_TEXTURE_3D: texBindQName = GL2ES2.GL_TEXTURE_BINDING_3D; break;
+            case GL2GL3.GL_TEXTURE_1D: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D; break;
+            case GL2GL3.GL_TEXTURE_1D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D_ARRAY; break;
+            case GL2GL3.GL_TEXTURE_2D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_2D_ARRAY; break;
+            case GL2GL3.GL_TEXTURE_RECTANGLE: texBindQName = GL2GL3.GL_TEXTURE_BINDING_RECTANGLE; break;
+            case GL2GL3.GL_TEXTURE_BUFFER: texBindQName = GL2GL3.GL_TEXTURE_BINDING_BUFFER; break;
+            case GL3.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break;
             case GL3.GL_TEXTURE_2D_MULTISAMPLE_ARRAY: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY; break;
             default: texBindQName = 0;
         }
         return texBindQName;
     }
-    
+
     private final int target;
-    /** 
+    /**
      * <pre>
      *   0 - unit
      *   1 - texture object
      *   2 - GL.GL_TEXTURE_MAG_FILTER
      *   3 - GL.GL_TEXTURE_MIN_FILTER
      *   4 - GL.GL_TEXTURE_WRAP_S
-     *   5 - GL.GL_TEXTURE_WRAP_T            
+     *   5 - GL.GL_TEXTURE_WRAP_T
      * </pre>
      */
     private final int[] state = new int[] { 0, 0, 0, 0, 0, 0 };
-    
+
     private static final String toHexString(int i) { return "0x"+Integer.toHexString(i); }
-    
+
     private static final int activeTexture(GL gl) {
         final int[] vi = { 0 };
         gl.glGetIntegerv(GL.GL_ACTIVE_TEXTURE, vi, 0);
         return vi[0];
     }
-    
+
     /**
      * Creates a texture state for the retrieved active texture-unit and the given texture-target.
      * See {@link TextureState}.
@@ -102,7 +102,7 @@ public class TextureState {
     public TextureState(GL gl, int textureTarget) throws GLException {
         this(gl, activeTexture(gl), textureTarget);
     }
-    
+
     /**
      * Creates a texture state for the given active texture-unit and the given texture-target.
      * See {@link TextureState}.
@@ -124,7 +124,7 @@ public class TextureState {
         gl.glGetTexParameteriv(target, GL.GL_TEXTURE_WRAP_S, state, 4);
         gl.glGetTexParameteriv(target, GL.GL_TEXTURE_WRAP_T, state, 5);
     }
-    
+
     /**
      * Restores the texture-unit's texture-target state.
      * <p>
@@ -140,12 +140,12 @@ public class TextureState {
         gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_S, state[4]);
         gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_T, state[5]);
     }
-    
+
     /** Returns the texture-unit of this state, key value. Unit is of range [ {@link GL#GL_TEXTURE0}.. ]. */
     public final int getUnit() { return state[0]; }
     /** Returns the texture-target of this state, key value. */
     public final int getTarget() { return target; }
-    
+
     /** Returns the state's texture-object. */
     public final int getObject() { return state[1]; }
     /** Returns the state's mag-filter param. */
@@ -156,12 +156,12 @@ public class TextureState {
     public final int getWrapS() { return state[4]; }
     /** Returns the state's wrap-t param. */
     public final int getWrapT() { return state[5]; }
-    
-    
+
+
     public final String toString() {
         return "TextureState[unit "+(state[0] - GL.GL_TEXTURE0)+", target "+toHexString(target)+
                 ": obj "+toHexString(state[1])+
-                ", filter[mag "+toHexString(state[2])+", min "+toHexString(state[3])+"], "+ 
+                ", filter[mag "+toHexString(state[2])+", min "+toHexString(state[3])+"], "+
                 ": wrap[s "+toHexString(state[4])+", t "+toHexString(state[5])+"]]";
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
index d7e825c1d..202c08e4e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -80,7 +80,7 @@ public class AWTTextureData extends TextureData {
 
     private static final java.awt.image.ColorModel rgbaColorModel =
         new ComponentColorModel(java.awt.color.ColorSpace.getInstance(java.awt.color.ColorSpace.CS_sRGB),
-                                new int[] {8, 8, 8, 8}, true, true, 
+                                new int[] {8, 8, 8, 8}, true, true,
                                 Transparency.TRANSLUCENT,
                                 DataBuffer.TYPE_BYTE);
     private static final java.awt.image.ColorModel rgbColorModel =
@@ -90,7 +90,7 @@ public class AWTTextureData extends TextureData {
                                 DataBuffer.TYPE_BYTE);
 
 
-    /** 
+    /**
      * Constructs a new TextureData object with the specified parameters
      * and data contained in the given BufferedImage. The resulting
      * TextureData "wraps" the contents of the BufferedImage, so if a
@@ -113,7 +113,7 @@ public class AWTTextureData extends TextureData {
      *                       texture
      * @param image          the image containing the texture data
      */
-    public AWTTextureData(GLProfile glp, 
+    public AWTTextureData(GLProfile glp,
                           int internalFormat,
                           int pixelFormat,
                           boolean mipmap,
@@ -142,15 +142,15 @@ public class AWTTextureData extends TextureData {
                   (expectingGL12    && haveGL12))) {
                 revertPixelAttributes();
             }
-        }        
+        }
     }
-    
+
     @Override
     public GLPixelAttributes getPixelAttributes() {
         validatePixelAttributes();
         return super.getPixelAttributes();
     }
-    
+
     @Override
     public int getPixelFormat() {
         validatePixelAttributes();
@@ -246,7 +246,7 @@ public class AWTTextureData extends TextureData {
                         // we can pass the image data directly to OpenGL only if
                         // we have an integral number of pixels in each scanline
                         // and only if the GL_EXT_abgr extension is present
-    
+
                         // NOTE: disabling this code path for now as it appears it's
                         // buggy at least on some NVidia drivers and doesn't perform
                         // the necessary byte swapping (FIXME: needs more
@@ -255,7 +255,7 @@ public class AWTTextureData extends TextureData {
                             pixelAttributes = new GLPixelAttributes(GL2.GL_ABGR_EXT, GL.GL_UNSIGNED_BYTE);
                             rowLength = scanlineStride / 4;
                             alignment = 4;
-    
+
                             // Store a reference to the original image for later in
                             // case it turns out that we don't have GL_EXT_abgr at the
                             // time we're going to do the texture upload to OpenGL
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
index fdd1365f7..c70f5d0f3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -100,7 +100,7 @@ public class AWTTextureIO extends TextureIO {
         return newTextureDataImpl(glp, image, internalFormat, pixelFormat, mipmap);
     }
 
-    /** 
+    /**
      * Creates an OpenGL texture object from the specified BufferedImage
      * using the current OpenGL context.
      *
@@ -119,7 +119,7 @@ public class AWTTextureIO extends TextureIO {
         return texture;
     }
 
-    private static TextureData newTextureDataImpl(GLProfile glp, 
+    private static TextureData newTextureDataImpl(GLProfile glp,
                                                   BufferedImage image,
                                                   int internalFormat,
                                                   int pixelFormat,
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
index 3f91ae966..d75bb3767 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -166,7 +166,7 @@ public class DDSImage {
     public static DDSImage read(String filename) throws IOException {
         return read(new File(filename));
     }
-  
+
     /** Reads a DirectDraw surface from the specified file, returning
         the resulting DDSImage.
 
@@ -212,7 +212,7 @@ public class DDSImage {
         }
     }
 
-    /** 
+    /**
      * Creates a new DDSImage from data supplied by the user. The
      * resulting DDSImage can be written to disk using the write()
      * method.
@@ -763,7 +763,7 @@ public class DDSImage {
         default:
             throw new IllegalArgumentException("d3dFormat must be one of the known formats");
         }
-    
+
         // Now check the mipmaps against this size
         int curSize = topmostMipmapSize;
         int totalSize = 0;
@@ -785,7 +785,7 @@ public class DDSImage {
             buf.put(mipmapData[i]);
         }
         this.buf = buf;
-    
+
         // Allocate and initialize a Header
         header = new Header();
         header.size = Header.size();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
index 4d3d088ba..471938754 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -40,12 +40,12 @@ import com.jogamp.common.nio.Buffers;
 import com.jogamp.opengl.util.texture.TextureData.ColorSpace;
 
 public class JPEGImage {
-    private static final boolean DEBUG = Debug.debug("JPEGImage");    
-    
-    
+    private static final boolean DEBUG = Debug.debug("JPEGImage");
+
+
     /**
      * Reads a JPEG image from the specified InputStream, using the given color space for storage.
-     * 
+     *
      * @param in
      * @param cs Storage color space, either {@link ColorSpace#RGB} or {@link ColorSpace#YCbCr}. {@link ColorSpace#YCCK} and {@link ColorSpace#CMYK} will throw an exception!
      * @return
@@ -54,12 +54,12 @@ public class JPEGImage {
     public static JPEGImage read(InputStream in, ColorSpace cs) throws IOException {
         return new JPEGImage(in, cs);
     }
-    
+
     /** Reads a JPEG image from the specified InputStream, using the {@link ColorSpace#RGB}. */
     public static JPEGImage read(InputStream in) throws IOException {
         return new JPEGImage(in, ColorSpace.RGB);
     }
-    
+
     private static class JPEGColorSink implements JPEGDecoder.ColorSink  {
         int width=0, height=0;
         int sourceComponents=0;
@@ -67,7 +67,7 @@ public class JPEGImage {
         int storageComponents;
         final ColorSpace storageCS;
         ByteBuffer data = null;
-        
+
         JPEGColorSink(ColorSpace storageCM) {
             this.storageCS = storageCM;
             switch(storageCS) {
@@ -79,7 +79,7 @@ public class JPEGImage {
                 throw new IllegalArgumentException("Unsupported storage color-space: "+storageCS);
             }
         }
-        
+
         @Override
         public final ColorSpace allocate(int width, int height, ColorSpace sourceCM, int sourceComponents) throws RuntimeException {
             this.width = width;
@@ -96,7 +96,7 @@ public class JPEGImage {
             data.put(i++, r);
             data.put(i++, g);
             data.put(i++, b);
-            // data.put(i++, (byte)0xff);            
+            // data.put(i++, (byte)0xff);
         }
 
         @Override
@@ -111,12 +111,12 @@ public class JPEGImage {
             data.put(i++, Cb);
             data.put(i++, Cr);
         }
-        
+
         public String toString() {
             return "JPEGPixels["+width+"x"+height+", sourceComp "+sourceComponents+", sourceCS "+sourceCS+", storageCS "+storageCS+", storageComp "+storageComponents+"]";
         }
     };
-    
+
     private JPEGImage(InputStream in, ColorSpace cs) throws IOException {
         pixelStorage = new JPEGColorSink(cs);
         final JPEGDecoder decoder = new JPEGDecoder();
@@ -126,7 +126,7 @@ public class JPEGImage {
         decoder.getPixel(pixelStorage, pixelWidth, pixelHeight);
         data = pixelStorage.data;
         final boolean hasAlpha = false;
-        
+
         bytesPerPixel = 3;
         glFormat = GL.GL_RGB;
         reversedChannels = false; // RGB[A]
@@ -142,7 +142,7 @@ public class JPEGImage {
     private final int pixelWidth, pixelHeight, glFormat, bytesPerPixel;
     private boolean reversedChannels;
     private final ByteBuffer data;
-    
+
     /** Returns the color space of the pixel data */
     public ColorSpace getColorSpace() { return pixelStorage.storageCS; }
 
@@ -157,10 +157,10 @@ public class JPEGImage {
 
     /** Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected. */
     public boolean getHasReversedChannels() { return reversedChannels; }
-    
+
     /** Returns the OpenGL format for this texture; e.g. GL.GL_LUMINANCE, GL.GL_RGB or GL.GL_RGBA. */
     public int getGLFormat() { return glFormat; }
-    
+
     /** Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE. */
     public int getGLType() { return GL.GL_UNSIGNED_BYTE; }
 
@@ -170,6 +170,6 @@ public class JPEGImage {
     /** Returns the raw data for this texture in the correct
         (bottom-to-top) order for calls to glTexImage2D. */
     public ByteBuffer getData()  { return data; }
-    
+
     public String toString() { return "JPEGImage["+pixelWidth+"x"+pixelHeight+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+pixelStorage+", "+data+"]"; }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
index b7262aa3e..4020ab3c0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -148,7 +148,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     }
 
     public final int readUnsignedShort() throws    IOException
-    { 
+    {
         int    ch1    = dataIn.read();
         int    ch2    = dataIn.read();
         if ((ch1 | ch2)    < 0)
@@ -195,7 +195,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
 
     /**
      * dont call this it is not implemented.
-     * @return empty new string 
+     * @return empty new string
      **/
     public final String    readLine() throws IOException
     {
@@ -204,7 +204,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
 
     /**
      * dont call this it is not implemented
-     * @return empty new string 
+     * @return empty new string
      **/
     public final String    readUTF() throws IOException
     {
@@ -213,7 +213,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
 
     /**
      * dont call this it is not implemented
-     * @return empty new string 
+     * @return empty new string
      **/
     public final static    String readUTF(DataInput in) throws    IOException
     {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
index e1e1ca924..a7101a576 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
index cd42a1157..43b8eebe6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -87,8 +87,8 @@ public class NetPbmTextureWriter implements TextureWriter {
     public boolean write(File file, TextureData data) throws IOException {
         boolean res;
         final int magic_old = magic;
-        
-        // file suffix selection        
+
+        // file suffix selection
         if (0==magic) {
             if (PPM.equals(IOUtil.getFileSuffix(file))) {
                 magic = 6;
@@ -97,7 +97,7 @@ public class NetPbmTextureWriter implements TextureWriter {
             } else {
                 return false;
             }
-        }        
+        }
         try {
             res = writeImpl(file, data);
         } finally {
@@ -105,7 +105,7 @@ public class NetPbmTextureWriter implements TextureWriter {
         }
         return res;
     }
-    
+
     private boolean writeImpl(File file, TextureData data) throws IOException {
         int pixelFormat = data.getPixelFormat();
         final int pixelType   = data.getPixelType();
@@ -115,16 +115,16 @@ public class NetPbmTextureWriter implements TextureWriter {
              pixelFormat == GL.GL_BGRA ) &&
             (pixelType == GL.GL_BYTE ||
              pixelType == GL.GL_UNSIGNED_BYTE)) {
-    
+
             ByteBuffer buf = (ByteBuffer) data.getBuffer();
             if (null == buf ) {
                 buf = (ByteBuffer) data.getMipmapData()[0];
             }
             buf.rewind();
-            
+
             int comps = ( pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA ) ? 4 : 3 ;
-            
-            if( pixelFormat == GL2.GL_BGR || pixelFormat == GL.GL_BGRA ) { 
+
+            if( pixelFormat == GL2.GL_BGR || pixelFormat == GL.GL_BGRA ) {
                 // Must reverse order of red and blue channels to get correct results
                 for (int i = 0; i < buf.remaining(); i += comps) {
                     byte red  = buf.get(i + 0);
@@ -141,7 +141,7 @@ public class NetPbmTextureWriter implements TextureWriter {
             }
 
             FileOutputStream fos = IOUtil.getFileOutputStream(file, true);
-            
+
             StringBuilder header = new StringBuilder();
             header.append("P");
             header.append(magic);
@@ -171,7 +171,7 @@ public class NetPbmTextureWriter implements TextureWriter {
             }
 
             fos.write(header.toString().getBytes());
-            
+
             FileChannel fosc = fos.getChannel();
             fosc.write(buf);
             fosc.force(true);
@@ -180,7 +180,7 @@ public class NetPbmTextureWriter implements TextureWriter {
             buf.rewind();
 
             return true;
-        }      
+        }
         throw new IOException("NetPbmTextureWriter writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
index 0f4559036..bfde1bfac 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -51,15 +51,15 @@ import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.util.IOUtil;
 
 public class PNGImage {
-    private static final boolean DEBUG = Debug.debug("PNGImage");    
-    
+    private static final boolean DEBUG = Debug.debug("PNGImage");
+
     /**
      * Creates a PNGImage from data supplied by the end user. Shares
      * data with the passed ByteBuffer. Assumes the data is already in
      * the correct byte order for writing to disk, i.e., LUMINANCE, RGB or RGBA.
      * Orientation is <i>bottom-to-top</i> (OpenGL coord. default)
      * or <i>top-to-bottom</i> depending on <code>isGLOriented</code>.
-     * 
+     *
      * @param width
      * @param height
      * @param dpiX
@@ -74,17 +74,17 @@ public class PNGImage {
                                           int bytesPerPixel, boolean reversedChannels, boolean isGLOriented, ByteBuffer data) {
         return new PNGImage(width, height, dpiX, dpiY, bytesPerPixel, reversedChannels, isGLOriented, data);
     }
-    
-    /** 
+
+    /**
      * Reads a PNG image from the specified InputStream.
      * <p>
      * Implicitly flip image to GL orientation, see {@link #isGLOriented()}.
-     * </p> 
+     * </p>
      */
     public static PNGImage read(InputStream in) throws IOException {
         return new PNGImage(in);
     }
-    
+
     /** Reverse read and store, implicitly flip image to GL orientation, see {@link #isGLOriented()}. */
     private static final int getPixelRGBA8(ByteBuffer d, int dOff, int[] scanline, int lineOff, boolean hasAlpha) {
         final int b = hasAlpha ? 4-1 : 3-1;
@@ -95,11 +95,11 @@ public class PNGImage {
             d.put(dOff--, (byte)scanline[lineOff + 3]); // A
         }
         d.put(dOff--, (byte)scanline[lineOff + 2]); // B
-        d.put(dOff--, (byte)scanline[lineOff + 1]); // G        
+        d.put(dOff--, (byte)scanline[lineOff + 1]); // G
         d.put(dOff--, (byte)scanline[lineOff    ]); // R
         return dOff;
     }
-    
+
     /** Reverse write and store, implicitly flip image from current orientation, see {@link #isGLOriented()}. Handle reversed channels (BGR[A]). */
     private int setPixelRGBA8(ImageLine line, int lineOff, ByteBuffer d, int dOff, boolean hasAlpha) {
         final int b = hasAlpha ? 4-1 : 3-1;
@@ -138,9 +138,9 @@ public class PNGImage {
         this.bytesPerPixel = bytesPerPixel;
         this.reversedChannels = reversedChannels;
         this.isGLOriented = isGLOriented;
-        this.data = data;        
+        this.data = data;
     }
-    
+
     private PNGImage(InputStream in) {
         final PngReader pngr = new PngReader(new BufferedInputStream(in), null);
         final ImageInfo imgInfo = pngr.imgInfo;
@@ -148,12 +148,12 @@ public class PNGImage {
         final PngChunkTRNS trns = pngr.getMetadata().getTRNS();
         final boolean indexed = imgInfo.indexed;
         final boolean hasAlpha = indexed ? ( trns != null ) : imgInfo.alpha ;
-        
+
         final int channels = indexed ? ( hasAlpha ? 4 : 3 ) : imgInfo.channels ;
         if ( ! ( 1 == channels || 3 == channels || 4 == channels ) ) {
             throw new RuntimeException("PNGImage can only handle Lum/RGB/RGBA [1/3/4 channels] images for now. Channels "+channels + " Paletted: " + indexed);
         }
-        
+
         bytesPerPixel = indexed ? channels : imgInfo.bytesPixel ;
         if ( ! ( 1 == bytesPerPixel || 3 == bytesPerPixel || 4 == bytesPerPixel ) ) {
             throw new RuntimeException("PNGImage can only handle Lum/RGB/RGBA [1/3/4 bpp] images for now. BytesPerPixel "+bytesPerPixel);
@@ -189,14 +189,14 @@ public class PNGImage {
                                ", bytesPerPixel "+bytesPerPixel+"/"+imgInfo.bytesPixel+
                                ", pixels "+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+"x"+dpi[1]+", glFormat 0x"+Integer.toHexString(glFormat));
         }
-        
+
         data = Buffers.newDirectByteBuffer(bytesPerPixel * pixelWidth * pixelHeight);
         reversedChannels = false; // RGB[A]
         isGLOriented = true;
         int dataOff = bytesPerPixel * pixelWidth * pixelHeight - 1; // start at end-of-buffer, reverse store
 
         int[] rgbaScanline = indexed ? new int[imgInfo.cols * channels] : null;
-        
+
         for (int row = 0; row < pixelHeight; row++) {
             final ImageLine l1 = pngr.readRow(row);
             int lineOff = ( pixelWidth - 1 ) * bytesPerPixel ; // start w/ last pixel in line, reverse read (PNG top-left -> OpenGL bottom-left origin)
@@ -224,7 +224,7 @@ public class PNGImage {
     private final boolean isGLOriented;
     private final double[] dpi;
     private final ByteBuffer data;
-    
+
     /** Returns the width of the image. */
     public int getWidth()    { return pixelWidth; }
 
@@ -233,23 +233,23 @@ public class PNGImage {
 
     /** Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected. */
     public boolean getHasReversedChannels() { return reversedChannels; }
-    
+
     /**
-     * Returns <code>true</code> if the drawable is rendered in 
+     * Returns <code>true</code> if the drawable is rendered in
      * OpenGL's coordinate system, <i>origin at bottom left</i>.
      * Otherwise returns <code>false</code>, i.e. <i>origin at top left</i>.
      * <p>
      * Default impl. is <code>true</code>, i.e. OpenGL coordinate system.
-     * </p> 
+     * </p>
      */
     public boolean isGLOriented() { return isGLOriented; }
-    
+
     /** Returns the dpi of the image. */
     public double[] getDpi() { return dpi; }
-    
+
     /** Returns the OpenGL format for this texture; e.g. GL.GL_LUMINANCE, GL.GL_RGB or GL.GL_RGBA. */
     public int getGLFormat() { return glFormat; }
-    
+
     /** Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE. */
     public int getGLType() { return GL.GL_UNSIGNED_BYTE; }
 
@@ -260,12 +260,12 @@ public class PNGImage {
         (bottom-to-top) order for calls to glTexImage2D. */
     public ByteBuffer getData()  { return data; }
 
-    public void write(File out, boolean allowOverwrite) throws IOException {        
-        final ImageInfo imi = new ImageInfo(pixelWidth, pixelHeight, 8, (4 == bytesPerPixel) ? true : false); // 8 bits per channel, no alpha 
+    public void write(File out, boolean allowOverwrite) throws IOException {
+        final ImageInfo imi = new ImageInfo(pixelWidth, pixelHeight, 8, (4 == bytesPerPixel) ? true : false); // 8 bits per channel, no alpha
         // open image for writing to a output stream
         final OutputStream outs = new BufferedOutputStream(IOUtil.getFileOutputStream(out, allowOverwrite));
         try {
-            final PngWriter png = new PngWriter(outs, imi); 
+            final PngWriter png = new PngWriter(outs, imi);
             // add some optional metadata (chunks)
             png.getMetadata().setDpi(dpi[0], dpi[1]);
             png.getMetadata().setTimeNow(0); // 0 seconds fron now = now
@@ -275,7 +275,7 @@ public class PNGImage {
             final ImageLine l1 = new ImageLine(imi);
             if( isGLOriented ) {
                 // start at last pixel at end-of-buffer, reverse read (OpenGL bottom-left -> PNG top-left origin)
-                int dataOff = ( pixelWidth * bytesPerPixel * ( pixelHeight - 1 ) ) + // full lines - 1 line 
+                int dataOff = ( pixelWidth * bytesPerPixel * ( pixelHeight - 1 ) ) + // full lines - 1 line
                               ( ( pixelWidth - 1 ) * bytesPerPixel );                // one line - 1 pixel
                 for (int row = 0; row < pixelHeight; row++) {
                     int lineOff = ( pixelWidth - 1 ) * bytesPerPixel ; // start w/ last pixel in line, reverse store (OpenGL bottom-left -> PNG top-left origin)
@@ -306,13 +306,13 @@ public class PNGImage {
                         }
                     }
                     png.writeRow(l1, row);
-                }                
+                }
             }
             png.end();
         } finally {
             IOUtil.close(outs, false);
         }
     }
-    
-    public String toString() { return "PNGImage["+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+" x "+dpi[1]+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+data+"]"; }       
+
+    public String toString() { return "PNGImage["+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+" x "+dpi[1]+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+data+"]"; }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
index d35330f58..fd96fba80 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
@@ -1,21 +1,21 @@
 /*
  * Portions Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -72,15 +72,15 @@ public class SGIImage {
         byte  storage;      // Storage format
         // 0 for uncompressed
         // 1 for RLE compression
-        byte  bpc;          // Number of bytes per pixel channel 
+        byte  bpc;          // Number of bytes per pixel channel
         // Legally 1 or 2
         short dimension;    // Number of dimensions
         // Legally 1, 2, or 3
         // 1 means a single row, XSIZE long
         // 2 means a single 2D image
         // 3 means multiple 2D images
-        short xsize;        // X size in pixels 
-        short ysize;        // Y size in pixels 
+        short xsize;        // X size in pixels
+        short ysize;        // Y size in pixels
         short zsize;        // Number of channels
         // 1 indicates greyscale
         // 3 indicates RGB
@@ -233,7 +233,7 @@ public class SGIImage {
     //----------------------------------------------------------------------
     // Internals only below this point
     //
-  
+
     private void decodeImage(DataInputStream in) throws IOException {
         if (header.storage == 1) {
             // Read RLE compression data; row starts and sizes
@@ -478,7 +478,7 @@ public class SGIImage {
         for (int z = 0; z < zsize; z++) {
             for (int y = ystart; y != yend; y += yincr) {
                 // RLE-compress each row.
-      
+
                 int x = 0;
                 byte count = 0;
                 boolean repeat_mode = false;
@@ -486,7 +486,7 @@ public class SGIImage {
                 int start_ptr = ptr;
                 int num_ptr = ptr++;
                 byte repeat_val = 0;
-      
+
                 while (x < xsize) {
                     // see if we should switch modes
                     should_switch = false;
@@ -503,7 +503,7 @@ public class SGIImage {
                                 if (DEBUG)
                                     System.err.println("left side was " + ((int) imgref(data, x, y, z, xsize, ysize, zsize)) +
                                                        ", right side was " + (int)imgref(data, x+i, y, z, xsize, ysize, zsize));
-              
+
                                 if (imgref(data, x, y, z, xsize, ysize, zsize) !=
                                     imgref(data, x+i, y, z, xsize, ysize, zsize))
                                     should_switch = false;
@@ -531,7 +531,7 @@ public class SGIImage {
                                 repeat_mode = true;
                             repeat_val = imgref(data, x, y, z, xsize, ysize, zsize);
                         }
-          
+
                         if (x > 0) {
                             // reset the number pointer
                             num_ptr = ptr++;
@@ -539,7 +539,7 @@ public class SGIImage {
                             count = 0;
                         }
                     }
-            
+
                     // if not in repeat mode, copy element to ptr
                     if (!repeat_mode) {
                         rlebuf[ptr++] = imgref(data, x, y, z, xsize, ysize, zsize);
@@ -581,8 +581,8 @@ public class SGIImage {
         // Now we have the offset tables computed, as well as the RLE data.
         // Output this information to the file.
         total_size = ptr;
-  
-        if (DEBUG) 
+
+        if (DEBUG)
             System.err.println("total_size was " + total_size);
 
         DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(IOUtil.getFileOutputStream(file, true)));
@@ -604,7 +604,7 @@ public class SGIImage {
         byte[] dest = new byte[16384];
         int pos = 0;
         int numRead = 0;
-    
+
         boolean done = false;
 
         do {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
index 2ff3b9cf0..df9430a26 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -146,9 +146,9 @@ public class TGAImage {
             tgaType = TYPE_OLD; // dont try and get footer.
 
             // initial header fields
-            idLength = in.readUnsignedByte();    
+            idLength = in.readUnsignedByte();
             colorMapType = in.readUnsignedByte();
-            imageType = in.readUnsignedByte();    
+            imageType = in.readUnsignedByte();
 
             // color map header fields
             firstEntryIndex = in.readUnsignedShort();
@@ -288,14 +288,14 @@ public class TGAImage {
             throw new IOException("TGADecoder Compressed Grayscale images not supported");
         }
     }
-  
+
     /**
      * This assumes that the body is for a 24 bit or 32 bit for a
      * RGB or ARGB image respectively.
      */
     private void decodeRGBImageU24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
         setupImage24_32(glp);
-        
+
         int i;    // row index
         int y;    // output row index
         int rawWidth = header.width() * bpp;
@@ -317,14 +317,14 @@ public class TGAImage {
             swapBGR(tmpData, rawWidth, header.height(), bpp);
         data = ByteBuffer.wrap(tmpData);
     }
-    
+
     /**
      * This assumes that the body is for a 24 bit or 32 bit for a
      * RGB or ARGB image respectively.
      */
     private void decodeRGBImageRLE24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
         setupImage24_32(glp);
-        
+
         byte[] pixel = new byte[bpp];
         int rawWidth = header.width() * bpp;
         byte[] tmpData = new byte[rawWidth * header.height()];
@@ -341,17 +341,17 @@ public class TGAImage {
                 dIn.read(tmpData, i, len * bpp);
             i += bpp * len;
         }
-        
+
         if(format == GL.GL_RGB || format == GL.GL_RGBA)
             swapBGR(tmpData, rawWidth, header.height(), bpp);
         data = ByteBuffer.wrap(tmpData);
     }
-    
+
     private void setupImage24_32(GLProfile glp) {
         bpp = header.pixelDepth / 8;
         switch (header.pixelDepth) {
-        case 24: 
-            format = glp.isGL2GL3() ? GL2GL3.GL_BGR : GL.GL_RGB;   
+        case 24:
+            format = glp.isGL2GL3() ? GL2GL3.GL_BGR : GL.GL_RGB;
             break;
         case 32:
             boolean useBGRA = glp.isGL2GL3();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java
index 88018edbe..0299531b1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java
index 55527cef5..35b8efa72 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
index 6e2f1b992..f23cb74bf 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
index 89d0d20a1..438ab6cc2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -113,7 +113,7 @@ public class IIOTextureWriter implements TextureWriter {
 
             return ImageIO.write(image, IOUtil.getFileSuffix(file), file);
         }
-      
+
         throw new IOException("ImageIO writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL2.java b/src/jogl/classes/javax/media/opengl/DebugGL2.java
index 05bcf3d5e..3c064a18f 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL2.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL2.java
@@ -10,7 +10,7 @@ package javax.media.opengl;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new DebugGL(drawable.getGL()));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL3.java b/src/jogl/classes/javax/media/opengl/DebugGL3.java
index c17f90667..b490a63f4 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL3.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL3.java
@@ -10,7 +10,7 @@ package javax.media.opengl;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new DebugGL(drawable.getGL()));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL3bc.java b/src/jogl/classes/javax/media/opengl/DebugGL3bc.java
index 6e294d42b..1d42afbc6 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL3bc.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL3bc.java
@@ -10,7 +10,7 @@ package javax.media.opengl;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new DebugGL(drawable.getGL()));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL4.java b/src/jogl/classes/javax/media/opengl/DebugGL4.java
index d21d39390..249d850a3 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL4.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL4.java
@@ -10,7 +10,7 @@ package javax.media.opengl;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new DebugGL(drawable.getGL()));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/DebugGLES2.java b/src/jogl/classes/javax/media/opengl/DebugGLES2.java
index dee363c1b..6d666d82a 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGLES2.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGLES2.java
@@ -10,7 +10,7 @@ package javax.media.opengl;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new DebugGL(drawable.getGL()));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
index b0f3da8e4..7e243471e 100644
--- a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
+++ b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -91,7 +91,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
       Debug.initSingleton();
       DEBUG = Debug.isPropertyDefined("jogl.debug.CapabilitiesChooser", true);
   }
-  
+
   private final static int NO_SCORE = -9999999;
   private final static int DOUBLE_BUFFER_MISMATCH_PENALTY = 1000;
   private final static int OPAQUE_MISMATCH_PENALTY = 750;
@@ -106,7 +106,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
   private final static int ACCUM_MISMATCH_PENALTY_SCALE     = 1;
   private final static int STENCIL_MISMATCH_PENALTY_SCALE   = 3;
   private final static int MULTISAMPLE_MISMATCH_PENALTY_SCALE   = 3;
-  
+
   @Override
   public int chooseCapabilities(final CapabilitiesImmutable desired,
                                 final List<? extends CapabilitiesImmutable> available,
@@ -143,12 +143,12 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
 
     // Create score array
     int[] scores = new int[availnum];
-    
+
     for (int i = 0; i < scores.length; i++) {
       scores[i] = NO_SCORE;
     }
     final int gldes_samples = gldes.getNumSamples();
-    
+
     // Compute score for each
     for (int i = 0; i < availnum; i++) {
       final GLCapabilitiesImmutable cur = (GLCapabilitiesImmutable) available.get(i);
@@ -165,24 +165,24 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
           }  */
           if (gldes.isPBuffer() && !cur.isPBuffer()) {
             continue; // requested pBuffer, but n/a
-          }          
+          }
           if (gldes.isBitmap() && !cur.isBitmap()) {
             continue; // requested pBuffer, but n/a
-          }          
+          }
       }
       if (gldes.getStereo() != cur.getStereo()) {
         continue;
       }
       final int cur_samples = cur.getNumSamples() ;
       int score = 0;
-              
+
       // Compute difference in color depth
       // (Note that this decides the direction of all other penalties)
       score += (COLOR_MISMATCH_PENALTY_SCALE *
                 ((cur.getRedBits() + cur.getGreenBits() + cur.getBlueBits() + cur.getAlphaBits()) -
                  (gldes.getRedBits() + gldes.getGreenBits() + gldes.getBlueBits() + gldes.getAlphaBits())));
       // Compute difference in depth buffer depth
-      score += (DEPTH_MISMATCH_PENALTY_SCALE * sign(score) * 
+      score += (DEPTH_MISMATCH_PENALTY_SCALE * sign(score) *
                 Math.abs(cur.getDepthBits() - gldes.getDepthBits()));
       // Compute difference in accumulation buffer depth
       score += (ACCUM_MISMATCH_PENALTY_SCALE * sign(score) *
@@ -261,7 +261,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
       System.err.println(" ]");
     }
 
-    // Ready to select. Choose score closest to 0. 
+    // Ready to select. Choose score closest to 0.
     int scoreClosestToZero = NO_SCORE;
     int chosenIndex = -1;
     for (int i = 0; i < availnum; i++) {
diff --git a/src/jogl/classes/javax/media/opengl/FPSCounter.java b/src/jogl/classes/javax/media/opengl/FPSCounter.java
index 9c07b58e4..4997258e0 100644
--- a/src/jogl/classes/javax/media/opengl/FPSCounter.java
+++ b/src/jogl/classes/javax/media/opengl/FPSCounter.java
@@ -36,28 +36,28 @@ import java.io.PrintStream;
  */
 public interface FPSCounter {
     public static final int DEFAULT_FRAMES_PER_INTERVAL = 5*60;
-    
+
     /**
-     * @param frames Update interval in frames.<br> At every rendered <i>frames</i> interval the currentTime and fps values are updated. 
+     * @param frames Update interval in frames.<br> At every rendered <i>frames</i> interval the currentTime and fps values are updated.
      *        If the <i>frames</i> interval is <= 0, no update will be issued, ie the FPSCounter feature is turned off. You may choose {@link #DEFAULT_FRAMES_PER_INTERVAL}.
-     * @param out optional print stream where the fps values gets printed if not null at every <i>frames</i> interval 
+     * @param out optional print stream where the fps values gets printed if not null at every <i>frames</i> interval
      */
     void setUpdateFPSFrames(int frames, PrintStream out);
-    
+
     /**
      * Reset all performance counter (startTime, currentTime, frame number)
      */
     void resetFPSCounter();
-    
+
     /**
      * @return update interval in frames
-     * 
+     *
      * @see #setUpdateFPSFrames(int, PrintStream)
      */
     int getUpdateFPSFrames();
-    
+
     /**
-     * Returns the time of the first display call in milliseconds after enabling this feature via {@link #setUpdateFPSFrames(int, PrintStream)}.<br> 
+     * Returns the time of the first display call in milliseconds after enabling this feature via {@link #setUpdateFPSFrames(int, PrintStream)}.<br>
      * This value is reset via {@link #resetFPSCounter()}.
      *
      * @see #setUpdateFPSFrames(int, PrintStream)
@@ -81,18 +81,18 @@ public interface FPSCounter {
      * @see #resetFPSCounter()
      */
     long getLastFPSPeriod();
-    
+
     /**
      * @return Last update interval's frames per seconds, {@link #getUpdateFPSFrames()} / {@link #getLastFPSPeriod()}
-     * 
+     *
      * @see #setUpdateFPSFrames(int, PrintStream)
      * @see #resetFPSCounter()
      */
-    float getLastFPS(); 
-    
+    float getLastFPS();
+
     /**
      * @return Number of frame rendered since {@link #getFPSStartTime()} up to {@link #getLastFPSUpdateTime()}
-     *  
+     *
      * @see #setUpdateFPSFrames(int, PrintStream)
      * @see #resetFPSCounter()
      */
@@ -108,10 +108,10 @@ public interface FPSCounter {
 
 
     /**
-     * @return Total frames per seconds, {@link #getTotalFPSFrames()} / {@link #getTotalFPSDuration()} 
-     * 
+     * @return Total frames per seconds, {@link #getTotalFPSFrames()} / {@link #getTotalFPSDuration()}
+     *
      * @see #setUpdateFPSFrames(int, PrintStream)
      * @see #resetFPSCounter()
      */
-    float getTotalFPS();       
+    float getTotalFPS();
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
index a72403eae..827145654 100644
--- a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
+++ b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
@@ -29,7 +29,7 @@
 package javax.media.opengl;
 
 /**
- * An animator control interface, 
+ * An animator control interface,
  * which implementation may drive a {@link javax.media.opengl.GLAutoDrawable} animation.
  */
 public interface GLAnimatorControl extends FPSCounter {
@@ -56,8 +56,8 @@ public interface GLAnimatorControl extends FPSCounter {
     boolean isAnimating();
 
     /**
-     * Indicates whether this animator {@link #isStarted() is started} 
-     * and either {@link #pause() manually paused} or paused 
+     * Indicates whether this animator {@link #isStarted() is started}
+     * and either {@link #pause() manually paused} or paused
      * automatically due to no {@link #add(GLAutoDrawable) added} {@link GLAutoDrawable}s.
      *
      * @see #start()
@@ -157,15 +157,15 @@ public interface GLAnimatorControl extends FPSCounter {
     /**
      * Adds a drawable to this animator's list of rendering drawables.
      * <p>
-     * This allows the animator thread to become {@link #isAnimating() animating}, 
+     * This allows the animator thread to become {@link #isAnimating() animating},
      * in case the first drawable is added and the animator {@link #isStarted() is started}.
      * </p>
-     * 
+     *
      * @param drawable the drawable to be added
      * @throws IllegalArgumentException if drawable was already added to this animator
      */
     void add(GLAutoDrawable drawable);
-    
+
     /**
      * Removes a drawable from the animator's list of rendering drawables.
      * <p>
@@ -173,10 +173,10 @@ public interface GLAnimatorControl extends FPSCounter {
      * and will not be recovered.
      * </p>
      * <p>
-     * This allows the animator thread to become {@link #isAnimating() not animating}, 
+     * This allows the animator thread to become {@link #isAnimating() not animating},
      * in case the last drawable has been removed.
      * </p>
-     * 
+     *
      * @param drawable the drawable to be removed
      * @throws IllegalArgumentException if drawable was not added to this animator
      */
diff --git a/src/jogl/classes/javax/media/opengl/GLArrayData.java b/src/jogl/classes/javax/media/opengl/GLArrayData.java
index 8e1383031..4025170cf 100644
--- a/src/jogl/classes/javax/media/opengl/GLArrayData.java
+++ b/src/jogl/classes/javax/media/opengl/GLArrayData.java
@@ -43,7 +43,7 @@ public interface GLArrayData {
      * Implementation and type dependent object association.
      * <p>
      * One currently known use case is to associate a {@link com.jogamp.opengl.util.glsl.ShaderState ShaderState}
-     * to an GLSL aware vertex attribute object, allowing to use the ShaderState to handle it's 
+     * to an GLSL aware vertex attribute object, allowing to use the ShaderState to handle it's
      * data persistence, location and state change.<br/>
      * This is implicitly done via {@link com.jogamp.opengl.util.glsl.ShaderState#ownAttribute(GLArrayData, boolean) shaderState.ownAttribute(GLArrayData, boolean)}.
      * </p>
@@ -51,7 +51,7 @@ public interface GLArrayData {
      * @param enable pass true to enable the association and false to disable it.
      */
     public void associate(Object obj, boolean enable);
-    
+
     /**
      * Returns true if this data set is intended for a GLSL vertex shader attribute,
      * otherwise false, ie intended for fixed function vertex pointer
@@ -110,7 +110,7 @@ public interface GLArrayData {
      *         &lt;0 denotes an invalid location, i.e. not found or used in the given shader program.
      */
     public int setLocation(GL2ES2 gl, int program);
-    
+
     /**
      * Binds the location of the shader attribute to the given location for the unlinked shader program.
      * <p>
@@ -121,7 +121,7 @@ public interface GLArrayData {
      * @return the given location
      */
     public int setLocation(GL2ES2 gl, int program, int location);
-    
+
     /**
      * Determines whether the data is server side (VBO) and enabled,
      * or a client side array (false).
@@ -150,7 +150,7 @@ public interface GLArrayData {
      */
     public int getVBOTarget();
 
-    
+
     /**
      * The Buffer holding the data, may be null if a GPU buffer without client bound data
      */
@@ -179,7 +179,7 @@ public interface GLArrayData {
      * In case the buffer's position is 0 (sealed, flipped), it's based on it's limit instead of it's position.
      */
     public int getElementCount();
-    
+
     /**
      * The currently used size in bytes.<br>
      * In case the buffer's position is 0 (sealed, flipped), it's based on it's limit instead of it's position.
@@ -187,18 +187,18 @@ public interface GLArrayData {
     public int getSizeInBytes();
 
     /**
-     * True, if GL shall normalize fixed point data while converting 
+     * True, if GL shall normalize fixed point data while converting
      * them into float.
-     * <p> 
+     * <p>
      * Default behavior (of the fixed function pipeline) is <code>true</code>
      * for fixed point data type and <code>false</code> for floating point data types.
      * </p>
      */
     public boolean getNormalized();
 
-    /** 
+    /**
      * @return the byte offset between consecutive components
-     */      
+     */
     public int getStride();
 
     public String toString();
diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
index 989a61aaf..38824ce8f 100644
--- a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
@@ -50,8 +50,8 @@ import jogamp.opengl.Debug;
     rendering context which is associated with the GLAutoDrawable for
     the lifetime of the object.
     <p>
-    Since the {@link GLContext} {@link GLContext#makeCurrent makeCurrent} 
-    implementation is synchronized, i.e. blocks if the context 
+    Since the {@link GLContext} {@link GLContext#makeCurrent makeCurrent}
+    implementation is synchronized, i.e. blocks if the context
     is current on another thread, the internal
     {@link GLContext} for the GLAutoDrawable can be used for the event
     based rendering mechanism and by end users directly.
@@ -123,7 +123,7 @@ public interface GLAutoDrawable extends GLDrawable {
    * otherwise return <code>this</code> instance.
    */
   public GLDrawable getDelegatedDrawable();
-  
+
   /**
    * Returns the context associated with this drawable. The returned
    * context will be synchronized.
@@ -135,38 +135,38 @@ public interface GLAutoDrawable extends GLDrawable {
    * Associate the new context, <code>newtCtx</code>, to this auto-drawable.
    * <p>
    * The current context will be destroyed if <code>destroyPrevCtx</code> is <code>true</code>,
-   * otherwise it will be dis-associated from this auto-drawable 
+   * otherwise it will be dis-associated from this auto-drawable
    * via {@link GLContext#setGLDrawable(GLDrawable, boolean) setGLDrawable(null, true);} first.
    * </p>
    * <p>
-   * The new context will be associated with this auto-drawable 
+   * The new context will be associated with this auto-drawable
    * via {@link GLContext#setGLDrawable(GLDrawable, boolean) newCtx.setGLDrawable(drawable, true);}.
-   * </p> 
+   * </p>
    * <p>
    * If the old or new context was current on this thread, it is being released before switching the association.
-   * The new context will be made current afterwards, if it was current before. 
+   * The new context will be made current afterwards, if it was current before.
    * However the user shall take extra care that no other thread
    * attempts to make this context current.
    * </p>
-   * 
+   *
    * @param newCtx the new context, maybe <code>null</code> for dis-association.
-   * @param destroyPrevCtx if <code>true</code>, destroy the previous context if exists  
+   * @param destroyPrevCtx if <code>true</code>, destroy the previous context if exists
    * @return the previous GLContext, maybe <code>null</code>
-   *  
+   *
    * @see GLContext#setGLDrawable(GLDrawable, boolean)
    * @see GLContext#setGLReadDrawable(GLDrawable)
    * @see jogamp.opengl.GLDrawableHelper#switchContext(GLDrawable, GLContext, boolean, GLContext, int)
    */
   public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx);
-  
+
   /**
    * Adds the given {@link GLEventListener listener} to the end of this drawable queue.
    * The {@link GLEventListener listeners} are notified of events in the order of the queue.
    * <p>
-   * The newly added listener's {@link GLEventListener#init(GLAutoDrawable) init(..)} 
+   * The newly added listener's {@link GLEventListener#init(GLAutoDrawable) init(..)}
    * method will be called once before any other of it's callback methods.
    * See {@link #getGLEventListenerInitState(GLEventListener)} for details.
-   * </p> 
+   * </p>
    * @param listener The GLEventListener object to be inserted
    */
   public void addGLEventListener(GLEventListener listener);
@@ -175,10 +175,10 @@ public interface GLAutoDrawable extends GLDrawable {
    * Adds the given {@link GLEventListener listener} at the given index of this drawable queue.
    * The {@link GLEventListener listeners} are notified of events in the order of the queue.
    * <p>
-   * The newly added listener's {@link GLEventListener#init(GLAutoDrawable) init(..)} 
+   * The newly added listener's {@link GLEventListener#init(GLAutoDrawable) init(..)}
    * method will be called once before any other of it's callback methods.
    * See {@link #getGLEventListenerInitState(GLEventListener)} for details.
-   * </p> 
+   * </p>
    * @param index Position where the listener will be inserted.
    *              Should be within (0 <= index && index <= size()).
    *              An index value of -1 is interpreted as the end of the list, size().
@@ -192,7 +192,7 @@ public interface GLAutoDrawable extends GLDrawable {
    * @return The number of GLEventListener objects of this drawable queue.
    */
   public int getGLEventListenerCount();
-  
+
   /**
    * Returns the {@link GLEventListener} at the given index of this drawable queue.
    * @param index Position of the listener to be returned.
@@ -202,18 +202,18 @@ public interface GLAutoDrawable extends GLDrawable {
    * @throws IndexOutOfBoundsException If the index is not within (0 <= index && index < size()), or -1
    */
   public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException;
-  
+
   /**
    * Retrieves whether the given {@link GLEventListener listener} is initialized or not.
    * <p>
-   * After {@link #addGLEventListener(GLEventListener) adding} a {@link GLEventListener} it is 
+   * After {@link #addGLEventListener(GLEventListener) adding} a {@link GLEventListener} it is
    * marked <i>uninitialized</i> and added to a list of to be initialized {@link GLEventListener}.
-   * If such <i>uninitialized</i> {@link GLEventListener}'s handler methods (reshape, display) 
+   * If such <i>uninitialized</i> {@link GLEventListener}'s handler methods (reshape, display)
    * are about to be invoked, it's {@link GLEventListener#init(GLAutoDrawable) init(..)} method is invoked first.
    * Afterwards the {@link GLEventListener} is marked <i>initialized</i>
    * and removed from the list of to be initialized {@link GLEventListener}.
    * </p>
-   * <p> 
+   * <p>
    * This methods returns the {@link GLEventListener} initialized state,
    * i.e. returns <code>false</code> if it is included in the list of to be initialized {@link GLEventListener},
    * otherwise <code>true</code>.
@@ -221,17 +221,17 @@ public interface GLAutoDrawable extends GLDrawable {
    * @param listener the GLEventListener object to query it's initialized state.
    */
   public boolean getGLEventListenerInitState(GLEventListener listener);
-  
+
   /**
    * Sets the given {@link GLEventListener listener's} initialized state.
-   * <p> 
+   * <p>
    * This methods allows manually setting the {@link GLEventListener} initialized state,
    * i.e. adding it to, or removing it from the list of to be initialized {@link GLEventListener}.
    * See {@link #getGLEventListenerInitState(GLEventListener)} for details.
    * </p>
    * <p>
    * <b>Warning:</b> This method does not validate whether the given {@link GLEventListener listener's}
-   * is member of this drawable queue, i.e. {@link #addGLEventListener(GLEventListener) added}. 
+   * is member of this drawable queue, i.e. {@link #addGLEventListener(GLEventListener) added}.
    * </p>
    * <p>
    * This method is only exposed to allow users full control over the {@link GLEventListener}'s state
@@ -239,16 +239,16 @@ public interface GLAutoDrawable extends GLDrawable {
    * </p>
    * <p>
    * One use case is moving a {@link GLContext} and their initialized {@link GLEventListener}
-   * from one {@link GLAutoDrawable} to another, 
+   * from one {@link GLAutoDrawable} to another,
    * where a subsequent {@link GLEventListener#init(GLAutoDrawable) init(..)} call after adding it
-   * to the new owner is neither required nor desired. 
+   * to the new owner is neither required nor desired.
    * See {@link com.jogamp.opengl.util.GLDrawableUtil#swapGLContextAndAllGLEventListener(GLAutoDrawable, GLAutoDrawable) swapGLContextAndAllGLEventListener(..)}.
    * </p>
    * @param listener the GLEventListener object to perform a state change.
-   * @param initialized if <code>true</code>, mark the listener initialized, otherwise uninitialized. 
+   * @param initialized if <code>true</code>, mark the listener initialized, otherwise uninitialized.
    */
   public void setGLEventListenerInitState(GLEventListener listener, boolean initialized);
-  
+
   /**
    * Disposes the given {@link GLEventListener listener} via {@link GLEventListener#dispose(GLAutoDrawable) dispose(..)}
    * if it has been initialized and added to this queue.
@@ -257,7 +257,7 @@ public interface GLAutoDrawable extends GLDrawable {
    * otherwise marked uninitialized.
    * </p>
    * <p>
-   * If an {@link GLAnimatorControl} is being attached and the current thread is different 
+   * If an {@link GLAnimatorControl} is being attached and the current thread is different
    * than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
    * </p>
    * <p>
@@ -268,8 +268,8 @@ public interface GLAutoDrawable extends GLDrawable {
    * Use {@link #removeGLEventListener(GLEventListener) removeGLEventListener(listener)} instead
    * if you just want to remove the {@link GLEventListener listener} and <i>don't care</i> about the disposal of the it's (OpenGL) resources.
    * </p>
-   * <p> 
-   * Also note that this is done from within a particular drawable's 
+   * <p>
+   * Also note that this is done from within a particular drawable's
    * {@link GLEventListener} handler (reshape, display, etc.), that it is not
    * guaranteed that all other listeners will be evaluated properly
    * during this update cycle.
@@ -277,30 +277,30 @@ public interface GLAutoDrawable extends GLDrawable {
    * @param listener The GLEventListener object to be disposed and removed if <code>remove</code> is <code>true</code>
    * @param remove pass <code>true</code> to have the <code>listener</code> removed from this drawable queue, otherwise pass <code>false</code>
    * @return the disposed and/or removed GLEventListener, or null if no action was performed, i.e. listener was not added
-   */  
+   */
   public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove);
-  
-  /** 
+
+  /**
    * Removes the given {@link GLEventListener listener} from this drawable queue.
    * <p>
-   * This is an inexpensive operation, since the removed listener's 
+   * This is an inexpensive operation, since the removed listener's
    * {@link GLEventListener#dispose(GLAutoDrawable) dispose(..)} method will <i>not</i> be called.
    * </p>
    * <p>
-   * Use {@link #disposeGLEventListener(GLEventListener, boolean) disposeGLEventListener(listener, true)} 
+   * Use {@link #disposeGLEventListener(GLEventListener, boolean) disposeGLEventListener(listener, true)}
    * instead to ensure disposal of the {@link GLEventListener listener}'s (OpenGL) resources.
-   * </p> 
-   * <p> 
-   * Note that if this is done from within a particular drawable's 
+   * </p>
+   * <p>
+   * Note that if this is done from within a particular drawable's
    * {@link GLEventListener} handler (reshape, display, etc.), that it is not
    * guaranteed that all other listeners will be evaluated properly
    * during this update cycle.
    * </p>
    * @param listener The GLEventListener object to be removed
    * @return the removed GLEventListener, or null if listener was not added
-   */  
+   */
   public GLEventListener removeGLEventListener(GLEventListener listener);
-  
+
   /**
    * Registers the usage of an animator, an {@link javax.media.opengl.GLAnimatorControl} implementation.
    * The animator will be queried whether it's animating, ie periodically issuing {@link #display()} calls or not.
@@ -334,17 +334,17 @@ public interface GLAutoDrawable extends GLDrawable {
   /**
    * Dedicates this instance's {@link GLContext} to the given thread.<br/>
    * The thread will exclusively claim the {@link GLContext} via {@link #display()} and not release it
-   * until {@link #destroy()} or <code>setExclusiveContextThread(null)</code> has been called. 
+   * until {@link #destroy()} or <code>setExclusiveContextThread(null)</code> has been called.
    * <p>
    * Default non-exclusive behavior is <i>requested</i> via <code>setExclusiveContextThread(null)</code>,
-   * which will cause the next call of {@link #display()} on the exclusive thread to 
-   * release the {@link GLContext}. Only after it's async release, {@link #getExclusiveContextThread()} 
+   * which will cause the next call of {@link #display()} on the exclusive thread to
+   * release the {@link GLContext}. Only after it's async release, {@link #getExclusiveContextThread()}
    * will return <code>null</code>.
    * </p>
    * <p>
    * To release a previous made exclusive thread, a user issues <code>setExclusiveContextThread(null)</code>
-   * and may poll {@link #getExclusiveContextThread()} until it returns <code>null</code>, 
-   * <i>while</i> the exclusive thread is still running.  
+   * and may poll {@link #getExclusiveContextThread()} until it returns <code>null</code>,
+   * <i>while</i> the exclusive thread is still running.
    * </p>
    * <p>
    * Note: Setting a new exclusive thread without properly releasing a previous one
@@ -359,17 +359,17 @@ public interface GLAutoDrawable extends GLDrawable {
    * and spare redundant context switches, see {@link com.jogamp.opengl.util.AnimatorBase#setExclusiveContext(boolean)}.
    * </p>
    * @param t the exclusive thread to claim the context, or <code>null</code> for default operation.
-   * @return previous exclusive context thread 
+   * @return previous exclusive context thread
    * @throws GLException If an exclusive thread is still active but a new one is attempted to be set
    * @see com.jogamp.opengl.util.AnimatorBase#setExclusiveContext(boolean)
    */
   public Thread setExclusiveContextThread(Thread t) throws GLException;
-  
+
   /**
-   * @see #setExclusiveContextThread(Thread) 
+   * @see #setExclusiveContextThread(Thread)
    */
   public Thread getExclusiveContextThread();
-  
+
   /**
    * Enqueues a one-shot {@link GLRunnable},
    * which will be executed within the next {@link #display()} call
@@ -391,7 +391,7 @@ public interface GLAutoDrawable extends GLDrawable {
    * has been executed by the {@link GLAnimatorControl animator}, otherwise the method returns immediately.
    * </p>
    * <p>
-   * If <code>wait</code> is <code>true</code> <b>and</b> 
+   * If <code>wait</code> is <code>true</code> <b>and</b>
    * {@link #isRealized()} returns <code>false</code> <i>or</i> {@link #getContext()} returns <code>null</code>,
    * the call is ignored and returns <code>false</code>.<br>
    * This helps avoiding deadlocking the caller.
@@ -404,16 +404,16 @@ public interface GLAutoDrawable extends GLDrawable {
    * @param wait if <code>true</code> block until execution of <code>glRunnable</code> is finished, otherwise return immediately w/o waiting
    * @param glRunnable the {@link GLRunnable} to execute within {@link #display()}
    * @return <code>true</code> if the {@link GLRunnable} has been processed or queued, otherwise <code>false</code>.
-   * 
+   *
    * @see #setAnimator(GLAnimatorControl)
    * @see #display()
    * @see GLRunnable
    * @see #invoke(boolean, List)
    */
   public boolean invoke(boolean wait, GLRunnable glRunnable);
-  
+
   /**
-   * Extends {@link #invoke(boolean, GLRunnable)} functionality 
+   * Extends {@link #invoke(boolean, GLRunnable)} functionality
    * allowing to inject a list of {@link GLRunnable}s.
    * @param wait if <code>true</code> block until execution of the last <code>glRunnable</code> is finished, otherwise return immediately w/o waiting
    * @param glRunnables the {@link GLRunnable}s to execute within {@link #display()}
@@ -494,16 +494,16 @@ public interface GLAutoDrawable extends GLDrawable {
    * <p>
    * This GLAutoDrawable implementation holds it's own GLContext reference,
    * thus created a GLContext using this methods won't replace it implicitly.
-   * To replace or set this GLAutoDrawable's GLContext you need to call {@link #setContext(GLContext, boolean)}. 
+   * To replace or set this GLAutoDrawable's GLContext you need to call {@link #setContext(GLContext, boolean)}.
    * </p>
    * <p>
-   * The GLAutoDrawable implementation shall also set the 
-   * context creation flags as customized w/ {@link #setContextCreationFlags(int)}. 
+   * The GLAutoDrawable implementation shall also set the
+   * context creation flags as customized w/ {@link #setContextCreationFlags(int)}.
    * </p>
    */
   @Override
   public GLContext createContext(GLContext shareWith);
-  
+
   /** Returns the {@link GL} pipeline object this GLAutoDrawable uses.
       If this method is called outside of the {@link
       GLEventListener}'s callback methods (init, display, etc.) it may
@@ -522,13 +522,13 @@ public interface GLAutoDrawable extends GLDrawable {
       demos for examples.
       @return the set GL pipeline or null if not successful */
   public GL setGL(GL gl);
-  
+
   /**
    * Method <i>may</i> return the upstream UI toolkit object
    * holding this {@link GLAutoDrawable} instance, if exist.
    * <p>
    * Currently known Java UI toolkits and it's known return types are:
-   * 
+   *
    * <table border="1">
    *     <tr><td>Toolkit</td>  <td>GLAutoDrawable Implementation</td>            <td>~</td>      <td>Return Type of getUpstreamWidget()</td</tr>
    *     <tr><td>NEWT</td>     <td>{@link com.jogamp.newt.opengl.GLWindow}</td>  <td>has a</td>  <td>{@link com.jogamp.newt.Window}</td</tr>
@@ -536,7 +536,7 @@ public interface GLAutoDrawable extends GLDrawable {
    *     <tr><td>AWT</td>      <td>{@link javax.media.opengl.awt.GLCanvas}</td>  <td>is a</td>   <td>{@link java.awt.Canvas}</td</tr>
    *     <tr><td>AWT</td>      <td>{@link javax.media.opengl.awt.GLJPanel}</td>  <td>is a</td>   <td>{@link javax.swing.JPanel}</td</tr>
    * </table>
-   * However, the result may be other object types than the listed above 
+   * However, the result may be other object types than the listed above
    * due to new supported toolkits.
    * </p>
    * <p>
diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java
index 1f75a7b4a..e84dd7be9 100644
--- a/src/jogl/classes/javax/media/opengl/GLBase.java
+++ b/src/jogl/classes/javax/media/opengl/GLBase.java
@@ -32,7 +32,7 @@ package javax.media.opengl;
 /**
  * <P>The base interface from which all GL profiles derive, providing
  * checked conversion down to concrete profiles, access to the
- * OpenGL context associated with the GL and extension/function 
+ * OpenGL context associated with the GL and extension/function
  * availability queries as described below.</P>
  *
  * <P> While the APIs for vendor extensions are unconditionally
@@ -79,7 +79,7 @@ package javax.media.opengl;
  *
  */
 public interface GLBase {
-    
+
   /**
    * Indicates whether this GL object conforms to any of the OpenGL profiles.
    */
@@ -131,7 +131,7 @@ public interface GLBase {
    * <p>
    * Remark: ES2 compatible desktop profiles are not included.
    * To query whether core ES2 functionality is provided, use {@link #isGLES2Compatible()}.
-   * </p> 
+   * </p>
    * @see #isGLES2Compatible()
    * @see GLContext#isGLES2()
    */
@@ -142,12 +142,12 @@ public interface GLBase {
    * <p>
    * Remark: ES3 compatible desktop profiles are not included.
    * To query whether core ES3 functionality is provided, use {@link #isGLES3Compatible()}.
-   * </p> 
+   * </p>
    * @see #isGLES3Compatible()
    * @see GLContext#isGLES3()
    */
   public boolean isGLES3();
-  
+
   /**
    * Indicates whether this GL object conforms to one of the OpenGL ES profiles,
    * see {@link #isGLES1()} and {@link #isGLES2()}.
@@ -180,7 +180,7 @@ public interface GLBase {
   public boolean isGL3ES3();
 
   /**
-   * Returns true if this GL object conforms to a GL4ES3 compatible profile, i.e. if {@link #isGLES3Compatible()} returns true. 
+   * Returns true if this GL object conforms to a GL4ES3 compatible profile, i.e. if {@link #isGLES3Compatible()} returns true.
    * <p>Includes [ GL &ge; 4.3, GL &ge; 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]</p>
    * @see GLContext#isGL4ES3()
    */
@@ -192,29 +192,29 @@ public interface GLBase {
    */
   public boolean isGL2GL3();
 
-  /** 
+  /**
    * Indicates whether this GL object uses a GL4 core profile. <p>Includes [ GL4 ].</p>
    * @see GLContext#isGL4core()
    */
   public boolean isGL4core();
-  
-  /** 
+
+  /**
    * Indicates whether this GL object uses a GL3 core profile. <p>Includes [ GL4, GL3 ].</p>
    * @see GLContext#isGL3core()
    */
   public boolean isGL3core();
-  
-  /** 
+
+  /**
    * Indicates whether this GL object uses a GL core profile. <p>Includes [ GL4, GL3, GLES3, GL2ES2 ].</p>
    * @see GLContext#isGLcore()
    */
   public boolean isGLcore();
-  
+
   /**
    * Indicates whether this GL object is compatible with the core OpenGL ES2 functionality.
-   * @return true if this context is an ES2 context or implements 
+   * @return true if this context is an ES2 context or implements
    *         the extension <code>GL_ARB_ES2_compatibility</code>, otherwise false
-   * @see GLContext#isGLES2Compatible() 
+   * @see GLContext#isGLES2Compatible()
    */
   public boolean isGLES2Compatible();
 
@@ -227,26 +227,26 @@ public interface GLBase {
    * <p>
    * Includes [ GL &ge; 4.3, GL &ge; 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]
    * </p>
-   * @see GLContext#isGLES3Compatible() 
+   * @see GLContext#isGLES3Compatible()
    */
   public boolean isGLES3Compatible();
 
-  /** 
-   * Indicates whether this GL object supports GLSL. 
-   * @see GLContext#hasGLSL() 
+  /**
+   * Indicates whether this GL object supports GLSL.
+   * @see GLContext#hasGLSL()
    */
   public boolean hasGLSL();
 
   /**
    * Returns the downstream GL instance in case this is a wrapping pipeline, otherwise <code>null</code>.
    * <p>
-   * See {@link #getRootGL()} for retrieving the implementing root instance. 
+   * See {@link #getRootGL()} for retrieving the implementing root instance.
    * </p>
    * @throws GLException if the downstream instance is not null and not a GL implementation
    * @see #getRootGL()
    */
   public GL getDownstreamGL() throws GLException;
-  
+
   /**
    * Returns the implementing root instance, considering a wrapped pipelined hierarchy, see {@link #getDownstreamGL()}.
    * <p>
@@ -256,7 +256,7 @@ public interface GLBase {
    * @throws GLException if the root instance is not a GL implementation
    */
   public GL getRootGL() throws GLException;
-  
+
   /**
    * Casts this object to the GL interface.
    * @throws GLException if this object is not a GL implementation
@@ -360,14 +360,14 @@ public interface GLBase {
    /**
     * Returns true if the specified OpenGL core- or extension-function can be
     * used successfully through this GL instance given the current host (OpenGL
-    * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P> 
-    * By "successfully" we mean that the function is both <i>callable</i> 
-    * on the machine running the program and <i>available</i> on the current 
-    * display.<P> 
+    * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P>
+    * By "successfully" we mean that the function is both <i>callable</i>
+    * on the machine running the program and <i>available</i> on the current
+    * display.<P>
     *
     * In order to call a function successfully, the function must be both
-    * <i>callable</i> on the machine running the program and <i>available</i> on 
-    * the display device that is rendering the output (note: on non-networked, 
+    * <i>callable</i> on the machine running the program and <i>available</i> on
+    * the display device that is rendering the output (note: on non-networked,
     * single-display machines these two conditions are identical; on networked and/or
     * multi-display machines this becomes more complicated). These conditions are
     * met if the function is either part of the core OpenGL version supported by
@@ -376,7 +376,7 @@ public interface GLBase {
     *
     * A GL function is <i>callable</i> if it is successfully linked at runtime,
     * hence the GLContext must be made current at least once.
-    * 
+    *
     * @param glFunctionName the name of the OpenGL function (e.g., use
     * "glBindRenderbufferEXT" or "glBindRenderbuffer" to check if {@link
     * GL#glBindRenderbuffer(int,int)} is available).
@@ -386,14 +386,14 @@ public interface GLBase {
    /**
     * Returns true if the specified OpenGL extension can be
     * used successfully through this GL instance given the current host (OpenGL
-    * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P> 
+    * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P>
     *
     * @param glExtensionName the name of the OpenGL extension (e.g.,
     * "GL_ARB_vertex_program").
     */
    public boolean isExtensionAvailable(String glExtensionName);
 
-   /** 
+   /**
     * Returns <code>true</code> if basic FBO support is available, otherwise <code>false</code>.
     * <p>
     * Basic FBO is supported if the context is either GL-ES >= 2.0, GL >= core 3.0 or implements the extensions
@@ -407,12 +407,12 @@ public interface GLBase {
     */
    public boolean hasBasicFBOSupport();
 
-   /** 
+   /**
     * Returns <code>true</code> if full FBO support is available, otherwise <code>false</code>.
     * <p>
     * Full FBO is supported if the context is either GL >= core 3.0 or implements the extensions
     * <code>ARB_framebuffer_object</code>, or all of
-    * <code>EXT_framebuffer_object</code>, <code>EXT_framebuffer_multisample</code>, 
+    * <code>EXT_framebuffer_object</code>, <code>EXT_framebuffer_multisample</code>,
     * <code>EXT_framebuffer_blit</code>, <code>GL_EXT_packed_depth_stencil</code>.
     * </p>
     * <p>
@@ -424,7 +424,7 @@ public interface GLBase {
 
    /**
     * Returns the maximum number of FBO RENDERBUFFER samples
-    * if {@link #hasFullFBOSupport() full FBO is supported}, otherwise false. 
+    * if {@link #hasFullFBOSupport() full FBO is supported}, otherwise false.
     * @see GLContext#getMaxRenderbufferSamples()
     */
    public int getMaxRenderbufferSamples();
@@ -440,7 +440,7 @@ public interface GLBase {
    public boolean isNPOTTextureAvailable();
 
    public boolean isTextureFormatBGRA8888Available();
-   
+
    /** Provides a platform-independent way to specify the minimum swap
        interval for buffer swaps. An argument of 0 disables
        sync-to-vertical-refresh completely, while an argument of 1
@@ -449,7 +449,7 @@ public interface GLBase {
        is usually either 0 or 1. This function is not guaranteed to
        have an effect, and in particular only affects heavyweight
        onscreen components.
-       
+
        @see #getSwapInterval
        @throws GLException if this context is not the current
     */
@@ -458,8 +458,8 @@ public interface GLBase {
    /** Provides a platform-independent way to get the swap
        interval set by {@link #setSwapInterval}. <br>
 
-       If the interval is not set by {@link #setSwapInterval} yet, 
-       -1 is returned, indicating that the platforms default 
+       If the interval is not set by {@link #setSwapInterval} yet,
+       -1 is returned, indicating that the platforms default
        is being used.
 
        @see #setSwapInterval
@@ -498,10 +498,10 @@ public interface GLBase {
     */
    public Object getExtension(String extensionName);
 
-   /** Aliased entrypoint of <code> void {@native glClearDepth}(GLclampd depth); </code> and <code> void {@native glClearDepthf}(GLclampf depth); </code>. */  
+   /** Aliased entrypoint of <code> void {@native glClearDepth}(GLclampd depth); </code> and <code> void {@native glClearDepthf}(GLclampf depth); </code>. */
    public void glClearDepth( double depth );
 
-   /** Aliased entrypoint of <code> void {@native glDepthRange}(GLclampd depth); </code> and <code> void {@native glDepthRangef}(GLclampf depth); </code>. */  
+   /** Aliased entrypoint of <code> void {@native glDepthRange}(GLclampd depth); </code> and <code> void {@native glDepthRangef}(GLclampf depth); </code>. */
    public void glDepthRange(double zNear, double zFar);
 
    /**
@@ -526,44 +526,44 @@ public interface GLBase {
     */
    public boolean glIsVBOElementArrayBound();
 
-   /** 
-    * Return the framebuffer name bound to this context, 
+   /**
+    * Return the framebuffer name bound to this context,
     * see {@link GL#glBindFramebuffer(int, int)}.
     */
    public int getBoundFramebuffer(int target);
 
-   /** 
+   /**
     * Return the default draw framebuffer name.
-    * <p> 
+    * <p>
     * May differ from it's default <code>zero</code>
     * in case an framebuffer object ({@link com.jogamp.opengl.FBObject}) based drawable
     * is being used.
-    * </p> 
+    * </p>
     */
    public int getDefaultDrawFramebuffer();
 
-   /** 
+   /**
     * Return the default read framebuffer name.
-    * <p> 
+    * <p>
     * May differ from it's default <code>zero</code>
     * in case an framebuffer object ({@link com.jogamp.opengl.FBObject}) based drawable
     * is being used.
-    * </p> 
+    * </p>
     */
    public int getDefaultReadFramebuffer();
-   
-   /** 
-    * Returns the default color buffer within the current bound 
+
+   /**
+    * Returns the default color buffer within the current bound
     * {@link #getDefaultReadFramebuffer()}, i.e. GL_READ_FRAMEBUFFER,
-    * which will be used as the source for pixel reading commands, 
+    * which will be used as the source for pixel reading commands,
     * like {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer)} etc.
     * <p>
     * For offscreen framebuffer objects this is {@link GL#GL_COLOR_ATTACHMENT0},
-    * otherwise this is {@link GL#GL_FRONT} for single buffer configurations 
+    * otherwise this is {@link GL#GL_FRONT} for single buffer configurations
     * and {@link GL#GL_BACK} for double buffer configurations.
-    * </p> 
+    * </p>
     */
    public int getDefaultReadBuffer();
-   
+
 }
 
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilities.java b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
index 872069fb8..b825d6388 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilities.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
@@ -99,7 +99,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   }
 
   /**
-   * Copies all {@link GLCapabilities} and {@link Capabilities} values 
+   * Copies all {@link GLCapabilities} and {@link Capabilities} values
    * from <code>source</code> into this instance.
    * @return this instance
    */
@@ -122,11 +122,11 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
     sampleExtension = source.getSampleExtension();
     return this;
   }
-  
+
   @Override
   public int hashCode() {
     // 31 * x == (x << 5) - x
-    int hash = super.hashCode(); 
+    int hash = super.hashCode();
     hash = ((hash << 5) - hash) + this.glProfile.hashCode() ;
     hash = ((hash << 5) - hash) + ( this.hardwareAccelerated ? 1 : 0 );
     hash = ((hash << 5) - hash) + ( this.stereo ? 1 : 0 );
@@ -238,7 +238,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   public void setGLProfile(GLProfile profile) {
     glProfile=profile;
   }
-  
+
   @Override
   public final boolean isPBuffer() {
     return isPBuffer;
@@ -255,7 +255,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
    * <p>
    * Requesting offscreen pbuffer mode disables the offscreen auto selection.
    * </p>
-   */  
+   */
   public void setPBuffer(boolean enable) {
     if(enable) {
       setOnscreen(false);
@@ -267,7 +267,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   public final boolean isFBO() {
       return isFBO;
   }
-  
+
   /**
    * Requesting offscreen FBO mode.
    * <p>
@@ -422,7 +422,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
     return sampleBuffers;
   }
 
-  /** 
+  /**
    * If sample buffers are enabled, indicates the number of buffers
    * to be allocated. Defaults to 2.
    * @see #getNumSamples()
@@ -491,7 +491,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
         if(isOnscreen()) {
             sink.append(".");        // no additional off-screen modes besides on-screen
         } else {
-            sink.append("auto-cfg"); // auto-config off-screen mode            
+            sink.append("auto-cfg"); // auto-config off-screen mode
         }
     }
     sink.append("]");
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java
index 5d575c2ee..2e0bec1f9 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -53,7 +53,7 @@ import javax.media.opengl.GLCapabilitiesImmutable;
     the appropriate method of {@link GLDrawableFactory}; the chooser
     will be called during the OpenGL context creation process. Note
     that this is only a marker interface; its signature is the same as
-    {@link CapabilitiesChooser} and the {@link List} of 
+    {@link CapabilitiesChooser} and the {@link List} of
     objects extending {@link CapabilitiesImmutable}
     passed to {@link #chooseCapabilities chooseCapabilities}
     is actually a {@link List} of type {@link GLCapabilitiesImmutable}. */
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilitiesImmutable.java b/src/jogl/classes/javax/media/opengl/GLCapabilitiesImmutable.java
index 6af35021f..dc28539a0 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilitiesImmutable.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilitiesImmutable.java
@@ -37,13 +37,13 @@ import javax.media.nativewindow.CapabilitiesImmutable;
  * @see javax.media.nativewindow.CapabilitiesImmutable
  */
 public interface GLCapabilitiesImmutable extends CapabilitiesImmutable {
-    /** 
-     * One of the platform's default sample extension 
+    /**
+     * One of the platform's default sample extension
      * <code>EGL.EGL_SAMPLES, GLX.GLX_SAMPLES, WGLExt.WGL_SAMPLES_ARB</code>
      * if available, or any other <i>known</i> fallback one, ie <code>EGLExt.EGL_COVERAGE_SAMPLES_NV</code>
      */
     public static final String DEFAULT_SAMPLE_EXTENSION = "default" ;
-    
+
     /**
      * Returns the GL profile you desire or used by the drawable.
      */
@@ -110,10 +110,10 @@ public interface GLCapabilitiesImmutable extends CapabilitiesImmutable {
      * </p>
      */
     String getSampleExtension();
-    
+
     /**
      * Returns whether sample buffers for full-scene antialiasing
-     * (FSAA) should be allocated for this drawable. 
+     * (FSAA) should be allocated for this drawable.
      * <p>
      * Default is false.
      * </p>
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index f4dbde6b2..bd6867359 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -72,14 +72,14 @@ import com.jogamp.opengl.GLRendererQuirks;
     abstraction provides a stable object which clients can use to
     refer to a given context. */
 public abstract class GLContext {
-  
+
   public static final boolean DEBUG = Debug.debug("GLContext");
   public static final boolean TRACE_SWITCH = Debug.isPropertyDefined("jogl.debug.GLContext.TraceSwitch", true);
-  public static final boolean DEBUG_TRACE_SWITCH = DEBUG || TRACE_SWITCH;  
+  public static final boolean DEBUG_TRACE_SWITCH = DEBUG || TRACE_SWITCH;
 
-  /** 
-   * If <code>true</code> (default), bootstrapping the available GL profiles 
-   * will use the highest compatible GL context for each profile, 
+  /**
+   * If <code>true</code> (default), bootstrapping the available GL profiles
+   * will use the highest compatible GL context for each profile,
    * hence skipping querying lower profiles if a compatible higher one is found:
    * <ul>
    *   <li>4.2-core -> 4.2-core, 3.3-core</li>
@@ -95,17 +95,17 @@ public abstract class GLContext {
    * </ul>
    * Using aliasing speeds up initialization about:
    * <ul>
-   *   <li>Linux x86_64 - Nvidia: 28%,  700ms down to 500ms</li> 
-   *   <li>Linux x86_64 - AMD   : 40%, 1500ms down to 900ms</li> 
+   *   <li>Linux x86_64 - Nvidia: 28%,  700ms down to 500ms</li>
+   *   <li>Linux x86_64 - AMD   : 40%, 1500ms down to 900ms</li>
    * <p>
    * Can be turned off with property <code>jogl.debug.GLContext.NoProfileAliasing</code>.
    * </p>
    */
   public static final boolean PROFILE_ALIASING = !Debug.isPropertyDefined("jogl.debug.GLContext.NoProfileAliasing", true);
-  
+
   protected static final boolean FORCE_NO_FBO_SUPPORT = Debug.isPropertyDefined("jogl.fbo.force.none", true);
   protected static final boolean FORCE_MIN_FBO_SUPPORT = Debug.isPropertyDefined("jogl.fbo.force.min", true);
-  
+
   /** Reflects property jogl.debug.DebugGL. If true, the debug pipeline is enabled at context creation. */
   public static final boolean DEBUG_GL = Debug.isPropertyDefined("jogl.debug.DebugGL", true);
   /** Reflects property jogl.debug.TraceGL. If true, the trace pipeline is enabled at context creation. */
@@ -130,31 +130,31 @@ public abstract class GLContext {
   public static final VersionNumber Version140 = new VersionNumber(1, 40, 0);
   /* Version 1.50, i.e. GLSL 1.50 for GL 3.2. */
   public static final VersionNumber Version150 = new VersionNumber(1, 50, 0);
-  
+
   /** Version 3.0. As an OpenGL version, it qualifies for desktop {@link #isGL2()} only, or ES 3.0. */
   public static final VersionNumber Version300 = new VersionNumber(3, 0, 0);
-  
+
   /** Version 3.1. As an OpenGL version, it qualifies for {@link #isGL3core()}, {@link #isGL3bc()} and {@link #isGL3()} */
   public static final VersionNumber Version310 = new VersionNumber(3, 1, 0);
-  
+
   /** Version 3.2. As an OpenGL version, it qualifies for geometry shader */
   public static final VersionNumber Version320 = new VersionNumber(3, 2, 0);
-  
+
   /** Version 4.3. As an OpenGL version, it qualifies for <code>GL_ARB_ES3_compatibility</code> */
   public static final VersionNumber Version430 = new VersionNumber(4, 3, 0);
-  
+
   protected static final VersionNumber Version800 = new VersionNumber(8, 0, 0);
 
   //
   // Cached keys, bits [0..15]
   //
-  
+
   /** Context option bits, full bit mask covering bits [0..15], i.e. <code>0x0000FFFF</code>, {@value}. */
   protected static final int CTX_IMPL_FULL_MASK = 0x0000FFFF;
-  
+
   /** Context option bits, cached bit mask covering 9 bits [0..8], i.e. <code>0x000001FF</code>, {@value}. Leaving 7 bits for non cached options, i.e. 9:7. */
   protected static final int CTX_IMPL_CACHE_MASK = 0x000001FF;
-  
+
   /** <code>ARB_create_context</code> related: created via ARB_create_context. Cache key value. See {@link #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)}. */
   protected static final int CTX_IS_ARB_CREATED  = 1 <<  0;
   /** <code>ARB_create_context</code> related: desktop compatibility profile. Cache key value. See {@link #isGLCompatibilityProfile()}, {@link #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)}. */
@@ -173,14 +173,14 @@ public abstract class GLContext {
   //
   // Non cached keys, bits [9..15]
   //
-  
+
   /** <code>GL_ARB_ES2_compatibility</code> implementation related: Context is compatible w/ ES2. Not a cache key. See {@link #isGLES2Compatible()}, {@link #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)}. */
   protected static final int CTX_IMPL_ES2_COMPAT = 1 <<  9;
 
   /** <code>GL_ARB_ES3_compatibility</code> implementation related: Context is compatible w/ ES3. Not a cache key. See {@link #isGLES3Compatible()}, {@link #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)}. */
   protected static final int CTX_IMPL_ES3_COMPAT = 1 << 10;
-  
-  /** 
+
+  /**
    * Context supports basic FBO, details see {@link #hasBasicFBOSupport()}.
    * Not a cache key.
    * @see #hasBasicFBOSupport()
@@ -188,15 +188,15 @@ public abstract class GLContext {
    */
   protected static final int CTX_IMPL_FBO        = 1 << 11;
 
-  /** 
-   * Context supports <code>OES_single_precision</code>, fp32, fixed function point (FFP) compatibility entry points, 
+  /**
+   * Context supports <code>OES_single_precision</code>, fp32, fixed function point (FFP) compatibility entry points,
    * see {@link #hasFP32CompatAPI()}.
    * Not a cache key.
    * @see #hasFP32CompatAPI()
    * @see #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)
    */
   protected static final int CTX_IMPL_FP32_COMPAT_API = 1 << 12;
-  
+
   private static final ThreadLocal<GLContext> currentContext = new ThreadLocal<GLContext>();
 
   private final HashMap<String, Object> attachedObjects = new HashMap<String, Object>();
@@ -219,9 +219,9 @@ public abstract class GLContext {
   private int currentSwapInterval;
   protected GLRendererQuirks glRendererQuirks;
 
-  /** Did the drawable association changed ? see {@link GLRendererQuirks#NoSetSwapIntervalPostRetarget} */ 
-  protected boolean drawableRetargeted; 
-    
+  /** Did the drawable association changed ? see {@link GLRendererQuirks#NoSetSwapIntervalPostRetarget} */
+  protected boolean drawableRetargeted;
+
   /**
    * @param isInit true if called for class initialization, otherwise false (re-init or destruction).
    */
@@ -242,12 +242,12 @@ public abstract class GLContext {
       drawableRetargeted = false;
   }
 
-  /** 
+  /**
    * Returns the instance of {@link GLRendererQuirks}, allowing one to determine workarounds.
    * @return instance of {@link GLRendererQuirks} if context was made current once, otherwise <code>null</code>.
    */
   public final GLRendererQuirks getRendererQuirks() { return glRendererQuirks; }
-  
+
   /**
    * Returns true if the <code>quirk</code> exist in {@link #getRendererQuirks()}, otherwise false.
    * <p>
@@ -260,10 +260,10 @@ public abstract class GLContext {
    * @param quirk the quirk to be tested, e.g. {@link GLRendererQuirks#NoDoubleBufferedPBuffer}.
    * @throws IllegalArgumentException if the quirk is out of range
    */
-  public final boolean hasRendererQuirk(int quirk) throws IllegalArgumentException { 
-      return null != glRendererQuirks ? glRendererQuirks.exist(quirk) : false ; 
+  public final boolean hasRendererQuirk(int quirk) throws IllegalArgumentException {
+      return null != glRendererQuirks ? glRendererQuirks.exist(quirk) : false ;
   }
-  
+
   /**
    * Sets the read/write drawable for framebuffer operations.
    * <p>
@@ -276,13 +276,13 @@ public abstract class GLContext {
    * attempts to make this context current. Otherwise a race condition may happen.
    * </p>
    * @param readWrite The read/write drawable for framebuffer operations, maybe <code>null</code> to remove association.
-   * @param setWriteOnly Only change the write-drawable, if <code>setWriteOnly</code> is <code>true</code> and 
-   *                     if the {@link #getGLReadDrawable() read-drawable} differs 
-   *                     from the {@link #getGLDrawable() write-drawable}. 
+   * @param setWriteOnly Only change the write-drawable, if <code>setWriteOnly</code> is <code>true</code> and
+   *                     if the {@link #getGLReadDrawable() read-drawable} differs
+   *                     from the {@link #getGLDrawable() write-drawable}.
    *                     Otherwise set both drawables, read and write.
    * @return The previous read/write drawable
    *
-   * @throws GLException in case <code>null</code> is being passed or 
+   * @throws GLException in case <code>null</code> is being passed or
    *                     this context is made current on another thread.
    *
    * @see #isGLReadDrawableAvailable()
@@ -292,13 +292,13 @@ public abstract class GLContext {
    * @see #getGLDrawable()
    */
   public abstract GLDrawable setGLDrawable(GLDrawable readWrite, boolean setWriteOnly);
-  
+
   /**
    * Returns the write-drawable this context uses for framebuffer operations.
    * <p>
    * If the read-drawable has not been changed manually via {@link #setGLReadDrawable(GLDrawable)},
    * it equals to the write-drawable (default).
-   * </p> 
+   * </p>
    * @see #setGLDrawable(GLDrawable, boolean)
    * @see #setGLReadDrawable(GLDrawable)
    */
@@ -336,10 +336,10 @@ public abstract class GLContext {
    * <p>
    * If the read-drawable has not been changed manually via {@link #setGLReadDrawable(GLDrawable)},
    * it equals to the write-drawable (default).
-   * </p> 
+   * </p>
    * @see #isGLReadDrawableAvailable()
    * @see #setGLReadDrawable(GLDrawable)
-   * @see #getGLReadDrawable() 
+   * @see #getGLReadDrawable()
    */
   public abstract GLDrawable getGLReadDrawable();
 
@@ -354,9 +354,9 @@ public abstract class GLContext {
    * </p>
    * <p>
    * A return value of {@link #CONTEXT_CURRENT_NEW}
-   * indicates that that context has been made current for the 1st time, 
+   * indicates that that context has been made current for the 1st time,
    * or that the state of the underlying context or drawable has
-   * changed since the last time this context was current. 
+   * changed since the last time this context was current.
    * In this case, the application may wish to initialize the render state.
    * </p>
    * <p>
@@ -378,7 +378,7 @@ public abstract class GLContext {
    * </p>
    *
    * @return <ul>
-   *           <li>{@link #CONTEXT_CURRENT_NEW} if the context was successfully made current the 1st time,</li> 
+   *           <li>{@link #CONTEXT_CURRENT_NEW} if the context was successfully made current the 1st time,</li>
    *           <li>{@link #CONTEXT_CURRENT} if the context was successfully made current,</li>
    *           <li>{@link #CONTEXT_NOT_CURRENT} if the context could not be made current.</li>
    *         </ul>
@@ -514,7 +514,7 @@ public abstract class GLContext {
   public abstract void destroy();
 
   /**
-   * Returns the implementing root GL instance of this GLContext's GL object, 
+   * Returns the implementing root GL instance of this GLContext's GL object,
    * considering a wrapped pipelined hierarchy, see {@link GLBase#getDownstreamGL()}.
    * @throws GLException if the root instance is not a GL implementation
    * @see GLBase#getRootGL()
@@ -523,7 +523,7 @@ public abstract class GLContext {
    * @see #setGL(GL)
    */
   public abstract GL getRootGL();
-  
+
   /**
    * Returns the GL pipeline object for this GLContext.
    *
@@ -716,16 +716,16 @@ public abstract class GLContext {
   }
 
   /**
-   * Returns this context OpenGL version. 
-   * @see #getGLSLVersionNumber() 
+   * Returns this context OpenGL version.
+   * @see #getGLSLVersionNumber()
    **/
   public final VersionNumber getGLVersionNumber() { return ctxVersion; }
-  /** 
+  /**
    * Returns the vendor's version, i.e. version number at the end of <code>GL_VERSION</code> not being the GL version.
    * <p>
-   * In case no such version exists within <code>GL_VERSION</code>, 
+   * In case no such version exists within <code>GL_VERSION</code>,
    * the {@link VersionNumberString#zeroVersion zero version} instance is returned.
-   * </p> 
+   * </p>
    * <p>
    * The vendor's version is usually the vendor's OpenGL driver version.
    * </p>
@@ -743,31 +743,31 @@ public abstract class GLContext {
    * via {@link GL2ES2#GL_SHADING_LANGUAGE_VERSION} if &ge; ES2.0 or GL2.0,
    * otherwise a static match is being utilized.
    * <p>
-   * The context must have been current once, 
-   * otherwise the {@link VersionNumberString#zeroVersion zero version} instance is returned. 
+   * The context must have been current once,
+   * otherwise the {@link VersionNumberString#zeroVersion zero version} instance is returned.
    * </p>
    * <p>
-   * Examples w/ <code>major.minor</code>: 
+   * Examples w/ <code>major.minor</code>:
    * <pre>
-   *    1.00 (ES 2.0), 1.10 (GL 2.0), 1.20 (GL 2.1), 1.50 (GL 3.2), 
+   *    1.00 (ES 2.0), 1.10 (GL 2.0), 1.20 (GL 2.1), 1.50 (GL 3.2),
    *    3.30 (GL 3.3), 4.00 (GL 4.0), 4.10 (GL 4.1), 4.20 (GL 4.2)
    * </pre >
    * </p>
    * <p>
    * <i>Matching</i> could also refer to the maximum GLSL version usable by this context
    * since <i>normal</i> GL implementations are capable of using a lower GLSL version as well.
-   * The latter is not true on OSX w/ a GL3 context. 
+   * The latter is not true on OSX w/ a GL3 context.
    * </p>
-   * 
-   * @return GLSL version number if context has been made current at least once, 
+   *
+   * @return GLSL version number if context has been made current at least once,
    *         otherwise the {@link VersionNumberString#zeroVersion zero version} instance is returned.
-   *            
+   *
    * @see #getGLVersionNumber()
    */
   public final VersionNumber getGLSLVersionNumber() {
       return ctxGLSLVersion;
   }
-  
+
   /**
    * Returns the GLSL version string as to be used in a shader program, including a terminating newline '\n',
    * i.e. for desktop
@@ -794,10 +794,10 @@ public abstract class GLContext {
           return "";
       }
       final int minor = ctxGLSLVersion.getMinor();
-      final String esSuffix = isGLES() && ctxGLSLVersion.compareTo(Version300) >= 0 ? " es" : ""; 
+      final String esSuffix = isGLES() && ctxGLSLVersion.compareTo(Version300) >= 0 ? " es" : "";
       return "#version " + ctxGLSLVersion.getMajor() + ( minor < 10 ? "0"+minor : minor ) + esSuffix + "\n" ;
   }
-  
+
   protected static final VersionNumber getStaticGLSLVersionNumber(int glMajorVersion, int glMinorVersion, int ctxOptions) {
       if( 0 != ( CTX_PROFILE_ES & ctxOptions ) ) {
           if( 3 > glMajorVersion ) {
@@ -814,13 +814,13 @@ public abstract class GLContext {
           switch ( glMinorVersion ) {
               case 0:  return Version130;  // GL 3.0  ->  GLSL 1.30
               case 1:  return Version140;  // GL 3.1  ->  GLSL 1.40
-              default: return Version150;  // GL 3.2  ->  GLSL 1.50 
+              default: return Version150;  // GL 3.2  ->  GLSL 1.50
           }
       }
       // The new default: GL >= 3.3, ES >= 3.0
       return new VersionNumber(glMajorVersion, glMinorVersion * 10, 0); // GL M.N  ->  GLSL M.N
   }
-  
+
   /**
    * @return true if this context is an ES2 context or implements
    *         the extension <code>GL_ARB_ES3_compatibility</code> or <code>GL_ARB_ES2_compatibility</code>, otherwise false
@@ -840,18 +840,18 @@ public abstract class GLContext {
       return 0 != ( ctxOptions & CTX_IMPL_ES3_COMPAT ) ;
   }
 
-  /** 
+  /**
    * @return true if impl. is a hardware rasterizer, otherwise false.
    * @see #isHardwareRasterizer(AbstractGraphicsDevice, GLProfile)
-   * @see GLProfile#isHardwareRasterizer() 
+   * @see GLProfile#isHardwareRasterizer()
    */
   public final boolean isHardwareRasterizer() {
       return 0 == ( ctxOptions & CTX_IMPL_ACCEL_SOFT ) ;
   }
-  
+
   /**
    * @return true if context supports GLSL, i.e. is either {@link #isGLES2()}, {@link #isGL3()} or {@link #isGL2()} <i>and</i> major-version > 1.
-   * @see GLProfile#hasGLSL() 
+   * @see GLProfile#hasGLSL()
    */
   public final boolean hasGLSL() {
       return isGLES2() ||
@@ -859,7 +859,7 @@ public abstract class GLContext {
              isGL2() && ctxVersion.getMajor()>1 ;
   }
 
-  /** 
+  /**
    * Returns <code>true</code> if basic FBO support is available, otherwise <code>false</code>.
    * <p>
    * Basic FBO is supported if the context is either GL-ES >= 2.0, GL >= core 3.0 or implements the extensions
@@ -875,30 +875,30 @@ public abstract class GLContext {
       return 0 != ( ctxOptions & CTX_IMPL_FBO ) ;
   }
 
-  /** 
-   * Returns <code>true</code> if <code>OES_single_precision</code>, fp32, fixed function point (FFP) compatibility entry points available, 
+  /**
+   * Returns <code>true</code> if <code>OES_single_precision</code>, fp32, fixed function point (FFP) compatibility entry points available,
    * otherwise <code>false</code>.
    * @see #CTX_IMPL_FP32_COMPAT_API
    */
   public final boolean hasFP32CompatAPI() {
       return 0 != ( ctxOptions & CTX_IMPL_FP32_COMPAT_API ) ;
   }
-  
-  /** 
+
+  /**
    * Returns <code>true</code> if full FBO support is available, otherwise <code>false</code>.
    * <p>
    * Full FBO is supported if the context is either GL >= core 3.0 or implements the extensions
    * <code>ARB_framebuffer_object</code>, or all of
-   * <code>EXT_framebuffer_object</code>, <code>EXT_framebuffer_multisample</code>, 
+   * <code>EXT_framebuffer_object</code>, <code>EXT_framebuffer_multisample</code>,
    * <code>EXT_framebuffer_blit</code>, <code>GL_EXT_packed_depth_stencil</code>.
    * </p>
    * <p>
    * Full FBO support includes multiple color attachments and multisampling.
    * </p>
    */
-  public final boolean hasFullFBOSupport() {        
+  public final boolean hasFullFBOSupport() {
       return hasBasicFBOSupport() && !hasRendererQuirk(GLRendererQuirks.NoFullFBOSupport) &&
-             ( isGL3() ||                                                         // GL >= 3.0                
+             ( isGL3() ||                                                         // GL >= 3.0
                isExtensionAvailable(GLExtensions.ARB_framebuffer_object) ||       // ARB_framebuffer_object
                ( isExtensionAvailable(GLExtensions.EXT_framebuffer_object) &&     // All EXT_framebuffer_object*
                  isExtensionAvailable(GLExtensions.EXT_framebuffer_multisample) &&
@@ -907,10 +907,10 @@ public abstract class GLContext {
                )
              ) ;
   }
-  
+
   /**
    * Returns the maximum number of FBO RENDERBUFFER samples
-   * if {@link #hasFullFBOSupport() full FBO is supported}, otherwise false. 
+   * if {@link #hasFullFBOSupport() full FBO is supported}, otherwise false.
    */
   public final int getMaxRenderbufferSamples() {
       if( hasFullFBOSupport() ) {
@@ -928,7 +928,7 @@ public abstract class GLContext {
       }
       return 0;
   }
-  
+
   /** Note: The GL impl. may return a const value, ie {@link GLES2#isNPOTTextureAvailable()} always returns <code>true</code>. */
   public boolean isNPOTTextureAvailable() {
       return isGL3() || isGLES2Compatible() || isExtensionAvailable(GLExtensions.ARB_texture_non_power_of_two);
@@ -940,9 +940,9 @@ public abstract class GLContext {
              isExtensionAvailable(GLExtensions.IMG_texture_format_BGRA8888) ;
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GL4bc.  <p>Includes [ GL4bc ].</p>
-   * @see GLProfile#isGL4bc() 
+   * @see GLProfile#isGL4bc()
    */
   public final boolean isGL4bc() {
       return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
@@ -950,9 +950,9 @@ public abstract class GLContext {
              ctxVersion.getMajor() >= 4;
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GL4.    <p>Includes [ GL4bc, GL4 ].</p>
-   * @see GLProfile#isGL4() 
+   * @see GLProfile#isGL4()
    */
   public final boolean isGL4() {
       return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
@@ -960,7 +960,7 @@ public abstract class GLContext {
              ctxVersion.getMajor() >= 4;
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext uses a GL4 core profile. <p>Includes [ GL4 ].</p>
    */
   public final boolean isGL4core() {
@@ -968,10 +968,10 @@ public abstract class GLContext {
              0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
              ctxVersion.getMajor() >= 4;
   }
-  
-  /** 
+
+  /**
    * Indicates whether this GLContext is capable of GL3bc.  <p>Includes [ GL4bc, GL3bc ].</p>
-   * @see GLProfile#isGL3bc() 
+   * @see GLProfile#isGL3bc()
    */
   public final boolean isGL3bc() {
       return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
@@ -979,17 +979,17 @@ public abstract class GLContext {
              ctxVersion.compareTo(Version310) >= 0 ;
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GL3.    <p>Includes [ GL4bc, GL4, GL3bc, GL3 ].</p>
-   * @see GLProfile#isGL3() 
+   * @see GLProfile#isGL3()
    */
   public final boolean isGL3() {
       return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
              0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE)) &&
              ctxVersion.compareTo(Version310) >= 0 ;
-  }  
-  
-  /** 
+  }
+
+  /**
    * Indicates whether this GLContext uses a GL3 core profile. <p>Includes [ GL4, GL3 ].</p>
    */
   public final boolean isGL3core() {
@@ -997,8 +997,8 @@ public abstract class GLContext {
              0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
              ctxVersion.compareTo(Version310) >= 0;
   }
-  
-  /** 
+
+  /**
    * Indicates whether this GLContext uses a GL core profile. <p>Includes [ GL4, GL3, GLES3, GLES2 ].</p>
    */
   public final boolean isGLcore() {
@@ -1008,26 +1008,26 @@ public abstract class GLContext {
                ctxVersion.compareTo(Version310) >= 0
              ) ;
   }
-  
+
   /**
    * Indicates whether this GLContext allows CPU data sourcing (indices, vertices ..) as opposed to using a GPU buffer source (VBO),
-   * e.g. {@link GL2#glDrawElements(int, int, int, java.nio.Buffer)}. 
+   * e.g. {@link GL2#glDrawElements(int, int, int, java.nio.Buffer)}.
    * <p>Includes [GL2ES1, GLES2] == [ GL4bc, GL3bc, GL2, GLES1, GL2ES1, GLES2 ].</p>
    * <p>See Bug 852 - https://jogamp.org/bugzilla/show_bug.cgi?id=852 </p>
    */
   public final boolean isCPUDataSourcingAvail() {
       return isGL2ES1() || isGLES2();
   }
-  
-  /** 
-   * Indicates whether this GLContext's native profile does not implement a default <i>vertex array object</i> (VAO), 
+
+  /**
+   * Indicates whether this GLContext's native profile does not implement a default <i>vertex array object</i> (VAO),
    * starting w/ OpenGL 3.1 core and GLES3.
    * <p>Includes [ GL4, GL3, GLES3 ].</p>
    * <pre>
      Due to GL 3.1 core spec: E.1. DEPRECATED AND REMOVED FEATURES (p 296),
             GL 3.2 core spec: E.2. DEPRECATED AND REMOVED FEATURES (p 331)
      there is no more default VAO buffer 0 bound, hence generating and binding one
-     to avoid INVALID_OPERATION at VertexAttribPointer. 
+     to avoid INVALID_OPERATION at VertexAttribPointer.
      More clear is GL 4.3 core spec: 10.4 (p 307).
    * </pre>
    * <pre>
@@ -1047,87 +1047,87 @@ public abstract class GLContext {
                ctxVersion.compareTo(Version310) >= 0
              ) ;
   }
-  
+
   /**
    * If this GLContext does not implement a default VAO, see {@link #hasNoDefaultVAO()},
    * an <i>own default VAO</i> will be created and bound at context creation.
    * <p>
    * If this GLContext does implement a default VAO, i.e. {@link #hasNoDefaultVAO()}
    * returns <code>false</code>, this method returns <code>0</code>.
-   * </p> 
+   * </p>
    * <p>
    * Otherwise this method returns the VAO object name
-   * representing this GLContext's <i>own default VAO</i>.  
-   * </p> 
+   * representing this GLContext's <i>own default VAO</i>.
+   * </p>
    * @see #hasNoDefaultVAO()
    */
   public abstract int getDefaultVAO();
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GL2.    <p>Includes [ GL4bc, GL3bc, GL2  ].</p>
-   * @see GLProfile#isGL2() 
+   * @see GLProfile#isGL2()
    */
   public final boolean isGL2() {
       return 0 != ( ctxOptions & CTX_PROFILE_COMPAT ) && ctxVersion.getMajor()>=1 ;
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GL2GL3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GL2, GL2GL3 ].</p>
-   * @see GLProfile#isGL2GL3() 
-   */  
+   * @see GLProfile#isGL2GL3()
+   */
   public final boolean isGL2GL3() {
       return isGL2() || isGL3();
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GLES1.  <p>Includes [ GLES1 ].</p>
-   * @see GLProfile#isGLES1() 
+   * @see GLProfile#isGLES1()
    */
   public final boolean isGLES1() {
       return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 1 ;
   }
 
   /**
-   * Indicates whether this GLContext is capable of GLES2.  <p>Includes [ GLES2 ].</p> 
-   * @see GLProfile#isGLES2() 
+   * Indicates whether this GLContext is capable of GLES2.  <p>Includes [ GLES2 ].</p>
+   * @see GLProfile#isGLES2()
    */
   public final boolean isGLES2() {
       return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 2 ;
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GLES3.  <p>Includes [ GLES3 ].</p>
-   * @see GLProfile#isGLES3() 
+   * @see GLProfile#isGLES3()
    */
   public final boolean isGLES3() {
       return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 3 ;
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GLES.  <p>Includes [ GLES3, GLES1, GLES2 ].</p>
-   * @see GLProfile#isGLES() 
+   * @see GLProfile#isGLES()
    */
   public final boolean isGLES() {
       return 0 != ( CTX_PROFILE_ES & ctxOptions ) ;
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GL2ES1. <p>Includes [ GL4bc, GL3bc, GL2, GLES1, GL2ES1 ].</p>
-   * @see GLProfile#isGL2ES1() 
+   * @see GLProfile#isGL2ES1()
    */
   public final boolean isGL2ES1() {
       return isGLES1() || isGL2();
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GL2ES2. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL2, GL2GL3, GL2ES2, GLES2 ].</p>
-   * @see GLProfile#isGL2ES2() 
+   * @see GLProfile#isGL2ES2()
    */
   public final boolean isGL2ES2() {
       return isGLES2() || isGL2GL3();
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GL2ES3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL3ES3, GL2, GL2GL3 ].</p>
    * @see GLProfile#isGL2ES3()
    * @see #isGL3ES3()
@@ -1137,16 +1137,16 @@ public abstract class GLContext {
       return isGL3ES3() || isGL2GL3();
   }
 
-  /** 
+  /**
    * Indicates whether this GLContext is capable of GL3ES3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3 ].</p>
-   * @see GLProfile#isGL3ES3() 
+   * @see GLProfile#isGL3ES3()
    */
   public final boolean isGL3ES3() {
       return isGL4ES3() || isGL3();
   }
 
-  /** 
-   * Returns true if this profile is capable of GL4ES3, i.e. if {@link #isGLES3Compatible()} returns true. 
+  /**
+   * Returns true if this profile is capable of GL4ES3, i.e. if {@link #isGLES3Compatible()} returns true.
    * <p>Includes [ GL &ge; 4.3, GL &ge; 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]</p>
    * @see GLProfile#isGL4ES3()
    */
@@ -1185,7 +1185,7 @@ public abstract class GLContext {
    * </p>
    * <p>
    * For a valid context the default value is <code>1</code>
-   * in case of an EGL based profile (ES1 or ES2) and <code>-1</code> 
+   * in case of an EGL based profile (ES1 or ES2) and <code>-1</code>
    * (undefined) for desktop.
    * </p>
    */
@@ -1222,51 +1222,51 @@ public abstract class GLContext {
   }
   protected boolean bindSwapBarrierImpl(int group, int barrier) { /** nop per default .. **/  return false; }
 
-  /** 
-   * Return the framebuffer name bound to this context, 
+  /**
+   * Return the framebuffer name bound to this context,
    * see {@link GL#glBindFramebuffer(int, int)}.
    */
   public abstract int getBoundFramebuffer(int target);
-  
-  /** 
+
+  /**
    * Return the default draw framebuffer name.
-   * <p> 
+   * <p>
    * May differ from it's default <code>zero</code>
    * in case an framebuffer object ({@link com.jogamp.opengl.FBObject}) based drawable
    * is being used.
-   * </p> 
+   * </p>
    */
   public abstract int getDefaultDrawFramebuffer();
-  
-  /** 
+
+  /**
    * Return the default read framebuffer name.
-   * <p> 
+   * <p>
    * May differ from it's default <code>zero</code>
    * in case an framebuffer object ({@link com.jogamp.opengl.FBObject}) based drawable
    * is being used.
-   * </p> 
+   * </p>
    */
   public abstract int getDefaultReadFramebuffer();
-  
-  /** 
-   * Returns the default color buffer within the current bound 
-   * {@link #getDefaultReadFramebuffer()}, i.e. GL_READ_FRAMEBUFFER​,  
-   * which will be used as the source for pixel reading commands, 
+
+  /**
+   * Returns the default color buffer within the current bound
+   * {@link #getDefaultReadFramebuffer()}, i.e. GL_READ_FRAMEBUFFER​,
+   * which will be used as the source for pixel reading commands,
    * like {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer)} etc.
    * <p>
    * For offscreen framebuffer objects this is {@link GL#GL_COLOR_ATTACHMENT0},
-   * otherwise this is {@link GL#GL_FRONT} for single buffer configurations 
+   * otherwise this is {@link GL#GL_FRONT} for single buffer configurations
    * and {@link GL#GL_BACK} for double buffer configurations.
-   * </p> 
+   * </p>
    */
   public abstract int getDefaultReadBuffer();
-  
+
   /** Get the default pixel data type, as required by e.g. {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer)}. */
   public abstract int getDefaultPixelDataType();
-  
+
   /** Get the default pixel data format, as required by e.g. {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer)}. */
   public abstract int getDefaultPixelDataFormat();
-  
+
   /**
    * @return The extension implementing the GLDebugOutput feature,
    *         either {@link GLExtensions#ARB_debug_output} or {@link GLExtensions#AMD_debug_output}.
@@ -1486,13 +1486,13 @@ public abstract class GLContext {
           }
           if (DEBUG) {
             System.err.println(getThreadName() + ": createContextARB: SET mappedVersionsAvailableSet "+devKey);
-            System.err.println(GLContext.dumpAvailableGLVersions(null).toString());            
+            System.err.println(GLContext.dumpAvailableGLVersions(null).toString());
           }
       }
   }
 
-  /** 
-   * Returns a unique String object using {@link String#intern()} for the given arguments, 
+  /**
+   * Returns a unique String object using {@link String#intern()} for the given arguments,
    * which object reference itself can be used as a key.
    */
   protected static String getDeviceVersionAvailableKey(AbstractGraphicsDevice device, int major, int profile) {
@@ -1575,7 +1575,7 @@ public abstract class GLContext {
     }
     return val;
   }
-  
+
   /**
    * @param reqMajor Key Value either 1, 2, 3 or 4
    * @param reqProfile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
@@ -1647,7 +1647,7 @@ public abstract class GLContext {
         reqMajorCTP[1]=CTX_PROFILE_CORE;
     }
   }
-  
+
   /**
    * @param device the device the context profile is being requested for
    * @param GLProfile the GLProfile the context profile is being requested for
@@ -1656,7 +1656,7 @@ public abstract class GLContext {
   protected static final int getAvailableContextProperties(final AbstractGraphicsDevice device, final GLProfile glp) {
     final int[] reqMajorCTP = new int[] { 0, 0 };
     getRequestMajorAndCompat(glp, reqMajorCTP);
-    
+
     int _major[] = { 0 };
     int _minor[] = { 0 };
     int _ctp[] = { 0 };
@@ -1702,7 +1702,7 @@ public abstract class GLContext {
    * Returns true if it is possible to create an <i>framebuffer object</i> (FBO).
    * <p>
    * FBO feature is implemented in OpenGL, hence it is {@link GLProfile} dependent.
-   * </p> 
+   * </p>
    * <p>
    * FBO support is queried as described in {@link #hasBasicFBOSupport()}.
    * </p>
@@ -1714,16 +1714,16 @@ public abstract class GLContext {
   public static final boolean isFBOAvailable(AbstractGraphicsDevice device, GLProfile glp) {
       return 0 != ( CTX_IMPL_FBO & getAvailableContextProperties(device, glp) );
   }
-  
+
   /**
-   * @return <code>1</code> if using a hardware rasterizer, <code>0</code> if using a software rasterizer and <code>-1</code> if not determined yet. 
+   * @return <code>1</code> if using a hardware rasterizer, <code>0</code> if using a software rasterizer and <code>-1</code> if not determined yet.
    * @see GLContext#isHardwareRasterizer()
-   * @see GLProfile#isHardwareRasterizer() 
+   * @see GLProfile#isHardwareRasterizer()
    */
   public static final int isHardwareRasterizer(AbstractGraphicsDevice device, GLProfile glp) {
       final int r;
       final int ctp = getAvailableContextProperties(device, glp);
-      if(0 == ctp) { 
+      if(0 == ctp) {
           r = -1;
       } else if( 0 == ( CTX_IMPL_ACCEL_SOFT & ctp ) ) {
           r = 1;
@@ -1732,7 +1732,7 @@ public abstract class GLContext {
       }
       return r;
   }
-  
+
   /**
    * @param device the device to request whether the profile is available for
    * @param reqMajor Key Value either 1, 2, 3 or 4
@@ -1774,7 +1774,7 @@ public abstract class GLContext {
       int minor[] = { 0 };
       int ctp[] = { 0 };
       boolean ok;
-      
+
       ok = GLContext.getAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_ES, major, minor, ctp);
       if( !ok ) {
           ok = GLContext.getAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_CORE, major, minor, ctp);
@@ -1784,7 +1784,7 @@ public abstract class GLContext {
       }
       return 0 != ( ctp[0] & CTX_IMPL_ES3_COMPAT );
   }
-    
+
   public static boolean isGL4bcAvailable(AbstractGraphicsDevice device, boolean isHardware[]) {
       return isGLVersionAvailable(device, 4, CTX_PROFILE_COMPAT, isHardware);
   }
@@ -1859,6 +1859,6 @@ public abstract class GLContext {
   }
 
   protected static String getThreadName() { return Thread.currentThread().getName(); }
-  
+
 }
 
diff --git a/src/jogl/classes/javax/media/opengl/GLDebugListener.java b/src/jogl/classes/javax/media/opengl/GLDebugListener.java
index 8887d022a..ec7f7cec1 100644
--- a/src/jogl/classes/javax/media/opengl/GLDebugListener.java
+++ b/src/jogl/classes/javax/media/opengl/GLDebugListener.java
@@ -29,16 +29,16 @@ package javax.media.opengl;
 
 /**
  * Listener for {@link GLDebugMessage}s.
- * 
+ *
  * <p>One can enable GLDebugOutput via {@link GLContext#enableGLDebugMessage(boolean)}
  * and add listeners via {@link GLContext#addGLDebugListener(GLDebugListener)}.
  */
 public interface GLDebugListener {
-    /** 
+    /**
      * Handle {@link GLDebugMessage} message sent from native GL implementation.
-     * 
+     *
      * <p>Since this method is invoked directly by the GL implementation, it shall
      * return as fast as possible.</p>
      */
-    void messageSent(GLDebugMessage event);    
+    void messageSent(GLDebugMessage event);
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
index 4b8d62898..1032cf929 100644
--- a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
+++ b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
@@ -30,18 +30,18 @@ package javax.media.opengl;
 import com.jogamp.common.os.Platform;
 
 /**
- * OpenGL debug message generated by the driver 
+ * OpenGL debug message generated by the driver
  * and delivered via {@link GLDebugListener}.
  */
 public class GLDebugMessage {
     final GLContext source;
-    final long when;    
+    final long when;
     final int dbgSource;
     final int dbgType;
     final int dbgId;
     final int dbgSeverity;
     final String dbgMsg;
-    
+
     /**
      * @param source The source of the event
      * @param when The time of the event
@@ -60,9 +60,9 @@ public class GLDebugMessage {
         this.dbgSeverity = dbgSeverity;
         this.dbgMsg = dbgMsg;
     }
-    
+
     /**
-     * 
+     *
      * @param source
      * @param when
      * @param dbgId
@@ -73,88 +73,88 @@ public class GLDebugMessage {
      */
     public static GLDebugMessage translateAMDEvent(GLContext source, long when, int dbgId, int amdDbgCategory, int dbgSeverity, String dbgMsg) {
         int dbgSource, dbgType;
-        
+
         // AMD category == ARB source/type
         switch(amdDbgCategory) {
-            case GL2GL3.GL_DEBUG_CATEGORY_API_ERROR_AMD: 
+            case GL2GL3.GL_DEBUG_CATEGORY_API_ERROR_AMD:
                 dbgSource = GL2GL3.GL_DEBUG_SOURCE_API;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_ERROR; 
+                dbgType = GL2GL3.GL_DEBUG_TYPE_ERROR;
                 break;
 
             //
             // def source / other type
             //
-                
-            case GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD: 
+
+            case GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD:
                 dbgSource = GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER; 
+                dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
                 break;
-                
+
             case GL2GL3.GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD:
                 dbgSource = GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER; 
+                dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
                 break;
-                
+
             case GL2GL3.GL_DEBUG_CATEGORY_APPLICATION_AMD:
                 dbgSource = GL2GL3.GL_DEBUG_SOURCE_APPLICATION;
                 dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
                 break;
-                
-                
+
+
             //
             // other source / def type
             //
-                
+
             case GL2GL3.GL_DEBUG_CATEGORY_DEPRECATION_AMD:
                 dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR; 
+                dbgType = GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR;
                 break;
-                
+
             case GL2GL3.GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD:
                 dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR; 
+                dbgType = GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR;
                 break;
-                
+
             case GL2GL3.GL_DEBUG_CATEGORY_PERFORMANCE_AMD:
                 dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_PERFORMANCE; 
+                dbgType = GL2GL3.GL_DEBUG_TYPE_PERFORMANCE;
                 break;
-                
-            case GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD: 
+
+            case GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD:
             default:
                 dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
                 dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
         }
-        
-        return new GLDebugMessage(source, when, dbgSource, dbgType, dbgId, dbgSeverity, dbgMsg);        
+
+        return new GLDebugMessage(source, when, dbgSource, dbgType, dbgId, dbgSeverity, dbgMsg);
     }
 
     public static int translateARB2AMDCategory(int dbgSource, int dbgType) {
         switch (dbgSource) {
             case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM:
-                return GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD; 
-                
+                return GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD;
+
             case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER:
                 return GL2GL3.GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD;
-                
+
             case GL2GL3.GL_DEBUG_SOURCE_APPLICATION:
                 return GL2GL3.GL_DEBUG_CATEGORY_APPLICATION_AMD;
         }
-        
+
         switch(dbgType) {
             case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
                 return GL2GL3.GL_DEBUG_CATEGORY_DEPRECATION_AMD;
-                
+
             case GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
                 return GL2GL3.GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD;
-                
-            case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE: 
+
+            case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE:
                 return GL2GL3.GL_DEBUG_CATEGORY_PERFORMANCE_AMD;
         }
-                
-        return GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD;        
+
+        return GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD;
     }
-    
+
     public GLContext getSource() {
         return source;
     }
@@ -162,7 +162,7 @@ public class GLDebugMessage {
     public long getWhen() {
         return when;
     }
-    
+
     public int getDbgSource() {
         return dbgSource;
     }
@@ -182,14 +182,14 @@ public class GLDebugMessage {
     public String getDbgMsg() {
         return dbgMsg;
     }
-    
+
     public StringBuilder toString(StringBuilder sb) {
-        final String crtab = Platform.getNewline()+"\t";        
+        final String crtab = Platform.getNewline()+"\t";
         if(null==sb) {
             sb = new StringBuilder();
-        }        
+        }
         sb.append("GLDebugEvent[ id ");
-        toHexString(sb, dbgId)        
+        toHexString(sb, dbgId)
         .append(crtab).append("type ").append(getDbgTypeString(dbgType))
         .append(crtab).append("severity ").append(getDbgSeverityString(dbgSeverity))
         .append(crtab).append("source ").append(getDbgSourceString(dbgSource))
@@ -199,46 +199,46 @@ public class GLDebugMessage {
             sb.append(crtab).append("source ").append(source.getGLVersion()).append(" - hash 0x").append(Integer.toHexString(source.hashCode()));
         }
         sb.append("]");
-        return sb;        
+        return sb;
     }
 
     public String toString() {
         return toString(null).toString();
     }
-        
+
     public static String getDbgSourceString(int dbgSource) {
         switch(dbgSource) {
             case GL2GL3.GL_DEBUG_SOURCE_API: return "GL API";
-            case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER: return "GLSL or extension compiler";                                          
-            case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM: return "Native Windowing binding";                                          
+            case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER: return "GLSL or extension compiler";
+            case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM: return "Native Windowing binding";
             case GL2GL3.GL_DEBUG_SOURCE_THIRD_PARTY: return "Third party";
             case GL2GL3.GL_DEBUG_SOURCE_APPLICATION: return "Application";
             case GL2GL3.GL_DEBUG_SOURCE_OTHER: return "generic";
             default: return "Unknown (" + toHexString(dbgSource) + ")";
         }
     }
-    
+
     public static String getDbgTypeString(int dbgType) {
         switch(dbgType) {
             case GL2GL3.GL_DEBUG_TYPE_ERROR: return "Error";
-            case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: return "Warning: marked for deprecation";                                            
+            case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: return "Warning: marked for deprecation";
             case GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: return "Warning: undefined behavior";
-            case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE: return "Warning: implementation dependent performance";   
-            case GL2GL3.GL_DEBUG_TYPE_PORTABILITY: return "Warning: vendor-specific extension use";   
-            case GL2GL3.GL_DEBUG_TYPE_OTHER: return "Warning: generic";            
+            case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE: return "Warning: implementation dependent performance";
+            case GL2GL3.GL_DEBUG_TYPE_PORTABILITY: return "Warning: vendor-specific extension use";
+            case GL2GL3.GL_DEBUG_TYPE_OTHER: return "Warning: generic";
             default: return "Unknown (" + toHexString(dbgType) + ")";
         }
     }
-    
+
     public static String getDbgSeverityString(int dbgSeverity) {
         switch(dbgSeverity) {
-            case GL2GL3.GL_DEBUG_SEVERITY_HIGH: return "High: dangerous undefined behavior";                                          
-            case GL2GL3.GL_DEBUG_SEVERITY_MEDIUM: return "Medium: Severe performance/deprecation/other warnings";    
-            case GL2GL3.GL_DEBUG_SEVERITY_LOW: return "Low: Performance warnings (redundancy/undefined)";        
+            case GL2GL3.GL_DEBUG_SEVERITY_HIGH: return "High: dangerous undefined behavior";
+            case GL2GL3.GL_DEBUG_SEVERITY_MEDIUM: return "Medium: Severe performance/deprecation/other warnings";
+            case GL2GL3.GL_DEBUG_SEVERITY_LOW: return "Low: Performance warnings (redundancy/undefined)";
             default: return "Unknown (" + toHexString(dbgSeverity) + ")";
         }
     }
-    
+
     public static StringBuilder toHexString(StringBuilder sb, int i) {
         if(null==sb) {
             sb = new StringBuilder();
@@ -247,6 +247,6 @@ public class GLDebugMessage {
     }
     public static String toHexString(int i) {
         return "0x"+Integer.toHexString(i);
-    }    
-    
+    }
+
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawable.java b/src/jogl/classes/javax/media/opengl/GLDrawable.java
index 46fa923ad..5a032db29 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawable.java
@@ -73,13 +73,13 @@ public interface GLDrawable {
    * </p>
    * <p>
    * End users do not need to call this method; it is not necessary to
-   * call <code>setRealized</code> on a {@link GLAutoDrawable} 
+   * call <code>setRealized</code> on a {@link GLAutoDrawable}
    * as these perform the appropriate calls on their underlying GLDrawables internally.
    * </p>
    * <p>
    * Developers implementing new OpenGL components for various window
    * toolkits need to call this method against GLDrawables obtained
-   * from the GLDrawableFactory via the 
+   * from the GLDrawableFactory via the
    * {@link GLDrawableFactory#createGLDrawable(NativeSurface)} method.
    * It must typically be
    * called with an argument of <code>true</code> when the component
@@ -89,7 +89,7 @@ public interface GLDrawable {
    * the <code>addNotify</code> method and with an argument of
    * <code>false</code> in the <code>removeNotify</code> method.
    * </p>
-   * <p>   
+   * <p>
    * <code>GLDrawable</code> implementations should handle multiple
    * cycles of <code>setRealized(true)</code> /
    * <code>setRealized(false)</code> calls. Most, if not all, Java
@@ -104,7 +104,7 @@ public interface GLDrawable {
    * associated resources as the component becomes realized and
    * unrealized, respectively.
    * </p>
-   * <p>   
+   * <p>
    * With an argument of <code>true</code>,
    * the minimum implementation shall call
    * {@link NativeSurface#lockSurface() NativeSurface's lockSurface()} and if successful:
@@ -117,7 +117,7 @@ public interface GLDrawable {
    * ensures resolving the window/surface handles, and the drawable's {@link GLCapabilities}
    * might have changed.
    * </p>
-   * <p>   
+   * <p>
    * Calling this method has no other effects. For example, if
    * <code>removeNotify</code> is called on a Canvas implementation
    * for which a GLDrawable has been created, it is also necessary to
@@ -130,7 +130,7 @@ public interface GLDrawable {
    */
   public void setRealized(boolean realized);
 
-  /** 
+  /**
    * Returns <code>true</code> if this drawable is realized, otherwise <code>true</code>.
    * <p>
    * A drawable can be realized and unrealized via {@link #setRealized(boolean)}.
@@ -146,19 +146,19 @@ public interface GLDrawable {
   public int getHeight();
 
   /**
-   * Returns <code>true</code> if the drawable is rendered in 
+   * Returns <code>true</code> if the drawable is rendered in
    * OpenGL's coordinate system, <i>origin at bottom left</i>.
    * Otherwise returns <code>false</code>, i.e. <i>origin at top left</i>.
    * <p>
    * Default impl. is <code>true</code>, i.e. OpenGL coordinate system.
-   * </p> 
+   * </p>
    * <p>
    * Currently only MS-Windows bitmap offscreen drawable uses a non OpenGL orientation and hence returns <code>false</code>.<br/>
    * This removes the need of a vertical flip when used in AWT or Windows applications.
    * </p>
    */
   public boolean isGLOriented();
-  
+
   /** Swaps the front and back buffers of this drawable. For {@link
       GLAutoDrawable} implementations, when automatic buffer swapping
       is enabled (as is the default), this method is called
@@ -191,11 +191,11 @@ public interface GLDrawable {
   public NativeSurface getNativeSurface();
 
   /**
-   * Returns the GL drawable handle, 
+   * Returns the GL drawable handle,
    * guaranteed to be valid after {@link #setRealized(boolean) realization}
    * <i>and</i> while it's {@link NativeSurface surface} is being {@link NativeSurface#lockSurface() locked}.
    * <p>
-   * It is usually identical to the underlying windowing toolkit {@link NativeSurface surface}'s 
+   * It is usually identical to the underlying windowing toolkit {@link NativeSurface surface}'s
    * {@link javax.media.nativewindow.NativeSurface#getSurfaceHandle() handle}
    * or an intermediate layer to suite GL, e.g. an EGL surface.
    * </p>
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 7c3c42e45..e486e2bfd 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -83,7 +83,7 @@ import jogamp.opengl.Debug;
     during the first repaint of the {@link javax.media.opengl.awt.GLCanvas} or {@link
     javax.media.opengl.awt.GLJPanel} if the capabilities can not be met.<br>
     {@link javax.media.opengl.GLPbuffer} are always
-    created immediately and their creation will fail with a 
+    created immediately and their creation will fail with a
     {@link javax.media.opengl.GLException} if errors occur. </P>
 
     <P> The concrete GLDrawableFactory subclass instantiated by {@link
@@ -94,21 +94,21 @@ import jogamp.opengl.Debug;
 public abstract class GLDrawableFactory {
 
   protected static final boolean DEBUG = Debug.debug("GLDrawable");
-  
-  /** 
-   * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome. 
+
+  /**
+   * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome.
    * When run in the mentioned browsers, the eglInitialize(..) implementation crashes.
    * <p>
    * This can be overridden by explicitly enabling ANGLE on Windows by setting the property
    * <code>jogl.enable.ANGLE</code>.
-   * </p> 
+   * </p>
    */
   protected static final boolean enableANGLE = Debug.isPropertyDefined("jogl.enable.ANGLE", true);
 
-  /** 
+  /**
    * In case no OpenGL ES implementation is required
    * and if the running platform may have a buggy implementation,
-   * setting the property <code>jogl.disable.opengles</code> disables querying a possible existing OpenGL ES implementation. 
+   * setting the property <code>jogl.disable.opengles</code> disables querying a possible existing OpenGL ES implementation.
    */
   protected static final boolean disableOpenGLES = Debug.isPropertyDefined("jogl.disable.opengles", true);
 
@@ -117,11 +117,11 @@ public abstract class GLDrawableFactory {
   private static GLDrawableFactory nativeOSFactory;
 
   private static ArrayList<GLDrawableFactory> glDrawableFactories = new ArrayList<GLDrawableFactory>();
-  
+
   /**
    * Instantiate singleton factories if available, EGLES1, EGLES2 and the OS native ones.
    */
-  public static final void initSingleton() { 
+  public static final void initSingleton() {
       if (!isInit) { // volatile: ok
           synchronized (GLDrawableFactory.class) {
               if (!isInit) {
@@ -130,7 +130,7 @@ public abstract class GLDrawableFactory {
               }
           }
       }
-  }  
+  }
   private static final void initSingletonImpl() {
     NativeWindowFactory.initSingleton();
     NativeWindowFactory.addCustomShutdownHook(false /* head */, new Runnable() {
@@ -138,7 +138,7 @@ public abstract class GLDrawableFactory {
            shutdown0();
        }
     });
-    
+
     final String nwt = NativeWindowFactory.getNativeWindowType(true);
     GLDrawableFactory tmp = null;
     String factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true);
@@ -163,7 +163,7 @@ public abstract class GLDrawableFactory {
       }
       try {
           tmp = (GLDrawableFactory) ReflectionUtil.createInstance(factoryClassName, cl);
-      } catch (Exception jre) { 
+      } catch (Exception jre) {
           if (DEBUG || GLProfile.DEBUG) {
               System.err.println("Info: GLDrawableFactory.static - Native Platform: "+nwt+" - not available: "+factoryClassName);
               jre.printStackTrace();
@@ -202,7 +202,7 @@ public abstract class GLDrawableFactory {
       }
     }
   }
-  
+
   private static void shutdown0() {
     // Following code will _always_ remain in shutdown hook
     // due to special semantics of native utils, i.e. X11Utils.
@@ -228,22 +228,22 @@ public abstract class GLDrawableFactory {
             }
         }
         glDrawableFactories.clear();
-        
-        // both were members of glDrawableFactories and are shutdown already 
+
+        // both were members of glDrawableFactories and are shutdown already
         nativeOSFactory = null;
         eglFactory = null;
     }
     GLContext.shutdown();
   }
-  
+
   protected GLDrawableFactory() {
     synchronized(glDrawableFactories) {
         glDrawableFactories.add(this);
     }
   }
-  
+
   protected static String getThreadName() { return Thread.currentThread().getName(); }
-  
+
   /** Returns true if this factory is complete, i.e. ready to be used. Otherwise return false. */
   protected abstract boolean isComplete();
 
@@ -253,14 +253,14 @@ public abstract class GLDrawableFactory {
   protected abstract void destroy();
 
   public abstract void resetDisplayGamma();
-  
+
   /**
    * Retrieve the default <code>device</code> {@link AbstractGraphicsDevice#getConnection() connection},
    * {@link AbstractGraphicsDevice#getUnitID() unit ID} and {@link AbstractGraphicsDevice#getUniqueID() unique ID name}. for this factory<br>
    * The implementation must return a non <code>null</code> default device, which must not be opened, ie. it's native handle is <code>null</code>.
    * <p>
    * This method shall return the default device if available
-   * even if the GLDrawableFactory is not functional and hence not compatible. 
+   * even if the GLDrawableFactory is not functional and hence not compatible.
    * The latter situation may happen because no native OpenGL implementation is available for the specific implementation.
    * </p>
    * @return the default shared device for this factory, eg. :0.0 on X11 desktop.
@@ -272,7 +272,7 @@ public abstract class GLDrawableFactory {
    * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
    * @return true if the device is compatible with this factory, ie. if it can be used for GLDrawable creation. Otherwise false.
    *         This implies validation whether the implementation is functional.
-   *         
+   *
    * @see #getDefaultDevice()
    */
   public abstract boolean getIsDeviceCompatible(AbstractGraphicsDevice device);
@@ -287,8 +287,8 @@ public abstract class GLDrawableFactory {
               System.err.println("Info: "+getClass().getSimpleName()+".validateDevice: using default device : "+device);
           }
       }
-      
-      // Always validate the device, 
+
+      // Always validate the device,
       // since even the default device may not be used by this factory.
       if( !getIsDeviceCompatible(device) ) {
           if (GLProfile.DEBUG) {
@@ -300,29 +300,29 @@ public abstract class GLDrawableFactory {
   }
 
   /**
-   * Validate and start the shared resource runner thread if necessary and 
+   * Validate and start the shared resource runner thread if necessary and
    * if the implementation uses it.
-   * 
+   *
    * @return the shared resource runner thread, if implementation uses it.
    */
   protected abstract Thread getSharedResourceThread();
-  
+
   /**
    * Create the shared resource used internally as a reference for capabilities etc.
    * <p>
-   * Returns true if a shared resource could be created 
+   * Returns true if a shared resource could be created
    * for the <code>device</code> {@link AbstractGraphicsDevice#getConnection()}.<br>
    * This does not imply a shared resource is mapped (ie. made persistent), but is available in general<br>.
    * </p>
    *
    * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
-   * @return true if a shared resource could been created, otherwise false. 
+   * @return true if a shared resource could been created, otherwise false.
    */
   protected final boolean createSharedResource(AbstractGraphicsDevice device) {
       return createSharedResourceImpl(device);
-  }  
+  }
   protected abstract boolean createSharedResourceImpl(AbstractGraphicsDevice device);
-  
+
   /**
    * Returns true if the <code>quirk</code> exist in the shared resource's context {@link GLRendererQuirks}.
    * <p>
@@ -332,7 +332,7 @@ public abstract class GLDrawableFactory {
       return null != glrq ? glrq.exist(quirk) : false;
    * </pre>
    * </p>
-   * 
+   *
    * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
    * @param quirk the quirk to be tested, e.g. {@link GLRendererQuirks#NoDoubleBufferedPBuffer}.
    * @throws IllegalArgumentException if the quirk is out of range
@@ -343,7 +343,7 @@ public abstract class GLDrawableFactory {
       final GLRendererQuirks glrq = getRendererQuirks(device);
       return null != glrq ? glrq.exist(quirk) : false;
   }
-  
+
   /**
    * Returns the shared resource's context {@link GLRendererQuirks}.
    * <p>
@@ -358,12 +358,12 @@ public abstract class GLDrawableFactory {
    * @see GLRendererQuirks
    */
   public abstract GLRendererQuirks getRendererQuirks(AbstractGraphicsDevice device);
-  
+
   /**
    * Returns the sole GLDrawableFactory instance for the desktop (X11, WGL, ..) if exist or null
    */
   public static GLDrawableFactory getDesktopFactory() {
-    GLProfile.initSingleton();    
+    GLProfile.initSingleton();
     return nativeOSFactory;
   }
 
@@ -371,14 +371,14 @@ public abstract class GLDrawableFactory {
    * Returns the sole GLDrawableFactory instance for EGL if exist or null
    */
   public static GLDrawableFactory getEGLFactory() {
-    GLProfile.initSingleton();    
+    GLProfile.initSingleton();
     return eglFactory;
   }
 
-  /** 
-   * Returns the sole GLDrawableFactory instance. 
-   * 
-   * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory, 
+  /**
+   * Returns the sole GLDrawableFactory instance.
+   *
+   * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
    *                or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
    */
   public static GLDrawableFactory getFactory(GLProfile glProfile) throws GLException {
@@ -387,7 +387,7 @@ public abstract class GLDrawableFactory {
 
   protected static GLDrawableFactory getFactoryImpl(String glProfileImplName) throws GLException {
     if ( GLProfile.usesNativeGLES(glProfileImplName) ) {
-        if(null!=eglFactory) {   
+        if(null!=eglFactory) {
             return eglFactory;
         }
     } else if(null!=nativeOSFactory) {
@@ -446,10 +446,10 @@ public abstract class GLDrawableFactory {
    * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true.
    * </p>
    * <p>
-   * If not onscreen and neither FBO nor Pbuffer is available, 
+   * If not onscreen and neither FBO nor Pbuffer is available,
    * a simple pixmap/bitmap drawable/surface is created, which is unlikely to be hardware accelerated.
    * </p>
-   * 
+   *
    * @throws IllegalArgumentException if the passed target is null
    * @throws GLException if any window system-specific errors caused
    *         the creation of the GLDrawable to fail.
@@ -463,12 +463,12 @@ public abstract class GLDrawableFactory {
    */
   public abstract GLDrawable createGLDrawable(NativeSurface target)
     throws IllegalArgumentException, GLException;
-  
+
   /**
-   * Creates a {@link GLDrawable#isRealized() realized} {@link GLOffscreenAutoDrawable} 
+   * Creates a {@link GLDrawable#isRealized() realized} {@link GLOffscreenAutoDrawable}
    * incl it's offscreen {@link javax.media.nativewindow.NativeSurface} with the given capabilites and dimensions.
    * <p>
-   * The {@link GLOffscreenAutoDrawable}'s {@link GLDrawable} is {@link GLDrawable#isRealized() realized} 
+   * The {@link GLOffscreenAutoDrawable}'s {@link GLDrawable} is {@link GLDrawable#isRealized() realized}
    * and it's {@link GLContext} assigned but not yet made current.
    * </p>
    * <p>
@@ -485,7 +485,7 @@ public abstract class GLDrawableFactory {
    * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true.
    * </p>
    * <p>
-   * If neither FBO nor Pbuffer is available, 
+   * If neither FBO nor Pbuffer is available,
    * a simple pixmap/bitmap auto drawable is created, which is unlikely to be hardware accelerated.
    * </p>
    *
@@ -498,7 +498,7 @@ public abstract class GLDrawableFactory {
    *
    * @throws GLException if any window system-specific errors caused
    *         the creation of the Offscreen to fail.
-   *         
+   *
    * @see #createOffscreenDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int)
    */
   public abstract GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice device,
@@ -507,7 +507,7 @@ public abstract class GLDrawableFactory {
                                                                       int width, int height,
                                                                       GLContext shareWith) throws GLException;
   /**
-   * Creates an {@link GLDrawable#isRealized() unrealized} offscreen {@link GLDrawable} 
+   * Creates an {@link GLDrawable#isRealized() unrealized} offscreen {@link GLDrawable}
    * incl it's offscreen {@link javax.media.nativewindow.NativeSurface} with the given capabilites and dimensions.
    * <p>
    * In case the passed {@link GLCapabilitiesImmutable} contains default values, i.e.
@@ -523,7 +523,7 @@ public abstract class GLDrawableFactory {
    * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true.
    * </p>
    * <p>
-   * If neither FBO nor Pbuffer is available, 
+   * If neither FBO nor Pbuffer is available,
    * a simple pixmap/bitmap drawable is created, which is unlikely to be hardware accelerated.
    * </p>
    *
@@ -537,7 +537,7 @@ public abstract class GLDrawableFactory {
    *
    * @throws GLException if any window system-specific errors caused
    *         the creation of the Offscreen to fail.
-   *         
+   *
    * @see #createOffscreenAutoDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext)
    */
   public abstract GLDrawable createOffscreenDrawable(AbstractGraphicsDevice device,
@@ -546,7 +546,7 @@ public abstract class GLDrawableFactory {
                                                      int width, int height) throws GLException;
 
   /**
-   * Creates an {@link GLDrawable#isRealized() unrealized} dummy {@link GLDrawable}. 
+   * Creates an {@link GLDrawable#isRealized() unrealized} dummy {@link GLDrawable}.
    * A dummy drawable is not visible on screen and will not be used to render directly to, it maybe on- or offscreen.
    * <p>
    * It is used to allow the creation of a {@link GLContext} to query information.
@@ -558,26 +558,26 @@ public abstract class GLDrawableFactory {
    * @return the created dummy {@link GLDrawable}
    */
   public abstract GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp);
-  
+
   /**
-   * Creates a proxy {@link NativeSurface} w/ defined surface handle, 
-   * i.e. a {@link jogamp.nativewindow.WrappedSurface} or {@link jogamp.nativewindow.windows.GDISurface} instance. 
+   * Creates a proxy {@link NativeSurface} w/ defined surface handle,
+   * i.e. a {@link jogamp.nativewindow.WrappedSurface} or {@link jogamp.nativewindow.windows.GDISurface} instance.
    * <p>
-   * It's {@link AbstractGraphicsConfiguration} is properly set according to the given 
+   * It's {@link AbstractGraphicsConfiguration} is properly set according to the given
    * <code>windowHandle</code>'s native visualID if set or the given {@link GLCapabilitiesImmutable}.
    * </p>
    * <p>
    * Lifecycle (creation and destruction) of the given surface handle shall be handled by the caller
-   * via {@link ProxySurface#createNotify()} and {@link ProxySurface#destroyNotify()}.  
+   * via {@link ProxySurface#createNotify()} and {@link ProxySurface#destroyNotify()}.
    * </p>
    * <p>
    * Such surface can be used to instantiate a GLDrawable. With the help of {@link GLAutoDrawableDelegate}
-   * you will be able to implement a new native windowing system  binding almost on-the-fly, 
-   * see {@link com.jogamp.opengl.swt.GLCanvas}. 
+   * you will be able to implement a new native windowing system  binding almost on-the-fly,
+   * see {@link com.jogamp.opengl.swt.GLCanvas}.
    * </p>
-   * 
+   *
    * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
-   *        Caller has to ensure it is compatible w/ the given <code>windowHandle</code> 
+   *        Caller has to ensure it is compatible w/ the given <code>windowHandle</code>
    * @param screenIdx matching screen index of given <code>windowHandle</code>
    * @param windowHandle the native window handle
    * @param caps the requested GLCapabilties
@@ -586,15 +586,15 @@ public abstract class GLDrawableFactory {
    * @return the created {@link ProxySurface} instance w/ defined surface handle.
    */
   public abstract ProxySurface createProxySurface(AbstractGraphicsDevice device,
-                                                  int screenIdx, 
-                                                  long windowHandle, 
+                                                  int screenIdx,
+                                                  long windowHandle,
                                                   GLCapabilitiesImmutable caps, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream);
-  
+
   /**
    * Returns true if it is possible to create an <i>framebuffer object</i> (FBO).
    * <p>
    * FBO feature is implemented in OpenGL, hence it is {@link GLProfile} dependent.
-   * </p> 
+   * </p>
    * <p>
    * FBO support is queried as described in {@link GLContext#hasBasicFBOSupport()}.
    * </p>
@@ -607,9 +607,9 @@ public abstract class GLDrawableFactory {
 
   /**
    * Returns true if it is possible to create an <i>pbuffer surface</i>.
-   * <p> 
-   * Some older graphics cards do not have this capability, 
-   * as well as some new GL implementation, i.e. OpenGL 3 core on OSX. 
+   * <p>
+   * Some older graphics cards do not have this capability,
+   * as well as some new GL implementation, i.e. OpenGL 3 core on OSX.
    * </p>
    *
    * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
@@ -637,7 +637,7 @@ public abstract class GLDrawableFactory {
    *
    * @throws GLException if any window system-specific errors caused
    *         the creation of the GLPbuffer to fail.
-   *         
+   *
    * @deprecated {@link GLPbuffer} is deprecated, use {@link #createOffscreenAutoDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext)}
    */
   public abstract GLPbuffer createGLPbuffer(AbstractGraphicsDevice device,
@@ -648,7 +648,7 @@ public abstract class GLDrawableFactory {
                                             GLContext shareWith)
     throws GLException;
 
-  
+
   //----------------------------------------------------------------------
   // Methods for interacting with third-party OpenGL libraries
 
diff --git a/src/jogl/classes/javax/media/opengl/GLEventListener.java b/src/jogl/classes/javax/media/opengl/GLEventListener.java
index 15fae4a39..c8c3440b5 100644
--- a/src/jogl/classes/javax/media/opengl/GLEventListener.java
+++ b/src/jogl/classes/javax/media/opengl/GLEventListener.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -49,7 +49,7 @@ import java.util.EventListener;
 public interface GLEventListener extends EventListener {
   /** Called by the drawable immediately after the OpenGL context is
       initialized. Can be used to perform one-time OpenGL
-      initialization per GLContext, such as setup of lights and display lists.<p> 
+      initialization per GLContext, such as setup of lights and display lists.<p>
 
       Note that this method may be called more than once if the underlying
       OpenGL context for the GLAutoDrawable is destroyed and
@@ -57,7 +57,7 @@ public interface GLEventListener extends EventListener {
       hierarchy and later added again.
   */
   public void init(GLAutoDrawable drawable);
-  
+
   /** Notifies the listener to perform the release of all OpenGL
       resources per GLContext, such as memory buffers and GLSL programs.<P>
 
@@ -68,11 +68,11 @@ public interface GLEventListener extends EventListener {
 
       Note that this event does not imply the end of life of the application.
       It could be produced with a followup call to {@link #init(GLAutoDrawable)}
-      in case the GLContext has been recreated, 
+      in case the GLContext has been recreated,
       e.g. due to a pixel configuration change in a multihead environment.
   */
   public void dispose(GLAutoDrawable drawable);
-  
+
   /** Called by the drawable to initiate OpenGL rendering by the
       client. After all GLEventListeners have been notified of a
       display event, the drawable will swap its buffers if {@link
diff --git a/src/jogl/classes/javax/media/opengl/GLException.java b/src/jogl/classes/javax/media/opengl/GLException.java
index 644042e15..460f17be9 100644
--- a/src/jogl/classes/javax/media/opengl/GLException.java
+++ b/src/jogl/classes/javax/media/opengl/GLException.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
index df38745d5..052b08a4b 100644
--- a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -33,17 +33,17 @@ import javax.media.nativewindow.NativeWindowException;
 import com.jogamp.opengl.FBObject;
 import com.jogamp.opengl.FBObject.TextureAttachment;
 
-/** 
+/**
  * Platform-independent {@link GLDrawable} specialization,
  * exposing {@link FBObject} functionality.
  *
  * <p>
- * A {@link GLFBODrawable} is uninitialized until a {@link GLContext} is bound 
+ * A {@link GLFBODrawable} is uninitialized until a {@link GLContext} is bound
  * and made current the first time, hence only then it's capabilities <i>fully</i> reflect expectations,
  * i.e. color, depth, stencil and MSAA bits will be <i>valid</i> only after the first {@link GLContext#makeCurrent() makeCurrent()} call.
  * On-/offscreen bits are <i>valid</i> after {@link #setRealized(boolean) setRealized(true)}.
  * </p>
- * 
+ *
  * <p>
  * MSAA is used if {@link GLCapabilitiesImmutable#getNumSamples() requested}.
  * </p>
@@ -51,7 +51,7 @@ import com.jogamp.opengl.FBObject.TextureAttachment;
  * Double buffering is used if {@link GLCapabilitiesImmutable#getDoubleBuffered() requested}.
  * </p>
  * <p>
- * In MSAA mode, it always uses the implicit 2nd {@link FBObject framebuffer} {@link FBObject#getSamplingSinkFBO() sink}. 
+ * In MSAA mode, it always uses the implicit 2nd {@link FBObject framebuffer} {@link FBObject#getSamplingSinkFBO() sink}.
  * Hence double buffering is always the case w/ MSAA.
  * </p>
  * <p>
@@ -61,7 +61,7 @@ import com.jogamp.opengl.FBObject.TextureAttachment;
  * This method also allows usage of both textures seperately.
  * </p>
  * <p>
- * It would be possible to implement double buffering simply using 
+ * It would be possible to implement double buffering simply using
  * {@link TextureAttachment}s with one {@link FBObject framebuffer}.
  * This would require mode selection and hence complicate the API. Besides, it would
  * not support differentiation of read and write framebuffer and hence not be spec compliant.
@@ -71,50 +71,50 @@ import com.jogamp.opengl.FBObject.TextureAttachment;
  * is performed either in the {@link jogamp.opengl.GLContextImpl#contextMadeCurrent(boolean) context current hook}
  * or when {@link jogamp.opengl.GLDrawableImpl#swapBuffersImpl(boolean) swapping buffers}, whatever comes first.
  * </p>
- */ 
+ */
 public interface GLFBODrawable extends GLDrawable {
     // public enum DoubleBufferMode { NONE, TEXTURE, FBO }; // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
-    
+
     /**
      * @return <code>true</code> if initialized, i.e. a {@link GLContext} is bound and made current once, otherwise <code>false</code>.
      */
     public boolean isInitialized();
-    
+
     /**
      * Notify this instance about upstream size change
      * to reconfigure the {@link FBObject}.
-     * @param gl GL context object bound to this drawable, will be made current during operation. 
-     *           A prev. current context will be make current after operation. 
+     * @param gl GL context object bound to this drawable, will be made current during operation.
+     *           A prev. current context will be make current after operation.
      * @throws GLException if resize operation failed
      */
     void resetSize(GL gl) throws GLException;
-    
+
     /**
      * @return the used texture unit
      */
     int getTextureUnit();
-    
+
     /**
-     * 
+     *
      * @param unit the texture unit to be used
      */
     void setTextureUnit(int unit);
-    
+
     /**
      * Set the number of sample buffers if using MSAA
-     * 
-     * @param gl GL context object bound to this drawable, will be made current during operation. 
-     *           A prev. current context will be make current after operation. 
+     *
+     * @param gl GL context object bound to this drawable, will be made current during operation.
+     *           A prev. current context will be make current after operation.
      * @param newSamples new sample size
      * @throws GLException if resetting the FBO failed
      */
     void setNumSamples(GL gl, int newSamples) throws GLException;
-    
+
     /**
      * @return the number of sample buffers if using MSAA, otherwise 0
      */
     int getNumSamples();
-        
+
     /**
      * Sets the number of buffers (FBO) being used if using {@link GLCapabilities#getDoubleBuffered() double buffering}.
      * <p>
@@ -123,22 +123,22 @@ public interface GLFBODrawable extends GLDrawable {
      * <p>
      * Must be called before {@link #isInitialized() initialization}, otherwise an exception is thrown.
      * </p>
-     * @return the new number of buffers (FBO) used, maybe different than the requested <code>bufferCount</code> (see above) 
+     * @return the new number of buffers (FBO) used, maybe different than the requested <code>bufferCount</code> (see above)
      * @throws GLException if already initialized, see {@link #isInitialized()}.
      */
     int setNumBuffers(int bufferCount) throws GLException;
-    
-    /** 
+
+    /**
      * @return the number of buffers (FBO) being used. 1 if not using {@link GLCapabilities#getDoubleBuffered() double buffering},
-     * otherwise &ge; 2, depending on {@link #setNumBuffers(int)}. 
+     * otherwise &ge; 2, depending on {@link #setNumBuffers(int)}.
      */
     int getNumBuffers();
-    
+
     /**
-     * @return the used {@link DoubleBufferMode} 
+     * @return the used {@link DoubleBufferMode}
      */
     // DoubleBufferMode getDoubleBufferMode(); // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
-    
+
     /**
      * Sets the {@link DoubleBufferMode}. Must be called before {@link #isInitialized() initialization},
      * otherwise an exception is thrown.
@@ -153,11 +153,11 @@ public interface GLFBODrawable extends GLDrawable {
      * @throws GLException if already initialized, see {@link #isInitialized()}.
      */
     // void setDoubleBufferMode(DoubleBufferMode mode) throws GLException; // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
-    
+
     /**
      * If MSAA is being used and {@link GL#GL_FRONT} is requested,
-     * the internal {@link FBObject} {@link FBObject#getSamplingSinkFBO() sample sink} is being returned. 
-     * 
+     * the internal {@link FBObject} {@link FBObject#getSamplingSinkFBO() sample sink} is being returned.
+     *
      * @param bufferName {@link GL#GL_FRONT} and {@link GL#GL_BACK} are valid buffer names
      * @return the named {@link FBObject}
      * @throws IllegalArgumentException if an illegal buffer name is being used
@@ -167,7 +167,7 @@ public interface GLFBODrawable extends GLDrawable {
     /**
      * Returns the named texture buffer.
      * <p>
-     * If MSAA is being used, only the {@link GL#GL_FRONT} buffer is accessible 
+     * If MSAA is being used, only the {@link GL#GL_FRONT} buffer is accessible
      * and an exception is being thrown if {@link GL#GL_BACK} is being requested.
      * </p>
      * @param bufferName {@link GL#GL_FRONT} and {@link GL#GL_BACK} are valid buffer names
@@ -176,20 +176,20 @@ public interface GLFBODrawable extends GLDrawable {
      */
     FBObject.TextureAttachment getTextureBuffer(int bufferName) throws IllegalArgumentException;
 
-    /** Resizeable {@link GLFBODrawable} specialization */     
+    /** Resizeable {@link GLFBODrawable} specialization */
     public interface Resizeable extends GLFBODrawable {
         /**
          * Resize this drawable.
          * <p>
          * This drawable is being locked during operation.
          * </p>
-         * @param context the {@link GLContext} bound to this drawable, will be made current during operation 
-         *                A prev. current context will be make current after operation. 
+         * @param context the {@link GLContext} bound to this drawable, will be made current during operation
+         *                A prev. current context will be make current after operation.
          * @param newWidth
          * @param newHeight
          * @throws NativeWindowException in case the surface could no be locked
          * @throws GLException in case an error during the resize operation occurred
          */
-        void setSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException;                
+        void setSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException;
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java
index 6fe76a3f4..be90d935f 100644
--- a/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -32,7 +32,7 @@ import javax.media.nativewindow.NativeWindowException;
 
 import com.jogamp.opengl.FBObject;
 
-/** 
+/**
  * Platform-independent {@link GLAutoDrawable} specialization,
  * exposing offscreen functionality.
  * <p>
@@ -41,7 +41,7 @@ import com.jogamp.opengl.FBObject;
  * </p>
  */
 public interface GLOffscreenAutoDrawable extends GLAutoDrawable {
-    
+
     /**
      * Resize this auto drawable.
      * @param newWidth
@@ -56,8 +56,8 @@ public interface GLOffscreenAutoDrawable extends GLAutoDrawable {
      * @see #getUpstreamWidget()
      */
     void setUpstreamWidget(Object newUpstreamWidget);
-    
-    /** {@link FBObject} based {@link GLOffscreenAutoDrawable} specialization */ 
-    public interface FBO extends GLOffscreenAutoDrawable, GLFBODrawable {      
-    }    
+
+    /** {@link FBObject} based {@link GLOffscreenAutoDrawable} specialization */
+    public interface FBO extends GLOffscreenAutoDrawable, GLFBODrawable {
+    }
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLPbuffer.java b/src/jogl/classes/javax/media/opengl/GLPbuffer.java
index 12f57fcd8..f36a4bf29 100644
--- a/src/jogl/classes/javax/media/opengl/GLPbuffer.java
+++ b/src/jogl/classes/javax/media/opengl/GLPbuffer.java
@@ -46,8 +46,8 @@ package javax.media.opengl;
     as a texture map and enabling rendering to floating-point frame
     buffers. These methods are not guaranteed to be supported on all
     platforms and may be deprecated in a future release.
-    
-    @deprecated Use {@link GLOffscreenAutoDrawable} w/ {@link GLCapabilities#setFBO(boolean)} 
+
+    @deprecated Use {@link GLOffscreenAutoDrawable} w/ {@link GLCapabilities#setFBO(boolean)}
                 via {@link GLDrawableFactory#createOffscreenAutoDrawable(javax.media.nativewindow.AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext) GLDrawableFactory.createOffscreenAutoDrawable(..)}.
   */
 public interface GLPbuffer extends GLAutoDrawable {
diff --git a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
index c6bf26235..d947bada2 100644
--- a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,7 +28,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -49,7 +49,7 @@ import jogamp.opengl.*;
 public class GLPipelineFactory {
     public static final boolean DEBUG = Debug.debug("GLPipelineFactory");
 
-    /** 
+    /**
      * Creates a pipelined GL instance using the given downstream <code>downstream</code>
      * and optional arguments <code>additionalArgs</code> for the constructor.
      *
@@ -66,7 +66,7 @@ public class GLPipelineFactory {
      *     gl = drawable.setGL( GLPipelineFactory.create("javax.media.opengl.Trace",         null, gl, new Object[] { System.err } ) );
      * </pre>
      * </p>
-     * 
+     *
      * <p>
      * The upstream GL instance is determined as follows:
      * <ul>
@@ -76,7 +76,7 @@ public class GLPipelineFactory {
      *      <li> For all <code>downstream</code> class and superclass interfaces, do:</li>
      *      <ul>
      *        <li> If <code>reqInterface</code> is not null and the interface is unequal, continue loop.</li>
-     *        <li> If <code>downstream</code> is not instance of interface, continue loop.</li> 
+     *        <li> If <code>downstream</code> is not instance of interface, continue loop.</li>
      *        <li> If upstream class is available use it, end loop.</li>
      *      </ul>
      *   </ul>
@@ -116,7 +116,7 @@ public class GLPipelineFactory {
                     if(DEBUG) {
                         System.out.println("GLPipelineFactory: "+downstream.getClass().getName() + " is _not_ instance of "+ clazzes[i].getName());
                     }
-                    continue; // not a compatible one 
+                    continue; // not a compatible one
                 } else {
                     if(DEBUG) {
                         System.out.println("GLPipelineFactory: "+downstream.getClass().getName() + " _is_ instance of "+ clazzes[i].getName());
@@ -153,7 +153,7 @@ public class GLPipelineFactory {
         // throws exception if cstr not found!
         Constructor<?> cstr = ReflectionUtil.getConstructor(upstreamClazz, cstrArgTypes);
         Object instance = null;
-        try { 
+        try {
             Object[] cstrArgs = new Object[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
             {
                 int i = 0;
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index 4a2edc56b..15300e397 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -66,48 +66,48 @@ import java.util.List;
 
 /**
  * Specifies the the OpenGL profile.
- * 
+ *
  * This class static singleton initialization queries the availability of all OpenGL Profiles
  * and instantiates singleton GLProfile objects for each available profile.
  *
- * The platform default profile may be used, using {@link GLProfile#GetProfileDefault()}, 
+ * The platform default profile may be used, using {@link GLProfile#GetProfileDefault()},
  * or more specialized versions using the other static GetProfile methods.
  */
 public class GLProfile {
-    
+
     public static final boolean DEBUG = Debug.debug("GLProfile");
-    
+
     static {
         // Also initializes TempJarCache if shall be used.
         Platform.initSingleton();
     }
-    
+
     /**
      * Static initialization of JOGL.
      *
      * <p>
      * This method shall not need to be called for other reasons than having a defined initialization sequence.
      * </p>
-     * 
+     *
      * <P>
      * In case this method is not invoked, GLProfile is initialized implicit by
      * the first call to {@link #getDefault()}, {@link #get(java.lang.String)}.
      * <P>
-     * 
+     *
      * <p>
-     * To initialize JOGL at startup ASAP, this method may be invoked in the <i>main class</i>'s 
+     * To initialize JOGL at startup ASAP, this method may be invoked in the <i>main class</i>'s
      * static initializer block, in the <i>static main() method</i> or in the <i>Applet init() method</i>.
      * </p>
-     * 
+     *
      * <p>
      * Since JOGL's initialization is complex and involves multi threading, it is <b>not</b> recommended
-     * to be have it invoked on the AWT EDT thread. In case all JOGL usage is performed 
+     * to be have it invoked on the AWT EDT thread. In case all JOGL usage is performed
      * on the AWT EDT, invoke this method outside the AWT EDT - see above.
      * </p>
-     * 
+     *
      */
     public static void initSingleton() {
-        final boolean justInitialized; 
+        final boolean justInitialized;
         initLock.lock();
         try {
             if(!initialized) { // volatile: ok
@@ -117,13 +117,13 @@ public class GLProfile {
                     System.err.println("GLProfile.initSingleton() - thread "+Thread.currentThread().getName());
                     Thread.dumpStack();
                 }
-    
+
                 // run the whole static initialization privileged to speed up,
                 // since this skips checking further access
                 AccessController.doPrivileged(new PrivilegedAction<Object>() {
                     public Object run() {
                         Platform.initSingleton();
-                        
+
                         // Performance hack to trigger classloading of the GL classes impl, which makes up to 12%, 800ms down to 700ms
                         new Thread(new Runnable() {
                           public void run() {
@@ -132,15 +132,15 @@ public class GLProfile {
                                   ReflectionUtil.createInstance(getGLImplBaseClassName(GL4bc)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);
                               } catch (Throwable t) {}
                               try {
-                                  ReflectionUtil.createInstance(getGLImplBaseClassName(GLES3)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);              
+                                  ReflectionUtil.createInstance(getGLImplBaseClassName(GLES3)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);
                               } catch (Throwable t) {}
                               try {
-                                  ReflectionUtil.createInstance(getGLImplBaseClassName(GLES1)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);              
+                                  ReflectionUtil.createInstance(getGLImplBaseClassName(GLES1)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);
                               } catch (Throwable t) {}
                           }
-                        }, "GLProfile-GL_Bootstrapping").start();      
+                        }, "GLProfile-GL_Bootstrapping").start();
+
 
-                        
                         if(TempJarCache.isInitialized()) {
                            final ClassLoader cl = GLProfile.class.getClassLoader();
                            final String newtFactoryClassName = "com.jogamp.newt.NewtFactory";
@@ -164,13 +164,13 @@ public class GLProfile {
             if( justInitialized && ( hasGL234Impl || hasGLES1Impl || hasGLES3Impl ) ) {
                 System.err.println(JoglVersion.getDefaultOpenGLInfo(defaultDevice, null, true));
             }
-        }        
+        }
     }
 
     /**
      * Trigger eager initialization of GLProfiles for the given device,
      * in case it isn't done yet.
-     * 
+     *
      * @throws GLException if no profile for the given device is available.
      */
     public static void initProfiles(AbstractGraphicsDevice device) throws GLException {
@@ -194,7 +194,7 @@ public class GLProfile {
                 if(DEBUG) {
                     System.err.println("GLProfile.shutdown() - thread "+Thread.currentThread().getName());
                     Thread.dumpStack();
-                }                    
+                }
                 GLDrawableFactory.shutdown();
             }
         } finally {
@@ -206,11 +206,11 @@ public class GLProfile {
     // Query platform available OpenGL implementation
     //
 
-    /** 
+    /**
      * Returns the availability of a profile on a device.
-     * 
+     *
      * @param device a valid AbstractGraphicsDevice, or <code>null</null> for the default device.
-     * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..), 
+     * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
      *        or <code>[ null, GL ]</code> for the default profile.
      * @return true if the profile is available for the device, otherwise false.
      */
@@ -221,31 +221,31 @@ public class GLProfile {
     private static boolean isAvailableImpl(HashMap<String /*GLProfile_name*/, GLProfile> map, String profile) {
         return null != map && null != map.get(profile);
     }
-    
-    /** 
+
+    /**
      * Returns the availability of a profile on the default device.
-     * 
-     * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..), 
+     *
+     * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
      *        or <code>[ null, GL ]</code> for the default profile.
      * @return true if the profile is available for the default device, otherwise false.
      */
     public static boolean isAvailable(String profile) {
         return isAvailable(null, profile);
     }
-    
-    /** 
+
+    /**
      * Returns the availability of any profile on the default device.
-     * 
+     *
      * @return true if any profile is available for the default device, otherwise false.
      */
     public static boolean isAnyAvailable() {
         return isAvailable(null, null);
     }
-    
+
     public static String glAvailabilityToString(AbstractGraphicsDevice device) {
         return glAvailabilityToString(device, null).toString();
     }
-    
+
     public static StringBuilder glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb) {
         return glAvailabilityToString(device, sb, null, 0);
     }
@@ -264,19 +264,19 @@ public class GLProfile {
         final boolean useIndent = null != indent;
 
         initSingleton();
-        
+
         if(null==device) {
             device = defaultDevice;
         }
         final HashMap<String /*GLProfile_name*/, GLProfile> map = getProfileMap(device, false);
-        
+
         if(useIndent) {
             doIndent(sb, indent, indentCount).append("Native");
             indentCount++;
             doIndent(sb.append(Platform.getNewline()), indent, indentCount).append("GL4bc").append(indent);
         } else {
             sb.append("Native[GL4bc ");
-        }        
+        }
         avail=isAvailableImpl(map, GL4bc);
         sb.append(avail);
         if(avail) {
@@ -366,7 +366,7 @@ public class GLProfile {
             sb.append(", GL4ES3 ");
         }
         sb.append(isAvailableImpl(map, GL4ES3));
-        
+
         if(useIndent) {
             doIndent(sb.append(Platform.getNewline()), indent, indentCount).append("GL2ES2").append(indent);
         } else {
@@ -388,7 +388,7 @@ public class GLProfile {
         } else {
             sb.append("], Profiles[");
         }
-        
+
         if(null != map) {
             for(Iterator<GLProfile> i=map.values().iterator(); i.hasNext(); ) {
                 if(useIndent) {
@@ -418,7 +418,7 @@ public class GLProfile {
 
         return sb;
     }
-    
+
     /** Uses the default device */
     public static String glAvailabilityToString() {
         return glAvailabilityToString(null);
@@ -465,11 +465,11 @@ public class GLProfile {
 
     /** The intersection of the desktop GL4 and ES3 profile */
     public static final String GL4ES3 = "GL4ES3";
-    
+
     /** The default profile, used for the device default profile map  */
     private static final String GL_DEFAULT = "GL_DEFAULT";
 
-    /** 
+    /**
      * All GL Profiles in the order of default detection.
      * Desktop compatibility profiles (the one with fixed function pipeline) comes first
      * from highest to lowest version.
@@ -492,7 +492,7 @@ public class GLProfile {
      *
      */
     public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL4bc, GL3bc, GL2, GL4, GL3, GLES3, GL4ES3, GL2GL3, GLES2, GL2ES2, GLES1, GL2ES1 };
-    
+
     /**
      * Order of maximum profiles.
      *
@@ -526,7 +526,7 @@ public class GLProfile {
      *
      */
     public static final String[] GL_PROFILE_LIST_MIN = new String[] { GLES1, GLES2, GL2, GLES3, GL3, GL3bc, GL4, GL4bc };
-    
+
     /**
      * Order of minimum original desktop profiles.
      *
@@ -540,7 +540,7 @@ public class GLProfile {
      *
      */
     public static final String[] GL_PROFILE_LIST_MIN_DESKTOP = new String[] { GL2, GL3bc, GL4bc, GL3, GL4 };
-    
+
     /**
      * Order of maximum fixed function profiles
      *
@@ -582,7 +582,7 @@ public class GLProfile {
      *
      */
     public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER_CORE = new String[] { GL4, GL3, GLES3, GLES2 };
-    
+
     /** Returns a default GLProfile object, reflecting the best for the running platform.
      * It selects the first of the set {@link GLProfile#GL_PROFILE_LIST_ALL}
      * and favors hardware acceleration.
@@ -597,7 +597,7 @@ public class GLProfile {
     /** Returns a default GLProfile object, reflecting the best for the running platform.
      * It selects the first of the set {@link GLProfile#GL_PROFILE_LIST_ALL}
      * and favors hardware acceleration.
-     * <p>Uses the default device.</p> 
+     * <p>Uses the default device.</p>
      * @throws GLException if no profile is available for the default device.
      */
     public static GLProfile getDefault() {
@@ -617,7 +617,7 @@ public class GLProfile {
         return get(device, GL_PROFILE_LIST_MAX, favorHardwareRasterizer);
     }
 
-    /** Uses the default device 
+    /** Uses the default device
      * @throws GLException if no profile is available for the default device.
      * @see #GL_PROFILE_LIST_MAX
      */
@@ -640,7 +640,7 @@ public class GLProfile {
         return get(device, GL_PROFILE_LIST_MIN, favorHardwareRasterizer);
     }
 
-    /** Uses the default device 
+    /** Uses the default device
      * @throws GLException if no desktop profile is available for the default device.
      * @see #GL_PROFILE_LIST_MIN
      */
@@ -664,7 +664,7 @@ public class GLProfile {
         return get(device, GL_PROFILE_LIST_MAX_FIXEDFUNC, favorHardwareRasterizer);
     }
 
-    /** Uses the default device 
+    /** Uses the default device
      * @throws GLException if no fixed function profile is available for the default device.
      * @see #GL_PROFILE_LIST_MAX_FIXEDFUNC
      */
@@ -687,7 +687,7 @@ public class GLProfile {
         return get(device, GL_PROFILE_LIST_MAX_PROGSHADER, favorHardwareRasterizer);
     }
 
-    /** Uses the default device 
+    /** Uses the default device
      * @throws GLException if no programmable profile is available for the default device.
      * @see #GL_PROFILE_LIST_MAX_PROGSHADER
      */
@@ -706,11 +706,11 @@ public class GLProfile {
      */
     public static GLProfile getMaxProgrammableCore(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
         throws GLException
-    {            
+    {
         return get(device, GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer);
     }
 
-    /** Uses the default device 
+    /** Uses the default device
      * @throws GLException if no programmable core profile is available for the default device.
      * @see #GL_PROFILE_LIST_MAX_PROGSHADER_CORE
      */
@@ -719,8 +719,8 @@ public class GLProfile {
     {
         return get(GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer);
     }
-    
-    /** 
+
+    /**
      * Returns the GL2ES1 profile implementation, hence compatible w/ GL2ES1.<br/>
      * It returns:
      * <pre>
@@ -739,8 +739,8 @@ public class GLProfile {
         return get(device, GL2ES1).getImpl();
     }
 
-    /** 
-     * Calls {@link #getGL2ES1(AbstractGraphicsDevice)} using the default device. 
+    /**
+     * Calls {@link #getGL2ES1(AbstractGraphicsDevice)} using the default device.
      * <p>Selection favors hardware rasterizer.</p>
      * @see #getGL2ES1(AbstractGraphicsDevice)
      */
@@ -750,7 +750,7 @@ public class GLProfile {
         return get(defaultDevice, GL2ES1).getImpl();
     }
 
-    /** 
+    /**
      * Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.<br/>
      * It returns:
      * <pre>
@@ -769,8 +769,8 @@ public class GLProfile {
         return get(device, GL2ES2).getImpl();
     }
 
-    /** 
-     * Calls {@link #getGL2ES2(AbstractGraphicsDevice)} using the default device. 
+    /**
+     * Calls {@link #getGL2ES2(AbstractGraphicsDevice)} using the default device.
      * <p>Selection favors hardware rasterizer.</p>
      * @see #getGL2ES2(AbstractGraphicsDevice)
      */
@@ -780,7 +780,7 @@ public class GLProfile {
         return get(defaultDevice, GL2ES2).getImpl();
     }
 
-    /** 
+    /**
      * Returns the GL4ES3 profile implementation, hence compatible w/ GL4ES3.<br/>
      * It returns:
      * <pre>
@@ -799,8 +799,8 @@ public class GLProfile {
         return get(device, GL4ES3).getImpl();
     }
 
-    /** 
-     * Calls {@link #getGL4ES3(AbstractGraphicsDevice)} using the default device. 
+    /**
+     * Calls {@link #getGL4ES3(AbstractGraphicsDevice)} using the default device.
      * <p>Selection favors hardware rasterizer.</p>
      * @see #getGL4ES3(AbstractGraphicsDevice)
      */
@@ -810,7 +810,7 @@ public class GLProfile {
         return get(defaultDevice, GL4ES3).getImpl();
     }
 
-    /** 
+    /**
      * Returns the GL2GL3 profile implementation, hence compatible w/ GL2GL3.<br/>
      * It returns:
      * <pre>
@@ -829,8 +829,8 @@ public class GLProfile {
         return get(device, GL2GL3).getImpl();
     }
 
-    /** 
-     * Calls {@link #getGL2GL3(AbstractGraphicsDevice)} using the default device. 
+    /**
+     * Calls {@link #getGL2GL3(AbstractGraphicsDevice)} using the default device.
      * <p>Selection favors hardware rasterizer.</p>
      * @see #getGL2GL3(AbstractGraphicsDevice)
      */
@@ -846,7 +846,7 @@ public class GLProfile {
      * the default profile.
      *
      * @param device a valid AbstractGraphicsDevice, or <code>null</null> for the default device.
-     * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..), 
+     * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
      *        or <code>[ null, GL ]</code> for the default profile.
      * @throws GLException if the requested profile is not available for the device.
      */
@@ -864,8 +864,8 @@ public class GLProfile {
         return glp;
     }
 
-    /** Uses the default device 
-     * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..), 
+    /** Uses the default device
+     * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
      *        or <code>[ null, GL ]</code> for the default profile.
      * @throws GLException if the requested profile is not available for the default device.
      */
@@ -881,14 +881,14 @@ public class GLProfile {
      *
      * @param device a valid AbstractGraphicsDevice, or <code>null</null> for the default device.
      * @param profiles array of valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..)
-     * @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false. 
+     * @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false.
      * @throws GLException if the non of the requested profiles is available for the device.
      */
     public static GLProfile get(AbstractGraphicsDevice device, String[] profiles, boolean favorHardwareRasterizer)
         throws GLException
     {
         GLProfile glProfileAny = null;
-        
+
         HashMap<String /*GLProfile_name*/, GLProfile> map = getProfileMap(device, true);
         for(int i=0; i<profiles.length; i++) {
             final GLProfile glProfile = map.get(profiles[i]);
@@ -901,18 +901,18 @@ public class GLProfile {
                 }
                 if(null==glProfileAny) {
                     glProfileAny = glProfile;
-                }                
+                }
             }
         }
         if(null!=glProfileAny) {
             return glProfileAny;
-        }                
+        }
         throw new GLException("Profiles "+array2String(profiles)+" not available on device "+device);
     }
 
-    /** Uses the default device 
-     * @param profiles array of valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..) 
-     * @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false. 
+    /** Uses the default device
+     * @param profiles array of valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..)
+     * @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false.
      * @throws GLException if the non of the requested profiles is available for the default device.
      */
     public static GLProfile get(String[] profiles, boolean favorHardwareRasterizer)
@@ -920,28 +920,28 @@ public class GLProfile {
     {
         return get(defaultDevice, profiles, favorHardwareRasterizer);
     }
-    
-    /** Indicates whether the native OpenGL ES1 profile is in use. 
+
+    /** Indicates whether the native OpenGL ES1 profile is in use.
      * This requires an EGL interface.
      */
     public static boolean usesNativeGLES1(String profileImpl) {
         return GLES1.equals(profileImpl);
     }
 
-    /** Indicates whether the native OpenGL ES3 or ES2 profile is in use. 
+    /** Indicates whether the native OpenGL ES3 or ES2 profile is in use.
      * This requires an EGL, ES3 or ES2 compatible interface.
      */
     public static boolean usesNativeGLES2(String profileImpl) {
         return GLES3.equals(profileImpl) || GLES2.equals(profileImpl);
     }
 
-    /** Indicates whether the native OpenGL ES2 profile is in use. 
+    /** Indicates whether the native OpenGL ES2 profile is in use.
      * This requires an EGL, ES3 compatible interface.
      */
     public static boolean usesNativeGLES3(String profileImpl) {
         return GLES3.equals(profileImpl);
     }
-    
+
     /** Indicates whether either of the native OpenGL ES profiles are in use. */
     public static boolean usesNativeGLES(String profileImpl) {
         return usesNativeGLES2(profileImpl) || usesNativeGLES1(profileImpl);
@@ -1014,7 +1014,7 @@ public class GLProfile {
             throw new GLException("unsupported profile \"" + profileImpl + "\"");
         }
     }
-    
+
     /**
      * @param o GLProfile object to compare with
      * @return true if given Object is a GLProfile and
@@ -1035,7 +1035,7 @@ public class GLProfile {
         hash = 97 * hash + getName().hashCode();
         return hash;
     }
- 
+
     /**
      * @param glp GLProfile to compare with
      * @throws GLException if given GLProfile and this aren't equal
@@ -1055,14 +1055,14 @@ public class GLProfile {
     public final GLProfile getImpl() {
         return null != profileImpl ? profileImpl : this;
     }
-    
+
     /** return true if impl. is a hardware rasterizer, otherwise false. */
     public final boolean isHardwareRasterizer() {
         return isHardwareRasterizer;
     }
-    
-    /** 
-     * return this profiles implementation name, eg. GL2ES2 -> GL2, or GL3 -> GL3 
+
+    /**
+     * return this profiles implementation name, eg. GL2ES2 -> GL2, or GL3 -> GL3
      */
     public final String getImplName() {
         return null != profileImpl ? profileImpl.getName() : getName();
@@ -1102,12 +1102,12 @@ public class GLProfile {
     public final boolean isGLES2() {
         return GLES2 == profile;
     }
-    
+
     /** Indicates whether this profile is capable of GLES3.  <p>Includes [ GLES3 ].</p> */
     public final boolean isGLES3() {
         return GLES3 == profile;
     }
-    
+
     /** Indicates whether this profile is capable of GLES.  <p>Includes [ GLES3, GLES1, GLES2 ].</p> */
     public final boolean isGLES() {
         return GLES3 == profile || GLES2 == profile || GLES1 == profile;
@@ -1122,21 +1122,21 @@ public class GLProfile {
     public final boolean isGL2GL3() {
         return GL2GL3 == profile || isGL3() || isGL2();
     }
-    
+
     /** Indicates whether this profile is capable of GL2ES2. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL2, GL2GL3, GL2ES2, GLES2 ].</p> */
     public final boolean isGL2ES2() {
         return GL2ES2 == profile || isGLES2() || isGL2GL3();
     }
 
-    /** 
+    /**
      * Indicates whether this profile is capable of GL2ES3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL3ES3, GL2, GL2GL3 ].</p>
-     * @see #isGL3ES3() 
-     * @see #isGL2GL3() 
+     * @see #isGL3ES3()
+     * @see #isGL2GL3()
      */
     public final boolean isGL2ES3() {
         return isGL3ES3() || isGL2GL3();
     }
-    
+
     /** Indicates whether this profile is capable of GL3ES3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3 ].</p> */
     public final boolean isGL3ES3() {
         return isGL4ES3() || isGL3();
@@ -1172,7 +1172,7 @@ public class GLProfile {
         return usesNativeGLES2() || usesNativeGLES1();
     }
 
-    /** 
+    /**
      * General validation if type is a valid GL data type
      * for the current profile
      */
@@ -1200,14 +1200,14 @@ public class GLProfile {
                 if( isGL2() ) {
                     return true;
                 }
-        } 
+        }
         if(throwException) {
             throw new GLException("Illegal data type on profile "+this+": "+type);
         }
         return false;
     }
-    
-    public boolean isValidArrayDataType(int index, int comps, int type, 
+
+    public boolean isValidArrayDataType(int index, int comps, int type,
                                         boolean isVertexAttribPointer, boolean throwException) {
         final String arrayName = getGLArrayName(index);
         if( isGLES1() ) {
@@ -1226,7 +1226,7 @@ public class GLProfile {
                         case GL.GL_FIXED:
                         case GL.GL_FLOAT:
                             break;
-                        default: 
+                        default:
                             if(throwException) {
                                 throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type);
                             }
@@ -1238,7 +1238,7 @@ public class GLProfile {
                         case 3:
                         case 4:
                             break;
-                        default: 
+                        default:
                             if(throwException) {
                                 throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
                             }
@@ -1252,7 +1252,7 @@ public class GLProfile {
                         case GL.GL_FIXED:
                         case GL.GL_FLOAT:
                             break;
-                        default: 
+                        default:
                             if(throwException) {
                                 throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type);
                             }
@@ -1262,7 +1262,7 @@ public class GLProfile {
                         case 0:
                         case 3:
                             break;
-                        default: 
+                        default:
                             if(throwException) {
                                 throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
                             }
@@ -1275,7 +1275,7 @@ public class GLProfile {
                         case GL.GL_FIXED:
                         case GL.GL_FLOAT:
                             break;
-                        default: 
+                        default:
                             if(throwException) {
                                 throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type);
                             }
@@ -1285,7 +1285,7 @@ public class GLProfile {
                         case 0:
                         case 4:
                             break;
-                        default: 
+                        default:
                             if(throwException) {
                                 throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
                             }
@@ -1303,7 +1303,7 @@ public class GLProfile {
                 case GL.GL_FLOAT:
                 case GL.GL_FIXED:
                     break;
-                default: 
+                default:
                     if(throwException) {
                         throw new GLException("Illegal data type for "+arrayName+" on profile GLES2: "+type);
                     }
@@ -1317,7 +1317,7 @@ public class GLProfile {
                 case 3:
                 case 4:
                     break;
-                default: 
+                default:
                     if(throwException) {
                         throw new GLException("Illegal component number for "+arrayName+" on profile GLES2: "+comps);
                     }
@@ -1335,7 +1335,7 @@ public class GLProfile {
                     case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
                     case javax.media.opengl.GL2.GL_DOUBLE:
                         break;
-                    default: 
+                    default:
                         if(throwException) {
                             throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
                         }
@@ -1348,7 +1348,7 @@ public class GLProfile {
                     case 3:
                     case 4:
                         break;
-                    default: 
+                    default:
                         if(throwException) {
                             throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
                         }
@@ -1363,7 +1363,7 @@ public class GLProfile {
                             case javax.media.opengl.GL2ES2.GL_INT:
                             case javax.media.opengl.GL2.GL_DOUBLE:
                                 break;
-                            default: 
+                            default:
                                 if(throwException) {
                                     throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
                                 }
@@ -1375,7 +1375,7 @@ public class GLProfile {
                             case 3:
                             case 4:
                                 break;
-                            default: 
+                            default:
                                 if(throwException) {
                                     throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
                                 }
@@ -1390,7 +1390,7 @@ public class GLProfile {
                             case javax.media.opengl.GL2ES2.GL_INT:
                             case javax.media.opengl.GL2.GL_DOUBLE:
                                 break;
-                            default: 
+                            default:
                                 if(throwException) {
                                     throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
                                 }
@@ -1400,7 +1400,7 @@ public class GLProfile {
                             case 0:
                             case 3:
                                 break;
-                            default: 
+                            default:
                                 if(throwException) {
                                     throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
                                 }
@@ -1418,7 +1418,7 @@ public class GLProfile {
                             case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
                             case javax.media.opengl.GL2.GL_DOUBLE:
                                 break;
-                            default: 
+                            default:
                                 if(throwException) {
                                     throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
                                 }
@@ -1429,7 +1429,7 @@ public class GLProfile {
                             case 3:
                             case 4:
                                 break;
-                            default: 
+                            default:
                                 if(throwException) {
                                     throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
                                 }
@@ -1443,7 +1443,7 @@ public class GLProfile {
                             case javax.media.opengl.GL2ES2.GL_INT:
                             case javax.media.opengl.GL2.GL_DOUBLE:
                                 break;
-                            default: 
+                            default:
                                 if(throwException) {
                                     throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
                                 }
@@ -1456,7 +1456,7 @@ public class GLProfile {
                             case 3:
                             case 4:
                                 break;
-                            default: 
+                            default:
                                 if(throwException) {
                                     throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
                                 }
@@ -1475,7 +1475,7 @@ public class GLProfile {
 
     private static /*final*/ boolean isAWTAvailable;
 
-    private static /*final*/ boolean hasDesktopGLFactory;    
+    private static /*final*/ boolean hasDesktopGLFactory;
     private static /*final*/ boolean hasGL234Impl;
     private static /*final*/ boolean hasEGLFactory;
     private static /*final*/ boolean hasGLES3Impl;
@@ -1508,11 +1508,11 @@ public class GLProfile {
 
         // depends on hasDesktopGLFactory
         hasGL234Impl   = ReflectionUtil.isClassAvailable("jogamp.opengl.gl4.GL4bcImpl", classloader);
-        
+
         // depends on hasEGLFactory
         hasGLES1Impl   = ReflectionUtil.isClassAvailable("jogamp.opengl.es1.GLES1Impl", classloader);
         hasGLES3Impl   = ReflectionUtil.isClassAvailable("jogamp.opengl.es3.GLES3Impl", classloader);
-        
+
         //
         // Iteration of desktop GL availability detection
         // utilizing the detected GL version in the shared context.
@@ -1521,7 +1521,7 @@ public class GLProfile {
         //   which will register at GLContext ..
         //
         GLDrawableFactory.initSingleton();
-        
+
         Throwable t=null;
         // if successfull it has a shared dummy drawable and context created
         try {
@@ -1592,14 +1592,14 @@ public class GLProfile {
                 System.err.println("Info: GLProfile.init - EGL GLDrawable factory not available");
             }
         } else {
-            defaultEGLDevice = eglFactory.getDefaultDevice();            
+            defaultEGLDevice = eglFactory.getDefaultDevice();
         }
 
         if( null != defaultDesktopDevice ) {
             defaultDevice = defaultDesktopDevice;
             if(DEBUG) {
                 System.err.println("Info: GLProfile.init - Default device is desktop derived: "+defaultDevice);
-            }            
+            }
         } else if ( null != defaultEGLDevice ) {
             defaultDevice = defaultEGLDevice;
             if(DEBUG) {
@@ -1611,12 +1611,12 @@ public class GLProfile {
             }
             defaultDevice = null;
         }
-                
+
         // we require to initialize the EGL device 1st, if available
         final boolean addedEGLProfile     = null != defaultEGLDevice     ? initProfilesForDevice(defaultEGLDevice)     : false;
-        final boolean addedDesktopProfile = null != defaultDesktopDevice ? initProfilesForDevice(defaultDesktopDevice) : false;        
+        final boolean addedDesktopProfile = null != defaultDesktopDevice ? initProfilesForDevice(defaultDesktopDevice) : false;
         final boolean addedAnyProfile     = addedEGLProfile || addedDesktopProfile ;
-    
+
         if(DEBUG) {
             System.err.println("GLProfile.init addedAnyProfile       "+addedAnyProfile+" (desktop: "+addedDesktopProfile+", egl "+addedEGLProfile+")");
             System.err.println("GLProfile.init isAWTAvailable        "+isAWTAvailable);
@@ -1672,8 +1672,8 @@ public class GLProfile {
         boolean addedDesktopProfile = false;
         boolean addedEGLProfile = false;
 
-        final boolean deviceIsDesktopCompatible = hasDesktopGLFactory && desktopFactory.getIsDeviceCompatible(device);        
-                
+        final boolean deviceIsDesktopCompatible = hasDesktopGLFactory && desktopFactory.getIsDeviceCompatible(device);
+
         if( deviceIsDesktopCompatible ) {
             // 1st pretend we have all Desktop and EGL profiles ..
             computeProfileMap(device, true /* desktopCtxUndef*/, true  /* esCtxUndef */);
@@ -1698,9 +1698,9 @@ public class GLProfile {
             }
             addedDesktopProfile = computeProfileMap(device, false /* desktopCtxUndef*/, false /* esCtxUndef */);
         }
-        
+
         final boolean deviceIsEGLCompatible = hasEGLFactory && eglFactory.getIsDeviceCompatible(device);
-        
+
         // also test GLES1, GLES2 and GLES3 on desktop, since we have implementations / emulations available.
         if( deviceIsEGLCompatible && ( hasGLES3Impl || hasGLES1Impl ) ) {
             // 1st pretend we have all EGL profiles ..
@@ -1718,7 +1718,7 @@ public class GLProfile {
             }
             if(!eglSharedCtxAvail) {
                 // Remark: On Windows there is a libEGL.dll delivered w/ Chrome 15.0.874.121m and Firefox 8.0.1
-                // but it seems even EGL.eglInitialize(eglDisplay, null, null) 
+                // but it seems even EGL.eglInitialize(eglDisplay, null, null)
                 // fails in some scenarios (eg VirtualBox 4.1.6) w/ EGL error 0x3001 (EGL_NOT_INITIALIZED).
                 hasEGLFactory = false;
                 hasGLES3Impl = false;
@@ -1993,7 +1993,7 @@ public class GLProfile {
         return null;
     }
 
-    private static /*final*/ HashMap<String /*device_connection*/, HashMap<String /*GLProfile_name*/, GLProfile>> deviceConn2ProfileMap = 
+    private static /*final*/ HashMap<String /*device_connection*/, HashMap<String /*GLProfile_name*/, GLProfile>> deviceConn2ProfileMap =
                 new HashMap<String /*device_connection*/, HashMap<String /*GLProfile_name*/, GLProfile>>();
 
     /**
@@ -2004,22 +2004,22 @@ public class GLProfile {
      *
      * @param device the key 'device -> GLProfiles-Map'
      * @param throwExceptionOnZeroProfile true if <code>GLException</code> shall be thrown in case of no mapped profile, otherwise false.
-     * @return the GLProfile HashMap if exists, otherwise null 
+     * @return the GLProfile HashMap if exists, otherwise null
      * @throws GLException if no profile for the given device is available.
      */
-    private static HashMap<String /*GLProfile_name*/, GLProfile> getProfileMap(AbstractGraphicsDevice device, boolean throwExceptionOnZeroProfile) 
-        throws GLException 
+    private static HashMap<String /*GLProfile_name*/, GLProfile> getProfileMap(AbstractGraphicsDevice device, boolean throwExceptionOnZeroProfile)
+        throws GLException
     {
         initSingleton();
 
         if(null==defaultDevice) { // avoid NPE and notify of incomplete initialization
             throw new GLException("No default device available");
         }
-        
+
         if(null==device) {
             device = defaultDevice;
         }
-        
+
         final String deviceKey = device.getUniqueID();
         HashMap<String /*GLProfile_name*/, GLProfile> map = deviceConn2ProfileMap.get(deviceKey);
         if( null != map ) {
diff --git a/src/jogl/classes/javax/media/opengl/GLRunnable.java b/src/jogl/classes/javax/media/opengl/GLRunnable.java
index 1ae1c9b22..ad68662ce 100644
--- a/src/jogl/classes/javax/media/opengl/GLRunnable.java
+++ b/src/jogl/classes/javax/media/opengl/GLRunnable.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package javax.media.opengl;
 
 /**
@@ -33,8 +33,8 @@ package javax.media.opengl;
  * Declares a one-shot OpenGL command usable for injection
  * via {@link GLAutoDrawable#invoke(boolean, javax.media.opengl.GLRunnable)}.<br>
  * {@link GLAutoDrawable} executes the GLRunnables within it's {@link GLAutoDrawable#display() display()}
- * method after all registered {@link GLEventListener}s 
- * {@link GLEventListener#display(GLAutoDrawable) display(GLAutoDrawable)} 
+ * method after all registered {@link GLEventListener}s
+ * {@link GLEventListener#display(GLAutoDrawable) display(GLAutoDrawable)}
  * methods has been called.
  * </p>
  * <p>
@@ -44,13 +44,13 @@ package javax.media.opengl;
  * This might be useful to inject OpenGL commands from an I/O event listener.
  * </p>
  */
-public interface GLRunnable { 
+public interface GLRunnable {
     /**
      * @param drawable the associated drawable and current context for this call
      * @return true if the GL [back] framebuffer remains intact by this runnable, otherwise false.
      *         If returning false {@link GLAutoDrawable} will call
-     *         {@link GLEventListener#display(GLAutoDrawable) display(GLAutoDrawable)} 
-     *         of all registered {@link GLEventListener}s once more. 
+     *         {@link GLEventListener#display(GLAutoDrawable) display(GLAutoDrawable)}
+     *         of all registered {@link GLEventListener}s once more.
      * @see GLRunnable
      */
     boolean run(GLAutoDrawable drawable);
diff --git a/src/jogl/classes/javax/media/opengl/GLRunnable2.java b/src/jogl/classes/javax/media/opengl/GLRunnable2.java
index 1598a6215..5f0393257 100644
--- a/src/jogl/classes/javax/media/opengl/GLRunnable2.java
+++ b/src/jogl/classes/javax/media/opengl/GLRunnable2.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package javax.media.opengl;
 
 /**
@@ -33,11 +33,11 @@ package javax.media.opengl;
  * Declares a one-shot OpenGL command.
  * </p>
  */
-public interface GLRunnable2<T,U> { 
+public interface GLRunnable2<T,U> {
     /**
      * @param gl a current GL object
      * @param args custom arguments
-     * @return the desired object 
+     * @return the desired object
      */
     T run(GL gl, U args);
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLUniformData.java b/src/jogl/classes/javax/media/opengl/GLUniformData.java
index 60d0c58bf..700bba2eb 100644
--- a/src/jogl/classes/javax/media/opengl/GLUniformData.java
+++ b/src/jogl/classes/javax/media/opengl/GLUniformData.java
@@ -77,16 +77,16 @@ public class GLUniformData {
           sb = new StringBuilder();
       }
       sb.append("GLUniformData[name ").append(name).
-                       append(", location ").append(location). 
+                       append(", location ").append(location).
                        append(", size ").append(rows).append("x").append(columns).
-                       append(", count ").append(count). 
-                       append(", data ");      
+                       append(", count ").append(count).
+                       append(", data ");
       if(isMatrix() && data instanceof FloatBuffer) {
           sb.append("\n");
-          final FloatBuffer fb = (FloatBuffer)getBuffer(); 
+          final FloatBuffer fb = (FloatBuffer)getBuffer();
           for(int i=0; i<count; i++) {
               FloatUtil.matrixToString(sb, i+": ", "%10.5f", fb, i*rows*columns, rows, columns, false);
-              sb.append(",\n");              
+              sb.append(",\n");
           }
       } else if(isBuffer()) {
           Buffers.toString(sb, null, getBuffer());
@@ -96,7 +96,7 @@ public class GLUniformData {
       sb.append("]");
       return sb;
     }
-    
+
     public String toString() {
         return toString(null).toString();
     }
@@ -166,7 +166,7 @@ public class GLUniformData {
         location = gl.glGetUniformLocation(program, name);
         return location;
     }
-    
+
     public Object getObject() {
         return data;
     }
diff --git a/src/jogl/classes/javax/media/opengl/Threading.java b/src/jogl/classes/javax/media/opengl/Threading.java
index 4788f9cf6..7503e9cf7 100644
--- a/src/jogl/classes/javax/media/opengl/Threading.java
+++ b/src/jogl/classes/javax/media/opengl/Threading.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -42,7 +42,7 @@ package javax.media.opengl;
 
 import jogamp.opengl.ThreadingImpl;
 
-/** This API provides access to the threading model for the implementation of 
+/** This API provides access to the threading model for the implementation of
     the classes in this package.
 
     <P>
@@ -59,12 +59,12 @@ import jogamp.opengl.ThreadingImpl;
 
     Due to these limitations, and due to the inherent multithreading
     in the Java platform (in particular, in the Abstract Window
-    Toolkit), it is often necessary to limit the multithreading 
-    occurring in the typical application using the OpenGL API. 
+    Toolkit), it is often necessary to limit the multithreading
+    occurring in the typical application using the OpenGL API.
 
     <P>
 
-    In the current reference implementation, for instance, multithreading 
+    In the current reference implementation, for instance, multithreading
     has been limited by
     forcing all OpenGL-related work for GLAutoDrawables on to a single
     thread. In other words, if an application uses only the
@@ -93,9 +93,9 @@ import jogamp.opengl.ThreadingImpl;
 
     This class also provides mechanisms for querying whether this
     internal serialization of OpenGL work is in effect, and a
-    programmatic way of disabling it.  In the current reference 
-    implementation it is enabled by default, although it could be 
-    disabled in the future if OpenGL drivers become more robust on 
+    programmatic way of disabling it.  In the current reference
+    implementation it is enabled by default, although it could be
+    disabled in the future if OpenGL drivers become more robust on
     all platforms.
 
     <P>
@@ -113,7 +113,7 @@ import jogamp.opengl.ThreadingImpl;
                              platforms, and also the default behavior older releases)
     -Djogl.1thread=worker    Enable single-threading of OpenGL work on newly-created worker thread (not suitable for Mac
                              OS X or X11 platforms, and risky on Windows in applet environments)
-    </PRE>    
+    </PRE>
 */
 
 public class Threading {
@@ -121,9 +121,9 @@ public class Threading {
     /** No reason to ever instantiate this class */
     private Threading() {}
 
-    /** If an implementation of the javax.media.opengl APIs offers a 
-        multithreading option but the default behavior is single-threading, 
-        this API provides a mechanism for end users to disable single-threading 
+    /** If an implementation of the javax.media.opengl APIs offers a
+        multithreading option but the default behavior is single-threading,
+        this API provides a mechanism for end users to disable single-threading
         in this implementation.  Users are strongly discouraged from
         calling this method unless they are aware of all of the
         consequences and are prepared to enforce some amount of
@@ -133,7 +133,7 @@ public class Threading {
         GLPbuffer. Currently there is no supported way to re-enable it
         once disabled, partly to discourage careless use of this
         method. This method should be called as early as possible in an
-        application. */ 
+        application. */
     public static final void disableSingleThreading() {
         ThreadingImpl.disableSingleThreading();
     }
@@ -145,11 +145,11 @@ public class Threading {
     }
 
     /** Indicates whether the current thread is the designated toolkit thread,
-        if such semantics exists. */    
+        if such semantics exists. */
     public static final boolean isToolkitThread() throws GLException {
         return ThreadingImpl.isToolkitThread();
     }
-    
+
     /** Indicates whether the current thread is the single thread on
         which this implementation of the javax.media.opengl APIs
         performs all of its OpenGL-related work. This method should only
@@ -166,12 +166,12 @@ public class Threading {
         thread (i.e., if <code>isOpenGLThread()</code> returns
         false). It is up to the end user to check to see whether the
         current thread is the OpenGL thread and either execute the
-        Runnable directly or perform the work inside it. 
+        Runnable directly or perform the work inside it.
      **/
     public static final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
         ThreadingImpl.invokeOnOpenGLThread(wait, r);
     }
-    
+
     /**
      * If {@link #isSingleThreaded()} <b>and</b> not {@link #isOpenGLThread()}
      * <b>and</b> the <code>lock</code> is not being hold by this thread,
@@ -179,14 +179,14 @@ public class Threading {
      * <p>
      * Otherwise invoke Runnable <code>r</code> on the current thread.
      * </p>
-     * 
-     * @param wait set to true for waiting until Runnable <code>r</code> is finished, otherwise false. 
+     *
+     * @param wait set to true for waiting until Runnable <code>r</code> is finished, otherwise false.
      * @param r the Runnable to be executed
      * @param lock optional lock object to be tested
      * @throws GLException
      */
     public static final void invoke(boolean wait, Runnable r, Object lock) throws GLException {
-        if ( isSingleThreaded() && !isOpenGLThread() && 
+        if ( isSingleThreaded() && !isOpenGLThread() &&
              ( null == lock || !Thread.holdsLock(lock) ) ) {
             invokeOnOpenGLThread(wait, r);
         } else {
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL2.java b/src/jogl/classes/javax/media/opengl/TraceGL2.java
index 58f5d9f99..c577332e9 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL2.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL2.java
@@ -12,7 +12,7 @@ import java.io.PrintStream;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new TraceGL(drawable.getGL(), System.err));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL3.java b/src/jogl/classes/javax/media/opengl/TraceGL3.java
index 616b31f61..5fccf40c7 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL3.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL3.java
@@ -12,7 +12,7 @@ import java.io.PrintStream;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new TraceGL(drawable.getGL(), System.err));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL3bc.java b/src/jogl/classes/javax/media/opengl/TraceGL3bc.java
index f3761d4d6..84f537f60 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL3bc.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL3bc.java
@@ -12,7 +12,7 @@ import java.io.PrintStream;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new TraceGL(drawable.getGL(), System.err));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL4.java b/src/jogl/classes/javax/media/opengl/TraceGL4.java
index a12bf0f47..afe2cd9a1 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL4.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL4.java
@@ -12,7 +12,7 @@ import java.io.PrintStream;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new TraceGL(drawable.getGL(), System.err));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/TraceGLES2.java b/src/jogl/classes/javax/media/opengl/TraceGLES2.java
index 38d60e3ac..4740e2e72 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGLES2.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGLES2.java
@@ -12,7 +12,7 @@ import java.io.PrintStream;
  * Sample code which installs this pipeline, manual:
  * <pre>
  *     gl = drawable.setGL(new TraceGL(drawable.getGL(), System.err));
- * </pre> 
+ * </pre>
  * For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
  * </p>
  */
diff --git a/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java b/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java
index 0c4f63c2d..5feaa5760 100644
--- a/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java
+++ b/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index 6828beb10..f08fbafe8 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -115,15 +115,15 @@ import jogamp.opengl.awt.AWTTilePainter;
     of Z-ordering or LayoutManager problems.
  *
  * <h5><A NAME="java2dgl">Offscreen Layer Remarks</A></h5>
- * 
+ *
  * {@link OffscreenLayerOption#setShallUseOffscreenLayer(boolean) setShallUseOffscreenLayer(true)}
- * maybe called to use an offscreen drawable (FBO or PBuffer) allowing 
+ * maybe called to use an offscreen drawable (FBO or PBuffer) allowing
  * the underlying JAWT mechanism to composite the image, if supported.
  * <p>
  * {@link OffscreenLayerOption#setShallUseOffscreenLayer(boolean) setShallUseOffscreenLayer(true)}
  * is being called if {@link GLCapabilitiesImmutable#isOnscreen()} is <code>false</code>.
  * </p>
- * 
+ *
  * <h5><A NAME="java2dgl">Java2D OpenGL Remarks</A></h5>
  *
  * To avoid any conflicts with a potential Java2D OpenGL context,<br>
@@ -274,7 +274,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   public final Object getUpstreamWidget() {
     return this;
   }
-     
+
   @Override
   public void setShallUseOffscreenLayer(boolean v) {
       shallUseOffscreenLayer = v;
@@ -315,11 +315,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
      *     all platforms since the peer hasn't been created.
      */
     final GraphicsConfiguration gc = super.getGraphicsConfiguration();
-    
+
     if( Beans.isDesignTime() ) {
         return gc;
     }
-    
+
     /*
      * chosen is only non-null on platforms where the GLDrawableFactory
      * returns a non-null GraphicsConfiguration (in the GLCanvas
@@ -431,11 +431,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
         _lock.unlock();
     }
   }
-    
+
   private final void setRealizedImpl(boolean realized) {
       final RecursiveLock _lock = lock;
       _lock.lock();
-      try {            
+      try {
           final GLDrawable _drawable = drawable;
           if( null == _drawable || realized == _drawable.isRealized() ||
               realized && ( 0 >= _drawable.getWidth() || 0 >= _drawable.getHeight() ) ) {
@@ -448,10 +448,10 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
       } finally {
           _lock.unlock();
       }
-  }  
+  }
   private final Runnable realizeOnEDTAction = new Runnable() { public void run() { setRealizedImpl(true); } };
   private final Runnable unrealizeOnEDTAction = new Runnable() { public void run() { setRealizedImpl(false); } };
-  
+
   @Override
   public final void setRealized(boolean realized) {
       // Make sure drawable realization happens on AWT-EDT and only there. Consider the AWTTree lock!
@@ -503,7 +503,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   public void destroy() {
     destroyImpl( false );
   }
-  
+
   protected void destroyImpl(boolean destroyJAWTWindowAndAWTDevice) {
     Threading.invoke(true, destroyOnEDTAction, getTreeLock());
     if( destroyJAWTWindowAndAWTDevice ) {
@@ -553,14 +553,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   public void addNotify() {
     final RecursiveLock _lock = lock;
     _lock.lock();
-    try {   
+    try {
         final boolean isBeansDesignTime = Beans.isDesignTime();
-        
+
         if(DEBUG) {
             System.err.println(getThreadName()+": Info: addNotify - start, bounds: "+this.getBounds()+", isBeansDesignTime "+isBeansDesignTime);
             // Thread.dumpStack();
         }
-    
+
         if( isBeansDesignTime ) {
             super.addNotify();
         } else {
@@ -576,21 +576,21 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             if(null==awtConfig) {
                 throw new GLException("Error: NULL AWTGraphicsConfiguration");
             }
-        
+
             // before native peer is valid: X11
             disableBackgroundErase();
-        
+
             // issues getGraphicsConfiguration() and creates the native peer
             super.addNotify();
-        
+
             // after native peer is valid: Windows
             disableBackgroundErase();
-        
+
             createDrawableAndContext( true );
-        
+
             // init drawable by paint/display makes the init sequence more equal
             // for all launch flavors (applet/javaws/..)
-            // validateGLDrawable();            
+            // validateGLDrawable();
         }
         awtWindowClosingProtocol.addClosingListener();
 
@@ -606,7 +606,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
     if ( !Beans.isDesignTime() ) {
         if( createJAWTWindow ) {
             jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(this, awtConfig);
-            jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer);            
+            jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer);
         }
         jawtWindow.lockSurface();
         try {
@@ -617,7 +617,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             jawtWindow.unlockSurface();
         }
     }
-  }  
+  }
 
   private boolean validateGLDrawable() {
       if( Beans.isDesignTime() || !isDisplayable() ) {
@@ -641,7 +641,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
       }
       return false;
   }
-  
+
   /** <p>Overridden to track when this component is removed from a
       container. Subclasses which override this method must call
       super.removeNotify() in their removeNotify() method in order to
@@ -686,13 +686,13 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   public void reshape(int x, int y, int width, int height) {
     synchronized (getTreeLock()) { // super.reshape(..) claims tree lock, so we do extend it's lock over reshape
         super.reshape(x, y, width, height);
-        
+
         if(DEBUG) {
             final NativeSurface ns = getNativeSurface();
             final long nsH = null != ns ? ns.getSurfaceHandle() : 0;
             System.err.println("GLCanvas.sizeChanged: ("+getThreadName()+"): "+width+"x"+height+" - surfaceHandle 0x"+Long.toHexString(nsH));
             // Thread.dumpStack();
-        }            
+        }
         if( validateGLDrawable() && !printActive ) {
             final GLDrawableImpl _drawable = drawable;
             if( ! _drawable.getChosenGLCapabilities().isOnscreen() ) {
@@ -701,7 +701,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
                 try {
                     final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, width, height);
                     if(_drawable != _drawableNew) {
-                        // write back 
+                        // write back
                         drawable = _drawableNew;
                     }
                 } finally {
@@ -723,13 +723,13 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   private volatile boolean printActive = false;
-  private GLAnimatorControl printAnimator = null; 
+  private GLAnimatorControl printAnimator = null;
   private GLAutoDrawable printGLAD = null;
   private AWTTilePainter printAWTTiles = null;
-  
+
   @Override
   public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
-      printActive = true; 
+      printActive = true;
       final int componentCount = isOpaque() ? 3 : 4;
       final TileRenderer printRenderer = new TileRenderer();
       printAWTTiles = new AWTTilePainter(printRenderer, componentCount, scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight, DEBUG);
@@ -742,14 +742,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
               if(DEBUG) {
                   System.err.println(getThreadName()+": Info: GLCanvas setupPrint - skipped GL render, drawable not valid yet");
               }
-              printActive = false; 
+              printActive = false;
               return; // not yet available ..
           }
           if( !isVisible() ) {
               if(DEBUG) {
                   System.err.println(getThreadName()+": Info: GLCanvas setupPrint - skipped GL render, drawable visible");
               }
-              printActive = false; 
+              printActive = false;
               return; // not yet available ..
           }
           sendReshape = false; // clear reshape flag
@@ -757,7 +757,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
           if( null != printAnimator ) {
               printAnimator.remove(GLCanvas.this);
           }
-          printGLAD = GLCanvas.this; // _not_ default, shall be replaced by offscreen GLAD          
+          printGLAD = GLCanvas.this; // _not_ default, shall be replaced by offscreen GLAD
           final GLCapabilities caps = (GLCapabilities)getChosenGLCapabilities().cloneMutable();
           final int printNumSamples = printAWTTiles.getNumSamples(caps);
           GLDrawable printDrawable = printGLAD.getDelegatedDrawable();
@@ -783,8 +783,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
                   caps.setNumSamples(printNumSamples);
               }
               final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-              printGLAD = factory.createOffscreenAutoDrawable(null, caps, null, 
-                      printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE, 
+              printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
+                      printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
                       printAWTTiles.customTileHeight != -1 ? printAWTTiles.customTileHeight : DEFAULT_PRINT_TILE_SIZE,
                       null);
               GLDrawableUtil.swapGLContextAndAllGLEventListener(GLCanvas.this, printGLAD);
@@ -801,7 +801,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
           }
       }
   };
-  
+
   @Override
   public void releasePrint() {
       if( !printActive || null == printGLAD ) {
@@ -832,7 +832,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
           display();
       }
   };
-  
+
   @Override
   public void print(Graphics graphics) {
       if( !printActive || null == printGLAD ) {
@@ -843,7 +843,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
           // we cannot dispatch print on AWT-EDT due to printing internal locking ..
       }
       sendReshape = false; // clear reshape flag
-      
+
       final Graphics2D g2d = (Graphics2D)graphics;
       try {
           printAWTTiles.setupGraphics2DAndClipBounds(g2d, getWidth(), getHeight());
@@ -876,7 +876,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
           System.err.println("AWT print.X: "+printAWTTiles);
       }
   }
-    
+
   @Override
   public void addGLEventListener(GLEventListener listener) {
     helper.addGLEventListener(listener);
@@ -906,14 +906,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
       helper.setGLEventListenerInitState(listener, initialized);
   }
-  
+
   @Override
   public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
     final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
     Threading.invoke(true, r, getTreeLock());
     return r.listener;
   }
-  
+
   @Override
   public GLEventListener removeGLEventListener(GLEventListener listener) {
     return helper.removeGLEventListener(listener);
@@ -948,7 +948,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   public boolean invoke(final boolean wait, final List<GLRunnable> glRunnables) {
     return helper.invoke(this, wait, glRunnables);
   }
-  
+
   @Override
   public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
       final RecursiveLock _lock = lock;
@@ -967,7 +967,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   public final GLDrawable getDelegatedDrawable() {
     return drawable;
   }
-  
+
   @Override
   public GLContext getContext() {
     return context;
@@ -1049,7 +1049,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
     final GLDrawable _drawable = drawable;
     return null != _drawable ? _drawable.isGLOriented() : true;
   }
-  
+
   @Override
   public NativeSurface getNativeSurface() {
     final GLDrawable _drawable = drawable;
@@ -1093,7 +1093,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
     public void run() {
         final RecursiveLock _lock = lock;
         _lock.lock();
-        try {            
+        try {
             final GLAnimatorControl animator =  getAnimator();
 
             if(DEBUG) {
@@ -1101,7 +1101,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
                         (null!=context) + ", hasDrawable " + (null!=drawable)+", "+animator);
                 // Thread.dumpStack();
             }
-                    
+
             final boolean animatorPaused;
             if(null!=animator) {
                 // can't remove us from animator for recreational addNotify()
@@ -1109,7 +1109,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             } else {
                 animatorPaused = false;
             }
-            
+
             // OLS will be detached by disposeGL's context destruction below
             if( null != context ) {
                 if( context.isCreated() ) {
@@ -1137,11 +1137,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             if(animatorPaused) {
                 animator.resume();
             }
-            
+
             if(DEBUG) {
                 System.err.println(getThreadName()+": dispose() - END, animator "+animator);
             }
-            
+
         } finally {
             _lock.unlock();
         }
@@ -1170,7 +1170,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             }
             jawtWindow=null;
         }
-        
+
         if(null != awtConfig) {
             final AbstractGraphicsConfiguration aconfig = awtConfig.getNativeGraphicsConfiguration();
             final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
@@ -1188,7 +1188,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
         awtConfig=null;
     }
   };
-  
+
   private final Runnable initAction = new Runnable() {
     @Override
     public void run() {
@@ -1250,7 +1250,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
         this.listener = listener;
         this.remove = remove;
     }
-    
+
     @Override
     public void run() {
         final RecursiveLock _lock = lock;
@@ -1262,7 +1262,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
         }
     }
   };
-  
+
   // Disables the AWT's erasing of this Canvas's background on Windows
   // in Java SE 6. This internal API is not available in previous
   // releases, but the system property
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index 1ec0ad7bc..84db62515 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -129,7 +129,7 @@ import com.jogamp.opengl.util.texture.TextureState;
     </p>
     <p>
     In case the above mentioned GLSL vertical-flipping is not performed,
-    {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line. 
+    {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line.
     This step causes more CPU load per frame and is not hardware-accelerated.
     </p>
     <p>
@@ -139,8 +139,8 @@ import com.jogamp.opengl.util.texture.TextureState;
     <P>
  *  Please read <a href="GLCanvas.html#java2dgl">Java2D OpenGL Remarks</a>.
  *  </P>
- *  
-    <a name="fboGLSLVerticalFlip"><h5>FBO / GLSL Vertical Flip</h5></a>     
+ *
+    <a name="fboGLSLVerticalFlip"><h5>FBO / GLSL Vertical Flip</h5></a>
     The FBO / GLSL code path uses one texture-unit and binds the FBO texture to it's active texture-target,
     see {@link #setTextureUnit(int)} and {@link #getTextureUnit()}.
     <p>
@@ -154,7 +154,7 @@ import com.jogamp.opengl.util.texture.TextureState;
     <i>Warning (Bug 842)</i>: Certain GL states other than viewport and texture (see above)
     influencing rendering, will also influence the GLSL vertical flip, e.g. {@link GL#glFrontFace(int) glFrontFace}({@link GL#GL_CCW}).
     It is recommended to reset those states to default when leaving the {@link GLEventListener#display(GLAutoDrawable)} method!
-    We may change this behavior in the future, i.e. preserve all influencing states.   
+    We may change this behavior in the future, i.e. preserve all influencing states.
     </p>
 */
 
@@ -162,23 +162,23 @@ import com.jogamp.opengl.util.texture.TextureState;
 public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosingProtocol, AWTPrintLifecycle {
   private static final boolean DEBUG;
   private static final boolean DEBUG_VIEWPORT;
-  private static final boolean USE_GLSL_TEXTURE_RASTERIZER;    
+  private static final boolean USE_GLSL_TEXTURE_RASTERIZER;
 
   /** Indicates whether the Java 2D OpenGL pipeline is requested by user. */
   private static final boolean java2dOGLEnabledByProp;
-  
+
   /** Indicates whether the Java 2D OpenGL pipeline is enabled, resource-compatible and requested by user. */
   private static final boolean useJava2DGLPipeline;
-  
+
   /** Indicates whether the Java 2D OpenGL pipeline's usage is error free. */
   private static boolean java2DGLPipelineOK;
-  
+
   static {
       Debug.initSingleton();
       DEBUG = Debug.debug("GLJPanel");
       DEBUG_VIEWPORT = Debug.isPropertyDefined("jogl.debug.GLJPanel.Viewport", true);
       USE_GLSL_TEXTURE_RASTERIZER = !Debug.isPropertyDefined("jogl.gljpanel.noglsl", true);
-      
+
       boolean enabled = Debug.getBooleanProperty("sun.java2d.opengl", false);
       java2dOGLEnabledByProp = enabled && !Debug.isPropertyDefined("jogl.gljpanel.noogl", true);
 
@@ -201,7 +201,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           System.err.println("GLJPanel: java2DGLPipelineOK "+java2DGLPipelineOK);
       }
   }
-  
+
   private static SingleAWTGLPixelBufferProvider singleAWTGLPixelBufferProvider = null;
   private static synchronized SingleAWTGLPixelBufferProvider getSingleAWTGLPixelBufferProvider() {
       if( null == singleAWTGLPixelBufferProvider ) {
@@ -209,7 +209,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       }
       return singleAWTGLPixelBufferProvider;
   }
-    
+
   private GLDrawableHelper helper = new GLDrawableHelper();
   private volatile boolean isInitialized;
 
@@ -236,14 +236,14 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   // Width of the actual GLJPanel: reshapeWidth -> panelWidth -> backend.width
   private int panelWidth   = 0;
   private int panelHeight  = 0;
-  
+
   // These are always set to (0, 0) except when the Java2D / OpenGL
   // pipeline is active
   private int viewportX;
   private int viewportY;
 
   private int requestedTextureUnit = 0; // default
-  
+
   // The backend in use
   private volatile Backend backend;
 
@@ -316,7 +316,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     this.factory = GLDrawableFactoryImpl.getFactoryImpl(glProfile);
     this.chooser = ((chooser != null) ? chooser : new DefaultGLCapabilitiesChooser());
     this.shareWith = shareWith;
-    
+
     this.setFocusable(true); // allow keyboard input!
   }
 
@@ -336,12 +336,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       }
       customPixelBufferProvider = custom;
   }
-  
+
   @Override
   public final Object getUpstreamWidget() {
     return this;
   }
-  
+
   @Override
   public void display() {
     if( isVisible() ) {
@@ -446,7 +446,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           handleReshape = false;
           sendReshape = handleReshape();
         }
-    
+
         if( isVisible() ) {
             updater.setGraphics(g);
             backend.doPaintComponent(g);
@@ -489,7 +489,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       which override this method must call super.reshape() in
       their reshape() method in order to function properly. <P>
    *
-   * {@inheritDoc} 
+   * {@inheritDoc}
    */
   @SuppressWarnings("deprecation")
   @Override
@@ -500,7 +500,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         System.err.println(getThreadName()+": GLJPanel.reshape resize"+(printActive?"WithinPrint":"")+" [ panel "+
                 panelWidth+"x"+panelHeight +
                 ", reshape: " +reshapeWidth+"x"+reshapeHeight +
-                "] -> "+(printActive?"skipped":"") + width+"x"+height);            
+                "] -> "+(printActive?"skipped":"") + width+"x"+height);
     }
     if( !printActive ) {
         reshapeWidth = width;
@@ -510,13 +510,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   private volatile boolean printActive = false;
-  private GLAnimatorControl printAnimator = null; 
+  private GLAnimatorControl printAnimator = null;
   private GLAutoDrawable printGLAD = null;
   private AWTTilePainter printAWTTiles = null;
-  
+
   @Override
   public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
-      printActive = true; 
+      printActive = true;
       final int componentCount = isOpaque() ? 3 : 4;
       final TileRenderer printRenderer = new TileRenderer();
       printAWTTiles = new AWTTilePainter(printRenderer, componentCount, scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight, DEBUG);
@@ -532,14 +532,14 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
               if(DEBUG) {
                   System.err.println(getThreadName()+": Info: GLJPanel setupPrint - skipped GL render, drawable not valid yet");
               }
-              printActive = false; 
+              printActive = false;
               return; // not yet available ..
           }
           if( !isVisible() ) {
               if(DEBUG) {
                   System.err.println(getThreadName()+": Info: GLJPanel setupPrint - skipped GL render, drawable visible");
               }
-              printActive = false; 
+              printActive = false;
               return; // not yet available ..
           }
           sendReshape = false; // clear reshape flag
@@ -548,8 +548,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           if( null != printAnimator ) {
               printAnimator.remove(GLJPanel.this);
           }
-          
-          printGLAD = GLJPanel.this; // default: re-use 
+
+          printGLAD = GLJPanel.this; // default: re-use
           final GLCapabilities caps = (GLCapabilities)getChosenGLCapabilities().cloneMutable();
           final int printNumSamples = printAWTTiles.getNumSamples(caps);
           GLDrawable printDrawable = printGLAD.getDelegatedDrawable();
@@ -570,8 +570,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
               caps.setSampleBuffers(0 < printNumSamples);
               caps.setNumSamples(printNumSamples);
               final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-              printGLAD = factory.createOffscreenAutoDrawable(null, caps, null, 
-                      printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE, 
+              printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
+                      printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
                       printAWTTiles.customTileHeight != -1 ? printAWTTiles.customTileHeight : DEFAULT_PRINT_TILE_SIZE,
                       null);
               GLDrawableUtil.swapGLContextAndAllGLEventListener(GLJPanel.this, printGLAD);
@@ -588,7 +588,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           }
       }
   };
-  
+
   @Override
   public void releasePrint() {
       if( !printActive ) {
@@ -598,7 +598,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       handleReshape = false; // ditto
       AWTEDTExecutor.singleton.invoke(getTreeLock(), true /* allowOnNonEDT */, true /* wait */, releasePrintOnEDT);
   }
-  
+
   private final Runnable releasePrintOnEDT = new Runnable() {
       @Override
       public void run() {
@@ -616,7 +616,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
               printAnimator.add(GLJPanel.this);
               printAnimator = null;
           }
-          
+
           // trigger reshape, i.e. gl-viewport and -listener - this component might got resized!
           final int awtWidth = GLJPanel.this.getWidth();
           final int awtHeight= GLJPanel.this.getHeight();
@@ -639,7 +639,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           display();
       }
   };
-  
+
   @Override
   public void print(Graphics graphics) {
       if( !printActive ) {
@@ -651,7 +651,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       }
       sendReshape = false; // clear reshape flag
       handleReshape = false; // ditto
-      
+
       final Graphics2D g2d = (Graphics2D)graphics;
       try {
           printAWTTiles.setupGraphics2DAndClipBounds(g2d, getWidth(), getHeight());
@@ -691,7 +691,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       }
       print(g);
   }
-      
+
   @Override
   public void setOpaque(boolean opaque) {
     if (backend != null) {
@@ -729,7 +729,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
       helper.setGLEventListenerInitState(listener, initialized);
   }
-   
+
   @Override
   public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
     final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
@@ -746,7 +746,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
     return r.listener;
   }
-  
+
   @Override
   public GLEventListener removeGLEventListener(GLEventListener listener) {
     return helper.removeGLEventListener(listener);
@@ -781,7 +781,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   public boolean invoke(final boolean wait, final List<GLRunnable> glRunnables) {
     return helper.invoke(this, wait, glRunnables);
   }
-  
+
   @Override
   public GLContext createContext(GLContext shareWith) {
     final Backend b = backend;
@@ -821,7 +821,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
     return b.getDrawable();
   }
-  
+
   @Override
   public GLContext getContext() {
     final Backend b = backend;
@@ -918,7 +918,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
     return b.getDrawable().isGLOriented();
   }
-  
+
   @Override
   public GLCapabilitiesImmutable getChosenGLCapabilities() {
     final Backend b = backend;
@@ -956,11 +956,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     return factory;
   }
 
-  /** 
+  /**
    * Returns the used texture unit, i.e. a value of [0..n], or -1 if non used.
    * <p>
    * If implementation uses a texture-unit, it will be known only after the first initialization, i.e. display call.
-   * </p> 
+   * </p>
    * <p>
    * See <a href="#fboGLSLVerticalFlip">FBO / GLSL Vertical Flip</a>.
    * </p>
@@ -970,9 +970,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     if ( null == b ) {
         return -1;
     }
-    return b.getTextureUnit();      
+    return b.getTextureUnit();
   }
-  
+
   /**
    * Allows user to request a texture unit to be used,
    * must be called before the first initialization, i.e. {@link #display()} call.
@@ -982,14 +982,14 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
    * <p>
    * See <a href="#fboGLSLVerticalFlip">FBO / GLSL Vertical Flip</a>.
    * </p>
-   * 
+   *
    * @param v requested texture unit
    * @see #getTextureUnit()
    */
   public final void setTextureUnit(int v) {
       requestedTextureUnit = v;
   }
-  
+
   //----------------------------------------------------------------------
   // Internals only below this point
   //
@@ -1004,7 +1004,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
       if (DEBUG) {
           System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend: " +panelWidth+"x"+panelHeight + " -> " + reshapeWidth+"x"+reshapeHeight);
-      }      
+      }
       // Pull down reshapeWidth and reshapeHeight into panelWidth and
       // panelHeight eagerly in order to complete initialization, and
       // force a reshape later
@@ -1039,7 +1039,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   private boolean handleReshape() {
     if (DEBUG) {
       System.err.println(getThreadName()+": GLJPanel.handleReshape: " +panelWidth+"x"+panelHeight + " -> " + reshapeWidth+"x"+reshapeHeight);
-    }    
+    }
     panelWidth  = reshapeWidth;
     panelHeight = reshapeHeight;
 
@@ -1089,7 +1089,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     public void plainPaint(GLAutoDrawable drawable) {
       helper.display(GLJPanel.this);
     }
-    
+
     @Override
     public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
       // This is handled above and dispatched directly to the appropriate context
@@ -1148,7 +1148,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       updater.plainPaint(GLJPanel.this);
     }
   };
-  
+
   private final Runnable paintImmediatelyAction = new Runnable() {
     @Override
     public void run() {
@@ -1172,7 +1172,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           }
       }
   };
-  
+
   private int getGLInteger(GL gl, int which) {
     int[] tmp = new int[1];
     gl.glGetIntegerv(which, tmp, 0);
@@ -1203,7 +1203,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     /** Called when the opacity of the GLJPanel is changed */
     public void setOpaque(boolean opaque);
 
-    /** 
+    /**
      * Called to manually create an additional OpenGL context against
      * this GLJPanel
      */
@@ -1220,7 +1220,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
     /** Returns the used texture unit, i.e. a value of [0..n], or -1 if non used. */
     public int getTextureUnit();
-    
+
     /** Called to fetch the "real" GLCapabilities for the backend */
     public GLCapabilitiesImmutable getChosenGLCapabilities();
 
@@ -1240,7 +1240,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
      */
     public boolean preGL(Graphics g);
 
-    /** 
+    /**
      * Called after the OpenGL work is done in init() and display().
      * The isDisplay argument indicates whether this was called on
      * behalf of a call to display() rather than init().
@@ -1262,7 +1262,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     private final boolean useSingletonBuffer;
     private AWTGLPixelBuffer pixelBuffer;
     private BufferedImage alignedImage;
-    
+
     // One of these is used to store the read back pixels before storing
     // in the BufferedImage
     protected IntBuffer readBackIntsForCPUVFlip;
@@ -1272,10 +1272,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     private boolean offscreenIsFBO;
     private FBObject fboFlipped;
     private GLSLTextureRaster glslTextureRaster;
-    
+
     private GLContextImpl offscreenContext;
-    private boolean flipVertical;          
-    
+    private boolean flipVertical;
+
     // For saving/restoring of OpenGL state during ReadPixels
     private final GLPixelStorageModes psm =  new GLPixelStorageModes();
 
@@ -1291,7 +1291,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             useSingletonBuffer = false;
         }
     }
-    
+
     @Override
     public boolean isUsingOwnLifecycle() { return false; }
 
@@ -1351,11 +1351,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
               } else {
                   fboFlipped = null;
                   glslTextureRaster = null;
-              }          
+              }
               offscreenContext.release();
           } else {
               isInitialized = false;
-          }          
+          }
       } finally {
           if( !isInitialized ) {
               if(null != offscreenContext) {
@@ -1376,7 +1376,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           System.err.println(getThreadName()+": OffscreenBackend: destroy() - offscreenContext: "+(null!=offscreenContext)+" - offscreenDrawable: "+(null!=offscreenDrawable));
       }
       if ( null != offscreenContext && offscreenContext.isCreated() ) {
-        if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {            
+        if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {
             try {
                 final GL gl = offscreenContext.getGL();
                 if(null != glslTextureRaster) {
@@ -1394,7 +1394,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       glslTextureRaster = null;
       fboFlipped = null;
       offscreenContext = null;
-      
+
       if (offscreenDrawable != null) {
         final AbstractGraphicsDevice adevice = offscreenDrawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
         offscreenDrawable.setRealized(false);
@@ -1404,8 +1404,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         }
       }
       offscreenIsFBO = false;
-      
-      if( null != readBackIntsForCPUVFlip ) { 
+
+      if( null != readBackIntsForCPUVFlip ) {
           readBackIntsForCPUVFlip.clear();
           readBackIntsForCPUVFlip = null;
       }
@@ -1449,10 +1449,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             componentCount = 4;
             alignment = 4;
         }
-        
-        final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, componentCount);        
-        
-        if( useSingletonBuffer ) { // attempt to fetch the latest AWTGLPixelBuffer             
+
+        final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, componentCount);
+
+        if( useSingletonBuffer ) { // attempt to fetch the latest AWTGLPixelBuffer
             pixelBuffer = (AWTGLPixelBuffer) ((SingletonGLPixelBufferProvider)pixelBufferProvider).getSingleBuffer(pixelAttribs);
         }
         if( null != pixelBuffer && pixelBuffer.requiresNewBuffer(gl, panelWidth, panelHeight, 0) ) {
@@ -1463,7 +1463,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         if ( null == pixelBuffer ) {
           if (0 >= panelWidth || 0 >= panelHeight ) {
               return;
-          }          
+          }
           pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, panelWidth, panelHeight, 1, true, 0);
           if(DEBUG) {
               System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: pixelBufferProvider isSingletonBufferProvider "+useSingletonBuffer+", 0x"+Integer.toHexString(pixelBufferProvider.hashCode())+", "+pixelBufferProvider.getClass().getSimpleName());
@@ -1482,7 +1482,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             }
         }
         final IntBuffer readBackInts;
-        
+
         if( !flipVertical || null != glslTextureRaster ) {
            readBackInts = (IntBuffer) pixelBuffer.buffer;
         } else {
@@ -1494,7 +1494,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
         final TextureState usrTexState, fboTexState;
         final int fboTexUnit = GL.GL_TEXTURE0 + ( offscreenIsFBO ? ((GLFBODrawable)offscreenDrawable).getTextureUnit() : 0 );
-        
+
         if( offscreenIsFBO ) {
             usrTexState = new TextureState(gl, GL.GL_TEXTURE_2D);
             if( fboTexUnit != usrTexState.getUnit() ) {
@@ -1510,9 +1510,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             usrTexState = null;
             fboTexState = null;
         }
-        
+
         // Must now copy pixels from offscreen context into surface
-        
+
         // Save current modes
         psm.setAlignment(gl, alignment, alignment);
         if(gl.isGL2ES3()) {
@@ -1520,14 +1520,14 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             gl2es3.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, panelWidth);
             gl2es3.glReadBuffer(gl2es3.getDefaultReadBuffer());
         }
-        
+
         offscreenDrawable.swapBuffers();
-        
+
         if(null != glslTextureRaster) { // implies flippedVertical
             final boolean viewportChange;
             final int[] usrViewport = new int[] { 0, 0, 0, 0 };
             gl.glGetIntegerv(GL.GL_VIEWPORT, usrViewport, 0);
-            viewportChange = 0 != usrViewport[0] || 0 != usrViewport[1] || 
+            viewportChange = 0 != usrViewport[0] || 0 != usrViewport[1] ||
                              offscreenDrawable.getWidth() != usrViewport[2] || offscreenDrawable.getHeight() != usrViewport[3];
             if( DEBUG_VIEWPORT ) {
                 System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL: Viewport: change "+viewportChange+
@@ -1536,21 +1536,21 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             }
             if( viewportChange ) {
                 gl.glViewport(0, 0, offscreenDrawable.getWidth(), offscreenDrawable.getHeight());
-            }            
-                        
-            // perform vert-flipping via OpenGL/FBO        
+            }
+
+            // perform vert-flipping via OpenGL/FBO
             final GLFBODrawable fboDrawable = (GLFBODrawable)offscreenDrawable;
             final FBObject.TextureAttachment fboTex = fboDrawable.getTextureBuffer(GL.GL_FRONT);
-            
+
             fboFlipped.bind(gl);
-            
+
             // gl.glActiveTexture(GL.GL_TEXTURE0 + fboDrawable.getTextureUnit()); // implicit by GLFBODrawableImpl: swapBuffers/contextMadeCurent -> swapFBOImpl
-            gl.glBindTexture(GL.GL_TEXTURE_2D, fboTex.getName());            
+            gl.glBindTexture(GL.GL_TEXTURE_2D, fboTex.getName());
             // gl.glClear(GL.GL_DEPTH_BUFFER_BIT); // fboFlipped runs w/o DEPTH!
-            
+
             glslTextureRaster.display(gl.getGL2ES2());
             gl.glReadPixels(0, 0, panelWidth, panelHeight, pixelAttribs.format, pixelAttribs.type, readBackInts);
-            
+
             fboFlipped.unbind(gl);
             if( viewportChange ) {
                 gl.glViewport(usrViewport[0], usrViewport[1], usrViewport[2], usrViewport[3]);
@@ -1558,7 +1558,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             fboTexState.restore(gl);
         } else {
             gl.glReadPixels(0, 0, panelWidth, panelHeight, pixelAttribs.format, pixelAttribs.type, readBackInts);
-            
+
             if ( flipVertical ) {
                 // Copy temporary data into raster of BufferedImage for faster
                 // blitting Note that we could avoid this copy in the cases
@@ -1586,7 +1586,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         // correctness on all platforms
       }
     }
-    
+
     @Override
     public int getTextureUnit() {
         if(null != glslTextureRaster && null != offscreenDrawable) { // implies flippedVertical
@@ -1598,16 +1598,16 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     @Override
     public void doPaintComponent(Graphics g) {
       helper.invokeGL(offscreenDrawable, offscreenContext, updaterDisplayAction, updaterInitAction);
-      
+
       if ( null != alignedImage ) {
         // Draw resulting image in one shot
         g.drawImage(alignedImage, 0, 0, alignedImage.getWidth(), alignedImage.getHeight(), null); // Null ImageObserver since image data is ready.
       }
     }
-    
+
     @Override
     public void doPlainPaint() {
-      helper.invokeGL(offscreenDrawable, offscreenContext, updaterPlainDisplayAction, updaterInitAction);        
+      helper.invokeGL(offscreenDrawable, offscreenContext, updaterPlainDisplayAction, updaterInitAction);
     }
 
     @Override
@@ -1616,7 +1616,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         {
             final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, offscreenContext, panelWidth, panelHeight);
             if(_drawable != _drawableNew) {
-                // write back 
+                // write back
                 _drawable = _drawableNew;
                 offscreenDrawable = _drawableNew;
             }
@@ -1626,9 +1626,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         }
         panelWidth = _drawable.getWidth();
         panelHeight = _drawable.getHeight();
-        
+
         if( null != glslTextureRaster ) {
-            if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {            
+            if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {
                 try {
                     final GL gl = offscreenContext.getGL();
                     fboFlipped.reset(gl, _drawable.getWidth(), _drawable.getHeight(), 0, false);
@@ -1640,7 +1640,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         }
         return _drawable.isRealized();
     }
-    
+
     @Override
     public GLContext createContext(GLContext shareWith) {
       return (null != offscreenDrawable) ? offscreenDrawable.createContext(shareWith) : null;
@@ -1790,7 +1790,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
     @Override
     public int getTextureUnit() { return -1; }
-    
+
     @Override
     public GLCapabilitiesImmutable getChosenGLCapabilities() {
       // FIXME: should do better than this; is it possible to using only platform-independent code?
@@ -2114,9 +2114,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
     @Override
     public void doPlainPaint() {
-      helper.invokeGL(joglDrawable, joglContext, updaterPlainDisplayAction, updaterInitAction);        
+      helper.invokeGL(joglDrawable, joglContext, updaterPlainDisplayAction, updaterInitAction);
     }
-    
+
     private void captureJ2DState(GL gl, Graphics g) {
       gl.glGetIntegerv(GL2.GL_DRAW_BUFFER, drawBuffer, 0);
       gl.glGetIntegerv(GL2.GL_READ_BUFFER, readBuffer, 0);
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
index 9fee0a2e2..b4d788329 100644
--- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
@@ -58,18 +58,18 @@ public interface GLMatrixFunc {
      *        which is the same behavior than the native JOGL GL impl
      */
     public void glGetFloatv(int pname, java.nio.FloatBuffer params);
-    
+
     /**
      * Copy the named matrix to the given storage at offset.
      * @param pname {@link #GL_MODELVIEW_MATRIX}, {@link #GL_PROJECTION_MATRIX} or {@link #GL_TEXTURE_MATRIX}
      * @param params storage
      * @param params_offset storage offset
-     */ 
+     */
     public void glGetFloatv(int pname, float[] params, int params_offset);
-    
+
     /**
      * glGetIntegerv
-     * @param pname {@link #GL_MATRIX_MODE} to receive the current matrix mode 
+     * @param pname {@link #GL_MATRIX_MODE} to receive the current matrix mode
      * @param params the FloatBuffer's position remains unchanged
      *        which is the same behavior than the native JOGL GL impl
      */
@@ -89,7 +89,7 @@ public interface GLMatrixFunc {
      * </p>
      */
     public void glPushMatrix();
-    
+
     /**
      * Pop the current matrix from it's stack.
      * @see #glPushMatrix()
@@ -97,19 +97,19 @@ public interface GLMatrixFunc {
     public void glPopMatrix();
 
     /**
-     * Load the current matrix with the identity matrix 
+     * Load the current matrix with the identity matrix
      */
     public void glLoadIdentity() ;
 
     /**
-     * Load the current matrix w/ the provided one. 
+     * Load the current matrix w/ the provided one.
      * @param params the FloatBuffer's position remains unchanged,
      *        which is the same behavior than the native JOGL GL impl
      */
-    public void glLoadMatrixf(java.nio.FloatBuffer m) ;    
+    public void glLoadMatrixf(java.nio.FloatBuffer m) ;
     /**
      * Load the current matrix w/ the provided one.
-     */ 
+     */
     public void glLoadMatrixf(float[] m, int m_offset);
 
     /**
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
index 786835f4d..4aff24b36 100644
--- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
@@ -31,7 +31,7 @@ package javax.media.opengl.fixedfunc;
 
 import javax.media.opengl.*;
 
-public interface GLPointerFunc { 
+public interface GLPointerFunc {
   public static final int GL_VERTEX_ARRAY = 0x8074;
   public static final int GL_NORMAL_ARRAY = 0x8075;
   public static final int GL_COLOR_ARRAY = 0x8076;
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
index 79ec38e0c..9bd644223 100644
--- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
@@ -28,7 +28,7 @@
 
 package javax.media.opengl.fixedfunc;
 
-public class GLPointerFuncUtil { 
+public class GLPointerFuncUtil {
     public static final String mgl_Vertex = "mgl_Vertex";
     public static final String mgl_Normal = "mgl_Normal";
     public static final String mgl_Color = "mgl_Color";
@@ -37,16 +37,16 @@ public class GLPointerFuncUtil {
 
     /**
      * @param glArrayIndex the fixed function array index
-     * @return default fixed function array name 
+     * @return default fixed function array name
      */
     public static String getPredefinedArrayIndexName(int glArrayIndex) {
         return getPredefinedArrayIndexName(glArrayIndex, -1);
     }
-    
+
     /**
      * @param glArrayIndex the fixed function array index
-     * @param multiTexCoordIndex index for multiTexCoordIndex  
-     * @return default fixed function array name 
+     * @param multiTexCoordIndex index for multiTexCoordIndex
+     * @return default fixed function array name
      */
     public static String getPredefinedArrayIndexName(int glArrayIndex, int multiTexCoordIndex) {
         switch(glArrayIndex) {
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java
index 1f59b5805..515583b14 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java
@@ -30,20 +30,20 @@ package jogamp.graph.curve.opengl;
 import com.jogamp.graph.curve.Region;
 import com.jogamp.graph.curve.opengl.GLRegion;
 
-/** RegionFactory to create a Context specific Region implementation. 
- *  
+/** RegionFactory to create a Context specific Region implementation.
+ *
  * @see GLRegion
  */
 public class RegionFactory {
-    
+
     /**
      * Create a Region using the passed render mode
-     * 
+     *
      * <p> In case {@link Region#VBAA_RENDERING_BIT} is being requested the default texture unit
      * {@link Region#TWO_PASS_DEFAULT_TEXTURE_UNIT} is being used.</p>
-     * 
+     *
      * @param rs the RenderState to be used
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT} 
+     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
      */
     public static GLRegion create(int renderModes) {
         if( 0 != ( Region.VBAA_RENDERING_BIT & renderModes ) ){
@@ -53,18 +53,18 @@ public class RegionFactory {
             return new VBORegionSPES2(renderModes);
         }
     }
-        
+
     /** Create a Single Pass Region using the passed render mode
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, 
+     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
      * {@link Region#VBAA_RENDERING_BIT}
      * @return
      */
     public static GLRegion createSinglePass(int renderModes) {
         return new VBORegionSPES2(renderModes);
     }
-    
+
     /** Create a Two Pass (VBAA) Region using the passed render mode
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, 
+     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
      * {@link Region#VBAA_RENDERING_BIT}
      * @return
      */
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
index 7f5afcd02..22600cb89 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
@@ -43,12 +43,12 @@ import com.jogamp.opengl.util.glsl.ShaderState;
 public class RegionRendererImpl01 extends RegionRenderer {
     public RegionRendererImpl01(RenderState rs, int renderModes) {
         super(rs, renderModes);
-        
+
     }
-    
+
     protected boolean initShaderProgram(GL2ES2 gl) {
         final ShaderState st = rs.getShaderState();
-        
+
         final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RegionRendererImpl01.class, "shader",
                                                   "shader/bin", getVertexShaderName(), true);
         final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RegionRendererImpl01.class, "shader",
@@ -57,29 +57,29 @@ public class RegionRendererImpl01 extends RegionRenderer {
         // rsFp.defaultShaderCustomization(gl, true, true);
         int pos = rsFp.addGLSLVersion(gl);
         if( gl.isGLES2() ) {
-            pos = rsFp.insertShaderSource(0, pos, ShaderCode.extOESDerivativesEnable);            
+            pos = rsFp.insertShaderSource(0, pos, ShaderCode.extOESDerivativesEnable);
         }
         final String rsFpDefPrecision =  getFragmentShaderPrecision(gl);
         if( null != rsFpDefPrecision ) {
             rsFp.insertShaderSource(0, pos, rsFpDefPrecision);
         }
-        
+
         final ShaderProgram sp = new ShaderProgram();
         sp.add(rsVp);
         sp.add(rsFp);
 
-        if( !sp.init(gl) ) { 
+        if( !sp.init(gl) ) {
             throw new GLException("RegionRenderer: Couldn't init program: "+sp);
         }
-        st.attachShaderProgram(gl, sp, false);        
+        st.attachShaderProgram(gl, sp, false);
         st.bindAttribLocation(gl, AttributeNames.VERTEX_ATTR_IDX, AttributeNames.VERTEX_ATTR_NAME);
-        st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);        
-        
+        st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);
+
         if(!sp.link(gl, System.err)) {
             throw new GLException("RegionRenderer: Couldn't link program: "+sp);
-        }    
+        }
         st.useProgram(gl, true);
-    
+
         if(DEBUG) {
             System.err.println("RegionRendererImpl01 initialized: " + Thread.currentThread()+" "+st);
         }
@@ -94,5 +94,5 @@ public class RegionRendererImpl01 extends RegionRenderer {
     @Override
     protected void drawImpl(GL2ES2 gl, Region region, float[] position, int[] texSize) {
         ((GLRegion)region).draw(gl, rs, vp_width, vp_height, texSize);
-    }    
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
index 51356ca13..8ca29b9f0 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
@@ -38,9 +38,9 @@ import com.jogamp.graph.geom.Vertex;
 import com.jogamp.opengl.util.PMVMatrix;
 import com.jogamp.opengl.util.glsl.ShaderState;
 
-public class RenderStateImpl extends RenderState {    
+public class RenderStateImpl extends RenderState {
     /**
-     * weight is equivalent to the 
+     * weight is equivalent to the
      * global off-curve vertex weight.
      * TODO: change to per vertex
      */
@@ -50,7 +50,7 @@ public class RenderStateImpl extends RenderState {
 
     public RenderStateImpl(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix) {
         super(st, pointFactory, pmvMatrix);
-        
+
         gcu_Weight = new GLUniformData(UniformNames.gcu_Weight, 1.0f);
         st.ownUniform(gcu_PMVMatrix);
         gcu_Alpha = new GLUniformData(UniformNames.gcu_Alpha, 1.0f);
@@ -60,15 +60,15 @@ public class RenderStateImpl extends RenderState {
 //        gcu_Strength = new GLUniformData(UniformNames.gcu_Strength, 3.0f);
 //        st.ownUniform(gcu_Strength);
     }
-    
+
     public RenderStateImpl(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory) {
         this(st, pointFactory, new PMVMatrix());
     }
-    
+
     public final GLUniformData getWeight() { return gcu_Weight; }
     public final GLUniformData getAlpha() { return gcu_Alpha; }
     public final GLUniformData getColorStatic() { return gcu_ColorStatic; }
     //public final GLUniformData getStrength() { return gcu_Strength; }
-    
-    
+
+
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
index 81c421371..60758b90b 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
@@ -40,11 +40,11 @@ import com.jogamp.opengl.util.glsl.ShaderCode;
 import com.jogamp.opengl.util.glsl.ShaderProgram;
 import com.jogamp.opengl.util.glsl.ShaderState;
 
-public class TextRendererImpl01 extends TextRenderer {    
+public class TextRendererImpl01 extends TextRenderer {
     public TextRendererImpl01(RenderState rs, int type) {
-        super(rs, type);                     
+        super(rs, type);
     }
-    
+
     @Override
     protected boolean initShaderProgram(GL2ES2 gl){
         final ShaderState st = rs.getShaderState();
@@ -63,18 +63,18 @@ public class TextRendererImpl01 extends TextRenderer {
         if( null != rsFpDefPrecision ) {
             rsFp.insertShaderSource(0, pos, rsFpDefPrecision);
         }
-        
+
         final ShaderProgram sp = new ShaderProgram();
         sp.add(rsVp);
         sp.add(rsFp);
-        
-        if( !sp.init(gl) ) { 
+
+        if( !sp.init(gl) ) {
             throw new GLException("RegionRenderer: Couldn't init program: "+sp);
         }
-        st.attachShaderProgram(gl, sp, false);        
+        st.attachShaderProgram(gl, sp, false);
         st.bindAttribLocation(gl, AttributeNames.VERTEX_ATTR_IDX, AttributeNames.VERTEX_ATTR_NAME);
-        st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);        
-        
+        st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);
+
         if(!sp.link(gl, System.err)) {
             throw new GLException("TextRendererImpl01: Couldn't link program: "+sp);
         }
@@ -82,15 +82,15 @@ public class TextRendererImpl01 extends TextRenderer {
 
         if(DEBUG) {
             System.err.println("TextRendererImpl01 initialized: " + Thread.currentThread()+" "+st);
-        }        
+        }
         return true;
     }
-    
+
     @Override
     protected void destroyImpl(GL2ES2 gl) {
         super.destroyImpl(gl);
     }
-    
+
     @Override
     public void drawString3D(GL2ES2 gl, Font font, String str, float[] position, int fontSize, int[/*1*/] texSize) {
         if(!isInitialized()){
@@ -101,7 +101,7 @@ public class TextRendererImpl01 extends TextRenderer {
             glyphString = createString(gl, font, fontSize, str);
             addCachedGlyphString(gl, font, str, fontSize, glyphString);
         }
-        
+
         glyphString.renderString3D(gl, rs, vp_width, vp_height, texSize);
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
index 85d3ad5a7..86c0db8c6 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
@@ -30,7 +30,7 @@ package jogamp.graph.curve.opengl;
 import java.nio.FloatBuffer;
 
 import javax.media.opengl.GL2ES2;
-// FIXME: Subsume GL2GL3.GL_DRAW_FRAMEBUFFER -> GL2ES2.GL_DRAW_FRAMEBUFFER ! 
+// FIXME: Subsume GL2GL3.GL_DRAW_FRAMEBUFFER -> GL2ES2.GL_DRAW_FRAMEBUFFER !
 import javax.media.opengl.GL;
 import javax.media.opengl.GLUniformData;
 import javax.media.opengl.fixedfunc.GLMatrixFunc;
@@ -58,90 +58,90 @@ public class VBORegion2PES2  extends GLRegion {
     private GLArrayDataServer verticeFboAttr;
     private GLArrayDataServer texCoordFboAttr;
     private GLArrayDataServer indicesFbo;
-    
-    
+
+
     private FBObject fbo;
     private TextureAttachment texA;
     private PMVMatrix fboPMVMatrix;
     GLUniformData mgl_fboPMVMatrix;
-    
+
     private int tex_width_c = 0;
     private int tex_height_c = 0;
-    GLUniformData mgl_ActiveTexture; 
+    GLUniformData mgl_ActiveTexture;
     GLUniformData mgl_TextureSize; // if GLSL < 1.30
-    
+
     public VBORegion2PES2(int renderModes, int textureEngine) {
         super(renderModes);
         fboPMVMatrix = new PMVMatrix();
-        mgl_fboPMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, fboPMVMatrix.glGetPMvMatrixf());        
-        mgl_ActiveTexture = new GLUniformData(UniformNames.gcu_TextureUnit, textureEngine);    
+        mgl_fboPMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, fboPMVMatrix.glGetPMvMatrixf());
+        mgl_ActiveTexture = new GLUniformData(UniformNames.gcu_TextureUnit, textureEngine);
     }
-    
+
     public void update(GL2ES2 gl, RenderState rs) {
         if(!isDirty()) {
-            return; 
+            return;
         }
 
         if(null == indicesFbo) {
             final int initialElementCount = 256;
             final ShaderState st = rs.getShaderState();
-            
-            indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);                
+
+            indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
             indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3);
             indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
             indicesFbo.seal(true);
-            
-            texCoordFboAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT, 
+
+            texCoordFboAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
                                                            false, initialElementCount, GL.GL_STATIC_DRAW);
             st.ownAttribute(texCoordFboAttr, true);
-            texCoordFboAttr.putf(5); texCoordFboAttr.putf(5);        
-            texCoordFboAttr.putf(5); texCoordFboAttr.putf(6);        
-            texCoordFboAttr.putf(6); texCoordFboAttr.putf(6);        
-            texCoordFboAttr.putf(6); texCoordFboAttr.putf(5);        
+            texCoordFboAttr.putf(5); texCoordFboAttr.putf(5);
+            texCoordFboAttr.putf(5); texCoordFboAttr.putf(6);
+            texCoordFboAttr.putf(6); texCoordFboAttr.putf(6);
+            texCoordFboAttr.putf(6); texCoordFboAttr.putf(5);
             texCoordFboAttr.seal(true);
-            
-            verticeFboAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT, 
-                                                          false, initialElementCount, GL.GL_STATIC_DRAW); 
+
+            verticeFboAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+                                                          false, initialElementCount, GL.GL_STATIC_DRAW);
             st.ownAttribute(verticeFboAttr, true);
-            
-            
-            indicesTxt = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);                
-            
-            verticeTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT, 
+
+
+            indicesTxt = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+
+            verticeTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
                                                           false, initialElementCount, GL.GL_STATIC_DRAW);
             st.ownAttribute(verticeTxtAttr, true);
-            
-            texCoordTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT, 
+
+            texCoordTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
                                                            false, initialElementCount, GL.GL_STATIC_DRAW);
             st.ownAttribute(texCoordTxtAttr, true);
-            
+
             if(DEBUG_INSTANCE) {
                 System.err.println("VBORegion2PES2 Create: " + this);
-            }                    
+            }
         }
         // process triangles
         indicesTxt.seal(gl, false);
-        indicesTxt.rewind();        
+        indicesTxt.rewind();
         for(int i=0; i<triangles.size(); i++) {
             final Triangle t = triangles.get(i);
             final Vertex[] t_vertices = t.getVertices();
-            
+
             if(t_vertices[0].getId() == Integer.MAX_VALUE){
                 t_vertices[0].setId(numVertices++);
                 t_vertices[1].setId(numVertices++);
                 t_vertices[2].setId(numVertices++);
-                
+
                 vertices.add(t_vertices[0]);
                 vertices.add(t_vertices[1]);
                 vertices.add(t_vertices[2]);
-                
+
                 indicesTxt.puts((short) t_vertices[0].getId());
                 indicesTxt.puts((short) t_vertices[1].getId());
                 indicesTxt.puts((short) t_vertices[2].getId());
             } else {
                 indicesTxt.puts((short) t_vertices[0].getId());
                 indicesTxt.puts((short) t_vertices[1].getId());
-                indicesTxt.puts((short) t_vertices[2].getId());                
+                indicesTxt.puts((short) t_vertices[2].getId());
             }
         }
         indicesTxt.seal(gl, true);
@@ -157,43 +157,43 @@ public class VBORegion2PES2  extends GLRegion {
             final Vertex v = vertices.get(i);
             verticeTxtAttr.putf(v.getX());
             verticeTxtAttr.putf(v.getY());
-            verticeTxtAttr.putf(v.getZ());            
-            box.resize(v.getX(), v.getY(), v.getZ());            
-            
+            verticeTxtAttr.putf(v.getZ());
+            box.resize(v.getX(), v.getY(), v.getZ());
+
             final float[] tex = v.getTexCoord();
             texCoordTxtAttr.putf(tex[0]);
-            texCoordTxtAttr.putf(tex[1]);            
+            texCoordTxtAttr.putf(tex[1]);
         }
         texCoordTxtAttr.seal(gl, true);
         texCoordTxtAttr.enableBuffer(gl, false);
-        verticeTxtAttr.seal(gl, true);     
+        verticeTxtAttr.seal(gl, true);
         verticeTxtAttr.enableBuffer(gl, false);
-        
+
         // update all bbox related data
         verticeFboAttr.seal(gl, false);
-        verticeFboAttr.rewind();        
-        verticeFboAttr.putf(box.getLow()[0]);  verticeFboAttr.putf(box.getLow()[1]);  verticeFboAttr.putf(box.getLow()[2]);        
-        verticeFboAttr.putf(box.getLow()[0]);  verticeFboAttr.putf(box.getHigh()[1]); verticeFboAttr.putf(box.getLow()[2]);            
-        verticeFboAttr.putf(box.getHigh()[0]); verticeFboAttr.putf(box.getHigh()[1]); verticeFboAttr.putf(box.getLow()[2]);                
-        verticeFboAttr.putf(box.getHigh()[0]); verticeFboAttr.putf(box.getLow()[1]);  verticeFboAttr.putf(box.getLow()[2]);        
-        verticeFboAttr.seal(gl, true);     
+        verticeFboAttr.rewind();
+        verticeFboAttr.putf(box.getLow()[0]);  verticeFboAttr.putf(box.getLow()[1]);  verticeFboAttr.putf(box.getLow()[2]);
+        verticeFboAttr.putf(box.getLow()[0]);  verticeFboAttr.putf(box.getHigh()[1]); verticeFboAttr.putf(box.getLow()[2]);
+        verticeFboAttr.putf(box.getHigh()[0]); verticeFboAttr.putf(box.getHigh()[1]); verticeFboAttr.putf(box.getLow()[2]);
+        verticeFboAttr.putf(box.getHigh()[0]); verticeFboAttr.putf(box.getLow()[1]);  verticeFboAttr.putf(box.getLow()[2]);
+        verticeFboAttr.seal(gl, true);
         verticeFboAttr.enableBuffer(gl, false);
-        
+
         fboPMVMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         fboPMVMatrix.glLoadIdentity();
         fboPMVMatrix.glOrthof(box.getLow()[0], box.getHigh()[0], box.getLow()[1], box.getHigh()[1], -1, 1);
-        
+
         // push data 2 GPU ..
         indicesFbo.seal(gl, true);
         indicesFbo.enableBuffer(gl, false);
-        
+
         setDirty(false);
-        
+
         // the buffers were disabled, since due to real/fbo switching and other vbo usage
     }
-    
+
     int[] maxTexSize = new int[] { -1 } ;
-    
+
     protected void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
         if(vp_width <=0 || vp_height <= 0 || null==texWidth || texWidth[0] <= 0){
             renderRegion(gl);
@@ -205,54 +205,54 @@ public class VBORegion2PES2  extends GLRegion {
                 if(texWidth[0] > maxTexSize[0]) {
                     texWidth[0] = maxTexSize[0]; // clip to max - write-back user value!
                 }
-                renderRegion2FBO(gl, rs, texWidth); 
+                renderRegion2FBO(gl, rs, texWidth);
             }
             // System.out.println("Scale: " + matrix.glGetMatrixf().get(1+4*3) +" " + matrix.glGetMatrixf().get(2+4*3));
             renderFBO(gl, rs, vp_width, vp_height);
         }
     }
-    
+
     private void renderFBO(GL2ES2 gl, RenderState rs, int width, int hight) {
         final ShaderState st = rs.getShaderState();
-        
-        gl.glViewport(0, 0, width, hight);        
-        st.uniform(gl, mgl_ActiveTexture);    
+
+        gl.glViewport(0, 0, width, hight);
+        st.uniform(gl, mgl_ActiveTexture);
         gl.glActiveTexture(GL.GL_TEXTURE0 + mgl_ActiveTexture.intValue());
-        fbo.use(gl, texA);                        
-        verticeFboAttr.enableBuffer(gl, true);       
-        texCoordFboAttr.enableBuffer(gl, true);        
+        fbo.use(gl, texA);
+        verticeFboAttr.enableBuffer(gl, true);
+        texCoordFboAttr.enableBuffer(gl, true);
         indicesFbo.bindBuffer(gl, true); // keeps VBO binding
-        
+
         gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
-        
-        indicesFbo.bindBuffer(gl, false);        
+
+        indicesFbo.bindBuffer(gl, false);
         texCoordFboAttr.enableBuffer(gl, false);
-        verticeFboAttr.enableBuffer(gl, false);       
+        verticeFboAttr.enableBuffer(gl, false);
         fbo.unuse(gl);
-        
+
         // setback: gl.glActiveTexture(currentActiveTextureEngine[0]);
     }
-    
+
     private void renderRegion2FBO(GL2ES2 gl, RenderState rs, int[/*1*/] texWidth) {
         final ShaderState st = rs.getShaderState();
-        
+
         if(0>=texWidth[0]) {
             throw new IllegalArgumentException("texWidth must be greater than 0: "+texWidth[0]);
         }
-        
+
         tex_width_c  = texWidth[0];
         tex_height_c = (int) ( ( ( tex_width_c * box.getHeight() ) / box.getWidth() ) + 0.5f );
-        
+
         // System.out.println("FBO Size: "+texWidth[0]+" -> "+tex_width_c+"x"+tex_height_c);
         // System.out.println("FBO Scale: " + m.glGetMatrixf().get(0) +" " + m.glGetMatrixf().get(5));
-        
+
         if(null != fbo && fbo.getWidth() != tex_width_c && fbo.getHeight() != tex_height_c ) {
             fbo.reset(gl, tex_width_c, tex_height_c);
         }
-        
-        if(null == fbo) {  
+
+        if(null == fbo) {
             fbo = new FBObject();
-            fbo.reset(gl, tex_width_c, tex_height_c); 
+            fbo.reset(gl, tex_width_c, tex_height_c);
             // FIXME: shall not use bilinear, due to own AA ? However, w/o bilinear result is not smooth
             texA = fbo.attachTexture2D(gl, 0, true, GL2ES2.GL_LINEAR, GL2ES2.GL_LINEAR, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
             // texA = fbo.attachTexture2D(gl, 0, GL2ES2.GL_NEAREST, GL2ES2.GL_NEAREST, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
@@ -260,18 +260,18 @@ public class VBORegion2PES2  extends GLRegion {
         } else {
             fbo.bind(gl);
         }
-        
+
         //render texture
         gl.glViewport(0, 0, tex_width_c, tex_height_c);
         st.uniform(gl, mgl_fboPMVMatrix); // use orthogonal matrix
-        
+
         gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
         gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT | GL2ES2.GL_DEPTH_BUFFER_BIT);
         renderRegion(gl);
         fbo.unbind(gl);
-        
+
         st.uniform(gl, rs.getPMVMatrix()); // switch back to real PMV matrix
-        
+
         // if( !gl.isGL3() ) {
             // GLSL < 1.30
             if(null == mgl_TextureSize) {
@@ -281,21 +281,21 @@ public class VBORegion2PES2  extends GLRegion {
             texSize.put(0, (float)fbo.getWidth());
             texSize.put(1, (float)fbo.getHeight());
             st.uniform(gl, mgl_TextureSize);
-        //}                        
+        //}
     }
-    
+
     private void renderRegion(GL2ES2 gl) {
-        verticeTxtAttr.enableBuffer(gl, true);       
+        verticeTxtAttr.enableBuffer(gl, true);
         texCoordTxtAttr.enableBuffer(gl, true);
         indicesTxt.bindBuffer(gl, true); // keeps VBO binding
-        
+
         gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesTxt.getElementCount() * indicesTxt.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
-        
-        indicesTxt.bindBuffer(gl, false);        
+
+        indicesTxt.bindBuffer(gl, false);
         texCoordTxtAttr.enableBuffer(gl, false);
-        verticeTxtAttr.enableBuffer(gl, false);       
+        verticeTxtAttr.enableBuffer(gl, false);
     }
-    
+
     public void destroy(GL2ES2 gl, RenderState rs) {
         if(DEBUG_INSTANCE) {
             System.err.println("VBORegion2PES2 Destroy: " + this);
@@ -305,7 +305,7 @@ public class VBORegion2PES2  extends GLRegion {
             fbo.destroy(gl);
             fbo = null;
             texA = null;
-        }        
+        }
         if(null != verticeTxtAttr) {
             st.ownAttribute(verticeTxtAttr, false);
             verticeTxtAttr.destroy(gl);
@@ -335,6 +335,6 @@ public class VBORegion2PES2  extends GLRegion {
             indicesFbo = null;
         }
         triangles.clear();
-        vertices.clear();        
-    }       
+        vertices.clear();
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 0cba444ad..0a867b45c 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -44,13 +44,13 @@ public class VBORegionSPES2 extends GLRegion {
     private GLArrayDataServer texCoordAttr = null;
     private GLArrayDataServer indices = null;
 
-    protected VBORegionSPES2(int renderModes) { 
+    protected VBORegionSPES2(int renderModes) {
         super(renderModes);
     }
 
     protected void update(GL2ES2 gl, RenderState rs) {
         if(!isDirty()) {
-            return; 
+            return;
         }
 
         if(null == indices) {
@@ -59,11 +59,11 @@ public class VBORegionSPES2 extends GLRegion {
 
             indices = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
 
-            verticeAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT, 
-                    false, initialElementCount, GL.GL_STATIC_DRAW);         
+            verticeAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+                    false, initialElementCount, GL.GL_STATIC_DRAW);
             st.ownAttribute(verticeAttr, true);
 
-            texCoordAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT, 
+            texCoordAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
                     false, initialElementCount, GL.GL_STATIC_DRAW);
             st.ownAttribute(texCoordAttr, true);
 
@@ -74,7 +74,7 @@ public class VBORegionSPES2 extends GLRegion {
 
         // process triangles
         indices.seal(gl, false);
-        indices.rewind();        
+        indices.rewind();
         for(int i=0; i<triangles.size(); i++) {
             final Triangle t = triangles.get(i);
             final Vertex[] t_vertices = t.getVertices();
@@ -102,7 +102,7 @@ public class VBORegionSPES2 extends GLRegion {
 
         // process vertices and update bbox
         box.reset();
-        verticeAttr.seal(gl, false); 
+        verticeAttr.seal(gl, false);
         verticeAttr.rewind();
         texCoordAttr.seal(gl, false);
         texCoordAttr.rewind();
@@ -110,14 +110,14 @@ public class VBORegionSPES2 extends GLRegion {
             final Vertex v = vertices.get(i);
             verticeAttr.putf(v.getX());
             verticeAttr.putf(v.getY());
-            verticeAttr.putf(v.getZ());            
+            verticeAttr.putf(v.getZ());
             box.resize(v.getX(), v.getY(), v.getZ());
 
             final float[] tex = v.getTexCoord();
             texCoordAttr.putf(tex[0]);
             texCoordAttr.putf(tex[1]);
         }
-        verticeAttr.seal(gl, true);        
+        verticeAttr.seal(gl, true);
         verticeAttr.enableBuffer(gl, false);
         texCoordAttr.seal(gl, true);
         texCoordAttr.enableBuffer(gl, false);
@@ -126,21 +126,21 @@ public class VBORegionSPES2 extends GLRegion {
     }
 
     protected void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
-        verticeAttr.enableBuffer(gl, true);       
-        texCoordAttr.enableBuffer(gl, true);        
+        verticeAttr.enableBuffer(gl, true);
+        texCoordAttr.enableBuffer(gl, true);
         indices.bindBuffer(gl, true); // keeps VBO binding
-        
+
         gl.glDrawElements(GL2ES2.GL_TRIANGLES, indices.getElementCount() * indices.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
-        
+
         indices.bindBuffer(gl, false);
         texCoordAttr.enableBuffer(gl, false);
-        verticeAttr.enableBuffer(gl, false);       
-    }    
+        verticeAttr.enableBuffer(gl, false);
+    }
 
     public final void destroy(GL2ES2 gl, RenderState rs) {
         if(DEBUG_INSTANCE) {
             System.err.println("VBORegionSPES2 Destroy: " + this);
-        }        
+        }
         final ShaderState st = rs.getShaderState();
         if(null != verticeAttr) {
             st.ownAttribute(verticeAttr, false);
@@ -156,5 +156,5 @@ public class VBORegionSPES2 extends GLRegion {
             indices.destroy(gl);
             indices = null;
         }
-    }    
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/AttributeNames.java b/src/jogl/classes/jogamp/graph/curve/opengl/shader/AttributeNames.java
index 8a109c34a..b46661778 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/AttributeNames.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/AttributeNames.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -37,9 +37,9 @@ public class AttributeNames {
      */
     public static final int TEXCOORD_ATTR_IDX = 1;
     public static final String TEXCOORD_ATTR_NAME = "gca_TexCoords";
-    
+
     /** The color index in an OGL object
      */
     public static final int COLOR_ATTR_IDX = 2;
-    public static final String COLOR_ATTR_NAME = "gca_Colors";    
+    public static final String COLOR_ATTR_NAME = "gca_Colors";
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/UniformNames.java b/src/jogl/classes/jogamp/graph/curve/opengl/shader/UniformNames.java
index ab6e0dc6e..ce23aadac 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/UniformNames.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/UniformNames.java
@@ -3,7 +3,7 @@ package jogamp.graph.curve.opengl.shader;
 public class UniformNames {
     public static final String gcu_PMVMatrix = "gcu_PMVMatrix"; // gcu_PMVMatrix[3]; // P, Mv, and Mvi
     public static final String gcu_ColorStatic = "gcu_ColorStatic";
-    public static final String gcu_Alpha = "gcu_Alpha"; 
+    public static final String gcu_Alpha = "gcu_Alpha";
     public static final String gcu_Weight = "gcu_Weight";
     public static final String gcu_TextureUnit = "gcu_TextureUnit";
     public static final String gcu_TextureSize = "gcu_TextureSize";
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
index e96c559a2..4f48b2d20 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
@@ -39,29 +39,29 @@ import com.jogamp.opengl.math.VectorUtil;
 
 import jogamp.opengl.Debug;
 
-/** Constrained Delaunay Triangulation 
+/** Constrained Delaunay Triangulation
  * implementation of a list of Outlines that define a set of
  * Closed Regions with optional n holes.
- * 
+ *
  */
 public class CDTriangulator2D implements Triangulator{
 
     protected static final boolean DEBUG = Debug.debug("Triangulation");
-    
+
     private float sharpness = 0.5f;
     private ArrayList<Loop> loops;
     private ArrayList<Vertex> vertices;
-    
+
     private ArrayList<Triangle> triangles;
     private int maxTriID = 0;
 
-    
+
     /** Constructor for a new Delaunay triangulator
      */
     public CDTriangulator2D() {
         reset();
     }
-    
+
     /** Reset the triangulation to initial state
      *  Clearing cached data
      */
@@ -71,14 +71,14 @@ public class CDTriangulator2D implements Triangulator{
         triangles = new ArrayList<Triangle>(3);
         loops = new ArrayList<Loop>();
     }
-    
+
     public void addCurve(Outline polyline) {
         Loop loop = null;
-        
+
         if(!loops.isEmpty()) {
             loop = getContainerLoop(polyline);
         }
-        
+
         if(loop == null) {
             GraphOutline outline = new GraphOutline(polyline);
             GraphOutline innerPoly = extractBoundaryTriangles(outline, false);
@@ -92,8 +92,8 @@ public class CDTriangulator2D implements Triangulator{
             loop.addConstraintCurve(innerPoly);
         }
     }
-    
-    public ArrayList<Triangle> generate() {    
+
+    public ArrayList<Triangle> generate() {
         for(int i=0;i<loops.size();i++) {
             Loop loop = loops.get(i);
             int numTries = 0;
@@ -140,16 +140,16 @@ public class CDTriangulator2D implements Triangulator{
             GraphVertex gv0 = outVertices.get((i+size-1)%size);
             GraphVertex gv2 = outVertices.get((i+1)%size);
             GraphVertex gv1 = currentVertex;
-            
+
             if(!currentVertex.getPoint().isOnCurve()) {
                 Vertex v0 = gv0.getPoint().clone();
                 Vertex v2 = gv2.getPoint().clone();
                 Vertex v1 = gv1.getPoint().clone();
-                
+
                 gv0.setBoundaryContained(true);
                 gv1.setBoundaryContained(true);
                 gv2.setBoundaryContained(true);
-                
+
                 final Triangle t;
                 final boolean holeLike;
                 if(VectorUtil.ccw(v0,v1,v2)) {
@@ -184,7 +184,7 @@ public class CDTriangulator2D implements Triangulator{
         }
         return innerOutline;
     }
-    
+
     private Loop getContainerLoop(Outline polyline) {
         ArrayList<Vertex> vertices = polyline.getVertices();
         for(int i=0; i < loops.size(); i++) {
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
index c8251af15..2e8d4f58f 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
@@ -35,13 +35,13 @@ import com.jogamp.graph.geom.Vertex;
 public class GraphOutline {
     final private Outline outline;
     final private ArrayList<GraphVertex> controlpoints = new ArrayList<GraphVertex>(3);
-    
+
     public GraphOutline(){
         this.outline = new Outline();
     }
-    
+
     /**Create a control polyline of control vertices
-     * the curve pieces can be identified by onCurve flag 
+     * the curve pieces can be identified by onCurve flag
      * of each cp the control polyline is open by default
      */
     public GraphOutline(Outline ol){
@@ -59,7 +59,7 @@ public class GraphOutline {
     public ArrayList<GraphVertex> getGraphPoint() {
         return controlpoints;
     }
-    
+
     public ArrayList<Vertex> getVertices() {
         return outline.getVertices();
     }
@@ -68,5 +68,5 @@ public class GraphOutline {
         controlpoints.add(v);
         outline.addVertex(v.getPoint());
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
index 52d02baa5..1ef1d8c7f 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
@@ -35,7 +35,7 @@ public class GraphVertex {
     private Vertex point;
     private ArrayList<HEdge> edges = null;
     private boolean boundaryContained = false;
-    
+
     public GraphVertex(Vertex point) {
         this.point = point;
     }
@@ -43,15 +43,15 @@ public class GraphVertex {
     public Vertex getPoint() {
         return point;
     }
-    
+
     public float getX(){
         return point.getX();
     }
-    
+
     public float getY(){
         return point.getY();
     }
-    
+
     public float getZ(){
         return point.getZ();
     }
@@ -70,7 +70,7 @@ public class GraphVertex {
     public void setEdges(ArrayList<HEdge> edges) {
         this.edges = edges;
     }
-    
+
     public void addEdge(HEdge edge){
         if(edges == null){
             edges = new ArrayList<HEdge>();
@@ -112,7 +112,7 @@ public class GraphVertex {
         }
         return null;
     }
-    
+
     public boolean isBoundaryContained() {
         return boundaryContained;
     }
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
index 4d29a81f3..acaa3d708 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
@@ -35,14 +35,14 @@ public class HEdge {
     public static int BOUNDARY = 3;
     public static int INNER = 1;
     public static int HOLE = 2;
-    
+
     private GraphVertex vert;
     private HEdge prev = null;
     private HEdge next = null;
     private HEdge sibling = null;
     private int type = BOUNDARY;
     private Triangle triangle = null;
-    
+
     public HEdge(GraphVertex vert, int type) {
         this.vert = vert;
         this.type = type;
@@ -112,19 +112,19 @@ public class HEdge {
     public void setTriangle(Triangle triangle) {
         this.triangle = triangle;
     }
-    
+
     public static <T extends Vertex> void connect(HEdge first, HEdge next){
         first.setNext(next);
         next.setPrev(first);
     }
-    
+
     public static <T extends Vertex> void makeSiblings(HEdge first, HEdge second){
         first.setSibling(second);
         second.setSibling(first);
     }
-    
+
     public boolean vertexOnCurveVertex(){
         return vert.getPoint().isOnCurve();
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
index 651179062..c1dafc0d1 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
@@ -51,7 +51,7 @@ public class Loop {
 
     public Triangle cut(boolean delaunay){
         if(isSimplex()){
-            Triangle t = new Triangle(root.getGraphPoint().getPoint(), root.getNext().getGraphPoint().getPoint(), 
+            Triangle t = new Triangle(root.getGraphPoint().getPoint(), root.getNext().getGraphPoint().getPoint(),
                     root.getNext().getNext().getGraphPoint().getPoint());
             t.setVerticesBoundary(checkVerticesBoundary(root));
             return t;
@@ -103,20 +103,20 @@ public class Loop {
             throw new IllegalArgumentException("outline's vertices < 3: " + vertices.size());
         }
         final VectorUtil.Winding hasWinding = VectorUtil.getWinding(
-                                 vertices.get(0).getPoint(), 
+                                 vertices.get(0).getPoint(),
                                  vertices.get(1).getPoint(),
                                  vertices.get(2).getPoint());
         //FIXME: handle case when vertices come inverted - Rami
         // skips inversion CW -> CCW
         final boolean invert =  hasWinding != reqWinding &&
                                 reqWinding == VectorUtil.Winding.CW;
-       
+
         final int max;
         final int edgeType = reqWinding == VectorUtil.Winding.CCW ? HEdge.BOUNDARY : HEdge.HOLE ;
         int index;
         HEdge firstEdge = null;
         HEdge lastEdge = null;
-        
+
         if(!invert) {
             max = vertices.size();
             index = 0;
@@ -160,7 +160,7 @@ public class Loop {
     public void addConstraintCurve(GraphOutline polyline) {
         //        GraphOutline outline = new GraphOutline(polyline);
         /**needed to generate vertex references.*/
-        initFromPolyline(polyline, VectorUtil.Winding.CW); 
+        initFromPolyline(polyline, VectorUtil.Winding.CW);
 
         GraphVertex v3 = locateClosestVertex(polyline);
         HEdge v3Edge = v3.findBoundEdge();
@@ -180,9 +180,9 @@ public class Loop {
         HEdge.connect(crossEdgeSib, root);
     }
 
-    /** Locates the vertex and update the loops root 
-     * to have (root + vertex) as closest pair 
-     * @param polyline the control polyline 
+    /** Locates the vertex and update the loops root
+     * to have (root + vertex) as closest pair
+     * @param polyline the control polyline
      * to search for closestvertices
      * @return the vertex that is closest to the newly set root Hedge.
      */
@@ -205,7 +205,7 @@ public class Loop {
                     for (GraphVertex vert:vertices){
                         if(vert == v || vert == nextV || vert == cand)
                             continue;
-                        inValid = VectorUtil.inCircle(v.getPoint(), nextV.getPoint(), 
+                        inValid = VectorUtil.inCircle(v.getPoint(), nextV.getPoint(),
                                 cand.getPoint(), vert.getPoint());
                         if(inValid){
                             break;
@@ -243,8 +243,8 @@ public class Loop {
             Vertex cand = candEdge.getGraphPoint().getPoint();
             HEdge e = candEdge.getNext();
             while (e != candEdge){
-                if(e.getGraphPoint() == root.getGraphPoint() 
-                        || e.getGraphPoint() == next.getGraphPoint() 
+                if(e.getGraphPoint() == root.getGraphPoint()
+                        || e.getGraphPoint() == next.getGraphPoint()
                         || e.getGraphPoint().getPoint() == cand){
                     e = e.getNext();
                     continue;
@@ -311,15 +311,15 @@ public class Loop {
                   (v.getX() < (v2.getX() - v1.getX()) * (v.getY() - v1.getY()) / (v2.getY() - v1.getY()) + v1.getX()) ){
                 inside = !inside;
             }
-            
+
             current = next;
             next = current.getNext();
-            
+
         } while(current != root);
-        
+
         return inside;
     }
-    
+
     public int computeLoopSize(){
         int size = 0;
         HEdge e = root;
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
index 751a7e7ac..ff46c3338 100644
--- a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
+++ b/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
@@ -37,17 +37,17 @@ import com.jogamp.graph.curve.OutlineShape;
 import com.jogamp.opengl.math.Quaternion;
 
 public class GlyphShape {
-    
+
     private Quaternion quat= null;
     private OutlineShape shape = null;
-    
+
     /** Create a new Glyph shape
      * based on Parametric curve control polyline
      */
     public GlyphShape(Vertex.Factory<? extends Vertex> factory){
         shape = new OutlineShape(factory);
     }
-    
+
     /** Create a new GlyphShape from a {@link OutlineShape}
      * @param factory vertex impl factory {@link Factory}
      * @param shape {@link OutlineShape} representation of the Glyph
@@ -57,24 +57,24 @@ public class GlyphShape {
         this.shape = shape;
         this.shape.transformOutlines(OutlineShape.VerticesState.QUADRATIC_NURBS);
     }
-    
+
     public final Vertex.Factory<? extends Vertex> vertexFactory() { return shape.vertexFactory(); }
-    
+
     public OutlineShape getShape() {
         return shape;
     }
-    
+
     public int getNumVertices() {
         return shape.getVertices().size();
     }
-    
+
     /** Get the rotational Quaternion attached to this Shape
      * @return the Quaternion Object
      */
     public Quaternion getQuat() {
         return quat;
     }
-    
+
     /** Set the Quaternion that shall defien the rotation
      * of this shape.
      * @param quat
@@ -82,7 +82,7 @@ public class GlyphShape {
     public void setQuat(Quaternion quat) {
         this.quat = quat;
     }
-    
+
     /** Triangluate the glyph shape
      * @return ArrayList of triangles which define this shape
      */
@@ -95,5 +95,5 @@ public class GlyphShape {
      */
     public ArrayList<Vertex> getVertices(){
         return shape.getVertices();
-    }    
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
index cc850b823..2284ab669 100644
--- a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
+++ b/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
@@ -52,51 +52,51 @@ public class GlyphString {
      * <p>The actual font size shall be accomplished by the GL PMV matrix.</p>
      */
     public static final int STATIC_FONT_SIZE = 10;
-    
+
     private ArrayList<GlyphShape> glyphs = new ArrayList<GlyphShape>();
     private CharSequence str;
     private String fontname;
     private GLRegion region;
-    
+
     private SVertex origin = new SVertex();
 
     /**
      * <p>Uses {@link #STATIC_FONT_SIZE}.</p>
      * <p>No caching is performed.</p>
-     * 
+     *
      * @param shape is not null, add all {@link GlyphShape}'s {@link Outline} to this instance.
      * @param vertexFactory vertex impl factory {@link Factory}
-     * @param font the target {@link Font} 
+     * @param font the target {@link Font}
      * @param str string text
      * @return the created {@link GlyphString} instance
      */
     public static GlyphString createString(OutlineShape shape, Factory<? extends Vertex> vertexFactory, Font font, String str) {
-        return createString(shape, vertexFactory, font, STATIC_FONT_SIZE, str); 
+        return createString(shape, vertexFactory, font, STATIC_FONT_SIZE, str);
     }
-    
+
     /**
      * <p>No caching is performed.</p>
-     * 
+     *
      * @param shape is not null, add all {@link GlyphShape}'s {@link Outline} to this instance.
      * @param vertexFactory vertex impl factory {@link Factory}
-     * @param font the target {@link Font} 
+     * @param font the target {@link Font}
      * @param fontSize font size
      * @param str string text
      * @return the created {@link GlyphString} instance
      */
     public static GlyphString createString(OutlineShape shape, Factory<? extends Vertex> vertexFactory, Font font, int fontSize, String str) {
     	ArrayList<OutlineShape> shapes = ((FontInt)font).getOutlineShapes(str, fontSize, vertexFactory);
-        
+
         GlyphString glyphString = new GlyphString(font.getName(Font.NAME_UNIQUNAME), str);
         glyphString.createfromOutlineShapes(vertexFactory, shapes);
         if(null != shape) {
             for(int i=0; i<glyphString.glyphs.size(); i++) {
                 shape.addOutlineShape(glyphString.glyphs.get(i).getShape());
-            }    
+            }
         }
         return glyphString;
     }
-    
+
     /** Create a new GlyphString object
      * @param fontname the name of the font that this String is
      * associated with
@@ -106,18 +106,18 @@ public class GlyphString {
         this.fontname = fontname;
         this.str = str;
     }
-    
+
     public void addGlyphShape(GlyphShape glyph){
         glyphs.add(glyph);
     }
-    
+
     public CharSequence getString(){
         return str;
     }
 
-    /**Creates the Curve based Glyphs from a list of {@link OutlineShape} 
+    /**Creates the Curve based Glyphs from a list of {@link OutlineShape}
      * @param vertexFactory vertex impl factory {@link Factory}
-     * @param shapes list of {@link OutlineShape} 
+     * @param shapes list of {@link OutlineShape}
      */
     public void createfromOutlineShapes(Factory<? extends Vertex> vertexFactory, ArrayList<OutlineShape> shapes) {
         final int numGlyps = shapes.size();
@@ -126,31 +126,31 @@ public class GlyphString {
                 continue;
             }
             GlyphShape glyphShape = new GlyphShape(vertexFactory, shapes.get(index));
-            
+
             if(glyphShape.getNumVertices() < 3) {
                 continue;
-            }            
+            }
             addGlyphShape(glyphShape);
         }
     }
-    
-    
+
+
     /** Generate a OGL Region to represent this Object.
      * @param gl the current gl object
      * @param rs the current attached RenderState
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT} 
+     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
      */
     public GLRegion createRegion(GL2ES2 gl, int renderModes){
         region = RegionFactory.create(renderModes);
         // region.setFlipped(true);
-        
+
         int numVertices = region.getNumVertices();
-        
+
         for(int i=0; i< glyphs.size(); i++) {
             final GlyphShape glyph = glyphs.get(i);
             ArrayList<Triangle> gtris = glyph.triangulate();
             region.addTriangles(gtris);
-            
+
             final ArrayList<Vertex> gVertices = glyph.getVertices();
             for(int j=0; j<gVertices.size(); j++) {
                 final Vertex gVert = gVertices.get(j);
@@ -160,8 +160,8 @@ public class GlyphString {
         }
         return region;
     }
-    
-    /** Generate a Hashcode for this object 
+
+    /** Generate a Hashcode for this object
      * @return a string defining the hashcode
      */
     public String getTextHashCode(){
@@ -180,15 +180,15 @@ public class GlyphString {
      * @param rs the RenderState to be used
      * @param vp_width current screen width
      * @param vp_height current screen height
-     * @param texWidth desired texture width for multipass-rendering. 
+     * @param texWidth desired texture width for multipass-rendering.
      *        The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
      */
     public void renderString3D(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
         region.draw(gl, rs, vp_width, vp_height, texWidth);
     }
-    
+
     /** Get the Origin of this GlyphString
-     * @return 
+     * @return
      */
     public Vertex getOrigin() {
         return origin;
@@ -206,7 +206,7 @@ public class GlyphString {
         }
         glyphs.clear();
     }
-    
+
     public AABBox getBounds(){
         return region.getBounds();
     }
diff --git a/src/jogl/classes/jogamp/graph/font/FontInt.java b/src/jogl/classes/jogamp/graph/font/FontInt.java
index 20e1ec028..4366724ad 100644
--- a/src/jogl/classes/jogamp/graph/font/FontInt.java
+++ b/src/jogl/classes/jogamp/graph/font/FontInt.java
@@ -40,7 +40,7 @@ public interface FontInt extends Font {
 
     public interface GlyphInt extends Font.Glyph {
         public Path2D getPath();  // unscaled path
-        public Path2D getPath(float pixelSize);         
+        public Path2D getPath(float pixelSize);
     }
 
     public ArrayList<OutlineShape> getOutlineShapes(CharSequence string, float pixelSize, Factory<? extends Vertex> vertexFactory);
diff --git a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
index 3736c5f13..5978e937d 100644
--- a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
@@ -40,16 +40,16 @@ import com.jogamp.graph.font.FontSet;
 import com.jogamp.graph.font.FontFactory;
 
 public class JavaFontLoader implements FontSet {
-    
-    // FIXME: Add cache size to limit memory usage 
+
+    // FIXME: Add cache size to limit memory usage
     private static final IntObjectHashMap fontMap = new IntObjectHashMap();
-    
+
     private static final FontSet fontLoader = new JavaFontLoader();
 
     public static FontSet get() {
         return fontLoader;
     }
-    
+
     final static String availableFontFileNames[] =
     {
         /* 00 */ "LucidaBrightRegular.ttf",
@@ -61,9 +61,9 @@ public class JavaFontLoader implements FontSet {
         /* 06 */ "LucidaTypewriterRegular.ttf",
         /* 07 */ "LucidaTypewriterBold.ttf",
     };
-        
+
     final String javaFontPath;
-    
+
     private JavaFontLoader() {
         final String javaHome = AccessController.doPrivileged(new PrivilegedAction<String>() {
             public String run() {
@@ -80,11 +80,11 @@ public class JavaFontLoader implements FontSet {
     static boolean is(int bits, int bit) {
         return 0 != ( bits & bit ) ;
     }
-    
+
     public Font getDefault() throws IOException {
-        return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular 
+        return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular
     }
-    
+
     public Font get(int family, int style) throws IOException {
         Font font = (Font)fontMap.get( ( family << 8 ) | style );
         if (font != null) {
@@ -92,8 +92,8 @@ public class JavaFontLoader implements FontSet {
         }
 
         // 1st process Sans Serif (2 fonts)
-        if( is(style, STYLE_SERIF) ) {                
-            if( is(style, STYLE_BOLD) ) {                
+        if( is(style, STYLE_SERIF) ) {
+            if( is(style, STYLE_BOLD) ) {
                 font = abspath(availableFontFileNames[5], family, style);
             } else {
                 font = abspath(availableFontFileNames[4], family, style);
@@ -103,53 +103,53 @@ public class JavaFontLoader implements FontSet {
             }
             return font;
         }
-        
+
         // Serif Fonts ..
         switch (family) {
             case FAMILY_LIGHT:
             case FAMILY_MEDIUM:
             case FAMILY_CONDENSED:
             case FAMILY_REGULAR:
-                if( is(style, STYLE_BOLD) ) {                
-                    if( is(style, STYLE_ITALIC) ) {                
+                if( is(style, STYLE_BOLD) ) {
+                    if( is(style, STYLE_ITALIC) ) {
                         font = abspath(availableFontFileNames[3], family, style);
                     } else {
                         font = abspath(availableFontFileNames[2], family, style);
                     }
-                } else if( is(style, STYLE_ITALIC) ) {                
+                } else if( is(style, STYLE_ITALIC) ) {
                     font = abspath(availableFontFileNames[1], family, style);
                 } else {
                     font = abspath(availableFontFileNames[0], family, style);
                 }
                 break;
-                
+
             case FAMILY_MONOSPACED:
-                if( is(style, STYLE_BOLD) ) {                
+                if( is(style, STYLE_BOLD) ) {
                     font = abspath(availableFontFileNames[7], family, style);
                 } else {
                     font = abspath(availableFontFileNames[6], family, style);
                 }
-                break;                
+                break;
         }
 
         return font;
     }
-    
+
     Font abspath(String fname, int family, int style) throws IOException {
         if(null == javaFontPath) {
             throw new GLException("java font path undefined");
         }
         final String err = "Problem loading font "+fname+", file "+javaFontPath+fname ;
-                
+
         try {
             final Font f = FontFactory.get( new File(javaFontPath+fname) );
             if(null != f) {
                 fontMap.put( ( family << 8 ) | style, f );
                 return f;
             }
-            throw new IOException (err);            
+            throw new IOException (err);
         } catch (IOException ioe) {
-            throw new IOException(err, ioe);            
+            throw new IOException(err, ioe);
         }
-    }    
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
index c4c580290..254583739 100644
--- a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
@@ -39,23 +39,23 @@ import com.jogamp.graph.font.FontFactory;
 import java.net.URLConnection;
 
 public class UbuntuFontLoader implements FontSet {
-    
-    // FIXME: Add cache size to limit memory usage 
+
+    // FIXME: Add cache size to limit memory usage
     private static final IntObjectHashMap fontMap = new IntObjectHashMap();
-        
-    private static final String relPath = "fonts/ubuntu/" ;    
-    
+
+    private static final String relPath = "fonts/ubuntu/" ;
+
     private static final FontSet fontLoader = new UbuntuFontLoader();
 
     public static final FontSet get() {
         return fontLoader;
     }
-    
+
     final static String availableFontFileNames[] =
     {
         /* 00 */ "Ubuntu-R.ttf",   // regular
         /* 01 */ "Ubuntu-RI.ttf",  // regular italic
-        /* 02 */ "Ubuntu-B.ttf",   // bold     
+        /* 02 */ "Ubuntu-B.ttf",   // bold
         /* 03 */ "Ubuntu-BI.ttf",  // bold italic
         /* 04 */ "Ubuntu-L.ttf",   // light
         /* 05 */ "Ubuntu-LI.ttf",  // light italic
@@ -63,18 +63,18 @@ public class UbuntuFontLoader implements FontSet {
         /* 07 */ "Ubuntu-MI.ttf",  // medium italic
 
     };
-        
+
     private UbuntuFontLoader() {
     }
 
     static boolean is(int bits, int bit) {
         return 0 != ( bits & bit ) ;
     }
-    
+
     public Font getDefault() throws IOException {
-        return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular 
+        return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular
     }
-    
+
     public Font get(int family, int style) throws IOException {
         Font font = (Font)fontMap.get( ( family << 8 ) | style );
         if (font != null) {
@@ -97,7 +97,7 @@ public class UbuntuFontLoader implements FontSet {
                     font = abspath(availableFontFileNames[0], family, style);
                 }
                 break;
-                
+
             case FAMILY_LIGHT:
                 if( is(style, STYLE_ITALIC) ) {
                     font = abspath(availableFontFileNames[5], family, style);
@@ -105,19 +105,19 @@ public class UbuntuFontLoader implements FontSet {
                     font = abspath(availableFontFileNames[4], family, style);
                 }
                 break;
-                
+
             case FAMILY_MEDIUM:
                 if( is(style, STYLE_ITALIC) ) {
                     font = abspath(availableFontFileNames[6], family, style);
                 } else {
                     font = abspath(availableFontFileNames[7], family, style);
                 }
-                break;                
+                break;
         }
 
         return font;
     }
-        
+
     Font abspath(String fname, int family, int style) throws IOException {
         final String err = "Problem loading font "+fname+", stream "+relPath+fname;
         try {
@@ -129,10 +129,10 @@ public class UbuntuFontLoader implements FontSet {
             if(null != f) {
                 fontMap.put( ( family << 8 ) | style, f );
                 return f;
-            }        
+            }
             throw new IOException(err);
         } catch(IOException ioe) {
-            throw new IOException(err, ioe);            
+            throw new IOException(err, ioe);
         }
-    }           
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index 0441bf836..ba6c72650 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -51,20 +51,20 @@ import com.jogamp.opengl.math.geom.AABBox;
 
 class TypecastFont implements FontInt {
     static final boolean DEBUG = false;
-    
+
     final OTFontCollection fontset;
     final OTFont font;
     TypecastHMetrics metrics;
     final CmapFormat cmapFormat;
     int cmapentries;
-    
-    // FIXME: Add cache size to limit memory usage ??    
-    IntObjectHashMap char2Glyph; 
+
+    // FIXME: Add cache size to limit memory usage ??
+    IntObjectHashMap char2Glyph;
 
     public TypecastFont(OTFontCollection fontset) {
         this.fontset = fontset;
         this.font = fontset.getFont(0);
-        
+
         // FIXME: Generic attempt to find the best CmapTable,
         // which is assumed to be the one with the most entries (stupid 'eh?)
         CmapTable cmapTable = font.getCmapTable();
@@ -77,14 +77,14 @@ class TypecastFont implements FontInt {
             int pidx = cmapIdxEntry.getPlatformId();
             CmapFormat cf = cmapIdxEntry.getFormat();
             if(DEBUG) {
-                System.err.println("CmapFormat["+i+"]: platform " + pidx + 
+                System.err.println("CmapFormat["+i+"]: platform " + pidx +
                                    ", encoding "+cmapIdxEntry.getEncodingId() + ": "+cf);
             }
-            if( _cmapFormatP[pidx] == null || 
+            if( _cmapFormatP[pidx] == null ||
                 _cmapFormatP[pidx].getLength() < cf.getLength() ) {
                 _cmapFormatP[pidx] = cf;
                 if( cf.getLength() > platformLength ) {
-                    platformLength = cf.getLength() ; 
+                    platformLength = cf.getLength() ;
                     platform = pidx;
                     encoding = cmapIdxEntry.getEncodingId();
                 }
@@ -93,10 +93,10 @@ class TypecastFont implements FontInt {
         if(0 <= platform) {
             cmapFormat = _cmapFormatP[platform];
             if(DEBUG) {
-                System.err.println("Selected CmapFormat: platform " + platform + 
+                System.err.println("Selected CmapFormat: platform " + platform +
                                    ", encoding "+encoding + ": "+cmapFormat);
             }
-        } else {        
+        } else {
             CmapFormat _cmapFormat = null;
             /*if(null == _cmapFormat) {
                 platform = ID.platformMacintosh;
@@ -127,14 +127,14 @@ class TypecastFont implements FontInt {
         cmapentries = 0;
         for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
             CmapFormat.Range range = cmapFormat.getRange(i);
-            cmapentries += range.getEndCode() - range.getStartCode() + 1; // end included 
-        }        
+            cmapentries += range.getEndCode() - range.getStartCode() + 1; // end included
+        }
         if(DEBUG) {
             System.err.println("font direction hint: "+font.getHeadTable().getFontDirectionHint());
             System.err.println("num glyphs: "+font.getNumGlyphs());
             System.err.println("num cmap entries: "+cmapentries);
             System.err.println("num cmap ranges: "+cmapFormat.getRangeCount());
-        
+
             for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
                 CmapFormat.Range range = cmapFormat.getRange(i);
                 for (int j = range.getStartCode(); j <= range.getEndCode(); ++j) {
@@ -147,7 +147,7 @@ class TypecastFont implements FontInt {
         }
         char2Glyph = new IntObjectHashMap(cmapentries + cmapentries/4);
     }
-    
+
     public StringBuilder getName(StringBuilder sb, int nameIndex) {
         return font.getName(nameIndex, sb);
     }
@@ -161,12 +161,12 @@ class TypecastFont implements FontInt {
         sb = getName(sb, Font.NAME_FAMILY).append("-");
         getName(sb, Font.NAME_SUBFAMILY);
         return sb;
-    }    
+    }
 
     public float getAdvanceWidth(int i, float pixelSize) {
-        return font.getHmtxTable().getAdvanceWidth(i) * metrics.getScale(pixelSize);        
+        return font.getHmtxTable().getAdvanceWidth(i) * metrics.getScale(pixelSize);
     }
-    
+
     public Metrics getMetrics() {
         if (metrics == null) {
             metrics = new TypecastHMetrics(this);
@@ -175,7 +175,7 @@ class TypecastFont implements FontInt {
     }
 
     public Glyph getGlyph(char symbol) {
-        TypecastGlyph result = (TypecastGlyph) char2Glyph.get(symbol);        
+        TypecastGlyph result = (TypecastGlyph) char2Glyph.get(symbol);
         if (null == result) {
             // final short code = (short) char2Code.get(symbol);
             short code = (short) cmapFormat.mapCharCode(symbol);
@@ -187,7 +187,7 @@ class TypecastFont implements FontInt {
                     default:   code = Glyph.ID_UNKNOWN;
                 }
             }
-            
+
             jogamp.graph.font.typecast.ot.OTGlyph glyph = font.getGlyph(code);
             if(null == glyph) {
                 glyph = font.getGlyph(Glyph.ID_UNKNOWN);
@@ -200,25 +200,25 @@ class TypecastFont implements FontInt {
             if(DEBUG) {
                 System.err.println("New glyph: " + (int)symbol + " ( " + (char)symbol +" ) -> " + code + ", contours " + glyph.getPointCount() + ": " + path);
             }
-            final HdmxTable hdmx = font.getHdmxTable();            
+            final HdmxTable hdmx = font.getHdmxTable();
             if (null!= result && null != hdmx) {
                 /*if(DEBUG) {
                     System.err.println("hdmx "+hdmx);
                 }*/
                 for (int i=0; i<hdmx.getNumberOfRecords(); i++)
                 {
-                    final HdmxTable.DeviceRecord dr = hdmx.getRecord(i); 
+                    final HdmxTable.DeviceRecord dr = hdmx.getRecord(i);
                     result.addAdvance(dr.getWidth(code), dr.getPixelSize());
                     /* if(DEBUG) {
                         System.err.println("hdmx advance : pixelsize = "+dr.getWidth(code)+" : "+ dr.getPixelSize());
                     } */
                 }
-            }            
+            }
             char2Glyph.put(symbol, result);
         }
         return result;
     }
-   
+
     public ArrayList<OutlineShape> getOutlineShapes(CharSequence string, float pixelSize, Factory<? extends Vertex> vertexFactory) {
     	AffineTransform transform = new AffineTransform(vertexFactory);
     	return TypecastRenderer.getOutlineShapes(this, string, pixelSize, transform, vertexFactory);
@@ -238,7 +238,7 @@ class TypecastFont implements FontInt {
             }
         }
 
-        return (int)(width + 0.5f);        
+        return (int)(width + 0.5f);
     }
 
     public float getStringHeight(CharSequence string, float pixelSize) {
@@ -254,7 +254,7 @@ class TypecastFont implements FontInt {
                 height = (int)Math.ceil(Math.max(bbox.getHeight(), height));
             }
         }
-        return height;        
+        return height;
     }
 
     public AABBox getStringBounds(CharSequence string, float pixelSize) {
@@ -284,17 +284,17 @@ class TypecastFont implements FontInt {
             totalHeight -= advanceY;
             totalWidth = Math.max(curLineWidth, totalWidth);
         }
-        return new AABBox(0, 0, 0, totalWidth, totalHeight,0);        
+        return new AABBox(0, 0, 0, totalWidth, totalHeight,0);
     }
 
     final public int getNumGlyphs() {
         return font.getNumGlyphs();
     }
-    
+
     public boolean isPrintableChar( char c ) {
         return FontFactory.isPrintableChar(c);
     }
-    
+
     public String toString() {
         return getFullFamilyName(null).toString();
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
index 8479c08ca..77b5a9aa9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
@@ -46,7 +46,7 @@ public class TypecastFontConstructor implements FontConstructor  {
     public Font create(final File ffile) throws IOException {
         Object o = AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
-                OTFontCollection fontset;        
+                OTFontCollection fontset;
                 try {
                     fontset = OTFontCollection.create(ffile);
                     return new TypecastFont(fontset);
@@ -63,14 +63,14 @@ public class TypecastFontConstructor implements FontConstructor  {
         }
         throw new InternalError("Unexpected Object: "+o);
     }
-    
+
     public Font create(final URLConnection fconn) throws IOException {
         return AccessController.doPrivileged(new PrivilegedAction<Font>() {
             public Font run() {
                 File tf = null;
                 int len=0;
                 Font f = null;
-                try {         
+                try {
                     tf = IOUtil.createTempFile( "jogl.font", ".ttf", false);
                     len = IOUtil.copyURLConn2File(fconn, tf);
                     if(len==0) {
@@ -84,7 +84,7 @@ public class TypecastFontConstructor implements FontConstructor  {
                 }
                 return f;
             }
-        });        
+        });
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
index 1205c6539..476b3fd4e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
@@ -40,45 +40,45 @@ public class TypecastGlyph implements FontInt.GlyphInt {
     public class Advance
     {
         final Font      font;
-        final float     advance; 
-        HashMap<Float, Float> size2advance = new HashMap<Float, Float>(); 
-        
+        final float     advance;
+        HashMap<Float, Float> size2advance = new HashMap<Float, Float>();
+
         public Advance(Font font, float advance)
         {
             this.font = font;
             this.advance = advance;
         }
-        
+
         public void reset() {
             size2advance.clear();
         }
-        
+
         public float getScale(float pixelSize)
         {
             return this.font.getMetrics().getScale(pixelSize);
         }
-        
+
         public void add(float advance, float size)
         {
             size2advance.put(size, advance);
         }
-        
+
         public float get(float size, boolean useFrationalMetrics)
         {
             Float fo = size2advance.get(size);
-            if(null == fo) {            
+            if(null == fo) {
                 float value = (this.advance * getScale(size));
                 if (useFrationalMetrics == false) {
                     //value = (float)Math.ceil(value);
                     // value = (int)value;
-                    value = (int) ( value + 0.5f ) ; // TODO: check 
+                    value = (int) ( value + 0.5f ) ; // TODO: check
                 }
                 size2advance.put(size, value);
                 return value;
             }
             return fo.floatValue();
         }
-        
+
         public String toString()
         {
             return "\nAdvance:"+
@@ -86,147 +86,147 @@ public class TypecastGlyph implements FontInt.GlyphInt {
                 "\n advances: \n"+size2advance;
         }
     }
-    
+
     public class Metrics
     {
         AABBox    bbox;
         Advance advance;
-        
+
         public Metrics(Font font, AABBox bbox, float advance)
         {
             this.bbox = bbox;
             this.advance = new Advance(font, advance);
         }
-        
+
         public void reset() {
             advance.reset();
         }
-        
+
         public float getScale(float pixelSize)
         {
             return this.advance.getScale(pixelSize);
         }
-        
+
         public AABBox getBBox()
         {
             return this.bbox;
         }
-        
+
         public void addAdvance(float advance, float size)
         {
             this.advance.add(advance, size);
         }
-        
+
         public float getAdvance(float size, boolean useFrationalMetrics)
         {
             return this.advance.get(size, useFrationalMetrics);
         }
-        
+
         public String toString()
         {
             return "\nMetrics:"+
                 "\n  bbox: "+this.bbox+
                 this.advance;
         }
-    }    
+    }
 
     public static final short INVALID_ID    = (short)((1 << 16) - 1);
     public static final short MAX_ID        = (short)((1 << 16) - 2);
-    
+
     private final Font font;
-        
+
     char        symbol;
     short       id;
     int         advance;
     Metrics     metrics;
-    
+
     protected Path2D path; // in EM units
     protected Path2D pathSized;
     protected float numberSized;
-    
+
     protected TypecastGlyph(Font font, char symbol) {
         this.font = font;
         this.symbol = symbol;
     }
-    
+
     protected TypecastGlyph(Font font,
                             char symbol, short id, AABBox bbox, int advance, Path2D path) {
         this.font = font;
         this.symbol = symbol;
         this.advance = advance;
-        
+
         init(id, bbox, advance);
-        
+
         this.path = path;
         this.pathSized = null;
         this.numberSized = 0.0f;
     }
-    
+
     void init(short id, AABBox bbox, int advance) {
         this.id = id;
         this.advance = advance;
         this.metrics = new Metrics(this.font, bbox, this.advance);
     }
-    
+
     public void reset(Path2D path) {
         this.path = path;
         this.metrics.reset();
     }
-    
+
     public Font getFont() {
         return this.font;
     }
-    
+
     public char getSymbol() {
         return this.symbol;
     }
-    
+
     AABBox getBBoxUnsized() {
         return this.metrics.getBBox();
     }
-    
+
     public AABBox getBBox() {
         return this.metrics.getBBox();
     }
-    
+
     public Metrics getMetrics() {
         return this.metrics;
     }
-    
+
     public short getID() {
         return this.id;
     }
-    
+
     public float getScale(float pixelSize) {
         return this.metrics.getScale(pixelSize);
     }
-    
+
     public AABBox getBBox(float pixelSize) {
         final float size = getScale(pixelSize);
         AABBox newBox = getBBox().clone();
         newBox.scale(size);
-        return newBox;        
+        return newBox;
     }
-    
+
     protected void addAdvance(float advance, float size) {
         this.metrics.addAdvance(advance, size);
     }
-    
+
     public float getAdvance(float pixelSize, boolean useFrationalMetrics) {
         return this.metrics.getAdvance(pixelSize, useFrationalMetrics);
     }
-    
+
     public Path2D getPath() {
         return this.path;
     }
-        
+
     public Path2D getPath(float pixelSize) {
         final float size = getScale(pixelSize);
-        
+
         if (this.numberSized != size) {
             this.numberSized = size;
             this.pathSized = AffineTransform.getScaleInstance(null, size, size).createTransformedShape(getPath());
-        }        
+        }
         return this.pathSized;
-    }    
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
index f170f5819..a6ce58ae2 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
@@ -35,7 +35,7 @@ import com.jogamp.opengl.math.geom.AABBox;
 
 class TypecastHMetrics implements Metrics {
     private final TypecastFont fontImpl;
-    
+
     // HeadTable
     private final HeadTable headTable;
     private final float unitsPerEM_Inv;
@@ -44,23 +44,23 @@ class TypecastHMetrics implements Metrics {
     private final HheaTable hheaTable;
     // VheaTable (for horizontal fonts)
     // private final VheaTable vheaTable;
-    
+
     public TypecastHMetrics(TypecastFont fontImpl) {
         this.fontImpl = fontImpl;
         headTable = this.fontImpl.font.getHeadTable();
-        hheaTable = this.fontImpl.font.getHheaTable();        
+        hheaTable = this.fontImpl.font.getHheaTable();
         // vheaTable = this.fontImpl.font.getVheaTable();
         unitsPerEM_Inv = 1.0f / ( (float) headTable.getUnitsPerEm() );
-        
+
         int maxWidth = headTable.getXMax() - headTable.getXMin();
-        int maxHeight = headTable.getYMax() - headTable.getYMin();              
+        int maxHeight = headTable.getYMax() - headTable.getYMin();
         float lowx= headTable.getXMin();
         float lowy = -(headTable.getYMin()+maxHeight);
         float highx = lowx + maxWidth;
         float highy = lowy + maxHeight;
         bbox = new AABBox(lowx, lowy, 0, highx, highy, 0); // invert
     }
-        
+
     public final float getAscent(float pixelSize) {
         return getScale(pixelSize) * -hheaTable.getAscender(); // invert
     }
@@ -78,7 +78,7 @@ class TypecastHMetrics implements Metrics {
     }
     public final AABBox getBBox(float pixelSize) {
         AABBox res = new AABBox(bbox.getLow(), bbox.getHigh());
-        res.scale(getScale(pixelSize));        
+        res.scale(getScale(pixelSize));
         return res;
     }
 }
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
index f155345aa..127e260ca 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
@@ -43,14 +43,14 @@ import com.jogamp.graph.geom.Vertex;
 import com.jogamp.graph.geom.Vertex.Factory;
 
 /**
- * Factory to build a {@link com.jogamp.graph.geom.Path2D Path2D} from 
- * {@link jogamp.graph.font.typecast.ot.OTGlyph Glyph}s. 
+ * Factory to build a {@link com.jogamp.graph.geom.Path2D Path2D} from
+ * {@link jogamp.graph.font.typecast.ot.OTGlyph Glyph}s.
  */
 public class TypecastRenderer {
 
-    private static void getPaths(TypecastFont font, 
+    private static void getPaths(TypecastFont font,
             CharSequence string, float pixelSize, AffineTransform transform, Path2D[] p)
-    {        
+    {
         if (string == null) {
             return;
         }
@@ -79,14 +79,14 @@ public class TypecastRenderer {
             } else if (character == ' ') {
                 advanceTotal += font.getAdvanceWidth(Glyph.ID_SPACE, pixelSize);
                 continue;
-            }        
+            }
             Glyph glyph = font.getGlyph(character);
             Path2D gp = ((GlyphInt)glyph).getPath();
             float scale = metrics.getScale(pixelSize);
             t.translate(advanceTotal, y);
             t.scale(scale, scale);
             p[i].append(gp.iterator(t), false);
-            advanceTotal += glyph.getAdvance(pixelSize, true); 
+            advanceTotal += glyph.getAdvance(pixelSize, true);
         }
     }
 
@@ -119,19 +119,19 @@ public class TypecastRenderer {
         case PathIterator.SEG_MOVETO:
             shape.closeLastOutline();
             shape.addEmptyOutline();
-            shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));            
+            shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
             break;
         case PathIterator.SEG_LINETO:
-            shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));            
+            shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
             break;
         case PathIterator.SEG_QUADTO:
             shape.addVertex(0, vertexFactory.create(coords, 0, 2, false));
-            shape.addVertex(0, vertexFactory.create(coords, 2, 2, true));            
+            shape.addVertex(0, vertexFactory.create(coords, 2, 2, true));
             break;
         case PathIterator.SEG_CUBICTO:
             shape.addVertex(0, vertexFactory.create(coords, 0, 2, false));
             shape.addVertex(0, vertexFactory.create(coords, 2, 2, false));
-            shape.addVertex(0, vertexFactory.create(coords, 4, 2, true));            
+            shape.addVertex(0, vertexFactory.create(coords, 4, 2, true));
             break;
         case PathIterator.SEG_CLOSE:
             shape.closeLastOutline();
@@ -184,12 +184,12 @@ public class TypecastRenderer {
                 if (point_plus1.onCurve) {
                     // s = new Line2D.Float(point.x, point.y, point_plus1.x, point_plus1.y);
                     gp.lineTo( point_plus1.x, point_plus1.y );
-                    offset++;                    
+                    offset++;
                 } else {
                     if (point_plus2.onCurve) {
                         // s = new QuadCurve2D.Float( point.x, point.y, point_plus1.x, point_plus1.y, point_plus2.x, point_plus2.y);
                         gp.quadTo(point_plus1.x, point_plus1.y, point_plus2.x, point_plus2.y);
-                        offset+=2;                    
+                        offset+=2;
                     } else {
                         // s = new QuadCurve2D.Float(point.x,point.y,point_plus1.x,point_plus1.y,
                         //                           midValue(point_plus1.x, point_plus2.x), midValue(point_plus1.y, point_plus2.y));
@@ -210,7 +210,7 @@ public class TypecastRenderer {
                     //                           midValue(point.x, point_plus1.x), midValue(point.y, point_plus1.y));
                     //gp.curve3(midValue(point.x, point_plus1.x), midValue(point.y, point_plus1.y), point.x, point.y);
                     gp.quadTo(point.x, point.y, midValue(point.x, point_plus1.x), midValue(point.y, point_plus1.y));
-                    offset++;                    
+                    offset++;
                 }
             }
         }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
index b5535758d..8b685659e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
index ece0aae4b..0a4786f82 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
@@ -840,11 +840,11 @@ public class Fixed {
         }
         return n;
     }
-    
+
     public static float floatValue(long fixed) {
         return (fixed >> 16) + (float)(fixed & 0xffff) / 0x10000;
     }
-    
+
     public static float roundedFloatValue(long fixed, int decimalPlaces) {
         int factor = 10 * decimalPlaces;
         return (float)((int)(floatValue(fixed) * factor)) / factor;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
index 6b3dc1f6f..d6c9da268 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
index 8c14b7302..8fc4be92d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
@@ -104,10 +104,10 @@ public class OTFont {
     public StringBuilder getName(int nameIndex, StringBuilder sb) {
         if(null == sb) {
             sb = new StringBuilder();
-        }        
+        }
         return _name.getRecordsRecordString(sb, nameIndex);
     }
-    
+
     public StringBuilder getAllNames(StringBuilder sb, String separator) {
         if(null != _name) {
             if(null == sb) {
@@ -117,9 +117,9 @@ public class OTFont {
                 _name.getRecord(i).getRecordString(sb).append(separator);
             }
         }
-        return sb;  
+        return sb;
     }
-    
+
     public Table getTable(int tableType) {
         for (int i = 0; i < _tables.length; i++) {
             if ((_tables[i] != null) && (_tables[i].getType() == tableType)) {
@@ -132,31 +132,31 @@ public class OTFont {
     public Os2Table getOS2Table() {
         return _os2;
     }
-    
+
     public CmapTable getCmapTable() {
         return _cmap;
     }
-    
+
     public HeadTable getHeadTable() {
         return _head;
     }
-    
+
     public HheaTable getHheaTable() {
         return _hhea;
     }
-    
+
     public HdmxTable getHdmxTable() {
         return _hdmx;
     }
-    
+
     public HmtxTable getHmtxTable() {
         return _hmtx;
     }
-    
+
     public LocaTable getLocaTable() {
         return _loca;
     }
-    
+
     public MaxpTable getMaxpTable() {
         return _maxp;
     }
@@ -186,8 +186,8 @@ public class OTFont {
     }
 
     public OTGlyph getGlyph(int i) {
-        
-        final GlyfDescript _glyfDescr = _glyf.getDescription(i); 
+
+        final GlyfDescript _glyfDescr = _glyf.getDescription(i);
         return (null != _glyfDescr)
             ? new OTGlyph(
                 _glyfDescr,
@@ -195,11 +195,11 @@ public class OTFont {
                 _hmtx.getAdvanceWidth(i))
             : null;
     }
-    
+
     public TableDirectory getTableDirectory() {
         return _tableDirectory;
     }
-    
+
     private Table readTable(
             DataInputStream dis,
             int tablesOrigin,
@@ -228,13 +228,13 @@ public class OTFont {
             DataInputStream dis,
             int directoryOffset,
             int tablesOrigin) throws IOException {
-        
+
         // Load the table directory
         dis.reset();
         dis.skip(directoryOffset);
         _tableDirectory = new TableDirectory(dis);
         _tables = new Table[_tableDirectory.getNumTables()];
-        
+
         // Load some prerequisite tables
         _head = (HeadTable) readTable(dis, tablesOrigin, Table.head);
         _hhea = (HheaTable) readTable(dis, tablesOrigin, Table.hhea);
@@ -252,7 +252,7 @@ public class OTFont {
         if (_vhea != null) {
             _tables[index++] = _vhea;
         }
-        
+
         // Load all other tables
         for (int i = 0; i < _tableDirectory.getNumTables(); i++) {
             DirectoryEntry entry = _tableDirectory.getEntry(i);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
index 4a041604d..c79380f16 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
@@ -75,11 +75,11 @@ public class OTFontCollection {
     public OTFont getFont(int i) {
         return _fonts[i];
     }
-    
+
     public int getFontCount() {
         return _fonts.length;
     }
-    
+
     public TTCHeader getTtcHeader() {
         return _ttcHeader;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
index 244ab400a..e0d652bd4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
@@ -102,10 +102,10 @@ public class OTGlyph {
         }
     }
 
-    public AABBox getBBox() { 
-        return _bbox; 
+    public AABBox getBBox() {
+        return _bbox;
     }
-    
+
     public int getAdvanceWidth() {
         return _advanceWidth;
     }
@@ -163,7 +163,7 @@ public class OTGlyph {
         // Append the origin and advanceWidth points (n & n+1)
         // _points[gd.getPointCount()] = new Point(0, 0, true, true);
         // _points[gd.getPointCount()+1] = new Point(_advanceWidth, 0, true, true);
-        
+
         _bbox = new AABBox(gd.getXMinimum(), gd.getYMinimum(), 0, gd.getXMaximum(), gd.getYMaximum(), 0);
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
index 433ff6051..7a5b0c4d2 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
@@ -31,7 +31,7 @@ import java.io.IOException;
 public class ResourceData {
 
     private byte[] data;
-    
+
     /** Creates new ResourceData */
     public ResourceData(DataInput di) throws IOException {
         int dataLen = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
index 2ada22c82..468ab2e1c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
@@ -33,14 +33,14 @@ public class ResourceFile {
 
     private ResourceHeader header;
     private ResourceMap map;
-    
+
     /** Creates new Resource */
     public ResourceFile(RandomAccessFile raf) throws IOException {
 
         // Read header at the beginning of the file
         raf.seek(0);
         header = new ResourceHeader(raf);
-        
+
         // Seek to the map offset and read the map
         raf.seek(header.getMapOffset());
         map = new ResourceMap(raf);
@@ -53,18 +53,18 @@ public class ResourceFile {
     public static void main(String[] args) {
         try {
             //RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/GillSans.dfont", "r");
-            
+
             // Tests loading a font from a resource fork on Mac OS X
             RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/Georgia/..namedfork/rsrc", "r");
             ResourceFile resource = new ResourceFile(raf);
             for (int i = 0; i < resource.getResourceMap().getResourceTypeCount(); i++) {
                 System.out.println(resource.getResourceMap().getResourceType(i).getTypeAsString());
             }
-            
+
             // Get the first 'sfnt' resource
             ResourceType type = resource.getResourceMap().getResourceType("sfnt");
             ResourceReference reference = type.getReference(0);
-            
+
             type = resource.getResourceMap().getResourceType("FOND");
             for (int i = 0; i < type.getCount(); ++i) {
                 reference = type.getReference(i);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
index 8f5224632..de13b116f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
@@ -46,15 +46,15 @@ public class ResourceHeader {
     public int getDataOffset() {
         return dataOffset;
     }
-    
+
     public int getMapOffset() {
         return mapOffset;
     }
-    
+
     public int getDataLength() {
         return dataLen;
     }
-    
+
     public int getMapLength() {
         return mapLen;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
index 96ba06087..d348c645e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
@@ -35,7 +35,7 @@ public class ResourceMap {
     private int fileReferenceNumber;
     private int attributes;
     private ResourceType[] types;
-    
+
     /** Creates new ResourceMap */
     public ResourceMap(DataInput di) throws IOException {
         di.readFully(headerCopy);
@@ -45,18 +45,18 @@ public class ResourceMap {
         int typeOffset = di.readUnsignedShort();
         int nameOffset = di.readUnsignedShort();
         int typeCount = di.readUnsignedShort() + 1;
-        
+
         // Read types
         types = new ResourceType[typeCount];
         for (int i = 0; i < typeCount; i++) {
             types[i] = new ResourceType(di);
         }
-        
+
         // Read the references
         for (int i = 0; i < typeCount; i++) {
             types[i].readRefs(di);
         }
-        
+
         // Read the names
         for (int i = 0; i < typeCount; i++) {
             types[i].readNames(di);
@@ -76,7 +76,7 @@ public class ResourceMap {
     public ResourceType getResourceType(int i) {
         return types[i];
     }
-    
+
     public int getResourceTypeCount() {
         return types.length;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
index fd7ec46b2..9d1534821 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
@@ -36,7 +36,7 @@ public class ResourceReference {
     private int dataOffset;
     private int handle;
     private String name;
-    
+
     /** Creates new ResourceReference */
     protected ResourceReference(DataInput di) throws IOException {
         id = di.readUnsignedShort();
@@ -58,23 +58,23 @@ public class ResourceReference {
     public int getId() {
         return id;
     }
-    
+
     public short getNameOffset() {
         return nameOffset;
     }
-    
+
     public short getAttributes() {
         return attributes;
     }
-    
+
     public int getDataOffset() {
         return dataOffset;
     }
-    
+
     public int getHandle() {
         return handle;
     }
-    
+
     public String getName() {
         return name;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
index 1c7e24c0f..2ad002e6a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
@@ -34,7 +34,7 @@ public class ResourceType {
     private int count;
     private int offset;
     private ResourceReference[] references;
-    
+
     /** Creates new ResourceType */
     protected ResourceType(DataInput di) throws IOException {
         type = di.readInt();
@@ -42,7 +42,7 @@ public class ResourceType {
         offset = di.readUnsignedShort();
         references = new ResourceReference[count];
     }
-    
+
     protected void readRefs(DataInput di) throws IOException {
         for (int i = 0; i < count; i++) {
             references[i] = new ResourceReference(di);
@@ -58,7 +58,7 @@ public class ResourceType {
     public int getType() {
         return type;
     }
-    
+
     public String getTypeAsString() {
         return new StringBuilder()
             .append((char)((type>>24)&0xff))
@@ -67,11 +67,11 @@ public class ResourceType {
             .append((char)((type)&0xff))
             .toString();
     }
-    
+
     public int getCount() {
         return count;
     }
-    
+
     public int getOffset() {
         return offset;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
index ed615eb72..b6626a9cc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
@@ -31,18 +31,18 @@ import java.io.IOException;
  * @author <a href="mailto:davidsch@dev.java.net">David Schweinsberg</a>
  */
 public class BaseTable implements Table {
-    
+
     private abstract class BaseCoord {
 
         public abstract int getBaseCoordFormat();
-        
+
         public abstract short getCoordinate();
     }
-    
+
     private class BaseCoordFormat1 extends BaseCoord {
 
         private short _coordinate;
-        
+
         protected BaseCoordFormat1(DataInput di) throws IOException {
             _coordinate = di.readShort();
         }
@@ -50,19 +50,19 @@ public class BaseTable implements Table {
         public int getBaseCoordFormat() {
             return 1;
         }
-        
+
         public short getCoordinate() {
             return _coordinate;
         }
-        
+
     }
-    
+
     private class BaseCoordFormat2 extends BaseCoord {
 
         private short _coordinate;
         private int _referenceGlyph;
         private int _baseCoordPoint;
-        
+
         protected BaseCoordFormat2(DataInput di) throws IOException {
             _coordinate = di.readShort();
             _referenceGlyph = di.readUnsignedShort();
@@ -72,18 +72,18 @@ public class BaseTable implements Table {
         public int getBaseCoordFormat() {
             return 2;
         }
-        
+
         public short getCoordinate() {
             return _coordinate;
         }
-        
+
     }
-    
+
     private class BaseCoordFormat3 extends BaseCoord {
 
         private short _coordinate;
         private int _deviceTableOffset;
-        
+
         protected BaseCoordFormat3(DataInput di) throws IOException {
             _coordinate = di.readShort();
             _deviceTableOffset = di.readUnsignedShort();
@@ -92,33 +92,33 @@ public class BaseTable implements Table {
         public int getBaseCoordFormat() {
             return 2;
         }
-        
+
         public short getCoordinate() {
             return _coordinate;
         }
-        
+
     }
-    
+
     private class FeatMinMaxRecord {
-        
+
         private int _tag;
         private int _minCoordOffset;
         private int _maxCoordOffset;
-        
+
         protected FeatMinMaxRecord(DataInput di) throws IOException {
             _tag = di.readInt();
             _minCoordOffset = di.readUnsignedShort();
             _maxCoordOffset = di.readUnsignedShort();
         }
     }
-    
+
     private class MinMax {
-        
+
         private int _minCoordOffset;
         private int _maxCoordOffset;
         private int _featMinMaxCount;
         private FeatMinMaxRecord[] _featMinMaxRecord;
-        
+
         protected MinMax(int minMaxOffset) throws IOException {
             DataInput di = getDataInputForOffset(minMaxOffset);
             _minCoordOffset = di.readUnsignedShort();
@@ -130,14 +130,14 @@ public class BaseTable implements Table {
             }
         }
     }
-    
+
     private class BaseValues {
-        
+
         private int _defaultIndex;
         private int _baseCoordCount;
         private int[] _baseCoordOffset;
         private BaseCoord[] _baseCoords;
-        
+
         protected BaseValues(int baseValuesOffset) throws IOException {
             DataInput di = getDataInputForOffset(baseValuesOffset);
             _defaultIndex = di.readUnsignedShort();
@@ -163,12 +163,12 @@ public class BaseTable implements Table {
             }
         }
     }
-    
+
     private class BaseLangSysRecord {
-        
+
         private int _baseLangSysTag;
         private int _minMaxOffset;
-        
+
         protected BaseLangSysRecord(DataInput di) throws IOException {
             _baseLangSysTag = di.readInt();
             _minMaxOffset = di.readUnsignedShort();
@@ -177,14 +177,14 @@ public class BaseTable implements Table {
         public int getBaseLangSysTag() {
             return _baseLangSysTag;
         }
-        
+
         public int getMinMaxOffset() {
             return _minMaxOffset;
         }
     }
-    
+
     private class BaseScript {
-        
+
         private int _thisOffset;
         private int _baseValuesOffset;
         private int _defaultMinMaxOffset;
@@ -192,7 +192,7 @@ public class BaseTable implements Table {
         private BaseLangSysRecord[] _baseLangSysRecord;
         private BaseValues _baseValues;
         private MinMax[] _minMax;
-        
+
         protected BaseScript(int baseScriptOffset) throws IOException {
             _thisOffset = baseScriptOffset;
             DataInput di = getDataInputForOffset(baseScriptOffset);
@@ -231,9 +231,9 @@ public class BaseTable implements Table {
             return sb.toString();
         }
     }
-    
+
     private class BaseScriptRecord {
-        
+
         private int _baseScriptTag;
         private int _baseScriptOffset;
 
@@ -245,19 +245,19 @@ public class BaseTable implements Table {
         public int getBaseScriptTag() {
             return _baseScriptTag;
         }
-        
+
         public int getBaseScriptOffset() {
             return _baseScriptOffset;
         }
     }
-    
+
     private class BaseScriptList {
-        
+
         private int _thisOffset;
         private int _baseScriptCount;
         private BaseScriptRecord[] _baseScriptRecord;
         private BaseScript[] _baseScripts;
- 
+
         protected BaseScriptList(int baseScriptListOffset) throws IOException {
             _thisOffset = baseScriptListOffset;
             DataInput di = getDataInputForOffset(baseScriptListOffset);
@@ -288,13 +288,13 @@ public class BaseTable implements Table {
             return sb.toString();
         }
      }
-    
+
     private class BaseTagList {
-        
+
         private int _thisOffset;
         private int _baseTagCount;
         private int[] _baselineTag;
-        
+
         protected BaseTagList(int baseTagListOffset) throws IOException {
             _thisOffset = baseTagListOffset;
             DataInput di = getDataInputForOffset(baseTagListOffset);
@@ -315,9 +315,9 @@ public class BaseTable implements Table {
             return sb.toString();
         }
     }
-    
+
     private class Axis {
-        
+
         private int _thisOffset;
         private int _baseTagListOffset;
         private int _baseScriptListOffset;
@@ -348,7 +348,7 @@ public class BaseTable implements Table {
                 .toString();
         }
     }
-    
+
     private DirectoryEntry _de;
     private int _version;
     private int _horizAxisOffset;
@@ -375,25 +375,25 @@ public class BaseTable implements Table {
         if (_vertAxisOffset != 0) {
             _vertAxis = new Axis(_vertAxisOffset);
         }
-        
+
         // Let go of the buffer
         _buf = null;
     }
-    
+
     private DataInput getDataInputForOffset(int offset) {
         return new DataInputStream(new ByteArrayInputStream(
                 _buf, offset,
                 _de.getLength() - offset));
     }
-    
+
 //    private String valueAsShortHex(int value) {
 //        return String.format("%1$4x", value);
 //    }
-//    
+//
 //    private String valueAsLongHex(int value) {
 //        return String.format("%1$8x", value);
 //    }
-    
+
     static protected String tagAsString(int tag) {
         char[] c = new char[4];
         c[0] = (char)((tag >> 24) & 0xff);
@@ -402,7 +402,7 @@ public class BaseTable implements Table {
         c[3] = (char)(tag & 0xff);
         return String.valueOf(c);
     }
-    
+
     public int getType() {
         return BASE;
     }
@@ -422,7 +422,7 @@ public class BaseTable implements Table {
         }
         return sb.toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
index 966f6e17b..62486fb7f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
@@ -36,13 +36,13 @@ import java.util.Hashtable;
  * @author <a href="mailto:davidsch@dev.java.net">David Schweinsberg</a>
  */
 public class CffTable implements Table {
-    
+
     public class Dict {
-        
+
         private Dictionary<Integer, Object> _entries = new Hashtable<Integer, Object>();
         private int[] _data;
         private int _index;
-        
+
         protected Dict(int[] data, int offset, int length) {
             _data = data;
             _index = offset;
@@ -50,11 +50,11 @@ public class CffTable implements Table {
                 addKeyAndValueEntry();
             }
         }
-        
+
         public Object getValue(int key) {
             return _entries.get(key);
         }
-        
+
         private boolean addKeyAndValueEntry() {
             ArrayList<Object> operands = new ArrayList<Object>();
             Object operand = null;
@@ -74,7 +74,7 @@ public class CffTable implements Table {
             }
             return true;
         }
-        
+
         private boolean isOperandAtIndex() {
             int b0 = _data[_index];
             if ((32 <= b0 && b0 <= 254)
@@ -97,31 +97,31 @@ public class CffTable implements Table {
         private Object nextOperand() {
             int b0 = _data[_index];
             if (32 <= b0 && b0 <= 246) {
-                
+
                 // 1 byte integer
                 ++_index;
                 return new Integer(b0 - 139);
             } else if (247 <= b0 && b0 <= 250) {
-                
+
                 // 2 byte integer
                 int b1 = _data[_index + 1];
                 _index += 2;
                 return new Integer((b0 - 247) * 256 + b1 + 108);
             } else if (251 <= b0 && b0 <= 254) {
-                
+
                 // 2 byte integer
                 int b1 = _data[_index + 1];
                 _index += 2;
                 return new Integer(-(b0 - 251) * 256 - b1 - 108);
             } else if (b0 == 28) {
-                
+
                 // 3 byte integer
                 int b1 = _data[_index + 1];
                 int b2 = _data[_index + 2];
                 _index += 3;
                 return new Integer(b1 << 8 | b2);
             } else if (b0 == 29) {
-                
+
                 // 5 byte integer
                 int b1 = _data[_index + 1];
                 int b2 = _data[_index + 2];
@@ -130,7 +130,7 @@ public class CffTable implements Table {
                 _index += 5;
                 return new Integer(b1 << 24 | b2 << 16 | b3 << 8 | b4);
             } else if (b0 == 30) {
-                
+
                 // Real number
                 StringBuilder fString = new StringBuilder();
                 int nibble1 = 0;
@@ -142,13 +142,13 @@ public class CffTable implements Table {
                     ++_index;
                     fString.append(decodeRealNibble(nibble1));
                     fString.append(decodeRealNibble(nibble2));
-                }                
+                }
                 return new Float(fString.toString());
             } else {
                 return null;
             }
         }
-        
+
         private String decodeRealNibble(int nibble) {
             if (nibble < 0xa) {
                 return Integer.toString(nibble);
@@ -163,7 +163,7 @@ public class CffTable implements Table {
             }
             return "";
         }
-        
+
         public String toString() {
             StringBuilder sb = new StringBuilder();
             Enumeration<Integer> keys = _entries.keys();
@@ -179,14 +179,14 @@ public class CffTable implements Table {
             return sb.toString();
         }
     }
-    
+
     public class Index {
-        
+
         private int _count;
         private int _offSize;
         private int[] _offset;
         private int[] _data;
-        
+
         protected Index(DataInput di) throws IOException {
             _count = di.readUnsignedShort();
             _offset = new int[_count + 1];
@@ -203,19 +203,19 @@ public class CffTable implements Table {
                 _data[i] = di.readUnsignedByte();
             }
         }
-        
+
         public int getCount() {
             return _count;
         }
-        
+
         public int getOffset(int index) {
             return _offset[index];
         }
-        
+
         public int getDataLength() {
             return _offset[_offset.length - 1] - 1;
         }
-        
+
         public int[] getData() {
             return _data;
         }
@@ -241,13 +241,13 @@ public class CffTable implements Table {
             return sb.toString();
         }
     }
-    
+
     public class TopDictIndex extends Index {
 
         protected TopDictIndex(DataInput di) throws IOException {
             super(di);
         }
-        
+
         public Dict getTopDict(int index) {
             int offset = getOffset(index) - 1;
             int len = getOffset(index + 1) - offset - 1;
@@ -262,13 +262,13 @@ public class CffTable implements Table {
             return sb.toString();
         }
     }
-    
+
     public class NameIndex extends Index {
 
         protected NameIndex(DataInput di) throws IOException {
             super(di);
         }
-        
+
         public String getName(int index) {
             String name = null;
             int offset = getOffset(index) - 1;
@@ -286,7 +286,7 @@ public class CffTable implements Table {
             }
             return name;
         }
-        
+
         public String toString() {
             StringBuilder sb = new StringBuilder();
             for (int i = 0; i < getCount(); ++i) {
@@ -301,7 +301,7 @@ public class CffTable implements Table {
         protected StringIndex(DataInput di) throws IOException {
             super(di);
         }
-        
+
         public String getString(int index) {
             if (index < CffStandardStrings.standardStrings.length) {
                 return CffStandardStrings.standardStrings[index];
@@ -320,7 +320,7 @@ public class CffTable implements Table {
                 return sb.toString();
             }
         }
-        
+
         public String toString() {
             int nonStandardBase = CffStandardStrings.standardStrings.length;
             StringBuilder sb = new StringBuilder();
@@ -331,12 +331,12 @@ public class CffTable implements Table {
             return sb.toString();
         }
     }
-    
+
     private class CharsetRange {
-        
+
         private int _first;
         private int _left;
-        
+
         public int getFirst() {
             return _first;
         }
@@ -344,7 +344,7 @@ public class CffTable implements Table {
         protected void setFirst(int first) {
             _first = first;
         }
-        
+
         public int getLeft() {
             return _left;
         }
@@ -355,39 +355,39 @@ public class CffTable implements Table {
     }
 
     private class CharsetRange1 extends CharsetRange {
-        
+
         protected CharsetRange1(DataInput di) throws IOException {
             setFirst(di.readUnsignedShort());
             setLeft(di.readUnsignedByte());
         }
     }
-    
+
     private class CharsetRange2 extends CharsetRange {
-        
+
         protected CharsetRange2(DataInput di) throws IOException {
             setFirst(di.readUnsignedShort());
             setLeft(di.readUnsignedShort());
         }
     }
-    
+
     private abstract class Charset {
-        
+
         public abstract int getFormat();
-        
+
         public abstract int getSID(int gid);
     }
-    
+
     private class CharsetFormat0 extends Charset {
-        
+
         private int[] _glyph;
-        
+
         protected CharsetFormat0(DataInput di, int glyphCount) throws IOException {
             _glyph = new int[glyphCount - 1];  // minus 1 because .notdef is omitted
             for (int i = 0; i < glyphCount - 1; ++i) {
                 _glyph[i] = di.readUnsignedShort();
             }
         }
-        
+
         public int getFormat() {
             return 0;
         }
@@ -399,11 +399,11 @@ public class CffTable implements Table {
             return _glyph[gid - 1];
         }
     }
-    
+
     private class CharsetFormat1 extends Charset {
-        
+
         private ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
-        
+
         protected CharsetFormat1(DataInput di, int glyphCount) throws IOException {
             int glyphsCovered = glyphCount - 1;  // minus 1 because .notdef is omitted
             while (glyphsCovered > 0) {
@@ -421,7 +421,7 @@ public class CffTable implements Table {
             if (gid == 0) {
                 return 0;
             }
-            
+
             // Count through the ranges to find the one of interest
             int count = 0;
             for (CharsetRange range : _charsetRanges) {
@@ -436,9 +436,9 @@ public class CffTable implements Table {
     }
 
     private class CharsetFormat2 extends Charset {
-        
+
         private ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
-        
+
         protected CharsetFormat2(DataInput di, int glyphCount) throws IOException {
             int glyphsCovered = glyphCount - 1;  // minus 1 because .notdef is omitted
             while (glyphsCovered > 0) {
@@ -456,7 +456,7 @@ public class CffTable implements Table {
             if (gid == 0) {
                 return 0;
             }
-            
+
             // Count through the ranges to find the one of interest
             int count = 0;
             for (CharsetRange range : _charsetRanges) {
@@ -469,7 +469,7 @@ public class CffTable implements Table {
             return 0;
         }
     }
-    
+
     private DirectoryEntry _de;
     private int _major;
     private int _minor;
@@ -499,24 +499,24 @@ public class CffTable implements Table {
         _minor = di2.readUnsignedByte();
         _hdrSize = di2.readUnsignedByte();
         _offSize = di2.readUnsignedByte();
-        
+
         // Name INDEX
         di2 = getDataInputForOffset(_hdrSize);
         _nameIndex = new NameIndex(di2);
-        
+
         // Top DICT INDEX
         _topDictIndex = new TopDictIndex(di2);
 
         // String INDEX
         _stringIndex = new StringIndex(di2);
-        
+
         // Global Subr INDEX
         _globalSubrIndex = new Index(di2);
-        
+
         // Encodings go here -- but since this is an OpenType font will this
         // not always be a CIDFont?  In which case there are no encodings
         // within the CFF data.
-        
+
         // Load each of the fonts
         _charStringsIndexArray = new Index[_topDictIndex.getCount()];
         _charsets = new Charset[_topDictIndex.getCount()];
@@ -530,7 +530,7 @@ public class CffTable implements Table {
             di2 = getDataInputForOffset(charStringsOffset);
             _charStringsIndexArray[i] = new Index(di2);
             int glyphCount = _charStringsIndexArray[i].getCount();
-        
+
             // Charsets
             Integer charsetOffset = (Integer) _topDictIndex.getTopDict(i).getValue(15);
             di2 = getDataInputForOffset(charsetOffset);
@@ -563,7 +563,7 @@ public class CffTable implements Table {
             }
         }
     }
-    
+
     private DataInput getDataInputForOffset(int offset) {
         return new DataInputStream(new ByteArrayInputStream(
                 _buf, offset,
@@ -573,7 +573,7 @@ public class CffTable implements Table {
     public NameIndex getNameIndex() {
         return _nameIndex;
     }
-    
+
     public Charset getCharset(int fontIndex) {
         return _charsets[fontIndex];
     }
@@ -581,7 +581,7 @@ public class CffTable implements Table {
     public Charstring getCharstring(int fontIndex, int gid) {
         return _charstringsArray[fontIndex][gid];
     }
-    
+
     public int getCharstringCount(int fontIndex) {
         return _charstringsArray[fontIndex].length;
     }
@@ -607,7 +607,7 @@ public class CffTable implements Table {
         }
         return sb.toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Charstring.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Charstring.java
index d411d1e00..01e2d4934 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Charstring.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Charstring.java
@@ -28,6 +28,6 @@ package jogamp.graph.font.typecast.ot.table;
 public abstract class Charstring {
 
     public abstract int getIndex();
-    
+
     public abstract String getName();
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
index 9c40a0e5e..93ff60988 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
@@ -28,7 +28,7 @@ import jogamp.graph.font.typecast.ot.table.CffTable;
  * @author <a href="mailto:davidsch@dev.java.net">David Schweinsberg</a>
  */
 public class CharstringType2 extends Charstring {
-    
+
     private static final String[] _oneByteOperators = {
         "-Reserved-",
         "hstem",
@@ -105,7 +105,7 @@ public class CharstringType2 extends Charstring {
         "flex1",
         "-Reserved-"
     };
-    
+
     private int _index;
     private String _name;
     private int[] _data;
@@ -132,7 +132,7 @@ public class CharstringType2 extends Charstring {
         _localSubrIndex = localSubrIndex;
         _globalSubrIndex = globalSubrIndex;
     }
-    
+
     public int getIndex() {
         return _index;
     }
@@ -140,7 +140,7 @@ public class CharstringType2 extends Charstring {
     public String getName() {
         return _name;
     }
-    
+
     private void disassemble(StringBuilder sb) {
         Number operand = null;
         while (isOperandAtIndex()) {
@@ -151,7 +151,7 @@ public class CharstringType2 extends Charstring {
         String mnemonic;
         if (operator == 12) {
             operator = nextByte();
-            
+
             // Check we're not exceeding the upper limit of our mnemonics
             if (operator > 38) {
                 operator = 38;
@@ -162,7 +162,7 @@ public class CharstringType2 extends Charstring {
         }
         sb.append(mnemonic);
     }
-    
+
     public void resetIP() {
         _ip = _offset;
     }
@@ -214,15 +214,15 @@ public class CharstringType2 extends Charstring {
             return null;
         }
     }
-    
+
     public int nextByte() {
         return _data[_ip++];
     }
-    
+
     public boolean moreBytes() {
         return _ip < _offset + _length;
     }
-    
+
     public String toString() {
         StringBuilder sb = new StringBuilder();
         resetIP();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
index 4c2f3decb..21698c76b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
index 0c99ad66a..1079aeed4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
index 5b7c4d655..59bc7b329 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
index 7ce531cd9..62ce5ae4c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
@@ -58,21 +58,21 @@ import java.io.IOException;
  * @author <a href="mailto:davidsch@dev.java.net">David Schweinsberg</a>
  */
 public abstract class CmapFormat {
-    
+
     public class Range {
-        
+
         private int _startCode;
         private int _endCode;
-        
+
         protected Range(int startCode, int endCode) {
             _startCode = startCode;
             _endCode = endCode;
         }
-        
+
         public int getStartCode() {
             return _startCode;
         }
-        
+
         public int getEndCode() {
             return _endCode;
         }
@@ -116,12 +116,12 @@ public abstract class CmapFormat {
     }
 
     public abstract int getRangeCount();
-    
+
     public abstract Range getRange(int index)
         throws ArrayIndexOutOfBoundsException;
 
     public abstract int mapCharCode(int charCode);
-    
+
     public String toString() {
         return new StringBuilder()
         .append("format: ")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
index e374f82d2..2093158bd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
@@ -74,7 +74,7 @@ public class CmapFormat0 extends CmapFormat {
     public int getRangeCount() {
         return 1;
     }
-    
+
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         if (index != 0) {
             throw new ArrayIndexOutOfBoundsException();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
index 319d8c0d0..222c93852 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
@@ -67,7 +67,7 @@ public class CmapFormat2 extends CmapFormat {
         int _idRangeOffset;
         int _arrayIndex;
     }
-    
+
     private int[] _subHeaderKeys = new int[256];
     private SubHeader[] _subHeaders;
     private int[] _glyphIndexArray;
@@ -75,9 +75,9 @@ public class CmapFormat2 extends CmapFormat {
     protected CmapFormat2(DataInput di) throws IOException {
         super(di);
         _format = 2;
-        
+
         int pos = 6;
-        
+
         // Read the subheader keys, noting the highest value, as this will
         // determine the number of subheaders to read.
         int highest = 0;
@@ -88,7 +88,7 @@ public class CmapFormat2 extends CmapFormat {
         }
         int subHeaderCount = highest / 8 + 1;
         _subHeaders = new SubHeader[subHeaderCount];
-        
+
         // Read the subheaders, once again noting the highest glyphIndexArray
         // index range.
         int indexArrayOffset = 8 * subHeaderCount + 518;
@@ -99,18 +99,18 @@ public class CmapFormat2 extends CmapFormat {
             sh._entryCount = di.readUnsignedShort();
             sh._idDelta = di.readShort();
             sh._idRangeOffset = di.readUnsignedShort();
-            
+
             // Calculate the offset into the _glyphIndexArray
             pos += 8;
             sh._arrayIndex =
                     (pos - 2 + sh._idRangeOffset - indexArrayOffset) / 2;
-            
+
             // What is the highest range within the glyphIndexArray?
             highest = Math.max(highest, sh._arrayIndex + sh._entryCount);
-            
+
             _subHeaders[i] = sh;
         }
-        
+
         // Read the glyphIndexArray
         _glyphIndexArray = new int[highest];
         for (int i = 0; i < _glyphIndexArray.length; ++i) {
@@ -121,12 +121,12 @@ public class CmapFormat2 extends CmapFormat {
     public int getRangeCount() {
         return _subHeaders.length;
     }
-    
+
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         if (index < 0 || index >= _subHeaders.length) {
             throw new ArrayIndexOutOfBoundsException();
         }
-        
+
         // Find the high-byte (if any)
         int highByte = 0;
         if (index != 0) {
@@ -137,7 +137,7 @@ public class CmapFormat2 extends CmapFormat {
                 }
             }
         }
-        
+
         return new Range(
                 highByte | _subHeaders[index]._firstCode,
                 highByte | (_subHeaders[index]._firstCode +
@@ -145,7 +145,7 @@ public class CmapFormat2 extends CmapFormat {
     }
 
     public int mapCharCode(int charCode) {
-        
+
         // Get the appropriate subheader
         int index = 0;
         int highByte = charCode >> 8;
@@ -153,14 +153,14 @@ public class CmapFormat2 extends CmapFormat {
             index = _subHeaderKeys[highByte] / 8;
         }
         SubHeader sh = _subHeaders[index];
-        
+
         // Is the charCode out-of-range?
         int lowByte = charCode & 0xff;
         if (lowByte < sh._firstCode ||
                 lowByte >= (sh._firstCode + sh._entryCount)) {
             return 0;
         }
-        
+
         // Now calculate the glyph index
         int glyphIndex =
                 _glyphIndexArray[sh._arrayIndex + (lowByte - sh._firstCode)];
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
index c09bdc8c3..ef65867af 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
@@ -102,7 +102,7 @@ public class CmapFormat4 extends CmapFormat {
         for (int i = 0; i < count; i++) {
             _glyphIdArray[i] = di.readUnsignedShort();
         } // + 2*count (8*segCount + 2*count + 18)
-        
+
         // Are there any padding bytes we need to consume?
 //        int leftover = length - (8*segCount + 2*count + 18);
 //        if (leftover > 0) {
@@ -113,7 +113,7 @@ public class CmapFormat4 extends CmapFormat {
     public int getRangeCount() {
         return _segCount;
     }
-    
+
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         if (index < 0 || index >= _segCount) {
             throw new ArrayIndexOutOfBoundsException();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
index a58531d11..a22e33244 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
@@ -67,7 +67,7 @@ public class CmapFormat6 extends CmapFormat {
     protected CmapFormat6(DataInput di) throws IOException {
         super(di);
         _format = 6;
-        
+
         // HACK: As this is not yet implemented, we need to skip over the bytes
         // we should be consuming
         //di.skipBytes(_length - 4);
@@ -76,7 +76,7 @@ public class CmapFormat6 extends CmapFormat {
     public int getRangeCount() {
         return 0;
     }
-    
+
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         throw new ArrayIndexOutOfBoundsException();
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
index 83366b593..3544b6f62 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
@@ -30,12 +30,12 @@ import java.io.IOException;
  * @version $Id: CmapFormatUnknown.java,v 1.1 2004-12-21 10:21:23 davidsch Exp $
  */
 public class CmapFormatUnknown extends CmapFormat {
-    
+
     /** Creates a new instance of CmapFormatUnknown */
     protected CmapFormatUnknown(int format, DataInput di) throws IOException {
         super(di);
         _format = format;
-        
+
         // We don't know how to handle this data, so we'll just skip over it
         di.skipBytes(_length - 4);
     }
@@ -43,7 +43,7 @@ public class CmapFormatUnknown extends CmapFormat {
     public int getRangeCount() {
         return 0;
     }
-    
+
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         throw new ArrayIndexOutOfBoundsException();
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
index 85fdf7225..47f6c470d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
@@ -85,7 +85,7 @@ public class CmapIndexEntry implements Comparable {
     public CmapFormat getFormat() {
         return _format;
     }
-    
+
     public void setFormat(CmapFormat format) {
         _format = format;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
index 0050fdd8e..016efa093 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
@@ -94,7 +94,7 @@ public class CmapTable implements Table {
             } else if (_entries[i].getOffset() > bytesRead) {
                 di.skipBytes(_entries[i].getOffset() - (int) bytesRead);
             } else if (_entries[i].getOffset() != bytesRead) {
-                
+
                 // Something is amiss
                 throw new IOException();
             }
@@ -109,15 +109,15 @@ public class CmapTable implements Table {
     public int getVersion() {
         return _version;
     }
-    
+
     public int getNumTables() {
         return _numTables;
     }
-    
+
     public CmapIndexEntry getCmapIndexEntry(int i) {
         return _entries[i];
     }
-    
+
     public CmapFormat getCmapFormat(short platformId, short encodingId) {
 
         // Find the requested format
@@ -148,7 +148,7 @@ public class CmapTable implements Table {
 //        }
         return sb.toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
index e85fadb5e..4f526f51d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
@@ -68,7 +68,7 @@ public abstract class Coverage {
      * can't be found.
      */
     public abstract int findGlyph(int glyphId);
-    
+
     protected static Coverage read(DataInput di) throws IOException {
         Coverage c = null;
         int format = di.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
index 963163584..867ef1823 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -47,7 +47,7 @@ public class CvtTable implements Table {
         }
         return sb.toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -57,5 +57,5 @@ public class CvtTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
index 6b4af6908..5451f4502 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
index c98f03fe9..7abcec0ce 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
@@ -70,7 +70,7 @@ public class DirectoryEntry implements Cloneable {
         _offset = di.readInt();
         _length = di.readInt();
     }
-    
+
     public Object clone() {
         try {
             return super.clone();
@@ -103,7 +103,7 @@ public class DirectoryEntry implements Cloneable {
             .append((char)((_tag)&0xff))
             .toString();
     }
-    
+
     public String toString() {
         return new StringBuilder()
             .append("'").append(getTagAsString())
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
index 4b41f451d..4a09a4c34 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -21,7 +21,7 @@ public class DsigEntry {
     private int format;
     private int length;
     private int offset;
-    
+
     /** Creates new DsigEntry */
     protected DsigEntry(DataInput di) throws IOException {
         format = di.readInt();
@@ -32,11 +32,11 @@ public class DsigEntry {
     public int getFormat() {
         return format;
     }
-    
+
     public int getLength() {
         return length;
     }
-    
+
     public int getOffset() {
         return offset;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
index e2784f9e6..f25c595d0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -48,7 +48,7 @@ public class DsigTable implements Table {
     public int getType() {
         return DSIG;
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -58,7 +58,7 @@ public class DsigTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
     public String toString() {
         StringBuilder sb = new StringBuilder().append("DSIG\n");
         for (int i = 0; i < numSigs; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
index 3cfb54a38..fdedca94a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
@@ -66,11 +66,11 @@ public class FeatureList {
 
     /** Creates new FeatureList */
     public FeatureList(DataInputStream dis, int offset) throws IOException {
-        
+
         // Ensure we're in the right place
         dis.reset();
         dis.skipBytes(offset);
-        
+
         // Start reading
         _featureCount = dis.readUnsignedShort();
         _featureRecords = new FeatureRecord[_featureCount];
@@ -88,11 +88,11 @@ public class FeatureList {
     public int getFeatureCount() {
         return _featureCount;
     }
-    
+
     public FeatureRecord getFeatureRecord(int i) {
         return _featureRecords[i];
     }
-    
+
     public Feature getFeature(int i) {
         return _features[i];
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
index eb610814b..1da74f4d5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
@@ -72,7 +72,7 @@ public class FeatureRecord {
     public int getTag() {
         return _tag;
     }
-    
+
     public int getOffset() {
         return _offset;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
index 9a6000156..b662265d9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -33,7 +33,7 @@ public class FpgmTable extends Program implements Table {
     public String toString() {
         return Disassembler.disassemble(getInstructions(), 0);
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -43,5 +43,5 @@ public class FpgmTable extends Program implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
index 2748406df..cf4afa88e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -20,10 +20,10 @@ public class GaspRange {
 
     public static final int GASP_GRIDFIT = 1;
     public static final int GASP_DOGRAY = 2;
-    
+
     private int rangeMaxPPEM;
     private int rangeGaspBehavior;
-    
+
     /** Creates new GaspRange */
     protected GaspRange(DataInput di) throws IOException {
         rangeMaxPPEM = di.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
index a83db5bff..45498eda1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -22,7 +22,7 @@ public class GaspTable implements Table {
     private int version;
     private int numRanges;
     private GaspRange[] gaspRange;
-    
+
     /** Creates new GaspTable */
     protected GaspTable(DirectoryEntry de, DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
@@ -49,7 +49,7 @@ public class GaspTable implements Table {
         }
         return sb.toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -59,5 +59,5 @@ public class GaspTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
index 4cf254198..50f62ed62 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
@@ -73,7 +73,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
             int glyphIndex,
             DataInput di) throws IOException {
         super(parentTable, glyphIndex, (short) -1, di);
-        
+
         // Get all of the composite components
         GlyfCompositeComp comp;
         int firstIndex = 0;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
index a9342a434..a7e2e7b69 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
@@ -111,7 +111,7 @@ public abstract class GlyfDescript extends Program implements GlyphDescription {
     public short getYMinimum() {
         return _yMin;
     }
-    
+
     public String toString() {
         return new StringBuilder()
             .append("          numberOfContours: ").append(_numberOfContours)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
index c11d2d8ff..f67162cff 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
@@ -73,7 +73,7 @@ public class GlyfSimpleDescript extends GlyfDescript {
             short numberOfContours,
             DataInput di) throws IOException {
         super(parentTable, glyphIndex, numberOfContours, di);
-        
+
         // Simple glyph description
         _endPtsOfContours = new int[numberOfContours];
         for (int i = 0; i < numberOfContours; i++) {
@@ -184,7 +184,7 @@ public class GlyfSimpleDescript extends GlyfDescript {
             System.out.println("error: array index out of bounds");
         }
     }
-    
+
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append(super.toString());
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
index 22fdd8886..34a8218d9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
@@ -71,12 +71,12 @@ public class GlyfTable implements Table {
             LocaTable loca) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _descript = new GlyfDescript[maxp.getNumGlyphs()];
-        
+
         // Buffer the whole table so we can randomly access it
         byte[] buf = new byte[de.getLength()];
         di.readFully(buf);
         ByteArrayInputStream bais = new ByteArrayInputStream(buf);
-        
+
         // Process all the simple glyphs
         for (int i = 0; i < maxp.getNumGlyphs(); i++) {
             int len = loca.getOffset(i + 1) - loca.getOffset(i);
@@ -119,7 +119,7 @@ public class GlyfTable implements Table {
     public int getType() {
         return glyf;
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyphDescription.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyphDescription.java
index 106e17917..025778dfc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyphDescription.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyphDescription.java
@@ -56,29 +56,29 @@ package jogamp.graph.font.typecast.ot.table;
  * @author <a href="mailto:davidsch@dev.java.net">David Schweinsberg</a>
  */
 public interface GlyphDescription {
-    
+
     public int getGlyphIndex();
-    
+
     public int getEndPtOfContours(int i);
-    
+
     public byte getFlags(int i);
-    
+
     public short getXCoordinate(int i);
-    
+
     public short getYCoordinate(int i);
-    
+
     public short getXMaximum();
-    
+
     public short getXMinimum();
-    
+
     public short getYMaximum();
-    
+
     public short getYMinimum();
-    
+
     public boolean isComposite();
-    
+
     public int getPointCount();
-    
+
     public int getContourCount();
 
     //  public int getComponentIndex(int c);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
index 91a62362a..9a367412d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
@@ -48,7 +48,7 @@ public class GposTable implements Table {
     public int getType() {
         return GPOS;
     }
-    
+
     public String toString() {
         return "GPOS";
     }
@@ -62,5 +62,5 @@ public class GposTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
index c002de374..0351c903d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
@@ -66,10 +66,10 @@ public class GsubTable implements Table, LookupSubtableFactory {
     private ScriptList _scriptList;
     private FeatureList _featureList;
     private LookupList _lookupList;
-    
+
     protected GsubTable(DirectoryEntry de, DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
-        
+
         // Load into a temporary buffer, and create another input stream
         byte[] buf = new byte[de.getLength()];
         di.readFully(buf);
@@ -86,17 +86,17 @@ public class GsubTable implements Table, LookupSubtableFactory {
 
         // Feature List
         _featureList = new FeatureList(dis, featureListOffset);
-        
+
         // Lookup List
         _lookupList = new LookupList(dis, lookupListOffset, this);
     }
 
     /**
-     * 1 - Single - Replace one glyph with one glyph 
-     * 2 - Multiple - Replace one glyph with more than one glyph 
-     * 3 - Alternate - Replace one glyph with one of many glyphs 
-     * 4 - Ligature - Replace multiple glyphs with one glyph 
-     * 5 - Context - Replace one or more glyphs in context 
+     * 1 - Single - Replace one glyph with one glyph
+     * 2 - Multiple - Replace one glyph with more than one glyph
+     * 3 - Alternate - Replace one glyph with one of many glyphs
+     * 4 - Ligature - Replace multiple glyphs with one glyph
+     * 5 - Context - Replace one or more glyphs in context
      * 6 - Chaining - Context Replace one or more glyphs in chained context
      */
     public LookupSubtable read(
@@ -167,7 +167,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
         }
         return "Unknown";
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -177,5 +177,5 @@ public class GsubTable implements Table, LookupSubtableFactory {
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
index 5b1fa2020..42f9bf0d0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
@@ -30,9 +30,9 @@ import java.io.IOException;
  * @version $Id: HdmxTable.java,v 1.2 2007-07-26 11:12:30 davidsch Exp $
  */
 public class HdmxTable implements Table {
-    
+
     public class DeviceRecord {
-        
+
         private short _pixelSize;
         private short _maxWidth;
         private short[] _widths;
@@ -49,11 +49,11 @@ public class HdmxTable implements Table {
         public short getPixelSize() {
             return _pixelSize;
         }
-        
+
         public short getMaxWidth() {
             return _maxWidth;
         }
-        
+
         public short[] getWidths() {
             return _widths;
         }
@@ -61,9 +61,9 @@ public class HdmxTable implements Table {
         public short getWidth(int glyphidx) {
             return _widths[glyphidx];
         }
-        
+
     }
-    
+
     private DirectoryEntry _de;
     private int _version;
     private short _numRecords;
@@ -78,7 +78,7 @@ public class HdmxTable implements Table {
         _numRecords = di.readShort();
         _sizeDeviceRecords = di.readInt();
         _records = new DeviceRecord[_numRecords];
-        
+
         // Read the device records
         for (int i = 0; i < _numRecords; ++i) {
             _records[i] = new DeviceRecord(maxp.getNumGlyphs(), di);
@@ -88,15 +88,15 @@ public class HdmxTable implements Table {
     public int getNumberOfRecords() {
         return _numRecords;
     }
-    
+
     public DeviceRecord getRecord(int i) {
         return _records[i];
     }
-    
+
     public int getType() {
         return hdmx;
     }
-    
+
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'hdmx' Table - Horizontal Device Metrics\n----------------------------------------\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
index 9d7fe4251..cf7c58449 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
@@ -192,7 +192,7 @@ public class HeadTable implements Table {
             .append("\n  glyphDataFormat:     ").append(_glyphDataFormat)
             .toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -202,5 +202,5 @@ public class HeadTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
index 20a21e4d9..0278929f1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -122,7 +122,7 @@ public class HheaTable implements Table {
             .append("\n        numOf_LongHorMetrics: ").append(numberOfHMetrics)
             .toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -132,5 +132,5 @@ public class HheaTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
index 9fd66e728..eed8c1841 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
@@ -38,7 +38,7 @@ public abstract class ID {
     public static final short encodingUnicode11Semantics = 1;
     public static final short encodingISO10646Semantics = 2;
     public static final short encodingUnicode20Semantics = 3;
-    
+
     // Microsoft Encoding IDs
 //    public static final short encodingUndefined = 0;
 //    public static final short encodingUGL = 1;
@@ -203,7 +203,7 @@ public abstract class ID {
     public static String getEncodingName(short platformId, short encodingId) {
 
         if (platformId == platformUnicode) {
-            
+
             // Unicode specific encodings
             switch (encodingId) {
                 case encodingUnicode10Semantics: return "Unicode 1.0 semantics";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
index 7a4cccba2..04fd646a7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -21,7 +21,7 @@ public abstract class KernSubtable {
     /** Creates new KernSubtable */
     protected KernSubtable() {
     }
-    
+
     public abstract int getKerningPairCount();
 
     public abstract KerningPair getKerningPair(int i);
@@ -32,7 +32,7 @@ public abstract class KernSubtable {
         int length = di.readUnsignedShort();
         int coverage = di.readUnsignedShort();
         int format = coverage >> 8;
-        
+
         switch (format) {
         case 0:
             table = new KernSubtableFormat0(di);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
index b55bef6d5..89e6f9f11 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -17,7 +17,7 @@ import java.io.IOException;
  * @version $Id: KernSubtableFormat0.java,v 1.1.1.1 2004-12-05 23:14:48 davidsch Exp $
  */
 public class KernSubtableFormat0 extends KernSubtable {
-    
+
     private int nPairs;
     private int searchRange;
     private int entrySelector;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
index 60d584ca6..6f5e1f5e8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
index 70aee70d2..1d526865a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -17,7 +17,7 @@ import java.io.IOException;
  * @version $Id: KernTable.java,v 1.1.1.1 2004-12-05 23:14:48 davidsch Exp $
  */
 public class KernTable implements Table {
-    
+
     private DirectoryEntry de;
     private int version;
     private int nTables;
@@ -37,7 +37,7 @@ public class KernTable implements Table {
     public int getSubtableCount() {
         return nTables;
     }
-    
+
     public KernSubtable getSubtable(int i) {
         return tables[i];
     }
@@ -58,5 +58,5 @@ public class KernTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
index ce7cebc97..52f82cc85 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
index 6759208f5..1ab112a78 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
@@ -64,7 +64,7 @@ public class LangSys {
     private int _reqFeatureIndex;
     private int _featureCount;
     private int[] _featureIndex;
-    
+
     /** Creates new LangSys */
     protected LangSys(DataInput di) throws IOException {
         _lookupOrder = di.readUnsignedShort();
@@ -75,19 +75,19 @@ public class LangSys {
             _featureIndex[i] = di.readUnsignedShort();
         }
     }
-    
+
     public int getLookupOrder() {
         return _lookupOrder;
     }
-    
+
     public int getReqFeatureIndex() {
         return _reqFeatureIndex;
     }
-    
+
     public int getFeatureCount() {
         return _featureCount;
     }
-    
+
     public int getFeatureIndex(int i) {
         return _featureIndex[i];
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
index 9511f66ba..f3befe3b6 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
@@ -62,7 +62,7 @@ public class LangSysRecord {
 
     private int _tag;
     private int _offset;
-    
+
     /** Creates new LangSysRecord */
     public LangSysRecord(DataInput di) throws IOException {
         _tag = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
index d3e2ad5cd..de862a983 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
@@ -73,11 +73,11 @@ public class Ligature {
             _components[i] = di.readUnsignedShort();
         }
     }
-    
+
     public int getGlyphCount() {
         return _compCount;
     }
-    
+
     public int getGlyphId(int i) {
         return (i == 0) ? _ligGlyph : _components[i-1];
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
index a0f42662c..cad5e106a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
@@ -91,5 +91,5 @@ public class LigatureSubstFormat1 extends LigatureSubst {
 
     public String getTypeAsString() {
         return "LigatureSubstFormat1";
-    }    
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
index 5eb7c5856..ce0862eea 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -64,7 +64,7 @@ public class LocaTable implements Table {
         }
         return sb.toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
index 2899c24d9..6496c3791 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
@@ -79,7 +79,7 @@ public class Lookup {
         // Ensure we're in the right place
         dis.reset();
         dis.skipBytes(offset);
-        
+
         // Start reading
         _type = dis.readUnsignedShort();
         _flag = dis.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
index a3b71b639..e70a932e4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
@@ -67,11 +67,11 @@ public class LookupList {
     /** Creates new LookupList */
     public LookupList(DataInputStream dis, int offset, LookupSubtableFactory factory)
     throws IOException {
-        
+
         // Ensure we're in the right place
         dis.reset();
         dis.skipBytes(offset);
-        
+
         // Start reading
         _lookupCount = dis.readUnsignedShort();
         _lookupOffsets = new int[_lookupCount];
@@ -87,11 +87,11 @@ public class LookupList {
     public int getLookupCount() {
         return _lookupCount;
     }
-    
+
     public int getLookupOffset(int i) {
         return _lookupOffsets[i];
     }
-    
+
     public Lookup getLookup(int i) {
         return _lookups[i];
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupSubtableFactory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupSubtableFactory.java
index cb4d28d2c..ca67df7fb 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupSubtableFactory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupSubtableFactory.java
@@ -47,13 +47,13 @@
  Apache Software Foundation, please see <http://www.apache.org/>.
 
 */
- 
+
 package jogamp.graph.font.typecast.ot.table;
 
 import java.io.DataInputStream;
 import java.io.IOException;
 
-/** 
+/**
  *
  * @author <a href="mailto:davidsch@dev.java.net">David Schweinsberg</a>
  * @version $Id: LookupSubtableFactory.java,v 1.2 2007-01-24 09:47:46 davidsch Exp $
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
index ace3d38b5..9b0c8e6b4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -22,7 +22,7 @@ public class LtshTable implements Table {
     private int version;
     private int numGlyphs;
     private int[] yPels;
-    
+
     /** Creates new LtshTable */
     protected LtshTable(DirectoryEntry de, DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
@@ -41,7 +41,7 @@ public class LtshTable implements Table {
     public int getType() {
         return LTSH;
     }
-    
+
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'LTSH' Table - Linear Threshold Table\n-------------------------------------")
@@ -54,7 +54,7 @@ public class LtshTable implements Table {
         }
         return sb.toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -64,5 +64,5 @@ public class LtshTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
index 0e8ec44c7..5ab6b51ca 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -39,7 +39,7 @@ public class MaxpTable implements Table {
     protected MaxpTable(DirectoryEntry de, DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         versionNumber = di.readInt();
-        
+
         // CFF fonts use version 0.5, TrueType fonts use version 1.0
         if (versionNumber == 0x00005000) {
             numGlyphs = di.readUnsignedShort();
@@ -149,7 +149,7 @@ public class MaxpTable implements Table {
         }
         return sb.toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -159,5 +159,5 @@ public class MaxpTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
index 268d6cfca..9f9822986 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
@@ -75,19 +75,19 @@ public class NameRecord {
         _stringLength = di.readShort();
         _stringOffset = di.readShort();
     }
-    
+
     public short getEncodingId() {
         return _encodingId;
     }
-    
+
     public short getLanguageId() {
         return _languageId;
     }
-    
+
     public short getNameId() {
         return _nameId;
     }
-    
+
     public short getPlatformId() {
         return _platformId;
     }
@@ -101,7 +101,7 @@ public class NameRecord {
         StringBuilder sb = new StringBuilder();
         di.skipBytes(_stringOffset);
         if (_platformId == ID.platformUnicode) {
-            
+
             // Unicode (big-endian)
             for (int i = 0; i < _stringLength/2; i++) {
                 sb.append(di.readChar());
@@ -113,13 +113,13 @@ public class NameRecord {
                 sb.append((char) di.readByte());
             }
         } else if (_platformId == ID.platformISO) {
-            
+
             // ISO encoding, ASCII
             for (int i = 0; i < _stringLength; i++) {
                 sb.append((char) di.readByte());
             }
         } else if (_platformId == ID.platformMicrosoft) {
-            
+
             // Microsoft encoding, Unicode
             char c;
             for (int i = 0; i < _stringLength/2; i++) {
@@ -132,7 +132,7 @@ public class NameRecord {
 
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        
+
         sb.append("             Platform ID:       ").append(_platformId)
             .append("\n             Specific ID:       ").append(_encodingId)
             .append("\n             Language ID:       ").append(_languageId)
@@ -140,7 +140,7 @@ public class NameRecord {
             .append("\n             Length:            ").append(_stringLength)
             .append("\n             Offset:            ").append(_stringOffset)
             .append("\n\n").append(_record);
-        
+
         return sb.toString();
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
index 6daf2ad60..5b7a17d3b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
@@ -68,25 +68,25 @@ public class NameTable implements Table {
     private short _numberOfNameRecords;
     private short _stringStorageOffset;
     private NameRecord[] _records;
-    
+
     protected NameTable(DirectoryEntry de, DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _formatSelector = di.readShort();
         _numberOfNameRecords = di.readShort();
         _stringStorageOffset = di.readShort();
         _records = new NameRecord[_numberOfNameRecords];
-        
+
         // Load the records, which contain the encoding information and string
         // offsets
         for (int i = 0; i < _numberOfNameRecords; i++) {
             _records[i] = new NameRecord(di);
         }
-        
+
         // Load the string data into a buffer so the records can copy out the
         // bits they are interested in
         byte[] buffer = new byte[_de.getLength() - _stringStorageOffset];
         di.readFully(buffer);
-        
+
         // Now let the records get their hands on them
         for (int i = 0; i < _numberOfNameRecords; i++) {
             _records[i].loadString(
@@ -98,7 +98,7 @@ public class NameTable implements Table {
         return _numberOfNameRecords;
     }
 
-    
+
     public NameRecord getRecord(int i) {
         if(_numberOfNameRecords > i) {
             return _records[i];
@@ -133,7 +133,7 @@ public class NameTable implements Table {
     public int getType() {
         return name;
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -143,5 +143,5 @@ public class NameTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
index f4fa76e81..9dfbceb99 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
@@ -134,7 +134,7 @@ public class Os2Table implements Table {
         _usWinDescent = di.readUnsignedShort();
         _ulCodePageRange1 = di.readInt();
         _ulCodePageRange2 = di.readInt();
-        
+
         // OpenType 1.3
         if (_version == 2) {
             _sxHeight = di.readShort();
@@ -276,19 +276,19 @@ public class Os2Table implements Table {
     public short getXHeight() {
         return _sxHeight;
     }
-    
+
     public short getCapHeight() {
         return _sCapHeight;
     }
-    
+
     public int getDefaultChar() {
         return _usDefaultChar;
     }
-    
+
     public int getBreakChar() {
         return _usBreakChar;
     }
-    
+
     public int getMaxContext() {
         return _usMaxContext;
     }
@@ -335,7 +335,7 @@ public class Os2Table implements Table {
             .append("\n  CodePage Range 2( Bits 32- 63 ): ").append(Integer.toHexString(_ulCodePageRange2).toUpperCase())
             .toString();
     }
-    
+
     private String getVendorIDAsString() {
         return new StringBuilder()
             .append((char)((_achVendorID>>24)&0xff))
@@ -344,7 +344,7 @@ public class Os2Table implements Table {
             .append((char)((_achVendorID)&0xff))
             .toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
index 6127140d1..1f6c5a1dd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -42,11 +42,11 @@ public class Panose {
   public byte getFamilyType() {
     return bFamilyType;
   }
-  
+
   public byte getSerifStyle() {
     return bSerifStyle;
   }
-  
+
   public byte getWeight() {
     return bWeight;
   }
@@ -54,31 +54,31 @@ public class Panose {
   public byte getProportion() {
     return bProportion;
   }
-  
+
   public byte getContrast() {
     return bContrast;
   }
-  
+
   public byte getStrokeVariation() {
     return bStrokeVariation;
   }
-  
+
   public byte getArmStyle() {
     return bArmStyle;
   }
-  
+
   public byte getLetterForm() {
     return bLetterform;
   }
-  
+
   public byte getMidline() {
     return bMidline;
   }
-  
+
   public byte getXHeight() {
     return bXHeight;
   }
-  
+
   public String toString() {
     StringBuilder sb = new StringBuilder();
     sb.append(String.valueOf(bFamilyType)).append(" ")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
index f9dcf2ce7..6ed9b2b9c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -68,7 +68,7 @@ public class PcltTable implements Table {
     public int getType() {
         return PCLT;
     }
-    
+
     public String toString() {
         return new StringBuilder()
             .append("'PCLT' Table - Printer Command Language Table\n---------------------------------------------")
@@ -91,7 +91,7 @@ public class PcltTable implements Table {
             .append("\n        reserved:            ").append(reserved)
             .toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -101,5 +101,5 @@ public class PcltTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
index c913b4c71..46f1ac088 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -294,7 +294,7 @@ public class PostTable implements Table {
     private int maxMemType42;
     private int minMemType1;
     private int maxMemType1;
-    
+
     // v2
     private int numGlyphs;
     private int[] glyphNameIndex;
@@ -312,7 +312,7 @@ public class PostTable implements Table {
         maxMemType42 = di.readInt();
         minMemType1 = di.readInt();
         maxMemType1 = di.readInt();
-        
+
         if (version == 0x00020000) {
             numGlyphs = di.readUnsignedShort();
             glyphNameIndex = new int[numGlyphs];
@@ -366,7 +366,7 @@ public class PostTable implements Table {
             return false;
         }
     }
-    
+
     /** Get the table type, as a table directory value.
      * @return The table type
      */
@@ -409,7 +409,7 @@ public class PostTable implements Table {
         }
         return sb.toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -419,5 +419,5 @@ public class PostTable implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
index aac10c539..2046d7fe4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -33,7 +33,7 @@ public class PrepTable extends Program implements Table {
     public String toString() {
         return Disassembler.disassemble(getInstructions(), 0);
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
@@ -43,5 +43,5 @@ public class PrepTable extends Program implements Table {
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
index 28c148c2b..e3beabef8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
index 72d703bb4..40ddf4215 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
@@ -75,7 +75,7 @@ public class RangeRecord {
     public boolean isInRange(int glyphId) {
         return (_start <= glyphId && glyphId <= _end);
     }
-    
+
     public int getCoverageIndex(int glyphId) {
         if (isInRange(glyphId)) {
             return _startCoverageIndex + glyphId - _start;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
index eb534b5dd..04781a8f9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
@@ -65,14 +65,14 @@ public class Script {
     private LangSysRecord[] _langSysRecords;
     private LangSys _defaultLangSys;
     private LangSys[] _langSys;
-    
+
     /** Creates new ScriptTable */
     protected Script(DataInputStream dis, int offset) throws IOException {
 
         // Ensure we're in the right place
         dis.reset();
         dis.skipBytes(offset);
-        
+
         // Start reading
         _defaultLangSysOffset = dis.readUnsignedShort();
         _langSysCount = dis.readUnsignedShort();
@@ -102,7 +102,7 @@ public class Script {
     public int getLangSysCount() {
         return _langSysCount;
     }
-    
+
     public LangSysRecord getLangSysRecord(int i) {
         return _langSysRecords[i];
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
index 4af62b0ee..18589b712 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
@@ -63,14 +63,14 @@ public class ScriptList {
     private int _scriptCount = 0;
     private ScriptRecord[] _scriptRecords;
     private Script[] _scripts;
-    
+
     /** Creates new ScriptList */
     protected ScriptList(DataInputStream dis, int offset) throws IOException {
-        
+
         // Ensure we're in the right place
         dis.reset();
         dis.skipBytes(offset);
-        
+
         // Start reading
         _scriptCount = dis.readUnsignedShort();
         _scriptRecords = new ScriptRecord[_scriptCount];
@@ -86,15 +86,15 @@ public class ScriptList {
     public int getScriptCount() {
         return _scriptCount;
     }
-    
+
     public ScriptRecord getScriptRecord(int i) {
         return _scriptRecords[i];
     }
-    
+
     public Script getScript(int i) {
         return _scripts[i];
     }
-    
+
     public Script findScript(String tag) {
         if (tag.length() != 4) {
             return null;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
index 5da0608dd..183ca2ffd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
@@ -62,7 +62,7 @@ public class ScriptRecord {
 
     private int _tag;
     private int _offset;
-    
+
     /** Creates new ScriptRecord */
     protected ScriptRecord(DataInput di) throws IOException {
         _tag = di.readInt();
@@ -72,7 +72,7 @@ public class ScriptRecord {
     public int getTag() {
         return _tag;
     }
-    
+
     public int getOffset() {
         return _offset;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
index 5a5de119f..15f0cd04f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -22,7 +22,7 @@ public class SignatureBlock {
     private int reserved2;
     private int signatureLen;
     private byte[] signature;
-    
+
     /** Creates new SignatureBlock */
     protected SignatureBlock(DataInput di) throws IOException {
         reserved1 = di.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
index 8c56a740f..e31281f2e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
@@ -63,7 +63,7 @@ public abstract class SingleSubst extends LookupSubtable {
     public abstract int getFormat();
 
     public abstract int substitute(int glyphId);
-    
+
     public static SingleSubst read(DataInputStream dis, int offset) throws IOException {
         SingleSubst s = null;
         dis.reset();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
index 99b85f35c..a8df78504 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
@@ -84,7 +84,7 @@ public class SingleSubstFormat1 extends SingleSubst {
         }
         return glyphId;
     }
-    
+
     public String getTypeAsString() {
         return "SingleSubstFormat1";
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
index cd3b6d147..2e47b2924 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
@@ -92,6 +92,6 @@ public class SingleSubstFormat2 extends SingleSubst {
 
     public String getTypeAsString() {
         return "SingleSubstFormat2";
-    }    
+    }
 }
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
index b801517f8..f7c7d99b5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -17,7 +17,7 @@ import java.io.IOException;
  * @author <a href="mailto:davidsch@dev.java.net">David Schweinsberg</a>
  */
 public class TTCHeader {
-    
+
     public static final int ttcf = 0x74746366;
 
     private int ttcTag;
@@ -47,7 +47,7 @@ public class TTCHeader {
     public int getDirectoryCount() {
         return directoryCount;
     }
-    
+
     public int getTableDirectory(int i) {
         return tableDirectory[i];
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Table.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Table.java
index 624f47bef..30fd2f457 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Table.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Table.java
@@ -1,9 +1,9 @@
 /*****************************************************************************
  * Copyright (C) The Apache Software Foundation. All rights reserved.        *
- * ------------------------------------------------------------------------- * 
- * This software is published under the terms of the Apache Software License * 
- * version 1.1, a copy of which has been included with this distribution in  * 
- * the LICENSE file.                                                         * 
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in  *
+ * the LICENSE file.                                                         *
  *****************************************************************************/
 
 package jogamp.graph.font.typecast.ot.table;
@@ -51,7 +51,7 @@ public interface Table {
     public static final int vmtx = 0x766d7478; // Vertical Metrics
 
     public static final String notAvailable = "n/a";
-    
+
     /**
      * Get the table type, as a table directory value.
      * @return The table type
@@ -65,5 +65,5 @@ public interface Table {
      * @return A directory entry
      */
     public DirectoryEntry getDirectoryEntry();
-    
+
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
index bacc26d30..8c5678088 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
@@ -112,7 +112,7 @@ public class TableDirectory {
     public int getVersion() {
         return _version;
     }
-    
+
     public String toString() {
         StringBuilder sb = new StringBuilder()
             .append("Offset Table\n------ -----")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
index 7749ea856..65aa84bff 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
@@ -26,7 +26,7 @@ package jogamp.graph.font.typecast.ot.table;
  * @version $Id: TableException.java,v 1.1.1.1 2004-12-05 23:15:00 davidsch Exp $
  */
 public class TableException extends java.lang.Exception {
-    
+
     private static final long serialVersionUID = 1L;
 
     /**
@@ -34,8 +34,8 @@ public class TableException extends java.lang.Exception {
      */
     public TableException() {
     }
-    
-    
+
+
     /**
      * Constructs an instance of <code>TableException</code> with the specified detail message.
      * @param msg the detail message.
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
index 998ce08e3..956d1aecd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
@@ -47,7 +47,7 @@
  Apache Software Foundation, please see <http://www.apache.org/>.
 
 */
- 
+
 package jogamp.graph.font.typecast.ot.table;
 
 import java.io.DataInputStream;
@@ -56,7 +56,7 @@ import java.io.IOException;
 import jogamp.graph.font.typecast.ot.OTFont;
 import jogamp.graph.font.typecast.ot.OTFontCollection;
 
-/** 
+/**
  *
  * @version $Id: TableFactory.java,v 1.7 2007-02-05 12:39:51 davidsch Exp $
  * @author <a href="mailto:davidsch@dev.java.net">David Schweinsberg</a>
@@ -69,7 +69,7 @@ public class TableFactory {
             DirectoryEntry de,
             DataInputStream dis) throws IOException {
         Table t = null;
-        
+
         // First, if we have a font collection, look for the table there
         if (fc != null) {
             t = fc.getTable(de);
@@ -77,7 +77,7 @@ public class TableFactory {
                 return t;
             }
         }
-        
+
         // Create the table
         switch (de.getTag()) {
         case Table.BASE:
@@ -175,7 +175,7 @@ public class TableFactory {
             t = new VmtxTable(de, dis, font.getVheaTable(), font.getMaxpTable());
             break;
         }
-        
+
         // If we have a font collection, add this table to it
         if ((fc != null) && (t != null)) {
             fc.addTable(t);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
index 80579f5cd..28f9aa6e3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
@@ -31,12 +31,12 @@ import java.io.IOException;
 public class VdmxTable implements Table {
 
     private class Ratio {
-        
+
         private byte _bCharSet;
         private byte _xRatio;
         private byte _yStartRatio;
         private byte _yEndRatio;
-        
+
         protected Ratio(DataInput di) throws IOException {
             _bCharSet = di.readByte();
             _xRatio = di.readByte();
@@ -47,26 +47,26 @@ public class VdmxTable implements Table {
         public byte getBCharSet() {
             return _bCharSet;
         }
-        
+
         public byte getXRatio() {
             return _xRatio;
         }
-        
+
         public byte getYStartRatio() {
             return _yStartRatio;
         }
-        
+
         public byte getYEndRatio() {
             return _yEndRatio;
         }
     }
-    
+
     private class VTableRecord {
-        
+
         private int _yPelHeight;
         private short _yMax;
         private short _yMin;
-        
+
         protected VTableRecord(DataInput di) throws IOException {
             _yPelHeight = di.readUnsignedShort();
             _yMax = di.readShort();
@@ -76,23 +76,23 @@ public class VdmxTable implements Table {
         public int getYPelHeight() {
             return _yPelHeight;
         }
-        
+
         public short getYMax() {
             return _yMax;
         }
-        
+
         public short getYMin() {
             return _yMin;
         }
     }
-    
+
     private class Group {
-        
+
         private int _recs;
         private int _startsz;
         private int _endsz;
         private VTableRecord[] _entry;
-        
+
         protected Group(DataInput di) throws IOException {
             _recs = di.readUnsignedShort();
             _startsz = di.readUnsignedByte();
@@ -106,20 +106,20 @@ public class VdmxTable implements Table {
         public int getRecs() {
             return _recs;
         }
-        
+
         public int getStartSZ() {
             return _startsz;
         }
-        
+
         public int getEndSZ() {
             return _endsz;
         }
-        
+
         public VTableRecord[] getEntry() {
             return _entry;
         }
     }
-    
+
     private DirectoryEntry _de;
     private int _version;
     private int _numRecs;
@@ -127,7 +127,7 @@ public class VdmxTable implements Table {
     private Ratio[] _ratRange;
     private int _offset[];
     private Group[] _groups;
-    
+
     /** Creates a new instance of VdmxTable */
     protected VdmxTable(DirectoryEntry de, DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
@@ -147,11 +147,11 @@ public class VdmxTable implements Table {
             _groups[i] = new Group(di);
         }
     }
-    
+
     public int getType() {
         return VDMX;
     }
-    
+
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'VDMX' Table - Precomputed Vertical Device Metrics\n")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
index 19c91765b..f42da119b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
@@ -135,7 +135,7 @@ public class VheaTable implements Table {
             .append("\n        numOf_LongVerMetrics: ").append(_numberOfLongVerMetrics)
             .toString();
     }
-    
+
     /**
      * Get a directory entry for this table.  This uniquely identifies the
      * table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
index 887f8c34f..181ec7e10 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
@@ -34,23 +34,23 @@ import jogamp.graph.font.typecast.ot.table.CharstringType2;
  * @version $Id: T2Interpreter.java,v 1.2 2007-07-26 11:10:18 davidsch Exp $
  */
 public class T2Interpreter {
-    
+
     private static final int ARGUMENT_STACK_LIMIT = 48;
     private static final int SUBR_STACK_LIMIT = 10;
     private static final int TRANSIENT_ARRAY_ELEMENT_COUNT = 32;
-    
+
     private Number[] _argStack = new Number[ARGUMENT_STACK_LIMIT];
     private int _argStackIndex = 0;
     private int[] _subrStack = new int[SUBR_STACK_LIMIT];
     private int _subrStackIndex = 0;
     private Number[] _transientArray = new Number[TRANSIENT_ARRAY_ELEMENT_COUNT];
-    
+
     private ArrayList<Point> _points;
 
     /** Creates a new instance of T2Interpreter */
     public T2Interpreter() {
     }
-    
+
     /**
      * Moves the current point to a position at the relative coordinates
      * (dx1, dy1).
@@ -72,7 +72,7 @@ public class T2Interpreter {
         Point lastPoint = getLastPoint();
         moveTo(lastPoint.x + dx1, lastPoint.y);
     }
-    
+
     /**
      * Moves the current point dy1 units in the vertical direction.
      */
@@ -82,7 +82,7 @@ public class T2Interpreter {
         Point lastPoint = getLastPoint();
         moveTo(lastPoint.x, lastPoint.y + dy1);
     }
-    
+
     /**
      * Appends a line from the current point to a position at the
      * relative coordinates dxa, dya. Additional rlineto operations are
@@ -103,7 +103,7 @@ public class T2Interpreter {
         }
         clearArg();
     }
-    
+
     /**
      * Appends a horizontal line of length dx1 to the current point.
      * With an odd number of arguments, subsequent argument pairs
@@ -130,7 +130,7 @@ public class T2Interpreter {
         }
         clearArg();
     }
-    
+
     /**
      * Appends a vertical line of length dy1 to the current point. With
      * an odd number of arguments, subsequent argument pairs are
@@ -157,7 +157,7 @@ public class T2Interpreter {
         }
         clearArg();
     }
-    
+
     /**
      * Appends a Bezier curve, defined by dxa...dyc, to the current
      * point. For each subsequent set of six arguments, an additional
@@ -194,7 +194,7 @@ public class T2Interpreter {
         }
         clearArg();
     }
-    
+
     /**
      * Appends one or more Bezier curves, as described by the
      * dxa...dxc set of arguments, to the current point. For each curve,
@@ -230,7 +230,7 @@ public class T2Interpreter {
         }
         clearArg();
     }
-    
+
     /**
      * Appends one or more Bezier curves to the current point. The
      * tangent for the first Bezier must be horizontal, and the second
@@ -327,13 +327,13 @@ public class T2Interpreter {
                 int yf = ye + dyf[i];
                 curveTo(xa, ya, xb, yb, xc, yc);
                 curveTo(xd, yd, xe, ye, xf, yf);
-                
+
                 // What on earth do we do with dx1, dx2, dy2 and dy3?
             }
         }
         clearArg();
     }
-    
+
     /**
      * Is equivalent to one rrcurveto for each set of six arguments
      * dxa...dyc, followed by exactly one rlineto using the dxd, dyd
@@ -373,7 +373,7 @@ public class T2Interpreter {
         lineTo(xc + dxd, yc + dyd);
         clearArg();
     }
-    
+
     /**
      * Is equivalent to one rlineto for each pair of arguments beyond
      * the six arguments dxb...dyd needed for the one rrcurveto
@@ -411,7 +411,7 @@ public class T2Interpreter {
         curveTo(xb, yb, xc, yc, xd, yd);
         clearArg();
     }
-    
+
     /**
      * Appends one or more Bezier curves to the current point, where
      * the first tangent is vertical and the second tangent is horizontal.
@@ -465,7 +465,7 @@ public class T2Interpreter {
         }
         clearArg();
     }
-    
+
     /**
      * Appends one or more curves to the current point. If the argument
      * count is a multiple of four, the curve starts and ends vertical. If
@@ -473,10 +473,10 @@ public class T2Interpreter {
      * vertical tangent.
      */
     private void _vvcurveto() {
-        
+
         clearArg();
     }
-    
+
     /**
      * Causes two Bezier curves, as described by the arguments (as
      * shown in Figure 2 below), to be rendered as a straight line when
@@ -485,10 +485,10 @@ public class T2Interpreter {
      * pixels.
      */
     private void _flex() {
-        
+
         clearArg();
     }
-    
+
     /**
      * Causes the two curves described by the arguments dx1...dx6 to
      * be rendered as a straight line when the flex depth is less than
@@ -496,10 +496,10 @@ public class T2Interpreter {
      * flex depth is greater than or equal to 0.5 device pixels.
      */
     private void _hflex() {
-        
+
         clearArg();
     }
-    
+
     /**
      * Causes the two curves described by the arguments to be
      * rendered as a straight line when the flex depth is less than 0.5
@@ -507,10 +507,10 @@ public class T2Interpreter {
      * than or equal to 0.5 device pixels.
      */
     private void _hflex1() {
-        
+
         clearArg();
     }
-    
+
     /**
      * Causes the two curves described by the arguments to be
      * rendered as a straight line when the flex depth is less than 0.5
@@ -518,10 +518,10 @@ public class T2Interpreter {
      * than or equal to 0.5 device pixels.
      */
     private void _flex1() {
-        
+
         clearArg();
     }
-    
+
     /**
      * Finishes a charstring outline definition, and must be the
      * last operator in a character's outline.
@@ -530,37 +530,37 @@ public class T2Interpreter {
         endContour();
         clearArg();
     }
-    
+
     private void _hstem() {
-        
+
         clearArg();
     }
-    
+
     private void _vstem() {
-        
+
         clearArg();
     }
-    
+
     private void _hstemhm() {
-        
+
         clearArg();
     }
-    
+
     private void _vstemhm() {
-        
+
         clearArg();
     }
-    
+
     private void _hintmask() {
-        
+
         clearArg();
     }
-    
+
     private void _cntrmask() {
-        
+
         clearArg();
     }
-    
+
     /**
      * Returns the absolute value of num.
      */
@@ -568,7 +568,7 @@ public class T2Interpreter {
         double num = popArg().doubleValue();
         pushArg(Math.abs(num));
     }
-    
+
     /**
      * Returns the sum of the two numbers num1 and num2.
      */
@@ -577,7 +577,7 @@ public class T2Interpreter {
         double num1 = popArg().doubleValue();
         pushArg(num1 + num2);
     }
-    
+
     /**
      * Returns the result of subtracting num2 from num1.
      */
@@ -586,7 +586,7 @@ public class T2Interpreter {
         double num1 = popArg().doubleValue();
         pushArg(num1 - num2);
     }
-    
+
     /**
      * Returns the quotient of num1 divided by num2. The result is
      * undefined if overflow occurs and is zero for underflow.
@@ -596,7 +596,7 @@ public class T2Interpreter {
         double num1 = popArg().doubleValue();
         pushArg(num1 / num2);
     }
-    
+
     /**
      * Returns the negative of num.
      */
@@ -604,7 +604,7 @@ public class T2Interpreter {
         double num = popArg().doubleValue();
         pushArg(-num);
     }
-    
+
     /**
      * Returns a pseudo random number num2 in the range (0,1], that
      * is, greater than zero and less than or equal to one.
@@ -612,7 +612,7 @@ public class T2Interpreter {
     private void _random() {
         pushArg(1.0 - Math.random());
     }
-    
+
     /**
      * Returns the product of num1 and num2. If overflow occurs, the
      * result is undefined, and zero is returned for underflow.
@@ -622,7 +622,7 @@ public class T2Interpreter {
         double num1 = popArg().doubleValue();
         pushArg(num1 * num2);
     }
-    
+
     /**
      * Returns the square root of num. If num is negative, the result is
      * undefined.
@@ -631,14 +631,14 @@ public class T2Interpreter {
         double num = popArg().doubleValue();
         pushArg(Math.sqrt(num));
     }
-    
+
     /**
      * Removes the top element num from the Type 2 argument stack.
      */
     private void _drop() {
         popArg();
     }
-    
+
     /**
      * Exchanges the top two elements on the argument stack.
      */
@@ -648,7 +648,7 @@ public class T2Interpreter {
         pushArg(num2);
         pushArg(num1);
     }
-    
+
     /**
      * Retrieves the element i from the top of the argument stack and
      * pushes a copy of that element onto that stack. If i is negative,
@@ -666,7 +666,7 @@ public class T2Interpreter {
         }
         pushArg(nums[i]);
     }
-    
+
     /**
      * Performs a circular shift of the elements num(Nx1) ... num0 on
      * the argument stack by the amount J. Positive J indicates upward
@@ -685,7 +685,7 @@ public class T2Interpreter {
             pushArg(nums[(n + i + j) % n]);
         }
     }
-    
+
     /**
      * Duplicates the top element on the argument stack.
      */
@@ -694,7 +694,7 @@ public class T2Interpreter {
         pushArg(any);
         pushArg(any);
     }
-    
+
     /**
      * Stores val into the transient array at the location given by i.
      */
@@ -703,7 +703,7 @@ public class T2Interpreter {
         Number val = popArg();
         _transientArray[i] = val;
     }
-    
+
     /**
      * Retrieves the value stored in the transient array at the location
      * given by i and pushes the value onto the argument stack. If get
@@ -714,7 +714,7 @@ public class T2Interpreter {
         int i = popArg().intValue();
         pushArg(_transientArray[i]);
     }
-    
+
     /**
      * Puts a 1 on the stack if num1 and num2 are both non-zero, and
      * puts a 0 on the stack if either argument is zero.
@@ -724,7 +724,7 @@ public class T2Interpreter {
         double num1 = popArg().doubleValue();
         pushArg((num1!=0.0) && (num2!=0.0) ? 1 : 0);
     }
-    
+
     /**
      * Puts a 1 on the stack if either num1 or num2 are non-zero, and
      * puts a 0 on the stack if both arguments are zero.
@@ -734,7 +734,7 @@ public class T2Interpreter {
         double num1 = popArg().doubleValue();
         pushArg((num1!=0.0) || (num2!=0.0) ? 1 : 0);
     }
-    
+
     /**
      * Returns a 0 if num1 is non-zero; returns a 1 if num1 is zero.
      */
@@ -742,7 +742,7 @@ public class T2Interpreter {
         double num1 = popArg().doubleValue();
         pushArg((num1!=0.0) ? 0 : 1);
     }
-    
+
     /**
      * Puts a 1 on the stack if num1 equals num2, otherwise a 0 (zero)
      * is put on the stack.
@@ -752,7 +752,7 @@ public class T2Interpreter {
         double num1 = popArg().doubleValue();
         pushArg(num1 == num2 ? 1 : 0);
     }
-    
+
     /**
      * Leaves the value s1 on the stack if v1 ? v2, or leaves s2 on the
      * stack if v1 > v2. The value of s1 and s2 is usually the biased
@@ -765,7 +765,7 @@ public class T2Interpreter {
         Number s1 = popArg();
         pushArg(v1 <= v2 ? s1 : s2);
     }
-    
+
     /**
      * Calls a charstring subroutine with index subr# (actually the subr
      * number plus the subroutine bias number, as described in section
@@ -777,25 +777,25 @@ public class T2Interpreter {
      * Calling an undefined subr (gsubr) has undefined results.
      */
     private void _callsubr() {
-        
+
     }
-    
+
     /**
      * Operates in the same manner as callsubr except that it calls a
      * global subroutine.
      */
     private void _callgsubr() {
-        
+
     }
-    
+
     /**
      * Returns from either a local or global charstring subroutine, and
      * continues execution after the corresponding call(g)subr.
      */
     private void _return() {
-        
+
     }
-    
+
     public Point[] execute(CharstringType2 cs) {
         _points = new ArrayList<Point>();
         cs.resetIP();
@@ -975,7 +975,7 @@ public class T2Interpreter {
     private int getArgCount() {
         return _argStackIndex;
     }
-    
+
     /**
      * Pop a value off the argument stack
      */
@@ -989,7 +989,7 @@ public class T2Interpreter {
     private void pushArg(Number n) {
         _argStack[_argStackIndex++] = n;
     }
-    
+
     /**
      * Pop a value off the subroutine stack
      */
@@ -1003,14 +1003,14 @@ public class T2Interpreter {
     private void pushSubr(int n) {
         _subrStack[_subrStackIndex++] = n;
     }
-    
+
     /**
      * Clear the argument stack
      */
     private void clearArg() {
         _argStackIndex = 0;
     }
-    
+
     private Point getLastPoint() {
         int size = _points.size();
         if (size > 0) {
@@ -1019,22 +1019,22 @@ public class T2Interpreter {
             return new Point(0, 0, true, false);
         }
     }
-    
+
     private void moveTo(int x, int y) {
         endContour();
         _points.add(new Point(x, y, true, false));
     }
-    
+
     private void lineTo(int x, int y) {
         _points.add(new Point(x, y, true, false));
     }
-    
+
     private void curveTo(int cx1, int cy1, int cx2, int cy2, int x, int y) {
         _points.add(new Point(cx1, cy1, false, false));
         _points.add(new Point(cx2, cy2, false, false));
         _points.add(new Point(x, y, true, false));
     }
-    
+
     private void endContour() {
         Point lastPoint = getLastPoint();
         if (lastPoint != null) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
index a659a7003..2bb5cec0c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
@@ -570,7 +570,7 @@ public class Interpreter {
     private void _mps() {
         push(0);
     }
-    
+
     private void _msirp(short param) {
         pop();
         pop();
@@ -1190,7 +1190,7 @@ public class Interpreter {
         while (ip < ((ip & 0xffff0000) | parser.getISLength(ip >> 16))) {
             short opcode = parser.getOpcode(ip);
             if (inFuncDef) {
-                
+
                 // We're within a function definition, so don't execute the code
                 if (opcode == Mnemonic.ENDF) {
                     inFuncDef = false;
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
index 0fd174cda..32e2b6a39 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
@@ -33,7 +33,7 @@ public class AffineTransform implements Cloneable, Serializable {
     private static final long serialVersionUID = 1330973210523860834L;
 
     static final String determinantIsZero = "Determinant is zero";
-    
+
     public static final int TYPE_IDENTITY = 0;
     public static final int TYPE_TRANSLATION = 1;
     public static final int TYPE_UNIFORM_SCALE = 2;
@@ -49,14 +49,14 @@ public class AffineTransform implements Cloneable, Serializable {
      * The <code>TYPE_UNKNOWN</code> is an initial type value
      */
     static final int TYPE_UNKNOWN = -1;
-    
+
     /**
-     * The min value equivalent to zero. If absolute value less then ZERO it considered as zero.  
+     * The min value equivalent to zero. If absolute value less then ZERO it considered as zero.
      */
     static final float ZERO = (float) 1E-10;
-   
+
     private final Vertex.Factory<? extends Vertex> pointFactory;
-    
+
     /**
      * The values of transformation matrix
      */
@@ -68,7 +68,7 @@ public class AffineTransform implements Cloneable, Serializable {
     float m12;
 
     /**
-     * The transformation <code>type</code> 
+     * The transformation <code>type</code>
      */
     transient int type;
 
@@ -123,20 +123,20 @@ public class AffineTransform implements Cloneable, Serializable {
 
     /*
      * Method returns type of affine transformation.
-     * 
+     *
      * Transform matrix is
      *   m00 m01 m02
      *   m10 m11 m12
-     * 
-     * According analytic geometry new basis vectors are (m00, m01) and (m10, m11), 
-     * translation vector is (m02, m12). Original basis vectors are (1, 0) and (0, 1). 
-     * Type transformations classification:  
+     *
+     * According analytic geometry new basis vectors are (m00, m01) and (m10, m11),
+     * translation vector is (m02, m12). Original basis vectors are (1, 0) and (0, 1).
+     * Type transformations classification:
      *   TYPE_IDENTITY - new basis equals original one and zero translation
-     *   TYPE_TRANSLATION - translation vector isn't zero  
+     *   TYPE_TRANSLATION - translation vector isn't zero
      *   TYPE_UNIFORM_SCALE - vectors length of new basis equals
-     *   TYPE_GENERAL_SCALE - vectors length of new basis doesn't equal 
+     *   TYPE_GENERAL_SCALE - vectors length of new basis doesn't equal
      *   TYPE_FLIP - new basis vector orientation differ from original one
-     *   TYPE_QUADRANT_ROTATION - new basis is rotated by 90, 180, 270, or 360 degrees     
+     *   TYPE_QUADRANT_ROTATION - new basis is rotated by 90, 180, 270, or 360 degrees
      *   TYPE_GENERAL_ROTATION - new basis is rotated by arbitrary angle
      *   TYPE_GENERAL_TRANSFORM - transformation can't be inversed
      */
@@ -322,7 +322,7 @@ public class AffineTransform implements Cloneable, Serializable {
     }
 
     public static <T extends Vertex> AffineTransform getShearInstance(Vertex.Factory<? extends Vertex> factory, float shx, float shy) {
-        AffineTransform t = new AffineTransform(factory);        
+        AffineTransform t = new AffineTransform(factory);
         t.setToShear(shx, shy);
         return t;
     }
@@ -359,13 +359,13 @@ public class AffineTransform implements Cloneable, Serializable {
         concatenate(AffineTransform.getRotateInstance(pointFactory, angle, px, py));
     }
 
-    /** 
+    /**
      * Multiply matrix of two AffineTransform objects.
      * The first argument's {@link Vertex.Factory} is being used.
-     * 
+     *
      * @param t1 - the AffineTransform object is a multiplicand
      * @param t2 - the AffineTransform object is a multiplier
-     * @return an AffineTransform object that is a result of t1 multiplied by matrix t2. 
+     * @return an AffineTransform object that is a result of t1 multiplied by matrix t2.
      */
     AffineTransform multiply(AffineTransform t1, AffineTransform t2) {
         return new AffineTransform(t1.pointFactory,
@@ -415,7 +415,7 @@ public class AffineTransform implements Cloneable, Serializable {
 
     public void transform(Vertex[] src, int srcOff, Vertex[] dst, int dstOff, int length) {
         while (--length >= 0) {
-            Vertex srcPoint = src[srcOff++]; 
+            Vertex srcPoint = src[srcOff++];
             float x = srcPoint.getX();
             float y = srcPoint.getY();
             Vertex dstPoint = dst[dstOff];
@@ -426,7 +426,7 @@ public class AffineTransform implements Cloneable, Serializable {
             dst[dstOff++] = dstPoint;
         }
     }
-    
+
     public void transform(float[] src, int srcOff, float[] dst, int dstOff, int length) {
         int step = 2;
         if (src == dst && srcOff < dstOff && dstOff < srcOff + length * 2) {
@@ -443,7 +443,7 @@ public class AffineTransform implements Cloneable, Serializable {
             dstOff += step;
         }
     }
-    
+
     public Vertex deltaTransform(Vertex src, Vertex dst) {
         if (dst == null) {
             dst = pointFactory.create();
@@ -486,7 +486,7 @@ public class AffineTransform implements Cloneable, Serializable {
     {
         float det = getDeterminant();
         if (FloatUtil.abs(det) < ZERO) {
-            throw new NoninvertibleTransformException(determinantIsZero);            
+            throw new NoninvertibleTransformException(determinantIsZero);
         }
 
         while (--length >= 0) {
@@ -554,7 +554,7 @@ public class AffineTransform implements Cloneable, Serializable {
         return false;
     }
 
-    
+
     /**
      * Write AffineTrasform object to the output steam.
      * @param stream - the output stream
@@ -564,12 +564,12 @@ public class AffineTransform implements Cloneable, Serializable {
         stream.defaultWriteObject();
     }
 
-    
+
     /**
      * Read AffineTransform object from the input stream
      * @param stream - the input steam
      * @throws IOException - if there are I/O errors while reading from the input strem
-     * @throws ClassNotFoundException - if class could not be found 
+     * @throws ClassNotFoundException - if class could not be found
      */
     private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
         stream.defaultReadObject();
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
index cd4ee2a91..4ee0c250d 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
@@ -29,17 +29,17 @@ public class Crossing {
      * Allowable tolerance for bounds comparison
      */
     static final float DELTA = (float) 1E-5;
-    
+
     /**
      * If roots have distance less then <code>ROOT_DELTA</code> they are double
      */
     static final float ROOT_DELTA = (float) 1E-10;
-    
+
     /**
      * Rectangle cross segment
      */
     public static final int CROSSING = 255;
-    
+
     /**
      * Unknown crossing result
      */
@@ -130,8 +130,8 @@ public class Crossing {
     }
 
     /**
-     * Excludes float roots. Roots are float if they lies enough close with each other. 
-     * @param res - the roots 
+     * Excludes float roots. Roots are float if they lies enough close with each other.
+     * @param res - the roots
      * @param rc - the roots count
      * @return new roots count
      */
@@ -384,12 +384,12 @@ public class Crossing {
 
         // START
         if (x == x1) {
-            return x1 < x2 ? 0 : -1;        
+            return x1 < x2 ? 0 : -1;
         }
-        
+
         // END
         if (x == x2) {
-            return x1 < x2 ? 1 : 0;        
+            return x1 < x2 ? 1 : 0;
         }
 
         // INSIDE-DOWN
@@ -493,10 +493,10 @@ public class Crossing {
                     }
                     break;
                 default:
-                    throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);                
+                    throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);
             }
-            
-            // checks if the point (x,y) is the vertex of shape with PathIterator p           
+
+            // checks if the point (x,y) is the vertex of shape with PathIterator p
             if (x == cx && y == cy) {
                 cross = 0;
                 cy = my;
@@ -554,9 +554,9 @@ public class Crossing {
             }
         }
     }
-    
+
     /**
-     * Returns are bounds intersect or not intersect rectangle 
+     * Returns are bounds intersect or not intersect rectangle
      */
     static int crossBound(float bound[], int bc, float py1, float py2) {
 
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
index 945eeceeb..c1ee17a4b 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
@@ -33,12 +33,12 @@ public final class Path2D implements Cloneable {
 
     static final String invalidWindingRuleValue = "Invalid winding rule value";
     static final String iteratorOutOfBounds = "Iterator out of bounds";
-    
+
     /**
      * The buffers size
      */
     private static final int BUFFER_SIZE = 10;
-    
+
     /**
      * The buffers capacity
      */
@@ -48,24 +48,24 @@ public final class Path2D implements Cloneable {
      * The point's types buffer
      */
     byte[] types;
-    
+
     /**
      * The points buffer
      */
     float[] points;
-    
+
     /**
      * The point's type buffer size
      */
     int typeSize;
-    
+
     /**
      * The points buffer size
      */
     int pointSize;
-    
+
     /**
-     * The path rule 
+     * The path rule
      */
     int rule;
 
@@ -80,7 +80,7 @@ public final class Path2D implements Cloneable {
             0}; // CLOSE
 
     /*
-     * GeneralPath path iterator 
+     * GeneralPath path iterator
      */
     class Iterator implements PathIterator {
 
@@ -88,17 +88,17 @@ public final class Path2D implements Cloneable {
          * The current cursor position in types buffer
          */
         int typeIndex;
-        
+
         /**
          * The current cursor position in points buffer
          */
         int pointIndex;
-        
+
         /**
          * The source GeneralPath object
          */
         Path2D p;
-        
+
         /**
          * The path iterator transformation
          */
@@ -183,7 +183,7 @@ public final class Path2D implements Cloneable {
     }
 
     /**
-     * Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.   
+     * Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.
      * @param pointCount - the point count to be added in buffer
      */
     void checkBuf(int pointCount, boolean checkMove) {
@@ -244,18 +244,18 @@ public final class Path2D implements Cloneable {
     final public int size() {
         return typeSize;
     }
-    
+
     final public boolean isClosed() {
         return typeSize > 0 && types[typeSize - 1] == PathIterator.SEG_CLOSE ;
     }
-    
+
     public void closePath() {
         if (!isClosed()) {
             checkBuf(0, true);
             types[typeSize++] = PathIterator.SEG_CLOSE;
         }
     }
-    
+
     public String toString() {
         return "[size "+size()+", closed "+isClosed()+"]";
     }
@@ -295,7 +295,7 @@ public final class Path2D implements Cloneable {
                     closePath();
                     break;
                 default:
-                    throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);                
+                    throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);
             }
             path.next();
             connect = false;
@@ -366,9 +366,9 @@ public final class Path2D implements Cloneable {
     }
 
     /**
-     * Checks cross count according to path rule to define is it point inside shape or not. 
+     * Checks cross count according to path rule to define is it point inside shape or not.
      * @param cross - the point cross count
-     * @return true if point is inside path, or false otherwise 
+     * @return true if point is inside path, or false otherwise
      */
     boolean isInside(int cross) {
         if (rule == WIND_NON_ZERO) {
@@ -396,7 +396,7 @@ public final class Path2D implements Cloneable {
     }
 
     public boolean contains(AABBox r) {
-        return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());   
+        return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
     }
 
     public boolean intersects(AABBox r) {
@@ -404,9 +404,9 @@ public final class Path2D implements Cloneable {
     }
 
     public PathIterator iterator() {
-        return new Iterator(this);        
+        return new Iterator(this);
     }
-       
+
     public PathIterator iterator(AffineTransform t) {
         return new Iterator(this, t);
     }
diff --git a/src/jogl/classes/jogamp/opengl/Debug.java b/src/jogl/classes/jogamp/opengl/Debug.java
index b88a09b71..74892d894 100644
--- a/src/jogl/classes/jogamp/opengl/Debug.java
+++ b/src/jogl/classes/jogamp/opengl/Debug.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -51,14 +51,14 @@ public class Debug extends PropertyAccess {
   // Some common properties
   private static final boolean verbose;
   private static final boolean debugAll;
-  
+
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
         public Object run() {
             PropertyAccess.addTrustedPrefix("jogl.");
             return null;
     } } );
-    
+
     verbose = isPropertyDefined("jogl.verbose", true);
     debugAll = isPropertyDefined("jogl.debug", true);
     if (verbose) {
@@ -68,7 +68,7 @@ public class Debug extends PropertyAccess {
        System.err.println("JOGL implementation vendor " + p.getImplementationVendor());
     }
   }
-  
+
   /** Ensures static init block has been issues, i.e. if calling through to {@link PropertyAccess#isPropertyDefined(String, boolean)}. */
   public static final void initSingleton() {}
 
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
index ef9477a31..578f416b7 100644
--- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl;
 
 import java.util.List;
@@ -47,11 +47,11 @@ public abstract class DesktopGLDynamicLibraryBundleInfo extends GLDynamicLibrary
     public final List<String> getGlueLibNames() {
         return glueLibNames;
     }
-    
+
     @Override
     public final boolean useToolGetProcAdressFirst(String funcName) {
         return true;
     }
-    
+
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
index 8eb3468ed..a1023acd2 100644
--- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl;
 
 import com.jogamp.common.os.NativeLibrary;
diff --git a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
index 94acf93b0..b8bcd2e78 100644
--- a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
+++ b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -59,7 +59,7 @@ final class ExtensionAvailabilityCache {
   }
 
   /**
-   * Flush the cache. 
+   * Flush the cache.
    */
   final void flush()
   {
@@ -87,7 +87,7 @@ final class ExtensionAvailabilityCache {
     validateInitialization();
     return availableExtensionCache.size();
   }
-  
+
   final boolean isExtensionAvailable(String glExtensionName) {
     validateInitialization();
     return availableExtensionCache.contains(glExtensionName);
@@ -97,7 +97,7 @@ final class ExtensionAvailabilityCache {
     validateInitialization();
     return glXExtensionCount;
   }
-  
+
   final String getPlatformExtensionsString() {
     validateInitialization();
     return glXExtensions;
@@ -107,7 +107,7 @@ final class ExtensionAvailabilityCache {
     validateInitialization();
     return glExtensionCount;
   }
-  
+
   final String getGLExtensionsString() {
     validateInitialization();
     if(DEBUG) {
@@ -151,7 +151,7 @@ final class ExtensionAvailabilityCache {
                   ", use "+ ( useGetStringi ? "glGetStringi" : "glGetString" ) );
       }
 
-      HashSet<String> glExtensionSet = new HashSet<String>(gl.isGLES() ? 50 : 320); // far less gl extension expected on mobile 
+      HashSet<String> glExtensionSet = new HashSet<String>(gl.isGLES() ? 50 : 320); // far less gl extension expected on mobile
       if(useGetStringi) {
           GL2GL3 gl2gl3 = gl.getGL2GL3();
           final int count;
@@ -163,7 +163,7 @@ final class ExtensionAvailabilityCache {
           StringBuilder sb = new StringBuilder();
           for (int i = 0; i < count; i++) {
               if(i > 0) {
-                  sb.append(" ");                
+                  sb.append(" ");
               }
               final String ext = gl2gl3.glGetStringi(GL.GL_EXTENSIONS, i);
               glExtensionSet.add(ext);
@@ -185,7 +185,7 @@ final class ExtensionAvailabilityCache {
               }
           }
       }
-      glExtensionCount = glExtensionSet.size(); 
+      glExtensionCount = glExtensionSet.size();
       if (DEBUG) {
           System.err.println(getThreadName() + ":ExtensionAvailabilityCache: GL_EXTENSIONS: "+glExtensionCount+
                                                ", used "+ ( useGetStringi ? "glGetStringi" : "glGetString" ) );
@@ -193,17 +193,17 @@ final class ExtensionAvailabilityCache {
 
       // Platform Extensions
       HashSet<String> glXExtensionSet = new HashSet<String>(50);
-      {         
-          // unify platform extension .. might have duplicates          
+      {
+          // unify platform extension .. might have duplicates
           StringTokenizer tok = new StringTokenizer(context.getPlatformExtensionsStringImpl().toString());
           while (tok.hasMoreTokens()) {
-              glXExtensionSet.add(tok.nextToken().trim());              
+              glXExtensionSet.add(tok.nextToken().trim());
           }
           final StringBuilder sb = new StringBuilder();
           for(Iterator<String> iter = glXExtensionSet.iterator(); iter.hasNext(); ) {
               sb.append(iter.next());
               if(iter.hasNext()) {
-                  sb.append(" ");                
+                  sb.append(" ");
               }
           }
           glXExtensions = sb.toString();
@@ -222,7 +222,7 @@ final class ExtensionAvailabilityCache {
       final int ctxOptions = context.getCtxOptions();
       final VersionNumber version = context.getGLVersionNumber();
       int major[] = new int[] { version.getMajor() };
-      int minor[] = new int[] { version.getMinor() };          
+      int minor[] = new int[] { version.getMinor() };
       while (GLContext.isValidGLVersion(ctxOptions, major[0], minor[0])) {
           final String GL_XX_VERSION = ( context.isGLES() ? "GL_ES_VERSION_" : "GL_VERSION_" ) + major[0] + "_" + minor[0];
           availableExtensionCache.add(GL_XX_VERSION);
diff --git a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
index b74ac9f41..c96f7db32 100644
--- a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
+++ b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
@@ -41,39 +41,39 @@ public class FPSCounterImpl implements FPSCounter {
     private long fpsStartTime, fpsLastUpdateTime, fpsLastPeriod, fpsTotalDuration;
     private int  fpsTotalFrames;
     private float fpsLast, fpsTotal;
-    
+
     /** Creates a disabled instance */
     public FPSCounterImpl() {
         setUpdateFPSFrames(0, null);
     }
-    
+
     /**
      * Increases total frame count and updates values if feature is enabled and
      * update interval is reached.<br>
-     * 
+     *
      * Shall be called by actual FPSCounter implementing renderer, after display a new frame.
-     *  
+     *
      */
     public final synchronized void tickFPS() {
         fpsTotalFrames++;
         if(fpsUpdateFramesInterval>0 && fpsTotalFrames%fpsUpdateFramesInterval == 0) {
             final long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
             fpsLastPeriod = now - fpsLastUpdateTime;
-            fpsLastPeriod = Math.max(fpsLastPeriod, 1); // div 0 
-            fpsLast = ( (float)fpsUpdateFramesInterval * 1000f ) / ( (float) fpsLastPeriod ) ; 
-            
+            fpsLastPeriod = Math.max(fpsLastPeriod, 1); // div 0
+            fpsLast = ( (float)fpsUpdateFramesInterval * 1000f ) / ( (float) fpsLastPeriod ) ;
+
             fpsTotalDuration = now - fpsStartTime;
             fpsTotalDuration = Math.max(fpsTotalDuration, 1); // div 0
             fpsTotal= ( (float)fpsTotalFrames * 1000f ) / ( (float) fpsTotalDuration ) ;
-            
+
             if(null != fpsOutputStream) {
                 fpsOutputStream.println(toString());
             }
-            
+
             fpsLastUpdateTime = now;
         }
     }
-    
+
     public StringBuilder toString(StringBuilder sb) {
         if(null==sb) {
             sb = new StringBuilder();
@@ -81,22 +81,22 @@ public class FPSCounterImpl implements FPSCounter {
         String fpsLastS = String.valueOf(fpsLast);
         fpsLastS = fpsLastS.substring(0, fpsLastS.indexOf('.') + 2);
         String fpsTotalS = String.valueOf(fpsTotal);
-        fpsTotalS = fpsTotalS.substring(0, fpsTotalS.indexOf('.') + 2);                
+        fpsTotalS = fpsTotalS.substring(0, fpsTotalS.indexOf('.') + 2);
         sb.append(fpsTotalDuration/1000 +" s: "+ fpsUpdateFramesInterval+" f / "+ fpsLastPeriod+" ms, " + fpsLastS+" fps, "+ fpsLastPeriod/fpsUpdateFramesInterval+" ms/f; "+
                   "total: "+ fpsTotalFrames+" f, "+ fpsTotalS+ " fps, "+ fpsTotalDuration/fpsTotalFrames+" ms/f");
         return sb;
     }
-    
+
     public String toString() {
         return toString(null).toString();
     }
-    
+
     public final synchronized void setUpdateFPSFrames(int frames, PrintStream out) {
         fpsUpdateFramesInterval = frames;
         fpsOutputStream = out;
         resetFPSCounter();
     }
-    
+
     public final synchronized void resetFPSCounter() {
         fpsStartTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); // overwrite startTime to real init one
         fpsLastUpdateTime   = fpsStartTime;
@@ -109,9 +109,9 @@ public class FPSCounterImpl implements FPSCounter {
     public final synchronized int getUpdateFPSFrames() {
         return fpsUpdateFramesInterval;
     }
-    
-    public final synchronized long getFPSStartTime()   { 
-        return fpsStartTime; 
+
+    public final synchronized long getFPSStartTime()   {
+        return fpsStartTime;
     }
 
     public final synchronized long getLastFPSUpdateTime() {
@@ -121,20 +121,20 @@ public class FPSCounterImpl implements FPSCounter {
     public final synchronized long getLastFPSPeriod() {
         return fpsLastPeriod;
     }
-    
+
     public final synchronized float getLastFPS() {
         return fpsLast;
     }
-    
-    public final synchronized int getTotalFPSFrames() { 
-        return fpsTotalFrames; 
+
+    public final synchronized int getTotalFPSFrames() {
+        return fpsTotalFrames;
     }
 
-    public final synchronized long getTotalFPSDuration() { 
-        return fpsTotalDuration; 
+    public final synchronized long getTotalFPSDuration() {
+        return fpsTotalDuration;
     }
-    
+
     public final synchronized float getTotalFPS() {
         return fpsTotal;
-    }        
+    }
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
index f8b453555..bb2983399 100644
--- a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
+++ b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl;
 
 import java.io.PrintStream;
@@ -56,7 +56,7 @@ import com.jogamp.opengl.GLStateKeeper;
 
 /**
  * Abstract common code for GLAutoDrawable implementations.
- * 
+ *
  * @see GLAutoDrawable
  * @see GLAutoDrawableDelegate
  * @see GLPBufferImpl
@@ -64,10 +64,10 @@ import com.jogamp.opengl.GLStateKeeper;
  */
 public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeeper, FPSCounter {
     public static final boolean DEBUG = GLDrawableImpl.DEBUG;
-    
+
     protected final GLDrawableHelper helper = new GLDrawableHelper();
     protected final FPSCounterImpl fpsCounter = new FPSCounterImpl();
-    
+
     protected volatile GLDrawableImpl drawable; // volatile: avoid locking for read-only access
     protected GLContextImpl context;
     protected boolean preserveGLELSAtDestroy;
@@ -79,9 +79,9 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     protected volatile boolean sendDestroy = false; // volatile: maybe written by WindowManager thread w/o locking
 
     /**
-     * @param drawable upstream {@link GLDrawableImpl} instance, 
+     * @param drawable upstream {@link GLDrawableImpl} instance,
      *                 may be <code>null</code> for lazy initialization
-     * @param context upstream {@link GLContextImpl} instance, 
+     * @param context upstream {@link GLContextImpl} instance,
      *                may not have been made current (created) yet,
      *                may not be associated w/ <code>drawable<code> yet,
      *                may be <code>null</code> for lazy initialization
@@ -100,19 +100,19 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         if(null != context && null != drawable) {
             context.setGLDrawable(drawable, false);
         }
-        resetFPSCounter();        
+        resetFPSCounter();
     }
-   
-    /** Returns the recursive lock object of the upstream implementation, which synchronizes multithreaded access on top of {@link NativeSurface#lockSurface()}. */ 
+
+    /** Returns the recursive lock object of the upstream implementation, which synchronizes multithreaded access on top of {@link NativeSurface#lockSurface()}. */
     protected abstract RecursiveLock getLock();
 
     @Override
     public final GLStateKeeper.Listener setGLStateKeeperListener(Listener l) {
         final GLStateKeeper.Listener pre = glStateKeeperListener;
         glStateKeeperListener = l;
-        return pre;        
+        return pre;
     }
-    
+
     @Override
     public final boolean preserveGLStateAtDestroy(boolean value) {
         final boolean res = isGLStatePreservationSupported() ? true : false;
@@ -125,10 +125,10 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         }
         return res;
     }
-    
+
     @Override
     public boolean isGLStatePreservationSupported() { return false; }
-    
+
     @Override
     public final GLEventListenerState getPreservedGLState() {
         return glels;
@@ -140,20 +140,20 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         glels = null;
         return r;
     }
-    
+
     /**
      * Pulls the {@link GLEventListenerState} from this {@link GLAutoDrawable}.
-     * 
+     *
      * @return <code>true</code> if the {@link GLEventListenerState} is pulled successfully from this {@link GLAutoDrawable},
      *         otherwise <code>false</code>.
-     * 
+     *
      * @throws IllegalStateException if the {@link GLEventListenerState} is already pulled
-     * 
+     *
      * @see #pushGLEventListenerState()
      */
     protected final boolean pullGLEventListenerState() throws IllegalStateException {
         if( null != glels ) {
-            throw new IllegalStateException("GLEventListenerState already pulled");            
+            throw new IllegalStateException("GLEventListenerState already pulled");
         }
         if( null != context && context.isCreated() ) {
             if( null!= glStateKeeperListener) {
@@ -164,14 +164,14 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         }
         return false;
     }
-    
+
     /**
      * Pushes a previously {@link #pullGLEventListenerState() pulled} {@link GLEventListenerState} to this {@link GLAutoDrawable}.
-     * 
-     * @return <code>true</code> if the {@link GLEventListenerState} was previously {@link #pullGLEventListenerState() pulled} 
+     *
+     * @return <code>true</code> if the {@link GLEventListenerState} was previously {@link #pullGLEventListenerState() pulled}
      *         and is pushed successfully to this {@link GLAutoDrawable},
      *         otherwise <code>false</code>.
-     * 
+     *
      * @see #pullGLEventListenerState()
      */
     protected final boolean pushGLEventListenerState() {
@@ -180,12 +180,12 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             glels = null;
             if( null!= glStateKeeperListener) {
                 glStateKeeperListener.glStateRestored(this);
-            }            
+            }
             return true;
         }
-        return false;        
+        return false;
     }
-    
+
     /** Default implementation to handle repaint events from the windowing system */
     protected final void defaultWindowRepaintOp() {
         final GLDrawable _drawable = drawable;
@@ -195,7 +195,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             }
         }
     }
-    
+
     /** Default implementation to handle resize events from the windowing system. All required locks are being claimed. */
     protected final void defaultWindowResizedOp(int newWidth, int newHeight) throws NativeWindowException, GLException {
         GLDrawableImpl _drawable = drawable;
@@ -210,7 +210,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
                 try {
                     final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, newWidth, newHeight);
                     if(_drawable != _drawableNew) {
-                        // write back 
+                        // write back
                         _drawable = _drawableNew;
                         drawable = _drawableNew;
                     }
@@ -226,15 +226,15 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             }
         }
     }
-    
-    /** 
+
+    /**
      * Default implementation to handle destroy notifications from the windowing system.
-     * 
+     *
      * <p>
-     * If the {@link NativeSurface} does not implement {@link WindowClosingProtocol} 
+     * If the {@link NativeSurface} does not implement {@link WindowClosingProtocol}
      * or {@link WindowClosingMode#DISPOSE_ON_CLOSE} is enabled (default),
      * a thread safe destruction is being induced.
-     * </p> 
+     * </p>
      */
     protected final void defaultWindowDestroyNotifyOp() {
         final NativeSurface ns = getNativeSurface();
@@ -243,22 +243,22 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             shallClose = WindowClosingMode.DISPOSE_ON_CLOSE == ((WindowClosingProtocol)ns).getDefaultCloseOperation();
         } else {
             shallClose = true;
-        }        
+        }
         if( shallClose ) {
             destroyAvoidAwareOfLocking();
-        }                
+        }
     }
 
     /**
-     * Calls {@link #destroy()} 
+     * Calls {@link #destroy()}
      * directly if the following requirements are met:
      * <ul>
-     *   <li>An {@link GLAnimatorControl} is bound (see {@link #getAnimator()}) and running on another thread. 
+     *   <li>An {@link GLAnimatorControl} is bound (see {@link #getAnimator()}) and running on another thread.
      *       Here we pause the animation while issuing the destruction.</li>
      *   <li>Surface is not locked by another thread (considered anonymous).</li>
      * </ul>
      * <p>
-     * Otherwise destroy is being flagged to be called within the next 
+     * Otherwise destroy is being flagged to be called within the next
      * call of display().
      * </p>
      * <p>
@@ -270,9 +270,9 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
      */
     protected final void destroyAvoidAwareOfLocking() {
         final NativeSurface ns = getNativeSurface();
-        
+
         final GLAnimatorControl ctrl = helper.getAnimator();
-        
+
         // Is an animator thread perform rendering?
         if ( helper.isAnimatorStartedOnOtherThread() ) {
             // Pause animations before initiating safe destroy.
@@ -292,7 +292,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             destroy();
         }
     }
-    
+
     /**
      * Calls {@link #destroyImplInLock()} while claiming the lock.
      */
@@ -305,7 +305,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             lock.unlock();
         }
     }
-    
+
     /**
      * Default implementation to destroys the drawable and context of this GLAutoDrawable:
      * <ul>
@@ -323,7 +323,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             pullGLEventListenerState();
         }
         if( null != context ) {
-            if( context.isCreated() ) {        
+            if( context.isCreated() ) {
                 // Catch dispose GLExceptions by GLEventListener, just 'print' them
                 // so we can continue with the destruction.
                 try {
@@ -341,9 +341,9 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             if( ownsDevice ) {
                 device.close();
             }
-        }        
+        }
     }
-    
+
     public final void defaultSwapBuffers() throws GLException {
         final RecursiveLock _lock = getLock();
         _lock.lock();
@@ -359,7 +359,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     //
     // GLAutoDrawable
     //
-    
+
     protected final Runnable defaultInitAction = new Runnable() {
         @Override
         public final void run() {
@@ -397,7 +397,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             _lock.unlock();
         }
     }
-        
+
     protected final GLEventListener defaultDisposeGLEventListener(GLEventListener listener, boolean remove) {
         final RecursiveLock _lock = getLock();
         _lock.lock();
@@ -405,14 +405,14 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             return helper.disposeGLEventListener(GLAutoDrawableBase.this, drawable, context, listener, remove);
         } finally {
             _lock.unlock();
-        }        
+        }
     }
-    
+
     @Override
     public final GLDrawable getDelegatedDrawable() {
         return drawable;
     }
-    
+
     @Override
     public final GLContext getContext() {
         return context;
@@ -458,7 +458,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
 
     @Override
     public final void addGLEventListener(int index, GLEventListener listener) throws IndexOutOfBoundsException {
-        helper.addGLEventListener(index, listener);        
+        helper.addGLEventListener(index, listener);
     }
 
     @Override
@@ -480,21 +480,21 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
         helper.setGLEventListenerInitState(listener, initialized);
     }
-   
+
     @Override
     public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
         return defaultDisposeGLEventListener(listener, remove);
     }
-    
+
     @Override
     public final GLEventListener removeGLEventListener(GLEventListener listener) {
-        return helper.removeGLEventListener(listener);        
+        return helper.removeGLEventListener(listener);
     }
-    
+
     @Override
     public final void setAnimator(GLAnimatorControl animatorControl)
             throws GLException {
-        helper.setAnimator(animatorControl);        
+        helper.setAnimator(animatorControl);
     }
 
     @Override
@@ -511,20 +511,20 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     public final Thread getExclusiveContextThread() {
         return helper.getExclusiveContextThread();
     }
-    
+
     @Override
     public final boolean invoke(boolean wait, GLRunnable glRunnable) {
-        return helper.invoke(this, wait, glRunnable);        
+        return helper.invoke(this, wait, glRunnable);
     }
 
     @Override
     public boolean invoke(final boolean wait, final List<GLRunnable> glRunnables) {
         return helper.invoke(this, wait, glRunnables);
     }
-    
+
     @Override
     public final void setAutoSwapBufferMode(boolean enable) {
-        helper.setAutoSwapBufferMode(enable);        
+        helper.setAutoSwapBufferMode(enable);
     }
 
     @Override
@@ -534,7 +534,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
 
     @Override
     public final void setContextCreationFlags(int flags) {
-        additionalCtxCreationFlags = flags;        
+        additionalCtxCreationFlags = flags;
         final GLContext _context = context;
         if(null != _context) {
             _context.setContextCreationFlags(additionalCtxCreationFlags);
@@ -549,7 +549,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     //
     // FPSCounter
     //
-    
+
     @Override
     public final void setUpdateFPSFrames(int frames, PrintStream out) {
         fpsCounter.setUpdateFPSFrames(frames, out);
@@ -599,11 +599,11 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     public final float getTotalFPS() {
         return fpsCounter.getTotalFPS();
     }
-    
+
     //
     // GLDrawable delegation
     //
-        
+
     @Override
     public final GLContext createContext(final GLContext shareWith) {
         final RecursiveLock lock = getLock();
@@ -624,10 +624,10 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     public final void setRealized(boolean realized) {
         final RecursiveLock _lock = getLock();
         _lock.lock();
-        try {            
+        try {
             final GLDrawable _drawable = drawable;
             if( null == _drawable || realized && ( 0 >= _drawable.getWidth() || 0 >= _drawable.getHeight() ) ) {
-                return; 
+                return;
             }
             _drawable.setRealized(realized);
             if( realized && _drawable.isRealized() ) {
@@ -637,7 +637,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             _lock.unlock();
         }
     }
-    
+
     @Override
     public final boolean isRealized() {
         final GLDrawable _drawable = drawable;
@@ -661,7 +661,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         final GLDrawable _drawable = drawable;
         return null != _drawable ? _drawable.isGLOriented() : true;
     }
-  
+
     @Override
     public final GLCapabilitiesImmutable getChosenGLCapabilities() {
         final GLDrawable _drawable = drawable;
@@ -685,7 +685,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         final GLDrawable _drawable = drawable;
         return null != _drawable ? _drawable.getHandle() : 0;
     }
-    
+
     protected static String getThreadName() { return Thread.currentThread().getName(); }
 
     @Override
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
index 17646cc7b..73a864304 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -93,7 +93,7 @@ public class GLBufferSizeTracker {
       Debug.initSingleton();
       DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferSizeTracker", true);
   }
-  
+
   // Map from buffer names to sizes.
   // Note: should probably have some way of shrinking this map, but
   // can't just make it a WeakHashMap because nobody holds on to the
@@ -102,7 +102,7 @@ public class GLBufferSizeTracker {
   // pattern of buffer objects indicates that the fact that this map
   // never shrinks is probably not that bad.
   private IntLongHashMap bufferSizeMap;
-  
+
   public GLBufferSizeTracker() {
       bufferSizeMap = new IntLongHashMap();
       bufferSizeMap.setKeyNotFoundValue(0xFFFFFFFFFFFFFFFFL);
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
index f14d16ec4..cd9eea287 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -50,7 +50,7 @@ import com.jogamp.common.util.IntIntHashMap;
  * This class is used to verify that e.g. the vertex
  * buffer object extension is in use when the glVertexPointer variant
  * taking a long as argument is called. <P>
- * 
+ *
  * Note that because the enumerated value used for the binding of a
  * buffer object (e.g. GL_ARRAY_BUFFER) is different than that used to
  * query the binding using glGetIntegerv (e.g.
@@ -77,16 +77,16 @@ import com.jogamp.common.util.IntIntHashMap;
 
 public class GLBufferStateTracker {
   protected static final boolean DEBUG;
-  
+
   static {
       Debug.initSingleton();
       DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferStateTracker", true);
   }
-  
+
   // Maps binding targets to buffer objects. A null value indicates
   // that the binding is unknown. A zero value indicates that it is
-  // known that no buffer is bound to the target, according to the 
-  // OpenGL specifications. 
+  // known that no buffer is bound to the target, according to the
+  // OpenGL specifications.
   // http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml
   private IntIntHashMap bindingMap;
 
@@ -108,7 +108,7 @@ public class GLBufferStateTracker {
   public final void setBoundBufferObject(int target, int value) {
     bindingMap.put(target, value);
     if (DEBUG) {
-      System.err.println("GLBufferStateTracker.setBoundBufferObject() target 0x" + 
+      System.err.println("GLBufferStateTracker.setBoundBufferObject() target 0x" +
                          Integer.toHexString(target) + " -> mapped bound buffer 0x" +
                          Integer.toHexString(value));
       // Thread.dumpStack();
@@ -146,7 +146,7 @@ public class GLBufferStateTracker {
             value = 0;
         }
         if (DEBUG) {
-          System.err.println("GLBufferStateTracker.getBoundBufferObject() glerr[pre 0x"+Integer.toHexString(glerrPre)+", post 0x"+Integer.toHexString(glerrPost)+"], [queried value]: target 0x" + 
+          System.err.println("GLBufferStateTracker.getBoundBufferObject() glerr[pre 0x"+Integer.toHexString(glerrPre)+", post 0x"+Integer.toHexString(glerrPost)+"], [queried value]: target 0x" +
                              Integer.toHexString(target) + " / query 0x"+Integer.toHexString(queryTarget)+
                              " -> mapped bound buffer 0x" + Integer.toHexString(value));
         }
@@ -156,7 +156,7 @@ public class GLBufferStateTracker {
       return 0;
     }
     if (DEBUG) {
-      System.err.println("GLBufferStateTracker.getBoundBufferObject() [mapped value]: target 0x" + 
+      System.err.println("GLBufferStateTracker.getBoundBufferObject() [mapped value]: target 0x" +
                          Integer.toHexString(target) + " -> mapped bound buffer 0x" +
                          Integer.toHexString(value));
     }
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 7f9f20a21..7c3a5922b 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -106,14 +106,14 @@ public abstract class GLContextImpl extends GLContext {
   private final GLStateTracker glStateTracker = new GLStateTracker();
   private GLDebugMessageHandler glDebugHandler = null;
   private final int[] boundFBOTarget = new int[] { 0, 0 }; // { draw, read }
-  private int defaultVAO = 0; 
-  
+  private int defaultVAO = 0;
+
   protected GLDrawableImpl drawable;
   protected GLDrawableImpl drawableRead;
-  
+
   private volatile boolean pixelDataEvaluated;
   private int /* pixelDataInternalFormat, */ pixelDataFormat, pixelDataType;
-  
+
   protected GL gl;
 
   protected static final Object mappedContextTypeObjectLock;
@@ -161,7 +161,7 @@ public abstract class GLContextImpl extends GLContext {
       glStateTracker.setEnabled(false);
       glStateTracker.clearStates();
   }
-  
+
   @Override
   protected void resetStates(boolean isInit) {
       if( !isInit ) {
@@ -177,12 +177,12 @@ public abstract class GLContextImpl extends GLContext {
       glRenderer = glVendor;
       glRendererLowerCase = glRenderer;
       glVersion = glVendor;
-      
+
       if (boundFBOTarget != null) { // <init>
           boundFBOTarget[0] = 0; // draw
           boundFBOTarget[1] = 0; // read
       }
-      
+
       pixelDataEvaluated = false;
 
       super.resetStates(isInit);
@@ -190,7 +190,7 @@ public abstract class GLContextImpl extends GLContext {
 
   @Override
   public final GLDrawable setGLReadDrawable(GLDrawable read) {
-    if(!isGLReadDrawableAvailable()) { 
+    if(!isGLReadDrawableAvailable()) {
         throw new GLException("Setting read drawable feature not available");
     }
     final boolean lockHeld = lock.isOwner(Thread.currentThread());
@@ -220,7 +220,7 @@ public abstract class GLContextImpl extends GLContext {
     final Thread currentThread = Thread.currentThread();
     if( lock.isLockedByOtherThread() ) {
         throw new GLException("GLContext current by other thread "+lock.getOwner().getName()+", operation not allowed on this thread "+currentThread.getName());
-    }    
+    }
     final boolean lockHeld = lock.isOwner(currentThread);
     if( lockHeld && lock.getHoldCount() > 1 ) {
         // would need to makeCurrent * holdCount
@@ -272,7 +272,7 @@ public abstract class GLContextImpl extends GLContext {
       }
       return _gl;
   }
-  
+
   @Override
   public final GL getGL() {
     return gl;
@@ -314,7 +314,7 @@ public abstract class GLContextImpl extends GLContext {
   @Override
   public void release() throws GLException {
     release(false);
-  }  
+  }
   private void release(boolean inDestruction) throws GLException {
     if( TRACE_SWITCH ) {
         System.err.println(getThreadName() +": GLContext.ContextSwitch[release.0]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+", inDestruction: "+inDestruction+", "+lock);
@@ -332,7 +332,7 @@ public abstract class GLContextImpl extends GLContext {
         }
         throw new GLException(msg);
     }
-    
+
     Throwable drawableContextMadeCurrentException = null;
     final boolean actualRelease = ( inDestruction || lock.getHoldCount() == 1 ) && 0 != contextHandle;
     try {
@@ -365,7 +365,7 @@ public abstract class GLContextImpl extends GLContext {
     if(null != drawableContextMadeCurrentException) {
       throw new GLException("GLContext.release(false) during GLDrawableImpl.contextMadeCurrent(this, false)", drawableContextMadeCurrentException);
     }
-    
+
   }
   private Throwable lastCtxReleaseStack = null;
   protected abstract void releaseImpl() throws GLException;
@@ -518,21 +518,21 @@ public abstract class GLContextImpl extends GLContext {
   public final int makeCurrent() throws GLException {
       return makeCurrent(false);
   }
-  
+
   protected final int makeCurrent(boolean forceDrawableAssociation) throws GLException {
     if( TRACE_SWITCH ) {
         System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.0]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - "+lock);
-    }      
+    }
 
     // Note: the surface is locked within [makeCurrent .. swap .. release]
     final int lockRes = drawable.lockSurface();
     if (NativeSurface.LOCK_SURFACE_NOT_READY >= lockRes) {
         if( DEBUG_TRACE_SWITCH ) {
-            System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X1]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - Surface Not Ready - CONTEXT_NOT_CURRENT - "+lock);                        
+            System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X1]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - Surface Not Ready - CONTEXT_NOT_CURRENT - "+lock);
         }
         return CONTEXT_NOT_CURRENT;
     }
-    
+
     boolean unlockResources = true; // Must be cleared if successful, otherwise finally block will release context and/or surface!
     int res = CONTEXT_NOT_CURRENT;
     try {
@@ -552,7 +552,7 @@ public abstract class GLContextImpl extends GLContext {
                         drawableUpdatedNotify();
                         unlockResources = false; // success
                         if( TRACE_SWITCH ) {
-                            System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X2]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - keep   - CONTEXT_CURRENT - "+lock);                        
+                            System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X2]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - keep   - CONTEXT_CURRENT - "+lock);
                         }
                         return CONTEXT_CURRENT;
                     } else {
@@ -561,7 +561,7 @@ public abstract class GLContextImpl extends GLContext {
                 }
                 res = makeCurrentWithinLock(lockRes);
                 unlockResources = CONTEXT_NOT_CURRENT == res; // success ?
-                
+
                 /**
                  * FIXME: refactor dependence on Java 2D / JOGL bridge
                     if ( tracker != null && res == CONTEXT_CURRENT_NEW ) {
@@ -608,16 +608,16 @@ public abstract class GLContextImpl extends GLContext {
         if(TRACE_GL) {
             gl = gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, gl, new Object[] { System.err } ) );
         }
-        
+
         forceDrawableAssociation = true;
       }
-      
+
       if( forceDrawableAssociation ) {
           associateDrawable(true);
       }
-      
+
       contextMadeCurrent(true);
-      
+
       /* FIXME: refactor dependence on Java 2D / JOGL bridge
 
       // Try cleaning up any stale server-side OpenGL objects
@@ -629,10 +629,10 @@ public abstract class GLContextImpl extends GLContext {
     }
     if( TRACE_SWITCH ) {
         System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X3]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - switch - "+makeCurrentResultToString(res)+" - stateTracker.on "+glStateTracker.isEnabled()+" - "+lock);
-    }      
+    }
     return res;
   }
-  
+
   private final int makeCurrentWithinLock(int surfaceLockRes) throws GLException {
       if (!isCreated()) {
         if( 0 >= drawable.getWidth() || 0 >= drawable.getHeight() ) {
@@ -683,7 +683,7 @@ public abstract class GLContextImpl extends GLContext {
             final AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
             final AbstractGraphicsDevice device = config.getScreen().getDevice();
 
-            // Non ARB desktop profiles may not have been registered 
+            // Non ARB desktop profiles may not have been registered
             if( !GLContext.getAvailableGLVersionsSet(device) ) {        // not yet set
                 if( 0 == ( ctxOptions & GLContext.CTX_PROFILE_ES) ) {   // not ES profile
                     final int reqMajor;
@@ -701,10 +701,10 @@ public abstract class GLContextImpl extends GLContext {
                     GLContext.mapAvailableGLVersion(device, reqMajor, reqProfile,
                                                     ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
                     GLContext.setAvailableGLVersionsSet(device);
-                    
+
                     if (DEBUG) {
                       System.err.println(getThreadName() + ": createContextOLD-MapVersionsAvailable HAVE: " + device+" -> "+reqMajor+"."+reqProfile+ " -> "+getGLVersion());
-                    }                    
+                    }
                 }
             }
         }
@@ -717,17 +717,17 @@ public abstract class GLContextImpl extends GLContext {
   protected abstract void makeCurrentImpl() throws GLException;
 
   /**
-   * Calls {@link GLDrawableImpl#associateContext(GLContext, boolean)} 
-   */ 
-  protected void associateDrawable(boolean bound) { 
-      drawable.associateContext(this, bound);      
+   * Calls {@link GLDrawableImpl#associateContext(GLContext, boolean)}
+   */
+  protected void associateDrawable(boolean bound) {
+      drawable.associateContext(this, bound);
   }
-  
+
   /**
-   * Calls {@link GLDrawableImpl#contextMadeCurrent(GLContext, boolean)} 
-   */ 
+   * Calls {@link GLDrawableImpl#contextMadeCurrent(GLContext, boolean)}
+   */
   protected void contextMadeCurrent(boolean current) {
-      drawable.contextMadeCurrent(this, current);      
+      drawable.contextMadeCurrent(this, current);
   }
 
   /**
@@ -827,7 +827,7 @@ public abstract class GLContextImpl extends GLContext {
     final GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
     final int[] reqMajorCTP = new int[] { 0, 0 };
     getRequestMajorAndCompat(glCaps.getGLProfile(), reqMajorCTP);
-    
+
     int _major[] = { 0 };
     int _minor[] = { 0 };
     int _ctp[] = { 0 };
@@ -842,7 +842,7 @@ public abstract class GLContextImpl extends GLContext {
     }
     return _ctx;
   }
-  
+
   private final boolean mapGLVersions(AbstractGraphicsDevice device) {
     synchronized (GLContext.deviceVersionAvailable) {
         final long t0 = ( DEBUG ) ? System.nanoTime() : 0;
@@ -854,7 +854,7 @@ public abstract class GLContextImpl extends GLContext {
         boolean hasGL4   = false;
         boolean hasGL3   = false;
         boolean hasES3   = false;
-        
+
         // Even w/ PROFILE_ALIASING, try to use true core GL profiles
         // ensuring proper user behavior across platforms due to different feature sets!
         //
@@ -863,7 +863,7 @@ public abstract class GLContextImpl extends GLContext {
             success |= hasGL4;
             if(hasGL4) {
                 // Map all lower compatible profiles: GL3
-                GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);                
+                GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
                 if(PROFILE_ALIASING) {
                     hasGL3   = true;
                 }
@@ -874,7 +874,7 @@ public abstract class GLContextImpl extends GLContext {
             hasGL3   = createContextARBMapVersionsAvailable(3, CTX_PROFILE_CORE);    // GL3
             success |= hasGL3;
             if(hasGL3) {
-                resetStates(false); // clean this context states, since creation was temporary                
+                resetStates(false); // clean this context states, since creation was temporary
             }
         }
         if(!hasGL4bc) {
@@ -919,14 +919,14 @@ public abstract class GLContextImpl extends GLContext {
             hasGL2   = createContextARBMapVersionsAvailable(2, CTX_PROFILE_COMPAT);  // GL2
             success |= hasGL2;
             if(hasGL2) {
-                resetStates(false); // clean this context states, since creation was temporary                
+                resetStates(false); // clean this context states, since creation was temporary
             }
         }
         if(!hasES3) {
             hasES3   = createContextARBMapVersionsAvailable(3, CTX_PROFILE_ES);  // ES3
             success |= hasES3;
             if(hasES3) {
-                resetStates(false); // clean this context states, since creation was temporary                
+                resetStates(false); // clean this context states, since creation was temporary
             }
         }
         if(success) {
@@ -935,7 +935,7 @@ public abstract class GLContextImpl extends GLContext {
             if(DEBUG) {
                 final long t1 = System.nanoTime();
                 System.err.println("GLContextImpl.mapGLVersions: "+device+", profileAliasing: "+PROFILE_ALIASING+", total "+(t1-t0)/1e6 +"ms");
-                System.err.println(GLContext.dumpAvailableGLVersions(null).toString());                
+                System.err.println(GLContext.dumpAvailableGLVersions(null).toString());
             }
         } else if (DEBUG) {
             System.err.println(getThreadName() + ": createContextARB-MapVersions NONE for :"+device);
@@ -944,9 +944,9 @@ public abstract class GLContextImpl extends GLContext {
     }
   }
 
-  /** 
+  /**
    * Note: Since context creation is temporary, caller need to issue {@link #resetStates(boolean)}, if creation was successful, i.e. returns true.
-   * This method does not reset the states, allowing the caller to utilize the state variables. 
+   * This method does not reset the states, allowing the caller to utilize the state variables.
    **/
   private final boolean createContextARBMapVersionsAvailable(int reqMajor, int reqProfile) {
     long _context;
@@ -1059,7 +1059,7 @@ public abstract class GLContextImpl extends GLContext {
       if ( 0 == ctp ) {
         throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
       }
-      
+
       if (!GLContext.isValidGLVersion(ctp, major, minor)) {
         throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
       }
@@ -1080,10 +1080,10 @@ public abstract class GLContextImpl extends GLContext {
               if( ctxGLSLVersion.isZero() ) {
                   ctxGLSLVersion = getStaticGLSLVersionNumber(major, minor, ctxOptions);
               }
-          } 
+          }
       }
   }
-  
+
   //----------------------------------------------------------------------
   // Helpers for various context implementations
   //
@@ -1107,8 +1107,8 @@ public abstract class GLContextImpl extends GLContext {
     */
     return gl;
   }
-  
-  /** 
+
+  /**
    * Finalizes GL instance initialization after this context has been initialized.
    * <p>
    * Method calls 'void finalizeInit()' of instance 'gl' as retrieved by reflection, if exist.
@@ -1138,7 +1138,7 @@ public abstract class GLContextImpl extends GLContext {
    * ie for GLXExt, EGLExt, ..
    */
   public abstract ProcAddressTable getPlatformExtProcAddressTable();
-  
+
   /**
    * Part of <code>GL_NV_vertex_array_range</code>.
    * <p>
@@ -1154,7 +1154,7 @@ public abstract class GLContextImpl extends GLContext {
    * Provides platform-independent access to the <code>wglFreeMemoryNV</code> /
    * <code>glXFreeMemoryNV</code>.
    * </p>
-   */  
+   */
   public abstract void glFreeMemoryNV(ByteBuffer pointer);
 
   /** Maps the given "platform-independent" function name to a real function
@@ -1195,7 +1195,7 @@ public abstract class GLContextImpl extends GLContext {
         }
     } );
   }
-  
+
   private final boolean initGLRendererAndGLVersionStrings()  {
     final GLDynamicLookupHelper glDynLookupHelper = getDrawableImpl().getGLDynamicLookupHelper();
     final long _glGetString = glDynLookupHelper.dynamicLookupFunction("glGetString");
@@ -1215,7 +1215,7 @@ public abstract class GLContextImpl extends GLContext {
             return false;
         }
         glVendor = _glVendor;
-        
+
         final String _glRenderer = glGetStringInt(GL.GL_RENDERER, _glGetString);
         if(null == _glRenderer) {
             if(DEBUG) {
@@ -1226,7 +1226,7 @@ public abstract class GLContextImpl extends GLContext {
         }
         glRenderer = _glRenderer;
         glRendererLowerCase = glRenderer.toLowerCase();
-        
+
         final String _glVersion = glGetStringInt(GL.GL_VERSION, _glGetString);
         if(null == _glVersion) {
             // FIXME
@@ -1237,7 +1237,7 @@ public abstract class GLContextImpl extends GLContext {
             return false;
         }
         glVersion = _glVersion;
-        
+
         return true;
     }
   }
@@ -1251,7 +1251,7 @@ public abstract class GLContextImpl extends GLContext {
           minor[0] = 0;
       }
   }
-  
+
   /**
    * Returns null if version string is invalid, otherwise a valid instance.
    * <p>
@@ -1278,7 +1278,7 @@ public abstract class GLContextImpl extends GLContext {
    * version for given arrays.
    * <p>
    * If the GL query fails, major will be zero.
-   * </p> 
+   * </p>
    * <p>
    * Note: Non ARB ctx is limited to GL 3.0.
    * </p>
@@ -1292,20 +1292,20 @@ public abstract class GLContextImpl extends GLContext {
         if(DEBUG) {
             Thread.dumpStack();
         }
-        return false;        
+        return false;
     } else {
         glGetIntegervInt(GL2GL3.GL_MAJOR_VERSION, glIntMajor, 0, _glGetIntegerv);
         glGetIntegervInt(GL2GL3.GL_MINOR_VERSION, glIntMinor, 0, _glGetIntegerv);
         limitNonARBContextVersion(glIntMajor, glIntMinor, ctp);
-        return true;        
+        return true;
     }
   }
-  
+
   protected final int getCtxOptions() {
       return ctxOptions;
   }
 
-  
+
   /**
    * Sets the OpenGL implementation class and
    * the cache of which GL functions are available for calling through this
@@ -1325,8 +1325,8 @@ public abstract class GLContextImpl extends GLContext {
    *                      <li>be greater or equal than the requested <code>major.minor</code> version, and</li>
    *                      <li>match the ctxProfileBits</li>
    *                    </ul>, otherwise method aborts and returns <code>false</code>.
-   * @return returns <code>true</code> if successful, otherwise <code>false</code>. See <code>strictMatch</code>. 
-   *                 If <code>false</code> is returned, no data has been cached or mapped, i.e. ProcAddressTable, Extensions, Version, etc. 
+   * @return returns <code>true</code> if successful, otherwise <code>false</code>. See <code>strictMatch</code>.
+   *                 If <code>false</code> is returned, no data has been cached or mapped, i.e. ProcAddressTable, Extensions, Version, etc.
    * @see #setContextVersion
    * @see javax.media.opengl.GLContext#CTX_OPTION_ANY
    * @see javax.media.opengl.GLContext#CTX_PROFILE_COMPAT
@@ -1340,7 +1340,7 @@ public abstract class GLContextImpl extends GLContext {
     if ( 0 < major && !GLContext.isValidGLVersion(ctxProfileBits, major, minor) ) {
         throw new GLException("Invalid GL Version Request "+GLContext.getGLVersion(major, minor, ctxProfileBits, null));
     }
-    
+
     if(null==this.gl || !verifyInstance(gl.getGLProfile(), "Impl", this.gl)) {
         setGL( createGL( getGLDrawable().getGLProfile() ) );
     }
@@ -1348,7 +1348,7 @@ public abstract class GLContextImpl extends GLContext {
 
     final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration();
     final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
-    
+
     {
         final boolean initGLRendererAndGLVersionStringsOK = initGLRendererAndGLVersionStrings();
         if( !initGLRendererAndGLVersionStringsOK ) {
@@ -1367,7 +1367,7 @@ public abstract class GLContextImpl extends GLContext {
             System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Given "+adevice+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, glVersion));
         }
     }
-    
+
     //
     // Validate GL version either by GL-Integer or GL-String
     //
@@ -1377,8 +1377,8 @@ public abstract class GLContextImpl extends GLContext {
     boolean versionValidated = false;
     boolean versionGL3IntFailed = false;
     {
-        // Validate the requested version w/ the GL-version from an integer query. 
-        final int[] glIntMajor = new int[] { 0 }, glIntMinor = new int[] { 0 }; 
+        // Validate the requested version w/ the GL-version from an integer query.
+        final int[] glIntMajor = new int[] { 0 }, glIntMinor = new int[] { 0 };
         final boolean getGLIntVersionOK = getGLIntVersion(glIntMajor, glIntMinor, ctxProfileBits);
         if( !getGLIntVersionOK ) {
             final String errMsg = "Fetching GL Integer Version failed. "+adevice+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, null);
@@ -1392,14 +1392,14 @@ public abstract class GLContextImpl extends GLContext {
                 // unusable GL context - non query mode - hard fail!
                 throw new GLException(errMsg);
             }
-        }        
+        }
         if (DEBUG) {
             System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: version verification (Int): "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
         }
-        
+
         // Only validate if a valid int version was fetched, otherwise cont. w/ version-string method -> 3.0 > Version || Version > MAX!
         if ( GLContext.isValidGLVersion(ctxProfileBits, glIntMajor[0], glIntMinor[0]) ) {
-            if( glIntMajor[0]<major || ( glIntMajor[0]==major && glIntMinor[0]<minor ) || 0 == major ) {        
+            if( glIntMajor[0]<major || ( glIntMajor[0]==major && glIntMinor[0]<minor ) || 0 == major ) {
                 if( strictMatch && 2 < major ) { // relaxed match for versions major < 3 requests, last resort!
                     if(DEBUG) {
                         System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL version mismatch (Int): "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
@@ -1415,13 +1415,13 @@ public abstract class GLContextImpl extends GLContext {
         }
     }
     if( !versionValidated ) {
-        // Validate the requested version w/ the GL-version from the version string. 
+        // Validate the requested version w/ the GL-version from the version string.
         final VersionNumber setGLVersionNumber = new VersionNumber(major, minor, 0);
         final VersionNumber strGLVersionNumber = getGLVersionNumber(ctxProfileBits, glVersion);
         if (DEBUG) {
             System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: version verification (String): "+glVersion+", "+strGLVersionNumber);
         }
-        
+
         // Only validate if a valid string version was fetched -> MIN > Version || Version > MAX!
         if( null != strGLVersionNumber ) {
             if( strGLVersionNumber.compareTo(setGLVersionNumber) < 0 || 0 == major ) {
@@ -1438,7 +1438,7 @@ public abstract class GLContextImpl extends GLContext {
                 if(DEBUG) {
                     System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL3 version Int failed, String: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+strGLVersionNumber);
                 }
-                return false;            
+                return false;
             }
             versionValidated = true;
         }
@@ -1447,27 +1447,27 @@ public abstract class GLContextImpl extends GLContext {
         if(DEBUG) {
             System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, No GL version validation possible: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion);
         }
-        return false;                    
+        return false;
     }
     if (DEBUG) {
         System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: post version verification "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+", strictMatch "+strictMatch+", versionValidated "+versionValidated+", versionGL3IntFailed "+versionGL3IntFailed);
     }
-    
+
     if( 2 > major ) { // there is no ES2/3-compat for a profile w/ major < 2
         ctxProfileBits &= ~ ( GLContext.CTX_IMPL_ES2_COMPAT | GLContext.CTX_IMPL_ES3_COMPAT ) ;
     }
-    
+
     final VersionNumberString vendorVersion = GLVersionNumber.createVendorVersion(glVersion);
-    
+
     setRendererQuirks(adevice, major, minor, ctxProfileBits, vendorVersion);
-    
+
     if( strictMatch && glRendererQuirks.exist(GLRendererQuirks.GLNonCompliant) ) {
         if(DEBUG) {
             System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL is not compliant: "+GLContext.getGLVersion(major, minor, ctxProfileBits, glVersion)+", "+glRenderer);
         }
         return false;
     }
-    
+
     if(!isCurrentContextHardwareRasterizer()) {
         ctxProfileBits |= GLContext.CTX_IMPL_ACCEL_SOFT;
     }
@@ -1529,7 +1529,7 @@ public abstract class GLContextImpl extends GLContext {
             }
         }
     }
-    
+
     if( 0 != ( CTX_PROFILE_ES & ctxProfileBits ) ) {
         if( major >= 3 ) {
             ctxProfileBits |= CTX_IMPL_ES3_COMPAT | CTX_IMPL_ES2_COMPAT ;
@@ -1550,45 +1550,45 @@ public abstract class GLContextImpl extends GLContext {
     } else if( hasFBOImpl(major, ctxProfileBits, extensionAvailability) ) {
         ctxProfileBits |= CTX_IMPL_FBO;
     }
-    
+
     if( ( 0 != ( CTX_PROFILE_ES & ctxProfileBits ) && major == 1 ) ||  isExtensionAvailable(GLExtensions.OES_single_precision) ) {
         ctxProfileBits |= CTX_IMPL_FP32_COMPAT_API;
     }
-    
+
     if(FORCE_NO_FBO_SUPPORT) {
         ctxProfileBits &= ~CTX_IMPL_FBO ;
-    }      
-    
+    }
+
     //
     // Set GL Version (complete w/ version string)
     //
     setContextVersion(major, minor, ctxProfileBits, vendorVersion, true);
-    
+
     finalizeInit(gl);
-    
+
     setDefaultSwapInterval();
-    
+
     final int glErrX = gl.glGetError(); // clear GL error, maybe caused by above operations
-    
+
     if(DEBUG) {
         System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: OK "+contextFQN+" - "+GLContext.getGLVersion(ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions, null)+" - glErr "+toHexString(glErrX));
     }
     return true;
   }
-  
+
   private final void setRendererQuirks(final AbstractGraphicsDevice adevice, int major, int minor, int ctp, final VersionNumberString vendorVersion) {
     int[] quirks = new int[GLRendererQuirks.COUNT + 1]; // + 1 ( NoFullFBOSupport )
     int i = 0;
-    
+
     final String MesaSP = "Mesa ";
-    // final String MesaRendererAMDsp = " AMD "; 
-    // final String MesaRendererIntelsp = "Intel(R)"; 
+    // final String MesaRendererAMDsp = " AMD ";
+    // final String MesaRendererIntelsp = "Intel(R)";
     final boolean hwAccel = 0 == ( ctp & GLContext.CTX_IMPL_ACCEL_SOFT );
     final boolean compatCtx = 0 != ( ctp & GLContext.CTX_PROFILE_COMPAT );
     final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ");
     final boolean isDriverATICatalyst = !isDriverMesa && ( glVendor.contains("ATI Technologies") || glRenderer.startsWith("ATI ") );
     final boolean isDriverNVIDIAGeForce = !isDriverMesa && ( glVendor.contains("NVIDIA Corporation") || glRenderer.contains("NVIDIA ") );
-    
+
     //
     // OS related quirks
     //
@@ -1603,7 +1603,7 @@ public abstract class GLContextImpl extends GLContext {
             }
             quirks[i++] = quirk;
         }
-        
+
         if( isDriverNVIDIAGeForce ) {
             final VersionNumber osxVersionNVFlushClean = new VersionNumber(10,7,3); // < OSX 10.7.3 w/ NV needs glFlush
             if( Platform.getOSVersionNumber().compareTo(osxVersionNVFlushClean) < 0 ) {
@@ -1622,7 +1622,7 @@ public abstract class GLContextImpl extends GLContext {
                 quirks[i++] = quirk;
             }
         }
-    } else if( Platform.getOSType() == Platform.OSType.WINDOWS ) {        
+    } else if( Platform.getOSType() == Platform.OSType.WINDOWS ) {
         //
         // WINDOWS
         //
@@ -1633,28 +1633,28 @@ public abstract class GLContextImpl extends GLContext {
             }
             quirks[i++] = quirk;
         }
-        
+
         if( isDriverATICatalyst ) {
-            final VersionNumber winXPVersionNumber = new VersionNumber ( 5, 1, 0);          
-            final VersionNumber amdSafeMobilityVersion = new VersionNumber(12, 102, 3);  
-            
+            final VersionNumber winXPVersionNumber = new VersionNumber ( 5, 1, 0);
+            final VersionNumber amdSafeMobilityVersion = new VersionNumber(12, 102, 3);
+
             if ( vendorVersion.compareTo(amdSafeMobilityVersion) < 0 ) { // includes: vendorVersion.isZero()
                 final int quirk = GLRendererQuirks.NeedCurrCtx4ARBCreateContext;
                 if(DEBUG) {
                     System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType()+", [Vendor "+glVendor+" or Renderer "+glRenderer+"], driverVersion "+vendorVersion);
                 }
-                quirks[i++] = quirk;                
+                quirks[i++] = quirk;
             }
-            
+
             if( Platform.getOSVersionNumber().compareTo(winXPVersionNumber) <= 0 ) {
                 final int quirk = GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries;
                 if(DEBUG) {
                     System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS-Version "+Platform.getOSType()+" "+Platform.getOSVersionNumber()+", [Vendor "+glVendor+" or Renderer "+glRenderer+"]");
                 }
-                quirks[i++] = quirk;                
+                quirks[i++] = quirk;
             }
         }
-    } else if( Platform.OSType.ANDROID == Platform.getOSType() ) {    
+    } else if( Platform.OSType.ANDROID == Platform.getOSType() ) {
         //
         // ANDROID
         //
@@ -1667,7 +1667,7 @@ public abstract class GLContextImpl extends GLContext {
             quirks[i++] = quirk;
         }
     }
-    
+
     //
     // Windowing Toolkit related quirks
     //
@@ -1704,8 +1704,8 @@ public abstract class GLContextImpl extends GLContext {
             }
         }
     }
-    
-    
+
+
     //
     // RENDERER related quirks
     //
@@ -1735,8 +1735,8 @@ public abstract class GLContextImpl extends GLContext {
         }
         if( Platform.getOSType() == Platform.OSType.WINDOWS && glRenderer.contains("SVGA3D") )
         {
-            final VersionNumber mesaSafeFBOVersion = new VersionNumber(8, 0, 0);              
-            if ( vendorVersion.compareTo(mesaSafeFBOVersion) < 0 ) { // includes: vendorVersion.isZero()            
+            final VersionNumber mesaSafeFBOVersion = new VersionNumber(8, 0, 0);
+            if ( vendorVersion.compareTo(mesaSafeFBOVersion) < 0 ) { // includes: vendorVersion.isZero()
                 final int quirk = GLRendererQuirks.NoFullFBOSupport;
                 if(DEBUG) {
                     System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType() + " / Renderer " + glRenderer + " / Mesa-Version "+vendorVersion);
@@ -1745,7 +1745,7 @@ public abstract class GLContextImpl extends GLContext {
             }
         }
     }
-    
+
     //
     // Property related quirks
     //
@@ -1754,28 +1754,28 @@ public abstract class GLContextImpl extends GLContext {
         if(DEBUG) {
             System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: property");
         }
-        quirks[i++] = quirk;        
+        quirks[i++] = quirk;
     }
-    
+
     glRendererQuirks = new GLRendererQuirks(quirks, 0, i);
   }
-    
+
   private static final boolean hasFBOImpl(int major, int ctp, ExtensionAvailabilityCache extCache) {
     return ( 0 != (ctp & CTX_PROFILE_ES) && major >= 2 ) ||   // ES >= 2.0
-            
-           major >= 3 ||                                                 // any >= 3.0 GL ctx                       
-           
+
+           major >= 3 ||                                                 // any >= 3.0 GL ctx
+
            ( null != extCache &&
-           
+
                extCache.isExtensionAvailable(GLExtensions.ARB_ES2_compatibility)  ||         // ES 2.0 compatible
-               
+
                extCache.isExtensionAvailable(GLExtensions.ARB_framebuffer_object) ||         // ARB_framebuffer_object
-               
+
                extCache.isExtensionAvailable(GLExtensions.EXT_framebuffer_object) ||         // EXT_framebuffer_object
-               
-               extCache.isExtensionAvailable(GLExtensions.OES_framebuffer_object) ) ;        // OES_framebuffer_object excluded               
+
+               extCache.isExtensionAvailable(GLExtensions.OES_framebuffer_object) ) ;        // OES_framebuffer_object excluded
   }
-  
+
   private final void removeCachedVersion(int major, int minor, int ctxProfileBits) {
     if(!isCurrentContextHardwareRasterizer()) {
         ctxProfileBits |= GLContext.CTX_IMPL_ACCEL_SOFT;
@@ -1932,7 +1932,7 @@ public abstract class GLContextImpl extends GLContext {
       evalPixelDataType();
       return pixelDataFormat;
   }
-  
+
   private final void evalPixelDataType() {
     if(!pixelDataEvaluated) {
         synchronized(this) {
@@ -1946,14 +1946,14 @@ public abstract class GLContextImpl extends GLContext {
                 } else */ if( isGLES2Compatible() || isExtensionAvailable(GLExtensions.OES_read_format) ) {
                     final int[] glImplColorReadVals = new int[] { 0, 0 };
                     gl.glGetIntegerv(GL.GL_IMPLEMENTATION_COLOR_READ_FORMAT, glImplColorReadVals, 0);
-                    gl.glGetIntegerv(GL.GL_IMPLEMENTATION_COLOR_READ_TYPE, glImplColorReadVals, 1);            
+                    gl.glGetIntegerv(GL.GL_IMPLEMENTATION_COLOR_READ_TYPE, glImplColorReadVals, 1);
                     // pixelDataInternalFormat = (4 == components) ? GL.GL_RGBA : GL.GL_RGB;
                     pixelDataFormat = glImplColorReadVals[0];
                     pixelDataType = glImplColorReadVals[1];
                     ok = 0 != pixelDataFormat && 0 != pixelDataType;
                 }
                 if( !ok ) {
-                    // RGBA read is safe for all GL profiles 
+                    // RGBA read is safe for all GL profiles
                     // pixelDataInternalFormat = (4 == components) ? GL.GL_RGBA : GL.GL_RGB;
                     pixelDataFormat=GL.GL_RGBA;
                     pixelDataType = GL.GL_UNSIGNED_BYTE;
@@ -1984,54 +1984,54 @@ public abstract class GLContextImpl extends GLContext {
   public final GLStateTracker getGLStateTracker() {
     return glStateTracker;
   }
-  
+
   //---------------------------------------------------------------------------
   // Helpers for context optimization where the last context is left
   // current on the OpenGL worker thread
   //
 
-  /** 
+  /**
    * Returns true if the given thread is owner, otherwise false.
    * <p>
    * Method exists merely for code validation of {@link #isCurrent()}.
-   * </p> 
+   * </p>
    */
   public final boolean isOwner(Thread thread) {
       return lock.isOwner(thread);
   }
-  
-  /** 
+
+  /**
    * Returns true if there are other threads waiting for this GLContext to {@link #makeCurrent()}, otherwise false.
    * <p>
    * Since method does not perform any synchronization, accurate result are returned if lock is hold - only.
-   * </p> 
+   * </p>
    */
   public final boolean hasWaiters() {
     return lock.getQueueLength()>0;
   }
-  
-  /** 
+
+  /**
    * Returns the number of hold locks. See {@link RecursiveLock#getHoldCount()} for semantics.
    * <p>
    * Since method does not perform any synchronization, accurate result are returned if lock is hold - only.
-   * </p> 
+   * </p>
    */
   public final int getLockCount() {
       return lock.getHoldCount();
   }
-  
+
   //---------------------------------------------------------------------------
   // Special FBO hook
   //
-  
+
   /**
    * Tracks {@link GL#GL_FRAMEBUFFER}, {@link GL2GL3#GL_DRAW_FRAMEBUFFER} and {@link GL2GL3#GL_READ_FRAMEBUFFER}
    * to be returned via {@link #getBoundFramebuffer(int)}.
-   * 
+   *
    * <p>Invoked by {@link GL#glBindFramebuffer(int, int)}. </p>
-   * 
-   * <p>Assumes valid <code>framebufferName</code> range of [0..{@link Integer#MAX_VALUE}]</p> 
-   * 
+   *
+   * <p>Assumes valid <code>framebufferName</code> range of [0..{@link Integer#MAX_VALUE}]</p>
+   *
    * <p>Does not throw an exception if <code>target</code> is unknown or <code>framebufferName</code> invalid.</p>
    */
   public final void setBoundFramebuffer(int target, int framebufferName) {
@@ -2064,14 +2064,14 @@ public abstract class GLContextImpl extends GLContext {
               throw new InternalError("Invalid FBO target name: "+toHexString(target));
       }
   }
-  
+
   @Override
-  public final int getDefaultDrawFramebuffer() { return drawable.getDefaultDrawFramebuffer(); }  
+  public final int getDefaultDrawFramebuffer() { return drawable.getDefaultDrawFramebuffer(); }
   @Override
-  public final int getDefaultReadFramebuffer() { return drawable.getDefaultReadFramebuffer(); }  
+  public final int getDefaultReadFramebuffer() { return drawable.getDefaultReadFramebuffer(); }
   @Override
   public final int getDefaultReadBuffer() { return drawable.getDefaultReadBuffer(gl); }
-    
+
   //---------------------------------------------------------------------------
   // GL_ARB_debug_output, GL_AMD_debug_output helpers
   //
@@ -2090,7 +2090,7 @@ public abstract class GLContextImpl extends GLContext {
   public final int getContextCreationFlags() {
       return additionalCtxCreationFlags;
   }
-  
+
   @Override
   public final void setContextCreationFlags(int flags) {
       if(!isCreated()) {
@@ -2160,7 +2160,7 @@ public abstract class GLContextImpl extends GLContext {
 
   /** Internal bootstraping glGetString(GL_RENDERER) */
   private static native String glGetStringInt(int name, long procAddress);
-  
+
   /** Internal bootstraping glGetIntegerv(..) for version */
   private static native void glGetIntegervInt(int pname, int[] params, int params_offset, long procAddress);
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
index b7acc0dff..70ade34b7 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2011 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -55,7 +55,7 @@ import javax.media.opengl.GLException;
 
 public class GLContextShareSet {
   private static final boolean DEBUG = GLContextImpl.DEBUG;
-  
+
   // This class is implemented using a HashMap which maps from all shared contexts
   // to a share set, containing all shared contexts itself.
 
@@ -74,17 +74,17 @@ public class GLContextShareSet {
         } else {
           destroyedShares.put(ctx, dummyValue);
         }
-      }      
+      }
     }
 
     public Set<GLContext> getCreatedShares() {
         return createdShares.keySet();
     }
-    
+
     public Set<GLContext> getDestroyedShares() {
         return destroyedShares.keySet();
     }
-    
+
     public GLContext getCreatedShare(GLContext ignore) {
       for (Iterator<GLContext> iter = createdShares.keySet().iterator(); iter.hasNext(); ) {
         GLContext ctx = iter.next();
@@ -133,9 +133,9 @@ public class GLContextShareSet {
     addEntry(share1, share);
     addEntry(share2, share);
     if (DEBUG) {
-      System.err.println("GLContextShareSet: registereSharing: 1: " + 
+      System.err.println("GLContextShareSet: registereSharing: 1: " +
               toHexString(share1.getHandle()) + ", 2: " + toHexString(share2.getHandle()));
-    }                  
+    }
   }
 
   public static synchronized void unregisterSharing(GLContext lastContext) {
@@ -155,9 +155,9 @@ public class GLContextShareSet {
         throw new GLException("Last context's share set contains no destroyed context");
     }
     if (DEBUG) {
-      System.err.println("GLContextShareSet: unregisterSharing: " + 
+      System.err.println("GLContextShareSet: unregisterSharing: " +
               toHexString(lastContext.getHandle())+", entries: "+s.size());
-    }                  
+    }
     for(Iterator<GLContext> iter = s.iterator() ; iter.hasNext() ; ) {
         GLContext ctx = iter.next();
         if(null == removeEntry(ctx)) {
@@ -165,7 +165,7 @@ public class GLContextShareSet {
         }
     }
   }
-  
+
   private static synchronized Set<GLContext> getCreatedSharedImpl(GLContext context) {
     if (context == null) {
       throw new IllegalArgumentException("context is null");
@@ -174,9 +174,9 @@ public class GLContextShareSet {
     if (share != null) {
         return share.getCreatedShares();
     }
-    return null;    
+    return null;
   }
-  
+
   public static synchronized boolean isShared(GLContext context) {
     if (context == null) {
       throw new IllegalArgumentException("context is null");
@@ -184,12 +184,12 @@ public class GLContextShareSet {
     final ShareSet share = entryFor(context);
     return share != null;
   }
-  
+
   public static synchronized boolean hasCreatedSharedLeft(GLContext context) {
       final Set<GLContext> s = getCreatedSharedImpl(context);
       return null != s && s.size()>0 ;
   }
-  
+
   /** currently not used ..
   public static synchronized Set<GLContext> getCreatedShared(GLContext context) {
     final Set<GLContext> s = getCreatedSharedImpl(context);
@@ -198,7 +198,7 @@ public class GLContextShareSet {
     }
     return s;
   }
-    
+
   public static synchronized Set<GLContext> getDestroyedShared(GLContext context) {
     if (context == null) {
       throw new IllegalArgumentException("context is null");
@@ -209,7 +209,7 @@ public class GLContextShareSet {
     }
     return share.getDestroyedShares();
   } */
-    
+
   public static synchronized GLContext getShareContext(GLContext contextToCreate) {
     ShareSet share = entryFor(contextToCreate);
     if (share == null) {
@@ -262,7 +262,7 @@ public class GLContextShareSet {
 
   //----------------------------------------------------------------------
   // Internals only below this point
-  
+
 
   private static ShareSet entryFor(GLContext context) {
     return (ShareSet) shareMap.get(context);
@@ -276,8 +276,8 @@ public class GLContextShareSet {
   private static ShareSet removeEntry(GLContext context) {
     return (ShareSet) shareMap.remove(context);
   }
-  
+
   protected static String toHexString(long hex) {
     return "0x" + Long.toHexString(hex);
-  }  
+  }
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
index 9ecaca75d..b770f3b05 100644
--- a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
+++ b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
@@ -44,57 +44,57 @@ import com.jogamp.opengl.GLExtensions;
 /**
  * The GLDebugMessageHandler, handling <i>GL_ARB_debug_output</i> or <i>GL_AMD_debug_output</i>
  * debug messages.<br>
- * 
+ *
  * <p>An instance must be bound to the current thread's GLContext to achieve thread safety.</p>
- * 
- * <p>A native callback function is registered at {@link #enable(boolean) enable(true)}, 
- * which forwards received messages to the added {@link GLDebugListener} directly. 
+ *
+ * <p>A native callback function is registered at {@link #enable(boolean) enable(true)},
+ * which forwards received messages to the added {@link GLDebugListener} directly.
  * Hence the {@link GLDebugListener#messageSent(GLDebugMessage)} implementation shall
  * return as fast as possible.</p>
- * 
+ *
  * <p>In case no <i>GL_ARB_debug_output</i> is available, but <i>GL_AMD_debug_output</i>,
  * the messages are translated to <i>ARB</i> {@link GLDebugMessage}, using {@link GLDebugMessage#translateAMDEvent(javax.media.opengl.GLContext, long, int, int, int, String)}.</p>
  */
 public class GLDebugMessageHandler {
     private static final boolean DEBUG = Debug.debug("GLDebugMessageHandler");
-    
+
     private static final int EXT_ARB = 1;
-    private static final int EXT_AMD = 2;    
-    
+    private static final int EXT_AMD = 2;
+
     static {
         if ( !initIDs0() ) {
             throw new NativeWindowException("Failed to initialize GLDebugMessageHandler jmethodIDs");
-        }        
+        }
     }
-            
-    private final GLContextImpl ctx;    
+
+    private final GLContextImpl ctx;
     private final ListenerSyncedImplStub<GLDebugListener> listenerImpl;
-    
+
     // licefycle: init - EOL
     private String extName;
     private int extType;
     private long glDebugMessageCallbackProcAddress;
-    private boolean extAvailable; 
+    private boolean extAvailable;
     private boolean synchronous;
-    
+
     // licefycle: enable - disable/EOL
     private long handle;
-    
+
     /**
      * @param ctx the associated GLContext
      * @param glDebugExtension chosen extension to use
      */
-    public GLDebugMessageHandler(GLContextImpl ctx) {        
+    public GLDebugMessageHandler(GLContextImpl ctx) {
         this.ctx = ctx;
-        this.listenerImpl = new ListenerSyncedImplStub<GLDebugListener>();        
+        this.listenerImpl = new ListenerSyncedImplStub<GLDebugListener>();
         this.glDebugMessageCallbackProcAddress = 0;
         this.extName = null;
         this.extType = 0;
-        this.extAvailable = false; 
+        this.extAvailable = false;
         this.handle = 0;
         this.synchronous = true;
     }
-    
+
     public void init(boolean enable) {
         if(DEBUG) {
             System.err.println("GLDebugMessageHandler.init("+enable+")");
@@ -106,13 +106,13 @@ public class GLDebugMessageHandler {
             System.err.println("GLDebugMessageHandler.init("+enable+") .. n/a");
         }
     }
-    
+
     private final long getAddressFor(final ProcAddressTable table, final String functionName) {
         return AccessController.doPrivileged(new PrivilegedAction<Long>() {
             public Long run() {
                 try {
                     return Long.valueOf( table.getAddressFor(functionName) );
-                } catch (IllegalArgumentException iae) { 
+                } catch (IllegalArgumentException iae) {
                     return Long.valueOf(0);
                 }
             }
@@ -124,12 +124,12 @@ public class GLDebugMessageHandler {
         if( isAvailable()) {
             return;
         }
-        
+
         if( !ctx.isGLDebugEnabled() ) {
             if(DEBUG) {
                 System.err.println("GLDebugMessageHandler: GL DEBUG not set in ARB ctx options: "+ctx.getGLVersion());
             }
-            return;            
+            return;
         }
         if(Platform.OS_TYPE == Platform.OSType.WINDOWS && Platform.is32Bit()) {
             // Currently buggy, ie. throws an exception after leaving the native callback.
@@ -149,93 +149,93 @@ public class GLDebugMessageHandler {
         if(DEBUG) {
             System.err.println("GLDebugMessageHandler: Using extension: <"+extName+">");
         }
-        
+
         if(0 == extType) {
             if(DEBUG) {
                 System.err.println("GLDebugMessageHandler: No extension available! "+ctx.getGLVersion());
                 System.err.println("GL_EXTENSIONS  "+ctx.getGLExtensionCount());
-                System.err.println(ctx.getGLExtensionsString());                
+                System.err.println(ctx.getGLExtensionsString());
             }
             return;
         }
-                
+
         final ProcAddressTable procAddressTable = ctx.getGLProcAddressTable();
         if( !ctx.isGLES1() && !ctx.isGLES2() ) {
             switch(extType) {
-                case EXT_ARB: 
+                case EXT_ARB:
                     glDebugMessageCallbackProcAddress = getAddressFor(procAddressTable, "glDebugMessageCallbackARB");
                     break;
-                case EXT_AMD: 
+                case EXT_AMD:
                     glDebugMessageCallbackProcAddress = getAddressFor(procAddressTable, "glDebugMessageCallbackAMD");
                     break;
             }
         } else {
             glDebugMessageCallbackProcAddress = 0;
             if(DEBUG) {
-                System.err.println("Non desktop context not supported");    
-            }            
+                System.err.println("Non desktop context not supported");
+            }
         }
         extAvailable = 0 < extType && null != extName && 0 != glDebugMessageCallbackProcAddress;
-        
+
         if(DEBUG) {
             System.err.println("GLDebugMessageHandler: extAvailable: "+extAvailable+", glDebugMessageCallback* : 0x"+Long.toHexString(glDebugMessageCallbackProcAddress));
         }
-        
+
         if(!extAvailable) {
             glDebugMessageCallbackProcAddress = 0;
         }
-        
+
         handle = 0;
     }
 
     public final boolean isAvailable() { return extAvailable; }
-    
+
     /**
-     * @return The extension implementing the GLDebugMessage feature, 
-     *         either {@link #GL_ARB_debug_output} or {@link #GL_AMD_debug_output}. 
-     *         If unavailable <i>null</i> is returned. 
+     * @return The extension implementing the GLDebugMessage feature,
+     *         either {@link #GL_ARB_debug_output} or {@link #GL_AMD_debug_output}.
+     *         If unavailable <i>null</i> is returned.
      */
     public final String getExtension() {
         return extName;
     }
-    
+
     public final boolean isExtensionARB() {
         return extName == GLExtensions.ARB_debug_output;
     }
-    
+
     public final boolean isExtensionAMD() {
         return extName == GLExtensions.AMD_debug_output;
     }
-    
+
     /**
-     * @see javax.media.opengl.GLContext#isGLDebugSynchronous() 
+     * @see javax.media.opengl.GLContext#isGLDebugSynchronous()
      */
     public final boolean isSynchronous() { return synchronous; }
-    
+
     /**
-     * @see javax.media.opengl.GLContext#setGLDebugSynchronous(boolean) 
+     * @see javax.media.opengl.GLContext#setGLDebugSynchronous(boolean)
      */
     public final void setSynchronous(boolean synchronous) {
         this.synchronous = synchronous;
         if( isEnabled() ) {
             setSynchronousImpl();
         }
-    }    
+    }
     private final void setSynchronousImpl() {
         if(isExtensionARB()) {
             if(synchronous) {
                 ctx.getGL().glEnable(GL2GL3.GL_DEBUG_OUTPUT_SYNCHRONOUS);
             } else {
                 ctx.getGL().glDisable(GL2GL3.GL_DEBUG_OUTPUT_SYNCHRONOUS);
-            }        
+            }
             if(DEBUG) {
                 System.err.println("GLDebugMessageHandler: synchronous "+synchronous);
             }
         }
     }
-    
+
     /**
-     * @see javax.media.opengl.GLContext#enableGLDebugMessage(boolean) 
+     * @see javax.media.opengl.GLContext#enableGLDebugMessage(boolean)
      */
     public final void enable(boolean enable) throws GLException {
         ctx.validateCurrent();
@@ -243,7 +243,7 @@ public class GLDebugMessageHandler {
             return;
         }
         enableImpl(enable);
-    }        
+    }
     final void enableImpl(boolean enable) throws GLException {
         if(enable) {
             if(0 == handle) {
@@ -257,19 +257,19 @@ public class GLDebugMessageHandler {
             if(0 != handle) {
                 unregister0(glDebugMessageCallbackProcAddress, handle);
                 handle = 0;
-            }                    
+            }
         }
         if(DEBUG) {
             System.err.println("GLDebugMessageHandler: enable("+enable+") -> 0x" + Long.toHexString(handle));
         }
     }
-    
+
     public final boolean isEnabled() { return 0 != handle; }
 
-    public final int listenerSize() { 
-        return listenerImpl.size(); 
+    public final int listenerSize() {
+        return listenerImpl.size();
     }
-    
+
     public final void addListener(GLDebugListener listener) {
         listenerImpl.addListener(-1, listener);
     }
@@ -277,11 +277,11 @@ public class GLDebugMessageHandler {
     public final void addListener(int index, GLDebugListener listener) {
         listenerImpl.addListener(index, listener);
     }
-  
+
     public final void removeListener(GLDebugListener listener) {
         listenerImpl.removeListener(listener);
     }
-    
+
     private final void sendMessage(GLDebugMessage msg) {
         synchronized(listenerImpl) {
             if(DEBUG) {
@@ -293,10 +293,10 @@ public class GLDebugMessageHandler {
             }
         }
     }
-    
+
     public static class StdErrGLDebugListener implements GLDebugListener {
         boolean threadDump;
-        
+
         public StdErrGLDebugListener(boolean threadDump) {
             this.threadDump = threadDump;
         }
@@ -305,13 +305,13 @@ public class GLDebugMessageHandler {
             if(threadDump) {
                 Thread.dumpStack();
             }
-        }        
+        }
     }
-    
+
     //
     // native -> java
     //
-    
+
     protected final void glDebugMessageARB(int source, int type, int id, int severity, String msg) {
         final GLDebugMessage event = new GLDebugMessage(ctx, System.currentTimeMillis(), source, type, id, severity, msg);
         sendMessage(event);
@@ -321,11 +321,11 @@ public class GLDebugMessageHandler {
         final GLDebugMessage event = GLDebugMessage.translateAMDEvent(ctx, System.currentTimeMillis(), id, category, severity, msg);
         sendMessage(event);
     }
-        
+
     //
     // java -> native
-    // 
-    
+    //
+
     private static native boolean initIDs0();
     private native long register0(long glDebugMessageCallbackProcAddress, int extType);
     private native void unregister0(long glDebugMessageCallbackProcAddress, long handle);
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
index f5ceb8058..1e4cb38fa 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
@@ -95,14 +95,14 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
           }
       } catch (GLException gle) {
           if(DEBUG) {
-              System.err.println("Catched Exception on thread "+getThreadName()); 
+              System.err.println("Catched Exception on thread "+getThreadName());
               gle.printStackTrace();
           }
       }
       return null;
   }
   protected abstract SharedResourceRunner.Resource getOrCreateSharedResourceImpl(AbstractGraphicsDevice device);
-  
+
   /**
    * Returns the shared context mapped to the <code>device</code> {@link AbstractGraphicsDevice#getConnection()},
    * either a pre-existing or newly created, or <code>null</code> if creation failed or <b>not supported</b>.<br>
@@ -176,7 +176,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
         final OffscreenLayerSurface ols = NativeWindowFactory.getOffscreenLayerSurface(target, true);
         if(null != ols) {
             final GLCapabilitiesImmutable chosenCapsMod = GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(chosenCaps, this, adevice);
-            
+
             // layered surface -> Offscreen/[FBO|PBuffer]
             if( !chosenCapsMod.isFBO() && !chosenCapsMod.isPBuffer() ) {
                 throw new GLException("Neither FBO nor Pbuffer is available for "+chosenCapsMod+", "+target);
@@ -193,10 +193,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
             }
             if( ! ( target instanceof MutableSurface ) ) {
                 throw new IllegalArgumentException("Passed NativeSurface must implement SurfaceChangeable for offscreen layered surface: "+target);
-            }            
+            }
             if( chosenCapsMod.isFBO() ) {
                 result = createFBODrawableImpl(target, chosenCapsMod, 0);
-            } else {            
+            } else {
                 result = createOffscreenDrawableImpl(target);
             }
         } else if(chosenCaps.isOnscreen()) {
@@ -217,7 +217,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
                 throw new IllegalArgumentException("Passed NativeSurface must implement MutableSurface for offscreen: "+target);
             }
             if( chosenCaps.isFBO() && isFBOAvailable ) {
-                // need to hook-up a native dummy surface since source may not have & use minimum GLCapabilities for it w/ same profile 
+                // need to hook-up a native dummy surface since source may not have & use minimum GLCapabilities for it w/ same profile
                 final ProxySurface dummySurface = createDummySurfaceImpl(adevice, false, new GLCapabilities(chosenCaps.getGLProfile()), (GLCapabilitiesImmutable)config.getRequestedCapabilities(), null, 64, 64);
                 dummySurface.setUpstreamSurfaceHook(new DelegatedUpstreamSurfaceHookWithSurfaceSize(dummySurface.getUpstreamSurfaceHook(), target));
                 result = createFBODrawableImpl(dummySurface, chosenCaps, 0);
@@ -245,7 +245,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   //
   // PBuffer Offscreen GLAutoDrawable construction
   //
-  
+
   @Override
   public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp);
 
@@ -271,7 +271,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
     GLDrawableImpl drawable = null;
     device.lock();
     try {
-        drawable = createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser, 
+        drawable = createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser,
                                                                      new UpstreamSurfaceHookMutableSize(width, height) ) );
         if(null != drawable) {
             drawable.setRealized(true);
@@ -294,9 +294,9 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
     if(null == device) {
         throw new GLException("No shared device for requested: "+deviceReq);
     }
-    return GLContext.isFBOAvailable(device, glp);      
+    return GLContext.isFBOAvailable(device, glp);
   }
-  
+
   @Override
   public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice deviceReq,
                                                              GLCapabilitiesImmutable capsRequested,
@@ -311,7 +311,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
     }
     return new GLOffscreenAutoDrawableImpl( drawable, context, null, null);
   }
-  
+
   @Override
   public final GLDrawable createOffscreenDrawable(AbstractGraphicsDevice deviceReq,
                                             GLCapabilitiesImmutable capsRequested,
@@ -324,18 +324,18 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
     if(null == device) {
         throw new GLException("No shared device for requested: "+deviceReq);
     }
-    
+
     final GLCapabilitiesImmutable capsChosen = GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(capsRequested, this, device);
 
     device.lock();
     try {
         if( capsChosen.isFBO() ) {
-            // Use minimum GLCapabilities for the dummy surface w/ same profile 
+            // Use minimum GLCapabilities for the dummy surface w/ same profile
             final ProxySurface dummySurface = createDummySurfaceImpl(device, true, new GLCapabilities(capsChosen.getGLProfile()), capsRequested, null, width, height);
             final GLDrawableImpl dummyDrawable = createOnscreenDrawableImpl(dummySurface);
             return new GLFBODrawableImpl.ResizeableImpl(this, dummyDrawable, dummySurface, capsChosen, 0);
-        }    
-        return createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser, 
+        }
+        return createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser,
                                                                      new UpstreamSurfaceHookMutableSize(width, height) ) );
     } finally {
         device.unlock();
@@ -343,7 +343,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   @Override
-  public final GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp) {  
+  public final GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp) {
     final AbstractGraphicsDevice device = createNewDevice ? getOrCreateSharedDevice(deviceReq) : deviceReq;
     if(null == device) {
         throw new GLException("No shared device for requested: "+deviceReq+", createNewDevice "+createNewDevice);
@@ -357,14 +357,14 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
         device.unlock();
     }
   }
-  
-  /** Creates a platform independent unrealized FBO offscreen GLDrawable */ 
+
+  /** Creates a platform independent unrealized FBO offscreen GLDrawable */
   protected final GLFBODrawable createFBODrawableImpl(NativeSurface dummySurface, GLCapabilitiesImmutable fboCaps, int textureUnit) {
     final GLDrawableImpl dummyDrawable = createOnscreenDrawableImpl(dummySurface);
     return new GLFBODrawableImpl(this, dummyDrawable, dummySurface, fboCaps, textureUnit);
   }
-  
-  /** Creates a platform dependent unrealized offscreen pbuffer/pixmap GLDrawable instance */  
+
+  /** Creates a platform dependent unrealized offscreen pbuffer/pixmap GLDrawable instance */
   protected abstract GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) ;
 
   /**
@@ -381,10 +381,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    * @param capsChosen
    * @param capsRequested
    * @param chooser the custom chooser, may be null for default
-   * @param upstreamHook surface size information and optional control of the surface's lifecycle 
+   * @param upstreamHook surface size information and optional control of the surface's lifecycle
    * @return the created {@link MutableSurface} instance w/o defined surface handle
    */
-  protected abstract ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice, 
+  protected abstract ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice,
                                                            GLCapabilitiesImmutable capsChosen,
                                                            GLCapabilitiesImmutable capsRequested,
                                                            GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook);
@@ -399,7 +399,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    * @param deviceReq which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
    * @param requestedCaps
    * @param chooser the custom chooser, may be null for default
-   * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width. 
+   * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
    *        The latter is platform specific and small
    * @param height the initial height as returned by {@link NativeSurface#getHeight()}, not the actual dummy surface height,
    *        The latter is platform specific and small
@@ -419,7 +419,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
         device.unlock();
     }
   }
-  
+
   /**
    * A dummy surface is not visible on screen and will not be used to render directly to,
    * it maybe on- or offscreen.
@@ -433,22 +433,22 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    * @param chosenCaps
    * @param requestedCaps
    * @param chooser the custom chooser, may be null for default
-   * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width. 
+   * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
    *        The latter is platform specific and small
    * @param height the initial height as returned by {@link NativeSurface#getHeight()}, not the actual dummy surface height,
    *        The latter is platform specific and small
    * @return the created {@link ProxySurface} instance w/o defined surface handle but platform specific {@link UpstreamSurfaceHook}.
    */
-  public abstract ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice, 
+  public abstract ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice,
                                                       GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height);
 
   //---------------------------------------------------------------------------
   //
   // ProxySurface (Wrapped pre-existing native surface) construction
   //
-  
+
   @Override
-  public ProxySurface createProxySurface(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, 
+  public ProxySurface createProxySurface(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
                                          GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
     final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
     if(null == device) {
@@ -473,7 +473,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    * </p>
  * @param upstream TODO
    */
-  protected abstract ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, 
+  protected abstract ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
                                                          GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream);
 
   //---------------------------------------------------------------------------
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index 5418fbaf3..2cf384fd7 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -63,12 +63,12 @@ import javax.media.opengl.GLRunnable;
 public class GLDrawableHelper {
   /** true if property <code>jogl.debug.GLDrawable.PerfStats</code> is defined. */
   private static final boolean PERF_STATS;
-    
+
   static {
       Debug.initSingleton();
       PERF_STATS = Debug.isPropertyDefined("jogl.debug.GLDrawable.PerfStats", true);
   }
-  
+
   protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
   private final Object listenersLock = new Object();
   private final ArrayList<GLEventListener> listeners = new ArrayList<GLEventListener>();
@@ -120,7 +120,7 @@ public class GLDrawableHelper {
 
   /** Limit release calls of {@link #forceNativeRelease(GLContext)} to {@value}. */
   private static final int MAX_RELEASE_ITER = 512;
-  
+
   /**
    * Since GLContext's {@link GLContext#makeCurrent()} and {@link GLContext#release()}
    * is recursive, a call to {@link GLContext#release()} may not natively release the context.
@@ -138,36 +138,36 @@ public class GLDrawableHelper {
               System.err.println("GLDrawableHelper.forceNativeRelease() #"+releaseCount+" -- currentThread "+Thread.currentThread()+" -> "+GLContext.getCurrent());
           }
       } while( MAX_RELEASE_ITER > releaseCount && ctx.isCurrent() );
-      
+
       if( ctx.isCurrent() ) {
           throw new GLException("Context still current after "+MAX_RELEASE_ITER+" releases: "+ctx);
       }
   }
-        
+
   /**
    * Switch {@link GLContext} / {@link GLDrawable} association.
    * <p>
    * The <code>oldCtx</code> will be destroyed if <code>destroyPrevCtx</code> is <code>true</code>,
-   * otherwise dis-associate <code>oldCtx</code> from <code>drawable</code> 
+   * otherwise dis-associate <code>oldCtx</code> from <code>drawable</code>
    * via {@link GLContext#setGLDrawable(GLDrawable, boolean) oldCtx.setGLDrawable(null, true);}.
    * </p>
    * <p>
-   * Re-associate <code>newCtx</code> with <code>drawable</code> 
+   * Re-associate <code>newCtx</code> with <code>drawable</code>
    * via {@link GLContext#setGLDrawable(GLDrawable, boolean) newCtx.setGLDrawable(drawable, true);}.
    * </p>
-   * <p> 
+   * <p>
    * If the old or new context was current on this thread, it is being released before switching the drawable.
    * </p>
    * <p>
    * No locking is being performed on the drawable, caller is required to take care of it.
    * </p>
-   * 
+   *
    * @param drawable the drawable which context is changed
    * @param oldCtx the old context, maybe <code>null</code>.
    * @param destroyOldCtx if <code>true</code>, destroy the <code>oldCtx</code>
    * @param newCtx the new context, maybe <code>null</code> for dis-association.
    * @param newCtxCreationFlags additional creation flags if newCtx is not null and not been created yet, see {@link GLContext#setContextCreationFlags(int)}
-   *  
+   *
    * @see GLAutoDrawable#setContext(GLContext, boolean)
    */
   public static final void switchContext(GLDrawable drawable, GLContext oldCtx, boolean destroyOldCtx, GLContext newCtx, int newCtxCreationFlags) {
@@ -178,16 +178,16 @@ public class GLDrawableHelper {
               oldCtx.setGLDrawable(null, true); // dis-associate old pair
           }
       }
-      
+
       if(null!=newCtx) {
           newCtx.setContextCreationFlags(newCtxCreationFlags);
-          newCtx.setGLDrawable(drawable, true); // re-associate new pair          
+          newCtx.setGLDrawable(drawable, true); // re-associate new pair
       }
   }
-  
+
   /**
    * If the drawable is not realized, OP is a NOP.
-   * <ul> 
+   * <ul>
    *  <li>release context if current</li>
    *  <li>destroy old drawable</li>
    *  <li>create new drawable</li>
@@ -197,12 +197,12 @@ public class GLDrawableHelper {
    * <p>
    * Locking is performed via {@link GLContext#makeCurrent()} on the passed <code>context</code>.
    * </p>
-   * 
+   *
    * @param drawable
    * @param context maybe null
    * @return the new drawable
    */
-  public static final GLDrawableImpl recreateGLDrawable(GLDrawableImpl drawable, GLContext context) {      
+  public static final GLDrawableImpl recreateGLDrawable(GLDrawableImpl drawable, GLContext context) {
       if( ! drawable.isRealized() ) {
           return drawable;
       }
@@ -210,7 +210,7 @@ public class GLDrawableHelper {
       final GLDrawableFactory factory = drawable.getFactory();
       final NativeSurface surface = drawable.getNativeSurface();
       final ProxySurface proxySurface = (surface instanceof ProxySurface) ? (ProxySurface)surface : null;
-      
+
       if( null != context ) {
           // Ensure to sync GL command stream
           if( currentContext != context ) {
@@ -219,7 +219,7 @@ public class GLDrawableHelper {
           context.getGL().glFinish();
           context.setGLDrawable(null, true); // dis-associate
       }
-      
+
       if(null != proxySurface) {
           proxySurface.enableUpstreamSurfaceHookLifecycle(false);
       }
@@ -236,18 +236,18 @@ public class GLDrawableHelper {
       if(null != context) {
           context.setGLDrawable(drawable, true); // re-association
       }
-      
+
       if( null != currentContext ) {
           currentContext.makeCurrent();
       }
       return drawable;
   }
-   
+
   /**
    * Performs resize operation on the given drawable, assuming it is offscreen.
    * <p>
    * The {@link GLDrawableImpl}'s {@link NativeSurface} is being locked during operation.
-   * In case the holder is an auto drawable or similar, it's lock shall be claimed by the caller. 
+   * In case the holder is an auto drawable or similar, it's lock shall be claimed by the caller.
    * </p>
    * <p>
    * May recreate the drawable via {@link #recreateGLDrawable(GLDrawableImpl, GLContext)}
@@ -257,10 +257,10 @@ public class GLDrawableHelper {
    * FBO drawables are resized w/o drawable destruction.
    * </p>
    * <p>
-   * Offscreen resize operation is validated w/ drawable size in the end. 
+   * Offscreen resize operation is validated w/ drawable size in the end.
    * An exception is thrown if not successful.
    * </p>
-   * 
+   *
    * @param drawable
    * @param context
    * @param newWidth the new width, it's minimum is capped to 1
@@ -270,7 +270,7 @@ public class GLDrawableHelper {
    * @throws GLException may be thrown a resize operation
    */
   public static final GLDrawableImpl resizeOffscreenDrawable(GLDrawableImpl drawable, GLContext context, int newWidth, int newHeight)
-          throws NativeWindowException, GLException 
+          throws NativeWindowException, GLException
   {
       if(drawable.getChosenGLCapabilities().isOnscreen()) {
           throw new NativeWindowException("Drawable is not offscreen: "+drawable);
@@ -288,7 +288,7 @@ public class GLDrawableHelper {
           }
           if(0>=newWidth)  { newWidth = 1; validateSize=false; }
           if(0>=newHeight) { newHeight = 1; validateSize=false; }
-          // propagate new size 
+          // propagate new size
           if(ns instanceof ProxySurface) {
               final ProxySurface ps = (ProxySurface) ns;
               final UpstreamSurfaceHook ush = ps.getUpstreamSurfaceHook();
@@ -301,7 +301,7 @@ public class GLDrawableHelper {
               System.err.println("GLDrawableHelper.resizeOffscreenDrawable: Drawable's offscreen surface n.a. ProxySurface, but "+ns.getClass().getName()+": "+ns);
           }
           if(drawable instanceof GLFBODrawable) {
-              if( null != context && context.isCreated() ) {                      
+              if( null != context && context.isCreated() ) {
                   ((GLFBODrawable) drawable).resetSize(context.getGL());
               }
           } else {
@@ -315,7 +315,7 @@ public class GLDrawableHelper {
       }
       return drawable;
   }
-    
+
   public final void addGLEventListener(GLEventListener listener) {
     addGLEventListener(-1, listener);
   }
@@ -328,14 +328,14 @@ public class GLDrawableHelper {
         // GLEventListener may be added after context is created,
         // hence we earmark initialization for the next display call.
         listenersToBeInit.add(listener);
-        
+
         listeners.add(index, listener);
     }
   }
 
   /**
    * Note that no {@link GLEventListener#dispose(GLAutoDrawable)} call is being issued
-   * due to the lack of a current context. 
+   * due to the lack of a current context.
    * Consider calling {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)}.
    * @return the removed listener, or null if listener was not added
    */
@@ -356,11 +356,11 @@ public class GLDrawableHelper {
         return listener;
     }
   }
-  
+
   public final int getGLEventListenerCount() {
     synchronized(listenersLock) {
         return listeners.size();
-    }      
+    }
   }
 
   public final GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
@@ -371,13 +371,13 @@ public class GLDrawableHelper {
         return listeners.get(index);
     }
   }
-  
+
   public final boolean getGLEventListenerInitState(GLEventListener listener) {
     synchronized(listenersLock) {
         return !listenersToBeInit.contains(listener);
     }
   }
-  
+
   public final void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
     synchronized(listenersLock) {
         if(initialized) {
@@ -387,16 +387,16 @@ public class GLDrawableHelper {
         }
     }
   }
-  
+
   /**
-   * Disposes the given {@link GLEventListener} via {@link GLEventListener#dispose(GLAutoDrawable)} 
+   * Disposes the given {@link GLEventListener} via {@link GLEventListener#dispose(GLAutoDrawable)}
    * if it has been initialized and added to this queue.
    * <p>
    * If <code>remove</code> is <code>true</code>, the {@link GLEventListener} is removed from this drawable queue before disposal,
    * otherwise marked uninitialized.
    * </p>
    * <p>
-   * Please consider using {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)} 
+   * Please consider using {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)}
    * for correctness, i.e. encapsulating all calls w/ makeCurrent etc.
    * </p>
    * @param autoDrawable
@@ -405,9 +405,9 @@ public class GLDrawableHelper {
    */
   public final GLEventListener disposeGLEventListener(GLAutoDrawable autoDrawable, GLEventListener listener, boolean remove) {
       synchronized(listenersLock) {
-          if( remove ) {              
+          if( remove ) {
               if( listeners.remove(listener) ) {
-                  if( !listenersToBeInit.remove(listener) ) {              
+                  if( !listenersToBeInit.remove(listener) ) {
                       listener.dispose(autoDrawable);
                   }
                   return listener;
@@ -417,12 +417,12 @@ public class GLDrawableHelper {
                   listener.dispose(autoDrawable);
                   listenersToBeInit.add(listener);
                   return listener;
-              }              
+              }
           }
       }
       return null;
   }
-  
+
   /**
    * Disposes all added initialized {@link GLEventListener}s via {@link GLEventListener#dispose(GLAutoDrawable)}.
    * <p>
@@ -456,20 +456,20 @@ public class GLDrawableHelper {
                   listenersToBeInit.add(listener);
                   disposeCount++;
               }
-            }            
+            }
         }
     }
     return disposeCount;
   }
 
   /**
-   * Principal helper method which runs {@link #disposeGLEventListener(GLAutoDrawable, GLEventListener, boolean)} 
+   * Principal helper method which runs {@link #disposeGLEventListener(GLAutoDrawable, GLEventListener, boolean)}
    * with the context made current.
    * <p>
-   * If an {@link GLAnimatorControl} is being attached and the current thread is different 
+   * If an {@link GLAnimatorControl} is being attached and the current thread is different
    * than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
    * </p>
-   * 
+   *
    * @param autoDrawable
    * @param context
    * @param listener
@@ -477,7 +477,7 @@ public class GLDrawableHelper {
    */
   public final GLEventListener disposeGLEventListener(final GLAutoDrawable autoDrawable,
                                                       final GLDrawable drawable,
-                                                      final GLContext context, 
+                                                      final GLContext context,
                                                       final GLEventListener listener,
                                                       final boolean remove) {
       synchronized(listenersLock) {
@@ -485,7 +485,7 @@ public class GLDrawableHelper {
           if( listenersToBeInit.contains(listener) ) {
              if( remove ) {
                  listenersToBeInit.remove(listener);
-                 return listeners.remove(listener) ? listener : null; 
+                 return listeners.remove(listener) ? listener : null;
              }
              return null;
           }
@@ -498,21 +498,21 @@ public class GLDrawableHelper {
           }
       };
       invokeGL(drawable, context, action, nop);
-      
+
       if(isPaused) {
           animatorCtrl.resume();
       }
       return res[0];
   }
-  
+
   /**
-   * Principal helper method which runs {@link #disposeAllGLEventListener(GLAutoDrawable, boolean)} 
+   * Principal helper method which runs {@link #disposeAllGLEventListener(GLAutoDrawable, boolean)}
    * with the context made current.
    * <p>
-   * If an {@link GLAnimatorControl} is being attached and the current thread is different 
+   * If an {@link GLAnimatorControl} is being attached and the current thread is different
    * than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
    * </p>
-   * 
+   *
    * @param autoDrawable
    * @param context
    * @param remove
@@ -521,21 +521,21 @@ public class GLDrawableHelper {
                                               final GLDrawable drawable,
                                               final GLContext context,
                                               final boolean remove) {
-      
+
       final boolean isPaused = isAnimatorAnimatingOnOtherThread() && animatorCtrl.pause();
-      
+
       final Runnable action = new Runnable() {
           public void run() {
               disposeAllGLEventListener(autoDrawable, remove);
           }
       };
       invokeGL(drawable, context, action, nop);
-      
+
       if(isPaused) {
           animatorCtrl.resume();
       }
   }
-  
+
   private final void init(GLEventListener l, GLAutoDrawable drawable, boolean sendReshape, boolean setViewport) {
       l.init(drawable);
       if(sendReshape) {
@@ -543,8 +543,8 @@ public class GLDrawableHelper {
       }
   }
 
-  /** 
-   * The default init action to be called once after ctx is being created @ 1st makeCurrent(). 
+  /**
+   * The default init action to be called once after ctx is being created @ 1st makeCurrent().
    * @param sendReshape set to true if the subsequent display call won't reshape, otherwise false to avoid double reshape.
    **/
   public final void init(GLAutoDrawable drawable, boolean sendReshape) {
@@ -554,7 +554,7 @@ public class GLDrawableHelper {
         if( listenerCount > 0 ) {
             for (int i=0; i < listenerCount; i++) {
               final GLEventListener listener = _listeners.get(i) ;
-    
+
               // If make ctx current, invoked by invokGL(..), results in a new ctx, init gets called.
               // This may happen not just for initial setup, but for ctx recreation due to resource change (drawable/window),
               // hence it must be called unconditional, always.
@@ -571,7 +571,7 @@ public class GLDrawableHelper {
   public final void display(GLAutoDrawable drawable) {
     displayImpl(drawable);
     if( glRunnables.size()>0 && !execGLRunnables(drawable) ) { // glRunnables volatile OK; execGL.. only executed if size > 0
-        displayImpl(drawable);  
+        displayImpl(drawable);
     }
   }
   private final void displayImpl(GLAutoDrawable drawable) {
@@ -580,7 +580,7 @@ public class GLDrawableHelper {
           final int listenerCount = _listeners.size();
           for (int i=0; i < listenerCount; i++) {
             final GLEventListener listener = _listeners.get(i) ;
-            // GLEventListener may need to be init, 
+            // GLEventListener may need to be init,
             // in case this one is added after the realization of the GLAutoDrawable
             if( listenersToBeInit.remove(listener) ) {
                 init( listener, drawable, true /* sendReshape */, listenersToBeInit.size() + 1 == listenerCount /* setViewport if 1st init */ );
@@ -589,11 +589,11 @@ public class GLDrawableHelper {
           }
       }
   }
-  
+
   private final void reshape(GLEventListener listener, GLAutoDrawable drawable,
                              int x, int y, int width, int height, boolean setViewport, boolean checkInit) {
     if(checkInit) {
-        // GLEventListener may need to be init, 
+        // GLEventListener may need to be init,
         // in case this one is added after the realization of the GLAutoDrawable
         synchronized(listenersLock) {
             if( listenersToBeInit.remove(listener) ) {
@@ -627,7 +627,7 @@ public class GLDrawableHelper {
             _glRunnables = null;
         }
     }
-    
+
     if(null!=_glRunnables) {
         for (int i=0; i < _glRunnables.size(); i++) {
             res = _glRunnables.get(i).run(drawable) && res;
@@ -648,7 +648,7 @@ public class GLDrawableHelper {
                 _glRunnables = null;
             }
         }
-        
+
         if(null!=_glRunnables) {
             for (int i=0; i < _glRunnables.size(); i++) {
                 _glRunnables.get(i).flush();
@@ -656,7 +656,7 @@ public class GLDrawableHelper {
         }
     }
   }
-  
+
   public final void setAnimator(GLAnimatorControl animator) throws GLException {
     synchronized(glRunnablesLock) {
         if(animatorCtrl!=animator && null!=animator && null!=animatorCtrl) {
@@ -693,7 +693,7 @@ public class GLDrawableHelper {
    * If <code>wait</code> is <code>true</code> the call blocks until the <code>glRunnable</code>
    * has been executed.<p>
    * <p>
-   * If <code>wait</code> is <code>true</code> <b>and</b> 
+   * If <code>wait</code> is <code>true</code> <b>and</b>
    * {@link GLDrawable#isRealized()} returns <code>false</code> <i>or</i> {@link GLAutoDrawable#getContext()} returns <code>null</code>,
    * the call is ignored and returns <code>false</code>.<br>
    * This helps avoiding deadlocking the caller.
@@ -709,7 +709,7 @@ public class GLDrawableHelper {
         wait && ( !drawable.isRealized() || null==drawable.getContext() ) ) {
         return false;
     }
-    
+
     GLRunnableTask rTask = null;
     Object rTaskLock = new Object();
     Throwable throwable = null;
@@ -743,13 +743,13 @@ public class GLDrawableHelper {
     }
     return true;
   }
-  
+
   public final boolean invoke(GLAutoDrawable drawable, boolean wait, List<GLRunnable> newGLRunnables) {
     if( null == newGLRunnables || newGLRunnables.size() == 0 || null == drawable ||
         wait && ( !drawable.isRealized() || null==drawable.getContext() ) ) {
         return false;
     }
-    
+
     final int count = newGLRunnables.size();
     GLRunnableTask rTask = null;
     Object rTaskLock = new Object();
@@ -785,18 +785,18 @@ public class GLDrawableHelper {
             }
         }
     }
-    return true;      
+    return true;
   }
 
   public final void enqueue(GLRunnable glRunnable) {
     if( null == glRunnable) {
         return;
-    }    
+    }
     synchronized(glRunnablesLock) {
         glRunnables.add( new GLRunnableTask(glRunnable, null, false) );
     }
   }
-  
+
   public final void setAutoSwapBufferMode(boolean enable) {
     autoSwapBufferMode = enable;
   }
@@ -812,17 +812,17 @@ public class GLDrawableHelper {
   /**
    * Dedicates this instance's {@link GLContext} to the given thread.<br/>
    * The thread will exclusively claim the {@link GLContext} via {@link #display()} and not release it
-   * until {@link #destroy()} or <code>setExclusiveContextThread(null)</code> has been called. 
+   * until {@link #destroy()} or <code>setExclusiveContextThread(null)</code> has been called.
    * <p>
    * Default non-exclusive behavior is <i>requested</i> via <code>setExclusiveContextThread(null)</code>,
-   * which will cause the next call of {@link #display()} on the exclusive thread to 
-   * release the {@link GLContext}. Only after it's async release, {@link #getExclusiveContextThread()} 
+   * which will cause the next call of {@link #display()} on the exclusive thread to
+   * release the {@link GLContext}. Only after it's async release, {@link #getExclusiveContextThread()}
    * will return <code>null</code>.
    * </p>
    * <p>
    * To release a previous made exclusive thread, a user issues <code>setExclusiveContextThread(null)</code>
-   * and may poll {@link #getExclusiveContextThread()} until it returns <code>null</code>, 
-   * <i>while</i> the exclusive thread is still running.  
+   * and may poll {@link #getExclusiveContextThread()} until it returns <code>null</code>,
+   * <i>while</i> the exclusive thread is still running.
    * </p>
    * <p>
    * Note: Setting a new exclusive thread without properly releasing a previous one
@@ -833,7 +833,7 @@ public class GLDrawableHelper {
    * and spare redundant context switches.
    * </p>
    * @param t the exclusive thread to claim the context, or <code>null</code> for default operation.
-   * @return previous exclusive context thread 
+   * @return previous exclusive context thread
    * @throws GLException If an exclusive thread is still active but a new one is attempted to be set
    */
   public final Thread setExclusiveContextThread(Thread t, GLContext context) throws GLException {
@@ -857,7 +857,7 @@ public class GLDrawableHelper {
                 ex.printStackTrace();
                 throw new GLException(ex);
             }
-        }        
+        }
         exclusiveContextThread = t;
     }
     if (DEBUG) {
@@ -865,14 +865,14 @@ public class GLDrawableHelper {
     }
     return oldExclusiveContextThread;
   }
-  
+
   /**
-   * @see #setExclusiveContextThread(Thread, GLContext) 
+   * @see #setExclusiveContextThread(Thread, GLContext)
    */
   public final Thread getExclusiveContextThread() {
     return exclusiveContextThread;
   }
-  
+
   private static final ThreadLocal<Runnable> perThreadInitAction = new ThreadLocal<Runnable>();
 
   /** Principal helper method which runs a Runnable with the context
@@ -904,15 +904,15 @@ public class GLDrawableHelper {
     }
 
     if(PERF_STATS) {
-        invokeGLImplStats(drawable, context, runnable, initAction);    
+        invokeGLImplStats(drawable, context, runnable, initAction);
     } else {
         invokeGLImpl(drawable, context, runnable, initAction);
     }
   }
 
-  /** 
-   * Principal helper method which runs 
-   * {@link #disposeAllGLEventListener(GLAutoDrawable, boolean) disposeAllGLEventListener(autoDrawable, false)} 
+  /**
+   * Principal helper method which runs
+   * {@link #disposeAllGLEventListener(GLAutoDrawable, boolean) disposeAllGLEventListener(autoDrawable, false)}
    * with the context made current.
    * <p>
    * If <code>destroyContext</code> is <code>true</code> the context is destroyed in the end while holding the lock.
@@ -940,7 +940,7 @@ public class GLDrawableHelper {
         }
     }
 
-    int res;    
+    int res;
     try {
       res = context.makeCurrent();
       if (GLContext.CONTEXT_NOT_CURRENT != res) {
@@ -975,7 +975,7 @@ public class GLDrawableHelper {
   private final void invokeGLImpl(final GLDrawable drawable,
           final GLContext context,
           final Runnable  runnable,
-          final Runnable  initAction) {                                  
+          final Runnable  initAction) {
       final Thread currentThread = Thread.currentThread();
 
       // Exclusive Cases:
@@ -1013,7 +1013,7 @@ public class GLDrawableHelper {
               lastContext.release();
           }
       }
-      
+
       try {
           final boolean releaseContext;
           if( GLContext.CONTEXT_NOT_CURRENT == res ) {
@@ -1110,7 +1110,7 @@ public class GLDrawableHelper {
       long tdX = 0; // release
       boolean ctxClaimed = false;
       boolean ctxReleased = false;
-      boolean ctxDestroyed = false;    
+      boolean ctxDestroyed = false;
       try {
           final boolean releaseContext;
           if( GLContext.CONTEXT_NOT_CURRENT == res ) {
@@ -1129,7 +1129,7 @@ public class GLDrawableHelper {
                       }
                       initAction.run();
                   }
-                  tdR = System.currentTimeMillis();        
+                  tdR = System.currentTimeMillis();
                   tdA = tdR - t0; // makeCurrent
                   runnable.run();
                   tdS = System.currentTimeMillis();
@@ -1172,5 +1172,5 @@ public class GLDrawableHelper {
   }
 
   protected static String getThreadName() { return Thread.currentThread().getName(); }
-    
+
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
index e1088da29..a79a3cf25 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
@@ -53,11 +53,11 @@ import javax.media.opengl.GLProfile;
 
 public abstract class GLDrawableImpl implements GLDrawable {
   protected static final boolean DEBUG = GLDrawableFactoryImpl.DEBUG;
-  
+
   protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
       this(factory, comp, (GLCapabilitiesImmutable) comp.getGraphicsConfiguration().getRequestedCapabilities(), realized);
   }
-  
+
   protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, GLCapabilitiesImmutable requestedCapabilities, boolean realized) {
       this.factory = factory;
       this.surface = comp;
@@ -100,20 +100,20 @@ public abstract class GLDrawableImpl implements GLDrawable {
         }
     } finally {
         unlockSurface();
-    }        
+    }
     surface.surfaceUpdated(this, surface, System.currentTimeMillis());
   }
-  
+
   /**
    * Platform and implementation depending surface swap.
    * <p>The surface is locked.</p>
    * <p>
-   * If <code>doubleBuffered</code> is <code>true</code>, 
+   * If <code>doubleBuffered</code> is <code>true</code>,
    * an actual platform dependent surface swap shall be executed.
    * </p>
    * <p>
-   * If <code>doubleBuffered</code> is <code>false</code>, 
-   * {@link GL#glFlush()} has been called already and 
+   * If <code>doubleBuffered</code> is <code>false</code>,
+   * {@link GL#glFlush()} has been called already and
    * the implementation may execute implementation specific code.
    * </p>
    * @param doubleBuffered indicates whether double buffering is enabled, see above.
@@ -143,19 +143,19 @@ public abstract class GLDrawableImpl implements GLDrawable {
     return surface;
   }
 
-  /** 
+  /**
    * called with locked surface @ setRealized(false) or @ lockSurface(..) when surface changed
    * <p>
    * Must be paired w/ {@link #createHandle()}.
-   * </p> 
+   * </p>
    */
   protected void destroyHandle() {}
 
-  /** 
+  /**
    * called with locked surface @ setRealized(true) or @ lockSurface(..) when surface changed
    * <p>
    * Must be paired w/ {@link #destroyHandle()}.
-   * </p> 
+   * </p>
    */
   protected void createHandle() {}
 
@@ -213,16 +213,16 @@ public abstract class GLDrawableImpl implements GLDrawable {
         System.err.println(getThreadName() + ": setRealized: "+getClass().getName()+" "+this.realized+" == "+realizedArg);
     }
   }
-  
+
   /**
-   * Platform specific realization of drawable 
+   * Platform specific realization of drawable
    */
   protected abstract void setRealizedImpl();
 
   /**
    * Callback for special implementations, allowing
    * <ul>
-   *   <li>to associate bound context to this drawable (bound == true) 
+   *   <li>to associate bound context to this drawable (bound == true)
    *       or to remove such association (bound == false).</li>
    *   <li>to trigger GLContext/GLDrawable related lifecycle: <code>construct</code>, <code>destroy</code>.</li>
    * </ul>
@@ -239,8 +239,8 @@ public abstract class GLDrawableImpl implements GLDrawable {
    * @param bound if <code>true</code> create an association, otherwise remove it
    */
   protected void associateContext(GLContext ctx, boolean bound) { }
-  
-  /** 
+
+  /**
    * Callback for special implementations, allowing GLContext to trigger GL related lifecycle: <code>makeCurrent</code>, <code>release</code>.
    * <p>
    * If <code>current</code> is <code>true</code>, the context has just been made current.
@@ -252,13 +252,13 @@ public abstract class GLDrawableImpl implements GLDrawable {
    * Being called by {@link GLContextImpl#contextMadeCurrent(boolean)}.
    * </p>
    * @see #associateContext(GLContext, boolean)
-   */ 
+   */
   protected void contextMadeCurrent(GLContext glc, boolean current) { }
 
   /** Callback for special implementations, allowing GLContext to fetch a custom default render framebuffer. Defaults to zero.*/
   protected int getDefaultDrawFramebuffer() { return 0; }
   /** Callback for special implementations, allowing GLContext to fetch a custom default read framebuffer. Defaults to zero. */
-  protected int getDefaultReadFramebuffer() { return 0; }  
+  protected int getDefaultReadFramebuffer() { return 0; }
   /** Callback for special implementations, allowing GLContext to fetch a custom default read buffer of current framebuffer. */
   protected int getDefaultReadBuffer(GL gl) {
       if(gl.isGLES() || getChosenGLCapabilities().getDoubleBuffered()) {
@@ -266,9 +266,9 @@ public abstract class GLDrawableImpl implements GLDrawable {
           // Note-2: ES3 only supports GL_BACK, GL_NONE or GL_COLOR_ATTACHMENT0+i
           return GL.GL_BACK;
       }
-      return GL.GL_FRONT ; 
+      return GL.GL_FRONT ;
   }
-  
+
   @Override
   public final boolean isRealized() {
     return realized;
@@ -286,22 +286,22 @@ public abstract class GLDrawableImpl implements GLDrawable {
 
   @Override
   public boolean isGLOriented() {
-      return true;      
+      return true;
   }
-  
-  /** 
+
+  /**
    * {@link NativeSurface#lockSurface() Locks} the underlying windowing toolkit's {@link NativeSurface surface}.
    * <p>
    * <i>If</i> drawable is {@link #setRealized(boolean) realized},
-   * the {@link #getHandle() drawable handle} is valid after successfully {@link NativeSurface#lockSurface() locking} 
+   * the {@link #getHandle() drawable handle} is valid after successfully {@link NativeSurface#lockSurface() locking}
    * it's {@link NativeSurface surface} until being {@link #unlockSurface() unlocked}.
    * </p>
    * <p>
-   * In case the {@link NativeSurface surface} has changed as indicated by it's 
+   * In case the {@link NativeSurface surface} has changed as indicated by it's
    * {@link NativeSurface#lockSurface() lock} result {@link NativeSurface#LOCK_SURFACE_CHANGED},
-   * the implementation is required to update this information as needed within it's implementation. 
+   * the implementation is required to update this information as needed within it's implementation.
    * </p>
-   * 
+   *
    * @see NativeSurface#lockSurface()
    * @see #getHandle()
    */
@@ -312,7 +312,7 @@ public abstract class GLDrawableImpl implements GLDrawable {
         final long _handle1 = getHandle();
         destroyHandle();
         createHandle();
-        final long _handle2 = getHandle();        
+        final long _handle2 = getHandle();
         if(DEBUG) {
             if( _handle1 != _handle2) {
                 System.err.println(getThreadName() + ": Drawable handle changed: "+toHexString(_handle1)+" -> "+toHexString(_handle2));
@@ -320,14 +320,14 @@ public abstract class GLDrawableImpl implements GLDrawable {
         }
     }
     return lockRes;
-    
+
   }
 
-  /** 
+  /**
    * {@link NativeSurface#unlockSurface() Unlocks} the underlying windowing toolkit {@link NativeSurface surface},
    * which may render the {@link #getHandle() drawable handle} invalid.
-   * 
-   * @see NativeSurface#unlockSurface() 
+   *
+   * @see NativeSurface#unlockSurface()
    * @see #getHandle()
    */
   public final void unlockSurface() {
diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
index 8ba9f617b..640e181ae 100644
--- a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl;
 
 import com.jogamp.common.os.DynamicLibraryBundle;
@@ -36,7 +36,7 @@ public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundle
     protected GLDynamicLibraryBundleInfo() {
     }
 
-    /** 
+    /**
      * Returns <code>true</code>,
      * since we might load a desktop GL library and allow symbol access to subsequent libs.
      * <p>
@@ -47,19 +47,19 @@ public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundle
      * </p>
      */
     public final boolean shallLinkGlobal() { return true; }
-    
+
     /**
      * {@inheritDoc}
      * <p>
      * Returns <code>false</code>.
      * </p>
-     */ 
+     */
     @Override
     public boolean shallLookupGlobal() { return false; }
 
     @Override
     public final RunnableExecutor getLibLoaderExecutor() {
         return DynamicLibraryBundle.getDefaultRunnableExecutor();
-    }    
+    }
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
index 1ed73f15e..421f06205 100644
--- a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl;
 
 import com.jogamp.common.os.DynamicLibraryBundle;
diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
index f2248b388..ab318927c 100644
--- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
@@ -26,11 +26,11 @@ import com.jogamp.opengl.JoglVersion;
  * to initialize the {@link FBObject} instance.
  * </p>
  * <p>
- * It utilizes the context current hook {@link #contextMadeCurrent(GLContext, boolean) contextMadeCurrent(context, true)} 
+ * It utilizes the context current hook {@link #contextMadeCurrent(GLContext, boolean) contextMadeCurrent(context, true)}
  * to {@link FBObject#bind(GL) bind} the FBO.
  * </p>
  * See {@link GLFBODrawable} for double buffering details.
- * 
+ *
  * @see GLDrawableImpl#contextRealized(GLContext, boolean)
  * @see GLDrawableImpl#contextMadeCurrent(GLContext, boolean)
  * @see GLDrawableImpl#getDefaultDrawFramebuffer()
@@ -39,21 +39,21 @@ import com.jogamp.opengl.JoglVersion;
 public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     protected static final boolean DEBUG;
     protected static final boolean DEBUG_SWAP;
-    
+
     static {
         Debug.initSingleton();
         DEBUG = GLDrawableImpl.DEBUG || Debug.debug("FBObject");
         DEBUG_SWAP = DEBUG || Debug.isPropertyDefined("jogl.debug.FBObject.Swap", true);
     }
-    
+
     private final GLDrawableImpl parent;
     private GLCapabilitiesImmutable origParentChosenCaps;
-    
+
     private boolean initialized;
     private int texUnit;
     private int samples;
     private boolean fboResetQuirk;
-    
+
     private FBObject[] fbos;
     private int fboIBack;  // points to GL_BACK buffer
     private int fboIFront; // points to GL_FRONT buffer
@@ -64,19 +64,19 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     private boolean fboSwapped;
 
     /** dump fboResetQuirk info only once pre ClassLoader and only in DEBUG mode */
-    private static volatile boolean resetQuirkInfoDumped = false; 
-    
+    private static volatile boolean resetQuirkInfoDumped = false;
+
     /** number of FBOs for double buffering. TODO: Possible to configure! */
-    private static final int bufferCount = 2; 
-    
+    private static final int bufferCount = 2;
+
     // private DoubleBufferMode doubleBufferMode; // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
-    
+
     private SwapBufferContext swapBufferContext;
-    
+
     public static interface SwapBufferContext {
         public void swapBuffers(boolean doubleBuffered);
     }
-    
+
     /**
      * @param factory
      * @param parent
@@ -84,7 +84,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
      * @param fboCaps the requested FBO capabilities
      * @param textureUnit
      */
-    protected GLFBODrawableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, NativeSurface surface, 
+    protected GLFBODrawableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, NativeSurface surface,
                                 GLCapabilitiesImmutable fboCaps, int textureUnit) {
         super(factory, surface, fboCaps, false);
         this.initialized = false;
@@ -94,13 +94,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         this.texUnit = textureUnit;
         this.samples = fboCaps.getNumSamples();
         fboResetQuirk = false;
-        
+
         // default .. // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
         // this.doubleBufferMode = ( samples > 0 || fboCaps.getDoubleBuffered() ) ? DoubleBufferMode.FBO : DoubleBufferMode.NONE ;
-        
+
         this.swapBufferContext = null;
     }
-    
+
     private final void initialize(boolean realize, GL gl) {
         if( !initialized && !realize ) {
             if( DEBUG ) {
@@ -114,7 +114,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         }
         if(realize) {
             final GLCapabilities chosenFBOCaps = (GLCapabilities) getChosenGLCapabilities(); // cloned at setRealized(true)
-            
+
             final int maxSamples = gl.getMaxRenderbufferSamples();
             {
                 final int newSamples = samples <= maxSamples ? samples : maxSamples;
@@ -123,7 +123,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                 }
                 samples = newSamples;
             }
-            
+
             final int fbosN;
             if(samples > 0) {
                 fbosN = 1;
@@ -136,7 +136,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
             fbos = new FBObject[fbosN];
             fboIBack = 0;                // head
             fboIFront = fbos.length - 1; // tail
-            
+
             for(int i=0; i<fbosN; i++) {
                 fbos[i] = new FBObject();
                 fbos[i].reset(gl, getWidth(), getHeight(), samples, false);
@@ -168,13 +168,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         fboSwapped = false;
         pendingFBOReset = -1;
         initialized = realize;
-        
+
         if(DEBUG) {
             System.err.println("GLFBODrawableImpl.initialize("+realize+"): "+this);
             Thread.dumpStack();
         }
     }
-    
+
     public final void setSwapBufferContext(SwapBufferContext sbc) {
         swapBufferContext = sbc;
     }
@@ -200,7 +200,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                             System.err.println(joglVersion.toString());
                             System.err.println(JoglVersion.getGLInfo(gl, null));
                         } else {
-                            System.err.println(joglVersion.getBriefOSGLBuildInfo(gl, null));                        
+                            System.err.println(joglVersion.getBriefOSGLBuildInfo(gl, null));
                         }
                         e.printStackTrace();
                     }
@@ -226,16 +226,16 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
             fbos[idx].attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
         }
     }
-        
+
     private final void reset(GL gl, int newSamples) throws GLException {
         if(!initialized) {
             // NOP if not yet initializes
             return;
         }
-                
+
         final GLContext curContext = GLContext.getCurrent();
         final GLContext ourContext = gl.getContext();
-        final boolean ctxSwitch = null != curContext && curContext != ourContext; 
+        final boolean ctxSwitch = null != curContext && curContext != ourContext;
         if(DEBUG) {
             System.err.println("GLFBODrawableImpl.reset(newSamples "+newSamples+"): BEGIN - ctxSwitch "+ctxSwitch+", "+this);
             Thread.dumpStack();
@@ -247,9 +247,9 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         fboBound = false; // clear bound-flag immediatly, caused by contextMadeCurrent(..) - otherwise we would swap @ release
         fboSwapped = false;
         try {
-            final int maxSamples = gl.getMaxRenderbufferSamples();        
+            final int maxSamples = gl.getMaxRenderbufferSamples();
             newSamples = newSamples <= maxSamples ? newSamples : maxSamples;
-            
+
             if(0==samples && 0<newSamples || 0<samples && 0==newSamples) {
                 // MSAA on/off switch
                 if(DEBUG) {
@@ -258,7 +258,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                 initialize(false, gl);
                 samples = newSamples;
                 initialize(true, gl);
-            } else {            
+            } else {
                 if(DEBUG) {
                     System.err.println("GLFBODrawableImpl.reset(): simple reconfig: "+samples+" -> "+newSamples+"/"+maxSamples);
                 }
@@ -297,11 +297,11 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
             System.err.println("GLFBODrawableImpl.reset(newSamples "+newSamples+"): END "+this);
         }
     }
-    
+
     //
     // GLDrawable
     //
-    
+
     @Override
     public final GLContext createContext(GLContext shareWith) {
         final GLContext ctx = parent.createContext(shareWith);
@@ -312,7 +312,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     //
     // GLDrawableImpl
     //
-    
+
     @Override
     public final GLDynamicLookupHelper getGLDynamicLookupHelper() {
         return parent.getGLDynamicLookupHelper();
@@ -320,13 +320,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
 
     @Override
     protected final int getDefaultDrawFramebuffer() { return initialized ? fbos[fboIBack].getWriteFramebuffer() : 0; }
-    
+
     @Override
     protected final int getDefaultReadFramebuffer() { return initialized ? fbos[fboIFront].getReadFramebuffer() : 0; }
 
     @Override
     protected final int getDefaultReadBuffer(GL gl) { return initialized ? fbos[fboIFront].getDefaultReadBuffer() : GL.GL_COLOR_ATTACHMENT0 ; }
-    
+
     @Override
     protected final void setRealizedImpl() {
         final MutableGraphicsConfiguration msConfig = (MutableGraphicsConfiguration) surface.getGraphicsConfiguration();
@@ -341,12 +341,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
             parent.setRealized(false);
         }
     }
-    
+
     @Override
     protected void associateContext(GLContext glc, boolean bound) {
-        initialize(bound, glc.getGL());        
+        initialize(bound, glc.getGL());
     }
-    
+
     @Override
     protected final void contextMadeCurrent(GLContext glc, boolean current) {
         final GL gl = glc.getGL();
@@ -367,7 +367,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
             }
         }
     }
-        
+
     @Override
     protected void swapBuffersImpl(boolean doubleBuffered) {
         final GLContext ctx = GLContext.getCurrent();
@@ -389,7 +389,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
             swapFBOImplPost(ctx);
         }
     }
-    
+
     private final void swapFBOImplPost(GLContext glc) {
         // Safely reset the previous front FBO - after completing propagating swap
         if(0 <= pendingFBOReset) {
@@ -398,18 +398,18 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
             pendingFBOReset = -1;
         }
     }
-    
+
     private final void swapFBOImpl(GLContext glc) {
         final GL gl = glc.getGL();
         fbos[fboIBack].markUnbound(); // fast path, use(gl,..) is called below
-        
+
         if(DEBUG) {
             int _fboIFront = ( fboIFront + 1 ) % fbos.length;
             if(_fboIFront != fboIBack) { throw new InternalError("XXX: "+_fboIFront+"!="+fboIBack); }
         }
         fboIFront = fboIBack;
         fboIBack  = ( fboIBack  + 1 ) % fbos.length;
-        
+
         final Colorbuffer colorbuffer = samples > 0 ? fbos[fboIFront].getSamplingSink() : fbos[fboIFront].getColorbuffer(0);
         final TextureAttachment texAttachment;
         if(colorbuffer instanceof TextureAttachment) {
@@ -423,12 +423,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         }
         gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit);
         fbos[fboIFront].use(gl, texAttachment);
-        
-        /* Included in above use command:  
+
+        /* Included in above use command:
                 gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, fbos[fboIBack].getDrawFramebuffer());
                 gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, fbos[fboIFront].getReadFramebuffer());
         } */
-        
+
         if(DEBUG_SWAP) {
             System.err.println("Post FBO swap(X): fboI back "+fboIBack+", front "+fboIFront+", num "+fbos.length);
         }
@@ -436,62 +436,62 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
 
     //
     // GLFBODrawable
-    // 
-    
+    //
+
     @Override
     public final boolean isInitialized() {
         return initialized;
     }
-    
+
     @Override
     public final void resetSize(GL gl) throws GLException {
         reset(gl, samples);
-    }    
-    
+    }
+
     @Override
     public final int getTextureUnit() { return texUnit; }
-    
+
     @Override
     public final void setTextureUnit(int u) { texUnit = u; }
-    
+
     @Override
     public final int getNumSamples() { return samples; }
-    
+
     @Override
     public void setNumSamples(GL gl, int newSamples) throws GLException {
         if(samples != newSamples) {
             reset(gl, newSamples);
         }
     }
-    
+
     @Override
     public final int setNumBuffers(int bufferCount) throws GLException {
         // FIXME: Implement
         return bufferCount;
     }
-    
+
     @Override
     public final int getNumBuffers() {
         return bufferCount;
     }
-    
+
     /** // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
     @Override
     public final DoubleBufferMode getDoubleBufferMode() {
         return doubleBufferMode;
     }
-    
+
     @Override
     public final void setDoubleBufferMode(DoubleBufferMode mode) throws GLException {
         if(initialized) {
             throw new GLException("Not allowed past initialization: "+this);
-        }        
+        }
         final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getChosenCapabilities();
         if(0 == samples && caps.getDoubleBuffered() && DoubleBufferMode.NONE != mode) {
             doubleBufferMode = mode;
         }
     } */
-    
+
     @Override
     public FBObject getFBObject(int bufferName) throws IllegalArgumentException {
         if(!initialized) {
@@ -509,12 +509,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
             case GL.GL_BACK:
                 res = fbos[fboIBack];
                 break;
-            default: 
+            default:
                 throw new IllegalArgumentException(illegalBufferName+toHexString(bufferName));
-        }        
-        return res;  
+        }
+        return res;
     }
-    
+
     @Override
     public final TextureAttachment getTextureBuffer(int bufferName) throws IllegalArgumentException {
         if(!initialized) {
@@ -536,13 +536,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                     res = (TextureAttachment) fbos[fboIBack].getColorbuffer(0);
                 }
                 break;
-            default: 
+            default:
                 throw new IllegalArgumentException(illegalBufferName+toHexString(bufferName));
-        }        
-        return res;  
+        }
+        return res;
     }
     private static final String illegalBufferName = "Only GL_FRONT and GL_BACK buffer are allowed, passed ";
-    
+
     @Override
     public String toString() {
         return getClass().getSimpleName()+"[Initialized "+initialized+", realized "+isRealized()+", texUnit "+texUnit+", samples "+samples+
@@ -555,13 +555,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                 ",\n\tSurface   "+getNativeSurface()+
                 "]";
     }
-    
+
     public static class ResizeableImpl extends GLFBODrawableImpl implements GLFBODrawable.Resizeable {
-        protected ResizeableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, ProxySurface surface, 
+        protected ResizeableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, ProxySurface surface,
                                  GLCapabilitiesImmutable fboCaps, int textureUnit) {
             super(factory, parent, surface, fboCaps, textureUnit);
         }
-        
+
         @Override
         public final void setSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException {
             if(DEBUG) {
@@ -572,7 +572,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                 throw new NativeWindowException("Could not lock surface: "+this);
             }
             try {
-                // propagate new size 
+                // propagate new size
                 final ProxySurface ps = (ProxySurface) getNativeSurface();
                 final UpstreamSurfaceHook ush = ps.getUpstreamSurfaceHook();
                 if(ush instanceof UpstreamSurfaceHook.MutableSize) {
diff --git a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
index d54da4d28..702fb77de 100644
--- a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
+++ b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
@@ -85,12 +85,12 @@ public class GLGraphicsConfigurationUtil {
         }
         if(isFBO) {
             winattrbits |= FBO_BIT;
-        } 
+        }
         if(isPBuffer ){
             winattrbits |= PBUFFER_BIT;
-        } 
+        }
         if(isBitmap) {
-            winattrbits |= BITMAP_BIT;                
+            winattrbits |= BITMAP_BIT;
         }
         return winattrbits;
     }
@@ -110,7 +110,7 @@ public class GLGraphicsConfigurationUtil {
         } else if(isPBuffer ){
             winattrbits = PBUFFER_BIT;
         } else if(isBitmap) {
-            winattrbits = BITMAP_BIT;                
+            winattrbits = BITMAP_BIT;
         } else {
             throw new InternalError("Empty bitmask");
         }
@@ -136,9 +136,9 @@ public class GLGraphicsConfigurationUtil {
             caps.setHardwareAccelerated(false);
         }
 
-        return caps;        
+        return caps;
     }
-    
+
     /**
      * Fixes the requested  {@link GLCapabilitiesImmutable} according to on- and offscreen usage.
      * <p>
@@ -150,17 +150,17 @@ public class GLGraphicsConfigurationUtil {
      * @param device the device on which the drawable will be created, maybe null for the {@link GLDrawableFactory#getDefaultDevice() default device}.
      * @return either the given requested {@link GLCapabilitiesImmutable} instance if no modifications were required, or a modified {@link GLCapabilitiesImmutable} instance.
      */
-    public static GLCapabilitiesImmutable fixGLCapabilities(GLCapabilitiesImmutable capsRequested, 
+    public static GLCapabilitiesImmutable fixGLCapabilities(GLCapabilitiesImmutable capsRequested,
                                                             GLDrawableFactory factory, AbstractGraphicsDevice device) {
         if( !capsRequested.isOnscreen() ) {
             return fixOffscreenGLCapabilities(capsRequested, factory, device);
         }
         return capsRequested;
     }
-    
+
     public static GLCapabilitiesImmutable fixOnscreenGLCapabilities(GLCapabilitiesImmutable capsRequested)
     {
-        if( !capsRequested.isOnscreen() || capsRequested.isFBO() || capsRequested.isPBuffer() || capsRequested.isBitmap() ) { 
+        if( !capsRequested.isOnscreen() || capsRequested.isFBO() || capsRequested.isPBuffer() || capsRequested.isBitmap() ) {
             // fix caps ..
             final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
             caps2.setBitmap  (false);
@@ -174,7 +174,7 @@ public class GLGraphicsConfigurationUtil {
 
     public static GLCapabilitiesImmutable fixOffscreenBitOnly(GLCapabilitiesImmutable capsRequested)
     {
-        if( capsRequested.isOnscreen() ) { 
+        if( capsRequested.isOnscreen() ) {
             // fix caps ..
             final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
             caps2.setOnscreen(false);
@@ -182,7 +182,7 @@ public class GLGraphicsConfigurationUtil {
         }
         return capsRequested;
     }
-    
+
     /**
      * Fixes the requested  {@link GLCapabilitiesImmutable} according to:
      * <ul>
@@ -203,15 +203,15 @@ public class GLGraphicsConfigurationUtil {
         final GLProfile glp = capsRequested.getGLProfile();
         final boolean fboAvailable = GLContext.isFBOAvailable(device, glp);
         final boolean pbufferAvailable = factory.canCreateGLPbuffer(device, glp);
-        
+
         final GLRendererQuirks glrq = factory.getRendererQuirks(device);
         final boolean bitmapAvailable;
         final boolean doubleBufferAvailable;
-        
+
         if(null != glrq) {
             bitmapAvailable = !glrq.exist(GLRendererQuirks.NoOffscreenBitmap);
             if( capsRequested.getDoubleBuffered() &&
-                ( capsRequested.isPBuffer() && glrq.exist(GLRendererQuirks.NoDoubleBufferedPBuffer) ) || 
+                ( capsRequested.isPBuffer() && glrq.exist(GLRendererQuirks.NoDoubleBufferedPBuffer) ) ||
                 ( capsRequested.isBitmap() && glrq.exist(GLRendererQuirks.NoDoubleBufferedBitmap) ) ) {
                 doubleBufferAvailable = false;
             } else {
@@ -221,25 +221,25 @@ public class GLGraphicsConfigurationUtil {
             bitmapAvailable = true;
             doubleBufferAvailable = true;
         }
-        
-        final boolean auto = !( fboAvailable     && capsRequested.isFBO()     ) && 
-                             !( pbufferAvailable && capsRequested.isPBuffer() ) && 
+
+        final boolean auto = !( fboAvailable     && capsRequested.isFBO()     ) &&
+                             !( pbufferAvailable && capsRequested.isPBuffer() ) &&
                              !( bitmapAvailable  && capsRequested.isBitmap()  ) ;
 
         final boolean useFBO     =                           fboAvailable     && ( auto || capsRequested.isFBO()     ) ;
         final boolean usePbuffer = !useFBO                && pbufferAvailable && ( auto || capsRequested.isPBuffer() ) ;
         final boolean useBitmap  = !useFBO && !usePbuffer && bitmapAvailable  && ( auto || capsRequested.isBitmap()  ) ;
-        
+
         if( capsRequested.isOnscreen() ||
-            useFBO != capsRequested.isFBO() || 
-            usePbuffer != capsRequested.isPBuffer() || 
+            useFBO != capsRequested.isFBO() ||
+            usePbuffer != capsRequested.isPBuffer() ||
             useBitmap != capsRequested.isBitmap() ||
             !doubleBufferAvailable && capsRequested.getDoubleBuffered() )
         {
             // fix caps ..
             final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
             caps2.setOnscreen(false);
-            caps2.setFBO( useFBO ); 
+            caps2.setFBO( useFBO );
             caps2.setPBuffer( usePbuffer );
             caps2.setBitmap( useBitmap );
             if( !doubleBufferAvailable ) {
@@ -253,8 +253,8 @@ public class GLGraphicsConfigurationUtil {
     public static GLCapabilitiesImmutable fixGLPBufferGLCapabilities(GLCapabilitiesImmutable capsRequested)
     {
         if( capsRequested.isOnscreen() ||
-            !capsRequested.isPBuffer() || 
-            capsRequested.isFBO() ) 
+            !capsRequested.isPBuffer() ||
+            capsRequested.isFBO() )
         {
             // fix caps ..
             final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
@@ -277,7 +277,7 @@ public class GLGraphicsConfigurationUtil {
         }
         return capsRequested;
     }
-    
+
     /** Fix double buffered setting */
     public static GLCapabilitiesImmutable fixDoubleBufferedGLCapabilities(GLCapabilitiesImmutable capsRequested, boolean doubleBuffered)
     {
@@ -288,7 +288,7 @@ public class GLGraphicsConfigurationUtil {
         }
         return capsRequested;
     }
-    
+
     public static GLCapabilitiesImmutable clipRGBAGLCapabilities(GLCapabilitiesImmutable caps, boolean allowRGB555, boolean allowAlpha)
     {
         final int iR = caps.getRedBits();
@@ -305,21 +305,21 @@ public class GLGraphicsConfigurationUtil {
             caps2.setGreenBits(oG);
             caps2.setBlueBits(oB);
             caps2.setAlphaBits(oA);
-            return caps2;            
+            return caps2;
         }
         return caps;
     }
-    
+
     public static int clipColor(final int compIn, final boolean allowRGB555) {
         final int compOut;
         if( 5 < compIn || !allowRGB555 ) {
-            compOut = 8; 
+            compOut = 8;
         } else {
             compOut = 5;
-        }        
+        }
         return compOut;
     }
-    
+
     public static GLCapabilitiesImmutable fixGLProfile(GLCapabilitiesImmutable caps, GLProfile glp)
     {
         if( caps.getGLProfile() != glp ) {
diff --git a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
index 6d9116303..a22454d60 100644
--- a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -42,10 +42,10 @@ import com.jogamp.opengl.GLAutoDrawableDelegate;
 import jogamp.opengl.GLFBODrawableImpl;
 
 public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implements GLOffscreenAutoDrawable {
-  
+
     /**
      * @param drawable a valid {@link GLDrawable}, may not be {@link GLDrawable#isRealized() realized} yet.
-     * @param context a valid {@link GLContext}, 
+     * @param context a valid {@link GLContext},
      *                may not have been made current (created) yet,
      *                may not be associated w/ <code>drawable<code> yet,
      *                may be <code>null</code> for lazy initialization
@@ -55,16 +55,16 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
     public GLOffscreenAutoDrawableImpl(GLDrawable drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
         super(drawable, context, upstreamWidget, true, lock);
     }
-    
+
     @Override
     public void setSize(int newWidth, int newHeight) throws NativeWindowException, GLException {
         this.defaultWindowResizedOp(newWidth, newHeight);
     }
-    
-    public static class FBOImpl extends GLOffscreenAutoDrawableImpl implements GLOffscreenAutoDrawable.FBO {      
+
+    public static class FBOImpl extends GLOffscreenAutoDrawableImpl implements GLOffscreenAutoDrawable.FBO {
         /**
          * @param drawable a valid {@link GLDrawable}, may not be {@link GLDrawable#isRealized() realized} yet.
-         * @param context a valid {@link GLContext}, 
+         * @param context a valid {@link GLContext},
          *                may not have been made current (created) yet,
          *                may not be associated w/ <code>drawable<code> yet,
          *                may be <code>null</code> for lazy initialization
@@ -74,7 +74,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
         public FBOImpl(GLFBODrawableImpl drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
             super(drawable, context, upstreamWidget, lock);
         }
-        
+
         @Override
         public boolean isInitialized() {
             return ((GLFBODrawableImpl)drawable).isInitialized();
@@ -84,7 +84,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
         public final int getTextureUnit() {
             return ((GLFBODrawableImpl)drawable).getTextureUnit();
         }
-        
+
         @Override
         public final void setTextureUnit(int unit) {
             ((GLFBODrawableImpl)drawable).setTextureUnit(unit);
@@ -94,23 +94,23 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
         public final int getNumSamples() {
             return ((GLFBODrawableImpl)drawable).getNumSamples();
         }
-        
+
         @Override
         public final void setNumSamples(GL gl, int newSamples) throws GLException {
             ((GLFBODrawableImpl)drawable).setNumSamples(gl, newSamples);
             windowRepaintOp();
         }
-        
+
         @Override
         public final int setNumBuffers(int bufferCount) throws GLException {
             return ((GLFBODrawableImpl)drawable).setNumBuffers(bufferCount);
         }
-        
+
         @Override
         public final int getNumBuffers() {
             return ((GLFBODrawableImpl)drawable).getNumBuffers();
         }
-        
+
         /** // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
         @Override
         public DoubleBufferMode getDoubleBufferMode() {
@@ -119,14 +119,14 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
 
         @Override
         public void setDoubleBufferMode(DoubleBufferMode mode) throws GLException {
-            ((GLFBODrawableImpl)drawable).setDoubleBufferMode(mode);            
+            ((GLFBODrawableImpl)drawable).setDoubleBufferMode(mode);
         } */
-        
+
         @Override
-        public final FBObject getFBObject(int bufferName) { 
+        public final FBObject getFBObject(int bufferName) {
             return ((GLFBODrawableImpl)drawable).getFBObject(bufferName);
         }
-        
+
         public final FBObject.TextureAttachment getTextureBuffer(int bufferName) {
             return ((GLFBODrawableImpl)drawable).getTextureBuffer(bufferName);
         }
@@ -134,6 +134,6 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
         @Override
         public void resetSize(GL gl) throws GLException {
             ((GLFBODrawableImpl)drawable).resetSize(gl);
-        }        
+        }
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
index b8841d6e2..c32957b86 100644
--- a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
@@ -51,7 +51,7 @@ import com.jogamp.common.util.locks.RecursiveLock;
 public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
 
   public GLPbufferImpl(GLDrawableImpl pbufferDrawable, GLContextImpl pbufferContext) {
-    super(pbufferDrawable, pbufferContext, true); // drawable := pbufferDrawable, context := pbufferContext  
+    super(pbufferDrawable, pbufferContext, true); // drawable := pbufferDrawable, context := pbufferContext
   }
 
   //
@@ -60,26 +60,26 @@ public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
 
   //
   // GLDrawable delegation
-  // 
-    
+  //
+
   @Override
   public final void swapBuffers() throws GLException {
       defaultSwapBuffers();
   }
-  
+
   //
   // GLAutoDrawable completion
   //
   private final RecursiveLock lock = LockFactory.createRecursiveLock();  // instance wide lock
-  
+
   @Override
   protected final RecursiveLock getLock() { return lock; }
-  
+
   @Override
   public final Object getUpstreamWidget() {
     return null;
   }
-  
+
   @Override
   public void destroy() {
     defaultDestroy();
@@ -92,7 +92,7 @@ public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
 
   @Override
   public final void display() {
-    final RecursiveLock _lock = lock;        
+    final RecursiveLock _lock = lock;
     _lock.lock(); // sync: context/drawable could been recreated/destroyed while animating
     try {
         if( null != context ) {
diff --git a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
index 244a3fd79..2238d49bc 100644
--- a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
+++ b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl;
 
 import javax.media.opengl.GLRunnable;
@@ -86,41 +86,41 @@ public class GLRunnableTask implements GLRunnable {
         }
         return res;
     }
-    
-    /** 
+
+    /**
      * Simply flush this task and notify a waiting executor.
      * The executor which might have been blocked until notified
      * will be unblocked and the task removed from the queue.
-     * 
+     *
      * @see #isFlushed()
      * @see #isInQueue()
-     */ 
+     */
     public void flush() {
         if(!isExecuted() && null != notifyObject) {
             synchronized (notifyObject) {
                 isFlushed=true;
-                notifyObject.notifyAll();                
+                notifyObject.notifyAll();
             }
         }
     }
-    
+
     /**
      * @return !{@link #isExecuted()} && !{@link #isFlushed()}
      */
     public boolean isInQueue() { return !isExecuted && !isFlushed; }
-    
+
     /**
      * @return whether this task has been executed.
      * @see #isInQueue()
      */
     public boolean isExecuted() { return isExecuted; }
-    
+
     /**
      * @return whether this task has been flushed.
      * @see #isInQueue()
      */
     public boolean isFlushed() { return isFlushed; }
-    
+
     public Throwable getThrowable() { return runnableException; }
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/GLStateTracker.java b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
index 01c3716e0..307fd0a15 100644
--- a/src/jogl/classes/jogamp/opengl/GLStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -53,47 +53,47 @@ import java.util.ArrayList;
  * Currently supported states: PixelStorei
  */
 public class GLStateTracker {
-    
-  /** Minimum value of MAX_CLIENT_ATTRIB_STACK_DEPTH */  
+
+  /** Minimum value of MAX_CLIENT_ATTRIB_STACK_DEPTH */
   public static final int MIN_CLIENT_ATTRIB_STACK_DEPTH = 16;
-  
+
   /** static size of pixel state map */
   static final int PIXEL_STATE_MAP_SIZE = 16;
   /** avoid rehash of static size pixel state map */
   static final int PIXEL_STATE_MAP_CAPACITY = 32;
-  
+
   private volatile boolean enabled = true;
 
   private IntIntHashMap pixelStateMap;
   private final ArrayList<SavedState> stack;
-  
+
   private static class SavedState {
 
     /**
      * Empty pixel-store state
-     */ 
+     */
     private IntIntHashMap pixelStateMap;
-    
+
     /**
      * set (client) pixel-store state, deep copy
-     */ 
+     */
     private final void setPixelStateMap(IntIntHashMap pixelStateMap) {
         this.pixelStateMap = (IntIntHashMap) pixelStateMap.clone();
     }
-    
+
     /**
      * get (client) pixel-store state, return reference
-     */ 
+     */
     private final IntIntHashMap getPixelStateMap() { return pixelStateMap; }
 
   }
-  
 
-  public GLStateTracker() {    
+
+  public GLStateTracker() {
     pixelStateMap = new IntIntHashMap(PIXEL_STATE_MAP_CAPACITY, 0.75f);
     pixelStateMap.setKeyNotFoundValue(0xFFFFFFFF);
     resetStates();
-    
+
     stack = new ArrayList<SavedState>(MIN_CLIENT_ATTRIB_STACK_DEPTH);
   }
 
@@ -102,18 +102,18 @@ public class GLStateTracker {
   }
 
   public final void setEnabled(boolean on) {
-    enabled = on;    
+    enabled = on;
   }
 
   public final boolean isEnabled() {
     return enabled;
   }
 
-  /** @return true if found in our map, otherwise false, 
+  /** @return true if found in our map, otherwise false,
    *  which forces the caller to query GL. */
   public final boolean getInt(int pname, int[] params, int params_offset) {
     if(enabled) {
-        final int value = pixelStateMap.get(pname);        
+        final int value = pixelStateMap.get(pname);
         if(0xFFFFFFFF != value) {
             params[params_offset] = value;
             return true;
@@ -122,7 +122,7 @@ public class GLStateTracker {
     return false;
   }
 
-  /** @return true if found in our map, otherwise false, 
+  /** @return true if found in our map, otherwise false,
    *  which forces the caller to query GL. */
   public final boolean getInt(int pname, IntBuffer params, int dummy) {
     if(enabled) {
@@ -158,7 +158,7 @@ public class GLStateTracker {
             throw new GLException("stack contains no elements");
         }
         SavedState state = stack.remove(stack.size()-1); // pop
-        
+
         if(null==state) {
             throw new GLException("null stack element (remaining stack size "+stack.size()+")");
         }
@@ -166,7 +166,7 @@ public class GLStateTracker {
         if ( null != state.getPixelStateMap() ) {
             // use pulled client pixel-store state from stack
             pixelStateMap = state.getPixelStateMap();
-        } // else: empty-slot, not pushed by GL_CLIENT_PIXEL_STORE_BIT        
+        } // else: empty-slot, not pushed by GL_CLIENT_PIXEL_STORE_BIT
     }
   }
 
diff --git a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
index e4187b35b..431c1a387 100644
--- a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
+++ b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
@@ -43,9 +43,9 @@ public class GLVersionNumber extends VersionNumberString {
         super(val[0], val[1], val[2], strEnd, state, versionString);
         this.valid = valid;
     }
-    
+
     private static java.util.regex.Pattern getUnderscorePattern() {
-        if( null == _Pattern ) { // volatile dbl-checked-locking OK 
+        if( null == _Pattern ) { // volatile dbl-checked-locking OK
             synchronized( VersionNumber.class ) {
                 if( null == _Pattern ) {
                     _Pattern = getVersionNumberPattern("_");
@@ -55,7 +55,7 @@ public class GLVersionNumber extends VersionNumberString {
         return _Pattern;
     }
     private static volatile java.util.regex.Pattern _Pattern = null;
-    
+
     public static final GLVersionNumber create(String versionString) {
         int[] val = new int[] { 0, 0, 0 };
         int strEnd = 0;
@@ -73,7 +73,7 @@ public class GLVersionNumber extends VersionNumberString {
                 strEnd = version.endOfStringMatch();
                 val[0] = version.getMajor();
                 val[1] = version.getMinor();
-                state = (short) ( ( version.hasMajor() ? VersionNumber.HAS_MAJOR : (short)0 ) | 
+                state = (short) ( ( version.hasMajor() ? VersionNumber.HAS_MAJOR : (short)0 ) |
                                   ( version.hasMinor() ? VersionNumber.HAS_MINOR : (short)0 ) );
                 valid = version.hasMajor() && version.hasMinor(); // Requires at least a defined major and minor version component!
             } catch (Exception e) {
@@ -82,16 +82,16 @@ public class GLVersionNumber extends VersionNumberString {
                 val[0] = 1;
                 val[1] = 0;
             }
-        }    
+        }
         return new GLVersionNumber(val, strEnd, state, versionString, valid);
     }
 
     public final boolean isValid() {
         return valid;
     }
-    
-    /** 
-     * Returns the optional vendor version at the end of the 
+
+    /**
+     * Returns the optional vendor version at the end of the
      * <code>GL_VERSION</code> string if exists, otherwise the {@link VersionNumberString#zeroVersion zero version} instance.
      * <pre>
      *   2.1 Mesa 7.0.3-rc2 -> 7.0.3 (7.0.3-rc2)
@@ -105,14 +105,14 @@ public class GLVersionNumber extends VersionNumberString {
         if (versionString == null || versionString.length() <= 0) {
             return null;
         }
-        
+
         // Skip the 1st GL version
         String str;
         {
             final GLVersionNumber glv = create(versionString);
             str = versionString.substring(glv.endOfStringMatch()).trim();
         }
-        
+
         while ( str.length() > 0 ) {
             final VersionNumberString version = new VersionNumberString(str, getDefaultVersionNumberPattern());
             final int eosm = version.endOfStringMatch();
diff --git a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
index 112dfcb64..979c6dc0a 100644
--- a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
+++ b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -67,7 +67,7 @@ public class GLWorkerThread {
   private static volatile Runnable work;
   // Queue of Runnables to be asynchronously invoked
   private static List<Runnable> queue = new ArrayList<Runnable>();
-  
+
   /** Should only be called by Threading class if creation of the
       GLWorkerThread was requested via the opengl.1thread system
       property. <br>
@@ -149,7 +149,7 @@ public class GLWorkerThread {
     }
   }
 
-  public static void invoke(boolean wait, Runnable runnable) 
+  public static void invoke(boolean wait, Runnable runnable)
       throws InvocationTargetException, InterruptedException {
       if(wait) {
           invokeAndWait(runnable);
@@ -157,7 +157,7 @@ public class GLWorkerThread {
           invokeLater(runnable);
       }
   }
-  
+
   public static void invokeAndWait(Runnable runnable)
     throws InvocationTargetException, InterruptedException {
     if (!started) {
@@ -220,7 +220,7 @@ public class GLWorkerThread {
   }
 
   protected static String getThreadName() { return Thread.currentThread().getName(); }
-  
+
   static class WorkerRunnable implements Runnable {
     public void run() {
       // Notify starting thread that we're ready
@@ -244,7 +244,7 @@ public class GLWorkerThread {
               break;
             }
           }
-          
+
           if (shouldTerminate) {
             lock.notifyAll();
             thread = null;
diff --git a/src/jogl/classes/jogamp/opengl/GLXExtensions.java b/src/jogl/classes/jogamp/opengl/GLXExtensions.java
index 36c6c4665..9325c6f68 100644
--- a/src/jogl/classes/jogamp/opengl/GLXExtensions.java
+++ b/src/jogl/classes/jogamp/opengl/GLXExtensions.java
@@ -28,9 +28,9 @@
 package jogamp.opengl;
 
 /**
- * Class holding GLX/WGL/.. extension strings, commonly used by JOGL's implementation. 
+ * Class holding GLX/WGL/.. extension strings, commonly used by JOGL's implementation.
  */
-public class GLXExtensions {   
+public class GLXExtensions {
   public static final String GLX_MESA_swap_control           = "GLX_MESA_swap_control";
   public static final String GLX_SGI_swap_control            = "GLX_SGI_swap_control";
   public static final String GLX_NV_swap_group               = "GLX_NV_swap_group";
diff --git a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
index 1cde551be..a64a2f5cd 100644
--- a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
+++ b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
@@ -33,9 +33,9 @@ import java.util.ArrayList;
 /**
  * Simple locked listener implementation stub to be used for listener handler,
  * synchronized on it's instance.
- * 
+ *
  * <p>Utilizing simple locking via synchronized.</p>
- * 
+ *
  * @param <E> The listener type
  */
 public class ListenerSyncedImplStub<E> {
@@ -48,7 +48,7 @@ public class ListenerSyncedImplStub<E> {
   public synchronized final void reset() {
     listeners = new ArrayList<E>();
   }
-  
+
   public synchronized final void destroy() {
     listeners.clear();
     listeners = null;
@@ -57,7 +57,7 @@ public class ListenerSyncedImplStub<E> {
   public synchronized final int size() {
     return listeners.size();
   }
-  
+
   public synchronized final void addListener(E listener) {
     addListener(-1, listener);
   }
@@ -68,12 +68,12 @@ public class ListenerSyncedImplStub<E> {
     }
     listeners.add(index, listener);
   }
-  
+
   public synchronized final void removeListener(E listener) {
     listeners.remove(listener);
   }
 
   public final ArrayList<E> getListeners() {
       return listeners;
-  }  
+  }
 }
diff --git a/src/jogl/classes/jogamp/opengl/ProjectFloat.java b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
index 439ddc76e..d4fd1c935 100644
--- a/src/jogl/classes/jogamp/opengl/ProjectFloat.java
+++ b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
@@ -6,9 +6,9 @@
 ** this file except in compliance with the License. You may obtain a copy
 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-** 
+**
 ** http://oss.sgi.com/projects/FreeB
-** 
+**
 ** Note that, as provided in the License, the Software is distributed on an
 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
@@ -24,13 +24,13 @@
 ** except that Section 2.2 and 11 are omitted.  Any differences between
 ** the Alternative License and the SGI License are offered solely by Sun
 ** and not by SGI.
-** 
+**
 ** Original Code. The Original Code is: OpenGL Sample Implementation,
 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
 ** Copyright in any portions created by third parties is as indicated
 ** elsewhere herein. All Rights Reserved.
-** 
+**
 ** Additional Notice Provisions: The application programming interfaces
 ** established by SGI in conjunction with the Original Code are The
 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -45,34 +45,34 @@
 ** $Header$
 */
 
-/* 
+/*
  * Copyright (c) 2002-2004 LWJGL Project
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are 
+ * modification, are permitted provided that the following conditions are
  * met:
- * 
- * * Redistributions of source code must retain the above copyright 
+ *
+ * * Redistributions of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
  *
  * * Redistributions in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
  *
- * * Neither the name of 'LWJGL' nor the names of 
- *   its contributors may be used to endorse or promote products derived 
+ * * Neither the name of 'LWJGL' nor the names of
+ *   its contributors may be used to endorse or promote products derived
  *   from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
@@ -80,22 +80,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2011 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -108,7 +108,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -129,14 +129,14 @@ import com.jogamp.opengl.math.FloatUtil;
  * <p>
  * Created 11-jan-2004
  * </p>
- * 
+ *
  * @author Erik Duijs
  * @author Kenneth Russell
  * @author Sven Gothel
  */
 public class ProjectFloat {
   public static final int getRequiredFloatBufferSize() { return 1*16; }
-  
+
   // Note that we have cloned parts of the implementation in order to
   // support incoming Buffers. The reason for this is to avoid loading
   // non-direct buffer subclasses unnecessarily, because doing so can
@@ -162,22 +162,22 @@ public class ProjectFloat {
   public ProjectFloat() {
       this(true);
   }
-  
+
   public ProjectFloat(boolean useBackingArray) {
-      this(useBackingArray ? null : Buffers.newDirectByteBuffer(getRequiredFloatBufferSize() * Buffers.SIZEOF_FLOAT), 
-           useBackingArray ? new float[getRequiredFloatBufferSize()] : null, 
+      this(useBackingArray ? null : Buffers.newDirectByteBuffer(getRequiredFloatBufferSize() * Buffers.SIZEOF_FLOAT),
+           useBackingArray ? new float[getRequiredFloatBufferSize()] : null,
            0);
   }
 
   /**
    * @param floatBuffer source buffer, may be ByteBuffer (recommended) or FloatBuffer or <code>null</code>.
-   *                    If used, shall be &ge; {@link #getRequiredFloatBufferSize()} + floatOffset. 
+   *                    If used, shall be &ge; {@link #getRequiredFloatBufferSize()} + floatOffset.
    *                    Buffer's position is ignored and floatPos is being used.
    * @param floatArray source float array or <code>null</code>.
    *                   If used, size shall be &ge; {@link #getRequiredFloatBufferSize()} + floatOffset.
    * @param floatOffset Offset for either of the given sources (buffer or array)
    */
-  public ProjectFloat(Buffer floatBuffer, float[] floatArray, int floatOffset) {    
+  public ProjectFloat(Buffer floatBuffer, float[] floatArray, int floatOffset) {
     matrixBuf = Buffers.slice2Float(floatBuffer, floatArray, floatOffset, 16);
   }
 
@@ -259,7 +259,7 @@ public class ProjectFloat {
   /**
    * @param src
    * @param inverse
-   * 
+   *
    * @return
    */
   public boolean gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) {
@@ -268,7 +268,7 @@ public class ProjectFloat {
 
     final int srcPos = src.position();
     final int invPos = inverse.position();
-    
+
     final float[][] temp = tempInvertMatrix;
 
     for (i = 0; i < 4; i++) {
@@ -297,7 +297,7 @@ public class ProjectFloat {
           t = temp[i][k];
           temp[i][k] = temp[swap][k];
           temp[swap][k] = t;
-          
+
           t = inverse.get(i*4+k + invPos);
           inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
           inverse.put(swap*4+k + invPos, t);
@@ -335,7 +335,7 @@ public class ProjectFloat {
 
   /**
    * Method gluOrtho2D.
-   * 
+   *
    * @param left
    * @param right
    * @param bottom
@@ -347,7 +347,7 @@ public class ProjectFloat {
 
   /**
    * Method gluPerspective.
-   * 
+   *
    * @param fovy
    * @param aspect
    * @param zNear
@@ -380,7 +380,7 @@ public class ProjectFloat {
 
   /**
    * Method gluLookAt
-   * 
+   *
    * @param eyex
    * @param eyey
    * @param eyez
@@ -436,7 +436,7 @@ public class ProjectFloat {
 
   /**
    * Map object coordinates to window coordinates.
-   * 
+   *
    * @param objx
    * @param objy
    * @param objz
@@ -444,7 +444,7 @@ public class ProjectFloat {
    * @param projMatrix
    * @param viewport
    * @param win_pos
-   * 
+   *
    * @return
    */
   public boolean gluProject(float objx, float objy, float objz,
@@ -518,13 +518,13 @@ public class ProjectFloat {
     win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
     win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
     win_pos[2+win_pos_offset] = in[2];
-    
+
     return true;
   }
-  
+
   /**
    * Map object coordinates to window coordinates.
-   * 
+   *
    * @param objx
    * @param objy
    * @param objz
@@ -532,7 +532,7 @@ public class ProjectFloat {
    * @param projMatrix
    * @param viewport
    * @param win_pos
-   * 
+   *
    * @return
    */
   public boolean gluProject(float objx, float objy, float objz,
@@ -576,7 +576,7 @@ public class ProjectFloat {
 
   /**
    * Map window coordinates to object coordinates.
-   * 
+   *
    * @param winx
    * @param winy
    * @param winz
@@ -584,7 +584,7 @@ public class ProjectFloat {
    * @param projMatrix
    * @param viewport
    * @param obj_pos
-   * 
+   *
    * @return
    */
   public boolean gluUnProject(float winx, float winy, float winz,
@@ -633,7 +633,7 @@ public class ProjectFloat {
 
   /**
    * Map window coordinates to object coordinates.
-   * 
+   *
    * @param winx
    * @param winy
    * @param winz
@@ -646,7 +646,7 @@ public class ProjectFloat {
    * @return
    */
   public boolean gluUnProject(float winx, float winy, float winz,
-                              FloatBuffer modelMatrix, 
+                              FloatBuffer modelMatrix,
                               FloatBuffer projMatrix,
                               int[] viewport, int viewport_offset,
                               float[] obj_pos, int obj_pos_offset) {
@@ -674,7 +674,7 @@ public class ProjectFloat {
     in[2] = in[2] * 2 - 1;
 
     FloatUtil.multMatrixVecf(matrixBuf, in, out);
-    
+
     if (out[3] == 0.0) {
       return false;
     }
@@ -687,10 +687,10 @@ public class ProjectFloat {
 
     return true;
   }
-  
+
   /**
    * Map window coordinates to object coordinates.
-   * 
+   *
    * @param winx
    * @param winy
    * @param winz
@@ -698,11 +698,11 @@ public class ProjectFloat {
    * @param projMatrix
    * @param viewport
    * @param obj_pos
-   * 
+   *
    * @return
    */
   public boolean gluUnProject(float winx, float winy, float winz,
-                              FloatBuffer modelMatrix, 
+                              FloatBuffer modelMatrix,
                               FloatBuffer projMatrix,
                               IntBuffer viewport,
                               FloatBuffer obj_pos) {
@@ -722,7 +722,7 @@ public class ProjectFloat {
 
     // Map x and y from window coordinates
     final int vPos = viewport.position();
-    final int oPos = obj_pos.position();    
+    final int oPos = obj_pos.position();
     in[0] = (in[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
     in[1] = (in[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
 
@@ -749,7 +749,7 @@ public class ProjectFloat {
 
   /**
    * Map window coordinates to object coordinates.
-   * 
+   *
    * @param winx
    * @param winy
    * @param winz
@@ -760,7 +760,7 @@ public class ProjectFloat {
    * @param near
    * @param far
    * @param obj_pos
-   * 
+   *
    * @return
    */
   public boolean gluUnProject4(float winx,
@@ -815,7 +815,7 @@ public class ProjectFloat {
 
   /**
    * Map window coordinates to object coordinates.
-   * 
+   *
    * @param winx
    * @param winy
    * @param winz
@@ -826,7 +826,7 @@ public class ProjectFloat {
    * @param near
    * @param far
    * @param obj_pos
-   * 
+   *
    * @return
    */
   public boolean gluUnProject4(float winx,
@@ -857,7 +857,7 @@ public class ProjectFloat {
     in[0] = (in[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
     in[1] = (in[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
     in[2] = (in[2] - near) / (far - near);
-    
+
     // Map to range -1 to 1
     in[0] = in[0] * 2 - 1;
     in[1] = in[1] * 2 - 1;
@@ -873,14 +873,14 @@ public class ProjectFloat {
     obj_pos.put(0+oPos, out[0]);
     obj_pos.put(1+oPos, out[1]);
     obj_pos.put(2+oPos, out[2]);
-    obj_pos.put(3+oPos, out[3]);    
+    obj_pos.put(3+oPos, out[3]);
     return true;
   }
 
 
   /**
    * Method gluPickMatrix
-   * 
+   *
    * @param x
    * @param y
    * @param deltaX
@@ -907,7 +907,7 @@ public class ProjectFloat {
 
   /**
    * Method gluPickMatrix
-   * 
+   *
    * @param x
    * @param y
    * @param deltaX
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
index e5f5ee09a..eddb36975 100644
--- a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
+++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
@@ -52,30 +52,30 @@ public class SharedResourceRunner implements Runnable {
          * <p>
          * Called within synchronized block.
          * </p>
-         * @param connection for creation a {@link AbstractGraphicsDevice} instance. 
-         * @return <code>true</code> if the device supports all protocols required for the implementation, otherwise <code>false</code>. 
+         * @param connection for creation a {@link AbstractGraphicsDevice} instance.
+         * @return <code>true</code> if the device supports all protocols required for the implementation, otherwise <code>false</code>.
          */
         boolean isDeviceSupported(String connection);
-        
+
         /**
          * <p>
          * Called within synchronized block.
          * </p>
-         * @param connection for creation a {@link AbstractGraphicsDevice} instance. 
-         * @return A new shared resource instance 
+         * @param connection for creation a {@link AbstractGraphicsDevice} instance.
+         * @return A new shared resource instance
          */
         Resource createSharedResource(String connection);
-        
-        /** Called within synchronized block. */ 
+
+        /** Called within synchronized block. */
         void releaseSharedResource(Resource shared);
-        /** Called within synchronized block. */ 
+        /** Called within synchronized block. */
         void clear();
 
-        /** Called within synchronized block. */ 
+        /** Called within synchronized block. */
         Resource mapPut(String connection, Resource resource);
-        /** Called within synchronized block. */ 
+        /** Called within synchronized block. */
         Resource mapGet(String connection);
-        /** Called within synchronized block. */ 
+        /** Called within synchronized block. */
         Collection<Resource> mapValues();
     }
 
@@ -103,7 +103,7 @@ public class SharedResourceRunner implements Runnable {
         this.impl = impl;
         resetState();
     }
-    
+
     private void resetState() { // synchronized call
         devicesTried.clear();
         thread = null;
@@ -114,12 +114,12 @@ public class SharedResourceRunner implements Runnable {
         releaseConnection = null;
     }
 
-    /** 
+    /**
      * Start the shared resource runner thread, if not running.
      * <p>
      * Validate the thread upfront and release all related resource if it was killed.
      * </p>
-     * 
+     *
      * @return the shared resource runner thread.
      */
     public Thread start() {
@@ -132,7 +132,7 @@ public class SharedResourceRunner implements Runnable {
                 releaseSharedResources();
                 thread = null;
                 running = false;
-            }        
+            }
             if( null == thread ) {
                 if (DEBUG) {
                     System.err.println("SharedResourceRunner.start() - start new Thread - "+getThreadName());
@@ -150,7 +150,7 @@ public class SharedResourceRunner implements Runnable {
         }
         return thread;
     }
-    
+
     public void stop() {
         synchronized (this) {
             if(null != thread) {
@@ -160,7 +160,7 @@ public class SharedResourceRunner implements Runnable {
                 synchronized (this) {
                     shouldRelease = true;
                     this.notifyAll();
-        
+
                     while (running) {
                         try {
                             this.wait();
@@ -170,7 +170,7 @@ public class SharedResourceRunner implements Runnable {
             }
         }
     }
-    
+
     public SharedResourceRunner.Resource getOrCreateShared(AbstractGraphicsDevice device) {
         SharedResourceRunner.Resource sr = null;
         if(null != device) {
@@ -203,7 +203,7 @@ public class SharedResourceRunner implements Runnable {
         if(null != device) {
             synchronized (this) {
                 final String connection = device.getConnection();
-                sr = impl.mapGet(connection);    
+                sr = impl.mapGet(connection);
                 if (null != sr) {
                     removeDeviceTried(connection);
                     if (DEBUG) {
@@ -261,7 +261,7 @@ public class SharedResourceRunner implements Runnable {
 
         synchronized (this) {
             running = true;
-            
+
             while (!shouldRelease) {
                 try {
                     // wait for stop or init
@@ -271,7 +271,7 @@ public class SharedResourceRunner implements Runnable {
                     }
                     notifyAll();
                     this.wait();
-                } catch (InterruptedException ex) { 
+                } catch (InterruptedException ex) {
                     shouldRelease = true;
                     if(DEBUG) {
                         System.err.println("SharedResourceRunner.run(): INTERRUPTED - "+threadName);
@@ -311,7 +311,7 @@ public class SharedResourceRunner implements Runnable {
                             } catch (Exception e) {
                                 e.printStackTrace();
                             }
-                        }                        
+                        }
                     }
                 }
                 initConnection = null;
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
index d55a2c976..6ffe46b36 100644
--- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
+++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.opengl;
@@ -49,14 +49,14 @@ import com.jogamp.common.util.ReflectionUtil;
 
 public class ThreadingImpl {
     public enum Mode {
-        MT(0), ST_AWT(1), ST_WORKER(2); 
-        
+        MT(0), ST_AWT(1), ST_WORKER(2);
+
         public final int id;
 
         Mode(int id){
             this.id = id;
         }
-    }    
+    }
 
     protected static final boolean DEBUG = Debug.debug("Threading");
 
@@ -68,7 +68,7 @@ public class ThreadingImpl {
     private static boolean _isX11;
 
     private static final ToolkitThreadingPlugin threadingPlugin;
-  
+
     static {
         threadingPlugin =
             AccessController.doPrivileged(new PrivilegedAction<ToolkitThreadingPlugin>() {
@@ -94,7 +94,7 @@ public class ThreadingImpl {
                         // default setting
                         singleThreaded = true;
                         mode  = ( hasAWT ? Mode.ST_AWT : Mode.ST_WORKER );
-                        
+
                         if (singleThreadProp != null) {
                             if (singleThreadProp.equals("true") ||
                                 singleThreadProp.equals("auto")) {
@@ -113,7 +113,7 @@ public class ThreadingImpl {
                                 throw new RuntimeException("Unsupported value for property jogl.1thread: "+singleThreadProp+", should be [true/auto, worker, awt or false]");
                             }
                         }
-                        
+
                         ToolkitThreadingPlugin threadingPlugin=null;
                         if(hasAWT) {
                             // try to fetch the AWTThreadingPlugin
@@ -139,9 +139,9 @@ public class ThreadingImpl {
     public static boolean isX11() { return _isX11; }
     public static Mode getMode() { return mode; }
 
-    /** If an implementation of the javax.media.opengl APIs offers a 
-        multithreading option but the default behavior is single-threading, 
-        this API provides a mechanism for end users to disable single-threading 
+    /** If an implementation of the javax.media.opengl APIs offers a
+        multithreading option but the default behavior is single-threading,
+        this API provides a mechanism for end users to disable single-threading
         in this implementation.  Users are strongly discouraged from
         calling this method unless they are aware of all of the
         consequences and are prepared to enforce some amount of
@@ -151,7 +151,7 @@ public class ThreadingImpl {
         GLPbuffer. Currently there is no supported way to re-enable it
         once disabled, partly to discourage careless use of this
         method. This method should be called as early as possible in an
-        application. */ 
+        application. */
     public static final void disableSingleThreading() {
         singleThreaded = false;
         if (Debug.verbose()) {
@@ -183,7 +183,7 @@ public class ThreadingImpl {
                 throw new InternalError("Illegal single-threading mode " + mode);
         }
     }
-    
+
     public static final boolean isToolkitThread() throws GLException {
         if(null!=threadingPlugin) {
             return threadingPlugin.isToolkitThread();
@@ -215,7 +215,7 @@ public class ThreadingImpl {
                 throw new InternalError("Illegal single-threading mode " + mode);
         }
     }
-    
+
     public static final void invokeOnWorkerThread(boolean wait, Runnable r) throws GLException {
         GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking
         try {
@@ -224,6 +224,6 @@ public class ThreadingImpl {
             throw new GLException(e.getTargetException());
         } catch (InterruptedException e) {
             throw new GLException(e);
-        }        
+        }
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java
index 22972953a..06fb0fe91 100644
--- a/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -46,7 +46,7 @@ public interface ToolkitThreadingPlugin {
   /** Indicates whether the current thread is the designated toolkit thread,
       if such semantics exists. */
   public boolean isToolkitThread() throws GLException;
-  
+
   /** Indicates whether the current thread is the thread on
       which this implementation of the javax.media.opengl APIs
       performs all of its OpenGL-related work. This method should only
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
index 56f00b370..cd1bb45c9 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -57,7 +57,7 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
   public final boolean isToolkitThread() throws GLException {
       return EventQueue.isDispatchThread();
   }
-  
+
   public final boolean isOpenGLThread() throws GLException {
     switch (ThreadingImpl.getMode()) {
       case ST_AWT:
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 9bdceff48..5faee1307 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -67,19 +67,19 @@ import com.jogamp.opengl.util.awt.AWTGLPixelBuffer.AWTGLPixelBufferProvider;
  */
 public class AWTTilePainter {
     private static final boolean DEBUG_TILES = Debug.debug("TileRenderer.PNG");
-    
+
     public final TileRenderer renderer;
     public final int componentCount;
     public final double scaleMatX, scaleMatY;
     public final int customTileWidth, customTileHeight, customNumSamples;
     public final boolean verbose;
-    
+
     public boolean flipVertical;
     private AWTGLPixelBuffer tBuffer = null;
     private BufferedImage vFlipImage = null;
     private Graphics2D g2d = null;
-    private AffineTransform saveAT = null;    
-    
+    private AffineTransform saveAT = null;
+
     public static void dumpHintsAndScale(Graphics2D g2d) {
           final RenderingHints rHints = g2d.getRenderingHints();
           final Set<Entry<Object, Object>> rEntries = rHints.entrySet();
@@ -92,13 +92,13 @@ public class AWTTilePainter {
           if( null != aTrans ) {
               System.err.println(" type "+aTrans.getType());
               System.err.println(" scale "+aTrans.getScaleX()+" x "+aTrans.getScaleY());
-              System.err.println(" move "+aTrans.getTranslateX()+" x "+aTrans.getTranslateY());        
+              System.err.println(" move "+aTrans.getTranslateX()+" x "+aTrans.getTranslateY());
               System.err.println(" mat  "+aTrans);
           } else {
               System.err.println(" null transform");
           }
     }
-    
+
     /**
      * @return resulting number of samples by comparing w/ {@link #customNumSamples} and the caps-config, 0 if disabled
      */
@@ -114,12 +114,12 @@ public class AWTTilePainter {
               return caps.getNumSamples();
           }
     }
-    
-    /** 
+
+    /**
      * Assumes a configured {@link TileRenderer}, i.e.
      * an {@link TileRenderer#attachAutoDrawable(GLAutoDrawable) attached}
      * {@link GLAutoDrawable} with {@link TileRenderer#setTileSize(int, int, int) set tile size}.
-     * <p> 
+     * <p>
      * Sets the renderer to {@link TileRenderer#TR_TOP_TO_BOTTOM} row order.
      * </p>
      * <p>
@@ -129,7 +129,7 @@ public class AWTTilePainter {
      * @param componentCount
      * @param scaleMatX {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatX * width pixels
      * @param scaleMatY {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatY * height pixels
-     * @param numSamples custom multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples 
+     * @param numSamples custom multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
      * @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param verbose
@@ -146,13 +146,13 @@ public class AWTTilePainter {
         this.verbose = verbose;
         this.flipVertical = true;
     }
-    
+
     public String toString() { return renderer.toString(); }
-    
+
     public void setIsGLOriented(boolean v) {
         flipVertical = v;
     }
-    
+
     private static Rectangle2D getClipBounds2D(Graphics2D g) {
         final Shape shape = g.getClip();
         return null != shape ? shape.getBounds2D() : null;
@@ -170,7 +170,7 @@ public class AWTTilePainter {
         }
         return new Rectangle2D.Double(x, y, width, height);
     }
-    
+
     /**
      * Caches the {@link Graphics2D} instance for rendering.
      * <p>
@@ -201,9 +201,9 @@ public class AWTTilePainter {
         final Rectangle2D dClipOrigR = getClipBounds2D(g2d);
         final Rectangle2D dClipOrig = clipNegative(dClipOrigR);
         final Rectangle2D dImageSizeOrig = new Rectangle2D.Double(0, 0, width, height);
-        
+
         // Retrieve scaled image-size and clip-bounds
-        // Note: Clip bounds lie within image-size! 
+        // Note: Clip bounds lie within image-size!
         final Rectangle2D dImageSizeScaled, dClipScaled;
         {
             final AffineTransform scaledATI;
@@ -230,10 +230,10 @@ public class AWTTilePainter {
         // GL y-offset is lower-left origin, AWT y-offset upper-left.
         scaledYOffset = iClipScaled.y;
         renderer.setTileOffset(iClipScaled.x, iImageSizeScaled.height - ( iClipScaled.y + clipH ));
-        
+
         // Scale actual Grahics2D matrix
         g2d.scale(scaleMatX, scaleMatY);
-        
+
         if( verbose ) {
             System.err.println("AWT print.0: image "+dImageSizeOrig + " -> " + dImageSizeScaled + " -> " + iImageSizeScaled);
             System.err.println("AWT print.0: clip  "+dClipOrigR + " -> " + dClipOrig + " -> " + dClipScaled + " -> " + iClipScaled);
@@ -241,12 +241,12 @@ public class AWTTilePainter {
         }
     }
     private int scaledYOffset;
-    
+
     /** See {@ #setupGraphics2DAndClipBounds(Graphics2D)}. */
-    public void resetGraphics2D() {        
+    public void resetGraphics2D() {
         g2d.setTransform(saveAT);
     }
-    
+
     /**
      * Disposes resources and {@link TileRenderer#detachAutoDrawable() detaches}
      * the {@link TileRenderer}'s {@link GLAutoDrawable}.
@@ -263,7 +263,7 @@ public class AWTTilePainter {
             vFlipImage = null;
         }
     }
-    
+
     final GLEventListener preTileGLEL = new GLEventListener() {
         @Override
         public void init(GLAutoDrawable drawable) {}
@@ -275,7 +275,7 @@ public class AWTTilePainter {
             if( null == tBuffer ) {
                 final int tWidth = renderer.getParam(TileRenderer.TR_TILE_WIDTH);
                 final int tHeight = renderer.getParam(TileRenderer.TR_TILE_HEIGHT);
-                final AWTGLPixelBufferProvider printBufferProvider = new AWTGLPixelBufferProvider( true /* allowRowStride */ );      
+                final AWTGLPixelBufferProvider printBufferProvider = new AWTGLPixelBufferProvider( true /* allowRowStride */ );
                 final GLPixelAttributes pixelAttribs = printBufferProvider.getAttributes(gl, componentCount);
                 tBuffer = printBufferProvider.allocate(gl, pixelAttribs, tWidth, tHeight, 1, true, 0);
                 renderer.setTileBuffer(tBuffer);
@@ -300,7 +300,7 @@ public class AWTTilePainter {
         @Override
         public void dispose(GLAutoDrawable drawable) {}
         @Override
-        public void display(GLAutoDrawable drawable) {              
+        public void display(GLAutoDrawable drawable) {
             final DimensionImmutable cis = renderer.getClippedImageSize();
             final int tWidth = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_WIDTH);
             final int tHeight = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_HEIGHT);
@@ -309,26 +309,26 @@ public class AWTTilePainter {
             final int imgYOff = flipVertical ? 0 : renderer.getParam(TileRenderer.TR_TILE_HEIGHT) - tHeight; // imgYOff will be cut-off via sub-image
             final int pX = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS); // tileX == pX
             final int pY = cis.getHeight() - ( tY - tYOff + tHeight ) + scaledYOffset;
-            
+
             // Copy temporary data into raster of BufferedImage for faster
             // blitting Note that we could avoid this copy in the cases
             // where !offscreenDrawable.isGLOriented(),
             // but that's the software rendering path which is very slow anyway.
             final BufferedImage dstImage;
             if( DEBUG_TILES ) {
-                final String fname = String.format("file_%03d_0_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png", 
-                        _counter, 
+                final String fname = String.format("file_%03d_0_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
+                        _counter,
                         renderer.getParam(TileRenderer.TR_CURRENT_COLUMN), renderer.getParam(TileRenderer.TR_CURRENT_ROW),
                         tWidth, tHeight,
                         pX, tY, tYOff, pX, pY).replace(' ', '_');
                 System.err.println("XXX file "+fname);
-                final File fout = new File(fname); 
+                final File fout = new File(fname);
                 try {
                     ImageIO.write(tBuffer.image, "png", fout);
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
-            }            
+            }
             if( flipVertical ) {
                 final BufferedImage srcImage = tBuffer.image;
                 dstImage = vFlipImage;
@@ -347,20 +347,20 @@ public class AWTTilePainter {
                 dstImage = tBuffer.image;
             }
             if( DEBUG_TILES ) {
-                final String fname = String.format("file_%03d_1_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png", 
-                        _counter, 
+                final String fname = String.format("file_%03d_1_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
+                        _counter,
                         renderer.getParam(TileRenderer.TR_CURRENT_COLUMN), renderer.getParam(TileRenderer.TR_CURRENT_ROW),
                         tWidth, tHeight,
                         pX, tY, tYOff, pX, pY).replace(' ', '_');
                 System.err.println("XXX file "+fname);
-                final File fout = new File(fname); 
+                final File fout = new File(fname);
                 try {
                     ImageIO.write(dstImage, "png", fout);
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
                 _counter++;
-            }            
+            }
             // Draw resulting image in one shot
             final BufferedImage outImage = dstImage.getSubimage(0, imgYOff, tWidth, tHeight);
             final boolean drawDone = g2d.drawImage(outImage, pX, pY, null); // Null ImageObserver since image data is ready.
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
index e15e538c2..dc286ca59 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -85,7 +85,7 @@ public class AWTUtil {
           NativeWindowFactory.getAWTToolkitLock().lock();
         }
       } catch (Exception e) { j2dOk=false; }
-    } 
+    }
     if(!j2dOk) {
       NativeWindowFactory.getAWTToolkitLock().lock();
     }
@@ -108,7 +108,7 @@ public class AWTUtil {
               NativeWindowFactory.getAWTToolkitLock().unlock();
             }
           } catch (Exception e) { j2dOk=false; }
-        } 
+        }
         if(!j2dOk) {
           NativeWindowFactory.getAWTToolkitLock().unlock();
         }
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
index edf9e89f8..7a8ddf0b4 100644
--- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java
+++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -144,7 +144,7 @@ public class Java2D {
             } else {
                 if (DEBUG) {
                   System.err.println("Java2D support disabled: by Property "+java2dOGLDisabledByProp+", by OS "+java2dOGLDisabledByOS);
-                }                
+                }
                 cfg = null;
                 cfgName = "nil";
             }
@@ -154,8 +154,8 @@ public class Java2D {
               System.err.println("Java2D support: default GraphicsConfiguration = " + cfgName);
             }
             isOGLPipelineActive = cfgName.startsWith("sun.java2d.opengl");
-            isOGLPipelineResourceCompatible = isOGLPipelineActive; 
-            
+            isOGLPipelineResourceCompatible = isOGLPipelineActive;
+
             if (isOGLPipelineActive) {
               try {
                 // Try to get methods we need to integrate
@@ -179,19 +179,19 @@ public class Java2D {
                                                                      Integer.TYPE
                                                                    });
                     getOGLViewportMethod.setAccessible(true);
-    
+
                     getOGLScissorBoxMethod = utils.getDeclaredMethod("getOGLScissorBox",
                                                                      new Class[] {
                                                                        Graphics.class
                                                                      });
                     getOGLScissorBoxMethod.setAccessible(true);
-    
+
                     getOGLSurfaceIdentifierMethod = utils.getDeclaredMethod("getOGLSurfaceIdentifier",
                                                                             new Class[] {
                                                                               Graphics.class
                                                                             });
                     getOGLSurfaceIdentifierMethod.setAccessible(true);
-    
+
                     // Try to get additional methods required for proper FBO support
                     fbObjectSupportInitialized = true;
                     try {
@@ -201,7 +201,7 @@ public class Java2D {
                                                                                           Runnable.class
                                                                                         });
                       invokeWithOGLSharedContextCurrentMethod.setAccessible(true);
-    
+
                       getOGLSurfaceTypeMethod = utils.getDeclaredMethod("getOGLSurfaceType",
                                                                         new Class[] {
                                                                           Graphics.class
@@ -214,7 +214,7 @@ public class Java2D {
                         System.err.println("Info: Disabling Java2D/JOGL FBO support");
                       }
                     }
-    
+
                     // Try to get an additional method for FBO support in recent Mustang builds
                     try {
                       getOGLTextureTypeMethod = utils.getDeclaredMethod("getOGLTextureType",
@@ -228,7 +228,7 @@ public class Java2D {
                         System.err.println("Info: GL_ARB_texture_rectangle FBO support disabled");
                       }
                     }
-    
+
                     // Try to set up APIs for enabling the bridge on OS X,
                     // where it isn't possible to create generalized
                     // external GLDrawables
@@ -244,7 +244,7 @@ public class Java2D {
                     if (cglSurfaceData != null) {
                       // FIXME: for now, assume that FBO support is not enabled on OS X
                       fbObjectSupportInitialized = false;
-    
+
                       // We need to find these methods in order to make the bridge work on OS X
                       createOGLContextOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("createOGLContextOnSurface",
                                                                                          new Class[] {
@@ -252,14 +252,14 @@ public class Java2D {
                                                                                            Long.TYPE
                                                                                          });
                       createOGLContextOnSurfaceMethod.setAccessible(true);
-    
+
                       makeOGLContextCurrentOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("makeOGLContextCurrentOnSurface",
                                                                                               new Class[] {
                                                                                                 Graphics.class,
                                                                                                 Long.TYPE
                                                                                               });
                       makeOGLContextCurrentOnSurfaceMethod.setAccessible(true);
-    
+
                       destroyOGLContextMethod = cglSurfaceData.getDeclaredMethod("destroyOGLContext",
                                                                                  new Class[] {
                                                                                    Long.TYPE
@@ -273,7 +273,7 @@ public class Java2D {
                   System.err.println("Info: Disabling Java2D/JOGL integration");
                 }
                 isOGLPipelineActive = false;
-                isOGLPipelineResourceCompatible = false;                
+                isOGLPipelineResourceCompatible = false;
               }
             }
           } catch (HeadlessException e) {
@@ -297,7 +297,7 @@ public class Java2D {
   public static boolean isOGLPipelineActive() {
     return isOGLPipelineActive;
   }
-  
+
   public static boolean isOGLPipelineResourceCompatible() {
     return isOGLPipelineResourceCompatible;
   }
@@ -317,7 +317,7 @@ public class Java2D {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
-  
+
   /** Makes current the OpenGL context associated with the passed
       Graphics object and runs the given Runnable on the Queue
       Flushing Thread in one atomic action. */
@@ -556,7 +556,7 @@ public class Java2D {
       throw new GLException("Java2D OpenGL pipeline not active");
     }
   }
-  
+
   private static void checkCompatible() {
     if ( !isOGLPipelineResourceCompatible() ) {
       throw new GLException("Java2D OpenGL pipeline not resource compatible");
diff --git a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
index 55fb3f9a2..a29d1e6aa 100644
--- a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
+++ b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
@@ -42,7 +42,7 @@ public class VersionApplet extends Applet {
     va.init();
     frame.add(va, BorderLayout.CENTER);
     frame.validate();
-        
+
     frame.setVisible(true);
     va.start();
   }
@@ -68,7 +68,7 @@ public class VersionApplet extends Applet {
     if(null != canvas) { return; }
 
     setEnabled(true);
-    
+
     GLProfile glp = GLProfile.getDefault();
     GLCapabilities glcaps = new GLCapabilities(glp);
 
@@ -87,7 +87,7 @@ public class VersionApplet extends Applet {
     /*
     s = NativeWindowVersion.getInstance().toString();
     System.err.println(s);
-    tareaVersion.append(NativeWindowVersion.getInstance().toString()); 
+    tareaVersion.append(NativeWindowVersion.getInstance().toString());
     */
 
     s = JoglVersion.getInstance().toString();
diff --git a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
index 3d59d1d53..1179e2b7f 100644
--- a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl.egl;
 
 import java.util.*;
@@ -60,12 +60,12 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
     public final boolean useToolGetProcAdressFirst(String funcName) {
         return true;
     }
-    
+
     public final List<List<String>> getToolLibNames() {
         final List<List<String>> libsList = new ArrayList<List<String>>();
         final List<String> libsGL = new ArrayList<String>();
-        
-        // Be aware that on DRI systems, eg ATI fglrx, etc, 
+
+        // Be aware that on DRI systems, eg ATI fglrx, etc,
         // you have to set LIBGL_DRIVERS_PATH env variable.
         // Eg on Ubuntu 64bit systems this is:
         //    export LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri:/usr/lib32/fglrx/dri
@@ -82,15 +82,15 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
 
         // OSX (guess ES2 on OSX will never happen)
         libsGL.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib");
-        
+
         // last but not least .. the generic one
         libsGL.add("GL");
-        
+
         libsList.add(libsGL);
         return libsList;
-    }    
-        
+    }
+
     public final List<String> getGlueLibNames() {
         return glueLibNames;
-    }    
+    }
 }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
index 179cb7504..3de910369 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -115,7 +115,7 @@ public class EGLContext extends GLContextImpl {
         if (EGL.eglGetCurrentContext() != contextHandle) {
             final long dpy = drawable.getNativeSurface().getDisplayHandle();
             if (!EGL.eglMakeCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-                throw new GLException("Error making context " + toHexString(contextHandle) + 
+                throw new GLException("Error making context " + toHexString(contextHandle) +
                                       " current on Thread " + getThreadName() +
                                       " with display " + toHexString(dpy) +
                                       ", drawableWrite " + toHexString(drawable.getHandle()) +
@@ -128,7 +128,7 @@ public class EGLContext extends GLContextImpl {
     @Override
     protected void releaseImpl() throws GLException {
       if (!EGL.eglMakeCurrent(drawable.getNativeSurface().getDisplayHandle(), EGL.EGL_NO_SURFACE, EGL.EGL_NO_SURFACE, EGL.EGL_NO_CONTEXT)) {
-            throw new GLException("Error freeing OpenGL context " + toHexString(contextHandle) + 
+            throw new GLException("Error freeing OpenGL context " + toHexString(contextHandle) +
                                   ": error code " + toHexString(EGL.eglGetError()));
       }
     }
@@ -138,7 +138,7 @@ public class EGLContext extends GLContextImpl {
       if (!EGL.eglDestroyContext(drawable.getNativeSurface().getDisplayHandle(), contextHandle)) {
           final int eglError = EGL.eglGetError();
           if(EGL.EGL_SUCCESS != eglError) { /* oops, Mesa EGL impl. may return false, but has no EGL error */
-              throw new GLException("Error destroying OpenGL context " + toHexString(contextHandle) + 
+              throw new GLException("Error destroying OpenGL context " + toHexString(contextHandle) +
                                     ": error code " + toHexString(eglError));
           }
       }
@@ -285,11 +285,11 @@ public class EGLContext extends GLContextImpl {
     //
     // Accessible ..
     //
-    
+
     /* pp */ void mapCurrentAvailableGLVersion(AbstractGraphicsDevice device) {
         mapStaticGLVersion(device, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
     }
-    /* pp */ int getContextOptions() { return ctxOptions; }    
+    /* pp */ int getContextOptions() { return ctxOptions; }
     /* pp */ static void mapStaticGLESVersion(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps) {
         final GLProfile glp = caps.getGLProfile();
         final int[] reqMajorCTP = new int[2];
@@ -305,7 +305,7 @@ public class EGLContext extends GLContextImpl {
             reqMajorCTP[1] |= GLContext.CTX_IMPL_ACCEL_SOFT;
         }
         mapStaticGLVersion(device, reqMajorCTP[0], 0, reqMajorCTP[1]);
-    }    
+    }
     /* pp */ static void mapStaticGLESVersion(AbstractGraphicsDevice device, final int major) {
         int ctp = GLContext.CTX_PROFILE_ES;
         if( major >= 3 ) {
@@ -324,20 +324,20 @@ public class EGLContext extends GLContextImpl {
             if(! ( device instanceof EGLGraphicsDevice ) ) {
                 final EGLGraphicsDevice eglDevice = new EGLGraphicsDevice(device.getHandle(), EGL.EGL_NO_DISPLAY, device.getConnection(), device.getUnitID(), null);
                 GLContext.mapAvailableGLVersion(eglDevice, reqMajor, reqProfile, major, minor, ctp);
-            }            
+            }
         }
     }
     protected static String getGLVersion(int major, int minor, int ctp, String gl_version) {
         return GLContext.getGLVersion(major, minor, ctp, gl_version);
     }
-    
+
     protected static boolean getAvailableGLVersionsSet(AbstractGraphicsDevice device) {
         return GLContext.getAvailableGLVersionsSet(device);
     }
     protected static void setAvailableGLVersionsSet(AbstractGraphicsDevice device) {
         GLContext.setAvailableGLVersionsSet(device);
     }
-    
+
     protected static String toHexString(int hex) {
         return GLContext.toHexString(hex);
     }
@@ -358,7 +358,7 @@ public class EGLContext extends GLContextImpl {
     public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
         throw new GLException("Should not call this");
     }
-    
+
     @Override
     public final void glFreeMemoryNV(ByteBuffer pointer) {
         throw new GLException("Should not call this");
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
index f2efb0479..89f34432d 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -41,8 +41,8 @@ import jogamp.opengl.Debug;
 import com.jogamp.common.util.LongObjectHashMap;
 import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
 
-/** 
- * This implementation provides recursive calls to  
+/**
+ * This implementation provides recursive calls to
  * {@link EGL#eglInitialize(long, IntBuffer, IntBuffer)} and {@link EGL#eglTerminate(long)},
  * where <code>eglInitialize(..)</code> is issued only for the 1st call per <code>eglDisplay</code>
  * and <code>eglTerminate(..)</code> is issued only for the last call.
@@ -53,30 +53,30 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
  */
 public class EGLDisplayUtil {
     protected static final boolean DEBUG = Debug.debug("EGLDisplayUtil");
-    
+
     private static class DpyCounter {
         final long eglDisplay;
         final Throwable createdStack;
         int refCount;
-        
+
         private DpyCounter(long eglDisplay) {
             this.eglDisplay = eglDisplay;
             this.refCount = 0;
             this.createdStack = DEBUG ? new Throwable() : null;
         }
-        
+
         public String toString() {
             return "EGLDisplay[0x"+Long.toHexString(eglDisplay)+": refCnt "+refCount+"]";
         }
     }
     static final LongObjectHashMap eglDisplayCounter;
-    
+
     static {
         eglDisplayCounter = new LongObjectHashMap();
         eglDisplayCounter.setKeyNotFoundValue(null);
     }
 
-    /** 
+    /**
      * @return number of unclosed EGL Displays.<br>
      */
     public static int shutdown(boolean verbose) {
@@ -91,7 +91,7 @@ public class EGLDisplayUtil {
         }
         return eglDisplayCounter.size();
     }
-    
+
     public static void dumpOpenDisplayConnections() {
         System.err.println("EGLDisplayUtil: Open EGL Display Connections: "+eglDisplayCounter.size());
         int i=0;
@@ -104,7 +104,7 @@ public class EGLDisplayUtil {
             }
         }
     }
-    
+
     public static long eglGetDisplay(long nativeDisplay_id)  {
         final long eglDisplay = EGL.eglGetDisplay(nativeDisplay_id);
         if(DEBUG) {
@@ -114,16 +114,16 @@ public class EGLDisplayUtil {
         }
         return eglDisplay;
     }
-    
+
     /**
      * @param eglDisplay
      * @param major
      * @param minor
      * @return true if the eglDisplay is valid and it's reference counter becomes one and {@link EGL#eglInitialize(long, IntBuffer, IntBuffer)} was successful, otherwise false
-     * 
+     *
      * @see EGL#eglInitialize(long, IntBuffer, IntBuffer)
      */
-    public static synchronized boolean eglInitialize(long eglDisplay, IntBuffer major, IntBuffer minor)  {    
+    public static synchronized boolean eglInitialize(long eglDisplay, IntBuffer major, IntBuffer minor)  {
         if( EGL.EGL_NO_DISPLAY == eglDisplay) {
             return false;
         }
@@ -157,16 +157,16 @@ public class EGLDisplayUtil {
         }
         return res;
     }
-    
+
     /**
      * @param nativeDisplayID
      * @param eglDisplay array of size 1 holding return value if successful, otherwise {@link EGL#EGL_NO_DISPLAY}.
-     * @param eglErr array of size 1 holding the EGL error value as retrieved by {@link EGL#eglGetError()} if not successful.  
+     * @param eglErr array of size 1 holding the EGL error value as retrieved by {@link EGL#eglGetError()} if not successful.
      * @param major
      * @param minor
-     * @return {@link EGL#EGL_SUCCESS} if successful, otherwise {@link EGL#EGL_BAD_DISPLAY} if {@link #eglGetDisplay(long)} failed 
+     * @return {@link EGL#EGL_SUCCESS} if successful, otherwise {@link EGL#EGL_BAD_DISPLAY} if {@link #eglGetDisplay(long)} failed
      *         or {@link EGL#EGL_NOT_INITIALIZED} if {@link #eglInitialize(long, IntBuffer, IntBuffer)} failed.
-     * 
+     *
      * @see #eglGetDisplay(long)
      * @see #eglInitialize(long, IntBuffer, IntBuffer)
      */
@@ -184,7 +184,7 @@ public class EGLDisplayUtil {
         eglDisplay[0] = _eglDisplay;
         return EGL.EGL_SUCCESS;
     }
-        
+
     /**
      * @param nativeDisplayID in/out array of size 1, passing the requested nativeVisualID, may return a different revised nativeVisualID handle
      * @return the initialized EGL display ID
@@ -209,7 +209,7 @@ public class EGLDisplayUtil {
         }
         throw new GLException("Failed to created/initialize EGL display incl. fallback default: native "+EGLContext.toHexString(nativeDisplayID[0])+", error "+EGLContext.toHexString(eglRes)+"/"+EGLContext.toHexString(eglError[0]));
     }
-        
+
     /**
      * @param eglDisplay the EGL display handle
      * @return true if the eglDisplay is valid and it's reference counter becomes zero and {@link EGL#eglTerminate(long)} was successful, otherwise false
@@ -218,7 +218,7 @@ public class EGLDisplayUtil {
         if( EGL.EGL_NO_DISPLAY == eglDisplay) {
             return false;
         }
-        final boolean res;    
+        final boolean res;
         final int refCnt;
         final DpyCounter d;
         {
@@ -237,7 +237,7 @@ public class EGLDisplayUtil {
         } else {
             if(0 < refCnt) { // no negative refCount
                 d.refCount = refCnt;
-            } 
+            }
             res = true;
         }
         if(DEBUG) {
@@ -246,7 +246,7 @@ public class EGLDisplayUtil {
         }
         return res;
     }
-    
+
     public static final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback = new EGLGraphicsDevice.EGLDisplayLifecycleCallback() {
         public long eglGetAndInitDisplay(long[] nativeDisplayID) {
             return eglGetDisplayAndInitialize(nativeDisplayID);
@@ -255,25 +255,25 @@ public class EGLDisplayUtil {
             EGLDisplayUtil.eglTerminate(eglDisplayHandle);
         }
     };
-    
+
     /**
      * @param nativeDisplayID
      * @param connection
      * @param unitID
-     * @return an initialized EGLGraphicsDevice 
+     * @return an initialized EGLGraphicsDevice
      * @throws GLException if {@link EGL#eglGetDisplay(long)} or {@link EGL#eglInitialize(long, int[], int, int[], int)} fails
-     * @see EGLGraphicsDevice#EGLGraphicsDevice(long, long, String, int, com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLDisplayLifecycleCallback) 
+     * @see EGLGraphicsDevice#EGLGraphicsDevice(long, long, String, int, com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLDisplayLifecycleCallback)
      */
     public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(long nativeDisplayID, String connection, int unitID)  {
         final EGLGraphicsDevice eglDisplay = new EGLGraphicsDevice(nativeDisplayID, EGL.EGL_NO_DISPLAY, connection, unitID, eglLifecycleCallback);
         eglDisplay.open();
         return eglDisplay;
     }
-    
+
     /**
      * @param surface
-     * @return an initialized EGLGraphicsDevice 
-     * @throws GLException if {@link EGL#eglGetDisplay(long)} or {@link EGL#eglInitialize(long, int[], int, int[], int)} fails incl fallback 
+     * @return an initialized EGLGraphicsDevice
+     * @throws GLException if {@link EGL#eglGetDisplay(long)} or {@link EGL#eglInitialize(long, int[], int, int[], int)} fails incl fallback
      */
     public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(NativeSurface surface)  {
         final long nativeDisplayID;
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
index 2edf26145..bf269c548 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
@@ -59,15 +59,15 @@ public abstract class EGLDrawable extends GLDrawableImpl {
     @Override
     public abstract GLContext createContext(GLContext shareWith);
 
-    protected abstract long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle);    
+    protected abstract long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle);
 
     private final long createEGLSurface() {
         final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
-        final EGLGraphicsConfiguration eglConfig = (EGLGraphicsConfiguration) eglws.getGraphicsConfiguration();        
+        final EGLGraphicsConfiguration eglConfig = (EGLGraphicsConfiguration) eglws.getGraphicsConfiguration();
         final NativeSurface upstreamSurface = eglws.getUpstreamSurface();
-        
+
         long eglSurface = createSurface(eglConfig, eglws.getWidth(), eglws.getHeight(), upstreamSurface.getSurfaceHandle());
-        
+
         int eglError0;
         if (EGL.EGL_NO_SURFACE == eglSurface) {
             eglError0 = EGL.eglGetError();
@@ -104,7 +104,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
         final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
         if(DEBUG) {
             System.err.println(getThreadName() + ": createHandle of "+eglws);
-        }        
+        }
         if( eglws.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
             if( EGL.EGL_NO_SURFACE != eglws.getSurfaceHandle() ) {
                 throw new InternalError("Set surface but claimed to be invalid: "+eglws);
@@ -114,12 +114,12 @@ public abstract class EGLDrawable extends GLDrawableImpl {
             throw new InternalError("Nil surface but claimed to be valid: "+eglws);
         }
     }
-    
-    protected void destroyHandle() {    
+
+    protected void destroyHandle() {
         final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
         if(DEBUG) {
             System.err.println(getThreadName() + ": destroyHandle of "+eglws);
-        }        
+        }
         if( EGL.EGL_NO_SURFACE == eglws.getSurfaceHandle() ) {
             throw new InternalError("Nil surface but claimed to be valid: "+eglws);
         }
@@ -134,7 +134,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
         if( 0 == surfaceHandle ) {
             return false;
         }
-        final IntBuffer val = Buffers.newDirectIntBuffer(1);        
+        final IntBuffer val = Buffers.newDirectIntBuffer(1);
         final boolean eglSurfaceValid = EGL.eglQuerySurface(eglDisplayHandle, surfaceHandle, EGL.EGL_CONFIG_ID, val);
         if( !eglSurfaceValid ) {
             final int eglErr = EGL.eglGetError();
@@ -144,7 +144,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
         }
         return eglSurfaceValid;
     }
-    
+
     @Override
     protected final void setRealizedImpl() {
         if(DEBUG) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index 5d99e3eba..a0d896e3a 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -83,14 +83,14 @@ import com.jogamp.opengl.GLRendererQuirks;
 
 public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     protected static final boolean DEBUG = GLDrawableFactoryImpl.DEBUG; // allow package access
-    
+
     /* package */ static final boolean QUERY_EGL_ES_NATIVE_TK;
-    
+
     static {
         Debug.initSingleton();
         QUERY_EGL_ES_NATIVE_TK = Debug.isPropertyDefined("jogl.debug.EGLDrawableFactory.QueryNativeTK", true);
     }
-    
+
     private static GLDynamicLookupHelper eglES1DynamicLookupHelper = null;
     private static GLDynamicLookupHelper eglES2DynamicLookupHelper = null;
 
@@ -109,7 +109,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                dl.isFunctionAvailable("glEnableClientState") &&
                dl.isFunctionAvailable("glColorPointer");
     }
-    
+
     public EGLDrawableFactory() {
         super();
 
@@ -189,10 +189,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                 } else {
                     if( isANGLE && ( DEBUG || GLProfile.DEBUG ) ) {
                         System.err.println("Info: EGLDrawableFactory.init - EGL/ES2 ANGLE enabled");
-                    }                    
+                    }
                     sharedMap = new HashMap<String /*uniqueKey*/, SharedResource>();
                     sharedMapCreateAttempt = new HashSet<String>();
-                    
+
                     // FIXME: Following triggers eglInitialize(..) which crashed on Windows w/ Chrome/Angle, FF/Angle!
                     defaultDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
                 }
@@ -204,8 +204,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     protected final boolean isComplete() {
         return null != sharedMap; // null != eglES2DynamicLookupHelper || null != eglES1DynamicLookupHelper;
     }
-  
-    
+
+
     @Override
     protected final void destroy() {
         if(null != sharedMap) {
@@ -247,7 +247,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         EGLGraphicsConfigurationFactory.unregisterFactory();
         EGLDisplayUtil.shutdown(DEBUG);
     }
-    
+
     private void dumpMap() {
         synchronized(sharedMap) {
             System.err.println("EGLDrawableFactory.map "+sharedMap.size());
@@ -265,7 +265,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     private HashMap<String /*uniqueKey*/, SharedResource> sharedMap = null;
-    private HashSet<String> sharedMapCreateAttempt = null;    
+    private HashSet<String> sharedMapCreateAttempt = null;
     private EGLGraphicsDevice defaultDevice = null;
     private SharedResource defaultSharedResource = null;
     private boolean isANGLE = false;
@@ -286,9 +286,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
       private final boolean hasPBufferES1;
       private final boolean hasPBufferES3ES2;
 
-      SharedResource(EGLGraphicsDevice dev, 
-                     boolean wasContextES1Created, boolean hasPBufferES1, GLRendererQuirks rendererQuirksES1, int ctpES1,  
-                     boolean wasContextES2Created, boolean wasContextES3Created, 
+      SharedResource(EGLGraphicsDevice dev,
+                     boolean wasContextES1Created, boolean hasPBufferES1, GLRendererQuirks rendererQuirksES1, int ctpES1,
+                     boolean wasContextES2Created, boolean wasContextES3Created,
                      boolean hasPBufferES3ES2, GLRendererQuirks rendererQuirksES3ES2, int ctpES3ES2) {
           this.device = dev;
           // this.contextES1 = ctxES1;
@@ -296,7 +296,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
           this.hasPBufferES1= hasPBufferES1;
           this.rendererQuirksES1 = rendererQuirksES1;
           this.ctpES1 = ctpES1;
-          
+
           // this.contextES2 = ctxES2;
           // this.contextES3 = ctxES3;
           this.wasES2ContextCreated = wasContextES2Created;
@@ -314,7 +314,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
       // final EGLContext getContextES1() { return contextES1; }
       // final EGLContext getContextES2() { return contextES2; }
       // final EGLContext getContextES3() { return contextES3; }
-      
+
       @Override
       public AbstractGraphicsScreen getScreen() {
           return null;
@@ -329,7 +329,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
       }
       @Override
       public GLRendererQuirks getRendererQuirks() {
-          return null != rendererQuirksES3ES2 ? rendererQuirksES3ES2 : rendererQuirksES1 ;      
+          return null != rendererQuirksES3ES2 ? rendererQuirksES3ES2 : rendererQuirksES1 ;
       }
     }
 
@@ -359,18 +359,18 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         }
         return new ArrayList<GLCapabilitiesImmutable>(0);
     }
-    
-    private boolean mapAvailableEGLESConfig(AbstractGraphicsDevice adevice, int esProfile, 
+
+    private boolean mapAvailableEGLESConfig(AbstractGraphicsDevice adevice, int esProfile,
                                             boolean[] hasPBuffer, GLRendererQuirks[] rendererQuirks, int[] ctp) {
         final String profileString;
         switch( esProfile ) {
             case 3:
-                profileString = GLProfile.GLES3; break; 
+                profileString = GLProfile.GLES3; break;
             case 2:
-                profileString = GLProfile.GLES2; break; 
-            case 1: 
+                profileString = GLProfile.GLES2; break;
+            case 1:
                 profileString = GLProfile.GLES1; break;
-            default: 
+            default:
                 throw new GLException("Invalid ES profile number "+esProfile);
         }
         if ( !GLProfile.isAvailable(adevice, profileString) ) {
@@ -394,23 +394,23 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         ProxySurface upstreamSurface = null; // X11, GLX, ..
         boolean success = false;
         boolean deviceFromUpstreamSurface = false;
-        try {            
+        try {
             final GLCapabilities reqCapsAny = new GLCapabilities(glp);
             reqCapsAny.setRedBits(5); reqCapsAny.setGreenBits(5); reqCapsAny.setBlueBits(5); reqCapsAny.setAlphaBits(0);
             reqCapsAny.setDoubleBuffered(false);
-            
+
             if( mapsADeviceToDefaultDevice ) {
                 // In this branch, any non EGL device is mapped to EGL default shared resources (default behavior).
-                // Only one default shared resource instance is ever be created. 
+                // Only one default shared resource instance is ever be created.
                 final GLCapabilitiesImmutable reqCapsPBuffer = GLGraphicsConfigurationUtil.fixGLPBufferGLCapabilities(reqCapsAny);
                 final List<GLCapabilitiesImmutable> availablePBufferCapsL = getAvailableEGLConfigs(defaultDevice, reqCapsPBuffer);
                 hasPBuffer[0] = availablePBufferCapsL.size() > 0;
-                
+
                 // 1st case: adevice is not the EGL default device, map default shared resources
                 if( adevice != defaultDevice ) {
                     if(null == defaultSharedResource) {
                         return false;
-                    }                    
+                    }
                     switch(esProfile) {
                         case 3:
                             if( !defaultSharedResource.wasES3ContextCreated ) {
@@ -419,14 +419,14 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                             rendererQuirks[0] = defaultSharedResource.rendererQuirksES3ES2;
                             ctp[0] = defaultSharedResource.ctpES3ES2;
                             break;
-                        case 2: 
+                        case 2:
                             if( !defaultSharedResource.wasES2ContextCreated ) {
                                 return false;
                             }
                             rendererQuirks[0] = defaultSharedResource.rendererQuirksES3ES2;
                             ctp[0] = defaultSharedResource.ctpES3ES2;
                             break;
-                        case 1: 
+                        case 1:
                             if( !defaultSharedResource.wasES1ContextCreated ) {
                                 return false;
                             }
@@ -437,11 +437,11 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                     EGLContext.mapStaticGLVersion(adevice, esProfile, 0, ctp[0]);
                     return true;
                 }
-                
+
                 // attempt to created the default shared resources ..
-                
+
                 eglDevice = defaultDevice; // reuse
-                
+
                 if( hasPBuffer[0] ) {
                     // 2nd case create defaultDevice shared resource using pbuffer surface
                     surface = createDummySurfaceImpl(eglDevice, false, reqCapsPBuffer, reqCapsPBuffer, null, 64, 64); // egl pbuffer offscreen
@@ -459,15 +459,15 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                     if(DEBUG) {
                         System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig() no pbuffer config available, detected !pbuffer config: "+success);
                         EGLGraphicsConfigurationFactory.printCaps("!PBufferCaps", capsAnyL, System.err);
-                    }                    
-                }                
+                    }
+                }
             } else {
-                // 4th case always creates a true mapping of given device to EGL                
+                // 4th case always creates a true mapping of given device to EGL
                 surface = desktopFactory.createDummySurface(adevice, reqCapsAny, null, 64, 64); // X11, WGL, .. dummy window
                 upstreamSurface = ( surface instanceof ProxySurface ) ? (ProxySurface)surface : null ;
                 if(null != upstreamSurface) {
                     upstreamSurface.createNotify();
-                }                    
+                }
                 eglDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(surface);
                 deviceFromUpstreamSurface = true;
                 hasPBuffer[0] = true;
@@ -482,7 +482,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                         context.makeCurrent(); // could cause exception
                         if(context.isCurrent()) {
                             final String glVersion = context.getGL().glGetString(GL.GL_VERSION);
-                            if(null != glVersion) {                                
+                            if(null != glVersion) {
                                 context.mapCurrentAvailableGLVersion(eglDevice);
                                 if(eglDevice != adevice) {
                                     context.mapCurrentAvailableGLVersion(adevice);
@@ -493,7 +493,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                             } else {
                                 // Oops .. something is wrong
                                 if(DEBUG) {
-                                    System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: "+eglDevice+", "+context.getGLVersion()+" - VERSION is null, dropping availability!");                                
+                                    System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: "+eglDevice+", "+context.getGLVersion()+" - VERSION is null, dropping availability!");
                                 }
                             }
                         }
@@ -510,7 +510,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
             }
         } catch (Throwable t) {
             if(DEBUG) {
-                System.err.println("Catched Exception on thread "+getThreadName()); 
+                System.err.println("Catched Exception on thread "+getThreadName());
                 t.printStackTrace();
             }
             success = false;
@@ -518,7 +518,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
             if(eglDevice == defaultDevice) {
                 if(null != upstreamSurface) {
                     upstreamSurface.destroyNotify();
-                }                
+                }
             } else if( deviceFromUpstreamSurface ) {
                 if(null != eglDevice) {
                     eglDevice.close();
@@ -529,7 +529,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
             } else {
                 if(null != upstreamSurface) {
                     upstreamSurface.destroyNotify();
-                }                
+                }
                 if(null != eglDevice) {
                     eglDevice.close();
                 }
@@ -553,9 +553,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                 }
                 return false;
             }
-        }        
+        }
     }
-    
+
     @Override
     protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice adevice) {
         if(null == sharedMap) { // null == eglES1DynamicLookupHelper && null == eglES2DynamicLookupHelper
@@ -571,27 +571,27 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                 dumpMap();
                 throw new InternalError("defaultSharedResource already exist: "+defaultSharedResource);
             }
-            defaultSharedResource = createEGLSharedResourceImpl(defaultDevice);            
+            defaultSharedResource = createEGLSharedResourceImpl(defaultDevice);
         }
-        
+
         final String key = adevice.getUniqueID();
         if( defaultDevice.getUniqueID().equals(key) ) {
             return defaultSharedResource;
         } else {
-            if( null == defaultSharedResource) { // defaultDevice must be initialized before host-device 
+            if( null == defaultSharedResource) { // defaultDevice must be initialized before host-device
                 dumpMap();
-                throw new InternalError("defaultSharedResource does not exist");            
+                throw new InternalError("defaultSharedResource does not exist");
             }
             final SharedResource[] existing = new SharedResource[] { null };
             if ( !needsToCreateSharedResource(key, existing) ) {
                 return existing[0];
-            }            
+            }
             return createEGLSharedResourceImpl(adevice);
         }
     }
-    
+
     private SharedResource createEGLSharedResourceImpl(AbstractGraphicsDevice adevice) {
-        final boolean madeCurrentES1;            
+        final boolean madeCurrentES1;
         final boolean madeCurrentES2;
         final boolean madeCurrentES3;
         boolean[] hasPBufferES1 = new boolean[] { false };
@@ -602,12 +602,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         GLRendererQuirks[] rendererQuirksES3ES2 = new GLRendererQuirks[] { null };
         int[] ctpES1 = new int[] { -1 };
         int[] ctpES3ES2 = new int[] { -1 };
-        
-        
+
+
         if (DEBUG) {
             System.err.println("EGLDrawableFactory.createShared(): device "+adevice);
         }
-        
+
         if( null != eglES1DynamicLookupHelper ) {
             madeCurrentES1 = mapAvailableEGLESConfig(adevice, 1, hasPBufferES1, rendererQuirksES1, ctpES1);
         } else {
@@ -625,10 +625,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
             madeCurrentES2 = false;
             madeCurrentES3 = false;
         }
-        
+
         if( !EGLContext.getAvailableGLVersionsSet(adevice) ) {
             // Even though we override the non EGL native mapping intentionally,
-            // avoid exception due to double 'set' - carefull exception of the rule. 
+            // avoid exception due to double 'set' - carefull exception of the rule.
             EGLContext.setAvailableGLVersionsSet(adevice);
         }
         if( hasX11 ) {
@@ -637,7 +637,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         }
         final SharedResource sr = new SharedResource(defaultDevice, madeCurrentES1, hasPBufferES1[0], rendererQuirksES1[0], ctpES1[0],
                                                                     madeCurrentES2, madeCurrentES3, hasPBufferES3ES2[0], rendererQuirksES3ES2[0], ctpES3ES2[0]);
-        
+
         synchronized(sharedMap) {
             sharedMap.put(adevice.getUniqueID(), sr);
         }
@@ -650,7 +650,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         }
         return sr;
     }
-    
+
     private void handleDontCloseX11DisplayQuirk(GLRendererQuirks quirks) {
         if( null != quirks && quirks.exist( GLRendererQuirks.DontCloseX11Display ) ) {
             jogamp.nativewindow.x11.X11Util.markAllDisplaysUnclosable();
@@ -692,7 +692,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         }
         return new EGLOnscreenDrawable(this, EGLWrappedSurface.get(target));
     }
-    
+
     @Override
     protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
         if (target == null) {
@@ -715,8 +715,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice, 
-                                                    GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, 
+    protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
+                                                    GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
                                                     GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
         final boolean ownDevice;
         final EGLGraphicsDevice device;
@@ -732,21 +732,21 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         final DefaultGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);
         final EGLGraphicsConfiguration config = EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen, VisualIDHolder.VID_UNDEFINED, false);
         if(null == config) {
-            throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen); 
-        }    
+            throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen);
+        }
         return new WrappedSurface(config, 0, upstreamHook, ownDevice);
     }
-    
+
     @Override
-    public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice, 
+    public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
                                                      GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
-        chosenCaps = GLGraphicsConfigurationUtil.fixOffscreenBitOnly(chosenCaps); // complete validation in EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(..) above         
+        chosenCaps = GLGraphicsConfigurationUtil.fixOffscreenBitOnly(chosenCaps); // complete validation in EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(..) above
         return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new EGLDummyUpstreamSurfaceHook(width, height));
     }
-    
+
     /**
-     * @param ms {@link MutableSurface} which dimensions and config are being used to create the pbuffer surface. 
-     *           It will also hold the resulting pbuffer surface handle. 
+     * @param ms {@link MutableSurface} which dimensions and config are being used to create the pbuffer surface.
+     *           It will also hold the resulting pbuffer surface handle.
      * @param useTexture
      * @return the passed {@link MutableSurface} which now has the EGL pbuffer surface set as it's handle
      */
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
index 162e7166a..eb6578ec5 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
@@ -9,17 +9,17 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
 
 public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
     /**
-     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)}, 
-     *        not the actual dummy surface width. 
+     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+     *        not the actual dummy surface width.
      *        The latter is platform specific and small
-     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)}, 
+     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
      *        not the actual dummy surface height,
      *        The latter is platform specific and small
      */
     public EGLDummyUpstreamSurfaceHook(int width, int height) {
         super(width, height);
     }
-    
+
     @Override
     public final void create(ProxySurface s) {
         final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
@@ -31,14 +31,14 @@ public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
             }
             if( EGL.EGL_NO_SURFACE == s.getSurfaceHandle() ) {
                 s.setSurfaceHandle( EGLDrawableFactory.createPBufferSurfaceImpl((EGLGraphicsConfiguration)s.getGraphicsConfiguration(), 64, 64, false) );
-                s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );            
+                s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
             }
             s.addUpstreamOptionBits(ProxySurface.OPT_UPSTREAM_WINDOW_INVISIBLE);
         } finally {
             eglDevice.unlock();
         }
     }
-    
+
     @Override
     public final void destroy(ProxySurface s) {
         if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
index 778f0cb38..ac880ebc0 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl.egl;
 
 import com.jogamp.common.os.AndroidVersion;
@@ -52,7 +52,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
         super();
     }
 
-    /** 
+    /**
      * Returns <code>true</code> on <code>Android</code>,
      * and <code>false</code> otherwise.
      */
@@ -65,7 +65,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
         // default behavior for other platforms
         return false;
     }
-    
+
     @Override
     public final List<String> getToolGetProcAddressFuncNameList() {
         List<String> res = new ArrayList<String>();
@@ -87,26 +87,26 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
             return true;
         }
     }
-    
+
     protected final List<String> getEGLLibNamesList() {
         List<String> eglLibNames = new ArrayList<String>();
-        
-        // this is the default EGL lib name, according to the spec 
+
+        // this is the default EGL lib name, according to the spec
         eglLibNames.add("libEGL.so.1");
-        
+
         // try these as well, if spec fails
         eglLibNames.add("libEGL.so");
         eglLibNames.add("EGL");
-        
-        // for windows distributions using the 'unlike' lib prefix, 
+
+        // for windows distributions using the 'unlike' lib prefix,
         // where our tool does not add it.
         eglLibNames.add("libEGL");
-        
+
         return eglLibNames;
     }
 
     @Override
     public final List<String> getGlueLibNames() {
         return glueLibNames;
-    }    
+    }
 }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
index dd3d6faea..9ffcea864 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl.egl;
 
 import java.util.*;
@@ -39,29 +39,29 @@ public final class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
         final List<List<String>> libsList = new ArrayList<List<String>>();
         {
             final List<String> libsGL = new ArrayList<String>();
-            
-            // this is the default lib name, according to the spec 
+
+            // this is the default lib name, according to the spec
             libsGL.add("libGLESv1_CM.so.2");
-            
+
             // try these as well, if spec fails
             libsGL.add("libGLESv1_CM.so");
-            libsGL.add("GLESv1_CM");            
+            libsGL.add("GLESv1_CM");
 
             // alternative names
             libsGL.add("GLES_CM");
             libsGL.add("GLES_CL");
-            
-            // for windows distributions using the 'unlike' lib prefix, 
+
+            // for windows distributions using the 'unlike' lib prefix,
             // where our tool does not add it.
             libsGL.add("libGLESv1_CM");
             libsGL.add("libGLES_CM");
             libsGL.add("libGLES_CL");
-            
+
             libsList.add(libsGL);
         }
         libsList.add(getEGLLibNamesList());
-        
+
         return libsList;
-    }    
+    }
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
index 0d20fd4e8..de1f0a42e 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,17 +20,17 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl.egl;
 
 import java.util.*;
 
-/** 
+/**
  * <p>
  * Covering ES3 and ES2.
  * </p>
@@ -44,12 +44,12 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
         final List<List<String>> libsList = new ArrayList<List<String>>();
         {
             final List<String> libsGL = new ArrayList<String>();
-            
-            // ES3: This is the default lib name, according to the spec            
+
+            // ES3: This is the default lib name, according to the spec
             libsGL.add("libGLESv3.so.3");
-            
+
             // ES3: Try these as well, if spec fails
-            libsGL.add("libGLESv3.so");            
+            libsGL.add("libGLESv3.so");
             libsGL.add("GLESv3");
 
             // ES3: Alternative names
@@ -59,12 +59,12 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
             // where our tool does not add it.
             libsGL.add("libGLESv3");
             libsGL.add("libGLES30");
-            
-            // ES2: This is the default lib name, according to the spec            
+
+            // ES2: This is the default lib name, according to the spec
             libsGL.add("libGLESv2.so.2");
-            
+
             // ES2: Try these as well, if spec fails
-            libsGL.add("libGLESv2.so");            
+            libsGL.add("libGLESv2.so");
             libsGL.add("GLESv2");
 
             // ES2: Alternative names
@@ -75,14 +75,14 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
             // where our tool does not add it.
             libsGL.add("libGLESv2");
             libsGL.add("libGLESv2_CM");
-            libsGL.add("libGLES20"); 
-    
+            libsGL.add("libGLES20");
+
             libsList.add(libsGL);
         }
         libsList.add(getEGLLibNamesList());
-        
+
         return libsList;
-    }    
-    
+    }
+
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
index b1ffe608e..f3592c150 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -57,7 +57,7 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
 import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
 
 public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
-    
+
     public final long getNativeConfig() {
         return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfig();
     }
@@ -66,7 +66,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfigID();
     }
 
-    EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen, 
+    EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen,
                              EGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
         super(absScreen, capsChosen, capsRequested);
         this.chooser = chooser;
@@ -77,7 +77,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
      * @param absScreen
      * @param eglConfigID {@link EGL#EGL_CONFIG_ID} for which the config is being created for.
      * @return
-     * @throws GLException if invalid EGL display. 
+     * @throws GLException if invalid EGL display.
      */
     public static EGLGraphicsConfiguration create(GLCapabilitiesImmutable capsRequested, AbstractGraphicsScreen absScreen, int eglConfigID) {
         final AbstractGraphicsDevice absDevice = absScreen.getDevice();
@@ -101,9 +101,9 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
     public Object clone() {
         return super.clone();
     }
-        
+
     void updateGraphicsConfiguration() {
-        CapabilitiesImmutable capsChosen = getChosenCapabilities(); 
+        CapabilitiesImmutable capsChosen = getChosenCapabilities();
         EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
             GraphicsConfigurationFactory.getFactory(getScreen().getDevice(), capsChosen).chooseGraphicsConfiguration(
                 capsChosen, getRequestedCapabilities(), chooser, getScreen(), VisualIDHolder.VID_UNDEFINED);
@@ -140,7 +140,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
             return false;
         }
         final IntBuffer val = Buffers.newDirectIntBuffer(1);
-        
+
         // get the configID
         if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, val)) {
             final int eglErr = EGL.eglGetError();
@@ -169,7 +169,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         }
         if ( 0 != ( _stype & EGL.EGL_PBUFFER_BIT ) ) {
             val |= GLGraphicsConfigurationUtil.PBUFFER_BIT |
-                   GLGraphicsConfigurationUtil.FBO_BIT;     
+                   GLGraphicsConfigurationUtil.FBO_BIT;
         }
         return val;
     }
@@ -189,7 +189,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         final int cfgID;
         final int rType;
         final int visualID;
-        
+
         // get the configID
         if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, val)) {
             if(DEBUG) {
@@ -199,7 +199,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
             return null;
         }
         cfgID = val.get(0);
-        
+
         if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_RENDERABLE_TYPE, val)) {
             if(DEBUG) {
                 System.err.println("EGL couldn't retrieve EGL_RENDERABLE_TYPE for config "+toHexString(config)+", error "+toHexString(EGL.eglGetError()));
@@ -213,8 +213,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         } else {
             visualID = VisualIDHolder.VID_UNDEFINED;
         }
-        
-        EGLGLCapabilities caps = null;        
+
+        EGLGLCapabilities caps = null;
         try {
             if(null == glp) {
                 glp = EGLGLCapabilities.getCompatible(device, rType);
@@ -232,8 +232,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
                 System.err.println("config "+toHexString(config)+": "+gle);
             }
             return null;
-        }        
-                
+        }
+
         if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_CAVEAT, val)) {
             if( EGL.EGL_SLOW_CONFIG == val.get(0) ) {
                 caps.setHardwareAccelerated(false);
@@ -244,11 +244,11 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
             caps.setNumSamples(val.get(0));
         }
         if(!caps.getSampleBuffers()) {
-            // try NV_coverage_sample extension 
+            // try NV_coverage_sample extension
             if(EGL.eglGetConfigAttrib(display, config, EGLExt.EGL_COVERAGE_BUFFERS_NV, val)) {
                 if(val.get(0)>0 &&
                    EGL.eglGetConfigAttrib(display, config, EGLExt.EGL_COVERAGE_SAMPLES_NV, val)) {
-                    caps.setSampleExtension(GLGraphicsConfigurationUtil.NV_coverage_sample); 
+                    caps.setSampleExtension(GLGraphicsConfigurationUtil.NV_coverage_sample);
                     caps.setSampleBuffers(true);
                     caps.setNumSamples(val.get(0));
                 }
@@ -269,7 +269,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
             if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_BLUE_VALUE, val)) {
                 caps.setTransparentBlueValue(val.get(0)==EGL.EGL_DONT_CARE?-1:val.get(0));
             }
-            /** Not defined in EGL 
+            /** Not defined in EGL
             if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_ALPHA_VALUE, val)) {
                 caps.setTransparentAlphaValue(val.get(0)==EGL.EGL_DONT_CARE?-1:val.get(0));
             } */
@@ -294,16 +294,16 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
             caps.setDepthBits(val.get(0));
         }
 
-        // Since the passed GLProfile may be null, 
+        // Since the passed GLProfile may be null,
         // we use EGL_RENDERABLE_TYPE derived profile as created in the EGLGLCapabilities constructor.
-        final int availableTypeBits = EGLConfigDrawableTypeBits(device, config);        
+        final int availableTypeBits = EGLConfigDrawableTypeBits(device, config);
         final int drawableTypeBits = winattrmask & availableTypeBits;
 
         if( 0 == drawableTypeBits ) {
             return null;
         }
-        
-        return (EGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps); 
+
+        return (EGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
     }
 
     public static IntBuffer GLCapabilities2AttribList(GLCapabilitiesImmutable caps) {
@@ -313,7 +313,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         attrs.put(idx++, EGL.EGL_SURFACE_TYPE);
         final int surfaceType;
         if( caps.isOnscreen() ) {
-            surfaceType = EGL.EGL_WINDOW_BIT;            
+            surfaceType = EGL.EGL_WINDOW_BIT;
         } else if( caps.isFBO() ) {
             surfaceType = EGL.EGL_PBUFFER_BIT;  // native replacement!
         } else if( caps.isPBuffer() ) {
@@ -338,7 +338,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
             attrs.put(idx++, EGL.EGL_ALPHA_SIZE);
             attrs.put(idx++, caps.getAlphaBits());
         }
-        
+
         if(caps.getStencilBits()>0) {
             attrs.put(idx++, EGL.EGL_STENCIL_SIZE);
             attrs.put(idx++, caps.getStencilBits());
@@ -382,7 +382,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
             attrs.put(idx++, caps.getTransparentAlphaValue()>=0?caps.getTransparentAlphaValue():EGL.EGL_DONT_CARE; */
         }
 
-        // 28 
+        // 28
         attrs.put(idx++, EGL.EGL_RENDERABLE_TYPE);
         if(caps.getGLProfile().usesNativeGLES1()) {
             attrs.put(idx++, EGL.EGL_OPENGL_ES_BIT);
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
index b44e08500..5764a6178 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -75,10 +75,10 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
     static GraphicsConfigurationFactory nativeGraphicsConfigurationFactory = null;
     static GraphicsConfigurationFactory kdeglGraphicsConfigurationFactory = null;
     static GraphicsConfigurationFactory fallbackGraphicsConfigurationFactory = null;
-    
+
     static void registerFactory() {
         GraphicsConfigurationFactory eglFactory = new EGLGraphicsConfigurationFactory();
-        
+
         // become the pre-selector for X11/.. to match the native visual id w/ EGL, if native ES is selected
         final String nwType = NativeWindowFactory.getNativeWindowType(false);
         if(NativeWindowFactory.TYPE_X11 == nwType) {
@@ -86,32 +86,32 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
             if(null != nativeGraphicsConfigurationFactory) {
                 fallbackGraphicsConfigurationFactory = nativeGraphicsConfigurationFactory;
             } else {
-                fallbackGraphicsConfigurationFactory = GraphicsConfigurationFactory.getFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, CapabilitiesImmutable.class);                
+                fallbackGraphicsConfigurationFactory = GraphicsConfigurationFactory.getFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, CapabilitiesImmutable.class);
             }
         } /* else if(NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false)) {
             nativeGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, eglFactory);
-        } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {            
+        } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
         } */
-        
+
         // become the selector for KD/EGL ..
-        kdeglGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, GLCapabilitiesImmutable.class, eglFactory);                
+        kdeglGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, GLCapabilitiesImmutable.class, eglFactory);
     }
-    
+
     static void unregisterFactory() {
         final String nwType = NativeWindowFactory.getNativeWindowType(false);
         if(NativeWindowFactory.TYPE_X11 == nwType) {
-            GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, GLCapabilitiesImmutable.class, nativeGraphicsConfigurationFactory);                    
+            GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, GLCapabilitiesImmutable.class, nativeGraphicsConfigurationFactory);
         } /* else if(NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false)) {
             GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, nativeGraphicsConfigurationFactory);
-        } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {            
+        } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
         } */
         nativeGraphicsConfigurationFactory = null;
         fallbackGraphicsConfigurationFactory = null;
-        
+
         GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, GLCapabilitiesImmutable.class, kdeglGraphicsConfigurationFactory);
         kdeglGraphicsConfigurationFactory = null;
     }
-    
+
     private EGLGraphicsConfigurationFactory() {
     }
 
@@ -139,21 +139,21 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         AbstractGraphicsDevice absDevice = absScreen.getDevice();
         if(null==absDevice) {
             throw new GLException("Null AbstractGraphicsDevice");
-        }        
-        
+        }
+
         AbstractGraphicsConfiguration cfg = null;
-        
+
         if( absDevice instanceof EGLGraphicsDevice ) {
             cfg = chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable) capsChosen,
                                                     (GLCapabilitiesImmutable) capsRequested,
                                                     (GLCapabilitiesChooser) chooser,
-                                                    absScreen, nativeVisualID, false);            
+                                                    absScreen, nativeVisualID, false);
         } else {
-            // handle non native cases (X11, ..) 
+            // handle non native cases (X11, ..)
             if(null == fallbackGraphicsConfigurationFactory) {
                 throw new InternalError("Native fallback GraphicsConfigurationFactory is null, but call issued for device: "+absDevice+" of type "+absDevice.getClass().getSimpleName());
             }
-            
+
             if(glCapsChosen.getGLProfile().usesNativeGLES()) {
                 if(DEBUG) {
                     System.err.println("EGLGraphicsConfigurationFactory.choose..: Handle native device "+absDevice.getClass().getSimpleName());
@@ -175,7 +175,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
                     System.err.println("EGLGraphicsConfigurationFactory.choose..: Delegate to "+fallbackGraphicsConfigurationFactory.getClass().getSimpleName());
                 }
                 cfg = fallbackGraphicsConfigurationFactory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, absScreen, nativeVisualID);
-            }            
+            }
         }
         return cfg;
     }
@@ -219,7 +219,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
     public static EGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
                                                                              GLCapabilitiesImmutable capsReq,
                                                                              GLCapabilitiesChooser chooser,
-                                                                             AbstractGraphicsScreen absScreen, int nativeVisualID, 
+                                                                             AbstractGraphicsScreen absScreen, int nativeVisualID,
                                                                              boolean forceTransparentFlag) {
         if (capsChosen == null) {
             capsChosen = new GLCapabilities(null);
@@ -232,7 +232,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         if(null==absDevice) {
             throw new GLException("Null AbstractGraphicsDevice");
         }
-        
+
         final EGLGraphicsDevice eglDevice;
         final boolean ownEGLDisplay;
         if( absDevice instanceof EGLGraphicsDevice ) {
@@ -253,7 +253,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
             if(DEBUG) {
                 System.err.println("eglChooseConfig failed with given capabilities "+capsChosen);
             }
-    
+
             // Last try .. add a fixed embedded profile [ATI, Nokia, Intel, ..]
             //
             // rgb888 - d16, s4
@@ -268,7 +268,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
                 fixedCaps.setOnscreen(false);
                 fixedCaps.setPBuffer(capsChosen.isPBuffer());
                 fixedCaps.setFBO(capsChosen.isFBO());
-            }            
+            }
             if(DEBUG) {
                 System.err.println("trying fixed caps (1): "+fixedCaps);
             }
@@ -286,7 +286,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
                 fixedCaps.setOnscreen(false);
                 fixedCaps.setPBuffer(capsChosen.isPBuffer());
                 fixedCaps.setFBO(capsChosen.isFBO());
-            }            
+            }
             if(DEBUG) {
                 System.err.println("trying fixed caps (2): "+fixedCaps);
             }
@@ -306,7 +306,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
                 fixedCaps.setOnscreen(false);
                 fixedCaps.setPBuffer(capsChosen.isPBuffer());
                 fixedCaps.setFBO(capsChosen.isFBO());
-            }            
+            }
             if(DEBUG) {
                 System.err.println("trying fixed caps (3): "+fixedCaps);
             }
@@ -322,8 +322,8 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         return res;
     }
 
-    
-    static EGLGraphicsConfiguration eglChooseConfig(EGLGraphicsDevice device, 
+
+    static EGLGraphicsConfiguration eglChooseConfig(EGLGraphicsDevice device,
                                                     GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
                                                     GLCapabilitiesChooser chooser,
                                                     AbstractGraphicsScreen absScreen,
@@ -354,7 +354,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         final IntBuffer attrs = EGLGraphicsConfiguration.GLCapabilities2AttribList(capsChosen);
         PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
 
-        // 1st choice: get GLCapabilities based on users GLCapabilities 
+        // 1st choice: get GLCapabilities based on users GLCapabilities
         //             setting recommendedIndex as preferred choice
         // skipped if nativeVisualID is given
         if( VisualIDHolder.VID_UNDEFINED != nativeVisualID || !EGL.eglChooseConfig(eglDisplay, attrs, configs, configs.capacity(), numConfigs) ) {
@@ -387,7 +387,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
                 throw new GLException("EGLGraphicsConfiguration.eglChooseConfig: #2 Get all configs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
             }
             if (numConfigs.get(0) > 0) {
-                availableCaps = eglConfigs2GLCaps(device, glp, configs, numConfigs.get(0), winattrmask, forceTransparentFlag);                
+                availableCaps = eglConfigs2GLCaps(device, glp, configs, numConfigs.get(0), winattrmask, forceTransparentFlag);
             }
         }
 
@@ -400,7 +400,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
             }
             return null;
         }
-        
+
         if(DEBUG) {
             System.err.println("EGLGraphicsConfiguration.eglChooseConfig: got configs: "+availableCaps.size());
             for(int i=0; i<availableCaps.size(); i++) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
index 19084ba19..065f80dcb 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
@@ -54,8 +54,8 @@ public class EGLOnscreenDrawable extends EGLDrawable {
     }
 
     @Override
-    protected long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle) {    
+    protected long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle) {
         return EGL.eglCreateWindowSurface(config.getScreen().getDevice().getHandle(), config.getNativeConfig(), nativeSurfaceHandle, null);
-    }    
+    }
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
index 8dea10df1..5083c854f 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
@@ -23,8 +23,8 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
 public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
     protected static final boolean DEBUG = EGLDrawableFactory.DEBUG;
     private final NativeSurface upstreamSurface;
-    private final UpstreamSurfaceHook.MutableSize upstreamSurfaceHookMutableSize; 
-    
+    private final UpstreamSurfaceHook.MutableSize upstreamSurfaceHookMutableSize;
+
     public EGLUpstreamSurfaceHook(NativeSurface upstream) {
         upstreamSurface = upstream;
         if(upstreamSurface instanceof ProxySurface) {
@@ -39,32 +39,32 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
             upstreamSurfaceHookMutableSize = null;
         }
     }
-    
+
     public final NativeSurface getUpstreamSurface() { return upstreamSurface; }
-    
+
     static String getThreadName() { return Thread.currentThread().getName(); }
-    
+
     public final void setSize(int width, int height) {
         if(null != upstreamSurfaceHookMutableSize) {
             upstreamSurfaceHookMutableSize.setSize(width, height);
-        }        
+        }
     }
-    
+
     @Override
     public final void create(ProxySurface surface) {
         final String dbgPrefix;
         if(DEBUG) {
             dbgPrefix = getThreadName() + ": EGLUpstreamSurfaceHook.create( up "+upstreamSurface.getClass().getSimpleName()+" -> this "+surface.getClass().getSimpleName()+" ): ";
-            System.err.println(dbgPrefix+this);            
+            System.err.println(dbgPrefix+this);
         } else {
             dbgPrefix = null;
         }
-        
+
         if(upstreamSurface instanceof ProxySurface) {
-            // propagate createNotify(..) so upstreamSurface will be created 
+            // propagate createNotify(..) so upstreamSurface will be created
             ((ProxySurface)upstreamSurface).createNotify();
         }
-        
+
         // lock upstreamSurface, so it can be used in case EGLDisplay is derived from it!
         if(NativeSurface.LOCK_SURFACE_NOT_READY >= upstreamSurface.lockSurface()) {
             throw new GLException("Could not lock: "+upstreamSurface);
@@ -73,16 +73,16 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
             evalUpstreamSurface(dbgPrefix, surface);
         } finally {
             upstreamSurface.unlockSurface();
-        }        
+        }
     }
-    
+
     private final void evalUpstreamSurface(String dbgPrefix, ProxySurface surface) {
         //
         // evaluate nature of upstreamSurface, may create EGL instances if required
         //
-        
+
         boolean isEGLSurfaceValid = true; // assume yes
-        
+
         final EGLGraphicsDevice eglDevice;
         final AbstractGraphicsConfiguration aConfig;
         {
@@ -92,14 +92,14 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
                 System.err.println(dbgPrefix+"SurfaceDevice: "+surfaceDevice.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(surfaceDevice.hashCode())+", "+surfaceDevice);
                 System.err.println(dbgPrefix+"SurfaceConfig: "+surfaceConfig.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(surfaceConfig.hashCode())+", "+surfaceConfig);
             }
-    
-            final AbstractGraphicsConfiguration upstreamConfig = upstreamSurface.getGraphicsConfiguration();        
+
+            final AbstractGraphicsConfiguration upstreamConfig = upstreamSurface.getGraphicsConfiguration();
             final AbstractGraphicsDevice upstreamDevice = upstreamConfig.getScreen().getDevice();
             if(DEBUG) {
                 System.err.println(dbgPrefix+"UpstreamDevice: "+upstreamDevice.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(upstreamDevice.hashCode())+", "+upstreamDevice);
                 System.err.println(dbgPrefix+"UpstreamConfig: "+upstreamConfig.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(upstreamConfig.hashCode())+", "+upstreamConfig);
             }
-            
+
             if( surfaceDevice instanceof EGLGraphicsDevice ) {
                 eglDevice = (EGLGraphicsDevice) surfaceDevice;
                 aConfig = surfaceConfig;
@@ -129,13 +129,13 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
                 surface.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
             }
         }
-        
+
         final GLCapabilitiesImmutable capsRequested = (GLCapabilitiesImmutable) aConfig.getRequestedCapabilities();
         final EGLGraphicsConfiguration eglConfig;
         if( aConfig instanceof EGLGraphicsConfiguration ) {
             // Config is already in EGL type - reuse ..
             final EGLGLCapabilities capsChosen = (EGLGLCapabilities) aConfig.getChosenCapabilities();
-            if( !isEGLSurfaceValid || !EGLGraphicsConfiguration.isEGLConfigValid(eglDevice.getHandle(), capsChosen.getEGLConfig()) ) { 
+            if( !isEGLSurfaceValid || !EGLGraphicsConfiguration.isEGLConfigValid(eglDevice.getHandle(), capsChosen.getEGLConfig()) ) {
                 // 'refresh' the native EGLConfig handle
                 capsChosen.setEGLConfig(EGLGraphicsConfiguration.EGLConfigId2EGLConfig(eglDevice.getHandle(), capsChosen.getEGLConfigID()));
                 if( 0 == capsChosen.getEGLConfig() ) {
@@ -166,7 +166,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
             isEGLSurfaceValid = false;
         }
         surface.setGraphicsConfiguration(eglConfig);
-        
+
         if(isEGLSurfaceValid) {
             isEGLSurfaceValid = EGLDrawable.isValidEGLSurface(eglDevice.getHandle(), upstreamSurface.getSurfaceHandle());
         }
@@ -182,15 +182,15 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
             if(DEBUG) {
                 System.err.println(dbgPrefix+"Fin: EGL surface n/a - TBD: "+upstreamSurface);
             }
-        }        
+        }
     }
 
     @Override
     public final void destroy(ProxySurface surface) {
         if(EGLDrawableFactory.DEBUG) {
-            System.err.println("EGLUpstreamSurfaceHook.destroy("+surface.getClass().getSimpleName()+"): "+this);            
+            System.err.println("EGLUpstreamSurfaceHook.destroy("+surface.getClass().getSimpleName()+"): "+this);
         }
-        surface.clearUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );            
+        surface.clearUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
         if(upstreamSurface instanceof ProxySurface) {
             ((ProxySurface)upstreamSurface).destroyNotify();
         }
@@ -205,7 +205,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
     public final int getHeight(ProxySurface s) {
         return upstreamSurface.getHeight();
     }
-    
+
     @Override
     public String toString() {
         final String us_s = null != upstreamSurface ? ( upstreamSurface.getClass().getName() + ": 0x" + Long.toHexString(upstreamSurface.getSurfaceHandle()) ) : "nil";
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
index f816151c7..e6d43d957 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
@@ -19,16 +19,16 @@ public class EGLWrappedSurface extends WrappedSurface {
         }
         return new EGLWrappedSurface(surface);
     }
-    
+
     public EGLWrappedSurface(NativeSurface surface) {
         super(surface.getGraphicsConfiguration(), EGL.EGL_NO_SURFACE, new EGLUpstreamSurfaceHook(surface), false /* tbd in UpstreamSurfaceHook */);
         if(EGLDrawableFactory.DEBUG) {
-            System.err.println("EGLWrappedSurface.ctor(): "+this);            
+            System.err.println("EGLWrappedSurface.ctor(): "+this);
         }
     }
 
     @Override
-    public final NativeSurface getUpstreamSurface() { 
-        return ((EGLUpstreamSurfaceHook)super.getUpstreamSurfaceHook()).getUpstreamSurface(); 
-    }    
+    public final NativeSurface getUpstreamSurface() {
+        return ((EGLUpstreamSurfaceHook)super.getUpstreamSurfaceHook()).getUpstreamSurface();
+    }
 }
diff --git a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
index 9165dbc4b..a4aa1c7c5 100644
--- a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
+++ b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
@@ -6,9 +6,9 @@
 ** this file except in compliance with the License. You may obtain a copy
 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-** 
+**
 ** http://oss.sgi.com/projects/FreeB
-** 
+**
 ** Note that, as provided in the License, the Software is distributed on an
 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
@@ -24,13 +24,13 @@
 ** except that Section 2.2 and 11 are omitted.  Any differences between
 ** the Alternative License and the SGI License are offered solely by Sun
 ** and not by SGI.
-** 
+**
 ** Original Code. The Original Code is: OpenGL Sample Implementation,
 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
 ** Copyright in any portions created by third parties is as indicated
 ** elsewhere herein. All Rights Reserved.
-** 
+**
 ** Additional Notice Provisions: The application programming interfaces
 ** established by SGI in conjunction with the Original Code are The
 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -45,56 +45,56 @@
 ** $Header$
 */
 
-/* 
+/*
  * Copyright (c) 2002-2004 LWJGL Project
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are 
+ * modification, are permitted provided that the following conditions are
  * met:
- * 
- * * Redistributions of source code must retain the above copyright 
+ *
+ * * Redistributions of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
  *
  * * Redistributions in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
  *
- * * Neither the name of 'LWJGL' nor the names of 
- *   its contributors may be used to endorse or promote products derived 
+ * * Neither the name of 'LWJGL' nor the names of
+ *   its contributors may be used to endorse or promote products derived
  *   from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -107,7 +107,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -125,7 +125,7 @@ import com.jogamp.common.nio.Buffers;
  * <p/>
  * <p/>
  * Created 11-jan-2004
- * 
+ *
  * @author Erik Duijs
  * @author Kenneth Russell
  */
@@ -155,7 +155,7 @@ public class ProjectDouble {
   private final double[] forward = new double[3];
   private final double[] side = new double[3];
   private final double[] up = new double[3];
-  
+
   // Buffer-based implementation
   private DoubleBuffer locbuf;
   private final DoubleBuffer matrixBuf;
@@ -227,7 +227,7 @@ public class ProjectDouble {
 
   /**
    * Method __gluMultMatrixVecd
-   * 
+   *
    * @param matrix
    * @param in
    * @param out
@@ -244,7 +244,7 @@ public class ProjectDouble {
 
   /**
    * Method __gluMultMatrixVecd
-   * 
+   *
    * @param matrix
    * @param in
    * @param out
@@ -265,7 +265,7 @@ public class ProjectDouble {
   /**
    * @param src
    * @param inverse
-   * 
+   *
    * @return
    */
   private boolean __gluInvertMatrixd(double[] src, double[] inverse) {
@@ -335,7 +335,7 @@ public class ProjectDouble {
   /**
    * @param src
    * @param inverse
-   * 
+   *
    * @return
    */
   private boolean __gluInvertMatrixd(DoubleBuffer src, DoubleBuffer inverse) {
@@ -525,7 +525,7 @@ public class ProjectDouble {
 
   /**
    * Method gluOrtho2D.
-   * 
+   *
    * @param left
    * @param right
    * @param bottom
@@ -537,7 +537,7 @@ public class ProjectDouble {
 
   /**
    * Method gluPerspective.
-   * 
+   *
    * @param fovy
    * @param aspect
    * @param zNear
@@ -570,7 +570,7 @@ public class ProjectDouble {
 
   /**
    * Method gluLookAt
-   * 
+   *
    * @param eyex
    * @param eyey
    * @param eyez
@@ -631,7 +631,7 @@ public class ProjectDouble {
 
   /**
    * Method gluProject
-   * 
+   *
    * @param objx
    * @param objy
    * @param objz
@@ -639,7 +639,7 @@ public class ProjectDouble {
    * @param projMatrix
    * @param viewport
    * @param win_pos
-   * 
+   *
    * @return
    */
   public boolean gluProject(double objx,
@@ -685,7 +685,7 @@ public class ProjectDouble {
 
   /**
    * Method gluProject
-   * 
+   *
    * @param objx
    * @param objy
    * @param objz
@@ -693,7 +693,7 @@ public class ProjectDouble {
    * @param projMatrix
    * @param viewport
    * @param win_pos
-   * 
+   *
    * @return
    */
   public boolean gluProject(double objx,
@@ -738,7 +738,7 @@ public class ProjectDouble {
 
   /**
    * Method gluUnproject
-   * 
+   *
    * @param winx
    * @param winy
    * @param winz
@@ -746,7 +746,7 @@ public class ProjectDouble {
    * @param projMatrix
    * @param viewport
    * @param obj_pos
-   * 
+   *
    * @return
    */
   public boolean gluUnProject(double winx,
@@ -799,7 +799,7 @@ public class ProjectDouble {
 
   /**
    * Method gluUnproject
-   * 
+   *
    * @param winx
    * @param winy
    * @param winz
@@ -807,7 +807,7 @@ public class ProjectDouble {
    * @param projMatrix
    * @param viewport
    * @param obj_pos
-   * 
+   *
    * @return
    */
   public boolean gluUnProject(double winx,
@@ -858,7 +858,7 @@ public class ProjectDouble {
 
   /**
    * Method gluUnproject4
-   * 
+   *
    * @param winx
    * @param winy
    * @param winz
@@ -869,7 +869,7 @@ public class ProjectDouble {
    * @param near
    * @param far
    * @param obj_pos
-   * 
+   *
    * @return
    */
   public boolean gluUnProject4(double winx,
@@ -923,7 +923,7 @@ public class ProjectDouble {
 
   /**
    * Method gluUnproject4
-   * 
+   *
    * @param winx
    * @param winy
    * @param winz
@@ -934,7 +934,7 @@ public class ProjectDouble {
    * @param near
    * @param far
    * @param obj_pos
-   * 
+   *
    * @return
    */
   public boolean gluUnProject4(double winx,
@@ -987,7 +987,7 @@ public class ProjectDouble {
 
   /**
    * Method gluPickMatrix
-   * 
+   *
    * @param x
    * @param y
    * @param deltaX
@@ -1014,7 +1014,7 @@ public class ProjectDouble {
 
   /**
    * Method gluPickMatrix
-   * 
+   *
    * @param x
    * @param y
    * @param deltaX
diff --git a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
index 7cd7da53e..b4383c2e6 100644
--- a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
@@ -6,15 +6,15 @@
 ** this file except in compliance with the License. You may obtain a copy
 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-** 
+**
 ** http://oss.sgi.com/projects/FreeB
-** 
+**
 ** Note that, as provided in the License, the Software is distributed on an
 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-** 
+**
 ** NOTE:  The Original Code (as defined below) has been licensed to Sun
 ** Microsystems, Inc. ("Sun") under the SGI Free Software License B
 ** (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
 ** Copyright in any portions created by third parties is as indicated
 ** elsewhere herein. All Rights Reserved.
-** 
+**
 ** Additional Notice Provisions: The application programming interfaces
 ** established by SGI in conjunction with the Original Code are The
 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -45,56 +45,56 @@
 ** $Header$
 */
 
-/* 
+/*
  * Copyright (c) 2002-2004 LWJGL Project
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are 
+ * modification, are permitted provided that the following conditions are
  * met:
- * 
- * * Redistributions of source code must retain the above copyright 
+ *
+ * * Redistributions of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
  *
  * * Redistributions in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
  *
- * * Neither the name of 'LWJGL' nor the names of 
- *   its contributors may be used to endorse or promote products derived 
+ * * Neither the name of 'LWJGL' nor the names of
+ *   its contributors may be used to endorse or promote products derived
  *   from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -107,7 +107,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -124,8 +124,8 @@ import com.jogamp.opengl.util.glsl.ShaderState;
 
 /**
  * GLUquadricImpl.java
- * 
- * 
+ *
+ *
  * Created 22-dec-2003 (originally Quadric.java)
  * @author Erik Duijs
  * @author Kenneth Russell, Sven Gothel
@@ -197,19 +197,19 @@ public class GLUquadricImpl implements GLUquadric {
     ImmModeSink res = immModeSink;
     if(useGLSL) {
         if(null != shaderState) {
-            immModeSink = ImmModeSink.createGLSL (32, 
-                                                  3, GL.GL_FLOAT,             // vertex 
+            immModeSink = ImmModeSink.createGLSL (32,
+                                                  3, GL.GL_FLOAT,             // vertex
                                                   0, GL.GL_FLOAT,             // color
                                                   USE_NORM?3:0, normalType,   // normal
                                                   USE_TEXT?2:0, GL.GL_FLOAT,  // texCoords
                                                   GL.GL_STATIC_DRAW, shaderState);
         } else {
-            immModeSink = ImmModeSink.createGLSL (32, 
-                                                  3, GL.GL_FLOAT,             // vertex 
+            immModeSink = ImmModeSink.createGLSL (32,
+                                                  3, GL.GL_FLOAT,             // vertex
                                                   0, GL.GL_FLOAT,             // color
                                                   USE_NORM?3:0, normalType,   // normal
                                                   USE_TEXT?2:0, GL.GL_FLOAT,  // texCoords
-                                                  GL.GL_STATIC_DRAW, shaderProgram);            
+                                                  GL.GL_STATIC_DRAW, shaderProgram);
         }
     } else {
         immModeSink = ImmModeSink.createFixed(32,
@@ -229,7 +229,7 @@ public class GLUquadricImpl implements GLUquadric {
   }
 
   /**
-   * specifies the draw style for quadrics.  
+   * specifies the draw style for quadrics.
    *
    * The legal values are as follows:
    *
@@ -243,7 +243,7 @@ public class GLUquadricImpl implements GLUquadric {
    *            separating coplanar faces will not be drawn.
    *
    * GLU.POINT:       Quadrics are rendered as a set of points.
-   * 
+   *
    * @param drawStyle The drawStyle to set
    */
   public void setDrawStyle(int drawStyle) {
@@ -260,7 +260,7 @@ public class GLUquadricImpl implements GLUquadric {
    *
    * GLU.SMOOTH:   One normal is generated for every vertex of a quadric.  This
    *               is the default.
-   * 
+   *
    * @param normals The normals to set
    */
   public void setNormals(int normals) {
@@ -277,7 +277,7 @@ public class GLUquadricImpl implements GLUquadric {
    *
    * Note that the interpretation of outward and inward depends on the quadric
    * being drawn.
-   * 
+   *
    * @param orientation The orientation to set
    */
   public void setOrientation(int orientation) {
@@ -292,7 +292,7 @@ public class GLUquadricImpl implements GLUquadric {
    *
    * The manner in which texture coordinates are generated depends upon the
    * specific quadric rendered.
-   * 
+   *
    * @param textureFlag The textureFlag to set
    */
   public void setTextureFlag(boolean textureFlag) {
@@ -512,10 +512,10 @@ public class GLUquadricImpl implements GLUquadric {
         glNormal3f(gl, 0.0f, 0.0f, -1.0f);
       }
     }
-    
+
     da = 2.0f * PI / slices;
     dr = (outerRadius - innerRadius) /  loops;
-    
+
     switch (drawStyle) {
     case GLU.GLU_FILL:
       {
@@ -648,18 +648,18 @@ public class GLUquadricImpl implements GLUquadric {
    * through startAngle + sweepAngle is included (where 0 degrees is along
    * the +y axis, 90 degrees along the +x axis, 180 along the -y axis, and
    * 270 along the -x axis).
-   * 
+   *
    * The partial disk has a radius of outerRadius, and contains a concentric
    * circular hole with a radius of innerRadius. If innerRadius is zero, then
    * no hole is generated. The partial disk is subdivided around the z axis
    * into slices (like pizza slices), and also about the z axis into rings
    * (as specified by slices and loops, respectively).
-   * 
+   *
    * With respect to orientation, the +z side of the partial disk is
    * considered to be outside (see gluQuadricOrientation). This means that if
    * the orientation is set to GLU.GLU_OUTSIDE, then any normals generated point
    * along the +z axis. Otherwise, they point along the -z axis.
-   * 
+   *
    * If texturing is turned on (with gluQuadricTexture), texture coordinates
    * are generated linearly such that where r=outerRadius, the value at (r, 0, 0)
    * is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5),
@@ -1204,7 +1204,7 @@ public class GLUquadricImpl implements GLUquadric {
    */
   private void normal3f(GL gl, float x, float y, float z) {
     float mag;
-    
+
     mag = (float)Math.sqrt(x * x + y * y + z * z);
     if (mag > 0.00001F) {
       x /= mag;
diff --git a/src/jogl/classes/jogamp/opengl/glu/Glue.java b/src/jogl/classes/jogamp/opengl/glu/Glue.java
index 636d17f29..2ad3d8c89 100644
--- a/src/jogl/classes/jogamp/opengl/glu/Glue.java
+++ b/src/jogl/classes/jogamp/opengl/glu/Glue.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -89,15 +89,15 @@ public class Glue {
     "null control point reference",
     "duplicate point on piecewise linear trimming curve"
   } ;
-  
+
   /** Creates a new instance of Glue */
   public Glue() {
   }
-  
+
   public static String __gluNURBSErrorString( int errno ) {
     return( __gluNurbsErrors[ errno ] );
   }
-  
+
   private static String[] __gluTessErrors = {
     " ",
     "gluTessBeginPolygon() must precede a gluTessEndPolygon",
@@ -107,7 +107,7 @@ public class Glue {
     "a coordinate is too large",
     "need combine callback"
   };
-  
+
   public static String __gluTessErrorString( int errno ) {
     return( __gluTessErrors[ errno ] );
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/error/Error.java b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
index 2f49db9a4..ffb8d9471 100644
--- a/src/jogl/classes/jogamp/opengl/glu/error/Error.java
+++ b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
@@ -6,9 +6,9 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
@@ -24,13 +24,13 @@
  * except that Section 2.2 and 11 are omitted.  Any differences between
  * the Alternative License and the SGI License are offered solely by Sun
  * and not by SGI.
- * 
+ *
  * Original Code. The Original Code is: OpenGL Sample Implementation,
  * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -53,7 +53,7 @@ import jogamp.opengl.glu.Glue;
  * @author  Administrator
  */
 public class Error {
-  
+
   private static String[] glErrorStrings = {
     "invalid enumerant",
     "invalid value",
@@ -63,7 +63,7 @@ public class Error {
     "out of memory",
     "invalid framebuffer operation"
   };
-  
+
   private static String[] gluErrorStrings = {
     "invalid enumerant",
     "invalid value",
@@ -71,11 +71,11 @@ public class Error {
     "",
     "invalid operation"
   };
-  
+
   /** Creates a new instance of Error */
   public Error() {
   }
-  
+
   public static String gluErrorString( int errorCode ) {
     if( errorCode == 0 ) {
       return( "no error" );
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
index 2ef4468e5..f57c2310f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -48,7 +48,7 @@ import javax.media.opengl.glu.gl2.GLUgl2;
 class GL2CurveEvaluator implements CurveEvaluator {
 
   /**
-   * Output triangles (for callback) or render curve 
+   * Output triangles (for callback) or render curve
    */
   private boolean output_triangles;
 
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
index 58b565484..f83b3a805 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
@@ -43,9 +43,9 @@ import javax.media.opengl.glu.GLUnurbs;
 
 /**
  * Base object for working with NURBS curves and surfaces
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class GLUgl2nurbsImpl implements GLUnurbs {
 
@@ -272,7 +272,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Sets domain distance for dom.dist. sampling in u direction
-   * 
+   *
    * @param d
    *            distance
    */
@@ -283,7 +283,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Sets domain distance for dom.dist. sampling in v direction
-   * 
+   *
    * @param d
    *            distance
    */
@@ -303,7 +303,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Calls a method with given name and passes argumet
-   * 
+   *
    * @param name
    *            name of a method to be called
    * @param arg
@@ -329,7 +329,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Calls a method with given name
-   * 
+   *
    * @param name
    *            name of a method to be called
    */
@@ -349,7 +349,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Begins a NURBS curve
-   * 
+   *
    * @param o_curve
    *            curve object
    */
@@ -381,7 +381,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Begins new surface
-   * 
+   *
    * @param o_surface
    *            surface object
    */
@@ -503,7 +503,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Method for handling error codes
-   * 
+   *
    * @param i
    *            error code
    */
@@ -539,7 +539,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Make a NURBS curve
-   * 
+   *
    * @param nknots
    *            number of knots in knot vector
    * @param knot
@@ -587,7 +587,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Check knot vector specification
-   * 
+   *
    * @param knots
    *            knot vector
    * @param msg
@@ -607,7 +607,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Draw a curve
-   * 
+   *
    * @param o_nurbscurve
    *            NURBS curve object
    */
@@ -660,7 +660,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Draw NURBS surface
-   * 
+   *
    * @param o_nurbssurface
    *            NURBS surface object
    */
@@ -704,7 +704,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Define a map of given properties
-   * 
+   *
    * @param type
    *            map type
    * @param rational
@@ -719,7 +719,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Set NURBS property
-   * 
+   *
    * @param type
    *            property type
    * @param tag
@@ -744,7 +744,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Set parameters of existing property
-   * 
+   *
    * @param prop
    *            property
    */
@@ -755,7 +755,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Set given property to rendering hints
-   * 
+   *
    * @param prop
    *            property to be set
    */
@@ -767,7 +767,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Sets wheteher we use domain distance sampling
-   * 
+   *
    * @param i
    *            domain distance sampling flag
    */
@@ -805,7 +805,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Make NURBS surface
-   * 
+   *
    * @param sknot_count
    *            number of knots in s direction
    * @param sknot
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
index f5fe17a7b..81a99beab 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -64,7 +64,7 @@ public class BuildMipmap {
   /** Creates a new instance of BuildMipmap */
   public BuildMipmap() {
   }
-  
+
   public static int gluBuild1DMipmapLevelsCore( GL gl, int target, int internalFormat,
                   int width, int widthPowerOf2, int format, int type, int userLevel,
                   int baseLevel, int maxLevel, ByteBuffer data ) {
@@ -78,34 +78,34 @@ public class BuildMipmap {
     int maxsize;
     int cmpts;
     PixelStorageModes psm = new PixelStorageModes();
-    
+
     assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
     assert( width >= 1 );
-    
+
     newwidth = widthPowerOf2;
     levels = Mipmap.computeLog( newwidth );
-    
+
     levels += userLevel;
-    
+
     Mipmap.retrieveStoreModes( gl, psm );
     try {
-      newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format, 
+      newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format,
             GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
     } catch( OutOfMemoryError ome ) {
       return( GLU.GLU_OUT_OF_MEMORY );
     }
     newImage_width = width;
-    
+
     Image.fill_image( psm, width, 1, format, type, Mipmap.is_index( format ), data, newImage );
     cmpts = Mipmap.elements_per_group( format, type );
     gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    
+
     // if swap_bytes was set, swapping occurred in fill_image
     gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-    
+
     for( level = userLevel; level <= levels; level++ ) {
       if( newImage_width == newwidth ) {
         // user newimage for this level
@@ -132,10 +132,10 @@ public class BuildMipmap {
         imageTemp = otherImage;
         otherImage = newImage;
         newImage = imageTemp;
-        
+
         newImage_width = newwidth;
         if( baseLevel <= level && level <= maxLevel ) {
-          gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0, 
+          gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0,
                             format, GL2.GL_UNSIGNED_SHORT, newImage );
         }
       }
@@ -148,10 +148,10 @@ public class BuildMipmap {
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
     gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
     gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-    
+
     return( 0 );
   }
-  
+
   public static int bitmapBuild2DMipmaps( GL gl, int target, int internalFormat,
             int width, int height, int format, int type, ByteBuffer data ) {
     int newwidth[] = new int[1];
@@ -166,37 +166,37 @@ public class BuildMipmap {
     int maxsize;
     int cmpts;
     PixelStorageModes psm = new PixelStorageModes();
-    
+
     Mipmap.retrieveStoreModes( gl, psm );
-    
+
     Mipmap.closestFit( gl, target, width, height, internalFormat, format, type, newwidth, newheight );
-    
+
     levels = Mipmap.computeLog( newwidth[0] );
     level = Mipmap.computeLog( newheight[0] );
     if( level > levels ) {
       levels = level;
     }
-    
+
     try {
-      newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height, 
+      newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height,
             format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
     } catch( OutOfMemoryError ome ) {
       return( GLU.GLU_OUT_OF_MEMORY );
     }
     newImage_width = width;
     newImage_height = height;
-    
+
     Image.fill_image( psm, width, height, format, type, Mipmap.is_index( format ), data, newImage );
-    
+
     cmpts = Mipmap.elements_per_group( format, type );
     gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    
+
     // if swap_bytes is set, swapping occurred in fill_image
     gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-    
+
     for( level = 0; level < levels; level++ ) {
       if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
         newImage.rewind();
@@ -216,13 +216,13 @@ public class BuildMipmap {
             return( GLU.GLU_OUT_OF_MEMORY );
           }
         }
-        ScaleInternal.scale_internal( cmpts, newImage_width, newImage_height, 
+        ScaleInternal.scale_internal( cmpts, newImage_width, newImage_height,
                               newImage, newwidth[0], newheight[0], otherImage );
         // swap newImage and otherImage
         tempImage = otherImage;
         otherImage = newImage;
         newImage = tempImage;
-        
+
         newImage_width = newwidth[0];
         newImage_height = newheight[0];
         newImage.rewind();
@@ -241,10 +241,10 @@ public class BuildMipmap {
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
     gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
     gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-    
+
     return( 0 );
   }
-  
+
   public static int gluBuild2DMipmapLevelsCore( GL gl, int target, int internalFormat,
                 int width, int height, int widthPowerOf2, int heightPowerOf2,
                 int format, int type, int userLevel, int baseLevel, int maxLevel,
@@ -263,19 +263,19 @@ public class BuildMipmap {
     int maxsize;
     int cmpts;
     int mark=-1;
-    
+
     boolean myswap_bytes;
     int groups_per_line, element_size, group_size;
     int rowsize, padding;
     PixelStorageModes psm = new PixelStorageModes();
-    
+
     assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
     assert( width >= 1 && height >= 1 );
-    
+
     if( type == GL2.GL_BITMAP ) {
       return( bitmapBuild2DMipmaps( gl, target, internalFormat, width, height, format, type, data ) );
     }
-    
+
     newwidth = widthPowerOf2;
     newheight = heightPowerOf2;
     levels = Mipmap.computeLog( newwidth );
@@ -283,9 +283,9 @@ public class BuildMipmap {
     if( level > levels ) {
       levels = level;
     }
-    
+
     levels += userLevel;
-    
+
     Mipmap.retrieveStoreModes( gl, psm );
     myswap_bytes = psm.getUnpackSwapBytes();
     cmpts = Mipmap.elements_per_group( format, type );
@@ -294,28 +294,28 @@ public class BuildMipmap {
     } else {
       groups_per_line = width;
     }
-    
+
     element_size = Mipmap.bytes_per_element( type );
     group_size = element_size * cmpts;
     if( element_size == 1 ) {
       myswap_bytes = false;
     }
-    
+
     rowsize = groups_per_line * group_size;
     padding = ( rowsize % psm.getUnpackAlignment() );
     if( padding != 0 ) {
       rowsize += psm.getUnpackAlignment() - padding;
     }
-    
+
     mark = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
     data.position( mark );
-    
+
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    
+
     level = userLevel;
-    
+
     // already power of two square
     if( width == newwidth && height == newheight ) {
       // use usersImage for level userLevel
@@ -333,7 +333,7 @@ public class BuildMipmap {
       }
       int nextWidth = newwidth / 2;
       int nextHeight = newheight / 2;
-      
+
       // clamp to 1
       if( nextWidth < 1 ) {
         nextWidth = 1;
@@ -342,7 +342,7 @@ public class BuildMipmap {
         nextHeight = 1;
       }
       memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
-      
+
       try {
         switch( type ) {
           case( GL2.GL_UNSIGNED_BYTE ):
@@ -452,7 +452,7 @@ public class BuildMipmap {
       if( newheight < 1 ) {
         newheight = 1;
       }
-      
+
       myswap_bytes = false;
       rowsize = newwidth * group_size;
       memReq = Mipmap.image_size( newwidth, newheight, format, type );
@@ -498,7 +498,7 @@ public class BuildMipmap {
       level = userLevel + 1;
     } else { // user's image is not nice powerof2 size square
       memReq = Mipmap.image_size( newwidth, newheight, format, type );
-      try { 
+      try {
         switch( type ) {
           case( GL2.GL_UNSIGNED_BYTE ):
           case( GL2.GL_BYTE ):
@@ -535,15 +535,15 @@ public class BuildMipmap {
       data.position( mark );
       switch( type ) {
         case( GL2.GL_UNSIGNED_BYTE ):
-          ScaleInternal.scale_internal_ubyte( cmpts, width, height, data, 
+          ScaleInternal.scale_internal_ubyte( cmpts, width, height, data,
                 newwidth, newheight, dstImage, element_size, rowsize, group_size );
           break;
         case( GL2.GL_BYTE ):
-          ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth, 
+          ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth,
                   newheight, dstImage, element_size, rowsize, group_size );
           break;
         case( GL2.GL_UNSIGNED_SHORT ):
-          ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth, 
+          ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
                   newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
         case( GL2.GL_SHORT ):
@@ -620,7 +620,7 @@ public class BuildMipmap {
       tempImage = srcImage;
       srcImage = dstImage;
       dstImage = tempImage;
-      
+
       if( levels != 0 ) { // use as little memory as possible
         int nextWidth = newwidth / 2;
         int nextHeight = newheight / 2;
@@ -630,7 +630,7 @@ public class BuildMipmap {
         if( nextHeight < 1 ) {
           nextHeight = 1;
         }
-        
+
         memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
         try {
           switch( type ) {
@@ -670,7 +670,7 @@ public class BuildMipmap {
       // level userLevel is in srcImage; nothing saved yet
       level = userLevel;
     }
-    
+
     gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
     if( baseLevel <= level && level <= maxLevel ) {
       srcImage.rewind();
@@ -685,7 +685,7 @@ public class BuildMipmap {
         }
       }
     }
-    
+
     level++;  // update current level for the loop
     for( ; level <= levels; level++ ) {
       srcImage.rewind();
@@ -754,12 +754,12 @@ public class BuildMipmap {
           assert( false );
           break;
       }
-      
+
       // swap dstImage and srcImage
       tempImage = srcImage;
       srcImage = dstImage;
       dstImage = tempImage;
-      
+
       if( newwidth > 1 ) {
         newwidth /= 2;
         rowsize /= 2;
@@ -769,7 +769,7 @@ public class BuildMipmap {
       }
       // compute amount to pad per row if any
       int rowPad = rowsize % psm.getUnpackAlignment();
-      
+
       // should row be padded
       if( rowPad == 0 ) {
         // call teximage with srcImage untouched since its not padded
@@ -792,7 +792,7 @@ public class BuildMipmap {
         int ii, jj;
         int dstTrav;
         int srcTrav;
-        
+
         // allocate new image for mipmap of size newRowLength x newheight
         ByteBuffer newMipmapImage = null;
         try {
@@ -813,7 +813,7 @@ public class BuildMipmap {
             newMipmapImage.put( srcImage.get() );
           }
         }
-        
+
         // and use this new image for mipmapping instead
         if( baseLevel <= level && level <= maxLevel ) {
           newMipmapImage.rewind();
@@ -833,10 +833,10 @@ public class BuildMipmap {
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
     gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
     gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-    
+
     return( 0 );
   }
-  
+
   public static int fastBuild2DMipmaps( GL gl, PixelStorageModes psm, int target,
           int components, int width, int height, int format, int type, ByteBuffer data ) {
     int[] newwidth = new int[1];
@@ -850,22 +850,22 @@ public class BuildMipmap {
     int memReq;
     int maxsize;
     int cmpts;
-    
-    Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth, 
+
+    Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth,
             newheight );
-    
+
     levels = Mipmap.computeLog( newwidth[0] );
     level = Mipmap.computeLog( newheight[0] );
     if( level > levels ) {
       levels = level;
     }
-    
+
     cmpts = Mipmap.elements_per_group( format, type );
-    
+
     otherImage = null;
     //  No need to copy the user data if its packed correctly.
     //  Make sure that later routines don't change that data.
-    
+
     if( psm.getUnpackSkipRows() == 0 && psm.getUnpackSkipPixels() == 0 ) {
       newImage = data;
       newImage_width = width;
@@ -878,7 +878,7 @@ public class BuildMipmap {
       int iter;
       int iter2;
       int i, j;
-      
+
       try {
         newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL2.GL_UNSIGNED_BYTE ) );
       } catch( OutOfMemoryError err ) {
@@ -896,7 +896,7 @@ public class BuildMipmap {
       rowsize = group_per_line * cmpts;
       elements_per_line = width * cmpts;
       start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * cmpts;
-      
+
       for( i = 0; i < height; i++ ) {
         iter = start;
         data.position( iter );
@@ -906,13 +906,13 @@ public class BuildMipmap {
         start += rowsize;
       }
     }
-    
+
     gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 1 );
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-    
+
     for( level = 0; level <= levels; level++ ) {
       if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
         // use newImage for this level
@@ -937,7 +937,7 @@ public class BuildMipmap {
         imageTemp = otherImage;
         otherImage = newImage;
         newImage = imageTemp;
-        
+
         newImage_width = newwidth[0];
         newImage_height = newheight[0];
         newImage.rewind();
@@ -956,10 +956,10 @@ public class BuildMipmap {
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
     gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
     gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
-    
+
     return( 0 );
   }
-  
+
   public static int gluBuild3DMipmapLevelsCore( GL gl, int target, int internalFormat,
           int width, int height, int depth, int widthPowerOf2, int heightPowerOf2,
           int depthPowerOf2, int format, int type, int userLevel, int baseLevel,
@@ -977,19 +977,19 @@ public class BuildMipmap {
     int maxSize;
     int cmpts;
     int mark=-1;
-    
+
     boolean myswapBytes;
     int groupsPerLine, elementSize, groupSize;
     int rowsPerImage, imageSize;
     int rowSize, padding;
     PixelStorageModes psm = new PixelStorageModes();
-    
+
     assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
     assert( width >= 1 && height >= 1 && depth >= 1 );
     assert( type != GL2.GL_BITMAP );
-    
+
     srcImage = dstImage = null;
-    
+
     newWidth = widthPowerOf2;
     newHeight = heightPowerOf2;
     newDepth = depthPowerOf2;
@@ -1002,9 +1002,9 @@ public class BuildMipmap {
     if( level > levels ) {
       levels = level;
     }
-    
+
     levels += userLevel;
-    
+
     Mipmap.retrieveStoreModes3D( gl, psm );
     myswapBytes = psm.getUnpackSwapBytes();
     cmpts = Mipmap.elements_per_group( format, type );
@@ -1013,42 +1013,42 @@ public class BuildMipmap {
     } else {
       groupsPerLine = width;
     }
-    
+
     elementSize = Mipmap.bytes_per_element( type );
     groupSize = elementSize * cmpts;
     if( elementSize == 1 ) {
       myswapBytes = false;
     }
-    
+
     // 3dstuff
     if( psm.getUnpackImageHeight() > 0 ) {
       rowsPerImage = psm.getUnpackImageHeight();
     } else {
       rowsPerImage = height;
     }
-    
+
     rowSize = groupsPerLine * groupSize;
     padding = ( rowSize % psm.getUnpackAlignment() );
     if( padding != 0 ) {
       rowSize += psm.getUnpackAlignment() - padding;
     }
-    
+
     imageSize = rowsPerImage * rowSize;
-    
+
     usersImage = ByteBuffer.wrap(data.array());
     mark = psm.getUnpackSkipRows() * rowSize +
            psm.getUnpackSkipPixels() * groupSize +
            psm.getUnpackSkipImages() * imageSize;
     usersImage.position( mark );
-    
+
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, 0 );
     gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, 0 );
-    
+
     level = userLevel;
-    
+
     if( width == newWidth && height == newHeight && depth == newDepth ) {
       // use usersImage for level userlevel
       if( baseLevel <= level && level <= maxLevel ) {
@@ -1068,7 +1068,7 @@ public class BuildMipmap {
       int nextWidth = newWidth / 2;
       int nextHeight = newHeight / 2;
       int nextDepth = newDepth / 2;
-      
+
       // clamp to one
       if( nextWidth < 1 ) {
         nextWidth = 1;
@@ -1116,13 +1116,13 @@ public class BuildMipmap {
         gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
         return( GLU.GLU_OUT_OF_MEMORY );
       }
-      
+
       if( dstImage != null ) {
         switch( type ) {
           case( GL2.GL_UNSIGNED_BYTE ):
             if( depth > 1 ) {
               HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
-                      usersImage, dstImage, elementSize, 
+                      usersImage, dstImage, elementSize,
                       groupSize, rowSize, imageSize, myswapBytes );
             } else {
               HalveImage.halveImage_ubyte( cmpts, width, height, usersImage,
@@ -1145,7 +1145,7 @@ public class BuildMipmap {
                       usersImage, dstImage, elementSize, groupSize, rowSize,
                       imageSize, myswapBytes );
             } else {
-              HalveImage.halveImage_ushort( cmpts, width, height, usersImage, 
+              HalveImage.halveImage_ushort( cmpts, width, height, usersImage,
                       dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
             }
             break;
@@ -1257,7 +1257,7 @@ public class BuildMipmap {
       if( newDepth < 1 ) {
         newDepth = 1;
       }
-      
+
       myswapBytes = false;
       rowSize = newWidth * groupSize;
       imageSize = rowSize * newHeight;
@@ -1302,7 +1302,7 @@ public class BuildMipmap {
         gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
         return( GLU.GLU_OUT_OF_MEMORY );
       }
-      
+
       // level userLevel + 1 is in srcImage; level userLevel already saved
       level = userLevel + 1;
     } else {
@@ -1343,10 +1343,10 @@ public class BuildMipmap {
         gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
         return( GLU.GLU_OUT_OF_MEMORY );
       }
-      
+
       ScaleInternal.gluScaleImage3D( gl, format, width, height, depth, type,
               usersImage, newWidth, newHeight, newDepth, type, dstImage );
-      
+
       myswapBytes = false;
       rowSize = newWidth * groupSize;
       imageSize = rowSize * newHeight;
@@ -1354,7 +1354,7 @@ public class BuildMipmap {
       tempImage = srcImage;
       srcImage = dstImage;
       dstImage = tempImage;
-      
+
       if( levels != 0 ) {
         int nextWidth = newWidth / 2;
         int nextHeight = newHeight / 2;
@@ -1409,7 +1409,7 @@ public class BuildMipmap {
       // level userLevel is in srcImage; nothing saved yet
       level = userLevel;
     }
-    
+
     gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
     if( baseLevel <= level && level <= maxLevel ) {
       usersImage.position( mark );
@@ -1541,11 +1541,11 @@ public class BuildMipmap {
           assert( false );
           break;
       }
-      
+
       tempImage = srcImage;
       srcImage = dstImage;
       dstImage = tempImage;
-      
+
       if( newWidth > 1 ) {
         newWidth /= 2;
         rowSize /= 2;
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
index a564269fb..0eee9bf32 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
index 10ea1d729..5269024b4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.ByteBuffer;
  * @author Administrator
  */
 public class Extract1010102 implements Extract {
-  
+
   /** Creates a new instance of Extract1010102 */
   public Extract1010102() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     long uint = 0;
-    
+
     if( isSwap ) {
       uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
     } else {
       uint = 0x00000000FFFFFFFF & packedPixel.getInt();
     }
-    
+
     // 11111111,11000000,00000000,00000000 == 0xFFC00000
     // 00000000,00111111,11110000,00000000 == 0x003F0000
     // 00000000,00000000,00001111,11111100 == 0x00000FFC
     // 00000000,00000000,00000000,00000011 == 0x00000003
-    
+
     extractComponents[0] = (float)( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
     extractComponents[1] = (float)( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
     extractComponents[2] = (float)( ( uint & 0x00000FFC ) >>  2 ) / 1023.0f;
     extractComponents[3] = (float)( ( uint & 0x00000003 )       ) / 3.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
     // 00000000,00001111 == 0x000F
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
     assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     long uint = (((int)((shoveComponents[0] * 1023) + 0.5f) << 22) & 0xFFC00000 );
     uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) <<   12) & 0x003FF000 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
index 1234da5f8..6982931d3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.ByteBuffer;
  * @author Administrator
  */
 public class Extract1555rev implements Extract {
-  
+
   /** Creates a new instance of Extract1555rev */
   public Extract1555rev() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
-    
+
     if( isSwap ) {
       ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
     } else {
       ushort = 0x0000FFFF & packedPixel.getShort();
     }
-    
+
     // 00000000,00011111 == 0x001F
     // 00000011,11100000 == 0x03E0
     // 01111100,00000000 == 0x7C00
     // 10000000,00000000 == 0x8000
-    
+
     extractComponents[0] = (float)( ( ushort & 0x001F )       ) / 31.0f;
     extractComponents[1] = (float)( ( ushort & 0x003E ) >>  5 ) / 31.0f;
     extractComponents[2] = (float)( ( ushort & 0x7C00 ) >>  10) / 31.0f;
     extractComponents[3] = (float)( ( ushort & 0x8000 ) >>  15);
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 00000000,00011111 == 0x001F
     // 00000011,11100000 == 0x03E0
     // 01111100,00000000 == 0x7C00
     // 10000000,00000000 == 0x8000
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
     assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     int ushort = (((int)((shoveComponents[0] * 31) + 0.5f)   ) & 0x0000001F );
     ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) <<  5) & 0x000003E0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
index 226254f99..1c7db6218 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.ByteBuffer;
  * @author Administrator
  */
 public class Extract2101010rev implements Extract {
-  
+
   /** Creates a new instance of Extract2101010 */
   public Extract2101010rev() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     long uint = 0;
-    
+
     if( isSwap ) {
       uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
     } else {
       uint = 0x00000000FFFFFFFF & packedPixel.getInt();
     }
-    
+
     // 11111111,11000000,00000000,00000000 == 0xFFC00000
     // 00000000,00111111,11110000,00000000 == 0x003F0000
     // 00000000,00000000,00001111,11111100 == 0x00000FFC
     // 00000000,00000000,00000000,00000011 == 0x00000003
-    
+
     extractComponents[0] = (float)( ( uint & 0x000003FF )       ) / 1023.0f;
     extractComponents[1] = (float)( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
     extractComponents[2] = (float)( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
     extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
     // 00000000,00001111 == 0x000F
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
     assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     long uint = (((int)((shoveComponents[0] * 1023) + 0.5f)    ) & 0x000003FF );
     uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) <<   10) & 0x000FFC00 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
index 9fa2a3a54..672c86c32 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.ByteBuffer;
  * @author Administrator
  */
 public class Extract233rev implements Extract {
-  
+
   /** Creates a new instance of Extract223rev */
   public Extract233rev() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     // 11100000 == 0xe0
     // 00011100 == 0x1c
@@ -65,16 +65,16 @@ public class Extract233rev implements Extract {
     extractComponents[1] = (float)((ubyte & 0x38) >> 3) / 7.0f;
     extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11100000 == 0xE0
     // 00011100 == 0x1C
     // 00000011 == 0x03
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) ) & 0x07 );
     b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 3 ) & 0x38 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
index 92d141be5..6cdbc5cb0 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.ByteBuffer;
  * @author Administrator
  */
 public class Extract332 implements Extract {
-  
+
   /** Creates a new instance of Extract332 */
   public Extract332() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     // 11100000 == 0xe0
     // 00011100 == 0x1c
@@ -65,16 +65,16 @@ public class Extract332 implements Extract {
     extractComponents[1] = (float)((ubyte & 0x1c) >> 2) / 7.0f;
     extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11100000 == 0xE0
     // 00011100 == 0x1C
     // 00000011 == 0x03
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) << 5 ) & 0xE0 );
     b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 2 ) & 0x1C );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
index af99d154c..b36b9fb82 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,41 +51,41 @@ import java.nio.*;
  * @author Administrator
  */
 public class Extract4444 implements Extract {
-  
+
   /** Creates a new instance of Extract4444 */
   public Extract4444() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
-    
+
     if( isSwap ) {
       ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
     } else {
       ushort = 0x0000FFFF & packedPixel.getShort();
     }
-    
+
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
     // 00000000,00001111 == 0x000F
-    
+
     extractComponents[0] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
     extractComponents[1] = (float)( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
     extractComponents[2] = (float)( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
     extractComponents[3] = (float)( ( ushort & 0x000F )       ) / 15.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
     // 00000000,00001111 == 0x000F
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     int ushort = (((int)((shoveComponents[0] * 15) + 0.5f) << 12) & 0x0000F000 );
     ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) << 8) & 0x00000F00 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
index e5bce60d8..b7a3ed55f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
  * @author Administrator
  */
 public class Extract4444rev implements Extract {
-  
+
   /** Creates a new instance of Extract4444rev */
   public Extract4444rev() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
-    
+
     if( isSwap ) {
       ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
     } else {
       ushort = 0x0000FFFF & packedPixel.getShort();
     }
-    
+
     // 00000000,00001111 == 0x000F
     // 00000000,11110000 == 0x00F0
     // 00001111,00000000 == 0x0F00
     // 11110000,00000000 == 0xF000
-    
+
     extractComponents[0] = (float)( ( ushort & 0x000F )       ) / 15.0f;
     extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
     extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
     extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
     // 00000000,00001111 == 0x000F
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
     assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     int ushort = (((int)((shoveComponents[0] * 15) + 0.5f)   ) & 0x0000000F );
     ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) <<  4) & 0x000000F0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
index 5c383103e..4dc566b25 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
  * @author Administrator
  */
 public class Extract5551 implements Extract {
-  
+
   /** Creates a new instance of Extract5551 */
   public Extract5551() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
-    
+
     if( isSwap ) {
       ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
     } else {
       ushort = 0x0000FFFF & packedPixel.getShort();
     }
-    
+
     // 11111000,00000000 == 0xF800
     // 00000111,11000000 == 0x07C0
     // 00000000,00111110 == 0x003E
     // 00000000,00000001 == 0x0001
-    
+
     extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
     extractComponents[1] = (float)( ( ushort & 0x00F0 ) >>  6 ) / 31.0f;
     extractComponents[2] = (float)( ( ushort & 0x0F00 ) >>  1 ) / 31.0f;
     extractComponents[3] = (float)( ( ushort & 0xF000 )       );
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
     // 00000000,00001111 == 0x000F
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
     assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
     ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) <<  6) & 0x000007C0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
index f6193dd2d..e198e46d4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,38 +51,38 @@ import java.nio.*;
  * @author Administrator
  */
 public class Extract565 implements Extract {
-  
+
   /** Creates a new instance of Extract565 */
   public Extract565() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
-    
+
     if( isSwap ) {
       ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
     } else {
       ushort = 0x0000FFFF & packedPixel.getShort();
     }
-    
+
     // 11111000,00000000 == 0xF800
     // 00000111,11100000 == 0x07E0
     // 00000000,00111111 == 0x001F
-    
+
     extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
     extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
     extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11111000,00000000 == 0xF800
     // 00000111,11100000 == 0x07E0
     // 00000000,00111111 == 0x001F
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
     ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
index 2e455adfa..fe19540ee 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,38 +51,38 @@ import java.nio.*;
  * @author Administrator
  */
 public class Extract565rev implements Extract {
-  
+
   /** Creates a new instance of Extract565rev */
   public Extract565rev() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
-    
+
     if( isSwap ) {
       ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
     } else {
       ushort = 0x0000FFFF & packedPixel.getShort();
     }
-    
+
     // 00000000,00011111 == 0x001F
     // 00000111,11100000 == 0x07E0
     // 11111000,00000000 == 0xF800
-    
+
     extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
     extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
     extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 00000000,00111111 == 0x001F
     // 00000111,11100000 == 0x07E0
     // 11111000,00000000 == 0xF800
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) ) & 0x0000001F );
     ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
index 137fa3c21..4602f2af9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
  * @author Administrator
  */
 public class Extract8888 implements Extract {
-  
+
   /** Creates a new instance of Extract8888 */
   public Extract8888() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     long uint = 0;
-    
+
     if( isSwap ) {
       uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
     } else {
       uint = 0x00000000FFFFFFFF & packedPixel.getInt();
     }
-    
+
     // 11111000,00000000 == 0xF800
     // 00000111,11000000 == 0x07C0
     // 00000000,00111110 == 0x003E
     // 00000000,00000001 == 0x0001
-    
+
     extractComponents[0] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
     extractComponents[1] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
     extractComponents[2] = (float)( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
     extractComponents[3] = (float)( ( uint & 0x000000FF )       ) / 255.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
     // 00000000,00001111 == 0x000F
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
     assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     long uint = (((int)((shoveComponents[0] * 255) + 0.5f) << 24) & 0xFF000000 );
     uint |= (((int)((shoveComponents[1] * 255) + 0.5f) <<   16) & 0x00FF0000 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
index 2ac942c84..373cb102a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
  * @author Administrator
  */
 public class Extract8888rev implements Extract {
-  
+
   /** Creates a new instance of Extract8888rev */
   public Extract8888rev() {
   }
-  
+
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     long uint = 0;
-    
+
     if( isSwap ) {
       uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
     } else {
       uint = 0x00000000FFFFFFFF & packedPixel.getInt();
     }
-    
+
     // 11111000,00000000 == 0xF800
     // 00000111,11000000 == 0x07C0
     // 00000000,00111110 == 0x003E
     // 00000000,00000001 == 0x0001
-    
+
     extractComponents[0] = (float)( ( uint & 0x000000FF )       ) / 255.0f;
     extractComponents[1] = (float)( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
     extractComponents[2] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
     extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
   }
-  
+
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
     // 00000000,00001111 == 0x000F
-    
+
     assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
     assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
     assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
     assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
+
     // due to limited precision, need to round before shoving
     long uint = (((int)((shoveComponents[0] * 255) + 0.5f)    ) & 0x000000FF );
     uint |= (((int)((shoveComponents[1] * 255) + 0.5f) <<    8) & 0x0000FF00 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
index 52c2191b9..ac0f2f290 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
  * @author Administrator
  */
 public class ExtractFloat implements ExtractPrimitive {
-  
+
   /** Creates a new instance of ExtractFloat */
   public ExtractFloat() {
   }
-  
+
   public double extract( boolean isSwap, ByteBuffer data ) {
     float f = 0;
     if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractFloat implements ExtractPrimitive {
     assert( f <= 1.0f );
     return( f );
   }
-  
+
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 1.0);
     data.asFloatBuffer().put( index, (float)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
index 926096649..a44fb9508 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
index 2e1a9a0a6..399386e30 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,17 +51,17 @@ import java.nio.ByteBuffer;
  * @author Administrator
  */
 public class ExtractSByte implements ExtractPrimitive {
-  
+
   /** Creates a new instance of ExtractUByte */
   public ExtractSByte() {
   }
-  
+
   public double extract( boolean isSwap, ByteBuffer sbyte ) {
     byte b = sbyte.get();
     assert( b <= 127 );
     return( b );
   }
-  
+
   public void shove( double value, int index, ByteBuffer data ) {
     data.position( index );
     data.put( (byte)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
index ca80747c4..be3fb3092 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
  * @author Administrator
  */
 public class ExtractSInt implements ExtractPrimitive {
-  
+
   /** Creates a new instance of ExtractSInt */
   public ExtractSInt() {
   }
-  
+
   public double extract( boolean isSwap, ByteBuffer uint ) {
     int i = 0;
     if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractSInt implements ExtractPrimitive {
     assert( i <= 0x7FFFFFFF );
     return( i );
   }
-  
+
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < Integer.MAX_VALUE);
     IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
index 979c3b449..1e123c9b4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
  * @author Administrator
  */
 public class ExtractSShort implements ExtractPrimitive {
-  
+
   /** Creates a new instance of ExtractSShort */
   public ExtractSShort() {
   }
-  
+
   public double extract( boolean isSwap, ByteBuffer ushort ) {
     short s = 0;
     if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractSShort implements ExtractPrimitive {
     assert( s <= 32767 );
     return( s );
   }
-  
+
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 32768.0);
     ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
index 4d14212ab..26ca5cd40 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,17 +51,17 @@ import java.nio.ByteBuffer;
  * @author Administrator
  */
 public class ExtractUByte implements ExtractPrimitive {
-  
+
   /** Creates a new instance of ExtractUByte */
   public ExtractUByte() {
   }
-  
+
   public double extract( boolean isSwap, ByteBuffer ubyte ) {
     int i = 0x000000FF & ubyte.get();
     assert( i <= 255 );
     return( i );
   }
-  
+
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 256.0);
     data.position( index );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
index c088ca301..8c94c89fc 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
  * @author Administrator
  */
 public class ExtractUInt implements ExtractPrimitive {
-  
+
   /** Creates a new instance of ExtractUInt */
   public ExtractUInt() {
   }
-  
+
   public double extract( boolean isSwap, ByteBuffer uint ) {
     long i = 0;
     if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractUInt implements ExtractPrimitive {
     assert( i <= 0xFFFFFFFF );
     return( i );
   }
-  
+
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 0xFFFFFFFF);
     IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
index 81db60f0f..55115c6f7 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
  * @author Administrator
  */
 public class ExtractUShort implements ExtractPrimitive {
-  
+
   /** Creates a new instance of ExtracUShort */
   public ExtractUShort() {
   }
-  
+
   public double extract( boolean isSwap, ByteBuffer ushort ) {
     int i = 0;
     if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractUShort implements ExtractPrimitive {
     assert( i <= 65535 );
     return( i );
   }
-  
+
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 65536.0);
     ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
index 7549044ba..184c5fda8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -52,11 +52,11 @@ import java.nio.*;
  * @author  Administrator
  */
 public class HalveImage {
-  
+
   private static final int BOX2 = 2;
   private static final int BOX4 = 4;
   private static final int BOX8 = 8;
-  
+
   public static void halveImage( int components, int width, int height,
           ShortBuffer datain, ShortBuffer dataout ) {
     int i, j, k;
@@ -64,11 +64,11 @@ public class HalveImage {
     int delta;
     int t = 0;
     short temp = 0;
-    
+
     newwidth = width / 2;
     newheight = height /2;
     delta = width * components;
-    
+
     // Piece of cake
     for( i = 0; i < newheight; i++ ) {
       for( j = 0; j < newwidth; j++ ) {
@@ -91,7 +91,7 @@ public class HalveImage {
       t += delta;
     }
   }
-  
+
   public static void halveImage_ubyte( int components, int width, int height,
                                       ByteBuffer datain, ByteBuffer dataout,
                                       int element_size, int ysize, int group_size ) {
@@ -99,19 +99,19 @@ public class HalveImage {
     int newwidth, newheight;
     int s;
     int t;
-    
+
     // Handle case where there is only 1 column/row
     if( width == 1 || height == 1 ) {
       assert( !( width == 1 && height == 1 ) ); // can't be 1x1
       halve1Dimage_ubyte( components, width, height, datain, dataout, element_size, ysize, group_size );
       return;
     }
-    
+
     newwidth = width / 2;
     newheight = height / 2;
     s = 0;
     t = 0;
-    
+
     int temp = 0;
     // piece of cake
     for( i = 0; i < newheight; i++ ) {
@@ -133,9 +133,9 @@ public class HalveImage {
       t += ysize;
     }
   }
-  
+
   public static void halve1Dimage_ubyte( int components, int width, int height,
-                      ByteBuffer datain, ByteBuffer dataout, 
+                      ByteBuffer datain, ByteBuffer dataout,
                       int element_size, int ysize, int group_size ) {
     int halfWidth = width / 2;
     int halfHeight = height / 2;
@@ -143,14 +143,14 @@ public class HalveImage {
     int dest = 0;
     int jj;
     int temp = 0;
-    
+
     assert( width == 1 || height == 1 ); // Must be 1D
     assert( width != height ); // can't be square
-    
+
     if( height == 1 ) { // 1 row
       assert( width != 1 ); // widthxheight can't be 1x1
       halfHeight = 1;
-      
+
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -161,7 +161,7 @@ public class HalveImage {
           temp /= 2;
           dataout.put( (byte)temp );
           /*
-          dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) + 
+          dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
                     (0x000000FF & datain.setIndexInBytes( src + group_size ).getByte())) / 2 ) );
            */
           src += element_size;
@@ -188,7 +188,7 @@ public class HalveImage {
           temp /= 2;
           dataout.put( (byte)temp );
           /*
-          dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) + 
+          dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
                     (0x000000FF & datain.setIndexInBytes(src + ysize).getByte()) ) / 2 ) );
            */
           src += element_size;
@@ -202,7 +202,7 @@ public class HalveImage {
     assert( src == ysize * height );
     assert( dest == components * element_size * halfWidth * halfHeight );
   }
-  
+
   public static void halveImage_byte( int components, int width, int height,
                     ByteBuffer datain, ByteBuffer dataout, int element_size,
                     int ysize, int group_size ) {
@@ -211,7 +211,7 @@ public class HalveImage {
     int s = 0;
     int t = 0;
     byte temp = (byte)0;
-    
+
     // handle case where there is only 1 column
     if( width == 1 || height == 1 ) {
       assert( !( width == 1 && height == 1 ) );
@@ -219,10 +219,10 @@ public class HalveImage {
                                                             ysize, group_size );
       return;
     }
-    
+
     newwidth = width / 2;
     newheight = height / 2;
-    
+
     for( i = 0; i < newheight; i++ ) {
       for( j = 0; j < newwidth; j++ ) {
         for( k = 0; k < components; k++ ) {
@@ -244,7 +244,7 @@ public class HalveImage {
       t += ysize;
     }
   }
-  
+
   public static void halve1Dimage_byte( int components, int width, int height,
                       ByteBuffer datain, ByteBuffer dataout,
                       int element_size, int ysize, int group_size ) {
@@ -254,14 +254,14 @@ public class HalveImage {
     int dest = 0;
     int jj;
     byte temp = (byte)0;
-    
+
     assert( width == 1 || height == 1 ); // must be 1D
     assert( width != height ); // can't be square
-    
+
     if( height == 1 ) { // 1 row
       assert( width != 1 ); // widthxheight can't be 1
       halfHeight = 1;
-      
+
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -284,7 +284,7 @@ public class HalveImage {
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
       // average two at a time
-      
+
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -303,7 +303,7 @@ public class HalveImage {
     }
     assert( dest == components * element_size * halfWidth * halfHeight );
   }
-  
+
   public static void halveImage_ushort( int components, int width, int height,
                           ByteBuffer datain, ShortBuffer dataout, int element_size,
                           int ysize, int group_size, boolean myswap_bytes ) {
@@ -319,10 +319,10 @@ public class HalveImage {
                                 ysize, group_size, myswap_bytes );
       return;
     }
-    
+
     newwidth = width / 2;
     newheight = height / 2;
-    
+
     // Piece of cake
     if( !myswap_bytes ) {
       for( i = 0; i < newheight; i++ ) {
@@ -364,7 +364,7 @@ public class HalveImage {
       }
     }
   }
-  
+
   public static void halve1Dimage_ushort( int components, int width, int height,
                       ByteBuffer datain, ShortBuffer dataout, int element_size,
                       int ysize, int group_size, boolean myswap_bytes ) {
@@ -373,14 +373,14 @@ public class HalveImage {
     int src = 0;
     int dest = 0;
     int jj;
-    
+
     assert( width == 1 || height == 1 ); // must be 1D
     assert( width != height ); // can't be square
-    
+
     if( height == 1 ) { // 1 row
       assert( width != 1 ); // widthxheight can't be 1
       halfHeight = 1;
-      
+
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < halfHeight; kk++ ) {
@@ -410,7 +410,7 @@ public class HalveImage {
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
       // average two at a time
-      
+
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -437,7 +437,7 @@ public class HalveImage {
     }
     assert( dest == components * element_size * halfWidth * halfHeight );
   }
-  
+
   public static void halveImage_short( int components, int width, int height,
                         ByteBuffer datain, ShortBuffer dataout, int element_size,
                         int ysize, int group_size, boolean myswap_bytes ) {
@@ -453,10 +453,10 @@ public class HalveImage {
                             ysize, group_size, myswap_bytes );
       return;
     }
-    
+
     newwidth = width / 2;
     newheight = height / 2;
-    
+
     // Piece of cake
     if( !myswap_bytes ) {
       for( i = 0; i < newheight; i++ ) {
@@ -504,7 +504,7 @@ public class HalveImage {
       }
     }
   }
-  
+
   public static void halve1Dimage_short( int components, int width, int height,
               ByteBuffer datain, ShortBuffer dataout, int element_size, int ysize,
               int group_size, boolean myswap_bytes ) {
@@ -513,14 +513,14 @@ public class HalveImage {
     int src = 0;
     int dest = 0;
     int jj;
-    
+
     assert( width == 1 || height == 1 ); // must be 1D
     assert( width != height ); // can't be square
-    
+
     if( height == 1 ) { // 1 row
       assert( width != 1 ); // can't be 1x1
       halfHeight = 1;
-      
+
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -550,7 +550,7 @@ public class HalveImage {
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
       // average two at a time
-      
+
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -577,7 +577,7 @@ public class HalveImage {
     }
     assert( dest == ( components * element_size * halfWidth * halfHeight ) );
   }
-  
+
   public static void halveImage_uint( int components, int width, int height,
                           ByteBuffer datain, IntBuffer dataout, int element_size,
                           int ysize, int group_size, boolean myswap_bytes ) {
@@ -586,7 +586,7 @@ public class HalveImage {
     int s = 0;
     int t = 0;
     double temp = 0;
-    
+
     // handle case where there is only 1 column/row
     if( width == 1 || height == 1 ) {
       assert( !( width == 1 && height == 1 ) ); // can't be 1x1
@@ -594,10 +594,10 @@ public class HalveImage {
                                 ysize, group_size, myswap_bytes );
       return;
     }
-    
+
     newwidth = width / 2;
     newheight = height / 2;
-    
+
     // Piece of cake
     if( !myswap_bytes ) {
       for( i = 0; i < newheight; i++ ) {
@@ -643,7 +643,7 @@ public class HalveImage {
       }
     }
   }
-  
+
   public static void halve1Dimage_uint( int components, int width, int height,
                       ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
                       int group_size, boolean myswap_bytes ) {
@@ -652,14 +652,14 @@ public class HalveImage {
     int src = 0;
     int dest = 0;
     int jj;
-    
+
     assert( width == 1 || height == 1 ); // must be 1D
     assert( width != height ); // can't be square
-    
+
     if( height == 1 ) { // 1 row
       assert( width != 1 ); // widthxheight can't be 1
       halfHeight = 1;
-      
+
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < halfHeight; kk++ ) {
@@ -689,7 +689,7 @@ public class HalveImage {
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
       // average two at a time
-      
+
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -716,7 +716,7 @@ public class HalveImage {
     }
     assert( dest == components * element_size * halfWidth * halfHeight );
   }
-  
+
   public static void halveImage_int( int components, int width, int height,
                         ByteBuffer datain, IntBuffer dataout, int element_size,
                         int ysize, int group_size, boolean myswap_bytes ) {
@@ -725,7 +725,7 @@ public class HalveImage {
     int s = 0;
     int t = 0;
     int temp = 0;
-    
+
     // handle case where there is only 1 column/row
     if( width == 1 || height == 1 ) {
       assert( !( width == 1 && height == 1 ) ); // can't be 1x1
@@ -733,10 +733,10 @@ public class HalveImage {
                             ysize, group_size, myswap_bytes );
       return;
     }
-    
+
     newwidth = width / 2;
     newheight = height / 2;
-    
+
     // Piece of cake
     if( !myswap_bytes ) {
       for( i = 0; i < newheight; i++ ) {
@@ -785,7 +785,7 @@ public class HalveImage {
       }
     }
   }
-  
+
   public static void halve1Dimage_int( int components, int width, int height,
               ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
               int group_size, boolean myswap_bytes ) {
@@ -794,14 +794,14 @@ public class HalveImage {
     int src = 0;
     int dest = 0;
     int jj;
-    
+
     assert( width == 1 || height == 1 ); // must be 1D
     assert( width != height ); // can't be square
-    
+
     if( height == 1 ) { // 1 row
       assert( width != 1 ); // can't be 1x1
       halfHeight = 1;
-      
+
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -831,7 +831,7 @@ public class HalveImage {
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
       // average two at a time
-      
+
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -858,7 +858,7 @@ public class HalveImage {
     }
     assert( dest == ( components * element_size * halfWidth * halfHeight ) );
   }
-  
+
   public static void halveImage_float( int components, int width, int height,
                     ByteBuffer datain, FloatBuffer dataout, int element_size,
                     int ysize, int group_size, boolean myswap_bytes ) {
@@ -874,10 +874,10 @@ public class HalveImage {
                                               ysize, group_size, myswap_bytes );
       return;
     }
-    
+
     newwidth = width / 2;
     newheight = height / 2;
-    
+
     // Piece of cake
     if( !myswap_bytes ) {
       for( i = 0; i < newheight; i++ ) {
@@ -920,7 +920,7 @@ public class HalveImage {
       }
     }
   }
-  
+
   public static void halve1Dimage_float( int components, int width, int height,
               ByteBuffer datain, FloatBuffer dataout, int element_size, int ysize,
               int group_size, boolean myswap_bytes ) {
@@ -929,14 +929,14 @@ public class HalveImage {
     int src = 0;
     int dest = 0;
     int jj;
-    
+
     assert( width == 1 || height == 1 ); // must be 1D
     assert( width != height ); // can't be square
-    
+
     if( height == 1 ) { // 1 row
       assert( width != 1 ); // can't be 1x1
       halfHeight = 1;
-      
+
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -966,7 +966,7 @@ public class HalveImage {
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
       // average two at a time
-      
+
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
@@ -993,9 +993,9 @@ public class HalveImage {
     }
     assert( dest == ( components * element_size * halfWidth * halfHeight ) );
   }
-  
-  public static void halveImagePackedPixel( int components, Extract extract, int width, 
-          int height, ByteBuffer datain, ByteBuffer dataout, 
+
+  public static void halveImagePackedPixel( int components, Extract extract, int width,
+          int height, ByteBuffer datain, ByteBuffer dataout,
           int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
     if( width == 1 || height == 1 ) {
       assert( !( width == 1 && height == 1 ) );
@@ -1004,19 +1004,19 @@ public class HalveImage {
       return;
     }
     int ii, jj;
-    
+
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int src = 0;
     int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
     int outIndex = 0;
-    
+
     for( ii = 0; ii < halfHeight; ii++ ) {
       for( jj = 0; jj < halfWidth; jj++ ) {
         float totals[] = new float[4];
         float extractTotals[][] = new float[BOX4][4];
         int cc;
-        
+
         datain.position( src );
         extract.extract( isSwap, datain, extractTotals[0] );
         datain.position( src + pixelSizeInBytes );
@@ -1045,7 +1045,7 @@ public class HalveImage {
     assert( src == rowSizeInBytes * height );
     assert( outIndex == halfWidth * halfHeight );
   }
-  
+
   public static void halve1DimagePackedPixel( int components, Extract extract, int width,
               int height, ByteBuffer datain, ByteBuffer dataout,
               int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
@@ -1053,23 +1053,23 @@ public class HalveImage {
     int halfHeight = height / 2;
     int src = 0;
     int jj;
-    
+
     assert( width == 1 || height == 1 );
     assert( width != height );
-    
+
     if( height == 1 ) {
       int outIndex = 0;
-      
+
       assert( width != 1 );
       halfHeight = 1;
-      
+
       // one horizontal row with possible pad bytes
-      
+
       for( jj = 0; jj < halfWidth; jj++ ) {
         float[] totals = new float[4];
         float[][] extractTotals = new float[BOX2][4];
         int cc;
-        
+
         datain.position( src );
         extract.extract( isSwap, datain, extractTotals[0] );
         datain.position( src + pixelSizeInBytes );
@@ -1090,17 +1090,17 @@ public class HalveImage {
       }
       int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
       src += padBytes;
-      
+
       assert( src == rowSizeInBytes );
       assert( outIndex == halfWidth * halfHeight );
     } else if( width == 1 ) {
       int outIndex = 0;
-      
+
       assert( height != 1 );
       halfWidth = 1;
       // one vertical volumn with possible pad bytes per row
       // average two at a time
-      
+
       for( jj = 0; jj < halfHeight; jj++ ) {
         float[] totals = new float[4];
         float[][] extractTotals = new float[BOX2][4];
@@ -1128,7 +1128,7 @@ public class HalveImage {
       assert( outIndex == halfWidth * halfHeight );
     }
   }
-  
+
   public static void halveImagePackedPixelSlice( int components, Extract extract,
           int width, int height, int depth, ByteBuffer dataIn,
           ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
@@ -1140,26 +1140,26 @@ public class HalveImage {
     int src = 0;
     int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
     int outIndex = 0;
-    
+
     assert( (width == 1 || height == 1) && depth >= 2 );
-    
+
     if( width == height ) {
       assert( width == 1 && height == 1 );
       assert( depth >= 2 );
-      
+
       for( ii = 0; ii < halfDepth; ii++ ) {
         float totals[] = new float[4];
         float extractTotals[][] = new float[BOX2][4];
         int cc;
-        
+
         dataIn.position( src );
         extract.extract( isSwap, dataIn, extractTotals[0] );
         dataIn.position( src + imageSizeInBytes );
         extract.extract( isSwap, dataIn, extractTotals[1] );
-        
+
         for( cc = 0; cc < components; cc++ ) {
           int kk;
-          
+
           // average only 2 pixels since a column
           totals[cc]= 0.0f;
           for( kk = 0; kk < BOX2; kk++ ) {
@@ -1167,7 +1167,7 @@ public class HalveImage {
           }
           totals[cc] /= BOX2;
         } // for cc
-        
+
         extract.shove( totals, outIndex, dataOut );
         outIndex++;
         // skip over to next group of 2
@@ -1175,13 +1175,13 @@ public class HalveImage {
       } // for ii
     } else if( height == 1 ) {
       assert( width != 1 );
-      
+
       for( ii = 0; ii < halfDepth; ii++ ) {
         for( jj = 0; jj < halfWidth; jj++ ) {
           float totals[] = new float[4];
           float extractTotals[][] = new float[BOX4][4];
           int cc;
-          
+
           dataIn.position( src );
           extract.extract( isSwap, dataIn, extractTotals[0] );
           dataIn.position( src + pixelSizeInBytes );
@@ -1190,10 +1190,10 @@ public class HalveImage {
           extract.extract( isSwap, dataIn, extractTotals[2] );
           dataIn.position( src + pixelSizeInBytes + imageSizeInBytes );
           extract.extract( isSwap, dataIn, extractTotals[3] );
-          
+
           for( cc = 0; cc < components; cc++ ) {
             int kk;
-            
+
             // grab 4 pixels to average
             totals[cc] = 0.0f;
             for( kk = 0; kk < BOX4; kk++ ) {
@@ -1209,13 +1209,13 @@ public class HalveImage {
       }
     } else if( width == 1 ) {
       assert( height != 1 );
-      
+
       for( ii = 0; ii < halfDepth; ii++ ) {
         for( jj = 0; jj < halfWidth; jj++ ) {
           float totals[] = new float[4];
           float extractTotals[][] = new float[BOX4][4];
           int cc;
-          
+
           dataIn.position( src );
           extract.extract( isSwap, dataIn, extractTotals[0] );
           dataIn.position( src + rowSizeInBytes );
@@ -1224,10 +1224,10 @@ public class HalveImage {
           extract.extract( isSwap, dataIn, extractTotals[2] );
           dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
           extract.extract( isSwap, dataIn, extractTotals[3] );
-          
+
           for( cc = 0; cc < components; cc++ ) {
             int kk;
-            
+
             // grab 4 pixels to average
             totals[cc] = 0.0f;
             for( kk = 0; kk < BOX4; kk++ ) {
@@ -1243,7 +1243,7 @@ public class HalveImage {
       }
     }
   }
-  
+
   public static void halveImageSlice( int components, ExtractPrimitive extract, int width,
           int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
           int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
@@ -1255,25 +1255,25 @@ public class HalveImage {
     int src = 0;
     int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
     int outIndex = 0;
-    
+
     assert( (width == 1 || height == 1) && depth >= 2 );
-    
+
     if( width == height ) {
       assert( width == 1 && height == 1 );
       assert( depth >= 2 );
-      
+
       for( ii = 0; ii < halfDepth; ii++ ) {
         int cc;
         for( cc = 0; cc < components; cc++ ) {
           double[] totals = new double[4];
           double[][] extractTotals = new double[BOX2][4];
           int kk;
-          
+
           dataIn.position( src );
           extractTotals[0][cc] = extract.extract( isSwap, dataIn );
           dataIn.position( src + imageSizeInBytes );
           extractTotals[1][cc] = extract.extract( isSwap, dataIn );
-          
+
           // average 2 pixels since only a column
           totals[cc] = 0.0f;
           // totals[red] = extractTotals[0][red] + extractTotals[1][red];
@@ -1282,7 +1282,7 @@ public class HalveImage {
             totals[cc] += extractTotals[kk][cc];
           }
           totals[cc] /= (double)BOX2;
-          
+
           extract.shove( totals[cc], outIndex, dataOut );
           outIndex++;
           src += elementSizeInBytes;
@@ -1290,12 +1290,12 @@ public class HalveImage {
         // skip over next group of 2
         src += rowSizeInBytes;
       } // for ii
-      
+
       assert( src == rowSizeInBytes * height * depth );
       assert( outIndex == halfDepth * components );
     } else if( height == 1 ) {
       assert( width != 1 );
-      
+
       for( ii = 0; ii < halfDepth; ii++ ) {
         for( jj = 0; jj < halfWidth; jj++ ) {
           int cc;
@@ -1303,7 +1303,7 @@ public class HalveImage {
             int kk;
             double totals[] = new double[4];
             double extractTotals[][] = new double[BOX4][4];
-            
+
             dataIn.position( src );
             extractTotals[0][cc] = extract.extract( isSwap, dataIn );
             dataIn.position( src + groupSizeInBytes );
@@ -1312,7 +1312,7 @@ public class HalveImage {
             extractTotals[2][cc] = extract.extract( isSwap, dataIn );
             dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
             extractTotals[3][cc] = extract.extract( isSwap, dataIn );
-            
+
             // grab 4 pixels to average
             totals[cc] = 0.0f;
             // totals[red] = extractTotals[0][red] + extractTotals[1][red] +
@@ -1322,7 +1322,7 @@ public class HalveImage {
               totals[cc] += extractTotals[kk][cc];
             }
             totals[cc] /= (double)BOX4;
-            
+
             extract.shove( totals[cc], outIndex, dataOut );
             outIndex++;
             src += elementSizeInBytes;
@@ -1337,7 +1337,7 @@ public class HalveImage {
       assert( outIndex == halfWidth * halfDepth * components );
     } else if( width == 1 ) {
       assert( height != 1 );
-      
+
       for( ii = 0; ii < halfDepth; ii++ ) {
         for( jj = 0; jj < halfHeight; jj++ ) {
           int cc;
@@ -1345,7 +1345,7 @@ public class HalveImage {
             int kk;
             double totals[] = new double[4];
             double extractTotals[][] = new double[BOX4][4];
-            
+
             dataIn.position( src );
             extractTotals[0][cc] = extract.extract( isSwap, dataIn );
             dataIn.position( src + rowSizeInBytes );
@@ -1354,8 +1354,8 @@ public class HalveImage {
             extractTotals[2][cc] = extract.extract( isSwap, dataIn );
             dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
             extractTotals[3][cc] = extract.extract( isSwap, dataIn );
-            
-            
+
+
             // grab 4 pixels to average
             totals[cc] = 0.0f;
             // totals[red] = extractTotals[0][red] + extractTotals[1][red] +
@@ -1365,7 +1365,7 @@ public class HalveImage {
               totals[cc] += extractTotals[kk][cc];
             }
             totals[cc] /= (double)BOX4;
-            
+
             extract.shove( totals[cc], outIndex, dataOut );
             outIndex++;
             src += elementSizeInBytes;
@@ -1380,32 +1380,32 @@ public class HalveImage {
       assert( outIndex == halfWidth * halfDepth * components );
     }
   }
-  
+
   public static void halveImage3D( int components, ExtractPrimitive extract,
           int width, int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
           int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
           int imageSizeInBytes, boolean isSwap ) {
     assert( depth > 1 );
-    
+
     // horizontal/vertical/onecolumn slice viewed from top
     if( width == 1 || height == 1 ) {
       assert( 1 <= depth );
-      
+
       halveImageSlice( components, extract, width, height, depth, dataIn, dataOut,
               elementSizeInBytes, groupSizeInBytes, rowSizeInBytes, imageSizeInBytes,
               isSwap );
       return;
     }
-    
+
     int ii, jj, dd;
-    
+
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int halfDepth = depth / 2;
     int src = 0;
     int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
     int outIndex = 0;
-    
+
     for( dd = 0; dd < halfDepth; dd++ ) {
       for( ii = 0; ii < halfHeight; ii++ ) {
         for( jj = 0; jj < halfWidth; jj++ ) {
@@ -1414,7 +1414,7 @@ public class HalveImage {
             int kk;
             double totals[] = new double[4];
             double extractTotals[][] = new double[BOX8][4];
-            
+
             dataIn.position( src );
             extractTotals[0][cc] = extract.extract( isSwap, dataIn );
             dataIn.position( src + groupSizeInBytes );
@@ -1431,17 +1431,17 @@ public class HalveImage {
             extractTotals[6][cc] = extract.extract( isSwap, dataIn );
             dataIn.position( src + rowSizeInBytes + imageSizeInBytes + groupSizeInBytes );
             extractTotals[7][cc] = extract.extract( isSwap, dataIn );
-            
+
             totals[cc] = 0.0f;
-            
+
             for( kk = 0; kk < BOX8; kk++ ) {
               totals[cc] += extractTotals[kk][cc];
             }
             totals[cc] /= (double)BOX8;
-            
+
             extract.shove( totals[cc], outIndex, dataOut );
             outIndex++;
-            
+
             src += elementSizeInBytes;
           } // for cc
           // skip over to next square of 4
@@ -1456,40 +1456,40 @@ public class HalveImage {
     assert( src == rowSizeInBytes * height * depth );
     assert( outIndex == halfWidth * halfHeight * halfDepth * components );
   }
-  
+
   public static void halveImagePackedPixel3D( int components, Extract extract,
-          int width, int height, int depth, ByteBuffer dataIn, 
+          int width, int height, int depth, ByteBuffer dataIn,
           ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
           int imageSizeInBytes, boolean isSwap ) {
     if( depth == 1 ) {
       assert( 1 <= width && 1 <= height );
-      
+
       halveImagePackedPixel( components, extract, width, height, dataIn, dataOut,
               pixelSizeInBytes, rowSizeInBytes, isSwap );
       return;
     } else if( width == 1 || height == 1 ) { // a horizontal or vertical slice viewed from top
       assert( 1 <= depth );
-      
+
       halveImagePackedPixelSlice( components, extract, width, height, depth, dataIn,
               dataOut, pixelSizeInBytes, rowSizeInBytes, imageSizeInBytes, isSwap );
       return;
     }
     int ii, jj, dd;
-    
+
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int halfDepth = depth / 2;
     int src = 0;
     int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
     int outIndex = 0;
-    
+
     for( dd = 0; dd < halfDepth; dd++ ) {
       for( ii = 0; ii < halfHeight; ii++ ) {
         for( jj = 0; jj < halfWidth; jj++ ) {
           float totals[] = new float[4]; // 4 is max components
           float extractTotals[][] = new float[BOX8][4];
           int cc;
-          
+
           dataIn.position( src );
           extract.extract( isSwap, dataIn, extractTotals[0] );
           dataIn.position( src + pixelSizeInBytes );
@@ -1506,7 +1506,7 @@ public class HalveImage {
           extract.extract( isSwap, dataIn, extractTotals[6] );
           dataIn.position( src + rowSizeInBytes + pixelSizeInBytes + imageSizeInBytes );
           extract.extract( isSwap, dataIn, extractTotals[7] );
-          
+
           for( cc = 0; cc < components; cc++ ) {
             int kk;
             // grab 8 pixels to average
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
index b610ce86b..18f814dde 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -53,18 +53,18 @@ import java.nio.*;
  * @author  Administrator
  */
 public class Image {
-  
+
   /** Creates a new instance of Image */
   public Image() {
   }
-  
+
   public static short getShortFromByteArray( byte[] array, int index ) {
     short s;
     s = (short)(array[index] << 8 );
     s |= (short)(0x00FF & array[index+1]);
     return( s );
   }
-  
+
   public static int getIntFromByteArray( byte[] array, int index ) {
     int i;
     i = ( array[index] << 24 ) & 0xFF000000;
@@ -73,12 +73,12 @@ public class Image {
     i |= ( array[index+3] ) & 0x000000FF;
     return( i );
   }
-  
+
   public static float getFloatFromByteArray( byte[] array, int index ) {
     int i = getIntFromByteArray( array, index );
     return( Float.intBitsToFloat(i) );
   }
-  
+
   /*
    *  Extract array from user's data applying all pixel store modes.
    *  The internal format used is an array of unsigned shorts.
@@ -98,7 +98,7 @@ public class Image {
     int iter2;
     int i, j, k;
     boolean myswap_bytes;
-    
+
     // Create a Extract interface object
     Extract extract = null;
     switch( type ) {
@@ -139,7 +139,7 @@ public class Image {
         extract = new Extract2101010rev();
         break;
     }
-    
+
     myswap_bytes = psm.getUnpackSwapBytes();
     components = Mipmap.elements_per_group( format, type );
     if( psm.getUnpackRowLength() > 0 ) {
@@ -147,12 +147,12 @@ public class Image {
     } else {
       groups_per_line = width;
     }
-    
+
     // All formats except GL_BITMAP fall out trivially
     if( type == GL2.GL_BITMAP ) {
       int bit_offset;
       int current_bit;
-      
+
       rowsize = ( groups_per_line * components + 7 ) / 8;
       padding = ( rowsize % psm.getUnpackAlignment() );
       if( padding != 0 ) {
@@ -200,7 +200,7 @@ public class Image {
       if( element_size == 1 ) {
         myswap_bytes = false;
       }
-      
+
       rowsize = groups_per_line * group_size;
       padding = ( rowsize % psm.getUnpackAlignment() );
       if( padding != 0 ) {
@@ -208,7 +208,7 @@ public class Image {
       }
       start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
       elements_per_line = width * components;
-      
+
       iter2 = 0;
       for( i = 0; i < height; i++ ) {
         iter = start;
@@ -364,7 +364,7 @@ public class Image {
         // want iter pointing at start, not within, row for assertion purposes
         iter = start;
       } // for i
-      
+
       // iterators should be one byte past end
       if( !Mipmap.isTypePackedPixel( type ) ) {
         assert( iter2 == ( width * height * components ) );
@@ -374,16 +374,16 @@ public class Image {
       assert( iter == ( rowsize * height + psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size ) );
     }
   }
-  
+
   /*
    *  Insert array into user's data applying all pixel store modes.
    *  Theinternal format is an array of unsigned shorts.
    *  empty_image() because it is the opposet of fill_image().
    */
-  public static void empty_image( PixelStorageModes psm, int width, int height, 
-                                  int format, int type, boolean index_format, 
+  public static void empty_image( PixelStorageModes psm, int width, int height,
+                                  int format, int type, boolean index_format,
                                   ShortBuffer oldimage, ByteBuffer userdata ) {
-    
+
     int components;
     int element_size;
     int rowsize;
@@ -396,7 +396,7 @@ public class Image {
     int iter2;
     int i, j, k;
     boolean myswap_bytes;
-    
+
     // Create a Extract interface object
     Extract extract = null;
     switch( type ) {
@@ -437,7 +437,7 @@ public class Image {
         extract = new Extract2101010rev();
         break;
     }
-    
+
     myswap_bytes = psm.getPackSwapBytes();
     components = Mipmap.elements_per_group( format, type );
     if( psm.getPackRowLength() > 0 ) {
@@ -445,12 +445,12 @@ public class Image {
     } else {
       groups_per_line = width;
     }
-    
+
     // all formats except GL_BITMAP fall out trivially
     if( type == GL2.GL_BITMAP ) {
       int bit_offset;
       int current_bit;
-      
+
       rowsize = ( groups_per_line * components + 7 ) / 8;
       padding = ( rowsize % psm.getPackAlignment() );
       if( padding != 0 ) {
@@ -472,7 +472,7 @@ public class Image {
               current_bit = 0;
             }
           }
-          
+
           if( current_bit != 0 ) {
             if( psm.getPackLsbFirst() ) {
               userdata.put( iter, (byte)( ( userdata.get( iter ) | ( 1 << bit_offset ) ) ) );
@@ -488,7 +488,7 @@ public class Image {
               userdata.put( iter, (byte)( ( userdata.get( iter ) & ~( 7 - bit_offset ) ) ) );
             }
           }
-          
+
           bit_offset++;
           if( bit_offset == 8 ) {
             bit_offset = 0;
@@ -500,13 +500,13 @@ public class Image {
       }
     } else {
       float shoveComponents[] = new float[4];
-      
+
       element_size = Mipmap.bytes_per_element( type );
       group_size = element_size * components;
       if( element_size == 1 ) {
         myswap_bytes = false;
       }
-      
+
       rowsize = groups_per_line * group_size;
       padding = ( rowsize % psm.getPackAlignment() );
       if( padding != 0 ) {
@@ -514,13 +514,13 @@ public class Image {
       }
       start = psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size;
       elements_per_line = width * components;
-      
+
       iter2 = 0;
       for( i = 0; i < height; i++ ) {
         iter = start;
         for( j = 0; j < elements_per_line; j++ ) {
           Type_Widget widget = new Type_Widget();
-          
+
           switch( type ) {
             case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
               for( k = 0; k < 3; k++ ) {
@@ -799,7 +799,7 @@ public class Image {
       assert( iter == rowsize * height + psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size );
     }
   }
-  
+
   public static void fillImage3D( PixelStorageModes psm, int width, int height,
           int depth, int format, int type, boolean indexFormat, ByteBuffer userImage,
           ShortBuffer newImage ) {
@@ -819,7 +819,7 @@ public class Image {
     int ww, hh, dd, k;
     Type_Widget widget = new Type_Widget();
     float extractComponents[] = new float[4];
-    
+
     // Create a Extract interface object
     Extract extract = null;
     switch( type ) {
@@ -860,7 +860,7 @@ public class Image {
         extract = new Extract2101010rev();
         break;
     }
-    
+
     myswapBytes = psm.getUnpackSwapBytes();
     components = Mipmap.elements_per_group( format, type );
     if( psm.getUnpackRowLength() > 0 ) {
@@ -873,7 +873,7 @@ public class Image {
     if( elementSize == 1 ) {
       myswapBytes = false;
     }
-    
+
     // 3dstuff begin
     if( psm.getUnpackImageHeight() > 0 ) {
       rowsPerImage = psm.getUnpackImageHeight();
@@ -881,27 +881,27 @@ public class Image {
       rowsPerImage = height;
     }
     // 3dstuff end
-    
+
     rowSize = groupsPerLine * groupSize;
     padding = rowSize % psm.getUnpackAlignment();
     if( padding != 0 ) {
       rowSize += psm.getUnpackAlignment() - padding;
     }
-    
+
     imageSize = rowsPerImage * rowSize; // 3dstuff
-    
-    start = psm.getUnpackSkipRows() * rowSize + 
-            psm.getUnpackSkipPixels() * groupSize + 
+
+    start = psm.getUnpackSkipRows() * rowSize +
+            psm.getUnpackSkipPixels() * groupSize +
             psm.getUnpackSkipImages() * imageSize;
     elementsPerLine = width * components;
-    
+
     iter2 = 0;
     for( dd = 0; dd < depth; dd++ ) {
       rowStart = start;
       for( hh = 0; hh < height; hh++ ) {
         iter = rowStart;
         for( ww = 0; ww < elementsPerLine; ww++ ) {
-          
+
           switch( type ) {
             case( GL2.GL_UNSIGNED_BYTE ):
               if( indexFormat ) {
@@ -1063,18 +1063,18 @@ public class Image {
       } // for hh
       start += imageSize;
     }// for dd
-    
+
     // iterators should be one byte past end
     if( !Mipmap.isTypePackedPixel( type ) ) {
       assert( iter2 == width * height * depth * components );
     } else {
       assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
     }
-    assert( iter == rowSize * height * depth + psm.getUnpackSkipRows() * rowSize + 
+    assert( iter == rowSize * height * depth + psm.getUnpackSkipRows() * rowSize +
             psm.getUnpackSkipPixels() * groupSize +
             psm.getUnpackSkipImages() * imageSize );
   }
-  
+
   public static void emptyImage3D( PixelStorageModes psm, int width, int height, int depth,
           int format, int type, boolean indexFormat, ShortBuffer oldImage, ByteBuffer userImage ) {
     boolean myswapBytes;
@@ -1092,7 +1092,7 @@ public class Image {
     int imageSize;
     Type_Widget widget = new Type_Widget();
     float[] shoveComponents = new float[4];
-    
+
     // Create a Extract interface object
     Extract extract = null;
     switch( type ) {
@@ -1133,9 +1133,9 @@ public class Image {
         extract = new Extract2101010rev();
         break;
     }
-    
+
     iter = 0;
-    
+
     myswapBytes = psm.getPackSwapBytes();
     components = Mipmap.elements_per_group( format, type );
     if( psm.getPackRowLength() > 0 ) {
@@ -1143,44 +1143,44 @@ public class Image {
     } else {
       groupsPerLine = width;
     }
-    
+
     elementSize = Mipmap.bytes_per_element( type );
     groupSize = elementSize * components;
     if( elementSize == 1 ) {
       myswapBytes = false;
     }
-    
+
     // 3dstuff begin
     if( psm.getPackImageHeight() > 0 ) {
       rowsPerImage = psm.getPackImageHeight();
     } else {
       rowsPerImage = height;
     }
-    
+
     // 3dstuff end
-    
+
     rowSize = groupsPerLine * groupSize;
     padding = rowSize % psm.getPackAlignment();
     if( padding != 0 ) {
       rowSize += psm.getPackAlignment() - padding;
     }
-    
+
     imageSize = rowsPerImage * rowSize;
-    
+
     start = psm.getPackSkipRows() * rowSize +
             psm.getPackSkipPixels() * groupSize +
             psm.getPackSkipImages() * imageSize;
     elementsPerLine = width * components;
-    
+
     iter2 = 0;
     for( dd = 0; dd < depth; dd++ ) {
       rowStart = start;
-      
+
       for( ii = 0; ii < height; ii++ ) {
         iter = rowStart;
-        
+
         for( jj = 0; jj < elementsPerLine; jj++ ) {
-          
+
           switch( type ) {
             case( GL2.GL_UNSIGNED_BYTE ):
               if( indexFormat ) {
@@ -1392,20 +1392,20 @@ public class Image {
             default:
               assert( false );
           }
-          
+
           iter += elementSize;
         } // for jj
         rowStart += rowSize;
       } // for ii
       start += imageSize;
     } // for dd
-    
+
     if( !Mipmap.isTypePackedPixel( type ) ) {
       assert( iter2 == width * height * depth * components );
     } else {
       assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
     }
-    assert( iter == rowSize * height * depth + 
+    assert( iter == rowSize * height * depth +
                     psm.getUnpackSkipRows() * rowSize +
                     psm.getUnpackSkipPixels() * groupSize +
                     psm.getUnpackSkipImages() * imageSize );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
index b74d0a6b8..938873ec5 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -57,11 +57,11 @@ import com.jogamp.common.nio.Buffers;
  * @author  Administrator
  */
 public class Mipmap {
-  
+
   /** Creates a new instance of Mipmap */
   public Mipmap() {
   }
-  
+
   public static int computeLog( int value ) {
     int i = 0;
     // Error
@@ -79,7 +79,7 @@ public class Mipmap {
       i++;
     }
   }
-  
+
   /* Compute the nearest power of 2 number.  This algorithm is a little strange
    * but it works quite well.
    */
@@ -99,7 +99,7 @@ public class Mipmap {
       i *= 2;
     }
   }
-  
+
   public static short GLU_SWAP_2_BYTES( short s ) {
     byte b = 0;
     b = (byte)( s >>> 8 );
@@ -107,7 +107,7 @@ public class Mipmap {
     s = (short)( s | (0x00FF & b) );
     return( s );
   }
-  
+
   public static int GLU_SWAP_4_BYTES( int i ) {
     int t = i << 24;
     t |= 0x00FF0000 & ( i << 8 );
@@ -115,13 +115,13 @@ public class Mipmap {
     t |= 0x000000FF & ( i >>> 24 );
     return( t );
   }
-  
+
   public static float GLU_SWAP_4_BYTES( float f ) {
     int i = Float.floatToRawIntBits( f );
     float temp = Float.intBitsToFloat( i );
     return( temp );
   }
-  
+
   public static int checkMipmapArgs( int internalFormat, int format, int type ) {
     if( !legalFormat( format ) || !legalType( type ) ) {
       return( GLU.GLU_INVALID_ENUM );
@@ -134,7 +134,7 @@ public class Mipmap {
     }
     return( 0 );
   }
-  
+
   public static boolean legalFormat( int format ) {
     switch( format ) {
       case( GL2.GL_COLOR_INDEX ):
@@ -155,7 +155,7 @@ public class Mipmap {
         return( false );
     }
   }
-  
+
   public static boolean legalType( int type ) {
     switch( type ) {
       case( GL2.GL_BITMAP ):
@@ -183,10 +183,10 @@ public class Mipmap {
         return( false );
     }
   }
-  
+
   public static boolean isTypePackedPixel( int type ) {
     assert( legalType( type ) );
-    
+
     if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
         type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
         type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
@@ -203,20 +203,20 @@ public class Mipmap {
     }
     return( false );
   }
-  
+
   public static boolean isLegalFormatForPackedPixelType( int format, int type ) {
     // if not a packed pixel type then return true
     if( isTypePackedPixel( type ) ) {
       return( true );
     }
-    
+
     // 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB
     if( (type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 || type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
         type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 || type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV )
         & format != GL2GL3.GL_RGB ) {
           return( false );
     }
-    
+
     // 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
     // 10_10_10_2/2_10_10_10_REV are only campatible with RGBA, BGRA & ARGB_EXT
     if( ( type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
@@ -232,7 +232,7 @@ public class Mipmap {
     }
     return( true );
   }
-  
+
   public static boolean isLegalLevels( int userLevel, int baseLevel, int maxLevel,
                                             int totalLevels ) {
     if( (baseLevel < 0) || (baseLevel < userLevel) || (maxLevel < baseLevel) ||
@@ -241,7 +241,7 @@ public class Mipmap {
     }
     return( true );
   }
-  
+
   /* Given user requested textures size, determine if it fits. If it doesn't then
    * halve both sides and make the determination again until it does fit ( for
    * IR only ).
@@ -257,7 +257,7 @@ public class Mipmap {
       int heightPowerOf2 = nearestPower( height );
       int[] proxyWidth = new int[1];
       boolean noProxyTextures = false;
-      
+
       // Some drivers (in particular, ATI's) seem to set a GL error
       // when proxy textures are used even though this is in violation
       // of the spec. Guard against this and interactions with the
@@ -268,20 +268,20 @@ public class Mipmap {
           int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
           int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
           int proxyTarget;
-        
+
           assert( widthAtLevelOne > 0 );
           assert( heightAtLevelOne > 0 );
-        
+
           // does width x height at level 1 & all their mipmaps fit?
           if( target == GL2GL3.GL_TEXTURE_2D || target == GL2GL3.GL_PROXY_TEXTURE_2D ) {
             proxyTarget = GL2GL3.GL_PROXY_TEXTURE_2D;
             gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
                              heightAtLevelOne, 0, format, type, null );
-          } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) || 
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) || 
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) || 
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) || 
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) || 
+          } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) ||
+                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) ||
+                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) ||
+                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ||
+                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) ||
                      (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) {
             proxyTarget = GL2GL3.GL_PROXY_TEXTURE_CUBE_MAP;
             gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
@@ -289,7 +289,7 @@ public class Mipmap {
           } else {
             assert( target == GL2GL3.GL_TEXTURE_1D || target == GL2GL3.GL_PROXY_TEXTURE_1D );
             proxyTarget = GL2GL3.GL_PROXY_TEXTURE_1D;
-            gl.getGL2GL3().glTexImage1D( proxyTarget, 1, internalFormat, widthAtLevelOne, 
+            gl.getGL2GL3().glTexImage1D( proxyTarget, 1, internalFormat, widthAtLevelOne,
                              0, format, type, null );
           }
           if(gl.isGL2GL3()) {
@@ -336,15 +336,15 @@ public class Mipmap {
       newHeight[0] = maxsize[0];
     }
   }
-  
-  public static void closestFit3D( GL gl, int target, int width, int height, int depth, 
+
+  public static void closestFit3D( GL gl, int target, int width, int height, int depth,
           int internalFormat, int format, int type, int[] newWidth, int[] newHeight,
           int[] newDepth ) {
     int widthPowerOf2 = nearestPower( width );
     int heightPowerOf2 = nearestPower( height );
     int depthPowerOf2 = nearestPower( depth );
     int[] proxyWidth = new int[1];
-    
+
     do {
       // compute level 1 width & height & depth, clamping each at 1
       int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
@@ -354,7 +354,7 @@ public class Mipmap {
       assert( widthAtLevelOne > 0 );
       assert( heightAtLevelOne > 0 );
       assert( depthAtLevelOne > 0 );
-      
+
       // does width x height x depth at level 1 & all their mipmaps fit?
       if( target == GL2GL3.GL_TEXTURE_3D || target == GL2GL3.GL_PROXY_TEXTURE_3D ) {
         proxyTarget = GL2GL3.GL_PROXY_TEXTURE_3D;
@@ -378,16 +378,16 @@ public class Mipmap {
       }
     } while( proxyWidth[0] == 0 );
     // loop must terminate
-    
+
     // return the width & height at level 0 that fits
     newWidth[0] = widthPowerOf2;
     newHeight[0] = heightPowerOf2;
     newDepth[0] = depthPowerOf2;
   }
-  
+
   public static int elements_per_group( int format, int type ) {
     // Return the number of elements per grtoup of a specified gromat
-    
+
     // If the type is packedpixels then answer is 1
     if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
         type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
@@ -403,7 +403,7 @@ public class Mipmap {
         type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
           return( 1 );
     }
-    
+
     // Types are not packed pixels so get elements per group
     switch( format ) {
       case( GL2GL3.GL_RGB ):
@@ -418,10 +418,10 @@ public class Mipmap {
         return( 1 );
     }
   }
-  
+
   public static int bytes_per_element( int type ) {
     // return the number of bytes per element, based on the element type
-    
+
     switch( type ) {
       case( GL2.GL_BITMAP ):
       case( GL2GL3.GL_BYTE ):
@@ -450,17 +450,17 @@ public class Mipmap {
         return( 4 );
     }
   }
-  
+
   public static boolean is_index( int format ) {
     return( format == GL2.GL_COLOR_INDEX || format == GL2GL3.GL_STENCIL_INDEX );
   }
-  
+
   /* Compute memory required for internal packed array of data of given type and format. */
-  
+
   public static int image_size( int width, int height, int format, int type ) {
     int bytes_per_row;
     int components;
-    
+
     assert( width > 0 );
     assert( height > 0 );
     components = elements_per_group( format, type );
@@ -471,17 +471,17 @@ public class Mipmap {
     }
     return( bytes_per_row * height * components );
   }
-  
+
   public static int imageSize3D( int width, int height, int depth, int format, int type ) {
     int components = elements_per_group( format, type );
     int bytes_per_row = bytes_per_element( type ) * width;
-    
+
     assert( width > 0 && height > 0 && depth > 0 );
     assert( type != GL2.GL_BITMAP );
-    
+
     return( bytes_per_row * height * depth * components );
   }
-  
+
   public static void retrieveStoreModes( GL gl, PixelStorageModes psm ) {
     int[] a = new int[1];
     gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
@@ -496,7 +496,7 @@ public class Mipmap {
     psm.setUnpackLsbFirst( ( a[0] == 1 ) );
     gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
     psm.setUnpackSwapBytes( ( a[0] == 1 ) );
-    
+
     gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
     psm.setPackAlignment( a[0] );
     gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
@@ -510,7 +510,7 @@ public class Mipmap {
     gl.glGetIntegerv( GL2GL3.GL_PACK_SWAP_BYTES, a, 0);
     psm.setPackSwapBytes( ( a[0] == 1 ) );
   }
-  
+
   public static void retrieveStoreModes3D( GL gl, PixelStorageModes psm ) {
     int[] a = new int[1];
     gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
@@ -529,7 +529,7 @@ public class Mipmap {
     psm.setUnpackSkipImages( a[0] );
     gl.glGetIntegerv( GL2GL3.GL_UNPACK_IMAGE_HEIGHT, a, 0);
     psm.setUnpackImageHeight( a[0] );
-    
+
     gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
     psm.setPackAlignment( a[0] );
     gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
@@ -547,9 +547,9 @@ public class Mipmap {
     gl.glGetIntegerv( GL2GL3.GL_PACK_IMAGE_HEIGHT, a, 0 );
     psm.setPackImageHeight( a[0] );
   }
-  
-  public static int gluScaleImage( GL gl, int format, int widthin, int heightin, 
-          int typein, ByteBuffer datain, int widthout, int heightout, 
+
+  public static int gluScaleImage( GL gl, int format, int widthin, int heightin,
+          int typein, ByteBuffer datain, int widthout, int heightout,
           int typeout, ByteBuffer dataout ) {
     int datainPos = datain.position();
     int dataoutPos = dataout.position();
@@ -559,7 +559,7 @@ public class Mipmap {
       ByteBuffer beforeimage;
       ByteBuffer afterimage;
       PixelStorageModes psm = new PixelStorageModes();
-    
+
       if( (widthin == 0)  || (heightin == 0) || (widthout == 0) || (heightout == 0) ) {
         return( 0 );
       }
@@ -580,20 +580,20 @@ public class Mipmap {
       if( beforeimage == null || afterimage == null ) {
         return( GLU.GLU_OUT_OF_MEMORY );
       }
-    
+
       retrieveStoreModes( gl, psm );
       Image.fill_image( psm, widthin, heightin, format, typein, is_index( format ), datain, beforeimage.asShortBuffer() );
       components = elements_per_group( format, 0 );
       ScaleInternal.scale_internal( components, widthin, heightin, beforeimage.asShortBuffer(), widthout, heightout, afterimage.asShortBuffer() );
       Image.empty_image( psm, widthout, heightout, format, typeout, is_index( format ), afterimage.asShortBuffer(), dataout );
-    
+
       return( 0 );
     } finally {
       datain.position(datainPos);
       dataout.position(dataoutPos);
     }
   }
-  
+
   public static int gluBuild1DMipmapLevels( GL gl, int target, int internalFormat,
                           int width, int format, int type, int userLevel, int baseLevel,
                           int maxLevel, ByteBuffer data ) {
@@ -601,30 +601,30 @@ public class Mipmap {
     try {
 
       int levels;
-    
+
       int rc = checkMipmapArgs( internalFormat, format, type );
       if( rc != 0 ) {
         return( rc );
       }
-    
+
       if( width < 1 ) {
         return( GLU.GLU_INVALID_VALUE );
       }
-    
+
       levels = computeLog( width );
-    
+
       levels += userLevel;
       if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
         return( GLU.GLU_INVALID_VALUE );
       }
-    
+
       return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat, width,
               width, format, type, userLevel, baseLevel, maxLevel, data ) );
     } finally {
       data.position(dataPos);
     }
   }
-  
+
   public static int gluBuild1DMipmaps( GL gl, int target, int internalFormat, int width,
               int format, int type, ByteBuffer data ) {
     int dataPos = data.position();
@@ -633,54 +633,54 @@ public class Mipmap {
       int[] widthPowerOf2 = new int[1];
       int levels;
       int[] dummy = new int[1];
-    
+
       int rc = checkMipmapArgs( internalFormat, format, type );
       if( rc != 0 ) {
         return( rc );
       }
-    
+
       if( width < 1 ) {
         return( GLU.GLU_INVALID_VALUE );
       }
-    
+
       closestFit( gl, target, width, 1, internalFormat, format, type, widthPowerOf2, dummy );
       levels = computeLog( widthPowerOf2[0] );
-    
-      return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat, 
+
+      return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat,
                     width, widthPowerOf2[0], format, type, 0, 0, levels, data ) );
     } finally {
       data.position(dataPos);
     }
   }
 
- 
+
   public static int gluBuild2DMipmapLevels( GL gl, int target, int internalFormat,
           int width, int height, int format, int type, int userLevel,
           int baseLevel, int maxLevel, Object data ) {
     int dataPos = 0;
 
     int level, levels;
-    
+
     int rc = checkMipmapArgs( internalFormat, format, type );
     if( rc != 0 ) {
       return( rc );
     }
-    
+
     if( width < 1 || height < 1 ) {
       return( GLU.GLU_INVALID_VALUE );
     }
-    
+
     levels = computeLog( width );
     level = computeLog( height );
     if( level > levels ) {
       levels = level;
     }
-    
+
     levels += userLevel;
     if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
       return( GLU.GLU_INVALID_VALUE );
     }
-    
+
     //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
     ByteBuffer buffer = null;
     if( data instanceof ByteBuffer ) {
@@ -706,7 +706,7 @@ public class Mipmap {
         FloatBuffer fb = buffer.asFloatBuffer();
         fb.put( array );
     }
-    
+
     try {
       return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
               width, height, width, height, format, type, userLevel, baseLevel,
@@ -716,7 +716,7 @@ public class Mipmap {
     }
   }
 
- 
+
   public static int gluBuild2DMipmaps( GL gl, int target, int internalFormat,
           int width, int height, int format, int type, Object data ) {
     int dataPos = 0;
@@ -724,25 +724,25 @@ public class Mipmap {
     int[] widthPowerOf2 = new int[1];
     int[] heightPowerOf2 = new int[1];
     int level, levels;
-    
+
     int rc = checkMipmapArgs( internalFormat, format, type );
     if( rc != 0 ) {
       return( rc );
     }
-    
+
     if( width < 1 || height < 1 ) {
       return( GLU.GLU_INVALID_VALUE );
     }
-    
-    closestFit( gl, target, width, height, internalFormat, format, type, 
+
+    closestFit( gl, target, width, height, internalFormat, format, type,
             widthPowerOf2, heightPowerOf2 );
-    
+
     levels = computeLog( widthPowerOf2[0] );
     level = computeLog( heightPowerOf2[0] );
     if( level > levels ) {
       levels = level;
     }
-    
+
     //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
     ByteBuffer buffer = null;
     if( data instanceof ByteBuffer ) {
@@ -768,17 +768,17 @@ public class Mipmap {
         FloatBuffer fb = buffer.asFloatBuffer();
         fb.put( array );
     }
-    
+
     try {
-      return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat, 
-              width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0, 
+      return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
+              width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0,
               0, levels, buffer ) );
     } finally {
       buffer.position(dataPos);
     }
   }
- 
- 
+
+
   public static int gluBuild3DMipmaps( GL gl, int target, int internalFormat,
           int width, int height, int depth, int format, int type, ByteBuffer data ) {
     int dataPos = data.position();
@@ -788,23 +788,23 @@ public class Mipmap {
       int[] heightPowerOf2 = new int[1];
       int[] depthPowerOf2 = new int[1];
       int level, levels;
-    
+
       int rc = checkMipmapArgs( internalFormat, format, type );
       if( rc != 0 ) {
         return( rc );
       }
-    
+
       if( width < 1 || height < 1 || depth < 1 ) {
         return( GLU.GLU_INVALID_VALUE );
       }
-    
+
       if( type == GL2.GL_BITMAP ) {
         return( GLU.GLU_INVALID_ENUM );
       }
-    
+
       closestFit3D( gl, target, width, height, depth, internalFormat, format,
                     type, widthPowerOf2, heightPowerOf2, depthPowerOf2 );
-    
+
       levels = computeLog( widthPowerOf2[0] );
       level = computeLog( heightPowerOf2[0] );
       if( level > levels ) {
@@ -814,7 +814,7 @@ public class Mipmap {
       if( level > levels ) {
         levels = level;
       }
-    
+
       return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
               height, depth, widthPowerOf2[0], heightPowerOf2[0], depthPowerOf2[0],
               format, type, 0, 0, levels, data ) );
@@ -822,27 +822,27 @@ public class Mipmap {
       data.position(dataPos);
     }
   }
-  
+
   public static int gluBuild3DMipmapLevels( GL gl, int target, int internalFormat,
           int width, int height, int depth, int format, int type, int userLevel,
           int baseLevel, int maxLevel, ByteBuffer data ) {
     int dataPos = data.position();
     try {
       int level, levels;
-    
+
       int rc = checkMipmapArgs( internalFormat, format, type );
       if( rc != 0 ) {
         return( rc );
       }
-    
+
       if( width < 1 || height < 1 || depth < 1 ) {
         return( GLU.GLU_INVALID_VALUE );
       }
-    
+
       if( type == GL2.GL_BITMAP ) {
         return( GLU.GLU_INVALID_ENUM );
       }
-    
+
       levels = computeLog( width );
       level = computeLog( height );
       if( level > levels ) {
@@ -852,12 +852,12 @@ public class Mipmap {
       if( level > levels ) {
         levels = level;
       }
-    
+
       levels += userLevel;
       if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
         return( GLU.GLU_INVALID_VALUE );
       }
-    
+
       return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
               height, depth, width, height, depth, format, type, userLevel,
               baseLevel, maxLevel, data ) );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
index 0b1af8323..7eb98db35 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -129,7 +129,7 @@ public class PixelStorageModes {
    * Holds value of property unpackImageHeight.
    */
   private int unpackImageHeight;
-  
+
   /** Creates a new instance of PixelStorageModes */
   public PixelStorageModes() {
   }
@@ -421,6 +421,6 @@ public class PixelStorageModes {
 
     this.unpackImageHeight = unpackImageHeight;
   }
-  
-  
+
+
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
index 9c95ae304..9aca1fb03 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -55,9 +55,9 @@ import com.jogamp.common.nio.Buffers;
  * @author  Administrator
  */
 public class ScaleInternal {
-  
+
   public static final float UINT_MAX = (float)(0x00000000FFFFFFFF);
-  
+
   public static void scale_internal( int components, int widthin, int heightin,
           ShortBuffer datain, int widthout, int heightout, ShortBuffer dataout ) {
     float x, lowx, highx, convx, halfconvx;
@@ -69,7 +69,7 @@ public class ScaleInternal {
     float area;
     int i, j, k, yint, xint, xindex, yindex;
     int temp;
-    
+
     if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
       HalveImage.halveImage( components, widthin, heightin, datain, dataout );
       return;
@@ -101,7 +101,7 @@ public class ScaleInternal {
         // data.
         totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
         area = 0.0f;
-        
+
         y = lowy;
         yint = (int)Math.floor( y );
         while( y < highy ) {
@@ -111,10 +111,10 @@ public class ScaleInternal {
           } else {
             ypercent = yint + 1 - y;
           }
-          
+
           x = lowx;
           xint = (int)Math.floor( x );
-          
+
           while( x < highx ) {
             xindex = ( xint + widthin ) % widthin;
             if( highx < xint + 1 ) {
@@ -122,21 +122,21 @@ public class ScaleInternal {
             } else {
               xpercent = xint + 1 - x;
             }
-            
+
             percent = xpercent * ypercent;
             area += percent;
             temp = ( xindex + ( yindex * widthin) ) * components;
             for( k = 0; k < components; k++ ) {
-              totals[k] += datain.get( temp + k ) * percent; 
+              totals[k] += datain.get( temp + k ) * percent;
             }
-            
+
             xint++;
             x = xint;
           }
           yint++;
           y = yint;
         }
-        
+
         temp = ( j + ( i * widthout ) ) * components;
         for( k = 0; k < components; k++ ) {
           // totals[] should be rounded in the case of enlarging an RGB
@@ -146,9 +146,9 @@ public class ScaleInternal {
       }
     }
   }
-  
+
   public static void scale_internal_ubyte( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
+                              ByteBuffer datain, int widthout, int heightout,
                               ByteBuffer dataout, int element_size, int ysize, int group_size ) {
     float x, convx;
     float y, convy;
@@ -157,11 +157,11 @@ public class ScaleInternal {
     float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
-    
+
     int temp, temp0;
     int temp_index;
     int outindex;
-    
+
     int lowx_int, highx_int, lowy_int, highy_int;
     float x_percent, y_percent;
     float lowx_float, highx_float, lowy_float, highy_float;
@@ -169,9 +169,9 @@ public class ScaleInternal {
     int convy_int, convx_int;
     int l, m;
     int left, right;
-    
+
     if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_ubyte( components, widthin, heightin, datain, dataout, 
+      HalveImage.halveImage_ubyte( components, widthin, heightin, datain, dataout,
                         element_size, ysize, group_size );
       return;
     }
@@ -181,14 +181,14 @@ public class ScaleInternal {
     convy_float = convy - convy_int;
     convx_int = (int)Math.floor( convx );
     convx_float = convx - convx_int;
-    
+
     area = convx * convy;
-    
+
     lowy_int = 0;
     lowy_float = 0.0f;
     highy_int = convy_int;
     highy_float = convy_float;
-    
+
     for( i = 0; i < heightout; i++ ) {
       // Clamp here to be sure we don't read beyond input buffer.
       if (highy_int >= heightin)
@@ -204,19 +204,19 @@ public class ScaleInternal {
         highx_int = convx_int;
         highx_float = convx_float;
       }
-      
+
       for( j = 0; j < widthout; j++ ) {
-        
+
         // Ok, now apply box filter to box that goes from (lowx, lowy)
         // to (highx, highy) on input data into this pixel on output
         // data.
         totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
+
         // caulate the value for pixels in the 1st row
         xindex = lowx_int * group_size;
 
         if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
+
           y_percent = 1 - lowy_float;
           temp = xindex + lowy_int * ysize;
           percent = y_percent * ( 1 - lowx_float );
@@ -239,7 +239,7 @@ public class ScaleInternal {
             datain.position( temp_index );
             totals[k] += ( 0x000000FF & datain.get() ) * percent;
           }
-          
+
           // calculate the value for pixels in the last row
           y_percent = highy_float;
           percent = y_percent * ( 1 - lowx_float );
@@ -261,7 +261,7 @@ public class ScaleInternal {
             datain.position( temp_index );
             totals[k] += ( 0x000000FF & datain.get() ) * percent;
           }
-          
+
           // calculate the value for the pixels in the 1st and last column
           for( m = lowy_int + 1; m < highy_int; m++ ) {
             left += ysize;
@@ -339,7 +339,7 @@ public class ScaleInternal {
           }
           temp0 += ysize;
         }
-        
+
         outindex = ( j + ( i * widthout ) ) * components;
         for( k = 0; k < components; k++ ) {
           dataout.position( outindex + k );
@@ -371,9 +371,9 @@ public class ScaleInternal {
       }
     }
   }
-  
+
   public static void scale_internal_byte( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
+                              ByteBuffer datain, int widthout, int heightout,
                               ByteBuffer dataout, int element_size, int ysize,
                               int group_size ) {
     float x, convx;
@@ -383,11 +383,11 @@ public class ScaleInternal {
     float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
-    
+
     int temp, temp0;
     int temp_index;
     int outindex;
-    
+
     int lowx_int, highx_int, lowy_int, highy_int;
     float x_percent, y_percent;
     float lowx_float, highx_float, lowy_float, highy_float;
@@ -395,9 +395,9 @@ public class ScaleInternal {
     int convy_int, convx_int;
     int l, m;
     int left, right;
-    
+
     if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_byte( components, widthin, heightin, datain, dataout, 
+      HalveImage.halveImage_byte( components, widthin, heightin, datain, dataout,
                         element_size, ysize, group_size );
       return;
     }
@@ -407,14 +407,14 @@ public class ScaleInternal {
     convy_float = convy - convy_int;
     convx_int = (int)Math.floor( convx );
     convx_float = convx - convx_int;
-    
+
     area = convx * convy;
-    
+
     lowy_int = 0;
     lowy_float = 0.0f;
     highy_int = convy_int;
     highy_float = convy_float;
-    
+
     for( i = 0; i < heightout; i++ ) {
       // Clamp here to be sure we don't read beyond input buffer.
       if (highy_int >= heightin)
@@ -430,18 +430,18 @@ public class ScaleInternal {
         highx_int = convx_int;
         highx_float = convx_float;
       }
-      
+
       for( j = 0; j < widthout; j++ ) {
-        
+
         // Ok, now apply box filter to box that goes from (lowx, lowy)
         // to (highx, highy) on input data into this pixel on output
         // data.
         totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
+
         // caulate the value for pixels in the 1st row
         xindex = lowx_int * group_size;
         if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
+
           y_percent = 1 - lowy_float;
           temp = xindex + lowy_int * ysize;
           percent = y_percent * ( 1 - lowx_float );
@@ -464,7 +464,7 @@ public class ScaleInternal {
             datain.position( temp_index );
             totals[k] += datain.get() * percent;
           }
-          
+
           // calculate the value for pixels in the last row
           y_percent = highy_float;
           percent = y_percent * ( 1 - lowx_float );
@@ -486,7 +486,7 @@ public class ScaleInternal {
             datain.position( temp_index );
             totals[k] += datain.get() * percent;
           }
-          
+
           // calculate the value for the pixels in the 1st and last column
           for( m = lowy_int + 1; m < highy_int; m++ ) {
             left += ysize;
@@ -550,7 +550,7 @@ public class ScaleInternal {
             totals[k] += datain.get() * percent;
           }
         }
-        
+
         // this is for the pixels in the body
         temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
         for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -564,7 +564,7 @@ public class ScaleInternal {
           }
           temp0 += ysize;
         }
-        
+
         outindex = ( j + ( i * widthout ) ) * components;
         for( k = 0; k < components; k++ ) {
           dataout.position( outindex + k );
@@ -596,10 +596,10 @@ public class ScaleInternal {
       }
     }
   }
-  
+
   public static void scale_internal_ushort( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              ShortBuffer dataout, int element_size, int ysize, 
+                              ByteBuffer datain, int widthout, int heightout,
+                              ShortBuffer dataout, int element_size, int ysize,
                               int group_size, boolean myswap_bytes ) {
     float x, convx;
     float y, convy;
@@ -608,11 +608,11 @@ public class ScaleInternal {
     float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
-    
+
     int temp, temp0;
     int temp_index;
     int outindex;
-    
+
     int lowx_int, highx_int, lowy_int, highy_int;
     float x_percent, y_percent;
     float lowx_float, highx_float, lowy_float, highy_float;
@@ -620,9 +620,9 @@ public class ScaleInternal {
     int convy_int, convx_int;
     int l, m;
     int left, right;
-    
+
     if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_ushort( components, widthin, heightin, datain, dataout, 
+      HalveImage.halveImage_ushort( components, widthin, heightin, datain, dataout,
                         element_size, ysize, group_size, myswap_bytes );
       return;
     }
@@ -632,14 +632,14 @@ public class ScaleInternal {
     convy_float = convy - convy_int;
     convx_int = (int)Math.floor( convx );
     convx_float = convx - convx_int;
-    
+
     area = convx * convy;
-    
+
     lowy_int = 0;
     lowy_float = 0.0f;
     highy_int = convy_int;
     highy_float = convy_float;
-    
+
     for( i = 0; i < heightout; i++ ) {
       // Clamp here to be sure we don't read beyond input buffer.
       if (highy_int >= heightin)
@@ -655,18 +655,18 @@ public class ScaleInternal {
         highx_int = convx_int;
         highx_float = convx_float;
       }
-      
+
       for( j = 0; j < widthout; j++ ) {
-        
+
         // Ok, now apply box filter to box that goes from (lowx, lowy)
         // to (highx, highy) on input data into this pixel on output
         // data.
         totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
+
         // caulate the value for pixels in the 1st row
         xindex = lowx_int * group_size;
         if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
+
           y_percent = 1 - lowy_float;
           temp = xindex + lowy_int * ysize;
           percent = y_percent * ( 1 - lowx_float );
@@ -701,7 +701,7 @@ public class ScaleInternal {
               totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
             }
           }
-          
+
           // calculate the value for pixels in the last row
           y_percent = highy_float;
           percent = y_percent * ( 1 - lowx_float );
@@ -735,7 +735,7 @@ public class ScaleInternal {
               totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
             }
           }
-          
+
           // calculate the value for the pixels in the 1st and last column
           for( m = lowy_int + 1; m < highy_int; m++ ) {
             left += ysize;
@@ -834,7 +834,7 @@ public class ScaleInternal {
             }
           }
         }
-        
+
         // this is for the pixels in the body
         temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
         for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -852,7 +852,7 @@ public class ScaleInternal {
           }
           temp0 += ysize;
         }
-        
+
         outindex = ( j + ( i * widthout ) ) * components;
         for( k = 0; k < components; k++ ) {
           dataout.position( outindex + k );
@@ -884,10 +884,10 @@ public class ScaleInternal {
       }
     }
   }
-  
+
   public static void scale_internal_short( int components, int widthin, int heightin,
                               ByteBuffer datain, int widthout, int heightout,
-                              ShortBuffer dataout, int element_size, int ysize, 
+                              ShortBuffer dataout, int element_size, int ysize,
                               int group_size, boolean myswap_bytes ) {
     float x, convx;
     float y, convy;
@@ -896,11 +896,11 @@ public class ScaleInternal {
     float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
-    
+
     int temp, temp0;
     int temp_index;
     int outindex;
-    
+
     int lowx_int, highx_int, lowy_int, highy_int;
     float x_percent, y_percent;
     float lowx_float, highx_float, lowy_float, highy_float;
@@ -908,11 +908,11 @@ public class ScaleInternal {
     int convy_int, convx_int;
     int l, m;
     int left, right;
-    
+
     int swapbuf; // unsigned buffer
-    
+
     if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_short( components, widthin, heightin, datain, dataout, 
+      HalveImage.halveImage_short( components, widthin, heightin, datain, dataout,
                         element_size, ysize, group_size, myswap_bytes );
       return;
     }
@@ -922,14 +922,14 @@ public class ScaleInternal {
     convy_float = convy - convy_int;
     convx_int = (int)Math.floor( convx );
     convx_float = convx - convx_int;
-    
+
     area = convx * convy;
-    
+
     lowy_int = 0;
     lowy_float = 0.0f;
     highy_int = convy_int;
     highy_float = convy_float;
-    
+
     for( i = 0; i < heightout; i++ ) {
       // Clamp here to be sure we don't read beyond input buffer.
       if (highy_int >= heightin)
@@ -945,18 +945,18 @@ public class ScaleInternal {
         highx_int = convx_int;
         highx_float = convx_float;
       }
-      
+
       for( j = 0; j < widthout; j++ ) {
-        
+
         // Ok, now apply box filter to box that goes from (lowx, lowy)
         // to (highx, highy) on input data into this pixel on output
         // data.
         totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
+
         // caulate the value for pixels in the 1st row
         xindex = lowx_int * group_size;
         if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
+
           y_percent = 1 - lowy_float;
           temp = xindex + lowy_int * ysize;
           percent = y_percent * ( 1 - lowx_float );
@@ -994,7 +994,7 @@ public class ScaleInternal {
               totals[k] += datain.getShort() * percent;
             }
           }
-          
+
           // calculate the value for pixels in the last row
           y_percent = highy_float;
           percent = y_percent * ( 1 - lowx_float );
@@ -1031,7 +1031,7 @@ public class ScaleInternal {
               totals[k] += datain.getShort() * percent;
             }
           }
-          
+
           // calculate the value for the pixels in the 1st and last column
           for( m = lowy_int + 1; m < highy_int; m++ ) {
             left += ysize;
@@ -1137,7 +1137,7 @@ public class ScaleInternal {
             }
           }
         }
-        
+
         // this is for the pixels in the body
         temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
         for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -1156,7 +1156,7 @@ public class ScaleInternal {
           }
           temp0 += ysize;
         }
-        
+
         outindex = ( j + ( i * widthout ) ) * components;
         for( k = 0; k < components; k++ ) {
           dataout.position( outindex + k );
@@ -1188,10 +1188,10 @@ public class ScaleInternal {
       }
     }
   }
-  
+
   public static void scale_internal_uint( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              IntBuffer dataout, int element_size, int ysize, 
+                              ByteBuffer datain, int widthout, int heightout,
+                              IntBuffer dataout, int element_size, int ysize,
                               int group_size, boolean myswap_bytes ) {
     float x, convx;
     float y, convy;
@@ -1200,11 +1200,11 @@ public class ScaleInternal {
     float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
-    
+
     int temp, temp0;
     int temp_index;
     int outindex;
-    
+
     int lowx_int, highx_int, lowy_int, highy_int;
     float x_percent, y_percent;
     float lowx_float, highx_float, lowy_float, highy_float;
@@ -1212,9 +1212,9 @@ public class ScaleInternal {
     int convy_int, convx_int;
     int l, m;
     int left, right;
-    
+
     if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_uint( components, widthin, heightin, datain, dataout, 
+      HalveImage.halveImage_uint( components, widthin, heightin, datain, dataout,
                         element_size, ysize, group_size, myswap_bytes );
       return;
     }
@@ -1224,14 +1224,14 @@ public class ScaleInternal {
     convy_float = convy - convy_int;
     convx_int = (int)Math.floor( convx );
     convx_float = convx - convx_int;
-    
+
     area = convx * convy;
-    
+
     lowy_int = 0;
     lowy_float = 0.0f;
     highy_int = convy_int;
     highy_float = convy_float;
-    
+
     for( i = 0; i < heightout; i++ ) {
       // Clamp here to be sure we don't read beyond input buffer.
       if (highy_int >= heightin)
@@ -1247,18 +1247,18 @@ public class ScaleInternal {
         highx_int = convx_int;
         highx_float = convx_float;
       }
-      
+
       for( j = 0; j < widthout; j++ ) {
-        
+
         // Ok, now apply box filter to box that goes from (lowx, lowy)
         // to (highx, highy) on input data into this pixel on output
         // data.
         totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
+
         // caulate the value for pixels in the 1st row
         xindex = lowx_int * group_size;
         if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
+
           y_percent = 1 - lowy_float;
           temp = xindex + lowy_int * ysize;
           percent = y_percent * ( 1 - lowx_float );
@@ -1293,7 +1293,7 @@ public class ScaleInternal {
               totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
             }
           }
-          
+
           // calculate the value for pixels in the last row
           y_percent = highy_float;
           percent = y_percent * ( 1 - lowx_float );
@@ -1327,7 +1327,7 @@ public class ScaleInternal {
               totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
             }
           }
-          
+
           // calculate the value for the pixels in the 1st and last column
           for( m = lowy_int + 1; m < highy_int; m++ ) {
             left += ysize;
@@ -1427,7 +1427,7 @@ public class ScaleInternal {
             }
           }
         }
-        
+
         // this is for the pixels in the body
         temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
         for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -1445,7 +1445,7 @@ public class ScaleInternal {
           }
           temp0 += ysize;
         }
-        
+
         outindex = ( j + ( i * widthout ) ) * components;
         float value = 0.0f;
         for( k = 0; k < components; k++ ) {
@@ -1483,10 +1483,10 @@ public class ScaleInternal {
       }
     }
   }
-  
+
   public static void scale_internal_int( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              IntBuffer dataout, int element_size, int ysize, 
+                              ByteBuffer datain, int widthout, int heightout,
+                              IntBuffer dataout, int element_size, int ysize,
                               int group_size, boolean myswap_bytes ) {
     float x, convx;
     float y, convy;
@@ -1495,11 +1495,11 @@ public class ScaleInternal {
     float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
-    
+
     int temp, temp0;
     int temp_index;
     int outindex;
-    
+
     int lowx_int, highx_int, lowy_int, highy_int;
     float x_percent, y_percent;
     float lowx_float, highx_float, lowy_float, highy_float;
@@ -1507,11 +1507,11 @@ public class ScaleInternal {
     int convy_int, convx_int;
     int l, m;
     int left, right;
-    
+
     long swapbuf; // unsigned buffer
-    
+
     if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_int( components, widthin, heightin, datain, dataout, 
+      HalveImage.halveImage_int( components, widthin, heightin, datain, dataout,
                         element_size, ysize, group_size, myswap_bytes );
       return;
     }
@@ -1521,14 +1521,14 @@ public class ScaleInternal {
     convy_float = convy - convy_int;
     convx_int = (int)Math.floor( convx );
     convx_float = convx - convx_int;
-    
+
     area = convx * convy;
-    
+
     lowy_int = 0;
     lowy_float = 0.0f;
     highy_int = convy_int;
     highy_float = convy_float;
-    
+
     for( i = 0; i < heightout; i++ ) {
       // Clamp here to be sure we don't read beyond input buffer.
       if (highy_int >= heightin)
@@ -1544,18 +1544,18 @@ public class ScaleInternal {
         highx_int = convx_int;
         highx_float = convx_float;
       }
-      
+
       for( j = 0; j < widthout; j++ ) {
-        
+
         // Ok, now apply box filter to box that goes from (lowx, lowy)
         // to (highx, highy) on input data into this pixel on output
         // data.
         totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
+
         // caulate the value for pixels in the 1st row
         xindex = lowx_int * group_size;
         if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
+
           y_percent = 1 - lowy_float;
           temp = xindex + lowy_int * ysize;
           percent = y_percent * ( 1 - lowx_float );
@@ -1593,7 +1593,7 @@ public class ScaleInternal {
               totals[k] += datain.getInt() * percent;
             }
           }
-          
+
           // calculate the value for pixels in the last row
           y_percent = highy_float;
           percent = y_percent * ( 1 - lowx_float );
@@ -1630,7 +1630,7 @@ public class ScaleInternal {
               totals[k] += datain.getInt() * percent;
             }
           }
-          
+
           // calculate the value for the pixels in the 1st and last column
           for( m = lowy_int + 1; m < highy_int; m++ ) {
             left += ysize;
@@ -1736,7 +1736,7 @@ public class ScaleInternal {
             }
           }
         }
-        
+
         // this is for the pixels in the body
         temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
         for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -1755,7 +1755,7 @@ public class ScaleInternal {
           }
           temp0 += ysize;
         }
-        
+
         outindex = ( j + ( i * widthout ) ) * components;
         for( k = 0; k < components; k++ ) {
           dataout.position( outindex + k );
@@ -1787,10 +1787,10 @@ public class ScaleInternal {
       }
     }
   }
-  
+
   public static void scale_internal_float( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              FloatBuffer dataout, int element_size, int ysize, 
+                              ByteBuffer datain, int widthout, int heightout,
+                              FloatBuffer dataout, int element_size, int ysize,
                               int group_size, boolean myswap_bytes ) {
     float x, convx;
     float y, convy;
@@ -1799,11 +1799,11 @@ public class ScaleInternal {
     float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
-    
+
     int temp, temp0;
     int temp_index;
     int outindex;
-    
+
     int lowx_int, highx_int, lowy_int, highy_int;
     float x_percent, y_percent;
     float lowx_float, highx_float, lowy_float, highy_float;
@@ -1811,11 +1811,11 @@ public class ScaleInternal {
     int convy_int, convx_int;
     int l, m;
     int left, right;
-    
+
     float swapbuf; // unsigned buffer
-    
+
     if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_float( components, widthin, heightin, datain, dataout, 
+      HalveImage.halveImage_float( components, widthin, heightin, datain, dataout,
                         element_size, ysize, group_size, myswap_bytes );
       return;
     }
@@ -1825,14 +1825,14 @@ public class ScaleInternal {
     convy_float = convy - convy_int;
     convx_int = (int)Math.floor( convx );
     convx_float = convx - convx_int;
-    
+
     area = convx * convy;
-    
+
     lowy_int = 0;
     lowy_float = 0.0f;
     highy_int = convy_int;
     highy_float = convy_float;
-    
+
     for( i = 0; i < heightout; i++ ) {
       // Clamp here to be sure we don't read beyond input buffer.
       if (highy_int >= heightin)
@@ -1848,18 +1848,18 @@ public class ScaleInternal {
         highx_int = convx_int;
         highx_float = convx_float;
       }
-      
+
       for( j = 0; j < widthout; j++ ) {
-        
+
         // Ok, now apply box filter to box that goes from (lowx, lowy)
         // to (highx, highy) on input data into this pixel on output
         // data.
         totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
+
         // caulate the value for pixels in the 1st row
         xindex = lowx_int * group_size;
         if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
+
           y_percent = 1 - lowy_float;
           temp = xindex + lowy_int * ysize;
           percent = y_percent * ( 1 - lowx_float );
@@ -1897,7 +1897,7 @@ public class ScaleInternal {
               totals[k] += datain.getFloat() * percent;
             }
           }
-          
+
           // calculate the value for pixels in the last row
           y_percent = highy_float;
           percent = y_percent * ( 1 - lowx_float );
@@ -1934,7 +1934,7 @@ public class ScaleInternal {
               totals[k] += datain.getFloat() * percent;
             }
           }
-          
+
           // calculate the value for the pixels in the 1st and last column
           for( m = lowy_int + 1; m < highy_int; m++ ) {
             left += ysize;
@@ -2040,7 +2040,7 @@ public class ScaleInternal {
             }
           }
         }
-        
+
         // this is for the pixels in the body
         temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
         for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -2059,7 +2059,7 @@ public class ScaleInternal {
           }
           temp0 += ysize;
         }
-        
+
         outindex = ( j + ( i * widthout ) ) * components;
         for( k = 0; k < components; k++ ) {
           dataout.position( outindex + k );
@@ -2091,28 +2091,28 @@ public class ScaleInternal {
       }
     }
   }
-  
-  public static void scaleInternalPackedPixel( int components, Extract extract, 
+
+  public static void scaleInternalPackedPixel( int components, Extract extract,
               int widthIn, int heightIn, ByteBuffer dataIn, int widthOut,
               int heightOut, ByteBuffer dataOut, int pixelSizeInBytes,
               int rowSizeInBytes, boolean isSwap ) {
     float x, convx;
     float y, convy;
     float percent;
-    
+
     // max components in a format is 4, so
     float[] totals = new float[4];
     float[] extractTotals = new float[4];
     float[] extractMoreTotals = new float[4];
     float[] shoveTotals = new float[4];
-    
+
     float area;
     int i, j, k, xindex;
-    
+
     int temp, temp0;
     int temp_index;
     int outIndex = 0;
-    
+
     int lowx_int, highx_int, lowy_int, highy_int;
     float x_percent, y_percent;
     float lowx_float, highx_float, lowy_float, highy_float;
@@ -2120,7 +2120,7 @@ public class ScaleInternal {
     int convy_int, convx_int;
     int l, m;
     int left, right;
-    
+
     if( widthIn == widthOut * 2 && heightIn == heightOut * 2 ) {
       HalveImage.halveImagePackedPixel( components, extract, widthIn, heightIn, dataIn, dataOut,
                               pixelSizeInBytes, rowSizeInBytes, isSwap );
@@ -2132,14 +2132,14 @@ public class ScaleInternal {
     convy_float = convy - convy_int;
     convx_int = (int)Math.floor( convx );
     convx_float = convx - convx_int;
-    
+
     area = convx * convy;
-    
+
     lowy_int = 0;
     lowy_float = 0.0f;
     highy_int = convy_int;
     highy_float = convx_float;
-    
+
     for( i = 0; i < heightOut; i++ ) {
       // Clamp here to be sure we don't read beyond input buffer.
       if (highy_int >= heightIn)
@@ -2148,16 +2148,16 @@ public class ScaleInternal {
       lowx_float = 0.0f;
       highx_int = convx_int;
       highx_float = convx_float;
-      
+
       for( j = 0; j < widthOut; j++ ) {
         // ok now apply box filter to box that goes from( lowx, lowy )
         // to ( highx, highy ) on input data into this pixel on output data
         totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
+
         // calculate that value for pixels in the 1st row
         xindex = lowx_int * pixelSizeInBytes;
         if( (highy_int > lowy_int) && (highx_int > lowx_int) ) {
-          
+
           y_percent = 1 - lowy_float;
           temp = xindex + lowy_int * rowSizeInBytes;
           percent = y_percent * ( 1 - lowx_float );
@@ -2184,7 +2184,7 @@ public class ScaleInternal {
             totals[k] += extractTotals[k] * percent;
           }
           // calculate the value for pixels in the last row
-          
+
           y_percent = highy_float;
           percent = y_percent * ( 1 - lowx_float );
           temp = xindex + highy_int * rowSizeInBytes;
@@ -2207,7 +2207,7 @@ public class ScaleInternal {
           for( k = 0; k < components; k++ ) {
             totals[k] += extractTotals[k] * percent;
           }
-          
+
           // calculate the value for pixels in the 1st and last column
           for( m = lowy_int + 1; m < highy_int; m++ ) {
             left += rowSizeInBytes;
@@ -2277,7 +2277,7 @@ public class ScaleInternal {
             totals[k] += extractTotals[k] * percent;
           }
         }
-        
+
         // this is for the pixels in the body
         temp0 = xindex + pixelSizeInBytes + ( lowy_int + 1 ) * rowSizeInBytes;
         for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -2292,7 +2292,7 @@ public class ScaleInternal {
           }
           temp0 += rowSizeInBytes;
         }
-        
+
         outIndex = ( j + ( i * widthOut ) );
         for( k = 0; k < components; k++ ) {
           shoveTotals[k] = totals[k] / area;
@@ -2325,7 +2325,7 @@ public class ScaleInternal {
     }
     assert( outIndex == ( widthOut * heightOut - 1) );
   }
-  
+
   public static void scaleInternal3D( int components, int widthIn, int heightIn,
           int depthIn, ShortBuffer dataIn, int widthOut, int heightOut,
           int depthOut, ShortBuffer dataOut ) {
@@ -2339,9 +2339,9 @@ public class ScaleInternal {
     float volume;
     int i, j, d, k, zint, yint, xint, xindex, yindex, zindex;
     int temp;
-    
+
     lowy = highy = lowx = highx = 0.0f;
-    
+
     convz = (float)depthIn / depthOut;
     convy = (float)heightIn / heightOut;
     convx = (float)widthIn / widthOut;
@@ -2375,13 +2375,13 @@ public class ScaleInternal {
             highz = x + 0.5f;
             lowz = x - 0.5f;
           }
-          
+
           // Ok, now apply box filter to box that goes from ( lowx, lowy, lowz )
           // to ( highx, highy, highz ) on input data into this pixel on output data
-          
+
           totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
           volume = 0.0f;
-          
+
           z = lowz;
           zint = (int)(Math.floor( z ) );
           while( z < highz ) {
@@ -2391,7 +2391,7 @@ public class ScaleInternal {
             } else {
               zpercent = zint + 1 - z;
             }
-            
+
             y = lowy;
             yint = (int)(Math.floor( y ) );
             while( y < highy ) {
@@ -2401,10 +2401,10 @@ public class ScaleInternal {
               } else {
                 ypercent = yint + 1 - y;
               }
-              
+
               x = lowx;
               xint = (int)(Math.floor( x ) );
-              
+
               while( x < highx ) {
                 xindex = (xint + widthIn ) % widthIn;
                 if( highx < xint + 1 ) {
@@ -2412,10 +2412,10 @@ public class ScaleInternal {
                 } else {
                   xpercent = xint + 1 - x;
                 }
-                
+
                 percent = xpercent * ypercent * zpercent;
                 volume += percent;
-                
+
                 temp = (xindex + ( yindex *widthIn) + (zindex * widthIn *heightIn)) * components;
                 for( k = 0; k < components; k++ ) {
                   assert( 0 <= (temp+k) && (temp+k) < (widthIn * heightIn * depthIn * components) );
@@ -2430,7 +2430,7 @@ public class ScaleInternal {
             zint++;
             z = zint;
           } // while z
-          
+
           temp = ( j + ( i * widthOut ) + (d * widthOut * heightOut ) ) * components;
           for( k = 0; k < components; k++ ) {
             // totals should be rounded in the case of enlarging an rgb ramp when the type is 332 or 4444
@@ -2441,48 +2441,48 @@ public class ScaleInternal {
       }
     }
   }
-  
-  public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn, 
-          int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut, 
+
+  public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn,
+          int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut,
           int depthOut, int typeOut, ByteBuffer dataOut ) {
     int components;
     ShortBuffer beforeImage, afterImage;
     PixelStorageModes psm = new PixelStorageModes();
-    
+
     if( widthIn == 0 || heightIn == 0 || depthIn == 0 ||
             widthOut == 0 || heightOut == 0 || depthOut == 0 ) {
       return( 0 );
     }
-    
+
     if( widthIn < 0 || heightIn < 0 || depthIn < 0 ||
             widthOut < 0 || heightOut < 0 || depthOut < 0 ) {
       return( GLU.GLU_INVALID_VALUE );
     }
-    
-    if( !Mipmap.legalFormat(format) || !Mipmap.legalType(typeIn) || 
+
+    if( !Mipmap.legalFormat(format) || !Mipmap.legalType(typeIn) ||
             !Mipmap.legalType(typeOut) || typeIn == GL2.GL_BITMAP ||
             typeOut == GL2.GL_BITMAP ) {
       return( GLU.GLU_INVALID_ENUM );
     }
-    
+
     if( !Mipmap.isLegalFormatForPackedPixelType( format, typeIn ) ) {
       return( GLU.GLU_INVALID_OPERATION );
     }
-    
+
     if( !Mipmap.isLegalFormatForPackedPixelType( format, typeOut ) ) {
       return( GLU.GLU_INVALID_OPERATION );
     }
-    
+
     try {
-        beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn, 
+        beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
                 heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
-        afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn, 
+        afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
                 heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
     } catch( OutOfMemoryError err ) {
       return( GLU.GLU_OUT_OF_MEMORY );
     }
     Mipmap.retrieveStoreModes3D( gl, psm );
-    
+
     Image.fillImage3D( psm, widthIn, heightIn, depthIn, format, typeIn,
             Mipmap.is_index( format ), dataIn, beforeImage );
     components = Mipmap.elements_per_group( format, 0 );
@@ -2490,7 +2490,7 @@ public class ScaleInternal {
             beforeImage, widthOut, heightOut, depthOut, afterImage );
     Image.emptyImage3D( psm, widthOut, heightOut, depthOut, format, typeOut,
             Mipmap.is_index( format ), afterImage, dataOut );
-    
+
     return( 0 );
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
index 38113f601..dc401880d 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,176 +51,176 @@ import java.nio.*;
  * @author  Administrator
  */
 public class Type_Widget {
-  
+
   ByteBuffer buffer;
-  
+
   /** Creates a new instance of Type_Widget */
   public Type_Widget() {
     // can't make this direct, because JVM doesn't allocate small direct buffers efficiently
     // see https://jogamp.org/bugzilla/show_bug.cgi?id=463 for details
     buffer = ByteBuffer.allocate( 4 );
   }
-  
+
   public void setUB0( byte b ) {
     buffer.position( 0 );
     buffer.put( b );
   }
-  
+
   public byte getUB0() {
     buffer.position( 0 );
     return( buffer.get() );
   }
-  
+
   public void setUB1( byte b ) {
     buffer.position( 1 );
     buffer.put( b );
   }
-  
+
   public byte getUB1() {
     buffer.position( 1 );
     return( buffer.get() );
   }
-  
+
   public void setUB2( byte b ) {
     buffer.position( 2 );
     buffer.put( b );
   }
-  
+
   public byte getUB2() {
     buffer.position( 2 );
     return( buffer.get() );
   }
-  
+
   public void setUB3( byte b ) {
     buffer.position( 3 );
     buffer.put( b );
   }
-  
+
   public byte getUB3() {
     buffer.position( 3 );
     return( buffer.get() );
   }
-  
+
   public void setUS0( short s ) {
     buffer.position( 0 );
     buffer.putShort( s );
   }
-  
+
   public short getUS0() {
     buffer.position( 0 );
     return( buffer.getShort() );
   }
-  
+
   public void setUS1( short s ) {
     buffer.position( 2 );
     buffer.putShort( s );
   }
-  
+
   public short getUS1() {
    buffer.position( 2 );
    return( buffer.getShort() );
   }
-  
+
   public void setUI( int i ) {
     buffer.position( 0 );
     buffer.putInt( i );
   }
-  
+
   public int getUI() {
     buffer.position( 0 );
     return( buffer.getInt() );
   }
-  
+
   public void setB0( byte b ) {
     buffer.position( 0 );
     buffer.put( b );
   }
-  
+
   public byte getB0() {
     buffer.position( 0 );
     return( buffer.get() );
   }
-  
+
   public void setB1( byte b ) {
     buffer.position( 1 );
     buffer.put( b );
   }
-  
+
   public byte getB1() {
     buffer.position( 1 );
     return( buffer.get() );
   }
-  
+
   public void setB2( byte b ) {
     buffer.position( 2 );
     buffer.put( b );
   }
-  
+
   public byte getB2() {
     buffer.position( 2 );
     return( buffer.get() );
   }
-  
+
   public void setB3( byte b ) {
     buffer.position( 3 );
     buffer.put( b );
   }
-  
+
   public byte getB3() {
     buffer.position( 3 );
     return( buffer.get() );
   }
-  
+
   public void setS0( short s ) {
     buffer.position( 0 );
     buffer.putShort( s );
   }
-  
+
   public short getS0() {
     buffer.position( 0 );
     return( buffer.getShort() );
   }
-  
+
   public void setS1( short s ) {
     buffer.position( 2 );
     buffer.putShort( s );
   }
-  
+
   public short getS1() {
     buffer.position( 2 );
     return( buffer.getShort() );
   }
-  
+
   public void setI( int i ) {
     buffer.position( 0 );
     buffer.putInt( i );
   }
-  
+
   public int getI() {
     buffer.position( 0 );
     return( buffer.getInt() );
   }
-  
+
   public void setF( float f ) {
     buffer.position( 0 );
     buffer.putFloat( f );
   }
-  
+
   public float getF() {
     buffer.position( 0 );
     return( buffer.getFloat() );
   }
-  
+
   public ByteBuffer getBuffer() {
     buffer.rewind();
     return( buffer );
   }
-  
+
   public static void main( String args[] ) {
     Type_Widget t = new Type_Widget();
     t.setI( 1000000 );
-    
+
     System.out.println("int: " + Integer.toHexString( t.getI() ) );
-    
+
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
index 422f8d4df..df2b9a147 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
@@ -72,7 +72,7 @@ public class Arc {
 
   /**
    * Makes new arc at specified side
-   * 
+   *
    * @param side
    *            which side doeas this arc form
    */
@@ -86,7 +86,7 @@ public class Arc {
 
   /**
    * Sets side the arc is at
-   * 
+   *
    * @param side
    *            arc side
    */
@@ -104,7 +104,7 @@ public class Arc {
     type &= ~(0x7 << 8);
   }
 
-  // this one replaces enum arc_side 
+  // this one replaces enum arc_side
   /**
    * Side not specified
    */
@@ -147,7 +147,7 @@ public class Arc {
 
   /**
    * Appends arc to the list
-   * 
+   *
    * @param jarc
    *            arc to be append
    * @return this
@@ -169,7 +169,7 @@ public class Arc {
 
   /**
    * Unused
-   * 
+   *
    * @return true
    */
   public boolean check() {
@@ -187,7 +187,7 @@ public class Arc {
 
   /**
    * Returns tail of linked list coords
-   * 
+   *
    * @return tail coords
    */
   public float[] tail() {
@@ -197,7 +197,7 @@ public class Arc {
 
   /**
    * Returns head of linked list coords
-   * 
+   *
    * @return head coords
    */
   public float[] head() {
@@ -207,7 +207,7 @@ public class Arc {
 
   /**
    * Returns whether arc is marked with arc_tag
-   * 
+   *
    * @return is arc marked with arc_tag
    */
   public boolean ismarked() {
@@ -241,7 +241,7 @@ public class Arc {
 
   /**
    * Returns whether arc is marked tail
-   * 
+   *
    * @return is tail
    */
   public boolean getitail() {
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
index f4ad70193..c299b10af 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
@@ -44,7 +44,7 @@ public class ArcSdirSorter {
   /**
    * Makes new ArcSdirSorter with Subdivider
    * @param subdivider subdivider
-   */ 
+   */
   public ArcSdirSorter(Subdivider subdivider) {
     //TODO
     //            System.out.println("TODO arcsdirsorter.constructor");
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
index be72c53d2..1a584c396 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
@@ -43,7 +43,7 @@ public class ArcTdirSorter {
   /**
    * Makes new ArcSdirSorter with Subdivider
    * @param subdivider subdivider
-   */ 
+   */
   public ArcTdirSorter(Subdivider subdivider) {
     // TODO Auto-generated constructor stub
     //            System.out.println("TODO arcTsorter.konstruktor");
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
index 610a19556..3e974247b 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
@@ -67,7 +67,7 @@ public abstract class Backend {
   protected SurfaceEvaluator surfaceEvaluator;
 
   /**
-   * Makes new backend 
+   * Makes new backend
    */
   public Backend() {
     // curveEvaluator = new OpenGLCurveEvaluator();
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
index df8b16ab5..17437ef01 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
@@ -143,7 +143,7 @@ public class Bin {
   /**
    * Returns next arc in linked list
    * @return next arc
-   * 
+   *
    */
   private Arc nextarc() {
     // DONE
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
index f45571dac..f84640d28 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
 
 /**
  * Class holding break point parameters
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class Breakpt {
 
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
index aaa8cb5f2..b67764c30 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
 
 /**
  * Class replacing C language pointer
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class CArrayOfArcs {
   /**
@@ -24,7 +24,7 @@ public class CArrayOfArcs {
 
   /**
    * Makes new CArray
-   * 
+   *
    * @param array
    *            underlaying array
    * @param pointer
@@ -38,7 +38,7 @@ public class CArrayOfArcs {
 
   /**
    * Makes new CArray from other CArray
-   * 
+   *
    * @param carray
    *            reference array
    */
@@ -50,7 +50,7 @@ public class CArrayOfArcs {
 
   /**
    * Makes new CArray with pointer set to 0
-   * 
+   *
    * @param ctlarray
    *            underlaying array
    */
@@ -61,7 +61,7 @@ public class CArrayOfArcs {
 
   /**
    * Returns element at pointer
-   * 
+   *
    * @return element at pointer
    */
   public Arc get() {
@@ -78,7 +78,7 @@ public class CArrayOfArcs {
 
   /**
    * Sets element at pointer
-   * 
+   *
    * @param f
    *            desired value
    */
@@ -89,7 +89,7 @@ public class CArrayOfArcs {
 
   /**
    * Returns array element at specified index
-   * 
+   *
    * @param i
    *            array index
    * @return element at index
@@ -100,7 +100,7 @@ public class CArrayOfArcs {
 
   /**
    * Returns array element at specified index relatively to pointer
-   * 
+   *
    * @param i
    *            relative index
    * @return element at relative index
@@ -111,7 +111,7 @@ public class CArrayOfArcs {
 
   /**
    * Sets value of element at specified index relatively to pointer
-   * 
+   *
    * @param i
    *            relative index
    * @param value
@@ -123,7 +123,7 @@ public class CArrayOfArcs {
 
   /**
    * Lessens pointer by value
-   * 
+   *
    * @param i
    *            lessen by
    */
@@ -134,7 +134,7 @@ public class CArrayOfArcs {
 
   /**
    * Returns pointer value
-   * 
+   *
    * @return pointer value
    */
   public int getPointer() {
@@ -143,7 +143,7 @@ public class CArrayOfArcs {
 
   /**
    * Sets ponter value
-   * 
+   *
    * @param pointer
    *            pointer value to be set
    */
@@ -156,7 +156,7 @@ public class CArrayOfArcs {
 
   /**
    * Raises pointer by value
-   * 
+   *
    * @param i
    *            raise by
    */
@@ -175,7 +175,7 @@ public class CArrayOfArcs {
 
   /**
    * Returns underlaying array
-   * 
+   *
    * @return underlaying array
    */
   public Arc[] getArray() {
@@ -184,7 +184,7 @@ public class CArrayOfArcs {
 
   /**
    * Sets underlaying array
-   * 
+   *
    * @param array
    *            underlaying array
    */
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
index 5112b07fc..b5f588960 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
 
 /**
  * Class replacing C language pointer
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class CArrayOfBreakpts {
   /**
@@ -19,7 +19,7 @@ public class CArrayOfBreakpts {
 
   /**
    * Makes new CArray
-   * 
+   *
    * @param array
    *            underlaying array
    * @param pointer
@@ -32,7 +32,7 @@ public class CArrayOfBreakpts {
 
   /**
    * Makes new CArray from other CArray
-   * 
+   *
    * @param carray
    *            reference array
    */
@@ -43,7 +43,7 @@ public class CArrayOfBreakpts {
 
   /**
    * Returns element at pointer
-   * 
+   *
    * @return element at pointer
    */
   public Breakpt get() {
@@ -59,7 +59,7 @@ public class CArrayOfBreakpts {
 
   /**
    * Sets element at pointer
-   * 
+   *
    * @param f
    *            desired value
    */
@@ -70,7 +70,7 @@ public class CArrayOfBreakpts {
 
   /**
    * Returns array element at specified index
-   * 
+   *
    * @param i
    *            array index
    * @return element at index
@@ -81,7 +81,7 @@ public class CArrayOfBreakpts {
 
   /**
    * Lessens pointer by value
-   * 
+   *
    * @param i
    *            lessen by
    */
@@ -92,7 +92,7 @@ public class CArrayOfBreakpts {
 
   /**
    * Returns pointer value
-   * 
+   *
    * @return pointer value
    */
   public int getPointer() {
@@ -101,7 +101,7 @@ public class CArrayOfBreakpts {
 
   /**
    * Sets ponter value
-   * 
+   *
    * @param pointer
    *            pointer value to be set
    */
@@ -111,7 +111,7 @@ public class CArrayOfBreakpts {
 
   /**
    * Raises pointer by value
-   * 
+   *
    * @param i
    *            raise by
    */
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
index 39ef841ec..d9e4d0ff1 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
 
 /**
  * Class replacing C language pointer
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class CArrayOfFloats {
 
@@ -25,7 +25,7 @@ public class CArrayOfFloats {
 
   /**
    * Makes new CArray
-   * 
+   *
    * @param array
    *            underlaying array
    * @param pointer
@@ -39,7 +39,7 @@ public class CArrayOfFloats {
 
   /**
    * Makes new CArray from other CArray
-   * 
+   *
    * @param carray
    *            reference array
    */
@@ -51,7 +51,7 @@ public class CArrayOfFloats {
 
   /**
    * Makes new CArray with pointer set to 0
-   * 
+   *
    * @param ctlarray
    *            underlaying array
    */
@@ -62,7 +62,7 @@ public class CArrayOfFloats {
 
   /**
    * Returns element at pointer
-   * 
+   *
    * @return element at pointer
    */
   public float get() {
@@ -79,7 +79,7 @@ public class CArrayOfFloats {
 
   /**
    * Sets element at pointer
-   * 
+   *
    * @param f
    *            desired value
    */
@@ -90,7 +90,7 @@ public class CArrayOfFloats {
 
   /**
    * Returns array element at specified index
-   * 
+   *
    * @param i
    *            array index
    * @return element at index
@@ -101,7 +101,7 @@ public class CArrayOfFloats {
 
   /**
    * Returns array element at specified index relatively to pointer
-   * 
+   *
    * @param i
    *            relative index
    * @return element at relative index
@@ -112,7 +112,7 @@ public class CArrayOfFloats {
 
   /**
    * Sets value of element at specified index relatively to pointer
-   * 
+   *
    * @param i
    *            relative index
    * @param value
@@ -124,7 +124,7 @@ public class CArrayOfFloats {
 
   /**
    * Lessens pointer by value
-   * 
+   *
    * @param i
    *            lessen by
    */
@@ -135,7 +135,7 @@ public class CArrayOfFloats {
 
   /**
    * Returns pointer value
-   * 
+   *
    * @return pointer value
    */
   public int getPointer() {
@@ -144,7 +144,7 @@ public class CArrayOfFloats {
 
   /**
    * Sets ponter value
-   * 
+   *
    * @param pointer
    *            pointer value to be set
    */
@@ -157,7 +157,7 @@ public class CArrayOfFloats {
 
   /**
    * Raises pointer by value
-   * 
+   *
    * @param i
    *            raise by
    */
@@ -176,7 +176,7 @@ public class CArrayOfFloats {
 
   /**
    * Returns underlaying array
-   * 
+   *
    * @return underlaying array
    */
   public float[] getArray() {
@@ -185,7 +185,7 @@ public class CArrayOfFloats {
 
   /**
    * Sets underlaying array
-   * 
+   *
    * @param array
    *            underlaying array
    */
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
index 4b21f2d50..e7bbac16a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
 
 /**
  * Class replacing C language pointer
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class CArrayOfQuiltspecs {
   /**
@@ -19,7 +19,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Makes new CArray
-   * 
+   *
    * @param array
    *            underlaying array
    * @param pointer
@@ -32,7 +32,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Makes new CArray from other CArray
-   * 
+   *
    * @param carray
    *            reference array
    */
@@ -43,7 +43,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Makes new CArray with pointer set to 0
-   * 
+   *
    * @param array
    *            underlaying array
    */
@@ -54,7 +54,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Returns element at pointer
-   * 
+   *
    * @return element at pointer
    */
   public Quiltspec get() {
@@ -70,7 +70,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Sets element at pointer
-   * 
+   *
    * @param f
    *            desired value
    */
@@ -81,7 +81,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Returns array element at specified index
-   * 
+   *
    * @param i
    *            array index
    * @return element at index
@@ -92,7 +92,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Lessens pointer by value
-   * 
+   *
    * @param i
    *            lessen by
    */
@@ -103,7 +103,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Returns pointer value
-   * 
+   *
    * @return pointer value
    */
   public int getPointer() {
@@ -112,7 +112,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Sets ponter value
-   * 
+   *
    * @param pointer
    *            pointer value to be set
    */
@@ -122,7 +122,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Raises pointer by value
-   * 
+   *
    * @param i
    *            raise by
    */
@@ -141,7 +141,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Returns underlaying array
-   * 
+   *
    * @return underlaying array
    */
   public Quiltspec[] getArray() {
@@ -150,7 +150,7 @@ public class CArrayOfQuiltspecs {
 
   /**
    * Sets underlaying array
-   * 
+   *
    * @param array
    *            underlaying array
    */
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
index 786781723..ea3a3d14e 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
@@ -103,7 +103,7 @@ public class Curve {
 
   /**
    * Makes new Curve
-   * 
+   *
    * @param geo
    * @param pta
    * @param ptb
@@ -143,7 +143,7 @@ public class Curve {
     range[0] = qs.get().breakpoints[qs.get().index];
     range[1] = qs.get().breakpoints[qs.get().index + 1];
     range[2] = range[1] - range[0];
-    // TODO it is necessary to solve problem with "this" pointer here 
+    // TODO it is necessary to solve problem with "this" pointer here
     if (range[0] != pta[0]) {
       //                System.out.println("TODO curve.Curve-range0");
       // Curve lower=new Curve(this,pta,0);
@@ -229,7 +229,7 @@ public class Curve {
 
   /**
    * Tells whether curve needs subdivision
-   * 
+   *
    * @return curve needs subdivison
    */
   public boolean needsSamplingSubdivision() {
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
index 6983691d9..f9c4c2d6f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
@@ -45,12 +45,12 @@ public class Flist {
 
   /**
    * Data elements end index
-   * 
+   *
    */
   public int end;
 
   /**
-   *Data elements start index 
+   *Data elements start index
    */
   public int start;
 
@@ -80,7 +80,7 @@ public class Flist {
   }
 
   /**
-   * Removes duplicate array elemnts 
+   * Removes duplicate array elemnts
    */
   public void filter() {
     // INFO the aim of this method is to remove duplicates from array
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
index 114832a1c..1dcf393a9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
 
 /**
  * Knot vector specification
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class Knotspec {
 
@@ -314,7 +314,7 @@ public class Knotspec {
 
   /**
    * Copies control points
-   * 
+   *
    * @param _inpt
    *            input control points
    * @param _outpt
@@ -346,7 +346,7 @@ public class Knotspec {
 
   /**
    * Copies one control point to other
-   * 
+   *
    * @param topt
    *            source control point
    * @param frompt
@@ -374,7 +374,7 @@ public class Knotspec {
 
   /**
    * Inserts a knot
-   * 
+   *
    * @param _p
    *            inserted knot
    */
@@ -402,7 +402,7 @@ public class Knotspec {
         }
       }
 
-    } else {//code for curve 
+    } else {//code for curve
       if (this.equals(kspectotrans)) {
         insert(p);
       } else {
@@ -428,7 +428,7 @@ public class Knotspec {
 
   /**
    * Inserts a knot and computes new control points
-   * 
+   *
    * @param p
    *            inserted knot
    */
@@ -490,7 +490,7 @@ public class Knotspec {
 
   /**
    * Copies one control point to another
-   * 
+   *
    * @param topt
    *            source ctrl point
    * @param frompt
@@ -519,7 +519,7 @@ public class Knotspec {
 
   /**
    * Computes new control point
-   * 
+   *
    * @param x
    *            first point
    * @param y
@@ -549,7 +549,7 @@ public class Knotspec {
                                 * z.getRelative(0)));
       break;
     default:
-      //no need of default - see previous method and its case statement                
+      //no need of default - see previous method and its case statement
       //                System.out.println("TODO pt_oo_sum default");
       break;
     }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
index aac4dfc52..571f44f06 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
 
 /**
  * Knot vector used in curve specification
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class Knotvector {
 
@@ -75,7 +75,7 @@ public class Knotvector {
 
   /**
    * Makes new knotvector
-   * 
+   *
    * @param nknots
    *            number of knots
    * @param stride
@@ -92,7 +92,7 @@ public class Knotvector {
 
   /**
    * Initializes knotvector
-   * 
+   *
    * @param nknots
    *            number of knots
    * @param stride
@@ -116,7 +116,7 @@ public class Knotvector {
 
   /**
    * Validates knot vector parameters
-   * 
+   *
    * @return knot vector validity
    */
   public int validate() {
@@ -154,7 +154,7 @@ public class Knotvector {
 
   /**
    * Show specified message
-   * 
+   *
    * @param msg
    *            message to be shown
    */
@@ -166,7 +166,7 @@ public class Knotvector {
 
   /**
    * Compares two knots for equality
-   * 
+   *
    * @param a
    *            first knot
    * @param b
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
index bd5d2db98..86638a827 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
@@ -112,7 +112,7 @@ public class Mapdesc {
   float clampfactor;
 
   /**
-   * Value of N_MINSAVINGS property 
+   * Value of N_MINSAVINGS property
    */
   private float minsavings;
 
@@ -162,7 +162,7 @@ public class Mapdesc {
   private float[] bboxsize;
 
   /**
-   * Makes new mapdesc 
+   * Makes new mapdesc
    * @param type map type
    * @param rational is rational
    * @param ncoords number of control points coords
@@ -318,7 +318,7 @@ public class Mapdesc {
   }
 
   /**
-   * Tells whether map is culling 
+   * Tells whether map is culling
    * @return is map culling
    */
   public boolean isCulling() {
@@ -327,7 +327,7 @@ public class Mapdesc {
   }
 
   /**
-   * Tells whether map is constantly sampling 
+   * Tells whether map is constantly sampling
    * @return is map constant sampling
    */
   public boolean isConstantSampling() {
@@ -335,7 +335,7 @@ public class Mapdesc {
   }
 
   /**
-   * Tells whether map is domain sampling 
+   * Tells whether map is domain sampling
    * @return is map domain sampling
    */
   public boolean isDomainSampling() {
@@ -343,7 +343,7 @@ public class Mapdesc {
   }
 
   /**
-   * Returns property of specified tag value 
+   * Returns property of specified tag value
    * @param tag property tag
    * @return property value
    */
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
index 05c89ebcf..a686da696 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
@@ -68,7 +68,7 @@ public class O_nurbscurve {
 
   /**
    * Makes new O_nurbscurve
-   * @param realType type of curve 
+   * @param realType type of curve
    */
   public O_nurbscurve(int realType) {
     // DONE
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
index f1e499a28..8c2922565 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
@@ -52,7 +52,7 @@ public class Patchlist {
   private Patch patch;
 
   /**
-   * Makes new list of patches 
+   * Makes new list of patches
    * @param quilts list of quilts
    * @param pta low border
    * @param ptb high border
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
index 25b4dc441..79f36ce43 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
 
 /**
  * Class representing property
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class Property {
 
@@ -59,7 +59,7 @@ public class Property {
 
   /**
    * Makes new property with given parameters
-   * 
+   *
    * @param type
    *            property type
    * @param tag
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
index 4729e2421..7c636122f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
@@ -35,7 +35,7 @@ package jogamp.opengl.glu.nurbs;
  */
 
 /**
- * Class holding rendering params 
+ * Class holding rendering params
  * @author Tomas Hrasky
  *
  */
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
index 37774f811..4d8296cca 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
@@ -41,7 +41,7 @@ package jogamp.opengl.glu.nurbs;
  */
 public class Subdivider {
   /**
-   * Cull type 
+   * Cull type
    */
   public static final int CULL_TRIVIAL_REJECT = 0;
 
@@ -76,7 +76,7 @@ public class Subdivider {
   private int subdivisions;
 
   /**
-   * U step when using domain distance sampling 
+   * U step when using domain distance sampling
    */
   private float domain_distance_u_rate;
 
@@ -375,7 +375,7 @@ public class Subdivider {
   }
 
   /**
-   * Sample 
+   * Sample
    * @param source
    * @param patchlist
    * @param subdivisions
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
index e88d69709..1025afb7c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
 
 /**
  * Holds vertex used in trim
- * 
+ *
  * @author Tomas Hrasky
- * 
+ *
  */
 public class TrimVertex {
 
diff --git a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
index 3d669d9bb..9c8523e51 100644
--- a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
+++ b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
@@ -6,15 +6,15 @@
  * this file except in compliance with the License. You may obtain a copy
  * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
+ *
  * http://oss.sgi.com/projects/FreeB
- * 
+ *
  * Note that, as provided in the License, the Software is distributed on an
  * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
+ *
  * NOTE:  The Original Code (as defined below) has been licensed to Sun
  * Microsystems, Inc. ("Sun") under the SGI Free Software License B
  * (Version 1.1), shown above ("SGI License").   Pursuant to Section
@@ -30,7 +30,7 @@
  * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
  * Copyright in any portions created by third parties is as indicated
  * elsewhere herein. All Rights Reserved.
- * 
+ *
  * Additional Notice Provisions: The application programming interfaces
  * established by SGI in conjunction with the Original Code are The
  * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import javax.media.opengl.glu.GLU;
  * @author  Administrator
  */
 public class Registry {
-  
+
   /** Creates a new instance of Registry */
   public Registry() {
   }
-  
+
   public static String gluGetString(int name) {
     if( name == GLU.GLU_VERSION ) {
       return( "1.3" );
@@ -64,7 +64,7 @@ public class Registry {
     }
     return( null );
   }
-  
+
   public static boolean gluCheckExtension( String extName, String extString ) {
     if( extName == null || extString == null ) {
       return( false );
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 0828d1dc3..5cc4003fe 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -80,7 +80,7 @@ import com.jogamp.opengl.util.glsl.ShaderCode;
 import com.jogamp.opengl.util.glsl.ShaderProgram;
 
 public class MacOSXCGLContext extends GLContextImpl
-{  
+{
   // Abstract interface for implementation of this context (either
   // NSOpenGL-based or CGL-based)
   protected interface GLBackendImpl {
@@ -140,13 +140,13 @@ public class MacOSXCGLContext extends GLContextImpl
   }
 
   private static final String shaderBasename = "texture01_xxx";
-  
+
   private static ShaderProgram createCALayerShader(GL3ES3 gl) {
       // Create & Link the shader program
       final ShaderProgram sp = new ShaderProgram();
-      final ShaderCode vp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MacOSXCGLContext.class, 
+      final ShaderCode vp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MacOSXCGLContext.class,
                                               "../../shader", "../../shader/bin", shaderBasename, true);
-      final ShaderCode fp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MacOSXCGLContext.class, 
+      final ShaderCode fp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MacOSXCGLContext.class,
                                               "../../shader", "../../shader/bin", shaderBasename, true);
       vp.defaultShaderCustomization(gl, true, true);
       fp.defaultShaderCustomization(gl, true, true);
@@ -162,7 +162,7 @@ public class MacOSXCGLContext extends GLContextImpl
       pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
       pmvMatrix.glLoadIdentity();
       pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-      pmvMatrix.glLoadIdentity();       
+      pmvMatrix.glLoadIdentity();
       final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
       pmvMatrixUniform.setLocation(gl, sp.program());
       gl.glUniform(pmvMatrixUniform);
@@ -170,8 +170,8 @@ public class MacOSXCGLContext extends GLContextImpl
       sp.useProgram(gl, false);
       return sp;
   }
-      
-  
+
+
   private boolean haveSetOpenGLMode = false;
   private GLBackendType openGLMode = GLBackendType.NSOPENGL;
 
@@ -185,7 +185,7 @@ public class MacOSXCGLContext extends GLContextImpl
 
   private long updateHandle = 0;
   private int lastWidth, lastHeight;
-  
+
   protected MacOSXCGLContext(GLDrawableImpl drawable,
                    GLContext shareWith) {
     super(drawable, shareWith);
@@ -303,7 +303,7 @@ public class MacOSXCGLContext extends GLContextImpl
   @Override
   protected void makeCurrentImpl() throws GLException {
     /** FIXME: won't work w/ special drawables (like FBO) - check for CGL mode regressions!
-     *  
+     *
     if (getOpenGLMode() != ((MacOSXCGLDrawable)drawable).getOpenGLMode()) {
       setOpenGLMode(((MacOSXCGLDrawable)drawable).getOpenGLMode());
     } */
@@ -327,7 +327,7 @@ public class MacOSXCGLContext extends GLContextImpl
         throw new GLException("Error destroying OpenGL Context: "+this);
     }
   }
-  
+
   private final long getUpdateHandle() {
     if( 0 == updateHandle ) {
         lastWidth = -1;
@@ -340,7 +340,7 @@ public class MacOSXCGLContext extends GLContextImpl
             } else {
               incompleteView = false;
             }
-            if(!incompleteView) {        
+            if(!incompleteView) {
                 updateHandle = CGL.updateContextRegister(contextHandle, drawable.getHandle());
                 if(0 == updateHandle) {
                     throw new InternalError("XXX2");
@@ -350,14 +350,14 @@ public class MacOSXCGLContext extends GLContextImpl
     }
     return updateHandle;
   }
-  
+
   private final void releaseUpdateHandle() {
     if ( 0 != updateHandle ) {
         CGL.updateContextUnregister(updateHandle);
         updateHandle = 0;
-    }      
+    }
   }
-  
+
   @Override
   protected void drawableUpdatedNotify() throws GLException {
     if( drawable.getChosenGLCapabilities().isOnscreen() ) {
@@ -376,7 +376,7 @@ public class MacOSXCGLContext extends GLContextImpl
         }
     }
   }
-  
+
   @Override
   protected void associateDrawable(boolean bound) {
       // context stuff depends on drawable stuff
@@ -390,12 +390,12 @@ public class MacOSXCGLContext extends GLContextImpl
           super.associateDrawable(false);  // 2) free drawable stuff
       }
   }
-  
+
   /* pp */ void detachPBuffer() {
       impl.detachPBuffer();
   }
 
-  
+
   @Override
   protected void copyImpl(GLContext source, int mask) throws GLException {
     if( isNSContext() != ((MacOSXCGLContext)source).isNSContext() ) {
@@ -429,7 +429,7 @@ public class MacOSXCGLContext extends GLContextImpl
     // FIXME: apparently the Apple extension doesn't require a custom memory allocator
     throw new GLException("Not yet implemented");
   }
-  
+
   @Override
   protected final void updateGLXProcAddressTable() {
     final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration();
@@ -520,11 +520,11 @@ public class MacOSXCGLContext extends GLContextImpl
       private int lastWidth=0, lastHeight=0; // allowing to detect size change
       private boolean needsSetContextPBuffer = false;
       private ShaderProgram gl3ShaderProgram = null;
-      
+
       @Override
       public boolean isNSContext() { return true; }
 
-      
+
       /** Only returns a valid NSView. If !NSView, return null and mark either pbuffer and FBO. */
       private long getNSViewHandle(boolean[] isPBuffer, boolean[] isFBO) {
           final long nsViewHandle;
@@ -558,11 +558,11 @@ public class MacOSXCGLContext extends GLContextImpl
           needsSetContextPBuffer = isPBuffer[0];
           return nsViewHandle;
       }
-      
+
       @Override
       public long create(long share, int ctp, int major, int minor) {
           long ctx = 0;
-          final NativeSurface surface = drawable.getNativeSurface();        
+          final NativeSurface surface = drawable.getNativeSurface();
           final MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) surface.getGraphicsConfiguration();
           final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
           final long nsViewHandle;
@@ -606,7 +606,7 @@ public class MacOSXCGLContext extends GLContextImpl
               if( !_fixedCaps.isPBuffer() && isPBuffer ) {
                   throw new InternalError("handle is PBuffer, fixedCaps not: "+drawable);
               }
-              // determine on-/offscreen caps, since pformat is ambiguous 
+              // determine on-/offscreen caps, since pformat is ambiguous
               _fixedCaps.setPBuffer( isPBuffer ); // exclusive
               _fixedCaps.setBitmap( false );      // n/a in our OSX impl.
               _fixedCaps.setOnscreen( !isFBO && !isPBuffer );
@@ -632,7 +632,7 @@ public class MacOSXCGLContext extends GLContextImpl
               // Thread.dumpStack();
           }
           config.setChosenCapabilities(fixedCaps);
-          
+
           final IntBuffer viewNotReady = Buffers.newDirectIntBuffer(1);
           // Try to allocate a context with this
           ctx = CGL.createContext(share, nsViewHandle, incompleteView,
@@ -665,12 +665,12 @@ public class MacOSXCGLContext extends GLContextImpl
        * <p>
        * Since NSOpenGLLayer creation requires this context for it's shared context creation,
        * this method attempts to acquire the surface and context lock with {@link #screenVSyncTimeout}/2 maximum wait time.
-       * If the surface and context lock could not be acquired, this runnable is being re-queued for later execution. 
+       * If the surface and context lock could not be acquired, this runnable is being re-queued for later execution.
        * </p>
        * <p>
        * Hence this method blocks the main-thread only for a short period of time.
        * </p>
-       */                  
+       */
       class AttachGLLayerCmd implements Runnable {
           final OffscreenLayerSurface ols;
           final long ctx;
@@ -685,7 +685,7 @@ public class MacOSXCGLContext extends GLContextImpl
           long nsOpenGLLayer;
           /** Synchronized by instance's monitor */
           boolean valid;
-          
+
           AttachGLLayerCmd(OffscreenLayerSurface ols, long ctx, int shaderProgram, long pfmt, long pbuffer, int texID, boolean isOpaque, int width, int height) {
               this.ols = ols;
               this.ctx = ctx;
@@ -699,23 +699,23 @@ public class MacOSXCGLContext extends GLContextImpl
               this.valid = false;
               this.nsOpenGLLayer = 0;
           }
-          
+
           public final String contentToString() {
               return "valid "+valid+", size "+width+"x"+height+", ctx "+toHexString(ctx)+", opaque "+isOpaque+", texID "+texID+", pbuffer "+toHexString(pbuffer)+", nsOpenGLLayer "+toHexString(nsOpenGLLayer);
           }
-          
+
           @Override
           public final String toString() {
               return "AttachGLLayerCmd["+contentToString()+"]";
           }
-          
+
           @Override
           public void run() {
               synchronized(this) {
                   if( !valid ) {
                       try {
                           final int maxwait = screenVSyncTimeout/2000; // TO 1/2 of current screen-vsync in [ms]
-                          final RecursiveLock surfaceLock = ols.getLock(); 
+                          final RecursiveLock surfaceLock = ols.getLock();
                           if( surfaceLock.tryLock( maxwait ) ) {
                               try {
                                   if( MacOSXCGLContext.this.lock.tryLock( maxwait ) ) {
@@ -752,19 +752,19 @@ public class MacOSXCGLContext extends GLContextImpl
           }
       }
       AttachGLLayerCmd attachGLLayerCmd = null;
-      
+
       class DetachGLLayerCmd implements Runnable {
         final AttachGLLayerCmd cmd;
-        
+
         DetachGLLayerCmd(AttachGLLayerCmd cmd) {
             this.cmd = cmd;
         }
-        
+
         @Override
         public final String toString() {
             return "DetachGLLayerCmd["+cmd.contentToString()+"]";
         }
-        
+
         @Override
         public void run() {
             synchronized( cmd ) {
@@ -777,7 +777,7 @@ public class MacOSXCGLContext extends GLContextImpl
                             ols.detachSurfaceLayer();
                         }
                     } catch(Throwable t) {
-                        System.err.println("Catched Exception on thread "+getThreadName()); 
+                        System.err.println("Catched Exception on thread "+getThreadName());
                         t.printStackTrace();
                     }
                     CGL.releaseNSOpenGLLayer(cmd.nsOpenGLLayer);
@@ -790,27 +790,27 @@ public class MacOSXCGLContext extends GLContextImpl
                     System.err.println("NSOpenGLLayer.Detach: Skipped "+toHexString(cmd.nsOpenGLLayer)+" - "+getThreadName());
                 }
             }
-        }          
+        }
       }
-      
+
       @Override
       public void associateDrawable(boolean bound) {
           backingLayerHost = NativeWindowFactory.getOffscreenLayerSurface(drawable.getNativeSurface(), true);
-          
+
           if(DEBUG) {
               System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable: "+bound+", ctx "+toHexString(contextHandle)+
                                  ", hasBackingLayerHost "+(null!=backingLayerHost)+", attachGLLayerCmd "+attachGLLayerCmd);
               // Thread.dumpStack();
-          }          
-          
-          if( bound ) {              
+          }
+
+          if( bound ) {
               if( null != backingLayerHost ) {
                   final GLCapabilitiesImmutable chosenCaps;
                   final long ctx;
                   final int texID;
                   final long pbufferHandle;
                   final int gl3ShaderProgramName;
-                  
+
                   //
                   // handled layered surface
                   //
@@ -823,8 +823,8 @@ public class MacOSXCGLContext extends GLContextImpl
                       pbufferHandle = 0;
                       fbod.setSwapBufferContext(new GLFBODrawableImpl.SwapBufferContext() {
                           public void swapBuffers(boolean doubleBuffered) {
-                              MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();                            
-                          } } ) ;                    
+                              MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();
+                          } } ) ;
                   } else if( CGL.isNSOpenGLPixelBuffer(drawableHandle) ) {
                       texID = 0;
                       pbufferHandle = drawableHandle;
@@ -847,19 +847,19 @@ public class MacOSXCGLContext extends GLContextImpl
                       gl3ShaderProgramName = gl3ShaderProgram.program();
                   } else {
                       gl3ShaderProgramName = 0;
-                  }                                     
-                   
+                  }
+
                   // All CALayer lifecycle ops are deferred on main-thread
-                  attachGLLayerCmd = new AttachGLLayerCmd( 
-                          backingLayerHost, ctx, gl3ShaderProgramName, pixelFormat, pbufferHandle, texID, 
+                  attachGLLayerCmd = new AttachGLLayerCmd(
+                          backingLayerHost, ctx, gl3ShaderProgramName, pixelFormat, pbufferHandle, texID,
                           chosenCaps.isBackgroundOpaque(), lastWidth, lastHeight );
                   if(DEBUG) {
                       System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable(true): "+attachGLLayerCmd);
-                  }                            
+                  }
                   OSXUtil.RunOnMainThread(false, attachGLLayerCmd);
-              } else { // -> null == backingLayerHost                  
+              } else { // -> null == backingLayerHost
                   lastWidth = drawable.getWidth();
-                  lastHeight = drawable.getHeight();                  
+                  lastHeight = drawable.getHeight();
                   boolean[] isPBuffer = { false };
                   boolean[] isFBO = { false };
                   CGL.setContextView(contextHandle, getNSViewHandle(isPBuffer, isFBO));
@@ -882,7 +882,7 @@ public class MacOSXCGLContext extends GLContextImpl
                           final DetachGLLayerCmd dCmd = new DetachGLLayerCmd(cmd);
                           if(DEBUG) {
                               System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable(false): "+dCmd);
-                          }                            
+                          }
                           OSXUtil.RunOnMainThread(false, dCmd);
                           if( null != gl3ShaderProgram ) {
                               gl3ShaderProgram.destroy(MacOSXCGLContext.this.gl.getGL3());
@@ -903,11 +903,11 @@ public class MacOSXCGLContext extends GLContextImpl
               needsSetContextPBuffer = false;
               CGL.setContextPBuffer(ctx, drawableHandle);
               if(DEBUG) {
-                  System.err.println("NS.validateDrawableConfig bind pbuffer "+toHexString(drawableHandle)+" -> ctx "+toHexString(ctx)); 
+                  System.err.println("NS.validateDrawableConfig bind pbuffer "+toHexString(drawableHandle)+" -> ctx "+toHexString(ctx));
               }
           }
       }
-      
+
       /** Returns true if size has been updated, otherwise false (same size). */
       private final boolean validateDrawableSizeConfig(long ctx) {
           final int width = drawable.getWidth();
@@ -916,13 +916,13 @@ public class MacOSXCGLContext extends GLContextImpl
               lastWidth = drawable.getWidth();
               lastHeight = drawable.getHeight();
               if(DEBUG) {
-                  System.err.println("NS.validateDrawableConfig size changed"); 
+                  System.err.println("NS.validateDrawableConfig size changed");
               }
               return true;
           }
           return false;
       }
-      
+
       @Override
       public boolean copyImpl(long src, int mask) {
           CGL.copyContext(contextHandle, src, mask);
@@ -975,7 +975,7 @@ public class MacOSXCGLContext extends GLContextImpl
           // CGL.setContextPBuffer(contextHandle, 0); // doesn't work, i.e. not taking nil
           return true;
       }
-      
+
       @Override
       public boolean setSwapInterval(int interval) {
           final AttachGLLayerCmd cmd = attachGLLayerCmd;
@@ -1004,7 +1004,7 @@ public class MacOSXCGLContext extends GLContextImpl
           if(DEBUG) { System.err.println("CGL setSwapInterval: "+interval); }
           CGL.setSwapInterval(contextHandle, interval);
       }
-      
+
       private int skipSync=0;
       /** TODO: Remove after discussion
       private boolean perfIterReset = false;
@@ -1014,7 +1014,7 @@ public class MacOSXCGLContext extends GLContextImpl
       private long frameXS = 0;
       private long lastFrameStart = 0;
       */
-      
+
       @Override
       public boolean swapBuffers() {
           final AttachGLLayerCmd cmd = attachGLLayerCmd;
@@ -1026,7 +1026,7 @@ public class MacOSXCGLContext extends GLContextImpl
                           // allowing to update the texture IDs ASAP.
                           skipSync = 10;
                       }
-                      
+
                       final boolean res;
                       final int texID;
                       final boolean valid;
@@ -1054,19 +1054,19 @@ public class MacOSXCGLContext extends GLContextImpl
                                   final long lastFramePeriod0 = TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - lastFrameStart;
                                   gl.glFinish(); // Require to finish previous GL rendering to give CALayer proper result
                                   final long lastFramePeriod1 = TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - lastFrameStart;
-                                  
-                                  // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay, 
+
+                                  // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
                                   // while still synchronizing w/ CALayer.
                                   // If v-sync is enabled wait until next swap interval (v-sync).
                                   CGL.waitUntilNSOpenGLLayerIsReady(cmd.nsOpenGLLayer, vsyncTimeout);
                                   final long lastFramePeriodX = TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - lastFrameStart;
-                                  
+
                                   final long finishGL = lastFramePeriod1 - lastFramePeriod0;
                                   final long waitGL = lastFramePeriodX - lastFramePeriod1;
                                   finishGLS += finishGL;
                                   waitGLS += waitGL;
                                   frameXS += lastFramePeriodX;
-                                  
+
                                   System.err.println("XXX["+perfIter+"] TO "+vsyncTimeout/1000+" ms, "+
                                                      "lFrame0 "+lastFramePeriod0/1000+" ms, "+
                                                      "lFrameX "+lastFramePeriodX/1000+" / "+frameXS/1000+" ~"+(frameXS/perfIter)/1000.0+" ms, "+
@@ -1080,8 +1080,8 @@ public class MacOSXCGLContext extends GLContextImpl
                                   // FIXME: IMHO this synchronization should be implicitly performed via 'CGL.flushBuffer(contextHandle)' above,
                                   // in case this will be determined a driver bug - use a QUIRK entry in GLRendererQuirks!
                                   gl.glFinish();
-                                  
-                                  // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay, 
+
+                                  // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
                                   // while still synchronizing w/ CALayer.
                                   // If v-sync is enabled wait until next swap interval (v-sync).
                                   CGL.waitUntilNSOpenGLLayerIsReady(cmd.nsOpenGLLayer, vsyncTimeout);
@@ -1093,7 +1093,7 @@ public class MacOSXCGLContext extends GLContextImpl
                                   CGL.setNSOpenGLLayerNeedsDisplayFBO(cmd.nsOpenGLLayer, texID);
                               } else {
                                   // trigger CALayer to update incl. possible surface change (new pbuffer handle)
-                                  CGL.setNSOpenGLLayerNeedsDisplayPBuffer(cmd.nsOpenGLLayer, drawable.getHandle());                          
+                                  CGL.setNSOpenGLLayerNeedsDisplayPBuffer(cmd.nsOpenGLLayer, drawable.getHandle());
                               }
                               // lastFrameStart = TimeUnit.NANOSECONDS.toMicros(System.nanoTime());
                           }
@@ -1137,8 +1137,8 @@ public class MacOSXCGLContext extends GLContextImpl
               if (0 != ctx) {
                   GLCapabilities fixedCaps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(pixelFormat);
                   fixedCaps = GLGraphicsConfigurationUtil.fixOpaqueGLCapabilities(fixedCaps, chosenCaps.isBackgroundOpaque());
-                  { // determine on-/offscreen caps, since pformat is ambiguous 
-                      fixedCaps.setFBO( false );         // n/a for CGLImpl 
+                  { // determine on-/offscreen caps, since pformat is ambiguous
+                      fixedCaps.setFBO( false );         // n/a for CGLImpl
                       fixedCaps.setPBuffer( fixedCaps.isPBuffer() && !chosenCaps.isOnscreen() );
                       fixedCaps.setBitmap( false );      // n/a in our OSX impl.
                       fixedCaps.setOnscreen( !fixedCaps.isPBuffer() );
@@ -1153,7 +1153,7 @@ public class MacOSXCGLContext extends GLContextImpl
                       if (res != CGL.kCGLNoError) {
                           throw new GLException("Error code " + res + " while attaching context to pbuffer");
                       }
-                  }              
+                  }
               }
           } finally {
               CGL.CGLDestroyPixelFormat(pixelFormat);
@@ -1224,7 +1224,7 @@ public class MacOSXCGLContext extends GLContextImpl
           } */
           return true;
       }
-      
+
       @Override
       public boolean setSwapInterval(int interval) {
           final IntBuffer lval = Buffers.newDirectIntBuffer(1);
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
index 4bd7bc994..bb36a7219 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
@@ -105,7 +105,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
   @Override
   protected void setRealizedImpl() {
   }
-  
+
   @Override
   protected void associateContext(GLContext ctx, boolean bound) {
     // NOTE: we need to keep track of the created contexts in order to
@@ -123,14 +123,14 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
                 } else {
                     i++;
                 }
-            }            
+            }
         }
-    }      
+    }
   }
-  
+
   @Override
   protected final void swapBuffersImpl(boolean doubleBuffered) {
-    if(doubleBuffered) { 
+    if(doubleBuffered) {
         synchronized (createdContexts) {
             for(int i=0; i<createdContexts.size(); ) {
                 final MacOSXCGLContext ctx = createdContexts.get(i).get();
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
index 83d656475..6f86e840b 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -124,7 +124,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   protected final boolean isComplete() {
       return null != macOSXCGLDynamicLookupHelper;
   }
-    
+
   @Override
   protected final void destroy() {
     if(null != sharedMap) {
@@ -194,7 +194,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
       }
       @Override
       public GLRendererQuirks getRendererQuirks() {
-          return glRendererQuirks;      
+          return glRendererQuirks;
       }
   }
 
@@ -251,12 +251,12 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
             final GLCapabilitiesImmutable caps = new GLCapabilities(glp);
             final GLDrawableImpl sharedDrawable = createOnscreenDrawableImpl(createDummySurfaceImpl(sharedDevice, false, caps, caps, null, 64, 64));
             sharedDrawable.setRealized(true);
-            
+
             final MacOSXCGLContext sharedContext = (MacOSXCGLContext) sharedDrawable.createContext(null);
             if (null == sharedContext) {
                 throw new GLException("Couldn't create shared context for drawable: "+sharedDrawable);
             }
-            
+
             try {
                 sharedContext.makeCurrent(); // could cause exception
                 isValid = sharedContext.isCurrent();
@@ -342,8 +342,8 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice, 
-                                                  GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, 
+  protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
+                                                  GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
                                                   GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
     final MacOSXGraphicsDevice device;
     if( createNewDevice || !(deviceReq instanceof MacOSXGraphicsDevice) ) {
@@ -354,24 +354,24 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
     final AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);
     final MacOSXCGLGraphicsConfiguration config = MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen, true);
     if(null == config) {
-        throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen); 
-    }    
+        throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen);
+    }
     return new WrappedSurface(config, 0, upstreamHook, createNewDevice);
   }
 
   @Override
-  public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice, 
+  public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
                                                    GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
     chosenCaps = GLGraphicsConfigurationUtil.fixOnscreenGLCapabilities(chosenCaps);
-    return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, 
-                                    new OSXDummyUpstreamSurfaceHook(width, height)); 
-  }  
-  
+    return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser,
+                                    new OSXDummyUpstreamSurfaceHook(width, height));
+  }
+
   @Override
   protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
     final MacOSXGraphicsDevice device = new MacOSXGraphicsDevice(deviceReq.getUnitID());
     final AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, screenIdx);
-    final MacOSXCGLGraphicsConfiguration config = MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen, true); 
+    final MacOSXCGLGraphicsConfiguration config = MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen, true);
     return new WrappedSurface(config, windowHandle, upstream, true);
   }
 
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
index f8c874a53..cda8307c7 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl.macosx.cgl;
 
 import jogamp.opengl.*;
@@ -42,13 +42,13 @@ public final class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLib
         final List<String> libsGL = new ArrayList<String>();
         libsGL.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib");
         libsGL.add("GL");
-        libsList.add(libsGL);        
+        libsList.add(libsGL);
         return libsList;
     }
-    
+
     @Override
     public final List<String> getToolGetProcAddressFuncNameList() {
-        return null; 
+        return null;
         /** OSX manual says: NSImage use is discouraged
         List res = new ArrayList();
         res.add("GetProcAddress"); // dummy
@@ -59,7 +59,7 @@ public final class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLib
     public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
         return 0;
         /** OSX manual says: NSImage use is discouraged
-            return CGL.getProcAddress(glFuncName); // manual implementation 
+            return CGL.getProcAddress(glFuncName); // manual implementation
          */
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
index 5eb11c6a4..535c4d2d3 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -54,7 +54,7 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
 
 public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
 
-    MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen, 
+    MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen,
                                    GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested) {
         super(screen, capsChosen, capsRequested);
     }
@@ -71,10 +71,10 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         // MacOSXGraphicsDevice osxDevice = sharedResource.getDevice();
         return new ArrayList<GLCapabilitiesImmutable>(0);
     }
-    
+
     static final IntBuffer cglInternalAttributeToken = Buffers.newDirectIntBuffer(new int[] {
         CGL.kCGLPFAOpenGLProfile,    // >= lion
-        CGL.NSOpenGLPFAAccelerated,  // query only (prefer accelerated, but allow non accelerated), ignored for createPixelformat 
+        CGL.NSOpenGLPFAAccelerated,  // query only (prefer accelerated, but allow non accelerated), ignored for createPixelformat
         CGL.NSOpenGLPFANoRecovery,
         CGL.kCGLPFAColorFloat,
         CGL.NSOpenGLPFAPixelBuffer,
@@ -96,13 +96,13 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         for (int idx = 0; idx < len; idx++) {
           final int attr = attrToken.get(idx+off);
           switch (attr) {
-              case CGL.kCGLPFAOpenGLProfile: 
+              case CGL.kCGLPFAOpenGLProfile:
                 ivalues.put(idx, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(ctp, major, minor));
                 break;
               case CGL.NSOpenGLPFANoRecovery:
                 ivalues.put(idx, caps.getHardwareAccelerated() ? 1 : 0);
                 break;
-                  
+
               case CGL.kCGLPFAColorFloat:
                 // ivalues.put(idx, ( !caps.isOnscreen() && caps.isPBuffer() && caps.getPbufferFloatingPointBuffers() ) ? 1 : 0);
                   ivalues.put(idx, 0);
@@ -160,7 +160,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         if ( !MacOSXCGLContext.isLionOrLater ) {
             // no OpenGLProfile
             attrToken.position(1);
-        }        
+        }
         final IntBuffer ivalues = GLCapabilities2NSAttribList(attrToken, caps, ctp, major, minor);
         return CGL.createPixelFormat(attrToken, attrToken.remaining(), ivalues);
     }
@@ -174,7 +174,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
       final IntBuffer attrs = Buffers.newDirectIntBuffer(256);
       int i = 0;
       if(MacOSXCGLContext.isLionOrLater) {
-          attrs.put(i++, CGL.kCGLPFAOpenGLProfile); 
+          attrs.put(i++, CGL.kCGLPFAOpenGLProfile);
           attrs.put(i++, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(ctp, major, minor));
       }
       /**
@@ -222,8 +222,8 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
       }
       return fmt.get(0);
     }
-    
-    static GLCapabilities CGLPixelFormat2GLCapabilities(long pixelFormat) {        
+
+    static GLCapabilities CGLPixelFormat2GLCapabilities(long pixelFormat) {
         return PixelFormat2GLCapabilities(null, pixelFormat, false);
     }
 
@@ -235,7 +235,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
             off = 1;
         } else {
             off = 0;
-        }        
+        }
         attrToken.position(off);
         final int len = attrToken.remaining();
         final IntBuffer ivalues = Buffers.newDirectIntBuffer(len);
@@ -243,7 +243,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         // On this platform the pixel format is associated with the
         // context and not the drawable. However it's a reasonable
         // approximation to just store the chosen pixel format up in the
-        // NativeSurface's AbstractGraphicsConfiguration, 
+        // NativeSurface's AbstractGraphicsConfiguration,
         // since the public API doesn't provide for a different GLCapabilities per context.
         // Note: These restrictions of the platform's API might be considered as a bug anyways.
 
@@ -253,7 +253,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         } else {
             CGL.CGLQueryPixelFormat(pixelFormat, attrToken, len, ivalues);
         }
-        
+
         if(null == glp && MacOSXCGLContext.isLionOrLater) {
             // pre-scan for OpenGL Profile
             for (int i = 0; i < len; i++) {
@@ -265,11 +265,11 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
                             break;
                         case CGL.kCGLOGLPVersion_Legacy:
                             glp = GLProfile.get(GLProfile.GL2);
-                            break;                            
+                            break;
                         default:
                             throw new RuntimeException("Unhandled OSX OpenGL Profile: 0x"+Integer.toHexString(ivalue));
                     }
-                }            
+                }
             }
         }
         if(null == glp) {
@@ -284,7 +284,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
               case CGL.NSOpenGLPFAAccelerated:
                 caps.setHardwareAccelerated(ivalue != 0);
                 break;
-                
+
               case CGL.kCGLPFAColorFloat:
                 // caps.setPbufferFloatingPointBuffers(ivalue != 0);
                 break;
@@ -346,7 +346,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
           }
         }
         caps.setAlphaBits(alphaBits);
-        
+
         return caps;
       }
 }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
index 3bbba2c52..e761be7b7 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -56,13 +56,13 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
     static void registerFactory() {
         GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.macosx.MacOSXGraphicsDevice.class, GLCapabilitiesImmutable.class, new MacOSXCGLGraphicsConfigurationFactory());
     }
-    private MacOSXCGLGraphicsConfigurationFactory() {        
+    private MacOSXCGLGraphicsConfigurationFactory() {
     }
 
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
             CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
-        
+
         if (absScreen == null) {
             throw new IllegalArgumentException("AbstractGraphicsScreen is null");
         }
@@ -78,7 +78,7 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
         if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
             throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
         }
-        
+
         return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, (GLCapabilitiesChooser)chooser, absScreen, false);
     }
 
@@ -91,7 +91,7 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
         }
         final AbstractGraphicsDevice device = absScreen.getDevice();
         capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, GLDrawableFactory.getDesktopFactory(), device);
-        
+
         return new MacOSXCGLGraphicsConfiguration(absScreen, (GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested);
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index 4e791cb5f..f6e8b8fa3 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -90,7 +90,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
   public GLContext createContext(GLContext shareWith) {
     return new MacOSXCGLContext(this, shareWith);
   }
-  
+
   protected int getTextureTarget() { return pBufferTexTarget;  }
   protected int getTextureWidth() { return pBufferTexWidth; }
   protected int getTextureHeight() { return pBufferTexHeight; }
@@ -101,7 +101,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
     if (0 != pBuffer) {
       synchronized (createdContexts) {
         for(int i=0; i<createdContexts.size(); ) {
-          final WeakReference<MacOSXCGLContext> ref = createdContexts.get(i); 
+          final WeakReference<MacOSXCGLContext> ref = createdContexts.get(i);
           final MacOSXCGLContext ctx = ref.get();
           if (ctx != null) {
             ctx.detachPBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
index edf9b7c84..c08259665 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -59,7 +59,7 @@ import jogamp.opengl.macosx.cgl.MacOSXCGLGraphicsConfiguration;
 public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
     public static void registerFactory() {
         GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.awt.AWTGraphicsDevice.class, GLCapabilitiesImmutable.class, new MacOSXAWTCGLGraphicsConfigurationFactory());
-    }    
+    }
     private MacOSXAWTCGLGraphicsConfigurationFactory() {
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java
index 1a4ca345b..810a9286b 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java
@@ -37,22 +37,22 @@ import javax.media.opengl.*;
  */
 public interface GLArrayHandler {
 
-    
+
   /**
-   * if <code>bind</code> is true and the data uses VBO, 
+   * if <code>bind</code> is true and the data uses VBO,
    * the latter will be bound and data written to the GPU if required.
    * <p>
    * If  <code>bind</code> is false and the data uses VBO,
    * the latter will be unbound.
    * </p>
-   * 
+   *
    * @param gl current GL object
-   * @param bind true if VBO shall be bound and data written, 
+   * @param bind true if VBO shall be bound and data written,
    *        otherwise clear VBO binding.
-   * @return true if data uses VBO and action was performed, otherwise false 
+   * @return true if data uses VBO and action was performed, otherwise false
    */
   public boolean bindBuffer(GL gl, boolean bind);
-  
+
   /**
    * Implementation shall enable or disable the array state.
    * <p>
@@ -60,23 +60,23 @@ public interface GLArrayHandler {
    * implementation shall synchronize the data with the GPU
    * and associate the data with the array.
    * </p>
-   * 
+   *
    * @param gl current GL object
    * @param enable true if array shall be enabled, otherwise false.
-   * @param ext extension object allowing passing of an implementation detail 
+   * @param ext extension object allowing passing of an implementation detail
    */
   public void enableState(GL gl, boolean enable, Object ext);
-  
+
   /**
-   * Supporting interleaved arrays, where sub handlers may handle 
+   * Supporting interleaved arrays, where sub handlers may handle
    * the array state and the <i>master</i> handler the buffer consistency.
-   *   
+   *
    * @param handler the sub handler
    * @throws UnsupportedOperationException if this array handler does not support interleaved arrays
    */
   public void addSubHandler(GLArrayHandlerFlat handler) throws UnsupportedOperationException;
 
   public void setSubArrayVBOName(int vboName);
-  
+
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java
index 4a8f40608..179142fee 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java
@@ -39,21 +39,21 @@ public interface GLArrayHandlerFlat {
 
   /**
    * Implementation shall associate the data with the array
-   * 
+   *
    * @param gl current GL object
-   * @param ext extension object allowing passing of an implementation detail 
+   * @param ext extension object allowing passing of an implementation detail
    */
   public void syncData(GL gl, Object ext);
-  
+
   /**
    * Implementation shall enable or disable the array state.
-   * 
+   *
    * @param gl current GL object
    * @param enable true if array shall be enabled, otherwise false.
-   * @param ext extension object allowing passing of an implementation detail 
+   * @param ext extension object allowing passing of an implementation detail
    */
-  public void enableState(GL gl, boolean enable, Object ext);  
-  
+  public void enableState(GL gl, boolean enable, Object ext);
+
   public GLArrayDataWrapper getData();
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index 98f711b8e..5f9b25530 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -36,8 +36,8 @@ import javax.media.opengl.GL;
 import com.jogamp.opengl.util.GLArrayDataEditable;
 
 /**
- * Interleaved fixed function arrays, i.e. where this buffer data 
- * represents many arrays. 
+ * Interleaved fixed function arrays, i.e. where this buffer data
+ * represents many arrays.
  */
 public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLArrayHandler {
   private List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
@@ -45,13 +45,13 @@ public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLAr
   public GLArrayHandlerInterleaved(GLArrayDataEditable ad) {
     super(ad);
   }
-  
+
   public final void setSubArrayVBOName(int vboName) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).getData().setVBOName(vboName);
-      }      
+      }
   }
-  
+
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       subArrays.add(handler);
   }
@@ -59,20 +59,20 @@ public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLAr
   private final void syncSubData(GL gl, Object ext) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).syncData(gl, ext);
-      }      
-  }  
-  
+      }
+  }
+
   public final void enableState(GL gl, boolean enable, Object ext) {
     if(enable) {
         final boolean vboBound = bindBuffer(gl, true);
         syncSubData(gl, ext);
         if(vboBound) {
             bindBuffer(gl, false);
-        }        
+        }
     }
     for(int i=0; i<subArrays.size(); i++) {
         subArrays.get(i).enableState(gl, enable, ext);
-    }      
+    }
   }
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
index 862d49d1d..be50fa9ef 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
@@ -35,8 +35,8 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
 
 
 /**
- * Used for pure VBO data arrays, i.e. where the buffer data 
- * does not represents a specific array name. 
+ * Used for pure VBO data arrays, i.e. where the buffer data
+ * does not represents a specific array name.
  */
 public class GLDataArrayHandler extends GLVBOArrayHandler implements GLArrayHandler {
 
@@ -47,12 +47,12 @@ public class GLDataArrayHandler extends GLVBOArrayHandler implements GLArrayHand
   public final void setSubArrayVBOName(int vboName) {
       throw new UnsupportedOperationException();
   }
-  
+
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       throw new UnsupportedOperationException();
   }
-  
-  public final void enableState(GL gl, boolean enable, Object ext) { 
+
+  public final void enableState(GL gl, boolean enable, Object ext) {
     if(enable) {
         if(!ad.isVBO()) {
             // makes no sense otherwise
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
index 32bba896f..8908bd89d 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
@@ -35,22 +35,22 @@ import javax.media.opengl.fixedfunc.GLPointerFunc;
 import com.jogamp.opengl.util.GLArrayDataEditable;
 
 /**
- * Used for 1:1 fixed function arrays, i.e. where the buffer data 
- * represents this array only. 
+ * Used for 1:1 fixed function arrays, i.e. where the buffer data
+ * represents this array only.
  */
 public class GLFixedArrayHandler extends GLVBOArrayHandler implements GLArrayHandler {
   public GLFixedArrayHandler(GLArrayDataEditable ad) {
     super(ad);
   }
-  
+
   public final void setSubArrayVBOName(int vboName) {
       throw new UnsupportedOperationException();
   }
-  
+
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       throw new UnsupportedOperationException();
   }
-  
+
   public final void enableState(GL gl, boolean enable, Object ext) {
     final GLPointerFunc glp = gl.getGL2ES1();
     if(enable) {
@@ -69,12 +69,12 @@ public class GLFixedArrayHandler extends GLVBOArrayHandler implements GLArrayHan
                 glp.glTexCoordPointer(ad);
                 break;
             default:
-                throw new GLException("invalid glArrayIndex: "+ad.getIndex()+":\n\t"+ad); 
+                throw new GLException("invalid glArrayIndex: "+ad.getIndex()+":\n\t"+ad);
         }
         if(vboBound) {
             bindBuffer(gl, false);
-        }        
-        glp.glEnableClientState(ad.getIndex());        
+        }
+        glp.glEnableClientState(ad.getIndex());
     } else {
         glp.glDisableClientState(ad.getIndex());
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
index ff1813b95..bbdd32f0f 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
@@ -35,7 +35,7 @@ import javax.media.opengl.fixedfunc.GLPointerFunc;
 import com.jogamp.opengl.util.GLArrayDataWrapper;
 
 /**
- * Used for interleaved fixed function arrays, i.e. where the buffer data itself is handled 
+ * Used for interleaved fixed function arrays, i.e. where the buffer data itself is handled
  * separately and interleaves many arrays.
  */
 public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
@@ -48,7 +48,7 @@ public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
   public GLArrayDataWrapper getData() {
       return ad;
   }
-  
+
   public final void syncData(GL gl, Object ext) {
     final GLPointerFunc glp = gl.getGL2ES1();
     switch(ad.getIndex()) {
@@ -65,14 +65,14 @@ public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
             glp.glTexCoordPointer(ad);
             break;
         default:
-            throw new GLException("invalid glArrayIndex: "+ad.getIndex()+":\n\t"+ad); 
+            throw new GLException("invalid glArrayIndex: "+ad.getIndex()+":\n\t"+ad);
     }
   }
 
   public final void enableState(GL gl, boolean enable, Object ext) {
     final GLPointerFunc glp = gl.getGL2ES1();
     if(enable) {
-        glp.glEnableClientState(ad.getIndex());        
+        glp.glEnableClientState(ad.getIndex());
     } else {
         glp.glDisableClientState(ad.getIndex());
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
index 383898898..2bab1c2c9 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
@@ -35,8 +35,8 @@ import javax.media.opengl.GL;
 import com.jogamp.opengl.util.GLArrayDataEditable;
 
 /**
- * Interleaved fixed function arrays, i.e. where this buffer data 
- * represents many arrays. 
+ * Interleaved fixed function arrays, i.e. where this buffer data
+ * represents many arrays.
  */
 public abstract class GLVBOArrayHandler implements GLArrayHandler {
   protected GLArrayDataEditable ad;
@@ -44,13 +44,13 @@ public abstract class GLVBOArrayHandler implements GLArrayHandler {
   public GLVBOArrayHandler(GLArrayDataEditable ad) {
     this.ad = ad;
   }
-  
+
   public final boolean bindBuffer(GL gl, boolean bind) {
     if( !ad.isVBO() ) {
         return false;
     }
     if(bind) {
-        // always bind and refresh the VBO mgr, 
+        // always bind and refresh the VBO mgr,
         // in case more than one gl*Pointer objects are in use
         gl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName());
         if(!ad.isVBOWritten()) {
@@ -65,6 +65,6 @@ public abstract class GLVBOArrayHandler implements GLArrayHandler {
     }
     return true;
   }
-  
+
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
index 31af8e4db..e893bab89 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -44,30 +44,30 @@ import jogamp.opengl.egl.EGLExt;
 public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
     final protected TextureType texType;
     final protected boolean useKHRSync;
-    
+
     public enum TextureType {
-        GL(0), KHRImage(1); 
-        
+        GL(0), KHRImage(1);
+
         public final int id;
 
         TextureType(int id){
             this.id = id;
         }
-    }    
-    
+    }
+
     public static class EGLTextureFrame extends TextureSequence.TextureFrame {
-        
+
         public EGLTextureFrame(Buffer clientBuffer, Texture t, long khrImage, long khrSync) {
             super(t);
             this.clientBuffer = clientBuffer;
             this.image = khrImage;
             this.sync = khrSync;
         }
-        
+
         public final Buffer getClientBuffer() { return clientBuffer; }
-        public final long getImage() { return image; }        
+        public final long getImage() { return image; }
         public final long getSync() { return sync; }
-        
+
         public String toString() {
             return "EGLTextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ texture.getTextureObject() + ", img "+ image + ", sync "+ sync+", clientBuffer "+clientBuffer+"]";
         }
@@ -76,7 +76,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
         protected final long sync;
     }
 
-    
+
     protected EGLMediaPlayerImpl(TextureType texType, boolean useKHRSync) {
         super();
         this.texType = texType;
@@ -89,21 +89,21 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
         final Buffer clientBuffer;
         final long image;
         final long sync;
-        final boolean eglUsage = TextureType.KHRImage == texType || useKHRSync ; 
+        final boolean eglUsage = TextureType.KHRImage == texType || useKHRSync ;
         final EGLContext eglCtx;
         final EGLExt eglExt;
         final EGLDrawable eglDrawable;
-        
+
         if(eglUsage) {
             eglCtx = (EGLContext) gl.getContext();
             eglExt = eglCtx.getEGLExt();
-            eglDrawable = (EGLDrawable) eglCtx.getGLDrawable();            
+            eglDrawable = (EGLDrawable) eglCtx.getGLDrawable();
         } else {
             eglCtx = null;
             eglExt = null;
             eglDrawable = null;
         }
-        
+
         if(TextureType.KHRImage == texType) {
             IntBuffer nioTmp = Buffers.newDirectIntBuffer(1);
             // create EGLImage from texture
@@ -135,25 +135,25 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
         }
         return new EGLTextureFrame(clientBuffer, texture, image, sync);
     }
-    
+
     @Override
     protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
-        final boolean eglUsage = TextureType.KHRImage == texType || useKHRSync ; 
+        final boolean eglUsage = TextureType.KHRImage == texType || useKHRSync ;
         final EGLContext eglCtx;
         final EGLExt eglExt;
         final EGLDrawable eglDrawable;
-        
+
         if(eglUsage) {
             eglCtx = (EGLContext) gl.getContext();
             eglExt = eglCtx.getEGLExt();
-            eglDrawable = (EGLDrawable) eglCtx.getGLDrawable();            
+            eglDrawable = (EGLDrawable) eglCtx.getGLDrawable();
         } else {
             eglCtx = null;
             eglExt = null;
             eglDrawable = null;
         }
         final EGLTextureFrame eglTex = (EGLTextureFrame) frame;
-        
+
         if(0!=eglTex.getImage()) {
             eglExt.eglDestroyImageKHR(eglDrawable.getNativeSurface().getDisplayHandle(), eglTex.getImage());
         }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 40fa9c9d6..ebb344664 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -63,7 +63,7 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
  *   <li>{@link #setTextureTarget(int)}</li>
  *   <li>{@link EGLMediaPlayerImpl#setEGLTexImageAttribs(boolean, boolean)}.</li>
  * </ul>
- * 
+ *
  * <p>
  * See {@link GLMediaPlayer}.
  * </p>
@@ -75,21 +75,21 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
     protected volatile State state;
     private Object stateLock = new Object();
-    
+
     protected int textureCount;
     protected int textureTarget;
     protected int textureFormat;
-    protected int textureInternalFormat; 
+    protected int textureInternalFormat;
     protected int textureType;
     protected int texUnit;
-    
-    
+
+
     protected int[] texMinMagFilter = { GL.GL_NEAREST, GL.GL_NEAREST };
     protected int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE };
-    
+
     /** User requested URI stream location. */
     protected URI streamLoc = null;
-    /** 
+    /**
      * In case {@link #streamLoc} is a {@link GLMediaPlayer#CameraInputScheme},
      * {@link #cameraPath} holds the URI's path portion
      * as parsed in {@link #initStream(URI, int, int, int)}.
@@ -98,10 +98,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected String cameraPath = null;
     /** Optional camera properties, see {@link #cameraPath}. */
     protected Map<String, String> cameraProps = null;
-    
+
     protected volatile float playSpeed = 1.0f;
     protected float audioVolume = 1.0f;
-    
+
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected int vid = GLMediaPlayer.STREAM_ID_AUTO;
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
@@ -130,20 +130,20 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected String acodec = unknown;
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
     protected String vcodec = unknown;
-    
+
     protected volatile int decodedFrameCount = 0;
     protected int presentedFrameCount = 0;
     protected int displayedFrameCount = 0;
     protected volatile int video_pts_last = 0;
-    
+
     /** See {@link #getAudioSink()}. Set by implementation if used from within {@link #initStreamImpl(int, int)}! */
     protected AudioSink audioSink = null;
     protected boolean audioSinkPlaySpeedSet = false;
-    
+
     /** System Clock Reference (SCR) of first audio PTS at start time. */
     private long audio_scr_t0 = 0;
     private boolean audioSCR_reset = true;
-    
+
     /** System Clock Reference (SCR) of first video frame at start time. */
     private long video_scr_t0 = 0;
     /** System Clock Reference (SCR) PTS offset, i.e. first video PTS at start time. */
@@ -152,7 +152,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     private float video_dpts_cum = 0;
     /** Cumulative video frames. */
     private int video_dpts_count = 0;
-    /** Number of min frame count required for video cumulative sync. */ 
+    /** Number of min frame count required for video cumulative sync. */
     private static final int VIDEO_DPTS_NUM = 20;
     /** Cumulative coefficient, value {@value}. */
     private static final float VIDEO_DPTS_COEFF = 0.7943282f; // (float) Math.exp(Math.log(0.01) / VIDEO_DPTS_NUM);
@@ -160,7 +160,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     private static final int VIDEO_DPTS_MAX = 5000; // 5s max diff
     /** Trigger video PTS reset with given cause as bitfield. */
     private boolean videoSCR_reset = false;
-    
+
     protected TextureFrame[] videoFramesOrig = null;
     protected Ringbuffer<TextureFrame> videoFramesFree =  null;
     protected Ringbuffer<TextureFrame> videoFramesDecoded =  null;
@@ -177,42 +177,42 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         this.textureTarget=GL.GL_TEXTURE_2D;
         this.textureFormat = GL.GL_RGBA;
         this.textureInternalFormat = GL.GL_RGBA;
-        this.textureType = GL.GL_UNSIGNED_BYTE;        
+        this.textureType = GL.GL_UNSIGNED_BYTE;
         this.texUnit = 0;
         this.state = State.Uninitialized;
     }
 
     @Override
     public final void setTextureUnit(int u) { texUnit = u; }
-    
+
     @Override
     public final int getTextureUnit() { return texUnit; }
-    
+
     @Override
     public final int getTextureTarget() { return textureTarget; }
-    
+
     @Override
     public final int getTextureCount() { return textureCount; }
-    
+
     protected final void setTextureTarget(int target) { textureTarget=target; }
-    protected final void setTextureFormat(int internalFormat, int format) { 
-        textureInternalFormat=internalFormat; 
-        textureFormat=format; 
-    }    
+    protected final void setTextureFormat(int internalFormat, int format) {
+        textureInternalFormat=internalFormat;
+        textureFormat=format;
+    }
     protected final void setTextureType(int t) { textureType=t; }
 
     public final void setTextureMinMagFilter(int[] minMagFilter) { texMinMagFilter[0] = minMagFilter[0]; texMinMagFilter[1] = minMagFilter[1];}
     public final int[] getTextureMinMagFilter() { return texMinMagFilter; }
-    
+
     public final void setTextureWrapST(int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
-    public final int[] getTextureWrapST() { return texWrapST; }    
-    
+    public final int[] getTextureWrapST() { return texWrapST; }
+
     private final void checkGLInit() {
         if(State.Uninitialized == state || State.Initialized == state ) {
             throw new IllegalStateException("GL not initialized: "+this);
-        }        
+        }
     }
-    
+
     @Override
     public String getRequiredExtensionsShaderStub() throws IllegalStateException {
         checkGLInit();
@@ -221,24 +221,24 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
         return "";
     }
-        
+
     @Override
     public String getTextureSampler2DType() throws IllegalStateException {
         checkGLInit();
         switch(textureTarget) {
             case GL.GL_TEXTURE_2D:
-            case GL2.GL_TEXTURE_RECTANGLE: 
+            case GL2.GL_TEXTURE_RECTANGLE:
                 return TextureSequence.sampler2D;
             case GLES2.GL_TEXTURE_EXTERNAL_OES:
                 return TextureSequence.samplerExternalOES;
             default:
-                throw new GLException("Unsuported texture target: "+toHexString(textureTarget));            
+                throw new GLException("Unsuported texture target: "+toHexString(textureTarget));
         }
     }
-    
+
     /**
      * {@inheritDoc}
-     * 
+     *
      * This implementation simply returns the build-in function name of <code>texture2D</code>,
      * if not overridden by specialization.
      */
@@ -247,31 +247,31 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         checkGLInit();
         return "texture2D";
     }
-    
+
     /**
      * {@inheritDoc}
-     * 
-     * This implementation simply returns an empty string since it's using 
+     *
+     * This implementation simply returns an empty string since it's using
      * the build-in function <code>texture2D</code>,
      * if not overridden by specialization.
      */
     @Override
     public String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
         checkGLInit();
-        return ""; 
+        return "";
     }
-    
+
     @Override
     public final int getDecodedFrameCount() { return decodedFrameCount; }
-    
+
     @Override
     public final int getPresentedFrameCount() { return presentedFrameCount; }
-    
+
     @Override
     public final int getVideoPTS() { return video_pts_last; }
-    
+
     @Override
-    public final int getAudioPTS() { 
+    public final int getAudioPTS() {
         if( State.Uninitialized != state ) {
             return getAudioPTSImpl();
         }
@@ -285,10 +285,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             return 0;
         }
     }
-    
+
     @Override
     public final State getState() { return state; }
-    
+
     @Override
     public final State play() {
         synchronized( stateLock ) {
@@ -310,7 +310,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
     protected abstract boolean playImpl();
-    
+
     @Override
     public final State pause(boolean flush) {
         return pauseImpl(flush, 0);
@@ -337,7 +337,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
     protected abstract boolean pauseImpl();
-    
+
     @Override
     public final State destroy(GL gl) {
         return destroyImpl(gl, 0);
@@ -354,7 +354,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
     protected abstract void destroyImpl(GL gl);
-    
+
     @Override
     public final int seek(int msec) {
         synchronized( stateLock ) {
@@ -383,12 +383,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
     protected abstract int seekImpl(int msec);
-    
+
     @Override
     public final float getPlaySpeed() {
         return playSpeed;
     }
-    
+
     @Override
     public final boolean setPlaySpeed(float rate) {
         synchronized( stateLock ) {
@@ -410,18 +410,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             return res;
         }
     }
-    /** 
+    /**
      * Override if not using AudioSink, or AudioSink's {@link AudioSink#setPlaySpeed(float)} is not sufficient!
      * <p>
-     * AudioSink shall respect <code>!audioSinkPlaySpeedSet</code> to determine data_size 
+     * AudioSink shall respect <code>!audioSinkPlaySpeedSet</code> to determine data_size
      * at {@link AudioSink#enqueueData(com.jogamp.opengl.util.av.AudioSink.AudioFrame)}.
-     * </p> 
+     * </p>
      */
     protected boolean setPlaySpeedImpl(float rate) {
         if( null != audioSink ) {
             audioSinkPlaySpeedSet = audioSink.setPlaySpeed(rate);
         }
-        // still true, even if audioSink rejects command since we deal w/ video sync 
+        // still true, even if audioSink rejects command since we deal w/ video sync
         // and AudioSink w/ audioSinkPlaySpeedSet at enqueueData(..).
         return true;
     }
@@ -431,7 +431,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         getAudioVolumeImpl();
         return audioVolume;
     }
-    /** 
+    /**
      * Override if not using AudioSink, or AudioSink's {@link AudioSink#getVolume()} is not sufficient!
      */
     protected void getAudioVolumeImpl() {
@@ -439,7 +439,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             audioVolume = audioSink.getVolume();
         }
     }
-    
+
     @Override
     public boolean setAudioVolume(float v) {
         synchronized( stateLock ) {
@@ -460,7 +460,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             return res;
         }
     }
-    /** 
+    /**
      * Override if not using AudioSink, or AudioSink's {@link AudioSink#setVolume(float)} is not sufficient!
      */
     protected boolean setAudioVolumeImpl(float v) {
@@ -470,7 +470,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         // still true, even if audioSink rejects command ..
         return true;
     }
-    
+
     @Override
     public final void initStream(URI streamLoc, int vid, int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
         synchronized( stateLock ) {
@@ -490,7 +490,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
             decodedFrameCount = 0;
             presentedFrameCount = 0;
-            displayedFrameCount = 0;            
+            displayedFrameCount = 0;
             this.streamLoc = streamLoc;
 
             // Pre-parse for camera-input scheme
@@ -500,7 +500,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             if( null != streamLocScheme && streamLocScheme.equals(CameraInputScheme) ) {
                 final String rawPath = streamLoc.getRawPath();
                 if( null != rawPath && rawPath.length() > 0 ) {
-                    // cut-off root fwd-slash 
+                    // cut-off root fwd-slash
                     cameraPath = rawPath.substring(1);
                     final URIQueryProps props = URIQueryProps.create(streamLoc, ';');
                     cameraProps = props.getProperties();
@@ -508,7 +508,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     throw new IllegalArgumentException("Camera path is empty: "+streamLoc.toString());
                 }
             }
-            
+
             this.vid = vid;
             this.aid = aid;
             if (this.streamLoc != null) {
@@ -519,7 +519,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     /**
      * Implementation shall set the following set of data here
      * @see #vid
-     * @see #aid 
+     * @see #aid
      * @see #width
      * @see #height
      * @see #fps
@@ -530,7 +530,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * @see #vcodec
     */
     protected abstract void initStreamImpl(int vid, int aid) throws Exception;
-    
+
     @Override
     public final StreamException getStreamException() {
         synchronized( stateLock ) {
@@ -541,26 +541,26 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
         }
     }
-    
+
     @Override
     public final void initGL(GL gl) throws IllegalStateException, StreamException, GLException {
         synchronized( stateLock ) {
             if(State.Initialized != state ) {
                 throw new IllegalStateException("Stream not in state initialized: "+this);
-            }        
+            }
             final StreamException streamInitErr = streamWorker.getStreamErr();
             if( null != streamInitErr ) {
                 streamWorker = null; // already terminated!
                 destroy(null);
                 throw streamInitErr;
             }
-            try {                
+            try {
                 if( STREAM_ID_NONE != vid ) {
                     removeAllTextureFrames(gl);
                     initGLImpl(gl);
                     if(DEBUG) {
                         System.err.println("initGLImpl.X "+this);
-                    }                    
+                    }
                     videoFramesOrig = createTexFrames(gl, textureCount);
                     videoFramesFree = new LFRingbuffer<TextureFrame>(videoFramesOrig);
                     videoFramesDecoded = new LFRingbuffer<TextureFrame>(TextureFrame[].class, textureCount);
@@ -583,7 +583,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
         }
     }
-    /** 
+    /**
      * Shall initialize all GL related resources, if not audio-only.
      * <p>
      * Shall also take care of {@link AudioSink} initialization if appropriate.
@@ -593,8 +593,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * @throws GLException
      */
     protected abstract void initGLImpl(GL gl) throws IOException, GLException;
-    
-    /** 
+
+    /**
      * Returns the validated number of textures to be handled.
      * <p>
      * Default is {@link #TEXTURE_COUNT_MIN} minimum textures.
@@ -606,7 +606,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected int validateTextureCount(int desiredTextureCount) {
         return desiredTextureCount < TEXTURE_COUNT_MIN ? TEXTURE_COUNT_MIN : desiredTextureCount;
     }
-    
+
     protected TextureFrame[] createTexFrames(GL gl, final int count) {
         final int[] texNames = new int[count];
         gl.glGenTextures(count, texNames, 0);
@@ -621,7 +621,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         return texFrames;
     }
     protected abstract TextureFrame createTexImage(GL gl, int texName);
-    
+
     protected final Texture createTexImageImpl(GL gl, int texName, int tWidth, int tHeight) {
         if( 0 > texName ) {
             throw new RuntimeException("TextureName "+toHexString(texName)+" invalid.");
@@ -661,19 +661,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
         }
         gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, texMinMagFilter[0]);
-        gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, texMinMagFilter[1]);        
+        gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, texMinMagFilter[1]);
         gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, texWrapST[0]);
         gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, texWrapST[1]);
-        
+
         return com.jogamp.opengl.util.texture.TextureIO.newTexture(
                      texName, textureTarget,
                      tWidth, tHeight,
                      width,  height,
-                     !isInGLOrientation);        
+                     !isInGLOrientation);
     }
-        
+
     protected void destroyTexFrame(GL gl, TextureFrame frame) {
-        frame.getTexture().destroy(gl);        
+        frame.getTexture().destroy(gl);
     }
 
     @Override
@@ -683,7 +683,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
         return lastFrame;
     }
-    
+
     private final void removeAllTextureFrames(GL gl) {
         final TextureFrame[] texFrames = videoFramesOrig;
         videoFramesOrig = null;
@@ -699,14 +699,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     }
                     texFrames[i] = null;
                 }
-                System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null");            
-            }        
+                System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null");
+            }
         }
     }
-    
+
     protected TextureFrame cachedFrame = null;
     protected long lastTimeMillis = 0;
-    
+
     @Override
     public final TextureFrame getNextTexture(GL gl) throws IllegalStateException {
         synchronized( stateLock ) {
@@ -750,7 +750,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 } else {
                                     d_apts = 0;
                                 }
-                                
+
                                 final int frame_period_last = video_pts - video_pts_last; // rendering loop interrupted ?
                                 if( videoSCR_reset || frame_period_last > frame_duration*10 ) {
                                     videoSCR_reset = false;
@@ -782,7 +782,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                         cachedFrame = nextFrame;
                                         nextFrame = null;
                                     } else if ( !droppedFrame && dt < -maxVideoDelay && videoFramesDecoded.size() > 0 ) {
-                                        // only drop if prev. frame has not been dropped and 
+                                        // only drop if prev. frame has not been dropped and
                                         // frame is too late and one decoded frame is already available.
                                         dropFrame = true;
                                     }
@@ -791,7 +791,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                         System.err.println( "AV_: dT "+(currentTimeMillis-lastTimeMillis)+", "+
                                                 getPerfStringImpl( video_scr, video_pts, d_vpts,
                                                                    audio_scr, audio_pts, d_apts,
-                                                                   video_dpts_avg_diff ) + 
+                                                                   video_dpts_avg_diff ) +
                                                                    ", avg dpy-fps "+avg_dpy_duration+" ms/f, maxD "+maxVideoDelay+" ms, "+_nextFrame+", playCached " + playCached + ", dropFrame "+dropFrame);
                                     }
                                 }
@@ -803,7 +803,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 lastFrame = nextFrame;
                                 videoFramesFree.putBlocking(_lastFrame);
                             }
-                        } else if( DEBUG ) {                            
+                        } else if( DEBUG ) {
                             final int video_pts = lastFrame.getPTS();
                             final int audio_pts = getAudioPTSImpl();
                             final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
@@ -835,25 +835,25 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * Audio frames, i.e. {@link AudioSink.AudioFrame}, shall be handled in the process.
      * <p>
      * Video frames shall be ignored, if {@link #getVID()} is {@link #STREAM_ID_NONE}.
-     * </p> 
+     * </p>
      * <p>
      * Audio frames shall be ignored, if {@link #getAID()} is {@link #STREAM_ID_NONE}.
      * </p>
      * <p>
      * Method may be invoked on the <a href="#streamworker"><i>StreamWorker</i> decoding thread</a>.
-     * </p> 
+     * </p>
      * <p>
      * Implementation shall care of OpenGL synchronization as required, e.g. glFinish()/glFlush()!
      * </p>
-     * @param gl valid and current GL instance, shall be <code>null</code> for audio only. 
+     * @param gl valid and current GL instance, shall be <code>null</code> for audio only.
      * @param nextFrame the {@link TextureFrame} to store the video PTS and texture data,
      *                  shall be <code>null</code> for audio only.
      * @return the last processed video PTS value, maybe {@link TimeFrameI#INVALID_PTS} if video frame is invalid or n/a.
-     *         Will be {@link TimeFrameI#END_OF_STREAM_PTS} if end of stream reached. 
+     *         Will be {@link TimeFrameI#END_OF_STREAM_PTS} if end of stream reached.
      */
     protected abstract int getNextTextureImpl(GL gl, TextureFrame nextFrame);
-    
-    /** 
+
+    /**
      * {@inheritDoc}
      * <p>
      * Note: All {@link AudioSink} operations are performed from {@link GLMediaPlayerImpl},
@@ -866,8 +866,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      */
     @Override
     public final AudioSink getAudioSink() { return audioSink; }
-    
-    /** 
+
+    /**
      * To be called from implementation at 1st PTS after start
      * w/ current pts value in milliseconds.
      * @param audio_scr_t0
@@ -908,10 +908,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     private final int getVideoDPTSAvg() {
         return (int) ( video_dpts_cum * (1.0f - VIDEO_DPTS_COEFF) + 0.5f );
     }
-    
+
     private final void newFrameAvailable(TextureFrame frame, long currentTimeMillis) {
         decodedFrameCount++;
-        if( 0 == frame.getDuration() ) { // patch frame duration if not set already 
+        if( 0 == frame.getDuration() ) { // patch frame duration if not set already
             frame.setDuration( (int) frame_duration );
         }
         synchronized(eventListenersLock) {
@@ -920,38 +920,38 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
         }
     }
-    
+
     class StreamWorker extends Thread {
         private volatile boolean isRunning = false;
         private volatile boolean isActive = false;
         private volatile boolean isBlocked = false;
-        
+
         private volatile boolean shallPause = true;
         private volatile boolean shallStop = false;
-        
+
         private volatile StreamException streamErr = null;
         private volatile GLContext sharedGLCtx = null;
         private boolean sharedGLCtxCurrent = false;
         private GLDrawable dummyDrawable = null;
-        
-        /** 
-         * Starts this daemon thread, 
+
+        /**
+         * Starts this daemon thread,
          * which initializes the stream first via {@link GLMediaPlayerImpl#initStreamImpl(int, int)} first.
          * <p>
          * After stream initialization, this thread pauses!
          * </p>
-         **/ 
+         **/
         StreamWorker() {
             setDaemon(true);
             start();
         }
-        
+
         private void makeCurrent(GLContext ctx) {
             if( GLContext.CONTEXT_NOT_CURRENT >= ctx.makeCurrent() ) {
                 throw new GLException("Couldn't make ctx current: "+ctx);
             }
         }
-        
+
         private void destroySharedGL() {
             if( null != sharedGLCtx ) {
                 if( sharedGLCtx.isCreated() ) {
@@ -963,16 +963,16 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         gle.printStackTrace();
                     }
                 }
-                sharedGLCtx = null;            
+                sharedGLCtx = null;
             }
             if( null != dummyDrawable ) {
                 final AbstractGraphicsDevice device = dummyDrawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
                 dummyDrawable.setRealized(false);
                 dummyDrawable = null;
                 device.close();
-            }            
+            }
         }
-        
+
         public synchronized void initGL(GL gl) {
             final GLContext glCtx = gl.getContext();
             final boolean glCtxCurrent = glCtx.isCurrent();
@@ -1013,7 +1013,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     while( !isActive ) {
                         this.notify();  // wake-up pause-block
                         try {
-                            this.wait(); // wait until resumed 
+                            this.wait(); // wait until resumed
                         } catch (InterruptedException e) {
                             e.printStackTrace();
                         }
@@ -1041,12 +1041,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
         public boolean isRunning() { return isRunning; }
         public boolean isActive() { return isActive; }
-        public StreamException getStreamErr() { return streamErr; } 
-        
+        public StreamException getStreamErr() { return streamErr; }
+
         public void run() {
             setName(getName()+"-StreamWorker_"+StreamWorkerInstanceId);
             StreamWorkerInstanceId++;
-            
+
             synchronized ( this ) {
                 isRunning = true;
                 try {
@@ -1061,7 +1061,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     return; // end of thread!
                 } // also initializes width, height, .. etc
             }
-            
+
             while( !shallStop ){
                 if( shallPause ) {
                     synchronized ( this ) {
@@ -1100,7 +1100,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         }
                     }
                 }
-                
+
                 if( !shallStop ) {
                     TextureFrame nextFrame = null;
                     try {
@@ -1121,7 +1121,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                     Thread.sleep(STREAM_WORKER_DELAY);
                                 }
                                 if( !videoFramesDecoded.put(nextFrame) ) {
-                                    throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); 
+                                    throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this);
                                 }
                                 newFrameAvailable(nextFrame, Platform.currentTimeMillis());
                                 nextFrame = null;
@@ -1170,10 +1170,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 this.notify(); // wake-up doStop()
             }
         }
-    }    
-    static int StreamWorkerInstanceId = 0;    
+    }
+    static int StreamWorkerInstanceId = 0;
     private StreamWorker streamWorker = null;
-    
+
     protected final int addStateEventMask(int event_mask, State newState) {
         if( state != newState ) {
             switch( newState ) {
@@ -1193,7 +1193,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
         return event_mask;
     }
-    
+
     protected final void attributesUpdated(int event_mask) {
         if( 0 != event_mask ) {
             final long now = Platform.currentTimeMillis();
@@ -1204,7 +1204,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
         }
     }
-    
+
     protected final void changeState(int event_mask, State newState) {
         event_mask = addStateEventMask(event_mask, newState);
         if( 0 != event_mask ) {
@@ -1212,9 +1212,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             attributesUpdated( event_mask );
         }
     }
-    
-    protected final void updateAttributes(int vid, int aid, int width, int height, int bps_stream, 
-                                          int bps_video, int bps_audio, float fps, 
+
+    protected final void updateAttributes(int vid, int aid, int width, int height, int bps_stream,
+                                          int bps_video, int bps_audio, float fps,
                                           int videoFrames, int audioFrames, int duration, String vcodec, String acodec) {
         int event_mask = 0;
         if( state == State.Uninitialized ) {
@@ -1227,19 +1227,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         if( this.vid != vid ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_VID;
             this.vid = vid;
-        }   
+        }
         if( STREAM_ID_AUTO == vid ) {
             vid = STREAM_ID_NONE;
         }
         if( this.aid != aid ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_AID;
             this.aid = aid;
-        }   
+        }
         if( this.width != width || this.height != height ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_SIZE;
             this.width = width;
             this.height = height;
-        }   
+        }
         if( this.fps != fps ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_FPS;
             this.fps = fps;
@@ -1257,7 +1257,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             this.audioFrames = audioFrames;
             this.duration = duration;
         }
-        if( (null!=acodec && acodec.length()>0 && !this.acodec.equals(acodec)) ) { 
+        if( (null!=acodec && acodec.length()>0 && !this.acodec.equals(acodec)) ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_CODEC;
             this.acodec = acodec;
         }
@@ -1283,7 +1283,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             attributesUpdated(GLMediaEventListener.EVENT_CHANGE_SIZE);
         }
     }
-    
+
     @Override
     public final URI getURI() {
         return streamLoc;
@@ -1291,10 +1291,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
     @Override
     public final int getVID() { return vid; }
-    
+
     @Override
     public final int getAID() { return aid; }
-    
+
     @Override
     public final String getVideoCodec() {
         return vcodec;
@@ -1309,7 +1309,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final int getVideoFrames() {
         return videoFrames;
     }
-    
+
     @Override
     public final int getAudioFrames() {
         return audioFrames;
@@ -1319,7 +1319,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final int getDuration() {
         return duration;
     }
-    
+
     @Override
     public final long getStreamBitrate() {
         return bps_stream;
@@ -1329,12 +1329,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final int getVideoBitrate() {
         return bps_video;
     }
-    
+
     @Override
     public final int getAudioBitrate() {
         return bps_audio;
     }
-    
+
     @Override
     public final float getFramerate() {
         return fps;
@@ -1344,7 +1344,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final boolean isGLOriented() {
         return isInGLOrientation;
     }
-    
+
     @Override
     public final int getWidth() {
         return width;
@@ -1369,11 +1369,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", glOrient "+isInGLOrientation+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
                "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]";
     }
-    
+
     @Override
     public final String getPerfString() {
         final long currentTimeMillis = Platform.currentTimeMillis();
-        final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed );        
+        final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed );
         final int d_vpts = video_pts_last - video_scr;
         final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
         final int audio_pts = getAudioPTSImpl();
@@ -1383,7 +1383,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     private final String getPerfStringImpl(final int video_scr, final int video_pts, final int d_vpts,
                                            final int audio_scr, final int audio_pts, final int d_apts,
                                            final int video_dpts_avg_diff) {
-        final float tt = getDuration() / 1000.0f;        
+        final float tt = getDuration() / 1000.0f;
         final String audioSinkInfo;
         final AudioSink audioSink = getAudioSink();
         if( null != audioSink ) {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
index 85fab96a4..6e006d9c0 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
@@ -22,75 +22,75 @@ public class JavaSoundAudioSink implements AudioSink {
     public static final int BUFFER_SIZE = 1000;
     public static final int SAMPLES_PER_BUFFER = BUFFER_SIZE / 2;
     private static final boolean staticAvailable;
-    
+
     // Sample time values
     // public static final double SAMPLE_TIME_IN_SECS = 1.0 / DEFAULT_SAMPLE_RATE;
     // public static final double BUFFER_TIME_IN_SECS = SAMPLE_TIME_IN_SECS * SAMPLES_PER_BUFFER;
-    
+
     private javax.sound.sampled.AudioFormat format;
     private DataLine.Info info;
     private SourceDataLine auline;
     private int bufferCount;
-    private byte [] sampleData = new byte[BUFFER_SIZE];  
+    private byte [] sampleData = new byte[BUFFER_SIZE];
     private boolean initialized = false;
     private AudioSink.AudioFormat chosenFormat = null;
-    
+
     private volatile boolean playRequested = false;
     private float volume = 1.0f;
-    
+
     static {
         boolean ok = false;
         try {
             AudioSystem.getAudioFileTypes();
             ok = true;
         } catch (Throwable t) {
-            
+
         }
         staticAvailable=ok;
-    }   
-    
+    }
+
     @Override
     public String toString() {
         return "JavaSoundSink[init "+initialized+", dataLine "+info+", source "+auline+", bufferCount "+bufferCount+
                ", chosen "+chosenFormat+", jsFormat "+format;
     }
-    
+
     @Override
     public final float getPlaySpeed() { return 1.0f; } // FIXME
-    
+
     @Override
-    public final boolean setPlaySpeed(float rate) { 
-        return false; // FIXME 
+    public final boolean setPlaySpeed(float rate) {
+        return false; // FIXME
     }
-    
+
     @Override
     public final float getVolume() {
         // FIXME
-        return volume;        
+        return volume;
     }
-    
+
     @Override
     public final boolean setVolume(float v) {
         // FIXME
         volume = v;
         return true;
     }
-    
+
     @Override
     public AudioSink.AudioFormat getPreferredFormat() {
         return DefaultFormat;
     }
-    
+
     @Override
     public final int getMaxSupportedChannels() {
         return 2;
     }
-    
+
     @Override
     public final boolean isSupported(AudioSink.AudioFormat format) {
         return true;
     }
-    
+
     @Override
     public boolean init(AudioSink.AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
         if( !staticAvailable ) {
@@ -117,12 +117,12 @@ public class JavaSoundAudioSink implements AudioSink {
         }
         return true;
     }
-    
+
     @Override
     public boolean isPlaying() {
         return playRequested && auline.isRunning();
     }
-    
+
     @Override
     public void play() {
         if( null != auline ) {
@@ -135,7 +135,7 @@ public class JavaSoundAudioSink implements AudioSink {
             auline.start();
         }
     }
-    
+
     @Override
     public void pause() {
         if( null != auline ) {
@@ -143,9 +143,9 @@ public class JavaSoundAudioSink implements AudioSink {
             auline.stop();
         }
     }
-    
+
     @Override
-    public void flush() {        
+    public void flush() {
         if( null != auline ) {
             playRequested = false;
             auline.stop();
@@ -157,17 +157,17 @@ public class JavaSoundAudioSink implements AudioSink {
     public final int getEnqueuedFrameCount() {
         return 0; // FIXME
     }
-    
+
     @Override
     public int getFrameCount() {
         return 1;
     }
-    
+
     @Override
     public int getQueuedFrameCount() {
         return 0;
     }
-    
+
     @Override
     public boolean isInitialized() {
         return initialized;
@@ -179,7 +179,7 @@ public class JavaSoundAudioSink implements AudioSink {
         chosenFormat = null;
         // FIXEM: complete code!
     }
-    
+
     @Override
     public AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
         int byteSize = audioDataFrame.getByteSize();
@@ -188,7 +188,7 @@ public class JavaSoundAudioSink implements AudioSink {
         final int p = byteBuffer.position();
         byteBuffer.get(bytes, 0, byteSize);
         byteBuffer.position(p);
-        
+
         int written = 0;
         int len;
         while (byteSize > 0) {
@@ -203,27 +203,27 @@ public class JavaSoundAudioSink implements AudioSink {
     @Override
     public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
         return enqueueData(new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), bytes, byteCount));
-    }    
-    
+    }
+
     @Override
     public int getQueuedByteCount() {
         return auline.getBufferSize() - auline.available();
     }
-    
+
     @Override
     public int getFreeFrameCount() {
         return auline.available();
     }
-    
+
     @Override
     public int getQueuedTime() {
         return getQueuedTimeImpl( getQueuedByteCount() );
     }
     private final int getQueuedTimeImpl(int byteCount) {
         final int bytesPerSample = chosenFormat.sampleSize >>> 3; // /8
-        return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) );        
+        return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) );
     }
 
     @Override
-    public final int getPTS() { return 0; } // FIXME        
+    public final int getPTS() { return 0; } // FIXME
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
index 723bb9dd1..8d3dbdf44 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
@@ -15,32 +15,32 @@ public class NullAudioSink implements AudioSink {
     private volatile float playSpeed = 1.0f;
     private volatile boolean playRequested = false;
     private float volume = 1.0f;
-        
+
     @Override
     public final float getPlaySpeed() { return playSpeed; }
-    
+
     @Override
-    public final boolean setPlaySpeed(float rate) { 
+    public final boolean setPlaySpeed(float rate) {
         if( Math.abs(1.0f - rate) < 0.01f ) {
             rate = 1.0f;
         }
-        playSpeed = rate; 
+        playSpeed = rate;
         return true;
     }
-    
+
     @Override
     public final float getVolume() {
         // FIXME
-        return volume;        
+        return volume;
     }
-    
+
     @Override
     public final boolean setVolume(float v) {
         // FIXME
-        volume = v;        
+        volume = v;
         return true;
     }
-    
+
     @Override
     public AudioFormat getPreferredFormat() {
         return DefaultFormat;
@@ -50,73 +50,73 @@ public class NullAudioSink implements AudioSink {
     public final int getMaxSupportedChannels() {
         return 8;
     }
-    
+
     @Override
     public final boolean isSupported(AudioFormat format) {
         return true;
     }
-    
+
     @Override
     public boolean init(AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
         return true;
     }
-    
+
     @Override
     public boolean isPlaying() {
         return playRequested;
     }
-    
+
     @Override
     public void play() {
         playRequested = true;
     }
-    
+
     @Override
     public void pause() {
         playRequested = false;
     }
-    
+
     @Override
-    public void flush() {        
+    public void flush() {
     }
-    
+
     @Override
     public void destroy() {
     }
-    
+
     @Override
     public final int getEnqueuedFrameCount() {
         return 0;
     }
-    
+
     @Override
     public int getFrameCount() {
         return 0;
     }
-    
+
     @Override
     public int getQueuedFrameCount() {
         return 0;
     }
-    
+
     @Override
     public int getQueuedByteCount() {
         return 0;
     }
-    
+
     @Override
     public int getQueuedTime() {
         return 0;
     }
-    
+
     @Override
     public final int getPTS() { return 0; }
-    
+
     @Override
     public int getFreeFrameCount() {
-        return 1;        
+        return 1;
     }
-    
+
     @Override
     public AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
         return null;
@@ -125,5 +125,5 @@ public class NullAudioSink implements AudioSink {
     @Override
     public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
         return null;
-    }    
+    }
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index 1cddaa9cf..840149272 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -54,10 +54,10 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     private TextureData texData = null;
     private int pos_ms = 0;
     private long pos_start = 0;
-    
+
     public NullGLMediaPlayer() {
         super();
-        
+
     }
 
     @Override
@@ -82,16 +82,16 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
         validatePos();
         return pos_ms;
     }
-    
+
     @Override
     protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         final int pts = getAudioPTSImpl();
         nextFrame.setPTS( pts );
         return pts;
     }
-    
+
     @Override
-    protected final int getAudioPTSImpl() { 
+    protected final int getAudioPTSImpl() {
         pos_ms = (int) ( Platform.currentTimeMillis() - pos_start );
         validatePos();
         return pos_ms;
@@ -102,9 +102,9 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
         if(null != texData) {
             texData.destroy();
             texData = null;
-        }                      
+        }
     }
-    
+
     public final static TextureData createTestTextureData() {
         TextureData res = null;
         try {
@@ -125,28 +125,28 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
             buffer.rewind();
             res = new TextureData(GLProfile.getGL2ES2(),
                    GL.GL_RGBA, w, h, 0,
-                   GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, false, 
+                   GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, false,
                    false, false, buffer, null);
         }
         return res;
     }
-        
+
     @Override
     protected final void initStreamImpl(int vid, int aid) throws IOException {
         texData = createTestTextureData();
         final float _fps = 24f;
         final int _duration = 10*60*1000; // msec
         final int _totalFrames = (int) ( (_duration/1000)*_fps );
-        updateAttributes(0 /* fake */, GLMediaPlayer.STREAM_ID_NONE, 
-                         texData.getWidth(), texData.getHeight(), 0, 
-                         0, 0, _fps, 
+        updateAttributes(0 /* fake */, GLMediaPlayer.STREAM_ID_NONE,
+                         texData.getWidth(), texData.getHeight(), 0,
+                         0, 0, _fps,
                          _totalFrames, 0, _duration, "png-static", null);
-    }    
+    }
     @Override
     protected final void initGLImpl(GL gl) throws IOException, GLException {
         isInGLOrientation = true;
     }
-    
+
     /**
      * {@inheritDoc}
      * <p>
@@ -157,21 +157,21 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     protected int validateTextureCount(int desiredTextureCount) {
         return 2;
     }
-    
+
     @Override
     protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
         final Texture texture = super.createTexImageImpl(gl, texName, width, height);
         if(null != texData) {
             texture.updateImage(gl, texData);
-        }                      
+        }
         return new TextureSequence.TextureFrame( texture );
     }
-    
+
     @Override
     protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
         super.destroyTexFrame(gl, frame);
     }
-    
+
     private void validatePos() {
         boolean considerPausing = false;
         if( 0 > pos_ms) {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index 146a47ebc..390c20346 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl.util.av.impl;
 
 import java.security.AccessController;
@@ -48,9 +48,9 @@ import com.jogamp.common.util.VersionNumber;
  */
 class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     private static final boolean DEBUG = FFMPEGMediaPlayer.DEBUG || DynamicLibraryBundleInfo.DEBUG;
-    
+
     private static final List<String> glueLibNames = new ArrayList<String>(); // none
-    
+
     private static final int symbolCount = 65;
     private static final String[] symbolNames = {
          "avutil_version",
@@ -61,10 +61,10 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
 
          // libavcodec
          "avcodec_register_all",
-         "avcodec_close", 
-         "avcodec_string", 
-         "avcodec_find_decoder", 
-         "avcodec_open2",             // 53.6.0    (opt) 
+         "avcodec_close",
+         "avcodec_string",
+         "avcodec_find_decoder",
+         "avcodec_open2",             // 53.6.0    (opt)
          "avcodec_alloc_frame",
          "avcodec_get_frame_defaults",
          "avcodec_free_frame",        // 54.28.0   (opt)
@@ -79,10 +79,10 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "av_init_packet",
          "av_new_packet",
          "av_destruct_packet",
-         "av_free_packet", 
+         "av_free_packet",
          "avcodec_decode_audio4",     // 53.25.0   (opt)
 /* 27 */ "avcodec_decode_video2",     // 52.23.0
-        
+
          // libavutil
          "av_pix_fmt_descriptors",
          "av_frame_unref",            // 55.0.0 (opt)
@@ -101,10 +101,10 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avformat_alloc_context",
          "avformat_free_context",     // 52.96.0   (opt)
          "avformat_close_input",      // 53.17.0   (opt)
-         "av_register_all", 
+         "av_register_all",
          "av_find_input_format",
-         "avformat_open_input", 
-         "av_dump_format", 
+         "avformat_open_input",
+         "av_dump_format",
          "av_read_frame",
          "av_seek_frame",
          "avformat_seek_file",        // ???       (opt)
@@ -115,24 +115,24 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
 /* 54 */ "avformat_find_stream_info", // 53.3.0    (opt)
 
          // libavdevice
-/* 55 */ "avdevice_register_all",     // ??? 
-         
+/* 55 */ "avdevice_register_all",     // ???
+
          // libavresample
          "avresample_alloc_context",  //  1.0.1
          "avresample_open",
          "avresample_close",
          "avresample_free",
 /* 60 */ "avresample_convert",
-                  
+
          // libavresample
          "av_opt_set_sample_fmt",     // actually lavu .. but exist only w/ swresample!
          "swr_alloc",
-         "swr_init",       
+         "swr_init",
          "swr_free",
 /* 65 */ "swr_convert",
 
     };
-    
+
     // optional symbol names
     private static final String[] optionalSymbolNames = {
          "avformat_seek_file",        // ???       (opt)
@@ -145,7 +145,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
 
          // libavdevice
          "avdevice_register_all",     // 53.0.0 (opt)
-         
+
          // libavresample
          "avresample_version",        //  1.0.1
          "avresample_alloc_context",  //  1.0.1
@@ -153,43 +153,43 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
          "avresample_close",
          "avresample_free",
          "avresample_convert",
-         
+
          // libavresample
          "av_opt_set_sample_fmt",     // actually lavu .. but exist only w/ swresample!
          "swresample_version",        //  0
          "swr_alloc",
-         "swr_init",       
+         "swr_init",
          "swr_free",
          "swr_convert",
     };
-    
+
     private static final long[] symbolAddr = new long[symbolCount];
     private static final boolean ready;
     private static final boolean libsUFCLoaded;
     private static final boolean avresampleLoaded;  // optional
     private static final boolean swresampleLoaded;  // optional
     private static final boolean avdeviceLoaded; // optional
-    static final VersionNumber avCodecVersion;    
+    static final VersionNumber avCodecVersion;
     static final VersionNumber avFormatVersion;
     static final VersionNumber avUtilVersion;
     static final VersionNumber avResampleVersion;
     static final VersionNumber swResampleVersion;
     private static final FFMPEGNatives natives;
-    
+
     private static final int LIB_IDX_UTI = 0;
     private static final int LIB_IDX_FMT = 1;
     private static final int LIB_IDX_COD = 2;
     private static final int LIB_IDX_DEV = 3;
     private static final int LIB_IDX_AVR = 4;
     private static final int LIB_IDX_SWR = 5;
-    
+
     static {
-        // native ffmpeg media player implementation is included in jogl_desktop and jogl_mobile     
+        // native ffmpeg media player implementation is included in jogl_desktop and jogl_mobile
         GLProfile.initSingleton();
         boolean _ready = false;
-        /** util, format, codec, device, avresample, swresample */  
-        boolean[] _loaded= new boolean[6]; 
-        /** util, format, codec, avresample, swresample */  
+        /** util, format, codec, device, avresample, swresample */
+        boolean[] _loaded= new boolean[6];
+        /** util, format, codec, avresample, swresample */
         VersionNumber[] _versions = new VersionNumber[5];
         try {
             _ready = initSymbols(_loaded, _versions);
@@ -226,7 +226,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
             } else {
                 System.err.println("LIB_AV No Version/Native-Impl Match");
                 natives = null;
-            }            
+            }
             if( null != natives && FFMPEGStaticNatives.initIDs0() ) {
                 ready = natives.initSymbols0(symbolAddr, symbolCount);
             } else {
@@ -234,7 +234,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
             }
         }
     }
-    
+
     static boolean libsLoaded() { return libsUFCLoaded; }
     static boolean avDeviceLoaded() { return avdeviceLoaded; }
     static boolean avResampleLoaded() { return avresampleLoaded; }
@@ -265,11 +265,11 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         if(symbolNames.length != symbolCount) {
             throw new InternalError("XXX0 "+symbolNames.length+" != "+symbolCount);
         }
-        
+
         // optional symbol name set
         final Set<String> optionalSymbolNameSet = new HashSet<String>();
         optionalSymbolNameSet.addAll(Arrays.asList(optionalSymbolNames));
-        
+
         // lookup
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
@@ -278,9 +278,9 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
                 }
                 return null;
             } } );
-        
+
         // validate results
-        boolean res = true; 
+        boolean res = true;
         for(int i = 0; i<symbolCount; i++) {
             if( 0 == symbolAddr[i] ) {
                 // no symbol, check optional and alternative symbols
@@ -298,10 +298,10 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         versions[2] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[2]));
         versions[3] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[3]));
         versions[4] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[4]));
-        
+
         return res;
     }
-    
+
     protected FFMPEGDynamicLibraryBundleInfo() {
     }
 
@@ -313,12 +313,12 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
      * <p>
      * Returns <code>true</code>.
      * </p>
-     */ 
+     */
     @Override
     public final boolean shallLookupGlobal() {
-        return true; 
+        return true;
     }
-    
+
     @Override
     public final List<String> getGlueLibNames() {
         return glueLibNames;
@@ -329,7 +329,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         List<List<String>> libsList = new ArrayList<List<String>>();
 
         // 6: util, format, codec, device, avresample, swresample
-        
+
         final List<String> avutil = new ArrayList<String>();
         avutil.add("avutil");        // default
 
@@ -337,13 +337,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         avutil.add("libavutil.so.52");     // ffmpeg 1.2 + 2 / libav 9 + 10
         avutil.add("libavutil.so.51");     // 0.8
         avutil.add("libavutil.so.50");     // 0.7
-        
+
         avutil.add("avutil-53");     // dummy future proof
         avutil.add("avutil-52");     // ffmpeg 1.2 + 2 / libav 9 + 10
         avutil.add("avutil-51");     // 0.8
         avutil.add("avutil-50");     // 0.7
         libsList.add(avutil);
-        
+
         final List<String> avformat = new ArrayList<String>();
         avformat.add("avformat");    // default
 
@@ -352,14 +352,14 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         avformat.add("libavformat.so.54"); // ffmpeg 1.2 / libav 9
         avformat.add("libavformat.so.53"); // 0.8
         avformat.add("libavformat.so.52"); // 0.7
-        
+
         avformat.add("avformat-56"); // dummy future proof
         avformat.add("avformat-55"); // ffmpeg 2 / libav 10
         avformat.add("avformat-54"); // ffmpeg 1.2 / libav 9
         avformat.add("avformat-53"); // 0.8
-        avformat.add("avformat-52"); // 0.7        
+        avformat.add("avformat-52"); // 0.7
         libsList.add(avformat);
-        
+
         final List<String> avcodec = new ArrayList<String>();
         avcodec.add("avcodec");      // default
 
@@ -367,15 +367,15 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         avcodec.add("libavcodec.so.55");   // ffmpeg 2/ libav 10
         avcodec.add("libavcodec.so.54");   // ffmpeg 1.2 / libav 9
         avcodec.add("libavcodec.so.53");   // 0.8
-        avcodec.add("libavcodec.so.52");   // 0.7        
-        
+        avcodec.add("libavcodec.so.52");   // 0.7
+
         avcodec.add("avcodec-56");   // dummy future proof
         avcodec.add("avcodec-55");   // ffmpeg 2/ libav 10
         avcodec.add("avcodec-54");   // ffmpeg 1.2 / libav 9
         avcodec.add("avcodec-53");   // 0.8
-        avcodec.add("avcodec-52");   // 0.7 
+        avcodec.add("avcodec-52");   // 0.7
         libsList.add(avcodec);
-        
+
         final List<String> avdevice = new ArrayList<String>();
         avdevice.add("avdevice");        // default
 
@@ -383,19 +383,19 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         avdevice.add("libavdevice.so.55");     // ffmpeg 2
         avdevice.add("libavdevice.so.54");     // ffmpeg 1.2 / libav 10
         avdevice.add("libavdevice.so.53");     // 0.8 && libav 9
-        
+
         avdevice.add("avdevice-56");     // dummy future proof
         avdevice.add("avdevice-55");     // ffmpeg 2
         avdevice.add("avdevice-54");     // ffmpeg 1.2 / libav 10
         avdevice.add("avdevice-53");     // 0.8 && libav 9
         libsList.add(avdevice);
-        
+
         final List<String> avresample = new ArrayList<String>();
         avresample.add("avresample");        // default
 
         avresample.add("libavresample.so.2");     // dummy future proof
         avresample.add("libavresample.so.1");     // libav 9 + 10
-        
+
         avresample.add("avresample-2");     // dummy future proof
         avresample.add("avresample-1");     // libav 9 + 10
         libsList.add(avresample);
@@ -405,11 +405,11 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
 
         swresample.add("libswresample.so.1");     // dummy future proof
         swresample.add("libswresample.so.0");     // ffmpeg 1.2 + 2.x
-        
+
         swresample.add("swresample-1");     // dummy future proof
         swresample.add("swresample-0");     // ffmpeg 1.2 + 2.x
         libsList.add(swresample);
-        
+
         return libsList;
     }
 
@@ -431,5 +431,5 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     @Override
     public final RunnableExecutor getLibLoaderExecutor() {
         return DynamicLibraryBundle.getDefaultRunnableExecutor();
-    }    
+    }
 }
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 f196ebef1..2abd73181 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -65,18 +65,18 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  * Besides the default BSD/Linux/.. repositories and installations,
  * precompiled binaries can be found at the
  * <a href="#libavavail">listed location below</a>.
- * </p> 
- * 
+ * </p>
+ *
  * <a name="implspecifics"><h5>Implementation specifics</h5></a>
  * <p>
- * The decoded video frame is written directly into an OpenGL texture 
- * on the GPU in it's native format. A custom fragment shader converts 
- * the native pixelformat to a usable <i>RGB</i> format if required. 
- * Hence only 1 copy is required before bloating the picture 
+ * The decoded video frame is written directly into an OpenGL texture
+ * on the GPU in it's native format. A custom fragment shader converts
+ * the native pixelformat to a usable <i>RGB</i> format if required.
+ * Hence only 1 copy is required before bloating the picture
  * from <i>YUV*</i> to <i>RGB</i>, for example.
- * </p> 
+ * </p>
  * <p>
- * Implements pixel format conversion to <i>RGB</i> via  
+ * Implements pixel format conversion to <i>RGB</i> via
  * fragment shader texture-lookup functions:
  * <ul>
  *   <li>{@link PixelFormat#YUV420P}</li>
@@ -88,10 +88,10 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  * </ul>
  * </p>
  * <p>
- * 
+ *
  * <a name="libavspecifics"><h5>Libav Specifics</h5></a>
  * <p>
- * Utilizes a slim dynamic and native binding to the Lib_av 
+ * Utilizes a slim dynamic and native binding to the Lib_av
  * libraries:
  * <ul>
  *   <li>libavcodec</li>
@@ -99,9 +99,9 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  *   <li>libavutil</li>
  *   <li>libavresample (opt)</li>
  *   <li>libavdevice (opt)</li>
- * </ul> 
+ * </ul>
  * </p>
- * 
+ *
  * <a name="compatibility"><h5>LibAV Compatibility</h5></a>
  * <p>
  * Currently we are binary compatible w/:
@@ -115,25 +115,25 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  * <p>
  * See http://upstream-tracker.org/versions/libav.html
  * </p>
- * <p> 
- * Check tag 'FIXME: Add more planar formats !' 
+ * <p>
+ * Check tag 'FIXME: Add more planar formats !'
  * here and in the corresponding native code
  * <code>jogl/src/jogl/native/libav/ffmpeg_impl_template.c</code>
  * </p>
- * 
- * 
+ *
+ *
  * <a name="todo"><h5>TODO:</h5></a>
  * <p>
  * <ul>
  *   <li>better audio synchronization handling? (video is synchronized)</li>
- * </ul> 
+ * </ul>
  * </p>
- * 
+ *
  * <a name="libavavail"><h5>FFMPEG / LibAV Availability</h5></a>
  * <p>
  * <ul>
  *   <li>GNU/Linux: ffmpeg or libav are deployed in most distributions.</li>
- *   <li>Windows: 
+ *   <li>Windows:
  *   <ul>
  *     <li>http://ffmpeg.zeranoe.com/builds/ (ffmpeg) <i>recommended, works w/ dshow</i></li>
  *     <li>http://win32.libav.org/releases/  (libav)</li>
@@ -144,22 +144,22 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  *       pkt install pkg:/video/ffmpeg
  *       </pre></li>
  * </ul>
- * </p> 
+ * </p>
  */
 public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
 
     /** POSIX ENOSYS {@value}: Function not implemented. FIXME: Move to GlueGen ?!*/
     private static final int ENOSYS = 38;
-    
+
     // Instance data
     private static final FFMPEGNatives natives;
     private static final int avUtilMajorVersionCC;
     private static final int avFormatMajorVersionCC;
-    private static final int avCodecMajorVersionCC;    
+    private static final int avCodecMajorVersionCC;
     private static final int avResampleMajorVersionCC;
     private static final int swResampleMajorVersionCC;
     private static final boolean available;
-    
+
     static {
         final boolean libAVGood = FFMPEGDynamicLibraryBundleInfo.initSingleton();
         final boolean libAVVersionGood;
@@ -171,7 +171,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                 avUtilMajorVersionCC = natives.getAvUtilMajorVersionCC0();
                 avResampleMajorVersionCC = natives.getAvResampleMajorVersionCC0();
                 swResampleMajorVersionCC = natives.getSwResampleMajorVersionCC0();
-            } else {            
+            } else {
                 avUtilMajorVersionCC = 0;
                 avFormatMajorVersionCC = 0;
                 avCodecMajorVersionCC = 0;
@@ -211,25 +211,25 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
         available = libAVGood && libAVVersionGood && null != natives;
     }
-    
+
     public static final boolean isAvailable() { return available; }
 
     //
     // General
     //
-    
-    private long moviePtr = 0;    
-    
+
+    private long moviePtr = 0;
+
     //
     // Video
     //
-    
+
     private String texLookupFuncName = "ffmpegTexture2D";
-    private boolean usesTexLookupShader = false;    
+    private boolean usesTexLookupShader = false;
     private PixelFormat vPixelFmt = null;
     private int vPlanes = 0;
     private int vBitsPerPixel = 0;
-    private int vBytesPerPixelPerPlane = 0;    
+    private int vBytesPerPixelPerPlane = 0;
     private int texWidth, texHeight; // overall (stuffing planes in one texture)
     private String singleTexComp = "r";
     private GLPixelStorageModes psm;
@@ -237,10 +237,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     //
     // Audio
     //
-    
+
     private AudioSink.AudioFormat avChosenAudioFormat;
     private int audioSamplesPerFrameAndChannel = 0;
-    
+
     public FFMPEGMediaPlayer() {
         if(!available) {
             throw new RuntimeException("FFMPEGMediaPlayer not available");
@@ -263,14 +263,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
     private final void destroyAudioSink() {
         final AudioSink _audioSink = audioSink;
-        if( null != _audioSink ) {            
+        if( null != _audioSink ) {
             audioSink = null;
             _audioSink.destroy();
         }
     }
-    
+
     public static final String dev_video_linux = "/dev/video";
-    
+
     @Override
     protected final void initStreamImpl(int vid, int aid) throws IOException {
         if(0==moviePtr) {
@@ -279,7 +279,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if(DEBUG) {
             System.err.println("initStream: p1 "+this);
         }
-        
+
         final String streamLocS=IOUtil.decodeFromURI(streamLoc.toString());
         destroyAudioSink();
         if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
@@ -291,7 +291,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if(DEBUG) {
             System.err.println("initStream: p2 preferred "+preferredAudioFormat+", "+this);
         }
-        
+
         final boolean isCameraInput = null != cameraPath;
         final String resStreamLocS;
         // int rw=640, rh=480, rr=15;
@@ -314,7 +314,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                 case OPENKODE:
                 default:
                     resStreamLocS = streamLocS; // FIXME: ??
-                    break;            
+                    break;
             }
             if( null != cameraProps ) {
                 sizes = cameraProps.get(CameraPropSizeS);
@@ -362,7 +362,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if(DEBUG) {
             System.err.println("initGL: p3 avChosen "+avChosenAudioFormat);
         }
-        
+
         if( STREAM_ID_NONE == aid ) {
             audioSink.destroy();
             audioSink = AudioSinkFactory.createNull();
@@ -386,7 +386,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("initGL: p4 chosen "+avChosenAudioFormat);
             System.err.println("initGL: p4 chosen "+audioSink);
         }
-        
+
         if( null != gl && STREAM_ID_NONE != vid ) {
             int tf, tif=GL.GL_RGBA; // texture format and internal format
             int tt = GL.GL_UNSIGNED_BYTE;
@@ -413,9 +413,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                             tf = GL2ES2.GL_BGRA;  tif=GL.GL_RGBA;  break;
                         } else {
                             tf = GL2ES2.GL_RGBA;  tif=GL.GL_RGBA;  break;
-                        }                    
+                        }
                 default: throw new RuntimeException("Unsupported bytes-per-pixel / plane "+vBytesPerPixelPerPlane);
-            }        
+            }
             setTextureFormat(tif, tf);
             setTextureType(tt);
             if(DEBUG) {
@@ -423,12 +423,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                                    ", tex "+texWidth+"x"+texHeight+", usesTexLookupShader "+usesTexLookupShader);
             }
         }
-    }    
+    }
     @Override
     protected final TextureFrame createTexImage(GL gl, int texName) {
         return new TextureFrame( createTexImageImpl(gl, texName, texWidth, texHeight) );
     }
-    
+
     /**
      * @param sampleRate sample rate in Hz (1/s)
      * @param sampleSize sample size in bits
@@ -439,10 +439,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      * @param littleEndian true for little-endian, false for big endian
      * @return
      */
-    
+
     /**
      * Native callback
-     * Converts the given libav/ffmpeg values to {@link AudioFormat} and returns {@link AudioSink#isSupported(AudioFormat)}. 
+     * Converts the given libav/ffmpeg values to {@link AudioFormat} and returns {@link AudioSink#isSupported(AudioFormat)}.
      * @param audioSampleFmt ffmpeg/libav audio-sample-format, see {@link SampleFormat}.
      * @param audioSampleRate sample rate in Hz (1/s)
      * @param audioChannels number of channels
@@ -456,9 +456,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
         return res;
     }
-    
+
     /**
-     * Returns {@link AudioFormat} as converted from the given libav/ffmpeg values. 
+     * Returns {@link AudioFormat} as converted from the given libav/ffmpeg values.
      * @param audioSampleFmt ffmpeg/libav audio-sample-format, see {@link SampleFormat}.
      * @param audioSampleRate sample rate in Hz (1/s)
      * @param audioChannels number of channels
@@ -506,7 +506,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
         return new AudioFormat(audioSampleRate, sampleSize, audioChannels, signed, fixedP, planar, true /* littleEndian */);
     }
-    
+
     /**
      * Native callback
      * @param vid
@@ -523,9 +523,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      * @param audioChannels
      * @param audioSamplesPerFrameAndChannel in audio samples per frame and channel
      */
-    void setupFFAttributes(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,              
+    void setupFFAttributes(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
                           int tWd0, int tWd1, int tWd2, int vW, int vH,
-                          int aid, int audioSampleFmt, int audioSampleRate, 
+                          int aid, int audioSampleFmt, int audioSampleRate,
                           int audioChannels, int audioSamplesPerFrameAndChannel) {
         // defaults ..
         vPixelFmt = null;
@@ -534,28 +534,28 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         vBytesPerPixelPerPlane = 0;
         usesTexLookupShader = false;
         texWidth = 0; texHeight = 0;
-        
+
         final int[] vTexWidth = { 0, 0, 0 }; // per plane
-        
+
         if( STREAM_ID_NONE != vid ) {
             vPixelFmt = PixelFormat.valueOf(pixFmt);
             vPlanes = planes;
             vBitsPerPixel = bitsPerPixel;
-            vBytesPerPixelPerPlane = bytesPerPixelPerPlane;                        
+            vBytesPerPixelPerPlane = bytesPerPixelPerPlane;
             vTexWidth[0] = tWd0; vTexWidth[1] = tWd1; vTexWidth[2] = tWd2;
-            
+
             switch(vPixelFmt) {
                 case YUVJ420P:
                 case YUV420P: // < planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
                     usesTexLookupShader = true;
                     // YUV420P: Adding U+V on right side of fixed height texture,
                     //          since width is already aligned by decoder.
-                    //          Splitting texture to 4 quadrants: 
+                    //          Splitting texture to 4 quadrants:
                     //            Y covers left top/low quadrant
                     //            U on top-right quadrant.
                     //            V on low-right quadrant.
                     // Y=w*h, U=w/2*h/2, V=w/2*h/2
-                    //   w*h + 2 ( w/2 * h/2 ) 
+                    //   w*h + 2 ( w/2 * h/2 )
                     //   w*h + w*h/2
                     texWidth = vTexWidth[0] + vTexWidth[1]; texHeight = vH;
                     break;
@@ -573,27 +573,27 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                 case YUYV422: // < packed YUV 4:2:2, 2x 16bpp, Y0 Cb Y1 Cr - stuffed into RGBA half width texture
                 case BGR24:
                     usesTexLookupShader = true;
-                    texWidth = vTexWidth[0]; texHeight = vH; 
+                    texWidth = vTexWidth[0]; texHeight = vH;
                     break;
-                    
+
                 case RGB24:
                 case ARGB:
                 case RGBA:
                 case ABGR:
                 case BGRA:
                     usesTexLookupShader = false;
-                    texWidth = vTexWidth[0]; texHeight = vH; 
+                    texWidth = vTexWidth[0]; texHeight = vH;
                     break;
                 default: // FIXME: Add more formats !
                     throw new RuntimeException("Unsupported pixelformat: "+vPixelFmt);
             }
         }
-        
+
         // defaults ..
         final SampleFormat aSampleFmt;
         avChosenAudioFormat = null;;
         this.audioSamplesPerFrameAndChannel = 0;
-        
+
         if( STREAM_ID_NONE != aid ) {
             aSampleFmt = SampleFormat.valueOf(audioSampleFmt);
             avChosenAudioFormat = avAudioFormat2Local(aSampleFmt, audioSampleRate, audioChannels);
@@ -601,7 +601,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         } else {
             aSampleFmt = null;
         }
-        
+
         if(DEBUG) {
             System.err.println("audio: id "+aid+", fmt "+aSampleFmt+", "+avChosenAudioFormat+", aFrameSize/fc "+audioSamplesPerFrameAndChannel);
             System.err.println("video: id "+vid+", fmt "+vW+"x"+vH+", "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane+", usesTexLookupShader "+usesTexLookupShader);
@@ -612,7 +612,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println(this.toString());
         }
     }
-    
+
     /**
      * Native callback
      * @param isInGLOrientation
@@ -624,13 +624,13 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      * @param tWd1
      * @param tWd2
      */
-    void updateVidAttributes(boolean isInGLOrientation, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,              
+    void updateVidAttributes(boolean isInGLOrientation, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
                              int tWd0, int tWd1, int tWd2, int vW, int vH) {
     }
-    
+
     /**
      * {@inheritDoc}
-     * 
+     *
      * If this implementation generates a specialized shader,
      * it allows the user to override the default function name <code>ffmpegTexture2D</code>.
      * Otherwise the call is delegated to it's super class.
@@ -646,15 +646,15 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             }
             return texLookupFuncName;
         }
-        return super.getTextureLookupFunctionName(desiredFuncName);        
+        return super.getTextureLookupFunctionName(desiredFuncName);
     }
-    
+
     /**
      * {@inheritDoc}
-     * 
+     *
      * Depending on the pixelformat, a specific conversion shader is being created,
-     * e.g. YUV420P to RGB. Otherwise the call is delegated to it's super class.  
-     */ 
+     * e.g. YUV420P to RGB. Otherwise the call is delegated to it's super class.
+     */
     @Override
     public final String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
       if(State.Uninitialized == state) {
@@ -685,7 +685,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
               "  return vec4(r, g, b, 1);\n"+
               "}\n"
           ;
-          
+
         case YUVJ422P:
         case YUV422P: ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
           return
@@ -706,7 +706,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
               "  return vec4(r, g, b, 1);\n"+
               "}\n"
           ;
-            
+
         case YUYV422: // < packed YUV 4:2:2, 2 x 16bpp, [Y0 Cb] [Y1 Cr]
                       // Stuffed into RGBA half width texture
           return
@@ -740,9 +740,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
 
         default: // FIXME: Add more formats !
           throw new InternalError("Add proper mapping of: vPixelFmt "+vPixelFmt+", usesTexLookupShader "+usesTexLookupShader);
-      }        
+      }
     }
-    
+
     @Override
     public final boolean playImpl() {
         if(0==moviePtr) {
@@ -754,7 +754,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
         return true;
     }
-    
+
     @Override
     public final boolean pauseImpl() {
         if(0==moviePtr) {
@@ -780,12 +780,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
         gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
     }
-    
+
     @Override
     protected void postNextTextureImpl(GL gl) {
         psm.restore(gl);
     }
-    
+
     @Override
     protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         if(0==moviePtr) {
@@ -806,14 +806,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             nextFrame.setPTS(vPTS);
         }
         return vPTS;
-    }    
-    
+    }
+
     final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
         setFirstAudioPTS2SCR( audio_pts );
         if( 1.0f == playSpeed || audioSinkPlaySpeedSet ) {
             audioSink.enqueueData( audio_pts, sampleData, data_size);
         }
     }
-    
+
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
index 8e08c23fa..bc0865aa9 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -30,21 +30,21 @@ package jogamp.opengl.util.av.impl;
 import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 interface FFMPEGNatives {
-        
+
     boolean initSymbols0(long[] symbols, int count);
     int getAvUtilMajorVersionCC0();
     int getAvFormatMajorVersionCC0();
     int getAvCodecMajorVersionCC0();
     int getAvResampleMajorVersionCC0();
     int getSwResampleMajorVersionCC0();
-    
+
     long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
     void destroyInstance0(long moviePtr);
-    
+
     /**
      * Issues {@link #updateAttributes(int, int, int, int, int, int, int, float, int, int, String, String)}
      * and {@link #updateAttributes2(int, int, int, int, int, int, int, int, int, int)}.
-     * 
+     *
      * @param moviePtr
      * @param url
      * @param vid
@@ -56,25 +56,25 @@ interface FFMPEGNatives {
      * @param aPrefSampleRate
      * @param aPrefChannelCount
      */
-    void setStream0(long moviePtr, String url, boolean isCameraInput, 
-                    int vid, String sizes, int vWidth, int vHeight, 
+    void setStream0(long moviePtr, String url, boolean isCameraInput,
+                    int vid, String sizes, int vWidth, int vHeight,
                     int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
-    
+
     void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
 
-    int getVideoPTS0(long moviePtr);    
-    
+    int getVideoPTS0(long moviePtr);
+
     int getAudioPTS0(long moviePtr);
-    
+
     /**
      * @return resulting current video PTS, or {@link TextureFrame#INVALID_PTS}
      */
     int readNextPacket0(long moviePtr, int texTarget, int texFmt, int texType);
-    
+
     int play0(long moviePtr);
     int pause0(long moviePtr);
     int seek0(long moviePtr, int position);
-        
+
     /** FFMPEG/libAV Audio Sample Format */
     public static enum SampleFormat {
         // NONE = -1,
@@ -89,10 +89,10 @@ interface FFMPEGNatives {
         S32P,        ///< signed 32 bits, planar
         FLTP,        ///< float, planar
         DBLP,        ///< double, planar
-        
+
         COUNT;       ///< Number of sample formats.
-        
-        /** 
+
+        /**
          * Returns the matching SampleFormat value corresponding to the given SampleFormat's integer ordinal.
          * <pre>
          *   given:
@@ -131,7 +131,7 @@ interface FFMPEGNatives {
         /** planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) */
         YUV411P,
         /** Y, 8bpp */
-        GRAY8,        
+        GRAY8,
         /** Y,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb */
         MONOWHITE,
         /** Y,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb */
@@ -151,57 +151,57 @@ interface FFMPEGNatives {
         /** packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 */
         UYVY422,
         /** packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 */
-        UYYVYY411, 
+        UYYVYY411,
         /** packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb) */
-        BGR8, 
+        BGR8,
         /** packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */
-        BGR4, 
+        BGR4,
         /** packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb) */
-        BGR4_BYTE, 
+        BGR4_BYTE,
         /** packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb) */
-        RGB8, 
+        RGB8,
         /** packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */
-        RGB4, 
+        RGB4,
         /** packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb) */
-        RGB4_BYTE, 
+        RGB4_BYTE,
         /** planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) */
-        NV12, 
+        NV12,
         /** as above, but U and V bytes are swapped */
-        NV21, 
+        NV21,
 
         /** packed ARGB 8:8:8:8, 32bpp, ARGBARGB... */
-        ARGB, 
+        ARGB,
         /** packed RGBA 8:8:8:8, 32bpp, RGBARGBA... */
-        RGBA, 
+        RGBA,
         /** packed ABGR 8:8:8:8, 32bpp, ABGRABGR... */
-        ABGR, 
+        ABGR,
         /** packed BGRA 8:8:8:8, 32bpp, BGRABGRA... */
-        BGRA, 
+        BGRA,
 
         /** Y, 16bpp, big-endian */
-        GRAY16BE,        
+        GRAY16BE,
         /** Y        , 16bpp, little-endian */
-        GRAY16LE,        
+        GRAY16LE,
         /** planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) */
-        YUV440P, 
+        YUV440P,
         /** planar YUV 4:4:0 full scale (JPEG), deprecated in favor of YUV440P and setting color_range */
-        YUVJ440P, 
+        YUVJ440P,
         /** planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) */
-        YUVA420P, 
+        YUVA420P,
         /** H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_H264, 
+        VDPAU_H264,
         /** MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_MPEG1, 
+        VDPAU_MPEG1,
         /** MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_MPEG2, 
+        VDPAU_MPEG2,
         /** WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_WMV3, 
+        VDPAU_WMV3,
         /** VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_VC1, 
+        VDPAU_VC1,
         /** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian */
-        RGB48BE, 
+        RGB48BE,
         /** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian */
-        RGB48LE, 
+        RGB48LE,
 
         RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
         RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
@@ -255,7 +255,7 @@ interface FFMPEGNatives {
         GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
         COUNT      ///< number of pixel formats in this list
         ;
-        /** 
+        /**
          * Returns the matching PixelFormat value corresponding to the given PixelFormat's integer ordinal.
          * <pre>
          *   given:
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
index 01c249313..22a045825 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -29,7 +29,7 @@ package jogamp.opengl.util.av.impl;
 
 import com.jogamp.common.util.VersionNumber;
 
-class FFMPEGStaticNatives {        
+class FFMPEGStaticNatives {
     static VersionNumber getAVVersion(int vers) {
         return new VersionNumber( ( vers >> 16 ) & 0xFF,
                                   ( vers >>  8 ) & 0xFF,
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
index 22694888d..4b013c1b3 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -45,7 +45,7 @@ class FFMPEGv08Natives implements FFMPEGNatives {
 
     @Override
     public native int getSwResampleMajorVersionCC0();
-    
+
     @Override
     public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
 
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
index 08e19d5e6..d69763287 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -45,7 +45,7 @@ class FFMPEGv09Natives implements FFMPEGNatives {
 
     @Override
     public native int getSwResampleMajorVersionCC0();
-    
+
     @Override
     public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
 
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
index 0081743fa..0b5f70d7c 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -45,7 +45,7 @@ class FFMPEGv10Natives implements FFMPEGNatives {
 
     @Override
     public native int getSwResampleMajorVersionCC0();
-    
+
     @Override
     public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
 
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index a5a701a4f..24198703a 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -45,19 +45,19 @@ import jogamp.opengl.util.av.EGLMediaPlayerImpl;
  */
 public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     static final boolean available;
-    
+
     static {
         available = false;
         /** FIXME!
-        // OMX binding is included in jogl_desktop and jogl_mobile     
+        // OMX binding is included in jogl_desktop and jogl_mobile
         GLProfile.initSingleton();
         available = initIDs0(); */
     }
-    
+
     public static final boolean isAvailable() { return available; }
-    
+
     protected long moviePtr = 0;
-    
+
     public OMXGLMediaPlayer() {
         super(TextureType.KHRImage, true);
         if(!available) {
@@ -70,21 +70,21 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         moviePtr = _createInstance();
         if(0==moviePtr) {
             throw new GLException("Couldn't create OMXInstance");
-        }        
+        }
     }
-    
+
     @Override
     protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
         final EGLTextureFrame eglTex = (EGLTextureFrame) super.createTexImage(gl, texName);
         _setStreamEGLImageTexture2D(moviePtr, texName, eglTex.getImage(), eglTex.getSync());
         return eglTex;
     }
-    
+
     @Override
     protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame imgTex) {
-        super.destroyTexFrame(gl, imgTex);        
+        super.destroyTexFrame(gl, imgTex);
     }
-    
+
     @Override
     protected void destroyImpl(GL gl) {
         if (moviePtr != 0) {
@@ -94,20 +94,20 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
             moviePtr = 0;
         }
     }
-    
+
     @Override
     protected void initStreamImpl(int vid, int aid) throws IOException {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
         if(!streamLoc.getScheme().equals("file")) {
-            throw new IOException("Only file schemes are allowed: "+streamLoc);            
+            throw new IOException("Only file schemes are allowed: "+streamLoc);
         }
         final String path=streamLoc.getPath();
         if(DEBUG) {
             System.out.println("initGLStream: clean path "+path);
         }
-    
+
         if(DEBUG) {
             System.out.println("initGLStream: p1 "+this);
         }
@@ -121,7 +121,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         // NOP
         isInGLOrientation = true;
     }
-    
+
     @Override
     protected int getAudioPTSImpl() {
         return 0!=moviePtr ? _getCurrentPosition(moviePtr) : 0;
@@ -172,8 +172,8 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         final int nextTex = _getNextTextureID(moviePtr, true);
         if(0 < nextTex) {
             // FIXME set pts !
-            /* FIXME 
-            final TextureSequence.TextureFrame eglImgTex = 
+            /* FIXME
+            final TextureSequence.TextureFrame eglImgTex =
                     texFrameMap.get(new Integer(_getNextTextureID(moviePtr, blocking)));
             if(null!=eglImgTex) {
                 lastTex = eglImgTex;
@@ -181,7 +181,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         }
         return 0; // FIXME: return pts
     }
-    
+
     private String replaceAll(String orig, String search, String repl) {
         String dest=null;
         // In case replaceAll / java.util.regex.* is not supported (-> CVM)
@@ -203,14 +203,14 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     private static native boolean initIDs0();
-    private native long _createInstance();    
+    private native long _createInstance();
     private native void _destroyInstance(long moviePtr);
-    
+
     private native void _detachVideoRenderer(long moviePtr); // stop before
     private native void _attachVideoRenderer(long moviePtr); // detach before
     private native void _setStream(long moviePtr, int textureNum, String path);
     private native void _activateStream(long moviePtr);
-    
+
     private native void _setStreamEGLImageTexture2D(long moviePtr, int tex, long image, long sync);
     private native int  _seek(long moviePtr, int position);
     private native void _setPlaySpeed(long moviePtr, float rate);
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
index 3c468f358..2d74fa532 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
@@ -41,23 +41,23 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
 import com.jogamp.opengl.util.glsl.ShaderState;
 
 /**
- * Used for 1:1 GLSL arrays, i.e. where the buffer data 
- * represents this array only. 
+ * Used for 1:1 GLSL arrays, i.e. where the buffer data
+ * represents this array only.
  */
-public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandler {    
-  
+public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandler {
+
   public GLSLArrayHandler(GLArrayDataEditable ad) {
     super(ad);
   }
-  
+
   public final void setSubArrayVBOName(int vboName) {
       throw new UnsupportedOperationException();
   }
-  
+
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       throw new UnsupportedOperationException();
   }
-  
+
   public final void enableState(GL gl, boolean enable, Object ext) {
     final GL2ES2 glsl = gl.getGL2ES2();
     if( null != ext ) {
@@ -66,12 +66,12 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle
         enableSimple(glsl, enable);
     }
   }
-  
+
   private final void enableShaderState(GL2ES2 glsl, boolean enable, ShaderState st) {
     if(enable) {
         /*
          * This would be the non optimized code path:
-         * 
+         *
         if(ad.isVBO()) {
             glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName());
             if(!ad.isVBOWritten()) {
@@ -108,13 +108,13 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle
         } else if(null!=buffer) {
             st.vertexAttribPointer(glsl, ad);
         }
-        
+
         st.enableVertexAttribArray(glsl, ad);
     } else {
         st.disableVertexAttribArray(glsl, ad);
     }
   }
-  
+
   private final void enableSimple(GL2ES2 glsl, boolean enable) {
     final int location = ad.getLocation();
     if( 0 > location ) {
@@ -123,7 +123,7 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle
     if(enable) {
         /*
          * This would be the non optimized code path:
-         * 
+         *
         if(ad.isVBO()) {
             glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName());
             if(!ad.isVBOWritten()) {
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
index 855406db3..a5f78b5d6 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
@@ -37,7 +37,7 @@ import com.jogamp.opengl.util.GLArrayDataWrapper;
 import com.jogamp.opengl.util.glsl.ShaderState;
 
 /**
- * Used for interleaved GLSL arrays, i.e. where the buffer data itself is handled 
+ * Used for interleaved GLSL arrays, i.e. where the buffer data itself is handled
  * separately and interleaves many arrays.
  */
 public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
@@ -50,7 +50,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
   public GLArrayDataWrapper getData() {
       return ad;
   }
-    
+
   public final void syncData(GL gl, Object ext) {
     final GL2ES2 glsl = gl.getGL2ES2();
     if( null != ext ) {
@@ -62,7 +62,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
     }
     /**
      * Due to probable application VBO switching, this might not make any sense ..
-     * 
+     *
     if(!written) {
         st.vertexAttribPointer(glsl, ad);
     } else if(st.getAttribLocation(glsl, ad) >= 0) {
@@ -94,7 +94,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
             } else {
                 glsl.glDisableVertexAttribArray(location);
             }
-        }        
+        }
     }
-  }  
+  }
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
index c2048d652..bcc146d78 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
@@ -40,8 +40,8 @@ import jogamp.opengl.util.GLVBOArrayHandler;
 import com.jogamp.opengl.util.GLArrayDataEditable;
 
 /**
- * Interleaved fixed function arrays, i.e. where this buffer data 
- * represents many arrays. 
+ * Interleaved fixed function arrays, i.e. where this buffer data
+ * represents many arrays.
  */
 public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLArrayHandler {
   private List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
@@ -49,13 +49,13 @@ public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GL
   public GLSLArrayHandlerInterleaved(GLArrayDataEditable ad) {
     super(ad);
   }
-  
+
   public final void setSubArrayVBOName(int vboName) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).getData().setVBOName(vboName);
-      }      
+      }
   }
-  
+
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       subArrays.add(handler);
   }
@@ -63,9 +63,9 @@ public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GL
   private final void syncSubData(GL gl, Object ext) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).syncData(gl, ext);
-      }      
-  }  
-  
+      }
+  }
+
   public final void enableState(GL gl, boolean enable, Object ext) {
     if(enable) {
         if(!ad.isVBO()) {
@@ -78,7 +78,7 @@ public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GL
     }
     for(int i=0; i<subArrays.size(); i++) {
         subArrays.get(i).enableState(gl, enable, ext);
-    }      
+    }
   }
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java
index eaf8dc30a..dba408554 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl.util.glsl;
 
 import java.nio.FloatBuffer;
@@ -45,33 +45,33 @@ import javax.media.opengl.fixedfunc.GLMatrixFunc;
 public class GLSLTextureRaster  {
     private final boolean textureVertFlipped;
     private final int textureUnit;
-    
+
     private ShaderProgram sp;
     private PMVMatrix pmvMatrix;
     private GLUniformData pmvMatrixUniform;
     private GLUniformData activeTexUniform;
     private GLArrayDataServer interleavedVBO;
-        
+
     public GLSLTextureRaster(int textureUnit, boolean textureVertFlipped) {
         this.textureVertFlipped = textureVertFlipped;
         this.textureUnit = textureUnit;
     }
-    
+
     public int getTextureUnit() { return textureUnit; }
 
     static final String shaderBasename = "texture01_xxx";
     static final String shaderSrcPath = "../../shader";
     static final String shaderBinPath = "../../shader/bin";
-    
+
     public void init(GL2ES2 gl) {
         // Create & Compile the shader objects
-        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), 
+        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
                                                   shaderSrcPath, shaderBinPath, shaderBasename, true);
-        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(), 
+        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
                                                   shaderSrcPath, shaderBinPath, shaderBasename, true);
         rsVp.defaultShaderCustomization(gl, true, true);
         rsFp.defaultShaderCustomization(gl, true, true);
-        
+
         // Create & Link the shader program
         sp = new ShaderProgram();
         sp.add(rsVp);
@@ -80,13 +80,13 @@ public class GLSLTextureRaster  {
             throw new GLException("Couldn't link program: "+sp);
         }
         sp.useProgram(gl, true);
-        
+
         // setup mgl_PMVMatrix
         pmvMatrix = new PMVMatrix();
         pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();       
+        pmvMatrix.glLoadIdentity();
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
         if( pmvMatrixUniform.setLocation(gl, sp.program()) < 0 ) {
             throw new GLException("Couldn't locate "+pmvMatrixUniform+" in shader: "+sp);
@@ -105,9 +105,9 @@ public class GLSLTextureRaster  {
         } else {
             s_quadTexCoords = s_quadTexCoords00;
         }
-        
+
         interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+2, GL.GL_FLOAT, false, 2*4, GL.GL_STATIC_DRAW);
-        {        
+        {
             final GLArrayData vArrayData = interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);
             if( vArrayData.setLocation(gl, sp.program()) < 0 ) {
                 throw new GLException("Couldn't locate "+vArrayData+" in shader: "+sp);
@@ -116,15 +116,15 @@ public class GLSLTextureRaster  {
             if( tArrayData.setLocation(gl, sp.program()) < 0 ) {
                 throw new GLException("Couldn't locate "+tArrayData+" in shader: "+sp);
             }
-            final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();            
+            final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
             for(int i=0; i<4; i++) {
                 ib.put(s_quadVertices,  i*3, 3);
                 ib.put(s_quadTexCoords, i*2, 2);
-            }                        
+            }
         }
         interleavedVBO.seal(gl, true);
         interleavedVBO.enableBuffer(gl, false);
-                
+
         sp.useProgram(gl, false);
     }
 
@@ -133,14 +133,14 @@ public class GLSLTextureRaster  {
             pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             pmvMatrix.glLoadIdentity();
             pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f);
-    
+
             pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             pmvMatrix.glLoadIdentity();
-            
+
             sp.useProgram(gl, true);
             gl.glUniform(pmvMatrixUniform);
             sp.useProgram(gl, false);
-        }        
+        }
     }
 
     public void dispose(GL2ES2 gl) {
@@ -162,34 +162,34 @@ public class GLSLTextureRaster  {
     }
 
     public void display(GL2ES2 gl) {
-        if(null != sp) {    
-            sp.useProgram(gl, true);               
+        if(null != sp) {
+            sp.useProgram(gl, true);
             interleavedVBO.enableBuffer(gl, true);
-            
+
             gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
-            
-            interleavedVBO.enableBuffer(gl, false);        
+
+            interleavedVBO.enableBuffer(gl, false);
             sp.useProgram(gl, false);
         }
     }
-    
-    private static final float[] s_quadVertices = { 
+
+    private static final float[] s_quadVertices = {
       -1f, -1f, 0f, // LB
        1f, -1f, 0f, // RB
       -1f,  1f, 0f, // LT
-       1f,  1f, 0f  // RT 
+       1f,  1f, 0f  // RT
     };
-    private static final float[] s_quadTexCoords00 = { 
+    private static final float[] s_quadTexCoords00 = {
         0f, 0f, // LB
         1f, 0f, // RB
-        0f, 1f, // LT   
+        0f, 1f, // LT
         1f, 1f  // RT
     };
-    private static final float[] s_quadTexCoords01 = { 
+    private static final float[] s_quadTexCoords01 = {
         0f, 1f, // LB
         1f, 1f, // RB
-        0f, 0f, // LT   
+        0f, 0f, // LT
         1f, 0f  // RT
-    };    
+    };
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
index 6d5b16def..d86940e04 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
@@ -77,7 +77,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
      * @param mode TODO
      * @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline}
      */
-    public FixedFuncHook(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix, 
+    public FixedFuncHook(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix,
                          Class<?> shaderRootClass, String shaderSrcRoot, String shaderBinRoot,
                          String vertexColorFile, String vertexColorLightFile,
                          String fragmentColorFile, String fragmentColorTextureFile) {
@@ -90,14 +90,14 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
             this.pmvMatrix = new PMVMatrix();
         }
 
-        fixedFunction = new FixedFuncPipeline(this.gl, mode, this.pmvMatrix, shaderRootClass, shaderSrcRoot, 
+        fixedFunction = new FixedFuncPipeline(this.gl, mode, this.pmvMatrix, shaderRootClass, shaderSrcRoot,
                                               shaderBinRoot, vertexColorFile, vertexColorLightFile, fragmentColorFile, fragmentColorTextureFile);
     }
 
     public boolean verbose() { return fixedFunction.verbose(); }
 
     public void setVerbose(boolean v) { fixedFunction.setVerbose(v); }
-    
+
     public void destroy() {
         fixedFunction.destroy(gl);
         fixedFunction = null;
@@ -111,16 +111,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     public PMVMatrix getMatrix() { return pmvMatrix; }
 
     //
-    // FixedFuncHookIf - hooks 
+    // FixedFuncHookIf - hooks
     //
     public void glDrawArrays(int mode, int first, int count) {
         fixedFunction.glDrawArrays(gl, mode, first, count);
     }
     public void glDrawElements(int mode, int count, int type, java.nio.Buffer indices) {
-        fixedFunction.glDrawElements(gl, mode, count, type, indices);        
+        fixedFunction.glDrawElements(gl, mode, count, type, indices);
     }
     public void glDrawElements(int mode, int count, int type, long indices_buffer_offset) {
-        fixedFunction.glDrawElements(gl, mode, count, type, indices_buffer_offset); 
+        fixedFunction.glDrawElements(gl, mode, count, type, indices_buffer_offset);
     }
 
     public void glActiveTexture(int texture) {
@@ -136,7 +136,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         if(fixedFunction.glEnable(cap, false)) {
             gl.glDisable(cap);
         }
-    }    
+    }
     public void glGetFloatv(int pname, java.nio.FloatBuffer params) {
         if(PMVMatrix.isMatrixGetName(pname)) {
             pmvMatrix.glGetFloatv(pname, params);
@@ -165,7 +165,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         }
         gl.glGetIntegerv(pname, params, params_offset);
     }
-    
+
     public void glTexEnvi(int target, int pname, int value) {
         fixedFunction.glTexEnvi(target, pname, value);
     }
@@ -179,7 +179,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         fixedFunction.glBindTexture(target, texture);
         gl.glBindTexture(target, texture);
     }
-    public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, 
+    public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border,
                              int format, int type,  Buffer pixels) {
         // align internalformat w/ format, an ES2 requirement
         switch(internalformat) {
@@ -212,8 +212,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     public  void glPointParameterfv(int pname, java.nio.FloatBuffer params) {
         fixedFunction.glPointParameterfv(pname, params);
     }
-    
-    // 
+
+    //
     // MatrixIf
     //
     public int  glGetMatrixMode() {
@@ -253,29 +253,29 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         pmvMatrix.glScalef(x, y, z);
     }
     public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) {
-        glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val); 
+        glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val);
     }
     public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
         pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar);
     }
     public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) {
-        glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar); 
+        glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar);
     }
     public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
         pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar);
     }
 
-    // 
+    //
     // LightingIf
     //
     public void glColor4f(float red, float green, float blue, float alpha) {
       fixedFunction.glColor4f(gl, red, green, blue, alpha);
     }
-    
+
     public  void glColor4ub(byte red, byte green, byte blue, byte alpha) {
-      glColor4f(ValueConv.byte_to_float(red, false), 
-                ValueConv.byte_to_float(green, false), 
-                ValueConv.byte_to_float(blue, false), 
+      glColor4f(ValueConv.byte_to_float(red, false),
+                ValueConv.byte_to_float(green, false),
+                ValueConv.byte_to_float(blue, false),
                 ValueConv.byte_to_float(alpha, false) );
     }
     public void glLightfv(int light, int pname, java.nio.FloatBuffer params) {
@@ -299,17 +299,17 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     //
     public void glShadeModel(int mode) {
       fixedFunction.glShadeModel(gl, mode);
-    }    
+    }
     public  void glAlphaFunc(int func, float ref) {
         fixedFunction.glAlphaFunc(func, ref);
     }
-    
-    /** ES2 supports CullFace implicit 
+
+    /** ES2 supports CullFace implicit
     public void glCullFace(int faceName) {
         fixedFunction.glCullFace(faceName);
         gl.glCullFace(faceName);
     } */
-    
+
     //
     // PointerIf
     //
@@ -340,7 +340,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     }
 
     public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) {
-      glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, 
+      glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                      pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
     public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) {
@@ -348,7 +348,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       if(vboName==0) {
         throw new GLException("no GL_ARRAY_BUFFER VBO bound");
       }
-      glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, 
+      glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                      null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER));
     }
 
@@ -368,7 +368,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       fixedFunction.glColorPointer(gl, array);
     }
     public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) {
-      glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, 
+      glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                     pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
     public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) {
@@ -376,7 +376,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       if(vboName==0) {
         throw new GLException("no GL_ARRAY_BUFFER VBO bound");
       }
-      glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, 
+      glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                    null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER));
     }
 
@@ -399,7 +399,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       fixedFunction.glNormalPointer(gl, array);
     }
     public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) {
-      glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride, 
+      glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                      pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
     public void glNormalPointer(int type, int stride, long pointer_buffer_offset) {
@@ -407,7 +407,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       if(vboName==0) {
         throw new GLException("no GL_ARRAY_BUFFER VBO bound");
       }
-      glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride, 
+      glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                      null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER));
     }
 
@@ -428,7 +428,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     }
     public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) {
       glTexCoordPointer(
-        GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, 
+        GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                        pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
     public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) {
@@ -437,7 +437,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         throw new GLException("no GL_ARRAY_BUFFER VBO bound");
       }
       glTexCoordPointer(
-        GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, 
+        GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                        null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER) );
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
index 5349745ea..187fdb309 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
@@ -59,25 +59,25 @@ import com.jogamp.opengl.util.glsl.ShaderState;
 import com.jogamp.opengl.util.glsl.fixedfunc.ShaderSelectionMode;
 
 /**
- * 
+ *
  * <p>
- * Note: Certain GL FFP state values (e.g.: alphaTestFunc and cullFace) 
- *       are mapped to a lower number range so they can be stored in low precision storage, 
+ * Note: Certain GL FFP state values (e.g.: alphaTestFunc and cullFace)
+ *       are mapped to a lower number range so they can be stored in low precision storage,
  *       i.e. in a 'lowp int' (GL ES2).
  * </p>
  */
 public class FixedFuncPipeline {
     protected static final boolean DEBUG;
-    
+
     static {
         Debug.initSingleton();
         DEBUG = Debug.isPropertyDefined("jogl.debug.FixedFuncPipeline", true);
     }
-    
+
     /** The maximum texture units which could be used, depending on {@link ShaderSelectionMode}. */
     public static final int MAX_TEXTURE_UNITS = 8;
     public static final int MAX_LIGHTS        = 8;
-    
+
     public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
         shaderRootClass = FixedFuncPipeline.class;
         shaderSrcRoot = shaderSrcRootDef;
@@ -88,8 +88,8 @@ public class FixedFuncPipeline {
         fragmentColorTextureFile = fragmentColorTextureFileDef;
         init(gl, mode, pmvMatrix);
     }
-    public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix, 
-                             Class<?> shaderRootClass, String shaderSrcRoot, 
+    public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix,
+                             Class<?> shaderRootClass, String shaderSrcRoot,
                              String shaderBinRoot,
                              String vertexColorFile, String vertexColorLightFile,
                              String fragmentColorFile, String fragmentColorTextureFile) {
@@ -100,9 +100,9 @@ public class FixedFuncPipeline {
         this.vertexColorLightFile = vertexColorLightFile;
         this.fragmentColorFile = fragmentColorFile;
         this.fragmentColorTextureFile = fragmentColorTextureFile;
-        init(gl, mode, pmvMatrix); 
+        init(gl, mode, pmvMatrix);
     }
-    
+
     public ShaderSelectionMode getShaderSelectionMode() { return requestedShaderSelectionMode; }
     public void setShaderSelectionMode(ShaderSelectionMode mode) { requestedShaderSelectionMode=mode; }
     public ShaderSelectionMode getCurrentShaderSelectionMode() { return currentShaderSelectionMode; }
@@ -153,21 +153,21 @@ public class FixedFuncPipeline {
         colorStatic.put(1, green);
         colorStatic.put(2, blue);
         colorStatic.put(3, alpha);
-        
+
         shaderState.useProgram(gl, true);
-        final GLUniformData ud = shaderState.getUniform(mgl_ColorStatic);        
+        final GLUniformData ud = shaderState.getUniform(mgl_ColorStatic);
         if(null!=ud) {
             // same data object ..
             shaderState.uniform(gl, ud);
         } else {
             throw new GLException("Failed to update: mgl_ColorStatic");
-        }        
+        }
     }
-    
+
     //
     // Arrays / States
     //
-    
+
     public void glEnableClientState(GL2ES2 gl, int glArrayIndex) {
         glToggleClientState(gl, glArrayIndex, true);
     }
@@ -202,7 +202,7 @@ public class FixedFuncPipeline {
                 break;
         }
     }
-    
+
     public void glVertexPointer(GL2ES2 gl, GLArrayData data) {
         shaderState.useProgram(gl, true);
         shaderState.vertexAttribPointer(gl, data);
@@ -217,14 +217,14 @@ public class FixedFuncPipeline {
         shaderState.useProgram(gl, true);
         shaderState.vertexAttribPointer(gl, data);
     }
-    
+
     //
     // MULTI-TEXTURE
     //
 
     /** Enables/Disables the named texture unit (if changed), returns previous state */
     private boolean glEnableTexture(boolean enable, int unit) {
-        final boolean isEnabled = 0 != ( textureEnabledBits & ( 1 << activeTextureUnit ) );  
+        final boolean isEnabled = 0 != ( textureEnabledBits & ( 1 << activeTextureUnit ) );
         if( isEnabled != enable ) {
             if(enable) {
                 textureEnabledBits |=  ( 1 << unit );
@@ -237,7 +237,7 @@ public class FixedFuncPipeline {
         }
         return isEnabled;
     }
-    
+
     public void glClientActiveTexture(int textureUnit) {
         textureUnit -= GL.GL_TEXTURE0;
         if(0 <= textureUnit && textureUnit<MAX_TEXTURE_UNITS) {
@@ -246,7 +246,7 @@ public class FixedFuncPipeline {
             throw new GLException("glClientActiveTexture textureUnit not within GL_TEXTURE0 + [0.."+MAX_TEXTURE_UNITS+"]: "+textureUnit);
         }
     }
-    
+
     public void glActiveTexture(int textureUnit) {
         textureUnit -= GL.GL_TEXTURE0;
         if(0 <= textureUnit && textureUnit<MAX_TEXTURE_UNITS) {
@@ -264,7 +264,7 @@ public class FixedFuncPipeline {
         data.setName( GLPointerFuncUtil.getPredefinedArrayIndexName(data.getIndex(), clientActiveTextureUnit) ) ;
         shaderState.vertexAttribPointer(gl, data);
     }
-    
+
     public void glBindTexture(int target, int texture) {
         if(GL.GL_TEXTURE_2D == target) {
             if( texture != boundTextureObject[activeTextureUnit] ) {
@@ -272,15 +272,15 @@ public class FixedFuncPipeline {
                 textureFormatDirty = true;
             }
         } else {
-            System.err.println("FixedFuncPipeline: Unimplemented glBindTexture for target "+toHexString(target)+". Texture name "+toHexString(texture));            
+            System.err.println("FixedFuncPipeline: Unimplemented glBindTexture for target "+toHexString(target)+". Texture name "+toHexString(texture));
         }
     }
-    
+
     public void glTexImage2D(int target, /* int level, */ int internalformat, /*, int width, int height, int border, */
                              int format /*, int type,  Buffer pixels */) {
         final int ifmt;
         if(GL.GL_TEXTURE_2D == target) {
-            switch(internalformat) {            
+            switch(internalformat) {
             case 3:
             case GL.GL_RGB:
             case GL.GL_RGB565:
@@ -306,16 +306,16 @@ public class FixedFuncPipeline {
                 // System.err.println("glTexImage2D TEXTURE_2D: internalformat ifmt "+toHexString(internalformat)+" fmt "+toHexString(format)+" -> "+toHexString(ifmt));
             }
         } else {
-            System.err.println("FixedFuncPipeline: Unimplemented glTexImage2D: target "+toHexString(target)+", internalformat "+toHexString(internalformat));            
+            System.err.println("FixedFuncPipeline: Unimplemented glTexImage2D: target "+toHexString(target)+", internalformat "+toHexString(internalformat));
         }
     }
     /*
     public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border,
-                             int format, int type,  long pixels_buffer_offset) {        
+                             int format, int type,  long pixels_buffer_offset) {
         textureFormat.put(activeTextureUnit, internalformat);
         textureFormatDirty = true;
     }*/
-         
+
     public void glTexEnvi(int target, int pname, int value) {
         if(GL2ES1.GL_TEXTURE_ENV == target && GL2ES1.GL_TEXTURE_ENV_MODE == pname) {
             final int mode;
@@ -351,7 +351,7 @@ public class FixedFuncPipeline {
         if( value != textureEnvMode.get(activeTextureUnit) ) {
             textureEnvMode.put(activeTextureUnit, value);
             textureEnvModeDirty = true;
-        }        
+        }
     }
     public void glGetTexEnviv(int target, int pname,  IntBuffer params) { // FIXME
         System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname));
@@ -359,13 +359,13 @@ public class FixedFuncPipeline {
     public void glGetTexEnviv(int target, int pname,  int[] params, int params_offset) { // FIXME
         System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname));
     }
-    
+
     //
     // Point Sprites
     //
     public void glPointSize(float size) {
         pointParams.put(0, size);
-        pointParamsDirty = true;                
+        pointParamsDirty = true;
     }
     public  void glPointParameterf(int pname, float param) {
         switch(pname) {
@@ -379,7 +379,7 @@ public class FixedFuncPipeline {
                 pointParams.put(4+3, param);
                 break;
         }
-        pointParamsDirty = true;                
+        pointParamsDirty = true;
     }
     public  void glPointParameterfv(int pname, float[] params, int params_offset) {
         switch(pname) {
@@ -389,7 +389,7 @@ public class FixedFuncPipeline {
                 pointParams.put(4+2, params[params_offset + 2]);
                 break;
         }
-        pointParamsDirty = true;                
+        pointParamsDirty = true;
     }
     public  void glPointParameterfv(int pname, java.nio.FloatBuffer params) {
         final int o = params.position();
@@ -400,24 +400,24 @@ public class FixedFuncPipeline {
                 pointParams.put(4+2, params.get(o + 2));
                 break;
         }
-        pointParamsDirty = true;                
+        pointParamsDirty = true;
     }
 
     // private int[] pointTexObj = new int[] { 0 };
-    
+
     private void glDrawPoints(GL2ES2 gl, GLRunnable2<Object,Object> glDrawAction, Object args) {
         if(gl.isGL2GL3()) {
             gl.glEnable(GL2GL3.GL_VERTEX_PROGRAM_POINT_SIZE);
         }
         if(gl.isGL2ES1()) {
             gl.glEnable(GL2ES1.GL_POINT_SPRITE);
-        }        
+        }
         loadShaderPoints(gl);
         shaderState.attachShaderProgram(gl, shaderProgramPoints, true);
         validate(gl, false); // sync uniforms
 
         glDrawAction.run(gl, args);
-                
+
         if(gl.isGL2ES1()) {
             gl.glDisable(GL2ES1.GL_POINT_SPRITE);
         }
@@ -432,17 +432,17 @@ public class FixedFuncPipeline {
             int[] _args = (int[])args;
             gl.glDrawArrays(GL.GL_POINTS, _args[0], _args[1]);
             return null;
-        }        
-    };    
+        }
+    };
     private final void glDrawPointArrays(GL2ES2 gl, int first, int count) {
-        glDrawPoints(gl, glDrawArraysAction, new int[] { first, count });        
+        glDrawPoints(gl, glDrawArraysAction, new int[] { first, count });
     }
-    
+
     //
     // Lighting
-    // 
+    //
 
-    public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) {        
+    public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) {
         shaderState.useProgram(gl, true);
         light -=GLLightingFunc.GL_LIGHT0;
         if(0 <= light && light < MAX_LIGHTS) {
@@ -536,14 +536,14 @@ public class FixedFuncPipeline {
             ud.setData(params);
             shaderState.uniform(gl, ud);
         } else if(verbose) {
-            
+
         }
     }
 
     //
     // Misc States
     //
-    
+
     public void glShadeModel(GL2ES2 gl, int mode) {
         shaderState.useProgram(gl, true);
         GLUniformData ud = shaderState.getUniform(mgl_ShadeModel);
@@ -608,7 +608,7 @@ public class FixedFuncPipeline {
                 _func = 8;
                 break;
             default:
-                throw new GLException("glAlphaFunc invalid func: "+toHexString(func));                    
+                throw new GLException("glAlphaFunc invalid func: "+toHexString(func));
         }
         if(0 < _func) {
             if(0>alphaTestFunc) {
@@ -623,7 +623,7 @@ public class FixedFuncPipeline {
     }
 
     /**
-     * @return false if digested in regard to GL2ES2 spec, 
+     * @return false if digested in regard to GL2ES2 spec,
      *         eg this call must not be passed to an underlying ES2 implementation.
      *         true if this call shall be passed to an underlying GL2ES2/ES2 implementation as well.
      */
@@ -631,16 +631,16 @@ public class FixedFuncPipeline {
         switch(cap) {
             case GL.GL_BLEND:
             case GL.GL_DEPTH_TEST:
-            case GL.GL_DITHER:   
+            case GL.GL_DITHER:
             case GL.GL_POLYGON_OFFSET_FILL:
             case GL.GL_SAMPLE_ALPHA_TO_COVERAGE:
             case GL.GL_SAMPLE_COVERAGE:
             case GL.GL_SCISSOR_TEST:
             case GL.GL_STENCIL_TEST:
                 return true;
-                
+
             case GL.GL_CULL_FACE:
-                /** ES2 supports CullFace implicit 
+                /** ES2 supports CullFace implicit
                 final int _cullFace;
                 if(0>cullFace && enable || 0<cullFace && !enable) {
                     _cullFace = cullFace * -1;
@@ -652,15 +652,15 @@ public class FixedFuncPipeline {
                     cullFace=_cullFace;
                 } */
                 return true;
-                
+
             case GL.GL_TEXTURE_2D:
                 glEnableTexture(enable, activeTextureUnit);
                 return false;
-                
+
             case GLLightingFunc.GL_LIGHTING:
                 lightingEnabled=enable;
                 return false;
-                
+
             case GL2ES1.GL_ALPHA_TEST:
                 final int _alphaTestFunc;
                 if(0>alphaTestFunc && enable || 0<alphaTestFunc && !enable) {
@@ -673,12 +673,12 @@ public class FixedFuncPipeline {
                     alphaTestFunc=_alphaTestFunc;
                 }
                 return false;
-                
+
             case GL2ES1.GL_POINT_SMOOTH:
                 pointParams.put(1, enable ? 1.0f : 0.0f);
                 pointParamsDirty = true;
                 return false;
-                
+
             case GL2ES1.GL_POINT_SPRITE:
                 // gl_PointCoord always enabled
                 return false;
@@ -699,7 +699,7 @@ public class FixedFuncPipeline {
     //
     // Draw
     //
-    
+
     public void glDrawArrays(GL2ES2 gl, int mode, int first, int count) {
         switch(mode) {
             case GL2.GL_QUAD_STRIP:
@@ -717,34 +717,34 @@ public class FixedFuncPipeline {
             for (int j = first; j < count - 3; j += 4) {
                 gl.glDrawArrays(GL.GL_TRIANGLE_FAN, j, 4);
             }
-        } else {            
+        } else {
             gl.glDrawArrays(mode, first, count);
         }
     }
     public void glDrawElements(GL2ES2 gl, int mode, int count, int type, java.nio.Buffer indices) {
-        validate(gl, true); 
+        validate(gl, true);
         if ( GL2.GL_QUADS == mode && !gl.isGL2() ) {
             final int idx0 = indices.position();
-            
+
             if( GL.GL_UNSIGNED_BYTE == type ) {
                 final ByteBuffer b = (ByteBuffer) indices;
                 for (int j = 0; j < count; j++) {
                     gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x000000ff & b.get(idx0+j)), 4);
-                }                        
+                }
             } else if( GL.GL_UNSIGNED_SHORT == type ){
                 final ShortBuffer b = (ShortBuffer) indices;
                 for (int j = 0; j < count; j++) {
                     gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x0000ffff & b.get(idx0+j)), 4);
-                }                                                
+                }
             } else {
                 final IntBuffer b = (IntBuffer) indices;
                 for (int j = 0; j < count; j++) {
                     gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4);
-                }                                                
+                }
             }
         } else {
             // FIXME: Impl. VBO usage .. or unroll (see above)!
-            if( !gl.getContext().isCPUDataSourcingAvail() ) {                    
+            if( !gl.getContext().isCPUDataSourcingAvail() ) {
                 throw new GLException("CPU data sourcing n/a w/ "+gl.getContext());
             }
             if( GL2ES1.GL_POINTS != mode ) {
@@ -756,17 +756,17 @@ public class FixedFuncPipeline {
         }
     }
     public void glDrawElements(GL2ES2 gl, int mode, int count, int type, long indices_buffer_offset) {
-        validate(gl, true); 
+        validate(gl, true);
         if ( GL2.GL_QUADS == mode && !gl.isGL2() ) {
             throw new GLException("Cannot handle indexed QUADS on !GL2 w/ VBO due to lack of CPU index access");
-        } else if( GL2ES1.GL_POINTS != mode ) {            
+        } else if( GL2ES1.GL_POINTS != mode ) {
             // FIXME GL_POINTS !
             gl.glDrawElements(mode, count, type, indices_buffer_offset);
         } else {
             gl.glDrawElements(mode, count, type, indices_buffer_offset);
         }
     }
-    
+
     private final int textureEnabledCount() {
         int n=0;
         for(int i=MAX_TEXTURE_UNITS-1; i>=0; i--) {
@@ -776,12 +776,12 @@ public class FixedFuncPipeline {
         }
         return n;
     }
-    
+
     public void validate(GL2ES2 gl, boolean selectShader) {
         if( selectShader ) {
             if( ShaderSelectionMode.AUTO == requestedShaderSelectionMode) {
                 final ShaderSelectionMode newMode;
-                
+
                 // pre-validate shader switch
                 if( 0 != textureEnabledBits ) {
                     if(lightingEnabled) {
@@ -808,9 +808,9 @@ public class FixedFuncPipeline {
                 shaderState.useProgram(gl, true);
             }
         }
-        
+
         GLUniformData ud;
-        if( pmvMatrix.update() ) {            
+        if( pmvMatrix.update() ) {
             ud = shaderState.getUniform(mgl_PMVMatrix);
             if(null!=ud) {
                 final FloatBuffer m;
@@ -818,7 +818,7 @@ public class FixedFuncPipeline {
                    ShaderSelectionMode.COLOR_LIGHT_PER_VERTEX== currentShaderSelectionMode ) {
                     m = pmvMatrix.glGetPMvMvitMatrixf();
                 } else {
-                    m = pmvMatrix.glGetPMvMatrixf();                    
+                    m = pmvMatrix.glGetPMvMatrixf();
                 }
                 if(m != ud.getBuffer()) {
                     ud.setData(m);
@@ -829,7 +829,7 @@ public class FixedFuncPipeline {
                 throw new GLException("Failed to update: mgl_PMVMatrix");
             }
         }
-        if(colorVAEnabledDirty) { 
+        if(colorVAEnabledDirty) {
             ud = shaderState.getUniform(mgl_ColorEnabled);
             if(null!=ud) {
                 int ca = true == shaderState.isVertexAttribArrayEnabled(GLPointerFuncUtil.mgl_Color) ? 1 : 0 ;
@@ -838,7 +838,7 @@ public class FixedFuncPipeline {
                     shaderState.uniform(gl, ud);
                 }
             } else {
-                throw new GLException("Failed to update: mgl_ColorEnabled");                
+                throw new GLException("Failed to update: mgl_ColorEnabled");
             }
             colorVAEnabledDirty = false;
         }
@@ -868,16 +868,16 @@ public class FixedFuncPipeline {
         if(pointParamsDirty) {
             ud = shaderState.getUniform(mgl_PointParams);
             if(null!=ud) {
-                // same data object 
+                // same data object
                 shaderState.uniform(gl, ud);
             }
             pointParamsDirty = false;
         }
-        
+
         if(lightsEnabledDirty) {
             ud = shaderState.getUniform(mgl_LightsEnabled);
             if(null!=ud) {
-                // same data object 
+                // same data object
                 shaderState.uniform(gl, ud);
             }
             lightsEnabledDirty=false;
@@ -886,41 +886,41 @@ public class FixedFuncPipeline {
         if(textureCoordEnabledDirty) {
             ud = shaderState.getUniform(mgl_TexCoordEnabled);
             if(null!=ud) {
-                // same data object 
+                // same data object
                 shaderState.uniform(gl, ud);
             }
             textureCoordEnabledDirty=false;
-        }        
+        }
 
         if(textureEnvModeDirty) {
             ud = shaderState.getUniform(mgl_TexEnvMode);
             if(null!=ud) {
-                // same data object 
+                // same data object
                 shaderState.uniform(gl, ud);
             }
             textureEnvModeDirty = false;
         }
-        
+
         if(textureFormatDirty) {
             for(int i = 0; i<MAX_TEXTURE_UNITS; i++) {
                 textureFormat.put(i, texID2Format.get(boundTextureObject[i]));
             }
             ud = shaderState.getUniform(mgl_TexFormat);
             if(null!=ud) {
-                // same data object 
+                // same data object
                 shaderState.uniform(gl, ud);
-            }            
+            }
             textureFormatDirty = false;
-        }            
+        }
         if(textureEnabledDirty) {
             ud = shaderState.getUniform(mgl_TextureEnabled);
             if(null!=ud) {
-                // same data object 
+                // same data object
                 shaderState.uniform(gl, ud);
             }
             textureEnabledDirty=false;
         }
-        
+
         if(verbose) {
             System.err.println("validate: "+toString(null, DEBUG).toString());
         }
@@ -944,7 +944,7 @@ public class FixedFuncPipeline {
         sb.append("\n\t, ShaderState: ");
         shaderState.toString(sb, alsoUnlocated);
         sb.append("]");
-        return sb;        
+        return sb;
     }
     public String toString() {
         return toString(null, DEBUG).toString();
@@ -954,19 +954,19 @@ public class FixedFuncPipeline {
     private static final String constMaxTextures2 = "#define MAX_TEXTURE_UNITS 2\n";
     private static final String constMaxTextures4 = "#define MAX_TEXTURE_UNITS 4\n";
     private static final String constMaxTextures8 = "#define MAX_TEXTURE_UNITS 8\n";
-    
+
     private final void customizeShader(GL2ES2 gl, ShaderCode vp, ShaderCode fp, String maxTextureDefine) {
         int rsVpPos = vp.defaultShaderCustomization(gl, true, true);
-        int rsFpPos = fp.defaultShaderCustomization(gl, true, true);        
+        int rsFpPos = fp.defaultShaderCustomization(gl, true, true);
         vp.insertShaderSource(0, rsVpPos, maxTextureDefine);
-        fp.insertShaderSource(0, rsFpPos, maxTextureDefine); 
+        fp.insertShaderSource(0, rsFpPos, maxTextureDefine);
     }
 
     private final void loadShaderPoints(GL2ES2 gl) {
         if( null != shaderProgramPoints ) {
             return;
         }
-        
+
         final ShaderCode vp = ShaderCode.create( gl, GL2ES2.GL_VERTEX_SHADER, shaderRootClass, shaderSrcRoot,
                                          shaderBinRoot, shaderPointFileDef, true);
         final ShaderCode fp = ShaderCode.create( gl, GL2ES2.GL_FRAGMENT_SHADER, shaderRootClass, shaderSrcRoot,
@@ -977,18 +977,18 @@ public class FixedFuncPipeline {
         shaderProgramPoints.add(fp);
         if(!shaderProgramPoints.link(gl, System.err)) {
             throw new GLException("Couldn't link VertexColor program: "+shaderProgramPoints);
-        }        
+        }
     }
-    
+
     private final void loadShader(GL2ES2 gl, ShaderSelectionMode mode) {
         final boolean loadColor = ShaderSelectionMode.COLOR == mode;
         final boolean loadColorTexture2 = ShaderSelectionMode.COLOR_TEXTURE2 == mode;
         final boolean loadColorTexture4 = ShaderSelectionMode.COLOR_TEXTURE4 == mode;
         final boolean loadColorTexture8 = ShaderSelectionMode.COLOR_TEXTURE8 == mode;
-        final boolean loadColorTexture = loadColorTexture2 || loadColorTexture4 || loadColorTexture8 ; 
+        final boolean loadColorTexture = loadColorTexture2 || loadColorTexture4 || loadColorTexture8 ;
         final boolean loadColorLightPerVertex = ShaderSelectionMode.COLOR_LIGHT_PER_VERTEX == mode;
         final boolean loadColorTexture8LightPerVertex = ShaderSelectionMode.COLOR_TEXTURE8_LIGHT_PER_VERTEX == mode;
-        
+
         if( null != shaderProgramColor && loadColor ||
             null != shaderProgramColorTexture2 && loadColorTexture2 ||
             null != shaderProgramColorTexture4 && loadColorTexture4 ||
@@ -997,7 +997,7 @@ public class FixedFuncPipeline {
             null != shaderProgramColorTexture8Light && loadColorTexture8LightPerVertex ) {
             return;
         }
-        
+
         if( loadColor ) {
             final ShaderCode vp = ShaderCode.create( gl, GL2ES2.GL_VERTEX_SHADER, shaderRootClass, shaderSrcRoot,
                                              shaderBinRoot, vertexColorFile, true);
@@ -1014,7 +1014,7 @@ public class FixedFuncPipeline {
             final ShaderCode vp = ShaderCode.create( gl, GL2ES2.GL_VERTEX_SHADER, shaderRootClass, shaderSrcRoot, shaderBinRoot, vertexColorFile, true);
             final ShaderCode fp = ShaderCode.create( gl, GL2ES2.GL_FRAGMENT_SHADER, shaderRootClass, shaderSrcRoot,
                                                      shaderBinRoot, fragmentColorTextureFile, true);
-            
+
             if( loadColorTexture2 ) {
                 customizeShader(gl, vp, fp, constMaxTextures2);
                 shaderProgramColorTexture2 = new ShaderProgram();
@@ -1066,7 +1066,7 @@ public class FixedFuncPipeline {
             }
         }
     }
-    
+
     private ShaderProgram selectShaderProgram(GL2ES2 gl, ShaderSelectionMode newMode) {
         if(ShaderSelectionMode.AUTO == newMode) {
             newMode = ShaderSelectionMode.COLOR;
@@ -1096,13 +1096,13 @@ public class FixedFuncPipeline {
         currentShaderSelectionMode = newMode;
         return sp;
     }
-    
-    private void init(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) { 
+
+    private void init(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
         if(null==pmvMatrix) {
             throw new GLException("PMVMatrix is null");
         }
         this.pmvMatrix=pmvMatrix;
-        this.requestedShaderSelectionMode = mode;        
+        this.requestedShaderSelectionMode = mode;
         this.shaderState=new ShaderState();
         this.shaderState.setVerbose(verbose);
 
@@ -1115,11 +1115,11 @@ public class FixedFuncPipeline {
 
         shaderState.uniform(gl, new GLUniformData(mgl_ColorEnabled,  0));
         shaderState.uniform(gl, new GLUniformData(mgl_ColorStatic, 4, colorStatic));
-        
-        texID2Format.setKeyNotFoundValue(0);        
+
+        texID2Format.setKeyNotFoundValue(0);
         shaderState.uniform(gl, new GLUniformData(mgl_TexCoordEnabled,  1, textureCoordEnabled));
         shaderState.uniform(gl, new GLUniformData(mgl_TexEnvMode, 1, textureEnvMode));
-        shaderState.uniform(gl, new GLUniformData(mgl_TexFormat, 1, textureFormat));        
+        shaderState.uniform(gl, new GLUniformData(mgl_TexFormat, 1, textureFormat));
         shaderState.uniform(gl, new GLUniformData(mgl_TextureEnabled, 1, textureEnabled));
         for(int i=0; i<MAX_TEXTURE_UNITS; i++) {
             shaderState.uniform(gl, new GLUniformData(mgl_Texture+i, i));
@@ -1128,7 +1128,7 @@ public class FixedFuncPipeline {
         /** ES2 supports CullFace implicit
         shaderState.uniform(gl, new GLUniformData(mgl_CullFace, cullFace)); */
         shaderState.uniform(gl, new GLUniformData(mgl_AlphaTestFunc, alphaTestFunc));
-        shaderState.uniform(gl, new GLUniformData(mgl_AlphaTestRef, alphaTestRef));   
+        shaderState.uniform(gl, new GLUniformData(mgl_AlphaTestRef, alphaTestRef));
         shaderState.uniform(gl, new GLUniformData(mgl_PointParams, 4, pointParams));
         for(int i=0; i<MAX_LIGHTS; i++) {
             shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].ambient", 4, defAmbient));
@@ -1141,7 +1141,7 @@ public class FixedFuncPipeline {
             shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].constantAttenuation", defConstantAtten));
             shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].linearAttenuation", defLinearAtten));
             shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].quadraticAttenuation", defQuadraticAtten));
-        }        
+        }
         shaderState.uniform(gl, new GLUniformData(mgl_LightModel+".ambient", 4, defLightModelAmbient));
         shaderState.uniform(gl, new GLUniformData(mgl_LightsEnabled,  1, lightsEnabled));
         shaderState.uniform(gl, new GLUniformData(mgl_FrontMaterial+".ambient", 4, defMatAmbient));
@@ -1159,11 +1159,11 @@ public class FixedFuncPipeline {
     private String toHexString(int i) {
         return "0x"+Integer.toHexString(i);
     }
-    
+
     protected boolean verbose = DEBUG;
 
     private final FloatBuffer colorStatic = Buffers.copyFloatBuffer(one4f);
-    
+
     private int activeTextureUnit=0;
     private int clientActiveTextureUnit=0;
     private final IntIntHashMap texID2Format = new IntIntHashMap();
@@ -1172,9 +1172,9 @@ public class FixedFuncPipeline {
     private final IntBuffer textureEnabled = Buffers.newDirectIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }); // per unit
     private boolean textureEnabledDirty = false;
     private final IntBuffer textureCoordEnabled = Buffers.newDirectIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }); // per unit
-    private boolean textureCoordEnabledDirty = false;    
+    private boolean textureCoordEnabledDirty = false;
     // textureEnvMode: 1 GL_ADD, 2 GL_MODULATE (default), 3 GL_DECAL, 4 GL_BLEND, 5 GL_REPLACE, 6 GL_COMBINE
-    private final IntBuffer textureEnvMode = Buffers.newDirectIntBuffer(new int[] { 2, 2, 2, 2, 2, 2, 2, 2 });    
+    private final IntBuffer textureEnvMode = Buffers.newDirectIntBuffer(new int[] { 2, 2, 2, 2, 2, 2, 2, 2 });
     private boolean textureEnvModeDirty = false;
     private final IntBuffer textureFormat = Buffers.newDirectIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }); // per unit
     private boolean textureFormatDirty = false;
@@ -1192,11 +1192,11 @@ public class FixedFuncPipeline {
     private boolean alphaTestDirty=false;
     private int alphaTestFunc=-8; // <=0 disabled; 1 GL_NEVER, 2 GL_LESS, 3 GL_EQUAL, 4 GL_LEQUAL, 5 GL_GREATER, 6 GL_NOTEQUAL, 7 GL_GEQUAL, and 8 GL_ALWAYS (default)
     private float alphaTestRef=0f;
-    
+
     private boolean pointParamsDirty = false;
     /** ( pointSize, pointSmooth, attn. pointMinSize, attn. pointMaxSize ) , ( attenuation coefficients 1f 0f 0f, attenuation fade theshold 1f )   */
-    private final FloatBuffer pointParams = Buffers.newDirectFloatBuffer(new float[] {  1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f }); 
-    
+    private final FloatBuffer pointParams = Buffers.newDirectFloatBuffer(new float[] {  1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f });
+
     private PMVMatrix pmvMatrix;
     private ShaderState shaderState;
     private ShaderProgram shaderProgramColor;
@@ -1204,7 +1204,7 @@ public class FixedFuncPipeline {
     private ShaderProgram shaderProgramColorLight;
     private ShaderProgram shaderProgramColorTexture8Light;
     private ShaderProgram shaderProgramPoints;
-    
+
     private ShaderSelectionMode requestedShaderSelectionMode = ShaderSelectionMode.AUTO;
     private ShaderSelectionMode currentShaderSelectionMode = requestedShaderSelectionMode;
 
@@ -1219,7 +1219,7 @@ public class FixedFuncPipeline {
     private static final String mgl_LightsEnabled    = "mgl_LightsEnabled";   //  int mgl_LightsEnabled[MAX_LIGHTS];
 
     private static final String mgl_AlphaTestFunc    = "mgl_AlphaTestFunc";   //  1i (lowp int)
-    private static final String mgl_AlphaTestRef     = "mgl_AlphaTestRef";    //  1f    
+    private static final String mgl_AlphaTestRef     = "mgl_AlphaTestRef";    //  1f
     private static final String mgl_ShadeModel       = "mgl_ShadeModel";      //  1i
     private static final String mgl_PointParams      = "mgl_PointParams";     //  vec4[2]: { (sz, smooth, attnMinSz, attnMaxSz), (attnCoeff(3), attnFadeTs) }
 
@@ -1231,7 +1231,7 @@ public class FixedFuncPipeline {
 
     // private static final FloatBuffer zero4f = Buffers.newDirectFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f, 0.0f });
     private static final FloatBuffer neut4f = Buffers.newDirectFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f, 1.0f });
-    private static final FloatBuffer one4f  = Buffers.newDirectFloatBuffer(new float[] { 1.0f, 1.0f, 1.0f, 1.0f });    
+    private static final FloatBuffer one4f  = Buffers.newDirectFloatBuffer(new float[] { 1.0f, 1.0f, 1.0f, 1.0f });
 
     public static final FloatBuffer defAmbient   = neut4f;
     public static final FloatBuffer defDiffuseN  = neut4f;
@@ -1245,7 +1245,7 @@ public class FixedFuncPipeline {
     public static final float defQuadraticAtten  = 0f;
 
     public static final FloatBuffer defLightModelAmbient = Buffers.newDirectFloatBuffer(new float[] { 0.2f, 0.2f, 0.2f, 1.0f });
-    
+
     public static final FloatBuffer defMatAmbient   = Buffers.newDirectFloatBuffer(new float[] { 0.2f, 0.2f, 0.2f, 1.0f });
     public static final FloatBuffer defMatDiffuse   = Buffers.newDirectFloatBuffer(new float[] { 0.8f, 0.8f, 0.8f, 1.0f });
     public static final FloatBuffer defMatSpecular  = neut4f;
@@ -1259,13 +1259,13 @@ public class FixedFuncPipeline {
     private static final String shaderPointFileDef           = "FixedFuncPoints";
     private static final String shaderSrcRootDef             = "shaders" ;
     private static final String shaderBinRootDef             = "shaders/bin" ;
-    
+
     private final Class<?> shaderRootClass;
-    private final String shaderSrcRoot; 
+    private final String shaderSrcRoot;
     private final String shaderBinRoot;
     private final String vertexColorFile;
     private final String vertexColorLightFile;
     private final String fragmentColorFile;
-    private final String fragmentColorTextureFile;     
+    private final String fragmentColorTextureFile;
 }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java b/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
index 833771dd1..1833a1d87 100644
--- a/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
+++ b/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
@@ -1,16 +1,16 @@
 /**
  * Original JavaScript code from <https://github.com/notmasteryet/jpgjs/blob/master/jpg.js>,
  * ported to Java for JogAmp Community.
- * 
+ *
  * Enhancements:
  *  * InputStream instead of memory buffer
  *  * User provided memory handler
- *  * Fixed JPEG Component ID/Index mapping 
+ *  * Fixed JPEG Component ID/Index mapping
  *  * Color space conversion (YCCK, CMYK -> RGB)
  *  * More error tolerant
- * 
+ *
  * *****************
- * 
+ *
  * Copyright 2011 notmasteryet
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,21 +24,21 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *  
+ *
  * *****************
- *  
+ *
  * Copyright 2013 JogAmp Community. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -48,7 +48,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -70,7 +70,7 @@ import com.jogamp.opengl.util.texture.TextureData;
 import com.jogamp.opengl.util.texture.TextureData.ColorSpace;
 
 /**
- * 
+ *
  * <ul>
  *   <li> The JPEG specification can be found in the ITU CCITT Recommendation T.81
  *        (www.w3.org/Graphics/JPEG/itu-t81.pdf) </li>
@@ -89,22 +89,22 @@ public class JPEGDecoder {
     private static final boolean DEBUG = Debug.debug("JPEGImage");
     private static final boolean DEBUG_IN = false;
 
-    /** Allows user to hook a {@link ColorSink} to another toolkit to produce {@link TextureData}. */ 
+    /** Allows user to hook a {@link ColorSink} to another toolkit to produce {@link TextureData}. */
     public static interface ColorSink {
         /**
          * @param width
          * @param height
          * @param sourceCS the color-space of the decoded JPEG
          * @param sourceComponents number of components used for the given source color-space
-         * @return Either {@link TextureData.ColorSpace#RGB} or {@link TextureData.ColorSpace#YCbCr}. {@link TextureData.ColorSpace#YCCK} and {@link TextureData.ColorSpace#CMYK} will throw an exception! 
+         * @return Either {@link TextureData.ColorSpace#RGB} or {@link TextureData.ColorSpace#YCbCr}. {@link TextureData.ColorSpace#YCCK} and {@link TextureData.ColorSpace#CMYK} will throw an exception!
          * @throws RuntimeException
          */
         public TextureData.ColorSpace allocate(int width, int height, TextureData.ColorSpace sourceCS, int sourceComponents) throws RuntimeException;
         public void store2(int x, int y, byte c1, byte c2);
         public void storeRGB(int x, int y, byte r, byte g, byte b);
-        public void storeYCbCr(int x, int y, byte Y, byte Cb, byte Cr);        
+        public void storeYCbCr(int x, int y, byte Y, byte Cb, byte Cr);
     }
-    
+
     public static class JFIF {
         final VersionNumber version;
         final int densityUnits;
@@ -138,11 +138,11 @@ public class JPEGDecoder {
             } else {
                 return null;
             }
-        }        
+        }
 
         public final String toString() {
             return "JFIF[ver "+version+", density[units "+densityUnits+", "+xDensity+"x"+yDensity+"], thumb "+thumbWidth+"x"+thumbHeight+"]";
-        }        
+        }
     }
 
     public static class Adobe {
@@ -151,7 +151,7 @@ public class JPEGDecoder {
         final short flags1;
         final short colorCode;
         final ColorSpace colorSpace;
-        
+
         private Adobe(final byte[] data) {
             version = data[6];
             flags0 = (short) ( (data[7] << 8) | data[8]  ) ;
@@ -174,7 +174,7 @@ public class JPEGDecoder {
         }
         public final String toString() {
             return "Adobe[ver "+version+", flags["+toHexString(flags0)+", "+toHexString(flags1)+"], colorSpace/Code "+colorSpace+"/"+toHexString(colorCode)+"]";
-        }        
+        }
     }
     /** TODO */
     public static class EXIF {
@@ -189,10 +189,10 @@ public class JPEGDecoder {
             } else {
                 return null;
             }
-        }        
+        }
         public final String toString() {
             return "EXIF[]";
-        }        
+        }
     }
 
     @SuppressWarnings("serial")
@@ -210,7 +210,7 @@ public class JPEGDecoder {
         }
         public int getMarker() { return marker; }
     }
-        
+
     /** Start of Image */
     private static final int M_SOI   = 0xFFD8;
     /** End of Image */
@@ -264,8 +264,8 @@ public class JPEGDecoder {
     private static final int M_APP15 = 0xFFEF;
 
     /** Annotation / Comment */
-    private static final int M_ANO   = 0xFFFE;    
-    
+    private static final int M_ANO   = 0xFFFE;
+
     static final int[] dctZigZag = new int[] {
         0,
         1,  8,
@@ -323,7 +323,7 @@ public class JPEGDecoder {
         private final void checkBounds(int idx) {
             if( 0 > idx || idx >= compCount ) {
                 throw new CodecException("Idx out of bounds "+idx+", "+this);
-            }            
+            }
         }
         public final void validateComponents() {
             for(int i=0; i<compCount; i++) {
@@ -378,7 +378,7 @@ public class JPEGDecoder {
         int blocksPerLine;
         int blocksPerLineForMcu;
         /** [blocksPerColumnForMcu][blocksPerLineForMcu][64]; */
-        int[][][] blocks; 
+        int[][][] blocks;
         int pred;
         BinObj huffmanTableAC;
         BinObj huffmanTableDC;
@@ -400,9 +400,9 @@ public class JPEGDecoder {
             if( row >= blocksPerColumnForMcu || col >= blocksPerLineForMcu ) {
                 throw new CodecException("Out of bounds given ["+row+"]["+col+"] - "+this);
             }
-            return blocks[row][col];            
+            return blocks[row][col];
         }
-        
+
         public final String toString() {
             return "CompIn[h "+h+", v "+v+", qttIdx "+qttIdx+", blocks["+blocksPerColumn+", mcu "+blocksPerColumnForMcu+"]["+blocksPerLine+", mcu "+blocksPerLineForMcu+"][64]]";
         }
@@ -410,7 +410,7 @@ public class JPEGDecoder {
 
     /** The decoded components */
     class ComponentOut {
-        private final ArrayList<byte[]> lines; 
+        private final ArrayList<byte[]> lines;
         final float scaleX;
         final float scaleY;
 
@@ -419,13 +419,13 @@ public class JPEGDecoder {
             this.scaleX = scaleX;
             this.scaleY = scaleY;
         }
-        
+
         /** Safely returning a line, if index exceeds number of lines, last line is returned. */
         public final byte[] getLine(int i) {
             final int sz = lines.size();
             return lines.get( i < sz ? i : sz - 1);
         }
-        
+
         public final String toString() {
             return "CompOut[lines "+lines.size()+", scale "+scaleX+"x"+scaleY+"]";
         }
@@ -442,7 +442,7 @@ public class JPEGDecoder {
     private BufferedInputStream istream;
     private int _ipos = 0;
     private int _iposSave = 0;
-    
+
     private int width = 0;
     private int height = 0;
     private JFIF jfif = null;
@@ -457,14 +457,14 @@ public class JPEGDecoder {
     public final int getHeight() { return height; }
 
     private final void resetInput(InputStream is) {
-        if( is instanceof BufferedInputStream ) { 
+        if( is instanceof BufferedInputStream ) {
             istream = (BufferedInputStream) is;
         } else {
             istream = new BufferedInputStream(is);
         }
         _ipos = 0;
     }
-    
+
     private final void markStream(int readLimit) {
         istream.mark(readLimit);
         _iposSave = _ipos;
@@ -480,7 +480,7 @@ public class JPEGDecoder {
         if( -1 < r ) {
             if(DEBUG_IN) { System.err.println("u8["+_ipos+"]: "+toHexString(r)); }
             _ipos++;
-        } else if(DEBUG_IN) { 
+        } else if(DEBUG_IN) {
             System.err.println("u8["+_ipos+"]: EOS");
         }
         return r;
@@ -519,7 +519,7 @@ public class JPEGDecoder {
         }
         if(DEBUG_IN) { System.err.println("JPEG.readDataBlock: net-len "+(len-2)+", "+this); dumpData(data, 0, len-2); }
         return data;
-    }       
+    }
     static final void dumpData(byte[] data, int offset, int len) {
         for(int i=0; i<len; ) {
             System.err.print(i%8+": ");
@@ -527,8 +527,8 @@ public class JPEGDecoder {
                 System.err.println(toHexString(0x000000FF & data[offset+i])+", ");
             }
             System.err.println("");
-        }        
-    }                
+        }
+    }
 
     public synchronized void clear(InputStream inputStream) {
         resetInput(inputStream);
@@ -536,17 +536,17 @@ public class JPEGDecoder {
         height = 0;
         jfif = null;
         exif = null;
-        adobe = null;        
-        components = null;        
+        adobe = null;
+        components = null;
     }
-    public synchronized JPEGDecoder parse(final InputStream inputStream) throws IOException {        
+    public synchronized JPEGDecoder parse(final InputStream inputStream) throws IOException {
         clear(inputStream);
-        
+
         final int[][] quantizationTables = new int[0x0F][]; // 4 bits
         final BinObj[] huffmanTablesAC = new BinObj[0x0F]; // Huffman table spec - 4 bits
         final BinObj[] huffmanTablesDC = new BinObj[0x0F]; // Huffman table spec - 4 bits
         // final ArrayList<Frame> frames = new ArrayList<Frame>(); // JAU: max 1-frame
-        
+
         Frame frame = null;
         int resetInterval = 0;
         int fileMarker = readUint16();
@@ -614,7 +614,7 @@ public class JPEGDecoder {
                     quantizationTables[tableIdx] = tableData;
                     if( DEBUG ) {
                         System.err.println("JPEG.parse.QTT["+tableIdx+"]: spec "+quantizationTableSpec+", precision "+precisionID+", data "+count+"/"+quantizationTablesLength);
-                    }                    
+                    }
                 }
                 if(count!=quantizationTablesLength){
                     throw new CodecException("ERROR: QTT format error [count!=Length]: "+count+"/"+quantizationTablesLength);
@@ -660,7 +660,7 @@ public class JPEGDecoder {
             }
             break;
 
-            case M_DHT: { 
+            case M_DHT: {
                 int count = 0;
                 final int huffmanLength = readUint16(); count+=2;
                 int i=count, codeLengthTotal = 0;
@@ -675,7 +675,7 @@ public class JPEGDecoder {
                     for (int j = 0; j < codeLengthSum; j++) {
                         huffmanValues[j] = (byte)readUint8(); count++;
                     }
-                    codeLengthTotal += codeLengthSum; 
+                    codeLengthTotal += codeLengthSum;
                     i += 17 + codeLengthSum;
                     final BinObj[] table = ( huffmanTableSpec >> 4 ) == 0 ? huffmanTablesDC : huffmanTablesAC;
                     table[huffmanTableSpec & 0x0F] = buildHuffmanTable(codeLengths, huffmanValues);
@@ -699,7 +699,7 @@ public class JPEGDecoder {
                 final int sosLen = readUint16(); count+=2;
                 final int selectorsCount = readUint8(); count++;
                 ArrayList<ComponentIn> components = new ArrayList<ComponentIn>();
-                if(DEBUG) { System.err.println("JPG.parse.SOS: selectorCount [0.."+(selectorsCount-1)+"]: "+frame); }                                
+                if(DEBUG) { System.err.println("JPG.parse.SOS: selectorCount [0.."+(selectorsCount-1)+"]: "+frame); }
                 for (int i = 0; i < selectorsCount; i++) {
                     final int compID = readUint8(); count++;
                     final ComponentIn component = frame.getCompByID(compID);
@@ -751,8 +751,8 @@ public class JPEGDecoder {
             final ComponentIn component = frame.getCompByIndex(i);
             // System.err.println("JPG.parse.buildComponentData["+i+"]: "+component); // JAU
             // System.err.println("JPG.parse.buildComponentData["+i+"]: "+frame); // JAU
-            this.components[i] = new ComponentOut( output.buildComponentData(frame, component), 
-                                                   (float)component.h / (float)frame.maxH, 
+            this.components[i] = new ComponentOut( output.buildComponentData(frame, component),
+                                                   (float)component.h / (float)frame.maxH,
                                                    (float)component.v / (float)frame.maxV );
         }
         if(DEBUG) { System.err.println("JPG.parse.X: End of processing input "+this); }
@@ -797,7 +797,7 @@ public class JPEGDecoder {
         final boolean isValue;
         final BinObj[] tree;
         final byte b;
-        
+
         BinObj(byte b) {
             this.isValue= true;
             this.b = b;
@@ -815,13 +815,13 @@ public class JPEGDecoder {
     }
 
     private BinObj buildHuffmanTable(int[] codeLengths, byte[] values) {
-        int k = 0;      
-        int length = 16;      
+        int k = 0;
+        int length = 16;
         final ArrayList<BinObjIdxed> code = new ArrayList<BinObjIdxed>();
         while (length > 0 && 0==codeLengths[length - 1]) {
             length--;
         }
-        code.add(new BinObjIdxed());        
+        code.add(new BinObjIdxed());
         BinObjIdxed p = code.get(0), q;
         for (int i = 0; i < length; i++) {
             for (int j = 0; j < codeLengths[i]; j++) {
@@ -959,7 +959,7 @@ public class JPEGDecoder {
                 t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;
                 v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;
                 v6 = t;
-    
+
                 // stage 1
                 p[0 + row] = v0 + v7;
                 p[7 + row] = v0 - v7;
@@ -1066,7 +1066,7 @@ public class JPEGDecoder {
         private int successiveACState, successiveACNextValue;
 
         private int decodeScan(Frame frame, ArrayList<ComponentIn> components, int resetInterval,
-                int spectralStart, int spectralEnd, int successivePrev, int successive) throws IOException { 
+                int spectralStart, int spectralEnd, int successivePrev, int successive) throws IOException {
             // this.precision = frame.precision;
             // this.samplesPerLine = frame.samplesPerLine;
             // this.scanLines = frame.scanLines;
@@ -1079,7 +1079,7 @@ public class JPEGDecoder {
             this.spectralStart = spectralStart;
             this.spectralEnd = spectralEnd;
             this.successive = successive;
-            
+
             final int componentsLength = components.size();
 
             final DecoderFunction decodeFn;
@@ -1096,7 +1096,7 @@ public class JPEGDecoder {
             int mcu = 0;
             int mcuExpected;
             if (componentsLength == 1) {
-                final ComponentIn c = components.get(0);            
+                final ComponentIn c = components.get(0);
                 mcuExpected = c.blocksPerLine * c.blocksPerColumn;
             } else {
                 mcuExpected = mcusPerLine * frame.mcusPerColumn;
@@ -1153,14 +1153,14 @@ public class JPEGDecoder {
                 if( marker < 0xFF00 ) {
                     rewindStream();
                     throw new CodecException("marker not found @ mcu "+mcu+"/"+mcuExpected+", u16: "+toHexString(marker));
-                }                
+                }
                 final boolean isRSTx = 0xFFD0 <= marker && marker <= 0xFFD7; // !RSTx
                 if(DEBUG) {
                     System.err.println("JPEG.decodeScan: MCUs "+mcu+"/"+mcuExpected+", u16 "+toHexString(marker)+", RSTx "+isRSTx+", "+frame);
                 }
                 if ( !isRSTx ) {
                     break; // handle !RSTx marker in caller
-                }                
+                }
             }
             return marker;
         }
@@ -1306,7 +1306,7 @@ public class JPEGDecoder {
                                 successiveACState = 1;
                             }
                         } else {
-                            // if (s !== 1) {                  
+                            // if (s !== 1) {
                             if (s != 1) {
                                 throw new CodecException("invalid ACn encoding");
                             }
@@ -1380,18 +1380,18 @@ public class JPEGDecoder {
         int R = Y + ( ( 91881 * Cr ) >> 16 );
         if(R<0) R=0;
         else if(R>255) R=255;
-        
+
         pixelStorage.storeRGB(x, y, (byte)R, (byte)G, (byte)B);
     } */
-    
+
     public synchronized void getPixel(JPEGDecoder.ColorSink pixelStorage, int width, int height) {
         final int scaleX = this.width / width, scaleY = this.height / height;
 
         final int componentCount = this.components.length;
-        final ColorSpace sourceCS = ( null != adobe ) ? adobe.colorSpace : ColorSpace.YCbCr; 
+        final ColorSpace sourceCS = ( null != adobe ) ? adobe.colorSpace : ColorSpace.YCbCr;
         final ColorSpace storageCS = pixelStorage.allocate(width, height, sourceCS, componentCount);
         if( ColorSpace.RGB != storageCS && ColorSpace.YCbCr != storageCS ) {
-            throw new IllegalArgumentException("Unsupported storage color space: "+storageCS); 
+            throw new IllegalArgumentException("Unsupported storage color space: "+storageCS);
         }
 
         switch (componentCount) {
@@ -1504,7 +1504,7 @@ public class JPEGDecoder {
                             final byte G = clampTo8bit( ( cM * cK ) / 255f );
                             final byte B = clampTo8bit( ( cY * cK ) / 255f );
                             pixelStorage.storeRGB(x, y, R, G, B);
-                        }                        
+                        }
                     } else { // ColorModel.YCCK == sourceCM
                         for (int x = 0; x < width; x++) {
                             final int xs = x * scaleX;
@@ -1525,7 +1525,7 @@ public class JPEGDecoder {
                     }
                 }
             }
-        } 
+        }
         break;
         default:
             throw new CodecException("Unsupported color model: Space "+sourceCS+", components "+componentCount);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java b/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java
index 0fffc85b1..5e177b8c3 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java
@@ -4,7 +4,7 @@ import java.util.HashMap;
 
 /**
  * Internal PNG predictor filter, or strategy to select it.
- * 
+ *
  */
 public enum FilterType {
 	/**
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java
index e62134cd5..ac7b858e1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java
@@ -98,7 +98,7 @@ public class ImageInfo {
 
 	/**
 	 * Full constructor
-	 * 
+	 *
 	 * @param cols
 	 *            Width in pixels
 	 * @param rows
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
index e34e6a226..906ce6373 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
@@ -25,7 +25,7 @@ public class ImageLine {
 	 * Except for 'packed' formats (gray/indexed with 1-2-4 bitdepth) each
 	 * <code>int</code> is a "sample" (one for channel), (0-255 or 0-65535) in
 	 * the corresponding PNG sequence: <code>R G B R G B...</code> or
-	 * <code>R G B A R G B A...</tt> 
+	 * <code>R G B A R G B A...</tt>
 	 * or <code>g g g ...</code> or <code>i i i</code> (palette index)
 	 * <p>
 	 * For bitdepth=1/2/4 , and if samplesUnpacked=false, each value is a PACKED
@@ -60,7 +60,7 @@ public class ImageLine {
 	/**
 	 * true: each element of the scanline array represents a sample always, even
 	 * for internally packed PNG formats
-	 * 
+	 *
 	 * false: if the original image was of packed type (bit depth less than 8)
 	 * we keep samples packed in a single array element
 	 */
@@ -74,7 +74,7 @@ public class ImageLine {
 	}
 
 	/**
-	 * 
+	 *
 	 * @param imgInfo
 	 *            Inmutable ImageInfo, basic parameter of the image we are
 	 *            reading or writing
@@ -84,7 +84,7 @@ public class ImageLine {
 	 * @param unpackedMode
 	 *            If true, we use unpacked format, even for packed original
 	 *            images
-	 * 
+	 *
 	 */
 	public ImageLine(ImageInfo imgInfo, SampleType stype, boolean unpackedMode) {
 		this(imgInfo, stype, unpackedMode, null, null);
@@ -124,13 +124,13 @@ public class ImageLine {
 
 	/*
 	 * Unpacks scanline (for bitdepth 1-2-4)
-	 * 
+	 *
 	 * Arrays must be prealocated. src : samplesPerRowPacked dst : samplesPerRow
-	 * 
+	 *
 	 * This usually works in place (with src==dst and length=samplesPerRow)!
-	 * 
+	 *
 	 * If not, you should only call this only when necesary (bitdepth <8)
-	 * 
+	 *
 	 * If <code>scale==true<code>, it scales the value (just a bit shift) towards 0-255.
 	 */
 	static void unpackInplaceInt(final ImageInfo iminfo, final int[] src, final int[] dst, final boolean scale) {
@@ -165,15 +165,15 @@ public class ImageLine {
 
 	/*
 	 * Unpacks scanline (for bitdepth 1-2-4)
-	 * 
+	 *
 	 * Arrays must be prealocated. src : samplesPerRow dst : samplesPerRowPacked
-	 * 
+	 *
 	 * This usually works in place (with src==dst and length=samplesPerRow)! If not, you should only call this only when
 	 * necesary (bitdepth <8)
-	 * 
+	 *
 	 * The trailing elements are trash
-	 * 
-	 * 
+	 *
+	 *
 	 * If <code>scale==true<code>, it scales the value (just a bit shift) towards 0-255.
 	 */
 	static void packInplaceInt(final ImageInfo iminfo, final int[] src, final int[] dst, final boolean scaled) {
@@ -270,7 +270,7 @@ public class ImageLine {
 
 	/**
 	 * Creates a new ImageLine similar to this, but unpacked
-	 * 
+	 *
 	 * The caller must be sure that the original was really packed
 	 */
 	public ImageLine unpackToNewImageLine() {
@@ -284,7 +284,7 @@ public class ImageLine {
 
 	/**
 	 * Creates a new ImageLine similar to this, but packed
-	 * 
+	 *
 	 * The caller must be sure that the original was really unpacked
 	 */
 	public ImageLine packToNewImageLine() {
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
index 91516a704..438a69984 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
@@ -23,7 +23,7 @@ public class ImageLineHelper {
 	/**
 	 * Given an indexed line with a palette, unpacks as a RGB array, or RGBA if
 	 * a non nul PngChunkTRNS chunk is passed
-	 * 
+	 *
 	 * @param line
 	 *            ImageLine as returned from PngReader
 	 * @param pal
@@ -143,7 +143,7 @@ public class ImageLineHelper {
 
 	/**
 	 * integer packed R G B only for bitdepth=8! (does not check!)
-	 * 
+	 *
 	 **/
 	public static int getPixelRGB8(ImageLine line, int column) {
 		int offset = column * line.channels;
@@ -252,7 +252,7 @@ public class ImageLineHelper {
 	 * <code>scale==true<code>, it scales the value (just a bit shift) towards 0-255.
 	 * <p>
 	 * You probably should use {@link ImageLine#unpackToNewImageLine()}
-	 * 
+	 *
 	 */
 	public static int[] unpack(ImageInfo imgInfo, int[] src, int[] dst, boolean scale) {
 		int len1 = imgInfo.samplesPerRow;
@@ -282,7 +282,7 @@ public class ImageLineHelper {
 	 * Packs scanline (for bitdepth 1-2-4) from array into the scanline
 	 * <p>
 	 * If <code>scale==true<code>, it scales the value (just a bit shift).
-	 * 
+	 *
 	 * You probably should use {@link ImageLine#packToNewImageLine()}
 	 */
 	public static int[] pack(ImageInfo imgInfo, int[] src, int[] dst, boolean scale) {
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java
index feb50e7b6..fb2cf5910 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java
@@ -5,7 +5,7 @@ import jogamp.opengl.util.pngj.ImageLine.SampleType;
 /**
  * Wraps in a matrix a set of image rows, not necessarily contiguous - but
  * equispaced.
- * 
+ *
  * The fields mirrors those of {@link ImageLine}, and you can access each row as
  * a ImageLine backed by the matrix row, see
  * {@link #getImageLineAtMatrixRow(int)}
@@ -28,7 +28,7 @@ public class ImageLines {
 	 * Allocates a matrix to store {@code nRows} image rows. See
 	 * {@link ImageLine} and {@link PngReader#readRowsInt()}
 	 * {@link PngReader#readRowsByte()}
-	 * 
+	 *
 	 * @param imgInfo
 	 * @param stype
 	 * @param unpackedMode
@@ -77,7 +77,7 @@ public class ImageLines {
 
 	/**
 	 * Converts from matrix row number (0 : nRows-1) to image row number
-	 * 
+	 *
 	 * @param mrow
 	 *            Matrix row number
 	 * @return Image row number. Invalid only if mrow is invalid
@@ -88,7 +88,7 @@ public class ImageLines {
 
 	/**
 	 * Returns a ImageLine is backed by the matrix, no allocation done
-	 * 
+	 *
 	 * @param mrow
 	 *            Matrix row, from 0 to nRows This is not necessarily the image
 	 *            row, see {@link #imageRowToMatrixRow(int)} and
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
index a950c6b33..1f598a5de 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
@@ -49,7 +49,7 @@ public class PngHelperInternal {
 
 	/**
 	 * -1 if eof
-	 * 
+	 *
 	 * PNG uses "network byte order"
 	 */
 	public static int readInt2(InputStream is) {
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
index e42dd8733..73442e0bb 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
@@ -92,13 +92,13 @@ public class PngReader {
 	 * Constructs a PngReader from an InputStream.
 	 * <p>
 	 * See also <code>FileHelper.createPngReader(File f)</code> if available.
-	 * 
+	 *
 	 * Reads only the signature and first chunk (IDHR)
-	 * 
+	 *
 	 * @param filenameOrDescription
 	 *            : Optional, can be a filename or a description. Just for
 	 *            error/debug messages
-	 * 
+	 *
 	 */
 	public PngReader(InputStream inputStream, String filenameOrDescription) {
 		this.filename = filenameOrDescription == null ? "" : filenameOrDescription;
@@ -411,7 +411,7 @@ public class PngReader {
 
 	/**
 	 * Determines which ancillary chunks (metada) are to be loaded
-	 * 
+	 *
 	 * @param chunkLoadBehaviour
 	 *            {@link ChunkLoadBehaviour}
 	 */
@@ -427,7 +427,7 @@ public class PngReader {
 	 * replaced by a single dummy-marker IDAT chunk. These might be copied to
 	 * the PngWriter
 	 * <p>
-	 * 
+	 *
 	 * @see #getMetadata()
 	 */
 	public ChunksList getChunksList() {
@@ -442,7 +442,7 @@ public class PngReader {
 
 	/**
 	 * High level wrapper over chunksList
-	 * 
+	 *
 	 * @see #getChunksList()
 	 */
 	public PngMetadata getMetadata() {
@@ -456,7 +456,7 @@ public class PngReader {
 	 * appropiate readRowInt/readRowByte
 	 * <p>
 	 * In general, specifying the concrete readRowInt/readRowByte is preferrable
-	 * 
+	 *
 	 * @see #readRowInt(int) {@link #readRowByte(int)}
 	 */
 	public ImageLine readRow(int nrow) {
@@ -468,9 +468,9 @@ public class PngReader {
 	/**
 	 * Reads the row as INT, storing it in the {@link #imgLine} property and
 	 * returning it.
-	 * 
+	 *
 	 * The row must be greater or equal than the last read row.
-	 * 
+	 *
 	 * @param nrow
 	 *            Row number, from 0 to rows-1. Increasing order.
 	 * @return ImageLine object, also available as field. Data is in
@@ -490,10 +490,10 @@ public class PngReader {
 	/**
 	 * Reads the row as BYTES, storing it in the {@link #imgLine} property and
 	 * returning it.
-	 * 
+	 *
 	 * The row must be greater or equal than the last read row. This method
 	 * allows to pass the same row that was last read.
-	 * 
+	 *
 	 * @param nrow
 	 *            Row number, from 0 to rows-1. Increasing order.
 	 * @return ImageLine object, also available as field. Data is in
@@ -524,13 +524,13 @@ public class PngReader {
 	 * <p>
 	 * If the bitdepth is less than 8, the bytes are packed - unless
 	 * {@link #unpackedMode} is true.
-	 * 
+	 *
 	 * @param buffer
 	 *            Prealocated buffer, or null.
 	 * @param nrow
 	 *            Row number (0 is top). Most be strictly greater than the last
 	 *            read row.
-	 * 
+	 *
 	 * @return The scanline in the same passwd buffer if it was allocated, a
 	 *         newly allocated one otherwise
 	 */
@@ -562,13 +562,13 @@ public class PngReader {
 	 * {@link #unpackedMode} is true. <br>
 	 * If the bitdepth is 16, the least significant byte is lost.
 	 * <p>
-	 * 
+	 *
 	 * @param buffer
 	 *            Prealocated buffer, or null.
 	 * @param nrow
 	 *            Row number (0 is top). Most be strictly greater than the last
 	 *            read row.
-	 * 
+	 *
 	 * @return The scanline in the same passwd buffer if it was allocated, a
 	 *         newly allocated one otherwise
 	 */
@@ -632,9 +632,9 @@ public class PngReader {
 	 * <p>
 	 * Notice that the columns in the matrix is not the pixel width of the
 	 * image, but rather pixels x channels
-	 * 
+	 *
 	 * @see #readRowInt(int) to read about the format of each row
-	 * 
+	 *
 	 * @param rowOffset
 	 *            Number of rows to be skipped
 	 * @param nRows
@@ -678,7 +678,7 @@ public class PngReader {
 
 	/**
 	 * Same as readRowsInt(0, imgInfo.rows, 1)
-	 * 
+	 *
 	 * @see #readRowsInt(int, int, int)
 	 */
 	public ImageLines readRowsInt() {
@@ -696,10 +696,10 @@ public class PngReader {
 	 * <p>
 	 * Notice that the columns in the matrix is not the pixel width of the
 	 * image, but rather pixels x channels
-	 * 
+	 *
 	 * @see #readRowByte(int) to read about the format of each row. Notice that
 	 *      if the bitdepth is 16 this will lose information
-	 * 
+	 *
 	 * @param rowOffset
 	 *            Number of rows to be skipped
 	 * @param nRows
@@ -743,7 +743,7 @@ public class PngReader {
 
 	/**
 	 * Same as readRowsByte(0, imgInfo.rows, 1)
-	 * 
+	 *
 	 * @see #readRowsByte(int, int, int)
 	 */
 	public ImageLines readRowsByte() {
@@ -752,13 +752,13 @@ public class PngReader {
 
 	/*
 	 * For the interlaced case, nrow indicates the subsampled image - the pass must be set already.
-	 * 
+	 *
 	 * This must be called in strict order, both for interlaced or no interlaced.
-	 * 
+	 *
 	 * Updates rowNum.
-	 * 
+	 *
 	 * Leaves raw result in rowb
-	 * 
+	 *
 	 * Returns bytes actually read (not including the filter byte)
 	 */
 	private int readRowRaw(final int nrow) {
@@ -933,7 +933,7 @@ public class PngReader {
 	 * scanline will be sample. This implies more processing and memory, but
 	 * it's the most efficient option if you intend to read individual pixels. <br>
 	 * This option should only be set before start reading.
-	 * 
+	 *
 	 * @param unPackedMode
 	 */
 	public void setUnpackedMode(boolean unPackedMode) {
@@ -951,7 +951,7 @@ public class PngReader {
 	 * Tries to reuse the allocated buffers from other already used PngReader
 	 * object. This will have no effect if the buffers are smaller than necessary.
 	 * It also reuses the inflater.
-	 * 
+	 *
 	 * @param other A PngReader that has already finished reading pixels. Can be null.
 	 */
 	public void reuseBuffersFrom(PngReader other) {
@@ -977,7 +977,7 @@ public class PngReader {
 	/**
 	 * Just for testing. TO be called after ending reading, only if
 	 * initCrctest() was called before start
-	 * 
+	 *
 	 * @return CRC of the raw pixels values
 	 */
 	long getCrctestVal() {
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
index 3e684a881..2f475aab1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
@@ -88,7 +88,7 @@ public class PngWriter {
 	 * filters) and queue chunks before start writing the pixels.
 	 * <p>
 	 * See also <code>FileHelper.createPngWriter()</code> if available.
-	 * 
+	 *
 	 * @param outputStream
 	 *            Opened stream for binary writing
 	 * @param imgInfo
@@ -422,7 +422,7 @@ public class PngWriter {
 	 * Should be called when creating an image from another, before starting
 	 * writing lines, to copy relevant chunks.
 	 * <p>
-	 * 
+	 *
 	 * @param reader
 	 *            : PngReader object, already opened.
 	 * @param copy_mask
@@ -439,7 +439,7 @@ public class PngWriter {
 	 * Should be called when creating an image from another, after writing all
 	 * lines, before closing the writer, to copy additional chunks.
 	 * <p>
-	 * 
+	 *
 	 * @param reader
 	 *            : PngReader object, already opened and fully read.
 	 * @param copy_mask
@@ -455,7 +455,7 @@ public class PngWriter {
 	 * <p>
 	 * Actually: compressed size = total size of IDAT data , raw size =
 	 * uncompressed pixel bytes = rows * (bytesPerRow + 1).
-	 * 
+	 *
 	 * This must be called after pngw.end()
 	 */
 	public double computeCompressionRatio() {
@@ -512,7 +512,7 @@ public class PngWriter {
 	 * This must be called just after constructor, before starting writing.
 	 * <p>
 	 * See also setFilterType()
-	 * 
+	 *
 	 * @param compLevel
 	 *            between 0 and 9 (default:6 , recommended: 6 or more)
 	 */
@@ -528,7 +528,7 @@ public class PngWriter {
 	 * This must be called just after constructor, before starting writing.
 	 * <p>
 	 * See also setCompLevel()
-	 * 
+	 *
 	 * @param filterType
 	 *            One of the five prediction types or strategy to choose it (see
 	 *            <code>PngFilterType</code>) Recommended values: DEFAULT
@@ -542,7 +542,7 @@ public class PngWriter {
 	 * Sets maximum size of IDAT fragments. This has little effect on
 	 * performance you should rarely call this
 	 * <p>
-	 * 
+	 *
 	 * @param idatMaxSize
 	 *            default=0 : use defaultSize (32K)
 	 */
@@ -572,7 +572,7 @@ public class PngWriter {
 	/**
 	 * Writes line, checks that the row number is consistent with that of the
 	 * ImageLine See writeRow(int[] newrow, int rown)
-	 * 
+	 *
 	 * @deprecated Better use writeRow(ImageLine imgline, int rownumber)
 	 */
 	public void writeRow(ImageLine imgline) {
@@ -581,9 +581,9 @@ public class PngWriter {
 
 	/**
 	 * Writes line. See writeRow(int[] newrow, int rown)
-	 * 
+	 *
 	 * The <tt>packed</tt> flag of the imageline is honoured!
-	 * 
+	 *
 	 * @see #writeRowInt(int[], int)
 	 */
 	public void writeRow(ImageLine imgline, int rownumber) {
@@ -596,7 +596,7 @@ public class PngWriter {
 
 	/**
 	 * Same as writeRow(int[] newrow, int rown), but does not check row number
-	 * 
+	 *
 	 * @param newrow
 	 */
 	public void writeRow(int[] newrow) {
@@ -605,7 +605,7 @@ public class PngWriter {
 
 	/**
 	 * Alias to writeRowInt
-	 * 
+	 *
 	 * @see #writeRowInt(int[], int)
 	 */
 	public void writeRow(int[] newrow, int rown) {
@@ -624,7 +624,7 @@ public class PngWriter {
 	 * Warning: the array might be modified in some cases (unpacked row with low
 	 * bitdepth)
 	 * <p>
-	 * 
+	 *
 	 * @param newrow
 	 *            Array of pixel values. Warning: the array size should be exact
 	 *            (samplesPerRowP)
@@ -642,7 +642,7 @@ public class PngWriter {
 	 * Same semantics as writeRowInt but using bytes. Each byte is still a
 	 * sample. If 16bitdepth, we are passing only the most significant byte (and
 	 * hence losing some info)
-	 * 
+	 *
 	 * @see PngWriter#writeRowInt(int[], int)
 	 */
 	public void writeRowByte(byte[] newrow, int rown) {
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
index 4a45cb5bf..97e24fc73 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
@@ -2,9 +2,9 @@ package jogamp.opengl.util.pngj;
 
 /**
  * Generic exception
- * 
+ *
  * @author Hernan J Gonzalez
- * 
+ *
  */
 public class PngjException extends RuntimeException {
 	private static final long serialVersionUID = 1L;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
index c429b893b..5da70de7b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
@@ -3,9 +3,9 @@ package jogamp.opengl.util.pngj;
 /**
  * Exception for anomalous internal problems (sort of asserts) that point to
  * some issue with the library
- * 
+ *
  * @author Hernan J Gonzalez
- * 
+ *
  */
 public class PngjExceptionInternal extends RuntimeException {
 	private static final long serialVersionUID = 1L;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
index a995e4481..82abb902d 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
@@ -59,7 +59,7 @@ public class ChunkHelper {
 	};
 
 	/*
-	 * static auxiliary buffer. any method that uses this should synchronize against this 
+	 * static auxiliary buffer. any method that uses this should synchronize against this
 	 */
 	private static byte[] tmpbuffer = new byte[4096];
 
@@ -136,7 +136,7 @@ public class ChunkHelper {
 
 	/**
 	 * Finds position of null byte in array
-	 * 
+	 *
 	 * @param b
 	 * @return -1 if not found
 	 */
@@ -149,7 +149,7 @@ public class ChunkHelper {
 
 	/**
 	 * Decides if a chunk should be loaded, according to a ChunkLoadBehaviour
-	 * 
+	 *
 	 * @param id
 	 * @param behav
 	 * @return true/false
@@ -208,7 +208,7 @@ public class ChunkHelper {
 
 	/**
 	 * Returns only the chunks that "match" the predicate
-	 * 
+	 *
 	 * See also trimList()
 	 */
 	public static List<PngChunk> filterList(List<PngChunk> target, ChunkPredicate predicateKeep) {
@@ -223,7 +223,7 @@ public class ChunkHelper {
 
 	/**
 	 * Remove (in place) the chunks that "match" the predicate
-	 * 
+	 *
 	 * See also filterList
 	 */
 	public static int trimList(List<PngChunk> target, ChunkPredicate predicateRemove) {
@@ -244,10 +244,10 @@ public class ChunkHelper {
 	 * they have same id and (perhaps, if multiple are allowed) if the match
 	 * also in some "internal key" (eg: key for string values, palette for sPLT,
 	 * etc)
-	 * 
+	 *
 	 * Notice that the use of this is optional, and that the PNG standard allows
 	 * Text chunks that have same key
-	 * 
+	 *
 	 * @return true if "equivalent"
 	 */
 	public static final boolean equivalent(PngChunk c1, PngChunk c2) {
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkLoadBehaviour.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkLoadBehaviour.java
index 82ab3bcf9..1fa00380a 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkLoadBehaviour.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkLoadBehaviour.java
@@ -15,7 +15,7 @@ public enum ChunkLoadBehaviour {
 	 */
 	LOAD_CHUNK_KNOWN,
 	/**
-	 * 
+	 *
 	 * Load chunk if "known" or "safe to copy".
 	 */
 	LOAD_CHUNK_IF_SAFE,
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkPredicate.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkPredicate.java
index a750ae34f..4695ccf44 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkPredicate.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkPredicate.java
@@ -6,7 +6,7 @@ package jogamp.opengl.util.pngj.chunks;
 public interface ChunkPredicate {
 	/**
 	 * The other chunk matches with this one
-	 * 
+	 *
 	 * @param chunk
 	 * @return true if match
 	 */
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
index 5ce94ff9f..3e0d03051 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
@@ -24,7 +24,7 @@ public class ChunksList {
 
 	/**
 	 * All chunks, read (or written)
-	 * 
+	 *
 	 * But IDAT is a single pseudo chunk without data
 	 */
 	protected List<PngChunk> chunks = new ArrayList<PngChunk>();
@@ -37,7 +37,7 @@ public class ChunksList {
 
 	/**
 	 * Keys of processed (read or writen) chunks
-	 * 
+	 *
 	 * @return key:chunk id, val: number of occurrences
 	 */
 	public HashMap<String, Integer> getChunksKeys() {
@@ -87,7 +87,7 @@ public class ChunksList {
 
 	/**
 	 * All chunks with this ID
-	 * 
+	 *
 	 * @param id
 	 * @return List, empty if none
 	 */
@@ -98,7 +98,7 @@ public class ChunksList {
 	/**
 	 * If innerid!=null and the chunk is PngChunkTextVar or PngChunkSPLT, it's
 	 * filtered by that id
-	 * 
+	 *
 	 * @param id
 	 * @return innerid Only used for text and SPLT chunks
 	 * @return List, empty if none
@@ -109,7 +109,7 @@ public class ChunksList {
 
 	/**
 	 * Returns only one chunk
-	 * 
+	 *
 	 * @param id
 	 * @return First chunk found, null if not found
 	 */
@@ -146,7 +146,7 @@ public class ChunksList {
 
 	/**
 	 * Finds all chunks "equivalent" to this one
-	 * 
+	 *
 	 * @param c2
 	 * @return Empty if nothing found
 	 */
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
index e76456ad4..3b84ab800 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
@@ -67,7 +67,7 @@ public class ChunksListForWrite extends ChunksList {
 
 	/**
 	 * Remove Chunk: only from queued
-	 * 
+	 *
 	 * WARNING: this depends on c.equals() implementation, which is
 	 * straightforward for SingleChunks. For MultipleChunks, it will normally
 	 * check for reference equality!
@@ -78,9 +78,9 @@ public class ChunksListForWrite extends ChunksList {
 
 	/**
 	 * Adds chunk to queue
-	 * 
+	 *
 	 * Does not check for duplicated or anything
-	 * 
+	 *
 	 * @param c
 	 */
 	public boolean queue(PngChunk c) {
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
index a45979ec2..6cd86eb98 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
@@ -248,7 +248,7 @@ public abstract class PngChunk {
 	/**
 	 * Creates the physical chunk. This is used when writing (serialization).
 	 * Each particular chunk class implements its own logic.
-	 * 
+	 *
 	 * @return A newly allocated and filled raw chunk
 	 */
 	public abstract ChunkRaw createRawChunk();
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
index 4a8502a3d..ea6235432 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
@@ -70,7 +70,7 @@ public class PngChunkBKGD extends PngChunkSingle {
 
 	/**
 	 * Set gray value (0-255 if bitdept=8)
-	 * 
+	 *
 	 * @param gray
 	 */
 	public void setGray(int gray) {
@@ -87,7 +87,7 @@ public class PngChunkBKGD extends PngChunkSingle {
 
 	/**
 	 * Set pallette index
-	 * 
+	 *
 	 */
 	public void setPaletteIndex(int i) {
 		if (!imgInfo.indexed)
@@ -103,7 +103,7 @@ public class PngChunkBKGD extends PngChunkSingle {
 
 	/**
 	 * Set rgb values
-	 * 
+	 *
 	 */
 	public void setRGB(int r, int g, int b) {
 		if (imgInfo.greyscale || imgInfo.indexed)
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
index d44250a2f..057f6c25e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
@@ -19,9 +19,9 @@ public abstract class PngChunkMultiple extends PngChunk {
 	/**
 	 * NOTE: this chunk uses the default Object's equals() hashCode()
 	 * implementation.
-	 * 
+	 *
 	 * This is the right thing to do, normally.
-	 * 
+	 *
 	 * This is important, eg see ChunkList.removeFromList()
 	 */
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
index bc70c6e5e..3a490654a 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
@@ -106,7 +106,7 @@ public class PngChunkSBIT extends PngChunkSingle {
 
 	/**
 	 * Set rgb values
-	 * 
+	 *
 	 */
 	public void setRGB(int r, int g, int b) {
 		if (imgInfo.greyscale || imgInfo.indexed)
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
index b68776477..867e34861 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
@@ -82,7 +82,7 @@ public class PngChunkTRNS extends PngChunkSingle {
 
 	/**
 	 * Set rgb values
-	 * 
+	 *
 	 */
 	public void setRGB(int r, int g, int b) {
 		if (imgInfo.greyscale || imgInfo.indexed)
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
index ecf8b98c3..fa3649613 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
@@ -87,7 +87,7 @@ public class PngMetadata {
 	/**
 	 * Creates a time chunk with current time, less secsAgo seconds
 	 * <p>
-	 * 
+	 *
 	 * @return Returns the created-queued chunk, just in case you want to
 	 *         examine or modify it
 	 */
@@ -105,7 +105,7 @@ public class PngMetadata {
 	/**
 	 * Creates a time chunk with diven date-time
 	 * <p>
-	 * 
+	 *
 	 * @return Returns the created-queued chunk, just in case you want to
 	 *         examine or modify it
 	 */
@@ -133,7 +133,7 @@ public class PngMetadata {
 	/**
 	 * Creates a text chunk and queue it.
 	 * <p>
-	 * 
+	 *
 	 * @param k
 	 *            : key (latin1)
 	 * @param val
@@ -201,7 +201,7 @@ public class PngMetadata {
 
 	/**
 	 * Returns the palette chunk, if present
-	 * 
+	 *
 	 * @return null if not present
 	 */
 	public PngChunkPLTE getPLTE() {
@@ -220,7 +220,7 @@ public class PngMetadata {
 
 	/**
 	 * Returns the TRNS chunk, if present
-	 * 
+	 *
 	 * @return null if not present
 	 */
 	public PngChunkTRNS getTRNS() {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
index bf2d3fa47..7a4e08d26 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
@@ -58,7 +58,7 @@ public class WGLGLCapabilities extends GLCapabilities {
       setRedBits(pfd.getCRedBits());
       setGreenBits(pfd.getCGreenBits());
       setBlueBits(pfd.getCBlueBits());
-      setAlphaBits(pfd.getCAlphaBits()); 
+      setAlphaBits(pfd.getCAlphaBits());
       setAccumRedBits(pfd.getCAccumRedBits());
       setAccumGreenBits(pfd.getCAccumGreenBits());
       setAccumBlueBits(pfd.getCAccumBlueBits());
@@ -77,12 +77,12 @@ public class WGLGLCapabilities extends GLCapabilities {
 
       return true;
   }
-    
+
   public static final String PFD2String(PIXELFORMATDESCRIPTOR pfd, int pfdID) {
       final int dwFlags = pfd.getDwFlags();
       StringBuilder sb = new StringBuilder();
       boolean sep = false;
-      
+
       if( 0 != (GDI.PFD_DRAW_TO_WINDOW & dwFlags ) ) {
           sep = true;
           sb.append("window");
@@ -106,7 +106,7 @@ public class WGLGLCapabilities extends GLCapabilities {
       if( 0 == (GDI.PFD_GENERIC_FORMAT & dwFlags ) || 0 == (GDI.PFD_GENERIC_ACCELERATED & dwFlags ) ) {
           if(sep) { sb.append(CSEP); } sep=true;
           sb.append("hw-accel");
-      }        
+      }
       return "PFD[id = "+pfdID+" (0x"+Integer.toHexString(pfdID)+
               "), colorBits "+pfd.getCColorBits()+", rgba "+pfd.getCRedBits()+ESEP+pfd.getCGreenBits()+ESEP+pfd.getCBlueBits()+ESEP+pfd.getCAlphaBits()+
               ", accum-rgba "+pfd.getCAccumRedBits()+ESEP+pfd.getCAccumGreenBits()+ESEP+pfd.getCAccumBlueBits()+ESEP+pfd.getCAccumAlphaBits()+
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
index 3e788d286..6454a34b5 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
@@ -33,15 +33,15 @@ import jogamp.opengl.Debug;
 
 public class WGLUtil {
     /**
-     * Switch to use the <code>wgl</code> variants of {@link jogamp.opengl.windows.wgl.WGL} 
+     * Switch to use the <code>wgl</code> variants of {@link jogamp.opengl.windows.wgl.WGL}
      * to replace the following 5 GDI based functions (see below).
      * <p>
      * Disabled per default.
-     * </p> 
+     * </p>
      * <p>
      * You can enable it by defining the property <code>jogl.windows.useWGLVersionOf5WGLGDIFuncSet</code>.
      * </p>
-     * 
+     *
      * @see jogamp.nativewindow.windows.GDI#ChoosePixelFormat(long, PIXELFORMATDESCRIPTOR)
      * @see jogamp.nativewindow.windows.GDI#DescribePixelFormat(long, int, int, PIXELFORMATDESCRIPTOR)
      * @see jogamp.nativewindow.windows.GDI#GetPixelFormat(long)
@@ -49,7 +49,7 @@ public class WGLUtil {
      * @see jogamp.nativewindow.windows.GDI#SwapBuffers(long)
      */
     public static final boolean USE_WGLVersion_Of_5WGLGDIFuncSet;
-    
+
     static {
         Debug.initSingleton();
         USE_WGLVersion_Of_5WGLGDIFuncSet = Debug.isPropertyDefined("jogl.windows.useWGLVersionOf5WGLGDIFuncSet", true);
@@ -63,34 +63,34 @@ public class WGLUtil {
             return WGL.wglChoosePixelFormat(hdc, pfd);
         } else {
             return GDI.ChoosePixelFormat(hdc, pfd);
-        }        
+        }
     }
     public static int DescribePixelFormat(long hdc, int pfdid, int pfdSize, PIXELFORMATDESCRIPTOR pfd)  {
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             return WGL.wglDescribePixelFormat(hdc, pfdid, pfdSize, pfd);
         } else {
             return GDI.DescribePixelFormat(hdc, pfdid, pfdSize, pfd);
-        }                
+        }
     }
     public static int GetPixelFormat(long hdc)  {
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             return WGL.wglGetPixelFormat(hdc);
         } else {
             return GDI.GetPixelFormat(hdc);
-        }                
+        }
     }
-    public static boolean SetPixelFormat(long hdc, int pfdid, PIXELFORMATDESCRIPTOR pfd)  {        
+    public static boolean SetPixelFormat(long hdc, int pfdid, PIXELFORMATDESCRIPTOR pfd)  {
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             return WGL.wglSetPixelFormat(hdc, pfdid, pfd);
         } else {
             return GDI.SetPixelFormat(hdc, pfdid, pfd);
-        }                
+        }
     }
-    public static boolean SwapBuffers(long hdc)  {        
+    public static boolean SwapBuffers(long hdc)  {
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             return WGL.wglSwapBuffers(hdc);
         } else {
             return GDI.SwapBuffers(hdc);
-        }                
+        }
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
index 909a017b0..f658a3598 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
@@ -63,7 +63,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
   private WindowsBitmapWGLDrawable(GLDrawableFactory factory, NativeSurface comp) {
     super(factory, comp, false);
   }
-  
+
   protected static WindowsBitmapWGLDrawable create(GLDrawableFactory factory, NativeSurface comp) {
     final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)comp.getGraphicsConfiguration();
     final AbstractGraphicsDevice aDevice = config.getScreen().getDevice();
@@ -102,7 +102,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
   public boolean isGLOriented() {
       return false;
   }
-  
+
   private void createBitmap() {
     int werr;
     final NativeSurface ns = getNativeSurface();
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
index a5893775a..966a8b28a 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
@@ -56,7 +56,7 @@ import jogamp.nativewindow.windows.GDI;
 import jogamp.opengl.GLContextShareSet;
 
 public class WindowsExternalWGLContext extends WindowsWGLContext {
-    
+
   private WindowsExternalWGLContext(Drawable drawable, long ctx, WindowsWGLGraphicsConfiguration cfg) {
     super(drawable, null);
     this.contextHandle = ctx;
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
index 217ca18e8..2e60c682b 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -127,7 +127,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
         }
 
         final int winattrPbuffer = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(false /* onscreen */, false /* fbo */, true /* pbuffer */, false /* bitmap */);
-        
+
         final IntBuffer iattributes = Buffers.newDirectIntBuffer(2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS);
         final FloatBuffer fattributes = Buffers.newDirectFloatBuffer(1);
         int[]   floatModeTmp = new int[1];
@@ -162,7 +162,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
         if (DEBUG) {
           System.err.println("" + nformats + " suitable pixel formats found");
           for (int i = 0; i < nformats; i++) {
-            WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile, 
+            WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
                                           sharedHdc, pformats.get(i), winattrPbuffer);
             System.err.println("pixel format " + pformats.get(i) + " (index " + i + "): " + dbgCaps);
           }
@@ -209,7 +209,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
 
         // Re-query chosen pixel format
         {
-          WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile, 
+          WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
                                           sharedHdc, pfdid, winattrPbuffer);
           if(null == newCaps) {
             throw new GLException("pbuffer creation error: unable to re-query chosen PFD ID: " + pfdid + ", hdc " + GLDrawableImpl.toHexString(tmpHdc));
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
index 3fad22d88..d936308af 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
@@ -280,7 +280,7 @@ public class WindowsWGLContext extends GLContextImpl {
     if (DEBUG) {
         System.err.println(getThreadName() + ": createImpl: START "+glCaps+", share "+shareWith);
     }
-    
+
     // Windows can set up sharing of display lists after creation time
     long share;
     if ( null != shareWith ) {
@@ -405,7 +405,7 @@ public class WindowsWGLContext extends GLContextImpl {
   protected void  makeCurrentImpl() throws GLException {
     if (WGL.wglGetCurrentContext() != contextHandle) {
       if (!wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-        throw new GLException("Error making context " + toHexString(contextHandle) + 
+        throw new GLException("Error making context " + toHexString(contextHandle) +
                               " current on Thread " + getThreadName() +
                               ", drawableWrite " + toHexString(drawable.getHandle()) +
                               ", drawableRead "+ toHexString(drawableRead.getHandle()) +
@@ -563,13 +563,13 @@ public class WindowsWGLContext extends GLContextImpl {
   }
 
   @Override
-  public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {  
+  public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
     return getWGLExt().wglAllocateMemoryNV(size, readFrequency, writeFrequency, priority);
   }
-  
+
   @Override
   public final void glFreeMemoryNV(ByteBuffer pointer) {
     getWGLExt().wglFreeMemoryNV(pointer);
   }
-  
+
 }
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
index 741e671eb..66071cbe1 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
@@ -52,12 +52,12 @@ import jogamp.opengl.GLDynamicLookupHelper;
 
 public abstract class WindowsWGLDrawable extends GLDrawableImpl {
   private static final boolean PROFILING;
-  
+
   static {
       Debug.initSingleton();
       PROFILING = Debug.isPropertyDefined("jogl.debug.GLDrawable.profiling", true);
   }
-  
+
   private static final int PROFILING_TICKS = 200;
   private int  profilingSwapBuffersTicks;
   private long profilingSwapBuffersTime;
@@ -87,11 +87,11 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
         } else {
           t0 = 0;
         }
-    
+
         if (!WGLUtil.SwapBuffers(getHandle()) && (GDI.GetLastError() != GDI.ERROR_SUCCESS)) {
           throw new GLException("Error swapping buffers");
         }
-    
+
         if (PROFILING) {
           profilingSwapBuffersTime += System.currentTimeMillis() - t0;
           if (++profilingSwapBuffersTicks == PROFILING_TICKS) {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index 156e75196..203af110c 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -137,8 +137,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   protected final boolean isComplete() {
       return null != windowsWGLDynamicLookupHelper;
   }
-  
-  
+
+
   @Override
   protected final void destroy() {
     if(null != sharedResourceRunner) {
@@ -216,7 +216,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
       private AbstractGraphicsScreen screen;
       private GLDrawableImpl drawable;
       private GLContextImpl context;
-      
+
       SharedResource(WindowsGraphicsDevice dev, AbstractGraphicsScreen scrn, GLDrawableImpl draw, GLContextImpl ctx,
                      boolean arbPixelFormat, boolean arbMultisample, boolean arbPBuffer, boolean arbReadDrawable) {
           device = dev;
@@ -243,7 +243,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
       final public GLContextImpl getContext() { return context; }
       @Override
       public GLRendererQuirks getRendererQuirks() {
-          return null != context ? context.getRendererQuirks() : null;      
+          return null != context ? context.getRendererQuirks() : null;
       }
 
       final boolean hasARBPixelFormat() { return hasARBPixelFormat; }
@@ -276,7 +276,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
         public boolean isDeviceSupported(String connection) {
             return true;
         }
-        
+
         @Override
         public SharedResourceRunner.Resource createSharedResource(String connection) {
             final WindowsGraphicsDevice sharedDevice = new WindowsGraphicsDevice(connection, AbstractGraphicsDevice.DEFAULT_UNIT);
@@ -290,7 +290,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
                 final GLCapabilitiesImmutable caps = new GLCapabilities(glp);
                 final GLDrawableImpl sharedDrawable = createOnscreenDrawableImpl(createDummySurfaceImpl(sharedDevice, false, caps, caps, null, 64, 64));
                 sharedDrawable.setRealized(true);
-                                
+
                 final GLContextImpl sharedContext  = (GLContextImpl) sharedDrawable.createContext(null);
                 if (null == sharedContext) {
                     throw new GLException("Couldn't create shared context for drawable: "+sharedDrawable);
@@ -473,8 +473,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice, 
-                                                        GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, 
+  protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
+                                                        GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
                                                         GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
     final WindowsGraphicsDevice device;
     if(createNewDevice || !(deviceReq instanceof WindowsGraphicsDevice)) {
@@ -485,13 +485,13 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
     final AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);
     final WindowsWGLGraphicsConfiguration config = WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen);
     if(null == config) {
-        throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen); 
-    }    
+        throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen);
+    }
     return new WrappedSurface(config, 0, upstreamHook, createNewDevice);
   }
 
   @Override
-  public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice, 
+  public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
                                                    GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
     final WindowsGraphicsDevice device;
     if( createNewDevice || !(deviceReq instanceof WindowsGraphicsDevice) ) {
@@ -502,12 +502,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
     final AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);
     chosenCaps = GLGraphicsConfigurationUtil.fixOnscreenGLCapabilities(chosenCaps);
     final WindowsWGLGraphicsConfiguration config = WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(chosenCaps, requestedCaps, chooser, screen);
-    if(null == config) { 
+    if(null == config) {
         throw new GLException("Choosing GraphicsConfiguration failed w/ "+chosenCaps+" on "+screen);
-    }    
+    }
     return new GDISurface(config, 0, new GDIDummyUpstreamSurfaceHook(width, height), createNewDevice);
-  }    
-  
+  }
+
   @Override
   protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
     final WindowsGraphicsDevice device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
index 7ec6c50f8..6098cde7f 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl.windows.wgl;
 
 import jogamp.opengl.*;
@@ -41,10 +41,10 @@ public final class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLi
         final List<List<String>> libsList = new ArrayList<List<String>>();
         final List<String> libsGL = new ArrayList<String>();
         libsGL.add("OpenGL32");
-        libsList.add(libsGL);        
+        libsList.add(libsGL);
         return libsList;
     }
-    
+
     @Override
     public final List<String> getToolGetProcAddressFuncNameList() {
         List<String> res = new ArrayList<String>();
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index 42b92305a..cb445f005 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -58,7 +58,7 @@ import jogamp.nativewindow.windows.MARGINS;
 import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR;
 import jogamp.opengl.GLGraphicsConfigurationUtil;
 
-public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {    
+public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
     protected static final int MAX_PFORMATS = 256;
     protected static final int MAX_ATTRIBS  = 256;
 
@@ -66,7 +66,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
     private boolean isDetermined = false;
     private boolean isExternal = false;
 
-    WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen, 
+    WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen,
                                     GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
                                     GLCapabilitiesChooser chooser) {
         super(screen, capsChosen, capsRequested);
@@ -161,7 +161,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         if (0 == hdc) {
             throw new GLException("Error: HDC is null");
         }
-    
+
         if (!WGLUtil.SetPixelFormat(hdc, caps.getPFDID(), caps.getPFD())) {
             throw new GLException("Unable to set pixel format " + caps.getPFDID() + " of " + caps +
                                   " for device context " + toHexString(hdc) +
@@ -192,7 +192,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         }
         setCapsPFD(caps);
     }
-    
+
     /**
      * Only sets this configuration's capabilities and marks it as determined,
      * the actual pixelformat is not set.
@@ -209,20 +209,20 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
      * External configuration's HDC pixelformat shall not be modified
      */
     public final boolean isExternal() { return isExternal; }
-    
+
     final void markExternal() {
         this.isExternal=true;
     }
-    
+
     /**
      * Determined configuration states set target capabilties via {@link #setCapsPFD(WGLGLCapabilities)},
      * but does not imply a set pixelformat.
-     * 
-     * @see #setPixelFormat(long, WGLGLCapabilities) 
+     *
+     * @see #setPixelFormat(long, WGLGLCapabilities)
      * @see #setCapsPFD(WGLGLCapabilities)
      */
     public final boolean isDetermined() { return isDetermined; }
-    
+
     public final PIXELFORMATDESCRIPTOR getPixelFormat()   { return isDetermined ? ((WGLGLCapabilities)capabilitiesChosen).getPFD() : null; }
     public final int getPixelFormatID() { return isDetermined ? ((WGLGLCapabilities)capabilitiesChosen).getPFDID() : 0; }
     public final boolean isChoosenByARB() { return isDetermined ? ((WGLGLCapabilities)capabilitiesChosen).isSetByARB() : false; }
@@ -255,7 +255,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         }
         return niattribs;
     }
-    
+
     static boolean wglARBPFIDValid(WindowsWGLContext sharedCtx, long hdc, int pfdID) {
         final IntBuffer out = Buffers.newDirectIntBuffer(1);
         final IntBuffer in = Buffers.newDirectIntBuffer(1);
@@ -270,7 +270,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
     static int wglARBPFDIDCount(WindowsWGLContext sharedCtx, long hdc) {
         final IntBuffer iresults = Buffers.newDirectIntBuffer(1);
         final IntBuffer iattributes = Buffers.newDirectIntBuffer(1);
-        iattributes.put(0, WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB); 
+        iattributes.put(0, WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB);
 
         WGLExt wglExt = sharedCtx.getWGLExt();
         // pfdID shall be ignored here (spec), however, pass a valid pdf index '1' below (possible driver bug)
@@ -293,7 +293,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         }
         return pfdIDCount;
     }
-    
+
     static int[] wglAllARBPFDIDs(int pfdIDCount) {
         int[] pfdIDs = new int[pfdIDCount];
         for (int i = 0; i < pfdIDCount; i++) {
@@ -301,7 +301,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         }
         return pfdIDs;
     }
-    
+
     static WGLGLCapabilities wglARBPFID2GLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
                                                        AbstractGraphicsDevice device, GLProfile glp,
                                                        long hdc, int pfdID, int winattrbits) {
@@ -314,7 +314,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         final int niattribs = fillAttribsForGeneralWGLARBQuery(sharedResource, iattributes);
 
         if (!((WindowsWGLContext)sharedResource.getContext()).getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdID, 0, niattribs, iattributes, iresults)) {
-            throw new GLException("wglARBPFID2GLCapabilities: Error getting pixel format attributes for pixel format " + pfdID + 
+            throw new GLException("wglARBPFID2GLCapabilities: Error getting pixel format attributes for pixel format " + pfdID +
                                   " of device context " + toHexString(hdc) + ", werr " + GDI.GetLastError());
         }
         return AttribList2GLCapabilities(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits);
@@ -338,7 +338,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         final WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
         final IntBuffer pformatsTmp = Buffers.newDirectIntBuffer(WindowsWGLGraphicsConfiguration.MAX_PFORMATS);
         final IntBuffer numFormatsTmp = Buffers.newDirectIntBuffer(1);
-        
+
         if ( !wglExt.wglChoosePixelFormatARB(hdc, iattributes, fattributes,
                                              WindowsWGLGraphicsConfiguration.MAX_PFORMATS,
                                              pformatsTmp, numFormatsTmp) ) {
@@ -388,7 +388,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
                 if(null != caps) {
                     bucket.add(caps);
                     if(DEBUG) {
-                        final int j = bucket.size() - 1; 
+                        final int j = bucket.size() - 1;
                         System.err.println("wglARBPFIDs2GLCapabilities: bucket["+i+" -> "+j+"]: "+caps);
                     }
                 } else if(DEBUG) {
@@ -411,7 +411,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
                                              IntBuffer iattributes,
                                              WindowsWGLDrawableFactory.SharedResource sharedResource,
                                              int accelerationValue,
-                                             int[] floatMode) throws GLException {    
+                                             int[] floatMode) throws GLException {
         if (!sharedResource.hasARBPixelFormat()) {
           return false;
         }
@@ -426,10 +426,10 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         }
 
         final boolean usePBuffer = caps.isPBuffer() && sharedResource.hasARBPBuffer() ;
-        
+
         final int surfaceType;
         if( caps.isOnscreen() ) {
-            surfaceType = WGLExt.WGL_DRAW_TO_WINDOW_ARB;            
+            surfaceType = WGLExt.WGL_DRAW_TO_WINDOW_ARB;
         } else if( caps.isFBO() ) {
             surfaceType = WGLExt.WGL_DRAW_TO_WINDOW_ARB;  // native replacement!
         } else if( usePBuffer ) {
@@ -441,7 +441,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         }
         iattributes.put(niattribs++, surfaceType);
         iattributes.put(niattribs++, GL.GL_TRUE);
-        
+
         iattributes.put(niattribs++, WGLExt.WGL_DOUBLE_BUFFER_ARB);
         if (caps.getDoubleBuffered()) {
           iattributes.put(niattribs++, GL.GL_TRUE);
@@ -455,7 +455,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         } else {
           iattributes.put(niattribs++, GL.GL_FALSE);
         }
-        
+
         iattributes.put(niattribs++, WGLExt.WGL_RED_BITS_ARB);
         iattributes.put(niattribs++, caps.getRedBits());
         iattributes.put(niattribs++, WGLExt.WGL_GREEN_BITS_ARB);
@@ -505,7 +505,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return true;
     }
 
-    static int AttribList2DrawableTypeBits(final IntBuffer iattribs, 
+    static int AttribList2DrawableTypeBits(final IntBuffer iattribs,
                                            final int niattribs, final IntBuffer iresults) {
         int val = 0;
 
@@ -533,7 +533,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return val;
     }
 
-    static WGLGLCapabilities AttribList2GLCapabilities(final AbstractGraphicsDevice device, 
+    static WGLGLCapabilities AttribList2GLCapabilities(final AbstractGraphicsDevice device,
                                                        final GLProfile glp, final long hdc, final int pfdID,
                                                        final IntBuffer iattribs, final int niattribs, IntBuffer iresults, final int winattrmask) {
         final int allDrawableTypeBits = AttribList2DrawableTypeBits(iattribs, niattribs, iresults);
@@ -554,7 +554,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         }
         final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
         res.setValuesByARB(iattribs, niattribs, iresults);
-        return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res); 
+        return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
     }
 
     //
@@ -608,7 +608,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         }
         if( GLGraphicsConfigurationUtil.BITMAP_BIT == drawableTypeBits ) {
             // BITMAP exclusive PFD SafeGuard: Only accept BITMAP compatible color formats!
-            final int pfdColorBits = pfd.getCColorBits(); 
+            final int pfdColorBits = pfd.getCColorBits();
             if ( pfdColorBits != 24 || 0 < pfd.getCAlphaBits() ) { // Allowed: RGB888 && !alpha
                 if(DEBUG) {
                     System.err.println("Drop [color bits excl BITMAP]: " + WGLGLCapabilities.PFD2String(pfd, pfdID));
@@ -619,24 +619,24 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
 
         final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
         res.setValuesByGDI();
-        return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res); 
+        return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
    }
 
     static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID) {
         PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
         return PFD2GLCapabilitiesNoCheck(device, glp, pfd, pfdID);
    }
-    
+
    static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(AbstractGraphicsDevice device, GLProfile glp, PIXELFORMATDESCRIPTOR pfd, int pfdID) {
         if(null == pfd) {
             return null;
         }
         final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
         res.setValuesByGDI();
-        
-        return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, PFD2DrawableTypeBits(pfd), res); 
+
+        return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, PFD2DrawableTypeBits(pfd), res);
    }
-    
+
    static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(GLCapabilitiesImmutable caps, PIXELFORMATDESCRIPTOR pfd) {
        int colorDepth = (caps.getRedBits() +
                caps.getGreenBits() +
@@ -665,7 +665,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
                pfdFlags |= GDI.PFD_DOUBLEBUFFER;
            }
        }
-       
+
        if (caps.getStereo()) {
            pfdFlags |= GDI.PFD_STEREO;
        }
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 3d093b972..9e917a0eb 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -93,7 +93,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
             throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
         }
-        
+
         return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, (GLCapabilitiesChooser)chooser, absScreen);
     }
 
@@ -123,7 +123,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         final GLProfile glp = GLProfile.getDefault(device);
 
         List<GLCapabilitiesImmutable> availableCaps = null;
-        
+
         final GLContext sharedContext;
         if ( factory.hasRendererQuirk(device, GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries) ) {
             sharedContext = sharedResource.getContext();
@@ -151,10 +151,10 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
             }
         } finally {
             if ( null != sharedContext ) {
-                sharedContext.release();    
+                sharedContext.release();
             } else {
                 sharedDrawable.unlockSurface();
-            }            
+            }
         }
 
         if( null != availableCaps && availableCaps.size() > 1 ) {
@@ -166,7 +166,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
     private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesARB(WindowsWGLDrawableFactory.SharedResource sharedResource, AbstractGraphicsDevice device, GLProfile glProfile, long hdc) {
         final int pfdIDCount = WindowsWGLGraphicsConfiguration.wglARBPFDIDCount((WindowsWGLContext)sharedResource.getContext(), hdc);
         final int[] pformats = WindowsWGLGraphicsConfiguration.wglAllARBPFDIDs(pfdIDCount);
-        return WindowsWGLGraphicsConfiguration.wglARBPFIDs2GLCapabilities(sharedResource, device, glProfile, hdc, pformats, 
+        return WindowsWGLGraphicsConfiguration.wglARBPFIDs2GLCapabilities(sharedResource, device, glProfile, hdc, pformats,
                 GLGraphicsConfigurationUtil.ALL_BITS & ~GLGraphicsConfigurationUtil.BITMAP_BIT); // w/o BITMAP
     }
 
@@ -175,7 +175,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         int numFormats = pformats.length;
         List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(numFormats);
         for (int i = 0; i < numFormats; i++) {
-            final GLCapabilitiesImmutable caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, pformats[i], 
+            final GLCapabilitiesImmutable caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, pformats[i],
                  bitmapOnly ? GLGraphicsConfigurationUtil.BITMAP_BIT : GLGraphicsConfigurationUtil.ALL_BITS );
             if(null != caps) {
                 bucket.add(caps);
@@ -226,7 +226,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
                                                   " for device context " + toHexString(hdc) +
                                                   ": error code " + GDI.GetLastError());
                         }
-                        set = true;                        
+                        set = true;
                     }
                     if (DEBUG) {
                         System.err.println("setPixelFormat (post): hdc "+toHexString(hdc) +", "+pfdID+" -> "+config.getPixelFormatID()+", set: "+set);
@@ -332,9 +332,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         final boolean isOpaque = capsChosen.isBackgroundOpaque() && GDI.DwmIsCompositionEnabled();
         final int winattrbits = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(capsChosen) & ~GLGraphicsConfigurationUtil.BITMAP_BIT; // w/o BITMAP
         final GLProfile glProfile = capsChosen.getGLProfile();
-        
+
         final int pfdIDCount = WindowsWGLGraphicsConfiguration.wglARBPFDIDCount((WindowsWGLContext)sharedResource.getContext(), hdc);
-        
+
         if(DEBUG) {
             System.err.println("updateGraphicsConfigurationARB: hdc "+toHexString(hdc)+", pfdIDCount(hdc) "+pfdIDCount+", capsChosen "+capsChosen+", "+GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrbits).toString());
             System.err.println("isOpaque "+isOpaque+" (translucency requested: "+(!capsChosen.isBackgroundOpaque())+", compositioning enabled: "+GDI.DwmIsCompositionEnabled()+")");
@@ -346,7 +346,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
             }
             return false;
         }
-        
+
         WGLGLCapabilities pixelFormatCaps = null; // chosen or preset PFD ID's caps
         boolean pixelFormatSet = false; // indicates a preset PFD ID [caps]
         final int presetPFDID = extHDC ? -1 : WGLUtil.GetPixelFormat(hdc) ;
@@ -406,9 +406,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
                 }
             }
 
-            List<GLCapabilitiesImmutable> availableCaps = 
+            List<GLCapabilitiesImmutable> availableCaps =
                     WindowsWGLGraphicsConfiguration.wglARBPFIDs2GLCapabilities(sharedResource, device, glProfile, hdc, pformats, winattrbits);
-            
+
             if( null == availableCaps || 0 == availableCaps.size() ) {
                 if (DEBUG) {
                     System.err.println("updateGraphicsConfigurationARB: wglARBPFIDs2GLCapabilities failed with " + pformats.length + " pfd ids");
@@ -467,11 +467,11 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         // final boolean useFBO = capsChosen.isFBO();
         final GLProfile glProfile = capsChosen.getGLProfile();
         final int winattrmask = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(capsChosen);
-        
+
         if(DEBUG) {
             System.err.println("updateGraphicsConfigurationGDI: capsChosen "+capsChosen+", "+GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrmask).toString());
         }
-        
+
         AbstractGraphicsDevice device = config.getScreen().getDevice();
         int pfdID; // chosen or preset PFD ID
         WGLGLCapabilities pixelFormatCaps = null; // chosen or preset PFD ID's caps
@@ -503,7 +503,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
                 if(null != caps) {
                     availableCaps.add(caps);
                     if(DEBUG) {
-                        final int j = availableCaps.size() - 1; 
+                        final int j = availableCaps.size() - 1;
                         System.err.println("updateGraphicsConfigurationGDI: availableCaps["+i+" -> "+j+"]: "+caps);
                     }
                 } else if(DEBUG) {
@@ -543,7 +543,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
             }
             pixelFormatCaps = (WGLGLCapabilities) availableCaps.get(chosenIndex);
             if (DEBUG) {
-                System.err.println("chosen pfdID (GDI): chosenIndex "+ chosenIndex + ", caps " + pixelFormatCaps + 
+                System.err.println("chosen pfdID (GDI): chosenIndex "+ chosenIndex + ", caps " + pixelFormatCaps +
                                    " (" + WGLGLCapabilities.PFD2String(pixelFormatCaps.getPFD(), pixelFormatCaps.getPFDID()) +")");
             }
         }
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
index 3b2ff133a..ddfcbb55b 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -65,7 +65,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
     public static void registerFactory() {
         GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.awt.AWTGraphicsDevice.class, GLCapabilitiesImmutable.class, new WindowsAWTWGLGraphicsConfigurationFactory());
     }
-    private WindowsAWTWGLGraphicsConfigurationFactory() {        
+    private WindowsAWTWGLGraphicsConfigurationFactory() {
     }
 
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
@@ -114,7 +114,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
             throw new GLException("Unable to choose a GraphicsConfiguration: "+capsChosen+",\n\t"+chooser+"\n\t"+winScreen);
         }
 
-        GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory(((GLCapabilitiesImmutable)capsChosen).getGLProfile());        
+        GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory(((GLCapabilitiesImmutable)capsChosen).getGLProfile());
         GraphicsConfiguration chosenGC = null;
 
         if ( drawableFactory instanceof WindowsWGLDrawableFactory ) {
@@ -138,7 +138,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
                 }
                 // go on ..
             }
-    
+
             if( null == chosenGC ) {
                 // 2nd Choice: Choose and match the GL Visual with AWT:
                 //   - collect all AWT PFDs
@@ -147,7 +147,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
                 // The resulting GraphicsConfiguration has to be 'forced' on the AWT native peer,
                 // ie. returned by GLCanvas's getGraphicsConfiguration() befor call by super.addNotify().
                 //
-    
+
                 // collect all available PFD IDs
                 GraphicsConfiguration[] configs = device.getConfigurations();
                 int[] pfdIDs = new int[configs.length];
@@ -171,11 +171,11 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
                         System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: Found matching AWT PFD ID "+winConfig.getPixelFormatID()+" -> "+winConfig);
                     }
                 }
-            }                
+            }
         } else {
             chosenGC = device.getDefaultConfiguration();
         }
-        
+
         if ( null == chosenGC ) {
             throw new GLException("Unable to determine GraphicsConfiguration: "+winConfig);
         }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
index 2c591cfbd..12e3db3bd 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -45,14 +45,14 @@ import com.jogamp.nativewindow.x11.X11GraphicsDevice;
 
 public class GLXUtil {
     public static final boolean DEBUG = Debug.debug("GLXUtil");
-    
+
     public static synchronized boolean isGLXAvailableOnServer(X11GraphicsDevice x11Device) {
         if(null == x11Device) {
             throw new IllegalArgumentException("null X11GraphicsDevice");
         }
         if(0 == x11Device.getHandle()) {
             throw new IllegalArgumentException("null X11GraphicsDevice display handle");
-        }        
+        }
         boolean glXAvailable = false;
         x11Device.lock();
         try {
@@ -60,17 +60,17 @@ public class GLXUtil {
         } catch (Throwable t) { /* n/a */
         } finally {
             x11Device.unlock();
-        }        
-        return glXAvailable;        
+        }
+        return glXAvailable;
     }
-    
+
     public static String getGLXClientString(X11GraphicsDevice x11Device, int name) {
         x11Device.lock();
         try {
             return GLX.glXGetClientString(x11Device.getHandle(), name);
         } finally {
             x11Device.unlock();
-        }        
+        }
     }
     public static String queryGLXServerString(X11GraphicsDevice x11Device, int screen_idx, int name) {
         x11Device.lock();
@@ -78,27 +78,27 @@ public class GLXUtil {
             return GLX.glXQueryServerString(x11Device.getHandle(), screen_idx, name);
         } finally {
             x11Device.unlock();
-        }        
-    }    
+        }
+    }
     public static String queryGLXExtensionsString(X11GraphicsDevice x11Device, int screen_idx) {
         x11Device.lock();
         try {
             return GLX.glXQueryExtensionsString(x11Device.getHandle(), screen_idx);
         } finally {
             x11Device.unlock();
-        }        
+        }
     }
-    
+
     public static VersionNumber getGLXServerVersionNumber(X11GraphicsDevice x11Device) {
         final IntBuffer major = Buffers.newDirectIntBuffer(1);
         final IntBuffer minor = Buffers.newDirectIntBuffer(1);
-        
+
         x11Device.lock();
         try {
             if (!GLX.glXQueryVersion(x11Device.getHandle(), major, minor)) {
               throw new GLException("glXQueryVersion failed");
             }
-    
+
             // Work around bugs in ATI's Linux drivers where they report they
             // only implement GLX version 1.2 on the server side
             if (major.get(0) == 1 && minor.get(0) == 2) {
@@ -117,7 +117,7 @@ public class GLXUtil {
         }
         return new VersionNumber(major.get(0), minor.get(0), 0);
     }
-    
+
     public static boolean isMultisampleAvailable(String extensions) {
         if (extensions != null) {
             return (extensions.indexOf("GLX_ARB_multisample") >= 0);
@@ -142,8 +142,8 @@ public class GLXUtil {
     public static VersionNumber getClientVersionNumber() {
         return clientVersionNumber;
     }
-    
-    public static synchronized void initGLXClientDataSingleton(X11GraphicsDevice x11Device) { 
+
+    public static synchronized void initGLXClientDataSingleton(X11GraphicsDevice x11Device) {
         if(null != clientVendorName) {
             return; // already initialized
         }
@@ -152,10 +152,10 @@ public class GLXUtil {
         }
         if(0 == x11Device.getHandle()) {
             throw new IllegalArgumentException("null X11GraphicsDevice display handle");
-        }        
+        }
         clientMultisampleAvailable = isMultisampleAvailable(GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_EXTENSIONS));
         clientVendorName = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VENDOR);
-        
+
         int[] major = new int[1];
         int[] minor = new int[1];
         final String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
index 72e84b05e..ba88ff3c4 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
@@ -79,15 +79,15 @@ public class X11ExternalGLXContext extends X11GLXContext {
     long drawable = GLX.glXGetCurrentDrawable();
     if (drawable == 0) {
       throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current");
-    }    
+    }
     IntBuffer val = Buffers.newDirectIntBuffer(1);
-    
+
     int w, h;
     GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, val);
     w=val.get(0);
     GLX.glXQueryDrawable(display, drawable, GLX.GLX_HEIGHT, val);
     h=val.get(0);
-    
+
     GLX.glXQueryContext(display, ctx, GLX.GLX_SCREEN, val);
     X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
 
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
index fca36c0cc..650fd31d3 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
@@ -73,7 +73,7 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable {
       throw new GLException("Error: attempted to make an external GLDrawable without a drawable current");
     }
     IntBuffer val = Buffers.newDirectIntBuffer(1);
-    
+
     GLX.glXQueryContext(display, context, GLX.GLX_SCREEN, val);
     X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
 
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
index 0ecf11a43..22a48e093 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
@@ -142,7 +142,7 @@ public class X11GLXContext extends GLContextImpl {
     if(null != glXServerVersion) {
         return isGLXVersionGreaterEqualOneThree;
     }
-    glXServerVersion = ((X11GLXDrawableFactory)drawable.getFactoryImpl()).getGLXVersionNumber(drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice()); 
+    glXServerVersion = ((X11GLXDrawableFactory)drawable.getFactoryImpl()).getGLXVersionNumber(drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice());
     isGLXVersionGreaterEqualOneThree = null != glXServerVersion ? glXServerVersion.compareTo(X11GLXDrawableFactory.versionOneThree) >= 0 : false;
     return isGLXVersionGreaterEqualOneThree;
   }
@@ -262,7 +262,7 @@ public class X11GLXContext extends GLContextImpl {
           t.printStackTrace();
         }
     }
-    
+
     if(0!=ctx) {
         if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), ctx)) {
             if(DEBUG) {
@@ -419,7 +419,7 @@ public class X11GLXContext extends GLContextImpl {
 
     if (GLX.glXGetCurrentContext() != contextHandle) {
         if (!glXMakeContextCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-            throw new GLException("Error making context " + toHexString(contextHandle) + 
+            throw new GLException("Error making context " + toHexString(contextHandle) +
                                   " current on Thread " + getThreadName() +
                                   " with display " + toHexString(dpy) +
                                   ", drawableWrite " + toHexString(drawable.getHandle()) +
@@ -525,7 +525,7 @@ public class X11GLXContext extends GLContextImpl {
 
   @Override
   protected boolean setSwapIntervalImpl(int interval) {
-    if( !drawable.getChosenGLCapabilities().isOnscreen() ) { return false; } 
+    if( !drawable.getChosenGLCapabilities().isOnscreen() ) { return false; }
 
     final GLXExt glXExt = getGLXExt();
     if(0==hasSwapInterval) {
@@ -534,7 +534,7 @@ public class X11GLXContext extends GLContextImpl {
             if( glXExt.isExtensionAvailable(GLXExtensions.GLX_MESA_swap_control) ) {
                 if(DEBUG) { System.err.println("X11GLXContext.setSwapInterval using: "+GLXExtensions.GLX_MESA_swap_control); }
                 hasSwapInterval =  1;
-            } else */ 
+            } else */
             if ( glXExt.isExtensionAvailable(GLXExtensions.GLX_SGI_swap_control) ) {
                 if(DEBUG) { System.err.println("X11GLXContext.setSwapInterval using: "+GLXExtensions.GLX_SGI_swap_control); }
                 hasSwapInterval =  2;
@@ -542,7 +542,7 @@ public class X11GLXContext extends GLContextImpl {
                 hasSwapInterval = -1;
             }
         } catch (Throwable t) { hasSwapInterval=-1; }
-    } 
+    }
     /* try {
         switch( hasSwapInterval ) {
             case 1:
@@ -581,7 +581,7 @@ public class X11GLXContext extends GLContextImpl {
         try {
             final IntBuffer maxGroupsNIO = Buffers.newDirectIntBuffer(maxGroups.length - maxGroups_offset);
             final IntBuffer maxBarriersNIO = Buffers.newDirectIntBuffer(maxBarriers.length - maxBarriers_offset);
-            
+
             if( glXExt.glXQueryMaxSwapGroupsNV(ns.getDisplayHandle(), ns.getScreenIndex(),
                                                maxGroupsNIO, maxBarriersNIO) ) {
                 maxGroupsNIO.get(maxGroups, maxGroups_offset, maxGroupsNIO.remaining());
@@ -623,7 +623,7 @@ public class X11GLXContext extends GLContextImpl {
   }
 
   @Override
-  public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {  
+  public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
     return getGLXExt().glXAllocateMemoryNV(size, readFrequency, writeFrequency, priority);
   }
 
@@ -631,7 +631,7 @@ public class X11GLXContext extends GLContextImpl {
   public final void glFreeMemoryNV(ByteBuffer pointer) {
     getGLXExt().glXFreeMemoryNV(pointer);
   }
-    
+
   @Override
   public String toString() {
     StringBuilder sb = new StringBuilder();
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index 5df458b7e..3f0841b6c 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -86,7 +86,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   public static final VersionNumber versionOneFour = new VersionNumber(1, 4, 0);
 
   static final String GLX_SGIX_pbuffer = "GLX_SGIX_pbuffer";
-  
+
   private static DesktopGLDynamicLookupHelper x11GLXDynamicLookupHelper = null;
 
   public X11GLXDrawableFactory() {
@@ -134,7 +134,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   protected final boolean isComplete() {
       return null != x11GLXDynamicLookupHelper;
   }
-  
+
   @Override
   protected final void destroy() {
     if(null != sharedResourceRunner) {
@@ -205,7 +205,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
       final public GLContextImpl getContext() { return context; }
       @Override
       public GLRendererQuirks getRendererQuirks() {
-          return null != context ? context.getRendererQuirks() : null;      
+          return null != context ? context.getRendererQuirks() : null;
       }
 
       final String getGLXVendorName() { return glXServerVendorName; }
@@ -251,18 +251,18 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
             }
             return res;
         }
-        
+
         @Override
         public SharedResourceRunner.Resource createSharedResource(String connection) {
             final X11GraphicsDevice sharedDevice = new X11GraphicsDevice(X11Util.openDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
             sharedDevice.lock();
             try {
                 final X11GraphicsScreen sharedScreen = new X11GraphicsScreen(sharedDevice, sharedDevice.getDefaultScreen());
-                
+
                 GLXUtil.initGLXClientDataSingleton(sharedDevice);
                 final String glXServerVendorName = GLX.glXQueryServerString(sharedDevice.getHandle(), 0, GLX.GLX_VENDOR);
                 final boolean glXServerMultisampleAvailable = GLXUtil.isMultisampleAvailable(GLX.glXQueryServerString(sharedDevice.getHandle(), 0, GLX.GLX_EXTENSIONS));
-                
+
                 final GLProfile glp = GLProfile.get(sharedDevice, GLProfile.GL_PROFILE_LIST_MIN_DESKTOP, false);
                 if (null == glp) {
                     throw new GLException("Couldn't get default GLProfile for device: "+sharedDevice);
@@ -283,7 +283,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
                 if (null == sharedContext) {
                     throw new GLException("Couldn't create shared context for drawable: "+sharedDrawable);
                 }
-                
+
                 boolean madeCurrent = false;
                 sharedContext.makeCurrent();
                 try {
@@ -493,12 +493,12 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice, 
+  protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
                                                         GLCapabilitiesImmutable capsChosen,
                                                         GLCapabilitiesImmutable capsRequested,
                                                         GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
     final X11GraphicsDevice device;
-    if( createNewDevice || !(deviceReq instanceof X11GraphicsDevice) ) { 
+    if( createNewDevice || !(deviceReq instanceof X11GraphicsDevice) ) {
         device = new X11GraphicsDevice(X11Util.openDisplay(deviceReq.getConnection()), deviceReq.getUnitID(), true /* owner */);
     } else {
         device = (X11GraphicsDevice) deviceReq;
@@ -506,18 +506,18 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
     final X11GraphicsScreen screen = new X11GraphicsScreen(device, device.getDefaultScreen());
     final X11GLXGraphicsConfiguration config = X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen, VisualIDHolder.VID_UNDEFINED);
     if(null == config) {
-        throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen); 
+        throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen);
     }
     return new WrappedSurface(config, 0, upstreamHook, createNewDevice);
   }
-  
+
   @Override
-  public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice, 
+  public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
                                                    GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
     chosenCaps = GLGraphicsConfigurationUtil.fixOnscreenGLCapabilities(chosenCaps);
-    return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new X11DummyUpstreamSurfaceHook(width, height)); 
-  }  
-  
+    return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new X11DummyUpstreamSurfaceHook(width, height));
+  }
+
   @Override
   protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
     final X11GraphicsDevice device = new X11GraphicsDevice(X11Util.openDisplay(deviceReq.getConnection()), deviceReq.getUnitID(), true /* owner */);
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
index f25f7ae2c..951174f71 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.opengl.x11.glx;
 
 import jogamp.opengl.*;
@@ -40,8 +40,8 @@ public final class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibrar
     public final List<List<String>> getToolLibNames() {
         final List<List<String>> libsList = new ArrayList<List<String>>();
         final List<String> libsGL = new ArrayList<String>();
-        
-        // Be aware that on DRI systems, eg ATI fglrx, etc, 
+
+        // Be aware that on DRI systems, eg ATI fglrx, etc,
         // you have to set LIBGL_DRIVERS_PATH env variable.
         // Eg on Ubuntu 64bit systems this is:
         //    export LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri:/usr/lib32/fglrx/dri
@@ -55,11 +55,11 @@ public final class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibrar
 
         // last but not least .. the generic one
         libsGL.add("GL");
-        
-        libsList.add(libsGL);        
+
+        libsList.add(libsGL);
         return libsList;
-    }    
-    
+    }
+
     @Override
     public final List<String> getToolGetProcAddressFuncNameList() {
         List<String> res = new ArrayList<String>();
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
index c23bd5337..5aea33f21 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -61,9 +61,9 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
 
 public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implements Cloneable {
     public static final int MAX_ATTRIBS = 128;
-    private GLCapabilitiesChooser chooser; 
+    private GLCapabilitiesChooser chooser;
 
-    X11GLXGraphicsConfiguration(X11GraphicsScreen screen, 
+    X11GLXGraphicsConfiguration(X11GraphicsScreen screen,
                                 X11GLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
         super(screen, capsChosen, capsRequested, capsChosen.getXVisualInfo());
         this.chooser=chooser;
@@ -86,8 +86,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     void updateGraphicsConfiguration() {
         final CapabilitiesImmutable aChosenCaps = getChosenCapabilities();
         if( !(aChosenCaps instanceof X11GLCapabilities) || VisualIDHolder.VID_UNDEFINED == aChosenCaps.getVisualID(VIDType.X11_XVISUAL) ) {
-            // This case is actually quite impossible, since on X11 the visualID and hence GraphicsConfiguration 
-            // must be determined _before_ window creation! 
+            // This case is actually quite impossible, since on X11 the visualID and hence GraphicsConfiguration
+            // must be determined _before_ window creation!
             final X11GLXGraphicsConfiguration newConfig = (X11GLXGraphicsConfiguration)
                 GraphicsConfigurationFactory.getFactory(getScreen().getDevice(), aChosenCaps).chooseGraphicsConfiguration(
                     aChosenCaps, getRequestedCapabilities(), chooser, getScreen(), VisualIDHolder.VID_UNDEFINED);
@@ -121,7 +121,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
         glp = GLProfile.getDefault(x11Screen.getDevice());
       }
       final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
-      final X11GLCapabilities caps = GLXFBConfig2GLCapabilities(device, glp, fbcfg, GLGraphicsConfigurationUtil.ALL_BITS, factory.isGLXMultisampleAvailable(device));      
+      final X11GLCapabilities caps = GLXFBConfig2GLCapabilities(device, glp, fbcfg, GLGraphicsConfigurationUtil.ALL_BITS, factory.isGLXMultisampleAvailable(device));
       if(null==caps) {
           throw new GLException("GLCapabilities null of "+toHexString(fbcfg));
       }
@@ -130,7 +130,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
 
     static IntBuffer GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
                                                boolean forFBAttr, boolean isMultisampleAvailable,
-                                               long display, int screen) 
+                                               long display, int screen)
     {
         int colorDepth = (caps.getRedBits() +
                           caps.getGreenBits() +
@@ -143,7 +143,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
 
         if (forFBAttr) {
           res.put(idx++, GLX.GLX_DRAWABLE_TYPE);
-          
+
           final int surfaceType;
           if( caps.isOnscreen() ) {
               surfaceType = GLX.GLX_WINDOW_BIT;
@@ -157,7 +157,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
               throw new GLException("no surface type set in caps: "+caps);
           }
           res.put(idx++, surfaceType);
-          
+
           res.put(idx++, GLX.GLX_RENDER_TYPE);
           res.put(idx++, GLX.GLX_RGBA_BIT);
         } else {
@@ -233,8 +233,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
   }
 
   // FBConfig
-    
-  static boolean GLXFBConfigIDValid(long display, int screen, int fbcfgid) {      
+
+  static boolean GLXFBConfigIDValid(long display, int screen, int fbcfgid) {
     long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbcfgid);
     return (0 != fbcfg) ? X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfg ) : false ;
   }
@@ -278,8 +278,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
                                                       int winattrmask, boolean isMultisampleAvailable) {
     final int allDrawableTypeBits = FBCfgDrawableTypeBits(device, fbcfg);
     int drawableTypeBits = winattrmask & allDrawableTypeBits;
-    
-    final long display = device.getHandle(); 
+
+    final long display = device.getHandle();
     int fbcfgid = X11GLXGraphicsConfiguration.glXFBConfig2FBConfigID(display, fbcfg);
     XVisualInfo visualInfo = GLX.glXGetVisualFromFBConfig(display, fbcfg);
     if(null == visualInfo) {
@@ -307,8 +307,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
       res.setSampleBuffers(glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLE_BUFFERS, tmp) != 0);
       res.setNumSamples   (glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLES,        tmp));
     }
-    final XRenderDirectFormat xrmask = ( null != visualInfo ) ? 
-                                         XVisual2XRenderMask( display, visualInfo.getVisual() ) : 
+    final XRenderDirectFormat xrmask = ( null != visualInfo ) ?
+                                         XVisual2XRenderMask( display, visualInfo.getVisual() ) :
                                          null ;
     final int alphaMask = ( null != xrmask ) ? xrmask.getAlphaMask() : 0;
     res.setBackgroundOpaque( 0 >= alphaMask );
@@ -318,7 +318,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
         res.setTransparentBlueValue(xrmask.getBlueMask());
         res.setTransparentAlphaValue(alphaMask);
     }
-    // ALPHA shall be set at last - due to it's auto setting by the above (!opaque / samples)    
+    // ALPHA shall be set at last - due to it's auto setting by the above (!opaque / samples)
     res.setDoubleBuffered(glXGetFBConfig(display, fbcfg, GLX.GLX_DOUBLEBUFFER,     tmp) != 0);
     res.setStereo        (glXGetFBConfig(display, fbcfg, GLX.GLX_STEREO,           tmp) != 0);
     res.setHardwareAccelerated(glXGetFBConfig(display, fbcfg, GLX.GLX_CONFIG_CAVEAT, tmp) != GLX.GLX_SLOW_CONFIG);
@@ -332,8 +332,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     res.setAccumAlphaBits(glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_ALPHA_SIZE, tmp));
     res.setDepthBits     (glXGetFBConfig(display, fbcfg, GLX.GLX_DEPTH_SIZE,       tmp));
     res.setStencilBits   (glXGetFBConfig(display, fbcfg, GLX.GLX_STENCIL_SIZE,     tmp));
-    
-    return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res); 
+
+    return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
   }
 
   private static String glXGetFBConfigErrorCode(int err) {
@@ -363,7 +363,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
   static long glXFBConfigID2FBConfig(long display, int screen, int id) {
       final IntBuffer attribs = Buffers.newDirectIntBuffer(new int[] { GLX.GLX_FBCONFIG_ID, id, 0 });
       final IntBuffer count = Buffers.newDirectIntBuffer(1);
-      count.put(0, -1);      
+      count.put(0, -1);
       PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, count);
       if (fbcfgsL == null || fbcfgsL.limit()<1) {
           return 0;
@@ -380,7 +380,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
       XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0);
       if (infos == null || infos.length == 0) {
             return null;
-      }  
+      }
       XVisualInfo res = XVisualInfo.create(infos[0]);
       if (DEBUG) {
         System.err.println("Fetched XVisualInfo for visual ID " + toHexString(visualID));
@@ -391,10 +391,10 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
 
   static X11GLCapabilities XVisualInfo2GLCapabilities(final X11GraphicsDevice device, GLProfile glp, XVisualInfo info,
                                                       final int winattrmask, boolean isMultisampleEnabled) {
-    final int allDrawableTypeBits = GLGraphicsConfigurationUtil.WINDOW_BIT | 
+    final int allDrawableTypeBits = GLGraphicsConfigurationUtil.WINDOW_BIT |
                                     GLGraphicsConfigurationUtil.BITMAP_BIT |
                                     GLGraphicsConfigurationUtil.FBO_BIT ;
-    
+
     final int drawableTypeBits = winattrmask & allDrawableTypeBits;
 
     if( 0 == drawableTypeBits ) {
@@ -425,13 +425,13 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     // Note: use of hardware acceleration is determined by
     // glXCreateContext, not by the XVisualInfo. Optimistically claim
     // that all GLCapabilities have the capability to be hardware
-    // accelerated.    
+    // accelerated.
     if (isMultisampleEnabled) {
       res.setSampleBuffers(glXGetConfig(display, info, GLX.GLX_SAMPLE_BUFFERS, tmp) != 0);
       res.setNumSamples   (glXGetConfig(display, info, GLX.GLX_SAMPLES,        tmp));
     }
-    final XRenderDirectFormat xrmask = ( null != info ) ? 
-                                         XVisual2XRenderMask( display, info.getVisual() ) : 
+    final XRenderDirectFormat xrmask = ( null != info ) ?
+                                         XVisual2XRenderMask( display, info.getVisual() ) :
                                          null ;
     final int alphaMask = ( null != xrmask ) ? xrmask.getAlphaMask() : 0;
     res.setBackgroundOpaque( 0 >= alphaMask );
@@ -454,7 +454,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     res.setAccumBlueBits (glXGetConfig(display, info, GLX.GLX_ACCUM_BLUE_SIZE,  tmp));
     res.setAccumAlphaBits(glXGetConfig(display, info, GLX.GLX_ACCUM_ALPHA_SIZE, tmp));
 
-    return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res); 
+    return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
   }
 
   private static String glXGetConfigErrorCode(int err) {
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
index a7c7d3fe6..abe310a3f 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -109,7 +109,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
             throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
         }
-        
+
         if(!GLXUtil.isGLXAvailableOnServer((X11GraphicsDevice)absScreen.getDevice())) {
             if(null != fallbackX11GraphicsConfigurationFactory) {
                 if(DEBUG) {
@@ -118,7 +118,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
                 return fallbackX11GraphicsConfigurationFactory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, absScreen, VisualIDHolder.VID_UNDEFINED);
             }
             throw new InternalError("No GLX and no fallback GraphicsConfigurationFactory available for: "+absScreen);
-        }        
+        }
         return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested,
                                                  (GLCapabilitiesChooser)chooser, (X11GraphicsScreen)absScreen, nativeVisualID);
     }
@@ -134,7 +134,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         final GLProfile glp = GLProfile.getDefault(device);
 
         List<GLCapabilitiesImmutable> availableCaps = null;
-        
+
         sharedDevice.lock();
         try {
             if( sharedResource.isGLXVersionGreaterEqualOneThree() ) {
@@ -219,9 +219,9 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         if (capsChosen == null) {
             capsChosen = new GLCapabilities(null);
         }
-        X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();        
+        X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
         X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
-        
+
         capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, factory, x11Device);
         final boolean usePBuffer = !capsChosen.isOnscreen() && capsChosen.isPBuffer();
 
@@ -262,7 +262,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
             return null;
         }
         final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
-               
+
         final X11GLCapabilities caps = X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(x11Device, glp, fbcfg, GLGraphicsConfigurationUtil.ALL_BITS, factory.isGLXMultisampleAvailable(x11Device));
         return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser());
     }
@@ -280,8 +280,8 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
         long display = x11Device.getHandle();
         int screen = x11Screen.getIndex();
-        
-        final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();                              
+
+        final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
         final boolean isMultisampleAvailable = factory.isGLXMultisampleAvailable(x11Device);
         final IntBuffer attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capsChosen, true, isMultisampleAvailable, display, screen);
         final IntBuffer count = Buffers.newDirectIntBuffer(1);
@@ -337,14 +337,14 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
                 }
             }
         }
-        
+
         if(DEBUG) {
             System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: got configs: "+availableCaps.size());
             for(int i=0; i<availableCaps.size(); i++) {
                 System.err.println(i+": "+availableCaps.get(i));
             }
         }
-        
+
         if( VisualIDHolder.VID_UNDEFINED != xvisualID ) {
             for(int i=0; i<availableCaps.size(); ) {
                 VisualIDHolder vidh = (VisualIDHolder) availableCaps.get(i);
@@ -363,7 +363,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
                 System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: post filter visualID "+toHexString(xvisualID)+" got configs: "+availableCaps.size());
             }
         }
-        
+
         int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
         if ( 0 > chosenIndex ) {
             if (DEBUG) {
@@ -393,15 +393,15 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
         long display = absDevice.getHandle();
         int screen = x11Screen.getIndex();
-        
-        final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();                              
-        final boolean isMultisampleAvailable = factory.isGLXMultisampleAvailable(absDevice);        
+
+        final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
+        final boolean isMultisampleAvailable = factory.isGLXMultisampleAvailable(absDevice);
         final IntBuffer attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capsChosen, false, isMultisampleAvailable, display, screen);
 
         XVisualInfo recommendedVis = null;
         // 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice
         // skipped if xvisualID is given
-        if( VisualIDHolder.VID_UNDEFINED == xvisualID ) {  
+        if( VisualIDHolder.VID_UNDEFINED == xvisualID ) {
             recommendedVis = GLX.glXChooseVisual(display, screen, attribs);
             if (DEBUG) {
                 System.err.print("glXChooseVisual recommended ");
@@ -441,7 +441,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
                 System.err.println(i+": "+availableCaps.get(i));
             }
         }
-        
+
         if( VisualIDHolder.VID_UNDEFINED != xvisualID ) {
             for(int i=0; i<availableCaps.size(); ) {
                 VisualIDHolder vidh = (VisualIDHolder) availableCaps.get(i);
@@ -453,14 +453,14 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
             }
             if(0==availableCaps.size()) {
                 if(DEBUG) {
-                    System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual: post filter visualID "+toHexString(xvisualID )+" no config found, failed - return null");                    
+                    System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual: post filter visualID "+toHexString(xvisualID )+" no config found, failed - return null");
                 }
                 return null;
             } else if(DEBUG) {
                 System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual: post filter visualID "+toHexString(xvisualID)+" got configs: "+availableCaps.size());
             }
         }
-        
+
         int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
         if ( 0 > chosenIndex ) {
             if (DEBUG) {
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java
index 22c95f3dd..c98bf5436 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java
@@ -29,11 +29,11 @@ public class DelegatedUpstreamSurfaceHookMutableSize extends UpstreamSurfaceHook
             upstream.destroy(s);
         }
     }
-    
+
     @Override
     public String toString() {
-        return getClass().getSimpleName()+"[ "+ width + "x" + height + ", " + upstream + "]";        
+        return getClass().getSimpleName()+"[ "+ width + "x" + height + ", " + upstream + "]";
     }
-    
+
 }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
index 85e24582c..1557f4e51 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
@@ -42,13 +42,13 @@ public class DelegatedUpstreamSurfaceHookWithSurfaceSize implements UpstreamSurf
     @Override
     public final int getHeight(ProxySurface s) {
         return surface.getHeight();
-    }      
-    
+    }
+
     @Override
     public String toString() {
-        final String us_s = null != surface ? ( surface.getClass().getName() + ": 0x" + Long.toHexString(surface.getSurfaceHandle()) + " " +surface.getWidth() + "x" + surface.getHeight() ) : "nil";        
+        final String us_s = null != surface ? ( surface.getClass().getName() + ": 0x" + Long.toHexString(surface.getSurfaceHandle()) + " " +surface.getWidth() + "x" + surface.getHeight() ) : "nil";
         return getClass().getSimpleName()+"["+upstream+", "+us_s+"]";
     }
-    
+
 }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java
index eaad513aa..8b8ccb191 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java
@@ -41,10 +41,10 @@ public class MutableGraphicsConfiguration extends DefaultGraphicsConfiguration {
     public void setChosenCapabilities(CapabilitiesImmutable caps) {
         super.setChosenCapabilities(caps);
     }
-    
+
     @Override
     public void setScreen(AbstractGraphicsScreen screen) {
         super.setScreen(screen);
     }
-    
+
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
index 29f4964c0..a8dd9165c 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.nativewindow;
 
 import com.jogamp.common.GlueGenVersion;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
index 29c540ac4..5838c7a56 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
@@ -18,9 +18,9 @@ public class UpstreamSurfaceHookMutableSize implements UpstreamSurfaceHook.Mutab
     @Override
     public final void setSize(int width, int height) {
         this.width = width;
-        this.height = height;        
+        this.height = height;
     }
-    
+
     @Override
     public final int getWidth(ProxySurface s) {
         return width;
@@ -35,11 +35,11 @@ public class UpstreamSurfaceHookMutableSize implements UpstreamSurfaceHook.Mutab
 
     @Override
     public void destroy(ProxySurface s) { /* nop */ }
-    
+
     @Override
     public String toString() {
-        return getClass().getSimpleName()+"[ "+ width + "x" + height + "]";        
+        return getClass().getSimpleName()+"[ "+ width + "x" + height + "]";
     }
-    
+
 }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
index 7e3d30a47..15f3355d0 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -57,7 +57,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
   private GraphicsConfiguration config;
   AbstractGraphicsConfiguration encapsulated;
 
-  public AWTGraphicsConfiguration(AWTGraphicsScreen screen, 
+  public AWTGraphicsConfiguration(AWTGraphicsScreen screen,
                                   CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
                                   GraphicsConfiguration config, AbstractGraphicsConfiguration encapsulated) {
     super(screen, capsChosen, capsRequested);
@@ -71,9 +71,9 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
     this.config = config;
     this.encapsulated=null;
   }
-  
+
   /**
-   * @param capsChosen if null, <code>capsRequested</code> is copied and aligned 
+   * @param capsChosen if null, <code>capsRequested</code> is copied and aligned
    *        with the graphics {@link Capabilities} of the AWT Component to produce the chosen {@link Capabilities}.
    *        Otherwise the <code>capsChosen</code> is used.
    * @param capsRequested if null, default {@link Capabilities} are used, otherwise the given values.
@@ -81,7 +81,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
   public static AWTGraphicsConfiguration create(Component awtComp, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
       final GraphicsConfiguration awtGfxConfig = awtComp.getGraphicsConfiguration();
       if(null==awtGfxConfig) {
-          throw new NativeWindowException("AWTGraphicsConfiguration.create: Null AWT GraphicsConfiguration @ "+awtComp);          
+          throw new NativeWindowException("AWTGraphicsConfiguration.create: Null AWT GraphicsConfiguration @ "+awtComp);
       }
       final GraphicsDevice awtGraphicsDevice = awtGfxConfig.getDevice();
       if(null==awtGraphicsDevice) {
@@ -112,7 +112,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
   public void setChosenCapabilities(CapabilitiesImmutable capsChosen) {
       super.setChosenCapabilities(capsChosen);
   }
-  
+
   @Override
   public Object clone() {
       return super.clone();
@@ -171,7 +171,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
   public String toString() {
     return getClass().getSimpleName()+"[" + getScreen() +
                                    ",\n\tchosen    " + capabilitiesChosen+
-                                   ",\n\trequested " + capabilitiesRequested+ 
+                                   ",\n\trequested " + capabilitiesRequested+
                                    ",\n\t" + config +
                                    ",\n\tencapsulated "+encapsulated+"]";
   }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java
index 635e6d263..a7fa53577 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
index f4ee06e28..d3cf5bff6 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java
index e5290aee1..44163fc73 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -69,15 +69,15 @@ import jogamp.nativewindow.awt.AWTMisc;
     } finally {
        ctx.releasePrint();
     }
- * 
+ *
  * </pre>
  * </p>
  */
 public interface AWTPrintLifecycle {
 
     public static final int DEFAULT_PRINT_TILE_SIZE = 1024;
-    
-    
+
+
     /**
      * Shall be called before {@link PrinterJob#print()}.
      * <p>
@@ -85,12 +85,12 @@ public interface AWTPrintLifecycle {
      * </p>
      * @param scaleMatX {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatX * width pixels
      * @param scaleMatY {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatY * height pixels
-     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples 
+     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
      * @param tileWidth custom tile width for {@link com.jogamp.opengl.util.TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param tileHeight custom tile height for {@link com.jogamp.opengl.util.TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      */
     void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight);
-    
+
     /**
      * Shall be called after {@link PrinterJob#print()}.
      * <p>
@@ -111,11 +111,11 @@ public interface AWTPrintLifecycle {
          * <p>
          * See <a href="#usage">Usage</a>.
          * </p>
-         * 
+         *
          * @param c container to be traversed through to perform {@link AWTPrintLifecycle#setupPrint(double, double, int, int, int) setupPrint(..)} on all {@link AWTPrintLifecycle} elements.
          * @param scaleMatX {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatX * width pixels
          * @param scaleMatY {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatY * height pixels
-         * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples 
+         * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
          * @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
          * @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
          * @return the context
@@ -139,7 +139,7 @@ public interface AWTPrintLifecycle {
          * @return count of performed actions of last {@link #setupPrint(Container, double, double, int, int, int) setupPrint(..)} or {@link #releasePrint()}.
          */
         public int getCount() { return count; }
-        
+
         private final Container cont;
         private final double scaleMatX;
         private final double scaleMatY;
@@ -147,7 +147,7 @@ public interface AWTPrintLifecycle {
         private final int tileWidth;
         private final int tileHeight;
         private int count;
-        
+
         private final AWTMisc.ComponentAction setupAction = new AWTMisc.ComponentAction() {
             @Override
             public void run(Component c) {
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
index e499ff705..e350aaff4 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
@@ -78,7 +78,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
   /**
    * Adds this closing listener to the components Window if exist and only one time.
    * <p>
-   * If the closing listener is already added, and {@link IllegalStateException} is thrown. 
+   * If the closing listener is already added, and {@link IllegalStateException} is thrown.
    * </p>
    *
    * @return true if added, otherwise false.
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
index 7a7a771d6..e4d3884a7 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -45,29 +45,29 @@ import com.jogamp.common.nio.Buffers;
  * {@link DataBuffer} specialization using NIO direct buffer of type {@link DataBuffer#TYPE_INT} as storage.
  */
 public final class DirectDataBufferInt extends DataBuffer {
-    
+
     public static class DirectWritableRaster extends WritableRaster {
         protected DirectWritableRaster(SampleModel sampleModel, DirectDataBufferInt dataBuffer, Point origin) {
             super(sampleModel, dataBuffer, origin);
         }
     }
-    
+
     public static class BufferedImageInt extends BufferedImage {
         final int customImageType;
         public BufferedImageInt (int customImageType, ColorModel cm, WritableRaster raster, Hashtable<?,?> properties) {
             super(cm, raster, false /* isRasterPremultiplied */, properties);
-            this.customImageType = customImageType; 
+            this.customImageType = customImageType;
         }
-        
+
         /**
-         * @return one of the custom image-type values {@link BufferedImage#TYPE_INT_ARGB TYPE_INT_ARGB}, 
-         *         {@link BufferedImage#TYPE_INT_ARGB_PRE TYPE_INT_ARGB_PRE}, 
+         * @return one of the custom image-type values {@link BufferedImage#TYPE_INT_ARGB TYPE_INT_ARGB},
+         *         {@link BufferedImage#TYPE_INT_ARGB_PRE TYPE_INT_ARGB_PRE},
          *         {@link BufferedImage#TYPE_INT_RGB TYPE_INT_RGB} or {@link BufferedImage#TYPE_INT_BGR TYPE_INT_BGR}.
          */
         public int getCustomType() {
             return customImageType;
         }
-        
+
         @Override
         public String toString() {
             return new String("BufferedImageInt@"+Integer.toHexString(hashCode())
@@ -75,26 +75,26 @@ public final class DirectDataBufferInt extends DataBuffer {
                               +" "+getColorModel()+" "+getRaster());
         }
     }
-    
+
     /**
-     * Creates a {@link BufferedImageInt} using a {@link DirectColorModel direct color model} in {@link ColorSpace#CS_sRGB sRGB color space}.<br> 
+     * Creates a {@link BufferedImageInt} using a {@link DirectColorModel direct color model} in {@link ColorSpace#CS_sRGB sRGB color space}.<br>
      * It uses a {@link DirectWritableRaster} utilizing {@link DirectDataBufferInt} storage.
      * <p>
-     * Note that due to using the custom storage type {@link DirectDataBufferInt}, the resulting 
+     * Note that due to using the custom storage type {@link DirectDataBufferInt}, the resulting
      * {@link BufferedImage}'s {@link BufferedImage#getType() image-type} is of {@link BufferedImage#TYPE_CUSTOM TYPE_CUSTOM}.
      * We are not able to change this detail, since the AWT image implementation associates the {@link BufferedImage#getType() image-type}
      * with a build-in storage-type.
      * Use {@link BufferedImageInt#getCustomType()} to retrieve the custom image-type, which will return the <code>imageType</code>
-     * value passed here.   
+     * value passed here.
      * </p>
-     *  
+     *
      * @param width
      * @param height
-     * @param imageType one of {@link BufferedImage#TYPE_INT_ARGB TYPE_INT_ARGB}, {@link BufferedImage#TYPE_INT_ARGB_PRE TYPE_INT_ARGB_PRE}, 
+     * @param imageType one of {@link BufferedImage#TYPE_INT_ARGB TYPE_INT_ARGB}, {@link BufferedImage#TYPE_INT_ARGB_PRE TYPE_INT_ARGB_PRE},
      *                         {@link BufferedImage#TYPE_INT_RGB TYPE_INT_RGB} or {@link BufferedImage#TYPE_INT_BGR TYPE_INT_BGR}.
      * @param location origin, if <code>null</code> 0/0 is assumed.
      * @param properties <code>Hashtable</code> of
-     *                  <code>String</code>/<code>Object</code> pairs. Used for {@link BufferedImage#getProperty(String)} etc. 
+     *                  <code>String</code>/<code>Object</code> pairs. Used for {@link BufferedImage#getProperty(String)} etc.
      * @return
      */
     public static BufferedImageInt createBufferedImage(int width, int height, int imageType, Point location, Hashtable<?,?> properties) {
@@ -150,30 +150,30 @@ public final class DirectDataBufferInt extends DataBuffer {
         bandMasks[0] = rmask;
         bandMasks[1] = gmask;
         bandMasks[2] = bmask;
-        
+
         final DirectDataBufferInt dataBuffer = new DirectDataBufferInt(width*height);
         if( null == location ) {
             location = new Point(0,0);
         }
-        final SinglePixelPackedSampleModel sppsm = new SinglePixelPackedSampleModel(dataBuffer.getDataType(), 
+        final SinglePixelPackedSampleModel sppsm = new SinglePixelPackedSampleModel(dataBuffer.getDataType(),
                     width, height, width /* scanLineStride */, bandMasks);
         // IntegerComponentRasters must haveinteger DataBuffers:
         //    final WritableRaster raster = new IntegerInterleavedRaster(sppsm, dataBuffer, location);
         // Not public:
         //    final WritableRaster raster = new SunWritableRaster(sppsm, dataBuffer, location);
         final WritableRaster raster = new DirectWritableRaster(sppsm, dataBuffer, location);
-        
+
         return new BufferedImageInt(imageType, colorModel, raster, properties);
     }
-    
+
     /** Default data bank. */
     private IntBuffer data;
 
     /** All data banks */
     private IntBuffer bankdata[];
-    
+
     /**
-     * Constructs an nio integer-based {@link DataBuffer} with a single bank 
+     * Constructs an nio integer-based {@link DataBuffer} with a single bank
      * and the specified size.
      *
      * @param size The size of the {@link DataBuffer}.
@@ -222,17 +222,17 @@ public final class DirectDataBufferInt extends DataBuffer {
 
     /**
      * Returns the default (first) int data array in {@link DataBuffer}.
-     *    
+     *
      * @return The first integer data array.
      */
     public IntBuffer getData() {
         return data;
     }
 
-    /** 
-     * Returns the data array for the specified bank.    
-     *   
-     * @param bank The bank whose data array you want to get. 
+    /**
+     * Returns the data array for the specified bank.
+     *
+     * @param bank The bank whose data array you want to get.
      * @return The data array for the specified bank.
      */
     public IntBuffer getData(int bank) {
@@ -241,7 +241,7 @@ public final class DirectDataBufferInt extends DataBuffer {
 
     /**
      * Returns the requested data array element from the first (default) bank.
-     * 
+     *
      * @param i The data array element you want to get.
      * @return The requested data array element as an integer.
      * @see #setElem(int, int)
@@ -253,7 +253,7 @@ public final class DirectDataBufferInt extends DataBuffer {
 
     /**
      * Returns the requested data array element from the specified bank.
-     * 
+     *
      * @param bank The bank from which you want to get a data array element.
      * @param i The data array element you want to get.
      * @return The requested data array element as an integer.
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
index 38a46f214..49b2daeae 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
@@ -123,7 +123,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
         private boolean localVisibility = component.isVisible();
         private boolean globalVisibility = localVisibility;
         private boolean visibilityPropagation = false;
-        
+
         private String s(ComponentEvent e) {
             return "visible[local "+localVisibility+", global "+globalVisibility+", propag. "+visibilityPropagation+"],"+Platform.getNewline()+
                    "    ** COMP "+e.getComponent()+Platform.getNewline()+
@@ -164,7 +164,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
         }
 
         @Override
-        public void componentHidden(ComponentEvent e) { 
+        public void componentHidden(ComponentEvent e) {
             if(DEBUG) {
                 System.err.println("JAWTWindow.componentHidden: "+s(e));
             }
@@ -174,7 +174,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
         @Override
         public void hierarchyChanged(HierarchyEvent e) {
             final long bits = e.getChangeFlags();
-            final java.awt.Component changed = e.getChanged();            
+            final java.awt.Component changed = e.getChanged();
             if( 0 != ( java.awt.event.HierarchyEvent.DISPLAYABILITY_CHANGED & bits ) ) {
                 final boolean displayable = changed.isDisplayable();
                 final boolean resetLocalVisibility = changed == component && !displayable && localVisibility != component.isVisible();
@@ -220,7 +220,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
     if(DEBUG) {
         System.err.println("JAWTWindow.invalidate() - "+Thread.currentThread().getName());
         if( isSurfaceLayerAttached() ) {
-            System.err.println("OffscreenSurfaceLayer still attached: 0x"+Long.toHexString(offscreenSurfaceLayer));        
+            System.err.println("OffscreenSurfaceLayer still attached: 0x"+Long.toHexString(offscreenSurfaceLayer));
         }
         // Thread.dumpStack();
     }
@@ -237,14 +237,14 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   protected final boolean updateBounds(JAWT_Rectangle jawtBounds) {
     final Rectangle jb = new Rectangle(jawtBounds.getX(), jawtBounds.getY(), jawtBounds.getWidth(), jawtBounds.getHeight());
     final boolean changed = !bounds.equals(jb);
-    
+
     if(changed) {
         if(DEBUG) {
             System.err.println("JAWTWindow.updateBounds: "+bounds+" -> "+jb);
             // Thread.dumpStack();
         }
         bounds.set(jawtBounds.getX(), jawtBounds.getY(), jawtBounds.getWidth(), jawtBounds.getHeight());
-    
+
         if(component instanceof Container) {
             final java.awt.Insets contInsets = ((Container)component).getInsets();
             insets.set(contInsets.left, contInsets.right, contInsets.top, contInsets.bottom);
@@ -279,7 +279,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   //
   // OffscreenLayerOption
   //
-  
+
   @Override
   public void setShallUseOffscreenLayer(boolean v) {
       shallUseOffscreenLayer = v;
@@ -316,9 +316,9 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
    * Layout the offscreen layer according to the implementing class's constraints.
    * <p>
    * This method allows triggering a re-layout of the offscreen surface
-   * in case the implementation requires it.   
+   * in case the implementation requires it.
    * </p>
-   * <p> 
+   * <p>
    * Call this method if any parent or ancestor's layout has been changed,
    * which could affects the layout of this surface.
    * </p>
@@ -326,14 +326,14 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
    * @throws NativeWindowException if {@link #isOffscreenLayerSurfaceEnabled()} == false
    */
   protected void layoutSurfaceLayerImpl(long layerHandle, boolean visible) {}
-  
+
   private final void layoutSurfaceLayerIfEnabled(boolean visible) throws NativeWindowException {
       if( isOffscreenLayerSurfaceEnabled() && 0 != offscreenSurfaceLayer ) {
           layoutSurfaceLayerImpl(offscreenSurfaceLayer, visible);
       }
   }
-  
-  
+
+
   @Override
   public final void detachSurfaceLayer() throws NativeWindowException {
       if( 0 == offscreenSurfaceLayer) {
@@ -351,35 +351,35 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
     }
   };
 
-  /** 
+  /**
    * @param detachNotify Runnable to be called before native detachment
    */
   protected void detachSurfaceLayerImpl(final long layerHandle, final Runnable detachNotify) {
       throw new UnsupportedOperationException("offscreen layer not supported");
   }
-  
+
 
   @Override
   public final long getAttachedSurfaceLayer() {
       return offscreenSurfaceLayer;
   }
-  
+
   @Override
   public final boolean isSurfaceLayerAttached() {
       return 0 != offscreenSurfaceLayer;
   }
-  
+
   @Override
   public final void setChosenCapabilities(CapabilitiesImmutable caps) {
       ((MutableGraphicsConfiguration)getGraphicsConfiguration()).setChosenCapabilities(caps);
-      getPrivateGraphicsConfiguration().setChosenCapabilities(caps);      
+      getPrivateGraphicsConfiguration().setChosenCapabilities(caps);
   }
-  
+
   @Override
   public final RecursiveLock getLock() {
       return surfaceLock;
   }
-  
+
   //
   // SurfaceUpdateListener
   //
@@ -527,7 +527,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   public final AbstractGraphicsConfiguration getGraphicsConfiguration() {
     return config.getNativeGraphicsConfiguration();
   }
-  
+
   @Override
   public final long getDisplayHandle() {
     return getGraphicsConfiguration().getScreen().getDevice().getHandle();
@@ -545,7 +545,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
 
   @Override
   public final int getHeight() {
-    return component.getHeight();    
+    return component.getHeight();
   }
 
   //
@@ -647,10 +647,10 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   protected abstract Point getLocationOnScreenNativeImpl(int x, int y);
 
   protected static Component getLocationOnScreenNonBlocking(Point storage, Component comp) {
-      final java.awt.Insets insets = new java.awt.Insets(0, 0, 0, 0); // DEBUG 
+      final java.awt.Insets insets = new java.awt.Insets(0, 0, 0, 0); // DEBUG
       Component last = null;
       while(null != comp) {
-          final int dx = comp.getX(); 
+          final int dx = comp.getX();
           final int dy = comp.getY();
           if( DEBUG ) {
               final java.awt.Insets ins = AWTMisc.getInsets(comp, false);
@@ -674,7 +674,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
       }
       return last;
   }
-  
+
   @Override
   public boolean hasFocus() {
       return component.hasFocus();
@@ -693,7 +693,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
       }
       return sb;
   }
-  
+
   @Override
   public String toString() {
     StringBuilder sb = new StringBuilder();
@@ -715,7 +715,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
 
     return sb.toString();
   }
-  
+
   protected final String toHexString(long l) {
       return "0x"+Long.toHexString(l);
   }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
index fb6d39b2f..c83814907 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -45,7 +45,7 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
      * <p>
      * FIXME: This shall be removed when relocated EGL to the nativewindow package,
      * since then it can be utilized directly.
-     * </p> 
+     * </p>
      */
     public interface EGLDisplayLifecycleCallback {
         /**
@@ -55,14 +55,14 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
          * @return the initialized EGL display ID, or <code>0</code> if not successful
          */
         public long eglGetAndInitDisplay(long[] nativeDisplayID);
-        
+
         /**
          * Implementation should issue an <code>EGL.eglTerminate(eglDisplayHandle)</code> call.
          * @param eglDisplayHandle
          */
         void eglTerminate(long eglDisplayHandle);
     }
-    
+
     /**
      * Note that this is not an open connection, ie no native display handle exist.
      * This constructor exist to setup a default device connection/unit.<br>
@@ -78,9 +78,9 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         this.nativeDisplayID[0] = nativeDisplayID;
         this.eglLifecycleCallback = eglLifecycleCallback;
     }
-    
+
     public long getNativeDisplayID() { return nativeDisplayID[0]; }
-    
+
     @Override
     public Object clone() {
       return super.clone();
@@ -100,7 +100,7 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         }
         return false;
     }
-    
+
     @Override
     public boolean close() {
         if(null != eglLifecycleCallback && 0 != handle) {
@@ -111,11 +111,11 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         }
         return super.close();
     }
-    
+
     @Override
     public boolean isHandleOwner() {
         return null != eglLifecycleCallback;
-    }    
+    }
     @Override
     public void clearHandleOwner() {
         eglLifecycleCallback = null;
@@ -126,9 +126,9 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
     }
     @Override
     protected Object setHandleOwnership(Object newOwnership) {
-        final EGLDisplayLifecycleCallback oldOwnership = eglLifecycleCallback; 
+        final EGLDisplayLifecycleCallback oldOwnership = eglLifecycleCallback;
         eglLifecycleCallback = (EGLDisplayLifecycleCallback) newOwnership;
         return oldOwnership;
-    }    
+    }
 }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
index 0dc788c17..89df7f853 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
index 5c4fd82d2..6057f6700 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
@@ -54,28 +54,28 @@ import jogamp.nativewindow.x11.X11Lib;
 
 public class SWTAccessor {
     private static final boolean DEBUG = true;
-    
+
     private static final Field swt_control_handle;
     private static final boolean swt_uses_long_handles;
-    
-    private static Object swt_osx_init = new Object(); 
+
+    private static Object swt_osx_init = new Object();
     private static Field swt_osx_control_view = null;
     private static Field swt_osx_view_id = null;
-    
+
     private static final String nwt;
     private static final boolean isOSX;
     private static final boolean isWindows;
     private static final boolean isX11;
     private static final boolean isX11GTK;
-    
+
     // X11/GTK, Windows/GDI, ..
     private static final String str_handle = "handle";
-    
+
     // OSX/Cocoa
     private static final String str_osx_view = "view";  // OSX
     private static final String str_osx_id = "id";    // OSX
     // static final String str_NSView = "org.eclipse.swt.internal.cocoa.NSView";
-    
+
     private static final Method swt_control_internal_new_GC;
     private static final Method swt_control_internal_dispose_GC;
     private static final String str_internal_new_GC = "internal_new_GC";
@@ -85,18 +85,18 @@ public class SWTAccessor {
     public static final Class<?> OS_gtk_class;
     private static final String str_OS_gtk_version = "GTK_VERSION";
     public static final VersionNumber OS_gtk_version;
-    
+
     private static final Method OS_gtk_widget_realize;
     private static final Method OS_gtk_widget_unrealize; // optional (removed in SWT 4.3)
     private static final Method OS_GTK_WIDGET_WINDOW;
     private static final Method OS_gtk_widget_get_window;
     private static final Method OS_gdk_x11_drawable_get_xdisplay;
     private static final Method OS_gdk_x11_display_get_xdisplay;
-    private static final Method OS_gdk_window_get_display;    
-    private static final Method OS_gdk_x11_drawable_get_xid;  
+    private static final Method OS_gdk_window_get_display;
+    private static final Method OS_gdk_x11_drawable_get_xid;
     private static final Method OS_gdk_x11_window_get_xid;
     private static final Method OS_gdk_window_set_back_pixmap;
-    
+
     private static final String str_gtk_widget_realize = "gtk_widget_realize";
     private static final String str_gtk_widget_unrealize = "gtk_widget_unrealize";
     private static final String str_GTK_WIDGET_WINDOW = "GTK_WIDGET_WINDOW";
@@ -107,11 +107,11 @@ public class SWTAccessor {
     private static final String str_gdk_x11_drawable_get_xid = "gdk_x11_drawable_get_xid";
     private static final String str_gdk_x11_window_get_xid = "gdk_x11_window_get_xid";
     private static final String str_gdk_window_set_back_pixmap = "gdk_window_set_back_pixmap";
-    
+
     private static final VersionNumber GTK_VERSION_2_14_0 = new VersionNumber(2, 14, 0);
     private static final VersionNumber GTK_VERSION_2_24_0 = new VersionNumber(2, 24, 0);
     private static final VersionNumber GTK_VERSION_3_0_0  = new VersionNumber(3,  0, 0);
-    
+
     private static VersionNumber GTK_VERSION(int version) {
         // return (major << 16) + (minor << 8) + micro;
         final int micro = ( version       ) & 0x0f;
@@ -119,20 +119,20 @@ public class SWTAccessor {
         final int major = ( version >> 16 ) & 0x0f;
         return new VersionNumber(major, minor, micro);
     }
-    
+
     static {
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 NativeWindowFactory.initSingleton(); // last resort ..
                 return null;
             } } );
-        
+
         nwt = NativeWindowFactory.getNativeWindowType(false);
         isOSX = NativeWindowFactory.TYPE_MACOSX == nwt;
         isWindows = NativeWindowFactory.TYPE_WINDOWS == nwt;
         isX11 = NativeWindowFactory.TYPE_X11 == nwt;
-        
-        Field f = null;        
+
+        Field f = null;
         if( !isOSX ) {
             try {
                 f = Control.class.getField(str_handle);
@@ -141,7 +141,7 @@ public class SWTAccessor {
             }
         }
         swt_control_handle = f; // maybe null !
-        
+
         boolean ulh;
         if (null != swt_control_handle) {
             ulh = swt_control_handle.getGenericType().toString().equals(long.class.toString());
@@ -151,7 +151,7 @@ public class SWTAccessor {
         swt_uses_long_handles = ulh;
         // System.err.println("SWT long handles: " + swt_uses_long_handles);
         // System.err.println("Platform 64bit: "+Platform.is64Bit());
-        
+
         Method m=null;
         try {
             m = ReflectionUtil.getMethod(Control.class, str_internal_new_GC, new Class[] { GCData.class });
@@ -159,12 +159,12 @@ public class SWTAccessor {
             throw new NativeWindowException(ex);
         }
         swt_control_internal_new_GC = m;
-        
+
         try {
             if(swt_uses_long_handles) {
-                m = Control.class.getDeclaredMethod(str_internal_dispose_GC, new Class[] { long.class, GCData.class });            
+                m = Control.class.getDeclaredMethod(str_internal_dispose_GC, new Class[] { long.class, GCData.class });
             } else {
-                m = Control.class.getDeclaredMethod(str_internal_dispose_GC, new Class[] { int.class, GCData.class });                
+                m = Control.class.getDeclaredMethod(str_internal_dispose_GC, new Class[] { int.class, GCData.class });
             }
         } catch (NoSuchMethodException ex) {
             throw new NativeWindowException(ex);
@@ -181,7 +181,7 @@ public class SWTAccessor {
                 c = ReflectionUtil.getClass(str_OS_gtk_class, false, SWTAccessor.class.getClassLoader());
                 Field field_OS_gtk_version = c.getField(str_OS_gtk_version);
                 _gtk_version = GTK_VERSION(field_OS_gtk_version.getInt(null));
-                m1 = c.getDeclaredMethod(str_gtk_widget_realize, handleType);        
+                m1 = c.getDeclaredMethod(str_gtk_widget_realize, handleType);
                 if (_gtk_version.compareTo(GTK_VERSION_2_14_0) >= 0) {
                     m4 = c.getDeclaredMethod(str_gtk_widget_get_window, handleType);
                 } else {
@@ -189,9 +189,9 @@ public class SWTAccessor {
                 }
                 if (_gtk_version.compareTo(GTK_VERSION_2_24_0) >= 0) {
                     m6 = c.getDeclaredMethod(str_gdk_x11_display_get_xdisplay, handleType);
-                    m7 = c.getDeclaredMethod(str_gdk_window_get_display, handleType);                                
+                    m7 = c.getDeclaredMethod(str_gdk_window_get_display, handleType);
                 } else {
-                    m5 = c.getDeclaredMethod(str_gdk_x11_drawable_get_xdisplay, handleType);                
+                    m5 = c.getDeclaredMethod(str_gdk_x11_drawable_get_xdisplay, handleType);
                 }
                 if (_gtk_version.compareTo(GTK_VERSION_3_0_0) >= 0) {
                     m9 = c.getDeclaredMethod(str_gdk_x11_window_get_xid, handleType);
@@ -200,7 +200,7 @@ public class SWTAccessor {
                 }
                 ma = c.getDeclaredMethod(str_gdk_window_set_back_pixmap, handleType, handleType, boolean.class);
             } catch (Exception ex) { throw new NativeWindowException(ex); }
-            // optional 
+            // optional
             try {
                 m2 = c.getDeclaredMethod(str_gtk_widget_unrealize, handleType);
             } catch (Exception ex) { }
@@ -213,33 +213,33 @@ public class SWTAccessor {
         OS_gtk_widget_get_window = m4;
         OS_gdk_x11_drawable_get_xdisplay = m5;
         OS_gdk_x11_display_get_xdisplay = m6;
-        OS_gdk_window_get_display = m7;    
+        OS_gdk_window_get_display = m7;
         OS_gdk_x11_drawable_get_xid = m8;
         OS_gdk_x11_window_get_xid = m9;
         OS_gdk_window_set_back_pixmap = ma;
-        
+
         isX11GTK = isX11 && null != OS_gtk_class;
-        
+
         if(DEBUG) {
             System.err.println("SWTAccessor.<init>: GTK Version: "+OS_gtk_version);
         }
     }
-        
+
     private static Number getIntOrLong(long arg) {
         if(swt_uses_long_handles) {
             return new Long(arg);
         }
         return new Integer((int) arg);
     }
-    
-    private static void callStaticMethodL2V(Method m, long arg) {        
+
+    private static void callStaticMethodL2V(Method m, long arg) {
         ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
     }
-    
-    private static void callStaticMethodLLZ2V(Method m, long arg0, long arg1, boolean arg3) {        
+
+    private static void callStaticMethodLLZ2V(Method m, long arg0, long arg1, boolean arg3) {
         ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg0), getIntOrLong(arg1), Boolean.valueOf(arg3) });
     }
-    
+
     private static long callStaticMethodL2L(Method m, long arg) {
         Object o = ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
         if(o instanceof Number) {
@@ -252,18 +252,18 @@ public class SWTAccessor {
     //
     // Public properties
     //
-    
+
     public static boolean isUsingLongHandles() {
         return swt_uses_long_handles;
     }
 
     public static boolean useX11GTK() { return isX11GTK; }
     public static VersionNumber GTK_VERSION() { return OS_gtk_version; }
-    
+
     //
     // Common GTK
     //
-    
+
     public static long gdk_widget_get_window(long handle) {
         final long window;
         if (OS_gtk_version.compareTo(GTK_VERSION_2_14_0) >= 0) {
@@ -276,7 +276,7 @@ public class SWTAccessor {
         }
         return window;
     }
-    
+
     public static long gdk_window_get_xdisplay(long window) {
         final long xdisplay;
         if (OS_gtk_version.compareTo(GTK_VERSION_2_24_0) >= 0) {
@@ -293,7 +293,7 @@ public class SWTAccessor {
         }
         return xdisplay;
     }
-    
+
     public static long gdk_window_get_xwindow(long window) {
         final long xWindow;
         if (OS_gtk_version.compareTo(GTK_VERSION_3_0_0) >= 0) {
@@ -306,15 +306,15 @@ public class SWTAccessor {
         }
         return xWindow;
     }
-    
+
     public static void gdk_window_set_back_pixmap(long window, long pixmap, boolean parent_relative) {
         callStaticMethodLLZ2V(OS_gdk_window_set_back_pixmap, window, pixmap, parent_relative);
     }
-    
+
     //
     // Common any toolkit
     //
-    
+
     /**
      * @param swtControl the SWT Control to retrieve the native widget-handle from
      * @return the native widget-handle
@@ -335,9 +335,9 @@ public class SWTAccessor {
                     }
                 } catch (Exception ex) {
                     throw new NativeWindowException(ex);
-                }                    
+                }
             }
-        } else {       
+        } else {
             try {
                 h = swt_control_handle.getLong(swtControl);
             } catch (Exception ex) {
@@ -350,14 +350,14 @@ public class SWTAccessor {
         return h;
     }
 
-    public static void setRealized(final Control swtControl, final boolean realize) 
-            throws NativeWindowException 
+    public static void setRealized(final Control swtControl, final boolean realize)
+            throws NativeWindowException
     {
         if(!realize && swtControl.isDisposed()) {
             return;
         }
         final long handle = getHandle(swtControl);
-        
+
         if(null != OS_gtk_class) {
             invoke(true, new Runnable() {
                 public void run() {
@@ -365,16 +365,16 @@ public class SWTAccessor {
                         callStaticMethodL2V(OS_gtk_widget_realize, handle);
                     } else if(null != OS_gtk_widget_unrealize) {
                         callStaticMethodL2V(OS_gtk_widget_unrealize, handle);
-                    }                    
+                    }
                 }
             });
         }
     }
-        
+
     /**
      * @param swtControl the SWT Control to retrieve the native device handle from
      * @return the AbstractGraphicsDevice w/ the native device handle
-     * @throws NativeWindowException if the widget handle is null 
+     * @throws NativeWindowException if the widget handle is null
      * @throws UnsupportedOperationException if the windowing system is not supported
      */
     public static AbstractGraphicsDevice getDevice(Control swtControl) throws NativeWindowException, UnsupportedOperationException {
@@ -391,7 +391,7 @@ public class SWTAccessor {
         }
         throw new UnsupportedOperationException("n/a for this windowing system: "+nwt);
     }
-    
+
     /**
      * @param device
      * @param screen -1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen
@@ -400,7 +400,7 @@ public class SWTAccessor {
     public static AbstractGraphicsScreen getScreen(AbstractGraphicsDevice device, int screen) {
         return NativeWindowFactory.createScreen(device, screen);
     }
-    
+
     public static int getNativeVisualID(AbstractGraphicsDevice device, long windowHandle) {
         if( isX11 ) {
             return X11Lib.GetVisualIDFromWindow(device.getHandle(), windowHandle);
@@ -408,29 +408,29 @@ public class SWTAccessor {
         if( isWindows || isOSX ) {
             return VisualIDHolder.VID_UNDEFINED;
         }
-        throw new UnsupportedOperationException("n/a for this windowing system: "+nwt);        
+        throw new UnsupportedOperationException("n/a for this windowing system: "+nwt);
     }
-    
+
     /**
      * @param swtControl the SWT Control to retrieve the native window handle from
      * @return the native window handle
-     * @throws NativeWindowException if the widget handle is null 
+     * @throws NativeWindowException if the widget handle is null
      * @throws UnsupportedOperationException if the windowing system is not supported
      */
     public static long getWindowHandle(Control swtControl) throws NativeWindowException, UnsupportedOperationException {
-        final long handle = getHandle(swtControl);        
+        final long handle = getHandle(swtControl);
         if(0 == handle) {
             throw new NativeWindowException("Null SWT handle of SWT control "+swtControl);
         }
         if( isX11GTK ) {
-            return gdk_window_get_xwindow( gdk_widget_get_window( handle ) );            
+            return gdk_window_get_xwindow( gdk_widget_get_window( handle ) );
         }
         if( isWindows || isOSX ) {
             return handle;
         }
         throw new UnsupportedOperationException("n/a for this windowing system: "+nwt);
     }
-    
+
     public static long newGC(final Control swtControl, final GCData gcData) {
         final Object[] o = new Object[1];
         invoke(true, new Runnable() {
@@ -444,7 +444,7 @@ public class SWTAccessor {
             throw new InternalError("SWT internal_new_GC did not return int or long but "+o[0].getClass());
         }
     }
-    
+
     public static void disposeGC(final Control swtControl, final long gc, final GCData gcData) {
         invoke(true, new Runnable() {
             public void run() {
@@ -456,7 +456,7 @@ public class SWTAccessor {
             }
         });
     }
-    
+
    /**
     * Runs the specified action in an SWT compatible thread, which is:
     * <ul>
@@ -468,7 +468,7 @@ public class SWTAccessor {
     *   <li>Linux, Windows, ..
     *   <ul>
     *     <li>Current thread.</li>
-    *   </ul></li>  
+    *   </ul></li>
     * </ul>
     * @see Platform#AWT_AVAILABLE
     * @see Platform#getOSType()
@@ -479,9 +479,9 @@ public class SWTAccessor {
             OSXUtil.RunOnMainThread(wait, runnable);
         } else {
             runnable.run();
-        }        
+        }
     }
-    
+
    /**
     * Runs the specified action on the SWT UI thread.
     * <p>
@@ -492,56 +492,56 @@ public class SWTAccessor {
     public static void invoke(org.eclipse.swt.widgets.Display display, boolean wait, Runnable runnable) {
         if( display.isDisposed() || Thread.currentThread() == display.getThread() ) {
             invoke(wait, runnable);
-        } else if( wait ) {            
+        } else if( wait ) {
             display.syncExec(runnable);
         } else {
             display.asyncExec(runnable);
         }
     }
-    
+
     //
     // Specific X11 GTK ChildWindow - Using plain X11 native parenting (works well)
     //
-    
+
     public static long createCompatibleX11ChildWindow(AbstractGraphicsScreen screen, Control swtControl, int visualID, int width, int height) {
         final long handle = getHandle(swtControl);
         final long parentWindow = gdk_widget_get_window( handle );
         gdk_window_set_back_pixmap (parentWindow, 0, false);
-        
+
         final long x11ParentHandle = gdk_window_get_xwindow(parentWindow);
         final long x11WindowHandle = X11Lib.CreateWindow(x11ParentHandle, screen.getDevice().getHandle(), screen.getIndex(), visualID, width, height, true, true);
-        
+
         return x11WindowHandle;
     }
-    
+
     public static void resizeX11Window(AbstractGraphicsDevice device, Rectangle clientArea, long x11Window) {
-        X11Lib.SetWindowPosSize(device.getHandle(), x11Window, clientArea.x, clientArea.y, clientArea.width, clientArea.height);        
+        X11Lib.SetWindowPosSize(device.getHandle(), x11Window, clientArea.x, clientArea.y, clientArea.width, clientArea.height);
     }
     public static void destroyX11Window(AbstractGraphicsDevice device, long x11Window) {
         X11Lib.DestroyWindow(device.getHandle(), x11Window);
     }
-    
+
     //
     // Specific X11 SWT/GTK ChildWindow - Using SWT/GTK native parenting (buggy - sporadic resize flickering, sporadic drop of rendering)
     //
     // FIXME: Need to use reflection for 32bit access as well !
     //
-    
+
     // public static final int GDK_WA_TYPE_HINT = 1 << 9;
     // public static final int GDK_WA_VISUAL = 1 << 6;
-    
+
     public static long createCompatibleGDKChildWindow(Control swtControl, int visualID, int width, int height) {
         return 0;
         /**
         final long handle = SWTAccessor.getHandle(swtControl);
         final long parentWindow = gdk_widget_get_window( handle );
-        
+
         final long screen = OS.gdk_screen_get_default ();
         final long gdkvisual = OS.gdk_x11_screen_lookup_visual (screen, visualID);
-        
+
         final GdkWindowAttr attrs = new GdkWindowAttr();
         attrs.width = width > 0 ? width : 1;
-        attrs.height = height > 0 ? height : 1;        
+        attrs.height = height > 0 ? height : 1;
         attrs.event_mask = OS.GDK_KEY_PRESS_MASK | OS.GDK_KEY_RELEASE_MASK |
                            OS.GDK_FOCUS_CHANGE_MASK | OS.GDK_POINTER_MOTION_MASK |
                            OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK |
@@ -550,16 +550,16 @@ public class SWTAccessor {
                            OS.GDK_POINTER_MOTION_HINT_MASK;
         attrs.window_type = OS.GDK_WINDOW_CHILD;
         attrs.visual = gdkvisual;
-        
+
         final long childWindow = OS.gdk_window_new (parentWindow, attrs, OS.GDK_WA_VISUAL|GDK_WA_TYPE_HINT);
         OS.gdk_window_set_user_data (childWindow, handle);
         OS.gdk_window_set_back_pixmap (parentWindow, 0, false);
-        
+
         OS.gdk_window_show (childWindow);
         OS.gdk_flush();
         return childWindow; */
     }
-    
+
     public static void showGDKWindow(long gdkWindow) {
         /* OS.gdk_window_show (gdkWindow);
         OS.gdk_flush(); */
@@ -576,8 +576,8 @@ public class SWTAccessor {
         OS.gdk_window_resize (gdkWindow, clientArea.width, clientArea.height);
         OS.gdk_flush(); */
     }
-    
+
     public static void destroyGDKWindow(long gdkWindow) {
         // OS.gdk_window_destroy (gdkWindow);
-    }    
+    }
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
index 5cabdf150..7468d254b 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -34,7 +34,7 @@ package com.jogamp.nativewindow.windows;
 
 import javax.media.nativewindow.*;
 
-/** 
+/**
  * Encapsulates a graphics device on Windows platforms.<br>
  */
 public class WindowsGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java
index 0d2914c7d..120c86584 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -48,7 +48,7 @@ import jogamp.nativewindow.x11.XVisualInfo;
 public class X11GraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
     private XVisualInfo info;
 
-    public X11GraphicsConfiguration(X11GraphicsScreen screen, 
+    public X11GraphicsConfiguration(X11GraphicsScreen screen,
                                     CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
                                     XVisualInfo info) {
         super(screen, capsChosen, capsRequested);
@@ -71,12 +71,12 @@ public class X11GraphicsConfiguration extends MutableGraphicsConfiguration imple
     final public int getXVisualID() {
         return (null!=info)?(int)info.getVisualid():0;
     }
-    
+
     @Override
     public String toString() {
         return getClass().getSimpleName()+"["+getScreen()+", visualID 0x" + Long.toHexString(getXVisualID()) +
                                        ",\n\tchosen    " + capabilitiesChosen+
-                                       ",\n\trequested " + capabilitiesRequested+ 
+                                       ",\n\trequested " + capabilitiesRequested+
                                        "]";
     }
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
index e630e012e..40d212df3 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -87,12 +87,12 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         handleOwner = owner;
         isXineramaEnabled = X11Util.XineramaIsEnabled(this);
     }
-    
+
 
     private static int getDefaultScreenImpl(long dpy) {
         return X11Lib.DefaultScreen(dpy);
     }
-    
+
     /**
      * Returns the default screen number as referenced by the display connection, i.e. 'somewhere:0.1' -> 1
      * <p>
@@ -110,7 +110,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         }
         return ds;
     }
-    
+
     public int getDefaultVisualID() {
         final long display = getHandle();
         if(0==display) {
@@ -118,11 +118,11 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         }
         return X11Lib.DefaultVisualID(display, getDefaultScreenImpl(display));
     }
-    
+
     public final boolean isXineramaEnabled() {
         return isXineramaEnabled;
     }
-    
+
     @Override
     public Object clone() {
       return super.clone();
@@ -142,7 +142,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         }
         return false;
     }
-        
+
     @Override
     public boolean close() {
         if(handleOwner && 0 != handle) {
@@ -153,11 +153,11 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         }
         return super.close();
     }
-    
+
     @Override
     public boolean isHandleOwner() {
         return handleOwner;
-    }    
+    }
     @Override
     public void clearHandleOwner() {
         handleOwner = false;
@@ -168,8 +168,8 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
     }
     @Override
     protected Object setHandleOwnership(Object newOwnership) {
-        final Boolean oldOwnership = Boolean.valueOf(handleOwner); 
+        final Boolean oldOwnership = Boolean.valueOf(handleOwner);
         handleOwner = ((Boolean) newOwnership).booleanValue();
         return oldOwnership;
-    }        
+    }
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
index 2ec66290a..8aac7095a 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -62,7 +62,7 @@ public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneabl
         // It still could be an AWT hold handle ..
         return X11Lib.DefaultVisualID(getDevice().getHandle(), getIndex());
     }
-    
+
     public Object clone() {
       return super.clone();
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsConfiguration.java
index 4e45113d4..48f72e574 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsConfiguration.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -44,7 +44,7 @@ package javax.media.nativewindow;
     pixel format in a toolkit-independent manner. */
 public interface AbstractGraphicsConfiguration extends VisualIDHolder, Cloneable {
     public Object clone();
-    
+
     /**
      * Return the screen this graphics configuration is valid for
      */
diff --git a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java
index ed305d49e..31b64269f 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -47,7 +47,7 @@ import jogamp.nativewindow.Debug;
  */
 public interface AbstractGraphicsDevice extends Cloneable {
     public static final boolean DEBUG = Debug.debug("GraphicsDevice");
-    
+
     /** Dummy connection value for a default connection where no native support for multiple devices is available */
     public static String DEFAULT_CONNECTION = "decon";
 
@@ -58,7 +58,7 @@ public interface AbstractGraphicsDevice extends Cloneable {
     public static int DEFAULT_UNIT = 0;
 
     public Object clone();
-    
+
     /**
      * Returns the type of the underlying subsystem, ie
      * NativeWindowFactory.TYPE_KD, NativeWindowFactory.TYPE_X11, ..
@@ -96,7 +96,7 @@ public interface AbstractGraphicsDevice extends Cloneable {
      * The unique ID may be used as a key for semantic device mapping.
      * </p>
      * <p>
-     * The returned string object reference is unique using {@link String#intern()}  
+     * The returned string object reference is unique using {@link String#intern()}
      * and hence can be used as a key itself.
      * </p>
      */
@@ -114,29 +114,29 @@ public interface AbstractGraphicsDevice extends Cloneable {
      */
     public void lock();
 
-    /** 
+    /**
      * Optionally unlocking the device, utilizing eg {@link javax.media.nativewindow.ToolkitLock#unlock()}.
      * The lock implementation must be recursive.
-     * 
+     *
      * @throws RuntimeException in case the lock is not acquired by this thread.
      */
     public void unlock();
 
     /**
-     * @throws RuntimeException if current thread does not hold the lock 
+     * @throws RuntimeException if current thread does not hold the lock
      */
     public void validateLocked() throws RuntimeException;
-    
-    /** 
+
+    /**
      * Optionally [re]opening the device if handle is <code>null</code>.
      * <p>
      * The default implementation is a <code>NOP</code>.
      * </p>
      * <p>
-     * Example implementations like {@link com.jogamp.nativewindow.x11.X11GraphicsDevice} 
-     * or {@link com.jogamp.nativewindow.egl.EGLGraphicsDevice} 
+     * Example implementations like {@link com.jogamp.nativewindow.x11.X11GraphicsDevice}
+     * or {@link com.jogamp.nativewindow.egl.EGLGraphicsDevice}
      * issue the native open operation in case handle is <code>null</code>.
-     * </p> 
+     * </p>
      *
      * @return true if the handle was <code>null</code> and opening was successful, otherwise false.
      */
@@ -148,19 +148,19 @@ public interface AbstractGraphicsDevice extends Cloneable {
      * The default implementation {@link ToolkitLock#dispose() dispose} it's {@link ToolkitLock} and sets the handle to <code>null</code>.
      * </p>
      * <p>
-     * Example implementations like {@link com.jogamp.nativewindow.x11.X11GraphicsDevice} 
-     * or {@link com.jogamp.nativewindow.egl.EGLGraphicsDevice} 
+     * Example implementations like {@link com.jogamp.nativewindow.x11.X11GraphicsDevice}
+     * or {@link com.jogamp.nativewindow.egl.EGLGraphicsDevice}
      * issue the native close operation or skip it depending on the {@link #isHandleOwner() handles's ownership}.
-     * </p> 
+     * </p>
      *
      * @return true if the handle was not <code>null</code> and closing was successful, otherwise false.
      */
     public boolean close();
-    
+
     /**
      * @return <code>true</code> if instance owns the handle to issue {@link #close()}, otherwise <code>false</code>.
      */
     public boolean isHandleOwner();
-    
+
     public void clearHandleOwner();
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsScreen.java
index acb98073b..da8f12f3e 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsScreen.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -45,7 +45,7 @@ package javax.media.nativewindow;
 
 public interface AbstractGraphicsScreen extends Cloneable {
     public Object clone();
-    
+
     /**
      * Return the device this graphics configuration is valid for
      */
diff --git a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
index f2a8e2394..9eed887b5 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
@@ -61,7 +61,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
 
   // Switch for on- or offscreen
   private boolean onscreen  = true;
-  
+
   // offscreen bitmap mode
   private boolean isBitmap  = false;
 
@@ -74,7 +74,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   public Object cloneMutable() {
     return clone();
   }
-  
+
   @Override
   public Object clone() {
     try {
@@ -85,7 +85,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   }
 
   /**
-   * Copies all {@link Capabilities} values 
+   * Copies all {@link Capabilities} values
    * from <code>source</code> into this instance.
    * @return this instance
    */
@@ -103,7 +103,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
     transparentValueAlpha = other.getTransparentAlphaValue();
     return this;
   }
-  
+
   @Override
   public int hashCode() {
     // 31 * x == (x << 5) - x
@@ -150,15 +150,15 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
    **/
   @Override
   public int compareTo(final CapabilitiesImmutable caps) {
-    /** 
+    /**
     if ( ! ( o instanceof CapabilitiesImmutable ) ) {
         Class<?> c = (null != o) ? o.getClass() : null ;
         throw new ClassCastException("Not a CapabilitiesImmutable object, but " + c);
     }
     final CapabilitiesImmutable caps = (CapabilitiesImmutable) o; */
-        
+
     final int rgba = redBits * greenBits * blueBits * ( alphaBits + 1 );
-    
+
     final int xrgba = caps.getRedBits() * caps.getGreenBits() * caps.getBlueBits() * ( caps.getAlphaBits() + 1 );
 
     if(rgba > xrgba) {
@@ -222,17 +222,17 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
     return alphaBits;
   }
 
-  /** 
+  /**
    * Sets the number of bits requested for the color buffer's alpha
    * component. On some systems only the color depth, which is the
    * sum of the red, green, and blue bits, is considered.
    * <p>
-   * <b>Note:</b> If alpha bits are <code>zero</code>, they are set to <code>one</code> 
+   * <b>Note:</b> If alpha bits are <code>zero</code>, they are set to <code>one</code>
    * by {@link #setBackgroundOpaque(boolean)} and it's OpenGL specialization <code>GLCapabilities::setSampleBuffers(boolean)</code>.<br/>
    * Ensure to call this method after the above to ensure a <code>zero</code> value.</br>
    * The above automated settings takes into account, that the user calls this method to <i>request</i> alpha bits,
    * not to <i>reflect</i> a current state. Nevertheless if this is the case - call it at last.
-   * </p>  
+   * </p>
    */
   public void setAlphaBits(int alphaBits) {
     this.alphaBits = alphaBits;
@@ -271,7 +271,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
    * Defaults to true.
    * </p>
    * <p>
-   * If requesting an offscreen surface without further selection of it's mode, 
+   * If requesting an offscreen surface without further selection of it's mode,
    * e.g. FBO, Pbuffer or {@link #setBitmap(boolean) bitmap},
    * the implementation will choose the best available offscreen mode.
    * </p>
@@ -304,12 +304,12 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
     }
     isBitmap = enable;
   }
-  
+
   @Override
   public boolean isBitmap() {
-    return isBitmap;      
+    return isBitmap;
   }
-  
+
   @Override
   public final int getTransparentRedValue() { return transparentValueRed; }
 
@@ -354,7 +354,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   public StringBuilder toString(StringBuilder sink) {
       return toString(sink, true);
   }
-  
+
   /** Returns a textual representation of this Capabilities
       object. */
   @Override
@@ -365,7 +365,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
     msg.append("]");
     return msg.toString();
   }
-  
+
   /** Return a textual representation of this object's on/off screen state. Use the given StringBuilder [optional]. */
   protected StringBuilder onoffScreenToString(StringBuilder sink) {
     if(null == sink) {
@@ -381,19 +381,19 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
     } else if(onscreen) {
         sink.append(".");        // no additional off-screen modes besides on-screen
     } else {
-        sink.append("auto-cfg"); // auto-config off-screen mode            
+        sink.append("auto-cfg"); // auto-config off-screen mode
     }
-    sink.append("]");    
-    
+    sink.append("]");
+
     return sink;
   }
-  
+
   /** Element separator */
   protected static final String ESEP = "/";
   /** Component separator */
   protected static final String CSEP = ", ";
-  
-  protected StringBuilder toString(StringBuilder sink, boolean withOnOffScreen) {  
+
+  protected StringBuilder toString(StringBuilder sink, boolean withOnOffScreen) {
     if(null == sink) {
         sink = new StringBuilder();
     }
@@ -409,6 +409,6 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
     }
     return sink;
   }
-  
+
   protected final String toHexString(int val) { return Integer.toHexString(val); }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java
index e1fdf4938..1f4db7997 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -58,7 +58,7 @@ public interface CapabilitiesChooser {
       not necessarily required, that the chooser select that entry.
 
       <P> <em>Note:</em> this method is called automatically by the
-      {@link GraphicsConfigurationFactory#chooseGraphicsConfiguration} method 
+      {@link GraphicsConfigurationFactory#chooseGraphicsConfiguration} method
       when an instance of this class is passed in to it.
       It should generally not be
       invoked by users directly, unless it is desired to delegate the
diff --git a/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesImmutable.java
index 85659f286..c496a1535 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesImmutable.java
@@ -70,12 +70,12 @@ public interface CapabilitiesImmutable extends VisualIDHolder, WriteCloneable, C
      * Returns whether an opaque or translucent surface is requested, supported or chosen.
      * <p>
      * Default is true, i.e. opaque.
-     * </p> 
+     * </p>
      */
     boolean isBackgroundOpaque();
 
     /**
-     * Returns whether an on- or offscreen surface is requested, available or chosen. 
+     * Returns whether an on- or offscreen surface is requested, available or chosen.
      * <p>
      * Default is true, i.e. onscreen.
      * </p>
@@ -83,7 +83,7 @@ public interface CapabilitiesImmutable extends VisualIDHolder, WriteCloneable, C
      * Mind that an capabilities intance w/ <i>available</i> semantics
      * may show onscreen, but also the offscreen modes FBO, Pbuffer or {@link #setBitmap(boolean) bitmap}.
      * This is valid, since one native configuration maybe used for either functionality.
-     * </p> 
+     * </p>
      */
     boolean isOnscreen();
 
@@ -97,7 +97,7 @@ public interface CapabilitiesImmutable extends VisualIDHolder, WriteCloneable, C
      * </p>
      */
     boolean isBitmap();
-    
+
     /**
      * Gets the transparent red value for the frame buffer configuration. This
      * value is undefined if; equals true.
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
index 4f07bca9b..6095db052 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -66,16 +66,16 @@ import jogamp.nativewindow.Debug;
 */
 
 public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
-  private static final boolean DEBUG; 
+  private static final boolean DEBUG;
 
   static {
       Debug.initSingleton();
       DEBUG = Debug.isPropertyDefined("nativewindow.debug.CapabilitiesChooser", true);
   }
-  
+
   private final static int NO_SCORE = -9999999;
   private final static int COLOR_MISMATCH_PENALTY_SCALE     = 36;
-  
+
   public int chooseCapabilities(final CapabilitiesImmutable desired,
                                 final List<? extends CapabilitiesImmutable> available,
                                 final int windowSystemRecommendedChoice) {
@@ -112,7 +112,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
       if (desired.isOnscreen() && !cur.isOnscreen()) {
         continue; // requested onscreen, but n/a
       }
-      
+
       int score = 0;
       // Compute difference in color depth
       score += (COLOR_MISMATCH_PENALTY_SCALE *
@@ -132,7 +132,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
       System.err.println(" ]");
     }
 
-    // Ready to select. Choose score closest to 0. 
+    // Ready to select. Choose score closest to 0.
     int scoreClosestToZero = NO_SCORE;
     int chosenIndex = -1;
     for (int i = 0; i < availnum; i++) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
index 6b23172e1..3e32f30df 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -36,12 +36,12 @@ import jogamp.nativewindow.Debug;
 
 public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphicsConfiguration {
     protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
-    
+
     private AbstractGraphicsScreen screen;
     protected CapabilitiesImmutable capabilitiesChosen;
     protected CapabilitiesImmutable capabilitiesRequested;
 
-    public DefaultGraphicsConfiguration(AbstractGraphicsScreen screen, 
+    public DefaultGraphicsConfiguration(AbstractGraphicsScreen screen,
                                         CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
         if(null == screen) {
             throw new IllegalArgumentException("Null screen");
@@ -89,7 +89,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
     final public int getVisualID(VIDType type) throws NativeWindowException {
         return capabilitiesChosen.getVisualID(type);
     }
-            
+
     /**
      * Set the capabilities to a new value.
      *
@@ -119,7 +119,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
     public String toString() {
         return getClass().getSimpleName()+"[" + screen +
                                        ",\n\tchosen    " + capabilitiesChosen+
-                                       ",\n\trequested " + capabilitiesRequested+ 
+                                       ",\n\trequested " + capabilitiesRequested+
                                        "]";
     }
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
index 0bf5c2937..d74954a0d 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -140,8 +140,8 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
     public final void validateLocked() throws RuntimeException {
         toolkitLock.validateLocked();
     }
-    
-    /** 
+
+    /**
      * {@inheritDoc}
      * <p>
      * Locking is perfomed via delegation to {@link ToolkitLock#lock()}, {@link ToolkitLock#unlock()}.
@@ -154,7 +154,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
     public final void unlock() {
         toolkitLock.unlock();
     }
-    
+
     @Override
     public boolean open() {
         return false;
@@ -174,11 +174,11 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
     public boolean isHandleOwner() {
         return false;
     }
-    
+
     @Override
-    public void clearHandleOwner() {        
+    public void clearHandleOwner() {
     }
-    
+
     @Override
     public String toString() {
         return getClass().getSimpleName()+"[type "+getType()+", connection "+getConnection()+", unitID "+getUnitID()+", handle 0x"+Long.toHexString(getHandle())+", owner "+isHandleOwner()+", "+toolkitLock+"]";
@@ -193,14 +193,14 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
         handle = newHandle;
         return oldHandle;
     }
-    
+
     protected Object getHandleOwnership() {
         return null;
     }
     protected Object setHandleOwnership(Object newOwnership) {
         return null;
     }
-    
+
     public static final void swapDeviceHandleAndOwnership(final DefaultGraphicsDevice aDevice1, final DefaultGraphicsDevice aDevice2) {
         aDevice1.lock();
         try {
@@ -219,7 +219,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
             aDevice1.unlock();
         }
     }
-        
+
     /**
      * Set the internal ToolkitLock, which is used within the
      * {@link #lock()} and {@link #unlock()} implementation.
@@ -228,7 +228,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
      * The current ToolkitLock is being locked/unlocked while swapping the reference,
      * ensuring no concurrent access can occur during the swap.
      * </p>
-     * 
+     *
      * @param locker the ToolkitLock, if null, {@link jogamp.nativewindow.NullToolkitLock} is being used
      * @return the previous ToolkitLock instance
      */
@@ -253,8 +253,8 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
          return toolkitLock;
     }
 
-   /** 
-    * Returns a unique String object using {@link String#intern()} for the given arguments, 
+   /**
+    * Returns a unique String object using {@link String#intern()} for the given arguments,
     * which object reference itself can be used as a key.
     */
     protected static String getUniqueID(String type, String connection, int unitID) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
index 9fa58c7a3..ffcad235c 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -57,7 +57,7 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
     public AbstractGraphicsDevice getDevice() {
         return device;
     }
-    
+
     public int getIndex() {
       return idx;
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
index 9694f2491..e1aa91959 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008-2009 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -48,7 +48,7 @@ import java.util.Set;
 
 /**
  * Provides the mechanism by which the graphics configuration for a
- * window can be chosen before the window is created. The graphics 
+ * window can be chosen before the window is created. The graphics
  * configuration decides parameters related to hardware accelerated rendering such
  * as the OpenGL pixel format. <br>
  * On some window systems (EGL/OpenKODE and X11 in particular) it is necessary to
@@ -69,21 +69,21 @@ public abstract class GraphicsConfigurationFactory {
         public final Class<?> deviceType;
         public final Class<?> capsType;
         private final int hash32;
-        
+
         public DeviceCapsType(Class<?> deviceType, Class<?> capsType) {
             this.deviceType = deviceType;
             this.capsType = capsType;
-            
+
             // 31 * x == (x << 5) - x
             int hash32 = 31 + deviceType.hashCode();
             hash32 = ((hash32 << 5) - hash32) + capsType.hashCode();
             this.hash32 = hash32;
         }
-        
+
         public final int hashCode() {
             return hash32;
         }
-        
+
         public final boolean equals(Object obj) {
             if(this == obj)  { return true; }
             if (obj instanceof DeviceCapsType) {
@@ -92,18 +92,18 @@ public abstract class GraphicsConfigurationFactory {
             }
             return false;
         }
-        
+
         @Override
         public final String toString() {
             return "DeviceCapsType["+deviceType.getName()+", "+capsType.getName()+"]";
         }
-        
+
     }
-    
+
     private static final Map<DeviceCapsType, GraphicsConfigurationFactory> registeredFactories;
-    private static final DeviceCapsType defaultDeviceCapsType; 
+    private static final DeviceCapsType defaultDeviceCapsType;
     static boolean initialized = false;
-    
+
     static {
         DEBUG = Debug.debug("GraphicsConfiguration");
         if(DEBUG) {
@@ -113,7 +113,7 @@ public abstract class GraphicsConfigurationFactory {
         registeredFactories = Collections.synchronizedMap(new HashMap<DeviceCapsType, GraphicsConfigurationFactory>());
         defaultDeviceCapsType = new DeviceCapsType(AbstractGraphicsDevice.class, CapabilitiesImmutable.class);
     }
-        
+
     public static synchronized void initSingleton() {
         if(!initialized) {
             initialized = true;
@@ -121,31 +121,31 @@ public abstract class GraphicsConfigurationFactory {
             if(DEBUG) {
                 System.err.println(Thread.currentThread().getName()+" - GraphicsConfigurationFactory.initSingleton()");
             }
-            
+
             // Register the default no-op factory for arbitrary
             // AbstractGraphicsDevice implementations, including
             // AWTGraphicsDevice instances -- the OpenGL binding will take
             // care of handling AWTGraphicsDevices on X11 platforms (as
             // well as X11GraphicsDevices in non-AWT situations)
             registerFactory(defaultDeviceCapsType.deviceType, defaultDeviceCapsType.capsType, new DefaultGraphicsConfigurationFactoryImpl());
-            
+
             if (NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true)) {
                 try {
-                    ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.X11GraphicsConfigurationFactory", 
-                                                    "registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader());                
+                    ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.X11GraphicsConfigurationFactory",
+                                                    "registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader());
                 } catch (Exception e) {
                     throw new RuntimeException(e);
                 }
                 if(NativeWindowFactory.isAWTAvailable()) {
                     try {
-                        ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory", 
-                                                        "registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader());                
+                        ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory",
+                                                        "registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader());
                     } catch (Exception e) { /* n/a */ }
                 }
             }
         }
     }
-    
+
     public static synchronized void shutdown() {
         if(initialized) {
             initialized = false;
@@ -155,7 +155,7 @@ public abstract class GraphicsConfigurationFactory {
             registeredFactories.clear();
         }
     }
-    
+
     protected static String getThreadName() {
         return Thread.currentThread().getName();
     }
@@ -176,10 +176,10 @@ public abstract class GraphicsConfigurationFactory {
     /**
      * Returns the graphics configuration factory for use with the
      * given device and capability.
-     * 
+     *
      * @see #getFactory(Class, Class)
      */
-    public static GraphicsConfigurationFactory getFactory(AbstractGraphicsDevice device, CapabilitiesImmutable caps) {        
+    public static GraphicsConfigurationFactory getFactory(AbstractGraphicsDevice device, CapabilitiesImmutable caps) {
         if (device == null) {
             throw new IllegalArgumentException("null device");
         }
@@ -195,7 +195,7 @@ public abstract class GraphicsConfigurationFactory {
      * <p>
      * Note: Registered device types maybe classes or interfaces, where capabilities types are interfaces only.
      * </p>
-     *  
+     *
      * <p>
      * Pseudo code for finding a suitable factory is:
      * <pre>
@@ -211,7 +211,7 @@ public abstract class GraphicsConfigurationFactory {
      * @param deviceType the minimum capabilities class type accepted, must implement or extend {@link AbstractGraphicsDevice}
      * @param capabilitiesType the minimum capabilities class type accepted, must implement or extend {@link CapabilitiesImmutable}
      *
-     * @throws IllegalArgumentException if the deviceType does not implement {@link AbstractGraphicsDevice} or 
+     * @throws IllegalArgumentException if the deviceType does not implement {@link AbstractGraphicsDevice} or
      *                                  capabilitiesType does not implement {@link CapabilitiesImmutable}
      */
     public static GraphicsConfigurationFactory getFactory(Class<?> deviceType, Class<?> capabilitiesType)
@@ -228,12 +228,12 @@ public abstract class GraphicsConfigurationFactory {
             System.err.println("GraphicsConfigurationFactory.getFactory: "+deviceType.getName()+", "+capabilitiesType.getName());
             dumpFactories();
         }
-        
-        final List<Class<?>> deviceTypes = getAllAssignableClassesFrom(defaultDeviceCapsType.deviceType, deviceType, false);        
+
+        final List<Class<?>> deviceTypes = getAllAssignableClassesFrom(defaultDeviceCapsType.deviceType, deviceType, false);
         if(DEBUG) {
             System.err.println("GraphicsConfigurationFactory.getFactory() deviceTypes: " + deviceTypes);
         }
-        final List<Class<?>> capabilitiesTypes = getAllAssignableClassesFrom(defaultDeviceCapsType.capsType, capabilitiesType, true);        
+        final List<Class<?>> capabilitiesTypes = getAllAssignableClassesFrom(defaultDeviceCapsType.capsType, capabilitiesType, true);
         if(DEBUG) {
             System.err.println("GraphicsConfigurationFactory.getFactory() capabilitiesTypes: " + capabilitiesTypes);
         }
@@ -259,7 +259,7 @@ public abstract class GraphicsConfigurationFactory {
         return factory;
     }
     private static ArrayList<Class<?>> getAllAssignableClassesFrom(Class<?> superClassOrInterface, Class<?> fromClass, boolean interfacesOnly) {
-        // Using a todo list avoiding a recursive loop! 
+        // Using a todo list avoiding a recursive loop!
         final ArrayList<Class<?>> inspectClasses  = new ArrayList<Class<?>>();
         final ArrayList<Class<?>> resolvedInterfaces = new ArrayList<Class<?>>();
         inspectClasses.add(fromClass);
@@ -277,7 +277,7 @@ public abstract class GraphicsConfigurationFactory {
             }
         }
         types.addAll(Arrays.asList(fromClass.getInterfaces()));
-                
+
         for(int i=0; i<types.size(); i++) {
             final Class<?> iface = types.get(i);
             if( superClassOrInterface.isAssignableFrom(iface) && !resolvedInterfaces.contains(iface) ) {
@@ -302,20 +302,20 @@ public abstract class GraphicsConfigurationFactory {
         }
     }
 
-    /** 
+    /**
      * Registers a GraphicsConfigurationFactory handling
      * the given graphics device and capability class.
      * <p>
      * This does not need to be called by end users, only implementors of new
      * GraphicsConfigurationFactory subclasses.
      * </p>
-     * 
+     *
      * <p>
      * Note: Registered device types maybe classes or interfaces, where capabilities types are interfaces only.
-     * </p> 
-     * 
+     * </p>
+     *
      * <p>See {@link #getFactory(Class, Class)} for a description of the find algorithm.</p>
-     * 
+     *
      * @param deviceType the minimum capabilities class type accepted, must implement or extend interface {@link AbstractGraphicsDevice}
      * @param capabilitiesType the minimum capabilities class type accepted, must extend interface {@link CapabilitiesImmutable}
      * @return the previous registered factory, or null if none
@@ -329,7 +329,7 @@ public abstract class GraphicsConfigurationFactory {
         }
         if (!(defaultDeviceCapsType.capsType.isAssignableFrom(capabilitiesType))) {
             throw new IllegalArgumentException("Given capabilities class must implement CapabilitiesImmutable");
-        }        
+        }
         final DeviceCapsType dct = new DeviceCapsType(abstractGraphicsDeviceImplementor, capabilitiesType);
         final GraphicsConfigurationFactory prevFactory;
         if(null == factory) {
@@ -352,7 +352,7 @@ public abstract class GraphicsConfigurationFactory {
      * <P> Selects a graphics configuration on the specified graphics
      * device compatible with the supplied {@link Capabilities}. Some
      * platforms (e.g.: X11, EGL, KD) require the graphics configuration
-     * to be specified when the native window is created. 
+     * to be specified when the native window is created.
      * These architectures have seperated their device, screen, window and drawable
      * context and hence are capable of quering the capabilities for each screen.
      * A fully established window is not required.</P>
@@ -360,7 +360,7 @@ public abstract class GraphicsConfigurationFactory {
      * <P>Other platforms (e.g. Windows, MacOSX) don't offer the mentioned seperation
      * and hence need a fully established window and it's drawable.
      * Here the validation of the capabilities is performed later.
-     * In this case, the AbstractGraphicsConfiguration implementation 
+     * In this case, the AbstractGraphicsConfiguration implementation
      * must allow an overwrite of the Capabilites, for example
      * {@link DefaultGraphicsConfiguration#setChosenCapabilities DefaultGraphicsConfiguration.setChosenCapabilities(..)}.
      * </P>
@@ -385,7 +385,7 @@ public abstract class GraphicsConfigurationFactory {
      * @param capsRequested  the original requested capabilities
      * @param chooser        the choosing implementation
      * @param screen         the referring Screen
-     * @param nativeVisualID if not {@link VisualIDHolder#VID_UNDEFINED} it reflects a pre-chosen visualID of the native platform's windowing system. 
+     * @param nativeVisualID if not {@link VisualIDHolder#VID_UNDEFINED} it reflects a pre-chosen visualID of the native platform's windowing system.
      * @return               the complete GraphicsConfiguration
      *
      * @throws IllegalArgumentException if the data type of the passed
diff --git a/src/nativewindow/classes/javax/media/nativewindow/MutableSurface.java b/src/nativewindow/classes/javax/media/nativewindow/MutableSurface.java
index ff53c8109..a0db11ad9 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/MutableSurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/MutableSurface.java
@@ -31,12 +31,12 @@ package javax.media.nativewindow;
 /**
  * Provides a {@link NativeSurface} with a mutable <code>surfaceHandle</code>
  * via {@link #setSurfaceHandle(long)}.
- * 
+ *
  * @see NativeSurface
  */
 public interface MutableSurface extends NativeSurface {
 
-    /** 
+    /**
      * Sets the surface handle which is created outside of this implementation.
      */
     public void setSurfaceHandle(long surfaceHandle);
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java
index a89caec76..a755b1812 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package javax.media.nativewindow;
 
 /** Provides low-level information required for
@@ -54,10 +54,10 @@ public interface NativeSurface extends SurfaceUpdatedListener {
    * <p>
    * The surface handle shall be valid after a successfull call,
    * ie return a value other than {@link #LOCK_SURFACE_UNLOCKED} and {@link #LOCK_SURFACE_NOT_READY},
-   * which is 
-   * <pre> 
-   *    boolean ok = LOCK_SURFACE_NOT_READY < lockSurface(); 
-   * </pre> 
+   * which is
+   * <pre>
+   *    boolean ok = LOCK_SURFACE_NOT_READY < lockSurface();
+   * </pre>
    * </p>
    * <p>
    * The caller may need to take care of the result {@link #LOCK_SURFACE_CHANGED},
@@ -71,7 +71,7 @@ public interface NativeSurface extends SurfaceUpdatedListener {
    * This call allows recursion from the same thread.
    * </p>
    * <p>
-   * The implementation may want to aquire the 
+   * The implementation may want to aquire the
    * application level {@link com.jogamp.common.util.locks.RecursiveLock}
    * first before proceeding with a native surface lock.
    * </p>
@@ -115,7 +115,7 @@ public interface NativeSurface extends SurfaceUpdatedListener {
    * </pre>
    */
   public boolean isSurfaceLockedByOtherThread();
-  
+
   /**
    * Return the locking owner's Thread, or null if not locked.
    */
@@ -123,15 +123,15 @@ public interface NativeSurface extends SurfaceUpdatedListener {
 
   /**
    * Provide a mechanism to utilize custom (pre-) swap surface
-   * code. This method is called before the render toolkit (e.g. JOGL) 
+   * code. This method is called before the render toolkit (e.g. JOGL)
    * swaps the buffer/surface if double buffering is enabled.
-   * <p> 
+   * <p>
    * The implementation may itself apply the swapping,
    * in which case true shall be returned.
    * </p>
    *
    * @return true if this method completed swapping the surface,
-   *         otherwise false, in which case eg the GLDrawable 
+   *         otherwise false, in which case eg the GLDrawable
    *         implementation has to swap the code.
    */
   public boolean surfaceSwap();
@@ -153,13 +153,13 @@ public interface NativeSurface extends SurfaceUpdatedListener {
 
   /** Remove the specified {@link SurfaceUpdatedListener} from the list. */
   public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l);
-  
+
   /**
    * Returns the handle to the surface for this NativeSurface. <P>
-   * 
+   *
    * The surface handle should be set/update by {@link #lockSurface()},
    * where {@link #unlockSurface()} is not allowed to modify it.
-   * After {@link #unlockSurface()} it is no more guaranteed 
+   * After {@link #unlockSurface()} it is no more guaranteed
    * that the surface handle is still valid.
    *
    * The surface handle shall reflect the platform one
@@ -195,16 +195,16 @@ public interface NativeSurface extends SurfaceUpdatedListener {
   public AbstractGraphicsConfiguration getGraphicsConfiguration();
 
   /**
-   * Convenience: Get display handle from 
+   * Convenience: Get display handle from
    *   AbstractGraphicsConfiguration . AbstractGraphicsScreen . AbstractGraphicsDevice
    */
   public long getDisplayHandle();
 
   /**
-   * Convenience: Get display handle from 
+   * Convenience: Get display handle from
    *   AbstractGraphicsConfiguration . AbstractGraphicsScreen
    */
   public int  getScreenIndex();
-  
+
 }
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
index 593c1e7d6..0943c8c09 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index 07d1008b4..bad72f355 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008-2009 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -90,13 +90,13 @@ public abstract class NativeWindowFactory {
 
     private static final String nativeWindowingTypePure;   // canonical String via String.intern()
     private static final String nativeWindowingTypeCustom; // canonical String via String.intern()
-    
+
     private static NativeWindowFactory defaultFactory;
     private static Map<Class<?>, NativeWindowFactory> registeredFactories;
-    
+
     private static Class<?> nativeWindowClass;
     private static boolean isAWTAvailable;
-    
+
     private static final String JAWTUtilClassName = "jogamp.nativewindow.jawt.JAWTUtil" ;
     /** {@link jogamp.nativewindow.x11.X11Util} implements {@link ToolkitProperties}. */
     private static final String X11UtilClassName = "jogamp.nativewindow.x11.X11Util";
@@ -104,16 +104,16 @@ public abstract class NativeWindowFactory {
     private static final String OSXUtilClassName = "jogamp.nativewindow.macosx.OSXUtil";
     /** {@link jogamp.nativewindow.windows.GDIUtil} implements {@link ToolkitProperties}. */
     private static final String GDIClassName = "jogamp.nativewindow.windows.GDIUtil";
-    
+
     private static ToolkitLock jawtUtilJAWTToolkitLock;
-    
+
     private static boolean requiresToolkitLock;
     private static boolean desktopHasThreadingIssues;
 
     // Shutdown hook mechanism for the factory
     private static volatile boolean isJVMShuttingDown = false;
     private static final List<Runnable> customShutdownHooks = new ArrayList<Runnable>();
-    
+
     /** Creates a new NativeWindowFactory instance. End users do not
         need to call this method. */
     protected NativeWindowFactory() {
@@ -139,10 +139,10 @@ public abstract class NativeWindowFactory {
             case MACOS:
               return TYPE_MACOSX;
             case WINDOWS:
-              return TYPE_WINDOWS;                
+              return TYPE_WINDOWS;
             case OPENKODE:
               return TYPE_EGL;
-                
+
             case LINUX:
             case FREEBSD:
             case SUNOS:
@@ -158,7 +158,7 @@ public abstract class NativeWindowFactory {
     static {
         final boolean[] _DEBUG = new boolean[] { false };
         final String[] _tmp = new String[] { null };
-        
+
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 Platform.initSingleton(); // last resort ..
@@ -168,16 +168,16 @@ public abstract class NativeWindowFactory {
                     new Thread(new Runnable() {
                                 public void run() {
                                     NativeWindowFactory.shutdown(true);
-                                } }, "NativeWindowFactory_ShutdownHook" ) ) ;                        
+                                } }, "NativeWindowFactory_ShutdownHook" ) ) ;
                 return null;
             } } ) ;
-        
+
         DEBUG = _DEBUG[0];
         if(DEBUG) {
             System.err.println(Thread.currentThread().getName()+" - Info: NativeWindowFactory.<init>");
             // Thread.dumpStack();
         }
-        
+
         // Gather the windowing TK first
         nativeWindowingTypePure = _getNativeWindowingType();
         if(null==_tmp[0] || _tmp[0].length()==0) {
@@ -202,23 +202,23 @@ public abstract class NativeWindowFactory {
         }
         if( null != clazzName ) {
             ReflectionUtil.callStaticMethod(clazzName, "initSingleton", null, null, cl );
-            
+
             final Boolean res1 = (Boolean) ReflectionUtil.callStaticMethod(clazzName, "requiresToolkitLock", null, null, cl);
             requiresToolkitLock = res1.booleanValue();
             final Boolean res2 = (Boolean) ReflectionUtil.callStaticMethod(clazzName, "hasThreadingIssues", null, null, cl);
             desktopHasThreadingIssues = res2.booleanValue();
-        } else {            
+        } else {
             requiresToolkitLock = false;
             desktopHasThreadingIssues = false;
         }
     }
 
-    /** Returns true if the JVM is shutting down, otherwise false. */ 
+    /** Returns true if the JVM is shutting down, otherwise false. */
     public static final boolean isJVMShuttingDown() { return isJVMShuttingDown; }
-    
-    /** 
+
+    /**
      * Add a custom shutdown hook to be performed at JVM shutdown before shutting down NativeWindowFactory instance.
-     *  
+     *
      * @param head if true add runnable at the start, otherwise at the end
      * @param runnable runnable to be added.
      */
@@ -234,7 +234,7 @@ public abstract class NativeWindowFactory {
         }
     }
 
-    /** 
+    /**
      * Cleanup resources at JVM shutdown
      */
     public static synchronized void shutdown(boolean _isJVMShuttingDown) {
@@ -246,14 +246,14 @@ public abstract class NativeWindowFactory {
             final int cshCount = customShutdownHooks.size();
             for(int i=0; i < cshCount; i++) {
                 try {
-                    if( DEBUG ) { 
+                    if( DEBUG ) {
                         System.err.println("NativeWindowFactory.shutdown - customShutdownHook #"+(i+1)+"/"+cshCount);
                     }
                     customShutdownHooks.get(i).run();
                 } catch(Throwable t) {
                     System.err.println("NativeWindowFactory.shutdown: Catched "+t.getClass().getName()+" during customShutdownHook #"+(i+1)+"/"+cshCount);
-                    if( DEBUG ) { 
-                        t.printStackTrace(); 
+                    if( DEBUG ) {
+                        t.printStackTrace();
                     }
                 }
             }
@@ -262,7 +262,7 @@ public abstract class NativeWindowFactory {
         if(DEBUG) {
             System.err.println("NativeWindowFactory.shutdown(): Post customShutdownHook");
         }
-        
+
         if(initialized) {
             initialized = false;
             if(null != registeredFactories) {
@@ -271,14 +271,14 @@ public abstract class NativeWindowFactory {
             }
             GraphicsConfigurationFactory.shutdown();
         }
-        
+
         shutdownNativeImpl(NativeWindowFactory.class.getClassLoader()); // always re-shutdown
         // SharedResourceToolkitLock.shutdown(DEBUG); // not used yet
         if(DEBUG) {
             System.err.println(Thread.currentThread().getName()+" - NativeWindowFactory.shutdown() END JVM Shutdown "+isJVMShuttingDown);
         }
     }
-    
+
     private static void shutdownNativeImpl(final ClassLoader cl) {
         final String clazzName;
         if( TYPE_X11 == nativeWindowingTypePure ) {
@@ -292,11 +292,11 @@ public abstract class NativeWindowFactory {
         }
         if( null != clazzName ) {
             ReflectionUtil.callStaticMethod(clazzName, "shutdown", null, null, cl );
-        }        
+        }
     }
-    
+
     /** Returns true if {@link #initSingleton()} has been called w/o subsequent {@link #shutdown(boolean)}. */
-    public static synchronized boolean isInitialized() { return initialized; }    
+    public static synchronized boolean isInitialized() { return initialized; }
 
     /**
      * Static one time initialization of this factory.<br>
@@ -316,7 +316,7 @@ public abstract class NativeWindowFactory {
 
             if( Platform.AWT_AVAILABLE &&
                 ReflectionUtil.isClassAvailable("com.jogamp.nativewindow.awt.AWTGraphicsDevice", cl) ) {
-                
+
                 Method[] jawtUtilMethods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
                     public Method[] run() {
                         try {
@@ -327,7 +327,7 @@ public abstract class NativeWindowFactory {
                             jawtUtilInitMethod.setAccessible(true);
                             Method jawtUtilGetJAWTToolkitLockMethod = _jawtUtilClass.getDeclaredMethod("getJAWTToolkitLock", new Class[]{});
                             jawtUtilGetJAWTToolkitLockMethod.setAccessible(true);
-                            return new Method[] { jawtUtilInitMethod, jawtUtilIsHeadlessMethod, jawtUtilGetJAWTToolkitLockMethod }; 
+                            return new Method[] { jawtUtilInitMethod, jawtUtilIsHeadlessMethod, jawtUtilGetJAWTToolkitLockMethod };
                         } catch (Exception e) {
                             if(DEBUG) {
                                 e.printStackTrace();
@@ -340,7 +340,7 @@ public abstract class NativeWindowFactory {
                     final Method jawtUtilInitMethod = jawtUtilMethods[0];
                     final Method jawtUtilIsHeadlessMethod = jawtUtilMethods[1];
                     final Method jawtUtilGetJAWTToolkitLockMethod = jawtUtilMethods[2];
-                    
+
                     ReflectionUtil.callMethod(null, jawtUtilInitMethod);
 
                     Object resO = ReflectionUtil.callMethod(null, jawtUtilIsHeadlessMethod);
@@ -351,21 +351,21 @@ public abstract class NativeWindowFactory {
                     } else {
                         throw new RuntimeException("JAWTUtil.isHeadlessMode() didn't return a Boolean");
                     }
-                    resO = ReflectionUtil.callMethod(null, jawtUtilGetJAWTToolkitLockMethod);            
+                    resO = ReflectionUtil.callMethod(null, jawtUtilGetJAWTToolkitLockMethod);
                     if(resO instanceof ToolkitLock) {
                         jawtUtilJAWTToolkitLock = (ToolkitLock) resO;
                     } else {
                         throw new RuntimeException("JAWTUtil.getJAWTToolkitLock() didn't return a ToolkitLock");
-                    }                    
+                    }
                 }
             }
-            
+
             // X11 initialization after possible AWT initialization
             // This is performed post AWT initialization, allowing AWT to complete the same,
-            // which may have been triggered before NativeWindow initialization. 
-            // This way behavior is more uniforms across configurations (Applet/RCP, applications, ..). 
+            // which may have been triggered before NativeWindow initialization.
+            // This way behavior is more uniforms across configurations (Applet/RCP, applications, ..).
             initSingletonNativeImpl(cl);
-            
+
             registeredFactories = Collections.synchronizedMap(new HashMap<Class<?>, NativeWindowFactory>());
 
             // register our default factory -> NativeWindow
@@ -373,17 +373,17 @@ public abstract class NativeWindowFactory {
             nativeWindowClass = javax.media.nativewindow.NativeWindow.class;
             registerFactory(nativeWindowClass, factory);
             defaultFactory = factory;
-        
+
             if ( isAWTAvailable ) {
                 // register either our default factory or (if exist) the X11/AWT one -> AWT Component
                 registerFactory(ReflectionUtil.getClass(ReflectionUtil.AWTNames.ComponentClass, false, cl), factory);
             }
-            
+
             if(DEBUG) {
                 System.err.println("NativeWindowFactory requiresToolkitLock "+requiresToolkitLock+", desktopHasThreadingIssues "+desktopHasThreadingIssues);
                 System.err.println("NativeWindowFactory isAWTAvailable "+isAWTAvailable+", defaultFactory "+factory);
             }
-            
+
             GraphicsConfigurationFactory.initSingleton();
         }
     }
@@ -392,20 +392,20 @@ public abstract class NativeWindowFactory {
     public static boolean requiresToolkitLock() {
         return requiresToolkitLock;
     }
-    
+
     /** @return true if not headless, AWT Component and NativeWindow's AWT part available */
     public static boolean isAWTAvailable() { return isAWTAvailable; }
 
     /**
      * @param useCustom if false return the native value, if true return a custom value if set, otherwise fallback to the native value.
-     * @return the native window type, e.g. {@link #TYPE_X11}, which is canonical via {@link String#intern()}. 
+     * @return the native window type, e.g. {@link #TYPE_X11}, which is canonical via {@link String#intern()}.
      *        Hence {@link String#equals(Object)} and <code>==</code> produce the same result.
      */
     public static String getNativeWindowType(boolean useCustom) {
         return useCustom?nativeWindowingTypeCustom:nativeWindowingTypePure;
     }
 
-    /** Don't know if we shall add this factory here .. 
+    /** Don't know if we shall add this factory here ..
     public static AbstractGraphicsDevice createGraphicsDevice(String type, String connection, int unitID, long handle, ToolkitLock locker) {
         if(TYPE_EGL == type) {
             return new
@@ -427,13 +427,13 @@ public abstract class NativeWindowFactory {
         return defaultFactory;
     }
 
-    /** 
+    /**
      * Returns the AWT {@link ToolkitLock} (JAWT based) if {@link #isAWTAvailable}, otherwise null.
      * <p>
      * The JAWT based {@link ToolkitLock} also locks the global lock,
      * which matters if the latter is required.
-     * </p> 
-     */ 
+     * </p>
+     */
     public static ToolkitLock getAWTToolkitLock() {
         return jawtUtilJAWTToolkitLock;
     }
@@ -441,7 +441,7 @@ public abstract class NativeWindowFactory {
     public static ToolkitLock getNullToolkitLock() {
         return NativeWindowFactoryImpl.getNullToolkitLock();
     }
-    
+
     /**
      * Provides the system default {@link ToolkitLock} for the default system windowing type.
      * @see #getNativeWindowType(boolean)
@@ -486,7 +486,7 @@ public abstract class NativeWindowFactory {
         }
         return NativeWindowFactoryImpl.getNullToolkitLock();
     }
-    
+
     /**
      * @param device
      * @param screen -1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen
@@ -510,7 +510,7 @@ public abstract class NativeWindowFactory {
         }
         return new DefaultGraphicsScreen(device, screen);
     }
-    
+
     /** Returns the appropriate NativeWindowFactory to handle window
         objects of the given type. The windowClass might be {@link
         NativeWindow NativeWindow}, in which case the client has
@@ -543,7 +543,7 @@ public abstract class NativeWindowFactory {
     }
 
     /** Converts the given window object and it's
-        {@link AbstractGraphicsConfiguration AbstractGraphicsConfiguration} into a 
+        {@link AbstractGraphicsConfiguration AbstractGraphicsConfiguration} into a
         {@link NativeWindow NativeWindow} which can be operated upon by a custom
         toolkit, e.g. {@link javax.media.opengl.GLDrawableFactory javax.media.opengl.GLDrawableFactory}.<br>
         The object may be a component for a particular window toolkit, such as an AWT
@@ -554,7 +554,7 @@ public abstract class NativeWindowFactory {
         NativeWindowFactory is responsible for handling objects from a
         particular window toolkit. The built-in NativeWindowFactory
         handles NativeWindow instances as well as AWT Components.<br>
-    
+
         @throws IllegalArgumentException if the given window object
         could not be handled by any of the registered
         NativeWindowFactory instances
@@ -573,22 +573,22 @@ public abstract class NativeWindowFactory {
         NativeWindow. Implementors of concrete NativeWindowFactory
         subclasses should override this method. */
     protected abstract NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException;
-    
+
     /**
      * Returns the {@link OffscreenLayerSurface} instance of this {@link NativeSurface}.
      * <p>
-     * In case this surface is a {@link NativeWindow}, we traverse from the given surface 
+     * In case this surface is a {@link NativeWindow}, we traverse from the given surface
      * up to root until an implementation of {@link OffscreenLayerSurface} is found.
      * In case <code>ifEnabled</code> is true, the surface must also implement {@link OffscreenLayerOption}
-     * where {@link OffscreenLayerOption#isOffscreenLayerSurfaceEnabled()} is <code>true</code>.  
+     * where {@link OffscreenLayerOption#isOffscreenLayerSurfaceEnabled()} is <code>true</code>.
      * </p>
-     * 
+     *
      * @param surface The surface to query.
-     * @param ifEnabled If true, only return the enabled {@link OffscreenLayerSurface}, see {@link OffscreenLayerOption#isOffscreenLayerSurfaceEnabled()}. 
+     * @param ifEnabled If true, only return the enabled {@link OffscreenLayerSurface}, see {@link OffscreenLayerOption#isOffscreenLayerSurfaceEnabled()}.
      * @return
      */
     public static OffscreenLayerSurface getOffscreenLayerSurface(NativeSurface surface, boolean ifEnabled) {
-        if(surface instanceof OffscreenLayerSurface && 
+        if(surface instanceof OffscreenLayerSurface &&
            ( !ifEnabled || surface instanceof OffscreenLayerOption ) ) {
             final OffscreenLayerSurface ols = (OffscreenLayerSurface) surface;
             return ( !ifEnabled || ((OffscreenLayerOption)ols).isOffscreenLayerSurfaceEnabled() ) ? ols : null;
@@ -601,12 +601,12 @@ public abstract class NativeWindowFactory {
                     final OffscreenLayerSurface ols = (OffscreenLayerSurface) nw;
                     return ( !ifEnabled || ((OffscreenLayerOption)ols).isOffscreenLayerSurfaceEnabled() ) ? ols : null;
                 }
-                nw = nw.getParent();                
+                nw = nw.getParent();
             }
         }
-        return null;            
+        return null;
     }
-    
+
     /**
      * Returns true if the given visualID is valid for further processing, i.e. OpenGL usage,
      * otherwise return false.
@@ -619,8 +619,8 @@ public abstract class NativeWindowFactory {
      * </p>
      */
     public static boolean isNativeVisualIDValidForProcessing(int visualID) {
-        return NativeWindowFactory.TYPE_X11 != NativeWindowFactory.getNativeWindowType(false) || 
+        return NativeWindowFactory.TYPE_X11 != NativeWindowFactory.getNativeWindowType(false) ||
                VisualIDHolder.VID_UNDEFINED != visualID ;
     }
-        
+
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerOption.java b/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerOption.java
index 12d30b3cd..11496899a 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerOption.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerOption.java
@@ -32,30 +32,30 @@ package javax.media.nativewindow;
  * within the implementation.
  */
 public interface OffscreenLayerOption {
-    /** 
+    /**
      * Request an offscreen layer, if supported.
      * <p>
      * Shall be called before the first {@link NativeWindow#lockSurface()},
      * and hence before realization.
      * </p>
-     * 
+     *
      * @see #getShallUseOffscreenLayer()
-     * @see #isOffscreenLayerSurfaceEnabled() 
+     * @see #isOffscreenLayerSurfaceEnabled()
      */
     public void setShallUseOffscreenLayer(boolean v);
 
     /** Returns the property set by {@link #setShallUseOffscreenLayer(boolean)}. */
     public boolean getShallUseOffscreenLayer();
 
-    /** 
+    /**
      * Returns true if this instance uses an offscreen layer, otherwise false.
      * <p>
      * This instance is an offscreen layer, if {@link #setShallUseOffscreenLayer(boolean) setShallUseOffscreenLayer(true)}
      * has been called before it's realization and first lock and the underlying implementation supports it.
      * </p>
      * The return value is undefined before issuing the first {@link NativeWindow#lockSurface()}.
-     *  
-     * @see #setShallUseOffscreenLayer(boolean) 
+     *
+     * @see #setShallUseOffscreenLayer(boolean)
      */
     public boolean isOffscreenLayerSurfaceEnabled();
 }
\ No newline at end of file
diff --git a/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerSurface.java b/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerSurface.java
index 1826008ad..8681422ef 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerSurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerSurface.java
@@ -33,36 +33,36 @@ import com.jogamp.common.util.locks.RecursiveLock;
  * Interface specifying the offscreen layer surface protocol.
  */
 public interface OffscreenLayerSurface {
-  /** 
+  /**
    * Attach the offscreen layer to this offscreen layer surface.
    * <p>
    * Implementation may realize all required resources at this point.
    * </p>
-   * 
+   *
    * @see #isOffscreenLayerSurfaceEnabled()
    * @throws NativeWindowException if {@link #isOffscreenLayerSurfaceEnabled()} == false
    */
   public void attachSurfaceLayer(final long layerHandle) throws NativeWindowException;
-  
-  /** 
+
+  /**
    * Detaches a previously attached offscreen layer from this offscreen layer surface.
    * @see #attachSurfaceLayer(long)
    * @see #isOffscreenLayerSurfaceEnabled()
-   * @throws NativeWindowException if {@link #isOffscreenLayerSurfaceEnabled()} == false 
+   * @throws NativeWindowException if {@link #isOffscreenLayerSurfaceEnabled()} == false
    *                               or no surface layer is attached.
    */
   public void detachSurfaceLayer() throws NativeWindowException;
-  
+
   /** Returns the attached surface layer or null if none is attached. */
   public long getAttachedSurfaceLayer();
-  
+
   /** Returns true if a surface layer is attached, otherwise false. */
   public boolean isSurfaceLayerAttached();
-  
+
   /** Sets the capabilities of this instance, allowing upstream API's to refine it, i.e. OpenGL related settings. */
   public void setChosenCapabilities(CapabilitiesImmutable caps);
-  
-  /** Returns the recursive lock object of this surface, which synchronizes multithreaded access. */ 
+
+  /** Returns the recursive lock object of this surface, which synchronizes multithreaded access. */
   public RecursiveLock getLock();
-  
+
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
index 15a8738c5..eb0a6cf04 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
@@ -33,44 +33,44 @@ import jogamp.nativewindow.Debug;
 /**
  * Provides a mutable {@link NativeSurface}, i.e. {@link MutableSurface}, while allowing an
  * {@link UpstreamSurfaceHook} to influence the lifecycle and information.
- * 
+ *
  * @see UpstreamSurfaceHook
  * @see MutableSurface
  * @see NativeSurface
  */
-public interface ProxySurface extends MutableSurface {    
+public interface ProxySurface extends MutableSurface {
     public static final boolean DEBUG = Debug.debug("ProxySurface");
-    
-    /** 
+
+    /**
      * Implementation specific bit-value stating this {@link ProxySurface} owns the upstream's surface handle
      * @see #addUpstreamOptionBits(int)
      * @see #clearUpstreamOptionBits(int)
      * @see #getUpstreamOptionBits()
-     */ 
+     */
     public static final int OPT_PROXY_OWNS_UPSTREAM_SURFACE = 1 << 6;
-    
-    /** 
+
+    /**
      * Implementation specific bit-value stating this {@link ProxySurface} owns the upstream's {@link AbstractGraphicsDevice}.
      * @see #addUpstreamOptionBits(int)
      * @see #clearUpstreamOptionBits(int)
      * @see #getUpstreamOptionBits()
-     */ 
+     */
     public static final int OPT_PROXY_OWNS_UPSTREAM_DEVICE = 1 << 7;
-    
-    /** 
+
+    /**
      * Implementation specific bitvalue stating the upstream's {@link NativeSurface} is an invisible window, i.e. maybe incomplete.
      * @see #addUpstreamOptionBits(int)
      * @see #clearUpstreamOptionBits(int)
      * @see #getUpstreamOptionBits()
-     */ 
+     */
     public static final int OPT_UPSTREAM_WINDOW_INVISIBLE = 1 << 8;
 
     /** Allow redefining the AbstractGraphicsConfiguration */
-    public void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg);    
+    public void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg);
 
     /**
      * Return the upstream {@link NativeSurface} if used, otherwise <code>null</code>.
-     * <p> 
+     * <p>
      * An upstream {@link NativeSurface} may backup this {@link ProxySurface} instance's representation,
      * e.g. via a {@link #setUpstreamSurfaceHook(UpstreamSurfaceHook) set} {@link UpstreamSurfaceHook}.
      * </p>
@@ -80,47 +80,47 @@ public interface ProxySurface extends MutableSurface {
      * </p>
      */
     public NativeSurface getUpstreamSurface();
-    
+
     /** Returns the {@link UpstreamSurfaceHook} if {@link #setUpstreamSurfaceHook(UpstreamSurfaceHook) set}, otherwise <code>null</code>. */
     public UpstreamSurfaceHook getUpstreamSurfaceHook();
-    
+
     /**
      * Sets the {@link UpstreamSurfaceHook} and returns the previous value.
      */
     public void setUpstreamSurfaceHook(UpstreamSurfaceHook hook);
-    
-    /** 
-     * Enables or disables the {@link UpstreamSurfaceHook} lifecycle functions 
+
+    /**
+     * Enables or disables the {@link UpstreamSurfaceHook} lifecycle functions
      * {@link UpstreamSurfaceHook#create(ProxySurface)} and {@link UpstreamSurfaceHook#destroy(ProxySurface)}.
      * <p>
      * Use this for small code blocks where the native resources shall not change,
      * i.e. resizing a derived (OpenGL) drawable.
-     * </p> 
+     * </p>
      */
     public void enableUpstreamSurfaceHookLifecycle(boolean enable);
-    
-    /** 
+
+    /**
      * {@link UpstreamSurfaceHook#create(ProxySurface)} is being issued and the proxy surface/window handles shall be set.
-     */ 
+     */
     public void createNotify();
-    
-    /** 
+
+    /**
      * {@link UpstreamSurfaceHook#destroy(ProxySurface)} is being issued and all proxy surface/window handles shall be cleared.
-     */ 
+     */
     public void destroyNotify();
-    
+
     public StringBuilder getUpstreamOptionBits(StringBuilder sink);
     public int getUpstreamOptionBits();
-    
+
     /** Returns <code>true</code> if the give bit-mask <code>v</code> is set in this instance upstream-option-bits, otherwise <code>false</code>.*/
     public boolean containsUpstreamOptionBits(int v);
-    
+
     /** Add the given bit-mask to this instance upstream-option-bits using bit-or w/ <code>v</code>.*/
     public void addUpstreamOptionBits(int v);
-    
+
     /** Clear the given bit-mask from this instance upstream-option-bits using bit-and w/ <code>~v</code>*/
     public void clearUpstreamOptionBits(int v);
-    
+
     public StringBuilder toString(StringBuilder sink);
     public String toString();
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/SurfaceUpdatedListener.java b/src/nativewindow/classes/javax/media/nativewindow/SurfaceUpdatedListener.java
index 0912b5afe..de65a3031 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/SurfaceUpdatedListener.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/SurfaceUpdatedListener.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package javax.media.nativewindow;
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java b/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
index eccfcfa4f..017b996d7 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
@@ -53,26 +53,26 @@ public interface ToolkitLock {
      * @throws RuntimeException in case of a timeout
      */
     public void lock();
-    
+
     /**
      * Release the lock.
      *
      * @throws RuntimeException in case the lock is not acquired by this thread.
      */
     public void unlock();
-    
+
     /**
-     * @throws RuntimeException if current thread does not hold the lock 
+     * @throws RuntimeException if current thread does not hold the lock
      */
     public void validateLocked() throws RuntimeException;
-    
-    /** 
+
+    /**
      * Dispose this instance.
-     * <p> 
+     * <p>
      * Shall be called when instance is no more required.
      * </p>
      * This allows implementations sharing a lock via resources
-     * to decrease the reference counter.  
+     * to decrease the reference counter.
      */
     public void dispose();
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java b/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java
index 6fe2e5364..f08a6c938 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java
@@ -28,24 +28,24 @@
 
 package javax.media.nativewindow;
 
-/** 
- * Interface allowing upstream caller to pass lifecycle actions and size info 
- * to a {@link ProxySurface} instance. 
- */ 
+/**
+ * Interface allowing upstream caller to pass lifecycle actions and size info
+ * to a {@link ProxySurface} instance.
+ */
 public interface UpstreamSurfaceHook {
     /** called within {@link ProxySurface#createNotify()} within lock, before using surface. */
     public void create(ProxySurface s);
     /** called within {@link ProxySurface#destroyNotify()} within lock, before clearing fields. */
     public void destroy(ProxySurface s);
 
-    /** Returns the width of the upstream surface, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */ 
+    /** Returns the width of the upstream surface, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */
     public int getWidth(ProxySurface s);
-    /** Returns the height of the upstream surface, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */ 
+    /** Returns the height of the upstream surface, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */
     public int getHeight(ProxySurface s);
-    
+
     /**
-     * {@link UpstreamSurfaceHook} w/ mutable size, allowing it's {@link ProxySurface} user to resize.  
-     */ 
+     * {@link UpstreamSurfaceHook} w/ mutable size, allowing it's {@link ProxySurface} user to resize.
+     */
     public interface MutableSize extends UpstreamSurfaceHook {
         public void setSize(int width, int height);
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
index 4f3d3ff00..4ee71ee79 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
@@ -38,7 +38,7 @@ import java.util.Comparator;
  * </p>
  */
 public interface VisualIDHolder {
-    
+
     public enum VIDType {
         // Generic Values
         INTRINSIC(0), NATIVE(1),
@@ -47,19 +47,19 @@ public interface VisualIDHolder {
         // X11 Values
         X11_XVISUAL(20), X11_FBCONFIG(21),
         // Windows Values
-        WIN32_PFD(30); 
-        
+        WIN32_PFD(30);
+
         public final int id;
 
         VIDType(int id){
             this.id = id;
         }
-    }    
-    
+    }
+
     /**
      * Returns the native visual ID of the given <code>type</code>
      * if supported, or {@link #VID_UNDEFINED} if not supported.
-     * <p> 
+     * <p>
      * Depending on the native windowing system, <code>type</code> is handled as follows:
      * <ul>
      *   <li>X11 throws NativeWindowException on <code>EGL_CONFIG</code>, <code>WIN32_PFD</code>
@@ -76,7 +76,7 @@ public interface VisualIDHolder {
      *       <li><code>X11_XVISUAL</code>: <i>X11 XVisual ID</i></li>
      *       <li><code>X11_FBCONFIG</code>: <i>X11 FBConfig ID</i> or <code>VID_UNDEFINED</code></li>
      *     </ul></li>
-     *   <li>Windows/GL throws NativeWindowException on <code>EGL_CONFIG</code>, <code>X11_XVISUAL</code>, <code>X11_FBCONFIG</code> 
+     *   <li>Windows/GL throws NativeWindowException on <code>EGL_CONFIG</code>, <code>X11_XVISUAL</code>, <code>X11_FBCONFIG</code>
      *     <ul>
      *       <li><code>INTRINSIC</code>: <i>Win32 PIXELFORMATDESCRIPTOR ID</i></li>
      *       <li><code>NATIVE</code>: <i>Win32 PIXELFORMATDESCRIPTOR ID</i></li>
@@ -91,35 +91,35 @@ public interface VisualIDHolder {
      * </ul>
      * </p>
      * Note: <code>INTRINSIC</code> and <code>NATIVE</code> are always handled,
-     *       but may result in {@link #VID_UNDEFINED}. The latter is true if 
-     *       the native value are actually undefined or the corresponding object is not 
+     *       but may result in {@link #VID_UNDEFINED}. The latter is true if
+     *       the native value are actually undefined or the corresponding object is not
      *       mapped to a native visual object.
-     *       
+     *
      * @throws NativeWindowException if <code>type</code> is neither
      *         <code>INTRINSIC</code> nor <code>NATIVE</code>
-     *         and does not match the native implementation. 
+     *         and does not match the native implementation.
      */
     int getVisualID(VIDType type) throws NativeWindowException ;
-    
-    /** 
+
+    /**
      * {@link #getVisualID(VIDType)} result indicating an undefined value,
      * which could be cause by an unsupported query.
      * <p>
      * We assume the const value <code>0</code> doesn't reflect a valid native visual ID
      * and is interpreted as <i>no value</i> on all platforms.
      * This is currently true for Android, X11 and Windows.
-     * </p> 
+     * </p>
      */
     static final int VID_UNDEFINED = 0;
-    
+
     /** Comparing {@link VIDType#NATIVE} */
     public static class VIDComparator implements Comparator<VisualIDHolder> {
         private VIDType type;
-        
+
         public VIDComparator(VIDType type) {
             this.type = type;
         }
-        
+
         public int compare(VisualIDHolder vid1, VisualIDHolder vid2) {
             final int id1 = vid1.getVisualID(type);
             final int id2 = vid2.getVisualID(type);
@@ -131,5 +131,5 @@ public interface VisualIDHolder {
             }
             return 0;
         }
-    }    
+    }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java b/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java
index 02f68f442..8570b78da 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java
@@ -37,7 +37,7 @@ package javax.media.nativewindow;
  * this protocol default behavior {@link WindowClosingMode#DISPOSE_ON_CLOSE DISPOSE_ON_CLOSE} shall be used.</p>
  */
 public interface WindowClosingProtocol {
-    
+
     /**
      * Window closing mode if triggered by toolkit close operation.
      */
@@ -47,7 +47,7 @@ public interface WindowClosingProtocol {
          * This is the default behavior within an AWT environment.
          */
         DO_NOTHING_ON_CLOSE,
-        
+
         /**
          * Dispose resources on native window close operation.<br>
          * This is the default behavior in case no underlying toolkit defines otherwise.
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
index 17b4930c5..b8b48a46c 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
@@ -4,14 +4,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -21,12 +21,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package javax.media.nativewindow.util;
 
 public class Dimension implements Cloneable, DimensionImmutable {
@@ -48,7 +48,7 @@ public class Dimension implements Cloneable, DimensionImmutable {
     public Object cloneMutable() {
       return clone();
     }
-  
+
     public Object clone() {
         try {
             return super.clone();
@@ -92,7 +92,7 @@ public class Dimension implements Cloneable, DimensionImmutable {
     public int compareTo(final DimensionImmutable d) {
         final int tsq = width*height;
         final int xsq = d.getWidth()*d.getHeight();
-        
+
         if(tsq > xsq) {
             return 1;
         } else if(tsq < xsq) {
@@ -100,13 +100,13 @@ public class Dimension implements Cloneable, DimensionImmutable {
         }
         return 0;
     }
-    
+
     @Override
     public boolean equals(Object obj) {
         if(this == obj)  { return true; }
         if (obj instanceof Dimension) {
             Dimension p = (Dimension)obj;
-            return height == p.height && 
+            return height == p.height &&
                    width == p.width ;
         }
         return false;
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java
index 22bd3f48b..9caa433a6 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java
@@ -46,12 +46,12 @@ public interface DimensionImmutable extends WriteCloneable, Comparable<Dimension
     /**
      * <p>
      * Compares square of size.
-     * </p> 
+     * </p>
      * {@inheritDoc}
      */
     @Override
     public int compareTo(final DimensionImmutable d);
-    
+
     /**
      * Checks whether two dimensions objects are equal. Two instances
      * of <code>DimensionReadOnly</code> are equal if two components
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
index 942c12c2b..dbd997c60 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,18 +20,18 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package javax.media.nativewindow.util;
 
 public class Insets implements Cloneable, InsetsImmutable {
     static final InsetsImmutable zeroInsets = new Insets();
     public static final InsetsImmutable getZero() { return zeroInsets; }
-    
+
     int l, r, t, b;
 
     public Insets() {
@@ -44,11 +44,11 @@ public class Insets implements Cloneable, InsetsImmutable {
         this.t=top;
         this.b=bottom;
     }
-    
+
     public Object cloneMutable() {
       return clone();
     }
-  
+
     protected Object clone() {
         try {
             return super.clone();
@@ -77,7 +77,7 @@ public class Insets implements Cloneable, InsetsImmutable {
     public final void setRightWidth(int right) { r = right; }
     public final void setTopHeight(int top) { t = top; }
     public final void setBottomHeight(int bottom) { b = bottom; }
-    
+
     @Override
     public boolean equals(Object obj) {
         if(this == obj)  { return true; }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
index 075641ede..0f99a7861 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
@@ -41,13 +41,13 @@ public interface InsetsImmutable extends WriteCloneable {
 
     /** @return total width, ie. <code>left_width + right_width</code> */
     int getTotalWidth();
-    
+
     /** @return top inset height */
     int getTopHeight();
 
     /** @return bottom inset height */
     int getBottomHeight();
-    
+
     /** @return total height, ie. <code>top_height + bottom_height</code> */
     int getTotalHeight();
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
index 4c233bb16..aba515d52 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
@@ -45,7 +45,7 @@ public class Point implements Cloneable, PointImmutable {
     public Object cloneMutable() {
       return clone();
     }
-  
+
     public Object clone() {
         try {
             return super.clone();
@@ -58,7 +58,7 @@ public class Point implements Cloneable, PointImmutable {
     public int compareTo(final PointImmutable d) {
         final int sq = x*y;
         final int xsq = d.getX()*d.getY();
-        
+
         if(sq > xsq) {
             return 1;
         } else if(sq < xsq) {
@@ -66,7 +66,7 @@ public class Point implements Cloneable, PointImmutable {
         }
         return 0;
     }
-    
+
     @Override
     public boolean equals(Object obj) {
         if(this == obj)  { return true; }
@@ -120,5 +120,5 @@ public class Point implements Cloneable, PointImmutable {
         y *= sy ;
         return this;
     }
-    
+
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java
index b00329bb5..f5377e059 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java
@@ -41,12 +41,12 @@ public interface PointImmutable extends WriteCloneable, Comparable<PointImmutabl
     /**
      * <p>
      * Compares the square of the position.
-     * </p> 
+     * </p>
      * {@inheritDoc}
      */
     @Override
     public int compareTo(final PointImmutable d);
-    
+
     /**
      * Checks whether two points objects are equal. Two instances
      * of <code>PointReadOnly</code> are equal if the two components
@@ -57,5 +57,5 @@ public interface PointImmutable extends WriteCloneable, Comparable<PointImmutabl
     public boolean equals(Object obj);
 
     public int hashCode();
-    
+
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
index bbbfa2932..3a51fb67d 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package javax.media.nativewindow.util;
 
 import java.util.List;
@@ -46,11 +46,11 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         this.width=width;
         this.height=height;
     }
-    
+
     public Object cloneMutable() {
       return clone();
     }
-  
+
     protected Object clone() {
         try {
             return super.clone();
@@ -67,7 +67,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
     public final int getWidth() { return width; }
     @Override
     public final int getHeight() { return height; }
-    
+
     public final void set(int x, int y, int width, int height) {
         this.x = x;
         this.y = y;
@@ -89,7 +89,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         final int y1 = Math.min(y, ry1);
         final int x2 = Math.max(x + width, rx2);
         final int y2 = Math.max(y + height, ry2);
-        return new Rectangle(x1, y1, x2 - x1, y2 - y1);                
+        return new Rectangle(x1, y1, x2 - x1, y2 - y1);
     }
     /**
      * Calculates the union of the given rectangles, stores it in this instance and returns this instance.
@@ -109,7 +109,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         set(x1, y1, x2 - x1, y2 - y1);
         return this;
     }
-        
+
     @Override
     public final RectangleImmutable intersection(RectangleImmutable r) {
         return intersection(r.getX(), r.getY(), r.getX() + r.getWidth(), r.getY() + r.getHeight());
@@ -144,13 +144,13 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         final float sqT = (float) ( width*height );
         return sqI / sqT;
     }
-    
+
     @Override
     public int compareTo(final RectangleImmutable d) {
         {
             final int sq = width*height;
             final int xsq = d.getWidth()*d.getHeight();
-            
+
             if(sq > xsq) {
                 return 1;
             } else if(sq < xsq) {
@@ -160,7 +160,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         {
             final int sq = x*y;
             final int xsq = d.getX()*d.getY();
-            
+
             if(sq > xsq) {
                 return 1;
             } else if(sq < xsq) {
@@ -169,7 +169,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         }
         return 0;
     }
-    
+
     @Override
     public boolean equals(Object obj) {
         if(this == obj)  { return true; }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java
index 440d9e000..ce735f53f 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java
@@ -49,7 +49,7 @@ public interface RectangleImmutable extends WriteCloneable, Comparable<Rectangle
     RectangleImmutable intersection(RectangleImmutable r);
     /** Returns the intersection of this rectangleand the given coordinates. */
     RectangleImmutable intersection(final int rx1, final int ry1, final int rx2, final int ry2);
-    /** 
+    /**
      * Returns the coverage of given rectangle w/ this this one, i.e. between <code>0.0</code> and <code>1.0</code>.
      * <p>
      * Coverage is computed by:
@@ -57,19 +57,19 @@ public interface RectangleImmutable extends WriteCloneable, Comparable<Rectangle
      *    isect = this.intersection(r);
      *    coverage = area( isect ) / area( this ) ;
      * </pre>
-     * </p> 
+     * </p>
      */
     float coverage(RectangleImmutable r);
-    
+
     /**
      * <p>
      * Compares square of size 1st, if equal the square of position.
-     * </p> 
+     * </p>
      * {@inheritDoc}
      */
     @Override
     public int compareTo(final RectangleImmutable d);
-    
+
     /**
      * Checks whether two rect objects are equal. Two instances
      * of <code>Rectangle</code> are equal if the four integer values
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
index 3084816a5..917f7e230 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
@@ -4,14 +4,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -21,15 +21,15 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package javax.media.nativewindow.util;
 
-/** 
+/**
  * Immutable SurfaceSize Class, consisting of it's read only components:<br>
  * <ul>
  *  <li>{@link javax.media.nativewindow.util.DimensionImmutable} size in pixels</li>
@@ -63,7 +63,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
     /**
      * <p>
      * Compares {@link DimensionImmutable#compareTo(DimensionImmutable) resolution} 1st, if equal the bitsPerPixel.
-     * </p> 
+     * </p>
      * {@inheritDoc}
      */
     @Override
@@ -72,7 +72,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
         if( 0 != rres ) {
             return rres;
         }
-        final int xbpp = ssz.getBitsPerPixel(); 
+        final int xbpp = ssz.getBitsPerPixel();
         if(bitsPerPixel > xbpp) {
             return 1;
         } else if(bitsPerPixel < xbpp) {
@@ -80,7 +80,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
         }
         return 0;
     }
-    
+
     /**
      * Checks whether two size objects are equal. Two instances
      * of <code>SurfaceSize</code> are equal if the two components
diff --git a/src/nativewindow/classes/jogamp/nativewindow/Debug.java b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
index c5e316364..a7bf536ec 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/Debug.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -51,7 +51,7 @@ public class Debug extends PropertyAccess {
   // Some common properties
   private static final boolean verbose;
   private static final boolean debugAll;
-  
+
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
         public Object run() {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
index 52e9c8308..b3b5d2131 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
diff --git a/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java
index c9f830811..5fdbbf697 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java
@@ -36,20 +36,20 @@ import com.jogamp.common.util.locks.RecursiveLock;
 /**
  * Implementing a global recursive {@link javax.media.nativewindow.ToolkitLock}.
  * <p>
- * This is the last resort for unstable driver where multiple X11 display connections 
+ * This is the last resort for unstable driver where multiple X11 display connections
  * to the same connection name are not treated thread safe within the GL/X11 driver.
  * </p>
  */
 public class GlobalToolkitLock implements ToolkitLock {
     private static final RecursiveLock globalLock = LockFactory.createRecursiveLock();
     private static GlobalToolkitLock singleton = new GlobalToolkitLock();
-    
+
     public static final GlobalToolkitLock getSingleton() {
         return singleton;
     }
-    
+
     private GlobalToolkitLock() { }
-    
+
     @Override
     public final void lock() {
         globalLock.lock();
@@ -61,17 +61,17 @@ public class GlobalToolkitLock implements ToolkitLock {
         if(TRACE_LOCK) { System.err.println("GlobalToolkitLock.unlock()"); }
         globalLock.unlock(); // implicit lock validation
     }
-    
+
     @Override
     public final void validateLocked() throws RuntimeException {
         globalLock.validateLocked();
     }
-    
+
     @Override
     public final void dispose() {
         // nop
     }
-    
+
     public String toString() {
         return "GlobalToolkitLock[obj 0x"+Integer.toHexString(hashCode())+", isOwner "+globalLock.isOwner(Thread.currentThread())+", "+globalLock.toString()+"]";
     }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
index 1a106b1b9..36a25acfb 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 
 package jogamp.nativewindow;
 
@@ -36,7 +36,7 @@ import com.jogamp.common.jvm.JNILibLoaderBase;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.cache.TempJarCache;
 
-public class NWJNILibLoader extends JNILibLoaderBase {  
+public class NWJNILibLoader extends JNILibLoaderBase {
     public static boolean loadNativeWindow(final String ossuffix) {
         return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
             public Boolean run() {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
index a3a66b7f1..e3f6ab5ca 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -48,7 +48,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
     public static ToolkitLock getNullToolkitLock() {
         return nullToolkitLock;
     }
-    
+
     // This subclass of NativeWindowFactory handles the case of
     // NativeWindows being passed in
     protected NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException {
@@ -69,7 +69,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
                                            winObj.getClass().getName() + " is unsupported; expected " +
                                            "javax.media.nativewindow.NativeWindow or "+AWTNames.ComponentClass);
     }
-    
+
     private Constructor<?> nativeWindowConstructor = null;
 
     private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) {
@@ -93,7 +93,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
                 }
 
                 nativeWindowConstructor = ReflectionUtil.getConstructor(
-                                            windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class }, 
+                                            windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class },
                                             getClass().getClassLoader());
             } catch (Exception e) {
                 throw new IllegalArgumentException(e);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
index 5fc5fe376..d8ce98acb 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
@@ -38,7 +38,7 @@ import javax.media.nativewindow.ToolkitLock;
 public class NullToolkitLock implements ToolkitLock {
     /** Singleton via {@link NativeWindowFactoryImpl#getNullToolkitLock()} */
     protected NullToolkitLock() { }
-    
+
     @Override
     public final void lock() {
         if(TRACE_LOCK) {
@@ -51,21 +51,21 @@ public class NullToolkitLock implements ToolkitLock {
     public final void unlock() {
         if(TRACE_LOCK) { System.err.println("NullToolkitLock.unlock()"); }
     }
-    
+
     @Override
     public final void validateLocked() throws RuntimeException {
         if( NativeWindowFactory.requiresToolkitLock() ) {
             throw new RuntimeException("NullToolkitLock does not lock, but locking is required.");
         }
     }
-    
+
     @Override
     public final void dispose() {
         // nop
     }
-    
+
     public String toString() {
         return "NullToolkitLock[]";
     }
-    
+
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
index 56e342793..8a1048c6f 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
@@ -40,7 +40,7 @@ import javax.media.nativewindow.UpstreamSurfaceHook;
 import com.jogamp.common.util.locks.LockFactory;
 import com.jogamp.common.util.locks.RecursiveLock;
 
-public abstract class ProxySurfaceImpl implements ProxySurface {    
+public abstract class ProxySurfaceImpl implements ProxySurface {
     private final SurfaceUpdatedHelper surfaceUpdatedHelper = new SurfaceUpdatedHelper();
     private AbstractGraphicsConfiguration config; // control access due to delegation
     private UpstreamSurfaceHook upstream;
@@ -70,15 +70,15 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
         this.upstreamSurfaceHookLifecycleEnabled = true;
         if(ownsDevice) {
             addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
-        }        
+        }
     }
 
     @Override
     public NativeSurface getUpstreamSurface() { return null; }
-    
+
     @Override
     public final UpstreamSurfaceHook getUpstreamSurfaceHook() { return upstream; }
-            
+
     @Override
     public void setUpstreamSurfaceHook(UpstreamSurfaceHook hook) {
         if(null == hook) {
@@ -86,14 +86,14 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
         }
         upstream = hook;
     }
-        
+
     @Override
     public final void enableUpstreamSurfaceHookLifecycle(boolean enable) {
         upstreamSurfaceHookLifecycleEnabled = enable;
     }
-    
+
     @Override
-    public void createNotify() {        
+    public void createNotify() {
         if(upstreamSurfaceHookLifecycleEnabled) {
             upstream.create(this);
         }
@@ -113,15 +113,15 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
         }
         this.surfaceHandle_old = 0;
     }
-    
-    /** 
+
+    /**
      * Must be overridden by implementations allowing having a {@link UpstreamSurfaceHook} being passed.
-     * @see #destroyNotify() 
+     * @see #destroyNotify()
      */
     protected void invalidateImpl() {
-        throw new InternalError("UpstreamSurfaceHook given, but required method not implemented.");        
+        throw new InternalError("UpstreamSurfaceHook given, but required method not implemented.");
     }
-    
+
     protected final AbstractGraphicsConfiguration getPrivateGraphicsConfiguration() {
         return config;
     }
@@ -140,7 +140,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
     public final void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg) {
         config = cfg;
     }
-    
+
     @Override
     public final int getScreenIndex() {
         return getGraphicsConfiguration().getScreen().getIndex();
@@ -151,7 +151,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
 
     @Override
     public abstract void setSurfaceHandle(long surfaceHandle);
-    
+
     @Override
     public final int getWidth() {
         return upstream.getWidth(this);
@@ -252,7 +252,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
     public final Thread getSurfaceLockOwner() {
         return surfaceLock.getOwner();
     }
-    
+
     public final StringBuilder getUpstreamOptionBits(StringBuilder sink) {
         if(null == sink) {
             sink = new StringBuilder();
@@ -284,21 +284,21 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
         sink.append(" ]");
         return sink;
     }
-    
+
     @Override
     public final int getUpstreamOptionBits() { return implBitfield; }
-    
+
     @Override
     public final boolean containsUpstreamOptionBits(int v) {
         return v == ( implBitfield & v ) ;
     }
-    
+
     @Override
     public final void addUpstreamOptionBits(int v) { implBitfield |= v; }
-    
+
     @Override
     public final void clearUpstreamOptionBits(int v) { implBitfield &= ~v; }
-    
+
     @Override
     public StringBuilder toString(StringBuilder sink) {
         if(null == sink) {
@@ -315,7 +315,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
         // append("\n, upstreamSurface "+getUpstreamSurface());
         return sink;
     }
-    
+
     @Override
     public String toString() {
         StringBuilder msg = new StringBuilder();
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java
index 5b79de0b8..51dd58543 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java
@@ -50,7 +50,7 @@ public class ResourceToolkitLock implements ToolkitLock {
     private ResourceToolkitLock() {
         this.lock = LockFactory.createRecursiveLock();
     }
-    
+
     @Override
     public final void lock() {
         lock.lock();
@@ -62,17 +62,17 @@ public class ResourceToolkitLock implements ToolkitLock {
         if(TRACE_LOCK) { System.err.println("ResourceToolkitLock.unlock()"); }
         lock.unlock(); // implicit lock validation
     }
-    
+
     @Override
     public final void validateLocked() throws RuntimeException {
         lock.validateLocked();
     }
-    
+
     @Override
     public final void dispose() {
         // nop
     }
-    
+
     public String toString() {
         return "ResourceToolkitLock[obj 0x"+Integer.toHexString(hashCode())+", isOwner "+lock.isOwner(Thread.currentThread())+", "+lock.toString()+"]";
     }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
index 94d12e6fc..e20d3d138 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
@@ -54,8 +54,8 @@ public class SharedResourceToolkitLock implements ToolkitLock {
         handle2Lock = new LongObjectHashMap();
         handle2Lock.setKeyNotFoundValue(null);
     }
-    
-    /** 
+
+    /**
      * @return number of unclosed EGL Displays.<br>
      */
     public static int shutdown(boolean verbose) {
@@ -70,7 +70,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
         }
         return handle2Lock.size();
     }
-    
+
     public static void dumpOpenDisplayConnections() {
         System.err.println("SharedResourceToolkitLock: Open ResourceToolkitLock's: "+handle2Lock.size());
         int i=0;
@@ -79,7 +79,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
             System.err.println("SharedResourceToolkitLock: Open["+i+"]: "+e.value);
         }
     }
-    
+
     public static final SharedResourceToolkitLock get(long handle) {
         SharedResourceToolkitLock res;
         synchronized(handle2Lock) {
@@ -106,8 +106,8 @@ public class SharedResourceToolkitLock implements ToolkitLock {
         this.handle = handle;
         this.refCount = 0;
     }
-    
-    
+
+
     @Override
     public final void lock() {
         lock.lock();
@@ -119,12 +119,12 @@ public class SharedResourceToolkitLock implements ToolkitLock {
         if(TRACE_LOCK) { System.err.println("SharedResourceToolkitLock.unlock()"); }
         lock.unlock();
     }
-    
+
     @Override
     public final void validateLocked() throws RuntimeException {
         lock.validateLocked();
     }
-    
+
     @Override
     public final void dispose() {
         if(0 < refCount) { // volatile OK
@@ -141,7 +141,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
             if(DEBUG || TRACE_LOCK) { System.err.println("SharedResourceToolkitLock.dispose() * NULL  *: "+this); }
         }
     }
-    
+
     public String toString() {
         return "SharedResourceToolkitLock[refCount "+refCount+", handle 0x"+Long.toHexString(handle)+", obj 0x"+Integer.toHexString(hashCode())+", isOwner "+lock.isOwner(Thread.currentThread())+", "+lock.toString()+"]";
     }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
index 4f68c6945..d11e240fa 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -39,27 +39,27 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
 
     //
     // Management Utils
-    // 
+    //
     public int size() { return surfaceUpdatedListeners.size(); }
     public SurfaceUpdatedListener get(int i) { return surfaceUpdatedListeners.get(i); }
-    
+
     //
     // Implementation of NativeSurface SurfaceUpdatedListener methods
-    // 
-    
+    //
+
     public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
         addSurfaceUpdatedListener(-1, l);
     }
 
-    public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) 
+    public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l)
         throws IndexOutOfBoundsException
     {
         if(l == null) {
             return;
         }
         synchronized(surfaceUpdatedListenersLock) {
-            if(0>index) { 
-                index = surfaceUpdatedListeners.size(); 
+            if(0>index) {
+                index = surfaceUpdatedListeners.size();
             }
             surfaceUpdatedListeners.add(index, l);
         }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ToolkitProperties.java b/src/nativewindow/classes/jogamp/nativewindow/ToolkitProperties.java
index ed23def8f..47b3e63fa 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ToolkitProperties.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ToolkitProperties.java
@@ -8,14 +8,14 @@ import javax.media.nativewindow.NativeWindowFactory;
  * Implementation requires to provide static methods:
  * <pre>
     public static void initSingleton() {}
-    
+
     public static void shutdown() {}
-    
+
     public static boolean requiresToolkitLock() {}
-    
+
     public static boolean hasThreadingIssues() {}
  * </pre>
- * Above static methods are invoked by {@link NativeWindowFactory#initSingleton()}, 
+ * Above static methods are invoked by {@link NativeWindowFactory#initSingleton()},
  * or {@link NativeWindowFactory#shutdown()} via reflection.
  * </p>
  */
@@ -25,23 +25,23 @@ public interface ToolkitProperties {
      * Called by {@link NativeWindowFactory#initSingleton()}
      */
     // void initSingleton();
-    
-    /** 
+
+    /**
      * Cleanup resources.
      * <p>
      * Called by {@link NativeWindowFactory#shutdown()}
      * </p>
      */
     // void shutdown();
-    
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      */
     // boolean requiresToolkitLock();
-    
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      */
-    // boolean hasThreadingIssues();    
-    
+    // boolean hasThreadingIssues();
+
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
index c94f249a1..f622db8cc 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
@@ -37,7 +37,7 @@ import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize;
 
 /**
  * Generic Surface implementation which wraps an existing window handle.
- * 
+ *
  * @see ProxySurface
  */
 public class WrappedSurface extends ProxySurfaceImpl {
@@ -46,7 +46,7 @@ public class WrappedSurface extends ProxySurfaceImpl {
   /**
    * Utilizes a {@link UpstreamSurfaceHook.MutableSize} to hold the size information,
    * which is being passed to the {@link ProxySurface} instance.
-   * 
+   *
    * @param cfg the {@link AbstractGraphicsConfiguration} to be used
    * @param handle the wrapped pre-existing native surface handle, maybe 0 if not yet determined
    * @param initialWidth
@@ -59,7 +59,7 @@ public class WrappedSurface extends ProxySurfaceImpl {
       super(cfg, new UpstreamSurfaceHookMutableSize(initialWidth, initialHeight), ownsDevice);
       surfaceHandle=handle;
   }
-  
+
   /**
    * @param cfg the {@link AbstractGraphicsConfiguration} to be used
    * @param handle the wrapped pre-existing native surface handle, maybe 0 if not yet determined
@@ -74,7 +74,7 @@ public class WrappedSurface extends ProxySurfaceImpl {
   }
 
   @Override
-  protected void invalidateImpl() {    
+  protected void invalidateImpl() {
     surfaceHandle = 0;
   }
 
@@ -87,7 +87,7 @@ public class WrappedSurface extends ProxySurfaceImpl {
   public final void setSurfaceHandle(long surfaceHandle) {
     this.surfaceHandle=surfaceHandle;
   }
-  
+
   @Override
   protected final int lockSurfaceImpl() {
     return LOCK_SUCCESS;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
index 23c48d20e..0fa5006cc 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
@@ -71,19 +71,19 @@ public class AWTMisc {
         }
         return (Container) c;
     }
-    
+
     /**
      * Return insets of the component w/o traversing up to parent,
      * i.e. trying Window and JComponent.
      * <p>
-     * Exception is JRootPane. 
+     * Exception is JRootPane.
      * Return it's parent's Window component's insets if available,
      * otherwise return JRootPane's insets.<br>
-     * This is due to <i>experience</i> that <i>some</i> JRootPane's 
+     * This is due to <i>experience</i> that <i>some</i> JRootPane's
      * do not expose valid insets value.
      * </p>
      * @param topLevelOnly if true only returns insets of top-level components, i.e. Window and JRootPanel,
-     * otherwise for JComponent as well. 
+     * otherwise for JComponent as well.
      */
     public static Insets getInsets(Component c, boolean topLevelOnly) {
         if( c instanceof Window ) {
@@ -108,7 +108,7 @@ public class AWTMisc {
          */
         public void run(Component c);
     }
-    
+
     public static int performAction(Container c, Class<?> cType, ComponentAction action) {
         int count = 0;
         final int cc = c.getComponentCount();
@@ -128,18 +128,18 @@ public class AWTMisc {
         }
         return count;
     }
-    
+
     /**
      * Traverse to the next forward or backward component using the
      * container's FocusTraversalPolicy.
-     * 
-     * @param comp the assumed current focuse component 
+     *
+     * @param comp the assumed current focuse component
      * @param forward if true, returns the next focus component, otherwise the previous one.
      * @return
      */
     public static Component getNextFocus(Component comp, boolean forward) {
         Container focusContainer = comp.getFocusCycleRootAncestor();
-        while ( focusContainer != null && 
+        while ( focusContainer != null &&
                 ( !focusContainer.isShowing() || !focusContainer.isFocusable() || !focusContainer.isEnabled() ) )
         {
             comp = focusContainer;
@@ -155,7 +155,7 @@ public class AWTMisc {
         }
         return next;
     }
-    
+
     /**
      * Issue this when your non AWT toolkit gains focus to clear AWT menu path
      */
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
index f579da217..815facbee 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -47,7 +47,7 @@ import java.awt.Toolkit;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-public class JAWTJNILibLoader extends NWJNILibLoader {  
+public class JAWTJNILibLoader extends NWJNILibLoader {
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
       public Object run() {
@@ -55,7 +55,7 @@ public class JAWTJNILibLoader extends NWJNILibLoader {
         // a Dialog with "awt.dll not found" might pop up.
         // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4481947.
         Toolkit.getDefaultToolkit();
-        
+
         // Must pre-load JAWT on all non-Mac platforms to
         // ensure references from jogl_awt shared object
         // will succeed since JAWT shared object isn't in
@@ -74,9 +74,9 @@ public class JAWTJNILibLoader extends NWJNILibLoader {
       }
     });
   }
-  
+
   public static void initSingleton() {
-      // just exist to ensure static init has been run      
+      // just exist to ensure static init has been run
   }
-  
+
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
index 844b17469..32946fe2d 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -63,13 +63,13 @@ public class JAWTUtil {
 
   /** OSX JAWT version option to use CALayer */
   public static final int JAWT_MACOSX_USE_CALAYER = 0x80000000;
-  
+
   /** OSX JAWT CALayer availability on Mac OS X >= 10.6 Update 4 (recommended) */
   public static final VersionNumber JAWT_MacOSXCALayerMinVersion = new VersionNumber(10,6,4);
-  
+
   /** OSX JAWT CALayer required with Java >= 1.7.0 (implies OS X >= 10.7  */
   public static final VersionNumber JAWT_MacOSXCALayerRequiredForJavaVersion = Platform.Version17;
-  
+
   // See whether we're running in headless mode
   private static final boolean headlessMode;
   private static final JAWT jawtLockObject;
@@ -81,27 +81,27 @@ public class JAWTUtil {
   private static final Method  sunToolkitAWTLockMethod;
   private static final Method  sunToolkitAWTUnlockMethod;
   private static final boolean hasSunToolkitAWTLock;
-  
+
   private static final RecursiveLock jawtLock;
   private static final ToolkitLock jawtToolkitLock;
 
   private static class PrivilegedDataBlob1 {
     PrivilegedDataBlob1() {
         ok = false;
-    }  
+    }
     Method  sunToolkitAWTLockMethod;
     Method  sunToolkitAWTUnlockMethod;
     boolean ok;
   }
-  
+
   /**
    * Returns true if this platform's JAWT implementation supports offscreen layer.
    */
   public static boolean isOffscreenLayerSupported() {
     return Platform.OS_TYPE == Platform.OSType.MACOS &&
-           Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0;      
+           Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0;
   }
- 
+
   /**
    * Returns true if this platform's JAWT implementation requires using offscreen layer.
    */
@@ -109,8 +109,8 @@ public class JAWTUtil {
     return Platform.OS_TYPE == Platform.OSType.MACOS &&
            Platform.JAVA_VERSION_NUMBER.compareTo(JAWT_MacOSXCALayerRequiredForJavaVersion)>=0;
   }
- 
-  /** 
+
+  /**
    * CALayer size needs to be set using the AWT component size.
    * <p>
    * AWT's super-calayer, i.e. the AWT's own component CALayer,
@@ -120,13 +120,13 @@ public class JAWTUtil {
    * <p>
    * As of today, this flag is enabled for all known AWT versions.
    * </p>
-   * <p> 
+   * <p>
    * Sync w/ NativeWindowProtocols.h
-   * </p> 
+   * </p>
    */
   public static final int JAWT_OSX_CALAYER_QUIRK_SIZE     = 1 << 0;
-  
-  /** 
+
+  /**
    * CALayer position needs to be set to zero.
    * <p>
    * AWT's super-calayer, i.e. the AWT's own component CALayer,
@@ -137,19 +137,19 @@ public class JAWTUtil {
    * </p>
    * <p>
    * Further more a re-layout seems to be required in this case,
-   * i.e. a programmatic forced resize +1 and it's inverted resize -1. 
+   * i.e. a programmatic forced resize +1 and it's inverted resize -1.
    * </p>
    * <p>
-   * This flag is enabled w/ AWT < 1.7.0_40. 
+   * This flag is enabled w/ AWT < 1.7.0_40.
    * </p>
-   * <p> 
+   * <p>
    * Sync w/ NativeWindowProtocols.h
-   * </p> 
+   * </p>
    */
   public static final int JAWT_OSX_CALAYER_QUIRK_POSITION = 1 << 1;
-  
-  /** 
-   * CALayer position needs to be derived from AWT position 
+
+  /**
+   * CALayer position needs to be derived from AWT position
    * in relation to super CALayer.
    * <p>
    * AWT's super-calayer, i.e. the AWT top-container's CALayer,
@@ -165,7 +165,7 @@ public class JAWTUtil {
    * </p>
    * <p>
    * The super-calayer lies within the AWT top-container client space (content).
-   * </p>    
+   * </p>
    * <p>
    * Component's location in super-calayer:
    * <pre>
@@ -188,12 +188,12 @@ public class JAWTUtil {
    * <p>
    * As of today, this flag is enabled for w/ AWT >= 1.7.0_40.
    * </p>
-   * <p> 
+   * <p>
    * Sync w/ NativeWindowProtocols.h
-   * </p> 
+   * </p>
    */
   public static final int JAWT_OSX_CALAYER_QUIRK_LAYOUT = 1 << 2;
-  
+
   /**
    * Returns bitfield of required JAWT OSX CALayer quirks to mediate AWT impl. bugs.
    * <p>
@@ -211,12 +211,12 @@ public class JAWTUtil {
    */
   public static int getOSXCALayerQuirks() {
     int res = 0;
-    if( Platform.OS_TYPE == Platform.OSType.MACOS && 
+    if( Platform.OS_TYPE == Platform.OSType.MACOS &&
         Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0 ) {
-        
+
         /** Knowing impl. all expose the SIZE bug */
         res |= JAWT_OSX_CALAYER_QUIRK_SIZE;
-        
+
         final int c = Platform.JAVA_VERSION_NUMBER.compareTo(Platform.Version17);
         if( c < 0 || c == 0 && Platform.JAVA_VERSION_UPDATE < 40 ) {
             res |= JAWT_OSX_CALAYER_QUIRK_POSITION;
@@ -226,20 +226,20 @@ public class JAWTUtil {
     }
     return res;
   }
-  
+
   /**
    * @param useOffscreenLayerIfAvailable
    * @return
    */
   public static JAWT getJAWT(boolean useOffscreenLayerIfAvailable) {
-    final int jawt_version_flags = JAWTFactory.JAWT_VERSION_1_4;    
+    final int jawt_version_flags = JAWTFactory.JAWT_VERSION_1_4;
     JAWT jawt = JAWT.create();
-    
+
     // default queries
     boolean tryOffscreenLayer;
     boolean tryOnscreen;
     int jawt_version_flags_offscreen = jawt_version_flags;
-    
+
     if(isOffscreenLayerRequired()) {
         if(Platform.OS_TYPE == Platform.OSType.MACOS) {
             if(Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0) {
@@ -263,11 +263,11 @@ public class JAWTUtil {
     } else {
         tryOffscreenLayer = false;
         tryOnscreen = true;
-    }    
+    }
     if(DEBUG) {
         System.err.println("JAWTUtil.getJAWT(tryOffscreenLayer "+tryOffscreenLayer+", tryOnscreen "+tryOnscreen+")");
     }
-    
+
     StringBuilder errsb = new StringBuilder();
     if(tryOffscreenLayer) {
         errsb.append("Offscreen 0x").append(Integer.toHexString(jawt_version_flags_offscreen));
@@ -282,15 +282,15 @@ public class JAWTUtil {
         errsb.append("Onscreen 0x").append(Integer.toHexString(jawt_version_flags));
         if( JAWT.getJAWT(jawt, jawt_version_flags) ) {
             return jawt;
-        }        
+        }
     }
     throw new RuntimeException("Unable to initialize JAWT, trials: "+errsb.toString());
   }
-  
+
   public static boolean isJAWTUsingOffscreenLayer(JAWT jawt) {
       return 0 != ( jawt.getCachedVersion() & JAWTUtil.JAWT_MACOSX_USE_CALAYER );
   }
-  
+
   static {
     if(DEBUG) {
         System.err.println("JAWTUtil initialization (JAWT/JNI/...");
@@ -319,10 +319,10 @@ public class JAWTUtil {
     isQueueFlusherThread = m;
     j2dExist = ok;
 
-    PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction<Object>() {        
+    PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction<Object>() {
         public Object run() {
             PrivilegedDataBlob1 d = new PrivilegedDataBlob1();
-            try {                
+            try {
                 final Class<?> sunToolkitClass = Class.forName("sun.awt.SunToolkit");
                 d.sunToolkitAWTLockMethod = sunToolkitClass.getDeclaredMethod("awtLock", new Class[]{});
                 d.sunToolkitAWTLockMethod.setAccessible(true);
@@ -337,7 +337,7 @@ public class JAWTUtil {
     });
     sunToolkitAWTLockMethod = pdb1.sunToolkitAWTLockMethod;
     sunToolkitAWTUnlockMethod = pdb1.sunToolkitAWTUnlockMethod;
-    
+
     boolean _hasSunToolkitAWTLock = false;
     if ( pdb1.ok ) {
         try {
@@ -351,10 +351,10 @@ public class JAWTUtil {
     // hasSunToolkitAWTLock = false;
     jawtLock = LockFactory.createRecursiveLock();
 
-    jawtToolkitLock = new ToolkitLock() {          
+    jawtToolkitLock = new ToolkitLock() {
           public final void lock() {
               JAWTUtil.lockToolkit();
-          }    
+          }
           public final void unlock() {
               JAWTUtil.unlockToolkit();
           }
@@ -411,11 +411,11 @@ public class JAWTUtil {
   public static void initSingleton() {
       // just exist to ensure static init has been run
   }
-  
+
   /**
    * Called by {@link NativeWindowFactory#shutdown()}
    */
-  public static void shutdown() {      
+  public static void shutdown() {
   }
 
   public static boolean hasJava2D() {
@@ -443,7 +443,7 @@ public class JAWTUtil {
    * which just uses AWT's global ReentrantLock.
    * </p>
    * <p>
-   * AWT locking is wrapped through a recursive lock object. 
+   * AWT locking is wrapped through a recursive lock object.
    * </p>
    */
   public static void lockToolkit() throws NativeWindowException {
@@ -471,11 +471,11 @@ public class JAWTUtil {
    * which just uses AWT's global ReentrantLock.
    * </p>
    * <p>
-   * AWT unlocking is wrapped through a recursive lock object. 
+   * AWT unlocking is wrapped through a recursive lock object.
    * </p>
    */
   public static void unlockToolkit() {
-    jawtLock.validateLocked();    
+    jawtLock.validateLocked();
     if(ToolkitLock.TRACE_LOCK) { System.err.println("JAWTUtil-ToolkitLock.unlock(): "+jawtLock); }
     if( 1 == jawtLock.getHoldCount() ) {
         if(!headlessMode && !isJava2DQueueFlusherThread()) {
@@ -492,14 +492,14 @@ public class JAWTUtil {
     }
     jawtLock.unlock();
   }
-  
+
   public static final void validateLocked() throws RuntimeException {
     jawtLock.validateLocked();
-  }  
+  }
 
   public static ToolkitLock getJAWTToolkitLock() {
     return jawtToolkitLock;
   }
-  
+
 }
 
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java
index 40d7b8032..4f12d1925 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
index b712f6a1a..87e3d3dd8 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -102,7 +102,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
       }
       windowHandle=0;
   }
-  
+
   @Override
   protected void attachSurfaceLayerImpl(final long layerHandle) {
       OSXUtil.RunOnMainThread(false, new Runnable() {
@@ -119,7 +119,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
               if( null != outterInsets ) {
                   p1.translate(-outterInsets.left, -outterInsets.top);
               }
-              
+
               if( DEBUG ) {
                   final java.awt.Point pA0 = component.getLocationOnScreen();
                   final Point pA1 = new Point(pA0.x, pA0.y);
@@ -133,7 +133,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
               OSXUtil.AddCASublayer(rootSurfaceLayer, layerHandle, p1.getX(), p1.getY(), getWidth(), getHeight(), JAWTUtil.getOSXCALayerQuirks());
           } } );
   }
-  
+
   @Override
   protected void layoutSurfaceLayerImpl(long layerHandle, boolean visible) {
       final int caLayerQuirks = JAWTUtil.getOSXCALayerQuirks();
@@ -149,7 +149,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
       if( null != outterInsets ) {
           p1.translate(-outterInsets.left, -outterInsets.top);
       }
-      
+
       if( DEBUG ) {
           final java.awt.Point pA0 = component.getLocationOnScreen();
           final Point pA1 = new Point(pA0.x, pA0.y);
@@ -163,7 +163,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
       }
       OSXUtil.FixCALayerLayout(rootSurfaceLayer, layerHandle, visible, p1.getX(), p1.getY(), getWidth(), getHeight(), caLayerQuirks);
   }
-  
+
   @Override
   protected void detachSurfaceLayerImpl(final long layerHandle, final Runnable detachNotify) {
       OSXUtil.RunOnMainThread(false, new Runnable() {
@@ -172,17 +172,17 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
               OSXUtil.RemoveCASublayer(rootSurfaceLayer, layerHandle);
           } } );
   }
-  
+
   @Override
   public final long getWindowHandle() {
     return windowHandle;
   }
-  
+
   @Override
   public final long getSurfaceHandle() {
     return offscreenSurfaceDrawableSet ? offscreenSurfaceDrawable : drawable /* super.getSurfaceHandle() */ ;
   }
-  
+
   public void setSurfaceHandle(long surfaceHandle) {
       if( !isOffscreenLayerSurfaceEnabled() ) {
           throw new java.lang.UnsupportedOperationException("Not using CALAYER");
@@ -198,7 +198,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
        // use offscreen if supported and [ applet or requested ]
       return JAWTUtil.getJAWT(getShallUseOffscreenLayer() || isApplet());
   }
-  
+
   protected int lockSurfaceImpl() throws NativeWindowException {
     int ret = NativeWindow.LOCK_SURFACE_NOT_READY;
     ds = getJAWT().GetDrawingSurface(component);
@@ -247,7 +247,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
           return NativeWindow.LOCK_SURFACE_NOT_READY;
         }
         drawable = macosxdsi.getCocoaViewRef();
-    
+
         if (drawable == 0) {
           unlockSurfaceImpl();
           return NativeWindow.LOCK_SURFACE_NOT_READY;
@@ -259,9 +259,9 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
         /**
          * Only create a fake invisible NSWindow for the drawable handle
          * to please frameworks requiring such (eg. NEWT).
-         * 
-         * The actual surface/ca-layer shall be created/attached 
-         * by the upper framework (JOGL) since they require more information. 
+         *
+         * The actual surface/ca-layer shall be created/attached
+         * by the upper framework (JOGL) since they require more information.
          */
         String errMsg = null;
         if(0 == drawable) {
@@ -286,10 +286,10 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
             OSXUtil.RunOnMainThread(false, new Runnable() {
                 public void run() {
                     String errMsg = null;
-                    if(0 == rootSurfaceLayer && 0 != jawtSurfaceLayersHandle) {        
+                    if(0 == rootSurfaceLayer && 0 != jawtSurfaceLayersHandle) {
                         rootSurfaceLayer = OSXUtil.CreateCALayer(bounds.getWidth(), bounds.getHeight());
                         if(0 == rootSurfaceLayer) {
-                          errMsg = "Could not create root CALayer";                
+                          errMsg = "Could not create root CALayer";
                         } else {
                             try {
                                 SetJAWTRootSurfaceLayer0(jawtSurfaceLayersHandle, rootSurfaceLayer);
@@ -318,10 +318,10 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
         }
         ret = NativeWindow.LOCK_SUCCESS;
     }
-    
+
     return ret;
   }
-  
+
   protected void unlockSurfaceImpl() throws NativeWindowException {
     if(null!=ds) {
         if (null!=dsi) {
@@ -340,7 +340,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
       System.err.println("MaxOSXJAWTWindow: 0x"+Integer.toHexString(this.hashCode())+" - thread: "+Thread.currentThread().getName());
       dumpJAWTInfo();
   }
-  
+
   /**
    * {@inheritDoc}
    * <p>
@@ -350,9 +350,9 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
    *      ..
    *      ds = getJAWT().GetDrawingSurface(component);
    * due to a SIGSEGV.
-   * 
+   *
    * Hence we have some threading / sync issues with the native JAWT implementation.
-   * </p>      
+   * </p>
    */
   @Override
   public Point getLocationOnScreen(Point storage) {
@@ -361,36 +361,36 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
       }
       getLocationOnScreenNonBlocking(storage, component);
       return storage;
-  }  
+  }
   protected Point getLocationOnScreenNativeImpl(final int x0, final int y0) { return null; }
-  
-  
+
+
   private static native long GetJAWTSurfaceLayersHandle0(Buffer jawtDrawingSurfaceInfoBuffer);
-  
-  /** 
+
+  /**
    * Set the given root CALayer in the JAWT surface
-   */  
+   */
   private static native void SetJAWTRootSurfaceLayer0(long jawtSurfaceLayersHandle, long caLayer);
-  
-  /** 
+
+  /**
    * Unset the given root CALayer in the JAWT surface, passing the NIO DrawingSurfaceInfo buffer
-   */  
+   */
   private static native void UnsetJAWTRootSurfaceLayer0(long jawtSurfaceLayersHandle, long caLayer);
-  
+
   // Variables for lockSurface/unlockSurface
   private JAWT_DrawingSurface ds;
   private boolean dsLocked;
   private JAWT_DrawingSurfaceInfo dsi;
   private long jawtSurfaceLayersHandle;
-  
+
   private JAWT_MacOSXDrawingSurfaceInfo macosxdsi;
-  
+
   private volatile long rootSurfaceLayer = 0; // attached to the JAWT_SurfaceLayer
-  
+
   private long windowHandle = 0;
   private long offscreenSurfaceDrawable = 0;
   private boolean offscreenSurfaceDrawableSet = false;
-   
+
   // Workaround for instance of 4796548
   private boolean firstLock = true;
 
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
index 74dabb67f..876531151 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
index 905a313d5..64e177155 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -67,7 +67,7 @@ public class WindowsJAWTWindow extends JAWTWindow {
   protected JAWT fetchJAWTImpl() throws NativeWindowException {
       return JAWTUtil.getJAWT(false); // no offscreen
   }
-  
+
   protected int lockSurfaceImpl() throws NativeWindowException {
     int ret = NativeWindow.LOCK_SUCCESS;
     ds = getJAWT().GetDrawingSurface(component);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
index 2e5dc7fb5..b08a7d83a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -62,7 +62,7 @@ public class X11JAWTWindow extends JAWTWindow {
   protected JAWT fetchJAWTImpl() throws NativeWindowException {
       return JAWTUtil.getJAWT(false); // no offscreen
   }
-    
+
   protected int lockSurfaceImpl() throws NativeWindowException {
     int ret = NativeWindow.LOCK_SUCCESS;
     ds = getJAWT().GetDrawingSurface(component);
@@ -123,11 +123,11 @@ public class X11JAWTWindow extends JAWTWindow {
     // surface is locked and hence the device
     return X11Lib.GetRelativeLocation(getDisplayHandle(), getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
   }
-  
+
   // Variables for lockSurface/unlockSurface
   private JAWT_DrawingSurface ds;
   private boolean dsLocked;
   private JAWT_DrawingSurfaceInfo dsi;
   private JAWT_X11DrawingSurfaceInfo x11dsi;
-  
+
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
index 27e0a5e50..f1104d02f 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
index de3206c0c..b71af1042 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
@@ -9,12 +9,12 @@ import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize;
 
 public class OSXDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
     long nsWindow;
-    
+
     /**
-     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)}, 
-     *        not the actual dummy surface width. 
+     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+     *        not the actual dummy surface width.
      *        The latter is platform specific and small
-     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)}, 
+     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
      *        not the actual dummy surface height,
      *        The latter is platform specific and small
      */
@@ -22,7 +22,7 @@ public class OSXDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
         super(width, height);
         nsWindow = 0;
     }
-    
+
     @Override
     public final void create(ProxySurface s) {
         if(0 == nsWindow && 0 == s.getSurfaceHandle()) {
@@ -35,11 +35,11 @@ public class OSXDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
                 throw new NativeWindowException("Error NS view 0");
             }
             s.setSurfaceHandle(nsView);
-            s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );            
+            s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
         }
         s.addUpstreamOptionBits(ProxySurface.OPT_UPSTREAM_WINDOW_INVISIBLE);
     }
-    
+
     @Override
     public final void destroy(ProxySurface s) {
         if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
index 0d498fa54..004a91a42 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
@@ -41,9 +41,9 @@ import jogamp.nativewindow.NWJNILibLoader;
 import jogamp.nativewindow.ToolkitProperties;
 
 public class OSXUtil implements ToolkitProperties {
-    private static boolean isInit = false;  
+    private static boolean isInit = false;
     private static final boolean DEBUG = Debug.debug("OSXUtil");
-    
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
@@ -56,10 +56,10 @@ public class OSXUtil implements ToolkitProperties {
           if(!NWJNILibLoader.loadNativeWindow("macosx")) {
               throw new NativeWindowException("NativeWindow MacOSX native library load error.");
           }
-          
+
           if( !initIDs0() ) {
               throw new NativeWindowException("MacOSX: Could not initialized native stub");
-          }  
+          }
           isInit = true;
       }
     }
@@ -69,27 +69,27 @@ public class OSXUtil implements ToolkitProperties {
      * @see ToolkitProperties
      */
     public static void shutdown() { }
-    
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
      */
     public static boolean requiresToolkitLock() { return false; }
-    
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
      */
     public static final boolean hasThreadingIssues() { return false; }
-    
+
     public static boolean isNSView(long object) {
         return 0 != object ? isNSView0(object) : false;
     }
-    
+
     public static boolean isNSWindow(long object) {
         return 0 != object ? isNSWindow0(object) : false;
     }
-    
+
     /**
      * In case the <code>windowOrView</code> is top-level,
      * you shall set <code>topLevel</code> to true where
@@ -108,7 +108,7 @@ public class OSXUtil implements ToolkitProperties {
      * @param src_y
      * @return the client position
      */
-    public static Point GetLocationOnScreen(long windowOrView, boolean topLevel, int src_x, int src_y) {      
+    public static Point GetLocationOnScreen(long windowOrView, boolean topLevel, int src_x, int src_y) {
       final Point los = (Point) GetLocationOnScreen0(windowOrView, src_x, src_y);
       if(topLevel) {
           // top-level position -> client window position
@@ -117,11 +117,11 @@ public class OSXUtil implements ToolkitProperties {
       }
       return los;
     }
-    
+
     public static Insets GetInsets(long windowOrView) {
       return (Insets) GetInsets0(windowOrView);
     }
-    
+
     public static long CreateNSWindow(int x, int y, int width, int height) {
       return CreateNSWindow0(x, y, width, height);
     }
@@ -134,11 +134,11 @@ public class OSXUtil implements ToolkitProperties {
     public static long GetNSWindow(long nsView) {
       return GetNSWindow0(nsView);
     }
-    
-    /** 
+
+    /**
      * Create a CALayer suitable to act as a root CALayer.
      * @see #DestroyCALayer(long)
-     * @see #AddCASublayer(long, long) 
+     * @see #AddCASublayer(long, long)
      */
     public static long CreateCALayer(final int width, final int height) {
       final long l = CreateCALayer0(width, height);
@@ -147,8 +147,8 @@ public class OSXUtil implements ToolkitProperties {
       }
       return l;
     }
-    
-    /** 
+
+    /**
      * Attach a sub CALayer to the root CALayer
      * <p>
      * Method will trigger a <code>display</code>
@@ -156,7 +156,7 @@ public class OSXUtil implements ToolkitProperties {
      * </p>
      * <p>
      * Hence it is important that related resources are not locked <i>if</i>
-     * they will be used for creation.  
+     * they will be used for creation.
      * </p>
      * @param caLayerQuirks TODO
      * @see #CreateCALayer(int, int)
@@ -171,18 +171,18 @@ public class OSXUtil implements ToolkitProperties {
         }
         AddCASublayer0(rootCALayer, subCALayer, x, y, width, height, caLayerQuirks);
     }
-    
-    /** 
+
+    /**
      * Fix root and sub CALayer position to 0/0 and size
      * <p>
      * If the sub CALayer implements the Objective-C NativeWindow protocol NWDedicatedSize (e.g. JOGL's MyNSOpenGLLayer),
-     * the dedicated size is passed to the layer, which propagates it appropriately. 
+     * the dedicated size is passed to the layer, which propagates it appropriately.
      * </p>
      * <p>
      * On OSX/Java7 our root CALayer's frame position and size gets corrupted by its NSView,
      * hence we have created the NWDedicatedSize protocol.
      * </p>
-     * 
+     *
      * @param rootCALayer the root surface layer, maybe null.
      * @param subCALayer the client surface layer, maybe null.
      * @param visible TODO
@@ -196,8 +196,8 @@ public class OSXUtil implements ToolkitProperties {
         }
         FixCALayerLayout0(rootCALayer, subCALayer, visible, x, y, width, height, caLayerQuirks);
     }
-    
-    /** 
+
+    /**
      * Detach a sub CALayer from the root CALayer.
      */
     public static void RemoveCASublayer(final long rootCALayer, final long subCALayer) {
@@ -209,11 +209,11 @@ public class OSXUtil implements ToolkitProperties {
         }
         RemoveCASublayer0(rootCALayer, subCALayer);
     }
-    
-    /** 
+
+    /**
      * Destroy a CALayer.
      * @see #CreateCALayer(int, int)
-     */    
+     */
     public static void DestroyCALayer(final long caLayer) {
         if(0==caLayer) {
             throw new IllegalArgumentException("caLayer 0x"+Long.toHexString(caLayer));
@@ -223,13 +223,13 @@ public class OSXUtil implements ToolkitProperties {
         }
         DestroyCALayer0(caLayer);
     }
-    
+
     /**
      * Run on OSX UI main thread.
-     * <p> 
+     * <p>
      * 'waitUntilDone' is implemented on Java site via lock/wait on {@link RunnableTask} to not freeze OSX main thread.
      * </p>
-     * 
+     *
      * @param waitUntilDone
      * @param runnable
      */
@@ -238,10 +238,10 @@ public class OSXUtil implements ToolkitProperties {
             runnable.run(); // don't leave the JVM
         } else {
             // Utilize Java side lock/wait and simply pass the Runnable async to OSX main thread,
-            // otherwise we may freeze the OSX main thread.            
+            // otherwise we may freeze the OSX main thread.
             Throwable throwable = null;
             final Object sync = new Object();
-            final RunnableTask rt = new RunnableTask( runnable, waitUntilDone ? sync : null, true, waitUntilDone ? null : System.err ); 
+            final RunnableTask rt = new RunnableTask( runnable, waitUntilDone ? sync : null, true, waitUntilDone ? null : System.err );
             synchronized(sync) {
                 RunOnMainThread0(rt);
                 if( waitUntilDone ) {
@@ -260,7 +260,7 @@ public class OSXUtil implements ToolkitProperties {
             }
         }
     }
-    
+
     /**
      * Run later on ..
      * @param onMain if true, run on main-thread, otherwise on the current OSX thread.
@@ -270,20 +270,20 @@ public class OSXUtil implements ToolkitProperties {
     public static void RunLater(boolean onMain, Runnable runnable, int delay) {
         RunLater0(onMain, new RunnableTask( runnable, null, true, System.err ), delay);
     }
-    
+
     private static Runnable _nop = new Runnable() { public void run() {}; };
-    
-    /** Issues a {@link #RunOnMainThread(boolean, Runnable)} w/ an <i>NOP</i> runnable, while waiting until done. */ 
+
+    /** Issues a {@link #RunOnMainThread(boolean, Runnable)} w/ an <i>NOP</i> runnable, while waiting until done. */
     public static void WaitUntilFinish() {
         RunOnMainThread(true, _nop);
     }
-    
+
     /**
      * Run on OSX UI main thread.
-     * <p> 
+     * <p>
      * 'waitUntilDone' is implemented on Java site via lock/wait on {@link FunctionTask} to not freeze OSX main thread.
      * </p>
-     * 
+     *
      * @param waitUntilDone
      * @param func
      */
@@ -292,10 +292,10 @@ public class OSXUtil implements ToolkitProperties {
             return func.eval(args); // don't leave the JVM
         } else {
             // Utilize Java side lock/wait and simply pass the Runnable async to OSX main thread,
-            // otherwise we may freeze the OSX main thread.            
+            // otherwise we may freeze the OSX main thread.
             Throwable throwable = null;
             final Object sync = new Object();
-            final FunctionTask<R,A> rt = new FunctionTask<R,A>( func, waitUntilDone ? sync : null, true, waitUntilDone ? null : System.err ); 
+            final FunctionTask<R,A> rt = new FunctionTask<R,A>( func, waitUntilDone ? sync : null, true, waitUntilDone ? null : System.err );
             synchronized(sync) {
                 rt.setArgs(args);
                 RunOnMainThread0(rt);
@@ -316,20 +316,20 @@ public class OSXUtil implements ToolkitProperties {
             return rt.getResult();
         }
     }
-    
+
     public static boolean IsMainThread() {
         return IsMainThread0();
     }
-    
+
     /** Returns the screen refresh rate in Hz. If unavailable, returns 60Hz. */
     public static int GetScreenRefreshRate(int scrn_idx) {
         return GetScreenRefreshRate0(scrn_idx);
     }
-    
+
     /***
     private static boolean  isAWTEDTMainThreadInit = false;
     private static boolean  isAWTEDTMainThread;
-    
+
     public synchronized static boolean isAWTEDTMainThread() {
         if(!isAWTEDTMainThreadInit) {
             isAWTEDTMainThreadInit = true;
@@ -343,10 +343,10 @@ public class OSXUtil implements ToolkitProperties {
             } else {
                 isAWTEDTMainThread = false;
             }
-        }        
+        }
         return isAWTEDTMainThread;
     } */
-    
+
     private static native boolean initIDs0();
     private static native boolean isNSView0(long object);
     private static native boolean isNSWindow0(long object);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
index aa5f3dac5..e5de43c0a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
@@ -9,31 +9,31 @@ import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize;
 
 public class GDIDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
     /**
-     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)}, 
-     *        not the actual dummy surface width. 
+     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+     *        not the actual dummy surface width.
      *        The latter is platform specific and small
-     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)}, 
+     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
      *        not the actual dummy surface height,
      *        The latter is platform specific and small
      */
     public GDIDummyUpstreamSurfaceHook(int width, int height) {
         super(width, height);
     }
-    
+
     @Override
     public final void create(ProxySurface s) {
         final GDISurface ms = (GDISurface)s;
-        if(0 == ms.getWindowHandle()) {            
+        if(0 == ms.getWindowHandle()) {
             final long windowHandle = GDIUtil.CreateDummyWindow(0, 0, 64, 64);
             if(0 == windowHandle) {
                 throw new NativeWindowException("Error windowHandle 0, werr: "+GDI.GetLastError());
-            }    
+            }
             ms.setWindowHandle(windowHandle);
-            ms.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );            
+            ms.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
         }
         s.addUpstreamOptionBits(ProxySurface.OPT_UPSTREAM_WINDOW_INVISIBLE);
     }
-    
+
     @Override
     public final void destroy(ProxySurface s) {
         final GDISurface ms = (GDISurface)s;
@@ -46,5 +46,5 @@ public class GDIDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
             ms.setWindowHandle(0);
             ms.clearUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
         }
-    }    
+    }
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
index cc9c9853b..3e07b2a9e 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
@@ -43,7 +43,7 @@ import jogamp.nativewindow.windows.GDI;
  * allowing the use of HDC via lockSurface()/unlockSurface() protocol.
  * The latter will get and release the HDC.
  * The size via getWidth()/getHeight() is invalid.
- * 
+ *
  * @see ProxySurface
  */
 public class GDISurface extends ProxySurfaceImpl {
@@ -65,20 +65,20 @@ public class GDISurface extends ProxySurfaceImpl {
   }
 
   @Override
-  protected void invalidateImpl() {    
+  protected void invalidateImpl() {
     if(0 != surfaceHandle) {
         throw new NativeWindowException("didn't release surface Handle: "+this);
     }
     windowHandle = 0;
     // surfaceHandle = 0;
   }
-  
+
   /**
    * {@inheritDoc}
    * <p>
-   * Actually the window handle (HWND), since the surfaceHandle (HDC) is derived 
+   * Actually the window handle (HWND), since the surfaceHandle (HDC) is derived
    * from it at {@link #lockSurface()}.
-   * </p> 
+   * </p>
    */
   @Override
   public final void setSurfaceHandle(long surfaceHandle) {
@@ -86,7 +86,7 @@ public class GDISurface extends ProxySurfaceImpl {
   }
 
   /**
-   * Sets the window handle (HWND). 
+   * Sets the window handle (HWND).
    */
   public final void setWindowHandle(long windowHandle) {
       this.windowHandle = windowHandle;
@@ -118,7 +118,7 @@ public class GDISurface extends ProxySurfaceImpl {
   final protected void unlockSurfaceImpl() {
     if (0 != surfaceHandle) {
         if(0 == GDI.ReleaseDC(windowHandle, surfaceHandle)) {
-            throw new NativeWindowException("DC not released: "+this+", isWindow "+GDI.IsWindow(windowHandle)+", werr "+GDI.GetLastError()+", thread: "+Thread.currentThread().getName());        
+            throw new NativeWindowException("DC not released: "+this+", isWindow "+GDI.IsWindow(windowHandle)+", werr "+GDI.GetLastError()+", thread: "+Thread.currentThread().getName());
         }
         surfaceHandle=0;
     }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
index 00741a328..db61b1efd 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
@@ -37,11 +37,11 @@ import jogamp.nativewindow.ToolkitProperties;
 
 public class GDIUtil implements ToolkitProperties {
     private static final boolean DEBUG = Debug.debug("GDIUtil");
-  
+
     private static final String dummyWindowClassNameBase = "_dummyWindow_clazz" ;
     private static RegisteredClassFactory dummyWindowClassFactory;
     private static boolean isInit = false;
-  
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
@@ -59,42 +59,42 @@ public class GDIUtil implements ToolkitProperties {
                     if( !initIDs0() ) {
                         throw new NativeWindowException("GDI: Could not initialized native stub");
                     }
-                    dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, getDummyWndProc0());                    
+                    dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, getDummyWndProc0());
                     isInit = true;
                 }
             }
         }
     }
-  
+
     /**
      * Called by {@link NativeWindowFactory#shutdown()}
      * @see ToolkitProperties
      */
-    public static void shutdown() {      
+    public static void shutdown() {
     }
-    
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
      */
     public static boolean requiresToolkitLock() { return false; }
-  
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
      */
     public static final boolean hasThreadingIssues() { return false; }
-    
+
     private static RegisteredClass dummyWindowClass = null;
     private static Object dummyWindowSync = new Object();
-  
+
     public static long CreateDummyWindow(int x, int y, int width, int height) {
         synchronized(dummyWindowSync) {
             dummyWindowClass = dummyWindowClassFactory.getSharedClass();
             return CreateDummyWindow0(dummyWindowClass.getHInstance(), dummyWindowClass.getName(), dummyWindowClass.getName(), x, y, width, height);
         }
     }
-  
+
     public static boolean DestroyDummyWindow(long hwnd) {
         boolean res;
         synchronized(dummyWindowSync) {
@@ -106,27 +106,27 @@ public class GDIUtil implements ToolkitProperties {
         }
         return res;
     }
-  
+
     public static Point GetRelativeLocation(long src_win, long dest_win, int src_x, int src_y) {
         return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y);
     }
-    
+
     public static boolean IsUndecorated(long win) {
         return IsUndecorated0(win);
     }
-    
+
     public static boolean IsChild(long win) {
         return IsChild0(win);
     }
-    
+
     public static native boolean CreateWindowClass(long hInstance, String clazzName, long wndProc);
     public static native boolean DestroyWindowClass(long hInstance, String className);
-    
+
     private static native boolean initIDs0();
-    private static native long getDummyWndProc0();  
+    private static native long getDummyWndProc0();
     private static native Object GetRelativeLocation0(long src_win, long dest_win, int src_x, int src_y);
     private static native boolean IsChild0(long win);
     private static native boolean IsUndecorated0(long win);
-  
-    static native long CreateDummyWindow0(long hInstance, String className, String windowName, int x, int y, int width, int height);  
+
+    static native long CreateDummyWindow0(long hInstance, String className, String windowName, int x, int y, int width, int height);
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
index 949f5d06d..976693e3a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
@@ -39,7 +39,7 @@ public class RegisteredClass {
 
     /** Application handle, same as {@link RegisteredClassFactory#getHInstance()}. */
     public final long getHInstance() { return hInstance; }
-    
+
     /** Unique Window Class Name */
     public final String getName() { return className; }
 
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
index 0280b0df7..e033a9f66 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
@@ -34,9 +34,9 @@ import javax.media.nativewindow.NativeWindowException;
 
 public class RegisteredClassFactory {
     private static final boolean DEBUG = Debug.debug("RegisteredClass");
-    private static final ArrayList<RegisteredClassFactory> registeredFactories;    
+    private static final ArrayList<RegisteredClassFactory> registeredFactories;
     private static final long hInstance;
-    
+
     static {
         hInstance = GDI.GetApplicationHandle();
         if( 0 == hInstance ) {
@@ -44,7 +44,7 @@ public class RegisteredClassFactory {
         }
         registeredFactories = new ArrayList<RegisteredClassFactory>();
     }
-    
+
     private String classBaseName;
     private long wndProc;
 
@@ -52,9 +52,9 @@ public class RegisteredClassFactory {
     private int classIter = 0;
     private int sharedRefCount = 0;
     private final Object sync = new Object();
-    
+
     /**
-     * Release the {@link RegisteredClass} of all {@link RegisteredClassFactory}. 
+     * Release the {@link RegisteredClass} of all {@link RegisteredClassFactory}.
      */
     public static void shutdownSharedClasses() {
         synchronized(registeredFactories) {
@@ -65,7 +65,7 @@ public class RegisteredClassFactory {
                         GDIUtil.DestroyWindowClass(rcf.sharedClass.getHInstance(), rcf.sharedClass.getName());
                         rcf.sharedClass = null;
                         rcf.sharedRefCount = 0;
-                        rcf.classIter = 0;                 
+                        rcf.classIter = 0;
                         if(DEBUG) {
                           System.err.println("RegisteredClassFactory #"+j+"/"+registeredFactories.size()+" shutdownSharedClasses : "+rcf.sharedClass);
                         }
@@ -74,7 +74,7 @@ public class RegisteredClassFactory {
             }
         }
     }
-    
+
     /** Application handle. */
     public static long getHInstance() { return hInstance; }
 
@@ -94,7 +94,7 @@ public class RegisteredClassFactory {
               }
               String clazzName = null;
               boolean registered = false;
-              final int classIterMark = classIter - 1; 
+              final int classIterMark = classIter - 1;
               while ( !registered && classIterMark != classIter ) {
                   // Retry with next clazz name, this could happen if more than one JVM is running
                   clazzName = classBaseName + classIter;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
index 827862002..2c8ef642c 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
@@ -14,17 +14,17 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
 
 public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
     /**
-     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)}, 
-     *        not the actual dummy surface width. 
+     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+     *        not the actual dummy surface width.
      *        The latter is platform specific and small
-     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)}, 
+     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
      *        not the actual dummy surface height,
      *        The latter is platform specific and small
      */
     public X11DummyUpstreamSurfaceHook(int width, int height) {
         super(width, height);
     }
-    
+
     @Override
     public final void create(ProxySurface s) {
         final X11GraphicsConfiguration cfg = (X11GraphicsConfiguration) s.getGraphicsConfiguration();
@@ -42,14 +42,14 @@ public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
                     throw new NativeWindowException("Creating dummy window failed w/ "+cfg);
                 }
                 s.setSurfaceHandle(windowHandle);
-                s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );            
+                s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
             }
             s.addUpstreamOptionBits(ProxySurface.OPT_UPSTREAM_WINDOW_INVISIBLE);
         } finally {
             device.unlock();
         }
     }
-    
+
     @Override
     public final void destroy(ProxySurface s) {
         if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
@@ -59,7 +59,7 @@ public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
             }
             device.lock();
             try {
-                X11Lib.DestroyWindow(device.getHandle(), s.getSurfaceHandle());            
+                X11Lib.DestroyWindow(device.getHandle(), s.getSurfaceHandle());
                 s.setSurfaceHandle(0);
                 s.clearUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
             } finally {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
index b11dd1df1..d6e7b5970 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -47,10 +47,10 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
 public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactory {
     public static void registerFactory() {
         GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, CapabilitiesImmutable.class, new X11GraphicsConfigurationFactory());
-    }    
+    }
     private X11GraphicsConfigurationFactory() {
     }
-    
+
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
         CapabilitiesImmutable  capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID)
         throws IllegalArgumentException, NativeWindowException {
@@ -109,7 +109,7 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
         XVisualInfo best=null;
         int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
         for (int i = 0; vinfos!=null && i < num[0]; i++) {
-            if ( best == null || 
+            if ( best == null ||
                  best.getDepth() < vinfos[i].getDepth() )
             {
                 best = vinfos[i];
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
index 78e432b7f..6431fb3f5 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -54,16 +54,16 @@ import com.jogamp.nativewindow.x11.X11GraphicsDevice;
  */
 public class X11Util implements ToolkitProperties {
     public static final boolean DEBUG = Debug.debug("X11Util");
-    
-    /** 
+
+    /**
      * See Bug 515 - https://jogamp.org/bugzilla/show_bug.cgi?id=515
-     * <p> 
+     * <p>
      * It is observed that ATI X11 drivers, eg.
-     * <ul> 
+     * <ul>
      *   <li>fglrx 8.78.6,</li>
      *   <li>fglrx 11.08/8.881 and </li>
      *   <li>fglrx 11.11/8.911</li>
-     * </ul>  
+     * </ul>
      * are quite sensitive to multiple Display connections.
      * </p>
      * <p>
@@ -81,11 +81,11 @@ public class X11Util implements ToolkitProperties {
      * </p>
      * <p>
      * With ATI X11 drivers all connections must be closed at JVM shutdown,
-     * otherwise a SIGSEGV (after JVM safepoint) will be caused. 
+     * otherwise a SIGSEGV (after JVM safepoint) will be caused.
      * </p>
      */
     public static final boolean ATI_HAS_XCLOSEDISPLAY_BUG = !Debug.isPropertyDefined("nativewindow.debug.X11Util.ATI_HAS_NO_XCLOSEDISPLAY_BUG", true);
-    
+
     /** See {@link #ATI_HAS_XCLOSEDISPLAY_BUG}. */
     public static final boolean HAS_XCLOSEDISPLAY_BUG = Debug.isPropertyDefined("nativewindow.debug.X11Util.HAS_XCLOSEDISPLAY_BUG", true);
 
@@ -105,7 +105,7 @@ public class X11Util implements ToolkitProperties {
     private static final Object setX11ErrorHandlerLock = new Object();
     private static final String X11_EXTENSION_ATIFGLRXDRI     = "ATIFGLRXDRI";
     private static final String X11_EXTENSION_ATIFGLEXTENSION = "ATIFGLEXTENSION";
-    
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
@@ -121,15 +121,15 @@ public class X11Util implements ToolkitProperties {
                     if(!NWJNILibLoader.loadNativeWindow("x11")) {
                         throw new NativeWindowException("NativeWindow X11 native library load error.");
                     }
-        
+
                     final boolean isInitOK = initialize0( XERROR_STACKDUMP );
-        
+
                     final boolean hasX11_EXTENSION_ATIFGLRXDRI, hasX11_EXTENSION_ATIFGLEXTENSION;
                     final long dpy = X11Lib.XOpenDisplay(PropertyAccess.getProperty("nativewindow.x11.display.default", true));
                     if(0 != dpy) {
                         if(XSYNC_ENABLED) {
                             X11Lib.XSynchronize(dpy, true);
-                        }                    
+                        }
                         try {
                             nullDisplayName = X11Lib.XDisplayString(dpy);
                             hasX11_EXTENSION_ATIFGLRXDRI = X11Lib.QueryExtension(dpy, X11_EXTENSION_ATIFGLRXDRI);
@@ -147,7 +147,7 @@ public class X11Util implements ToolkitProperties {
                     if ( !markAllDisplaysUnclosable ) {
                         markAllDisplaysUnclosable = ( ATI_HAS_XCLOSEDISPLAY_BUG && isATIFGLRX ) || HAS_XCLOSEDISPLAY_BUG;
                     }
-                    
+
                     if(DEBUG) {
                         System.err.println("X11Util.initSingleton(): OK "+isInitOK+"]"+
                                            ",\n\t X11 Display(NULL) <"+nullDisplayName+">"+
@@ -164,17 +164,17 @@ public class X11Util implements ToolkitProperties {
             }
         }
     }
-    
+
     // not exactly thread safe, but good enough for our purpose,
     // which is to tag a NamedDisplay uncloseable after creation.
-    private static Object globalLock = new Object(); 
+    private static Object globalLock = new Object();
     private static LongObjectHashMap openDisplayMap = new LongObjectHashMap(); // handle -> name
     private static List<NamedDisplay> openDisplayList = new ArrayList<NamedDisplay>();     // open, no close attempt
     private static List<NamedDisplay> reusableDisplayList = new ArrayList<NamedDisplay>(); // close attempt, marked uncloseable, for reuse
     private static List<NamedDisplay> pendingDisplayList = new ArrayList<NamedDisplay>();  // all open (close attempt or reusable) in creation order
     private static final HashMap<String /* displayName */, Boolean> displayXineramaEnabledMap = new HashMap<String, Boolean>();
-    
-    /** 
+
+    /**
      * Cleanup resources.
      * <p>
      * Called by {@link NativeWindowFactory#shutdown()}
@@ -184,7 +184,7 @@ public class X11Util implements ToolkitProperties {
     public static void shutdown() {
         if(isInit) {
             synchronized(X11Util.class) {
-                if(isInit) {                    
+                if(isInit) {
                     final boolean isJVMShuttingDown = NativeWindowFactory.isJVMShuttingDown() ;
                     if( DEBUG ||
                         ( ( openDisplayMap.size() > 0 || reusableDisplayList.size() > 0 || pendingDisplayList.size() > 0 ) &&
@@ -207,9 +207,9 @@ public class X11Util implements ToolkitProperties {
                             }
                         }
                     }
-            
-                    // Only at JVM shutdown time, since AWT impl. seems to 
-                    // dislike closing of X11 Display's (w/ ATI driver). 
+
+                    // Only at JVM shutdown time, since AWT impl. seems to
+                    // dislike closing of X11 Display's (w/ ATI driver).
                     if( isJVMShuttingDown ) {
                         synchronized(globalLock) {
                             isInit = false;
@@ -226,7 +226,7 @@ public class X11Util implements ToolkitProperties {
             }
         }
     }
-    
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
@@ -234,15 +234,15 @@ public class X11Util implements ToolkitProperties {
     public static final boolean requiresToolkitLock() {
         return true; // JAWT locking: yes, instead of native X11 locking w use a recursive lock per display connection.
     }
-    
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
      */
     public static final boolean hasThreadingIssues() {
-        return hasThreadingIssues; // JOGL impl. may utilize special locking "somewhere" 
+        return hasThreadingIssues; // JOGL impl. may utilize special locking "somewhere"
     }
-    
+
     public static void setX11ErrorHandler(boolean onoff, boolean quiet) {
         synchronized(setX11ErrorHandlerLock) {
             setX11ErrorHandler0(onoff, quiet);
@@ -271,7 +271,7 @@ public class X11Util implements ToolkitProperties {
     public static boolean getMarkAllDisplaysUnclosable() {
         return markAllDisplaysUnclosable;
     }
-    
+
     private X11Util() {}
 
     public static class NamedDisplay {
@@ -303,7 +303,7 @@ public class X11Util implements ToolkitProperties {
         public final int hashCode() {
             return hash32;
         }
-        
+
         public final boolean equals(Object obj) {
             if(this == obj) { return true; }
             if(obj instanceof NamedDisplay) {
@@ -311,10 +311,10 @@ public class X11Util implements ToolkitProperties {
             }
             return false;
         }
-        
+
         public final void addRef() { refCount++; }
         public final void removeRef() { refCount--; }
-        
+
         public final String getName() { return name; }
         public final long   getHandle() { return handle; }
         public final int    getRefCount() { return refCount; }
@@ -365,7 +365,7 @@ public class X11Util implements ToolkitProperties {
             return openDisplayList.size();
         }
     }
-        
+
     public static void dumpOpenDisplayConnections() {
         synchronized(globalLock) {
             System.err.println("X11Util: Open X11 Display Connections: "+openDisplayList.size());
@@ -381,7 +381,7 @@ public class X11Util implements ToolkitProperties {
             }
         }
     }
-    
+
     public static int getReusableDisplayConnectionNumber() {
         synchronized(globalLock) {
             return reusableDisplayList.size();
@@ -439,7 +439,7 @@ public class X11Util implements ToolkitProperties {
         NamedDisplay namedDpy = null;
         name = validateDisplayName(name);
         boolean reused = false;
-        
+
         synchronized(globalLock) {
             for(int i=0; i<reusableDisplayList.size(); i++) {
                 if(reusableDisplayList.get(i).getName().equals(name)) {
@@ -484,7 +484,7 @@ public class X11Util implements ToolkitProperties {
                 X11Util.dumpPendingDisplayConnections();
                 throw new RuntimeException("X11Util.Display: Display(0x"+Long.toHexString(handle)+") Mapping error: "+namedDpy+". Thread "+Thread.currentThread().getName());
             }
-    
+
             namedDpy.removeRef();
             if(!openDisplayList.remove(namedDpy)) { throw new RuntimeException("Internal: "+namedDpy); }
 
@@ -497,13 +497,13 @@ public class X11Util implements ToolkitProperties {
                 pendingDisplayList.remove(namedDpy);
             } else {
                 // for reuse
-                X11Lib.XSync(namedDpy.getHandle(), true); // flush output buffer and discard all events                
+                X11Lib.XSync(namedDpy.getHandle(), true); // flush output buffer and discard all events
                 reusableDisplayList.add(namedDpy);
             }
 
             if(DEBUG) {
                 System.err.println("X11Util.Display: Closed (real: "+(!namedDpy.isUncloseable())+") "+namedDpy+". Thread "+Thread.currentThread().getName());
-            }    
+            }
         }
     }
 
@@ -513,7 +513,7 @@ public class X11Util implements ToolkitProperties {
         }
     }
 
-    /** 
+    /**
      * @return If name is null, it returns the previous queried NULL display name,
      * otherwise the name. */
     public static String validateDisplayName(String name) {
@@ -537,7 +537,7 @@ public class X11Util implements ToolkitProperties {
         long handle = X11Lib.XOpenDisplay(arg0);
         if(XSYNC_ENABLED && 0 != handle) {
             X11Lib.XSynchronize(handle, true);
-        }                    
+        }
         if(TRACE_DISPLAY_LIFECYCLE) {
             System.err.println(Thread.currentThread()+" - X11Util.XOpenDisplay("+arg0+") 0x"+Long.toHexString(handle));
             // Thread.dumpStack();
@@ -557,13 +557,13 @@ public class X11Util implements ToolkitProperties {
             System.err.println("X11Util: Catched Exception:");
             ex.printStackTrace();
         }
-        return res;            
+        return res;
     }
 
     static volatile boolean XineramaFetched = false;
     static long XineramaLibHandle = 0;
     static long XineramaQueryFunc = 0;
-    
+
     public static boolean XineramaIsEnabled(X11GraphicsDevice device) {
         if(null == device) {
             throw new IllegalArgumentException("X11 Display device is NULL");
@@ -573,9 +573,9 @@ public class X11Util implements ToolkitProperties {
             return XineramaIsEnabled(device.getHandle());
         } finally {
             device.unlock();
-        }        
+        }
     }
-    
+
     public static boolean XineramaIsEnabled(long displayHandle) {
         if( 0 == displayHandle ) {
             throw new IllegalArgumentException("X11 Display handle is NULL");
@@ -616,10 +616,10 @@ public class X11Util implements ToolkitProperties {
         }
         return res;
     }
-    
+
     private static final String getCurrentThreadName() { return Thread.currentThread().getName(); } // Callback for JNI
     private static final void dumpStack() { Thread.dumpStack(); } // Callback for JNI
-    
+
     private static native boolean initialize0(boolean debug);
     private static native void shutdown0();
     private static native void setX11ErrorHandler0(boolean onoff, boolean quiet);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
index b152f0f97..7b37d3cca 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -59,16 +59,16 @@ import jogamp.nativewindow.x11.X11Lib;
 import jogamp.nativewindow.x11.X11Util;
 
 public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
-    
+
     public static void registerFactory() {
         GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.awt.AWTGraphicsDevice.class, CapabilitiesImmutable.class, new X11AWTGraphicsConfigurationFactory());
-    }    
+    }
     private X11AWTGraphicsConfigurationFactory() {
     }
 
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {    
+            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
         if (absScreen != null &&
             !(absScreen instanceof AWTGraphicsScreen)) {
             throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
@@ -79,16 +79,16 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
 
         return chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, (AWTGraphicsScreen)absScreen, nativeVisualID);
     }
-    
+
     public static AWTGraphicsConfiguration chooseGraphicsConfigurationStatic(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
             CapabilitiesChooser chooser, AWTGraphicsScreen awtScreen, int nativeVisualID) {
         if(DEBUG) {
             System.err.println("X11AWTGraphicsConfigurationFactory: got "+awtScreen);
         }
-        
+
         final GraphicsDevice device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
-        
+
         final long displayHandleAWT = X11SunJDKReflection.graphicsDeviceGetDisplay(device);
         final long displayHandle;
         final boolean owner;
@@ -101,8 +101,8 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
         } else {
             /**
              * Using the AWT display handle works fine with NVidia.
-             * However we experienced different results w/ AMD drivers, 
-             * some work, but some behave erratic. 
+             * However we experienced different results w/ AMD drivers,
+             * some work, but some behave erratic.
              * I.e. hangs in XQueryExtension(..) via X11GraphicsScreen.
              */
             final String displayName = X11Lib.XDisplayString(displayHandleAWT);
@@ -113,13 +113,13 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
             }
         }
         // Global JAWT lock required - No X11 resource locking due to private display connection
-        final ToolkitLock lock = NativeWindowFactory.getDefaultToolkitLock(NativeWindowFactory.TYPE_AWT); 
-        final X11GraphicsDevice x11Device = new X11GraphicsDevice(displayHandle, AbstractGraphicsDevice.DEFAULT_UNIT, lock, owner); 
+        final ToolkitLock lock = NativeWindowFactory.getDefaultToolkitLock(NativeWindowFactory.TYPE_AWT);
+        final X11GraphicsDevice x11Device = new X11GraphicsDevice(displayHandle, AbstractGraphicsDevice.DEFAULT_UNIT, lock, owner);
         final X11GraphicsScreen x11Screen = new X11GraphicsScreen(x11Device, awtScreen.getIndex());
         if(DEBUG) {
             System.err.println("X11AWTGraphicsConfigurationFactory: made "+x11Screen);
         }
-        
+
         final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(x11Device, capsChosen);
         AbstractGraphicsConfiguration aConfig = factory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, x11Screen, nativeVisualID);
         if (aConfig == null) {
@@ -129,7 +129,7 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
             System.err.println("X11AWTGraphicsConfigurationFactory: chosen config: "+aConfig);
             // Thread.dumpStack();
         }
-        
+
         //
         // Match the X11/GL Visual with AWT:
         //   - choose a config AWT agnostic and then
@@ -137,7 +137,7 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
         //
         // The resulting GraphicsConfiguration has to be 'forced' on the AWT native peer,
         // ie. returned by GLCanvas's getGraphicsConfiguration() befor call by super.addNotify().
-        //        
+        //
         final GraphicsConfiguration[] configs = device.getConfigurations();
         int visualID = aConfig.getVisualID(VIDType.NATIVE);
         if(VisualIDHolder.VID_UNDEFINED != visualID) {
diff --git a/src/newt/classes/com/jogamp/newt/Display.java b/src/newt/classes/com/jogamp/newt/Display.java
index 382a5d583..83383d23c 100644
--- a/src/newt/classes/com/jogamp/newt/Display.java
+++ b/src/newt/classes/com/jogamp/newt/Display.java
@@ -114,9 +114,9 @@ public abstract class Display {
      */
     public abstract int removeReference();
 
-    /** 
-     * Return the {@link AbstractGraphicsDevice} used for depending resources lifecycle, 
-     * i.e. {@link Screen} and {@link Window}, as well as the event dispatching (EDT). */ 
+    /**
+     * Return the {@link AbstractGraphicsDevice} used for depending resources lifecycle,
+     * i.e. {@link Screen} and {@link Window}, as well as the event dispatching (EDT). */
     public abstract AbstractGraphicsDevice getGraphicsDevice();
 
     /**
@@ -136,8 +136,8 @@ public abstract class Display {
     public abstract int getId();
 
     /**
-     * @return This display connection name as defined at creation time. 
-     *         The display connection name is a technical platform specific detail, see {@link AbstractGraphicsDevice#getConnection()}. 
+     * @return This display connection name as defined at creation time.
+     *         The display connection name is a technical platform specific detail, see {@link AbstractGraphicsDevice#getConnection()}.
      *
      * @see AbstractGraphicsDevice#getConnection()
      */
@@ -154,11 +154,11 @@ public abstract class Display {
     /**
      * Sets a new {@link EDTUtil} and returns the previous one.
      * <p>
-     * If <code>usrEDTUtil</code> is <code>null</code>, 
+     * If <code>usrEDTUtil</code> is <code>null</code>,
      * the device's default EDTUtil is created and used.
      * </p>
      * <p>
-     * If a previous one exists and it differs from <code>usrEDTUtil</code>, 
+     * If a previous one exists and it differs from <code>usrEDTUtil</code>,
      * it's being stopped, wait-until-idle.
      * </p>
      * <p>
@@ -167,7 +167,7 @@ public abstract class Display {
      * </p>
      */
     public abstract EDTUtil setEDTUtil(EDTUtil usrEDTUtil);
-    
+
     public abstract EDTUtil getEDTUtil();
 
     /**
@@ -176,7 +176,7 @@ public abstract class Display {
     public abstract boolean isEDTRunning();
 
     public abstract void dispatchMessages();
-    
+
     // Global Displays
     protected static final ArrayList<WeakReference<Display>> displayList = new ArrayList<WeakReference<Display>>();
     protected static int displaysActive = 0;
@@ -193,12 +193,12 @@ public abstract class Display {
     }
 
     /**
-     * 
+     *
      * @param type
      * @param name
      * @param fromIndex start index, then increasing until found or end of list
-     * @paran shared if true, only shared instances are found, otherwise also exclusive 
-     * @return 
+     * @paran shared if true, only shared instances are found, otherwise also exclusive
+     * @return
      */
     public static Display getFirstDisplayOf(String type, String name, int fromIndex, boolean shared) {
         return getDisplayOfImpl(type, name, fromIndex, 1, shared);
@@ -209,7 +209,7 @@ public abstract class Display {
      * @param type
      * @param name
      * @param fromIndex start index, then decreasing until found or end of list. -1 is interpreted as size - 1.
-     * @paran shared if true, only shared instances are found, otherwise also exclusive 
+     * @paran shared if true, only shared instances are found, otherwise also exclusive
      * @return
      */
     public static Display getLastDisplayOf(String type, String name, int fromIndex, boolean shared) {
@@ -231,7 +231,7 @@ public abstract class Display {
                 } else {
                     if( display.getType().equals(type) &&
                         display.getName().equals(name) &&
-                        ( !shared || shared && !display.isExclusive() ) 
+                        ( !shared || shared && !display.isExclusive() )
                       ) {
                         return display;
                     }
@@ -241,7 +241,7 @@ public abstract class Display {
         }
         return null;
     }
-    
+
     protected static void addDisplay2List(Display display) {
         synchronized(displayList) {
             // GC before add
@@ -256,7 +256,7 @@ public abstract class Display {
             displayList.add(new WeakReference<Display>(display));
         }
     }
-    
+
     /** Returns the global display collection */
     public static Collection<Display> getAllDisplays() {
         ArrayList<Display> list;
diff --git a/src/newt/classes/com/jogamp/newt/MonitorDevice.java b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
index 42ac34240..625a7b39f 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorDevice.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt;
 
 import java.util.List;
@@ -36,7 +36,7 @@ import javax.media.nativewindow.util.RectangleImmutable;
 
 import com.jogamp.common.util.ArrayHashSet;
 
-/** 
+/**
  * Visual output device, i.e. a CRT, LED ..consisting of it's components:<br>
  * <ui>
  *   <li>Immutable
@@ -55,7 +55,7 @@ import com.jogamp.common.util.ArrayHashSet;
  */
 public abstract class MonitorDevice {
     protected final Screen screen; // backref
-    protected final int nativeId; // unique monitor device ID 
+    protected final int nativeId; // unique monitor device ID
     protected final DimensionImmutable sizeMM; // in [mm]
     protected final MonitorMode originalMode;
     protected final ArrayHashSet<MonitorMode> supportedModes; // FIXME: May need to support mutable mode, i.e. adding modes on the fly!
@@ -73,14 +73,14 @@ public abstract class MonitorDevice {
         this.viewport = viewport;
         this.modeChanged = false;
     }
-    
+
     /** Returns the {@link Screen} owning this monitor. */
     public final Screen getScreen() {
         return screen;
     }
-    
+
     /**
-     * Tests equality of two <code>MonitorDevice</code> objects 
+     * Tests equality of two <code>MonitorDevice</code> objects
      * by evaluating equality of it's components:<br>
      * <ul>
      *  <li><code>nativeID</code></li>
@@ -105,10 +105,10 @@ public abstract class MonitorDevice {
     public final int hashCode() {
         return nativeId;
     }
-    
+
     /** @return the immutable unique native Id of this monitor device. */
     public final int getId() { return nativeId; }
-    
+
     /**
      * @return the immutable monitor size in millimeters.
      */
@@ -140,11 +140,11 @@ public abstract class MonitorDevice {
         return supportedModes.getData();
     }
 
-    /** Returns the {@link RectangleImmutable rectangular} portion of the rotated virtual {@link Screen} size represented by this monitor. */  
+    /** Returns the {@link RectangleImmutable rectangular} portion of the rotated virtual {@link Screen} size represented by this monitor. */
     public final RectangleImmutable getViewport() {
         return viewport;
     }
-    
+
     /** Returns <code>true</code> if given coordinates are contained by this {@link #getViewport() viewport}, otherwise <code>false</code>. */
     public final boolean contains(int x, int y) {
         return x >= viewport.getX() &&
@@ -152,8 +152,8 @@ public abstract class MonitorDevice {
                y >= viewport.getY() &&
                y <  viewport.getY() + viewport.getHeight() ;
     }
-    
-    /** 
+
+    /**
      * Returns the coverage of given rectangle w/ this this {@link #getViewport() viewport}, i.e. between <code>0.0</code> and <code>1.0</code>.
      * <p>
      * Coverage is computed by:
@@ -161,12 +161,12 @@ public abstract class MonitorDevice {
      *    isect = viewport.intersection(r);
      *    coverage = area( isect ) / area( viewport ) ;
      * </pre>
-     * </p> 
+     * </p>
      */
     public final float coverage(RectangleImmutable r) {
         return viewport.coverage(r);
     }
-    
+
     /**
      * Returns the union of the given monitor's {@link #getViewport() viewport}.
      * @param result storage for result, will be returned
@@ -186,14 +186,14 @@ public abstract class MonitorDevice {
         result.set(x1, y1, x2 - x1, y2 - y1);
         return result;
     }
-    
+
     public final boolean isOriginalMode() {
         return currentMode.hashCode() == originalMode.hashCode();
     }
-    
+
     /**
      * Returns <code>true</true> if the {@link MonitorMode}
-     * has been changed programmatic via this API <i>only</i>, otherwise <code>false</code>. 
+     * has been changed programmatic via this API <i>only</i>, otherwise <code>false</code>.
      * <p>
      * Note: We cannot guarantee that we won't interfere w/ another running
      * application's screen mode change or vice versa.
@@ -202,7 +202,7 @@ public abstract class MonitorDevice {
     public final boolean isModeChangedByUs() {
         return modeChanged && !isOriginalMode();
     }
-    
+
     /**
      * Returns the cached current {@link MonitorMode} w/o native query.
      * <p>
@@ -212,7 +212,7 @@ public abstract class MonitorDevice {
     public final MonitorMode getCurrentMode() {
         return currentMode;
     }
-    
+
     /**
      * Returns the current {@link MonitorMode} resulting from a native query.
      * <p>
diff --git a/src/newt/classes/com/jogamp/newt/MonitorMode.java b/src/newt/classes/com/jogamp/newt/MonitorMode.java
index 218cd8bd5..175d6e5f2 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorMode.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorMode.java
@@ -37,7 +37,7 @@ import javax.media.nativewindow.util.SurfaceSize;
 import com.jogamp.newt.util.MonitorModeUtil;
 
 
-/** 
+/**
  * Immutable MonitorMode Class, consisting of it's read only components:<br>
  * <ul>
  *  <li>nativeId</li>
@@ -79,7 +79,7 @@ import com.jogamp.newt.util.MonitorModeUtil;
         // Pick the monitor:
         // Either the one used by a window ..
         MonitorDevice monitor = window.getMainMonitor();
-        
+
         // Or arbitrary from the list ..
         List<MonitorDevice> allMonitor = getMonitorDevices();
         MonitorDevice monitor = allMonitor.get(0);
@@ -87,7 +87,7 @@ import com.jogamp.newt.util.MonitorModeUtil;
         // Current and original modes ..
         MonitorMode mmCurrent = monitor.queryCurrentMode();
         MonitorMode mmOrig = monitor.getOriginalMode();
-        
+
         // Target resolution
         Dimension res = new Dimension(800, 600);
 
@@ -102,7 +102,7 @@ import com.jogamp.newt.util.MonitorModeUtil;
         monitorModes = MonitorModeUtil.filterByFlags(monitorModes, 0); // no interlace, double-scan etc
         monitorModes = MonitorModeUtil.filterByRotation(monitorModes, rot);
         monitorModes = MonitorModeUtil.filterByResolution(monitorModes, res);
-        monitorModes = MonitorModeUtil.filterByRate(monitorModes, freq);        
+        monitorModes = MonitorModeUtil.filterByRate(monitorModes, freq);
         monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
 
         // pick 1st one and set to current ..
@@ -111,20 +111,20 @@ import com.jogamp.newt.util.MonitorModeUtil;
  * </pre>
  */
 public class MonitorMode implements Comparable<MonitorMode> {
-    
+
     /** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the ascending order. */
     public static final Comparator<MonitorMode> monitorModeComparator = new Comparator<MonitorMode>() {
         public int compare(MonitorMode mm1, MonitorMode mm2) {
             return mm1.compareTo(mm2);
         } };
-    
+
     /** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the descending order. */
     public static final Comparator<MonitorMode> monitorModeComparatorInv = new Comparator<MonitorMode>() {
         public int compare(MonitorMode mm1, MonitorMode mm2) {
             return mm2.compareTo(mm1);
         } };
-        
-    /** 
+
+    /**
      * Immutable <i>surfaceSize, flags and refreshRate</i> Class, consisting of it's read only components:<br>
      * <ul>
      *  <li>nativeId</li>
@@ -141,7 +141,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
         /** Vertical refresh rate */
         public final float refreshRate;
         public final int hashCode;
-    
+
         public SizeAndRRate(SurfaceSize surfaceSize, float refreshRate, int flags) {
             if(null==surfaceSize) {
                 throw new IllegalArgumentException("surfaceSize must be set ("+surfaceSize+")");
@@ -151,11 +151,11 @@ public class MonitorMode implements Comparable<MonitorMode> {
             this.refreshRate=refreshRate;
             this.hashCode = getHashCode();
         }
-    
+
         private final static String STR_INTERLACE = "Interlace";
         private final static String STR_DOUBLESCAN = "DoubleScan";
         private final static String STR_SEP = ", ";
-        
+
         public static final StringBuilder flags2String(int flags) {
             final StringBuilder sb = new StringBuilder();
             boolean sp = false;
@@ -175,11 +175,11 @@ public class MonitorMode implements Comparable<MonitorMode> {
         public final String toString() {
             return new String(surfaceSize+" @ "+refreshRate+" Hz, flags ["+flags2String(flags).toString()+"]");
         }
-    
+
         /**
          * <p>
          * Compares {@link SurfaceSize#compareTo(SurfaceSize) surfaceSize} 1st, then {@link #flags}, then {@link #refreshRate}.
-         * </p> 
+         * </p>
          * <p>
          * Flags are compared as follows:
          * <pre>
@@ -196,7 +196,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
             final int rssz = surfaceSize.compareTo(sszr.surfaceSize);
             if( 0 != rssz ) {
                 return rssz;
-            }            
+            }
             final int tflags = 0 == flags ? Integer.MAX_VALUE : flags; // normalize NONE
             final int xflags = 0 == sszr.flags ? Integer.MAX_VALUE : sszr.flags; // normalize NONE
             if( tflags == xflags ) {
@@ -218,9 +218,9 @@ public class MonitorMode implements Comparable<MonitorMode> {
                 return 0;
             }
         }
-        
+
         /**
-         * Tests equality of two {@link SizeAndRRate} objects 
+         * Tests equality of two {@link SizeAndRRate} objects
          * by evaluating equality of it's components:<br/>
          * <ul>
          *  <li><code>surfaceSize</code></li>
@@ -238,7 +238,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
             }
             return false;
         }
-    
+
         /**
          * Returns a combined hash code of it's elements:<br/>
          * <ul>
@@ -249,16 +249,16 @@ public class MonitorMode implements Comparable<MonitorMode> {
          */
         public final int hashCode() {
             return hashCode;
-        }        
+        }
         private final int getHashCode() {
             // 31 * x == (x << 5) - x
             int hash = 31 + surfaceSize.hashCode();
             hash = ((hash << 5) - hash) + flags;
             hash = ((hash << 5) - hash) + (int)(refreshRate*100.0f);
             return hash;
-        }        
+        }
     }
-    
+
     /** zero rotation, compared to normal settings */
     public static final int ROTATE_0   = 0;
 
@@ -270,15 +270,15 @@ public class MonitorMode implements Comparable<MonitorMode> {
 
     /** 270 degrees CCW rotation */
     public static final int ROTATE_270 = 270;
-    
+
     /** Frame is split into two fields. See {@link #getFlags()}. */
     public static final int FLAG_INTERLACE = 1 << 0;
-    
+
     /** Lines are doubled. See {@link #getFlags()}. */
     public static final int FLAG_DOUBLESCAN = 1 << 1;
 
     /** The immutable native Id of this instance, which may not be unique. */
-    private final int nativeId;    
+    private final int nativeId;
     private final SizeAndRRate sizeAndRRate;
     private final int rotation;
     private final int hashCode;
@@ -301,7 +301,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
         this.rotation = rotation;
         this.hashCode = getHashCode();
     }
-    
+
     /**
      * Creates a user instance w/o {@link #getId() identity} to filter our matching modes w/ identity.
      * <p>
@@ -314,16 +314,16 @@ public class MonitorMode implements Comparable<MonitorMode> {
      */
     public MonitorMode(SurfaceSize surfaceSize, float refreshRate, int flags, int rotation) {
         this(0, new SizeAndRRate(surfaceSize, refreshRate, flags), rotation);
-    }    
+    }
 
     /** @return the immutable native Id of this mode, may not be unique, may be 0. */
     public final int getId() { return nativeId; }
-    
+
     /** Returns the <i>surfaceSize and refreshRate</i> instance. */
-    public final SizeAndRRate getSizeAndRRate() { 
+    public final SizeAndRRate getSizeAndRRate() {
         return sizeAndRRate;
     }
-    
+
     /** Returns the unrotated {@link SurfaceSize} */
     public final SurfaceSize getSurfaceSize() {
         return sizeAndRRate.surfaceSize;
@@ -338,23 +338,23 @@ public class MonitorMode implements Comparable<MonitorMode> {
     public final int getFlags() {
         return sizeAndRRate.flags;
     }
-    
+
     /** Returns the CCW rotation of this mode */
     public final int getRotation() {
         return rotation;
     }
-    
-    /** Returns the rotated screen width, 
+
+    /** Returns the rotated screen width,
      *  derived from <code>getMonitorMode().getSurfaceSize().getResolution()</code>
-     *  and <code>getRotation()</code> 
+     *  and <code>getRotation()</code>
      */
     public final int getRotatedWidth() {
         return getRotatedWH(true);
     }
-    
-    /** Returns the rotated screen height, 
+
+    /** Returns the rotated screen height,
      *  derived from <code>getMonitorMode().getSurfaceSize().getResolution()</code>
-     *  and <code>getRotation()</code> 
+     *  and <code>getRotation()</code>
      */
     public final int getRotatedHeight() {
         return getRotatedWH(false);
@@ -367,9 +367,9 @@ public class MonitorMode implements Comparable<MonitorMode> {
     /**
      * <p>
      * Compares {@link SizeAndRRate#compareTo(SizeAndRRate) sizeAndRRate} 1st, then {@link #rotation}.
-     * </p> 
+     * </p>
      * <p>
-     * Rotation is compared inverted, i.e. <code>360 - rotation</code>, 
+     * Rotation is compared inverted, i.e. <code>360 - rotation</code>,
      * so the lowest rotation reflects a higher value.
      * </p>
      * <p>
@@ -380,7 +380,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
      *   <li>flags</li>
      *   <li>refresh rate</li>
      *   <li>rotation</li>
-     * </ul> 
+     * </ul>
      * </p>
      * {@inheritDoc}
      */
@@ -399,9 +399,9 @@ public class MonitorMode implements Comparable<MonitorMode> {
         }
         return 0;
     }
-    
+
     /**
-     * Tests equality of two {@link MonitorMode} objects 
+     * Tests equality of two {@link MonitorMode} objects
      * by evaluating equality of it's components:<br/>
      * <ul>
      *  <li><code>nativeId</code></li>
@@ -438,7 +438,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
         hash = ((hash << 5) - hash) + getRotation();
         return hash;
     }
-    
+
     private final int getRotatedWH(boolean width) {
         final DimensionImmutable d = sizeAndRRate.surfaceSize.getResolution();
         final boolean swap = MonitorMode.ROTATE_90 == rotation || MonitorMode.ROTATE_270 == rotation ;
@@ -446,5 +446,5 @@ public class MonitorMode implements Comparable<MonitorMode> {
             return d.getHeight();
         }
         return d.getWidth();
-    }    
+    }
 }
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index e66b2f624..7116877a3 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt;
@@ -53,16 +53,16 @@ public class NewtFactory {
     public static final boolean DEBUG_IMPLEMENTATION = Debug.debug("Window");
 
     public static final String DRIVER_DEFAULT_ROOT_PACKAGE = "jogamp.newt.driver";
-    
+
     static {
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 NativeWindowFactory.initSingleton(); // last resort ..
-                
+
                 // Work-around for initialization order problems on Mac OS X
                 // between native Newt and (apparently) Fmod
                 WindowImpl.init(NativeWindowFactory.getNativeWindowType(true));
-                
+
                 return null;
             } } );
     }
@@ -75,7 +75,7 @@ public class NewtFactory {
                 clazzName = DRIVER_DEFAULT_ROOT_PACKAGE + packageName + "." + classBaseName ;
             } else {
                 clazzName = packageName + "." + classBaseName ;
-            }            
+            }
             try {
                 clazz = Class.forName(clazzName);
             } catch (Throwable t) {
@@ -90,7 +90,7 @@ public class NewtFactory {
 
     private static boolean useEDT = true;
 
-    /** 
+    /**
      * Toggles the usage of an EventDispatchThread while creating a Display.<br>
      * The default is enabled.<br>
      * The EventDispatchThread is thread local to the Display instance.<br>
@@ -108,7 +108,7 @@ public class NewtFactory {
      * Native creation is lazily done at usage, ie. {@link Display#addReference()}.
      * </p>
      * <p>
-     * An already existing display connection of the same <code>name</code> will be reused.  
+     * An already existing display connection of the same <code>name</code> will be reused.
      * </p>
      * @param name the display connection name which is a technical platform specific detail,
      *        see {@link AbstractGraphicsDevice#getConnection()}. Use <code>null</code> for default.
diff --git a/src/newt/classes/com/jogamp/newt/NewtVersion.java b/src/newt/classes/com/jogamp/newt/NewtVersion.java
index 9adb7aac5..e70d63f88 100644
--- a/src/newt/classes/com/jogamp/newt/NewtVersion.java
+++ b/src/newt/classes/com/jogamp/newt/NewtVersion.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt;
 
 import com.jogamp.common.GlueGenVersion;
diff --git a/src/newt/classes/com/jogamp/newt/Screen.java b/src/newt/classes/com/jogamp/newt/Screen.java
index f56ee344b..1274b3459 100644
--- a/src/newt/classes/com/jogamp/newt/Screen.java
+++ b/src/newt/classes/com/jogamp/newt/Screen.java
@@ -39,7 +39,7 @@ import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
 
-/** 
+/**
  * A screen may span multiple {@link MonitorDevice}s representing their combined virtual size.
  */
 public abstract class Screen {
@@ -102,7 +102,7 @@ public abstract class Screen {
 
     /**
      * See {@link Display#addReference()}
-     * 
+     *
      * @return number of references post operation
      * @throws NativeWindowException if the native creation failed.
      * @see #removeReference()
@@ -113,7 +113,7 @@ public abstract class Screen {
 
     /**
      * See {@link Display#removeReference()}
-     * 
+     *
      * @return number of references post operation
      * @see #addReference()
      * @see #setDestroyWhenUnused(boolean)
@@ -132,12 +132,12 @@ public abstract class Screen {
      * @return the x position of the virtual viewport's top-left origin.
      */
     public abstract int getX();
-    
+
     /**
      * @return the y position of the virtual viewport's top-left origin.
      */
     public abstract int getY();
-    
+
     /**
      * @return the <b>rotated</b> virtual viewport's width.
      */
@@ -152,19 +152,19 @@ public abstract class Screen {
      * @return the <b>rotated</b> virtual viewport, i.e. origin and size.
      */
     public abstract RectangleImmutable getViewport();
-    
+
     /**
      * @return the associated Display
      */
     public abstract Display getDisplay();
 
-    /** 
+    /**
      * @return The screen fully qualified Screen name,
      * which is a key of {@link com.jogamp.newt.Display#getFQName()} + {@link #getIndex()}.
      */
     public abstract String getFQName();
 
-    /** 
+    /**
      * Return a list of all {@link MonitorMode}s for all {@link MonitorDevice}s.
      * <p>
      * The list is ordered in descending order,
@@ -173,23 +173,23 @@ public abstract class Screen {
      */
     public abstract List<MonitorMode> getMonitorModes();
 
-    /** 
+    /**
      * Return a list of available {@link MonitorDevice}s.
      */
     public abstract List<MonitorDevice> getMonitorDevices();
 
     /**
-     * Returns the {@link MonitorDevice} which {@link MonitorDevice#getViewport() viewport} 
+     * Returns the {@link MonitorDevice} which {@link MonitorDevice#getViewport() viewport}
      * {@link MonitorDevice#coverage(RectangleImmutable) covers} the given rectangle the most.
      * <p>
-     * If no coverage is detected the first {@link MonitorDevice} is returned. 
+     * If no coverage is detected the first {@link MonitorDevice} is returned.
      * </p>
      */
     public final MonitorDevice getMainMonitor(RectangleImmutable r) {
         MonitorDevice res = null;
         float maxCoverage = Float.MIN_VALUE;
         final List<MonitorDevice> monitors = getMonitorDevices();
-        for(int i=monitors.size()-1; i>=0; i--) {            
+        for(int i=monitors.size()-1; i>=0; i--) {
             final MonitorDevice monitor = monitors.get(i);
             final float coverage = monitor.coverage(r);
             if( coverage > maxCoverage ) {
@@ -207,14 +207,14 @@ public abstract class Screen {
      * Returns the union of all monitor's {@link MonitorDevice#getViewport() viewport}.
      * <p>
      * Should be equal to {@link #getX()}, {@link #getY()}, {@link #getWidth()} and {@link #getHeight()},
-     * however, some native toolkits may choose a different virtual screen area. 
+     * however, some native toolkits may choose a different virtual screen area.
      * </p>
      * @param result storage for result, will be returned
      */
     public final Rectangle unionOfMonitorViewportSize(final Rectangle result) {
         return MonitorDevice.unionOfViewports(result, getMonitorDevices());
     }
-    
+
     /**
      * @param sml {@link MonitorModeListener} to be added for {@link MonitorEvent}
      */
@@ -274,7 +274,7 @@ public abstract class Screen {
         }
         return null;
     }
-    
+
     protected static void addScreen2List(Screen screen) {
         synchronized(screenList) {
             // GC before add
@@ -289,7 +289,7 @@ public abstract class Screen {
             screenList.add(new WeakReference<Screen>(screen));
         }
     }
-    
+
     /** Returns the global screen collection */
     public static Collection<Screen> getAllScreens() {
         ArrayList<Screen> list;
@@ -308,7 +308,7 @@ public abstract class Screen {
         }
         return list;
     }
-    
+
     public static int getActiveScreenNumber() {
         synchronized(screenList) {
             return screensActive;
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index 02727353f..04eb07a25 100644
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -58,8 +58,8 @@ import javax.media.nativewindow.util.RectangleImmutable;
  *   <li>... and more</li>
  * </ul>
  * <p>
- * One use case is {@link com.jogamp.newt.opengl.GLWindow}, which delegates 
- * window operation to an instance of this interface while providing OpenGL 
+ * One use case is {@link com.jogamp.newt.opengl.GLWindow}, which delegates
+ * window operation to an instance of this interface while providing OpenGL
  * functionality.
  * </p>
  */
@@ -90,14 +90,14 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
     Screen getScreen();
 
     /**
-     * Returns the {@link MonitorDevice} which {@link MonitorDevice#getViewport() viewport} 
+     * Returns the {@link MonitorDevice} which {@link MonitorDevice#getViewport() viewport}
      * {@link MonitorDevice#coverage(RectangleImmutable) covers} this window the most.
      * <p>
-     * If no coverage is detected the first {@link MonitorDevice} is returned. 
+     * If no coverage is detected the first {@link MonitorDevice} is returned.
      * </p>
      */
     MonitorDevice getMainMonitor();
-    
+
     /**
      * Set the CapabilitiesChooser to help determine the native visual type.
      *
@@ -129,7 +129,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      * Visibility is set to false.
      * </p>
      * <p>
-     * Method sends out {@link WindowEvent#EVENT_WINDOW_DESTROY_NOTIFY pre-} and 
+     * Method sends out {@link WindowEvent#EVENT_WINDOW_DESTROY_NOTIFY pre-} and
      * {@link WindowEvent#EVENT_WINDOW_DESTROYED post-} destruction events
      * to all of it's {@link WindowListener}.
      * </p>
@@ -151,7 +151,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      * Set a custom action handling destruction issued by a {@link WindowImpl#windowDestroyNotify(boolean) toolkit triggered window destroy}
      * replacing the default {@link #destroy()} action.
      * <p>
-     * The custom action shall call {@link #destroy()} 
+     * The custom action shall call {@link #destroy()}
      * but may perform further tasks before and after.
      * </p>
      */
@@ -369,7 +369,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      * @param x new top-level position, use -1 for default position.
      * @param y new top-level position, use -1 for default position.
      * @param forceDestroyCreate if true, uses re-creation strategy for reparenting, default is <code>false</code>.
-     * 
+     *
      * @return The issued reparent action type (strategy) as defined in Window.ReparentAction
      * @see #reparentWindow(NativeWindow)
      */
@@ -378,7 +378,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
     /**
      * Enable or disable fullscreen mode for this window.
      * <p>
-     * Fullscreen mode is established on the {@link #getMainMonitor() main monitor}. 
+     * Fullscreen mode is established on the {@link #getMainMonitor() main monitor}.
      * </p>
      * @param fullscreen enable or disable fullscreen mode
      * @return success
@@ -393,14 +393,14 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      * <p>
      * Disable fullscreen via {@link #setFullscreen(boolean)}.
      * </p>
-     * @param monitors if <code>null</code> fullscreen will be spanned across all {@link MonitorDevice}s, 
+     * @param monitors if <code>null</code> fullscreen will be spanned across all {@link MonitorDevice}s,
      *                 otherwise across the given list of {@link MonitorDevice}.
      * @return success
      * @see #setFullscreen(boolean)
      * @see #isFullscreen()
      */
     boolean setFullscreen(List<MonitorDevice> monitors);
-    
+
     boolean isFullscreen();
 
     static interface FocusRunnable {
@@ -429,7 +429,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      * and to perform focus traversal with a 3rd party toolkit.
      * </p>
      * <p>
-     * The {@link KeyListener} methods are not invoked for {@link KeyEvent#isAutoRepeat() auto-repeat} events. 
+     * The {@link KeyListener} methods are not invoked for {@link KeyEvent#isAutoRepeat() auto-repeat} events.
      * </p>
      * @param l
      */
@@ -469,7 +469,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
 
     /**
      * Send a {@link WindowEvent} to all {@link WindowListener}.
-     * @param eventType a {@link WindowEvent} type, e.g. {@link WindowEvent#EVENT_WINDOW_REPAINT}. 
+     * @param eventType a {@link WindowEvent} type, e.g. {@link WindowEvent#EVENT_WINDOW_REPAINT}.
      */
     public void sendWindowEvent(int eventType);
 
@@ -585,8 +585,8 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      * Returns all {@link MouseListener}
      */
     MouseListener[] getMouseListeners();
-    
-    /** Enable or disable default {@link GestureHandler}. Default is enabled. */  
+
+    /** Enable or disable default {@link GestureHandler}. Default is enabled. */
     void setDefaultGesturesEnabled(boolean enable);
     /** Return true if default {@link GestureHandler} are enabled. */
     boolean areDefaultGesturesEnabled();
@@ -627,5 +627,5 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
     /**
      * Removes the given {@link GestureHandler.GestureListener} from the list.
      */
-    void removeGestureListener(GestureHandler.GestureListener gl);    
+    void removeGestureListener(GestureHandler.GestureListener gl);
 }
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index 13affdf49..de1b7224f 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 
 package com.jogamp.newt.awt;
 
@@ -84,11 +84,11 @@ import com.jogamp.opengl.util.TileRenderer;
 
 /**
  * AWT {@link java.awt.Canvas Canvas} containing a NEWT {@link Window} using native parenting.
- *  
+ *
  * <h5><A NAME="java2dgl">Offscreen Layer Remarks</A></h5>
- * 
+ *
  * {@link OffscreenLayerOption#setShallUseOffscreenLayer(boolean) setShallUseOffscreenLayer(true)}
- * maybe called to use an offscreen drawable (FBO or PBuffer) allowing 
+ * maybe called to use an offscreen drawable (FBO or PBuffer) allowing
  * the underlying JAWT mechanism to composite the image, if supported.
  */
 @SuppressWarnings("serial")
@@ -104,7 +104,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     private AWTParentWindowAdapter awtAdapter = null;
     private AWTAdapter awtMouseAdapter = null;
     private AWTAdapter awtKeyAdapter = null;
-    
+
     private AWTWindowClosingProtocol awtWindowClosingProtocol =
           new AWTWindowClosingProtocol(this, new Runnable() {
                 public void run() {
@@ -115,7 +115,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                     if( newtChild != null ) {
                         newtChild.sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
                     }
-                }                
+                }
             } );
 
     /**
@@ -147,36 +147,36 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         super(gc);
         setNEWTChild(child);
     }
-    
+
     public void setShallUseOffscreenLayer(boolean v) {
         shallUseOffscreenLayer = v;
     }
-    
+
     public final boolean getShallUseOffscreenLayer() {
-        return shallUseOffscreenLayer;        
+        return shallUseOffscreenLayer;
     }
-    
-    public final boolean isOffscreenLayerSurfaceEnabled() { 
+
+    public final boolean isOffscreenLayerSurfaceEnabled() {
         return jawtWindow.isOffscreenLayerSurfaceEnabled();
     }
-      
-    /** 
-     * Returns true if the AWT component is parented to an {@link java.applet.Applet}, 
-     * otherwise false. This information is valid only after {@link #addNotify()} is issued, 
-     * ie. before adding the component to the AWT tree and make it visible. 
+
+    /**
+     * Returns true if the AWT component is parented to an {@link java.applet.Applet},
+     * otherwise false. This information is valid only after {@link #addNotify()} is issued,
+     * ie. before adding the component to the AWT tree and make it visible.
      */
     public boolean isApplet() {
         return jawtWindow.isApplet();
     }
 
     boolean isParent() {
-        return null!=newtChild && jawtWindow == newtChild.getParent();        
+        return null!=newtChild && jawtWindow == newtChild.getParent();
     }
-    
+
     boolean isFullscreen() {
         return null != newtChild && newtChild.isFullscreen();
     }
-    
+
     class FocusAction implements Window.FocusRunnable {
         public boolean run() {
             final boolean isParent = isParent();
@@ -199,7 +199,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         }
     }
     private FocusAction focusAction = new FocusAction();
-    
+
     WindowListener clearAWTMenusOnNewtFocus = new WindowAdapter() {
           @Override
           public void windowResized(WindowEvent e) {
@@ -224,15 +224,15 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                  handleKey(e, true);
              }
          }
-         
-         void handleKey(KeyEvent evt, boolean onRelease) {   
+
+         void handleKey(KeyEvent evt, boolean onRelease) {
              if(null == keyboardFocusManager) {
                  throw new InternalError("XXX");
              }
              final AWTKeyStroke ks = AWTKeyStroke.getAWTKeyStroke(evt.getKeyCode(), evt.getModifiers(), onRelease);
              boolean suppress = false;
              if(null != ks) {
-                 final Set<AWTKeyStroke> fwdKeys = keyboardFocusManager.getDefaultFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); 
+                 final Set<AWTKeyStroke> fwdKeys = keyboardFocusManager.getDefaultFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
                  final Set<AWTKeyStroke> bwdKeys = keyboardFocusManager.getDefaultFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
                  if(fwdKeys.contains(ks)) {
                      final Component nextFocus = AWTMisc.getNextFocus(NewtCanvasAWT.this, true /* forward */);
@@ -253,38 +253,38 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                  }
              }
              if(suppress) {
-                 evt.setConsumed(true);                 
+                 evt.setConsumed(true);
              }
              if(DEBUG) {
                  System.err.println("NewtCanvasAWT.focusKey: XXX: "+ks);
              }
          }
     }
-    private final FocusTraversalKeyListener newtFocusTraversalKeyListener = new FocusTraversalKeyListener(); 
+    private final FocusTraversalKeyListener newtFocusTraversalKeyListener = new FocusTraversalKeyListener();
 
     class FocusPropertyChangeListener implements PropertyChangeListener {
         public void propertyChange(PropertyChangeEvent evt) {
             final Object oldF = evt.getOldValue();
             final Object newF = evt.getNewValue();
             final boolean isParent = isParent();
-            final boolean isFullscreen = isFullscreen(); 
+            final boolean isFullscreen = isFullscreen();
             if(DEBUG) {
                 System.err.println("NewtCanvasAWT.FocusProperty: "+evt.getPropertyName()+", src "+evt.getSource()+", "+oldF+" -> "+newF+", isParent "+isParent+", isFS "+isFullscreen);
             }
             if(isParent && !isFullscreen) {
                 if(newF == NewtCanvasAWT.this) {
-                    if(DEBUG) {                    
+                    if(DEBUG) {
                         System.err.println("NewtCanvasAWT.FocusProperty: AWT focus -> NEWT focus traversal");
                     }
                     requestFocusNEWTChild();
                 } else if(oldF == NewtCanvasAWT.this && newF == null) {
                     // focus traversal to NEWT - NOP
-                    if(DEBUG) {                    
+                    if(DEBUG) {
                         System.err.println("NewtCanvasAWT.FocusProperty: NEWT focus");
                     }
                 } else if(null != newF && newF != NewtCanvasAWT.this) {
                     // focus traversal to another AWT component
-                    if(DEBUG) {                    
+                    if(DEBUG) {
                         System.err.println("NewtCanvasAWT.FocusProperty: lost focus - clear focus");
                     }
                     if(newtChild.getDelegatedWindow() instanceof DriverClearFocus) {
@@ -292,7 +292,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                     }
                 }
             }
-        }        
+        }
     }
     private final FocusPropertyChangeListener focusPropertyChangeListener = new FocusPropertyChangeListener();
     private volatile KeyboardFocusManager keyboardFocusManager = null;
@@ -300,7 +300,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     private final void requestFocusNEWTChild() {
         if(null!=newtChild) {
             newtChild.setFocusAction(null);
-            if(isOnscreen) {                    
+            if(isOnscreen) {
                 KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
             }
             newtChild.requestFocus();
@@ -308,17 +308,17 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         }
     }
 
-    /** 
+    /**
      * Sets a new NEWT child, provoking reparenting.
      * <p>
      * A previously detached <code>newChild</code> will be released to top-level status
-     * and made invisible. 
+     * and made invisible.
      * </p>
      * <p>
-     * Note: When switching NEWT child's, detaching the previous first via <code>setNEWTChild(null)</code> 
-     * produced much cleaner visual results. 
+     * Note: When switching NEWT child's, detaching the previous first via <code>setNEWTChild(null)</code>
+     * produced much cleaner visual results.
      * </p>
-     * @return the previous attached newt child.  
+     * @return the previous attached newt child.
      */
     public Window setNEWTChild(Window newChild) {
         final Window prevChild = newtChild;
@@ -336,17 +336,17 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
 
         updateLayoutSize();
         // will be done later at paint/display/..: attachNewtChild(cont);
-        
+
         return prevChild;
     }
-    
+
     private final void updateLayoutSize() {
         if( null != newtChild ) {
             // use NEWT child's size for min/pref size!
             java.awt.Dimension minSize = new java.awt.Dimension(newtChild.getWidth(), newtChild.getHeight());
             setMinimumSize(minSize);
             setPreferredSize(minSize);
-        }        
+        }
     }
 
     /** @return the current NEWT child */
@@ -357,7 +357,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     /** @return this AWT Canvas NativeWindow representation, may be null in case {@link #removeNotify()} has been called,
      * or {@link #addNotify()} hasn't been called yet.*/
     public NativeWindow getNativeWindow() { return jawtWindow; }
-    
+
     public WindowClosingMode getDefaultCloseOperation() {
         return awtWindowClosingProtocol.getDefaultCloseOperation();
     }
@@ -373,16 +373,16 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         } else {
             // before native peer is valid: X11
             disableBackgroundErase();
-    
+
             // creates the native peer
             super.addNotify();
-    
+
             // after native peer is valid: Windows
             disableBackgroundErase();
-                
-            jawtWindow = NewtFactoryAWT.getNativeWindow(this, null != newtChild ? newtChild.getRequestedCapabilities() : null);          
+
+            jawtWindow = NewtFactoryAWT.getNativeWindow(this, null != newtChild ? newtChild.getRequestedCapabilities() : null);
             jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer);
-            
+
             if(DEBUG) {
                 // if ( isShowing() == false ) -> Container was not visible yet.
                 // if ( isShowing() == true  ) -> Container is already visible.
@@ -397,7 +397,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     @Override
     public void removeNotify() {
         awtWindowClosingProtocol.removeClosingListener();
-        
+
         if( Beans.isDesignTime() ) {
             super.removeNotify();
         } else {
@@ -419,7 +419,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     public final void destroy() {
         destroyImpl(false /* removeNotify */, false /* windowClosing */);
     }
-    
+
     private final void destroyImpl(boolean removeNotify, boolean windowClosing) {
         if( null !=newtChild ) {
             java.awt.Container cont = AWTMisc.getContainer(this);
@@ -427,7 +427,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                 System.err.println("NewtCanvasAWT.destroy(removeNotify "+removeNotify+", windowClosing "+windowClosing+"): nw "+newtWinHandleToHexString(newtChild)+", from "+cont);
             }
             detachNewtChild(cont);
-            
+
             if( !removeNotify ) {
                 final Window cWin = newtChild;
                 final Window dWin = cWin.getDelegatedWindow();
@@ -437,14 +437,14 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                 } else {
                     cWin.destroy();
                 }
-            }            
+            }
         }
         if( ( removeNotify || windowClosing ) && null!=jawtWindow ) {
             NewtFactoryAWT.destroyNativeWindow(jawtWindow);
             jawtWindow=null;
-        }        
+        }
     }
-    
+
     @Override
     public void paint(Graphics g) {
         if( validateComponent(true) && !printActive ) {
@@ -469,9 +469,9 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
             }
         }
     }
-     
+
     private volatile boolean printActive = false;
-    private GLAnimatorControl printAnimator = null; 
+    private GLAnimatorControl printAnimator = null;
     private GLAutoDrawable printGLAD = null;
     private AWTTilePainter printAWTTiles = null;
 
@@ -481,15 +481,15 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         }
         return null;
     }
-    
+
     @Override
     public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
-        printActive = true; 
+        printActive = true;
         final int componentCount = isOpaque() ? 3 : 4;
         final TileRenderer printRenderer = new TileRenderer();
         printAWTTiles = new AWTTilePainter(printRenderer, componentCount, scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight, DEBUG);
         AWTEDTExecutor.singleton.invoke(getTreeLock(), true /* allowOnNonEDT */, true /* wait */, setupPrintOnEDT);
-    }  
+    }
     private final Runnable setupPrintOnEDT = new Runnable() {
         @Override
         public void run() {
@@ -497,14 +497,14 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                 if(DEBUG) {
                     System.err.println(getThreadName()+": Info: NewtCanvasAWT setupPrint - skipped GL render, drawable not valid yet");
                 }
-                printActive = false; 
+                printActive = false;
                 return; // not yet available ..
             }
             if( !isVisible() ) {
                 if(DEBUG) {
                     System.err.println(getThreadName()+": Info: NewtCanvasAWT setupPrint - skipped GL render, drawable visible");
                 }
-                printActive = false; 
+                printActive = false;
                 return; // not yet available ..
             }
             final GLAutoDrawable glad = getGLAD();
@@ -512,14 +512,14 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                 if( DEBUG ) {
                     System.err.println("AWT print.setup exit, newtChild not a GLAutoDrawable: "+newtChild);
                 }
-                printActive = false; 
+                printActive = false;
                 return;
             }
             printAnimator =  glad.getAnimator();
             if( null != printAnimator ) {
                 printAnimator.remove(glad);
             }
-            printGLAD = glad; // _not_ default, shall be replaced by offscreen GLAD                      
+            printGLAD = glad; // _not_ default, shall be replaced by offscreen GLAD
             final GLCapabilities caps = (GLCapabilities)glad.getChosenGLCapabilities().cloneMutable();
             final int printNumSamples = printAWTTiles.getNumSamples(caps);
             GLDrawable printDrawable = printGLAD.getDelegatedDrawable();
@@ -527,7 +527,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
             final boolean reqNewGLADSize = printAWTTiles.customTileWidth != -1 && printAWTTiles.customTileWidth != printDrawable.getWidth() ||
                                            printAWTTiles.customTileHeight != -1 && printAWTTiles.customTileHeight != printDrawable.getHeight();
             final boolean reqNewGLADOnscrn = caps.isOnscreen();
-            
+
             // It is desired to use a new offscreen GLAD, however Bug 830 forbids this for AA onscreen context.
             // Bug 830: swapGLContextAndAllGLEventListener and onscreen MSAA w/ NV/GLX
             final boolean reqNewGLAD = !caps.getSampleBuffers() && ( reqNewGLADOnscrn || reqNewGLADSamples || reqNewGLADSize );
@@ -546,8 +546,8 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                     caps.setNumSamples(printNumSamples);
                 }
                 final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-                printGLAD = factory.createOffscreenAutoDrawable(null, caps, null, 
-                        printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE, 
+                printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
+                        printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
                         printAWTTiles.customTileHeight != -1 ? printAWTTiles.customTileHeight : DEFAULT_PRINT_TILE_SIZE,
                         null);
                 GLDrawableUtil.swapGLContextAndAllGLEventListener(glad, printGLAD);
@@ -634,7 +634,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
             System.err.println("AWT print.X: "+printAWTTiles);
         }
     }
-    
+
     private final boolean validateComponent(boolean attachNewtChild) {
         if( Beans.isDesignTime() || !isDisplayable() ) {
             return false;
@@ -645,14 +645,14 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         if( 0 >= getWidth() || 0 >= getHeight() ) {
             return false;
         }
-        
+
         if( attachNewtChild && !newtChildAttached && null != newtChild ) {
             attachNewtChild();
         }
 
         return true;
     }
-    
+
     private final void configureNewtChild(boolean attach) {
         if(null!=awtAdapter) {
           awtAdapter.removeFrom(this);
@@ -670,13 +670,13 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
             keyboardFocusManager.removePropertyChangeListener("focusOwner", focusPropertyChangeListener);
             keyboardFocusManager = null;
         }
-        
+
         if( null != newtChild ) {
             newtChild.setKeyboardFocusHandler(null);
             if(attach) {
                 if(null == jawtWindow.getGraphicsConfiguration()) {
                     throw new InternalError("XXX");
-                }                
+                }
                 isOnscreen = jawtWindow.getGraphicsConfiguration().getChosenCapabilities().isOnscreen();
                 awtAdapter = (AWTParentWindowAdapter) new AWTParentWindowAdapter(jawtWindow, newtChild).addTo(this);
                 awtAdapter.removeWindowClosingFrom(this); // we utilize AWTWindowClosingProtocol triggered destruction!
@@ -733,13 +733,13 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
       newtChild.reparentWindow(jawtWindow);
       newtChild.addSurfaceUpdatedListener(jawtWindow);
       if( jawtWindow.isOffscreenLayerSurfaceEnabled() &&
-          0 != ( JAWTUtil.JAWT_OSX_CALAYER_QUIRK_POSITION & JAWTUtil.getOSXCALayerQuirks() ) ) {          
+          0 != ( JAWTUtil.JAWT_OSX_CALAYER_QUIRK_POSITION & JAWTUtil.getOSXCALayerQuirks() ) ) {
           AWTEDTExecutor.singleton.invoke(false, forceRelayout);
       }
       newtChild.setVisible(true);
       configureNewtChild(true);
       newtChild.sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout to listener
-      
+
       if(DEBUG) {
           System.err.println("NewtCanvasAWT.attachNewtChild.X: win "+newtWinHandleToHexString(newtChild)+", EDTUtil: cur "+newtChild.getScreen().getDisplay().getEDTUtil()+", comp "+this);
       }
@@ -759,7 +759,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                 System.err.println("NewtCanvasAWT.forceRelayout.X");
             }
         }  };
-    
+
     private final void detachNewtChild(java.awt.Container cont) {
       if( null == newtChild || null == jawtWindow || !newtChildAttached ) {
           return; // nop
@@ -773,14 +773,14 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                              ", cont "+cont);
       }
 
-      newtChild.removeSurfaceUpdatedListener(jawtWindow);      
+      newtChild.removeSurfaceUpdatedListener(jawtWindow);
       newtChildAttached = false;
       newtChild.setFocusAction(null); // no AWT focus traversal ..
       configureNewtChild(false);
       newtChild.setVisible(false);
-      
+
       newtChild.reparentWindow(null); // will destroy context (offscreen -> onscreen) and implicit detachSurfaceLayer
-      
+
       if(DEBUG) {
           System.err.println("NewtCanvasAWT.detachNewtChild.X: win "+newtWinHandleToHexString(newtChild)+", EDTUtil: cur "+newtChild.getScreen().getDisplay().getEDTUtil()+", comp "+this);
       }
@@ -837,7 +837,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
   }
 
   protected static String getThreadName() { return Thread.currentThread().getName(); }
-  
+
   static String newtWinHandleToHexString(Window w) {
       return null != w ? toHexString(w.getWindowHandle()) : "nil";
   }
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
index c7153840f..9b1b82297 100644
--- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
+++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
@@ -47,12 +47,12 @@ import jogamp.nativewindow.jawt.JAWTUtil;
 import com.jogamp.newt.awt.NewtCanvasAWT;
 import com.jogamp.newt.opengl.GLWindow;
 
-/** 
+/**
  * Simple GLEventListener deployment as an applet using JOGL. This demo must be
  * referenced from a web page via an &lt;applet&gt; tag.
- * 
+ *
  *  <p>
- *  Example of an applet tag using GearsES2 within the applet area (normal case): 
+ *  Example of an applet tag using GearsES2 within the applet area (normal case):
  *  <pre>
         &lt;applet width=100 height=100&gt;
            &lt;param name="java_arguments" value="-Dsun.java2d.noddraw=true"&gt;
@@ -65,9 +65,9 @@ import com.jogamp.newt.opengl.GLWindow;
         &lt;/applet&gt;Hello Gears !
  *  </pre>
  *  </p>
- *  
+ *
  *  <p>
- *  Example of an applet tag using GearsES2 in an undecorated, translucent, closeable and always-on-top window: 
+ *  Example of an applet tag using GearsES2 in an undecorated, translucent, closeable and always-on-top window:
  *  <pre>
         &lt;applet width=1 height=1&gt;
            &lt;param name="java_arguments" value="-Dsun.java2d.noddraw=true"&gt;
@@ -95,12 +95,12 @@ import com.jogamp.newt.opengl.GLWindow;
 @SuppressWarnings("serial")
 public class JOGLNewtApplet1Run extends Applet {
     public static final boolean DEBUG = JOGLNewtAppletBase.DEBUG;
-    
+
     GLWindow glWindow = null;
     NewtCanvasAWT newtCanvasAWT = null;
     JOGLNewtAppletBase base = null;
     /** if valid glStandalone:=true (own window) ! */
-    int glXd=Integer.MAX_VALUE, glYd=Integer.MAX_VALUE, glWidth=Integer.MAX_VALUE, glHeight=Integer.MAX_VALUE; 
+    int glXd=Integer.MAX_VALUE, glYd=Integer.MAX_VALUE, glWidth=Integer.MAX_VALUE, glHeight=Integer.MAX_VALUE;
 
     public void init() {
         if(DEBUG) {
@@ -135,7 +135,7 @@ public class JOGLNewtApplet1Run extends Applet {
             glCloseable = JOGLNewtAppletBase.str2Bool(getParameter("gl_closeable"), glCloseable);
             glOpaque = JOGLNewtAppletBase.str2Bool(getParameter("gl_opaque"), glOpaque);
             glAlphaBits = JOGLNewtAppletBase.str2Int(getParameter("gl_alpha"), glAlphaBits);
-            glNumMultisampleBuffer = JOGLNewtAppletBase.str2Int(getParameter("gl_multisamplebuffer"), glNumMultisampleBuffer); 
+            glNumMultisampleBuffer = JOGLNewtAppletBase.str2Int(getParameter("gl_multisamplebuffer"), glNumMultisampleBuffer);
             glXd = JOGLNewtAppletBase.str2Int(getParameter("gl_dx"), glXd);
             glYd = JOGLNewtAppletBase.str2Int(getParameter("gl_dy"), glYd);
             glWidth = JOGLNewtAppletBase.str2Int(getParameter("gl_width"), glWidth);
@@ -168,8 +168,8 @@ public class JOGLNewtApplet1Run extends Applet {
             System.err.println("glNumMultisampleBuffer: "+glNumMultisampleBuffer);
             System.err.println("glNoDefaultKeyListener: "+glNoDefaultKeyListener);
         }
-        
-        base = new JOGLNewtAppletBase(glEventListenerClazzName, 
+
+        base = new JOGLNewtAppletBase(glEventListenerClazzName,
                                       glSwapInterval,
                                       glNoDefaultKeyListener,
                                       glCloseable,
@@ -252,9 +252,9 @@ public class JOGLNewtApplet1Run extends Applet {
             System.err.println("GLWindow: "+glWindow);
         }
         base.start();
-        if( null != newtCanvasAWT && 
+        if( null != newtCanvasAWT &&
             newtCanvasAWT.isOffscreenLayerSurfaceEnabled() &&
-            0 != ( JAWTUtil.JAWT_OSX_CALAYER_QUIRK_POSITION & JAWTUtil.getOSXCALayerQuirks() ) ) {          
+            0 != ( JAWTUtil.JAWT_OSX_CALAYER_QUIRK_POSITION & JAWTUtil.getOSXCALayerQuirks() ) ) {
             // force relayout
             final int cW = newtCanvasAWT.getWidth();
             final int cH = newtCanvasAWT.getHeight();
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
index 1004adb8e..a6a30a8bf 100644
--- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
+++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
@@ -57,7 +57,7 @@ import com.jogamp.opengl.util.Animator;
 
 public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
     public static final boolean DEBUG = Debug.debug("Applet");
-    
+
     String glEventListenerClazzName;
     int glSwapInterval;
     boolean noDefaultKeyListener;
@@ -71,13 +71,13 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
     boolean isValid = false;
     NativeWindow awtParent;
 
-    public JOGLNewtAppletBase(String glEventListenerClazzName, 
+    public JOGLNewtAppletBase(String glEventListenerClazzName,
                               int glSwapInterval,
                               boolean noDefaultKeyListener,
                               boolean glClosable,
                               boolean glDebug,
                               boolean glTrace) {
-    
+
         this.glEventListenerClazzName=glEventListenerClazzName;
         this.glSwapInterval=glSwapInterval;
         this.noDefaultKeyListener = noDefaultKeyListener;
@@ -174,8 +174,8 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
                                     glWindow.reparentWindow(awtParent);
                                 }
                                }
-                            }).start();                         
-                        }                        
+                            }).start();
+                        }
                     }
                 } } );
 
@@ -203,7 +203,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
             if(glEventListener instanceof KeyListener) {
                 glWindow.addKeyListener((KeyListener)glEventListener);
             }
-            
+
             if(!noDefaultKeyListener) {
                 glWindow.addKeyListener(this);
             }
@@ -216,7 +216,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
             glAnimator.setThreadGroup(tg);
             glAnimator.add(glWindow);
             glAnimator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, null);
-            
+
         } catch (Throwable t) {
             throw new RuntimeException(t);
         }
@@ -262,14 +262,14 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
         if(glDebug) {
             try {
                 _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, _gl, null) );
-            } catch (Exception e) {e.printStackTrace();} 
+            } catch (Exception e) {e.printStackTrace();}
         }
 
         if(glTrace) {
             try {
                 // Trace ..
                 _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, _gl, new Object[] { System.err } ) );
-            } catch (Exception e) {e.printStackTrace();} 
+            } catch (Exception e) {e.printStackTrace();}
         }
 
         if(glSwapInterval>=0) {
@@ -317,9 +317,9 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
             }
        }
     }
-    
+
     @Override
-    public void keyReleased(KeyEvent e) { 
+    public void keyReleased(KeyEvent e) {
     }
 }
 
diff --git a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
index bc67cbee6..7dda47534 100644
--- a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
@@ -41,15 +41,15 @@ import jogamp.newt.Debug;
  *
  *    - touchSlop (scaled in pixels):
  *       - Min. movement w/ 2 pointer within ScaledDoubleTapSlop starting 'scroll' mode
- *       
+ *
  *    - Avoid computation if not within gesture, especially for MOVE/DRAG
- *    
+ *
  *    - Only allow gesture to start with PRESS
- *    
- *    - Leave gesture completely with RELEASE of both/all fingers, or dist-diff exceeds doubleTapSlop 
- *    
+ *
+ *    - Leave gesture completely with RELEASE of both/all fingers, or dist-diff exceeds doubleTapSlop
+ *
  *    - Tolerate temporary lift 1 of 2 pointer
- *    
+ *
  *     - Always validate pointer-id
  * </pre>
  * </p>
@@ -74,27 +74,27 @@ public class DoubleTapScrollGesture implements GestureHandler {
     public static final int SCROLL_SLOP_PIXEL;
     /** Two pointer 'double tap' slop in pixels (fallback), defaults to 104 pixels. Can be overriden by integer property <code>newt.event.double_tap_slop_pixel</code>.*/
     public static final int DOUBLE_TAP_SLOP_PIXEL;
-    
+
     /** Scroll threshold in millimeter, defaults to 3 mm. Can be overriden by integer property <code>newt.event.scroll_slop_mm</code>.*/
     public static final float SCROLL_SLOP_MM;
     /** Two pointer 'double tap' slop in millimeter, defaults to 20 mm. Can be overriden by integer property <code>newt.event.double_tap_slop_mm</code>.*/
     public static final float DOUBLE_TAP_SLOP_MM;
-    
+
     static {
         Debug.initSingleton();
-        
+
         SCROLL_SLOP_PIXEL = Debug.getIntProperty("newt.event.scroll_slop_pixel", true, 16);
         DOUBLE_TAP_SLOP_PIXEL = Debug.getIntProperty("newt.event.double_tap_slop_pixel", true, 104);
         SCROLL_SLOP_MM = Debug.getIntProperty("newt.event.scroll_slop_mm", true, 3);
         DOUBLE_TAP_SLOP_MM = Debug.getIntProperty("newt.event.double_tap_slop_mm", true, 20);
     }
-    
+
     private static final int ST_NONE = 0;
     private static final int ST_1PRESS = 1;
     private static final int ST_2PRESS_T = 2;
     private static final int ST_2PRESS_C = 3;
     private static final int ST_SCROLL = 4;
-    
+
     private final int scrollSlop, scrollSlopSquare, doubleTapSlop, doubleTapSlopSquare;
     private final float[] scrollDistance = new float[] { 0f, 0f };
     private int[] pIds = new int[] { -1, -1 };
@@ -104,18 +104,18 @@ public class DoubleTapScrollGesture implements GestureHandler {
     private int lastX, lastY;
     private int pointerDownCount;
     private MouseEvent hitGestureEvent;
-        
+
     private static final int getSquareDistance(float x1, float y1, float x2, float y2) {
         final int deltaX = (int) x1 - (int) x2;
         final int deltaY = (int) y1 - (int) y2;
         return deltaX * deltaX + deltaY * deltaY;
     }
-    
+
     private int gesturePointers(final MouseEvent e, final int excludeIndex) {
-        int j = 0;       
+        int j = 0;
         for(int i=e.getPointerCount()-1; i>=0; i--) {
             if( excludeIndex != i ) {
-                final int id = e.getPointerId(i); 
+                final int id = e.getPointerId(i);
                 if( pIds[0] == id || pIds[1] == id ) {
                     j++;
                 }
@@ -123,10 +123,10 @@ public class DoubleTapScrollGesture implements GestureHandler {
         }
         return j;
     }
-    
+
     /**
      * scaledScrollSlop < scaledDoubleTapSlop
-     * @param scaledScrollSlop Distance a pointer can wander before we think the user is scrolling in <i>pixels</i>. 
+     * @param scaledScrollSlop Distance a pointer can wander before we think the user is scrolling in <i>pixels</i>.
      * @param scaledDoubleTapSlop Distance in <i>pixels</i> between the first touch and second touch to still be considered a double tap.
      */
     public DoubleTapScrollGesture(int scaledScrollSlop, int scaledDoubleTapSlop) {
@@ -137,9 +137,9 @@ public class DoubleTapScrollGesture implements GestureHandler {
         pointerDownCount = 0;
         clear(true);
         if(DEBUG) {
-            System.err.println("DoubleTapScroll    scrollSlop (scaled) "+scrollSlop);                               
-            System.err.println("DoubleTapScroll doubleTapSlop (scaled) "+doubleTapSlop);                               
-        }        
+            System.err.println("DoubleTapScroll    scrollSlop (scaled) "+scrollSlop);
+            System.err.println("DoubleTapScroll doubleTapSlop (scaled) "+doubleTapSlop);
+        }
     }
 
     public String toString() {
@@ -160,17 +160,17 @@ public class DoubleTapScrollGesture implements GestureHandler {
             lastY = 0;
         }
     }
-    
+
     @Override
     public boolean isWithinGesture() {
         return ST_2PRESS_C <= gestureState;
     }
-    
+
     @Override
     public boolean hasGesture() {
         return null != hitGestureEvent;
     }
-    
+
     @Override
     public InputEvent getGestureEvent() {
         if( null != hitGestureEvent ) {
@@ -184,17 +184,17 @@ public class DoubleTapScrollGesture implements GestureHandler {
                 modifiers |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
             }
             return new MouseEvent(MouseEvent.EVENT_MOUSE_WHEEL_MOVED, ge.getSource(), ge.getWhen(), modifiers,
-                                  ge.getAllPointerTypes(), ge.getAllPointerIDs(), 
-                                  ge.getAllX(), ge.getAllY(), ge.getAllPressures(), ge.getMaxPressure(), 
+                                  ge.getAllPointerTypes(), ge.getAllPointerIDs(),
+                                  ge.getAllX(), ge.getAllY(), ge.getAllPressures(), ge.getMaxPressure(),
                                   ge.getButton(), ge.getClickCount(), rotationXYZ, scrollSlop);
         }
         return null;
     }
-    
+
     public final float[] getScrollDistanceXY() {
         return scrollDistance;
     }
-    
+
     @Override
     public boolean process(final InputEvent in) {
         if( null != hitGestureEvent || !(in instanceof MouseEvent) ) {
@@ -220,7 +220,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
                     final int y1 = pe.getY(1);
                     final int xm = (x0+x1)/2;
                     final int ym = (y0+y1)/2;
-                   
+
                     if( ST_1PRESS == gestureState ) {
                         final int sqDist = getSquareDistance(x0, y0, x1, y1);
                         final boolean isDistWithinDoubleTapSlop = sqDist < doubleTapSlopSquare;
@@ -254,7 +254,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
                     System.err.println(this+".pressed: gPtr "+gPtr+", this "+lastX+"/"+lastY+", "+pe);
                 }
             } break;
-            
+
             case MouseEvent.EVENT_MOUSE_RELEASED: {
                 pointerDownCount--; // lifted
                 final int gPtr = gesturePointers(pe, 0); // w/o lifted pointer
@@ -269,7 +269,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
                     System.err.println(this+".released: gPtr "+gPtr+", "+pe);
                 }
             } break;
-            
+
             case MouseEvent.EVENT_MOUSE_DRAGGED: {
                 if( 2 == pointerDownCount && ST_1PRESS < gestureState ) {
                     final int gPtr = gesturePointers(pe, -1);
@@ -289,11 +289,11 @@ public class DoubleTapScrollGesture implements GestureHandler {
                                         gestureState = ST_SCROLL;
                                     }
                                 } break;
-                                
+
                                 case ST_2PRESS_C:
                                     gestureState = ST_SCROLL;
                                     break;
-                                
+
                                 case ST_SCROLL:
                                     scrollDistance[0] = lastX - xm;
                                     scrollDistance[1] = lastY - ym;
@@ -338,7 +338,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
                     }
                 }
             } break;
-            
+
             default:
         }
         return null != hitGestureEvent;
diff --git a/src/newt/classes/com/jogamp/newt/event/GestureHandler.java b/src/newt/classes/com/jogamp/newt/event/GestureHandler.java
index 2c8f29bb7..2e98a8a01 100644
--- a/src/newt/classes/com/jogamp/newt/event/GestureHandler.java
+++ b/src/newt/classes/com/jogamp/newt/event/GestureHandler.java
@@ -30,7 +30,7 @@ package com.jogamp.newt.event;
 import jogamp.newt.Debug;
 
 /**
- * Generic gesture handler interface designed to allow pass-through 
+ * Generic gesture handler interface designed to allow pass-through
  * filtering of {@link InputEvent}s.
  * <p>
  * To avoid negative impact on event processing,
@@ -44,18 +44,18 @@ import jogamp.newt.Debug;
  */
 public interface GestureHandler {
     public static final boolean DEBUG = Debug.debug("Window.MouseEvent");
-    
+
     /** A custom gesture event */
     @SuppressWarnings("serial")
     public static class GestureEvent extends InputEvent {
         /** A gesture has been detected. */
         public static final short EVENT_GESTURE_DETECTED = 400;
-        
+
         private final GestureHandler handler;
-        
+
         /**
          * Creates a gesture event with default type {@link #EVENT_GESTURE_DETECTED}.
-         * 
+         *
          * @param source
          * @param when
          * @param modifiers
@@ -65,7 +65,7 @@ public interface GestureHandler {
             super(EVENT_GESTURE_DETECTED, source, when, modifiers);
             this.handler = handler;
         }
-        
+
         /**
          * Creates a gesture event with custom <i>event_type</i> !
          * @param event_type must lie within [400..599]
@@ -78,14 +78,14 @@ public interface GestureHandler {
             super(event_type, source, when, modifiers);
             this.handler = handler;
         }
-        
+
         /** Return the {@link GestureHandler}, which produced the event. */
         public final GestureHandler getHandler() { return handler; }
     }
-    
+
     /**
      * Listener for {@link GestureEvent}s.
-     * 
+     *
      * @see GestureEvent
      */
     public static interface GestureListener extends NEWTEventListener
@@ -93,50 +93,50 @@ public interface GestureHandler {
         /** {@link GestureHandler} {@link GestureHandler#hasGesture() has detected} the gesture. */
         public void gestureDetected(GestureEvent gh);
     }
-    
-    /** 
-     * Clears state of handler, i.e. resets all states incl. previous detected gesture. 
+
+    /**
+     * Clears state of handler, i.e. resets all states incl. previous detected gesture.
      * @param clearStarted if true, also clears {@link #isWithinGesture() started} state,
      *                     otherwise stay within gesture - if appropriate.
-     *                     Staying within a gesture allows fluent continuous gesture sequence, 
-     *                     e.g. for scrolling. 
+     *                     Staying within a gesture allows fluent continuous gesture sequence,
+     *                     e.g. for scrolling.
      */
     public void clear(boolean clearStarted);
-    
-    /** 
+
+    /**
      * Returns true if a previous {@link #process(InputEvent)} command produced a gesture,
-     * which has not been {@link #clear(boolean) cleared}. 
+     * which has not been {@link #clear(boolean) cleared}.
      * Otherwise returns false.
-     */ 
+     */
     public boolean hasGesture();
-    
-    /** 
+
+    /**
      * Returns the corresponding {@link InputEvent} for the gesture as detected by
      * a previous {@link #process(InputEvent)}, which has not been {@link #clear(boolean) cleared}.
      * Otherwise returns null.
      * <p>
      * Only implemented for gestures mapping to {@link InputEvent}s.
-     * </p> 
-     */ 
+     * </p>
+     */
     public InputEvent getGestureEvent();
-    
-    /** 
+
+    /**
      * Returns true if within a gesture as detected by a previous {@link #process(InputEvent)} command,
-     * which has not been {@link #clear(boolean) cleared}. 
+     * which has not been {@link #clear(boolean) cleared}.
      * Otherwise returns false.
-     */ 
+     */
     public boolean isWithinGesture();
 
     /**
      * Process the given {@link InputEvent} and returns true if it produced the gesture.
      * Otherwise returns false.
      * <p>
-     * If a gesture was already detected previously and has not been cleared, 
-     * method does not process the event and returns true. 
+     * If a gesture was already detected previously and has not been cleared,
+     * method does not process the event and returns true.
      * </p>
      * <p>
-     * Besides validation of the event's details, 
-     * the handler may also validate the {@link InputEvent.InputClass} and/or {@link InputEvent.InputType}.  
+     * Besides validation of the event's details,
+     * the handler may also validate the {@link InputEvent.InputClass} and/or {@link InputEvent.InputType}.
      * </p>
      */
     public boolean process(InputEvent e);
diff --git a/src/newt/classes/com/jogamp/newt/event/InputEvent.java b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
index 1bd67efa5..6520dafcf 100644
--- a/src/newt/classes/com/jogamp/newt/event/InputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt.event;
@@ -43,17 +43,17 @@ public abstract class InputEvent extends NEWTEvent
  /** Interface marking class of input types */
  public static interface InputClass {
  }
-    
+
  /** Interface marking type of input devices */
  public static interface InputType {
  }
-    
+
  public static final int  SHIFT_MASK       = 1 <<  0;
  public static final int  CTRL_MASK        = 1 <<  1;
  public static final int  META_MASK        = 1 <<  2;
  public static final int  ALT_MASK         = 1 <<  3;
  public static final int  ALT_GRAPH_MASK   = 1 <<  4;
- 
+
  public static final int  BUTTON1_MASK     = 1 <<  5;
  public static final int  BUTTON2_MASK     = 1 <<  6;
  public static final int  BUTTON3_MASK     = 1 <<  7;
@@ -63,23 +63,23 @@ public abstract class InputEvent extends NEWTEvent
  public static final int  BUTTON7_MASK     = 1 << 11;
  public static final int  BUTTON8_MASK     = 1 << 12;
  public static final int  BUTTON9_MASK     = 1 << 13;
- 
+
  public static final int  BUTTONLAST_MASK  = 1 << 20;  // 16 buttons
  public static final int  BUTTONALL_MASK   = 0xffff << 5 ;  // 16 buttons
- 
+
  /** Event is caused by auto-repeat. */
  public static final int  AUTOREPEAT_MASK  = 1 << 29;
- 
+
  /** Pointer is confined, see {@link Window#confinePointer(boolean)}. */
  public static final int  CONFINED_MASK    = 1 << 30;
- 
+
  /** Pointer is invisible, see {@link Window#setPointerVisible(boolean)}. */
  public static final int  INVISIBLE_MASK   = 1 << 31;
 
- /** 
+ /**
   * Returns the corresponding button mask for the given button.
   * <p>
-  * In case the given button lies outside 
+  * In case the given button lies outside
   * of the valid range [{@link MouseEvent#BUTTON1} .. {@link MouseEvent#BUTTON_COUNT}],
   * null is returned.
   * </p>
@@ -90,7 +90,7 @@ public abstract class InputEvent extends NEWTEvent
      }
      return 0;
  }
- 
+
  protected InputEvent(short eventType, Object source, long when, int modifiers) {
     super(eventType, source, when);
     this.modifiers=modifiers;
@@ -128,11 +128,11 @@ public abstract class InputEvent extends NEWTEvent
  public boolean isConfined()  {
     return (modifiers&CONFINED_MASK)!=0;
  }
- /** {@link #getModifiers()} contains {@link #INVISIBLE_MASK}. Pointer is invisible, see {@link Window#setPointerVisible(boolean)}. */ 
+ /** {@link #getModifiers()} contains {@link #INVISIBLE_MASK}. Pointer is invisible, see {@link Window#setPointerVisible(boolean)}. */
  public boolean isInvisible()  {
     return (modifiers&INVISIBLE_MASK)!=0;
  }
- 
+
  public StringBuilder getModifiersString(StringBuilder sb) {
     if(null == sb) {
         sb = new StringBuilder();
@@ -141,7 +141,7 @@ public abstract class InputEvent extends NEWTEvent
     boolean isFirst = true;
     if(isShiftDown()) { if(!isFirst) { sb.append(", "); } isFirst = false; sb.append("shift"); }
     if(isControlDown()) { if(!isFirst) { sb.append(", "); } isFirst = false; sb.append("ctrl"); }
-    if(isMetaDown()) { if(!isFirst) { sb.append(", "); } isFirst = false; sb.append("meta"); }    
+    if(isMetaDown()) { if(!isFirst) { sb.append(", "); } isFirst = false; sb.append("meta"); }
     if(isAltDown()) { if(!isFirst) { sb.append(", "); } isFirst = false; sb.append("alt"); }
     if(isAltGraphDown()) { if(!isFirst) { sb.append(", "); } isFirst = false; sb.append("altgr"); }
     if(isAutoRepeat()) { if(!isFirst) { sb.append(", "); } isFirst = false; sb.append("repeat"); }
@@ -151,18 +151,18 @@ public abstract class InputEvent extends NEWTEvent
     if(isConfined()) { if(!isFirst) { sb.append(", "); } isFirst = false; sb.append("confined"); }
     if(isInvisible()) { if(!isFirst) { sb.append(", "); } isFirst = false; sb.append("invisible"); }
     sb.append("]");
-    
+
     return sb;
  }
 
  /**
   * See also {@link MouseEvent}'s section about <i>Multiple-Pointer Events</i>.
-  * @return Array of pressed mouse buttons  [{@link MouseEvent#BUTTON1} .. {@link MouseEvent#BUTTON6}]. 
+  * @return Array of pressed mouse buttons  [{@link MouseEvent#BUTTON1} .. {@link MouseEvent#BUTTON6}].
   *         If none is down, the resulting array is of length 0.
   */
  public final short[] getButtonsDown()  {
      final int len = getButtonDownCount();
-     
+
      final short[] res = new short[len];
      int j = 0;
      for(int i=1; i<=MouseEvent.BUTTON_COUNT; i++) {
@@ -174,13 +174,13 @@ public abstract class InputEvent extends NEWTEvent
  /**
   * See also {@link MouseEvent}'s section about <i>Multiple-Pointer Events</i>.
   * @param button the button to test
-  * @return true if the given button is down 
+  * @return true if the given button is down
   */
  public final boolean isButtonDown(int button)  {
     return ( modifiers & getButtonMask(button) ) != 0;
  }
 
- /** 
+ /**
   * Returns the number of pressed buttons by counting the set bits:
   * <pre>
   *     getBitCount(modifiers & BUTTONALL_MASK);
@@ -194,8 +194,8 @@ public abstract class InputEvent extends NEWTEvent
  public final int getButtonDownCount() {
      return IntBitfield.getBitCount(modifiers & BUTTONALL_MASK);
  }
- 
- /** 
+
+ /**
   * Returns true if at least one button is pressed, otherwise false:
   * <pre>
   *     0 != ( modifiers & BUTTONALL_MASK )
@@ -209,11 +209,11 @@ public abstract class InputEvent extends NEWTEvent
  public final boolean isAnyButtonDown() {
      return 0 != ( modifiers & BUTTONALL_MASK );
  }
- 
+
  public String toString() {
      return toString(null).toString();
  }
- 
+
  public StringBuilder toString(StringBuilder sb) {
      if(null == sb) {
          sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
index 42ebea722..a89148574 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
@@ -4,14 +4,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -21,12 +21,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event;
 
 public abstract class KeyAdapter implements KeyListener
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
index 085f598dc..81680bf32 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt.event;
@@ -37,8 +37,8 @@ package com.jogamp.newt.event;
 import com.jogamp.common.util.IntBitfield;
 
 /**
- * <a name="eventDelivery"><h5>KeyEvent Delivery</h5></a> 
- * 
+ * <a name="eventDelivery"><h5>KeyEvent Delivery</h5></a>
+ *
  * Key events are delivered in the following order:
  * <p>
  * <table border="0">
@@ -48,10 +48,10 @@ import com.jogamp.common.util.IntBitfield;
  * </table>
  * </p>
  * In case the native platform does not
- * deliver keyboard events in the above order or skip events, 
- * the NEWT driver will reorder and inject synthetic events if required. 
+ * deliver keyboard events in the above order or skip events,
+ * the NEWT driver will reorder and inject synthetic events if required.
  * <p>
- * Besides regular modifiers like {@link InputEvent#SHIFT_MASK} etc., 
+ * Besides regular modifiers like {@link InputEvent#SHIFT_MASK} etc.,
  * the {@link InputEvent#AUTOREPEAT_MASK} bit is added if repetition is detected, following above constraints.
  * </p>
  * <p>
@@ -60,38 +60,38 @@ import com.jogamp.common.util.IntBitfield;
     P = pressed, R = released
     0 = normal, 1 = auto-repeat
 
-    P(0), [ R(1), P(1), R(1), ..], R(0)    
+    P(0), [ R(1), P(1), R(1), ..], R(0)
  * </pre>
  * The idea is if you mask out auto-repeat in your event listener
  * you just get one long pressed P/R tuple for {@link #isPrintableKey() printable} and {@link #isActionKey() Action} keys.
  * </p>
  * <p>
- * {@link #isActionKey() Action} keys will produce {@link #EVENT_KEY_PRESSED pressed} 
+ * {@link #isActionKey() Action} keys will produce {@link #EVENT_KEY_PRESSED pressed}
  * and {@link #EVENT_KEY_RELEASED released} events including {@link #isAutoRepeat() auto-repeat}.
  * </p>
  * <p>
  * {@link #isPrintableKey() Printable} keys will produce {@link #EVENT_KEY_PRESSED pressed} and {@link #EVENT_KEY_RELEASED released} events.
  * </p>
  * <p>
- * {@link #isModifierKey() Modifier} keys will produce {@link #EVENT_KEY_PRESSED pressed} and {@link #EVENT_KEY_RELEASED released} events 
+ * {@link #isModifierKey() Modifier} keys will produce {@link #EVENT_KEY_PRESSED pressed} and {@link #EVENT_KEY_RELEASED released} events
  * excluding {@link #isAutoRepeat() auto-repeat}.
  * They will also influence subsequent event's {@link #getModifiers() modifier} bits while pressed.
  * </p>
- * 
+ *
  * <a name="unicodeMapping"><h5>Unicode Mapping</h5></a>
  * <p>
- * {@link #getKeyChar() Key-chars}, as well as 
+ * {@link #getKeyChar() Key-chars}, as well as
  * {@link #isPrintableKey() printable} {@link #getKeyCode() key-codes} and {@link #getKeySymbol() key-symbols}
- * use the UTF-16 unicode space w/o collision. 
- * 
+ * use the UTF-16 unicode space w/o collision.
+ *
  * </p>
  * <p>
- * Non-{@link #isPrintableKey() printable} {@link #getKeyCode() key-codes} and {@link #getKeySymbol() key-symbols}, 
+ * Non-{@link #isPrintableKey() printable} {@link #getKeyCode() key-codes} and {@link #getKeySymbol() key-symbols},
  * i.e. {@link #isModifierKey() modifier-} and {@link #isActionKey() action-}keys,
  * are mapped to unicode's control and private range and do not collide w/ {@link #isPrintableKey() printable} unicode values
  * with the following exception.
  * </p>
- * 
+ *
  * <a name="unicodeCollision"><h5>Unicode Collision</h5></a>
  * <p>
  * The following {@link #getKeyCode() Key-code}s and {@link #getKeySymbol() key-symbol}s collide w/ unicode space:<br/>
@@ -103,9 +103,9 @@ import com.jogamp.common.util.IntBitfield;
  * <p>
  * Collision was chosen for {@link #getKeyCode() Key-code} and {@link #getKeySymbol() key-symbol} mapping
  * to allow a minimal code range, i.e. <code>[0..255]</code>.
- * The reduced code range in turn allows the implementation to utilize fast and small lookup tables, 
- * e.g. to implement a key-press state tracker. 
- * </p>  
+ * The reduced code range in turn allows the implementation to utilize fast and small lookup tables,
+ * e.g. to implement a key-press state tracker.
+ * </p>
  * <pre>
  * http://www.utf8-chartable.de/unicode-utf8-table.pl
  * http://www.unicode.org/Public/5.1.0/ucd/PropList.txt
@@ -136,7 +136,7 @@ public class KeyEvent extends InputEvent
                 }
             }
             flags = _flags;
-            
+
             //
             // Validate flags
             //
@@ -147,12 +147,12 @@ public class KeyEvent extends InputEvent
             }
         }
     }
-    
+
     public static KeyEvent create(short eventType, Object source, long when, int modifiers, short keyCode, short keySym, char keyChar) {
         return new KeyEvent(eventType, source, when, modifiers, keyCode, keySym, getModifierMask(keySym), keyChar);
     }
 
-    /** 
+    /**
      * Returns the <i>UTF-16</i> character reflecting the {@link #getKeySymbol() key symbol}
      * incl. active {@link #isModifierKey() modifiers}.
      * @see #getKeySymbol()
@@ -162,12 +162,12 @@ public class KeyEvent extends InputEvent
         return keyChar;
     }
 
-    /** 
+    /**
      * Returns the virtual <i>key symbol</i> reflecting the current <i>keyboard layout</i>.
      * <p>
      * For {@link #isPrintableKey() printable keys}, the <i>key symbol</i> is the {@link #isModifierKey() unmodified}
-     * representation of the UTF-16 {@link #getKeyChar() key char}.<br/> 
-     * E.g. symbol [{@link #VK_A}, 'A'] for char 'a'. 
+     * representation of the UTF-16 {@link #getKeyChar() key char}.<br/>
+     * E.g. symbol [{@link #VK_A}, 'A'] for char 'a'.
      * </p>
      * @see #isPrintableKey()
      * @see #getKeyChar()
@@ -176,18 +176,18 @@ public class KeyEvent extends InputEvent
     public final short getKeySymbol() {
         return keySym;
     }
-    
-    /** 
+
+    /**
      * Returns the virtual <i>key code</i> using a fixed mapping to the <i>US keyboard layout</i>.
      * <p>
-     * In contrast to {@link #getKeySymbol() key symbol}, <i>key code</i> 
-     * uses a fixed <i>US keyboard layout</i> and therefore is keyboard layout independent. 
+     * In contrast to {@link #getKeySymbol() key symbol}, <i>key code</i>
+     * uses a fixed <i>US keyboard layout</i> and therefore is keyboard layout independent.
      * </p>
      * <p>
-     * E.g. <i>virtual key code</i> {@link #VK_Y} denotes the same physical key 
-     * regardless whether <i>keyboard layout</i> <code>QWERTY</code> or 
+     * E.g. <i>virtual key code</i> {@link #VK_Y} denotes the same physical key
+     * regardless whether <i>keyboard layout</i> <code>QWERTY</code> or
      * <code>QWERTZ</code> is active. The {@link #getKeySymbol() key symbol} of the former is
-     * {@link #VK_Y}, where the latter produces {@link #VK_Y}. 
+     * {@link #VK_Y}, where the latter produces {@link #VK_Y}.
      * </p>
      * @see #getKeyChar()
      * @see #getKeySymbol()
@@ -228,9 +228,9 @@ public class KeyEvent extends InputEvent
         }
         return (short) keyChar;
     }
-    
-    /** 
-     * Returns <code>true</code> if the given <code>virtualKey</code> represents a modifier key, otherwise <code>false</code>. 
+
+    /**
+     * Returns <code>true</code> if the given <code>virtualKey</code> represents a modifier key, otherwise <code>false</code>.
      * <p>
      * A modifier key is one of {@link #VK_SHIFT}, {@link #VK_CONTROL}, {@link #VK_ALT}, {@link #VK_ALT_GRAPH}, {@link #VK_META}.
      * </p>
@@ -247,10 +247,10 @@ public class KeyEvent extends InputEvent
                 return false;
         }
     }
-    
+
     /**
      * If <code>vKey</code> is a {@link #isModifierKey() modifier key}, method returns the corresponding modifier mask,
-     * otherwise 0. 
+     * otherwise 0.
      */
     public static int getModifierMask(short vKey) {
         switch (vKey) {
@@ -266,10 +266,10 @@ public class KeyEvent extends InputEvent
         }
         return 0;
     }
-    
-    /** 
+
+    /**
      * Returns <code>true</code> if {@link #getKeySymbol() key symbol} represents a modifier key,
-     * otherwise <code>false</code>. 
+     * otherwise <code>false</code>.
      * <p>
      * See {@link #isModifierKey(short)} for details.
      * </p>
@@ -280,8 +280,8 @@ public class KeyEvent extends InputEvent
     public final boolean isModifierKey() {
         return 0 != ( F_MODIFIER_MASK & flags ) ;
     }
-    
-    /** 
+
+    /**
      * Returns <code>true</code> if {@link #getKeySymbol() key symbol} represents a non-printable and
      * non-{@link #isModifierKey(short) modifier} action key, otherwise <code>false</code>.
      * <p>
@@ -289,12 +289,12 @@ public class KeyEvent extends InputEvent
      * <code> A = U - ( P + M ) </code>
      * </p>
      * @see #isPrintableKey()
-     * @see #isModifierKey() 
+     * @see #isModifierKey()
      */
     public final boolean isActionKey() {
         return 0 != ( F_ACTION_MASK & flags ) ;
     }
-    
+
     /**
      * Returns <code>true</code> if given <code>uniChar</code> represents a printable character,
      * i.e. a value other than {@link #VK_UNDEFINED} and not a control or non-printable private code.
@@ -307,7 +307,7 @@ public class KeyEvent extends InputEvent
      * <p>
      * Distinction of key character and virtual key code is made due to <a href="#unicodeCollision">unicode collision</a>.
      * </p>
-     * 
+     *
      * @param uniChar the UTF-16 unicode value, which maybe a virtual key code or key character.
      * @param isKeyChar true if <code>uniChar</code> is a key character, otherwise a virtual key code
      */
@@ -333,9 +333,9 @@ public class KeyEvent extends InputEvent
         return VK_UNDEFINED != uniChar;
     }
 
-    /** 
-     * Returns <code>true</code> if {@link #getKeySymbol() key symbol} and {@link #getKeyChar() key char} 
-     * represents a printable character, i.e. a value other than {@link #VK_UNDEFINED} 
+    /**
+     * Returns <code>true</code> if {@link #getKeySymbol() key symbol} and {@link #getKeyChar() key char}
+     * represents a printable character, i.e. a value other than {@link #VK_UNDEFINED}
      * and not a control or non-printable private code.
      * <p>
      * A printable character is neither a {@link #isModifierKey(short) modifier key}, nor an {@link #isActionKey(short) action key}.
@@ -347,7 +347,7 @@ public class KeyEvent extends InputEvent
     public final boolean isPrintableKey() {
         return 0 != ( F_PRINTABLE_MASK & flags ) ;
     }
-    
+
     private final short keyCode;
     private final short keySym;
     private final char keyChar;
@@ -370,7 +370,7 @@ public class KeyEvent extends InputEvent
 
     public static class NonPrintableRange {
         /** min. unicode value, inclusive */
-        public short min; 
+        public short min;
         /** max. unicode value, inclusive */
         public short max;
         /** true if valid for keyChar values as well, otherwise only valid for keyCode and keySym due to collision. */
@@ -381,7 +381,7 @@ public class KeyEvent extends InputEvent
             this.inclKeyChar = inclKeyChar;
         }
     };
-    /** 
+    /**
      * Non printable key ranges, currently fixed to an array of size 4.
      * <p>
      * Not included, queried upfront:
@@ -390,98 +390,98 @@ public class KeyEvent extends InputEvent
      *  <li>{@link #VK_TAB}</li>
      *  <li>{@link #VK_ENTER}</li>
      * </ul>
-     * </p> 
+     * </p>
      */
-    public final static NonPrintableRange[] nonPrintableKeys = { 
+    public final static NonPrintableRange[] nonPrintableKeys = {
         new NonPrintableRange( (short)0x0000, (short)0x001F, true ),  // Unicode: Non printable controls: [0x00 - 0x1F], see exclusion above
         new NonPrintableRange( (short)0x0061, (short)0x0078, false),  // Small 'a' thru 'z' (0x61 - 0x7a) - Not used for keyCode / keySym - Re-used for Fn (collision)
-        new NonPrintableRange( (short)0x008F, (short)0x009F, true ),  // Unicode: Non printable controls: [0x7F - 0x9F], Numpad keys [0x7F - 0x8E] are printable! 
+        new NonPrintableRange( (short)0x008F, (short)0x009F, true ),  // Unicode: Non printable controls: [0x7F - 0x9F], Numpad keys [0x7F - 0x8E] are printable!
         new NonPrintableRange( (short)0xE000, (short)0xF8FF, true )   // Unicode: Private 0xE000 - 0xF8FF (Marked Non-Printable)
     };
-    
+
     //
     // Unicode: Non printable controls: [0x00 - 0x1F]
     //
-    
+
     /**
      * This value, {@value}, is used to indicate that the keyCode is unknown.
      */
     public static final short VK_UNDEFINED      = (short) 0x0;
-    
+
            static final short VK_FREE01         = (short) 0x01;
-    
+
     /** Constant for the HOME function key. ASCII: Start Of Text. */
     public static final short VK_HOME           = (short) 0x02;
-    
+
     /** Constant for the END function key. ASCII: End Of Text. */
     public static final short VK_END            = (short) 0x03;
-    
+
     /** Constant for the END function key. ASCII: End Of Transmission. */
     public static final short VK_FINAL          = (short) 0x04;
 
     /** Constant for the PRINT function key. ASCII: Enquiry. */
     public static final short VK_PRINTSCREEN    = (short) 0x05;
-    
+
            static final short VK_FREE06         = (short) 0x06;
            static final short VK_FREE07         = (short) 0x07;
-    
+
     /** Constant for the BACK SPACE key "\b", matching ASCII. Printable! */
     public static final short VK_BACK_SPACE     = (short) 0x08;
-    
+
     /** Constant for the HORIZ TAB key "\t", matching ASCII. Printable! */
     public static final short VK_TAB            = (short) 0x09;
-    
+
            /** LINE_FEED "\n", matching ASCII, n/a on keyboard. */
            static final short VK_FREE0A         = (short) 0x0A;
-    
+
     /** Constant for the PAGE DOWN function key. ASCII: Vertical Tabulation. */
     public static final short VK_PAGE_DOWN      = (short) 0x0B;
-    
+
     /** Constant for the CLEAR key, i.e. FORM FEED, matching ASCII. */
     public static final short VK_CLEAR          = (short) 0x0C;
-    
+
     /** Constant for the ENTER key, i.e. CARRIAGE RETURN, matching ASCII. Printable! */
     public static final short VK_ENTER          = (short) 0x0D;
-    
+
            static final short VK_FREE0E         = (short) 0x0E;
-    
+
     /** Constant for the CTRL function key. ASCII: shift-in. */
     public static final short VK_SHIFT          = (short) 0x0F;
 
     /** Constant for the PAGE UP function key. ASCII: Data Link Escape. */
     public static final short VK_PAGE_UP        = (short) 0x10;
-    
+
     /** Constant for the CTRL function key. ASCII: device-ctrl-one. */
     public static final short VK_CONTROL        = (short) 0x11;
-    
+
     /** Constant for the left ALT function key. ASCII: device-ctrl-two. */
     public static final short VK_ALT            = (short) 0x12;
-    
+
     /** Constant for the ALT_GRAPH function key, i.e. right ALT key. ASCII: device-ctrl-three. */
     public static final short VK_ALT_GRAPH      = (short) 0x13;
-    
+
     /** Constant for the CAPS LOCK function key. ASCII: device-ctrl-four. */
     public static final short VK_CAPS_LOCK      = (short) 0x14;
-    
+
            static final short VK_FREE15         = (short) 0x15;
-    
+
     /** Constant for the PAUSE function key. ASCII: sync-idle. */
     public static final short VK_PAUSE          = (short) 0x16;
-    
+
     /** <b>scroll lock</b> key. ASCII: End Of Transmission Block. */
     public static final short VK_SCROLL_LOCK    = (short) 0x17;
-        
+
     /** Constant for the CANCEL function key. ASCII: Cancel. */
     public static final short VK_CANCEL         = (short) 0x18;
-    
+
            static final short VK_FREE19         = (short) 0x19;
-    
+
     /** Constant for the INSERT function key. ASCII: Substitute. */
     public static final short VK_INSERT         = (short) 0x1A;
-    
+
     /** Constant for the ESCAPE function key. ASCII: Escape. */
     public static final short VK_ESCAPE         = (short) 0x1B;
-        
+
     /** Constant for the Convert function key, Japanese "henkan". ASCII: File Separator. */
     public static final short VK_CONVERT        = (short) 0x1C;
 
@@ -496,48 +496,48 @@ public class KeyEvent extends InputEvent
 
     //
     // Unicode: Printable [0x20 - 0x7E]
-    // NOTE: Collision of 'a' - 'x' [0x61 .. 0x78], used for keyCode/keySym Fn function keys 
+    // NOTE: Collision of 'a' - 'x' [0x61 .. 0x78], used for keyCode/keySym Fn function keys
     //
-        
+
     /** Constant for the SPACE function key. ASCII: SPACE. */
     public static final short VK_SPACE          = (short) 0x20;
-    
+
     /** Constant for the "!" key. */
     public static final short VK_EXCLAMATION_MARK = (short) 0x21;
 
     /** Constant for the """ key. */
     public static final short VK_QUOTEDBL       = (short) 0x22;
-    
+
     /** Constant for the "#" key. */
     public static final short VK_NUMBER_SIGN    = (short) 0x23;
 
     /** Constant for the "$" key. */
     public static final short VK_DOLLAR         = (short) 0x24;
-    
+
     /** Constant for the "%" key. */
     public static final short VK_PERCENT        = (short) 0x25;
-    
+
     /** Constant for the "&" key. */
     public static final short VK_AMPERSAND      = (short) 0x26;
-    
+
     /** Constant for the "'" key. */
     public static final short VK_QUOTE          = (short) 0x27;
-    
+
     /** Constant for the "(" key. */
     public static final short VK_LEFT_PARENTHESIS  = (short) 0x28;
-    
+
     /** Constant for the ")" key. */
     public static final short VK_RIGHT_PARENTHESIS = (short) 0x29;
-    
+
     /** Constant for the "*" key */
     public static final short VK_ASTERISK       = (short) 0x2A;
-    
+
     /** Constant for the "+" key. */
     public static final short VK_PLUS           = (short) 0x2B;
-    
+
     /** Constant for the comma key, "," */
     public static final short VK_COMMA          = (short) 0x2C;
-    
+
     /** Constant for the minus key, "-" */
     public static final short VK_MINUS          = (short) 0x2D;
 
@@ -582,13 +582,13 @@ public class KeyEvent extends InputEvent
 
     /** Constant for the equals key, ">" */
     public static final short VK_GREATER        = (short) 0x3E;
-    
+
     /** Constant for the equals key, "?" */
     public static final short VK_QUESTIONMARK   = (short) 0x3F;
-    
+
     /** Constant for the equals key, "@" */
     public static final short VK_AT             = (short) 0x40;
-    
+
     /** VK_A thru VK_Z are the same as Capital UTF16/ASCII 'A' thru 'Z' (0x41 - 0x5A) */
     public static final short VK_A              = (short) 0x41;
     /** See {@link #VK_A}. */
@@ -656,17 +656,17 @@ public class KeyEvent extends InputEvent
 
     /** Constant for the "_" key */
     public static final short VK_UNDERSCORE     = (short) 0x5F;
-    
+
     /** Constant for the "`" key */
     public static final short VK_BACK_QUOTE     = (short) 0x60;
-    
+
     /** Small UTF/ASCII 'a' thru 'z' (0x61 - 0x7a) - Not used for keyCode / keySym. */
-    
-    /** 
-     * Constant for the F<i>n</i> function keys. 
+
+    /**
+     * Constant for the F<i>n</i> function keys.
      * <p>
      * F1..F24, i.e. F<i>n</i>, are mapped from on <code>0x60+n</code> -> <code>[0x61 .. 0x78]</code>.
-     * </p> 
+     * </p>
      * <p>
      * <b>Warning:</b> The F<i>n</i> function keys <b>do collide</b> with unicode characters small 'a' thru 'x'!<br/>
      * See <a href="#unicodeCollision">Unicode Collision</a> for details.
@@ -743,26 +743,26 @@ public class KeyEvent extends InputEvent
     /** Constant for the F24 function key. See {@link #VK_F1}. */
     public static final short VK_F24            = (short) ( 0x60+24 );
 
-    
+
     /** Constant for the "{" key */
     public static final short VK_LEFT_BRACE     = (short) 0x7B;
     /** Constant for the "|" key */
     public static final short VK_PIPE           = (short) 0x7C;
     /** Constant for the "}" key */
     public static final short VK_RIGHT_BRACE    = (short) 0x7D;
-    
+
     /** Constant for the "~" key, matching ASCII */
     public static final short VK_TILDE          = (short) 0x7E;
-    
+
     //
     // Unicode: Non printable controls: [0x7F - 0x9F]
     //
     // Numpad keys [0x7F - 0x8E] are printable
     //
-    
+
     /** Numeric keypad <b>decimal separator</b> key. Non printable UTF control. */
     public static final short VK_SEPARATOR      = (short) 0x7F;
-    
+
     /** Numeric keypad VK_NUMPAD0 thru VK_NUMPAD9 are mapped to UTF control (0x80 - 0x89). Non printable UTF control. */
     public static final short VK_NUMPAD0        = (short) 0x80;
     /** See {@link #VK_NUMPAD0}. */
@@ -783,28 +783,28 @@ public class KeyEvent extends InputEvent
     public static final short VK_NUMPAD8        = (short) 0x88;
     /** See {@link #VK_NUMPAD0}. */
     public static final short VK_NUMPAD9        = (short) 0x89;
-    
+
     /** Numeric keypad <b>decimal separator</b> key. Non printable UTF control. */
     public static final short VK_DECIMAL        = (short) 0x8A;
-        
+
     /** Numeric keypad <b>add</b> key. Non printable UTF control. */
     public static final short VK_ADD            = (short) 0x8B;
 
     /** Numeric keypad <b>subtract</b> key. Non printable UTF control. */
     public static final short VK_SUBTRACT       = (short) 0x8C;
-    
+
     /** Numeric keypad <b>multiply</b> key. Non printable UTF control. */
     public static final short VK_MULTIPLY       = (short) 0x8D;
-    
+
     /** Numeric keypad <b>divide</b> key. Non printable UTF control. */
     public static final short VK_DIVIDE         = (short) 0x8E;
-    
+
     /** Constant for the DEL key, matching ASCII. Non printable UTF control. */
     public static final short VK_DELETE         = (short) 0x93;
-    
+
     /** Numeric keypad <b>num lock</b> key. Non printable UTF control. */
     public static final short VK_NUM_LOCK       = (short) 0x94;
-    
+
     /** Constant for the cursor- or numerical-pad <b>left</b> arrow key. Non printable UTF control. */
     public static final short VK_LEFT           = (short) 0x95;
 
@@ -816,22 +816,22 @@ public class KeyEvent extends InputEvent
 
     /** Constant for the cursor- or numerical pad <b>down</b> arrow key. Non printable UTF control. */
     public static final short VK_DOWN           = (short) 0x98;
-        
+
     /** Constant for the Context Menu key. Non printable UTF control. */
     public static final short VK_CONTEXT_MENU   = (short) 0x99;
 
     /**
      * Constant for the MS "Windows" function key.
-     * It is used for both the left and right version of the key.  
+     * It is used for both the left and right version of the key.
      */
     public static final short VK_WINDOWS        = (short) 0x9A;
 
     /** Constant for the Meta function key. */
     public static final short VK_META           = (short) 0x9B;
-    
+
     /** Constant for the Help function key. */
     public static final short VK_HELP           = (short) 0x9C;
-    
+
     /** Constant for the Compose function key. */
     public static final short VK_COMPOSE        = (short) 0x9D;
 
@@ -840,21 +840,21 @@ public class KeyEvent extends InputEvent
 
     /** Constant for the Stop function key. */
     public static final short VK_STOP           = (short) 0x9F;
-    
+
     //
     // Unicode: Printable [0x00A0 - 0xDFFF]
     //
-    
+
     /** Constant for the inverted exclamation mark key. */
     public static final short VK_INVERTED_EXCLAMATION_MARK = (short) 0xA1;
-    
+
     /** Constant for the Euro currency sign key. */
     public static final short VK_EURO_SIGN                = (short) 0x20AC;
 
     //
     // Unicode: Private 0xE000 - 0xF8FF (Marked Non-Printable)
     //
-    
+
     /* for Sun keyboards */
     public static final short VK_CUT            = (short) 0xF879;
     public static final short VK_COPY           = (short) 0xF87A;
@@ -871,7 +871,7 @@ public class KeyEvent extends InputEvent
      */
     /* Japanese PC 106 keyboard: kanji. Japanese Solaris keyboard: nihongo */
     public static final short VK_INPUT_METHOD_ON_OFF = (short) 0xF890;
-    
+
     /**
      * Constant for the Code Input function key.
      */
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyListener.java b/src/newt/classes/com/jogamp/newt/event/KeyListener.java
index b3927d81a..4b16ab61e 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyListener.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyListener.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,22 +29,22 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt.event;
 
 /**
  * Listener for {@link KeyEvent}s.
- * 
+ *
  * @see KeyEvent
  */
 public interface KeyListener extends NEWTEventListener
 {
     /** A key has been {@link KeyEvent#EVENT_KEY_PRESSED pressed}, excluding {@link #isAutoRepeat() auto-repeat} {@link #isModifierKey() modifier} keys. See {@link KeyEvent}. */
     public void keyPressed(KeyEvent e);
-    
-    /** 
+
+    /**
      * A key has been {@link KeyEvent#EVENT_KEY_RELEASED released}, excluding {@link #isAutoRepeat() auto-repeat} {@link #isModifierKey() modifier} keys. See {@link KeyEvent}.
      * <p>
      * To simulated the removed <code>keyTyped(KeyEvent e)</code> semantics,
@@ -52,9 +52,9 @@ public interface KeyListener extends NEWTEventListener
      * <pre>
         if( !e.isPrintableKey() || e.isAutoRepeat() ) {
             return;
-        }            
+        }
      * </pre>
-     * </p> 
+     * </p>
      */
     public void keyReleased(KeyEvent e);
 }
diff --git a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
index c47936a7a..77c66a2da 100644
--- a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
@@ -35,19 +35,19 @@ import com.jogamp.newt.MonitorMode;
 public class MonitorEvent extends OutputEvent {
     public static final short EVENT_MONITOR_MODE_CHANGE_NOTIFY = 600;
     public static final short EVENT_MONITOR_MODE_CHANGED       = 601;
-    
+
     private final MonitorMode mode;
-    
+
     public MonitorEvent (short eventType, MonitorDevice source, long when, MonitorMode mode) {
         super(eventType, source, when);
         this.mode = mode;
     }
-    
+
     /** Returns the {@link #getSource() source}, which is a {@link MonitorDevice}. */
     public final MonitorDevice getMonitor() { return (MonitorDevice)source; }
-    
+
     public final MonitorMode getMode() { return mode; }
-    
+
     public static String getEventTypeString(short type) {
         switch(type) {
         case EVENT_MONITOR_MODE_CHANGE_NOTIFY: return "EVENT_MONITOR_MODE_CHANGE_NOTIFY";
@@ -55,7 +55,7 @@ public class MonitorEvent extends OutputEvent {
         default: return "unknown (" + type + ")";
         }
     }
-    
+
     public final String toString() {
         return toString(null).toString();
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
index 3607ae634..652f87d5b 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event;
 
 public abstract class MouseAdapter implements MouseListener
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
index 57dd7e68c..4d7cc3b36 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt.event;
@@ -37,12 +37,12 @@ package com.jogamp.newt.event;
 /**
  * Pointer event of type {@link PointerType}.
  * <p>
- * The historical misleading class name may change in the future to <code>PointerEvent</code>. 
+ * The historical misleading class name may change in the future to <code>PointerEvent</code>.
  * </p>
  * <p>
  * http://www.w3.org/Submission/pointer-events/#pointerevent-interface
  * </p>
- * <a name="multiPtrEvent"><h5>Multiple-Pointer Events</h5></a> 
+ * <a name="multiPtrEvent"><h5>Multiple-Pointer Events</h5></a>
  * <p>
  * In case an instance represents a multiple-pointer event, i.e. {@link #getPointerCount()} is &gt; 1,
  * the first data element of the multiple-pointer fields represents the pointer triggering this event.<br/>
@@ -62,10 +62,10 @@ package com.jogamp.newt.event;
  * </p>
  * <p>
  * If representing a multiple-pointer event, the {@link #getButton() button number} is mapped to the <i>first {@link #getPointerId(int) pointer ID}</i>
- * triggering the event and the {@link InputEvent#BUTTON1_MASK button mask bits} in the {@link #getModifiers() modifiers} 
+ * triggering the event and the {@link InputEvent#BUTTON1_MASK button mask bits} in the {@link #getModifiers() modifiers}
  * field  represent the pressed pointer IDs.<br>
  * Hence users can query the pressed button count as well as the pressed pointer count via {@link InputEvent#getButtonDownCount()}
- * or use the simple query {@link InputEvent#isAnyButtonDown()}. 
+ * or use the simple query {@link InputEvent#isAnyButtonDown()}.
  * </p>
  */
 @SuppressWarnings("serial")
@@ -75,7 +75,7 @@ public class MouseEvent extends InputEvent
     public static enum PointerClass implements InputEvent.InputClass {
         Offscreen, Onscreen, Undefined;
     }
-    
+
     /** Type of pointer devices */
     public static enum PointerType implements InputEvent.InputType {
         /** {@link PointerClass#Offscreen} mouse. Ordinal 0. */
@@ -88,10 +88,10 @@ public class MouseEvent extends InputEvent
         Pen(PointerClass.Onscreen),
         /** {@link PointerClass#Undefined} ?. Ordinal 4. */
         Undefined(PointerClass.Undefined);
-        
+
         public PointerClass getPointerClass() { return pc; }
-        
-        /** 
+
+        /**
          * Returns the matching PointerType value corresponding to the given PointerType's integer ordinal.
          * <pre>
          *   given:
@@ -108,8 +108,8 @@ public class MouseEvent extends InputEvent
             }
             throw new IllegalArgumentException("Ordinal "+ordinal+" out of range of PointerType.values()[0.."+(all.length-1)+"]");
         }
-        
-        /** 
+
+        /**
          * Returns the PointerType array of matching PointerType values corresponding to the given PointerType's integer ordinal values.
          * <p>
          * See {@link #valueOf(int)}.
@@ -124,13 +124,13 @@ public class MouseEvent extends InputEvent
             }
             return types;
         }
-        
+
         private PointerType(PointerClass pc) {
             this.pc = pc;
         }
         PointerClass pc;
     }
-    
+
     /** ID for button 1, value <code>1</code> */
     public static final short BUTTON1 = 1;
     /** ID for button 2, value <code>2</code> */
@@ -149,17 +149,17 @@ public class MouseEvent extends InputEvent
     public static final short BUTTON8 = 8;
     /** ID for button 6, value <code>9</code> */
     public static final short BUTTON9 = 9;
-    
+
     /** Maximum number of buttons, value <code>16</code> */
     public static final short BUTTON_COUNT =  16;
 
-    /** 
+    /**
      * Maximum number of buttons, value <code>16</code>.
      * @deprecated Use {@link #BUTTON_COUNT} .. semantics.
      */
     public static final short BUTTON_NUMBER =  16;
-    
-    /** Returns the 3-axis XYZ rotation array by given rotation on Y axis or X axis (if SHIFT_MASK is given in mods). */ 
+
+    /** Returns the 3-axis XYZ rotation array by given rotation on Y axis or X axis (if SHIFT_MASK is given in mods). */
     public static final float[] getRotationXYZ(final float rotationXorY, final int mods) {
         final float[] rotationXYZ = new float[] { 0f, 0f, 0f };
         if( 0 != ( mods & InputEvent.SHIFT_MASK ) ) {
@@ -169,14 +169,14 @@ public class MouseEvent extends InputEvent
         }
         return rotationXYZ;
     }
-    
-    public static final short getClickTimeout() { 
-        return 300; 
+
+    public static final short getClickTimeout() {
+        return 300;
     }
-        
-    /** 
+
+    /**
      * Constructor for traditional one-pointer event.
-     * 
+     *
      * @param eventType
      * @param source
      * @param when
@@ -193,7 +193,7 @@ public class MouseEvent extends InputEvent
             int modifiers, int x, int y, short clickCount, short button,
             float[] rotationXYZ, float rotationScale)
     {
-        super(eventType, source, when, modifiers); 
+        super(eventType, source, when, modifiers);
         this.x = new int[]{x};
         this.y = new int[]{y};
         switch(eventType) {
@@ -214,15 +214,15 @@ public class MouseEvent extends InputEvent
         this.pointerType = constMousePointerTypes;
     }
 
-    /** 
+    /**
      * Constructor for a multiple-pointer event.
      * <p>
      * First element of multiple-pointer arrays represents the pointer which triggered the event!
      * </p>
-     * <p>  
+     * <p>
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * </p>
-     * 
+     *
      * @param eventType
      * @param source
      * @param when
@@ -239,12 +239,12 @@ public class MouseEvent extends InputEvent
      * @param rotationXYZ Rotation of all axis
      * @param rotationScale Rotation scale
      */
-    public MouseEvent(short eventType, Object source, long when, int modifiers, 
-                      PointerType pointerType[], short[] pointerID, 
-                      int[] x, int[] y, float[] pressure, float maxPressure, 
+    public MouseEvent(short eventType, Object source, long when, int modifiers,
+                      PointerType pointerType[], short[] pointerID,
+                      int[] x, int[] y, float[] pressure, float maxPressure,
                       short button, short clickCount, float[] rotationXYZ, float rotationScale)
     {
-        super(eventType, source, when, modifiers); 
+        super(eventType, source, when, modifiers);
         this.x = x;
         this.y = y;
         final int pointerCount = pointerType.length;
@@ -266,12 +266,12 @@ public class MouseEvent extends InputEvent
         this.rotationScale = rotationScale;
         this.pointerType = pointerType;
     }
-    
+
     public MouseEvent createVariant(short newEventType) {
         return new MouseEvent(newEventType, source, getWhen(), getModifiers(), pointerType, pointerID,
                               x, y, pressure, maxPressure, button, clickCount, rotationXYZ, rotationScale);
     }
-    
+
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return the count of pointers involved in this event
@@ -279,7 +279,7 @@ public class MouseEvent extends InputEvent
     public final int getPointerCount() {
         return pointerType.length;
     }
-    
+
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return the {@link PointerType} for the data at index or null if index not available.
@@ -290,7 +290,7 @@ public class MouseEvent extends InputEvent
         }
         return pointerType[index];
     }
-    
+
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return array of all {@link PointerType}s for all pointers
@@ -298,10 +298,10 @@ public class MouseEvent extends InputEvent
     public final PointerType[] getAllPointerTypes() {
         return pointerType;
     }
-    
+
     /**
      * Return the pointer id for the given index or -1 if index not available.
-     * <p> 
+     * <p>
      * IDs start w/ 0 and are consecutive numbers.
      * </p>
      * <p>
@@ -317,7 +317,7 @@ public class MouseEvent extends InputEvent
         }
         return pointerID[index];
     }
-    
+
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return the pointer index for the given pointer id or -1 if id not available.
@@ -332,7 +332,7 @@ public class MouseEvent extends InputEvent
         }
         return -1;
     }
-    
+
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return array of all pointer IDs for all pointers. IDs start w/ 0 and are consecutive numbers.
@@ -340,15 +340,15 @@ public class MouseEvent extends InputEvent
     public final short[] getAllPointerIDs() {
         return pointerID;
     }
-    
-    /** 
+
+    /**
      * Returns the button number, e.g. [{@link #BUTTON1}..{@link #BUTTON_COUNT}-1].
      * <p>
      * A button value of <code>0</code> denotes no button activity, i.e. {@link PointerType#Mouse} move.
      * </p>
      * <p>
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
-     * </p> 
+     * </p>
      */
     public final short getButton() {
         return button;
@@ -357,16 +357,16 @@ public class MouseEvent extends InputEvent
     public final short getClickCount() {
         return clickCount;
     }
-    
+
     public final int getX() {
         return x[0];
     }
-    
+
     public final int getY() {
         return y[0];
     }
 
-    /** 
+    /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @param index pointer-index within [0 .. {@link #getPointerCount()}-1]
      * @return X-Coord associated with the pointer-index.
@@ -376,7 +376,7 @@ public class MouseEvent extends InputEvent
         return x[index];
     }
 
-    /** 
+    /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @param index pointer-index within [0 .. {@link #getPointerCount()}-1]
      * @return Y-Coord associated with the pointer-index.
@@ -385,7 +385,7 @@ public class MouseEvent extends InputEvent
     public final int getY(int index) {
         return y[index];
     }
-    
+
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return array of all X-Coords for all pointers
@@ -393,7 +393,7 @@ public class MouseEvent extends InputEvent
     public final int[] getAllX() {
         return x;
     }
-    
+
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return array of all Y-Coords for all pointers
@@ -401,9 +401,9 @@ public class MouseEvent extends InputEvent
     public final int[] getAllY() {
         return y;
     }
-    
+
     /**
-     * @param normalized if true, method returns the normalized pressure, i.e. <code>pressure / maxPressure</code> 
+     * @param normalized if true, method returns the normalized pressure, i.e. <code>pressure / maxPressure</code>
      * @return The pressure associated with the pointer-index 0.
      *         The value of zero is return if not available.
      * @see #getMaxPressure()
@@ -411,11 +411,11 @@ public class MouseEvent extends InputEvent
     public final float getPressure(boolean normalized){
         return normalized ? pressure[0] / maxPressure : pressure[0];
     }
-    
+
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @param index pointer-index within [0 .. {@link #getPointerCount()}-1]
-     * @param normalized if true, method returns the normalized pressure, i.e. <code>pressure / maxPressure</code> 
+     * @param normalized if true, method returns the normalized pressure, i.e. <code>pressure / maxPressure</code>
      * @return The pressure associated with the pointer-index.
      *         The value of zero is return if not available.
      * @see #getMaxPressure()
@@ -423,7 +423,7 @@ public class MouseEvent extends InputEvent
     public final float getPressure(int index, boolean normalized){
         return normalized ? pressure[index] / maxPressure : pressure[index];
     }
-    
+
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return array of all raw, un-normalized pressures for all pointers
@@ -431,12 +431,12 @@ public class MouseEvent extends InputEvent
     public final float[] getAllPressures() {
         return pressure;
     }
-    
-    /** 
+
+    /**
      * Returns the maximum pressure known for the input device generating this event.
      * <p>
      * This value may be self calibrating on devices/OS, where no known maximum pressure is known.
-     * Hence subsequent events may return a higher value. 
+     * Hence subsequent events may return a higher value.
      * </p>
      * <p>
      * Self calibrating maximum pressure is performed on:
@@ -448,25 +448,25 @@ public class MouseEvent extends InputEvent
     public final float getMaxPressure() {
         return maxPressure;
     }
-    
+
     /**
      * Returns a 3-component float array filled with the values of the rotational axis
      * in the following order: horizontal-, vertical- and z-axis.
-     * <p> 
+     * <p>
      * A vertical rotation of <b>&gt; 0.0f is up</b> and <b>&lt; 0.0f is down</b>.
      * </p>
      * <p>
-     * A horizontal rotation of <b>&gt; 0.0f is left</b> and <b>&lt; 0.0f is right</b>.   
+     * A horizontal rotation of <b>&gt; 0.0f is left</b> and <b>&lt; 0.0f is right</b>.
      * </p>
      * <p>
-     * A z-axis rotation of <b>&gt; 0.0f is back</b> and <b>&lt; 0.0f is front</b>.   
+     * A z-axis rotation of <b>&gt; 0.0f is back</b> and <b>&lt; 0.0f is front</b>.
      * </p>
      * <p>
      * <i>However</i>, on some OS this might be flipped due to the OS <i>default</i> behavior.
      * The latter is true for OS X 10.7 (Lion) for example.
      * </p>
      * <p>
-     * On PointerClass {@link PointerClass#Onscreen onscreen} devices, i.e. {@link PointerType#TouchScreen touch screens}, 
+     * On PointerClass {@link PointerClass#Onscreen onscreen} devices, i.e. {@link PointerType#TouchScreen touch screens},
      * rotation events are usually produced by a 2-finger movement, where horizontal and vertical rotation values are filled.
      * </p>
      * <p>
@@ -475,13 +475,13 @@ public class MouseEvent extends InputEvent
      * </p>
      * <p>
      * The {@link InputEvent#SHIFT_MASK} modifier is set in case <b>|horizontal| &gt; |vertical|</b> value.<br/>
-     * This can be utilized to implement only one 2d rotation direction, you may use {@link #isShiftDown()} to query it.  
+     * This can be utilized to implement only one 2d rotation direction, you may use {@link #isShiftDown()} to query it.
      * </p>
      * <p>
      * In case the pointer type is {@link PointerType#Mouse mouse},
      * events are usually send in steps of one, ie. <i>-1.0f</i> and <i>1.0f</i>.
      * Higher values may result due to fast scrolling.
-     * Fractional values may result due to slow scrolling with high resolution devices.<br/>  
+     * Fractional values may result due to slow scrolling with high resolution devices.<br/>
      * Here the button number refers to the wheel number.
      * </p>
      * <p>
@@ -492,24 +492,24 @@ public class MouseEvent extends InputEvent
     public final float[] getRotation() {
         return rotationXYZ;
     }
-    
-    /** 
+
+    /**
      * Returns the scale used to determine the {@link #getRotation() rotation value},
      * which semantics depends on the {@link #getPointerType() pointer type's} {@link PointerClass}.
      * <p>
      * For {@link PointerClass#Offscreen}, the scale is usually <code>1.0f</code> and denominates
      * an abstract value without association to a physical value.
-     * </p> 
+     * </p>
      * <p>
      * For {@link PointerClass#Onscreen}, the scale varies and denominates
-     * the divisor of the distance the finger[s] have moved on the screen. 
-     * Hence <code>scale * rotation</code> reproduces the screen distance in pixels the finger[s] have moved. 
-     * </p> 
+     * the divisor of the distance the finger[s] have moved on the screen.
+     * Hence <code>scale * rotation</code> reproduces the screen distance in pixels the finger[s] have moved.
+     * </p>
      */
     public final float getRotationScale() {
         return rotationScale;
     }
-    
+
     public final String toString() {
         return toString(null).toString();
     }
@@ -533,7 +533,7 @@ public class MouseEvent extends InputEvent
                 .append("p[").append(pressure[i]).append("/").append(maxPressure).append("=").append(pressure[i]/maxPressure).append("]");
             }
             sb.append("]");
-        }        
+        }
         sb.append(", ");
         return super.toString(sb).append("]");
     }
@@ -551,14 +551,14 @@ public class MouseEvent extends InputEvent
             default: return "unknown (" + type + ")";
         }
     }
-    
+
     /** PointerType for each pointer (multiple pointer) */
     private final PointerType pointerType[];
-    /** 
+    /**
      * Pointer-ID for each pointer (multiple pointer). IDs start w/ 0 and are consecutive numbers.
-     * <p> 
+     * <p>
      * A pointer-ID of -1 may also denote no pointer/button activity, i.e. {@link PointerType#Mouse} move.
-     * </p> 
+     * </p>
      */
     private final short pointerID[];
     /** X-axis for each pointer (multiple pointer) */
@@ -581,11 +581,11 @@ public class MouseEvent extends InputEvent
     /** Rotation scale */
     private final float rotationScale;
     private final float maxPressure;
-    
+
     private static final float[] constMousePressure0 = new float[]{0f};
     private static final float[] constMousePressure1 = new float[]{1f};
     private static final PointerType[] constMousePointerTypes = new PointerType[] { PointerType.Mouse };
-    
+
     public static final short EVENT_MOUSE_CLICKED  = 200;
     public static final short EVENT_MOUSE_ENTERED  = 201;
     public static final short EVENT_MOUSE_EXITED   = 202;
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseListener.java b/src/newt/classes/com/jogamp/newt/event/MouseListener.java
index ce6796081..5378080b9 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseListener.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseListener.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt.event;
@@ -38,7 +38,7 @@ import com.jogamp.newt.event.MouseEvent.PointerType;
 
 /**
  * Listener for {@link MouseEvent}s.
- * 
+ *
  * @see MouseEvent
  */
 public interface MouseListener extends NEWTEventListener
@@ -50,13 +50,13 @@ public interface MouseListener extends NEWTEventListener
  public void mouseReleased(MouseEvent e);
  public void mouseMoved(MouseEvent e);
  public void mouseDragged(MouseEvent e);
- 
+
  /**
   * Traditional event name originally produced by a {@link PointerType#Mouse mouse} pointer type.
   * <p>
   * Triggered for any rotational pointer events, see
-  * {@link MouseEvent#getRotation()} and {@link MouseEvent#getRotationScale()}. 
-  * </p> 
+  * {@link MouseEvent#getRotation()} and {@link MouseEvent#getRotationScale()}.
+  * </p>
   */
  public void mouseWheelMoved(MouseEvent e);
 }
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
index 02bb4f929..022e2d0e1 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt.event;
@@ -50,7 +50,7 @@ package com.jogamp.newt.event;
  */
 @SuppressWarnings("serial")
 public class NEWTEvent extends java.util.EventObject {
-    /** 
+    /**
      * See {@link #setConsumed(boolean)} for description.
      */
     public static final Object consumedTag = new Object();
@@ -78,11 +78,11 @@ public class NEWTEvent extends java.util.EventObject {
         return when;
     }
 
-    /** 
+    /**
      * Attach the passed object to this event.<br>
      * If an object was previously attached, it will be replaced.<br>
      * Attachments to NEWT events allow users to pass on information
-     * from one custom listener to another, ie custom listener to listener 
+     * from one custom listener to another, ie custom listener to listener
      * communication.
      * @param attachment User application specific object
      */
@@ -90,14 +90,14 @@ public class NEWTEvent extends java.util.EventObject {
         this.attachment = attachment;
     }
 
-    /** 
+    /**
      * @return The user application specific attachment, or null
      */
     public final Object getAttachment() {
         return attachment;
     }
-    
-    /** 
+
+    /**
      * Returns <code>true</code> if this events has been {@link #setConsumed(boolean) consumed},
      * otherwise <code>false</code>.
      * @see #setConsumed(boolean)
@@ -105,8 +105,8 @@ public class NEWTEvent extends java.util.EventObject {
     public final boolean isConsumed() {
         return consumedTag == attachment;
     }
-    
-    /** 
+
+    /**
      * If <code>consumed</code> is <code>true</code>, this event is marked as consumed,
      * ie. the event will not be propagated any further to potential <i>other</i> event listener.
      * Otherwise the event will be propagated to other event listener, the default.
@@ -130,7 +130,7 @@ public class NEWTEvent extends java.util.EventObject {
             setAttachment( null );
         }
     }
-    
+
     public String toString() {
         return toString(null).toString();
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEventConsumer.java b/src/newt/classes/com/jogamp/newt/event/NEWTEventConsumer.java
index 6aa19e5f8..14fba6742 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEventConsumer.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEventConsumer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,18 +20,18 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event;
 
 public interface NEWTEventConsumer {
 
-    /** 
-     * Consume the event 
+    /**
+     * Consume the event
      *
      * @return true if the event has been consumed,
      * otherwise it returns false for later propagation.
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java b/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java
index fe224bba6..7dd56ad1e 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event;
 
 import java.util.LinkedList;
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEventListener.java b/src/newt/classes/com/jogamp/newt/event/NEWTEventListener.java
index 677136573..f7ee3d739 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEventListener.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEventListener.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt.event;
diff --git a/src/newt/classes/com/jogamp/newt/event/OutputEvent.java b/src/newt/classes/com/jogamp/newt/event/OutputEvent.java
index 86fa95877..80c7780f8 100644
--- a/src/newt/classes/com/jogamp/newt/event/OutputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/OutputEvent.java
@@ -39,7 +39,7 @@ public abstract class OutputEvent extends NEWTEvent
  public String toString() {
      return toString(null).toString();
  }
- 
+
  public StringBuilder toString(StringBuilder sb) {
      if(null == sb) {
          sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
index eceea053d..d275eab46 100644
--- a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
@@ -35,7 +35,7 @@ import jogamp.newt.Debug;
  * 2 pointer zoom, a.k.a. <i>pinch to zoom</i>, gesture handler processing {@link MouseEvent}s
  * while producing {@link ZoomEvent}s if gesture is completed.
  * <p>
- * Zoom value lies within [0..2], with 1 as <i>1:1</i>. 
+ * Zoom value lies within [0..2], with 1 as <i>1:1</i>.
  * </p>
  * <pre>
  *   - choosing the smallest surface edge (width/height -> x/y)
@@ -44,7 +44,7 @@ import jogamp.newt.Debug;
  */
 public class PinchToZoomGesture implements GestureHandler {
     public static final boolean DEBUG = Debug.debug("Window.MouseEvent");
-    
+
     /** A {@link GestureHandler.GestureEvent} denominating zoom. */
     @SuppressWarnings("serial")
     public static class ZoomEvent extends GestureEvent {
@@ -57,10 +57,10 @@ public class PinchToZoomGesture implements GestureHandler {
         }
         /** Triggering {@link MouseEvent} */
         public final MouseEvent getTrigger() { return pe; }
-        /** Zoom value lies within [0..2], with 1 as <i>1:1</i>. */ 
+        /** Zoom value lies within [0..2], with 1 as <i>1:1</i>. */
         public final float getZoom() { return zoom; }
     }
-    
+
     private final NativeSurface surface;
     private float zoom;
     private int zoomLastEdgeDist;
@@ -68,7 +68,7 @@ public class PinchToZoomGesture implements GestureHandler {
     private boolean zoomMode;
     private ZoomEvent zoomEvent;
     private short[] pIds = new short[] { -1, -1 };
-    
+
     public PinchToZoomGesture(NativeSurface surface) {
         clear(true);
         this.surface = surface;
@@ -80,10 +80,10 @@ public class PinchToZoomGesture implements GestureHandler {
     }
 
     private int gesturePointers(final MouseEvent e, final int excludeIndex) {
-        int j = 0;       
+        int j = 0;
         for(int i=e.getPointerCount()-1; i>=0; i--) {
             if( excludeIndex != i ) {
-                final int id = e.getPointerId(i); 
+                final int id = e.getPointerId(i);
                 if( pIds[0] == id || pIds[1] == id ) {
                     j++;
                 }
@@ -91,7 +91,7 @@ public class PinchToZoomGesture implements GestureHandler {
         }
         return j;
     }
-    
+
     @Override
     public void clear(boolean clearStarted) {
         zoomEvent = null;
@@ -103,31 +103,31 @@ public class PinchToZoomGesture implements GestureHandler {
             pIds[1] = -1;
         }
     }
-    
+
     @Override
     public boolean isWithinGesture() {
         return zoomMode;
     }
-    
+
     @Override
     public boolean hasGesture() {
         return null != zoomEvent;
     }
-    
+
     @Override
     public InputEvent getGestureEvent() {
         return zoomEvent;
     }
-    
-    /** Zoom value lies within [0..2], with 1 as <i>1:1</i>. */ 
+
+    /** Zoom value lies within [0..2], with 1 as <i>1:1</i>. */
     public final float getZoom() {
         return zoom;
     }
-    /** Set zoom value within [0..2], with 1 as <i>1:1</i>. */ 
+    /** Set zoom value within [0..2], with 1 as <i>1:1</i>. */
     public final void setZoom(float zoom) {
         this.zoom=zoom;
     }
-    
+
     @Override
     public boolean process(final InputEvent in) {
         if( null != zoomEvent || !(in instanceof MouseEvent) ) {
@@ -137,15 +137,15 @@ public class PinchToZoomGesture implements GestureHandler {
         if( pe.getPointerType(0).getPointerClass() != MouseEvent.PointerClass.Onscreen ) {
             return false;
         }
-        
+
         final int pointerDownCount = pe.getPointerCount();
         final int eventType = pe.getEventType();
         final boolean useY = surface.getWidth() >= surface.getHeight(); // use smallest dimension
         switch ( eventType ) {
             case MouseEvent.EVENT_MOUSE_PRESSED: {
                 if( 1 == pointerDownCount ) {
-                    pIds[0] = pe.getPointerId(0);                    
-                    pIds[1] = -1;                    
+                    pIds[0] = pe.getPointerId(0);
+                    pIds[1] = -1;
                 } else if ( 2 <= pointerDownCount ) { // && 1 == gesturePointers(pe, 0) /* w/o pressed pointer */) {
                     pIds[0] = pe.getPointerId(0);
                     pIds[1] = pe.getPointerId(1);
@@ -155,13 +155,13 @@ public class PinchToZoomGesture implements GestureHandler {
                     System.err.println(this+".pressed: down "+pointerDownCount+", gPtr "+gesturePointers(pe, -1)+", event "+pe);
                 }
             } break;
-            
+
             case MouseEvent.EVENT_MOUSE_RELEASED: {
                 final int gPtr = gesturePointers(pe, 0); // w/o lifted pointer
                 if ( 1 == gPtr ) {
                     zoomFirstTouch = true;
                     zoomMode = false;
-                } else if( 0 == gPtr ) { 
+                } else if( 0 == gPtr ) {
                     // all lifted
                     clear(true);
                 }
@@ -169,7 +169,7 @@ public class PinchToZoomGesture implements GestureHandler {
                     System.err.println(this+".released: down "+pointerDownCount+", gPtr "+gPtr+", event "+pe);
                 }
             } break;
-            
+
             case MouseEvent.EVENT_MOUSE_DRAGGED: {
                 if( 2 <= pointerDownCount ) {
                     final int gPtr = gesturePointers(pe, -1);
@@ -187,13 +187,13 @@ public class PinchToZoomGesture implements GestureHandler {
                                 zoomMode = true;
                             } else if( zoomMode ) {
                                 final int d = Math.abs(edge0-edge1);
-                                final int dd = d - zoomLastEdgeDist;                        
+                                final int dd = d - zoomLastEdgeDist;
                                 final float screenEdge = useY ? surface.getHeight() : surface.getWidth();
                                 final float incr = (float)dd / screenEdge; // [-1..1]
                                 if(DEBUG) {
                                     System.err.println("XXX2: id0 "+pIds[0]+" -> idx0 "+p0Idx+", id1 "+pIds[1]+" -> idx1 "+p1Idx);
                                     System.err.println("XXX3: d "+d+", ld "+zoomLastEdgeDist+", dd "+dd+", screen "+screenEdge+" -> incr "+incr+", zoom "+zoom+" -> "+(zoom+incr));
-                                }        
+                                }
                                 zoom += incr;
                                 // clip value
                                 if( 2f < zoom ) {
@@ -211,7 +211,7 @@ public class PinchToZoomGesture implements GestureHandler {
                     }
                 }
             } break;
-            
+
             default:
         }
         return null != zoomEvent;
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
index 629dc50d7..e826f4a6a 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event;
 
 public class TraceKeyAdapter implements KeyListener {
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
index 14ee633a0..d035091c4 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event;
 
 public class TraceMouseAdapter implements MouseListener {
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
index 8542820c4..630e85303 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event;
 
 public class TraceWindowAdapter implements WindowListener {
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
index b9e487e9b..e237c0d80 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event;
 
 public abstract class WindowAdapter implements WindowListener
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
index 24b3b380a..8c7abfe99 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt.event;
@@ -42,7 +42,7 @@ package com.jogamp.newt.event;
 @SuppressWarnings("serial")
 public class WindowEvent extends NEWTEvent {
     public static final short EVENT_WINDOW_RESIZED = 100;
-    public static final short EVENT_WINDOW_MOVED   = 101; 
+    public static final short EVENT_WINDOW_MOVED   = 101;
     public static final short EVENT_WINDOW_DESTROY_NOTIFY = 102;
     public static final short EVENT_WINDOW_GAINED_FOCUS = 103;
     public static final short EVENT_WINDOW_LOST_FOCUS = 104;
@@ -65,7 +65,7 @@ public class WindowEvent extends NEWTEvent {
             default: return "unknown (" + type + ")";
         }
     }
-    
+
     public String toString() {
         return toString(null).toString();
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowListener.java b/src/newt/classes/com/jogamp/newt/event/WindowListener.java
index dde182510..e097edf23 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowListener.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowListener.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package com.jogamp.newt.event;
@@ -44,17 +44,17 @@ public interface WindowListener extends NEWTEventListener {
     /** Window has been moved. */
     public void windowMoved(WindowEvent e);
 
-    /** 
+    /**
      * Window destruction has been requested.
      * <p>
      * Depending on the {@link WindowClosingProtocol#getDefaultCloseOperation() default close operation},
      * the window maybe destroyed or not.
      * </p>
-     * In case the window will be destroyed (see above), release of resources is recommended. 
+     * In case the window will be destroyed (see above), release of resources is recommended.
      **/
     public void windowDestroyNotify(WindowEvent e);
 
-    /** 
+    /**
      * Window has been destroyed.
      */
     public void windowDestroyed(WindowEvent e);
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
index a0f6e2cb4..8a204d234 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event;
 
 import javax.media.nativewindow.util.Rectangle;
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
index 6de2eee45..e3bf18448 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event.awt;
 
 import jogamp.newt.Debug;
@@ -48,10 +48,10 @@ import jogamp.newt.Debug;
  * Common:<br>
  * <pre>
     // your demo/render code
-    javax.media.opengl.GLEvenListener demo1 = new javax.media.opengl.GLEvenListener() { ... } ; 
+    javax.media.opengl.GLEvenListener demo1 = new javax.media.opengl.GLEvenListener() { ... } ;
 
     // your AWT agnostic NEWT mouse listener code
-    com.jogamp.newt.event.MouseListener mouseListener = new com.jogamp.newt.event.MouseAdapter() { ... } ; 
+    com.jogamp.newt.event.MouseListener mouseListener = new com.jogamp.newt.event.MouseAdapter() { ... } ;
  * </pre> </p>
  * <p>
  * Default NEWT use case, without using the AWTAdapter:<br>
@@ -96,7 +96,7 @@ import jogamp.newt.Debug;
     <br>
     new AWTMouseAdapter(mouseListener, glWindow).addTo(comp);<br>
  * </pre> </p>
- * 
+ *
  * Last but not least, the AWTAdapter maybe used as a general AWT event forwarder to NEWT.<br>
  *
  * <p>
@@ -108,7 +108,7 @@ import jogamp.newt.Debug;
     <br>
     new AWTMouseAdapter(glWindow).addTo(comp); // forward all AWT events to glWindow, as NEWT events<br>
  * </pre> </p>
- * 
+ *
  * @see #attachTo
  */
 public abstract class AWTAdapter implements java.util.EventListener
@@ -118,7 +118,7 @@ public abstract class AWTAdapter implements java.util.EventListener
     com.jogamp.newt.event.NEWTEventListener newtListener;
     com.jogamp.newt.Window newtWindow;
 
-    /** 
+    /**
      * Simply wrap aroung a NEWT EventListener, exposed as an AWT EventListener.<br>
      * The NEWT EventListener will be called when an event happens.<br>
      */
@@ -130,7 +130,7 @@ public abstract class AWTAdapter implements java.util.EventListener
         this.newtWindow = null;
     }
 
-    /** 
+    /**
      * Wrap aroung a NEWT EventListener, exposed as an AWT EventListener,<br>
      * where the given NEWT Window impersonates as the event's source.
      * The NEWT EventListener will be called when an event happens.<br>
@@ -146,7 +146,7 @@ public abstract class AWTAdapter implements java.util.EventListener
         this.newtWindow = newtProxy;
     }
 
-    /** 
+    /**
      * Create a pipeline adapter, AWT EventListener.<br>
      * Once attached to an AWT component, it sends the converted AWT events to the NEWT downstream window.<br>
      * This is only supported with EDT enabled!
@@ -162,15 +162,15 @@ public abstract class AWTAdapter implements java.util.EventListener
         }
     }
 
-    public final com.jogamp.newt.Window getNewtWindow() { 
-        return newtWindow; 
+    public final com.jogamp.newt.Window getNewtWindow() {
+        return newtWindow;
     }
-    
+
     public final com.jogamp.newt.event.NEWTEventListener getNewtEventListener() {
-        return newtListener; 
+        return newtListener;
     }
-    
-    /** 
+
+    /**
      * Due to the fact that some NEWT {@link com.jogamp.newt.event.NEWTEventListener}
      * are mapped to more than one {@link java.util.EventListener},
      * this method is for your convenience to use this Adapter as a listener for all types.<br>
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
index bef2e5d0f..1b53671ba 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,18 +20,18 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event.awt;
 
 import jogamp.newt.awt.event.AWTNewtEventFactory;
 
 /**
- * AWT: 
+ * AWT:
  *   printable:     PRESSED (t0), TYPED (t0), RELEASED (t1)
  *   non-printable: PRESSED (t0), RELEASED (t1)
  */
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
index 115743a0d..ab4bf7a3f 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,17 +20,17 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event.awt;
 
 import jogamp.newt.awt.event.AWTNewtEventFactory;
 
-public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseListener, 
+public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseListener,
                                                            java.awt.event.MouseMotionListener,
                                                            java.awt.event.MouseWheelListener
 {
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
index e91bb2f82..8c9781b77 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,20 +20,20 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.newt.event.awt;
 
 import java.awt.Dimension;
 
 import jogamp.newt.awt.event.AWTNewtEventFactory;
 
-public class AWTWindowAdapter 
-    extends AWTAdapter 
+public class AWTWindowAdapter
+    extends AWTAdapter
     implements java.awt.event.ComponentListener, java.awt.event.WindowListener, java.awt.event.FocusListener
 {
     WindowClosingListener windowClosingListener;
@@ -63,17 +63,17 @@ public class AWTWindowAdapter
         if(awtComponent instanceof java.awt.Window) {
             ((java.awt.Window)awtComponent).addWindowListener(this);
         }
-        return this;        
+        return this;
     }
-    
+
     public AWTAdapter removeWindowClosingFrom(java.awt.Component awtComponent) {
         java.awt.Window win = getWindow(awtComponent);
         if( null != win && null != windowClosingListener ) {
             win.removeWindowListener(windowClosingListener);
         }
-        return this;        
+        return this;
     }
-    
+
     public AWTAdapter removeFrom(java.awt.Component awtComponent) {
         awtComponent.removeFocusListener(this);
         awtComponent.removeComponentListener(this);
@@ -225,7 +225,7 @@ public class AWTWindowAdapter
                 enqueueEvent(true, event);
             }
         }
-        public void windowClosed(java.awt.event.WindowEvent e) { 
+        public void windowClosed(java.awt.event.WindowEvent e) {
             com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
             if(null!=newtListener) {
                 ((com.jogamp.newt.event.WindowListener)newtListener).windowDestroyed(event);
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index cae1a06a2..ac81e8469 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -127,7 +127,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
                 }
 
                 @Override
-                public void windowResized(WindowEvent e) {                    
+                public void windowResized(WindowEvent e) {
                     defaultWindowResizedOp(getWidth(), getHeight());
                 }
 
@@ -139,7 +139,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     public final Object getUpstreamWidget() {
         return window;
     }
-    
+
     /**
      * Creates a new GLWindow attaching a new Window referencing a
      * new default Screen and default Display with the given GLCapabilities.
@@ -218,7 +218,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     @Override
     public final CapabilitiesImmutable getChosenCapabilities() {
         final GLDrawable _drawable = drawable;
-        return null != _drawable ? _drawable.getChosenGLCapabilities() : window.getChosenCapabilities();        
+        return null != _drawable ? _drawable.getChosenGLCapabilities() : window.getChosenCapabilities();
     }
 
     @Override
@@ -339,7 +339,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     public final int getY() {
         return window.getY();
     }
-    
+
     @Override
     public final int getWidth() {
         return window.getWidth();
@@ -349,7 +349,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     public final int getHeight() {
         return window.getHeight();
     }
-    
+
     @Override
     public final void setPosition(int x, int y) {
         window.setPosition(x, y);
@@ -363,7 +363,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     public final boolean setFullscreen(boolean fullscreen) {
         return window.setFullscreen(fullscreen);
     }
-    
+
     @Override
     public boolean setFullscreen(List<MonitorDevice> monitors) {
         return window.setFullscreen(monitors);
@@ -418,7 +418,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     public void setWindowDestroyNotifyAction(Runnable r) {
         window.setWindowDestroyNotifyAction(r);
     }
-    
+
     @Override
     public final void setVisible(boolean visible) {
         window.setVisible(visible);
@@ -450,7 +450,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
         public void preserveGLStateAtDestroy(boolean value) {
             GLWindow.this.preserveGLStateAtDestroy(value);
         }
-        
+
         @Override
         public synchronized void destroyActionPreLock() {
             // nop
@@ -464,7 +464,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
                 //Exception e1 = new Exception(msg);
                 //e1.printStackTrace();
             }
-                    
+
             destroyImplInLock();
 
             if(Window.DEBUG_IMPLEMENTATION) {
@@ -493,7 +493,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
             } else {
                 t0 = 0;
             }
-            
+
             if (null == drawable && visible && 0 != window.getWindowHandle() && 0<getWidth()*getHeight()) {
                 if( ( null != context ) ) {
                     throw new InternalError("GLWindow.LifecycleHook.setVisiblePost: "+WindowImpl.getThreadName()+" - Null drawable, but valid context - "+GLWindow.this);
@@ -509,7 +509,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
                 }
                 drawable = (GLDrawableImpl) factory.createGLDrawable(ns);
                 drawable.setRealized(true);
-                
+
                 if( !GLWindow.this.pushGLEventListenerState() ) {
                     context = (GLContextImpl) drawable.createContext(sharedContext);
                     context.setContextCreationFlags(additionalCtxCreationFlags);
@@ -538,7 +538,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
                 savedAnimator.resume();
             }
         }
-        
+
         @SuppressWarnings("deprecation")
         @Override
         public void shutdownRenderingAction() {
@@ -572,12 +572,12 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     //
 
     private GLContext sharedContext = null;
-    
+
     @Override
     protected final RecursiveLock getLock() {
         return window.getLock();
     }
-    
+
     /**
      * Specifies an {@link javax.media.opengl.GLContext OpenGL context} to share with.<br>
      * At native creation, {@link #setVisible(boolean) setVisible(true)},
@@ -619,7 +619,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
             setVisible(true);
         }
     }
-    
+
     /**
      * {@inheritDoc}
      * <p>
@@ -643,7 +643,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     public final void swapBuffers() throws GLException {
          defaultSwapBuffers();
     }
-    
+
     //----------------------------------------------------------------------
     // NEWTEventConsumer
     //
@@ -807,7 +807,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     public final void removeGestureListener(GestureHandler.GestureListener gl) {
         window.removeGestureListener(gl);
     }
-    
+
     //----------------------------------------------------------------------
     // NativeWindow completion
     //
@@ -893,7 +893,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
                         _forceGL3 = true;
                     } else if(args[i].equals("-gl4es3")) {
                         _forceGL4ES3 = true;
-                    }            
+                    }
                 }
             }
             forceES2 = _forceES2;
@@ -905,7 +905,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
         System.err.println("forceES3    "+forceES3);
         System.err.println("forceGL3    "+forceGL3);
         System.err.println("forceGL4ES3 "+forceGL4ES3);
-        
+
         System.err.println(VersionUtil.getPlatformInfo());
         System.err.println(GlueGenVersion.getInstance());
         System.err.println(JoglVersion.getInstance());
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index a2135273b..a25b43777 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -71,9 +71,9 @@ import com.jogamp.newt.util.EDTUtil;
 public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
     private static final boolean DEBUG = Debug.debug("Window");
     private static final boolean isOSX = NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false);
-    
-    private final AbstractGraphicsScreen screen;     
-    
+
+    private final AbstractGraphicsScreen screen;
+
     private WindowClosingMode newtChildCloseOp = WindowClosingMode.DISPOSE_ON_CLOSE;
     private volatile Rectangle clientArea;
 
@@ -82,22 +82,22 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
     private volatile boolean newtChildReady = false; // ready if SWTEDTUtil is set and newtChild parented
     private volatile boolean postSetSize = false; // pending resize
 
-    /** 
-     * Creates an instance using {@link #NewtCanvasSWT(Composite, int, Window)} 
+    /**
+     * Creates an instance using {@link #NewtCanvasSWT(Composite, int, Window)}
      * on the SWT thread.
-     * 
+     *
      * <p>
      * Note: The NEWT child {@link Display}'s {@link EDTUtil} is being set to an SWT conform implementation
-     *       via {@link Display#setEDTUtil(EDTUtil)}. 
+     *       via {@link Display#setEDTUtil(EDTUtil)}.
      * </p>
-     * 
+     *
      * @param parent the SWT composite
-     * @param style additional styles to SWT#NO_BACKGROUND 
-     * @param child optional preassigned {@link #Window}, maybe null 
+     * @param style additional styles to SWT#NO_BACKGROUND
+     * @param child optional preassigned {@link #Window}, maybe null
      * @return a new instance
      */
     public static NewtCanvasSWT create(final Composite parent, final int style, final Window child) {
-        final NewtCanvasSWT[] res = new NewtCanvasSWT[] { null }; 
+        final NewtCanvasSWT[] res = new NewtCanvasSWT[] { null };
         parent.getDisplay().syncExec( new Runnable() {
            public void run() {
                res[0] = new NewtCanvasSWT( parent, style, child);
@@ -105,22 +105,22 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         });
         return res[0];
     }
-    
+
     /**
      * Instantiates a NewtCanvas with a NEWT child.
-     * 
+     *
      * <p>
      * Note: The NEWT child {@link Display}'s {@link EDTUtil} is being set to an SWT conform implementation
-     *       via {@link Display#setEDTUtil(EDTUtil)}. 
+     *       via {@link Display#setEDTUtil(EDTUtil)}.
      * </p>
-     * 
+     *
      * @param parent the SWT composite
-     * @param style additional styles to SWT#NO_BACKGROUND 
-     * @param child optional preassigned {@link #Window}, maybe null 
+     * @param style additional styles to SWT#NO_BACKGROUND
+     * @param child optional preassigned {@link #Window}, maybe null
      */
     public NewtCanvasSWT(final Composite parent, final int style, Window child) {
         super(parent, style | SWT.NO_BACKGROUND);
-        
+
         SWTAccessor.setRealized(this, true);
 
         clientArea = getClientArea();
@@ -128,7 +128,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         final AbstractGraphicsDevice device = SWTAccessor.getDevice(this);
         screen = SWTAccessor.getScreen(device, -1 /* default */);
         nativeWindow = null;
-        
+
         if(null != child) {
             setNEWTChild(child);
         }
@@ -161,12 +161,12 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         addListener (SWT.Paint, listener);
         addListener (SWT.Dispose, listener);
     }
-    
+
     /** assumes nativeWindow == null ! */
     protected final boolean validateNative() {
         updateSizeCheck();
         final Rectangle nClientArea = clientArea;
-        if(0 >= nClientArea.width || 0 >= nClientArea.height) {        
+        if(0 >= nClientArea.width || 0 >= nClientArea.height) {
             return false;
         }
         screen.getDevice().open();
@@ -177,9 +177,9 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         final boolean visualIDValid = NativeWindowFactory.isNativeVisualIDValidForProcessing(visualID);
         if(DEBUG) {
             System.err.println("NewtCanvasSWT.validateNative() windowHandle 0x"+Long.toHexString(nativeWindowHandle)+", visualID 0x"+Integer.toHexString(visualID)+", valid "+visualIDValid);
-        }        
+        }
         if( visualIDValid ) {
-            /* Get the nativewindow-Graphics Device associated with this control (which is determined by the parent Composite). 
+            /* Get the nativewindow-Graphics Device associated with this control (which is determined by the parent Composite).
              * Note: SWT is owner of the native handle, hence no closing operation will be a NOP. */
             final CapabilitiesImmutable caps = new Capabilities();
             final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(screen.getDevice(), caps);
@@ -187,7 +187,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
             if(DEBUG) {
                 System.err.println("NewtCanvasSWT.validateNative() factory: "+factory+", windowHandle 0x"+Long.toHexString(nativeWindowHandle)+", visualID 0x"+Integer.toHexString(visualID)+", chosen config: "+config);
                 // Thread.dumpStack();
-            }        
+            }
             if (null == config) {
                 throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
             }
@@ -198,11 +198,11 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
 
         return null != nativeWindow;
     }
-    
+
     protected final void updateSizeCheck() {
         final Rectangle oClientArea = clientArea;
         final Rectangle nClientArea = getClientArea();
-        if ( nClientArea != null && 
+        if ( nClientArea != null &&
              ( nClientArea.width != oClientArea.width || nClientArea.height != oClientArea.height )
            ) {
             clientArea = nClientArea; // write back new value
@@ -217,12 +217,12 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
             }
         }
     }
-    
+
     @Override
     public void update() {
         // don't paint background etc .. nop avoids flickering
     }
-    
+
     /**
      * Destroys this resource:
      * <ul>
@@ -248,12 +248,12 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         }
         screen.getDevice().close();
         nativeWindow = null;
-        super.dispose();            
+        super.dispose();
     }
-    
+
     /** @return this SWT Canvas NativeWindow representation, may be null in case it has not been realized. */
     public NativeWindow getNativeWindow() { return nativeWindow; }
-    
+
     public WindowClosingMode getDefaultCloseOperation() {
         return newtChildCloseOp; // TODO: implement ?!
     }
@@ -264,28 +264,28 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
 
 
     boolean isParent() {
-        return null!=newtChild ;        
+        return null!=newtChild ;
     }
 
     boolean isFullscreen() {
         return null != newtChild && newtChild.isFullscreen();
     }
 
-    /** 
+    /**
      * Sets a new NEWT child, provoking reparenting.
      * <p>
      * A previously detached <code>newChild</code> will be released to top-level status
-     * and made invisible. 
+     * and made invisible.
      * </p>
      * <p>
-     * Note: When switching NEWT child's, detaching the previous first via <code>setNEWTChild(null)</code> 
-     * produced much cleaner visual results. 
+     * Note: When switching NEWT child's, detaching the previous first via <code>setNEWTChild(null)</code>
+     * produced much cleaner visual results.
      * </p>
      * <p>
      * Note: The NEWT child {@link Display}'s {@link EDTUtil} is being set to an SWT conform implementation
-     *       via {@link Display#setEDTUtil(EDTUtil)}. 
+     *       via {@link Display#setEDTUtil(EDTUtil)}.
      * </p>
-     * @return the previous attached newt child.  
+     * @return the previous attached newt child.
      */
     public Window setNEWTChild(final Window newChild) {
         final Window prevChild = newtChild;
@@ -302,14 +302,14 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         if(null != nativeWindow && null != newChild) {
             reparentWindow( true );
         }
-        return prevChild;        
+        return prevChild;
     }
-    
+
     /** @return the current NEWT child */
     public Window getNEWTChild() {
         return newtChild;
     }
-    
+
     @Override
     public boolean setParent(Composite parent) {
         return super.setParent(parent);
@@ -319,11 +319,11 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         newtChildReady = attach;
         if( null != newtChild ) {
             newtChild.setKeyboardFocusHandler(null);
-            if(attach) {            
-                newtChildCloseOp = newtChild.setDefaultCloseOperation(WindowClosingMode.DO_NOTHING_ON_CLOSE);                
+            if(attach) {
+                newtChildCloseOp = newtChild.setDefaultCloseOperation(WindowClosingMode.DO_NOTHING_ON_CLOSE);
             } else {
                 newtChild.setFocusAction(null);
-                newtChild.setDefaultCloseOperation(newtChildCloseOp);                
+                newtChild.setDefaultCloseOperation(newtChildCloseOp);
             }
         }
     }
@@ -335,13 +335,13 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         if(DEBUG) {
             System.err.println("NewtCanvasSWT.reparentWindow.0: add="+add+", win "+newtWinHandleToHexString(newtChild)+", EDTUtil: cur "+newtChild.getScreen().getDisplay().getEDTUtil());
         }
-        
+
         newtChild.setFocusAction(null); // no AWT focus traversal ..
         if(add) {
             updateSizeCheck();
             final int w = clientArea.width;
             final int h = clientArea.height;
-            
+
             // set SWT EDT and start it
             {
                 final Display newtDisplay = newtChild.getScreen().getDisplay();
@@ -349,14 +349,14 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
                 edtUtil.start();
                 newtDisplay.setEDTUtil( edtUtil );
             }
-            
-            newtChild.setSize(w, h);            
+
+            newtChild.setSize(w, h);
             newtChild.reparentWindow(nativeWindow);
             newtChild.setVisible(true);
-            configureNewtChild(true);            
+            configureNewtChild(true);
             newtChild.sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout to listener
-            
-            // force this SWT Canvas to be focus-able, 
+
+            // force this SWT Canvas to be focus-able,
             // since it is completely covered by the newtChild (z-order).
             setEnabled(true);
         } else {
@@ -375,19 +375,19 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
             newtChild.requestFocus();
         }
     }
-    
+
     @Override
     public boolean forceFocus() {
         final boolean res = NewtCanvasSWT.super.forceFocus();
         requestFocusNEWTChild();
-        return res;        
+        return res;
     }
-        
+
     private class SWTNativeWindow implements NativeWindow {
         private final AbstractGraphicsConfiguration config;
         private final long nativeWindowHandle;
         private final InsetsImmutable insets; // only required to allow proper client position calculation on OSX
-        
+
         public SWTNativeWindow(AbstractGraphicsConfiguration config, long nativeWindowHandle) {
             this.config = config;
             this.nativeWindowHandle = nativeWindowHandle;
@@ -397,7 +397,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
                 this.insets = new Insets(0, 0, 0, 0);
             }
         }
-        
+
         @Override
         public int lockSurface() throws NativeWindowException, RuntimeException {
             return NativeSurface.LOCK_SUCCESS;
@@ -432,7 +432,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) { }
 
         @Override
-        public long getSurfaceHandle() {            
+        public long getSurfaceHandle() {
             return 0;
         }
 
@@ -462,7 +462,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         }
 
         @Override
-        public void surfaceUpdated(Object updater, NativeSurface ns, long when) { }            
+        public void surfaceUpdated(Object updater, NativeSurface ns, long when) { }
 
         @Override
         public void destroy() { }
@@ -497,7 +497,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
             if( isOSX ) {
                 final Point los = OSXUtil.GetLocationOnScreen(nativeWindowHandle, false, 0, 0);
                 // top-level position -> client window position
-                los.set(los.getX() + insets.getLeftWidth(), los.getY() + insets.getTopHeight());                
+                los.set(los.getX() + insets.getLeftWidth(), los.getY() + insets.getTopHeight());
                 if(null!=point) {
                   return point.translate(los);
                 } else {
@@ -506,7 +506,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
             } else {
                 // client position on 'normal' windowing systems is 0/0
                 if(null == point) {
-                    point = new Point(0, 0);                    
+                    point = new Point(0, 0);
                 }
                 return point;
             }
@@ -515,7 +515,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         @Override
         public boolean hasFocus() {
             return isFocusControl();
-        }        
+        }
     };
 
     static String newtWinHandleToHexString(Window w) {
diff --git a/src/newt/classes/com/jogamp/newt/util/EDTUtil.java b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java
index 52ca95682..582dc3e1f 100644
--- a/src/newt/classes/com/jogamp/newt/util/EDTUtil.java
+++ b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java
@@ -63,17 +63,17 @@ public interface EDTUtil {
      * @param ms poll period in milliseconds
      */
     public void setPollPeriod(long ms);
-    
+
     /**
      * Starts the EDT after it's creation or after {@link #invokeStop(boolean, Runnable) stopping}.
      * <p>
      * If the EDT is running, it must be {@link #invokeStop(boolean, Runnable) stopped} first
      * and the caller should wait {@link #waitUntilStopped() until it's stopped}.
      * </p>
-     * 
+     *
      * @return true if EDT has been successfully restarted, otherwise false
      * @throws IllegalStateException if EDT is running and not subject to be stopped, i.e. {@link #isRunning()} returns true
-     *  
+     *
      * @see #invokeStop(boolean, java.lang.Runnable)
      * @see #waitUntilStopped()
      */
@@ -82,11 +82,11 @@ public interface EDTUtil {
     /**
      * Returns true if the current thread is the event dispatch thread (EDT).
      * <p>
-     * The EDT is the platform specific thread dispatching toolkit-events 
+     * The EDT is the platform specific thread dispatching toolkit-events
      * and executing toolkit-tasks enqueued via {@link #invoke(boolean, Runnable)}.
      * </p>
      * <p>
-     * Usually it is the same thread as used to dequeue informal {@link NEWTEvent}s (NEDT), see {@link #isCurrentThreadNEDT()}, 
+     * Usually it is the same thread as used to dequeue informal {@link NEWTEvent}s (NEDT), see {@link #isCurrentThreadNEDT()},
      * however, this may differ, e.g. SWT and AWT implementation.
      * </p>
      */
@@ -95,28 +95,28 @@ public interface EDTUtil {
     /**
      * Returns true if the current thread is the internal NEWT event dequeue thread (NEDT).
      * <p>
-     * The NEDT is the NEWT thread used to dequeue informal {@link NEWTEvent}s enqueued internally 
+     * The NEDT is the NEWT thread used to dequeue informal {@link NEWTEvent}s enqueued internally
      * via {@link DisplayImpl#enqueueEvent(boolean, NEWTEvent)}.
      * </p>
      * <p>
-     * Usually it is the same thread as the EDT, see {@link #isCurrentThreadEDT()}, 
+     * Usually it is the same thread as the EDT, see {@link #isCurrentThreadEDT()},
      * however, this may differ, e.g. SWT and AWT implementation.
      * </p>
      */
     public boolean isCurrentThreadNEDT();
-    
+
     /**
      * Returns <code>true</code> if either {@link #isCurrentThreadEDT()} or {@link #isCurrentThreadNEDT()} is <code>true</code>,
      * otherwise <code>false</code>.
      */
     public boolean isCurrentThreadEDTorNEDT();
-    
+
     /**
      * @return True if EDT is running and not subject to be stopped.
      */
     public boolean isRunning();
 
-    /** 
+    /**
      * Append the final task to the EDT task queue,
      * signals EDT to stop.
      * <p>
@@ -133,22 +133,22 @@ public interface EDTUtil {
      *   <li>{@link #start()} may follow immediately, ie creating a new EDT</li>
      * </ul>
      * </p>
-     * @return true if <code>task</code> has been executed or queued for later execution, otherwise false 
+     * @return true if <code>task</code> has been executed or queued for later execution, otherwise false
      */
     public boolean invokeStop(boolean wait, Runnable finalTask);
 
-    /** 
+    /**
      * Appends task to the EDT task queue if current thread is not EDT,
-     * otherwise execute task immediately. 
+     * otherwise execute task immediately.
      * <p>
      * Wait until execution is finished if <code>wait == true</code>.
      * </p>
      * Can be issued from within EDT, ie from within an enqueued task.<br>
-     * @return true if <code>task</code> has been executed or queued for later execution, otherwise false 
+     * @return true if <code>task</code> has been executed or queued for later execution, otherwise false
      */
     public boolean invoke(boolean wait, Runnable task);
 
-    /** 
+    /**
      * Wait until the EDT task queue is empty.<br>
      * The last task may still be in execution when this method returns.
      * @return true if waited for idle, otherwise false, i.e. in case of current thread is EDT or NEDT
diff --git a/src/newt/classes/com/jogamp/newt/util/MainThread.java b/src/newt/classes/com/jogamp/newt/util/MainThread.java
index 5e79e9b49..049320b21 100644
--- a/src/newt/classes/com/jogamp/newt/util/MainThread.java
+++ b/src/newt/classes/com/jogamp/newt/util/MainThread.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -54,13 +54,13 @@ import jogamp.newt.NEWTJNILibLoader;
  * NEWT Utility class MainThread<P>
  *
  * <p>
- * FIXME: Update this documentation! 
+ * FIXME: Update this documentation!
  * This class just provides a main-thread utility, forking of a main java class
  * on another thread while being able to continue doing platform specific things
  * on the main-thread. The latter is essential for eg. MacOSX, where we continue
  * to run NSApp.run().
  * </p>
- * 
+ *
  * This class provides a startup singleton <i>main thread</i>,
  * from which a new thread with the users main class is launched.<br>
  *
@@ -72,17 +72,17 @@ import jogamp.newt.NEWTJNILibLoader;
  * use a NEWT multithreaded application with window handling within the different threads,
  * even on these restricted platforms.<br>
  *
- * To support your NEWT Window platform, 
+ * To support your NEWT Window platform,
  * you have to pass your <i>main thread</i> actions to {@link #invoke invoke(..)},
  * have a look at the {@link jogamp.newt.driver.macosx.WindowDriver NEWT Mac OSX Window} driver implementation.<br>
- * <i>TODO</i>: Some hardcoded dependencies exist in this implementation, 
+ * <i>TODO</i>: Some hardcoded dependencies exist in this implementation,
  * where you have to patch this code or factor it out. <P>
- * 
+ *
  * If your platform is not Mac OS X, but you want to test your code without modifying
  * this class, you have to set the system property <code>newt.MainThread.force</code> to <code>true</code>.<P>
  *
  * The code is compatible with all other platform, which support multithreaded windowing handling.
- * Since those platforms won't trigger the <i>main thread</i> serialization, the main method 
+ * Since those platforms won't trigger the <i>main thread</i> serialization, the main method
  * will be simply executed, in case you haven't set <code>newt.MainThread.force</code> to <code>true</code>.<P>
  *
  * Test case on Mac OS X (or any other platform):
@@ -96,35 +96,35 @@ public class MainThread {
     private static final Platform.OSType osType;
     private static final boolean isMacOSX;
     private static final ThreadGroup rootThreadGroup;
-    
+
     /** if true, use the main thread EDT, otherwise AWT's EDT */
     public static final boolean  HINT_USE_MAIN_THREAD;
-    
+
     static {
         NativeWindowFactory.initSingleton();
         NEWTJNILibLoader.loadNEWT();
-        HINT_USE_MAIN_THREAD = !NativeWindowFactory.isAWTAvailable() || 
+        HINT_USE_MAIN_THREAD = !NativeWindowFactory.isAWTAvailable() ||
                                 Debug.getBooleanProperty("newt.MainThread.force", true);
         osType = Platform.getOSType();
         isMacOSX = osType == Platform.OSType.MACOS;
         rootThreadGroup = getRootThreadGroup();
     }
-    
+
     public static boolean useMainThread = false;
-    
+
     protected static final boolean DEBUG = Debug.debug("MainThread");
 
     private static final MainThread singletonMainThread = new MainThread(); // one singleton MainThread
-    
+
     private static final ThreadGroup getRootThreadGroup() {
         ThreadGroup rootGroup = Thread.currentThread( ).getThreadGroup( );
         ThreadGroup parentGroup;
         while ( ( parentGroup = rootGroup.getParent() ) != null ) {
             rootGroup = parentGroup;
         }
-        return rootGroup;   
+        return rootGroup;
     }
-    
+
     private static final Thread[] getAllThreads(int[] count) {
         int tn;
         Thread[] threads = new Thread[ rootThreadGroup.activeCount() ];
@@ -149,17 +149,17 @@ public class MainThread {
                 t.printStackTrace();
             }
         }
-        return res;        
+        return res;
     }
     private static final int getNonDaemonThreadCount(List<Thread> ignoreThreads) {
         int res = 0;
         int[] tn = { 0 };
         Thread[] threads = getAllThreads(tn);
-        
+
         for(int i = tn[0] - 1; i >= 0; i--) {
             final Thread thread = threads[i];
             try {
-                if(thread.isAlive() && !thread.isDaemon() && !ignoreThreads.contains(thread)) {                    
+                if(thread.isAlive() && !thread.isDaemon() && !ignoreThreads.contains(thread)) {
                     res++;
                     if(DEBUG) System.err.println("MainAction.run(): non daemon thread: "+thread);
                 }
@@ -167,9 +167,9 @@ public class MainThread {
                 t.printStackTrace();
             }
         }
-        return res;        
+        return res;
     }
-    
+
     static class UserApp extends Thread {
         private final String mainClassNameShort;
         private final String mainClassName;
@@ -181,7 +181,7 @@ public class MainThread {
             super();
             this.mainClassName=mainClassName;
             this.mainClassArgs=mainClassArgs;
-            
+
             final Class<?> mainClass = ReflectionUtil.getClass(mainClassName, true, getClass().getClassLoader());
             if(null==mainClass) {
                 throw new ClassNotFoundException("MainAction couldn't find main class "+mainClassName);
@@ -192,7 +192,7 @@ public class MainThread {
 
             setName(getName()+"-UserApp-"+mainClassNameShort);
             setDaemon(false);
-            
+
             if(DEBUG) System.err.println("MainAction(): instantiated: "+getName()+", is daemon "+isDaemon()+", main-class: "+mainClass.getName());
         }
 
@@ -230,32 +230,32 @@ public class MainThread {
                 if(isMacOSX) {
                     try {
                         if(DEBUG) {
-                            System.err.println("MainAction.main(): "+Thread.currentThread()+" MainAction fin - stopNSApp.0"); 
+                            System.err.println("MainAction.main(): "+Thread.currentThread()+" MainAction fin - stopNSApp.0");
                         }
-                        ReflectionUtil.callStaticMethod(MACOSXDisplayClassName, "stopNSApplication", 
+                        ReflectionUtil.callStaticMethod(MACOSXDisplayClassName, "stopNSApplication",
                             null, null, MainThread.class.getClassLoader());
                         if(DEBUG) {
-                            System.err.println("MainAction.main(): "+Thread.currentThread()+" MainAction fin - stopNSApp.X"); 
+                            System.err.println("MainAction.main(): "+Thread.currentThread()+" MainAction fin - stopNSApp.X");
                         }
                     } catch (Exception e) {
                         e.printStackTrace();
                     }
                 } else {
                     if(DEBUG) System.err.println("MainAction.run(): "+Thread.currentThread().getName()+" MainAction fin - System.exit(0)");
-                    System.exit(0);                
-                }   
+                    System.exit(0);
+                }
             }
         }
     }
     private static UserApp mainAction;
 
-    /** Your new java application main entry, which pipelines your application 
-     * @throws ClassNotFoundException 
-     * @throws NoSuchMethodException 
+    /** Your new java application main entry, which pipelines your application
+     * @throws ClassNotFoundException
+     * @throws NoSuchMethodException
      * @throws SecurityException */
     public static void main(String[] args) throws SecurityException, NoSuchMethodException, ClassNotFoundException {
         final Thread cur = Thread.currentThread();
-        
+
         useMainThread = HINT_USE_MAIN_THREAD;
 
         if(DEBUG) {
@@ -268,7 +268,7 @@ public class MainThread {
         if(!useMainThread && !NativeWindowFactory.isAWTAvailable()) {
             throw new RuntimeException("!USE_MAIN_THREAD and no AWT available");
         }
-        
+
         if(args.length==0) {
             return;
         }
@@ -282,7 +282,7 @@ public class MainThread {
         mainAction = new UserApp(mainClassName, mainClassArgs);
 
         if(isMacOSX) {
-            ReflectionUtil.callStaticMethod(MACOSXDisplayClassName, "initSingleton", 
+            ReflectionUtil.callStaticMethod(MACOSXDisplayClassName, "initSingleton",
                 null, null, MainThread.class.getClassLoader());
         }
 
@@ -290,24 +290,24 @@ public class MainThread {
             try {
                 cur.setName(cur.getName()+"-MainThread");
             } catch (Exception e) {}
-            
+
             // dispatch user's main thread ..
             mainAction.start();
-            
+
             if(isMacOSX) {
                 try {
                     if(DEBUG) {
-                        System.err.println("MainThread.main(): "+cur.getName()+"- runNSApp"); 
+                        System.err.println("MainThread.main(): "+cur.getName()+"- runNSApp");
                     }
-                    ReflectionUtil.callStaticMethod(MACOSXDisplayClassName, "runNSApplication", 
+                    ReflectionUtil.callStaticMethod(MACOSXDisplayClassName, "runNSApplication",
                         null, null, MainThread.class.getClassLoader());
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
-            }   
-            if(DEBUG) { System.err.println("MainThread - wait until last non daemon thread ends ..."); }            
+            }
+            if(DEBUG) { System.err.println("MainThread - wait until last non daemon thread ends ..."); }
         } else {
-            // run user's main in this thread 
+            // run user's main in this thread
             mainAction.run();
         }
     }
diff --git a/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java b/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java
index c30b427d6..fdd7985fe 100644
--- a/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java
+++ b/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java
@@ -42,7 +42,7 @@ import javax.media.nativewindow.util.SurfaceSize;
  * filters etc.
  */
 public class MonitorModeUtil {
-    
+
     public static int getIndex(List<MonitorMode> monitorModes, MonitorMode search) {
         return monitorModes.indexOf(search);
     }
@@ -69,7 +69,7 @@ public class MonitorModeUtil {
         }
         return null;
     }
-    
+
     /** Sort the given {@link MonitorMode} collection w/ {@link MonitorMode#compareTo(MonitorMode)} function. */
     public static void sort(List<MonitorMode> monitorModes, boolean ascendingOrder) {
         if( ascendingOrder ) {
@@ -78,9 +78,9 @@ public class MonitorModeUtil {
             Collections.sort(monitorModes, MonitorMode.monitorModeComparatorInv);
         }
     }
-    
+
     /**
-     * 
+     *
      * @param monitorModes
      * @param surfaceSize
      * @return modes with exact {@link SurfaceSize}. May return zero sized list for non.
@@ -99,7 +99,7 @@ public class MonitorModeUtil {
     }
 
     /**
-     * 
+     *
      * @param monitorModes
      * @param rotation
      * @return modes with exact rotation. May return zero sized list for non.
@@ -118,7 +118,7 @@ public class MonitorModeUtil {
     }
 
     /**
-     * 
+     *
      * @param monitorModes
      * @param bitsPerPixel
      * @return modes with exact bpp. May return zero sized list for non.
@@ -137,7 +137,7 @@ public class MonitorModeUtil {
     }
 
     /**
-     * 
+     *
      * @param monitorModes
      * @param flags
      * @return modes with exact flags. May return zero sized list for non.
@@ -165,7 +165,7 @@ public class MonitorModeUtil {
         if( null!=monitorModes && monitorModes.size()>0 ) {
             final int resolution_sq = resolution.getHeight()*resolution.getWidth();
             int mode_dsq=Integer.MAX_VALUE, mode_dsq_idx=0;
-    
+
             for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
                 final MonitorMode mode = monitorModes.get(i);
                 final DimensionImmutable res = mode.getSurfaceSize().getResolution();
@@ -236,7 +236,7 @@ public class MonitorModeUtil {
     }
 
     /**
-     * 
+     *
      * @param monitorModes
      * @return modes with highest available refresh rate. May return zero sized list for non.
      */
diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java
index 4b0a98216..46a354d4a 100644
--- a/src/newt/classes/jogamp/newt/Debug.java
+++ b/src/newt/classes/jogamp/newt/Debug.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -51,14 +51,14 @@ public class Debug extends PropertyAccess {
   // Some common properties
   private static final boolean verbose;
   private static final boolean debugAll;
-  
+
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
         public Object run() {
             PropertyAccess.addTrustedPrefix("newt.");
             return null;
     } } );
-    
+
     verbose = isPropertyDefined("newt.verbose", true);
     debugAll = isPropertyDefined("newt.debug", true);
     if (verbose) {
diff --git a/src/newt/classes/jogamp/newt/DefaultEDTUtil.java b/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
index 3d1037ad5..f33b4744e 100644
--- a/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
@@ -51,7 +51,7 @@ public class DefaultEDTUtil implements EDTUtil {
     public static final boolean DEBUG = Debug.debug("EDT");
 
     private final Object edtLock = new Object(); // locking the EDT start/stop state
-    private /* final */ ThreadGroup threadGroup; 
+    private /* final */ ThreadGroup threadGroup;
     private final String name;
     private final Runnable dispatchMessages;
     private NEDT edt = null;
@@ -75,7 +75,7 @@ public class DefaultEDTUtil implements EDTUtil {
     final public void setPollPeriod(long ms) {
         pollPeriod = ms;
     }
-    
+
     @Override
     public final boolean start() throws IllegalStateException {
         synchronized(edtLock) {
@@ -117,7 +117,7 @@ public class DefaultEDTUtil implements EDTUtil {
     public final boolean isCurrentThreadEDT() {
         return edt == Thread.currentThread(); // EDT == NEDT
     }
-    
+
     @Override
     public final boolean isCurrentThreadNEDT() {
         return edt == Thread.currentThread(); // EDT == NEDT
@@ -126,8 +126,8 @@ public class DefaultEDTUtil implements EDTUtil {
     @Override
     public final boolean isCurrentThreadEDTorNEDT() {
         return edt == Thread.currentThread(); // EDT == NEDT
-    }    
-    
+    }
+
     @Override
     public final boolean isRunning() {
         return edt.isRunning() ;
@@ -149,9 +149,9 @@ public class DefaultEDTUtil implements EDTUtil {
 
     private static Runnable nullTask = new Runnable() {
         @Override
-        public void run() { }        
+        public void run() { }
     };
-    
+
     private final boolean invokeImpl(boolean wait, Runnable task, boolean stop) {
         Throwable throwable = null;
         RunnableTask rTask = null;
@@ -201,7 +201,7 @@ public class DefaultEDTUtil implements EDTUtil {
                         synchronized(edt.tasks) {
                             rTask = new RunnableTask(task,
                                                      wait ? rTaskLock : null,
-                                                     true /* always catch and report Exceptions, don't disturb EDT */, 
+                                                     true /* always catch and report Exceptions, don't disturb EDT */,
                                                      wait ? null : System.err);
                             if(stop) {
                                 rTask.setAttachment(new Boolean(true)); // mark final task, will imply shouldStop:=true
@@ -305,8 +305,8 @@ public class DefaultEDTUtil implements EDTUtil {
                 throw new InternalError("XXX");
             }
         }
-        
-        /** 
+
+        /**
          * Utilizing locking only on tasks and its execution,
          * not for event dispatching.
          */
@@ -315,7 +315,7 @@ public class DefaultEDTUtil implements EDTUtil {
             if(DEBUG) {
                 System.err.println(getName()+": Default-EDT run() START "+ getName());
             }
-            if(Lock.DEBUG) {            
+            if(Lock.DEBUG) {
                 validateNoRecursiveLocksHold();
             }
             RuntimeException error = null;
@@ -368,7 +368,7 @@ public class DefaultEDTUtil implements EDTUtil {
             } finally {
                 if(DEBUG) {
                     RunnableTask rt = ( tasks.size() > 0 ) ? tasks.get(0) : null ;
-                    System.err.println(getName()+": Default-EDT run() END "+ getName()+", tasks: "+tasks.size()+", "+rt+", "+error); 
+                    System.err.println(getName()+": Default-EDT run() END "+ getName()+", tasks: "+tasks.size()+", "+rt+", "+error);
                 }
                 synchronized(edtLock) {
                     isRunning = false;
diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java
index 0f47c87a0..c6cb706a4 100644
--- a/src/newt/classes/jogamp/newt/DisplayImpl.java
+++ b/src/newt/classes/jogamp/newt/DisplayImpl.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt;
@@ -60,16 +60,16 @@ public abstract class DisplayImpl extends Display {
            }
         });
     }
-        
+
     /** Ensure static init has been run. */
     /* pp */static void initSingleton() { }
-    
-    private static Class<?> getDisplayClass(String type) 
-        throws ClassNotFoundException 
+
+    private static Class<?> getDisplayClass(String type)
+        throws ClassNotFoundException
     {
         final Class<?> displayClass = NewtFactory.getCustomClass(type, "DisplayDriver");
         if(null==displayClass) {
-            throw new ClassNotFoundException("Failed to find NEWT Display Class <"+type+".DisplayDriver>");            
+            throw new ClassNotFoundException("Failed to find NEWT Display Class <"+type+".DisplayDriver>");
         }
         return displayClass;
     }
@@ -100,7 +100,7 @@ public abstract class DisplayImpl extends Display {
                 display.setEDTUtil( display.edtUtil ); // device's default if EDT is used, or null
                 Display.addDisplay2List(display);
             }
-            
+
             if(DEBUG) {
                 System.err.println("Display.create() NEW: "+display+" "+getThreadName());
             }
@@ -109,7 +109,7 @@ public abstract class DisplayImpl extends Display {
             throw new RuntimeException(e);
         }
     }
-    
+
     @Override
     public boolean equals(Object obj) {
         if (obj == null) {
@@ -168,7 +168,7 @@ public abstract class DisplayImpl extends Display {
     protected EDTUtil createEDTUtil() {
         final EDTUtil def;
         if(NewtFactory.useEDT()) {
-            def = new DefaultEDTUtil(Thread.currentThread().getThreadGroup(), "Display-"+getFQName(), dispatchMessagesRunnable);            
+            def = new DefaultEDTUtil(Thread.currentThread().getThreadGroup(), "Display-"+getFQName(), dispatchMessagesRunnable);
             if(DEBUG) {
                 System.err.println("Display.createEDTUtil("+getFQName()+"): "+def.getClass().getName());
             }
@@ -271,7 +271,7 @@ public abstract class DisplayImpl extends Display {
             if(DEBUG) {
                 System.err.println("Display.destroy(): "+this+", active "+displaysActive+" "+getThreadName());
             }
-        }        
+        }
         final DisplayImpl f_dpy = this;
         final AbstractGraphicsDevice f_aDevice = aDevice;
         aDevice = null;
@@ -287,10 +287,10 @@ public abstract class DisplayImpl extends Display {
             dumpDisplayList("Display.destroy("+getFQName()+") END");
         }
     }
-    
+
     /** May be utilized at a shutdown hook, impl. does not block. */
     /* pp */ static final void shutdownAll() {
-        final int dCount = displayList.size(); 
+        final int dCount = displayList.size();
         if(DEBUG) {
             dumpDisplayList("Display.shutdownAll "+dCount+" instances, on thread "+getThreadName());
         }
@@ -306,7 +306,7 @@ public abstract class DisplayImpl extends Display {
                 final EDTUtil edtUtil = d.getEDTUtil();
                 final AbstractGraphicsDevice f_aDevice = d.aDevice;
                 d.aDevice = null;
-                d.refCount=0;                
+                d.refCount=0;
                 final Runnable closeNativeTask = new Runnable() {
                     public void run() {
                         if ( null != d.getGraphicsDevice() ) {
@@ -381,7 +381,7 @@ public abstract class DisplayImpl extends Display {
     public final String getFQName() {
         return fqname;
     }
-    
+
     @Override
     public final boolean isExclusive() {
         return exclusive;
@@ -438,7 +438,7 @@ public abstract class DisplayImpl extends Display {
     @Override
     public String toString() {
         final EDTUtil _edtUtil = edtUtil;
-        final boolean _edtUtilRunning = ( null != _edtUtil ) ? _edtUtil.isRunning() : false; 
+        final boolean _edtUtilRunning = ( null != _edtUtil ) ? _edtUtil.isRunning() : false;
         return "NEWT-Display["+getFQName()+", excl "+exclusive+", refCount "+refCount+", hasEDT "+(null!=_edtUtil)+", edtRunning "+_edtUtilRunning+", "+aDevice+"]";
     }
 
@@ -455,8 +455,8 @@ public abstract class DisplayImpl extends Display {
         } };
 
     final void dispatchMessage(final NEWTEvent event) {
-        try { 
-            final Object source = event.getSource();        
+        try {
+            final Object source = event.getSource();
             if(source instanceof NEWTEventConsumer) {
                 final NEWTEventConsumer consumer = (NEWTEventConsumer) source ;
                 if(!consumer.consumeEvent(event)) {
@@ -476,10 +476,10 @@ public abstract class DisplayImpl extends Display {
             throw re;
         }
     }
-    
+
     final void dispatchMessage(final NEWTEventTask eventTask) {
         final NEWTEvent event = eventTask.get();
-        try { 
+        try {
             if(null == event) {
                 // Ooops ?
                 System.err.println("Warning: event of eventTask is NULL");
@@ -495,15 +495,15 @@ public abstract class DisplayImpl extends Display {
                 throw re;
             }
         }
-        eventTask.notifyCaller();        
+        eventTask.notifyCaller();
     }
-    
+
     @Override
     public void dispatchMessages() {
         // System.err.println("Display.dispatchMessages() 0 "+this+" "+getThreadName());
-        if(0==refCount || // no screens 
+        if(0==refCount || // no screens
            null==getGraphicsDevice() // no native device
-          ) 
+          )
         {
             return;
         }
@@ -541,13 +541,13 @@ public abstract class DisplayImpl extends Display {
             }
             return;
         }
-        
+
         // can't wait if we are on EDT or NEDT -> consume right away
         if(wait && _edtUtil.isCurrentThreadEDTorNEDT() ) {
             dispatchMessage(e);
             return;
         }
-        
+
         final Object lock = new Object();
         final NEWTEventTask eTask = new NEWTEventTask(e, wait?lock:null);
         synchronized(lock) {
@@ -565,13 +565,13 @@ public abstract class DisplayImpl extends Display {
                 if( null != eTask.getException() ) {
                     throw eTask.getException();
                 }
-            }            
+            }
         }
     }
 
     public interface DisplayRunnable<T> {
         T run(long dpy);
-    }    
+    }
     public static final <T> T runWithLockedDevice(AbstractGraphicsDevice device, DisplayRunnable<T> action) {
         T res;
         device.lock();
@@ -589,7 +589,7 @@ public abstract class DisplayImpl extends Display {
         }
         return runWithLockedDevice(device, action);
     }
-    
+
     protected volatile EDTUtil edtUtil = null;
     protected int id;
     protected String name;
diff --git a/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java b/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java
index 43d558515..9e10879c4 100644
--- a/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java
+++ b/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.newt;
 
 import javax.media.nativewindow.util.DimensionImmutable;
@@ -41,7 +41,7 @@ public class MonitorDeviceImpl extends MonitorDevice {
     public MonitorDeviceImpl(ScreenImpl screen, int nativeId, DimensionImmutable sizeMM, Rectangle viewport, MonitorMode currentMode, ArrayHashSet<MonitorMode> supportedModes) {
         super(screen, nativeId, sizeMM, viewport, currentMode, supportedModes);
     }
-    
+
     @Override
     public final MonitorMode queryCurrentMode() {
         final ScreenImpl screenImpl = (ScreenImpl)screen;
@@ -54,7 +54,7 @@ public class MonitorDeviceImpl extends MonitorDevice {
             }
             MonitorMode mmU = supportedModes.get(mm0); // unified instance
             if( null == mmU ) {
-                // add new mode avoiding exception! 
+                // add new mode avoiding exception!
                 mmU = sms.getMonitorModes().getOrAdd(mm0);
                 mmU = supportedModes.getOrAdd(mmU);
                 if( Screen.DEBUG ) {
@@ -89,21 +89,21 @@ public class MonitorDeviceImpl extends MonitorDevice {
             if( mmU.equals( mmC ) ) {
                 if(Screen.DEBUG) {
                     System.err.println("Screen.setCurrentMode: 0.0 is-current (skip) "+mmU+" == "+mmC);
-                }            
+                }
                 return true;
             }
             final long tStart;
             if(Screen.DEBUG) {
-                tStart = System.currentTimeMillis();                
+                tStart = System.currentTimeMillis();
             } else {
                 tStart = 0;
             }
-            
+
             sms.fireMonitorModeChangeNotify(this, mmU);
             if(Screen.DEBUG) {
                 System.err.println("Screen.setCurrentMode ("+(System.currentTimeMillis()-tStart)+"ms): fireModeChangeNotify() "+mmU);
             }
-            
+
             boolean success = screenImpl.setCurrentMonitorModeImpl(this, mmU);
             if(success) {
                 if(Screen.DEBUG) {
@@ -135,13 +135,13 @@ public class MonitorDeviceImpl extends MonitorDevice {
     private final void setCurrentModeValue(MonitorMode currentMode) {
         this.currentMode = currentMode;
     }
-    
+
     /* pp */ final void setViewportValue(Rectangle viewport) {
         this.viewport = viewport;
     }
-    
+
     /* pp */ ArrayHashSet<MonitorMode> getSupportedModesImpl() {
         return supportedModes;
     }
-    
+
 }
diff --git a/src/newt/classes/jogamp/newt/MonitorModeProps.java b/src/newt/classes/jogamp/newt/MonitorModeProps.java
index 820807e15..9d8f4919c 100644
--- a/src/newt/classes/jogamp/newt/MonitorModeProps.java
+++ b/src/newt/classes/jogamp/newt/MonitorModeProps.java
@@ -54,12 +54,12 @@ public class MonitorModeProps {
      * 1: bpp
      */
     public static final int NUM_SURFACE_SIZE_PROPERTIES = 1;
-    
+
     /** WARNING: must be synchronized with ScreenMode.h, native implementation
      * 2: refresh-rate (Hz*100), flags
      */
     public static final int NUM_SIZEANDRATE_PROPERTIES = 2;
-    
+
     /** WARNING: must be synchronized with ScreenMode.h, native implementation
      * 2: id, rotation
      */
@@ -69,7 +69,7 @@ public class MonitorModeProps {
      * count + all the above
      */
     public static final int NUM_MONITOR_MODE_PROPERTIES_ALL = 8;
-    
+
     public static final int IDX_MONITOR_MODE_BPP =   1 // count
                                                    + MonitorModeProps.NUM_RESOLUTION_PROPERTIES
                                                    ;
@@ -79,7 +79,7 @@ public class MonitorModeProps {
                                                    + MonitorModeProps.NUM_SIZEANDRATE_PROPERTIES
                                                    + 1 // id of MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES
                                                    ;
-    
+
     /** WARNING: must be synchronized with ScreenMode.h, native implementation
      * 10: count + id, ScreenSizeMM[width, height], rotated Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
      */
@@ -89,15 +89,15 @@ public class MonitorModeProps {
                                                           + 1 // native mode
                                                           + MonitorModeProps.NUM_RESOLUTION_PROPERTIES // sizeMM
                                                           ;
-    
+
     public static class Cache {
         public final ArrayHashSet<DimensionImmutable>       resolutions  = new ArrayHashSet<DimensionImmutable>();
         public final ArrayHashSet<SurfaceSize>              surfaceSizes = new ArrayHashSet<SurfaceSize>();
-        public final ArrayHashSet<MonitorMode.SizeAndRRate> sizeAndRates = new ArrayHashSet<MonitorMode.SizeAndRRate>(); 
+        public final ArrayHashSet<MonitorMode.SizeAndRRate> sizeAndRates = new ArrayHashSet<MonitorMode.SizeAndRRate>();
         public final ArrayHashSet<MonitorMode>              monitorModes = new ArrayHashSet<MonitorMode>();
         public final ArrayHashSet<MonitorDevice>            monitorDevices = new ArrayHashSet<MonitorDevice>();
     }
-    
+
     /** WARNING: must be synchronized with ScreenMode.h, native implementation */
     private static DimensionImmutable streamInResolution(int[] resolutionProperties, int offset) {
         Dimension resolution = new Dimension(resolutionProperties[offset++], resolutionProperties[offset++]);
@@ -116,7 +116,7 @@ public class MonitorModeProps {
         final int flags = sizeAndRRateProperties[offset++];
         return new MonitorMode.SizeAndRRate(surfaceSize, refreshRate, flags);
     }
-    
+
     /** WARNING: must be synchronized with ScreenMode.h, native implementation */
     private static MonitorMode streamInMonitorMode0(MonitorMode.SizeAndRRate sizeAndRate, int[] modeProperties, int offset) {
         final int id = modeProperties[offset++];
@@ -161,7 +161,7 @@ public class MonitorModeProps {
         if(null!=cache) {
             sizeAndRate = cache.sizeAndRates.getOrAdd(sizeAndRate);
         }
-        
+
         MonitorMode monitorMode = MonitorModeProps.streamInMonitorMode0(sizeAndRate, modeProperties, offset);
         if(null!=cache) {
             monitorMode = cache.monitorModes.getOrAdd(monitorMode);
@@ -193,12 +193,12 @@ public class MonitorModeProps {
         }
         return data;
     }
-    
-    /** 
+
+    /**
      * WARNING: must be synchronized with ScreenMode.h, native implementation
      * <p>
      * Note: This variant only works for impl. w/ a unique mode key pair <i>modeId, rotation</i>.
-     * </p> 
+     * </p>
      * @param mode_idx if not null, returns the index of resulting {@link MonitorDevice} within {@link Cache#monitorDevices}.
      * @param cache hash arrays of unique {@link MonitorMode} components and {@link MonitorDevice}s, allowing to avoid duplicates
      * @param modeProperties the input data
@@ -218,7 +218,7 @@ public class MonitorModeProps {
         if(count > monitorProperties.length-offset) {
             throw new RuntimeException("properties array too short (count), should be >= "+count+", is "+(monitorProperties.length-offset));
         }
-        final int limit = offset + count; 
+        final int limit = offset + count;
         offset++;
         final List<MonitorMode> allMonitorModes = cache.monitorModes.getData();
         final int id = monitorProperties[offset++];
@@ -252,7 +252,7 @@ public class MonitorModeProps {
             monitor_idx[0] = _monitorIdx;
         }
         return monitorDevice;
-    }    
+    }
     private static MonitorMode getByNativeIdAndRotation(List<MonitorMode> monitorModes, int modeId, int rotation) {
         if( null!=monitorModes && monitorModes.size()>0 ) {
             for (int i=0; i<monitorModes.size(); i++) {
@@ -264,12 +264,12 @@ public class MonitorModeProps {
         }
         return null;
     }
-    
-    /** 
+
+    /**
      * WARNING: must be synchronized with ScreenMode.h, native implementation
      * <p>
      * This variant expects <code>count</code> to be <code>{@link MIN_MONITOR_DEVICE_PROPERTIES} - 1 - {@link NUM_MONITOR_MODE_PROPERTIES}</code>,
-     * due to lack of supported mode and current mode. 
+     * due to lack of supported mode and current mode.
      * </p>
      *
      * @param mode_idx if not null, returns the index of resulting {@link MonitorDevice} within {@link Cache#monitorDevices}.
@@ -310,7 +310,7 @@ public class MonitorModeProps {
         }
         return monitorDevice;
     }
-    
+
     /** WARNING: must be synchronized with ScreenMode.h, native implementation */
     public static int[] streamOutMonitorDevice (MonitorDevice monitorDevice) {
         // min 11: count, id, ScreenSizeMM[width, height], Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
@@ -339,7 +339,7 @@ public class MonitorModeProps {
         }
         return data;
     }
-    
+
     public final void swapRotatePair(int rotation, int[] pairs, int offset, int numPairs) {
         if( MonitorMode.ROTATE_0 == rotation || MonitorMode.ROTATE_180 == rotation ) {
             // nop
@@ -347,9 +347,9 @@ public class MonitorModeProps {
         }
         for(int i=0; i<numPairs; i++, offset+=2) {
             final int tmp = pairs[offset];
-            pairs[offset] = pairs[offset+1];  
+            pairs[offset] = pairs[offset+1];
             pairs[offset+1] = tmp;
         }
-    }    
-    
+    }
+
 }
diff --git a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
index bc12bf3ee..f1e212394 100644
--- a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
+++ b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -48,7 +48,7 @@ import com.jogamp.common.jvm.JNILibLoaderBase;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.cache.TempJarCache;
 
-public class NEWTJNILibLoader extends JNILibLoaderBase {  
+public class NEWTJNILibLoader extends JNILibLoaderBase {
     public static boolean loadNEWT() {
         return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
             public Boolean run() {
diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java
index 0a302d76b..eba844230 100644
--- a/src/newt/classes/jogamp/newt/OffscreenWindow.java
+++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt;
@@ -50,7 +50,7 @@ import com.jogamp.newt.MonitorDevice;
 public class OffscreenWindow extends WindowImpl implements MutableSurface {
 
     long surfaceHandle;
-    
+
     public OffscreenWindow() {
         surfaceHandle = 0;
     }
@@ -72,7 +72,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
         synchronized(OffscreenWindow.class) {
             setWindowHandle(nextWindowHandle++);
         }
-        visibleChanged(false, true);        
+        visibleChanged(false, true);
     }
 
     protected void closeNativeImpl() {
@@ -92,7 +92,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
     @Override
     public long getSurfaceHandle() {
         return surfaceHandle;
-    }        
+    }
 
     protected void requestFocusImpl(boolean reparented) {
     }
@@ -101,7 +101,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
     public void setPosition(int x, int y) {
         // nop
     }
-    
+
     @Override
     public boolean setFullscreen(boolean fullscreen) {
         return false; // nop
@@ -112,7 +112,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
         return false; // nop
     }
 
-    
+
     protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
         sizeChanged(false, width, height, false);
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
@@ -137,13 +137,13 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
      }
      return new Point(0,0);
     }
-    
+
     protected Point getLocationOnScreenImpl(int x, int y) {
         return new Point(x,y);
     }
-    
+
     protected void updateInsetsImpl(Insets insets) {
-        // nop ..        
+        // nop ..
     }
 }
 
diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java
index 7068d7464..d7e6c641c 100644
--- a/src/newt/classes/jogamp/newt/ScreenImpl.java
+++ b/src/newt/classes/jogamp/newt/ScreenImpl.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt;
@@ -56,7 +56,7 @@ import com.jogamp.newt.util.MonitorModeUtil;
 
 public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     protected static final boolean DEBUG_TEST_SCREENMODE_DISABLED;
-    
+
     static {
         Debug.initSingleton();
         DEBUG_TEST_SCREENMODE_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableScreenMode", true);
@@ -67,14 +67,14 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     public static final int default_sm_heightmm = 324;
     public static final int default_sm_rate = 60;
     public static final int default_sm_rotation = 0;
-    
+
     static {
         DisplayImpl.initSingleton();
     }
-    
+
     /** Ensure static init has been run. */
     /* pp */static void initSingleton() { }
-    
+
     protected DisplayImpl display;
     protected int screen_idx;
     protected String fqname;
@@ -85,14 +85,14 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     protected static Dimension usrSize = null; // property values: newt.ws.swidth and newt.ws.sheight
     protected static volatile boolean usrSizeQueried = false;
     private ArrayList<MonitorModeListener> refMonitorModeListener = new ArrayList<MonitorModeListener>();
-    
+
     private long tCreated; // creationTime
 
-    private static Class<?> getScreenClass(String type) throws ClassNotFoundException 
+    private static Class<?> getScreenClass(String type) throws ClassNotFoundException
     {
         final Class<?> screenClass = NewtFactory.getCustomClass(type, "ScreenDriver");
         if(null==screenClass) {
-            throw new ClassNotFoundException("Failed to find NEWT Screen Class <"+type+".ScreenDriver>");            
+            throw new ClassNotFoundException("Failed to find NEWT Screen Class <"+type+".ScreenDriver>");
         }
         return screenClass;
     }
@@ -104,7 +104,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                     if(!usrSizeQueried) {
                         usrSizeQueried = true;
                         final int w = Debug.getIntProperty("newt.ws.swidth", true, 0);
-                        final int h = Debug.getIntProperty("newt.ws.sheight", true, 0);                        
+                        final int h = Debug.getIntProperty("newt.ws.sheight", true, 0);
                         if(w>0 && h>0) {
                             usrSize = new Dimension(w, h);
                             System.err.println("User screen size "+usrSize);
@@ -135,7 +135,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                     System.err.println("Screen.create() NEW: "+screen+" "+Display.getThreadName());
                 }
                 return screen;
-            }            
+            }
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
@@ -167,16 +167,16 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     @Override
     public synchronized final void createNative()
             throws NativeWindowException
-    {        
+    {
         if(null == aScreen) {
             if(DEBUG) {
                 tCreated = System.nanoTime();
                 System.err.println("Screen.createNative() START ("+DisplayImpl.getThreadName()+", "+this+")");
             } else {
                 tCreated = 0;
-            }            
+            }
             display.addReference();
-            
+
             createNativeImpl();
             if(null == aScreen) {
                 throw new NativeWindowException("Screen.createNative() failed to instanciate an AbstractGraphicsScreen");
@@ -249,7 +249,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
 
     protected abstract void createNativeImpl();
     protected abstract void closeNativeImpl();
-    
+
     /**
      * Returns the validated screen index, which is either the passed <code>idx</code>
      * value or <code>0</code>.
@@ -258,23 +258,23 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
      * </p>
      */
     protected abstract int validateScreenIndex(int idx);
-    
+
     /**
      * Stores the virtual origin and virtual <b>rotated</b> screen size.
      * <p>
-     * This method is called after the MonitorMode has been set or changed, 
+     * This method is called after the MonitorMode has been set or changed,
      * hence you may utilize it.
      * </p>
      * <p>
      * Default implementation uses the union of all monitor's viewport,
-     * calculated via {@link #unionOfMonitorViewportSize()}. 
+     * calculated via {@link #unionOfMonitorViewportSize()}.
      * </p>
      * @param vOriginSize storage for result
      */
-    protected void calcVirtualScreenOriginAndSize(final Rectangle vOriginSize) { 
+    protected void calcVirtualScreenOriginAndSize(final Rectangle vOriginSize) {
         unionOfMonitorViewportSize(vOriginSize);
     }
-    
+
     @Override
     public final String getFQName() {
         return fqname;
@@ -335,15 +335,15 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     }
 
     //
-    // MonitorDevice and MonitorMode 
+    // MonitorDevice and MonitorMode
     //
-    
+
     /**
      * To be implemented by the native specification.<br>
      * Is called within a thread safe environment.<br>
      * Is called only to collect the {@link MonitorMode}s and {@link MonitorDevice}s, usually at startup setting up modes.<br>
      * <br>
-     * <b>WARNING</b>: must be synchronized with 
+     * <b>WARNING</b>: must be synchronized with
      * <ul>
      *   <li>{@link MonitorModeProps#NUM_SCREEN_MODE_PROPERTIES} and </li>
      *   <li>{@link MonitorModeProps#MIN_MONITOR_DEVICE_PROPERTIES}</li>
@@ -356,19 +356,19 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
      * @param cache memory pool caching the result
      */
     protected abstract void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache);
-    
+
     protected Rectangle getNativeMonitorDeviceViewportImpl(MonitorDevice monitor) { return null; }
-    
+
     /**
      * To be implemented by the native specification.<br>
      * Is called within a thread safe environment.<br>
      * <p>
-     * Implementation shall not unify the result w/ monitor's supported modes or a locally 
+     * Implementation shall not unify the result w/ monitor's supported modes or a locally
      * saved {@link MonitorModeProps.Cache}, since caller will perform such tasks.
      * </p>
      */
     protected abstract MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor);
-    
+
     /**
      * To be implemented by the native specification.<br>
      * Is called within a thread safe environment.<br>
@@ -378,13 +378,13 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     @Override
     public final List<MonitorMode> getMonitorModes() {
         final ScreenMonitorState sms = getScreenMonitorStatus(false);
-        return null != sms ? sms.getMonitorModes().getData() : null; 
+        return null != sms ? sms.getMonitorModes().getData() : null;
     }
-    
+
     @Override
     public final List<MonitorDevice> getMonitorDevices() {
         final ScreenMonitorState sms = getScreenMonitorStatus(false);
-        return null != sms ? sms.getMonitorDevices().getData() : null; 
+        return null != sms ? sms.getMonitorDevices().getData() : null;
     }
 
     final ScreenMonitorState getScreenMonitorStatus(boolean throwException) {
@@ -395,7 +395,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
         }
         return res;
     }
-    
+
     @Override
     public void monitorModeChangeNotify(MonitorEvent me) {
         if(DEBUG) {
@@ -417,9 +417,9 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
             if( null != newViewport ) {
                 monitor.setViewportValue(newViewport);
             }
-        }        
+        }
     }
-    
+
     @Override
     public void monitorModeChanged(MonitorEvent me, boolean success) {
         if(success) {
@@ -443,9 +443,9 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     public synchronized final void removeMonitorModeListener(MonitorModeListener sml) {
         refMonitorModeListener.remove(sml);
     }
-    
+
     /**
-     * 
+     *
      * @param cache optional ..
      * @param modeId
      * @return
@@ -468,7 +468,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     }
 
     /**
-     * 
+     *
      * @param cache mandatory !
      * @param monitorId
      * @param currentMode
@@ -493,7 +493,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
         }
         return MonitorModeProps.streamInMonitorDevice(null, cache, this, props, 0);
     }
-    
+
     /**
      * Utilizes {@link #getCurrentMonitorModeImpl()}, if the latter returns null it uses
      * the current screen size and dummy values.
@@ -530,7 +530,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
             sms = ScreenMonitorState.getScreenMonitorState(this.getFQName());
             if(null==sms) {
                 final MonitorModeProps.Cache cache = new MonitorModeProps.Cache();
-                if( 0 >= collectNativeMonitorModes(cache) ) {                    
+                if( 0 >= collectNativeMonitorModes(cache) ) {
                     updateVirtualScreenOriginAndSize();
                     vScrnSizeUpdated = true;
                     final MonitorMode mode = getVirtualMonitorMode(cache, 0);
@@ -557,7 +557,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                             System.err.println("["+i+"]["+j+"]: "+iMode.next());
                         }
                     }
-                }                
+                }
                 sms = new ScreenMonitorState(cache.monitorDevices, cache.monitorModes);
                 ScreenMonitorState.mapScreenMonitorState(this.getFQName(), sms);
             }
@@ -580,7 +580,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
      * Collects {@link MonitorDevice}s and {@link MonitorMode}s within the given cache.
      * </p>
      */
-    private final int collectNativeMonitorModes(MonitorModeProps.Cache cache) { 
+    private final int collectNativeMonitorModes(MonitorModeProps.Cache cache) {
         if(!DEBUG_TEST_SCREENMODE_DISABLED) {
             collectNativeMonitorModesAndDevicesImpl(cache);
         }
@@ -639,12 +639,12 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                 } finally {
                     sms.unlock();
                 }
-            }            
+            }
         } finally {
             ScreenMonitorState.unlockScreenMonitorState();
         }
     }
-    
+
     private final void shutdown() {
         ScreenMonitorState sms = ScreenMonitorState.getScreenMonitorStateUnlocked(getFQName());
         if(null != sms) {
@@ -661,11 +661,11 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                 }
             }
             ScreenMonitorState.unmapScreenMonitorStateUnlocked(getFQName());
-        }            
+        }
     }
-    
+
     /** pp */ static final void shutdownAll() {
-        final int sCount = screenList.size(); 
+        final int sCount = screenList.size();
         if(DEBUG) {
             System.err.println("Screen.shutdownAll "+sCount+" instances, on thread "+Display.getThreadName());
         }
diff --git a/src/newt/classes/jogamp/newt/ScreenMonitorState.java b/src/newt/classes/jogamp/newt/ScreenMonitorState.java
index 66e75be16..01e6cfee9 100644
--- a/src/newt/classes/jogamp/newt/ScreenMonitorState.java
+++ b/src/newt/classes/jogamp/newt/ScreenMonitorState.java
@@ -42,7 +42,7 @@ import java.util.HashMap;
 
 public class ScreenMonitorState {
     private static boolean DEBUG = Screen.DEBUG;
-    
+
     private final RecursiveLock lock = LockFactory.createRecursiveLock();
     private final ArrayHashSet<MonitorDevice> allMonitors;
     private final ArrayHashSet<MonitorMode> allMonitorModes;
@@ -105,21 +105,21 @@ public class ScreenMonitorState {
     protected static void unlockScreenMonitorState() {
         screen2ScreenMonitorState.unlock();
     }
-    
+
     public ScreenMonitorState(ArrayHashSet<MonitorDevice> allMonitors,
                               ArrayHashSet<MonitorMode> allMonitorModes) {
-        this.allMonitors = allMonitors; 
+        this.allMonitors = allMonitors;
         this.allMonitorModes = allMonitorModes;
     }
 
-    protected ArrayHashSet<MonitorDevice> getMonitorDevices() { 
+    protected ArrayHashSet<MonitorDevice> getMonitorDevices() {
         return allMonitors;
     }
-    
-    protected ArrayHashSet<MonitorMode> getMonitorModes() { 
+
+    protected ArrayHashSet<MonitorMode> getMonitorModes() {
         return allMonitorModes;
     }
-    
+
     protected final int addListener(MonitorModeListener l) {
         lock();
         try {
@@ -151,14 +151,14 @@ public class ScreenMonitorState {
     protected final MonitorDevice getMonitor(MonitorDevice monitor) {
         return allMonitors.get(monitor);
     }
-    
+
     protected final void validateMonitor(MonitorDevice monitor) {
         final MonitorDevice md = allMonitors.get(monitor);
         if( null == md ) {
             throw new InternalError("Monitor unknown: "+monitor);
         }
     }
-    
+
     protected final void fireMonitorModeChangeNotify(MonitorDevice monitor, MonitorMode desiredMode) {
         lock();
         try {
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index a35d89408..a0ef8816b 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
    Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt;
@@ -87,19 +87,19 @@ import jogamp.nativewindow.SurfaceUpdatedHelper;
 public abstract class WindowImpl implements Window, NEWTEventConsumer
 {
     public static final boolean DEBUG_TEST_REPARENT_INCOMPATIBLE;
-    
+
     static {
         Debug.initSingleton();
         DEBUG_TEST_REPARENT_INCOMPATIBLE = Debug.isPropertyDefined("newt.test.Window.reparent.incompatible", true);
-        
+
         ScreenImpl.initSingleton();
     }
-    
-    protected static final ArrayList<WeakReference<WindowImpl>> windowList = new ArrayList<WeakReference<WindowImpl>>();    
-            
+
+    protected static final ArrayList<WeakReference<WindowImpl>> windowList = new ArrayList<WeakReference<WindowImpl>>();
+
     /** Maybe utilized at a shutdown hook, impl. does not block. */
     public static final void shutdownAll() {
-        final int wCount = windowList.size(); 
+        final int wCount = windowList.size();
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("Window.shutdownAll "+wCount+" instances, on thread "+getThreadName());
         }
@@ -132,25 +132,25 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             }
         }
     }
-    
+
     /** Timeout of queued events (repaint and resize) */
-    static final long QUEUED_EVENT_TO = 1200; // ms    
+    static final long QUEUED_EVENT_TO = 1200; // ms
 
     private static final PointerType[] constMousePointerTypes = new PointerType[] { PointerType.Mouse };
-    
+
     //
     // Volatile: Multithread Mutable Access
-    //    
+    //
     private volatile long windowHandle = 0; // lifecycle critical
     private volatile boolean visible = false; // lifecycle critical
-    private volatile boolean hasFocus = false;    
+    private volatile boolean hasFocus = false;
     private volatile int width = 128, height = 128; // client-area size w/o insets, default: may be overwritten by user
     private volatile int x = 64, y = 64; // client-area pos w/o insets
     private volatile Insets insets = new Insets(); // insets of decoration (if top-level && decorated)
-        
+
     private RecursiveLock windowLock = LockFactory.createRecursiveLock();  // Window instance wide lock
     private int surfaceLockCount = 0; // surface lock recursion count
-    
+
     private ScreenImpl screen; // never null after create - may change reference though (reparent)
     private boolean screenReferenceAdded = false;
     private NativeWindow parentWindow = null;
@@ -162,7 +162,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     private List<MonitorDevice> fullscreenMonitors = null;
     private boolean fullscreenUseMainMonitor = true;
     private boolean autoPosition = true; // default: true (allow WM to choose top-level position, if not set by user)
-    
+
     private int nfs_width, nfs_height, nfs_x, nfs_y; // non fullscreen client-area size/pos w/o insets
     private NativeWindow nfs_parent = null;          // non fullscreen parent, in case explicit reparenting is performed (offscreen)
     private String title = "Newt Window";
@@ -178,26 +178,26 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     private KeyListener keyboardFocusHandler = null;
 
     private SurfaceUpdatedHelper surfaceUpdatedHelper = new SurfaceUpdatedHelper();
-    
+
     private Object childWindowsLock = new Object();
     private ArrayList<NativeWindow> childWindows = new ArrayList<NativeWindow>();
 
     private ArrayList<MouseListener> mouseListeners = new ArrayList<MouseListener>();
-    
+
     /** from event passing: {@link WindowImpl#consumePointerEvent(MouseEvent)}. */
     private static class PointerState0 {
         /** mouse entered window - is inside the window (may be synthetic) */
         boolean insideWindow = false;
-        
+
         /** last time when a mouse button was pressed */
         long lastButtonPressTime = 0;
-        
+
         void clearButton() {
             lastButtonPressTime = 0;
         }
     }
     private PointerState0 pState0 = new PointerState0();
-    
+
     /** from direct input: {@link WindowImpl#doPointerEvent(boolean, boolean, int[], short, int, int, boolean, short[], int[], int[], float[], float, float[], float)}. */
     private static class PointerState1 extends PointerState0 {
         /** current pressed mouse button number */
@@ -206,15 +206,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         int buttonPressedMask = 0;
         /** last mouse button click count */
         short lastButtonClickCount = (short)0;
-        
+
         final void clearButton() {
             super.clearButton();
             lastButtonPressTime = 0;
-            lastButtonClickCount = (short)0; 
+            lastButtonClickCount = (short)0;
             buttonPressed = 0;
-            buttonPressedMask = 0;            
+            buttonPressedMask = 0;
         }
-        
+
         /** last pointer-move position for 8 touch-down pointers */
         final Point[] movePositions = new Point[] {
                 new Point(), new Point(), new Point(), new Point(),
@@ -227,16 +227,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
     }
     private PointerState1 pState1 = new PointerState1();
-        
+
     /** pointer names -> pointer ID (consecutive index, starting w/ 0) */
     private final ArrayHashSet<Integer> pName2pID = new ArrayHashSet<Integer>();
-    
+
     private boolean defaultGestureHandlerEnabled = true;
     private DoubleTapScrollGesture gesture2PtrTouchScroll = null;
     private ArrayList<GestureHandler> pointerGestureHandler = new ArrayList<GestureHandler>();
-    
+
     private ArrayList<GestureHandler.GestureListener> gestureListeners = new ArrayList<GestureHandler.GestureListener>();
-    
+
     private ArrayList<KeyListener> keyListeners = new ArrayList<KeyListener>();
 
     private ArrayList<WindowListener> windowListeners  = new ArrayList<WindowListener>();
@@ -267,7 +267,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     {
         final Class<?> windowClass = NewtFactory.getCustomClass(type, "WindowDriver");
         if(null==windowClass) {
-            throw new ClassNotFoundException("Failed to find NEWT Window Class <"+type+".WindowDriver>");            
+            throw new ClassNotFoundException("Failed to find NEWT Window Class <"+type+".WindowDriver>");
         }
         return windowClass;
     }
@@ -293,7 +293,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             throw new NativeWindowException(t);
         }
     }
-    
+
     public static WindowImpl create(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
         try {
             Class<?> windowClass = getWindowClass(screen.getDisplay().getType());
@@ -329,11 +329,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         hasFocus = false;
         parentWindowHandle = 0;
     }
-    
+
     protected final void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg) {
         config = cfg;
     }
-    
+
     public static interface LifecycleHook {
         /**
          * Reset of internal state counter, ie totalFrames, etc.
@@ -341,8 +341,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
          */
         public abstract void resetCounter();
 
-        /** 
-         * Invoked after Window setVisible, 
+        /**
+         * Invoked after Window setVisible,
          * allows allocating resources depending on the native Window.
          * Called from EDT while window is locked.
          */
@@ -354,9 +354,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
          * @param value <code>true</code> to set the one-shot preservation if supported, otherwise clears it.
          */
         void preserveGLStateAtDestroy(boolean value);
-        
-        /** 
-         * Invoked before Window destroy action, 
+
+        /**
+         * Invoked before Window destroy action,
          * allows releasing of resources depending on the native Window.<br>
          * Surface not locked yet.<br>
          * Called not necessarily from EDT.
@@ -388,12 +388,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
          * @see #pauseRenderingAction()
          */
         void resumeRenderingAction();
-        
+
         /**
          * Shutdown rendering action (thread) abnormally.
          * <p>
          * Should be called only at shutdown, if necessary.
-         * </p> 
+         * </p>
          */
         void shutdownRenderingAction();
     }
@@ -406,14 +406,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         } else {
             tStart = 0;
         }
-        
-        if( null != parentWindow && 
+
+        if( null != parentWindow &&
             NativeSurface.LOCK_SURFACE_NOT_READY >= parentWindow.lockSurface() ) {
             throw new NativeWindowException("Parent surface lock: not ready: "+parentWindow);
         }
-        
+
         // child window: position defaults to 0/0, no auto position, no negative position
-        if( null != parentWindow && ( autoPosition || 0>getX() || 0>getY() ) ) {                
+        if( null != parentWindow && ( autoPosition || 0>getX() || 0>getY() ) ) {
             definePosition(0, 0);
         }
         boolean postParentlockFocus = false;
@@ -556,28 +556,28 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
     /**
      * Notifies the driver impl. that the instantiation is finished,
-     * ie. instance created and all fields set. 
+     * ie. instance created and all fields set.
      */
     protected void instantiationFinished() {
         // nop
     }
-    
+
     protected boolean canCreateNativeImpl() {
         return true; // default: always able to be created
     }
-    
-    /** 
+
+    /**
      * The native implementation must set the native windowHandle.<br>
      *
      * <p>
      * The implementation shall respect the states {@link #isAlwaysOnTop()}/{@link #FLAG_IS_ALWAYSONTOP} and
      * {@link #isUndecorated()}/{@link #FLAG_IS_UNDECORATED}, ie. the created window shall reflect those settings.
      * </p>
-     * 
+     *
      * <p>
      * The implementation should invoke the referenced java state callbacks
      * to notify this Java object of state changes.</p>
-     * 
+     *
      * @see #windowDestroyNotify(boolean)
      * @see #focusChanged(boolean, boolean)
      * @see #visibleChanged(boolean, boolean)
@@ -589,16 +589,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
     protected abstract void closeNativeImpl();
 
-    /** 
+    /**
      * Async request which shall be performed within {@link #TIMEOUT_NATIVEWINDOW}.
      * <p>
-     * If if <code>force == false</code> the native implementation 
+     * If if <code>force == false</code> the native implementation
      * may only request focus if not yet owner.</p>
      * <p>
      * {@link #focusChanged(boolean, boolean)} should be called
-     * to notify about the focus traversal. 
-     * </p> 
-     * 
+     * to notify about the focus traversal.
+     * </p>
+     *
      * @param force if true, bypass {@link #focusChanged(boolean, boolean)} and force focus request
      */
     protected abstract void requestFocusImpl(boolean force);
@@ -608,7 +608,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public static final int FLAG_CHANGE_FULLSCREEN      = 1 <<  2;
     public static final int FLAG_CHANGE_ALWAYSONTOP     = 1 <<  3;
     public static final int FLAG_CHANGE_VISIBILITY      = 1 <<  4;
-    
+
     public static final int FLAG_HAS_PARENT             = 1 <<  8;
     public static final int FLAG_IS_UNDECORATED         = 1 <<  9;
     public static final int FLAG_IS_FULLSCREEN          = 1 << 10;
@@ -619,12 +619,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     /**
      * The native implementation should invoke the referenced java state callbacks
      * to notify this Java object of state changes.
-     * 
+     *
      * <p>
      * Implementations shall set x/y to 0, in case it's negative. This could happen due
      * to insets and positioning a decorated window to 0/0, which would place the frame
      * outside of the screen.</p>
-     * 
+     *
      * @param x client-area position, or <0 if unchanged
      * @param y client-area position, or <0 if unchanged
      * @param width client-area size, or <=0 if unchanged
@@ -635,12 +635,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * @see #positionChanged(boolean,int, int)
      */
     protected abstract boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags);
-    
-    /** 
+
+    /**
      * Tests whether a single reconfigure flag is supported by implementation.
      * <p>
      * Default is all but {@link #FLAG_IS_FULLSCREEN_SPAN}
-     * </p> 
+     * </p>
      */
     protected boolean isReconfigureFlagSupported(int changeFlags) {
         return 0 == ( changeFlags & FLAG_IS_FULLSCREEN_SPAN );
@@ -656,14 +656,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     protected static String getReconfigureFlagsAsString(StringBuilder sb, int flags) {
         if(null == sb) { sb = new StringBuilder(); }
         sb.append("[");
-        
+
         if( 0 != ( FLAG_CHANGE_PARENTING & flags) ) {
             sb.append("*");
         }
         sb.append("PARENT_");
         sb.append(0 != ( FLAG_HAS_PARENT & flags));
         sb.append(", ");
-        
+
         if( 0 != ( FLAG_CHANGE_FULLSCREEN & flags) ) {
             sb.append("*");
         }
@@ -679,24 +679,24 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         sb.append("UNDECOR_");
         sb.append(0 != ( FLAG_IS_UNDECORATED & flags));
         sb.append(", ");
-        
+
         if( 0 != ( FLAG_CHANGE_ALWAYSONTOP & flags) ) {
             sb.append("*");
         }
         sb.append("ALWAYSONTOP_");
         sb.append(0 != ( FLAG_IS_ALWAYSONTOP & flags));
         sb.append(", ");
-        
+
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             sb.append("*");
         }
         sb.append("VISIBLE_");
         sb.append(0 != ( FLAG_IS_VISIBLE & flags));
-        
+
         sb.append("]");
         return sb.toString();
     }
-    
+
     protected void setTitleImpl(String title) {}
 
     /**
@@ -713,11 +713,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * @return if not null, the screen location of the given coordinates
      */
     protected abstract Point getLocationOnScreenImpl(int x, int y);
-    
+
     /** Triggered by user via {@link #getInsets()}.<br>
-     * Implementations may implement this hook to update the insets.<br> 
+     * Implementations may implement this hook to update the insets.<br>
      * However, they may prefer the event driven path via {@link #insetsChanged(boolean, int, int, int, int)}.
-     * 
+     *
      * @see #getInsets()
      * @see #insetsChanged(boolean, int, int, int, int)
      */
@@ -726,7 +726,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     protected boolean setPointerVisibleImpl(boolean pointerVisible) { return false; }
     protected boolean confinePointerImpl(boolean confine) { return false; }
     protected void warpPointerImpl(int x, int y) { }
-    
+
     //----------------------------------------------------------------------
     // NativeSurface
     //
@@ -791,7 +791,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public final RecursiveLock getLock() {
         return windowLock;
     }
-    
+
     @Override
     public long getSurfaceHandle() {
         return windowHandle; // default: return window handle
@@ -810,7 +810,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     @Override
     public final long getDisplayHandle() {
         return config.getNativeGraphicsConfiguration().getScreen().getDevice().getHandle();
-    }    
+    }
 
     @Override
     public final int  getScreenIndex() {
@@ -879,19 +879,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public final Screen getScreen() {
         return screen;
     }
-    
+
     @Override
     public final MonitorDevice getMainMonitor() {
         return screen.getMainMonitor(new Rectangle(getX(), getY(), getWidth(), getHeight()));
     }
-    
+
     protected final void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
-        reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_VISIBILITY, visible));           
-    }    
+        reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_VISIBILITY, visible));
+    }
     final void setVisibleActionImpl(boolean visible) {
         boolean nativeWindowCreated = false;
         boolean madeVisible = false;
-        
+
         final RecursiveLock _lock = windowLock;
         _lock.lock();
         try {
@@ -911,7 +911,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     madeVisible = nativeWindowCreated;
                 }
                 // always flag visible, allowing a retry ..
-                WindowImpl.this.visible = true;      
+                WindowImpl.this.visible = true;
             } else if(WindowImpl.this.visible != visible) {
                 if(isNativeValid()) {
                     setVisibleImpl(visible, getX(), getY(), getWidth(), getHeight());
@@ -965,14 +965,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("Window setVisible: START ("+getThreadName()+") "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+this.visible+" -> "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+(null!=parentWindow));
         }
-        runOnEDTIfAvail(wait, new VisibleAction(visible));        
+        runOnEDTIfAvail(wait, new VisibleAction(visible));
     }
 
     @Override
     public void setVisible(boolean visible) {
         setVisible(true, visible);
     }
-    
+
     private class SetSizeAction implements Runnable {
         int width, height;
         boolean disregardFS;
@@ -1024,11 +1024,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
     private void setFullscreenSize(int width, int height) {
         runOnEDTIfAvail(true, new SetSizeAction(width, height, true));
-    }    
+    }
     @Override
     public void setSize(int width, int height) {
         runOnEDTIfAvail(true, new SetSizeAction(width, height, false));
-    }    
+    }
     @Override
     public void setTopLevelSize(int width, int height) {
         setSize(width - getInsets().getTotalWidth(), height - getInsets().getTotalHeight());
@@ -1049,10 +1049,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Window DestroyAction() hasScreen "+(null != screen)+", isNativeValid "+isNativeValid()+" - "+getThreadName());
                 }
-                
+
                 // send synced destroy-notify notification
                 sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
-                
+
                 // Childs first ..
                 synchronized(childWindowsLock) {
                   if(childWindows.size()>0) {
@@ -1111,30 +1111,30 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             if(animatorPaused) {
                 lifecycleHook.resumeRenderingAction();
             }
-            
+
             // these refs shall be kept alive - resurrection via setVisible(true)
             /**
             if(null!=parentWindow && parentWindow instanceof Window) {
                 ((Window)parentWindow).removeChild(WindowImpl.this);
-            }        
+            }
             childWindows = null;
             surfaceUpdatedListeners = null;
             mouseListeners = null;
             keyListeners = null;
             capsRequested = null;
             lifecycleHook = null;
-            
-            screen = null;           
+
+            screen = null;
             windowListeners = null;
             parentWindow = null;
-            */                        
+            */
         }
     }
     private final DestroyAction destroyAction = new DestroyAction();
 
     @Override
     public void destroy() {
-        visible = false; // Immediately mark synchronized visibility flag, avoiding possible recreation 
+        visible = false; // Immediately mark synchronized visibility flag, avoiding possible recreation
         runOnEDTIfAvail(true, destroyAction);
     }
 
@@ -1144,15 +1144,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         destroy();
     }
-    
+
     /**
      * @param cWin child window, must not be null
      * @param pWin parent window, may be null
-     * @return true if at least one of both window's configurations is offscreen 
+     * @return true if at least one of both window's configurations is offscreen
      */
     protected static boolean isOffscreenInstance(NativeWindow cWin, NativeWindow pWin) {
         boolean ofs = false;
-        final AbstractGraphicsConfiguration cWinCfg = cWin.getGraphicsConfiguration(); 
+        final AbstractGraphicsConfiguration cWinCfg = cWin.getGraphicsConfiguration();
         if( null != cWinCfg ) {
             ofs = !cWinCfg.getChosenCapabilities().isOnscreen();
         }
@@ -1164,7 +1164,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         return ofs;
     }
-    
+
     private class ReparentAction implements Runnable {
         final NativeWindow newParentWindow;
         final int topLevelX, topLevelY;
@@ -1187,7 +1187,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             removeScreenReference();
             screen = newScreen;
         }
-        
+
         public final void run() {
             boolean animatorPaused = false;
             if(null!=lifecycleHook) {
@@ -1198,7 +1198,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 lifecycleHook.resumeRenderingAction();
             }
         }
-        
+
         private void reparent() {
             // mirror pos/size so native change notification can get overwritten
             final int oldX = getX();
@@ -1209,7 +1209,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             int width = oldWidth;
             int height = oldHeight;
             boolean wasVisible;
-            
+
             final RecursiveLock _lock = windowLock;
             _lock.lock();
             try {
@@ -1217,7 +1217,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     // force recreation if offscreen, since it may become onscreen
                     forceDestroyCreate |= isOffscreenInstance(WindowImpl.this, newParentWindow);
                 }
-                                
+
                 wasVisible = isVisible();
 
                 Window newParentWindowNEWT = null;
@@ -1233,7 +1233,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
                 if(null!=newParentWindow) {
                     // REPARENT TO CHILD WINDOW
-                    
+
                     // reset position to 0/0 within parent space
                     x = 0;
                     y = 0;
@@ -1278,7 +1278,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                                 operation = ReparentOperation.ACTION_NATIVE_CREATION_PENDING;
                             }
                         } else if ( forceDestroyCreate || !NewtFactory.isScreenCompatible(newParentWindow, screen) ) {
-                            // Destroy this window, may create a new compatible Screen/Display, while trying to preserve resources if becoming visible again.                            
+                            // Destroy this window, may create a new compatible Screen/Display, while trying to preserve resources if becoming visible again.
                             destroy( wasVisible );
                             if(null!=newParentWindowNEWT) {
                                 setScreen( (ScreenImpl) newParentWindowNEWT.getScreen() );
@@ -1333,11 +1333,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 if ( ReparentOperation.ACTION_INVALID == operation ) {
                     throw new NativeWindowException("Internal Error: reparentAction not set");
                 }
-                
+
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Window.reparent: ACTION ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" new parentWindowHandle "+toHexString(newParentWindowHandle)+", reparentAction "+operation+", pos/size "+x+"/"+y+" "+width+"x"+height+", visible "+wasVisible);
                 }
-                
+
                 if( ReparentOperation.ACTION_NOP == operation ) {
                     return;
                 }
@@ -1401,18 +1401,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                             }
                             if(ok) {
                                 requestFocusInt( 0 == parentWindowHandle /* skipFocusAction if top-level */);
-                                display.dispatchMessagesNative(); // status up2date                                
+                                display.dispatchMessagesNative(); // status up2date
                             }
                         }
                     }
 
                     if(!ok || !wasVisible) {
-                        // make size and position persistent manual, 
+                        // make size and position persistent manual,
                         // since we don't have a WM feedback (invisible or recreation)
                         definePosition(x, y);
                         defineSize(width, height);
                     }
-                    
+
                     if(!ok) {
                         // native reparent failed -> try creation, while trying to preserve resources if becoming visible again.
                         if(DEBUG_IMPLEMENTATION) {
@@ -1430,7 +1430,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     definePosition(x, y);
                     defineSize(width, height);
                 }
-                
+
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Window.reparent: END-1 ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
                 }
@@ -1451,7 +1451,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                         // This may run on the new Display/Screen connection, hence a new EDT task
                         runOnEDTIfAvail(true, reparentActionRecreate);
                         break;
-                        
+
                     default:
                 }
             }
@@ -1566,7 +1566,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 if(WindowImpl.this.alwaysOnTop != alwaysOnTop) {
                     // set current state
                     WindowImpl.this.alwaysOnTop = alwaysOnTop;
-                  
+
                     if( isNativeValid() ) {
                         // Mirror pos/size so native change notification can get overwritten
                         final int x = getX();
@@ -1591,12 +1591,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public final void setAlwaysOnTop(boolean value) {
         runOnEDTIfAvail(true, new AlwaysOnTopAction(value));
     }
-    
+
     @Override
     public final boolean isAlwaysOnTop() {
         return alwaysOnTop;
     }
-        
+
     @Override
     public String getTitle() {
         return title;
@@ -1624,7 +1624,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 setVal = setPointerVisibleImpl(pointerVisible);
             }
             if(setVal) {
-                this.pointerVisible = pointerVisible;                
+                this.pointerVisible = pointerVisible;
             }
         }
     }
@@ -1632,7 +1632,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public boolean isPointerConfined() {
         return pointerConfined;
     }
-    
+
     @Override
     public void confinePointer(boolean confine) {
         if(this.pointerConfined != confine) {
@@ -1652,18 +1652,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 }
             }
             if(setVal) {
-                this.pointerConfined = confine;       
+                this.pointerConfined = confine;
             }
-        }        
+        }
     }
-    
+
     @Override
     public void warpPointer(int x, int y) {
         if(0 != getWindowHandle()) {
             warpPointerImpl(x, y);
         }
     }
-    
+
     @Override
     public final InsetsImmutable getInsets() {
         if(isUndecorated()) {
@@ -1672,7 +1672,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         updateInsetsImpl(insets);
         return insets;
     }
-    
+
     @Override
     public final int getWidth() {
         return width;
@@ -1694,8 +1694,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     protected final boolean autoPosition() { return autoPosition; }
-    
-    /** Sets the position fields {@link #x} and {@link #y} to the given values and {@link #autoPosition} to false. */ 
+
+    /** Sets the position fields {@link #x} and {@link #y} to the given values and {@link #autoPosition} to false. */
     protected final void definePosition(int x, int y) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("definePosition: "+this.x+"/"+this.y+" -> "+x+"/"+y);
@@ -1705,7 +1705,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         this.x = x; this.y = y;
     }
 
-    /** Sets the size fields {@link #width} and {@link #height} to the given values. */ 
+    /** Sets the size fields {@link #width} and {@link #height} to the given values. */
     protected final void defineSize(int width, int height) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("defineSize: "+this.width+"x"+this.height+" -> "+width+"x"+height);
@@ -1713,7 +1713,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         this.width = width; this.height = height;
     }
-    
+
     @Override
     public final boolean isVisible() {
         return visible;
@@ -1732,7 +1732,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public final Window getDelegatedWindow() {
         return this;
     }
-    
+
     //----------------------------------------------------------------------
     // WindowImpl
     //
@@ -1755,8 +1755,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return old;
     }
 
-    /** 
-     * If this Window actually wraps a {@link NativeSurface} from another instance or toolkit, 
+    /**
+     * If this Window actually wraps a {@link NativeSurface} from another instance or toolkit,
      * it will return such reference. Otherwise returns null.
      */
     public NativeSurface getWrappedSurface() {
@@ -1768,13 +1768,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         windowDestroyNotifyAction = r;
     }
 
-    /** 
-     * Returns the non delegated {@link AbstractGraphicsConfiguration}, 
+    /**
+     * Returns the non delegated {@link AbstractGraphicsConfiguration},
      * see {@link #getGraphicsConfiguration()}. */
     public final AbstractGraphicsConfiguration getPrivateGraphicsConfiguration() {
         return config;
     }
-    
+
     protected final long getParentWindowHandle() {
         return isFullscreen() ? 0 : parentWindowHandle;
     }
@@ -1864,7 +1864,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public void requestFocus(boolean wait) {
         requestFocus(wait /* wait */, false /* skipFocusAction */, brokenFocusChange /* force */);
     }
-    
+
     private void requestFocus(boolean wait, boolean skipFocusAction, boolean force) {
         if( isNativeValid() &&
             ( force || !hasFocus() ) &&
@@ -1872,7 +1872,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             runOnEDTIfAvail(wait, force ? requestFocusActionForced : requestFocusAction);
         }
     }
-    
+
     /** Internally forcing request focus on current thread */
     private void requestFocusInt(boolean skipFocusAction) {
         if( skipFocusAction || !focusAction() ) {
@@ -1880,14 +1880,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 System.err.println("Window.RequestFocusInt: forcing - ("+getThreadName()+"): skipFocusAction "+skipFocusAction+", focus "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
             }
             requestFocusImpl(true);
-        }        
+        }
     }
-    
+
     @Override
     public void setFocusAction(FocusRunnable focusAction) {
         this.focusAction = focusAction;
     }
-    
+
     private boolean focusAction() {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("Window.focusAction() START - "+getThreadName()+", focusAction: "+focusAction+" - windowHandle "+toHexString(getWindowHandle()));
@@ -1903,16 +1903,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         return res;
     }
-    
+
     protected void setBrokenFocusChange(boolean v) {
         brokenFocusChange = v;
     }
-    
+
     @Override
     public void setKeyboardFocusHandler(KeyListener l) {
         keyboardFocusHandler = l;
     }
-    
+
     private class SetPositionAction implements Runnable {
         int x, y;
 
@@ -1932,7 +1932,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     if(isNativeValid()) {
                         // this.x/this.y will be set by sizeChanged, triggered by windowing event system
                         reconfigureWindowImpl(x, y, getWidth(), getHeight(), getReconfigureFlags(0, isVisible()));
-                        
+
                         // Wait until custom position is reached within tolerances
                         waitForPosition(true, x, y, Window.TIMEOUT_NATIVEWINDOW);
                     } else {
@@ -1950,16 +1950,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         autoPosition = false;
         runOnEDTIfAvail(true, new SetPositionAction(x, y));
     }
-    
+
     @Override
     public void setTopLevelPosition(int x, int y) {
         setPosition(x + getInsets().getLeftWidth(), y + getInsets().getTopHeight());
     }
-    
+
     private class FullScreenAction implements Runnable {
         boolean fullscreen;
 
-        private boolean init(boolean fullscreen) {            
+        private boolean init(boolean fullscreen) {
             if(isNativeValid()) {
                 this.fullscreen = fullscreen;
                 return isFullscreen() != fullscreen;
@@ -1967,7 +1967,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 WindowImpl.this.fullscreen = fullscreen; // set current state for createNative(..)
                 return false;
             }
-        }                
+        }
         public boolean fsOn() { return fullscreen; }
 
         public final void run() {
@@ -1981,9 +1981,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 final int oldY = getY();
                 final int oldWidth = getWidth();
                 final int oldHeight = getHeight();
-                
+
                 int x,y,w,h;
-                
+
                 final RectangleImmutable sviewport = screen.getViewport();
                 final RectangleImmutable viewport;
                 final int fs_span_flag;
@@ -2007,7 +2007,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     nfs_y = oldY;
                     nfs_width = oldWidth;
                     nfs_height = oldHeight;
-                    x = viewport.getX(); 
+                    x = viewport.getX();
                     y = viewport.getY();
                     w = viewport.getWidth();
                     h = viewport.getHeight();
@@ -2020,12 +2020,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     y = nfs_y;
                     w = nfs_width;
                     h = nfs_height;
-                    
+
                     if(null!=parentWindow) {
                         // reset position to 0/0 within parent space
                         x = 0;
                         y = 0;
-    
+
                         // refit if size is bigger than parent
                         if( w > parentWindow.getWidth() ) {
                             w = parentWindow.getWidth();
@@ -2044,7 +2044,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 final DisplayImpl display = (DisplayImpl) screen.getDisplay();
                 display.dispatchMessagesNative(); // status up2date
                 final boolean wasVisible = isVisible();
-                                
+
                 // Lock parentWindow only during reparenting (attempt)
                 final NativeWindow parentWindowLocked;
                 if( null != parentWindow ) {
@@ -2065,8 +2065,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     parentWindowLocked = null;
                 }
                 try {
-                    reconfigureWindowImpl(x, y, w, h, 
-                                          getReconfigureFlags( ( ( null != parentWindowLocked ) ? FLAG_CHANGE_PARENTING : 0 ) | 
+                    reconfigureWindowImpl(x, y, w, h,
+                                          getReconfigureFlags( ( ( null != parentWindowLocked ) ? FLAG_CHANGE_PARENTING : 0 ) |
                                                                fs_span_flag | FLAG_CHANGE_FULLSCREEN | FLAG_CHANGE_DECORATION, isVisible()) );
                 } finally {
                     if(null!=parentWindowLocked) {
@@ -2074,7 +2074,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     }
                 }
                 display.dispatchMessagesNative(); // status up2date
-                
+
                 if(wasVisible) {
                     setVisibleImpl(true, x, y, w, h);
                     boolean ok = 0 <= WindowImpl.this.waitForVisible(true, false);
@@ -2086,7 +2086,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     }
                     if(ok) {
                         requestFocusInt(fullscreen /* skipFocusAction if fullscreen */);
-                        display.dispatchMessagesNative(); // status up2date                                
+                        display.dispatchMessagesNative(); // status up2date
                     }
                     if(DEBUG_IMPLEMENTATION) {
                         System.err.println("Window fs done: ok " + ok + ", " + WindowImpl.this);
@@ -2098,24 +2098,24 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
         }
     }
-    private final FullScreenAction fullScreenAction = new FullScreenAction();       
+    private final FullScreenAction fullScreenAction = new FullScreenAction();
 
     @Override
     public boolean setFullscreen(boolean fullscreen) {
         return setFullscreenImpl(fullscreen, true, null);
     }
-    
+
     @Override
     public boolean setFullscreen(List<MonitorDevice> monitors) {
         return setFullscreenImpl(true, false, monitors);
     }
-    
+
     private boolean setFullscreenImpl(boolean fullscreen, boolean useMainMonitor, List<MonitorDevice> monitors) {
         synchronized(fullScreenAction) {
             fullscreenMonitors = monitors;
             fullscreenUseMainMonitor = useMainMonitor;
             if( fullScreenAction.init(fullscreen) ) {
-                if(fullScreenAction.fsOn() && isOffscreenInstance(WindowImpl.this, parentWindow)) { 
+                if(fullScreenAction.fsOn() && isOffscreenInstance(WindowImpl.this, parentWindow)) {
                     // enable fullscreen on offscreen instance
                     if(null != parentWindow) {
                         nfs_parent = parentWindow;
@@ -2124,19 +2124,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                         throw new InternalError("Offscreen instance w/o parent unhandled");
                     }
                 }
-                
+
                 runOnEDTIfAvail(true, fullScreenAction);
-                
+
                 if(!fullScreenAction.fsOn() && null != nfs_parent) {
                     // disable fullscreen on offscreen instance
                     reparentWindow(nfs_parent, -1, -1, true /* forceDestroyCreate */);
                     nfs_parent = null;
                 }
             }
-            return this.fullscreen;                
+            return this.fullscreen;
         }
     }
-    
+
     private class MonitorModeListenerImpl implements MonitorModeListener {
         boolean animatorPaused = false;
         boolean hadFocus = false;
@@ -2226,7 +2226,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
     //----------------------------------------------------------------------
     // Child Window Management
-    // 
+    //
 
     @Override
     public final boolean removeChild(NativeWindow win) {
@@ -2282,7 +2282,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                         if(DEBUG_IMPLEMENTATION) {
                             System.err.println("Window.consumeEvent: REPAINT "+Thread.currentThread().getName()+" - queued "+e+", discard-to "+discardTO);
                             // Thread.dumpStack();
-                        }                                                
+                        }
                         return discardTO; // discardTO:=true -> consumed
                     }
                     return true;
@@ -2343,11 +2343,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     //
     // MouseListener/Event Support
     //
-    
+
     //
     // Native MouseEvents pre-processed to be enqueued or consumed directly
     //
-    
+
     public final void sendMouseEvent(short eventType, int modifiers,
                                      int x, int y, short button, float rotation) {
         doMouseEvent(false, false, eventType, modifiers, x, y, button, MouseEvent.getRotationXYZ(rotation, modifiers), 1f);
@@ -2369,11 +2369,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                                         int x, int y, short button, float[] rotationXYZ, float rotationScale) {
         doMouseEvent(true, wait, eventType, modifiers, x, y, button, rotationXYZ, rotationScale);
     } */
-    
+
     /**
      * Send mouse event (one-pointer) either to be directly consumed or to be enqueued
-     * 
-     * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued}, 
+     *
+     * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
      *                otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
      * @param wait if true wait until {@link #consumeEvent(NEWTEvent) consumed}.
      */
@@ -2383,7 +2383,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             throw new NativeWindowException("Invalid mouse button number" + button);
         }
         doPointerEvent(enqueue, wait, constMousePointerTypes, eventType, modifiers,
-                       0 /*actionIdx*/, new short[] { (short)(button-1) }, 
+                       0 /*actionIdx*/, new short[] { (short)(button-1) },
                        new int[]{x}, new int[]{y}, new float[]{0f} /*pressure*/,
                        1f /*maxPressure*/, rotationXYZ, rotationScale);
     }
@@ -2396,11 +2396,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * </p>
      * <p>
      * The given pointer names, <code>pNames</code>, are mapped to consecutive pointer IDs starting w/ 0
-     * using a hash-map if <code>normalPNames</code> is <code>false</code>. 
-     * Otherwise a simple <code>int</code> to <code>short</code> type cast is performed. 
+     * using a hash-map if <code>normalPNames</code> is <code>false</code>.
+     * Otherwise a simple <code>int</code> to <code>short</code> type cast is performed.
      * </p>
-     * 
-     * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued}, 
+     *
+     * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
      *                otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
      * @param wait if true wait until {@link #consumeEvent(NEWTEvent) consumed}.
      * @param pTypes {@link MouseEvent.PointerType} for each pointer (multiple pointer)
@@ -2410,14 +2410,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * @param normalPNames see pName below.
      * @param pNames Pointer name for each pointer (multiple pointer).
      *        We assume consecutive pointer names starting w/ 0 if <code>normalPIDs</code> is <code>true</code>.
-     *        Otherwise we hash-map the values during state pressed to retrieve the normal ID. 
+     *        Otherwise we hash-map the values during state pressed to retrieve the normal ID.
      * @param pX X-axis for each pointer (multiple pointer)
      * @param pY Y-axis for each pointer (multiple pointer)
      * @param pPressure Pressure for each pointer (multiple pointer)
      * @param maxPressure Maximum pointer pressure for all pointer
      */
     public final void doPointerEvent(boolean enqueue, boolean wait,
-                                     final PointerType[] pTypes, short eventType, int modifiers, 
+                                     final PointerType[] pTypes, short eventType, int modifiers,
                                      int actionIdx, boolean normalPNames, final int[] pNames,
                                      final int[] pX, final int[] pY, float[] pPressure,
                                      float maxPressure, final float[] rotationXYZ, final float rotationScale) {
@@ -2447,25 +2447,25 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 pIDs[i] = (short)pNames[i];
             }
         }
-        doPointerEvent(enqueue, wait, pTypes, eventType, modifiers, actionIdx, pIDs, 
+        doPointerEvent(enqueue, wait, pTypes, eventType, modifiers, actionIdx, pIDs,
                        pX, pY, pPressure, maxPressure, rotationXYZ, rotationScale);
     }
-    
+
     /**
      * Send multiple-pointer event either to be directly consumed or to be enqueued
      * <p>
      * The index for the element of multiple-pointer arrays represents the pointer which triggered the event
      * is passed via <i>actionIdx</i>.
-     * </p>  
-     * 
-     * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued}, 
+     * </p>
+     *
+     * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
      *                otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
      * @param wait if true wait until {@link #consumeEvent(NEWTEvent) consumed}.
      * @param pTypes {@link MouseEvent.PointerType} for each pointer (multiple pointer)
      * @param eventType
      * @param modifiers
      * @param pActionIdx index of multiple-pointer arrays representing the pointer which triggered the event
-     * @param pID Pointer ID for each pointer (multiple pointer). We assume consecutive pointerIDs starting w/ 0. 
+     * @param pID Pointer ID for each pointer (multiple pointer). We assume consecutive pointerIDs starting w/ 0.
      *            A pointer-ID of -1 may also denote no pointer/button activity, i.e. {@link PointerType#Mouse} move.
      * @param pX X-axis for each pointer (multiple pointer)
      * @param pY Y-axis for each pointer (multiple pointer)
@@ -2473,14 +2473,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * @param maxPressure Maximum pointer pressure for all pointer
      */
     public final void doPointerEvent(boolean enqueue, boolean wait,
-                                     final PointerType[] pTypes, short eventType, int modifiers, 
+                                     final PointerType[] pTypes, short eventType, int modifiers,
                                      int pActionIdx, final short[] pID, final int[] pX, final int[] pY, final float[] pPressure,
                                      float maxPressure, final float[] rotationXYZ, float rotationScale) {
         final long when = System.currentTimeMillis();
         final int pCount = pTypes.length;
-        
+
         if( 0 > pActionIdx || pActionIdx >= pCount) {
-            throw new IllegalArgumentException("actionIdx out of bounds [0.."+(pCount-1)+"]");            
+            throw new IllegalArgumentException("actionIdx out of bounds [0.."+(pCount-1)+"]");
         }
         if( 0 < pActionIdx ) {
             // swap values to make idx 0 the triggering pointer
@@ -2518,11 +2518,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 button = com.jogamp.newt.event.MouseEvent.BUTTON1;
             }
         }
-        
+
         //
         // - Determine ENTERED/EXITED state
         // - Remove redundant move/drag events
-        // - Reset states if applicable 
+        // - Reset states if applicable
         //
         int x = pX[0];
         int y = pY[0];
@@ -2537,7 +2537,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     movePositionP0.set(0, 0);
                 }
                 // Fall through intended!
-                
+
             case MouseEvent.EVENT_MOUSE_ENTERED:
                 // clip coordinates to window dimension
                 x = Math.min(Math.max(x,  0), getWidth()-1);
@@ -2545,11 +2545,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 pState1.insideWindow = eventType == MouseEvent.EVENT_MOUSE_ENTERED;
                 pState1.clearButton();
                 break;
-                
+
             case MouseEvent.EVENT_MOUSE_MOVED:
             case MouseEvent.EVENT_MOUSE_DRAGGED:
                 if( null != movePositionP0 ) {
-                    if( pState1.insideWindow && movePositionP0.getX() == x && movePositionP0.getY() == y ) { 
+                    if( pState1.insideWindow && movePositionP0.getX() == x && movePositionP0.getY() == y ) {
                         if(DEBUG_MOUSE_EVENT) {
                             System.err.println("doPointerEvent: skip "+MouseEvent.getEventTypeString(eventType)+" w/ same position: "+movePositionP0);
                         }
@@ -2557,16 +2557,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     }
                     movePositionP0.set(x, y);
                 }
-                
+
                 // Fall through intended !
-                
+
             default:
                 if(!pState1.insideWindow) {
-                    pState1.insideWindow = true;                    
+                    pState1.insideWindow = true;
                     pState1.clearButton();
                 }
         }
-        
+
         if( x < 0 || y < 0 || x >= getWidth() || y >= getHeight() ) {
             if(DEBUG_MOUSE_EVENT) {
                 System.err.println("doPointerEvent: drop: "+MouseEvent.getEventTypeString(eventType)+
@@ -2582,29 +2582,29 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         final int buttonMask = InputEvent.getButtonMask(button);
         modifiers |= buttonMask; // Always add current button to modifier mask (Bug 571)
         modifiers |= pState1.buttonPressedMask; // Always add currently pressed mouse buttons to modifier mask
-        
+
         if( isPointerConfined() ) {
             modifiers |= InputEvent.CONFINED_MASK;
         }
         if( !isPointerVisible() ) {
             modifiers |= InputEvent.INVISIBLE_MASK;
         }
-        
+
         pX[0] = x;
         pY[0] = y;
-        
+
         //
         // - Determine CLICK COUNT
         // - Ignore sent CLICKED
         // - Track buttonPressed incl. buttonPressedMask
         // - Fix MOVED/DRAGGED event
         //
-        final MouseEvent e;        
+        final MouseEvent e;
         switch( eventType ) {
             case MouseEvent.EVENT_MOUSE_CLICKED:
                 e = null;
                 break;
-        
+
             case MouseEvent.EVENT_MOUSE_PRESSED:
                 if( 0 >= pPressure[0] ) {
                     pPressure[0] = maxPressure;
@@ -2618,16 +2618,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     }
                     pState1.lastButtonPressTime = when;
                     pState1.buttonPressed = button;
-                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID, 
+                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
                                        pX, pY, pPressure, maxPressure, button, pState1.lastButtonClickCount, rotationXYZ, rotationScale);
                 } else {
-                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID, 
+                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
                                        pX, pY, pPressure, maxPressure, button, (short)1, rotationXYZ, rotationScale);
                 }
                 break;
             case MouseEvent.EVENT_MOUSE_RELEASED:
                 if( 1 == pCount ) {
-                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID, 
+                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
                                        pX, pY, pPressure, maxPressure, button, pState1.lastButtonClickCount, rotationXYZ, rotationScale);
                     if( when - pState1.lastButtonPressTime >= MouseEvent.getClickTimeout() ) {
                         pState1.lastButtonClickCount = (short)0;
@@ -2635,7 +2635,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     }
                     pState1.buttonPressed = 0;
                 } else {
-                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID, 
+                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
                                        pX, pY, pPressure, maxPressure, button, (short)1, rotationXYZ, rotationScale);
                 }
                 pState1.buttonPressedMask &= ~buttonMask;
@@ -2645,10 +2645,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 break;
             case MouseEvent.EVENT_MOUSE_MOVED:
                 if ( 0 != pState1.buttonPressedMask ) { // any button or pointer move -> drag
-                    e = new MouseEvent(MouseEvent.EVENT_MOUSE_DRAGGED, this, when, modifiers, pTypes, pID, 
+                    e = new MouseEvent(MouseEvent.EVENT_MOUSE_DRAGGED, this, when, modifiers, pTypes, pID,
                                        pX, pY, pPressure, maxPressure, pState1.buttonPressed, (short)1, rotationXYZ, rotationScale);
                 } else {
-                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID, 
+                    e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
                                        pX, pY, pPressure, maxPressure, button, (short)0, rotationXYZ, rotationScale);
                 }
                 break;
@@ -2658,12 +2658,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 }
                 // Fall through intended!
             default:
-                e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID, 
+                e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
                                    pX, pY, pPressure, maxPressure, button, (short)0, rotationXYZ, rotationScale);
         }
         doEvent(enqueue, wait, e); // actual mouse event
     }
-    
+
     @Override
     public final void addMouseListener(MouseListener l) {
         addMouseListener(-1, l);
@@ -2676,8 +2676,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         @SuppressWarnings("unchecked")
         ArrayList<MouseListener> clonedListeners = (ArrayList<MouseListener>) mouseListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size(); 
+        if(0>index) {
+            index = clonedListeners.size();
         }
         clonedListeners.add(index, l);
         mouseListeners = clonedListeners;
@@ -2698,8 +2698,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public final MouseListener getMouseListener(int index) {
         @SuppressWarnings("unchecked")
         ArrayList<MouseListener> clonedListeners = (ArrayList<MouseListener>) mouseListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size()-1; 
+        if(0>index) {
+            index = clonedListeners.size()-1;
         }
         return clonedListeners.get(index);
     }
@@ -2717,7 +2717,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public final boolean areDefaultGesturesEnabled() {
         return defaultGestureHandlerEnabled;
     }
-    
+
     @Override
     public final void addGestureHandler(GestureHandler gh) {
         addGestureHandler(-1, gh);
@@ -2729,7 +2729,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         @SuppressWarnings("unchecked")
         ArrayList<GestureHandler> cloned = (ArrayList<GestureHandler>) pointerGestureHandler.clone();
-        if(0>index) { 
+        if(0>index) {
             index = cloned.size();
         }
         cloned.add(index, gh);
@@ -2756,7 +2756,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         @SuppressWarnings("unchecked")
         ArrayList<GestureHandler.GestureListener> cloned = (ArrayList<GestureHandler.GestureListener>) gestureListeners.clone();
-        if(0>index) { 
+        if(0>index) {
             index = cloned.size();
         }
         cloned.add(index, gl);
@@ -2772,11 +2772,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         cloned.remove(gl);
         gestureListeners= cloned;
     }
-    
+
     private static int step(int lower, int edge, int value) {
         return value < edge ? lower : value;
     }
-    
+
     /**
      * Consume the {@link MouseEvent}, i.e.
      * <pre>
@@ -2786,18 +2786,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      *   - dispatch event to listener
      * </pre>
      */
-    protected void consumePointerEvent(MouseEvent pe) {        
+    protected void consumePointerEvent(MouseEvent pe) {
         int x = pe.getX();
         int y = pe.getY();
-        
+
         if(DEBUG_MOUSE_EVENT) {
             System.err.println("consumePointerEvent.in: "+pe);
         }
-        
+
         //
         // - Determine ENTERED/EXITED state
         // - Synthesize ENTERED event
-        // - Reset states if applicable 
+        // - Reset states if applicable
         //
         final long when = pe.getWhen();
         int eventType = pe.getEventType();
@@ -2812,7 +2812,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 pState0.clearButton();
                 eEntered = null;
                 break;
-                
+
             default:
                 if(!pState0.insideWindow) {
                     pState0.insideWindow = true;
@@ -2833,12 +2833,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             }
             return; // .. invalid ..
         }
-        
+
         //
         // Handle Default Gestures
         //
         if( defaultGestureHandlerEnabled &&
-            pe.getPointerType(0).getPointerClass() == MouseEvent.PointerClass.Onscreen ) 
+            pe.getPointerType(0).getPointerClass() == MouseEvent.PointerClass.Onscreen )
         {
             if( null == gesture2PtrTouchScroll ) {
                 final int scaledScrollSlop;
@@ -2849,16 +2849,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     final float pixWPerMM = (float)monitor.getCurrentMode().getRotatedWidth() / (float)mm.getWidth();
                     final float pixHPerMM = (float)monitor.getCurrentMode().getRotatedHeight() / (float)mm.getHeight();
                     final float pixPerMM = Math.min(pixHPerMM, pixWPerMM);
-                    scaledScrollSlop = Math.round(DoubleTapScrollGesture.SCROLL_SLOP_MM * pixPerMM);  
-                    scaledDoubleTapSlop = Math.round(DoubleTapScrollGesture.DOUBLE_TAP_SLOP_MM * pixPerMM);                         
+                    scaledScrollSlop = Math.round(DoubleTapScrollGesture.SCROLL_SLOP_MM * pixPerMM);
+                    scaledDoubleTapSlop = Math.round(DoubleTapScrollGesture.DOUBLE_TAP_SLOP_MM * pixPerMM);
                     if(DEBUG_MOUSE_EVENT) {
                         System.err.println("consumePointerEvent.gscroll: scrollSlop "+scaledScrollSlop+", doubleTapSlop "+scaledDoubleTapSlop+", pixPerMM "+pixPerMM+", "+monitor);
                     }
                 } else {
                     scaledScrollSlop = DoubleTapScrollGesture.SCROLL_SLOP_PIXEL;
-                    scaledDoubleTapSlop = DoubleTapScrollGesture.DOUBLE_TAP_SLOP_PIXEL;                        
+                    scaledDoubleTapSlop = DoubleTapScrollGesture.DOUBLE_TAP_SLOP_PIXEL;
                 }
-                gesture2PtrTouchScroll = new DoubleTapScrollGesture(step(DoubleTapScrollGesture.SCROLL_SLOP_PIXEL, DoubleTapScrollGesture.SCROLL_SLOP_PIXEL/2, scaledScrollSlop), 
+                gesture2PtrTouchScroll = new DoubleTapScrollGesture(step(DoubleTapScrollGesture.SCROLL_SLOP_PIXEL, DoubleTapScrollGesture.SCROLL_SLOP_PIXEL/2, scaledScrollSlop),
                                                                     step(DoubleTapScrollGesture.DOUBLE_TAP_SLOP_PIXEL, DoubleTapScrollGesture.DOUBLE_TAP_SLOP_PIXEL/2, scaledDoubleTapSlop));
             }
             if( gesture2PtrTouchScroll.process(pe) ) {
@@ -2903,11 +2903,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 }
             }
         }
-        
+
         //
         // - Synthesize mouse CLICKED
         // - Ignore sent CLICKED
-        //        
+        //
         final MouseEvent eClicked;
         switch( eventType ) {
             case MouseEvent.EVENT_MOUSE_PRESSED:
@@ -2921,7 +2921,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     eClicked = pe.createVariant(MouseEvent.EVENT_MOUSE_CLICKED);
                 } else {
                     eClicked = null;
-                    pState0.lastButtonPressTime = 0;                    
+                    pState0.lastButtonPressTime = 0;
                 }
                 break;
             case MouseEvent.EVENT_MOUSE_CLICKED:
@@ -2935,7 +2935,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             default:
                 eClicked = null;
         }
-        
+
         if( null != pe ) {
             if(DEBUG_MOUSE_EVENT) {
                 System.err.println("consumePointerEvent.send.1: "+pe);
@@ -2949,7 +2949,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             dispatchMouseEvent(eClicked);
         }
     }
-    
+
     private final void dispatchMouseEvent(MouseEvent e) {
         for(int i = 0; !e.isConsumed() && i < mouseListeners.size(); i++ ) {
             MouseListener l = mouseListeners.get(i);
@@ -2989,15 +2989,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     //
     private static final int keyTrackingRange = 255;
     private final IntBitfield keyPressedState = new IntBitfield( keyTrackingRange + 1 );
-    
+
     protected final boolean isKeyCodeTracked(final short keyCode) {
         return ( 0xFFFF & (int)keyCode ) <= keyTrackingRange;
     }
-    
+
     /**
      * @param keyCode the keyCode to set pressed state
      * @param pressed true if pressed, otherwise false
-     * @return the previus pressed value 
+     * @return the previus pressed value
      */
     protected final boolean setKeyPressed(short keyCode, boolean pressed) {
         final int v = 0xFFFF & (int)keyCode;
@@ -3008,7 +3008,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
     /**
      * @param keyCode the keyCode to test pressed state
-     * @return true if pressed, otherwise false 
+     * @return true if pressed, otherwise false
      */
     protected final boolean isKeyPressed(short keyCode) {
         final int v = 0xFFFF & (int)keyCode;
@@ -3017,7 +3017,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         return false;
     }
-        
+
     public void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
         // Always add currently pressed mouse buttons to modifier mask
         consumeKeyEvent( KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
@@ -3027,12 +3027,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         // Always add currently pressed mouse buttons to modifier mask
         enqueueEvent(wait, KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
     }
-    
+
     @Override
     public final void setKeyboardVisible(boolean visible) {
         if(isNativeValid()) {
             // We don't skip the impl. if it seems that there is no state change,
-            // since we cannot assume the impl. reliably gives us it's current state. 
+            // since we cannot assume the impl. reliably gives us it's current state.
             final boolean ok = setKeyboardVisibleImpl(visible);
             if(DEBUG_IMPLEMENTATION || DEBUG_KEY_EVENT) {
                 System.err.println("setKeyboardVisible(native): visible "+keyboardVisible+" -- op[visible:"+visible +", ok "+ok+"] -> "+(visible && ok));
@@ -3046,13 +3046,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public final boolean isKeyboardVisible() {
         return keyboardVisible;
     }
-    /** 
+    /**
      * Returns <code>true</code> if operation was successful, otherwise <code>false</code>.
      * <p>
      * We assume that a failed invisible operation is due to an already invisible keyboard,
-     * hence even if an invisible operation failed, the keyboard is considered invisible!  
-     * </p> 
-     */ 
+     * hence even if an invisible operation failed, the keyboard is considered invisible!
+     * </p>
+     */
     protected boolean setKeyboardVisibleImpl(boolean visible) {
         return false; // nop
     }
@@ -3066,7 +3066,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
     }
     protected boolean keyboardVisible = false;
-    
+
     @Override
     public void addKeyListener(KeyListener l) {
         addKeyListener(-1, l);
@@ -3079,7 +3079,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         @SuppressWarnings("unchecked")
         ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone();
-        if(0>index) { 
+        if(0>index) {
             index = clonedListeners.size();
         }
         clonedListeners.add(index, l);
@@ -3101,7 +3101,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public KeyListener getKeyListener(int index) {
         @SuppressWarnings("unchecked")
         ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone();
-        if(0>index) { 
+        if(0>index) {
             index = clonedListeners.size()-1;
         }
         return clonedListeners.get(index);
@@ -3125,7 +3125,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         return e.isConsumed();
     }
-    
+
     protected void consumeKeyEvent(KeyEvent e) {
         boolean consumedE = false;
         if( null != keyboardFocusHandler && !e.isAutoRepeat() ) {
@@ -3164,7 +3164,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public void addWindowListener(int index, WindowListener l) 
+    public void addWindowListener(int index, WindowListener l)
         throws IndexOutOfBoundsException
     {
         if(l == null) {
@@ -3172,8 +3172,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         @SuppressWarnings("unchecked")
         ArrayList<WindowListener> clonedListeners = (ArrayList<WindowListener>) windowListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size(); 
+        if(0>index) {
+            index = clonedListeners.size();
         }
         clonedListeners.add(index, l);
         windowListeners = clonedListeners;
@@ -3194,8 +3194,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     public WindowListener getWindowListener(int index) {
         @SuppressWarnings("unchecked")
         ArrayList<WindowListener> clonedListeners = (ArrayList<WindowListener>) windowListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size()-1; 
+        if(0>index) {
+            index = clonedListeners.size()-1;
         }
         return clonedListeners.get(index);
     }
@@ -3234,7 +3234,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     l.windowRepaint((WindowUpdateEvent)e);
                     break;
                 default:
-                    throw 
+                    throw
                         new NativeWindowException("Unexpected window event type "
                                                   + e.getEventType());
             }
@@ -3248,7 +3248,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 System.err.println("Window.focusChanged: ("+getThreadName()+"): (defer: "+defer+") "+this.hasFocus+" -> "+focusGained+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
             }
             hasFocus = focusGained;
-            final int evt = focusGained ? WindowEvent.EVENT_WINDOW_GAINED_FOCUS : WindowEvent.EVENT_WINDOW_LOST_FOCUS ; 
+            final int evt = focusGained ? WindowEvent.EVENT_WINDOW_GAINED_FOCUS : WindowEvent.EVENT_WINDOW_LOST_FOCUS ;
             if(!defer) {
                 sendWindowEvent(evt);
             } else {
@@ -3256,7 +3256,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             }
         }
     }
-    
+
     /** Triggered by implementation's WM events to update the visibility state. */
     protected void visibleChanged(boolean defer, boolean visible) {
         if(this.visible != visible) {
@@ -3282,7 +3282,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             display.dispatchMessagesNative(); // status up2date
         }
         if(this.visible != visible) {
-            final String msg = "Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+this.visible; 
+            final String msg = "Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+this.visible;
             if(failFast) {
                 throw new NativeWindowException(msg);
             } else if (DEBUG_IMPLEMENTATION) {
@@ -3297,7 +3297,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
     }
 
-    /** Triggered by implementation's WM events to update the client-area size w/o insets/decorations. */ 
+    /** Triggered by implementation's WM events to update the client-area size w/o insets/decorations. */
     protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
         if(force || getWidth() != newWidth || getHeight() != newHeight) {
             if(DEBUG_IMPLEMENTATION) {
@@ -3316,7 +3316,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             }
         }
     }
-    
+
     private boolean waitForSize(int w, int h, boolean failFast, long timeOut) {
         final DisplayImpl display = (DisplayImpl) screen.getDisplay();
         display.dispatchMessagesNative(); // status up2date
@@ -3338,8 +3338,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             return true;
         }
     }
-    
-    /** Triggered by implementation's WM events to update the position. */ 
+
+    /** Triggered by implementation's WM events to update the position. */
     protected void positionChanged(boolean defer, int newX, int newY) {
         if ( getX() != newX || getY() != newY ) {
             if(DEBUG_IMPLEMENTATION) {
@@ -3352,7 +3352,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 enqueueWindowEvent(false, WindowEvent.EVENT_WINDOW_MOVED);
             }
         } else {
-            autoPosition = false; // ensure it's off even w/ same position            
+            autoPosition = false; // ensure it's off even w/ same position
         }
     }
 
@@ -3396,10 +3396,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         return ok;
     }
-    
+
     /**
-     * Triggered by implementation's WM events to update the insets. 
-     * 
+     * Triggered by implementation's WM events to update the insets.
+     *
      * @see #getInsets()
      * @see #updateInsetsImpl(Insets)
      */
@@ -3409,7 +3409,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Window.insetsChanged: skip insets change for undecoration mode");
                 }
-            } else if ( (left != insets.getLeftWidth() || right != insets.getRightWidth() || 
+            } else if ( (left != insets.getLeftWidth() || right != insets.getRightWidth() ||
                          top != insets.getTopHeight() || bottom != insets.getBottomHeight() )
                        ) {
                 insets.set(left, right, top, bottom);
@@ -3419,10 +3419,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             }
         }
     }
-    
+
     /**
      * Triggered by implementation's WM events or programmatic while respecting {@link #getDefaultCloseOperation()}.
-     * 
+     *
      * @param force if true, overrides {@link #setDefaultCloseOperation(WindowClosingMode)} with {@link WindowClosingProtocol#DISPOSE_ON_CLOSE}
      *              and hence force destruction. Otherwise is follows the user settings.
      * @return true if this window is no more valid and hence has been destroyed, otherwise false.
@@ -3434,9 +3434,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             System.err.println("Window.windowDestroyNotify(isNativeValid: "+isNativeValid()+", force: "+force+", mode "+defMode+" -> "+mode+") "+getThreadName()+": "+this);
             // Thread.dumpStack();
         }
-        
+
         final boolean destroyed;
-        
+
         if( isNativeValid() ) {
             if( WindowClosingMode.DISPOSE_ON_CLOSE == mode ) {
                 if(force) {
@@ -3457,7 +3457,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 // send synced destroy notifications
                 sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
             }
-            
+
             destroyed = !isNativeValid();
         } else {
             destroyed = true;
@@ -3465,19 +3465,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("Window.windowDestroyNotify(isNativeValid: "+isNativeValid()+", force: "+force+", mode "+mode+") END "+getThreadName()+": destroyed "+destroyed+", "+this);
-        }        
-        
+        }
+
         return destroyed;
     }
 
     @Override
     public void windowRepaint(int x, int y, int width, int height) {
-        windowRepaint(false, x, y, width, height); 
+        windowRepaint(false, x, y, width, height);
     }
-    
+
     /**
      * Triggered by implementation's WM events to update the content
-     */ 
+     */
     protected void windowRepaint(boolean defer, int x, int y, int width, int height) {
         width = ( 0 >= width ) ? getWidth() : width;
         height = ( 0 >= height ) ? getHeight() : height;
@@ -3542,7 +3542,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     protected final void shouldNotCallThis() {
         throw new NativeWindowException("Should not call this");
     }
-    
+
     public static String getThreadName() {
         return Display.getThreadName();
     }
diff --git a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
index 861a6d6be..2ba5b3460 100644
--- a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
+++ b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.newt.awt;
 
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
@@ -76,12 +76,12 @@ public class NewtFactoryAWT extends NewtFactory {
       }
       return (JAWTWindow)nw;
   }
-    
+
   public static void destroyNativeWindow(JAWTWindow jawtWindow) {
       final AbstractGraphicsConfiguration config = jawtWindow.getGraphicsConfiguration();
       jawtWindow.destroy();
-      config.getScreen().getDevice().close();      
+      config.getScreen().getDevice().close();
   }
-    
+
 }
 
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
index d71ad175b..0ee3cc0cd 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,26 +20,26 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.newt.awt.event;
 
 import com.jogamp.newt.event.MouseEvent;
 
 /**
  *
- * <a name="AWTEventModifierMapping"><h5>AWT Event Modifier Mapping</h5></a> 
+ * <a name="AWTEventModifierMapping"><h5>AWT Event Modifier Mapping</h5></a>
  * <pre>
     Modifier       AWT Constant                     AWT Bit  AWT Ex  NEWT Constant              NEWT Bit
     -------------  -------------------------------  -------  ------  -------------------------  --------
-    Shift          Event.SHIFT_MASK                 0                
-    Ctrl           Event.CTRL_MASK                  1                
-    Meta           Event.META_MASK                  2                
-    Alt            Event.ALT_MASK                   3               
+    Shift          Event.SHIFT_MASK                 0
+    Ctrl           Event.CTRL_MASK                  1
+    Meta           Event.META_MASK                  2
+    Alt            Event.ALT_MASK                   3
     Button1        InputEvent.BUTTON1_MASK          4
     Button2        InputEvent.BUTTON2_MASK          3
     Button3        InputEvent.BUTTON3_MASK          2
@@ -88,10 +88,10 @@ public class AWTNewtEventFactory {
             Method _getMaskForButtonMethod = null;
             try {
                 _getMaskForButtonMethod = ReflectionUtil.getMethod(java.awt.event.InputEvent.class, "getMaskForButton", int.class);
-            } catch(Throwable t) {}        
+            } catch(Throwable t) {}
             getMaskForButtonMethod = _getMaskForButtonMethod;
         } */
-        
+
         awtButtonDownMasks = new int[com.jogamp.newt.event.MouseEvent.BUTTON_COUNT] ; // java.awt.MouseInfo.getNumberOfButtons() ;
         for (int n = 0 ; n < awtButtonDownMasks.length ; ++n) {
             awtButtonDownMasks[n] = getAWTButtonDownMaskImpl(n+1);
@@ -112,12 +112,12 @@ public class AWTNewtEventFactory {
             case java.awt.event.WindowEvent.WINDOW_LOST_FOCUS: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_LOST_FOCUS;
             case java.awt.event.FocusEvent.FOCUS_LOST: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_LOST_FOCUS;
             // n/a case java.awt.event.WindowEvent.WINDOW_STATE_CHANGED: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_STATE_CHANGED;
-    
+
             case java.awt.event.ComponentEvent.COMPONENT_MOVED: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_MOVED;
             case java.awt.event.ComponentEvent.COMPONENT_RESIZED: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_RESIZED;
             // n/a case java.awt.event.ComponentEvent.COMPONENT_SHOWN: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_SHOWN;
             // n/a case java.awt.event.ComponentEvent.COMPONENT_HIDDEN: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_HIDDEN;
-    
+
             case java.awt.event.MouseEvent.MOUSE_CLICKED: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_CLICKED;
             case java.awt.event.MouseEvent.MOUSE_PRESSED: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_PRESSED;
             case java.awt.event.MouseEvent.MOUSE_RELEASED: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_RELEASED;
@@ -126,17 +126,17 @@ public class AWTNewtEventFactory {
             case java.awt.event.MouseEvent.MOUSE_EXITED: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_EXITED;
             case java.awt.event.MouseEvent.MOUSE_DRAGGED: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_DRAGGED;
             case java.awt.event.MouseEvent.MOUSE_WHEEL: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_WHEEL_MOVED;
-    
+
             case java.awt.event.KeyEvent.KEY_PRESSED: return com.jogamp.newt.event.KeyEvent.EVENT_KEY_PRESSED;
             case java.awt.event.KeyEvent.KEY_RELEASED: return com.jogamp.newt.event.KeyEvent.EVENT_KEY_RELEASED;
         }
         return (short)0;
     }
-    
+
     private static int getAWTButtonDownMaskImpl(int button) {
         /**
          * java.awt.event.InputEvent.getMaskForButton(button);
-         * 
+         *
         if(null != getMaskForButtonMethod) {
             Object r=null;
             try {
@@ -157,16 +157,16 @@ public class AWTNewtEventFactory {
                     m = 1 << ( 10 + button ) ; // b4 = 1<<14, b5 = 1<<15, etc
                 } else {
                     m = 0;
-                }                
+                }
         }
         return m;
     }
-    
+
     /**
      * <p>
      * See <a href="#AWTEventModifierMapping"> AWT event modifier mapping details</a>.
      * </p>
-     * 
+     *
      * @param button
      * @return
      */
@@ -175,9 +175,9 @@ public class AWTNewtEventFactory {
             return awtButtonDownMasks[button-1];
         } else {
             return 0;
-        }        
+        }
     }
-    
+
     public static final short awtButton2Newt(int awtButton) {
         if( 0 < awtButton && awtButton <= com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ) {
             return (short)awtButton;
@@ -185,32 +185,32 @@ public class AWTNewtEventFactory {
             return (short)0;
         }
     }
-    
+
     /**
      * Converts the specified set of AWT event modifiers and extended event
      * modifiers to the equivalent NEWT event modifiers.
-     * 
+     *
      * <p>
      * See <a href="#AWTEventModifierMapping"> AWT event modifier mapping details</a>.
      * </p>
-     * 
+     *
      * @param awtMods
      * The AWT event modifiers.
-     * 
+     *
      * @param awtModsEx
      * The AWT extended event modifiers.
      * AWT passes mouse button specific bits here and are the preferred way check the mouse button state.
      */
     public static final int awtModifiers2Newt(final int awtMods, final int awtModsEx) {
         int newtMods = 0;
-        
+
         /** Redundant old modifiers ..
         if ((awtMods & java.awt.event.InputEvent.SHIFT_MASK) != 0)     newtMods |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
         if ((awtMods & java.awt.event.InputEvent.CTRL_MASK) != 0)      newtMods |= com.jogamp.newt.event.InputEvent.CTRL_MASK;
         if ((awtMods & java.awt.event.InputEvent.META_MASK) != 0)      newtMods |= com.jogamp.newt.event.InputEvent.META_MASK;
         if ((awtMods & java.awt.event.InputEvent.ALT_MASK) != 0)       newtMods |= com.jogamp.newt.event.InputEvent.ALT_MASK;
         if ((awtMods & java.awt.event.InputEvent.ALT_GRAPH_MASK) != 0) newtMods |= com.jogamp.newt.event.InputEvent.ALT_GRAPH_MASK; */
-        
+
         if ((awtModsEx & java.awt.event.InputEvent.SHIFT_DOWN_MASK) != 0)     newtMods |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
         if ((awtModsEx & java.awt.event.InputEvent.CTRL_DOWN_MASK) != 0)      newtMods |= com.jogamp.newt.event.InputEvent.CTRL_MASK;
         if ((awtModsEx & java.awt.event.InputEvent.META_DOWN_MASK) != 0)      newtMods |= com.jogamp.newt.event.InputEvent.META_MASK;
@@ -221,7 +221,7 @@ public class AWTNewtEventFactory {
         // being ignored intentionally.  The AWT docs say that the
         // BUTTON1_DOWN_MASK etc bits in the extended modifiers are
         // the preferred place to check current button state.
-        
+
         if( 0 != awtModsEx ) {
             for (int n = 0 ; n < awtButtonDownMasks.length ; ++n) {
                 if ( (awtModsEx & awtButtonDownMasks[n]) != 0 ) {
@@ -232,7 +232,7 @@ public class AWTNewtEventFactory {
 
         return newtMods;
     }
-    
+
     public static short awtKeyCode2NewtKeyCode(final int awtKeyCode) {
         final short defNEWTKeyCode = (short)awtKeyCode;
         switch (awtKeyCode) {
@@ -371,7 +371,7 @@ public class AWTNewtEventFactory {
             case java.awt.event.KeyEvent.VK_MULTIPLY      : return com.jogamp.newt.event.KeyEvent.VK_MULTIPLY;
             case java.awt.event.KeyEvent.VK_DIVIDE        : return com.jogamp.newt.event.KeyEvent.VK_DIVIDE;
             case java.awt.event.KeyEvent.VK_NUM_LOCK      : return com.jogamp.newt.event.KeyEvent.VK_NUM_LOCK;
-            case java.awt.event.KeyEvent.VK_KP_LEFT       : /** Fall through intended .. */ 
+            case java.awt.event.KeyEvent.VK_KP_LEFT       : /** Fall through intended .. */
             case java.awt.event.KeyEvent.VK_LEFT          : return com.jogamp.newt.event.KeyEvent.VK_LEFT;
             case java.awt.event.KeyEvent.VK_KP_UP         : /** Fall through intended .. */
             case java.awt.event.KeyEvent.VK_UP            : return com.jogamp.newt.event.KeyEvent.VK_UP;
@@ -381,7 +381,7 @@ public class AWTNewtEventFactory {
             case java.awt.event.KeyEvent.VK_DOWN          : return com.jogamp.newt.event.KeyEvent.VK_DOWN;
             case java.awt.event.KeyEvent.VK_CONTEXT_MENU  : return com.jogamp.newt.event.KeyEvent.VK_CONTEXT_MENU;
             case java.awt.event.KeyEvent.VK_WINDOWS       : return com.jogamp.newt.event.KeyEvent.VK_WINDOWS;
-            case java.awt.event.KeyEvent.VK_META          : return com.jogamp.newt.event.KeyEvent.VK_META;            
+            case java.awt.event.KeyEvent.VK_META          : return com.jogamp.newt.event.KeyEvent.VK_META;
             case java.awt.event.KeyEvent.VK_HELP          : return com.jogamp.newt.event.KeyEvent.VK_HELP;
             case java.awt.event.KeyEvent.VK_COMPOSE       : return com.jogamp.newt.event.KeyEvent.VK_COMPOSE;
             case java.awt.event.KeyEvent.VK_BEGIN         : return com.jogamp.newt.event.KeyEvent.VK_BEGIN;
@@ -558,7 +558,7 @@ public class AWTNewtEventFactory {
             case com.jogamp.newt.event.KeyEvent.VK_DOWN          : return java.awt.event.KeyEvent.VK_DOWN;
             case com.jogamp.newt.event.KeyEvent.VK_CONTEXT_MENU  : return java.awt.event.KeyEvent.VK_CONTEXT_MENU;
             case com.jogamp.newt.event.KeyEvent.VK_WINDOWS       : return java.awt.event.KeyEvent.VK_WINDOWS;
-            case com.jogamp.newt.event.KeyEvent.VK_META          : return java.awt.event.KeyEvent.VK_META;            
+            case com.jogamp.newt.event.KeyEvent.VK_META          : return java.awt.event.KeyEvent.VK_META;
             case com.jogamp.newt.event.KeyEvent.VK_HELP          : return java.awt.event.KeyEvent.VK_HELP;
             case com.jogamp.newt.event.KeyEvent.VK_COMPOSE       : return java.awt.event.KeyEvent.VK_COMPOSE;
             case com.jogamp.newt.event.KeyEvent.VK_BEGIN         : return java.awt.event.KeyEvent.VK_BEGIN;
@@ -636,7 +636,7 @@ public class AWTNewtEventFactory {
             }
             return new com.jogamp.newt.event.MouseEvent(
                            newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
-                           mods, event.getX(), event.getY(), (short)event.getClickCount(), 
+                           mods, event.getX(), event.getY(), (short)event.getClickCount(),
                            newtButton, MouseEvent.getRotationXYZ(rotation, mods), 1f);
         }
         return null; // no mapping ..
@@ -650,11 +650,11 @@ public class AWTNewtEventFactory {
         if( (short)0 != newtType ) {
             final short newtKeyCode = awtKeyCode2NewtKeyCode( event.getKeyCode() );
             return com.jogamp.newt.event.KeyEvent.create(
-                           newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(), 
-                           awtModifiers2Newt(event.getModifiers(), event.getModifiersEx()), 
+                           newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
+                           awtModifiers2Newt(event.getModifiers(), event.getModifiersEx()),
                            newtKeyCode, newtKeyCode, event.getKeyChar());
         }
         return null; // no mapping ..
     }
-    
+
 }
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
index fa494adca..325f17278 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.newt.awt.event;
 
 import java.awt.KeyboardFocusManager;
@@ -45,7 +45,7 @@ import com.jogamp.newt.event.awt.AWTWindowAdapter;
 public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt.event.HierarchyListener
 {
     NativeWindow downstreamParent;
-    
+
     public AWTParentWindowAdapter(NativeWindow downstreamParent, com.jogamp.newt.Window downstream) {
         super(downstream);
         this.downstreamParent = downstreamParent;
@@ -111,12 +111,12 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
 
     public void componentMoved(java.awt.event.ComponentEvent e) {
         if(DEBUG_IMPLEMENTATION) {
-            System.err.println("AWT: componentMoved: "+e);            
+            System.err.println("AWT: componentMoved: "+e);
         }
         final Window newtWindow = getNewtWindow();
         if(newtWindow.getDelegatedWindow() instanceof DriverUpdatePosition) {
             ((DriverUpdatePosition)newtWindow.getDelegatedWindow()).updatePosition(0, 0);
-        }            
+        }
     }
 
     public void windowActivated(java.awt.event.WindowEvent e) {
@@ -130,7 +130,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
     public void hierarchyChanged(java.awt.event.HierarchyEvent e) {
         if( null == getNewtEventListener() ) {
             long bits = e.getChangeFlags();
-            final java.awt.Component changed = e.getChanged();            
+            final java.awt.Component changed = e.getChanged();
             if( 0 != ( java.awt.event.HierarchyEvent.SHOWING_CHANGED & bits ) ) {
                 final boolean showing = changed.isShowing();
                 if(DEBUG_IMPLEMENTATION) {
@@ -142,7 +142,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
                             getNewtWindow().setVisible(showing);
                         }
                     }});
-            } 
+            }
             if(DEBUG_IMPLEMENTATION) {
                 if( 0 != ( java.awt.event.HierarchyEvent.DISPLAYABILITY_CHANGED & bits ) ) {
                     final boolean displayability = changed.isDisplayable();
diff --git a/src/newt/classes/jogamp/newt/driver/DriverClearFocus.java b/src/newt/classes/jogamp/newt/driver/DriverClearFocus.java
index 0a824e83b..0ff86fe93 100644
--- a/src/newt/classes/jogamp/newt/driver/DriverClearFocus.java
+++ b/src/newt/classes/jogamp/newt/driver/DriverClearFocus.java
@@ -1,10 +1,10 @@
 package jogamp.newt.driver;
 
-/** 
+/**
  * Interface tagging driver requirement of clearing the focus.
  * <p>
- * Some drivers require a programmatic {@link #clearFocus()} when traversing the focus. 
- * </p>   
+ * Some drivers require a programmatic {@link #clearFocus()} when traversing the focus.
+ * </p>
  */
 public interface DriverClearFocus {
     /** Programmatic clear the focus */
diff --git a/src/newt/classes/jogamp/newt/driver/DriverUpdatePosition.java b/src/newt/classes/jogamp/newt/driver/DriverUpdatePosition.java
index 2ec327187..e5f9b6a68 100644
--- a/src/newt/classes/jogamp/newt/driver/DriverUpdatePosition.java
+++ b/src/newt/classes/jogamp/newt/driver/DriverUpdatePosition.java
@@ -1,14 +1,14 @@
 package jogamp.newt.driver;
 
-/** 
+/**
  * Interface tagging driver requirement of absolute positioning, ie. depend on parent position.
  */
 public interface DriverUpdatePosition {
-    /** 
+    /**
      * Programmatic update the top-left corner
      * of the client area relative to it's parent.
-     * 
-     * @param x x-component 
+     *
+     * @param x x-component
      * @param y y-component
      **/
     void updatePosition(int x, int y);
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
index 9a1632130..14cc9c69d 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.awt;
@@ -100,7 +100,7 @@ public class AWTCanvas extends Canvas {
   @Override
   public void paint(Graphics g) {
   }
-  
+
   public boolean hasDeviceChanged() {
     boolean res = displayConfigChanged;
     displayConfigChanged=false;
@@ -154,12 +154,12 @@ public class AWTCanvas extends Canvas {
   public NativeWindow getNativeWindow() {
     final JAWTWindow _jawtWindow = jawtWindow;
     return (null != _jawtWindow) ? _jawtWindow : null;
-  }  
-  
+  }
+
   public boolean isOffscreenLayerSurfaceEnabled() {
-      return null != jawtWindow ? jawtWindow.isOffscreenLayerSurfaceEnabled() : false; 
+      return null != jawtWindow ? jawtWindow.isOffscreenLayerSurfaceEnabled() : false;
   }
-  
+
   public void removeNotify() {
       try {
         dispose();
@@ -188,7 +188,7 @@ public class AWTCanvas extends Canvas {
         }
     }
   }
-  
+
   private String getThreadName() { return Thread.currentThread().getName(); }
 
   /**
@@ -200,7 +200,7 @@ public class AWTCanvas extends Canvas {
      * Workaround for problems with Xinerama and java.awt.Component.checkGD
      * when adding to a container on a different graphics device than the
      * one that this Canvas is associated with.
-     * 
+     *
      * GC will be null unless:
      *   - A native peer has assigned it. This means we have a native
      *     peer, and are already comitted to a graphics configuration.
@@ -214,7 +214,7 @@ public class AWTCanvas extends Canvas {
      * chosen is only non-null on platforms where the GLDrawableFactory
      * returns a non-null GraphicsConfiguration (in the GLCanvas
      * constructor).
-     * 
+     *
      * if gc is from this Canvas' native peer then it should equal chosen,
      * otherwise it is from an ancestor component that this Canvas is being
      * added to, and we go into this block.
@@ -224,21 +224,21 @@ public class AWTCanvas extends Canvas {
        * Check for compatibility with gc. If they differ by only the
        * device then return a new GCconfig with the super-class' GDevice
        * (and presumably the same visual ID in Xinerama).
-       * 
+       *
        */
       if (!chosen.getDevice().getIDstring().equals(gc.getDevice().getIDstring())) {
         /*
          * Here we select a GraphicsConfiguration on the alternate
          * device that is presumably identical to the chosen
          * configuration, but on the other device.
-         * 
+         *
          * Should really check to ensure that we select a configuration
          * with the same X visual ID for Xinerama screens, otherwise the
          * GLDrawable may have the wrong visual ID (I don't think this
          * ever gets updated). May need to add a method to
          * X11GLDrawableFactory to do this in a platform specific
          * manner.
-         * 
+         *
          * However, on platforms where we can actually get into this
          * block, both devices should have the same visual list, and the
          * same configuration should be selected here.
@@ -265,7 +265,7 @@ public class AWTCanvas extends Canvas {
           chosen = compatible;
           if( !config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities())) {
               displayConfigChanged=true;
-          } 
+          }
           awtConfig = config;
         }
       }
@@ -275,7 +275,7 @@ public class AWTCanvas extends Canvas {
        * return the GC that was selected in the constructor (and might
        * cause an exception in Component.checkGD when adding to a
        * container, but in this case that would be the desired behavior).
-       * 
+       *
        */
       return chosen;
     } else if (gc == null) {
@@ -299,7 +299,7 @@ public class AWTCanvas extends Canvas {
                                                                       CapabilitiesImmutable capsRequested,
                                                                       CapabilitiesChooser chooser,
                                                                       GraphicsDevice device) {
-    final AbstractGraphicsScreen aScreen = null != device ? 
+    final AbstractGraphicsScreen aScreen = null != device ?
             AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT):
             AWTGraphicsScreen.createDefault();
     AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
index 02f4be0cd..bddb43b30 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
@@ -40,9 +40,9 @@ import jogamp.newt.Debug;
 
 public class AWTEDTUtil implements EDTUtil {
     public static final boolean DEBUG = Debug.debug("EDT");
-    
+
     private final Object edtLock = new Object(); // locking the EDT start/stop state
-    private final ThreadGroup threadGroup; 
+    private final ThreadGroup threadGroup;
     private final String name;
     private final Runnable dispatchMessages;
     private NEDT nedt = null;
@@ -66,7 +66,7 @@ public class AWTEDTUtil implements EDTUtil {
     final public void setPollPeriod(long ms) {
         pollPeriod = ms;
     }
-    
+
     @Override
     public final boolean start() throws IllegalStateException {
         synchronized(edtLock) {
@@ -107,12 +107,12 @@ public class AWTEDTUtil implements EDTUtil {
     public final boolean isCurrentThreadNEDT() {
         return nedt == Thread.currentThread();
     }
-    
+
     @Override
     public final boolean isCurrentThreadEDTorNEDT() {
-        return EventQueue.isDispatchThread() || nedt == Thread.currentThread();        
+        return EventQueue.isDispatchThread() || nedt == Thread.currentThread();
     }
-    
+
     @Override
     final public boolean isRunning() {
         return nedt.isRunning() ;
@@ -127,12 +127,12 @@ public class AWTEDTUtil implements EDTUtil {
     public final boolean invoke(boolean wait, Runnable task) {
         return invokeImpl(wait, task, false);
     }
-    
+
     private static Runnable nullTask = new Runnable() {
         @Override
-        public void run() { }        
+        public void run() { }
     };
-    
+
     private final boolean invokeImpl(boolean wait, Runnable task, boolean stop) {
         Throwable throwable = null;
         RunnableTask rTask = null;
@@ -145,7 +145,7 @@ public class AWTEDTUtil implements EDTUtil {
                     if(DEBUG) {
                         Thread.dumpStack();
                     }
-                    return false; 
+                    return false;
                 }
                 if( isCurrentThreadEDT() ) {
                     if(null != task) {
@@ -181,7 +181,7 @@ public class AWTEDTUtil implements EDTUtil {
                     if(null != task) {
                         rTask = new RunnableTask(task,
                                                  wait ? rTaskLock : null,
-                                                 true /* always catch and report Exceptions, don't disturb EDT */, 
+                                                 true /* always catch and report Exceptions, don't disturb EDT */,
                                                  wait ? null : System.err);
                         AWTEDTExecutor.singleton.invoke(false, rTask);
                     }
@@ -205,7 +205,7 @@ public class AWTEDTUtil implements EDTUtil {
             }
             return true;
         }
-    }    
+    }
 
     @Override
     final public boolean waitUntilIdle() {
@@ -241,7 +241,7 @@ public class AWTEDTUtil implements EDTUtil {
             }
         }
     }
-    
+
     class NEDT extends Thread {
         volatile boolean shouldStop = false;
         volatile boolean isRunning = false;
@@ -261,7 +261,7 @@ public class AWTEDTUtil implements EDTUtil {
             super.start();
         }
 
-        /** 
+        /**
          * Utilizing locking only on tasks and its execution,
          * not for event dispatching.
          */
@@ -302,7 +302,7 @@ public class AWTEDTUtil implements EDTUtil {
                 }
             } finally {
                 if(DEBUG) {
-                    System.err.println(getName()+": AWT-EDT run() END "+ getName()+", "+error); 
+                    System.err.println(getName()+": AWT-EDT run() END "+ getName()+", "+error);
                 }
                 synchronized(edtLock) {
                     isRunning = false;
@@ -317,7 +317,7 @@ public class AWTEDTUtil implements EDTUtil {
             } // finally
         } // run()
     } // EventDispatchThread
-    
+
 }
 
 
diff --git a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
index 30449f9bc..9e716d544 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.awt;
@@ -57,7 +57,7 @@ public class DisplayDriver extends DisplayImpl {
     protected EDTUtil createEDTUtil() {
         final EDTUtil def;
         if(NewtFactory.useEDT()) {
-            def = new AWTEDTUtil(Thread.currentThread().getThreadGroup(), "AWTDisplay-"+getFQName(), dispatchMessagesRunnable);            
+            def = new AWTEDTUtil(Thread.currentThread().getThreadGroup(), "AWTDisplay-"+getFQName(), dispatchMessagesRunnable);
             if(DEBUG) {
                 System.err.println("Display.createNative("+getFQName()+") Create EDTUtil: "+def.getClass().getName());
             }
@@ -67,7 +67,7 @@ public class DisplayDriver extends DisplayImpl {
         return def;
     }
 
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { 
+    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
index 126143e1e..a2430e2bb 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,7 +28,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.awt;
@@ -66,10 +66,10 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     protected void closeNativeImpl() { }
-    
+
     protected int validateScreenIndex(int idx) {
-        return idx; // pass through ... 
-    }    
+        return idx; // pass through ...
+    }
 
     private static MonitorMode getModeProps(Cache cache, DisplayMode mode) {
         int rate = mode.getRefreshRate();
@@ -90,16 +90,16 @@ public class ScreenDriver extends ScreenImpl {
         props[i++] = 0; // flags
         props[i++] = 0; // mode_idx
         props[i++] = 0; // rotation
-        return MonitorModeProps.streamInMonitorMode(null, cache, props, 0);        
+        return MonitorModeProps.streamInMonitorMode(null, cache, props, 0);
     }
-    
+
     @Override
     protected void collectNativeMonitorModesAndDevicesImpl(Cache cache) {
         final GraphicsDevice awtGD = ((AWTGraphicsDevice)getDisplay().getGraphicsDevice()).getGraphicsDevice();
         final DisplayMode[] awtModes = awtGD.getDisplayModes();
         for(int i=0; i<awtModes.length; i++) {
             getModeProps(cache, awtModes[i]);
-        }        
+        }
         final MonitorMode currentMode = getModeProps(cache, awtGD.getDisplayMode());
 
         int[] props = new int[MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES - 1 - MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES];
@@ -116,7 +116,7 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     @Override
-    protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {        
+    protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
         return null;
     }
 
@@ -124,5 +124,5 @@ public class ScreenDriver extends ScreenImpl {
     protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode) {
         return false;
     }
-    
+
 }
diff --git a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
index 77daa556f..db71695b7 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.awt;
@@ -109,33 +109,33 @@ public class WindowDriver extends WindowImpl {
         } else {
             owningFrame=false;
             defineSize(awtContainer.getWidth(), awtContainer.getHeight());
-            definePosition(awtContainer.getX(), awtContainer.getY());            
+            definePosition(awtContainer.getX(), awtContainer.getY());
         }
         if(null!=awtFrame) {
             awtFrame.setTitle(getTitle());
         }
         awtContainer.setLayout(new BorderLayout());
-        
+
         if( null == awtCanvas ) {
             awtCanvas = new AWTCanvas(capsRequested, WindowDriver.this.capabilitiesChooser);
 
             // canvas.addComponentListener(listener);
             awtContainer.add(awtCanvas, BorderLayout.CENTER);
-        
+
             // via EDT ..
             new AWTMouseAdapter(this).addTo(awtCanvas); // fwd all AWT Mouse events to here
             new AWTKeyAdapter(this).addTo(awtCanvas); // fwd all AWT Key events to here
-        
+
             // direct w/o EDT
             new AWTWindowAdapter(new LocalWindowListener(), this).addTo(awtCanvas); // fwd all AWT Window events to here
         }
 
         reconfigureWindowImpl(getX(), getY(), getWidth(), getHeight(), getReconfigureFlags(FLAG_CHANGE_VISIBILITY | FLAG_CHANGE_DECORATION, true));
         // throws exception if failed ..
-        
+
         final NativeWindow nw = awtCanvas.getNativeWindow();
         if( null != nw ) {
-            setGraphicsConfiguration( awtCanvas.getAWTGraphicsConfiguration() );            
+            setGraphicsConfiguration( awtCanvas.getAWTGraphicsConfiguration() );
             setWindowHandle( nw.getWindowHandle() );
         }
     }
@@ -153,7 +153,7 @@ public class WindowDriver extends WindowImpl {
             owningFrame=false;
         }
         awtCanvas = null;
-        awtFrame = null;            
+        awtFrame = null;
         awtContainer = null;
     }
 
@@ -166,11 +166,11 @@ public class WindowDriver extends WindowImpl {
                 throw new NativeWindowException("Error Device change null GraphicsConfiguration: "+this);
             }
             setGraphicsConfiguration(cfg);
-            
+
             // propagate new info ..
             ((ScreenDriver)getScreen()).setAWTGraphicsScreen((AWTGraphicsScreen)cfg.getScreen());
             ((DisplayDriver)getScreen().getDisplay()).setAWTGraphicsDevice((AWTGraphicsDevice)cfg.getScreen().getDevice());
-    
+
             ((ScreenDriver)getScreen()).updateVirtualScreenOriginAndSize();
         }
         return res;
@@ -213,7 +213,7 @@ public class WindowDriver extends WindowImpl {
         awtCanvas.invalidate();
         awtContainer.validate();
     }
-    
+
     protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWTWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
@@ -228,7 +228,7 @@ public class WindowDriver extends WindowImpl {
                 }
             }
         }
-        
+
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             if( 0 != ( FLAG_IS_VISIBLE & flags) ) {
                 setCanvasSizeImpl(width, height);
@@ -244,15 +244,15 @@ public class WindowDriver extends WindowImpl {
             }
         }
         defineSize(width, height); // we are on AWT-EDT .. change values immediately
-        
+
         if( awtContainer.getX() != x || awtContainer.getY() != y ) {
             awtContainer.setLocation(x, y);
         }
-        
+
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             if( 0 != ( FLAG_IS_VISIBLE & flags ) ) {
                 if( !hasDeviceChanged() ) {
-                    // oops ??                   
+                    // oops ??
                     final AWTGraphicsConfiguration cfg = awtCanvas.getAWTGraphicsConfiguration();
                     if(null == cfg) {
                         throw new NativeWindowException("Error: !hasDeviceChanged && null == GraphicsConfiguration: "+this);
@@ -262,7 +262,7 @@ public class WindowDriver extends WindowImpl {
             }
             visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
         }
-        
+
         return true;
     }
 
@@ -271,13 +271,13 @@ public class WindowDriver extends WindowImpl {
         ap.translate(x, y);
         return new Point((int)(ap.getX()+0.5),(int)(ap.getY()+0.5));
     }
-   
+
     @Override
     public NativeSurface getWrappedSurface() {
         return ( null != awtCanvas ) ? awtCanvas.getNativeWindow() : null;
     }
 
-    class LocalWindowListener implements com.jogamp.newt.event.WindowListener { 
+    class LocalWindowListener implements com.jogamp.newt.event.WindowListener {
         @Override
         public void windowMoved(com.jogamp.newt.event.WindowEvent e) {
             if(null!=awtContainer) {
@@ -304,11 +304,11 @@ public class WindowDriver extends WindowImpl {
         }
         @Override
         public void windowGainedFocus(WindowEvent e) {
-            WindowDriver.this.focusChanged(false, true);            
+            WindowDriver.this.focusChanged(false, true);
         }
         @Override
         public void windowLostFocus(WindowEvent e) {
-            WindowDriver.this.focusChanged(false, false);            
+            WindowDriver.this.focusChanged(false, false);
         }
         @Override
         public void windowRepaint(WindowUpdateEvent e) {
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
index 112be2b04..1b73cb381 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.bcm.egl;
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
index abe2908b0..269574adc 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.bcm.egl;
@@ -60,9 +60,9 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     protected void closeNativeImpl() { }
 
     protected int validateScreenIndex(int idx) {
-        return 0; // only one screen available 
+        return 0; // only one screen available
     }
-     
+
     @Override
     protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
         int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
@@ -99,11 +99,11 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
         return false;
     }
-    
+
     protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
         vOriginSize.set(0, 0, fixedWidth, fixedHeight); // FIXME
     }
-    
+
     //----------------------------------------------------------------------
     // Internals only
     //
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
index 49d3d98ba..bed0520ff 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.bcm.egl;
@@ -56,7 +56,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         if(0!=getParentWindowHandle()) {
             throw new RuntimeException("Window parenting not supported (yet)");
         }
-        // query a good configuration, however chose the final one by the native queried egl-cfg-id  
+        // query a good configuration, however chose the final one by the native queried egl-cfg-id
         // after creation at {@link #windowCreated(int, int, int)}.
         final AbstractGraphicsConfiguration cfg = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice(), capsRequested).chooseGraphicsConfiguration(
                 capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen(), VisualIDHolder.VID_UNDEFINED);
@@ -89,8 +89,8 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         }
     }
 
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { 
-        if(0!=getWindowHandle()) {            
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+        if(0!=getWindowHandle()) {
             if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) {
                 if( 0 != ( FLAG_IS_FULLSCREEN & flags) ) {
                     // n/a in BroadcomEGL
@@ -110,7 +110,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         if(x>=0 || y>=0) {
             System.err.println("BCEGL Window.setPositionImpl n/a in BroadcomEGL");
         }
-        
+
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
         }
@@ -122,7 +122,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     }
 
     protected void updateInsetsImpl(Insets insets) {
-        // nop ..        
+        // nop ..
     }
 
     @Override
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
index 4872a9071..52c92a5da 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -72,7 +72,7 @@ public class DisplayDriver extends DisplayImpl {
         DispatchMessages();
     }
 
-    protected static native boolean initIDs();    
+    protected static native boolean initIDs();
     private native void DispatchMessages();
 }
 
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
index be99052d7..5a1917419 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -53,9 +53,9 @@ public class ScreenDriver extends ScreenImpl {
     protected void closeNativeImpl() { }
 
     protected int validateScreenIndex(int idx) {
-        return 0; // only one screen available 
-    }       
-    
+        return 0; // only one screen available
+    }
+
     @Override
     protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
         int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
@@ -92,20 +92,20 @@ public class ScreenDriver extends ScreenImpl {
     protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
         return false;
     }
-    
+
     @Override
     protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
         vOriginSize.set(0, 0, cachedWidth, cachedHeight);
     }
-    
+
     /** Called from {@link #initNative()}. */
     protected void setScreenSize(int width, int height) {
         cachedWidth = width;
         cachedHeight = height;
     }
-    
+
     private static int cachedWidth = 0;
-    private static int cachedHeight = 0;    
+    private static int cachedHeight = 0;
 
     protected static native boolean initIDs();
     protected native void initNative();
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
index e820439d0..560e49e96 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -65,7 +65,7 @@ public class WindowDriver extends WindowImpl {
         final EGLGraphicsDevice aDevice = (EGLGraphicsDevice) aScreen.getDevice();
         final EGLGraphicsDevice eglDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(aDevice.getNativeDisplayID(), aDevice.getConnection(), aDevice.getUnitID());
         final DefaultGraphicsScreen eglScreen = new DefaultGraphicsScreen(eglDevice, aScreen.getIndex());
-        
+
         final AbstractGraphicsConfiguration cfg = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice(), capsRequested).chooseGraphicsConfiguration(
                 capsRequested, capsRequested, capabilitiesChooser, eglScreen, VisualIDHolder.VID_UNDEFINED);
         if (null == cfg) {
@@ -89,24 +89,24 @@ public class WindowDriver extends WindowImpl {
         windowHandleClose = nativeWindowHandle;
         addWindowListener(LinuxMouseTracker.getSingleton());
         addWindowListener(LinuxEventDeviceTracker.getSingleton());
-        focusChanged(false, true);        
+        focusChanged(false, true);
     }
 
     protected void closeNativeImpl() {
         final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) getGraphicsConfiguration().getScreen().getDevice();
-        
+
         removeWindowListener(LinuxMouseTracker.getSingleton());
         removeWindowListener(LinuxEventDeviceTracker.getSingleton());
-        
+
         if(0!=windowHandleClose) {
             CloseWindow(windowHandleClose, windowUserData);
             windowUserData=0;
         }
-        
+
         eglDevice.close();
     }
 
-    protected void requestFocusImpl(boolean reparented) { 
+    protected void requestFocusImpl(boolean reparented) {
         focusChanged(false, true);
     }
 
@@ -115,7 +115,7 @@ public class WindowDriver extends WindowImpl {
             setVisible0(nativeWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
             visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
         }
-        
+
         if(0!=nativeWindowHandle) {
             if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) {
                 final boolean fs = 0 != ( FLAG_IS_FULLSCREEN & flags) ;
@@ -135,11 +135,11 @@ public class WindowDriver extends WindowImpl {
                 System.err.println("setPosition n/a in KD");
             }
         }
-        
+
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
         }
-        
+
         return true;
     }
 
@@ -148,9 +148,9 @@ public class WindowDriver extends WindowImpl {
     }
 
     protected void updateInsetsImpl(Insets insets) {
-        // nop ..        
+        // nop ..
     }
-        
+
     //----------------------------------------------------------------------
     // Internals only
     //
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
index ee93eb932..4cb566bc2 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.intel.gdl;
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
index 27b776562..b5202aaf9 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.intel.gdl;
@@ -62,9 +62,9 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     protected void closeNativeImpl() { }
 
     protected int validateScreenIndex(int idx) {
-        return 0; // only one screen available 
+        return 0; // only one screen available
     }
-        
+
     @Override
     protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
         int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
@@ -101,11 +101,11 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
         return false;
     }
-    
+
     protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
         vOriginSize.set(0, 0, cachedWidth, cachedHeight);
     }
-    
+
     //----------------------------------------------------------------------
     // Internals only
     //
@@ -118,7 +118,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         cachedWidth = width;
         cachedHeight = height;
     }
-    
+
     private static int cachedWidth = 0;
     private static int cachedHeight = 0;
 }
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
index 98335f192..80821d4da 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.intel.gdl;
@@ -108,7 +108,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
             }
             visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
         }
-        
+
         return true;
     }
 
@@ -126,9 +126,9 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     }
 
     protected void updateInsetsImpl(Insets insets) {
-        // nop ..        
+        // nop ..
     }
-    
+
     //----------------------------------------------------------------------
     // Internals only
     //
diff --git a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
index 3cd72e971..1b92ca586 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.kd;
diff --git a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
index f893275ca..17cc5dd2f 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.kd;
@@ -58,9 +58,9 @@ public class ScreenDriver extends ScreenImpl {
     protected void closeNativeImpl() { }
 
     protected int validateScreenIndex(int idx) {
-        return 0; // only one screen available 
-    }       
-    
+        return 0; // only one screen available
+    }
+
     @Override
     protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
         int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
@@ -97,16 +97,16 @@ public class ScreenDriver extends ScreenImpl {
     protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
         return false;
     }
-    
+
     protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
         vOriginSize.set(0, 0, cachedWidth, cachedHeight);
     }
-    
+
     protected void sizeChanged(int w, int h) {
         cachedWidth = w;
         cachedHeight = h;
     }
-    
+
     private static int cachedWidth = 0;
-    private static int cachedHeight = 0;    
+    private static int cachedHeight = 0;
 }
diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
index c733a3e94..d30d4f025 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.kd;
@@ -97,7 +97,7 @@ public class WindowDriver extends WindowImpl {
             setVisible0(eglWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
             visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
         }
-        
+
         if(0!=eglWindowHandle) {
             if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) {
                 final boolean fs = 0 != ( FLAG_IS_FULLSCREEN & flags) ;
@@ -117,11 +117,11 @@ public class WindowDriver extends WindowImpl {
                 System.err.println("setPosition n/a in KD");
             }
         }
-        
+
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
         }
-        
+
         return true;
     }
 
@@ -130,9 +130,9 @@ public class WindowDriver extends WindowImpl {
     }
 
     protected void updateInsetsImpl(Insets insets) {
-        // nop ..        
+        // nop ..
     }
-        
+
     //----------------------------------------------------------------------
     // Internals only
     //
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
index e68b91d82..b7c86a26d 100644
--- a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
+++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -126,7 +126,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
         try {
             while(true) {
                 Thread.sleep(1000);
-            } 
+            }
         } catch (InterruptedException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
@@ -186,7 +186,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
             /**
              * The Linux input event interface.
              * http://www.kernel.org/doc/Documentation/input/input.txt
-             * 
+             *
              * struct input_event {
              *  struct timeval time;
              *	unsigned short type;
@@ -262,7 +262,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
                         break;
                     case 1: // EV_KEY
                         keyCode = LinuxEVKey2NewtVKey(code); // The device independent code.
-                        keyChar = NewtVKey2Unicode(keyCode, modifiers); // The printable character w/ key modifiers.						
+                        keyChar = NewtVKey2Unicode(keyCode, modifiers); // The printable character w/ key modifiers.
                         if(Window.DEBUG_KEY_EVENT) {
                             System.out.println("[EV_KEY: [time "+timeSeconds+":"+timeSecondFraction+"] type "+type+" / code "+code+" = value "+value);
                         }
@@ -946,7 +946,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
             case 248: // mic mute
                 break; // FIXME
 
-            default: 
+            default:
             }
 
             if(Window.DEBUG_KEY_EVENT) {
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
index 0d6278bfb..1e314b7f4 100644
--- a/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
+++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -48,16 +48,16 @@ import com.jogamp.newt.event.WindowUpdateEvent;
  * within it's own polling thread.
  */
 public class LinuxMouseTracker implements WindowListener {
-    
+
     private static final LinuxMouseTracker lmt;
-    
+
     static {
         lmt = new LinuxMouseTracker();
         final Thread t = new Thread(lmt.mouseDevicePoller, "NEWT-LinuxMouseTracker");
         t.setDaemon(true);
         t.start();
     }
-    
+
     public static LinuxMouseTracker getSingleton() {
         return lmt;
     }
@@ -71,7 +71,7 @@ public class LinuxMouseTracker implements WindowListener {
     private short old_buttonDown = 0;
     private WindowImpl focusedWindow = null;
     private MouseDevicePoller mouseDevicePoller = new MouseDevicePoller();
-    
+
     @Override
     public void windowResized(WindowEvent e) { }
 
@@ -107,7 +107,7 @@ public class LinuxMouseTracker implements WindowListener {
 
     @Override
     public void windowRepaint(WindowUpdateEvent e) { }
-    
+
     class MouseDevicePoller implements Runnable {
         @Override
         public void run() {
@@ -150,17 +150,17 @@ public class LinuxMouseTracker implements WindowListener {
                 yo=(b[0]&128)>0;
                 xd=b[1];
                 yd=b[2];
-            
+
                 x+=xd;
                 y-=yd;
-                
+
                 if(x<0) {
                     x=0;
                 }
                 if(y<0) {
                     y=0;
                 }
-                
+
                 buttonDown = 0;
                 if(lb) {
                     buttonDown = MouseEvent.BUTTON1;
@@ -171,7 +171,7 @@ public class LinuxMouseTracker implements WindowListener {
                 if(rb) {
                     buttonDown = MouseEvent.BUTTON3;
                 }
-                
+
                 if(null != focusedWindow) {
                     if( x >= focusedWindow.getScreen().getWidth() ) {
                         x = focusedWindow.getScreen().getWidth() - 1;
@@ -179,31 +179,31 @@ public class LinuxMouseTracker implements WindowListener {
                     if( y >= focusedWindow.getScreen().getHeight() ) {
                         y = focusedWindow.getScreen().getHeight() - 1;
                     }
-                    int wx = x - focusedWindow.getX(), wy = y - focusedWindow.getY(); 
-                    
+                    int wx = x - focusedWindow.getX(), wy = y - focusedWindow.getY();
+
                     if(old_x != x || old_y != y) {
                         // mouse moved
-                        focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_MOVED, 0, wx, wy, (short)0, 0 ); 
+                        focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_MOVED, 0, wx, wy, (short)0, 0 );
                     }
-                    
+
                     if(old_buttonDown != buttonDown) {
                         // press/release
                         if( 0 != buttonDown ) {
-                            focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_PRESSED, 0, wx, wy, buttonDown, 0 ); 
+                            focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_PRESSED, 0, wx, wy, buttonDown, 0 );
                         } else {
-                            focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_RELEASED, 0, wx, wy, old_buttonDown, 0 ); 
+                            focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_RELEASED, 0, wx, wy, old_buttonDown, 0 );
                         }
-                    }                
+                    }
                 } else {
                     if(Window.DEBUG_MOUSE_EVENT) {
                         System.out.println(x+"/"+y+", hs="+hs+",vs="+vs+",lb="+lb+",rb="+rb+",mb="+mb+",xo="+xo+",yo="+yo+"xd="+xd+",yd="+yd);
                     }
                 }
-                
+
                 old_x = x;
                 old_y = y;
                 old_buttonDown = buttonDown;
-                
+
             }
             if(null != fis) {
                 try {
@@ -214,5 +214,5 @@ public class LinuxMouseTracker implements WindowListener {
                 }
             }
         }
-    }    
+    }
 }
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
index a99bc4f23..2dbdfdce7 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2012 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.macosx;
@@ -60,19 +60,19 @@ public class DisplayDriver extends DisplayImpl {
     public static void initSingleton() {
         // just exist to ensure static init has been run
     }
-    
+
     public DisplayDriver() {
     }
 
     protected void dispatchMessagesNative() {
         // nop
     }
-    
+
     protected void createNativeImpl() {
         aDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
     }
 
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { 
+    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
index baa94facd..a89150d7c 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -30,7 +30,7 @@ package jogamp.newt.driver.macosx;
 import com.jogamp.newt.event.KeyEvent;
 
 public class MacKeyUtil {
-      
+
     //
     // KeyCodes (Layout Dependent)
     //
@@ -64,17 +64,17 @@ public class MacKeyUtil {
     private static final short kVK_ANSI_8                    = 0x1C;
     private static final short kVK_ANSI_0                    = 0x1D;
     private static final short kVK_ANSI_RightBracket         = 0x1E;
-    private static final short kVK_ANSI_O                    = 0x1F; 
+    private static final short kVK_ANSI_O                    = 0x1F;
     private static final short kVK_ANSI_U                    = 0x20;
     private static final short kVK_ANSI_LeftBracket          = 0x21;
     private static final short kVK_ANSI_I                    = 0x22;
     private static final short kVK_ANSI_P                    = 0x23;
     private static final short kVK_ANSI_L                    = 0x25;
     private static final short kVK_ANSI_J                    = 0x26;
-    private static final short kVK_ANSI_Quote                = 0x27; 
+    private static final short kVK_ANSI_Quote                = 0x27;
     private static final short kVK_ANSI_K                    = 0x28;
     private static final short kVK_ANSI_Semicolon            = 0x29;
-    private static final short kVK_ANSI_Backslash            = 0x2A; 
+    private static final short kVK_ANSI_Backslash            = 0x2A;
     private static final short kVK_ANSI_Comma                = 0x2B;
     private static final short kVK_ANSI_Slash                = 0x2C;
     private static final short kVK_ANSI_N                    = 0x2D;
@@ -99,7 +99,7 @@ public class MacKeyUtil {
     private static final short kVK_ANSI_Keypad7              = 0x59;
     private static final short kVK_ANSI_Keypad8              = 0x5B;
     private static final short kVK_ANSI_Keypad9              = 0x5C;
-    
+
     //
     // KeyCodes (Layout Independent)
     //
@@ -150,7 +150,7 @@ public class MacKeyUtil {
     private static final short kVK_RightArrow                = 0x7C;
     private static final short kVK_DownArrow                 = 0x7D;
     private static final short kVK_UpArrow                   = 0x7E;
-  
+
     //
     // Key constants handled differently on Mac OS X than other platforms
     //
@@ -230,8 +230,8 @@ public class MacKeyUtil {
     private static final char NSHelpFunctionKey           = 0xF746;
     private static final char NSModeSwitchFunctionKey     = 0xF747;
     */
-    
-    static short validateKeyCode(short keyCode, char keyChar) {        
+
+    static short validateKeyCode(short keyCode, char keyChar) {
         // OS X Virtual Keycodes
         switch(keyCode) {
             //
@@ -267,17 +267,17 @@ public class MacKeyUtil {
             case kVK_ANSI_8:               return KeyEvent.VK_8;
             case kVK_ANSI_0:               return KeyEvent.VK_0;
             case kVK_ANSI_RightBracket:    return KeyEvent.VK_CLOSE_BRACKET;
-            case kVK_ANSI_O:               return KeyEvent.VK_O; 
+            case kVK_ANSI_O:               return KeyEvent.VK_O;
             case kVK_ANSI_U:               return KeyEvent.VK_U;
             case kVK_ANSI_LeftBracket:     return KeyEvent.VK_OPEN_BRACKET;
             case kVK_ANSI_I:               return KeyEvent.VK_I;
             case kVK_ANSI_P:               return KeyEvent.VK_P;
             case kVK_ANSI_L:               return KeyEvent.VK_L;
             case kVK_ANSI_J:               return KeyEvent.VK_J;
-            case kVK_ANSI_Quote:           return KeyEvent.VK_QUOTE; 
+            case kVK_ANSI_Quote:           return KeyEvent.VK_QUOTE;
             case kVK_ANSI_K:               return KeyEvent.VK_K;
             case kVK_ANSI_Semicolon:       return KeyEvent.VK_SEMICOLON;
-            case kVK_ANSI_Backslash:       return KeyEvent.VK_BACK_SLASH; 
+            case kVK_ANSI_Backslash:       return KeyEvent.VK_BACK_SLASH;
             case kVK_ANSI_Comma:           return KeyEvent.VK_COMMA;
             case kVK_ANSI_Slash:           return KeyEvent.VK_SLASH;
             case kVK_ANSI_N:               return KeyEvent.VK_N;
@@ -302,7 +302,7 @@ public class MacKeyUtil {
             case kVK_ANSI_Keypad7:         return KeyEvent.VK_7;
             case kVK_ANSI_Keypad8:         return KeyEvent.VK_8;
             case kVK_ANSI_Keypad9:         return KeyEvent.VK_9;
-            
+
             //
             // KeyCodes (Layout Independent)
             //
@@ -321,7 +321,7 @@ public class MacKeyUtil {
             case kVK_RightControl:         return KeyEvent.VK_CONTROL;
             // case kVK_Function:             return KeyEvent.VK_F;
             case kVK_F17:                  return KeyEvent.VK_F17;
-            // case kVK_VolumeUp:        
+            // case kVK_VolumeUp:
             // case kVK_VolumeDown:
             // case kVK_Mute:
             case kVK_F18:                  return KeyEvent.VK_F18;
@@ -354,7 +354,7 @@ public class MacKeyUtil {
             case kVK_DownArrow:            return KeyEvent.VK_DOWN;
             case kVK_UpArrow:              return KeyEvent.VK_UP;
         }
-        
+
         switch (keyChar) {
             case NSUpArrowFunctionKey:     return KeyEvent.VK_UP;
             case NSDownArrowFunctionKey:   return KeyEvent.VK_DOWN;
@@ -422,5 +422,5 @@ public class MacKeyUtil {
         }
 
         return (short) keyChar; // let's hope for the best (compatibility of keyChar/keyCode's)
-    }   
+    }
 }
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
index a3bb26731..5d3b7287b 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2011 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.macosx;
@@ -44,7 +44,7 @@ import com.jogamp.newt.MonitorDevice;
 import com.jogamp.newt.MonitorMode;
 
 public class ScreenDriver extends ScreenImpl {
-    
+
     static {
         DisplayDriver.initSingleton();
     }
@@ -68,7 +68,7 @@ public class ScreenDriver extends ScreenImpl {
         }
         return res;
     }
-    
+
     @Override
     protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
         int crtIdx = 0;
@@ -85,16 +85,16 @@ public class ScreenDriver extends ScreenImpl {
                 final MonitorMode currentMode = getMonitorModeImpl(cache, crtIdx, -1);
                 if ( null == currentMode ) {
                     throw new InternalError("Could not gather current mode of device "+crtIdx+", but gathered "+modeIdx+" modes");
-                }                
+                }
                 final int[] monitorProps = getMonitorProps0(crtIdx);
                 if ( null == monitorProps ) {
                     throw new InternalError("Could not gather device "+crtIdx+", but gathered "+modeIdx+" modes");
-                }                
+                }
                 // merge monitor-props + supported modes
                 MonitorModeProps.streamInMonitorDevice(null, cache, this, supportedModes, currentMode, monitorProps, 0);
-                
+
                 // next monitor, 1st mode
-                supportedModes= new ArrayHashSet<MonitorMode>();                
+                supportedModes= new ArrayHashSet<MonitorMode>();
                 crtIdx++;
                 modeIdx=0;
             } else {
@@ -108,16 +108,16 @@ public class ScreenDriver extends ScreenImpl {
     protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
         return getMonitorModeImpl(null, monitor.getId(), -1);
     }
-    
+
     @Override
     protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode)  {
         return setMonitorMode0(monitor.getId(), mode.getId(), mode.getRotation());
     }
-    
+
     protected int validateScreenIndex(int idx) {
-        return 0; // big-desktop w/ multiple monitor attached, only one screen available 
+        return 0; // big-desktop w/ multiple monitor attached, only one screen available
     }
-        
+
     private native int[] getMonitorProps0(int crt_idx);
     private native int[] getMonitorMode0(int crt_index, int mode_idx);
     private native boolean setMonitorMode0(int crt_index, int nativeId, int rot);
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
index 08638d868..f36d32772 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.macosx;
@@ -53,14 +53,14 @@ import com.jogamp.newt.event.InputEvent;
 import com.jogamp.newt.event.KeyEvent;
 
 public class WindowDriver extends WindowImpl implements MutableSurface, DriverClearFocus, DriverUpdatePosition {
-    
+
     static {
         DisplayDriver.initSingleton();
     }
 
     public WindowDriver() {
     }
-    
+
     @Override
     protected void createNativeImpl() {
         final AbstractGraphicsConfiguration cfg = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice(), capsRequested).chooseGraphicsConfiguration(
@@ -69,7 +69,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
         }
         setGraphicsConfiguration(cfg);
-        reconfigureWindowImpl(getX(), getY(), getWidth(), getHeight(), getReconfigureFlags(FLAG_CHANGE_VISIBILITY, true));        
+        reconfigureWindowImpl(getX(), getY(), getWidth(), getHeight(), getReconfigureFlags(FLAG_CHANGE_VISIBILITY, true));
         if (0 == getWindowHandle()) {
             throw new NativeWindowException("Error creating window");
         }
@@ -79,7 +79,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     protected void closeNativeImpl() {
         try {
             if(DEBUG_IMPLEMENTATION) { System.err.println("MacWindow.CloseAction "+Thread.currentThread().getName()); }
-            final long handle = getWindowHandle(); 
+            final long handle = getWindowHandle();
             visibleChanged(true, false);
             setWindowHandle(0);
             surfaceHandle = 0;
@@ -92,16 +92,16 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                    } } );
             }
         } catch (Throwable t) {
-            if(DEBUG_IMPLEMENTATION) { 
+            if(DEBUG_IMPLEMENTATION) {
                 Exception e = new Exception("Warning: closeNative failed - "+Thread.currentThread().getName(), t);
                 e.printStackTrace();
             }
         }
     }
-    
+
     @Override
     protected int lockSurfaceImpl() {
-        /** 
+        /**
          * if( isOffscreenInstance ) {
          *    return LOCK_SUCCESS;
          * }
@@ -116,7 +116,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
 
     @Override
     protected void unlockSurfaceImpl() {
-        /** 
+        /**
          * if( isOffscreenInstance ) {
          *    return;
          * }
@@ -129,7 +129,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             }
         }
     }
-    
+
     @Override
     public final long getSurfaceHandle() {
         return 0 != sscSurfaceHandle ? sscSurfaceHandle : surfaceHandle;
@@ -147,14 +147,14 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                     public void run() {
                         orderOut0( 0 != getParentWindowHandle() ? getParentWindowHandle() : getWindowHandle() );
                     } } );
-            } /** this is done by recreation! 
+            } /** this is done by recreation!
               else if (isVisible()){
                 OSXUtil.RunOnMainThread(false, new Runnable() {
                     public void run() {
                         orderFront0( 0!=getParentWindowHandle() ? getParentWindowHandle() : getWindowHandle() );
                     } } );
             } */
-        }        
+        }
     }
 
     @Override
@@ -179,7 +179,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             focusChanged(false, true);
         }
     }
-        
+
     @Override
     public final void clearFocus() {
         if(DEBUG_IMPLEMENTATION) {
@@ -194,9 +194,9 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             focusChanged(false, false);
         }
     }
-    
+
     private boolean useParent(NativeWindow parent) { return null != parent && 0 != parent.getWindowHandle(); }
-    
+
     @Override
     public void updatePosition(int x, int y) {
         final long handle = getWindowHandle();
@@ -215,8 +215,8 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             // no native event (fullscreen, some reparenting)
             positionChanged(true, x, y);
         }
-    }    
-    
+    }
+
     @Override
     protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
         final long handle = getWindowHandle();
@@ -237,7 +237,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
         }
         super.sizeChanged(defer, newWidth, newHeight, force);
     }
-   
+
     @Override
     protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, int flags) {
         final boolean _isOffscreenInstance = isOffscreenInstance(this, this.getParent());
@@ -250,11 +250,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             final boolean useParent = useParent(parent);
             if( useParent ) {
                 pClientLevelOnSreen = getLocationOnScreenImpl(x, y, parent, useParent);
-            } else {            
+            } else {
                 pClientLevelOnSreen = new Point(x, y);
             }
         }
-        
+
         if(DEBUG_IMPLEMENTATION) {
             final AbstractGraphicsConfiguration cWinCfg = this.getGraphicsConfiguration();
             final NativeWindow pWin = getParent();
@@ -269,9 +269,9 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                                "\n\t, "+getReconfigureFlagsAsString(null, flags));
             // Thread.dumpStack();
         }
-        
+
         final boolean setVisible = 0 != ( FLAG_IS_VISIBLE & flags);
-        
+
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && !setVisible ) {
             if ( !isOffscreenInstance ) {
                 OSXUtil.RunOnMainThread(false, new Runnable() {
@@ -290,11 +290,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             if(isOffscreenInstance) {
                 createWindow(true, 0 != getWindowHandle(), pClientLevelOnSreen, 64, 64, false, setVisible, false);
             } else {
-                createWindow(false, 0 != getWindowHandle(), pClientLevelOnSreen, width, height, 
+                createWindow(false, 0 != getWindowHandle(), pClientLevelOnSreen, width, height,
                                     0 != ( FLAG_IS_FULLSCREEN & flags), setVisible, 0 != ( FLAG_IS_ALWAYSONTOP & flags));
             }
         } else {
-            if( width>0 && height>0 ) {        
+            if( width>0 && height>0 ) {
                 if( !isOffscreenInstance ) {
                     OSXUtil.RunOnMainThread(false, new Runnable() {
                         public void run() {
@@ -306,7 +306,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                 sizeChanged(true, width, height, false);
             }
             if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && setVisible ) {
-                if( !isOffscreenInstance ) {                
+                if( !isOffscreenInstance ) {
                     OSXUtil.RunOnMainThread(false, new Runnable() {
                         public void run() {
                             orderFront0(getWindowHandle());
@@ -321,7 +321,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             }
         }
         if(DEBUG_IMPLEMENTATION) {
-            System.err.println("MacWindow reconfig.X: clientPos "+pClientLevelOnSreen+", "+width+"x"+height+" -> clientPos "+getLocationOnScreenImpl(0, 0)+", insets: "+getInsets());            
+            System.err.println("MacWindow reconfig.X: clientPos "+pClientLevelOnSreen+", "+width+"x"+height+" -> clientPos "+getLocationOnScreenImpl(0, 0)+", insets: "+getInsets());
         }
         return true;
     }
@@ -332,28 +332,28 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
         final boolean useParent = useParent(parent);
         return getLocationOnScreenImpl(x, y, parent, useParent);
     }
-        
+
     private Point getLocationOnScreenImpl(final int x, final int y, final NativeWindow parent, final boolean useParent) {
         if( !useParent && !isOffscreenInstance && 0 != surfaceHandle) {
             return OSXUtil.GetLocationOnScreen(surfaceHandle, true, x, y);
         }
-        
+
         final Point p = new Point(x, y);
         if( useParent ) {
             p.translate( parent.getLocationOnScreen(null) );
         }
         return p;
     }
-        
+
     @Override
     protected void updateInsetsImpl(Insets insets) {
         // nop - using event driven insetsChange(..)
     }
-        
+
     /** Callback for native screen position change event of the client area. */
-    protected void screenPositionChanged(boolean defer, int newX, int newY) {        
+    protected void screenPositionChanged(boolean defer, int newX, int newY) {
         // passed coordinates are in screen position of the client area
-        if(getWindowHandle()!=0) {            
+        if(getWindowHandle()!=0) {
             final NativeWindow parent = getParent();
             if( null == parent || isOffscreenInstance ) {
                 if(DEBUG_IMPLEMENTATION) {
@@ -362,7 +362,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                 positionChanged(defer, newX, newY);
             } else {
                 // screen position -> rel child window position
-                Point absPos = new Point(newX, newY);            
+                Point absPos = new Point(newX, newY);
                 Point parentOnScreen = parent.getLocationOnScreen(null);
                 absPos.translate( parentOnScreen.scale(-1, -1) );
                 if(DEBUG_IMPLEMENTATION) {
@@ -374,10 +374,10 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             System.err.println("MacWindow.positionChanged.2 (Screen Pos - IGN): ("+getThreadName()+"): (defer: "+defer+") "+getX()+"/"+getY()+" -> "+newX+"/"+newY);
         }
     }
-    
+
     @Override
     protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
-        if( !isOffscreenInstance ) {                
+        if( !isOffscreenInstance ) {
             return setPointerVisible0(getWindowHandle(), hasFocus(), pointerVisible);
         } // else may need offscreen solution ? FIXME
         return false;
@@ -385,29 +385,29 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
 
     @Override
     protected boolean confinePointerImpl(final boolean confine) {
-        if( !isOffscreenInstance ) {                
+        if( !isOffscreenInstance ) {
             return confinePointer0(getWindowHandle(), confine);
         } // else may need offscreen solution ? FIXME
         return false;
     }
-    
+
     @Override
     protected void warpPointerImpl(final int x, final int y) {
-        if( !isOffscreenInstance ) {                
+        if( !isOffscreenInstance ) {
             warpPointer0(getWindowHandle(), x, y);
         } // else may need offscreen solution ? FIXME
     }
-    
+
     @Override
     public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
         throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
     }
-    
+
     @Override
     public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short _keyCode, short _keySym, char keyChar) {
-        throw new InternalError("XXX: Adapt Java Code to Native Code Changes");    
+        throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
     }
-    
+
     protected final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short _keyCode, char keyChar, char keySymChar) {
         // Note that we send the key char for the key code on this
         // platform -- we do not get any useful key codes out of the system
@@ -427,7 +427,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                                ", was: pressed "+isKeyPressed(keyCode)+", isModifierKeyCode "+isModifierKeyCode+
                                ", nativeValid "+isNativeValid()+", isOffscreen "+isOffscreenInstance);
         } */
-            
+
         // OSX delivery order is PRESSED (t0), RELEASED (t1) and TYPED (t2) -> NEWT order: PRESSED (t0) and RELEASED (t1)
         // Auto-Repeat: OSX delivers only PRESSED, inject auto-repeat RELEASE key _before_ PRESSED
         switch(eventType) {
@@ -451,15 +451,15 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
 
     //----------------------------------------------------------------------
     // Internals only
-    //    
-    
-    private void createWindow(final boolean offscreenInstance, final boolean recreate, 
-                              final PointImmutable pS, final int width, final int height, 
+    //
+
+    private void createWindow(final boolean offscreenInstance, final boolean recreate,
+                              final PointImmutable pS, final int width, final int height,
                               final boolean fullscreen, final boolean visible, final boolean alwaysOnTop) {
 
         final long parentWinHandle = getParentWindowHandle();
         final long preWinHandle = getWindowHandle();
-        
+
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("MacWindow.createWindow on thread "+Thread.currentThread().getName()+
                                ": offscreen "+offscreenInstance+", recreate "+recreate+
@@ -474,7 +474,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                 setWindowHandle(0);
                 if( 0 == surfaceHandle ) {
                     throw new NativeWindowException("Internal Error - create w/ window, but no Newt NSView");
-                }                
+                }
                 OSXUtil.RunOnMainThread(false, new Runnable() {
                     public void run() {
                         changeContentView0(parentWinHandle, preWinHandle, 0);
@@ -483,14 +483,14 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             } else {
                 if( 0 != surfaceHandle ) {
                     throw new NativeWindowException("Internal Error - create w/o window, but has Newt NSView");
-                }                
+                }
                 surfaceHandle = createView0(pS.getX(), pS.getY(), width, height, fullscreen);
                 if( 0 == surfaceHandle ) {
                     throw new NativeWindowException("Could not create native view "+Thread.currentThread().getName()+" "+this);
                 }
             }
-            
-            final long newWin = createWindow0( pS.getX(), pS.getY(), width, height, fullscreen, 
+
+            final long newWin = createWindow0( pS.getX(), pS.getY(), width, height, fullscreen,
                                                ( isUndecorated() || offscreenInstance ) ? NSBorderlessWindowMask :
                                                NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask,
                                                NSBackingStoreBuffered, surfaceHandle);
@@ -498,9 +498,9 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                 throw new NativeWindowException("Could not create native window "+Thread.currentThread().getName()+" "+this);
             }
             setWindowHandle( newWin );
-            
+
             final boolean isOpaque = getGraphicsConfiguration().getChosenCapabilities().isBackgroundOpaque() && !offscreenInstance;
-            // Blocking initialization on main-thread!                
+            // Blocking initialization on main-thread!
             OSXUtil.RunOnMainThread(true, new Runnable() {
                 public void run() {
                     initWindow0( parentWinHandle, newWin, pS.getX(), pS.getY(), width, height,
@@ -517,7 +517,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             ie.printStackTrace();
         }
     }
-    
+
     protected static native boolean initIDs0();
     private native long createView0(int x, int y, int w, int h, boolean fullscreen);
     private native long createWindow0(int x, int y, int w, int h, boolean fullscreen, int windowStyle, int backingStoreType, long view);
@@ -543,7 +543,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     private native void changeContentView0(long parentWindowOrView, long window, long view);
     /** Must be called on Main-Thread */
     private native void setWindowClientTopLeftPointAndSize0(long window, int x, int y, int w, int h, boolean display);
-    /** Must be called on Main-Thread */    
+    /** Must be called on Main-Thread */
     private native void setWindowClientTopLeftPoint0(long window, int x, int y, boolean display);
     /** Must be called on Main-Thread */
     private native void setAlwaysOnTop0(long window, boolean atop);
@@ -551,7 +551,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     private static native boolean setPointerVisible0(long windowHandle, boolean hasFocus, boolean visible);
     private static native boolean confinePointer0(long windowHandle, boolean confine);
     private static native void warpPointer0(long windowHandle, int x, int y);
-    
+
     // Window styles
     private static final int NSBorderlessWindowMask     = 0;
     private static final int NSTitledWindowMask         = 1 << 0;
@@ -567,5 +567,5 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     private volatile long surfaceHandle = 0;
     private long sscSurfaceHandle = 0;
     private boolean isOffscreenInstance = false;
-    
+
 }
diff --git a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
index 595d5e952..d3c7416cc 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.windows;
@@ -52,10 +52,10 @@ public class DisplayDriver extends DisplayImpl {
         NEWTJNILibLoader.loadNEWT();
 
         sharedClassFactory = new RegisteredClassFactory(newtClassBaseName, WindowDriver.getNewtWndProc0());
-        
+
         if (!WindowDriver.initIDs0(RegisteredClassFactory.getHInstance())) {
             throw new NativeWindowException("Failed to initialize WindowsWindow jmethodIDs");
-        }        
+        }
     }
 
     public static void initSingleton() {
@@ -76,7 +76,7 @@ public class DisplayDriver extends DisplayImpl {
         aDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
     }
 
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { 
+    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         sharedClassFactory.releaseSharedClass();
         aDevice.close();
     }
diff --git a/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
index 621091320..e789b995f 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 package jogamp.newt.driver.windows;
 
@@ -60,7 +60,7 @@ public class ScreenDriver extends ScreenImpl {
     protected void createNativeImpl() {
         aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
     }
-    
+
     @Override
     protected void closeNativeImpl() {
     }
@@ -71,7 +71,7 @@ public class ScreenDriver extends ScreenImpl {
     private final String getActiveMonitorName(String adapterName, int monitor_idx) {
         return getActiveMonitorName0(adapterName, monitor_idx);
     }
-    
+
     private final MonitorMode getMonitorModeImpl(MonitorModeProps.Cache cache, String adapterName, int crtModeIdx) {
         if( null == adapterName ) {
             return null;
@@ -107,7 +107,7 @@ public class ScreenDriver extends ScreenImpl {
                     final int[] monitorProps = getMonitorDevice0(adapterName, crtIdx);
                     // merge monitor-props + supported modes
                     MonitorModeProps.streamInMonitorDevice(null, cache, this, supportedModes, currentMode, monitorProps, 0);
-                    
+
                     // next monitor, 1st mode
                     supportedModes= new ArrayHashSet<MonitorMode>();
                 }
@@ -116,7 +116,7 @@ public class ScreenDriver extends ScreenImpl {
             adapterName = getAdapterName(crtIdx);
         }
     }
-    
+
     @Override
     protected Rectangle getNativeMonitorDeviceViewportImpl(MonitorDevice monitor) {
         final String adapterName = getAdapterName(monitor.getId());
@@ -135,7 +135,7 @@ public class ScreenDriver extends ScreenImpl {
     protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
         return getMonitorModeImpl(null, getAdapterName(monitor.getId()), -1);
     }
-    
+
     @Override
     protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode)  {
         return setMonitorMode0(monitor.getId(),
@@ -150,14 +150,14 @@ public class ScreenDriver extends ScreenImpl {
 
     @Override
     protected int validateScreenIndex(int idx) {
-        return 0; // big-desktop w/ multiple monitor attached, only one screen available 
+        return 0; // big-desktop w/ multiple monitor attached, only one screen available
     }
-        
+
     @Override
     protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
         vOriginSize.set(getVirtualOriginX0(), getVirtualOriginY0(), getVirtualWidthImpl0(), getVirtualHeightImpl0());
     }
-    
+
     // Native calls
     private native int getVirtualOriginX0();
     private native int getVirtualOriginY0();
diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
index b2e175415..30405aa05 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.windows;
@@ -74,26 +74,26 @@ public class WindowDriver extends WindowImpl {
         }
         final long hWnd = getWindowHandle();
         hdc = GDI.GetDC(hWnd);
-        
+
         // return ( 0 == hdc ) ? LOCK_SURFACE_NOT_READY : ( hdc_old != hdc ) ? LOCK_SURFACE_CHANGED : LOCK_SUCCESS ;
-        if( 0 == hdc ) { 
+        if( 0 == hdc ) {
             return LOCK_SURFACE_NOT_READY;
-        }        
+        }
         hmon = MonitorFromWindow0(hWnd);
-        
+
         // Let's not trigger on HDC change, GLDrawableImpl.'s destroy/create is a nop here anyways.
         // FIXME: Validate against EGL surface creation: ANGLE uses HWND -> fine!
-        return LOCK_SUCCESS; 
-        
+        return LOCK_SUCCESS;
+
         /**
         if( hdc_old == hdc ) {
             return LOCK_SUCCESS;
         }
-        if(DEBUG_IMPLEMENTATION) {            
+        if(DEBUG_IMPLEMENTATION) {
             System.err.println("WindowsWindow: surface change "+toHexString(hdc_old)+" -> "+toHexString(hdc));
             // Thread.dumpStack();
         }
-        return LOCK_SURFACE_CHANGED; */        
+        return LOCK_SURFACE_CHANGED; */
     }
 
     @Override
@@ -137,24 +137,24 @@ public class WindowDriver extends WindowImpl {
         }
         setGraphicsConfiguration(cfg);
         final VersionNumber winVer = Platform.getOSVersionNumber();
-        final int flags = getReconfigureFlags(0, true) & 
+        final int flags = getReconfigureFlags(0, true) &
                           ( FLAG_IS_ALWAYSONTOP | FLAG_IS_UNDECORATED ) ;
         final long _windowHandle = CreateWindow0(DisplayDriver.getHInstance(), display.getWindowClassName(), display.getWindowClassName(),
                                                  winVer.getMajor(), winVer.getMinor(),
-                                                 getParentWindowHandle(), getX(), getY(), getWidth(), getHeight(), autoPosition(), flags); 
+                                                 getParentWindowHandle(), getX(), getY(), getWidth(), getHeight(), autoPosition(), flags);
         if ( 0 == _windowHandle ) {
             throw new NativeWindowException("Error creating window");
         }
         setWindowHandle(_windowHandle);
         windowHandleClose = _windowHandle;
-        
+
         if(DEBUG_IMPLEMENTATION) {
             Exception e = new Exception("Info: Window new window handle "+Thread.currentThread().getName()+
                                         " (Parent HWND "+toHexString(getParentWindowHandle())+
                                         ") : HWND "+toHexString(_windowHandle)+", "+Thread.currentThread());
             e.printStackTrace();
         }
-    }    
+    }
 
     protected void closeNativeImpl() {
         if(windowHandleClose != 0) {
@@ -162,7 +162,7 @@ public class WindowDriver extends WindowImpl {
                 try {
                     GDI.ReleaseDC(windowHandleClose, hdc);
                 } catch (Throwable t) {
-                    if(DEBUG_IMPLEMENTATION) { 
+                    if(DEBUG_IMPLEMENTATION) {
                         Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
                         e.printStackTrace();
                     }
@@ -188,14 +188,14 @@ public class WindowDriver extends WindowImpl {
             System.err.println("WindowsWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
                                getReconfigureFlagsAsString(null, flags));
         }
-        
+
         if(0 == ( FLAG_IS_UNDECORATED & flags)) {
             final InsetsImmutable i = getInsets();
-            
+
             // client position -> top-level window position
             x -= i.getLeftWidth() ;
             y -= i.getTopHeight() ;
-            
+
             if(0<width && 0<height) {
                 // client size -> top-level window size
                 width += i.getTotalWidth();
@@ -203,9 +203,9 @@ public class WindowDriver extends WindowImpl {
             }
         }
         reconfigureWindow0( getParentWindowHandle(), getWindowHandle(), x, y, width, height, flags);
-        
+
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
-            visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));            
+            visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
         }
         return true;
     }
@@ -222,7 +222,7 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
         final boolean[] res = new boolean[] { false };
-        
+
         this.runOnEDTIfAvail(true, new Runnable() {
             public void run() {
                 res[0] = setPointerVisible0(getWindowHandle(), pointerVisible);
@@ -234,19 +234,19 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected boolean confinePointerImpl(final boolean confine) {
         final Boolean[] res = new Boolean[] { Boolean.FALSE };
-        
+
         this.runOnEDTIfAvail(true, new Runnable() {
             public void run() {
                 final Point p0 = getLocationOnScreenImpl(0, 0);
-                res[0] = Boolean.valueOf(confinePointer0(getWindowHandle(), confine, 
+                res[0] = Boolean.valueOf(confinePointer0(getWindowHandle(), confine,
                         p0.getX(), p0.getY(), p0.getX()+getWidth(), p0.getY()+getHeight()));
             }
         });
         return res[0].booleanValue();
     }
-    
+
     @Override
-    protected void warpPointerImpl(final int x, final int y) {        
+    protected void warpPointerImpl(final int x, final int y) {
         this.runOnEDTIfAvail(true, new Runnable() {
             public void run() {
                 final Point sPos = getLocationOnScreenImpl(x, y);
@@ -255,44 +255,44 @@ public class WindowDriver extends WindowImpl {
         });
         return;
     }
-        
+
     protected Point getLocationOnScreenImpl(int x, int y) {
         return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
     }
 
     protected void updateInsetsImpl(Insets insets) {
-        // nop - using event driven insetsChange(..)         
+        // nop - using event driven insetsChange(..)
     }
-    
+
     //
     // PointerEvent Handling
     //
     /**
      * Send multiple-pointer {@link MouseEvent.PointerType#TouchScreen} event to be directly consumed
      * <p>
-     * Assumes non normal pointer names and rotation/scroll will be determined by a gesture handler. 
+     * Assumes non normal pointer names and rotation/scroll will be determined by a gesture handler.
      * </p>
      * <p>
      * See {@link #doPointerEvent(boolean, boolean, PointerType[], short, int, int, boolean, int[], int[], int[], float[], float, float[], float)}
      * for details.
      * </p>
      */
-    public final void sendTouchScreenEvent(short eventType, int modifiers, 
+    public final void sendTouchScreenEvent(short eventType, int modifiers,
                                            int pActionIdx, int[] pNames,
                                            int[] pX, int[] pY, float[] pPressure, float maxPressure) {
         final int pCount = pNames.length;
         final MouseEvent.PointerType[] pTypes = new MouseEvent.PointerType[pCount];
         for(int i=pCount-1; i>=0; i--) { pTypes[i] = PointerType.TouchScreen; }
-        doPointerEvent(false /*enqueue*/, false /*wait*/, 
-                       pTypes, eventType, modifiers, pActionIdx, false /*normalPNames*/, pNames, 
+        doPointerEvent(false /*enqueue*/, false /*wait*/,
+                       pTypes, eventType, modifiers, pActionIdx, false /*normalPNames*/, pNames,
                        pX, pY, pPressure, maxPressure, new float[] { 0f, 0f, 0f} /*rotationXYZ*/, 1f/*rotationScale*/);
     }
-    
+
     //
     // KeyEvent Handling
     //
     private short repeatedKey = KeyEvent.VK_UNDEFINED;
-    
+
     private final boolean handlePressTypedAutoRepeat(boolean isModifierKey, int modifiers, short keyCode, short keySym, char keyChar) {
         if( setKeyPressed(keyCode, true) ) {
             // AR: Key was already pressed: Either [enter | within] AR mode
@@ -308,18 +308,18 @@ public class WindowDriver extends WindowImpl {
                 super.sendKeyEvent(KeyEvent.EVENT_KEY_RELEASED, modifiers, keyCode, keySym, keyChar);
             }
             return true;
-        } 
+        }
         return false;
     }
-    
+
     @Override
     public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
         final boolean isModifierKey = KeyEvent.isModifierKey(keySym);
         // System.err.println("*** sendKeyEvent: event "+KeyEvent.getEventTypeString(eventType)+", keyCode "+toHexString(keyCode)+", keyChar <"+keyChar+">, mods "+toHexString(modifiers)+
         //                   ", isKeyCodeTracked "+isKeyCodeTracked(keyCode)+", was: pressed "+isKeyPressed(keyCode)+", printableKey "+KeyEvent.isPrintableKey(keyCode, false)+" [modifierKey "+isModifierKey+"] - "+System.currentTimeMillis());
-        
+
         // Reorder: WINDOWS delivery order is PRESSED (t0), TYPED (t0) and RELEASED (t1) -> NEWT order: PRESSED (t0) and RELEASED (t1)
-        // Auto-Repeat: WINDOWS delivers only PRESSED (t0) and TYPED (t0).        
+        // Auto-Repeat: WINDOWS delivers only PRESSED (t0) and TYPED (t0).
         switch(eventType) {
             case KeyEvent.EVENT_KEY_RELEASED:
                 if( isKeyCodeTracked(keyCode) ) {
@@ -339,12 +339,12 @@ public class WindowDriver extends WindowImpl {
                 break;
         }
     }
-    
+
     @Override
     public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
         throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
     }
-    
+
     //----------------------------------------------------------------------
     // Internals only
     //
@@ -361,5 +361,5 @@ public class WindowDriver extends WindowImpl {
 
     private static native boolean setPointerVisible0(long windowHandle, boolean visible);
     private static native boolean confinePointer0(long windowHandle, boolean grab, int l, int t, int r, int b);
-    private static native void warpPointer0(long windowHandle, int x, int y);    
+    private static native void warpPointer0(long windowHandle, int x, int y);
 }
diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
index d911483b0..aa8067520 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.x11;
@@ -83,7 +83,7 @@ public class DisplayDriver extends DisplayImpl {
             CompleteDisplay0(aDevice.getHandle());
         } catch(RuntimeException e) {
             closeNativeImpl(aDevice);
-            throw e;                
+            throw e;
         }
     }
 
@@ -114,14 +114,14 @@ public class DisplayDriver extends DisplayImpl {
     protected long getJavaObjectAtom() { return javaObjectAtom; }
     protected long getWindowDeleteAtom() { return windowDeleteAtom; }
     // protected long getKbdHandle() { return kbdHandle; } // XKB disabled for now
-    
-    /** Returns <code>null</code> if !{@link #isNativeValid()}, otherwise the Boolean value of {@link X11GraphicsDevice#isXineramaEnabled()}. */ 
+
+    /** Returns <code>null</code> if !{@link #isNativeValid()}, otherwise the Boolean value of {@link X11GraphicsDevice#isXineramaEnabled()}. */
     protected Boolean isXineramaEnabled() { return isNativeValid() ? Boolean.valueOf(((X11GraphicsDevice)aDevice).isXineramaEnabled()) : null; }
-    
+
     //----------------------------------------------------------------------
     // Internals only
     //
-    
+
     private static native boolean initIDs0(boolean debug);
 
     private native void CompleteDisplay0(long handle);
@@ -137,10 +137,10 @@ public class DisplayDriver extends DisplayImpl {
 
     /** X11 Window delete atom marker used on EDT */
     private long windowDeleteAtom;
-    
+
     /** X11 Window java object property used on EDT */
-    private long javaObjectAtom;    
-    
+    private long javaObjectAtom;
+
     /** X11 Keyboard handle used on EDT */
     // private long kbdHandle; // XKB disabled for now
 }
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR.java b/src/newt/classes/jogamp/newt/driver/x11/RandR.java
index e39a6c63a..8b065d1f0 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR.java
@@ -38,18 +38,18 @@ import com.jogamp.newt.MonitorDevice;
 import com.jogamp.newt.MonitorMode;
 
 public interface RandR {
-    public static final VersionNumber version110 = new VersionNumber(1, 1, 0);    
+    public static final VersionNumber version110 = new VersionNumber(1, 1, 0);
     public static final VersionNumber version130 = new VersionNumber(1, 3, 0);
     public static final VersionNumber version140 = new VersionNumber(1, 4, 0);
 
     VersionNumber getVersion();
-    
+
     void dumpInfo(final long dpy, final int screen_idx);
-    
+
     /**
-     * Encapsulate initial device query allowing caching of internal data structures. 
+     * Encapsulate initial device query allowing caching of internal data structures.
      * Methods covered:
-     * <ul> 
+     * <ul>
      *   <li>{@link #getMonitorDeviceCount(long, ScreenDriver)}</li>
      *   <li>{@link #getAvailableRotations(long, ScreenDriver, int)}</li>
      *   <li>{@link #getMonitorModeProps(long, ScreenDriver, int)}</li>
@@ -57,7 +57,7 @@ public interface RandR {
      *   <li>{@link #getMonitorDeviceProps(long, ScreenDriver, List, int, MonitorMode)}</li>
      * </ul>
      * <p>
-     * Above methods may be called w/o begin/end, in which case no 
+     * Above methods may be called w/o begin/end, in which case no
      * internal data structures can be cached:
      * </p>
      * @param dpy TODO
@@ -66,11 +66,11 @@ public interface RandR {
      */
     boolean beginInitialQuery(long dpy, ScreenDriver screen);
     void endInitialQuery(long dpy, ScreenDriver screen);
-    
+
     int getMonitorDeviceCount(final long dpy, final ScreenDriver screen);
     int[] getAvailableRotations(final long dpy, final ScreenDriver screen, final int crt_idx);
     /**
-     * 
+     *
      * @param dpy
      * @param screen
      * @param mode_idx w/o indexing rotation
@@ -80,7 +80,7 @@ public interface RandR {
     int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, MonitorModeProps.Cache cache, final int crt_idx);
     int[] getMonitorDeviceViewport(final long dpy, final ScreenDriver screen, final int crt_idx);
     int[] getCurrentMonitorModeProps(final long dpy, final ScreenDriver screen, final int crt_idx);
-    boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode);  
-    
-    public void updateScreenViewport(final long dpy, final ScreenDriver screen, RectangleImmutable viewport);    
+    boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode);
+
+    public void updateScreenViewport(final long dpy, final ScreenDriver screen, RectangleImmutable viewport);
 }
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR11.java b/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
index 877607f72..6c22a3fc6 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
@@ -38,8 +38,8 @@ import com.jogamp.newt.MonitorMode;
 
 class RandR11 implements RandR {
     private static final boolean DEBUG = ScreenDriver.DEBUG;
-    
-    RandR11() {        
+
+    RandR11() {
     }
 
     @Override
@@ -51,13 +51,13 @@ class RandR11 implements RandR {
     public void dumpInfo(final long dpy, final int screen_idx) {
         // NOP
     }
-    
+
     private int widthMM=0, heightMM=0;
     private int modeCount = 0;
     private int resolutionCount = 0;
     private int[][] nrates = null; // [nres_number][nrate_number]
     private int[] idx_rate = null, idx_res = null;
-    
+
     @Override
     public boolean beginInitialQuery(long dpy, ScreenDriver screen) {
         // initialize iterators and static data
@@ -76,11 +76,11 @@ class RandR11 implements RandR {
                 return false;
             }
         }
-        
+
         for(int nresIdx=0; nresIdx < resolutionCount; nresIdx++) {
             modeCount += nrates[nresIdx].length;
         }
-        
+
         idx_rate = new int[modeCount];
         idx_res = new int[modeCount];
 
@@ -94,23 +94,23 @@ class RandR11 implements RandR {
         }
         return true;
     }
-    
+
     @Override
     public void endInitialQuery(long dpy, ScreenDriver screen) {
         idx_rate=null;
-        idx_res=null;            
-        nrates=null;        
+        idx_res=null;
+        nrates=null;
     }
-    
+
     @Override
     public int getMonitorDeviceCount(final long dpy, final ScreenDriver screen) {
         return 1;
     }
-    
+
     @Override
     public int[] getAvailableRotations(final long dpy, final ScreenDriver screen, final int crt_idx) {
         if( 0 < crt_idx ) {
-            // RandR11 only supports 1 CRT 
+            // RandR11 only supports 1 CRT
             return null;
         }
         final int screen_idx = screen.getIndex();
@@ -120,17 +120,17 @@ class RandR11 implements RandR {
         }
         return availRotations;
     }
-    
+
     @Override
     public int[] getMonitorModeProps(final long dpy, final ScreenDriver screen, final int mode_idx) {
         if( mode_idx >= modeCount ) {
             return null;
-        }        
+        }
         final int screen_idx = screen.getIndex();
-        
+
         final int nres_index = idx_res[mode_idx];
         final int nrate_index = idx_rate[mode_idx];
-        
+
         final int[] res = getScreenResolution0(dpy, screen_idx, nres_index);
         if(null==res || 0==res.length) {
             return null;
@@ -144,7 +144,7 @@ class RandR11 implements RandR {
         if( res[3] > heightMM ) {
             heightMM = res[3];
         }
-        
+
         int rate = nrates[nres_index][nrate_index];
         if(0>=rate) {
             rate = ScreenImpl.default_sm_rate;
@@ -166,13 +166,13 @@ class RandR11 implements RandR {
         if( MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL != i ) {
             throw new InternalError("XX");
         }
-        return props;        
+        return props;
     }
-    
+
     @Override
     public int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, final MonitorModeProps.Cache cache, final int crt_idx) {
         if( 0 < crt_idx ) {
-            // RandR11 only supports 1 CRT 
+            // RandR11 only supports 1 CRT
             return null;
         }
         final int[] currentModeProps = getCurrentMonitorModeProps(dpy, screen, crt_idx);
@@ -194,15 +194,15 @@ class RandR11 implements RandR {
         props[i++] = currentMode.getId(); // current mode id
         props[i++] = currentMode.getRotation();
         for(int j=0; j<allModesCount; j++) {
-            props[i++] = cache.monitorModes.get(j).getId(); 
+            props[i++] = cache.monitorModes.get(j).getId();
         }
         return props;
     }
-    
+
     @Override
     public int[] getMonitorDeviceViewport(final long dpy, final ScreenDriver screen, final int crt_idx) {
         if( 0 < crt_idx ) {
-            // RandR11 only supports 1 CRT 
+            // RandR11 only supports 1 CRT
             return null;
         }
         final int screen_idx = screen.getIndex();
@@ -212,7 +212,7 @@ class RandR11 implements RandR {
         }
         int[] res;
         final int nres_idx;
-        try {                
+        try {
             int resNumber = getNumScreenResolutions0(dpy, screen_idx);
             if(0==resNumber) {
                 return null;
@@ -241,13 +241,13 @@ class RandR11 implements RandR {
         props[i++] = 0;
         props[i++] = res[0]; // width
         props[i++] = res[1]; // height
-        return props;        
+        return props;
     }
-    
+
     @Override
     public int[] getCurrentMonitorModeProps(final long dpy, final ScreenDriver screen, final int crt_idx) {
         if( 0 < crt_idx ) {
-            // RandR11 only supports 1 CRT 
+            // RandR11 only supports 1 CRT
             return null;
         }
         final int screen_idx = screen.getIndex();
@@ -258,7 +258,7 @@ class RandR11 implements RandR {
         int[] res;
         int rate, rot;
         final int nres_idx;
-        try {                
+        try {
             int resNumber = getNumScreenResolutions0(dpy, screen_idx);
             if(0==resNumber) {
                 return null;
@@ -318,7 +318,7 @@ class RandR11 implements RandR {
             final int resId = mode.getId();
             if(0>resId || resId>=resolutionCount) {
                 throw new RuntimeException("Invalid resolution index: ! 0 < "+resId+" < "+resolutionCount+", "+monitor+", "+mode);
-            }    
+            }
             final int f = (int)mode.getRefreshRate(); // simply cut-off, orig is int
             final int r = mode.getRotation();
 
@@ -335,11 +335,11 @@ class RandR11 implements RandR {
         }
         return done;
     }
-    
+
     @Override
     public final void updateScreenViewport(final long dpy, final ScreenDriver screen, RectangleImmutable viewport) {
         // nop
-    }    
+    }
 
     /** @return int[] { rot1, .. } */
     private static native int[] getAvailableScreenRotations0(long display, int screen_index);
@@ -353,7 +353,7 @@ class RandR11 implements RandR {
 
     private static native long getScreenConfiguration0(long display, int screen_index);
     private static native void freeScreenConfiguration0(long screenConfiguration);
-    
+
     private static native int getCurrentScreenResolutionIndex0(long screenConfiguration);
     private static native int getCurrentScreenRate0(long screenConfiguration);
     private static native int getCurrentScreenRotation0(long screenConfiguration);
@@ -361,5 +361,5 @@ class RandR11 implements RandR {
     /** needs own Display connection for XRANDR event handling */
     private static native boolean setCurrentScreenModeStart0(long display, int screen_index, long screenConfiguration, int mode_index, int freq, int rot);
     private static native boolean setCurrentScreenModePollEnd0(long display, int screen_index, int mode_index, int freq, int rot);
-    
+
 }
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR13.java b/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
index ac83fc5f2..a08741d9e 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
@@ -43,19 +43,19 @@ import com.jogamp.newt.MonitorMode;
  * <pre>
  * MonitorMode.id   == XRR mode-id (not index)
  * MonitorDevice.id == XRR monitor-idx (not id)
- * </pre> 
+ * </pre>
  */
 class RandR13 implements RandR {
     private static final boolean DEBUG = ScreenDriver.DEBUG;
-    
-    RandR13() {        
+
+    RandR13() {
     }
-    
+
     @Override
     public final VersionNumber getVersion() {
         return version130;
     }
-    
+
     @Override
     public void dumpInfo(final long dpy, final int screen_idx) {
         long screenResources = getScreenResources0(dpy, screen_idx);
@@ -66,12 +66,12 @@ class RandR13 implements RandR {
             dumpInfo0(dpy, screen_idx, screenResources);
         } finally {
              freeScreenResources0(screenResources);
-        }        
+        }
     }
-    
+
     long sessionScreenResources = 0;
     IntLongHashMap crtInfoHandleMap = null;
-    
+
     @Override
     public boolean beginInitialQuery(long dpy, ScreenDriver screen) {
         final int screen_idx = screen.getIndex();
@@ -84,7 +84,7 @@ class RandR13 implements RandR {
             return false;
         }
     }
-    
+
     @Override
     public void endInitialQuery(long dpy, ScreenDriver screen) {
         if( null != crtInfoHandleMap ) {
@@ -100,7 +100,7 @@ class RandR13 implements RandR {
             sessionScreenResources = 0;
         }
     }
-    
+
     private final long getScreenResourceHandle(final long dpy, final int screen_idx) {
         if( 0 != sessionScreenResources ) {
             return sessionScreenResources;
@@ -112,7 +112,7 @@ class RandR13 implements RandR {
             freeScreenResources0( screenResourceHandle );
         }
     }
-    
+
     private final long getMonitorInfoHandle(final long dpy, final int screen_idx, long screenResources, final int monitor_idx) {
         if( null != crtInfoHandleMap ) {
             long h = crtInfoHandleMap.get(monitor_idx);
@@ -129,8 +129,8 @@ class RandR13 implements RandR {
         if( null == crtInfoHandleMap ) {
             freeMonitorInfoHandle0(monitorInfoHandle);
         }
-    }    
-    
+    }
+
     @Override
     public int getMonitorDeviceCount(final long dpy, final ScreenDriver screen) {
         final int screen_idx = screen.getIndex();
@@ -141,7 +141,7 @@ class RandR13 implements RandR {
             releaseScreenResourceHandle(screenResources);
         }
     }
-    
+
     @Override
     public int[] getAvailableRotations(final long dpy, final ScreenDriver screen, final int crt_idx) {
         final int screen_idx = screen.getIndex();
@@ -152,7 +152,7 @@ class RandR13 implements RandR {
                 final int[] availRotations = getAvailableRotations0(monitorInfo);
                 if(null==availRotations || 0==availRotations.length) {
                     return null;
-                }        
+                }
                 return availRotations;
             } finally {
                 releaseMonitorInfoHandle(monitorInfo);
@@ -161,7 +161,7 @@ class RandR13 implements RandR {
             releaseScreenResourceHandle(screenResources);
         }
     }
-    
+
     @Override
     public int[] getMonitorModeProps(final long dpy, final ScreenDriver screen, final int mode_idx) {
         final int screen_idx = screen.getIndex();
@@ -172,7 +172,7 @@ class RandR13 implements RandR {
             releaseScreenResourceHandle(screenResources);
         }
     }
-    
+
     @Override
     public int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, MonitorModeProps.Cache cache, final int crt_idx) {
         final int screen_idx = screen.getIndex();
@@ -188,9 +188,9 @@ class RandR13 implements RandR {
             releaseScreenResourceHandle(screenResources);
         }
     }
-    
+
     @Override
-    public int[] getMonitorDeviceViewport(final long dpy, final ScreenDriver screen, final int crt_idx) {        
+    public int[] getMonitorDeviceViewport(final long dpy, final ScreenDriver screen, final int crt_idx) {
         final int screen_idx = screen.getIndex();
         final long screenResources = getScreenResourceHandle(dpy, screen_idx);
         try {
@@ -204,7 +204,7 @@ class RandR13 implements RandR {
             releaseScreenResourceHandle(screenResources);
         }
     }
-    
+
     @Override
     public int[] getCurrentMonitorModeProps(final long dpy, final ScreenDriver screen, final int crt_idx) {
         final int screen_idx = screen.getIndex();
@@ -220,7 +220,7 @@ class RandR13 implements RandR {
             releaseScreenResourceHandle(screenResources);
         }
     }
-    
+
     @Override
     public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode) {
         final int screen_idx = screen.getIndex();
@@ -229,7 +229,7 @@ class RandR13 implements RandR {
         try {
             final long monitorInfo = getMonitorInfoHandle(dpy, screen_idx, screenResources, monitor.getId());
             try {
-                res = setMonitorMode0(dpy, screenResources, monitorInfo, monitor.getId(), mode.getId(), mode.getRotation(), 
+                res = setMonitorMode0(dpy, screenResources, monitorInfo, monitor.getId(), mode.getId(), mode.getRotation(),
                                       -1, -1); // no fixed position!
             } finally {
                 releaseMonitorInfoHandle(monitorInfo);
@@ -239,36 +239,36 @@ class RandR13 implements RandR {
         }
         return res;
     }
-    
+
     @Override
     public final void updateScreenViewport(final long dpy, final ScreenDriver screen, final RectangleImmutable viewport) {
         final int screen_idx = screen.getIndex();
         final long screenResources = getScreenResourceHandle(dpy, screen_idx);
         try {
-            setScreenViewport0(dpy, screen_idx, screenResources, viewport.getX(), viewport.getY(), viewport.getWidth(), viewport.getHeight()); 
+            setScreenViewport0(dpy, screen_idx, screenResources, viewport.getX(), viewport.getY(), viewport.getWidth(), viewport.getHeight());
         } finally {
             dumpInfo0(dpy, screen_idx, screenResources);
             releaseScreenResourceHandle(screenResources);
         }
     }
-        
+
     private static native long getScreenResources0(long display, int screen_index);
     private static native void freeScreenResources0(long screenResources);
     private static native void dumpInfo0(long display, int screen_index, long screenResources);
-    
+
     private static native int getMonitorDeviceCount0(long screenResources);
-    
+
     private static native long getMonitorInfoHandle0(long display, int screen_index, long screenResources, int monitor_index);
     private static native void freeMonitorInfoHandle0(long monitorInfoHandle);
-    
+
     private static native int[] getAvailableRotations0(long monitorInfo);
     private static native int[] getMonitorViewport0(long monitorInfo);
     private static native int[] getMonitorCurrentMode0(long monitorInfo);
-    
+
     private static native int[] getMonitorMode0(long screenResources, int mode_index);
     private static native int[] getMonitorCurrentMode0(long screenResources, long monitorInfo);
     private static native int[] getMonitorDevice0(long display, long screenResources, long monitorInfo, int monitor_idx);
-    
+
     private static native boolean setMonitorMode0(long display, long screenResources, long monitorInfo, int monitor_idx, int mode_id, int rotation, int x, int y);
     private static native boolean setScreenViewport0(long display, int screen_index, long screenResources, int x, int y, int width, int height);
 }
diff --git a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
index c01d899f8..7f75e03f0 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 package jogamp.newt.driver.x11;
 
@@ -54,19 +54,19 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
 import com.jogamp.newt.MonitorDevice;
 import com.jogamp.newt.MonitorMode;
 
-public class ScreenDriver extends ScreenImpl {    
+public class ScreenDriver extends ScreenImpl {
     protected static final boolean DEBUG_TEST_RANDR13_DISABLED;
-    
+
     static {
         Debug.initSingleton();
         DEBUG_TEST_RANDR13_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableRandR13", true);
-        
+
         DisplayDriver.initSingleton();
     }
 
     /** Ensure static init has been run. */
     /* pp */static void initSingleton() { }
-    
+
     public ScreenDriver() {
     }
 
@@ -74,14 +74,14 @@ public class ScreenDriver extends ScreenImpl {
     protected void createNativeImpl() {
         // validate screen index
         Long handle = runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Long>() {
-            public Long run(long dpy) {        
+            public Long run(long dpy) {
                 return new Long(GetScreen0(dpy, screen_idx));
             } } );
         if (handle.longValue() == 0) {
             throw new RuntimeException("Error creating screen: " + screen_idx);
         }
-        final X11GraphicsDevice x11dev = (X11GraphicsDevice) getDisplay().getGraphicsDevice();        
-        final long dpy = x11dev.getHandle(); 
+        final X11GraphicsDevice x11dev = (X11GraphicsDevice) getDisplay().getGraphicsDevice();
+        final long dpy = x11dev.getHandle();
         aScreen = new X11GraphicsScreen(x11dev, screen_idx);
         {
             int v[] = getRandRVersion0(dpy);
@@ -118,7 +118,7 @@ public class ScreenDriver extends ScreenImpl {
             if( rAndR.beginInitialQuery(device.getHandle(), this) ) {
                 try {
                     final int crtCount = rAndR.getMonitorDeviceCount(device.getHandle(), this);
-                    
+
                     // Gather all available rotations
                     final ArrayHashSet<Integer> availableRotations = new ArrayHashSet<Integer>();
                     for(int i = 0; i < crtCount; i++) {
@@ -129,7 +129,7 @@ public class ScreenDriver extends ScreenImpl {
                             availableRotations.addAll(rotationList);
                         }
                     }
-                    
+
                     // collect all modes, while injecting all available rotations
                     {
                         int modeIdx = 0;
@@ -147,8 +147,8 @@ public class ScreenDriver extends ScreenImpl {
                     if( cache.monitorModes.size() > 0 ) {
                         for(int i = 0; i < crtCount; i++) {
                             final int[] monitorProps = rAndR.getMonitorDeviceProps(device.getHandle(), this, cache, i);
-                            if( null != monitorProps && 
-                                MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES <= monitorProps[0] && // Enabled ? I.e. contains active modes ? 
+                            if( null != monitorProps &&
+                                MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES <= monitorProps[0] && // Enabled ? I.e. contains active modes ?
                                 MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES <= monitorProps.length ) {
                                 MonitorModeProps.streamInMonitorDevice(null, cache, this, monitorProps, 0);
                             }
@@ -174,11 +174,11 @@ public class ScreenDriver extends ScreenImpl {
             device.unlock();
         }
     }
-    
+
     @Override
     protected MonitorMode queryCurrentMonitorModeImpl(final MonitorDevice monitor) {
         if( null == rAndR ) { return null; }
-        
+
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<MonitorMode>() {
             public MonitorMode run(long dpy) {
                 final int[] currentModeProps = rAndR.getCurrentMonitorModeProps(dpy, ScreenDriver.this, monitor.getId());
@@ -189,14 +189,14 @@ public class ScreenDriver extends ScreenImpl {
     @Override
     protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
         if( null == rAndR ) { return false; }
-        
+
         final long t0 = System.currentTimeMillis();
         boolean done = runWithOptTempDisplayHandle( new DisplayImpl.DisplayRunnable<Boolean>() {
             public Boolean run(long dpy) {
                 return Boolean.valueOf( rAndR.setCurrentMonitorMode(dpy, ScreenDriver.this, monitor, mode) );
-            }            
+            }
         }).booleanValue();
-        
+
         if(DEBUG || !done) {
             System.err.println("X11Screen.setCurrentMonitorModeImpl: TO ("+SCREEN_MODE_CHANGE_TIMEOUT+") reached: "+
                                (System.currentTimeMillis()-t0)+"ms; "+monitor.getCurrentMode()+" -> "+mode);
@@ -205,10 +205,10 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     private DisplayImpl.DisplayRunnable<Boolean> xineramaEnabledQueryWithTemp = new DisplayImpl.DisplayRunnable<Boolean>() {
-        public Boolean run(long dpy) {        
-            return new Boolean(X11Util.XineramaIsEnabled(dpy)); 
+        public Boolean run(long dpy) {
+            return new Boolean(X11Util.XineramaIsEnabled(dpy));
         } };
-    
+
     @Override
     protected int validateScreenIndex(final int idx) {
         final DisplayDriver x11Display = (DisplayDriver) getDisplay();
@@ -219,7 +219,7 @@ public class ScreenDriver extends ScreenImpl {
             return runWithTempDisplayHandle( xineramaEnabledQueryWithTemp ).booleanValue() ? 0 : idx;
         }
     }
-        
+
     @Override
     protected void calcVirtualScreenOriginAndSize(final Rectangle vOriginSize) {
         final RectangleImmutable ov = (RectangleImmutable) getViewport().cloneMutable();
@@ -244,17 +244,17 @@ public class ScreenDriver extends ScreenImpl {
                 System.err.println("X11Screen.calcVirtualScreenOriginAndSize: Querying X11: "+ov+" -> "+vOriginSize);
             }
         }
-    }    
-    
+    }
+
     //----------------------------------------------------------------------
     // Internals only
-    //    
+    //
     private final <T> T runWithLockedDisplayDevice(DisplayRunnable<T> action) {
         return display.runWithLockedDisplayDevice(action);
     }
-    
+
     private final <T> T runWithTempDisplayHandle(DisplayRunnable<T> action) {
-        final long displayHandle = X11Util.openDisplay(display.getName());        
+        final long displayHandle = X11Util.openDisplay(display.getName());
         if(0 == displayHandle) {
             throw new RuntimeException("null device");
         }
@@ -266,7 +266,7 @@ public class ScreenDriver extends ScreenImpl {
         }
         return res;
     }
-    
+
     private final <T> T runWithOptTempDisplayHandle(DisplayRunnable<T> action) {
         if( null != rAndR && rAndR.getVersion().compareTo(RandR.version130) >= 0 ) {
             return display.runWithLockedDisplayDevice(action);
@@ -274,12 +274,12 @@ public class ScreenDriver extends ScreenImpl {
             return runWithTempDisplayHandle(action);
         }
     }
-    
+
     private static native long GetScreen0(long dpy, int scrn_idx);
 
     private static native int getWidth0(long display, int scrn_idx);
 
     private static native int getHeight0(long display, int scrn_idx);
-    
+
     private static native int[] getRandRVersion0(long display);
 }
diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
index 806dd270c..02f80c0c3 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  */
 
 package jogamp.newt.driver.x11;
@@ -57,7 +57,7 @@ public class WindowDriver extends WindowImpl {
     private static final int X11_WHEEL_ONE_DOWN_BUTTON = 5;
     private static final int X11_WHEEL_TWO_UP_BUTTON   = 6;
     private static final int X11_WHEEL_TWO_DOWN_BUTTON = 7;
-    
+
     static {
         ScreenDriver.initSingleton();
     }
@@ -70,21 +70,21 @@ public class WindowDriver extends WindowImpl {
         final ScreenDriver screen = (ScreenDriver) getScreen();
         final DisplayDriver display = (DisplayDriver) screen.getDisplay();
         final AbstractGraphicsDevice edtDevice = display.getGraphicsDevice();
-        
-        // Decoupled X11 Device/Screen allowing X11 display lock-free off-thread rendering 
+
+        // Decoupled X11 Device/Screen allowing X11 display lock-free off-thread rendering
         final long renderDeviceHandle = X11Util.openDisplay(edtDevice.getConnection());
         if( 0 == renderDeviceHandle ) {
             throw new RuntimeException("Error creating display(GfxCfg/Render): "+edtDevice.getConnection());
         }
         renderDevice = new X11GraphicsDevice(renderDeviceHandle, AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
         final AbstractGraphicsScreen renderScreen = new X11GraphicsScreen(renderDevice, screen.getIndex());
-        
+
         final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice(), capsRequested);
         final AbstractGraphicsConfiguration cfg = factory.chooseGraphicsConfiguration(
                 capsRequested, capsRequested, capabilitiesChooser, renderScreen, VisualIDHolder.VID_UNDEFINED);
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("X11Window.createNativeImpl() factory: "+factory+", chosen config: "+cfg);
-        }        
+        }
         if (null == cfg) {
             throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
         }
@@ -93,13 +93,13 @@ public class WindowDriver extends WindowImpl {
             throw new NativeWindowException("Chosen Configuration w/o native visual ID: "+cfg);
         }
         setGraphicsConfiguration(cfg);
-        final int flags = getReconfigureFlags(0, true) & 
+        final int flags = getReconfigureFlags(0, true) &
                           ( FLAG_IS_ALWAYSONTOP | FLAG_IS_UNDECORATED ) ;
         edtDevice.lock();
-        try {        
+        try {
             setWindowHandle(CreateWindow0(getParentWindowHandle(),
-                                   edtDevice.getHandle(), screen.getIndex(), visualID, 
-                                   display.getJavaObjectAtom(), display.getWindowDeleteAtom(), 
+                                   edtDevice.getHandle(), screen.getIndex(), visualID,
+                                   display.getJavaObjectAtom(), display.getWindowDeleteAtom(),
                                    getX(), getY(), getWidth(), getHeight(), autoPosition(), flags));
         } finally {
             edtDevice.unlock();
@@ -117,10 +117,10 @@ public class WindowDriver extends WindowImpl {
             final AbstractGraphicsDevice edtDevice = display.getGraphicsDevice();
             edtDevice.lock();
             try {
-                CloseWindow0(edtDevice.getHandle(), windowHandleClose, 
+                CloseWindow0(edtDevice.getHandle(), windowHandleClose,
                              display.getJavaObjectAtom(), display.getWindowDeleteAtom() /* , display.getKbdHandle() */); // XKB disabled for now
             } catch (Throwable t) {
-                if(DEBUG_IMPLEMENTATION) { 
+                if(DEBUG_IMPLEMENTATION) {
                     Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
                     e.printStackTrace();
                 }
@@ -135,7 +135,7 @@ public class WindowDriver extends WindowImpl {
         }
     }
 
-    /** 
+    /**
      * <p>
      * X11 Window supports {@link #FLAG_IS_FULLSCREEN_SPAN}
      * </p>
@@ -145,7 +145,7 @@ public class WindowDriver extends WindowImpl {
     protected boolean isReconfigureFlagSupported(int changeFlags) {
         return true; // all flags!
     }
-    
+
     @Override
     protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, int flags) {
         if(DEBUG_IMPLEMENTATION) {
@@ -153,8 +153,8 @@ public class WindowDriver extends WindowImpl {
         }
         final int _x, _y;
         if(0 == ( FLAG_IS_UNDECORATED & flags)) {
-            final InsetsImmutable i = getInsets();         
-            
+            final InsetsImmutable i = getInsets();
+
             // client position -> top-level window position
             _x = x - i.getLeftWidth() ;
             _y = y - i.getTopHeight() ;
@@ -177,7 +177,7 @@ public class WindowDriver extends WindowImpl {
         final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
             public Object run(long dpy) {
-                reconfigureWindow0( dpy, getScreenIndex(), 
+                reconfigureWindow0( dpy, getScreenIndex(),
                                     getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
                                     _x, _y, width, height, fflags);
                 return null;
@@ -205,23 +205,23 @@ public class WindowDriver extends WindowImpl {
                 public Object run(long dpy) {
                     reconfigureWindow0( dpy, getScreenIndex(),
                                         getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
-                                        getX(), getY(), getWidth(), getHeight(), flags); 
+                                        getX(), getY(), getWidth(), getHeight(), flags);
                     return null;
                 }
             });
         }
         super.focusChanged(defer, focusGained);
     }
-        
+
     protected void reparentNotify(long newParentWindowHandle) {
         if(DEBUG_IMPLEMENTATION) {
             final long p0 = getParentWindowHandle();
             System.err.println("Window.reparentNotify ("+getThreadName()+"): "+toHexString(p0)+" -> "+toHexString(newParentWindowHandle));
         }
     }
-    
+
     @Override
-    protected void requestFocusImpl(final boolean force) {        
+    protected void requestFocusImpl(final boolean force) {
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
             public Object run(long dpy) {
                 requestFocus0(dpy, getWindowHandle(), force);
@@ -239,7 +239,7 @@ public class WindowDriver extends WindowImpl {
             }
         });
     }
-    
+
     @Override
     protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Boolean>() {
@@ -257,7 +257,7 @@ public class WindowDriver extends WindowImpl {
             }
         }).booleanValue();
     }
-    
+
     @Override
     protected void warpPointerImpl(final int x, final int y) {
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
@@ -267,7 +267,7 @@ public class WindowDriver extends WindowImpl {
             }
         });
     }
-    
+
     @Override
     protected Point getLocationOnScreenImpl(final int x, final int y) {
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Point>() {
@@ -279,9 +279,9 @@ public class WindowDriver extends WindowImpl {
 
     @Override
     protected void updateInsetsImpl(Insets insets) {
-        // nop - using event driven insetsChange(..)         
+        // nop - using event driven insetsChange(..)
     }
-    
+
     @Override
     protected final void doMouseEvent(boolean enqueue, boolean wait, short eventType, int modifiers,
                                 int x, int y, short button, float[] rotationXYZ, float rotationScale) {
@@ -321,34 +321,34 @@ public class WindowDriver extends WindowImpl {
                         rotationXYZ[0] = -1;
                         modifiers |= InputEvent.SHIFT_MASK;
                         break;
-                }                
+                }
                 break;
         }
         super.doMouseEvent(enqueue, wait, eventType, modifiers, x, y, button, rotationXYZ, rotationScale);
     }
-        
+
     /** Called by native TK */
     protected final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar0, String keyString) {
         // handleKeyEvent(true, false, eventType, modifiers, keyCode, keyChar);
         final boolean isModifierKey = KeyEvent.isModifierKey(keyCode);
         final boolean isAutoRepeat = 0 != ( KeyEvent.AUTOREPEAT_MASK & modifiers );
-        final char keyChar =  ( null != keyString ) ? keyString.charAt(0) : keyChar0;        
+        final char keyChar =  ( null != keyString ) ? keyString.charAt(0) : keyChar0;
         // System.err.println("*** sendKeyEvent: event "+KeyEvent.getEventTypeString(eventType)+", keyCode "+toHexString(keyCode)+", keyChar <"+keyChar0+">/<"+keyChar+">, keyString "+keyString+", mods "+toHexString(modifiers)+
         //                    ", isKeyCodeTracked "+isKeyCodeTracked(keyCode)+", was: pressed "+isKeyPressed(keyCode)+", repeat "+isAutoRepeat+", [modifierKey "+isModifierKey+"] - "+System.currentTimeMillis());
-        
+
         if( !isAutoRepeat || !isModifierKey ) { // ! (  isModifierKey && isAutoRepeat )
             switch(eventType) {
                 case KeyEvent.EVENT_KEY_PRESSED:
                     super.sendKeyEvent(KeyEvent.EVENT_KEY_PRESSED, modifiers, keyCode, keySym, keyChar);
                     break;
-                    
+
                 case KeyEvent.EVENT_KEY_RELEASED:
                     super.sendKeyEvent(KeyEvent.EVENT_KEY_RELEASED, modifiers, keyCode, keySym, keyChar);
                     break;
             }
         }
     }
-    
+
     @Override
     public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
         throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
@@ -357,33 +357,33 @@ public class WindowDriver extends WindowImpl {
     public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
         throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
     }
-    
+
     //----------------------------------------------------------------------
     // Internals only
     //
     private static final String getCurrentThreadName() { return Thread.currentThread().getName(); } // Callback for JNI
     private static final void dumpStack() { Thread.dumpStack(); } // Callback for JNI
-    
+
     private final <T> T runWithLockedDisplayDevice(DisplayRunnable<T> action) {
         return ((DisplayDriver) getScreen().getDisplay()).runWithLockedDisplayDevice(action);
     }
 
     protected static native boolean initIDs0();
-    
-    private native long CreateWindow0(long parentWindowHandle, long display, int screen_index, 
-                                      int visualID, long javaObjectAtom, long windowDeleteAtom, 
-                                      int x, int y, int width, int height, boolean autoPosition, int flags); 
+
+    private native long CreateWindow0(long parentWindowHandle, long display, int screen_index,
+                                      int visualID, long javaObjectAtom, long windowDeleteAtom,
+                                      int x, int y, int width, int height, boolean autoPosition, int flags);
     private native void CloseWindow0(long display, long windowHandle, long javaObjectAtom, long windowDeleteAtom /*, long kbdHandle*/ ); // XKB disabled for now
     private native void reconfigureWindow0(long display, int screen_index, long parentWindowHandle, long windowHandle,
-                                           long windowDeleteAtom, int x, int y, int width, int height, int flags);    
+                                           long windowDeleteAtom, int x, int y, int width, int height, int flags);
     private native void requestFocus0(long display, long windowHandle, boolean force);
-    
+
     private static native void setTitle0(long display, long windowHandle, String title);
     private static native long getParentWindow0(long display, long windowHandle);
     private static native boolean setPointerVisible0(long display, long windowHandle, boolean visible);
     private static native boolean confinePointer0(long display, long windowHandle, boolean grab);
     private static native void warpPointer0(long display, long windowHandle, int x, int y);
-    
+
     private long   windowHandleClose;
     private X11GraphicsDevice renderDevice;
 }
diff --git a/src/newt/classes/jogamp/newt/event/NEWTEventTask.java b/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
index 93d5e2fb9..38a434279 100644
--- a/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
+++ b/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.newt.event;
 
 import com.jogamp.newt.event.NEWTEvent;
diff --git a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
index 6024195e3..08eacdee5 100644
--- a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
@@ -40,16 +40,16 @@ import com.jogamp.newt.util.EDTUtil;
  */
 public class SWTEDTUtil implements EDTUtil {
     public static final boolean DEBUG = Debug.debug("EDT");
-        
+
     private final Object edtLock = new Object(); // locking the EDT start/stop state
-    private final ThreadGroup threadGroup; 
+    private final ThreadGroup threadGroup;
     private final String name;
     private final Runnable dispatchMessages;
     private final org.eclipse.swt.widgets.Display swtDisplay;
     private NEDT nedt = null;
     private int start_iter=0;
     private static long pollPeriod = EDTUtil.defaultEDTPollPeriod;
-    
+
     public SWTEDTUtil(final com.jogamp.newt.Display newtDisplay, org.eclipse.swt.widgets.Display swtDisplay) {
         this.threadGroup = Thread.currentThread().getThreadGroup();
         this.name=Thread.currentThread().getName()+"-SWTDisplay-"+newtDisplay.getFQName()+"-EDT-";
@@ -61,11 +61,11 @@ public class SWTEDTUtil implements EDTUtil {
         this.nedt = new NEDT(threadGroup, name);
         this.nedt.setDaemon(true); // don't stop JVM from shutdown ..
     }
-    
+
     public final org.eclipse.swt.widgets.Display getDisplay() {
         return swtDisplay;
     }
-    
+
     @Override
     public long getPollPeriod() {
         return pollPeriod;
@@ -116,7 +116,7 @@ public class SWTEDTUtil implements EDTUtil {
         }
         nedt.start();
     }
-    
+
     @Override
     public boolean isCurrentThreadEDT() {
         return !swtDisplay.isDisposed() && swtDisplay.getThread() == Thread.currentThread();
@@ -126,18 +126,18 @@ public class SWTEDTUtil implements EDTUtil {
     public final boolean isCurrentThreadNEDT() {
         return nedt == Thread.currentThread();
     }
-    
+
     @Override
     public final boolean isCurrentThreadEDTorNEDT() {
         final Thread ct = Thread.currentThread();
         return ( !swtDisplay.isDisposed() && ct == swtDisplay.getThread() ) || ct == nedt ;
     }
-    
+
     @Override
     public boolean isRunning() {
         return nedt.isRunning();
     }
-    
+
     @Override
     public final boolean invokeStop(boolean wait, Runnable task) {
         return invokeImpl(wait, task, true);
@@ -147,12 +147,12 @@ public class SWTEDTUtil implements EDTUtil {
     public final boolean invoke(boolean wait, Runnable task) {
         return invokeImpl(wait, task, false);
     }
-    
+
     private static Runnable nullTask = new Runnable() {
         @Override
-        public void run() { }        
+        public void run() { }
     };
-    
+
     private final boolean invokeImpl(boolean wait, Runnable task, boolean stop) {
         Throwable throwable = null;
         RunnableTask rTask = null;
@@ -165,12 +165,12 @@ public class SWTEDTUtil implements EDTUtil {
                         System.err.println(Thread.currentThread()+": Warning: SWT-EDT about (1) to stop, won't enqueue new task: "+nedt+", isRunning "+nedt.isRunning+", shouldStop "+nedt.shouldStop);
                         Thread.dumpStack();
                     }
-                    return false; 
+                    return false;
                 }
                 if( swtDisplay.isDisposed() ) {
                     stop = true;
                 }
-                
+
                 if( isCurrentThreadEDT() ) {
                     if(null != task) {
                         task.run();
@@ -179,7 +179,7 @@ public class SWTEDTUtil implements EDTUtil {
                     if( stop ) {
                         nedt.shouldStop = true;
                     }
-                } else {                
+                } else {
                     if( !nedt.isRunning && !swtDisplay.isDisposed() ) {
                         if( null != task ) {
                             if( stop ) {
@@ -210,11 +210,11 @@ public class SWTEDTUtil implements EDTUtil {
                             return false;
                         }
                     }
-                    
+
                     if( null != task ) {
                         rTask = new RunnableTask(task,
                                                  wait ? rTaskLock : null,
-                                                 true /* always catch and report Exceptions, don't disturb EDT */, 
+                                                 true /* always catch and report Exceptions, don't disturb EDT */,
                                                  wait ? null : System.err);
                         swtDisplay.asyncExec(rTask);
                     }
@@ -238,7 +238,7 @@ public class SWTEDTUtil implements EDTUtil {
             }
             return true;
         }
-    }    
+    }
 
     @Override
     final public boolean waitUntilIdle() {
@@ -278,7 +278,7 @@ public class SWTEDTUtil implements EDTUtil {
             }
         }
     }
-    
+
     class NEDT extends Thread {
         volatile boolean shouldStop = false;
         volatile boolean isRunning = false;
@@ -298,7 +298,7 @@ public class SWTEDTUtil implements EDTUtil {
             super.start();
         }
 
-        /** 
+        /**
          * Utilizing locking only on tasks and its execution,
          * not for event dispatching.
          */
@@ -315,7 +315,7 @@ public class SWTEDTUtil implements EDTUtil {
                         // EDT invoke thread is SWT-EDT,
                         // hence dispatching is required to run on SWT-EDT as well.
                         // Otherwise a deadlock may happen due to dispatched event's
-                        // triggering a locking action.                        
+                        // triggering a locking action.
                         if ( !swtDisplay.isDisposed() ) {
                             swtDisplay.syncExec(dispatchMessages);
                         } else {
@@ -343,7 +343,7 @@ public class SWTEDTUtil implements EDTUtil {
                 }
             } finally {
                 if(DEBUG) {
-                    System.err.println(getName()+": SWT-EDT run() END "+ getName()+", "+error); 
+                    System.err.println(getName()+": SWT-EDT run() END "+ getName()+", "+error);
                 }
                 synchronized(edtLock) {
                     isRunning = false;
@@ -358,5 +358,5 @@ public class SWTEDTUtil implements EDTUtil {
             } // finally
         } // run()
     } // EventDispatchThread
-    
+
 }
diff --git a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
index 3782a1186..b5c45c1aa 100644
--- a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.newt.swt.event;
 
 import org.eclipse.swt.SWT;
@@ -206,7 +206,7 @@ public class SWTNewtEventFactory {
         }
         return res;
     }
-    
+
     public static final com.jogamp.newt.event.MouseEvent createMouseEvent(org.eclipse.swt.widgets.Event event, Object source) {
         switch(event.type) {
             case SWT.MouseDown:
@@ -229,7 +229,7 @@ public class SWTNewtEventFactory {
             }
 
             int mods = swtModifiers2Newt(event.stateMask, true);
-            
+
             if( source instanceof com.jogamp.newt.Window) {
                 final com.jogamp.newt.Window newtSource = (com.jogamp.newt.Window)source;
                 if(newtSource.isPointerConfined()) {
@@ -239,7 +239,7 @@ public class SWTNewtEventFactory {
                     mods |= InputEvent.INVISIBLE_MASK;
                 }
             }
-            
+
             return new com.jogamp.newt.event.MouseEvent(
                            type, (null==source)?(Object)event.data:source, (0xFFFFFFFFL & (long)event.time),
                            mods, event.x, event.y, (short)event.count, (short)event.button, MouseEvent.getRotationXYZ(rotation, mods), 1f);
@@ -260,32 +260,32 @@ public class SWTNewtEventFactory {
             final short newtKeyCode = swtKeyCode2NewtKeyCode( event.keyCode );
             return com.jogamp.newt.event.KeyEvent.create(
                            type, (null==source)?(Object)event.data:source, (0xFFFFFFFFL & (long)event.time),
-                           swtModifiers2Newt(event.stateMask, false), 
+                           swtModifiers2Newt(event.stateMask, false),
                            newtKeyCode, newtKeyCode, event.character);
         }
         return null; // no mapping ..
     }
-    
+
     //
     //
     //
-    
+
     short dragButtonDown = 0;
-    
+
     public SWTNewtEventFactory() {
         resetButtonsDown();
     }
-    
+
     final void resetButtonsDown() {
         dragButtonDown = 0;
     }
-    
+
     public final boolean dispatchMouseEvent(org.eclipse.swt.widgets.Event event, Object source, com.jogamp.newt.event.MouseListener l) {
         com.jogamp.newt.event.MouseEvent res = createMouseEvent(event, source);
         if(null != res) {
             if(null != l) {
                 switch(event.type) {
-                    case SWT.MouseDown:               
+                    case SWT.MouseDown:
                         dragButtonDown = (short) event.button;
                         l.mousePressed(res); break;
                     case SWT.MouseUp:
@@ -293,7 +293,7 @@ public class SWTNewtEventFactory {
                         l.mouseReleased(res);
                         {
                             final com.jogamp.newt.event.MouseEvent res2 = new com.jogamp.newt.event.MouseEvent(
-                                           com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_CLICKED, 
+                                           com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_CLICKED,
                                            res.getSource(),
                                            res.getWhen(), res.getModifiers(),
                                            res.getX(), res.getY(), res.getClickCount(),
@@ -304,7 +304,7 @@ public class SWTNewtEventFactory {
                     case SWT.MouseMove:
                         if( 0 < dragButtonDown ) {
                             final com.jogamp.newt.event.MouseEvent res2 = new com.jogamp.newt.event.MouseEvent(
-                                           com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_DRAGGED, 
+                                           com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_DRAGGED,
                                            res.getSource(),
                                            res.getWhen(), res.getModifiers(),
                                            res.getX(), res.getY(), res.getClickCount(),
@@ -315,14 +315,14 @@ public class SWTNewtEventFactory {
                         }
                         break;
                     case SWT.MouseEnter:
-                        l.mouseEntered(res); 
+                        l.mouseEntered(res);
                         break;
                     case SWT.MouseExit:
                         resetButtonsDown();
-                        l.mouseExited(res); 
+                        l.mouseExited(res);
                         break;
                     case SWT.MouseVerticalWheel:
-                        l.mouseWheelMoved(res); 
+                        l.mouseWheelMoved(res);
                         break;
                 }
             }
@@ -337,7 +337,7 @@ public class SWTNewtEventFactory {
             if(null != l) {
                 switch(event.type) {
                     case SWT.KeyDown:
-                        l.keyPressed(res); 
+                        l.keyPressed(res);
                         break;
                     case SWT.KeyUp:
                         l.keyReleased(res);
@@ -347,9 +347,9 @@ public class SWTNewtEventFactory {
             return true;
         }
         return false;
-    }  
-    
-    public final void attachDispatchListener(final org.eclipse.swt.widgets.Control ctrl, final Object source, 
+    }
+
+    public final void attachDispatchListener(final org.eclipse.swt.widgets.Control ctrl, final Object source,
                                              final com.jogamp.newt.event.MouseListener ml,
                                              final com.jogamp.newt.event.KeyListener kl) {
       final Listener listener = new Listener () {
-- 
cgit v1.2.3


From f1ae8ddb87c88a57dce4593f006881ef6a7f0932 Mon Sep 17 00:00:00 2001
From: Harvey Harrison <harvey.harrison@gmail.com>
Date: Thu, 17 Oct 2013 22:51:47 -0700
Subject: jogl: add missing @Override annotations

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 .../com/jogamp/audio/windows/waveout/Mixer.java    |  2 ++
 .../com/jogamp/audio/windows/waveout/Vec3f.java    |  1 +
 .../gluegen/opengl/BuildComposablePipeline.java    | 31 +++++++++++++++++
 .../com/jogamp/gluegen/opengl/GLEmitter.java       |  3 ++
 .../jogamp/gluegen/opengl/ant/StaticGLGenTask.java |  1 +
 .../NativeSignatureJavaMethodBindingEmitter.java   |  6 ++++
 .../runtime/opengl/GLProcAddressResolver.java      |  1 +
 .../com/jogamp/graph/curve/OutlineShape.java       |  3 ++
 .../com/jogamp/graph/curve/opengl/RenderState.java |  1 +
 src/jogl/classes/com/jogamp/graph/font/Font.java   |  1 +
 .../classes/com/jogamp/graph/geom/Outline.java     |  3 ++
 .../classes/com/jogamp/graph/geom/Triangle.java    |  1 +
 src/jogl/classes/com/jogamp/graph/geom/Vertex.java |  1 +
 .../com/jogamp/graph/geom/opengl/SVertex.java      | 21 ++++++++++++
 src/jogl/classes/com/jogamp/opengl/FBObject.java   |  4 +++
 .../com/jogamp/opengl/GLRendererQuirks.java        |  1 +
 .../opengl/cg/CgDynamicLibraryBundleInfo.java      |  1 +
 .../com/jogamp/opengl/math/geom/AABBox.java        |  3 ++
 .../classes/com/jogamp/opengl/swt/GLCanvas.java    |  1 +
 .../com/jogamp/opengl/util/AWTAnimatorImpl.java    |  3 ++
 .../classes/com/jogamp/opengl/util/Animator.java   | 13 ++++++++
 .../com/jogamp/opengl/util/AnimatorBase.java       |  4 +++
 .../jogamp/opengl/util/DefaultAnimatorImpl.java    |  2 ++
 .../com/jogamp/opengl/util/FPSAnimator.java        | 14 ++++++++
 .../com/jogamp/opengl/util/GLArrayDataClient.java  |  1 +
 .../jogamp/opengl/util/GLArrayDataEditable.java    |  1 +
 .../com/jogamp/opengl/util/GLArrayDataServer.java  |  5 +++
 .../com/jogamp/opengl/util/GLPixelBuffer.java      |  2 ++
 .../com/jogamp/opengl/util/ImmModeSink.java        |  2 ++
 .../classes/com/jogamp/opengl/util/PMVMatrix.java  |  1 +
 .../com/jogamp/opengl/util/TileRendererBase.java   |  1 +
 .../classes/com/jogamp/opengl/util/TimeFrameI.java |  1 +
 .../com/jogamp/opengl/util/av/AudioSink.java       |  3 ++
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |  1 +
 .../jogamp/opengl/util/awt/AWTGLPixelBuffer.java   |  4 +++
 .../com/jogamp/opengl/util/awt/TextRenderer.java   | 32 ++++++++++++++++++
 .../com/jogamp/opengl/util/glsl/ShaderCode.java    |  3 ++
 .../com/jogamp/opengl/util/glsl/ShaderProgram.java |  3 ++
 .../jogamp/opengl/util/glsl/sdk/CompileShader.java |  1 +
 .../opengl/util/glsl/sdk/CompileShaderNVidia.java  |  4 +++
 .../com/jogamp/opengl/util/packrect/Level.java     |  2 ++
 .../com/jogamp/opengl/util/packrect/Rect.java      |  1 +
 .../opengl/util/packrect/RectanglePacker.java      |  2 ++
 .../com/jogamp/opengl/util/texture/Texture.java    |  1 +
 .../jogamp/opengl/util/texture/TextureCoords.java  |  1 +
 .../jogamp/opengl/util/texture/TextureData.java    |  1 +
 .../com/jogamp/opengl/util/texture/TextureIO.java  | 14 ++++++++
 .../opengl/util/texture/TextureSequence.java       |  1 +
 .../jogamp/opengl/util/texture/TextureState.java   |  1 +
 .../jogamp/opengl/util/texture/spi/JPEGImage.java  |  2 ++
 .../opengl/util/texture/spi/LEDataInputStream.java | 18 ++++++++++
 .../util/texture/spi/LEDataOutputStream.java       | 15 +++++++++
 .../util/texture/spi/NetPbmTextureWriter.java      |  1 +
 .../jogamp/opengl/util/texture/spi/PNGImage.java   |  1 +
 .../jogamp/opengl/util/texture/spi/SGIImage.java   |  2 ++
 .../jogamp/opengl/util/texture/spi/TGAImage.java   |  1 +
 .../util/texture/spi/awt/IIOTextureProvider.java   |  3 ++
 .../util/texture/spi/awt/IIOTextureWriter.java     |  1 +
 .../classes/javax/media/opengl/GLArrayData.java    |  1 +
 .../classes/javax/media/opengl/GLDebugMessage.java |  1 +
 .../javax/media/opengl/GLDrawableFactory.java      |  1 +
 src/jogl/classes/javax/media/opengl/GLProfile.java |  5 +++
 .../classes/javax/media/opengl/GLUniformData.java  |  1 +
 .../classes/javax/media/opengl/awt/GLCanvas.java   | 10 ++++--
 .../opengl/glu/GLUtessellatorCallbackAdapter.java  | 12 +++++++
 .../graph/curve/opengl/RegionRendererImpl01.java   |  1 +
 .../jogamp/graph/curve/opengl/RenderStateImpl.java |  3 ++
 .../jogamp/graph/curve/opengl/VBORegion2PES2.java  |  3 ++
 .../jogamp/graph/curve/opengl/VBORegionSPES2.java  |  3 ++
 .../jogamp/graph/curve/tess/CDTriangulator2D.java  |  3 ++
 .../classes/jogamp/graph/font/JavaFontLoader.java  |  3 ++
 .../jogamp/graph/font/UbuntuFontLoader.java        |  2 ++
 .../jogamp/graph/font/typecast/TypecastFont.java   | 14 ++++++++
 .../font/typecast/TypecastFontConstructor.java     |  4 +++
 .../jogamp/graph/font/typecast/TypecastGlyph.java  |  8 +++++
 .../graph/font/typecast/TypecastHMetrics.java      |  6 ++++
 .../jogamp/graph/font/typecast/ot/OTFont.java      |  1 +
 .../graph/font/typecast/ot/table/BaseTable.java    | 13 ++++++++
 .../graph/font/typecast/ot/table/CffTable.java     | 14 ++++++++
 .../font/typecast/ot/table/CharstringType2.java    |  3 ++
 .../font/typecast/ot/table/ClassDefFormat1.java    |  1 +
 .../font/typecast/ot/table/ClassDefFormat2.java    |  1 +
 .../graph/font/typecast/ot/table/CmapFormat.java   |  1 +
 .../graph/font/typecast/ot/table/CmapFormat0.java  |  3 ++
 .../graph/font/typecast/ot/table/CmapFormat2.java  |  3 ++
 .../graph/font/typecast/ot/table/CmapFormat4.java  |  4 +++
 .../graph/font/typecast/ot/table/CmapFormat6.java  |  3 ++
 .../font/typecast/ot/table/CmapFormatUnknown.java  |  3 ++
 .../font/typecast/ot/table/CmapIndexEntry.java     |  2 ++
 .../graph/font/typecast/ot/table/CmapTable.java    |  3 ++
 .../font/typecast/ot/table/CoverageFormat1.java    |  2 ++
 .../font/typecast/ot/table/CoverageFormat2.java    |  2 ++
 .../graph/font/typecast/ot/table/CvtTable.java     |  3 ++
 .../font/typecast/ot/table/DirectoryEntry.java     |  2 ++
 .../graph/font/typecast/ot/table/DsigTable.java    |  3 ++
 .../graph/font/typecast/ot/table/FpgmTable.java    |  3 ++
 .../graph/font/typecast/ot/table/GaspRange.java    |  1 +
 .../graph/font/typecast/ot/table/GaspTable.java    |  3 ++
 .../typecast/ot/table/GlyfCompositeDescript.java   |  7 ++++
 .../graph/font/typecast/ot/table/GlyfDescript.java |  6 ++++
 .../font/typecast/ot/table/GlyfSimpleDescript.java |  8 +++++
 .../graph/font/typecast/ot/table/GlyfTable.java    |  2 ++
 .../graph/font/typecast/ot/table/GposTable.java    |  3 ++
 .../graph/font/typecast/ot/table/GsubTable.java    |  4 +++
 .../graph/font/typecast/ot/table/HdmxTable.java    |  3 ++
 .../graph/font/typecast/ot/table/HeadTable.java    |  3 ++
 .../graph/font/typecast/ot/table/HheaTable.java    |  3 ++
 .../graph/font/typecast/ot/table/HmtxTable.java    |  3 ++
 .../typecast/ot/table/KernSubtableFormat0.java     |  2 ++
 .../typecast/ot/table/KernSubtableFormat2.java     |  2 ++
 .../graph/font/typecast/ot/table/KernTable.java    |  2 ++
 .../typecast/ot/table/LigatureSubstFormat1.java    |  1 +
 .../graph/font/typecast/ot/table/LocaTable.java    |  3 ++
 .../graph/font/typecast/ot/table/LtshTable.java    |  3 ++
 .../graph/font/typecast/ot/table/MaxpTable.java    |  3 ++
 .../graph/font/typecast/ot/table/NameRecord.java   |  1 +
 .../graph/font/typecast/ot/table/NameTable.java    |  2 ++
 .../graph/font/typecast/ot/table/Os2Table.java     |  3 ++
 .../graph/font/typecast/ot/table/Panose.java       |  1 +
 .../graph/font/typecast/ot/table/PcltTable.java    |  3 ++
 .../graph/font/typecast/ot/table/PostTable.java    |  3 ++
 .../graph/font/typecast/ot/table/PrepTable.java    |  3 ++
 .../font/typecast/ot/table/SignatureBlock.java     |  1 +
 .../font/typecast/ot/table/SingleSubstFormat1.java |  3 ++
 .../font/typecast/ot/table/SingleSubstFormat2.java |  3 ++
 .../font/typecast/ot/table/TableDirectory.java     |  1 +
 .../graph/font/typecast/ot/table/VdmxTable.java    |  3 ++
 .../graph/font/typecast/ot/table/VheaTable.java    |  3 ++
 .../graph/font/typecast/ot/table/VmtxTable.java    |  3 ++
 .../graph/font/typecast/tt/engine/Parser.java      |  1 +
 .../classes/jogamp/graph/geom/plane/Path2D.java    |  5 +++
 src/jogl/classes/jogamp/opengl/Debug.java          |  1 +
 .../opengl/DesktopGLDynamicLookupHelper.java       |  1 +
 src/jogl/classes/jogamp/opengl/FPSCounterImpl.java | 11 ++++++
 src/jogl/classes/jogamp/opengl/GLContextImpl.java  |  1 +
 .../jogamp/opengl/GLDebugMessageHandler.java       |  2 ++
 .../classes/jogamp/opengl/GLDrawableHelper.java    |  4 ++-
 .../jogamp/opengl/GLDynamicLibraryBundleInfo.java  |  1 +
 .../jogamp/opengl/GLOffscreenAutoDrawableImpl.java |  1 +
 src/jogl/classes/jogamp/opengl/GLRunnableTask.java |  1 +
 src/jogl/classes/jogamp/opengl/GLWorkerThread.java |  1 +
 src/jogl/classes/jogamp/opengl/MemoryObject.java   |  2 ++
 .../jogamp/opengl/SharedResourceRunner.java        |  1 +
 src/jogl/classes/jogamp/opengl/ThreadingImpl.java  |  1 +
 .../jogamp/opengl/awt/AWTThreadingPlugin.java      |  3 ++
 .../classes/jogamp/opengl/awt/AWTTilePainter.java  |  1 +
 src/jogl/classes/jogamp/opengl/awt/Java2D.java     |  3 ++
 .../classes/jogamp/opengl/awt/VersionApplet.java   |  9 +++++
 .../egl/DesktopES2DynamicLibraryBundleInfo.java    |  5 +++
 .../classes/jogamp/opengl/egl/EGLDisplayUtil.java  |  3 ++
 .../classes/jogamp/opengl/egl/EGLDrawable.java     |  1 +
 .../opengl/egl/EGLES1DynamicLibraryBundleInfo.java |  1 +
 .../opengl/egl/EGLES2DynamicLibraryBundleInfo.java |  1 +
 .../egl/EGLGraphicsConfigurationFactory.java       |  1 +
 .../jogamp/opengl/egl/EGLUpstreamSurfaceHook.java  |  1 +
 .../classes/jogamp/opengl/glu/GLUquadricImpl.java  |  6 ++++
 .../opengl/glu/gl2/nurbs/GL2CurveEvaluator.java    |  6 ++++
 .../opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java  |  8 +++++
 .../jogamp/opengl/glu/mipmap/Extract1010102.java   |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract1555rev.java   |  2 ++
 .../opengl/glu/mipmap/Extract2101010rev.java       |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract233rev.java    |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract332.java       |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract4444.java      |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract4444rev.java   |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract5551.java      |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract565.java       |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract565rev.java    |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract8888.java      |  2 ++
 .../jogamp/opengl/glu/mipmap/Extract8888rev.java   |  2 ++
 .../jogamp/opengl/glu/mipmap/ExtractFloat.java     |  2 ++
 .../jogamp/opengl/glu/mipmap/ExtractSByte.java     |  2 ++
 .../jogamp/opengl/glu/mipmap/ExtractSInt.java      |  2 ++
 .../jogamp/opengl/glu/mipmap/ExtractSShort.java    |  2 ++
 .../jogamp/opengl/glu/mipmap/ExtractUByte.java     |  2 ++
 .../jogamp/opengl/glu/mipmap/ExtractUInt.java      |  2 ++
 .../jogamp/opengl/glu/mipmap/ExtractUShort.java    |  2 ++
 .../opengl/glu/tessellator/PriorityQHeap.java      |  7 ++++
 .../opengl/glu/tessellator/PriorityQSort.java      |  7 ++++
 .../jogamp/opengl/glu/tessellator/Render.java      |  3 ++
 .../jogamp/opengl/glu/tessellator/Sweep.java       |  2 ++
 .../jogamp/opengl/macosx/cgl/MacOSXCGLContext.java |  1 +
 .../macosx/cgl/MacOSXCGLDrawableFactory.java       |  1 +
 .../macosx/cgl/MacOSXCGLGraphicsConfiguration.java |  1 +
 .../cgl/MacOSXCGLGraphicsConfigurationFactory.java |  1 +
 .../MacOSXAWTCGLGraphicsConfigurationFactory.java  |  1 +
 .../opengl/util/GLArrayHandlerInterleaved.java     |  3 ++
 .../jogamp/opengl/util/GLDataArrayHandler.java     |  3 ++
 .../jogamp/opengl/util/GLFixedArrayHandler.java    |  3 ++
 .../opengl/util/GLFixedArrayHandlerFlat.java       |  3 ++
 .../jogamp/opengl/util/GLVBOArrayHandler.java      |  1 +
 .../jogamp/opengl/util/av/EGLMediaPlayerImpl.java  |  1 +
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   |  5 +++
 .../av/impl/FFMPEGDynamicLibraryBundleInfo.java    |  2 ++
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     |  1 +
 .../jogamp/opengl/util/glsl/GLSLArrayHandler.java  |  3 ++
 .../opengl/util/glsl/GLSLArrayHandlerFlat.java     |  3 ++
 .../util/glsl/GLSLArrayHandlerInterleaved.java     |  3 ++
 .../opengl/util/glsl/fixedfunc/FixedFuncHook.java  | 39 ++++++++++++++++++++++
 .../util/glsl/fixedfunc/FixedFuncPipeline.java     |  1 +
 .../jogamp/opengl/util/jpeg/JPEGDecoder.java       | 12 +++++++
 .../classes/jogamp/opengl/util/pngj/ImageLine.java |  1 +
 .../jogamp/opengl/util/pngj/ImageLineHelper.java   |  1 +
 .../jogamp/opengl/util/pngj/PngHelperInternal.java |  1 +
 .../classes/jogamp/opengl/util/pngj/PngReader.java |  1 +
 .../opengl/util/pngj/chunks/ChunkHelper.java       |  2 ++
 .../jogamp/opengl/util/pngj/chunks/ChunkRaw.java   |  1 +
 .../jogamp/opengl/util/pngj/chunks/ChunksList.java |  4 +++
 .../util/pngj/chunks/ChunksListForWrite.java       |  2 ++
 .../opengl/util/pngj/chunks/PngChunkSingle.java    |  1 +
 .../opengl/util/pngj/chunks/PngMetadata.java       |  1 +
 .../windows/wgl/WindowsWGLDrawableFactory.java     |  1 +
 .../wgl/WindowsWGLGraphicsConfiguration.java       |  2 ++
 .../WindowsWGLGraphicsConfigurationFactory.java    |  1 +
 .../WindowsAWTWGLGraphicsConfigurationFactory.java |  1 +
 .../opengl/x11/glx/X11GLXDrawableFactory.java      |  1 +
 .../x11/glx/X11GLXGraphicsConfiguration.java       |  2 ++
 .../glx/X11GLXGraphicsConfigurationFactory.java    |  1 +
 .../nativewindow/awt/AWTGraphicsConfiguration.java |  1 +
 .../jogamp/nativewindow/awt/AWTGraphicsScreen.java |  1 +
 .../nativewindow/awt/AWTWindowClosingProtocol.java |  2 ++
 .../nativewindow/awt/DirectDataBufferInt.java      |  4 +++
 .../nativewindow/macosx/MacOSXGraphicsDevice.java  |  1 +
 .../com/jogamp/nativewindow/swt/SWTAccessor.java   |  4 +++
 .../windows/WindowsGraphicsDevice.java             |  1 +
 .../jogamp/nativewindow/x11/X11GraphicsScreen.java |  1 +
 .../nativewindow/DefaultCapabilitiesChooser.java   |  1 +
 .../nativewindow/DefaultGraphicsConfiguration.java |  4 +++
 .../media/nativewindow/DefaultGraphicsScreen.java  |  2 ++
 .../nativewindow/GraphicsConfigurationFactory.java |  2 ++
 .../media/nativewindow/NativeWindowFactory.java    |  4 +++
 .../javax/media/nativewindow/ProxySurface.java     |  1 +
 .../javax/media/nativewindow/VisualIDHolder.java   |  1 +
 .../javax/media/nativewindow/util/Dimension.java   |  2 ++
 .../nativewindow/util/DimensionImmutable.java      |  2 ++
 .../javax/media/nativewindow/util/Insets.java      |  3 ++
 .../media/nativewindow/util/InsetsImmutable.java   |  2 ++
 .../javax/media/nativewindow/util/Point.java       |  3 ++
 .../media/nativewindow/util/PointImmutable.java    |  2 ++
 .../javax/media/nativewindow/util/Rectangle.java   |  3 ++
 .../nativewindow/util/RectangleImmutable.java      |  2 ++
 .../javax/media/nativewindow/util/SurfaceSize.java |  3 ++
 .../classes/jogamp/nativewindow/Debug.java         |  1 +
 .../DefaultGraphicsConfigurationFactoryImpl.java   |  1 +
 .../jogamp/nativewindow/GlobalToolkitLock.java     |  1 +
 .../jogamp/nativewindow/NWJNILibLoader.java        |  1 +
 .../nativewindow/NativeWindowFactoryImpl.java      |  1 +
 .../jogamp/nativewindow/NullToolkitLock.java       |  1 +
 .../jogamp/nativewindow/ProxySurfaceImpl.java      |  1 +
 .../jogamp/nativewindow/ResourceToolkitLock.java   |  1 +
 .../nativewindow/SharedResourceToolkitLock.java    |  1 +
 .../jogamp/nativewindow/SurfaceUpdatedHelper.java  |  1 +
 .../jogamp/nativewindow/jawt/JAWTJNILibLoader.java |  1 +
 .../classes/jogamp/nativewindow/jawt/JAWTUtil.java |  4 +++
 .../nativewindow/jawt/macosx/MacOSXJAWTWindow.java | 10 ++++++
 .../jawt/windows/Win32SunJDKReflection.java        |  1 +
 .../jawt/windows/WindowsJAWTWindow.java            |  5 +++
 .../nativewindow/jawt/x11/X11JAWTWindow.java       |  5 +++
 .../nativewindow/jawt/x11/X11SunJDKReflection.java |  1 +
 .../jogamp/nativewindow/macosx/OSXUtil.java        |  2 +-
 .../x11/X11GraphicsConfigurationFactory.java       |  1 +
 .../classes/jogamp/nativewindow/x11/X11Util.java   |  2 ++
 .../awt/X11AWTGraphicsConfigurationFactory.java    |  1 +
 src/newt/classes/com/jogamp/newt/Display.java      |  2 ++
 .../classes/com/jogamp/newt/MonitorDevice.java     |  3 ++
 src/newt/classes/com/jogamp/newt/MonitorMode.java  |  8 +++++
 src/newt/classes/com/jogamp/newt/NewtFactory.java  |  1 +
 src/newt/classes/com/jogamp/newt/Screen.java       |  2 ++
 .../classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 13 ++++++++
 .../jogamp/newt/awt/applet/JOGLNewtApplet1Run.java |  4 +++
 .../jogamp/newt/awt/applet/JOGLNewtAppletBase.java |  6 ++++
 .../jogamp/newt/event/DoubleTapScrollGesture.java  |  1 +
 .../classes/com/jogamp/newt/event/InputEvent.java  |  2 ++
 .../classes/com/jogamp/newt/event/KeyAdapter.java  |  2 ++
 .../classes/com/jogamp/newt/event/KeyEvent.java    |  2 ++
 .../com/jogamp/newt/event/MonitorEvent.java        |  2 ++
 .../com/jogamp/newt/event/MouseAdapter.java        |  8 +++++
 .../classes/com/jogamp/newt/event/MouseEvent.java  |  2 ++
 .../classes/com/jogamp/newt/event/NEWTEvent.java   |  1 +
 .../com/jogamp/newt/event/PinchToZoomGesture.java  |  1 +
 .../com/jogamp/newt/event/TraceKeyAdapter.java     |  2 ++
 .../com/jogamp/newt/event/TraceMouseAdapter.java   |  8 +++++
 .../com/jogamp/newt/event/TraceWindowAdapter.java  |  7 ++++
 .../com/jogamp/newt/event/WindowAdapter.java       |  7 ++++
 .../classes/com/jogamp/newt/event/WindowEvent.java |  2 ++
 .../com/jogamp/newt/event/WindowUpdateEvent.java   |  2 ++
 .../com/jogamp/newt/event/awt/AWTKeyAdapter.java   |  2 ++
 .../com/jogamp/newt/event/awt/AWTMouseAdapter.java | 10 ++++++
 .../jogamp/newt/event/awt/AWTWindowAdapter.java    | 22 ++++++++++++
 .../classes/com/jogamp/newt/opengl/GLWindow.java   |  2 ++
 .../classes/com/jogamp/newt/swt/NewtCanvasSWT.java |  3 ++
 src/newt/classes/jogamp/newt/Debug.java            |  1 +
 src/newt/classes/jogamp/newt/DisplayImpl.java      |  9 +++++
 src/newt/classes/jogamp/newt/NEWTJNILibLoader.java |  1 +
 src/newt/classes/jogamp/newt/OffscreenWindow.java  |  7 ++++
 src/newt/classes/jogamp/newt/WindowImpl.java       | 16 +++++++++
 .../newt/awt/event/AWTParentWindowAdapter.java     | 11 ++++++
 .../classes/jogamp/newt/driver/awt/AWTCanvas.java  |  4 +++
 .../classes/jogamp/newt/driver/awt/AWTEDTUtil.java |  1 +
 .../jogamp/newt/driver/awt/DisplayDriver.java      |  4 +++
 .../jogamp/newt/driver/awt/ScreenDriver.java       |  3 ++
 .../jogamp/newt/driver/awt/WindowDriver.java       |  6 ++++
 .../jogamp/newt/driver/bcm/egl/DisplayDriver.java  |  3 ++
 .../jogamp/newt/driver/bcm/egl/ScreenDriver.java   |  4 +++
 .../jogamp/newt/driver/bcm/egl/WindowDriver.java   |  6 ++++
 .../newt/driver/bcm/vc/iv/DisplayDriver.java       |  3 ++
 .../jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java |  3 ++
 .../jogamp/newt/driver/bcm/vc/iv/WindowDriver.java |  6 ++++
 .../newt/driver/intel/gdl/DisplayDriver.java       |  3 ++
 .../jogamp/newt/driver/intel/gdl/ScreenDriver.java |  4 +++
 .../jogamp/newt/driver/intel/gdl/WindowDriver.java |  6 ++++
 .../jogamp/newt/driver/kd/DisplayDriver.java       |  3 ++
 .../jogamp/newt/driver/kd/ScreenDriver.java        |  4 +++
 .../jogamp/newt/driver/kd/WindowDriver.java        |  6 ++++
 .../jogamp/newt/driver/macosx/DisplayDriver.java   |  3 ++
 .../jogamp/newt/driver/macosx/ScreenDriver.java    |  3 ++
 .../jogamp/newt/driver/macosx/WindowDriver.java    | 12 +++++++
 .../jogamp/newt/driver/windows/DisplayDriver.java  |  3 ++
 .../jogamp/newt/driver/windows/WindowDriver.java   |  9 +++++
 .../jogamp/newt/driver/x11/DisplayDriver.java      |  2 ++
 .../jogamp/newt/driver/x11/ScreenDriver.java       |  5 +++
 .../jogamp/newt/driver/x11/WindowDriver.java       |  8 +++++
 src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java   |  2 ++
 323 files changed, 1132 insertions(+), 4 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
index 0a502c123..3b76d2ebf 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
@@ -129,6 +129,7 @@ public class Mixer {
             super("Mixer Thread");
         }
 
+        @Override
         public void run() {
             while (!shutdown) {
                 List/*<Track>*/ curTracks = tracks;
@@ -166,6 +167,7 @@ public class Mixer {
             }
         }
 
+        @Override
         public void run() {
             while (!shutdown) {
                 // Get the next buffer
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
index 0726e5762..79fb80169 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
@@ -206,6 +206,7 @@ class Vec3f {
     z *= arg.z;
   }
 
+  @Override
   public String toString() {
     return "(" + x + ", " + y + ", " + z + ")";
   }
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
index 8429fbcfd..5f358a6d3 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
@@ -402,6 +402,7 @@ public class BuildComposablePipeline {
                     ifNames,
                     null,
                     new CodeGenUtils.EmissionCallback() {
+                        @Override
                         public void emit(PrintWriter w) {
                             emitClassDocComment(w);
                         }
@@ -752,18 +753,22 @@ public class BuildComposablePipeline {
             this.mode = mode;
         }
 
+        @Override
         protected String getOutputName() {
             return className;
         }
 
+        @Override
         protected int getMode() {
             return mode;
         }
 
+        @Override
         protected boolean emptyMethodAllowed() {
             return true;
         }
 
+        @Override
         protected boolean emptyDownstreamAllowed() {
             return true;
         }
@@ -773,6 +778,7 @@ public class BuildComposablePipeline {
             super.preMethodEmissionHook(output);
         }
 
+        @Override
         protected void constructorHook(PrintWriter output) {
             output.print("  public " + getOutputName() + "(");
             output.print(downstreamName + " " + getDownstreamObjectName());
@@ -803,6 +809,7 @@ public class BuildComposablePipeline {
             }
         }
 
+        @Override
         protected void emitClassDocComment(PrintWriter output) {
             output.println("/**");
             output.println(" * Composable pipeline {@link " + outputPackage + "." + outputName + "}, implementing the interface");
@@ -837,10 +844,12 @@ public class BuildComposablePipeline {
             output.println("*/");
         }
 
+        @Override
         protected boolean hasPreDownstreamCallHook(Method m) {
             return null != getMethod(prologClassOpt, m);
         }
 
+        @Override
         protected void preDownstreamCallHook(PrintWriter output, Method m) {
             if (null != prologNameOpt) {
                 output.print(getPrologObjectNameOpt());
@@ -852,10 +861,12 @@ public class BuildComposablePipeline {
             }
         }
 
+        @Override
         protected boolean hasPostDownstreamCallHook(Method m) {
             return false;
         }
 
+        @Override
         protected void postDownstreamCallHook(PrintWriter output, Method m) {
         }
     } // end class CustomPipeline
@@ -869,18 +880,22 @@ public class BuildComposablePipeline {
             className = "Debug" + getBaseInterfaceName();
         }
 
+        @Override
         protected String getOutputName() {
             return className;
         }
 
+        @Override
         protected int getMode() {
             return 0;
         }
 
+        @Override
         protected boolean emptyMethodAllowed() {
             return false;
         }
 
+        @Override
         protected boolean emptyDownstreamAllowed() {
             return false;
         }
@@ -890,6 +905,7 @@ public class BuildComposablePipeline {
             super.preMethodEmissionHook(output);
         }
 
+        @Override
         protected void constructorHook(PrintWriter output) {
             output.print("  public " + getOutputName() + "(");
             output.println(downstreamName + " " + getDownstreamObjectName() + ")");
@@ -971,6 +987,7 @@ public class BuildComposablePipeline {
             output.println("  private GLContext _context;");
         }
 
+        @Override
         protected void emitClassDocComment(PrintWriter output) {
             output.println("/**");
             output.println(" * <p>");
@@ -988,18 +1005,22 @@ public class BuildComposablePipeline {
             output.println(" */");
         }
 
+        @Override
         protected boolean hasPreDownstreamCallHook(Method m) {
             return true;
         }
 
+        @Override
         protected void preDownstreamCallHook(PrintWriter output, Method m) {
             output.println("    checkContext();");
         }
 
+        @Override
         protected boolean hasPostDownstreamCallHook(Method m) {
             return true;
         }
 
+        @Override
         protected void postDownstreamCallHook(PrintWriter output, Method m) {
             if (m.getName().equals("glBegin")) {
                 output.println("    insideBeginEndPair = true;");
@@ -1041,18 +1062,22 @@ public class BuildComposablePipeline {
             className = "Trace" + getBaseInterfaceName();
         }
 
+        @Override
         protected String getOutputName() {
             return className;
         }
 
+        @Override
         protected int getMode() {
             return 0;
         }
 
+        @Override
         protected boolean emptyMethodAllowed() {
             return false;
         }
 
+        @Override
         protected boolean emptyDownstreamAllowed() {
             return false;
         }
@@ -1062,6 +1087,7 @@ public class BuildComposablePipeline {
             super.preMethodEmissionHook(output);
         }
 
+        @Override
         protected void constructorHook(PrintWriter output) {
             output.print("  public " + getOutputName() + "(");
             output.println(downstreamName + " " + getDownstreamObjectName() + ", PrintStream " + getOutputStreamName() + ")");
@@ -1112,6 +1138,7 @@ public class BuildComposablePipeline {
             output.println("}");
         }
 
+        @Override
         protected void emitClassDocComment(PrintWriter output) {
             output.println("/**");
             output.println(" * <p>");
@@ -1129,10 +1156,12 @@ public class BuildComposablePipeline {
             output.println(" */");
         }
 
+        @Override
         protected boolean hasPreDownstreamCallHook(Method m) {
             return true;
         }
 
+        @Override
         protected void preDownstreamCallHook(PrintWriter output, Method m) {
             if (m.getName().equals("glEnd") || m.getName().equals("glEndList")) {
                 output.println("indent-=2;");
@@ -1146,10 +1175,12 @@ public class BuildComposablePipeline {
             output.println(");");
         }
 
+        @Override
         protected boolean hasPostDownstreamCallHook(Method m) {
             return true;
         }
 
+        @Override
         protected void postDownstreamCallHook(PrintWriter output, Method m) {
             Class<?> ret = m.getReturnType();
             if (ret != Void.TYPE) {
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
index 1af632682..547382ed1 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
@@ -134,6 +134,7 @@ public class GLEmitter extends ProcAddressEmitter {
         private List<ConstantDefinition> constants;
         private List<FunctionSymbol> functions;
 
+        @Override
         public void filterSymbols(List<ConstantDefinition> constants,
                 List<FunctionSymbol> functions) {
             this.constants = constants;
@@ -141,10 +142,12 @@ public class GLEmitter extends ProcAddressEmitter {
             doWork();
         }
 
+        @Override
         public List<ConstantDefinition> getConstants() {
             return constants;
         }
 
+        @Override
         public List<FunctionSymbol> getFunctions() {
             return functions;
         }
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
index b98f17117..21946ea89 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
@@ -186,6 +186,7 @@ public class StaticGLGenTask extends Task
      *
      * @see  org.apache.tools.ant.Task#execute()
      */
+    @Override
     public void execute()
         throws BuildException
     {
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
index a17657382..6d9d6f2bb 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
@@ -131,6 +131,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     }
   }
 
+  @Override
   protected String getReturnTypeString(boolean skipArray) {
     if (isForImplementingMethodCall()) {
       JavaType returnType = getBinding().getJavaReturnType();
@@ -142,6 +143,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     return super.getReturnTypeString(skipArray);
   }
 
+  @Override
   protected void emitPreCallSetup(MethodBinding binding, PrintWriter writer) {
     super.emitPreCallSetup(binding, writer);
     for (int i = 0; i < binding.getNumArguments(); i++) {
@@ -162,6 +164,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     return "__buffer_array_" + argNumber;
   }
 
+  @Override
   protected int emitArguments(PrintWriter writer)
   {
     boolean needComma = false;
@@ -242,6 +245,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     return numEmitted;
   }
 
+  @Override
   protected void emitReturnVariableSetupAndCall(MethodBinding binding, PrintWriter writer) {
     writer.print("    ");
     JavaType returnType = binding.getJavaReturnType();
@@ -455,6 +459,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     return numArgsEmitted;
   }
 
+  @Override
   protected void emitCallResultReturn(MethodBinding binding, PrintWriter writer) {
     for (int i = 0; i < binding.getNumArguments(); i++) {
       JavaType type = binding.getJavaArgumentType(i);
@@ -468,6 +473,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     super.emitCallResultReturn(binding, writer);
   }
 
+  @Override
   public String getName() {
     String res = super.getName();
     if (forImplementingMethodCall && bufferObjectVariant) {
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
index f8406075c..3fb315c99 100644
--- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
+++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
@@ -42,6 +42,7 @@ public class GLProcAddressResolver implements FunctionAddressResolver {
 
     public static final boolean DEBUG = false;
 
+    @Override
     public long resolve(String name, DynamicLookupHelper lookup) {
 
         long newProcAddress = 0;
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
index cb2885e0f..60d5199eb 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
@@ -554,6 +554,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
      * as criteria.
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
+    @Override
     public final int compareTo(OutlineShape outline) {
         float size = getBounds().getSize();
         float newSize = outline.getBounds().getSize();
@@ -586,6 +587,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
      * @return true if {@code obj} is an OutlineShape, not null,
      *                 same outlineState, equal bounds and equal outlines in the same order
      */
+    @Override
     public boolean equals(Object obj) {
         if( obj == this) {
             return true;
@@ -614,6 +616,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
     /**
      * @return deep clone of this OutlineShape w/o Region
      */
+    @Override
     public OutlineShape clone() {
         OutlineShape o;
         try {
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
index 9c833fd24..6a8fb6a67 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
@@ -105,6 +105,7 @@ public abstract class RenderState {
         return sb;
     }
 
+    @Override
     public String toString() {
         return toString(null, false).toString();
     }
diff --git a/src/jogl/classes/com/jogamp/graph/font/Font.java b/src/jogl/classes/com/jogamp/graph/font/Font.java
index 82211da92..a4a8fd53d 100644
--- a/src/jogl/classes/com/jogamp/graph/font/Font.java
+++ b/src/jogl/classes/com/jogamp/graph/font/Font.java
@@ -109,5 +109,6 @@ public interface Font {
     public boolean isPrintableChar( char c );
 
     /** Shall return {@link #getFullFamilyName()} */
+    @Override
     public String toString();
 }
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
index dfa6a8635..77a318078 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
@@ -173,6 +173,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
      * as criteria.
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
+    @Override
     public final int compareTo(Outline outline) {
         float size = getBounds().getSize();
         float newSize = outline.getBounds().getSize();
@@ -204,6 +205,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
      * @param obj the Object to compare this Outline with
      * @return true if {@code obj} is an Outline, not null, equals bounds and equal vertices in the same order
      */
+    @Override
     public boolean equals(Object obj) {
         if( obj == this) {
             return true;
@@ -229,6 +231,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
     /**
      * @return deep clone of this Outline
      */
+    @Override
     public Outline clone() {
         Outline o;
         try {
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
index bd0900495..a01cd834f 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
@@ -73,6 +73,7 @@ public class Triangle {
         this.boundaryVertices = boundaryVertices;
     }
 
+    @Override
     public String toString() {
         return "Tri ID: " + id + "\n" +  vertices[0]  + "\n" +  vertices[1] + "\n" +  vertices[2];
     }
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
index 40048235e..994253f71 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
@@ -76,6 +76,7 @@ public interface Vertex extends Vert3fImmutable, Cloneable {
      * @param obj the Object to compare this Vertex with
      * @return true if {@code obj} is a Vertex and not null, on-curve flag is equal and has same vertex- and tex-coords.
      */
+    @Override
     boolean equals(Object obj);
 
     /**
diff --git a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java b/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
index 6b07688a7..b27604a44 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
@@ -45,14 +45,17 @@ public class SVertex implements Vertex {
     public static Factory factory() { return factory; }
 
     public static class Factory implements Vertex.Factory<SVertex> {
+        @Override
         public SVertex create() {
             return new SVertex();
         }
 
+        @Override
         public SVertex create(float x, float y, float z, boolean onCurve) {
             return new SVertex(x, y, z, onCurve);
         }
 
+        @Override
         public SVertex create(float[] coordsBuffer, int offset, int length, boolean onCurve) {
             return new SVertex(coordsBuffer, offset, length, onCurve);
         }
@@ -78,12 +81,14 @@ public class SVertex implements Vertex {
         setOnCurve(onCurve);
     }
 
+    @Override
     public final void setCoord(float x, float y, float z) {
         this.coord[0] = x;
         this.coord[1] = y;
         this.coord[2] = z;
     }
 
+    @Override
     public final void setCoord(float[] coordsBuffer, int offset, int length) {
         System.arraycopy(coordsBuffer, offset, coord, 0, length);
     }
@@ -98,46 +103,57 @@ public class SVertex implements Vertex {
         return coord;
     }
 
+    @Override
     public final void setX(float x) {
         this.coord[0] = x;
     }
 
+    @Override
     public final void setY(float y) {
         this.coord[1] = y;
     }
 
+    @Override
     public final void setZ(float z) {
         this.coord[2] = z;
     }
 
+    @Override
     public final float getX() {
         return this.coord[0];
     }
 
+    @Override
     public final float getY() {
         return this.coord[1];
     }
 
+    @Override
     public final float getZ() {
         return this.coord[2];
     }
 
+    @Override
     public final boolean isOnCurve() {
         return onCurve;
     }
 
+    @Override
     public final void setOnCurve(boolean onCurve) {
         this.onCurve = onCurve;
     }
 
+    @Override
     public final int getId(){
         return id;
     }
 
+    @Override
     public final void setId(int id){
         this.id = id;
     }
 
+    @Override
     public boolean equals(Object obj) {
         if( obj == this) {
             return true;
@@ -152,15 +168,18 @@ public class SVertex implements Vertex {
                VectorUtil.checkEquality(getCoord(), v.getCoord()) ;
     }
 
+    @Override
     public final float[] getTexCoord() {
         return texCoord;
     }
 
+    @Override
     public final void setTexCoord(float s, float t) {
         this.texCoord[0] = s;
         this.texCoord[1] = t;
     }
 
+    @Override
     public final void setTexCoord(float[] texCoordsBuffer, int offset, int length) {
         System.arraycopy(texCoordsBuffer, offset, texCoord, 0, length);
     }
@@ -168,10 +187,12 @@ public class SVertex implements Vertex {
     /**
      * @return deep clone of this Vertex, but keeping the id blank
      */
+    @Override
     public SVertex clone(){
         return new SVertex(this.coord, 0, 3, this.texCoord, 0, 2, this.onCurve);
     }
 
+    @Override
     public String toString() {
         return "[ID: " + id + ", onCurve: " + onCurve +
                ": p " + coord[0] + ", " + coord[1] + ", " + coord[2] +
diff --git a/src/jogl/classes/com/jogamp/opengl/FBObject.java b/src/jogl/classes/com/jogamp/opengl/FBObject.java
index c78b2b83d..72041a389 100644
--- a/src/jogl/classes/com/jogamp/opengl/FBObject.java
+++ b/src/jogl/classes/com/jogamp/opengl/FBObject.java
@@ -292,6 +292,7 @@ public class FBObject {
 
         int objectHashCode() { return super.hashCode(); }
 
+        @Override
         public String toString() {
             return getClass().getSimpleName()+"[type "+type+", format "+toHexString(format)+", "+width+"x"+height+
                    "; name "+toHexString(name)+", obj "+toHexString(objectHashCode())+"]";
@@ -414,6 +415,7 @@ public class FBObject {
             }
         }
 
+        @Override
         public String toString() {
             return getClass().getSimpleName()+"[type "+type+", format "+toHexString(format)+", samples "+samples+", "+getWidth()+"x"+getHeight()+
                    ", name "+toHexString(getName())+", obj "+toHexString(objectHashCode())+"]";
@@ -527,6 +529,7 @@ public class FBObject {
                 setName(0);
             }
         }
+        @Override
         public String toString() {
             return getClass().getSimpleName()+"[type "+type+", target GL_TEXTURE_2D, level 0, format "+toHexString(format)+
                                               ", "+getWidth()+"x"+getHeight()+", border 0, dataFormat "+toHexString(dataFormat)+
@@ -2306,6 +2309,7 @@ public class FBObject {
 
     int objectHashCode() { return super.hashCode(); }
 
+    @Override
     public final String toString() {
         final String caps = null != colorAttachmentPoints ? Arrays.asList(colorAttachmentPoints).toString() : null ;
         return "FBO[name r/w "+fbName+"/"+getReadFramebuffer()+", init "+initialized+", bound "+bound+", size "+width+"x"+height+
diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
index ee77f8d2d..9c9129ae6 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
@@ -262,6 +262,7 @@ public class GLRendererQuirks {
         return sb;
     }
 
+    @Override
     public final String toString() {
         return toString(null).toString();
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
index 8d2d07d58..4270607f2 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
@@ -43,6 +43,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
     private static final List<String> glueLibNames;
     static {
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
+            @Override
             public Object run() {
                 Platform.initSingleton();
 
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
index f1880a61b..d48677da5 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
@@ -333,10 +333,12 @@ public class AABBox implements Cloneable {
         return high[2] - low[2];
     }
 
+    @Override
     public final AABBox clone() {
         return new AABBox(this.low, this.high);
     }
 
+    @Override
     public final boolean equals(Object obj) {
         if( obj == this ) {
             return true;
@@ -349,6 +351,7 @@ public class AABBox implements Cloneable {
                VectorUtil.checkEquality(high, other.high) ;
     }
 
+    @Override
     public final String toString() {
         return "[ "+low[0]+"/"+low[1]+"/"+low[1]+" .. "+high[0]+"/"+high[0]+"/"+high[0]+", ctr "+
                     center[0]+"/"+center[1]+"/"+center[1]+" ]";
diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
index 33941a407..1a3e1e0c0 100644
--- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
+++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
@@ -286,6 +286,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
                                  final GLCapabilitiesChooser chooser, final GLContext shareWith) {
        final GLCanvas[] res = new GLCanvas[] { null };
        parent.getDisplay().syncExec(new Runnable() {
+           @Override
            public void run() {
                res[0] = new GLCanvas( parent, style, caps, chooser, shareWith );
            }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
index 80289acf3..d0de3b3a0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
@@ -58,6 +58,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
     private Map<RepaintManager,RepaintManager> repaintManagers = new IdentityHashMap<RepaintManager,RepaintManager>();
     private Map<JComponent,Rectangle>  dirtyRegions    = new IdentityHashMap<JComponent,Rectangle>();
 
+    @Override
     public void display(ArrayList<GLAutoDrawable> drawables,
                         boolean ignoreExceptions,
                         boolean printExceptions) {
@@ -97,6 +98,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
     // Uses RepaintManager APIs to implement more efficient redrawing of
     // the Swing widgets we're animating
     private Runnable drawWithRepaintManagerRunnable = new Runnable() {
+            @Override
             public void run() {
                 for (Iterator<JComponent> iter = lightweights.iterator(); iter.hasNext(); ) {
                     JComponent comp = iter.next();
@@ -164,6 +166,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
             }
         };
 
+    @Override
     public boolean blockUntilDone(Thread thread) {
         return Thread.currentThread() != thread && !EventQueue.isDispatchThread();
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index cdfb73b21..27b9427eb 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
@@ -109,6 +109,7 @@ public class Animator extends AnimatorBase {
         }
     }
 
+    @Override
     protected String getBaseName(String prefix) {
         return prefix + "Animator" ;
     }
@@ -138,10 +139,12 @@ public class Animator extends AnimatorBase {
     }
 
     class MainLoop implements Runnable {
+        @Override
         public String toString() {
             return "[started "+isStartedImpl()+", animating "+isAnimatingImpl()+", paused "+isPausedImpl()+", drawable "+drawables.size()+", drawablesEmpty "+drawablesEmpty+"]";
         }
 
+        @Override
         public void run() {
             try {
                 if(DEBUG) {
@@ -228,6 +231,7 @@ public class Animator extends AnimatorBase {
     private final boolean isAnimatingImpl() {
         return animThread != null && isAnimating ;
     }
+    @Override
     public final boolean isAnimating() {
         stateSync.lock();
         try {
@@ -240,6 +244,7 @@ public class Animator extends AnimatorBase {
     private final boolean isPausedImpl() {
         return animThread != null && pauseIssued ;
     }
+    @Override
     public final boolean isPaused() {
         stateSync.lock();
         try {
@@ -262,6 +267,7 @@ public class Animator extends AnimatorBase {
         threadGroup = tg;
     }
 
+    @Override
     public synchronized boolean start() {
         if ( isStartedImpl() ) {
             return false;
@@ -286,10 +292,12 @@ public class Animator extends AnimatorBase {
         return finishLifecycleAction(waitForStartedCondition, 0);
     }
     private final Condition waitForStartedCondition = new Condition() {
+        @Override
         public boolean eval() {
             return !isStartedImpl() || (!drawablesEmpty && !isAnimating) ;
         } };
 
+    @Override
     public synchronized boolean stop() {
         if ( !isStartedImpl() ) {
             return false;
@@ -298,10 +306,12 @@ public class Animator extends AnimatorBase {
         return finishLifecycleAction(waitForStoppedCondition, 0);
     }
     private final Condition waitForStoppedCondition = new Condition() {
+        @Override
         public boolean eval() {
             return isStartedImpl();
         } };
 
+    @Override
     public synchronized boolean pause() {
         if ( !isStartedImpl() || pauseIssued ) {
             return false;
@@ -310,11 +320,13 @@ public class Animator extends AnimatorBase {
         return finishLifecycleAction(waitForPausedCondition, 0);
     }
     private final Condition waitForPausedCondition = new Condition() {
+        @Override
         public boolean eval() {
             // end waiting if stopped as well
             return isStartedImpl() && isAnimating;
         } };
 
+    @Override
     public synchronized boolean resume() {
         if ( !isStartedImpl() || !pauseIssued ) {
             return false;
@@ -323,6 +335,7 @@ public class Animator extends AnimatorBase {
         return finishLifecycleAction(waitForResumeCondition, 0);
     }
     private final Condition waitForResumeCondition = new Condition() {
+        @Override
         public boolean eval() {
             // end waiting if stopped as well
             return isStartedImpl() && ( !drawablesEmpty && !isAnimating || drawablesEmpty && !pauseIssued ) ;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
index b447a339b..f6ee3376f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
@@ -194,6 +194,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
             resume();
         }
         final Condition waitForAnimatingAndECTCondition = new Condition() {
+            @Override
             public boolean eval() {
                 final Thread dect = drawable.getExclusiveContextThread();
                 return isStarted() && !isPaused() && !isAnimating() && ( exclusiveContext && null == dect || !exclusiveContext && null != dect );
@@ -217,6 +218,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         if( exclusiveContext && isAnimating() ) {
             drawable.setExclusiveContextThread( null );
             final Condition waitForNullECTCondition = new Condition() {
+                @Override
                 public boolean eval() {
                     return null != drawable.getExclusiveContextThread();
                 } };
@@ -240,6 +242,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         notifyAll();
     }
     private final Condition waitForNotAnimatingIfEmptyCondition = new Condition() {
+        @Override
         public boolean eval() {
             return isStarted() && drawablesEmpty && isAnimating();
         } };
@@ -577,6 +580,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
 
     protected static String getThreadName() { return Thread.currentThread().getName(); }
 
+    @Override
     public String toString() {
         return getClass().getName()+"[started "+isStarted()+", animating "+isAnimating()+", paused "+isPaused()+", drawable "+drawables.size()+
                ", totals[dt "+getTotalFPSDuration()+", frames "+getTotalFPSFrames()+", fps "+getTotalFPS()+
diff --git a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
index 0477e1903..a9c6e6456 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
@@ -41,6 +41,7 @@ import javax.media.opengl.GLAutoDrawable;
     up this behavior if desired. */
 
 class DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl {
+    @Override
     public void display(ArrayList<GLAutoDrawable> drawables,
                         boolean ignoreExceptions,
                         boolean printExceptions) {
@@ -60,6 +61,7 @@ class DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl {
         }
     }
 
+    @Override
     public boolean blockUntilDone(Thread thread) {
         return Thread.currentThread() != thread;
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
index b48169c27..351c47e7e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
@@ -64,6 +64,7 @@ public class FPSAnimator extends AnimatorBase {
     private volatile boolean shouldRun;  // MainTask trigger
     private volatile boolean shouldStop; // MainTask trigger
 
+    @Override
     protected String getBaseName(String prefix) {
         return "FPS" + prefix + "Animator" ;
     }
@@ -140,10 +141,12 @@ public class FPSAnimator extends AnimatorBase {
 
         public boolean isActive() { return !alreadyStopped && !alreadyPaused; }
 
+        @Override
         public String toString() {
             return "Task[thread "+animThread+", stopped "+alreadyStopped+", paused "+alreadyPaused+" shouldRun "+shouldRun+", shouldStop "+shouldStop+" -- started "+isStartedImpl()+", animating "+isAnimatingImpl()+", paused "+isPausedImpl()+", drawable "+drawables.size()+", drawablesEmpty "+drawablesEmpty+"]";
         }
 
+        @Override
         public void run() {
             if( justStarted ) {
                 justStarted = false;
@@ -208,6 +211,7 @@ public class FPSAnimator extends AnimatorBase {
     private final boolean isAnimatingImpl() {
         return animThread != null && isAnimating ;
     }
+    @Override
     public final boolean isAnimating() {
         stateSync.lock();
         try {
@@ -220,6 +224,7 @@ public class FPSAnimator extends AnimatorBase {
     private final boolean isPausedImpl() {
         return animThread != null && ( !shouldRun && !shouldStop ) ;
     }
+    @Override
     public final boolean isPaused() {
         stateSync.lock();
         try {
@@ -231,6 +236,7 @@ public class FPSAnimator extends AnimatorBase {
 
     static int timerNo = 0;
 
+    @Override
     public synchronized boolean start() {
         if ( null != timer || null != task || isStartedImpl() ) {
             return false;
@@ -254,10 +260,12 @@ public class FPSAnimator extends AnimatorBase {
         return res;
     }
     private final Condition waitForStartedAddedCondition = new Condition() {
+        @Override
         public boolean eval() {
             return !isStartedImpl() || !isAnimating ;
         } };
     private final Condition waitForStartedEmptyCondition = new Condition() {
+        @Override
         public boolean eval() {
             return !isStartedImpl() || isAnimating ;
         } };
@@ -265,6 +273,7 @@ public class FPSAnimator extends AnimatorBase {
     /** Stops this FPSAnimator. Due to the implementation of the
     FPSAnimator it is not guaranteed that the FPSAnimator will be
     completely stopped by the time this method returns. */
+    @Override
     public synchronized boolean stop() {
         if ( null == timer || !isStartedImpl() ) {
             return false;
@@ -297,10 +306,12 @@ public class FPSAnimator extends AnimatorBase {
         return res;
     }
     private final Condition waitForStoppedCondition = new Condition() {
+        @Override
         public boolean eval() {
             return isStartedImpl();
         } };
 
+    @Override
     public synchronized boolean pause() {
         if ( !isStartedImpl() || ( null != task && isPausedImpl() ) ) {
             return false;
@@ -327,11 +338,13 @@ public class FPSAnimator extends AnimatorBase {
         return res;
     }
     private final Condition waitForPausedCondition = new Condition() {
+        @Override
         public boolean eval() {
             // end waiting if stopped as well
             return isAnimating && isStartedImpl();
         } };
 
+    @Override
     public synchronized boolean resume() {
         if ( null != task || !isStartedImpl() || !isPausedImpl() ) {
             return false;
@@ -353,6 +366,7 @@ public class FPSAnimator extends AnimatorBase {
         return res;
     }
     private final Condition waitForResumeCondition = new Condition() {
+        @Override
         public boolean eval() {
             // end waiting if stopped as well
             return !drawablesEmpty && !isAnimating && isStartedImpl();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
index 2d685a1a8..f480c4bde 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
@@ -321,6 +321,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
     Buffers.putf(buffer, v);
   }
 
+  @Override
   public String toString() {
     return "GLArrayDataClient["+name+
                        ", index "+index+
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java
index 701f88e59..9a0f1cb37 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java
@@ -31,6 +31,7 @@ public interface GLArrayDataEditable extends GLArrayData {
     // Data and GL state modification ..
     //
 
+    @Override
     public void destroy(GL gl);
 
     public void reset(GL gl);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
index 80639c5c7..e30fea2f4 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
@@ -327,6 +327,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
   // Data and GL state modification ..
   //
 
+  @Override
   public void destroy(GL gl) {
     // super.destroy(gl):
     // - GLArrayDataClient.destroy(gl): disables & clears client-side buffer
@@ -349,11 +350,13 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * switch to client side data one
    * Only possible if buffer is defined.
    */
+  @Override
   public void    setVBOEnabled(boolean vboUsage) {
     checkSeal(false);
     super.setVBOEnabled(vboUsage);
   }
 
+  @Override
   public String toString() {
     return "GLArrayDataServer["+name+
                        ", index "+index+
@@ -384,6 +387,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
   // non public matters ..
   //
 
+  @Override
   protected void init(String name, int index, int comps, int dataType, boolean normalized,
                       int stride, Buffer data, int initialElementCount, boolean isVertexAttribute,
                       GLArrayHandler glArrayHandler,
@@ -396,6 +400,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
     vboEnabled=true;
   }
 
+  @Override
   protected void init_vbo(GL gl) {
     super.init_vbo(gl);
     if(vboEnabled && vboName==0) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
index f0c6be44f..50124c349 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
@@ -216,6 +216,7 @@ public class GLPixelBuffer {
                 }
             }
         }
+        @Override
         public String toString() {
             return "PixelAttributes[comp "+componentCount+", fmt 0x"+Integer.toHexString(format)+", type 0x"+Integer.toHexString(type)+", bytesPerPixel "+bytesPerPixel+"]";
         }
@@ -258,6 +259,7 @@ public class GLPixelBuffer {
         .append(", buffer[bytes ").append(byteSize).append(", elemSize ").append(bufferElemSize).append(", ").append(buffer).append("]");
         return sb;
     }
+    @Override
     public String toString() {
         return "GLPixelBuffer["+toString(null).toString()+"]";
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
index 697b7cca0..986f6d8d3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
@@ -173,6 +173,7 @@ public class ImmModeSink {
     vboSet.reset(gl);
   }
 
+  @Override
   public String toString() {
     StringBuilder sb = new StringBuilder("ImmModeSink[");
     sb.append(",\n\tVBO list: "+vboSetList.size()+" [");
@@ -1236,6 +1237,7 @@ public class ImmModeSink {
     }
   }
 
+    @Override
     public String toString() {
         final String glslS = useGLSL ?
                        ", useShaderState "+(null!=shaderState)+
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
index b4a0156e9..218897ffe 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
@@ -897,6 +897,7 @@ public class PMVMatrix implements GLMatrixFunc {
         return sb;
     }
 
+    @Override
     public String toString() {
         return toString(null, "%10.5f").toString();
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
index ff7cc5516..2ac4b1f82 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
@@ -244,6 +244,7 @@ public abstract class TileRendererBase {
         sb.append(", isSetup "+isSetup());
         return sb;
     }
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         return getClass().getSimpleName()+
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
index 45f5d2694..b29846d91 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
@@ -74,6 +74,7 @@ public class TimeFrameI {
     /** Set this frame's duration in milliseconds. */
     public final void setDuration(int duration) { this.duration = duration; }
 
+    @Override
     public String toString() {
         return "TimeFrame[pts " + pts + " ms, l " + duration + " ms]";
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
index dffdfae8e..b964245ad 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
@@ -193,6 +193,7 @@ public interface AudioSink {
             return ( byteCount << 3 ) / sampleSize;
         }
 
+        @Override
         public String toString() {
             return "AudioDataFormat[sampleRate "+sampleRate+", sampleSize "+sampleSize+", channelCount "+channelCount+
                    ", signed "+signed+", fixedP "+fixedP+", "+(planar?"planar":"packed")+", "+(littleEndian?"little":"big")+"-endian]"; }
@@ -217,6 +218,7 @@ public interface AudioSink {
         /** Set this frame's size in bytes. */
         public final void setByteSize(int size) { this.byteSize=size; }
 
+        @Override
         public String toString() {
             return "AudioFrame[pts " + pts + " ms, l " + duration + " ms, "+byteSize + " bytes]";
         }
@@ -235,6 +237,7 @@ public interface AudioSink {
         /** Get this frame's data. */
         public final ByteBuffer getData() { return data; }
 
+        @Override
         public String toString() {
             return "AudioDataFrame[pts " + pts + " ms, l " + duration + " ms, "+byteSize + " bytes, " + data + "]";
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index db6f5fdee..3f6b78d7e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -609,6 +609,7 @@ public interface GLMediaPlayer extends TextureSequence {
     public int getHeight();
 
     /** Returns a string represantation of this player, incl. state and audio/video details. */
+    @Override
     public String toString();
 
     /** Returns a string represantation of this player's performance values. */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
index fb2bdbbcb..77b14b424 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
@@ -117,11 +117,13 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
         return new BufferedImage (cm, raster1, cm.isAlphaPremultiplied(), null);
     }
 
+    @Override
     public StringBuilder toString(StringBuilder sb) {
         sb = super.toString(sb);
         sb.append(", allowRowStride ").append(allowRowStride).append(", image [").append(image.getWidth()).append("x").append(image.getHeight()).append(", ").append(image.toString()).append("]");
         return sb;
     }
+    @Override
     public String toString() {
         return "AWTGLPixelBuffer["+toString(null).toString()+"]";
     }
@@ -213,6 +215,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
         }
 
         /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link AWTGLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */
+        @Override
         public AWTGLPixelBuffer getSingleBuffer(GLPixelAttributes pixelAttributes) {
             return 4 == pixelAttributes.componentCount ? singleRGBA4 : singleRGB3;
         }
@@ -221,6 +224,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
          * Initializes the single {@link AWTGLPixelBuffer} w/ a given size, if not yet {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated}.
          * @return the newly initialized single {@link AWTGLPixelBuffer}, or null if already allocated.
          */
+        @Override
         public AWTGLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack) {
             if( 4 == componentCount ) {
                 if( null != singleRGBA4 ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
index 6e504c089..73d06cae0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
@@ -755,6 +755,7 @@ public class TextRenderer {
         // Iterate through the contents of the backing store, removing
         // text strings that haven't been used recently
         packer.visit(new RectVisitor() {
+                @Override
                 public void visit(Rect rect) {
                     TextData data = (TextData) rect.getUserData();
 
@@ -914,11 +915,13 @@ public class TextRenderer {
 
         final FPSAnimator anim = new FPSAnimator(dbgCanvas, 10);
         dbgFrame.addWindowListener(new WindowAdapter() {
+                @Override
                 public void windowClosing(WindowEvent e) {
                     // Run this on another thread than the AWT event queue to
                     // make sure the call to Animator.stop() completes before
                     // exiting
                     new Thread(new Runnable() {
+                            @Override
                             public void run() {
                                 anim.stop();
                             }
@@ -1009,12 +1012,14 @@ public class TextRenderer {
             mCurrentIndex = 0;
         }
 
+        @Override
         public char last() {
             mCurrentIndex = Math.max(0, mLength - 1);
 
             return current();
         }
 
+        @Override
         public char current() {
             if ((mLength == 0) || (mCurrentIndex >= mLength)) {
                 return CharacterIterator.DONE;
@@ -1023,36 +1028,43 @@ public class TextRenderer {
             return mSequence.charAt(mCurrentIndex);
         }
 
+        @Override
         public char next() {
             mCurrentIndex++;
 
             return current();
         }
 
+        @Override
         public char previous() {
             mCurrentIndex = Math.max(mCurrentIndex - 1, 0);
 
             return current();
         }
 
+        @Override
         public char setIndex(int position) {
             mCurrentIndex = position;
 
             return current();
         }
 
+        @Override
         public int getBeginIndex() {
             return 0;
         }
 
+        @Override
         public int getEndIndex() {
             return mLength;
         }
 
+        @Override
         public int getIndex() {
             return mCurrentIndex;
         }
 
+        @Override
         public Object clone() {
             CharSequenceIterator iter = new CharSequenceIterator(mSequence);
             iter.mCurrentIndex = mCurrentIndex;
@@ -1060,6 +1072,7 @@ public class TextRenderer {
             return iter;
         }
 
+        @Override
         public char first() {
             if (mLength == 0) {
                 return CharacterIterator.DONE;
@@ -1143,6 +1156,7 @@ public class TextRenderer {
     class Manager implements BackingStoreManager {
         private Graphics2D g;
 
+        @Override
         public Object allocateBackingStore(int w, int h) {
             // FIXME: should consider checking Font's attributes to see
             // whether we're likely to need to support a full RGBA backing
@@ -1165,10 +1179,12 @@ public class TextRenderer {
             return renderer;
         }
 
+        @Override
         public void deleteBackingStore(Object backingStore) {
             ((TextureRenderer) backingStore).dispose();
         }
 
+        @Override
         public boolean preExpand(Rect cause, int attemptNumber) {
             // Only try this one time; clear out potentially obsolete entries
             // NOTE: this heuristic and the fact that it clears the used bit
@@ -1204,6 +1220,7 @@ public class TextRenderer {
             return false;
         }
 
+        @Override
         public boolean additionFailed(Rect cause, int attemptNumber) {
             // Heavy hammer -- might consider doing something different
             packer.clear();
@@ -1222,10 +1239,12 @@ public class TextRenderer {
             return false;
         }
 
+        @Override
         public boolean canCompact() {
             return true;
         }
 
+        @Override
         public void beginMovement(Object oldBackingStore, Object newBackingStore) {
             // Exit the begin / end pair if necessary
             if (inBeginEndPair) {
@@ -1259,6 +1278,7 @@ public class TextRenderer {
             g = newRenderer.createGraphics();
         }
 
+        @Override
         public void move(Object oldBackingStore, Rect oldLocation,
                          Object newBackingStore, Rect newLocation) {
             TextureRenderer oldRenderer = (TextureRenderer) oldBackingStore;
@@ -1280,6 +1300,7 @@ public class TextRenderer {
             }
         }
 
+        @Override
         public void endMovement(Object oldBackingStore, Object newBackingStore) {
             g.dispose();
 
@@ -1316,10 +1337,12 @@ public class TextRenderer {
     }
 
     public static class DefaultRenderDelegate implements RenderDelegate {
+        @Override
         public boolean intensityOnly() {
             return true;
         }
 
+        @Override
         public Rectangle2D getBounds(CharSequence str, Font font,
                                      FontRenderContext frc) {
             return getBounds(font.createGlyphVector(frc,
@@ -1327,20 +1350,24 @@ public class TextRenderer {
                              frc);
         }
 
+        @Override
         public Rectangle2D getBounds(String str, Font font,
                                      FontRenderContext frc) {
             return getBounds(font.createGlyphVector(frc, str), frc);
         }
 
+        @Override
         public Rectangle2D getBounds(GlyphVector gv, FontRenderContext frc) {
             return gv.getVisualBounds();
         }
 
+        @Override
         public void drawGlyphVector(Graphics2D graphics, GlyphVector str,
                                     int x, int y) {
             graphics.drawGlyphVector(str, x, y);
         }
 
+        @Override
         public void draw(Graphics2D graphics, String str, int x, int y) {
             graphics.drawString(str, x, y);
         }
@@ -1896,6 +1923,7 @@ public class TextRenderer {
             this.frame = frame;
         }
 
+        @Override
         public void display(GLAutoDrawable drawable) {
             GL2 gl = GLContext.getCurrentGL().getGL2();
             gl.glClear(GL2.GL_DEPTH_BUFFER_BIT | GL2.GL_COLOR_BUFFER_BIT);
@@ -1913,6 +1941,7 @@ public class TextRenderer {
 
             if ((frame.getWidth() != w) || (frame.getHeight() != h)) {
                 EventQueue.invokeLater(new Runnable() {
+                        @Override
                         public void run() {
                             frame.setSize(w, h);
                         }
@@ -1920,6 +1949,7 @@ public class TextRenderer {
             }
         }
 
+        @Override
         public void dispose(GLAutoDrawable drawable) {
             glu.destroy();
             glu=null;
@@ -1927,9 +1957,11 @@ public class TextRenderer {
         }
 
         // Unused methods
+        @Override
         public void init(GLAutoDrawable drawable) {
         }
 
+        @Override
         public void reshape(GLAutoDrawable drawable, int x, int y, int width,
                             int height) {
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
index 68c1d0fec..6f16cc4fe 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -514,6 +514,7 @@ public class ShaderCode {
         id=-1;
     }
 
+    @Override
     public boolean equals(Object obj) {
         if(this==obj) { return true; }
         if(obj instanceof ShaderCode) {
@@ -521,9 +522,11 @@ public class ShaderCode {
         }
         return false;
     }
+    @Override
     public int hashCode() {
         return id;
     }
+    @Override
     public String toString() {
         StringBuilder buf = new StringBuilder("ShaderCode[id="+id+", type="+shaderTypeStr()+", valid="+valid+", shader: ");
         for(int i=0; i<shader.remaining(); i++) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
index d737d6f4e..92b00caf3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
@@ -263,6 +263,7 @@ public class ShaderProgram {
         return programLinked;
     }
 
+    @Override
     public boolean equals(Object obj) {
         if(this == obj)  { return true; }
         if(obj instanceof ShaderProgram) {
@@ -271,6 +272,7 @@ public class ShaderProgram {
         return false;
     }
 
+    @Override
     public int hashCode() {
         return id;
     }
@@ -288,6 +290,7 @@ public class ShaderProgram {
         return sb;
     }
 
+    @Override
     public String toString() {
         return toString(null).toString();
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
index 9573ea5c3..4903e6acd 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
@@ -161,6 +161,7 @@ public abstract class CompileShader {
             new Thread(this, "Output Reader Thread").start();
         }
 
+        @Override
         public void run()
         {
             byte[] buffer = new byte[4096];
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java
index 8eb9ef579..215cf592b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java
@@ -21,10 +21,12 @@ public class CompileShaderNVidia extends CompileShader {
         }
     }
 
+    @Override
     public int getBinaryFormat() {
         return GLES2.GL_NVIDIA_PLATFORM_BINARY_NV;
     }
 
+    @Override
     public File getSDKCompilerDir() {
         File compilerDir = new File( NVAPSDK + File.separator + "tools" + File.separator );
         File compilerFile = new File( compilerDir, getVertexShaderCompiler());
@@ -39,10 +41,12 @@ public class CompileShaderNVidia extends CompileShader {
         return compilerDir;
     }
 
+    @Override
     public String getVertexShaderCompiler() {
         return "glslv.bat";
     }
 
+    @Override
     public String getFragmentShaderCompiler() {
         return "glslf.bat";
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
index 44b4fea9e..661e104b6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
@@ -52,12 +52,14 @@ public class Level {
   private int nextAddX;
 
   static class RectXComparator implements Comparator {
+    @Override
     public int compare(Object o1, Object o2) {
       Rect r1 = (Rect) o1;
       Rect r2 = (Rect) o2;
       return r1.x() - r2.x();
     }
 
+    @Override
     public boolean equals(Object obj) {
       return this == obj;
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
index 23f143b83..89f594230 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
@@ -144,6 +144,7 @@ public class Rect {
             h() >= other.h());
   }
 
+  @Override
   public String toString() {
     return "[Rect x: " + x() + " y: " + y() + " w: " + w() + " h: " + h() + "]";
   }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
index a9d609745..2ee6a79b3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
@@ -61,12 +61,14 @@ public class RectanglePacker {
   private int maxHeight = -1;
 
   static class RectHComparator implements Comparator {
+    @Override
     public int compare(Object o1, Object o2) {
       Rect r1 = (Rect) o1;
       Rect r2 = (Rect) o2;
       return r2.h() - r1.h();
     }
 
+    @Override
     public boolean equals(Object obj) {
       return this == obj;
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
index fd026d76e..584cacf8c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
@@ -188,6 +188,7 @@ public class Texture {
     /** The texture coordinates corresponding to the entire image. */
     private TextureCoords coords;
 
+    @Override
     public String toString() {
         return "Texture[target 0x"+Integer.toHexString(target)+", name "+texID+", "+
                 imgWidth+"/"+texWidth+" x "+imgHeight+"/"+texHeight+", y-flip "+mustFlipVertically+
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
index 63f100630..ba59f89c5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
@@ -94,5 +94,6 @@ public class TextureCoords {
         rectangle. */
     public float top() { return top; }
 
+    @Override
     public String toString() { return "TexCoord[h: "+left+" - "+right+", v: "+bottom+" - "+top+"]"; }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
index 28029efc5..5d88a76c0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
@@ -499,6 +499,7 @@ public class TextureData {
         public void flush();
     }
 
+    @Override
     public String toString() {
         return "TextureData["+width+"x"+height+", y-flip "+mustFlipVertically+", internFormat 0x"+Integer.toHexString(internalFormat)+", "+
                 pixelAttributes+", border "+border+", estSize "+estimatedMemorySize+", alignment "+alignment+", rowlen "+rowLength;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
index b6d89d6d2..67ab5176d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
@@ -914,6 +914,7 @@ public class TextureIO {
     //----------------------------------------------------------------------
     // DDS provider -- supports files only for now
     static class DDSTextureProvider implements TextureProvider {
+        @Override
         public TextureData newTextureData(GLProfile glp, File file,
                                           int internalFormat,
                                           int pixelFormat,
@@ -928,6 +929,7 @@ public class TextureIO {
             return null;
         }
 
+        @Override
         public TextureData newTextureData(GLProfile glp, InputStream stream,
                                           int internalFormat,
                                           int pixelFormat,
@@ -944,6 +946,7 @@ public class TextureIO {
             return null;
         }
 
+        @Override
         public TextureData newTextureData(GLProfile glp, URL url,
                                           int internalFormat,
                                           int pixelFormat,
@@ -999,6 +1002,7 @@ public class TextureIO {
                 }
             }
             TextureData.Flusher flusher = new TextureData.Flusher() {
+                    @Override
                     public void flush() {
                         image.close();
                     }
@@ -1042,6 +1046,7 @@ public class TextureIO {
     //----------------------------------------------------------------------
     // Base class for SGI RGB and TGA image providers
     static abstract class StreamBasedTextureProvider implements TextureProvider {
+        @Override
         public TextureData newTextureData(GLProfile glp, File file,
                                           int internalFormat,
                                           int pixelFormat,
@@ -1062,6 +1067,7 @@ public class TextureIO {
             }
         }
 
+        @Override
         public TextureData newTextureData(GLProfile glp, URL url,
                                           int internalFormat,
                                           int pixelFormat,
@@ -1079,6 +1085,7 @@ public class TextureIO {
     //----------------------------------------------------------------------
     // SGI RGB image provider
     static class SGITextureProvider extends StreamBasedTextureProvider {
+        @Override
         public TextureData newTextureData(GLProfile glp, InputStream stream,
                                           int internalFormat,
                                           int pixelFormat,
@@ -1114,6 +1121,7 @@ public class TextureIO {
     //----------------------------------------------------------------------
     // TGA (Targa) image provider
     static class TGATextureProvider extends StreamBasedTextureProvider {
+        @Override
         public TextureData newTextureData(GLProfile glp, InputStream stream,
                                           int internalFormat,
                                           int pixelFormat,
@@ -1151,6 +1159,7 @@ public class TextureIO {
     //----------------------------------------------------------------------
     // PNG image provider
     static class PNGTextureProvider extends StreamBasedTextureProvider {
+        @Override
         public TextureData newTextureData(GLProfile glp, InputStream stream,
                                           int internalFormat,
                                           int pixelFormat,
@@ -1188,6 +1197,7 @@ public class TextureIO {
     //----------------------------------------------------------------------
     // JPEG image provider
     static class JPGTextureProvider extends StreamBasedTextureProvider {
+        @Override
         public TextureData newTextureData(GLProfile glp, InputStream stream,
                                           int internalFormat,
                                           int pixelFormat,
@@ -1226,6 +1236,7 @@ public class TextureIO {
     // DDS texture writer
     //
     static class DDSTextureWriter implements TextureWriter {
+        @Override
         public boolean write(File file,
                              TextureData data) throws IOException {
             if (DDS.equals(IOUtil.getFileSuffix(file))) {
@@ -1276,6 +1287,7 @@ public class TextureIO {
     // SGI (rgb) texture writer
     //
     static class SGITextureWriter implements TextureWriter {
+        @Override
         public boolean write(File file,
                              TextureData data) throws IOException {
             String fileSuffix = IOUtil.getFileSuffix(file);
@@ -1321,6 +1333,7 @@ public class TextureIO {
     // TGA (Targa) texture writer
 
     static class TGATextureWriter implements TextureWriter {
+        @Override
         public boolean write(File file,
                              TextureData data) throws IOException {
             if (TGA.equals(IOUtil.getFileSuffix(file))) {
@@ -1371,6 +1384,7 @@ public class TextureIO {
     // PNG texture writer
 
     static class PNGTextureWriter implements TextureWriter {
+        @Override
         public boolean write(File file, TextureData data) throws IOException {
             if (PNG.equals(IOUtil.getFileSuffix(file))) {
                 // See whether the PNG writer can handle this TextureData
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index e4f72abf0..c34e019c2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -124,6 +124,7 @@ public interface TextureSequence {
 
         public final Texture getTexture() { return texture; }
 
+        @Override
         public String toString() {
             return "TextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ (null != texture ? texture.getTextureObject() : 0) + "]";
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
index c8437d07c..d8320c690 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
@@ -158,6 +158,7 @@ public class TextureState {
     public final int getWrapT() { return state[5]; }
 
 
+    @Override
     public final String toString() {
         return "TextureState[unit "+(state[0] - GL.GL_TEXTURE0)+", target "+toHexString(target)+
                 ": obj "+toHexString(state[1])+
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
index 471938754..2081788ba 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
@@ -112,6 +112,7 @@ public class JPEGImage {
             data.put(i++, Cr);
         }
 
+        @Override
         public String toString() {
             return "JPEGPixels["+width+"x"+height+", sourceComp "+sourceComponents+", sourceCS "+sourceCS+", storageCS "+storageCS+", storageComp "+storageComponents+"]";
         }
@@ -171,5 +172,6 @@ public class JPEGImage {
         (bottom-to-top) order for calls to glTexImage2D. */
     public ByteBuffer getData()  { return data; }
 
+    @Override
     public String toString() { return "JPEGImage["+pixelWidth+"x"+pixelHeight+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+pixelStorage+", "+data+"]"; }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
index 4020ab3c0..3c90d96e4 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
@@ -82,38 +82,45 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
         dataIn = new DataInputStream(in);
     }
 
+    @Override
     public void close() throws IOException
     {
         dataIn.close();        // better close as we create it.
         // this will close underlying as well.
     }
 
+    @Override
     public synchronized    final int read(byte    b[]) throws    IOException
     {
         return dataIn.read(b, 0, b.length);
     }
 
+    @Override
     public synchronized    final int read(byte    b[], int off, int len) throws IOException
     {
         int    rl = dataIn.read(b,    off, len);
         return rl;
     }
 
+    @Override
     public final void readFully(byte b[]) throws IOException
     {
         dataIn.readFully(b,    0, b.length);
     }
 
+    @Override
     public final void readFully(byte b[], int off, int len)    throws IOException
     {
         dataIn.readFully(b,    off, len);
     }
 
+    @Override
     public final int skipBytes(int n) throws IOException
     {
         return dataIn.skipBytes(n);
     }
 
+    @Override
     public final boolean readBoolean() throws IOException
     {
         int    ch = dataIn.read();
@@ -122,6 +129,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
         return (ch != 0);
     }
 
+    @Override
     public final byte readByte() throws    IOException
     {
         int    ch = dataIn.read();
@@ -130,6 +138,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
         return (byte)(ch);
     }
 
+    @Override
     public final int readUnsignedByte()    throws IOException
     {
         int    ch = dataIn.read();
@@ -138,6 +147,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
         return ch;
     }
 
+    @Override
     public final short readShort() throws IOException
     {
         int    ch1    = dataIn.read();
@@ -147,6 +157,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
         return (short)((ch1    << 0) +    (ch2 <<    8));
     }
 
+    @Override
     public final int readUnsignedShort() throws    IOException
     {
         int    ch1    = dataIn.read();
@@ -156,6 +167,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
         return (ch1    << 0) +    (ch2 <<    8);
     }
 
+    @Override
     public final char readChar() throws    IOException
     {
         int    ch1    = dataIn.read();
@@ -165,6 +177,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
         return (char)((ch1 << 0) + (ch2    << 8));
     }
 
+    @Override
     public final int readInt() throws IOException
     {
         int    ch1    = dataIn.read();
@@ -176,6 +189,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
         return ((ch1 <<    0) + (ch2 << 8)    + (ch3 << 16) +    (ch4 <<    24));
     }
 
+    @Override
     public final long readLong() throws    IOException
     {
         int    i1 = readInt();
@@ -183,11 +197,13 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
         return ((long)i1 & 0xFFFFFFFFL) + ((long)i2 << 32);
     }
 
+    @Override
     public final float readFloat() throws IOException
     {
         return Float.intBitsToFloat(readInt());
     }
 
+    @Override
     public final double    readDouble() throws    IOException
     {
         return Double.longBitsToDouble(readLong());
@@ -197,6 +213,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
      * dont call this it is not implemented.
      * @return empty new string
      **/
+    @Override
     public final String    readLine() throws IOException
     {
         return new String();
@@ -206,6 +223,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
      * dont call this it is not implemented
      * @return empty new string
      **/
+    @Override
     public final String    readUTF() throws IOException
     {
         return new String();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
index a7101a576..93b097500 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
@@ -78,43 +78,51 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
         dataOut = new DataOutputStream(out);
     }
 
+    @Override
     public void close() throws IOException
     {
         dataOut.close(); // better close as we create it.
         // this will close underlying as well.
     }
 
+    @Override
     public synchronized final void write(byte b[]) throws IOException
     {
         dataOut.write(b, 0, b.length);
     }
 
+    @Override
     public synchronized final void write(byte b[], int off, int len) throws IOException
     {
         dataOut.write(b, off, len);
     }
 
+    @Override
     public final void write(int b) throws IOException
     {
         dataOut.write(b);
     }
 
+    @Override
     public final void writeBoolean(boolean v) throws IOException
     {
         dataOut.writeBoolean(v);
     }
 
+    @Override
     public final void writeByte(int v) throws IOException
     {
         dataOut.writeByte(v);
     }
 
     /** Don't call this -- not implemented */
+    @Override
     public final void writeBytes(String s) throws IOException
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public final void writeChar(int v) throws IOException
     {
         dataOut.writeChar(((v >> 8) & 0xff) |
@@ -122,21 +130,25 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
     }
 
     /** Don't call this -- not implemented */
+    @Override
     public final void writeChars(String s) throws IOException
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public final void writeDouble(double v) throws IOException
     {
         writeLong(Double.doubleToRawLongBits(v));
     }
 
+    @Override
     public final void writeFloat(float v) throws IOException
     {
         writeInt(Float.floatToRawIntBits(v));
     }
 
+    @Override
     public final void writeInt(int v) throws IOException
     {
         dataOut.writeInt((v >>> 24) |
@@ -145,12 +157,14 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
                          (v << 24));
     }
 
+    @Override
     public final void writeLong(long v) throws IOException
     {
         writeInt((int) v);
         writeInt((int) (v >>> 32));
     }
 
+    @Override
     public final void writeShort(int v) throws IOException
     {
         dataOut.writeShort(((v >> 8) & 0xff) |
@@ -158,6 +172,7 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
     }
 
     /** Don't call this -- not implemented */
+    @Override
     public final void writeUTF(String s) throws IOException
     {
         throw new UnsupportedOperationException();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
index 43b8eebe6..cabf4ebc5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
@@ -84,6 +84,7 @@ public class NetPbmTextureWriter implements TextureWriter {
 
     public String getSuffix() { return (magic==6)?PPM:PAM; }
 
+    @Override
     public boolean write(File file, TextureData data) throws IOException {
         boolean res;
         final int magic_old = magic;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
index bfde1bfac..71cbbf97e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
@@ -314,5 +314,6 @@ public class PNGImage {
         }
     }
 
+    @Override
     public String toString() { return "PNGImage["+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+" x "+dpi[1]+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+data+"]"; }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
index fd96fba80..cbc8e652f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
@@ -126,6 +126,7 @@ public class SGIImage {
             in.read(tmp);
         }
 
+        @Override
         public String toString() {
             return ("magic: " + magic +
                     " storage: " + (int) storage +
@@ -226,6 +227,7 @@ public class SGIImage {
         (bottom-to-top) order for calls to glTexImage2D. */
     public byte[] getData()  { return data; }
 
+    @Override
     public String toString() {
         return header.toString();
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
index df9430a26..15cd63eb3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
@@ -199,6 +199,7 @@ public class TGAImage {
         public byte[] imageIDbuf()           { return imageIDbuf; }
         public String imageID()              { return imageID; }
 
+        @Override
         public String toString() {
             return "TGA Header " +
                 " id length: " + idLength +
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
index f23cb74bf..18ad429d2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
@@ -54,6 +54,7 @@ import com.jogamp.opengl.util.texture.spi.*;
 public class IIOTextureProvider implements TextureProvider {
     private static final boolean DEBUG = Debug.debug("TextureIO");
 
+    @Override
     public TextureData newTextureData(GLProfile glp, File file,
                                       int internalFormat,
                                       int pixelFormat,
@@ -70,6 +71,7 @@ public class IIOTextureProvider implements TextureProvider {
         return new AWTTextureData(glp, internalFormat, pixelFormat, mipmap, img);
     }
 
+    @Override
     public TextureData newTextureData(GLProfile glp, InputStream stream,
                                       int internalFormat,
                                       int pixelFormat,
@@ -86,6 +88,7 @@ public class IIOTextureProvider implements TextureProvider {
         return new AWTTextureData(glp, internalFormat, pixelFormat, mipmap, img);
     }
 
+    @Override
     public TextureData newTextureData(GLProfile glp, URL url,
                                       int internalFormat,
                                       int pixelFormat,
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
index 438ab6cc2..be82e4fb8 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
@@ -53,6 +53,7 @@ import com.jogamp.opengl.util.texture.*;
 import com.jogamp.opengl.util.texture.spi.*;
 
 public class IIOTextureWriter implements TextureWriter {
+    @Override
     public boolean write(File file,
                          TextureData data) throws IOException {
         int pixelFormat = data.getPixelFormat();
diff --git a/src/jogl/classes/javax/media/opengl/GLArrayData.java b/src/jogl/classes/javax/media/opengl/GLArrayData.java
index 4025170cf..97f58a92a 100644
--- a/src/jogl/classes/javax/media/opengl/GLArrayData.java
+++ b/src/jogl/classes/javax/media/opengl/GLArrayData.java
@@ -201,6 +201,7 @@ public interface GLArrayData {
      */
     public int getStride();
 
+    @Override
     public String toString();
 
     public void destroy(GL gl);
diff --git a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
index 1032cf929..acb33b058 100644
--- a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
+++ b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
@@ -202,6 +202,7 @@ public class GLDebugMessage {
         return sb;
     }
 
+    @Override
     public String toString() {
         return toString(null).toString();
     }
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index e486e2bfd..26bafd961 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -134,6 +134,7 @@ public abstract class GLDrawableFactory {
   private static final void initSingletonImpl() {
     NativeWindowFactory.initSingleton();
     NativeWindowFactory.addCustomShutdownHook(false /* head */, new Runnable() {
+       @Override
        public void run() {
            shutdown0();
        }
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index 15300e397..35dcce0f7 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -121,11 +121,13 @@ public class GLProfile {
                 // run the whole static initialization privileged to speed up,
                 // since this skips checking further access
                 AccessController.doPrivileged(new PrivilegedAction<Object>() {
+                    @Override
                     public Object run() {
                         Platform.initSingleton();
 
                         // Performance hack to trigger classloading of the GL classes impl, which makes up to 12%, 800ms down to 700ms
                         new Thread(new Runnable() {
+                          @Override
                           public void run() {
                               final ClassLoader cl = GLProfile.class.getClassLoader();
                               try {
@@ -1020,6 +1022,7 @@ public class GLProfile {
      * @return true if given Object is a GLProfile and
      *         if both, profile and profileImpl is equal with this.
      */
+    @Override
     public final boolean equals(Object o) {
         if(this==o) { return true; }
         if(o instanceof GLProfile) {
@@ -1029,6 +1032,7 @@ public class GLProfile {
         return false;
     }
 
+    @Override
     public int hashCode() {
         int hash = 5;
         hash = 97 * hash + getImplName().hashCode();
@@ -1469,6 +1473,7 @@ public class GLProfile {
         return true;
     }
 
+    @Override
     public String toString() {
         return "GLProfile[" + getName() + "/" + getImplName() + "."+(this.isHardwareRasterizer?"hw":"sw")+"]";
     }
diff --git a/src/jogl/classes/javax/media/opengl/GLUniformData.java b/src/jogl/classes/javax/media/opengl/GLUniformData.java
index 700bba2eb..412bfb0a9 100644
--- a/src/jogl/classes/javax/media/opengl/GLUniformData.java
+++ b/src/jogl/classes/javax/media/opengl/GLUniformData.java
@@ -97,6 +97,7 @@ public class GLUniformData {
       return sb;
     }
 
+    @Override
     public String toString() {
         return toString(null).toString();
     }
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index f08fbafe8..8757c7a26 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -449,8 +449,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
           _lock.unlock();
       }
   }
-  private final Runnable realizeOnEDTAction = new Runnable() { public void run() { setRealizedImpl(true); } };
-  private final Runnable unrealizeOnEDTAction = new Runnable() { public void run() { setRealizedImpl(false); } };
+  private final Runnable realizeOnEDTAction = new Runnable() {
+    @Override
+    public void run() { setRealizedImpl(true); }
+  };
+  private final Runnable unrealizeOnEDTAction = new Runnable() {
+    @Override
+    public void run() { setRealizedImpl(false); }
+  };
 
   @Override
   public final void setRealized(boolean realized) {
diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
index bd12dfb9d..15a7bb2a1 100644
--- a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
@@ -64,20 +64,32 @@ package javax.media.opengl.glu;
  */
 
 public class GLUtessellatorCallbackAdapter implements GLUtessellatorCallback {
+    @Override
     public void begin(int type) {}
+    @Override
     public void edgeFlag(boolean boundaryEdge) {}
+    @Override
     public void vertex(Object vertexData) {}
+    @Override
     public void end() {}
 //  public void mesh(jogamp.opengl.tessellator.GLUmesh mesh) {}
+    @Override
     public void error(int errnum) {}
+    @Override
     public void combine(double[] coords, Object[] data,
                             float[] weight, Object[] outData) {}
+    @Override
     public void beginData(int type, Object polygonData) {}
+    @Override
     public void edgeFlagData(boolean boundaryEdge,
                                  Object polygonData) {}
+    @Override
     public void vertexData(Object vertexData, Object polygonData) {}
+    @Override
     public void endData(Object polygonData) {}
+    @Override
     public void errorData(int errnum, Object polygonData) {}
+    @Override
     public void combineData(double[] coords, Object[] data,
                                 float[] weight, Object[] outData,
                                 Object polygonData) {}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
index 22600cb89..012b1d1dd 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
@@ -46,6 +46,7 @@ public class RegionRendererImpl01 extends RegionRenderer {
 
     }
 
+    @Override
     protected boolean initShaderProgram(GL2ES2 gl) {
         final ShaderState st = rs.getShaderState();
 
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
index 8ca29b9f0..fe2dd7363 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
@@ -65,8 +65,11 @@ public class RenderStateImpl extends RenderState {
         this(st, pointFactory, new PMVMatrix());
     }
 
+    @Override
     public final GLUniformData getWeight() { return gcu_Weight; }
+    @Override
     public final GLUniformData getAlpha() { return gcu_Alpha; }
+    @Override
     public final GLUniformData getColorStatic() { return gcu_ColorStatic; }
     //public final GLUniformData getStrength() { return gcu_Strength; }
 
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
index 86c0db8c6..77c862ed4 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
@@ -77,6 +77,7 @@ public class VBORegion2PES2  extends GLRegion {
         mgl_ActiveTexture = new GLUniformData(UniformNames.gcu_TextureUnit, textureEngine);
     }
 
+    @Override
     public void update(GL2ES2 gl, RenderState rs) {
         if(!isDirty()) {
             return;
@@ -194,6 +195,7 @@ public class VBORegion2PES2  extends GLRegion {
 
     int[] maxTexSize = new int[] { -1 } ;
 
+    @Override
     protected void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
         if(vp_width <=0 || vp_height <= 0 || null==texWidth || texWidth[0] <= 0){
             renderRegion(gl);
@@ -296,6 +298,7 @@ public class VBORegion2PES2  extends GLRegion {
         verticeTxtAttr.enableBuffer(gl, false);
     }
 
+    @Override
     public void destroy(GL2ES2 gl, RenderState rs) {
         if(DEBUG_INSTANCE) {
             System.err.println("VBORegion2PES2 Destroy: " + this);
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 0a867b45c..9feb18a12 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -48,6 +48,7 @@ public class VBORegionSPES2 extends GLRegion {
         super(renderModes);
     }
 
+    @Override
     protected void update(GL2ES2 gl, RenderState rs) {
         if(!isDirty()) {
             return;
@@ -125,6 +126,7 @@ public class VBORegionSPES2 extends GLRegion {
         setDirty(false);
     }
 
+    @Override
     protected void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
         verticeAttr.enableBuffer(gl, true);
         texCoordAttr.enableBuffer(gl, true);
@@ -137,6 +139,7 @@ public class VBORegionSPES2 extends GLRegion {
         verticeAttr.enableBuffer(gl, false);
     }
 
+    @Override
     public final void destroy(GL2ES2 gl, RenderState rs) {
         if(DEBUG_INSTANCE) {
             System.err.println("VBORegionSPES2 Destroy: " + this);
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
index 4f48b2d20..a60f91b87 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
@@ -65,6 +65,7 @@ public class CDTriangulator2D implements Triangulator{
     /** Reset the triangulation to initial state
      *  Clearing cached data
      */
+    @Override
     public void reset() {
         maxTriID = 0;
         vertices = new ArrayList<Vertex>();
@@ -72,6 +73,7 @@ public class CDTriangulator2D implements Triangulator{
         loops = new ArrayList<Loop>();
     }
 
+    @Override
     public void addCurve(Outline polyline) {
         Loop loop = null;
 
@@ -93,6 +95,7 @@ public class CDTriangulator2D implements Triangulator{
         }
     }
 
+    @Override
     public ArrayList<Triangle> generate() {
         for(int i=0;i<loops.size();i++) {
             Loop loop = loops.get(i);
diff --git a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
index 5978e937d..e3df0af1d 100644
--- a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
@@ -66,6 +66,7 @@ public class JavaFontLoader implements FontSet {
 
     private JavaFontLoader() {
         final String javaHome = AccessController.doPrivileged(new PrivilegedAction<String>() {
+            @Override
             public String run() {
                 return System.getProperty("java.home");
             }
@@ -81,10 +82,12 @@ public class JavaFontLoader implements FontSet {
         return 0 != ( bits & bit ) ;
     }
 
+    @Override
     public Font getDefault() throws IOException {
         return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular
     }
 
+    @Override
     public Font get(int family, int style) throws IOException {
         Font font = (Font)fontMap.get( ( family << 8 ) | style );
         if (font != null) {
diff --git a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
index 254583739..9096f7d16 100644
--- a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
@@ -71,10 +71,12 @@ public class UbuntuFontLoader implements FontSet {
         return 0 != ( bits & bit ) ;
     }
 
+    @Override
     public Font getDefault() throws IOException {
         return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular
     }
 
+    @Override
     public Font get(int family, int style) throws IOException {
         Font font = (Font)fontMap.get( ( family << 8 ) | style );
         if (font != null) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index ba6c72650..67ae6c387 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -148,25 +148,31 @@ class TypecastFont implements FontInt {
         char2Glyph = new IntObjectHashMap(cmapentries + cmapentries/4);
     }
 
+    @Override
     public StringBuilder getName(StringBuilder sb, int nameIndex) {
         return font.getName(nameIndex, sb);
     }
+    @Override
     public String getName(int nameIndex) {
         return getName(null, nameIndex).toString();
     }
+    @Override
     public StringBuilder getAllNames(StringBuilder sb, String separator) {
         return font.getAllNames(sb, separator);
     }
+    @Override
     public StringBuilder getFullFamilyName(StringBuilder sb) {
         sb = getName(sb, Font.NAME_FAMILY).append("-");
         getName(sb, Font.NAME_SUBFAMILY);
         return sb;
     }
 
+    @Override
     public float getAdvanceWidth(int i, float pixelSize) {
         return font.getHmtxTable().getAdvanceWidth(i) * metrics.getScale(pixelSize);
     }
 
+    @Override
     public Metrics getMetrics() {
         if (metrics == null) {
             metrics = new TypecastHMetrics(this);
@@ -174,6 +180,7 @@ class TypecastFont implements FontInt {
         return metrics;
     }
 
+    @Override
     public Glyph getGlyph(char symbol) {
         TypecastGlyph result = (TypecastGlyph) char2Glyph.get(symbol);
         if (null == result) {
@@ -219,11 +226,13 @@ class TypecastFont implements FontInt {
         return result;
     }
 
+    @Override
     public ArrayList<OutlineShape> getOutlineShapes(CharSequence string, float pixelSize, Factory<? extends Vertex> vertexFactory) {
     	AffineTransform transform = new AffineTransform(vertexFactory);
     	return TypecastRenderer.getOutlineShapes(this, string, pixelSize, transform, vertexFactory);
     }
 
+    @Override
     public float getStringWidth(CharSequence string, float pixelSize) {
         float width = 0;
         final int len = string.length();
@@ -241,6 +250,7 @@ class TypecastFont implements FontInt {
         return (int)(width + 0.5f);
     }
 
+    @Override
     public float getStringHeight(CharSequence string, float pixelSize) {
         int height = 0;
 
@@ -257,6 +267,7 @@ class TypecastFont implements FontInt {
         return height;
     }
 
+    @Override
     public AABBox getStringBounds(CharSequence string, float pixelSize) {
         if (string == null) {
             return new AABBox();
@@ -287,14 +298,17 @@ class TypecastFont implements FontInt {
         return new AABBox(0, 0, 0, totalWidth, totalHeight,0);
     }
 
+    @Override
     final public int getNumGlyphs() {
         return font.getNumGlyphs();
     }
 
+    @Override
     public boolean isPrintableChar( char c ) {
         return FontFactory.isPrintableChar(c);
     }
 
+    @Override
     public String toString() {
         return getFullFamilyName(null).toString();
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
index 77b5a9aa9..d7db981b0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
@@ -43,8 +43,10 @@ import com.jogamp.graph.font.Font;
 
 public class TypecastFontConstructor implements FontConstructor  {
 
+    @Override
     public Font create(final File ffile) throws IOException {
         Object o = AccessController.doPrivileged(new PrivilegedAction<Object>() {
+            @Override
             public Object run() {
                 OTFontCollection fontset;
                 try {
@@ -64,8 +66,10 @@ public class TypecastFontConstructor implements FontConstructor  {
         throw new InternalError("Unexpected Object: "+o);
     }
 
+    @Override
     public Font create(final URLConnection fconn) throws IOException {
         return AccessController.doPrivileged(new PrivilegedAction<Font>() {
+            @Override
             public Font run() {
                 File tf = null;
                 int len=0;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
index 476b3fd4e..574aeb86d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
@@ -79,6 +79,7 @@ public class TypecastGlyph implements FontInt.GlyphInt {
             return fo.floatValue();
         }
 
+        @Override
         public String toString()
         {
             return "\nAdvance:"+
@@ -122,6 +123,7 @@ public class TypecastGlyph implements FontInt.GlyphInt {
             return this.advance.get(size, useFrationalMetrics);
         }
 
+        @Override
         public String toString()
         {
             return "\nMetrics:"+
@@ -173,10 +175,12 @@ public class TypecastGlyph implements FontInt.GlyphInt {
         this.metrics.reset();
     }
 
+    @Override
     public Font getFont() {
         return this.font;
     }
 
+    @Override
     public char getSymbol() {
         return this.symbol;
     }
@@ -201,6 +205,7 @@ public class TypecastGlyph implements FontInt.GlyphInt {
         return this.metrics.getScale(pixelSize);
     }
 
+    @Override
     public AABBox getBBox(float pixelSize) {
         final float size = getScale(pixelSize);
         AABBox newBox = getBBox().clone();
@@ -212,14 +217,17 @@ public class TypecastGlyph implements FontInt.GlyphInt {
         this.metrics.addAdvance(advance, size);
     }
 
+    @Override
     public float getAdvance(float pixelSize, boolean useFrationalMetrics) {
         return this.metrics.getAdvance(pixelSize, useFrationalMetrics);
     }
 
+    @Override
     public Path2D getPath() {
         return this.path;
     }
 
+    @Override
     public Path2D getPath(float pixelSize) {
         final float size = getScale(pixelSize);
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
index a6ce58ae2..ecc41e438 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
@@ -61,21 +61,27 @@ class TypecastHMetrics implements Metrics {
         bbox = new AABBox(lowx, lowy, 0, highx, highy, 0); // invert
     }
 
+    @Override
     public final float getAscent(float pixelSize) {
         return getScale(pixelSize) * -hheaTable.getAscender(); // invert
     }
+    @Override
     public final float getDescent(float pixelSize) {
         return getScale(pixelSize) * -hheaTable.getDescender(); // invert
     }
+    @Override
     public final float getLineGap(float pixelSize) {
         return getScale(pixelSize) * -hheaTable.getLineGap(); // invert
     }
+    @Override
     public final float getMaxExtend(float pixelSize) {
         return getScale(pixelSize) * hheaTable.getXMaxExtent();
     }
+    @Override
     public final float getScale(float pixelSize) {
         return pixelSize * unitsPerEM_Inv;
     }
+    @Override
     public final AABBox getBBox(float pixelSize) {
         AABBox res = new AABBox(bbox.getLow(), bbox.getHigh());
         res.scale(getScale(pixelSize));
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
index 8fc4be92d..7c3b32e2c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
@@ -283,6 +283,7 @@ public class OTFont {
         _glyf = (GlyfTable) getTable(Table.glyf);
     }
 
+    @Override
     public String toString() {
         if (_tableDirectory != null) {
             return _tableDirectory.toString();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
index b6626a9cc..60975dd52 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
@@ -47,10 +47,12 @@ public class BaseTable implements Table {
             _coordinate = di.readShort();
         }
 
+        @Override
         public int getBaseCoordFormat() {
             return 1;
         }
 
+        @Override
         public short getCoordinate() {
             return _coordinate;
         }
@@ -69,10 +71,12 @@ public class BaseTable implements Table {
             _baseCoordPoint = di.readUnsignedShort();
         }
 
+        @Override
         public int getBaseCoordFormat() {
             return 2;
         }
 
+        @Override
         public short getCoordinate() {
             return _coordinate;
         }
@@ -89,10 +93,12 @@ public class BaseTable implements Table {
             _deviceTableOffset = di.readUnsignedShort();
         }
 
+        @Override
         public int getBaseCoordFormat() {
             return 2;
         }
 
+        @Override
         public short getCoordinate() {
             return _coordinate;
         }
@@ -211,6 +217,7 @@ public class BaseTable implements Table {
             }
         }
 
+        @Override
         public String toString() {
             StringBuilder sb = new StringBuilder()
                 .append("\nBaseScript BaseScriptT").append(Integer.toHexString(_thisOffset))
@@ -273,6 +280,7 @@ public class BaseTable implements Table {
             }
         }
 
+        @Override
         public String toString() {
             StringBuilder sb = new StringBuilder()
                 .append("\nBaseScriptList BaseScriptListT").append(Integer.toHexString(_thisOffset))
@@ -305,6 +313,7 @@ public class BaseTable implements Table {
             }
         }
 
+        @Override
         public String toString() {
             StringBuilder sb = new StringBuilder()
                 .append("\nBaseTagList BaseTagListT").append(Integer.toHexString(_thisOffset))
@@ -338,6 +347,7 @@ public class BaseTable implements Table {
             }
         }
 
+        @Override
         public String toString() {
             return new StringBuilder()
                 .append("\nAxis AxisT").append(Integer.toHexString(_thisOffset))
@@ -403,10 +413,12 @@ public class BaseTable implements Table {
         return String.valueOf(c);
     }
 
+    @Override
     public int getType() {
         return BASE;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder()
             .append("; 'BASE' Table - Baseline\n;-------------------------------------\n\n")
@@ -429,6 +441,7 @@ public class BaseTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
index 62486fb7f..a36a49923 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
@@ -164,6 +164,7 @@ public class CffTable implements Table {
             return "";
         }
 
+        @Override
         public String toString() {
             StringBuilder sb = new StringBuilder();
             Enumeration<Integer> keys = _entries.keys();
@@ -220,6 +221,7 @@ public class CffTable implements Table {
             return _data;
         }
 
+        @Override
         public String toString() {
             StringBuilder sb = new StringBuilder();
             sb.append("DICT\n");
@@ -254,6 +256,7 @@ public class CffTable implements Table {
             return new Dict(getData(), offset, len);
         }
 
+        @Override
         public String toString() {
             StringBuilder sb = new StringBuilder();
             for (int i = 0; i < getCount(); ++i) {
@@ -287,6 +290,7 @@ public class CffTable implements Table {
             return name;
         }
 
+        @Override
         public String toString() {
             StringBuilder sb = new StringBuilder();
             for (int i = 0; i < getCount(); ++i) {
@@ -321,6 +325,7 @@ public class CffTable implements Table {
             }
         }
 
+        @Override
         public String toString() {
             int nonStandardBase = CffStandardStrings.standardStrings.length;
             StringBuilder sb = new StringBuilder();
@@ -388,10 +393,12 @@ public class CffTable implements Table {
             }
         }
 
+        @Override
         public int getFormat() {
             return 0;
         }
 
+        @Override
         public int getSID(int gid) {
             if (gid == 0) {
                 return 0;
@@ -413,10 +420,12 @@ public class CffTable implements Table {
             }
         }
 
+        @Override
         public int getFormat() {
             return 1;
         }
 
+        @Override
         public int getSID(int gid) {
             if (gid == 0) {
                 return 0;
@@ -448,10 +457,12 @@ public class CffTable implements Table {
             }
         }
 
+        @Override
         public int getFormat() {
             return 2;
         }
 
+        @Override
         public int getSID(int gid) {
             if (gid == 0) {
                 return 0;
@@ -586,10 +597,12 @@ public class CffTable implements Table {
         return _charstringsArray[fontIndex].length;
     }
 
+    @Override
     public int getType() {
         return CFF;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'CFF' Table - Compact Font Format\n---------------------------------\n");
@@ -614,6 +627,7 @@ public class CffTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
index 93ff60988..7a7b51890 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
@@ -133,10 +133,12 @@ public class CharstringType2 extends Charstring {
         _globalSubrIndex = globalSubrIndex;
     }
 
+    @Override
     public int getIndex() {
         return _index;
     }
 
+    @Override
     public String getName() {
         return _name;
     }
@@ -223,6 +225,7 @@ public class CharstringType2 extends Charstring {
         return _ip < _offset + _length;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         resetIP();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
index 1079aeed4..94910e4f6 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
@@ -32,6 +32,7 @@ public class ClassDefFormat1 extends ClassDef {
         }
     }
 
+    @Override
     public int getFormat() {
         return 1;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
index 59bc7b329..9906ecfb1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
@@ -30,6 +30,7 @@ public class ClassDefFormat2 extends ClassDef {
         }
     }
 
+    @Override
     public int getFormat() {
         return 2;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
index 62ce5ae4c..f7054852a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
@@ -122,6 +122,7 @@ public abstract class CmapFormat {
 
     public abstract int mapCharCode(int charCode);
 
+    @Override
     public String toString() {
         return new StringBuilder()
         .append("format: ")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
index 2093158bd..dd1ede232 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
@@ -71,10 +71,12 @@ public class CmapFormat0 extends CmapFormat {
         }
     }
 
+    @Override
     public int getRangeCount() {
         return 1;
     }
 
+    @Override
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         if (index != 0) {
             throw new ArrayIndexOutOfBoundsException();
@@ -82,6 +84,7 @@ public class CmapFormat0 extends CmapFormat {
         return new Range(0, 255);
     }
 
+    @Override
     public int mapCharCode(int charCode) {
         if (0 <= charCode && charCode < 256) {
             return _glyphIdArray[charCode];
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
index 222c93852..d071e9421 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
@@ -118,10 +118,12 @@ public class CmapFormat2 extends CmapFormat {
         }
     }
 
+    @Override
     public int getRangeCount() {
         return _subHeaders.length;
     }
 
+    @Override
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         if (index < 0 || index >= _subHeaders.length) {
             throw new ArrayIndexOutOfBoundsException();
@@ -144,6 +146,7 @@ public class CmapFormat2 extends CmapFormat {
                     _subHeaders[index]._entryCount - 1));
     }
 
+    @Override
     public int mapCharCode(int charCode) {
 
         // Get the appropriate subheader
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
index ef65867af..2ae23d031 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
@@ -110,10 +110,12 @@ public class CmapFormat4 extends CmapFormat {
 //        }
     }
 
+    @Override
     public int getRangeCount() {
         return _segCount;
     }
 
+    @Override
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         if (index < 0 || index >= _segCount) {
             throw new ArrayIndexOutOfBoundsException();
@@ -121,6 +123,7 @@ public class CmapFormat4 extends CmapFormat {
         return new Range(_startCode[index], _endCode[index]);
     }
 
+    @Override
     public int mapCharCode(int charCode) {
         try {
             for (int i = 0; i < _segCount; i++) {
@@ -142,6 +145,7 @@ public class CmapFormat4 extends CmapFormat {
         return 0;
     }
 
+    @Override
     public String toString() {
         return new StringBuilder()
             .append(super.toString())
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
index a22e33244..2a33d8d40 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
@@ -73,14 +73,17 @@ public class CmapFormat6 extends CmapFormat {
         //di.skipBytes(_length - 4);
     }
 
+    @Override
     public int getRangeCount() {
         return 0;
     }
 
+    @Override
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         throw new ArrayIndexOutOfBoundsException();
     }
 
+    @Override
     public int mapCharCode(int charCode) {
         return 0;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
index 3544b6f62..392683bcd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
@@ -40,14 +40,17 @@ public class CmapFormatUnknown extends CmapFormat {
         di.skipBytes(_length - 4);
     }
 
+    @Override
     public int getRangeCount() {
         return 0;
     }
 
+    @Override
     public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
         throw new ArrayIndexOutOfBoundsException();
     }
 
+    @Override
     public int mapCharCode(int charCode) {
         return 0;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
index 47f6c470d..4833318d5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
@@ -90,6 +90,7 @@ public class CmapIndexEntry implements Comparable {
         _format = format;
     }
 
+    @Override
     public String toString() {
         return new StringBuilder()
             .append("platform id: ")
@@ -104,6 +105,7 @@ public class CmapIndexEntry implements Comparable {
             .append(_offset).toString();
     }
 
+    @Override
     public int compareTo(java.lang.Object obj) {
         CmapIndexEntry entry = (CmapIndexEntry) obj;
         if (getOffset() < entry.getOffset()) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
index 016efa093..2cdddb3ef 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
@@ -130,10 +130,12 @@ public class CmapTable implements Table {
         return null;
     }
 
+    @Override
     public int getType() {
         return cmap;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder().append("cmap\n");
 
@@ -155,6 +157,7 @@ public class CmapTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
index 712da54df..715bf11ec 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
@@ -72,10 +72,12 @@ public class CoverageFormat1 extends Coverage {
         }
     }
 
+    @Override
     public int getFormat() {
         return 1;
     }
 
+    @Override
     public int findGlyph(int glyphId) {
         for (int i = 0; i < _glyphCount; i++) {
             if (_glyphIds[i] == glyphId) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
index 7196ed595..bd2a28f79 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
@@ -72,10 +72,12 @@ public class CoverageFormat2 extends Coverage {
         }
     }
 
+    @Override
     public int getFormat() {
         return 2;
     }
 
+    @Override
     public int findGlyph(int glyphId) {
         for (int i = 0; i < _rangeCount; i++) {
             int n = _rangeRecords[i].getCoverageIndex(glyphId);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
index 867ef1823..9e1c47de9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
@@ -29,6 +29,7 @@ public class CvtTable implements Table {
         }
     }
 
+    @Override
     public int getType() {
         return cvt;
     }
@@ -37,6 +38,7 @@ public class CvtTable implements Table {
         return values;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'cvt ' Table - Control Value Table\n----------------------------------\n");
@@ -54,6 +56,7 @@ public class CvtTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
index 7abcec0ce..e34fa32e8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
@@ -71,6 +71,7 @@ public class DirectoryEntry implements Cloneable {
         _length = di.readInt();
     }
 
+    @Override
     public Object clone() {
         try {
             return super.clone();
@@ -104,6 +105,7 @@ public class DirectoryEntry implements Cloneable {
             .toString();
     }
 
+    @Override
     public String toString() {
         return new StringBuilder()
             .append("'").append(getTagAsString())
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
index f25c595d0..2b85f52d8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
@@ -45,6 +45,7 @@ public class DsigTable implements Table {
      * Get the table type, as a table directory value.
      * @return The table type
      */
+    @Override
     public int getType() {
         return DSIG;
     }
@@ -55,10 +56,12 @@ public class DsigTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder().append("DSIG\n");
         for (int i = 0; i < numSigs; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
index b662265d9..467a4f360 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
@@ -26,10 +26,12 @@ public class FpgmTable extends Program implements Table {
         readInstructions(di, de.getLength());
     }
 
+    @Override
     public int getType() {
         return fpgm;
     }
 
+    @Override
     public String toString() {
         return Disassembler.disassemble(getInstructions(), 0);
     }
@@ -40,6 +42,7 @@ public class FpgmTable extends Program implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
index cf4afa88e..cc87b19a4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
@@ -30,6 +30,7 @@ public class GaspRange {
         rangeGaspBehavior = di.readUnsignedShort();
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("  rangeMaxPPEM:        ").append(rangeMaxPPEM)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
index 45498eda1..8f91e6d00 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
@@ -34,10 +34,12 @@ public class GaspTable implements Table {
         }
     }
 
+    @Override
     public int getType() {
         return gasp;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'gasp' Table - Grid-fitting And Scan-conversion Procedure\n---------------------------------------------------------");
@@ -56,6 +58,7 @@ public class GaspTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
index 50f62ed62..50e0fa339 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
@@ -99,6 +99,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
         }
     }
 
+    @Override
     public int getEndPtOfContours(int i) {
         GlyfCompositeComp c = getCompositeCompEndPt(i);
         if (c != null) {
@@ -108,6 +109,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
         return 0;
     }
 
+    @Override
     public byte getFlags(int i) {
         GlyfCompositeComp c = getCompositeComp(i);
         if (c != null) {
@@ -117,6 +119,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
         return 0;
     }
 
+    @Override
     public short getXCoordinate(int i) {
         GlyfCompositeComp c = getCompositeComp(i);
         if (c != null) {
@@ -131,6 +134,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
         return 0;
     }
 
+    @Override
     public short getYCoordinate(int i) {
         GlyfCompositeComp c = getCompositeComp(i);
         if (c != null) {
@@ -145,10 +149,12 @@ public class GlyfCompositeDescript extends GlyfDescript {
         return 0;
     }
 
+    @Override
     public boolean isComposite() {
         return true;
     }
 
+    @Override
     public int getPointCount() {
         GlyfCompositeComp c = _components.get(_components.size()-1);
         GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
@@ -159,6 +165,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
         }
     }
 
+    @Override
     public int getContourCount() {
         GlyfCompositeComp c = _components.get(_components.size()-1);
         return c.getFirstContour() + _parentTable.getDescription(c.getGlyphIndex()).getContourCount();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
index a7e2e7b69..6b06eb3de 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
@@ -92,26 +92,32 @@ public abstract class GlyfDescript extends Program implements GlyphDescription {
         return _numberOfContours;
     }
 
+    @Override
     public int getGlyphIndex() {
         return _glyphIndex;
     }
 
+    @Override
     public short getXMaximum() {
         return _xMax;
     }
 
+    @Override
     public short getXMinimum() {
         return _xMin;
     }
 
+    @Override
     public short getYMaximum() {
         return _yMax;
     }
 
+    @Override
     public short getYMinimum() {
         return _yMin;
     }
 
+    @Override
     public String toString() {
         return new StringBuilder()
             .append("          numberOfContours: ").append(_numberOfContours)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
index f67162cff..c06ceaa13 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
@@ -92,30 +92,37 @@ public class GlyfSimpleDescript extends GlyfDescript {
         readCoords(_count, di);
     }
 
+    @Override
     public int getEndPtOfContours(int i) {
         return _endPtsOfContours[i];
     }
 
+    @Override
     public byte getFlags(int i) {
         return _flags[i];
     }
 
+    @Override
     public short getXCoordinate(int i) {
         return _xCoordinates[i];
     }
 
+    @Override
     public short getYCoordinate(int i) {
         return _yCoordinates[i];
     }
 
+    @Override
     public boolean isComposite() {
         return false;
     }
 
+    @Override
     public int getPointCount() {
         return _count;
     }
 
+    @Override
     public int getContourCount() {
         return getNumberOfContours();
     }
@@ -185,6 +192,7 @@ public class GlyfSimpleDescript extends GlyfDescript {
         }
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append(super.toString());
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
index 34a8218d9..4b196c9e2 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
@@ -116,6 +116,7 @@ public class GlyfTable implements Table {
         }
     }
 
+    @Override
     public int getType() {
         return glyf;
     }
@@ -126,6 +127,7 @@ public class GlyfTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
index 9a367412d..30ecdd051 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
@@ -45,10 +45,12 @@ public class GposTable implements Table {
     /** Get the table type, as a table directory value.
      * @return The table type
      */
+    @Override
     public int getType() {
         return GPOS;
     }
 
+    @Override
     public String toString() {
         return "GPOS";
     }
@@ -59,6 +61,7 @@ public class GposTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
index 0351c903d..c23d420a8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
@@ -99,6 +99,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
      * 5 - Context - Replace one or more glyphs in context
      * 6 - Chaining - Context Replace one or more glyphs in chained context
      */
+    @Override
     public LookupSubtable read(
             int type,
             DataInputStream dis,
@@ -130,6 +131,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
     /** Get the table type, as a table directory value.
      * @return The table type
      */
+    @Override
     public int getType() {
         return GSUB;
     }
@@ -146,6 +148,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
         return _lookupList;
     }
 
+    @Override
     public String toString() {
         return "GSUB";
     }
@@ -174,6 +177,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
index 42f9bf0d0..64f5e6415 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
@@ -93,10 +93,12 @@ public class HdmxTable implements Table {
         return _records[i];
     }
 
+    @Override
     public int getType() {
         return hdmx;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'hdmx' Table - Horizontal Device Metrics\n----------------------------------------\n");
@@ -124,6 +126,7 @@ public class HdmxTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
index cf7c58449..47e60f900 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
@@ -142,6 +142,7 @@ public class HeadTable implements Table {
         return _modified;
     }
 
+    @Override
     public int getType() {
         return head;
     }
@@ -170,6 +171,7 @@ public class HeadTable implements Table {
         return _yMin;
     }
 
+    @Override
     public String toString() {
         return new StringBuilder()
             .append("'head' Table - Font Header\n--------------------------")
@@ -199,6 +201,7 @@ public class HeadTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
index 0278929f1..242c9b139 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
@@ -92,6 +92,7 @@ public class HheaTable implements Table {
         return numberOfHMetrics;
     }
 
+    @Override
     public int getType() {
         return hhea;
     }
@@ -100,6 +101,7 @@ public class HheaTable implements Table {
         return xMaxExtent;
     }
 
+    @Override
     public String toString() {
         return new StringBuilder()
             .append("'hhea' Table - Horizontal Header\n--------------------------------")
@@ -129,6 +131,7 @@ public class HheaTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
index dacd9e265..122a0a826 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
@@ -106,10 +106,12 @@ public class HmtxTable implements Table {
         }
     }
 
+    @Override
     public int getType() {
         return hmtx;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'hmtx' Table - Horizontal Metrics\n---------------------------------\n");
@@ -135,6 +137,7 @@ public class HmtxTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
index 89e6f9f11..1e7ff8c2d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
@@ -36,10 +36,12 @@ public class KernSubtableFormat0 extends KernSubtable {
         }
     }
 
+    @Override
     public int getKerningPairCount() {
         return nPairs;
     }
 
+    @Override
     public KerningPair getKerningPair(int i) {
         return kerningPairs[i];
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
index 6f5e1f5e8..9c7fc81f9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
@@ -31,10 +31,12 @@ public class KernSubtableFormat2 extends KernSubtable {
         array = di.readUnsignedShort();
     }
 
+    @Override
     public int getKerningPairCount() {
         return 0;
     }
 
+    @Override
     public KerningPair getKerningPair(int i) {
         return null;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
index 1d526865a..006a86895 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
@@ -45,6 +45,7 @@ public class KernTable implements Table {
     /** Get the table type, as a table directory value.
      * @return The table type
      */
+    @Override
     public int getType() {
         return kern;
     }
@@ -55,6 +56,7 @@ public class KernTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
index cad5e106a..1979ea586 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
@@ -89,6 +89,7 @@ public class LigatureSubstFormat1 extends LigatureSubst {
         return 1;
     }
 
+    @Override
     public String getTypeAsString() {
         return "LigatureSubstFormat1";
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
index ce0862eea..2c7079fec 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
@@ -49,10 +49,12 @@ public class LocaTable implements Table {
         return _offsets[i] * _factor;
     }
 
+    @Override
     public int getType() {
         return loca;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'loca' Table - Index To Location Table\n--------------------------------------\n")
@@ -71,6 +73,7 @@ public class LocaTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
index 9b0c8e6b4..47874cc56 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
@@ -38,10 +38,12 @@ public class LtshTable implements Table {
      * Get the table type, as a table directory value.
      * @return The table type
      */
+    @Override
     public int getType() {
         return LTSH;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'LTSH' Table - Linear Threshold Table\n-------------------------------------")
@@ -61,6 +63,7 @@ public class LtshTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
index 5ab6b51ca..abb6047fc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
@@ -121,10 +121,12 @@ public class MaxpTable implements Table {
         return numGlyphs;
     }
 
+    @Override
     public int getType() {
         return maxp;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'maxp' Table - Maximum Profile\n------------------------------")
@@ -156,6 +158,7 @@ public class MaxpTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
index 9f9822986..a1787e3e7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
@@ -130,6 +130,7 @@ public class NameRecord {
         _record = sb.toString();
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
index 5b7a17d3b..ad8198b7f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
@@ -130,6 +130,7 @@ public class NameTable implements Table {
         return sb;
     }
 
+    @Override
     public int getType() {
         return name;
     }
@@ -140,6 +141,7 @@ public class NameTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
index 9dfbceb99..5340b297c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
@@ -293,10 +293,12 @@ public class Os2Table implements Table {
         return _usMaxContext;
     }
 
+    @Override
     public int getType() {
         return OS_2;
     }
 
+    @Override
     public String toString() {
         return new StringBuilder()
             .append("'OS/2' Table - OS/2 and Windows Metrics\n---------------------------------------")
@@ -351,6 +353,7 @@ public class Os2Table implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
index 1f6c5a1dd..771318108 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
@@ -79,6 +79,7 @@ public class Panose {
     return bXHeight;
   }
 
+  @Override
   public String toString() {
     StringBuilder sb = new StringBuilder();
     sb.append(String.valueOf(bFamilyType)).append(" ")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
index 6ed9b2b9c..a1f603d8f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
@@ -65,10 +65,12 @@ public class PcltTable implements Table {
      * Get the table type, as a table directory value.
      * @return The table type
      */
+    @Override
     public int getType() {
         return PCLT;
     }
 
+    @Override
     public String toString() {
         return new StringBuilder()
             .append("'PCLT' Table - Printer Command Language Table\n---------------------------------------------")
@@ -98,6 +100,7 @@ public class PcltTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
index 46f1ac088..188b441ac 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
@@ -370,10 +370,12 @@ public class PostTable implements Table {
     /** Get the table type, as a table directory value.
      * @return The table type
      */
+    @Override
     public int getType() {
         return post;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'post' Table - PostScript Metrics\n---------------------------------\n")
@@ -416,6 +418,7 @@ public class PostTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
index 2046d7fe4..4c64673b7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
@@ -26,10 +26,12 @@ public class PrepTable extends Program implements Table {
         readInstructions(di, de.getLength());
     }
 
+    @Override
     public int getType() {
         return prep;
     }
 
+    @Override
     public String toString() {
         return Disassembler.disassemble(getInstructions(), 0);
     }
@@ -40,6 +42,7 @@ public class PrepTable extends Program implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
index 15f0cd04f..31a2d17c9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
@@ -32,6 +32,7 @@ public class SignatureBlock {
         di.readFully(signature);
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         for (int i = 0; i < signatureLen; i += 16) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
index a8df78504..e97e62a58 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
@@ -73,10 +73,12 @@ public class SingleSubstFormat1 extends SingleSubst {
         _coverage = Coverage.read(dis);
     }
 
+    @Override
     public int getFormat() {
         return 1;
     }
 
+    @Override
     public int substitute(int glyphId) {
         int i = _coverage.findGlyph(glyphId);
         if (i > -1) {
@@ -85,6 +87,7 @@ public class SingleSubstFormat1 extends SingleSubst {
         return glyphId;
     }
 
+    @Override
     public String getTypeAsString() {
         return "SingleSubstFormat1";
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
index 2e47b2924..4d46b07b4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
@@ -78,10 +78,12 @@ public class SingleSubstFormat2 extends SingleSubst {
         _coverage = Coverage.read(dis);
     }
 
+    @Override
     public int getFormat() {
         return 2;
     }
 
+    @Override
     public int substitute(int glyphId) {
         int i = _coverage.findGlyph(glyphId);
         if (i > -1) {
@@ -90,6 +92,7 @@ public class SingleSubstFormat2 extends SingleSubst {
         return glyphId;
     }
 
+    @Override
     public String getTypeAsString() {
         return "SingleSubstFormat2";
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
index 8c5678088..23ecba804 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
@@ -113,6 +113,7 @@ public class TableDirectory {
         return _version;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder()
             .append("Offset Table\n------ -----")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
index 28f9aa6e3..bebd7f946 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
@@ -148,10 +148,12 @@ public class VdmxTable implements Table {
         }
     }
 
+    @Override
     public int getType() {
         return VDMX;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'VDMX' Table - Precomputed Vertical Device Metrics\n")
@@ -191,6 +193,7 @@ public class VdmxTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
index f42da119b..521b87cc8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
@@ -105,6 +105,7 @@ public class VheaTable implements Table {
         return _numberOfLongVerMetrics;
     }
 
+    @Override
     public int getType() {
         return vhea;
     }
@@ -113,6 +114,7 @@ public class VheaTable implements Table {
         return _yMaxExtent;
     }
 
+    @Override
     public String toString() {
         return new StringBuilder()
             .append("'vhea' Table - Vertical Header\n------------------------------")
@@ -142,6 +144,7 @@ public class VheaTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
index 348405380..1b77a6fdc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
@@ -77,10 +77,12 @@ public class VmtxTable implements Table {
         }
     }
 
+    @Override
     public int getType() {
         return vmtx;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("'vmtx' Table - Vertical Metrics\n-------------------------------\n");
@@ -106,6 +108,7 @@ public class VmtxTable implements Table {
      * particular table.
      * @return A directory entry
      */
+    @Override
     public DirectoryEntry getDirectoryEntry() {
         return _de;
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
index c5a2b6e87..1159b2c17 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
@@ -148,6 +148,7 @@ public class Parser {
         instructions[2] = program;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         int ip = 0;
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
index c1ee17a4b..33b80d6b8 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
@@ -122,18 +122,22 @@ public final class Path2D implements Cloneable {
             this.t = at;
         }
 
+        @Override
         public int getWindingRule() {
             return p.getWindingRule();
         }
 
+        @Override
         public boolean isDone() {
             return typeIndex >= p.typeSize;
         }
 
+        @Override
         public void next() {
             typeIndex++;
         }
 
+        @Override
         public int currentSegment(float[] coords) {
             if (isDone()) {
                 throw new NoSuchElementException(iteratorOutOfBounds);
@@ -256,6 +260,7 @@ public final class Path2D implements Cloneable {
         }
     }
 
+    @Override
     public String toString() {
         return "[size "+size()+", closed "+isClosed()+"]";
     }
diff --git a/src/jogl/classes/jogamp/opengl/Debug.java b/src/jogl/classes/jogamp/opengl/Debug.java
index 74892d894..9332b670a 100644
--- a/src/jogl/classes/jogamp/opengl/Debug.java
+++ b/src/jogl/classes/jogamp/opengl/Debug.java
@@ -54,6 +54,7 @@ public class Debug extends PropertyAccess {
 
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
+        @Override
         public Object run() {
             PropertyAccess.addTrustedPrefix("jogl.");
             return null;
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
index a1023acd2..c1e1d1821 100644
--- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
@@ -39,6 +39,7 @@ public class DesktopGLDynamicLookupHelper extends GLDynamicLookupHelper {
 
     public final DesktopGLDynamicLibraryBundleInfo getDesktopGLBundleInfo() { return (DesktopGLDynamicLibraryBundleInfo) getBundleInfo(); }
 
+    @Override
     public final synchronized boolean loadGLULibrary() {
         /** hacky code .. where all platform GLU libs are tried ..*/
         if(null==gluLib) {
diff --git a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
index c96f7db32..08a1fe882 100644
--- a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
+++ b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
@@ -87,16 +87,19 @@ public class FPSCounterImpl implements FPSCounter {
         return sb;
     }
 
+    @Override
     public String toString() {
         return toString(null).toString();
     }
 
+    @Override
     public final synchronized void setUpdateFPSFrames(int frames, PrintStream out) {
         fpsUpdateFramesInterval = frames;
         fpsOutputStream = out;
         resetFPSCounter();
     }
 
+    @Override
     public final synchronized void resetFPSCounter() {
         fpsStartTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); // overwrite startTime to real init one
         fpsLastUpdateTime   = fpsStartTime;
@@ -106,34 +109,42 @@ public class FPSCounterImpl implements FPSCounter {
         fpsLastPeriod = 0; fpsTotalDuration=0;
     }
 
+    @Override
     public final synchronized int getUpdateFPSFrames() {
         return fpsUpdateFramesInterval;
     }
 
+    @Override
     public final synchronized long getFPSStartTime()   {
         return fpsStartTime;
     }
 
+    @Override
     public final synchronized long getLastFPSUpdateTime() {
         return fpsLastUpdateTime;
     }
 
+    @Override
     public final synchronized long getLastFPSPeriod() {
         return fpsLastPeriod;
     }
 
+    @Override
     public final synchronized float getLastFPS() {
         return fpsLast;
     }
 
+    @Override
     public final synchronized int getTotalFPSFrames() {
         return fpsTotalFrames;
     }
 
+    @Override
     public final synchronized long getTotalFPSDuration() {
         return fpsTotalDuration;
     }
 
+    @Override
     public final synchronized float getTotalFPS() {
         return fpsTotal;
     }
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 7c3a5922b..5f487fa6d 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -1189,6 +1189,7 @@ public abstract class GLContextImpl extends GLContext {
       GLEmitter by looking up anew all of its function pointers. */
   protected final void resetProcAddressTable(final ProcAddressTable table) {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
+        @Override
         public Object run() {
             table.reset(getDrawableImpl().getGLDynamicLookupHelper() );
             return null;
diff --git a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
index b770f3b05..2c947693c 100644
--- a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
+++ b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
@@ -109,6 +109,7 @@ public class GLDebugMessageHandler {
 
     private final long getAddressFor(final ProcAddressTable table, final String functionName) {
         return AccessController.doPrivileged(new PrivilegedAction<Long>() {
+            @Override
             public Long run() {
                 try {
                     return Long.valueOf( table.getAddressFor(functionName) );
@@ -300,6 +301,7 @@ public class GLDebugMessageHandler {
         public StdErrGLDebugListener(boolean threadDump) {
             this.threadDump = threadDump;
         }
+        @Override
         public void messageSent(GLDebugMessage event) {
             System.err.println(event);
             if(threadDump) {
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index 2cf384fd7..4ce6a7121 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -80,7 +80,7 @@ public class GLDrawableHelper {
   /** -1 release, 0 nop, 1 claim */
   private volatile int exclusiveContextSwitch;
   private GLAnimatorControl animatorCtrl;
-  private static Runnable nop = new Runnable() { public void run() {} };
+  private static Runnable nop = new Runnable() { @Override public void run() {} };
 
   public GLDrawableHelper() {
     reset();
@@ -493,6 +493,7 @@ public class GLDrawableHelper {
       final boolean isPaused = isAnimatorAnimatingOnOtherThread() && animatorCtrl.pause();
       final GLEventListener[] res = new GLEventListener[] { null };
       final Runnable action = new Runnable() {
+          @Override
           public void run() {
               res[0] = disposeGLEventListener(autoDrawable, listener, remove);
           }
@@ -525,6 +526,7 @@ public class GLDrawableHelper {
       final boolean isPaused = isAnimatorAnimatingOnOtherThread() && animatorCtrl.pause();
 
       final Runnable action = new Runnable() {
+          @Override
           public void run() {
               disposeAllGLEventListener(autoDrawable, remove);
           }
diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
index 640e181ae..39de3200d 100644
--- a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
@@ -46,6 +46,7 @@ public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundle
      * </pre>
      * </p>
      */
+    @Override
     public final boolean shallLinkGlobal() { return true; }
 
     /**
diff --git a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
index a22454d60..f175acf28 100644
--- a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
@@ -127,6 +127,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
             return ((GLFBODrawableImpl)drawable).getFBObject(bufferName);
         }
 
+        @Override
         public final FBObject.TextureAttachment getTextureBuffer(int bufferName) {
             return ((GLFBODrawableImpl)drawable).getTextureBuffer(bufferName);
         }
diff --git a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
index 2238d49bc..6de92f533 100644
--- a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
+++ b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
@@ -52,6 +52,7 @@ public class GLRunnableTask implements GLRunnable {
         isFlushed = false;
     }
 
+    @Override
     public boolean run(GLAutoDrawable drawable) {
         boolean res = true;
         if(null == notifyObject) {
diff --git a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
index 979c6dc0a..100b46a5e 100644
--- a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
+++ b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
@@ -222,6 +222,7 @@ public class GLWorkerThread {
   protected static String getThreadName() { return Thread.currentThread().getName(); }
 
   static class WorkerRunnable implements Runnable {
+    @Override
     public void run() {
       // Notify starting thread that we're ready
       synchronized (lock) {
diff --git a/src/jogl/classes/jogamp/opengl/MemoryObject.java b/src/jogl/classes/jogamp/opengl/MemoryObject.java
index df793dadd..d10747690 100644
--- a/src/jogl/classes/jogamp/opengl/MemoryObject.java
+++ b/src/jogl/classes/jogamp/opengl/MemoryObject.java
@@ -59,10 +59,12 @@ public class MemoryObject {
     /**
      * @return the 32bit hash value generated via {@link HashUtil#getAddrSizeHash32_EqualDist(long, long)}.
      */
+    @Override
     public int hashCode() {
         return hash;
     }
 
+    @Override
     public String toString() {
         return "MemoryObject[addr 0x"+Long.toHexString(addr)+", size 0x"+Long.toHexString(size)+", hash32: 0x"+Integer.toHexString(hash)+"]";
     }
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
index eddb36975..283ecdb9d 100644
--- a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
+++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
@@ -252,6 +252,7 @@ public class SharedResourceRunner implements Runnable {
         // done
     }
 
+    @Override
     public final void run() {
         final String threadName = getThreadName();
 
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
index 6ffe46b36..bf700d970 100644
--- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
+++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
@@ -72,6 +72,7 @@ public class ThreadingImpl {
     static {
         threadingPlugin =
             AccessController.doPrivileged(new PrivilegedAction<ToolkitThreadingPlugin>() {
+                    @Override
                     public ToolkitThreadingPlugin run() {
                         final String singleThreadProp;
                         {
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
index cd1bb45c9..72c9ac54b 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
@@ -54,10 +54,12 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
 
   public AWTThreadingPlugin() {}
 
+  @Override
   public final boolean isToolkitThread() throws GLException {
       return EventQueue.isDispatchThread();
   }
 
+  @Override
   public final boolean isOpenGLThread() throws GLException {
     switch (ThreadingImpl.getMode()) {
       case ST_AWT:
@@ -83,6 +85,7 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
     }
   }
 
+  @Override
   public final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
     switch (ThreadingImpl.getMode()) {
       case ST_AWT:
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 5faee1307..ff07b04d0 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -147,6 +147,7 @@ public class AWTTilePainter {
         this.flipVertical = true;
     }
 
+    @Override
     public String toString() { return renderer.toString(); }
 
     public void setIsGLOriented(boolean v) {
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
index 7a8ddf0b4..886cd9368 100644
--- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java
+++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
@@ -116,6 +116,7 @@ public class Java2D {
 
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
+        @Override
         public Object run() {
           if (DEBUG) {
             System.err.println("Checking for Java2D/OpenGL support");
@@ -565,6 +566,7 @@ public class Java2D {
 
   private static int getOGLUtilitiesIntField(final String name) {
     Integer i = AccessController.doPrivileged(new PrivilegedAction<Integer>() {
+        @Override
         public Integer run() {
           try {
             Class<?> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
@@ -608,6 +610,7 @@ public class Java2D {
         System.err.println("Starting initialization of J2D FBO share context");
       }
       invokeWithOGLSharedContextCurrent(device.getDefaultConfiguration(), new Runnable() {
+          @Override
           public void run() {
             j2dFBOShareContext = GLDrawableFactory.getFactory(GLProfile.getDefault(GLProfile.getDefaultDevice())).createExternalGLContext();
           }
diff --git a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
index a29d1e6aa..9173a38cb 100644
--- a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
+++ b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
@@ -54,6 +54,7 @@ public class VersionApplet extends Applet {
         this.f = f;
         this.va = va;
     }
+    @Override
     public void windowClosing(WindowEvent ev) {
         f.setVisible(false);
         va.stop();
@@ -129,24 +130,28 @@ public class VersionApplet extends Applet {
       }
   }
 
+  @Override
   public void init() {
     System.err.println("VersionApplet: init() - begin");
     my_init();
     System.err.println("VersionApplet: init() - end");
   }
 
+  @Override
   public void start() {
     System.err.println("VersionApplet: start() - begin");
     canvas.setVisible(true);
     System.err.println("VersionApplet: start() - end");
   }
 
+  @Override
   public void stop() {
     System.err.println("VersionApplet: stop() - begin");
     canvas.setVisible(false);
     System.err.println("VersionApplet: stop() - end");
   }
 
+  @Override
   public void destroy() {
     System.err.println("VersionApplet: destroy() - start");
     my_release();
@@ -154,6 +159,7 @@ public class VersionApplet extends Applet {
   }
 
   class GLInfo implements GLEventListener {
+    @Override
     public void init(GLAutoDrawable drawable) {
         GL gl = drawable.getGL();
         String s = JoglVersion.getGLInfo(gl, null).toString();
@@ -161,12 +167,15 @@ public class VersionApplet extends Applet {
         tareaVersion.append(s);
     }
 
+    @Override
     public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
     }
 
+    @Override
     public void display(GLAutoDrawable drawable) {
     }
 
+    @Override
     public void dispose(GLAutoDrawable drawable) {
     }
   }
diff --git a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
index 1179e2b7f..7b85c3e75 100644
--- a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
@@ -47,20 +47,24 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
         super();
     }
 
+    @Override
     public final List<String> getToolGetProcAddressFuncNameList() {
         List<String> res = new ArrayList<String>();
         res.add("eglGetProcAddress");
         return res;
     }
 
+    @Override
     public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
         return EGL.eglGetProcAddress(toolGetProcAddressHandle, funcName);
     }
 
+    @Override
     public final boolean useToolGetProcAdressFirst(String funcName) {
         return true;
     }
 
+    @Override
     public final List<List<String>> getToolLibNames() {
         final List<List<String>> libsList = new ArrayList<List<String>>();
         final List<String> libsGL = new ArrayList<String>();
@@ -90,6 +94,7 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
         return libsList;
     }
 
+    @Override
     public final List<String> getGlueLibNames() {
         return glueLibNames;
     }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
index 89f34432d..3d864ad76 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
@@ -65,6 +65,7 @@ public class EGLDisplayUtil {
             this.createdStack = DEBUG ? new Throwable() : null;
         }
 
+        @Override
         public String toString() {
             return "EGLDisplay[0x"+Long.toHexString(eglDisplay)+": refCnt "+refCount+"]";
         }
@@ -248,9 +249,11 @@ public class EGLDisplayUtil {
     }
 
     public static final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback = new EGLGraphicsDevice.EGLDisplayLifecycleCallback() {
+        @Override
         public long eglGetAndInitDisplay(long[] nativeDisplayID) {
             return eglGetDisplayAndInitialize(nativeDisplayID);
         }
+        @Override
         public void eglTerminate(long eglDisplayHandle) {
             EGLDisplayUtil.eglTerminate(eglDisplayHandle);
         }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
index bf269c548..ab28fb3fb 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
@@ -115,6 +115,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
         }
     }
 
+    @Override
     protected void destroyHandle() {
         final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
         if(DEBUG) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
index 9ffcea864..361ec26ff 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
@@ -35,6 +35,7 @@ public final class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
         super();
     }
 
+    @Override
     public final List<List<String>> getToolLibNames() {
         final List<List<String>> libsList = new ArrayList<List<String>>();
         {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
index de1f0a42e..74738463f 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
@@ -40,6 +40,7 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
         super();
     }
 
+    @Override
     public final List<List<String>> getToolLibNames() {
         final List<List<String>> libsList = new ArrayList<List<String>>();
         {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
index 5764a6178..31fa14fbb 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
@@ -115,6 +115,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
     private EGLGraphicsConfigurationFactory() {
     }
 
+    @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl (
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
             CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
index 5083c854f..dac058dc7 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
@@ -44,6 +44,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
 
     static String getThreadName() { return Thread.currentThread().getName(); }
 
+    @Override
     public final void setSize(int width, int height) {
         if(null != upstreamSurfaceHookMutableSize) {
             upstreamSurfaceHookMutableSize.setSize(width, height);
diff --git a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
index b4383c2e6..717b1255c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
@@ -164,6 +164,7 @@ public class GLUquadricImpl implements GLUquadric {
     replaceImmModeSink();
   }
 
+  @Override
   public void enableImmModeSink(boolean val) {
     if(gl.isGL2()) {
         immModeSinkEnabled=val;
@@ -175,10 +176,12 @@ public class GLUquadricImpl implements GLUquadric {
     }
   }
 
+  @Override
   public boolean isImmModeSinkEnabled() {
     return immModeSinkEnabled;
   }
 
+  @Override
   public void setImmMode(boolean val) {
     if(immModeSinkEnabled) {
         immModeSinkImmediate=val;
@@ -187,10 +190,12 @@ public class GLUquadricImpl implements GLUquadric {
     }
   }
 
+  @Override
   public boolean getImmMode() {
     return immModeSinkImmediate;
   }
 
+  @Override
   public ImmModeSink replaceImmModeSink() {
     if(!immModeSinkEnabled) return null;
 
@@ -222,6 +227,7 @@ public class GLUquadricImpl implements GLUquadric {
     return res;
   }
 
+  @Override
   public void resetImmModeSink(GL gl) {
     if(immModeSinkEnabled) {
         immModeSink.reset(gl);
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
index f57c2310f..4213dfd46 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -92,6 +92,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
   /**
    * Pushes eval bit
    */
+  @Override
   public void bgnmap1f() {
     // DONE
     if (output_triangles) {
@@ -108,6 +109,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
   /**
    * Pops all OpenGL attributes
    */
+  @Override
   public void endmap1f() {
     // DONE
     if (output_triangles) {
@@ -127,6 +129,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
    * @param order curve order
    * @param ps control points
    */
+  @Override
   public void map1f(int type, float ulo, float uhi, int stride, int order,
                     CArrayOfFloats ps) {
     if (output_triangles) {
@@ -153,6 +156,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
    * Calls opengl enable
    * @param type what to enable
    */
+  @Override
   public void enable(int type) {
     // DONE
     gl.glEnable(type);
@@ -164,6 +168,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
    * @param u1 low u
    * @param u2 high u
    */
+  @Override
   public void mapgrid1f(int nu, float u1, float u2) {
     if (output_triangles) {
       //                System.out.println("TODO curveevaluator.mapgrid1f");
@@ -179,6 +184,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
    * @param from lowest param
    * @param to highest param
    */
+  @Override
   public void mapmesh1f(int style, int from, int to) {
     /* //DEBUG drawing control points
        this.poradi++;
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
index 155c4f9a9..e9c9fca3f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
@@ -72,6 +72,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
   /**
    * Pushes eval bit
    */
+  @Override
   public void bgnmap2f() {
 
     if (output_triangles) {
@@ -88,6 +89,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * Sets  glPolygonMode
    * @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
    */
+  @Override
   public void polymode(int style) {
     if (!output_triangles) {
       switch (style) {
@@ -109,6 +111,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
   /**
    * Pops all attributes
    */
+  @Override
   public void endmap2f() {
     // TODO Auto-generated method stub
     if (output_triangles) {
@@ -126,6 +129,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param vlo
    * @param vhi
    */
+  @Override
   public void domain2f(float ulo, float uhi, float vlo, float vhi) {
     // DONE
   }
@@ -139,6 +143,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param v0 lowest v
    * @param v1 highest v
    */
+  @Override
   public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) {
 
     if (output_triangles) {
@@ -157,6 +162,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param vmin minimum V
    * @param vmax maximum V
    */
+  @Override
   public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) {
     if (output_triangles) {
       //            System.out.println("TODO openglsurfaceavaluator.mapmesh2f output_triangles");
@@ -195,6 +201,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param vorder surface order in v direction
    * @param pts control points
    */
+  @Override
   public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
                     float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) {
     // TODO Auto-generated method stub
@@ -210,6 +217,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * Calls opengl enable
    * @param type what to enable
    */
+  @Override
   public void enable(int type) {
     //DONE
     gl.glEnable(type);
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
index 5269024b4..0c155ff96 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
@@ -56,6 +56,7 @@ public class Extract1010102 implements Extract {
   public Extract1010102() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     long uint = 0;
 
@@ -76,6 +77,7 @@ public class Extract1010102 implements Extract {
     extractComponents[3] = (float)( ( uint & 0x00000003 )       ) / 3.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
index 6982931d3..5208ea537 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
@@ -56,6 +56,7 @@ public class Extract1555rev implements Extract {
   public Extract1555rev() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
 
@@ -76,6 +77,7 @@ public class Extract1555rev implements Extract {
     extractComponents[3] = (float)( ( ushort & 0x8000 ) >>  15);
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 00000000,00011111 == 0x001F
     // 00000011,11100000 == 0x03E0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
index 1c7db6218..1bf8abcc3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
@@ -56,6 +56,7 @@ public class Extract2101010rev implements Extract {
   public Extract2101010rev() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     long uint = 0;
 
@@ -76,6 +77,7 @@ public class Extract2101010rev implements Extract {
     extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
index 672c86c32..c86b39e63 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
@@ -56,6 +56,7 @@ public class Extract233rev implements Extract {
   public Extract233rev() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     // 11100000 == 0xe0
     // 00011100 == 0x1c
@@ -66,6 +67,7 @@ public class Extract233rev implements Extract {
     extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11100000 == 0xE0
     // 00011100 == 0x1C
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
index 6cdbc5cb0..706f0c3f2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
@@ -56,6 +56,7 @@ public class Extract332 implements Extract {
   public Extract332() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     // 11100000 == 0xe0
     // 00011100 == 0x1c
@@ -66,6 +67,7 @@ public class Extract332 implements Extract {
     extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11100000 == 0xE0
     // 00011100 == 0x1C
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
index b36b9fb82..182d66ce2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
@@ -56,6 +56,7 @@ public class Extract4444 implements Extract {
   public Extract4444() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
 
@@ -76,6 +77,7 @@ public class Extract4444 implements Extract {
     extractComponents[3] = (float)( ( ushort & 0x000F )       ) / 15.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
index b7a3ed55f..52ecdc17c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
@@ -56,6 +56,7 @@ public class Extract4444rev implements Extract {
   public Extract4444rev() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
 
@@ -76,6 +77,7 @@ public class Extract4444rev implements Extract {
     extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
index 4dc566b25..21f53aa1d 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
@@ -56,6 +56,7 @@ public class Extract5551 implements Extract {
   public Extract5551() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
 
@@ -76,6 +77,7 @@ public class Extract5551 implements Extract {
     extractComponents[3] = (float)( ( ushort & 0xF000 )       );
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
index e198e46d4..7408c45b2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
@@ -56,6 +56,7 @@ public class Extract565 implements Extract {
   public Extract565() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
 
@@ -74,6 +75,7 @@ public class Extract565 implements Extract {
     extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11111000,00000000 == 0xF800
     // 00000111,11100000 == 0x07E0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
index fe19540ee..adaafa7ea 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
@@ -56,6 +56,7 @@ public class Extract565rev implements Extract {
   public Extract565rev() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     int ushort = 0;
 
@@ -74,6 +75,7 @@ public class Extract565rev implements Extract {
     extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 00000000,00111111 == 0x001F
     // 00000111,11100000 == 0x07E0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
index 4602f2af9..be155d578 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
@@ -56,6 +56,7 @@ public class Extract8888 implements Extract {
   public Extract8888() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     long uint = 0;
 
@@ -76,6 +77,7 @@ public class Extract8888 implements Extract {
     extractComponents[3] = (float)( ( uint & 0x000000FF )       ) / 255.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
index 373cb102a..294e60e12 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
@@ -56,6 +56,7 @@ public class Extract8888rev implements Extract {
   public Extract8888rev() {
   }
 
+  @Override
   public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
     long uint = 0;
 
@@ -76,6 +77,7 @@ public class Extract8888rev implements Extract {
     extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
   }
 
+  @Override
   public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
index ac0f2f290..1dd8bff8a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
@@ -56,6 +56,7 @@ public class ExtractFloat implements ExtractPrimitive {
   public ExtractFloat() {
   }
 
+  @Override
   public double extract( boolean isSwap, ByteBuffer data ) {
     float f = 0;
     if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractFloat implements ExtractPrimitive {
     return( f );
   }
 
+  @Override
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 1.0);
     data.asFloatBuffer().put( index, (float)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
index 399386e30..dcbe52a40 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
@@ -56,12 +56,14 @@ public class ExtractSByte implements ExtractPrimitive {
   public ExtractSByte() {
   }
 
+  @Override
   public double extract( boolean isSwap, ByteBuffer sbyte ) {
     byte b = sbyte.get();
     assert( b <= 127 );
     return( b );
   }
 
+  @Override
   public void shove( double value, int index, ByteBuffer data ) {
     data.position( index );
     data.put( (byte)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
index be3fb3092..547bd944a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
@@ -56,6 +56,7 @@ public class ExtractSInt implements ExtractPrimitive {
   public ExtractSInt() {
   }
 
+  @Override
   public double extract( boolean isSwap, ByteBuffer uint ) {
     int i = 0;
     if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractSInt implements ExtractPrimitive {
     return( i );
   }
 
+  @Override
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < Integer.MAX_VALUE);
     IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
index 1e123c9b4..7dc172976 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
@@ -56,6 +56,7 @@ public class ExtractSShort implements ExtractPrimitive {
   public ExtractSShort() {
   }
 
+  @Override
   public double extract( boolean isSwap, ByteBuffer ushort ) {
     short s = 0;
     if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractSShort implements ExtractPrimitive {
     return( s );
   }
 
+  @Override
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 32768.0);
     ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
index 26ca5cd40..3e933811c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
@@ -56,12 +56,14 @@ public class ExtractUByte implements ExtractPrimitive {
   public ExtractUByte() {
   }
 
+  @Override
   public double extract( boolean isSwap, ByteBuffer ubyte ) {
     int i = 0x000000FF & ubyte.get();
     assert( i <= 255 );
     return( i );
   }
 
+  @Override
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 256.0);
     data.position( index );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
index 8c94c89fc..1c34828b3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
@@ -56,6 +56,7 @@ public class ExtractUInt implements ExtractPrimitive {
   public ExtractUInt() {
   }
 
+  @Override
   public double extract( boolean isSwap, ByteBuffer uint ) {
     long i = 0;
     if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractUInt implements ExtractPrimitive {
     return( i );
   }
 
+  @Override
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 0xFFFFFFFF);
     IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
index 55115c6f7..8e0d25c42 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
@@ -56,6 +56,7 @@ public class ExtractUShort implements ExtractPrimitive {
   public ExtractUShort() {
   }
 
+  @Override
   public double extract( boolean isSwap, ByteBuffer ushort ) {
     int i = 0;
     if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractUShort implements ExtractPrimitive {
     return( i );
   }
 
+  @Override
   public void shove( double value, int index, ByteBuffer data ) {
     assert(0.0 <= value && value < 65536.0);
     ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
index 474056cc3..1ac0fd438 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
@@ -81,6 +81,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
 /* really __gl_pqHeapDeletePriorityQ */
+    @Override
     void pqDeletePriorityQ() {
         handles = null;
         nodes = null;
@@ -137,6 +138,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
 /* really __gl_pqHeapInit */
+    @Override
     boolean pqInit() {
         int i;
 
@@ -152,6 +154,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
 
 /* really __gl_pqHeapInsert */
 /* returns LONG_MAX iff out of memory */
+    @Override
     int pqInsert(Object keyNew) {
         int curr;
         int free;
@@ -207,6 +210,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
 /* really __gl_pqHeapExtractMin */
+    @Override
     Object pqExtractMin() {
         jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
         jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
@@ -229,6 +233,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
 /* really __gl_pqHeapDelete */
+    @Override
     void pqDelete(int hCurr) {
         jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
         jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
@@ -252,10 +257,12 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
         freeList = hCurr;
     }
 
+    @Override
     Object pqMinimum() {
         return handles[nodes[1].handle].key;
     }
 
+    @Override
     boolean pqIsEmpty() {
         return size == 0;
     }
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
index f9e0225e3..cf54b15c3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
@@ -71,6 +71,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
 /* really __gl_pqSortDeletePriorityQ */
+    @Override
     void pqDeletePriorityQ() {
         if (heap != null) heap.pqDeletePriorityQ();
         order = null;
@@ -100,6 +101,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
 /* really __gl_pqSortInit */
+    @Override
     boolean pqInit() {
         int p, r, i, j;
         int piv;
@@ -191,6 +193,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
 
 /* really __gl_pqSortInsert */
 /* returns LONG_MAX iff out of memory */
+    @Override
     int pqInsert(Object keyNew) {
         int curr;
 
@@ -220,6 +223,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
 /* really __gl_pqSortExtractMin */
+    @Override
     Object pqExtractMin() {
         Object sortMin, heapMin;
 
@@ -240,6 +244,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
 /* really __gl_pqSortMinimum */
+    @Override
     Object pqMinimum() {
         Object sortMin, heapMin;
 
@@ -257,11 +262,13 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
 /* really __gl_pqSortIsEmpty */
+    @Override
     boolean pqIsEmpty() {
         return (size == 0) && heap.pqIsEmpty();
     }
 
 /* really __gl_pqSortDelete */
+    @Override
     void pqDelete(int curr) {
         if (curr >= 0) {
             heap.pqDelete(curr);
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
index 1801e1c59..a2e973508 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
@@ -279,6 +279,7 @@ class Render {
     }
 
     private static class RenderTriangle implements renderCallBack {
+        @Override
         public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
             /* Just add the triangle to a triangle list, so we can render all
              * the separate triangles at once.
@@ -323,6 +324,7 @@ class Render {
     }
 
     private static class RenderFan implements renderCallBack {
+        @Override
         public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
             /* Render as many CCW triangles as possible in a fan starting from
              * edge "e".  The fan *should* contain exactly "size" triangles
@@ -345,6 +347,7 @@ class Render {
     }
 
     private static class RenderStrip implements renderCallBack {
+        @Override
         public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
             /* Render as many CCW triangles as possible in a strip starting from
              * edge "e".  The strip *should* contain exactly "size" triangles
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
index b4a400c1c..364a7f198 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
@@ -1150,6 +1150,7 @@ class Sweep {
  */ {
         /* __gl_dictListNewDict */
         tess.dict = Dict.dictNewDict(tess, new Dict.DictLeq() {
+            @Override
             public boolean leq(Object frame, Object key1, Object key2) {
                 return EdgeLeq(tess, (ActiveRegion) key1, (ActiveRegion) key2);
             }
@@ -1231,6 +1232,7 @@ class Sweep {
 
         /* __gl_pqSortNewPriorityQ */
         pq = tess.pq = PriorityQ.pqNewPriorityQ(new PriorityQ.Leq() {
+            @Override
             public boolean leq(Object key1, Object key2) {
                 return Geom.VertLeq(((GLUvertex) key1), (GLUvertex) key2);
             }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 5cc4003fe..03aae3f78 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -822,6 +822,7 @@ public class MacOSXCGLContext extends GLContextImpl
                       texID = fbod.getTextureBuffer(GL.GL_FRONT).getName();
                       pbufferHandle = 0;
                       fbod.setSwapBufferContext(new GLFBODrawableImpl.SwapBufferContext() {
+                          @Override
                           public void swapBuffers(boolean doubleBuffered) {
                               MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();
                           } } ) ;
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
index 6f86e840b..994eee8d7 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -229,6 +229,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
       }
   }
 
+  @Override
   protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice adevice) {
     final String connection = adevice.getConnection();
     SharedResource sr;
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
index 535c4d2d3..13e249a58 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -59,6 +59,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         super(screen, capsChosen, capsRequested);
     }
 
+    @Override
     public Object clone() {
         return super.clone();
     }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
index e761be7b7..db2a1df68 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -59,6 +59,7 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
     private MacOSXCGLGraphicsConfigurationFactory() {
     }
 
+    @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
             CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
index c08259665..21923531f 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
@@ -63,6 +63,7 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigur
     private MacOSXAWTCGLGraphicsConfigurationFactory() {
     }
 
+    @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
             CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index 5f9b25530..0d4452864 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -46,12 +46,14 @@ public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLAr
     super(ad);
   }
 
+  @Override
   public final void setSubArrayVBOName(int vboName) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).getData().setVBOName(vboName);
       }
   }
 
+  @Override
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       subArrays.add(handler);
   }
@@ -62,6 +64,7 @@ public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLAr
       }
   }
 
+  @Override
   public final void enableState(GL gl, boolean enable, Object ext) {
     if(enable) {
         final boolean vboBound = bindBuffer(gl, true);
diff --git a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
index be50fa9ef..c1f6b954a 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
@@ -44,14 +44,17 @@ public class GLDataArrayHandler extends GLVBOArrayHandler implements GLArrayHand
     super(ad);
   }
 
+  @Override
   public final void setSubArrayVBOName(int vboName) {
       throw new UnsupportedOperationException();
   }
 
+  @Override
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       throw new UnsupportedOperationException();
   }
 
+  @Override
   public final void enableState(GL gl, boolean enable, Object ext) {
     if(enable) {
         if(!ad.isVBO()) {
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
index 8908bd89d..3aac9612a 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
@@ -43,14 +43,17 @@ public class GLFixedArrayHandler extends GLVBOArrayHandler implements GLArrayHan
     super(ad);
   }
 
+  @Override
   public final void setSubArrayVBOName(int vboName) {
       throw new UnsupportedOperationException();
   }
 
+  @Override
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       throw new UnsupportedOperationException();
   }
 
+  @Override
   public final void enableState(GL gl, boolean enable, Object ext) {
     final GLPointerFunc glp = gl.getGL2ES1();
     if(enable) {
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
index bbdd32f0f..acec0510f 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
@@ -45,10 +45,12 @@ public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
     this.ad = ad;
   }
 
+  @Override
   public GLArrayDataWrapper getData() {
       return ad;
   }
 
+  @Override
   public final void syncData(GL gl, Object ext) {
     final GLPointerFunc glp = gl.getGL2ES1();
     switch(ad.getIndex()) {
@@ -69,6 +71,7 @@ public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
     }
   }
 
+  @Override
   public final void enableState(GL gl, boolean enable, Object ext) {
     final GLPointerFunc glp = gl.getGL2ES1();
     if(enable) {
diff --git a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
index 2bab1c2c9..5198cacfa 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
@@ -45,6 +45,7 @@ public abstract class GLVBOArrayHandler implements GLArrayHandler {
     this.ad = ad;
   }
 
+  @Override
   public final boolean bindBuffer(GL gl, boolean bind) {
     if( !ad.isVBO() ) {
         return false;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
index e893bab89..c39b78bb8 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
@@ -68,6 +68,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
         public final long getImage() { return image; }
         public final long getSync() { return sync; }
 
+        @Override
         public String toString() {
             return "EGLTextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ texture.getTextureObject() + ", img "+ image + ", sync "+ sync+", clientBuffer "+clientBuffer+"]";
         }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index ebb344664..7e41c3fce 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -201,10 +201,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     protected final void setTextureType(int t) { textureType=t; }
 
+    @Override
     public final void setTextureMinMagFilter(int[] minMagFilter) { texMinMagFilter[0] = minMagFilter[0]; texMinMagFilter[1] = minMagFilter[1];}
+    @Override
     public final int[] getTextureMinMagFilter() { return texMinMagFilter; }
 
+    @Override
     public final void setTextureWrapST(int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
+    @Override
     public final int[] getTextureWrapST() { return texWrapST; }
 
     private final void checkGLInit() {
@@ -1043,6 +1047,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         public boolean isActive() { return isActive; }
         public StreamException getStreamErr() { return streamErr; }
 
+        @Override
         public void run() {
             setName(getName()+"-StreamWorker_"+StreamWorkerInstanceId);
             StreamWorkerInstanceId++;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index 390c20346..a6a6fba97 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -252,6 +252,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
             loaded[i] = false;
         }
         final DynamicLibraryBundle dl = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() {
+                                          @Override
                                           public DynamicLibraryBundle run() {
                                               return new DynamicLibraryBundle(new FFMPEGDynamicLibraryBundleInfo());
                                           } } );
@@ -272,6 +273,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
 
         // lookup
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
+            @Override
             public Object run() {
                 for(int i = 0; i<symbolCount; i++) {
                     symbolAddr[i] = dl.dynamicLookupFunction(symbolNames[i]);
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 2abd73181..d2ef026bd 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -346,6 +346,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         if( null != gl && STREAM_ID_NONE != vid ) {
             final GLContextImpl ctx = (GLContextImpl)gl.getContext();
             AccessController.doPrivileged(new PrivilegedAction<Object>() {
+                @Override
                 public Object run() {
                     final ProcAddressTable pt = ctx.getGLProcAddressTable();
                     final long procAddrGLTexSubImage2D = pt.getAddressFor("glTexSubImage2D");
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
index 2d74fa532..3b443fdd0 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
@@ -50,14 +50,17 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle
     super(ad);
   }
 
+  @Override
   public final void setSubArrayVBOName(int vboName) {
       throw new UnsupportedOperationException();
   }
 
+  @Override
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       throw new UnsupportedOperationException();
   }
 
+  @Override
   public final void enableState(GL gl, boolean enable, Object ext) {
     final GL2ES2 glsl = gl.getGL2ES2();
     if( null != ext ) {
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
index a5f78b5d6..34a381d7d 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
@@ -47,10 +47,12 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
     this.ad = ad;
   }
 
+  @Override
   public GLArrayDataWrapper getData() {
       return ad;
   }
 
+  @Override
   public final void syncData(GL gl, Object ext) {
     final GL2ES2 glsl = gl.getGL2ES2();
     if( null != ext ) {
@@ -77,6 +79,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
     }*/
   }
 
+  @Override
   public final void enableState(GL gl, boolean enable, Object ext) {
     final GL2ES2 glsl = gl.getGL2ES2();
     if( null != ext ) {
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
index bcc146d78..b175bb5dc 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
@@ -50,12 +50,14 @@ public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GL
     super(ad);
   }
 
+  @Override
   public final void setSubArrayVBOName(int vboName) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).getData().setVBOName(vboName);
       }
   }
 
+  @Override
   public final void addSubHandler(GLArrayHandlerFlat handler) {
       subArrays.add(handler);
   }
@@ -66,6 +68,7 @@ public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GL
       }
   }
 
+  @Override
   public final void enableState(GL gl, boolean enable, Object ext) {
     if(enable) {
         if(!ad.isVBO()) {
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
index d86940e04..c329945c4 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
@@ -137,6 +137,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
             gl.glDisable(cap);
         }
     }
+    @Override
     public void glGetFloatv(int pname, java.nio.FloatBuffer params) {
         if(PMVMatrix.isMatrixGetName(pname)) {
             pmvMatrix.glGetFloatv(pname, params);
@@ -144,6 +145,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         }
         gl.glGetFloatv(pname, params);
     }
+    @Override
     public void glGetFloatv(int pname, float[] params, int params_offset) {
         if(PMVMatrix.isMatrixGetName(pname)) {
             pmvMatrix.glGetFloatv(pname, params, params_offset);
@@ -151,6 +153,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         }
         gl.glGetFloatv(pname, params, params_offset);
     }
+    @Override
     public void glGetIntegerv(int pname, IntBuffer params) {
         if(PMVMatrix.isMatrixGetName(pname)) {
             pmvMatrix.glGetIntegerv(pname, params);
@@ -158,6 +161,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         }
         gl.glGetIntegerv(pname, params);
     }
+    @Override
     public void glGetIntegerv(int pname, int[] params, int params_offset) {
         if(PMVMatrix.isMatrixGetName(pname)) {
             pmvMatrix.glGetIntegerv(pname, params, params_offset);
@@ -219,48 +223,61 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     public int  glGetMatrixMode() {
         return pmvMatrix.glGetMatrixMode();
     }
+    @Override
     public void glMatrixMode(int mode) {
         pmvMatrix.glMatrixMode(mode);
     }
+    @Override
     public void glLoadMatrixf(java.nio.FloatBuffer m) {
         pmvMatrix.glLoadMatrixf(m);
     }
+    @Override
     public void glLoadMatrixf(float[] m, int m_offset) {
         glLoadMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
     }
+    @Override
     public void glPopMatrix() {
         pmvMatrix.glPopMatrix();
     }
+    @Override
     public void glPushMatrix() {
         pmvMatrix.glPushMatrix();
     }
+    @Override
     public void glLoadIdentity() {
         pmvMatrix.glLoadIdentity();
     }
+    @Override
     public void glMultMatrixf(java.nio.FloatBuffer m) {
         pmvMatrix.glMultMatrixf(m);
     }
+    @Override
     public void glMultMatrixf(float[] m, int m_offset) {
         glMultMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
     }
+    @Override
     public void glTranslatef(float x, float y, float z) {
         pmvMatrix.glTranslatef(x, y, z);
     }
+    @Override
     public void glRotatef(float angdeg, float x, float y, float z) {
         pmvMatrix.glRotatef(angdeg, x, y, z);
     }
+    @Override
     public void glScalef(float x, float y, float z) {
         pmvMatrix.glScalef(x, y, z);
     }
     public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) {
         glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val);
     }
+    @Override
     public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
         pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar);
     }
     public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) {
         glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar);
     }
+    @Override
     public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
         pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar);
     }
@@ -268,6 +285,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     //
     // LightingIf
     //
+    @Override
     public void glColor4f(float red, float green, float blue, float alpha) {
       fixedFunction.glColor4f(gl, red, green, blue, alpha);
     }
@@ -278,18 +296,23 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
                 ValueConv.byte_to_float(blue, false),
                 ValueConv.byte_to_float(alpha, false) );
     }
+    @Override
     public void glLightfv(int light, int pname, java.nio.FloatBuffer params) {
       fixedFunction.glLightfv(gl, light, pname, params);
     }
+    @Override
     public void glLightfv(int light, int pname, float[] params, int params_offset) {
         glLightfv(light, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
     }
+    @Override
     public void glMaterialfv(int face, int pname, java.nio.FloatBuffer params) {
       fixedFunction.glMaterialfv(gl, face, pname, params);
     }
+    @Override
     public void glMaterialfv(int face, int pname, float[] params, int params_offset) {
         glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
     }
+    @Override
     public void glMaterialf(int face, int pname, float param) {
         glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(new float[] { param }));
     }
@@ -297,6 +320,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     //
     // Misc Simple States
     //
+    @Override
     public void glShadeModel(int mode) {
       fixedFunction.glShadeModel(gl, mode);
     }
@@ -316,13 +340,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     public void glClientActiveTexture(int textureUnit) {
       fixedFunction.glClientActiveTexture(textureUnit);
     }
+    @Override
     public void glEnableClientState(int glArrayIndex) {
       fixedFunction.glEnableClientState(gl, glArrayIndex);
     }
+    @Override
     public void glDisableClientState(int glArrayIndex) {
       fixedFunction.glDisableClientState(gl, glArrayIndex);
     }
 
+    @Override
     public void glVertexPointer(GLArrayData array) {
       if(array.isVBO()) {
           if(!gl.glIsVBOArrayBound()) {
@@ -339,10 +366,12 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       fixedFunction.glVertexPointer(gl, array);
     }
 
+    @Override
     public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) {
       glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                      pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
+    @Override
     public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) {
       int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
       if(vboName==0) {
@@ -352,6 +381,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
                                                      null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER));
     }
 
+    @Override
     public void glColorPointer(GLArrayData array) {
       if(array.isVBO()) {
           if(!gl.glIsVBOArrayBound()) {
@@ -367,10 +397,12 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       }
       fixedFunction.glColorPointer(gl, array);
     }
+    @Override
     public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) {
       glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                     pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
+    @Override
     public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) {
       int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
       if(vboName==0) {
@@ -380,6 +412,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
                                                    null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER));
     }
 
+    @Override
     public void glNormalPointer(GLArrayData array) {
       if(array.getComponentCount()!=3) {
         throw new GLException("Only 3 components per normal allowed");
@@ -398,10 +431,12 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       }
       fixedFunction.glNormalPointer(gl, array);
     }
+    @Override
     public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) {
       glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                      pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
+    @Override
     public void glNormalPointer(int type, int stride, long pointer_buffer_offset) {
       int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
       if(vboName==0) {
@@ -411,6 +446,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
                                                      null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER));
     }
 
+    @Override
     public void glTexCoordPointer(GLArrayData array) {
       if(array.isVBO()) {
           if(!gl.glIsVBOArrayBound()) {
@@ -426,11 +462,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       }
       fixedFunction.glTexCoordPointer(gl, array);
     }
+    @Override
     public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) {
       glTexCoordPointer(
         GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                        pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
+    @Override
     public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) {
       int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
       if(vboName==0) {
@@ -441,6 +479,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
                                        null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER) );
     }
 
+    @Override
     public final String toString() {
           StringBuilder buf = new StringBuilder();
           buf.append(getClass().getName()+" (");
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
index 187fdb309..42269588d 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
@@ -946,6 +946,7 @@ public class FixedFuncPipeline {
         sb.append("]");
         return sb;
     }
+    @Override
     public String toString() {
         return toString(null, DEBUG).toString();
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java b/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
index 1833a1d87..d5b01ef54 100644
--- a/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
+++ b/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
@@ -140,6 +140,7 @@ public class JPEGDecoder {
             }
         }
 
+        @Override
         public final String toString() {
             return "JFIF[ver "+version+", density[units "+densityUnits+", "+xDensity+"x"+yDensity+"], thumb "+thumbWidth+"x"+thumbHeight+"]";
         }
@@ -172,6 +173,7 @@ public class JPEGDecoder {
                 return null;
             }
         }
+        @Override
         public final String toString() {
             return "Adobe[ver "+version+", flags["+toHexString(flags0)+", "+toHexString(flags1)+"], colorSpace/Code "+colorSpace+"/"+toHexString(colorCode)+"]";
         }
@@ -190,6 +192,7 @@ public class JPEGDecoder {
                 return null;
             }
         }
+        @Override
         public final String toString() {
             return "EXIF[]";
         }
@@ -362,6 +365,7 @@ public class JPEGDecoder {
         public final boolean hasCompID(int componentID) {
             return compIDs.contains(componentID);
         }
+        @Override
         public final String toString() {
             return "Frame[progressive "+progressive+", precision "+precision+", scanLines "+scanLines+", samplesPerLine "+samplesPerLine+
                     ", components[count "+compCount+", maxID "+maxCompID+", componentIDs "+compIDs+", comps "+Arrays.asList(comps)+"]]";
@@ -403,6 +407,7 @@ public class JPEGDecoder {
             return blocks[row][col];
         }
 
+        @Override
         public final String toString() {
             return "CompIn[h "+h+", v "+v+", qttIdx "+qttIdx+", blocks["+blocksPerColumn+", mcu "+blocksPerColumnForMcu+"]["+blocksPerLine+", mcu "+blocksPerLineForMcu+"][64]]";
         }
@@ -426,11 +431,13 @@ public class JPEGDecoder {
             return lines.get( i < sz ? i : sz - 1);
         }
 
+        @Override
         public final String toString() {
             return "CompOut[lines "+lines.size()+", scale "+scaleX+"x"+scaleY+"]";
         }
     }
 
+    @Override
     public String toString() {
         final String jfifS = null != jfif ? jfif.toString() : "JFIF nil";
         final String exifS = null != exif ? exif.toString() : "Exif nil";
@@ -1227,6 +1234,7 @@ public class JPEGDecoder {
         final DecoderFunction decodeACSuccessive = new ACSuccessiveDecoder();
 
         class BaselineDecoder implements DecoderFunction {
+            @Override
             public void decode(ComponentIn component, int[] zz) throws IOException {
                 final int t = decodeHuffman(component.huffmanTableDC);
                 final int diff = ( t == 0 ) ? 0 : receiveAndExtend(t);
@@ -1250,6 +1258,7 @@ public class JPEGDecoder {
             }
         }
         class DCFirstDecoder implements DecoderFunction {
+            @Override
             public void decode(ComponentIn component, int[] zz) throws IOException {
                 final int t = decodeHuffman(component.huffmanTableDC);
                 final int diff = ( t == 0 ) ? 0 : (receiveAndExtend(t) << successive);
@@ -1257,12 +1266,14 @@ public class JPEGDecoder {
             }
         }
         class DCSuccessiveDecoder implements DecoderFunction {
+            @Override
             public void decode(ComponentIn component, int[] zz) throws IOException {
                 zz[0] |= readBit() << successive;
             }
         }
 
         class ACFirstDecoder implements DecoderFunction {
+            @Override
             public void decode(ComponentIn component, int[] zz) throws IOException {
                 if (eobrun > 0) {
                     eobrun--;
@@ -1288,6 +1299,7 @@ public class JPEGDecoder {
             }
         }
         class ACSuccessiveDecoder implements DecoderFunction {
+            @Override
             public void decode(ComponentIn component, int[] zz) throws IOException {
                 int k = spectralStart, e = spectralEnd, r = 0;
                 while (k <= e) {
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
index 906ce6373..e6afd8694 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
@@ -315,6 +315,7 @@ public class ImageLine {
 	/**
 	 * Basic info
 	 */
+	@Override
 	public String toString() {
 		return "row=" + rown + " cols=" + imgInfo.cols + " bpc=" + imgInfo.bitDepth + " size=" + scanline.length;
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
index 438a69984..4636c3955 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
@@ -92,6 +92,7 @@ public class ImageLineHelper {
 		public double[] maxdif = { BIG_VALUE_NEG, BIG_VALUE_NEG, BIG_VALUE_NEG, BIG_VALUE }; // maxima
 		public final int channels; // diferencia
 
+		@Override
 		public String toString() {
 			return channels == 3 ? String.format(
 					"prom=%.1f (%.1f %.1f %.1f) max=%.1f (%.1f %.1f %.1f) min=%.1f (%.1f %.1f %.1f)", promlum, prom[0],
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
index 1f598a5de..9e64c3eb1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
@@ -186,6 +186,7 @@ public class PngHelperInternal {
 	}
 
 	private static final ThreadLocal<CRC32> crcProvider = new ThreadLocal<CRC32>() {
+		@Override
 		protected CRC32 initialValue() {
 			return new CRC32();
 		}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
index 73442e0bb..0412beb8c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
@@ -994,6 +994,7 @@ public class PngReader {
 	/**
 	 * Basic info, for debugging.
 	 */
+	@Override
 	public String toString() { // basic info
 		return "filename=" + filename + " " + imgInfo.toString();
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
index 82abb902d..4e8bf5635 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
@@ -47,12 +47,14 @@ public class ChunkHelper {
 	public static final String zTXt = "zTXt";
 
 	private static final ThreadLocal<Inflater> inflaterProvider = new ThreadLocal<Inflater>() {
+		@Override
 		protected Inflater initialValue() {
 			return new Inflater();
 		}
 	};
 
 	private static final ThreadLocal<Deflater> deflaterProvider = new ThreadLocal<Deflater>() {
+		@Override
 		protected Deflater initialValue() {
 			return new Deflater();
 		}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
index 3aba26cca..dcb1958df 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
@@ -108,6 +108,7 @@ public class ChunkRaw {
 		return new ByteArrayInputStream(data);
 	}
 
+	@Override
 	public String toString() {
 		return "chunkid=" + ChunkHelper.toString(idbytes) + " len=" + len;
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
index 3e0d03051..75107d761 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
@@ -59,12 +59,14 @@ public class ChunksList {
 	protected static List<PngChunk> getXById(final List<PngChunk> list, final String id, final String innerid) {
 		if (innerid == null)
 			return ChunkHelper.filterList(list, new ChunkPredicate() {
+				@Override
 				public boolean match(PngChunk c) {
 					return c.id.equals(id);
 				}
 			});
 		else
 			return ChunkHelper.filterList(list, new ChunkPredicate() {
+				@Override
 				public boolean match(PngChunk c) {
 					if (!c.id.equals(id))
 						return false;
@@ -152,12 +154,14 @@ public class ChunksList {
 	 */
 	public List<PngChunk> getEquivalent(final PngChunk c2) {
 		return ChunkHelper.filterList(chunks, new ChunkPredicate() {
+			@Override
 			public boolean match(PngChunk c) {
 				return ChunkHelper.equivalent(c, c2);
 			}
 		});
 	}
 
+	@Override
 	public String toString() {
 		return "ChunkList: read: " + chunks.size();
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
index 3b84ab800..c502e9071 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
@@ -149,6 +149,7 @@ public class ChunksListForWrite extends ChunksList {
 		return queuedChunks;
 	}
 
+	@Override
 	public String toString() {
 		return "ChunkList: written: " + chunks.size() + " queue: " + queuedChunks.size();
 	}
@@ -156,6 +157,7 @@ public class ChunksListForWrite extends ChunksList {
 	/**
 	 * for debugging
 	 */
+	@Override
 	public String toStringFull() {
 		StringBuilder sb = new StringBuilder(toString());
 		sb.append("\n Written:\n");
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
index 5247169e0..7df5ba021 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
@@ -12,6 +12,7 @@ public abstract class PngChunkSingle extends PngChunk {
 		super(id, imgInfo);
 	}
 
+	@Override
 	public final boolean allowsMultiple() {
 		return false;
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
index fa3649613..139603448 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
@@ -41,6 +41,7 @@ public class PngMetadata {
 			throw new PngjException("cannot set chunk : readonly metadata");
 		if (lazyOverwrite) {
 			ChunkHelper.trimList(cl.getQueuedChunks(), new ChunkPredicate() {
+				@Override
 				public boolean match(PngChunk c2) {
 					return ChunkHelper.equivalent(c, c2);
 				}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index 203af110c..95485b033 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -92,6 +92,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
     synchronized(WindowsWGLDrawableFactory.class) {
         if( null == windowsWGLDynamicLookupHelper ) {
             windowsWGLDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() {
+                @Override
                 public DesktopGLDynamicLookupHelper run() {
                     DesktopGLDynamicLookupHelper tmp;
                     try {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index cb445f005..5f2b0c227 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -119,6 +119,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return cfg;
     }
 
+    @Override
     public Object clone() {
         return super.clone();
     }
@@ -715,6 +716,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
        return createPixelFormatDescriptor(0, 0);
    }
 
+   @Override
    public String toString() {
        return "WindowsWGLGraphicsConfiguration["+getScreen()+", pfdID " + getPixelFormatID() + ", ARB-Choosen " + isChoosenByARB() +
                ",\n\trequested " + getRequestedCapabilities() +
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 9e917a0eb..961295208 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -79,6 +79,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
     private WindowsWGLGraphicsConfigurationFactory() {
     }
 
+    @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
 
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
index ddfcbb55b..96bd0bdd0 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
@@ -68,6 +68,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
     private WindowsAWTWGLGraphicsConfigurationFactory() {
     }
 
+    @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
             CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index 3f0841b6c..78e549508 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -95,6 +95,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
     synchronized(X11GLXDrawableFactory.class) {
         if( null == x11GLXDynamicLookupHelper ) {
             x11GLXDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() {
+                @Override
                 public DesktopGLDynamicLookupHelper run() {
                     DesktopGLDynamicLookupHelper tmp;
                     try {
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
index 5aea33f21..4d1ed3985 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -69,6 +69,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
         this.chooser=chooser;
     }
 
+    @Override
     public Object clone() {
         return super.clone();
     }
@@ -478,6 +479,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     return tmp.get(tmp.position());
   }
 
+  @Override
   public String toString() {
     return "X11GLXGraphicsConfiguration["+getScreen()+", visualID " + toHexString(getXVisualID()) + ", fbConfigID " + toHexString(getFBConfigID()) +
                                         ",\n\trequested " + getRequestedCapabilities()+
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
index abe310a3f..6050dabbb 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -92,6 +92,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
     private X11GLXGraphicsConfigurationFactory() {
     }
 
+    @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
         if (!(absScreen instanceof X11GraphicsScreen)) {
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
index 15f3355d0..aa9b876dd 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -109,6 +109,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
   }
 
   // open access to superclass method
+  @Override
   public void setChosenCapabilities(CapabilitiesImmutable capsChosen) {
       super.setChosenCapabilities(capsChosen);
   }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
index d3cf5bff6..83d6efa75 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
@@ -87,6 +87,7 @@ public class AWTGraphicsScreen extends DefaultGraphicsScreen implements Cloneabl
     return new AWTGraphicsScreen(AWTGraphicsDevice.createDefault());
   }
 
+  @Override
   public Object clone() {
       return super.clone();
   }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
index e350aaff4..27275c6e0 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
@@ -119,6 +119,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
    *         otherwise return the AWT/Swing close operation value translated to
    *         a {@link WindowClosingProtocol} value .
    */
+  @Override
   public final WindowClosingMode getDefaultCloseOperation() {
       synchronized(closingListenerLock) {
         if(defaultCloseOperationSetByUser) {
@@ -129,6 +130,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
       return AWTMisc.getNWClosingOperation(comp);
   }
 
+  @Override
   public final WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
       synchronized(closingListenerLock) {
           final WindowClosingMode _op = defaultCloseOperation;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
index e4d3884a7..c02fc0a04 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
@@ -247,6 +247,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @see #setElem(int, int)
      * @see #setElem(int, int, int)
      */
+    @Override
     public int getElem(int i) {
         return data.get(i+offset);
     }
@@ -260,6 +261,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @see #setElem(int, int)
      * @see #setElem(int, int, int)
      */
+    @Override
     public int getElem(int bank, int i) {
         return bankdata[bank].get(i+offsets[bank]);
     }
@@ -273,6 +275,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @see #getElem(int)
      * @see #getElem(int, int)
      */
+    @Override
     public void setElem(int i, int val) {
         data.put(i+offset, val);
     }
@@ -286,6 +289,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @see #getElem(int)
      * @see #getElem(int, int)
      */
+    @Override
     public void setElem(int bank, int i, int val) {
         bankdata[bank].put(i+offsets[bank], val);
     }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
index 89df7f853..99ca006fa 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
@@ -43,6 +43,7 @@ public class MacOSXGraphicsDevice extends DefaultGraphicsDevice implements Clone
         super(NativeWindowFactory.TYPE_MACOSX, AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID);
     }
 
+    @Override
     public Object clone() {
       return super.clone();
     }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
index 6057f6700..361d61c65 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
@@ -122,6 +122,7 @@ public class SWTAccessor {
 
     static {
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
+            @Override
             public Object run() {
                 NativeWindowFactory.initSingleton(); // last resort ..
                 return null;
@@ -360,6 +361,7 @@ public class SWTAccessor {
 
         if(null != OS_gtk_class) {
             invoke(true, new Runnable() {
+                @Override
                 public void run() {
                     if(realize) {
                         callStaticMethodL2V(OS_gtk_widget_realize, handle);
@@ -434,6 +436,7 @@ public class SWTAccessor {
     public static long newGC(final Control swtControl, final GCData gcData) {
         final Object[] o = new Object[1];
         invoke(true, new Runnable() {
+            @Override
             public void run() {
                 o[0] = ReflectionUtil.callMethod(swtControl, swt_control_internal_new_GC, new Object[] { gcData });
             }
@@ -447,6 +450,7 @@ public class SWTAccessor {
 
     public static void disposeGC(final Control swtControl, final long gc, final GCData gcData) {
         invoke(true, new Runnable() {
+            @Override
             public void run() {
                 if(swt_uses_long_handles) {
                     ReflectionUtil.callMethod(swtControl, swt_control_internal_dispose_GC, new Object[] { new Long(gc), gcData });
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
index 7468d254b..643982715 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
@@ -47,6 +47,7 @@ public class WindowsGraphicsDevice extends DefaultGraphicsDevice implements Clon
         super(NativeWindowFactory.TYPE_WINDOWS, connection, unitID);
     }
 
+    @Override
     public Object clone() {
       return super.clone();
     }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
index 8aac7095a..700937829 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
@@ -63,6 +63,7 @@ public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneabl
         return X11Lib.DefaultVisualID(getDevice().getHandle(), getIndex());
     }
 
+    @Override
     public Object clone() {
       return super.clone();
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
index 6095db052..77cbe2995 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
@@ -76,6 +76,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
   private final static int NO_SCORE = -9999999;
   private final static int COLOR_MISMATCH_PENALTY_SCALE     = 36;
 
+  @Override
   public int chooseCapabilities(final CapabilitiesImmutable desired,
                                 final List<? extends CapabilitiesImmutable> available,
                                 final int windowSystemRecommendedChoice) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
index 3e32f30df..42d7f3a23 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
@@ -69,18 +69,22 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
         }
     }
 
+    @Override
     final public AbstractGraphicsScreen getScreen() {
         return screen;
     }
 
+    @Override
     final public CapabilitiesImmutable getChosenCapabilities() {
         return capabilitiesChosen;
     }
 
+    @Override
     final public CapabilitiesImmutable getRequestedCapabilities() {
         return capabilitiesRequested;
     }
 
+    @Override
     public AbstractGraphicsConfiguration getNativeGraphicsConfiguration() {
         return this;
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
index ffcad235c..4bd548916 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
@@ -54,10 +54,12 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
         }
     }
 
+    @Override
     public AbstractGraphicsDevice getDevice() {
         return device;
     }
 
+    @Override
     public int getIndex() {
       return idx;
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
index e1aa91959..c09e6eaa4 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
@@ -80,10 +80,12 @@ public abstract class GraphicsConfigurationFactory {
             this.hash32 = hash32;
         }
 
+        @Override
         public final int hashCode() {
             return hash32;
         }
 
+        @Override
         public final boolean equals(Object obj) {
             if(this == obj)  { return true; }
             if (obj instanceof DeviceCapsType) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index bad72f355..6962ce505 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -123,6 +123,7 @@ public abstract class NativeWindowFactory {
         return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
             private final File vcliblocation = new File(
                     "/opt/vc/lib/libbcm_host.so");
+                @Override
                 public Boolean run() {
                     if ( vcliblocation.isFile() ) {
                         return Boolean.TRUE;
@@ -160,12 +161,14 @@ public abstract class NativeWindowFactory {
         final String[] _tmp = new String[] { null };
 
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
+            @Override
             public Object run() {
                 Platform.initSingleton(); // last resort ..
                 _DEBUG[0] = Debug.debug("NativeWindow");
                 _tmp[0] = Debug.getProperty("nativewindow.ws.name", true);
                 Runtime.getRuntime().addShutdownHook(
                     new Thread(new Runnable() {
+                                @Override
                                 public void run() {
                                     NativeWindowFactory.shutdown(true);
                                 } }, "NativeWindowFactory_ShutdownHook" ) ) ;
@@ -318,6 +321,7 @@ public abstract class NativeWindowFactory {
                 ReflectionUtil.isClassAvailable("com.jogamp.nativewindow.awt.AWTGraphicsDevice", cl) ) {
 
                 Method[] jawtUtilMethods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
+                    @Override
                     public Method[] run() {
                         try {
                             Class<?> _jawtUtilClass = Class.forName(JAWTUtilClassName, true, NativeWindowFactory.class.getClassLoader());
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
index eb0a6cf04..0af2bdaf9 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
@@ -122,5 +122,6 @@ public interface ProxySurface extends MutableSurface {
     public void clearUpstreamOptionBits(int v);
 
     public StringBuilder toString(StringBuilder sink);
+    @Override
     public String toString();
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
index 4ee71ee79..4ed79b1dc 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
@@ -120,6 +120,7 @@ public interface VisualIDHolder {
             this.type = type;
         }
 
+        @Override
         public int compare(VisualIDHolder vid1, VisualIDHolder vid2) {
             final int id1 = vid1.getVisualID(type);
             final int id2 = vid2.getVisualID(type);
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
index b8b48a46c..b8dc53c83 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
@@ -45,10 +45,12 @@ public class Dimension implements Cloneable, DimensionImmutable {
         this.height=height;
     }
 
+    @Override
     public Object cloneMutable() {
       return clone();
     }
 
+    @Override
     public Object clone() {
         try {
             return super.clone();
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java
index 9caa433a6..e6cacf4ff 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java
@@ -59,8 +59,10 @@ public interface DimensionImmutable extends WriteCloneable, Comparable<Dimension
      * @return  <code>true</code> if the two dimensions are equal;
      *          otherwise <code>false</code>.
      */
+    @Override
     boolean equals(Object obj);
 
+    @Override
     int hashCode();
 
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
index dbd997c60..c84359dcd 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
@@ -45,10 +45,12 @@ public class Insets implements Cloneable, InsetsImmutable {
         this.b=bottom;
     }
 
+    @Override
     public Object cloneMutable() {
       return clone();
     }
 
+    @Override
     protected Object clone() {
         try {
             return super.clone();
@@ -99,6 +101,7 @@ public class Insets implements Cloneable, InsetsImmutable {
         return sum3 * (sum3 + 1)/2 + val2;
     }
 
+    @Override
     public String toString() {
         return new String("[ l "+l+", r "+r+" - t "+t+", b "+b+" - "+getTotalWidth()+"x"+getTotalHeight()+"]");
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
index 0f99a7861..8256068cd 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
@@ -59,8 +59,10 @@ public interface InsetsImmutable extends WriteCloneable {
      * @return      <code>true</code> if the two Insets are equal;
      * otherwise <code>false</code>.
      */
+    @Override
     boolean equals(Object obj);
 
+    @Override
     int hashCode();
 
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
index aba515d52..57c6fb716 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
@@ -42,10 +42,12 @@ public class Point implements Cloneable, PointImmutable {
         this(0, 0);
     }
 
+    @Override
     public Object cloneMutable() {
       return clone();
     }
 
+    @Override
     public Object clone() {
         try {
             return super.clone();
@@ -95,6 +97,7 @@ public class Point implements Cloneable, PointImmutable {
         return hash;
     }
 
+    @Override
     public String toString() {
         return new String( x + " / " + y );
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java
index f5377e059..08c628cc1 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java
@@ -54,8 +54,10 @@ public interface PointImmutable extends WriteCloneable, Comparable<PointImmutabl
      * @return <code>true</code> if the two points are equal;
      *         otherwise <code>false</code>.
      */
+    @Override
     public boolean equals(Object obj);
 
+    @Override
     public int hashCode();
 
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
index 3a51fb67d..8dc8f4562 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
@@ -47,10 +47,12 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         this.height=height;
     }
 
+    @Override
     public Object cloneMutable() {
       return clone();
     }
 
+    @Override
     protected Object clone() {
         try {
             return super.clone();
@@ -191,6 +193,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         return sum3 * (sum3 + 1)/2 + val2;
     }
 
+    @Override
     public String toString() {
         return new String("[ "+x+" / "+y+"  "+width+" x "+height+" ]");
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java
index ce735f53f..7ca92ff53 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java
@@ -78,8 +78,10 @@ public interface RectangleImmutable extends WriteCloneable, Comparable<Rectangle
      * @return      <code>true</code> if the two rectangles are equal;
      * otherwise <code>false</code>.
      */
+    @Override
     boolean equals(Object obj);
 
+    @Override
     int hashCode();
 
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
index 917f7e230..f1749dfa6 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
@@ -56,6 +56,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
         return bitsPerPixel;
     }
 
+    @Override
     public final String toString() {
         return new String("[ "+resolution+" x "+bitsPerPixel+" bpp ]");
     }
@@ -89,6 +90,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
      * @return  <code>true</code> if the two dimensions are equal;
      *          otherwise <code>false</code>.
      */
+    @Override
     public final boolean equals(Object obj) {
         if(this == obj)  { return true; }
         if (obj instanceof SurfaceSize) {
@@ -99,6 +101,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
         return false;
     }
 
+    @Override
     public final int hashCode() {
         // 31 * x == (x << 5) - x
         int hash = 31 + getResolution().hashCode();
diff --git a/src/nativewindow/classes/jogamp/nativewindow/Debug.java b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
index a7bf536ec..b7197dbca 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/Debug.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
@@ -54,6 +54,7 @@ public class Debug extends PropertyAccess {
 
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
+        @Override
         public Object run() {
             PropertyAccess.addTrustedPrefix("nativewindow.");
             return null;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
index b3b5d2131..8fb819251 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
@@ -36,6 +36,7 @@ package jogamp.nativewindow;
 import javax.media.nativewindow.*;
 
 public class DefaultGraphicsConfigurationFactoryImpl extends GraphicsConfigurationFactory {
+    @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID) {
         return new DefaultGraphicsConfiguration(screen, capsChosen, capsRequested);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java
index 5fdbbf697..cadef9bf1 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java
@@ -72,6 +72,7 @@ public class GlobalToolkitLock implements ToolkitLock {
         // nop
     }
 
+    @Override
     public String toString() {
         return "GlobalToolkitLock[obj 0x"+Integer.toHexString(hashCode())+", isOwner "+globalLock.isOwner(Thread.currentThread())+", "+globalLock.toString()+"]";
     }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
index 36a25acfb..e7eb13756 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
@@ -39,6 +39,7 @@ import com.jogamp.common.util.cache.TempJarCache;
 public class NWJNILibLoader extends JNILibLoaderBase {
     public static boolean loadNativeWindow(final String ossuffix) {
         return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+            @Override
             public Boolean run() {
                 Platform.initSingleton();
                 final String libName = "nativewindow_"+ossuffix ;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
index e3f6ab5ca..22ac3bd94 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
@@ -51,6 +51,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
 
     // This subclass of NativeWindowFactory handles the case of
     // NativeWindows being passed in
+    @Override
     protected NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException {
         if (winObj instanceof NativeWindow) {
             // Use the NativeWindow directly
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
index d8ce98acb..bda20522c 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
@@ -64,6 +64,7 @@ public class NullToolkitLock implements ToolkitLock {
         // nop
     }
 
+    @Override
     public String toString() {
         return "NullToolkitLock[]";
     }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
index 8a1048c6f..097fffead 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
@@ -253,6 +253,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
         return surfaceLock.getOwner();
     }
 
+    @Override
     public final StringBuilder getUpstreamOptionBits(StringBuilder sink) {
         if(null == sink) {
             sink = new StringBuilder();
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java
index 51dd58543..f1efb8133 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java
@@ -73,6 +73,7 @@ public class ResourceToolkitLock implements ToolkitLock {
         // nop
     }
 
+    @Override
     public String toString() {
         return "ResourceToolkitLock[obj 0x"+Integer.toHexString(hashCode())+", isOwner "+lock.isOwner(Thread.currentThread())+", "+lock.toString()+"]";
     }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
index e20d3d138..7b74e1f1f 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
@@ -142,6 +142,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
         }
     }
 
+    @Override
     public String toString() {
         return "SharedResourceToolkitLock[refCount "+refCount+", handle 0x"+Long.toHexString(handle)+", obj 0x"+Integer.toHexString(hashCode())+", isOwner "+lock.isOwner(Thread.currentThread())+", "+lock.toString()+"]";
     }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
index d11e240fa..1e83232bb 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
@@ -74,6 +74,7 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
         }
     }
 
+    @Override
     public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
         synchronized(surfaceUpdatedListenersLock) {
           for(int i = 0; i < surfaceUpdatedListeners.size(); i++ ) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
index 815facbee..a5da41424 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
@@ -50,6 +50,7 @@ import java.security.PrivilegedAction;
 public class JAWTJNILibLoader extends NWJNILibLoader {
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
+      @Override
       public Object run() {
         // Make sure that awt.dll is loaded before loading jawt.dll. Otherwise
         // a Dialog with "awt.dll not found" might pop up.
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
index 32946fe2d..5a1d915ce 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
@@ -320,6 +320,7 @@ public class JAWTUtil {
     j2dExist = ok;
 
     PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction<Object>() {
+        @Override
         public Object run() {
             PrivilegedDataBlob1 d = new PrivilegedDataBlob1();
             try {
@@ -352,9 +353,11 @@ public class JAWTUtil {
     jawtLock = LockFactory.createRecursiveLock();
 
     jawtToolkitLock = new ToolkitLock() {
+          @Override
           public final void lock() {
               JAWTUtil.lockToolkit();
           }
+          @Override
           public final void unlock() {
               JAWTUtil.unlockToolkit();
           }
@@ -380,6 +383,7 @@ public class JAWTUtil {
         } else {
             final ArrayList<Map<?,?>> desktophintsBucket = new ArrayList<Map<?,?>>(1);
             EventQueue.invokeAndWait(new Runnable() {
+                @Override
                 public void run() {
                     Map<?,?> _desktophints = (Map<?,?>)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
                     if(null!=_desktophints) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
index 87e3d3dd8..600aa6cb2 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -88,6 +88,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
               OSXUtil.DestroyNSWindow(windowHandle);
           }
           OSXUtil.RunOnMainThread(false, new Runnable() {
+              @Override
               public void run() {
                   if( 0 != rootSurfaceLayer ) {
                       if( 0 != jawtSurfaceLayersHandle) {
@@ -106,6 +107,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
   @Override
   protected void attachSurfaceLayerImpl(final long layerHandle) {
       OSXUtil.RunOnMainThread(false, new Runnable() {
+          @Override
           public void run() {
               // AWT position is top-left w/ insets, where CALayer position is bottom/left from root CALayer w/o insets.
               // Determine p0: components location on screen w/o insets.
@@ -167,6 +169,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
   @Override
   protected void detachSurfaceLayerImpl(final long layerHandle, final Runnable detachNotify) {
       OSXUtil.RunOnMainThread(false, new Runnable() {
+          @Override
           public void run() {
               detachNotify.run();
               OSXUtil.RemoveCASublayer(rootSurfaceLayer, layerHandle);
@@ -183,6 +186,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
     return offscreenSurfaceDrawableSet ? offscreenSurfaceDrawable : drawable /* super.getSurfaceHandle() */ ;
   }
 
+  @Override
   public void setSurfaceHandle(long surfaceHandle) {
       if( !isOffscreenLayerSurfaceEnabled() ) {
           throw new java.lang.UnsupportedOperationException("Not using CALAYER");
@@ -194,11 +198,13 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
       this.offscreenSurfaceDrawableSet = true;
   }
 
+  @Override
   protected JAWT fetchJAWTImpl() throws NativeWindowException {
        // use offscreen if supported and [ applet or requested ]
       return JAWTUtil.getJAWT(getShallUseOffscreenLayer() || isApplet());
   }
 
+  @Override
   protected int lockSurfaceImpl() throws NativeWindowException {
     int ret = NativeWindow.LOCK_SURFACE_NOT_READY;
     ds = getJAWT().GetDrawingSurface(component);
@@ -223,6 +229,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
     }
     if (firstLock) {
       AccessController.doPrivileged(new PrivilegedAction<Object>() {
+          @Override
           public Object run() {
             dsi = ds.GetDrawingSurfaceInfo();
             return null;
@@ -284,6 +291,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
         if(null == errMsg) {
             jawtSurfaceLayersHandle = GetJAWTSurfaceLayersHandle0(dsi.getBuffer());
             OSXUtil.RunOnMainThread(false, new Runnable() {
+                @Override
                 public void run() {
                     String errMsg = null;
                     if(0 == rootSurfaceLayer && 0 != jawtSurfaceLayersHandle) {
@@ -322,6 +330,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
     return ret;
   }
 
+  @Override
   protected void unlockSurfaceImpl() throws NativeWindowException {
     if(null!=ds) {
         if (null!=dsi) {
@@ -362,6 +371,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
       getLocationOnScreenNonBlocking(storage, component);
       return storage;
   }
+  @Override
   protected Point getLocationOnScreenNativeImpl(final int x0, final int y0) { return null; }
 
 
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
index 876531151..8b9dfabfd 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
@@ -65,6 +65,7 @@ public class Win32SunJDKReflection {
 
   static {
     AccessController.doPrivileged(new PrivilegedAction() {
+        @Override
         public Object run() {
           try {
             win32GraphicsDeviceClass = Class.forName("sun.awt.Win32GraphicsDevice");
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
index 64e177155..54bdb34f6 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
@@ -60,14 +60,17 @@ public class WindowsJAWTWindow extends JAWTWindow {
     super(comp, config);
   }
 
+  @Override
   protected void invalidateNative() {
     windowHandle = 0;
   }
 
+  @Override
   protected JAWT fetchJAWTImpl() throws NativeWindowException {
       return JAWTUtil.getJAWT(false); // no offscreen
   }
 
+  @Override
   protected int lockSurfaceImpl() throws NativeWindowException {
     int ret = NativeWindow.LOCK_SUCCESS;
     ds = getJAWT().GetDrawingSurface(component);
@@ -110,6 +113,7 @@ public class WindowsJAWTWindow extends JAWTWindow {
     return ret;
   }
 
+  @Override
   protected void unlockSurfaceImpl() throws NativeWindowException {
     drawable = 0; // invalid HDC
     if(null!=ds) {
@@ -131,6 +135,7 @@ public class WindowsJAWTWindow extends JAWTWindow {
     return windowHandle;
   }
 
+  @Override
   protected Point getLocationOnScreenNativeImpl(int x, int y) {
     return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
   }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
index b08a7d83a..4599b9021 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
@@ -57,12 +57,15 @@ public class X11JAWTWindow extends JAWTWindow {
     super(comp, config);
   }
 
+  @Override
   protected void invalidateNative() { }
 
+  @Override
   protected JAWT fetchJAWTImpl() throws NativeWindowException {
       return JAWTUtil.getJAWT(false); // no offscreen
   }
 
+  @Override
   protected int lockSurfaceImpl() throws NativeWindowException {
     int ret = NativeWindow.LOCK_SUCCESS;
     ds = getJAWT().GetDrawingSurface(component);
@@ -104,6 +107,7 @@ public class X11JAWTWindow extends JAWTWindow {
     return ret;
   }
 
+  @Override
   protected void unlockSurfaceImpl() throws NativeWindowException {
     if(null!=ds) {
         if (null!=dsi) {
@@ -119,6 +123,7 @@ public class X11JAWTWindow extends JAWTWindow {
     x11dsi = null;
   }
 
+  @Override
   protected Point getLocationOnScreenNativeImpl(int x, int y) {
     // surface is locked and hence the device
     return X11Lib.GetRelativeLocation(getDisplayHandle(), getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
index f1104d02f..b2c3a931b 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
@@ -65,6 +65,7 @@ public class X11SunJDKReflection {
 
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
+        @Override
         public Object run() {
           try {
             x11GraphicsDeviceClass = Class.forName("sun.awt.X11GraphicsDevice");
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
index 004a91a42..bac07b85a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
@@ -271,7 +271,7 @@ public class OSXUtil implements ToolkitProperties {
         RunLater0(onMain, new RunnableTask( runnable, null, true, System.err ), delay);
     }
 
-    private static Runnable _nop = new Runnable() { public void run() {}; };
+    private static Runnable _nop = new Runnable() { @Override public void run() {}; };
 
     /** Issues a {@link #RunOnMainThread(boolean, Runnable)} w/ an <i>NOP</i> runnable, while waiting until done. */
     public static void WaitUntilFinish() {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
index d6e7b5970..6258632cd 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
@@ -51,6 +51,7 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
     private X11GraphicsConfigurationFactory() {
     }
 
+    @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
         CapabilitiesImmutable  capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID)
         throws IllegalArgumentException, NativeWindowException {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
index 6431fb3f5..2576c7db1 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
@@ -300,10 +300,12 @@ public class X11Util implements ToolkitProperties {
             }
         }
 
+        @Override
         public final int hashCode() {
             return hash32;
         }
 
+        @Override
         public final boolean equals(Object obj) {
             if(this == obj) { return true; }
             if(obj instanceof NamedDisplay) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
index 7b37d3cca..062040232 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
@@ -66,6 +66,7 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
     private X11AWTGraphicsConfigurationFactory() {
     }
 
+    @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
             CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
             CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/newt/classes/com/jogamp/newt/Display.java b/src/newt/classes/com/jogamp/newt/Display.java
index 83383d23c..a0a098481 100644
--- a/src/newt/classes/com/jogamp/newt/Display.java
+++ b/src/newt/classes/com/jogamp/newt/Display.java
@@ -41,9 +41,11 @@ public abstract class Display {
     public static final boolean DEBUG = Debug.debug("Display");
 
     /** return precomputed hashCode from FQN {@link #getFQName()} */
+    @Override
     public abstract int hashCode();
 
     /** return true if obj is of type Display and both FQN {@link #getFQName()} equals */
+    @Override
     public boolean equals(Object obj) {
         if (this == obj) { return true; }
         if (obj instanceof Display) {
diff --git a/src/newt/classes/com/jogamp/newt/MonitorDevice.java b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
index 625a7b39f..28d9f53a1 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorDevice.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
@@ -87,6 +87,7 @@ public abstract class MonitorDevice {
      * </ul>
      * <br>
      */
+    @Override
     public final boolean equals(Object obj) {
         if (this == obj) { return true; }
         if (obj instanceof MonitorDevice) {
@@ -102,6 +103,7 @@ public abstract class MonitorDevice {
      *  <li><code>nativeID</code></li>
      * </ul>
      */
+    @Override
     public final int hashCode() {
         return nativeId;
     }
@@ -228,6 +230,7 @@ public abstract class MonitorDevice {
      */
     public abstract boolean setCurrentMode(MonitorMode mode);
 
+    @Override
     public String toString() {
         return "Monitor[Id "+Display.toHexString(nativeId)+", "+sizeMM+" mm, viewport "+viewport+ ", orig "+originalMode+", curr "+currentMode+
                ", modeChanged "+modeChanged+", modeCount "+supportedModes.size()+"]";
diff --git a/src/newt/classes/com/jogamp/newt/MonitorMode.java b/src/newt/classes/com/jogamp/newt/MonitorMode.java
index 175d6e5f2..59f28e791 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorMode.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorMode.java
@@ -114,12 +114,14 @@ public class MonitorMode implements Comparable<MonitorMode> {
 
     /** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the ascending order. */
     public static final Comparator<MonitorMode> monitorModeComparator = new Comparator<MonitorMode>() {
+        @Override
         public int compare(MonitorMode mm1, MonitorMode mm2) {
             return mm1.compareTo(mm2);
         } };
 
     /** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the descending order. */
     public static final Comparator<MonitorMode> monitorModeComparatorInv = new Comparator<MonitorMode>() {
+        @Override
         public int compare(MonitorMode mm1, MonitorMode mm2) {
             return mm2.compareTo(mm1);
         } };
@@ -172,6 +174,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
             }
             return sb;
         }
+        @Override
         public final String toString() {
             return new String(surfaceSize+" @ "+refreshRate+" Hz, flags ["+flags2String(flags).toString()+"]");
         }
@@ -228,6 +231,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
          *  <li><code>flags</code></li>
          * </ul>
          */
+        @Override
         public final boolean equals(Object obj) {
             if (this == obj) { return true; }
             if (obj instanceof SizeAndRRate) {
@@ -247,6 +251,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
          *  <li><code>refreshRate</code></li>
          * </ul>
          */
+        @Override
         public final int hashCode() {
             return hashCode;
         }
@@ -360,6 +365,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
         return getRotatedWH(false);
     }
 
+    @Override
     public final String toString() {
         return "[Id "+Display.toHexString(nativeId)+", " +  sizeAndRRate + ", " + rotation + " degr]";
     }
@@ -409,6 +415,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
      *  <li><code>rotation</code></li>
      * </ul>
      */
+    @Override
     public final boolean equals(Object obj) {
         if (this == obj) { return true; }
         if (obj instanceof MonitorMode) {
@@ -428,6 +435,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
      *  <li><code>rotation</code></li>
      * </ul>
      */
+    @Override
     public final int hashCode() {
         return hashCode;
     }
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index 7116877a3..5ae3f3692 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -56,6 +56,7 @@ public class NewtFactory {
 
     static {
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
+            @Override
             public Object run() {
                 NativeWindowFactory.initSingleton(); // last resort ..
 
diff --git a/src/newt/classes/com/jogamp/newt/Screen.java b/src/newt/classes/com/jogamp/newt/Screen.java
index 1274b3459..ef62ec95d 100644
--- a/src/newt/classes/com/jogamp/newt/Screen.java
+++ b/src/newt/classes/com/jogamp/newt/Screen.java
@@ -53,9 +53,11 @@ public abstract class Screen {
     public static final boolean DEBUG = Debug.debug("Screen");
 
     /** return precomputed hashCode from FQN {@link #getFQName()} */
+    @Override
     public abstract int hashCode();
 
     /** return true if obj is of type Display and both FQN {@link #getFQName()} equals */
+    @Override
     public boolean equals(Object obj) {
         if (this == obj) { return true; }
         if (obj instanceof Screen) {
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index de1b7224f..1f5c26f27 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -107,10 +107,12 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
 
     private AWTWindowClosingProtocol awtWindowClosingProtocol =
           new AWTWindowClosingProtocol(this, new Runnable() {
+                @Override
                 public void run() {
                     NewtCanvasAWT.this.destroyImpl(false /* removeNotify */, true /* windowClosing */);
                 }
             }, new Runnable() {
+                @Override
                 public void run() {
                     if( newtChild != null ) {
                         newtChild.sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
@@ -148,14 +150,17 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         setNEWTChild(child);
     }
 
+    @Override
     public void setShallUseOffscreenLayer(boolean v) {
         shallUseOffscreenLayer = v;
     }
 
+    @Override
     public final boolean getShallUseOffscreenLayer() {
         return shallUseOffscreenLayer;
     }
 
+    @Override
     public final boolean isOffscreenLayerSurfaceEnabled() {
         return jawtWindow.isOffscreenLayerSurfaceEnabled();
     }
@@ -178,6 +183,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     }
 
     class FocusAction implements Window.FocusRunnable {
+        @Override
         public boolean run() {
             final boolean isParent = isParent();
             final boolean isFullscreen = isFullscreen();
@@ -214,11 +220,13 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     };
 
     class FocusTraversalKeyListener implements KeyListener {
+         @Override
          public void keyPressed(KeyEvent e) {
              if( isParent() && !isFullscreen() ) {
                  handleKey(e, false);
              }
          }
+         @Override
          public void keyReleased(KeyEvent e) {
              if( isParent() && !isFullscreen() ) {
                  handleKey(e, true);
@@ -263,6 +271,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     private final FocusTraversalKeyListener newtFocusTraversalKeyListener = new FocusTraversalKeyListener();
 
     class FocusPropertyChangeListener implements PropertyChangeListener {
+        @Override
         public void propertyChange(PropertyChangeEvent evt) {
             final Object oldF = evt.getOldValue();
             final Object newF = evt.getNewValue();
@@ -358,10 +367,12 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
      * or {@link #addNotify()} hasn't been called yet.*/
     public NativeWindow getNativeWindow() { return jawtWindow; }
 
+    @Override
     public WindowClosingMode getDefaultCloseOperation() {
         return awtWindowClosingProtocol.getDefaultCloseOperation();
     }
 
+    @Override
     public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
         return awtWindowClosingProtocol.setDefaultCloseOperation(op);
     }
@@ -745,6 +756,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
       }
     }
     private final Runnable forceRelayout = new Runnable() {
+        @Override
         public void run() {
             if(DEBUG) {
                 System.err.println("NewtCanvasAWT.forceRelayout.0");
@@ -797,6 +809,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     if (!disableBackgroundEraseInitialized) {
       try {
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
+            @Override
             public Object run() {
               try {
                 Class<?> clazz = getToolkit().getClass();
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
index 9b1b82297..409f78307 100644
--- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
+++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
@@ -102,6 +102,7 @@ public class JOGLNewtApplet1Run extends Applet {
     /** if valid glStandalone:=true (own window) ! */
     int glXd=Integer.MAX_VALUE, glYd=Integer.MAX_VALUE, glWidth=Integer.MAX_VALUE, glHeight=Integer.MAX_VALUE;
 
+    @Override
     public void init() {
         if(DEBUG) {
             System.err.println("JOGLNewtApplet1Run.init() START");
@@ -223,6 +224,7 @@ public class JOGLNewtApplet1Run extends Applet {
         }
     }
 
+    @Override
     public void start() {
         if(DEBUG) {
             System.err.println("JOGLNewtApplet1Run.start() START (isVisible "+isVisible()+", isDisplayable "+isDisplayable()+")");
@@ -266,6 +268,7 @@ public class JOGLNewtApplet1Run extends Applet {
         }
     }
 
+    @Override
     public void stop() {
         if(DEBUG) {
             System.err.println("JOGLNewtApplet1Run.stop() START");
@@ -276,6 +279,7 @@ public class JOGLNewtApplet1Run extends Applet {
         }
     }
 
+    @Override
     public void destroy() {
         if(DEBUG) {
             System.err.println("JOGLNewtApplet1Run.destroy() START");
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
index a6a30a8bf..d17d2e77c 100644
--- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
+++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
@@ -112,6 +112,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
 
         try {
             final Class<?> clazz = AccessController.doPrivileged(new PrivilegedAction<Class<?>>() {
+                @Override
                 public Class<?> run() {
                     final ClassLoader cl = Thread.currentThread().getContextClassLoader();
                     Class<?> clazz = null;
@@ -169,6 +170,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
                         if(null == glWindow.getParent()) {
                             // we may be called directly by the native EDT
                             new Thread(new Runnable() {
+                               @Override
                                public void run() {
                                 if( glWindow.isNativeValid() ) {
                                     glWindow.reparentWindow(awtParent);
@@ -256,6 +258,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
     // ***********************************************************************************
     // ***********************************************************************************
 
+    @Override
     public void init(GLAutoDrawable drawable) {
         GL _gl = drawable.getGL();
 
@@ -276,10 +279,13 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
             _gl.setSwapInterval(glSwapInterval);
         }
     }
+    @Override
     public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
     }
+    @Override
     public void display(GLAutoDrawable drawable) {
     }
+    @Override
     public void dispose(GLAutoDrawable drawable) {
     }
 
diff --git a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
index 7dda47534..edb2429bb 100644
--- a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
@@ -142,6 +142,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
         }
     }
 
+    @Override
     public String toString() {
         return "DoubleTapScroll[state "+gestureState+", in "+isWithinGesture()+", has "+(null!=hitGestureEvent)+", pc "+pointerDownCount+"]";
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/InputEvent.java b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
index 6520dafcf..f29b632e8 100644
--- a/src/newt/classes/com/jogamp/newt/event/InputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
@@ -210,10 +210,12 @@ public abstract class InputEvent extends NEWTEvent
      return 0 != ( modifiers & BUTTONALL_MASK );
  }
 
+ @Override
  public String toString() {
      return toString(null).toString();
  }
 
+ @Override
  public StringBuilder toString(StringBuilder sb) {
      if(null == sb) {
          sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
index a89148574..5cef734bb 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
@@ -31,8 +31,10 @@ package com.jogamp.newt.event;
 
 public abstract class KeyAdapter implements KeyListener
 {
+ @Override
  public void keyPressed(KeyEvent e) {
  }
+ @Override
  public void keyReleased(KeyEvent e) {
  }
 }
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
index 81680bf32..49aa4e054 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
@@ -196,10 +196,12 @@ public class KeyEvent extends InputEvent
         return keyCode;
     }
 
+    @Override
     public final String toString() {
         return toString(null).toString();
     }
 
+    @Override
     public final StringBuilder toString(StringBuilder sb) {
         if(null == sb) {
             sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
index 77c66a2da..03242e147 100644
--- a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
@@ -56,10 +56,12 @@ public class MonitorEvent extends OutputEvent {
         }
     }
 
+    @Override
     public final String toString() {
         return toString(null).toString();
     }
 
+    @Override
     public final StringBuilder toString(StringBuilder sb) {
         if(null == sb) {
             sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
index 652f87d5b..98252fe14 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
@@ -30,20 +30,28 @@ package com.jogamp.newt.event;
 
 public abstract class MouseAdapter implements MouseListener
 {
+ @Override
  public void mouseClicked(MouseEvent e) {
  }
+ @Override
  public void mouseEntered(MouseEvent e) {
  }
+ @Override
  public void mouseExited(MouseEvent e) {
  }
+ @Override
  public void mousePressed(MouseEvent e) {
  }
+ @Override
  public void mouseReleased(MouseEvent e) {
  }
+ @Override
  public void mouseMoved(MouseEvent e) {
  }
+ @Override
  public void mouseDragged(MouseEvent e) {
  }
+ @Override
  public void mouseWheelMoved(MouseEvent e) {
  }
 }
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
index 4d7cc3b36..635bdba52 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
@@ -510,10 +510,12 @@ public class MouseEvent extends InputEvent
         return rotationScale;
     }
 
+    @Override
     public final String toString() {
         return toString(null).toString();
     }
 
+    @Override
     public final StringBuilder toString(StringBuilder sb) {
         if(null == sb) {
             sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
index 022e2d0e1..af800e61e 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
@@ -131,6 +131,7 @@ public class NEWTEvent extends java.util.EventObject {
         }
     }
 
+    @Override
     public String toString() {
         return toString(null).toString();
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
index d275eab46..b4e1341da 100644
--- a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
@@ -75,6 +75,7 @@ public class PinchToZoomGesture implements GestureHandler {
         this.zoom = 1f;
     }
 
+    @Override
     public String toString() {
         return "PinchZoom[1stTouch "+zoomFirstTouch+", in "+isWithinGesture()+", has "+(null!=zoomEvent)+", zoom "+zoom+"]";
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
index e826f4a6a..bbc170958 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
@@ -40,10 +40,12 @@ public class TraceKeyAdapter implements KeyListener {
         this.downstream = downstream;
     }
 
+    @Override
     public void keyPressed(KeyEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.keyPressed(e); }
     }
+    @Override
     public void keyReleased(KeyEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.keyReleased(e); }
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
index d035091c4..db8376034 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
@@ -40,34 +40,42 @@ public class TraceMouseAdapter implements MouseListener {
     this.downstream = downstream;
  }
 
+ @Override
  public void mouseClicked(MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseClicked(e); }
  }
+ @Override
  public void mouseEntered(MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseEntered(e); }
  }
+ @Override
  public void mouseExited(MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseExited(e); }
  }
+ @Override
  public void mousePressed(MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mousePressed(e); }
  }
+ @Override
  public void mouseReleased(MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseReleased(e); }
  }
+ @Override
  public void mouseMoved(MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseMoved(e); }
  }
+ @Override
  public void mouseDragged(MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseDragged(e); }
  }
+ @Override
  public void mouseWheelMoved(MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseWheelMoved(e); }
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
index 630e85303..7b844f059 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
@@ -40,30 +40,37 @@ public class TraceWindowAdapter implements WindowListener {
         this.downstream = downstream;
     }
 
+    @Override
     public void windowResized(WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowResized(e); }
     }
+    @Override
     public void windowMoved(WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowMoved(e); }
     }
+    @Override
     public void windowDestroyNotify(WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowDestroyNotify(e); }
     }
+    @Override
     public void windowDestroyed(WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowDestroyed(e); }
     }
+    @Override
     public void windowGainedFocus(WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowGainedFocus(e); }
     }
+    @Override
     public void windowLostFocus(WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowLostFocus(e); }
     }
+    @Override
     public void windowRepaint(WindowUpdateEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowRepaint(e); }
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
index e237c0d80..ccc627444 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
@@ -30,18 +30,25 @@ package com.jogamp.newt.event;
 
 public abstract class WindowAdapter implements WindowListener
 {
+    @Override
     public void windowResized(WindowEvent e) {
     }
+    @Override
     public void windowMoved(WindowEvent e) {
     }
+    @Override
     public void windowDestroyNotify(WindowEvent e) {
     }
+    @Override
     public void windowDestroyed(WindowEvent e) {
     }
+    @Override
     public void windowGainedFocus(WindowEvent e) {
     }
+    @Override
     public void windowLostFocus(WindowEvent e) {
     }
+    @Override
     public void windowRepaint(WindowUpdateEvent e) {
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
index 8c7abfe99..2841fd0f6 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
@@ -66,10 +66,12 @@ public class WindowEvent extends NEWTEvent {
         }
     }
 
+    @Override
     public String toString() {
         return toString(null).toString();
     }
 
+    @Override
     public StringBuilder toString(StringBuilder sb) {
         if(null == sb) {
             sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
index 8a204d234..9044517b5 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
@@ -44,10 +44,12 @@ public class WindowUpdateEvent extends WindowEvent {
         return bounds;
     }
 
+    @Override
     public String toString() {
         return toString(null).toString();
     }
 
+    @Override
     public StringBuilder toString(StringBuilder sb) {
         if(null == sb) {
             sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
index 1b53671ba..f6f11b81f 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
@@ -49,11 +49,13 @@ public class AWTKeyAdapter extends AWTAdapter implements java.awt.event.KeyListe
         super(downstream);
     }
 
+    @Override
     public AWTAdapter addTo(java.awt.Component awtComponent) {
         awtComponent.addKeyListener(this);
         return this;
     }
 
+    @Override
     public AWTAdapter removeFrom(java.awt.Component awtComponent) {
         awtComponent.removeKeyListener(this);
         return this;
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
index ab4bf7a3f..73a02c9fc 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
@@ -46,6 +46,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         super(downstream);
     }
 
+    @Override
     public AWTAdapter addTo(java.awt.Component awtComponent) {
         awtComponent.addMouseListener(this);
         awtComponent.addMouseMotionListener(this);
@@ -53,6 +54,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         return this;
     }
 
+    @Override
     public AWTAdapter removeFrom(java.awt.Component awtComponent) {
         awtComponent.removeMouseListener(this);
         awtComponent.removeMouseMotionListener(this);
@@ -60,6 +62,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         return this;
     }
 
+    @Override
     public void mouseClicked(java.awt.event.MouseEvent e) {
         com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
         if(null!=newtListener) {
@@ -69,6 +72,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         }
     }
 
+    @Override
     public void mouseEntered(java.awt.event.MouseEvent e) {
         com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
         if(null!=newtListener) {
@@ -78,6 +82,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         }
     }
 
+    @Override
     public void mouseExited(java.awt.event.MouseEvent e) {
         com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
         if(null!=newtListener) {
@@ -87,6 +92,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         }
     }
 
+    @Override
     public void mousePressed(java.awt.event.MouseEvent e) {
         com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
         if(null!=newtListener) {
@@ -96,6 +102,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         }
     }
 
+    @Override
     public void mouseReleased(java.awt.event.MouseEvent e) {
         com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
         if(null!=newtListener) {
@@ -105,6 +112,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         }
     }
 
+    @Override
     public void mouseDragged(java.awt.event.MouseEvent e) {
         com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
         if(null!=newtListener) {
@@ -114,6 +122,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         }
     }
 
+    @Override
     public void mouseMoved(java.awt.event.MouseEvent e) {
         com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
         if(null!=newtListener) {
@@ -123,6 +132,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
         }
     }
 
+    @Override
     public void mouseWheelMoved(java.awt.event.MouseWheelEvent e) {
         com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
         if(null!=newtListener) {
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
index 8c9781b77..8a9a2a49f 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
@@ -50,6 +50,7 @@ public class AWTWindowAdapter
         super(downstream);
     }
 
+    @Override
     public AWTAdapter addTo(java.awt.Component awtComponent) {
         java.awt.Window win = getWindow(awtComponent);
         awtComponent.addComponentListener(this);
@@ -74,6 +75,7 @@ public class AWTWindowAdapter
         return this;
     }
 
+    @Override
     public AWTAdapter removeFrom(java.awt.Component awtComponent) {
         awtComponent.removeFocusListener(this);
         awtComponent.removeComponentListener(this);
@@ -94,6 +96,7 @@ public class AWTWindowAdapter
         return null;
     }
 
+    @Override
     public void focusGained(java.awt.event.FocusEvent e) {
         com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
         if(DEBUG_IMPLEMENTATION) {
@@ -106,6 +109,7 @@ public class AWTWindowAdapter
         }
     }
 
+    @Override
     public void focusLost(java.awt.event.FocusEvent e) {
         com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
         if(DEBUG_IMPLEMENTATION) {
@@ -118,6 +122,7 @@ public class AWTWindowAdapter
         }
     }
 
+    @Override
     public void componentResized(java.awt.event.ComponentEvent e) {
         com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
         if(DEBUG_IMPLEMENTATION) {
@@ -142,6 +147,7 @@ public class AWTWindowAdapter
         }
     }
 
+    @Override
     public void componentMoved(java.awt.event.ComponentEvent e) {
         com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
         if(DEBUG_IMPLEMENTATION) {
@@ -154,6 +160,7 @@ public class AWTWindowAdapter
         }
     }
 
+    @Override
     public void componentShown(java.awt.event.ComponentEvent e) {
         final java.awt.Component comp = e.getComponent();
         if(DEBUG_IMPLEMENTATION) {
@@ -171,6 +178,7 @@ public class AWTWindowAdapter
         }*/
     }
 
+    @Override
     public void componentHidden(java.awt.event.ComponentEvent e) {
         final java.awt.Component comp = e.getComponent();
         if(DEBUG_IMPLEMENTATION) {
@@ -188,6 +196,7 @@ public class AWTWindowAdapter
         }*/
     }
 
+    @Override
     public void windowActivated(java.awt.event.WindowEvent e) {
         com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
         if(null!=newtListener) {
@@ -197,10 +206,13 @@ public class AWTWindowAdapter
         }
     }
 
+    @Override
     public void windowClosed(java.awt.event.WindowEvent e) { }
 
+    @Override
     public void windowClosing(java.awt.event.WindowEvent e) { }
 
+    @Override
     public void windowDeactivated(java.awt.event.WindowEvent e) {
         com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
         if(null!=newtListener) {
@@ -210,13 +222,17 @@ public class AWTWindowAdapter
         }
     }
 
+    @Override
     public void windowDeiconified(java.awt.event.WindowEvent e) { }
 
+    @Override
     public void windowIconified(java.awt.event.WindowEvent e) { }
 
+    @Override
     public void windowOpened(java.awt.event.WindowEvent e) { }
 
     class WindowClosingListener implements java.awt.event.WindowListener {
+        @Override
         public void windowClosing(java.awt.event.WindowEvent e) {
             com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
             if(null!=newtListener) {
@@ -225,6 +241,7 @@ public class AWTWindowAdapter
                 enqueueEvent(true, event);
             }
         }
+        @Override
         public void windowClosed(java.awt.event.WindowEvent e) {
             com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
             if(null!=newtListener) {
@@ -234,10 +251,15 @@ public class AWTWindowAdapter
             }
         }
 
+        @Override
         public void windowActivated(java.awt.event.WindowEvent e) { }
+        @Override
         public void windowDeactivated(java.awt.event.WindowEvent e) { }
+        @Override
         public void windowDeiconified(java.awt.event.WindowEvent e) { }
+        @Override
         public void windowIconified(java.awt.event.WindowEvent e) { }
+        @Override
         public void windowOpened(java.awt.event.WindowEvent e) { }
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index ac81e8469..8c1110ed3 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -117,6 +117,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
         super(null, null, false /* always handle device lifecycle ourselves */);
         this.window = (WindowImpl) window;
         this.window.setWindowDestroyNotifyAction( new Runnable() {
+            @Override
             public void run() {
                 defaultWindowDestroyNotifyOp();
             } } );
@@ -549,6 +550,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
                     anim.stop(); // on anim thread, non-blocking
                 } else {
                     AccessController.doPrivileged(new PrivilegedAction<Object>() {
+                        @Override
                         public Object run() {
                             if( anim.isAnimating() && null != animThread ) {
                                 try {
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index a25b43777..e63a53524 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -99,6 +99,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
     public static NewtCanvasSWT create(final Composite parent, final int style, final Window child) {
         final NewtCanvasSWT[] res = new NewtCanvasSWT[] { null };
         parent.getDisplay().syncExec( new Runnable() {
+           @Override
            public void run() {
                res[0] = new NewtCanvasSWT( parent, style, child);
            }
@@ -254,10 +255,12 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
     /** @return this SWT Canvas NativeWindow representation, may be null in case it has not been realized. */
     public NativeWindow getNativeWindow() { return nativeWindow; }
 
+    @Override
     public WindowClosingMode getDefaultCloseOperation() {
         return newtChildCloseOp; // TODO: implement ?!
     }
 
+    @Override
     public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
         return newtChildCloseOp = op; // TODO: implement ?!
     }
diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java
index 46a354d4a..7ef2d7ffc 100644
--- a/src/newt/classes/jogamp/newt/Debug.java
+++ b/src/newt/classes/jogamp/newt/Debug.java
@@ -54,6 +54,7 @@ public class Debug extends PropertyAccess {
 
   static {
     AccessController.doPrivileged(new PrivilegedAction<Object>() {
+        @Override
         public Object run() {
             PropertyAccess.addTrustedPrefix("newt.");
             return null;
diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java
index c6cb706a4..0c29d772a 100644
--- a/src/newt/classes/jogamp/newt/DisplayImpl.java
+++ b/src/newt/classes/jogamp/newt/DisplayImpl.java
@@ -53,6 +53,7 @@ public abstract class DisplayImpl extends Display {
 
     static {
         NativeWindowFactory.addCustomShutdownHook(true /* head */, new Runnable() {
+           @Override
            public void run() {
                WindowImpl.shutdownAll();
                ScreenImpl.shutdownAll();
@@ -147,6 +148,7 @@ public abstract class DisplayImpl extends Display {
             final DisplayImpl f_dpy = this;
             try {
                 runOnEDTIfAvail(true, new Runnable() {
+                    @Override
                     public void run() {
                         f_dpy.createNativeImpl();
                     }});
@@ -244,6 +246,7 @@ public abstract class DisplayImpl extends Display {
         task.run();
     }
 
+    @Override
     public boolean validateEDTStopped() {
         if( 0==refCount && null == aDevice ) {
             final EDTUtil _edtUtil = edtUtil;
@@ -277,6 +280,7 @@ public abstract class DisplayImpl extends Display {
         aDevice = null;
         refCount=0;
         stopEDT( edtUtil, new Runnable() { // blocks!
+            @Override
             public void run() {
                 if ( null != f_aDevice ) {
                     f_dpy.closeNativeImpl(f_aDevice);
@@ -308,6 +312,7 @@ public abstract class DisplayImpl extends Display {
                 d.aDevice = null;
                 d.refCount=0;
                 final Runnable closeNativeTask = new Runnable() {
+                    @Override
                     public void run() {
                         if ( null != d.getGraphicsDevice() ) {
                             d.closeNativeImpl(f_aDevice);
@@ -329,6 +334,7 @@ public abstract class DisplayImpl extends Display {
         }
     }
 
+    @Override
     public synchronized final int addReference() {
         if(DEBUG) {
             System.err.println("Display.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
@@ -343,6 +349,7 @@ public abstract class DisplayImpl extends Display {
     }
 
 
+    @Override
     public synchronized final int removeReference() {
         if(DEBUG) {
             System.err.println("Display.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1));
@@ -355,6 +362,7 @@ public abstract class DisplayImpl extends Display {
         return refCount;
     }
 
+    @Override
     public synchronized final int getReferenceCount() {
         return refCount;
     }
@@ -450,6 +458,7 @@ public abstract class DisplayImpl extends Display {
     private volatile boolean haveEvents = false;
 
     final protected Runnable dispatchMessagesRunnable = new Runnable() {
+        @Override
         public void run() {
             DisplayImpl.this.dispatchMessages();
         } };
diff --git a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
index f1e212394..9364ada30 100644
--- a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
+++ b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
@@ -51,6 +51,7 @@ import com.jogamp.common.util.cache.TempJarCache;
 public class NEWTJNILibLoader extends JNILibLoaderBase {
     public static boolean loadNEWT() {
         return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+            @Override
             public Boolean run() {
                 Platform.initSingleton();
                 final String libName = "newt";
diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java
index eba844230..2478b1e5d 100644
--- a/src/newt/classes/jogamp/newt/OffscreenWindow.java
+++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java
@@ -57,6 +57,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
 
     static long nextWindowHandle = 0x100; // start here - a marker
 
+    @Override
     protected void createNativeImpl() {
         if(capsRequested.isOnscreen()) {
             throw new NativeWindowException("Capabilities is onscreen");
@@ -75,6 +76,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
         visibleChanged(false, true);
     }
 
+    @Override
     protected void closeNativeImpl() {
         // nop
     }
@@ -85,6 +87,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
         surfaceHandle = 0;
     }
 
+    @Override
     public void setSurfaceHandle(long handle) {
         surfaceHandle = handle ;
     }
@@ -94,6 +97,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
         return surfaceHandle;
     }
 
+    @Override
     protected void requestFocusImpl(boolean reparented) {
     }
 
@@ -113,6 +117,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
     }
 
 
+    @Override
     protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
         sizeChanged(false, width, height, false);
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
@@ -138,10 +143,12 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
      return new Point(0,0);
     }
 
+    @Override
     protected Point getLocationOnScreenImpl(int x, int y) {
         return new Point(x,y);
     }
 
+    @Override
     protected void updateInsetsImpl(Insets insets) {
         // nop ..
     }
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index a0ef8816b..5102fd26d 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -207,6 +207,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         /** last mouse button click count */
         short lastButtonClickCount = (short)0;
 
+        @Override
         final void clearButton() {
             super.clearButton();
             lastButtonPressTime = 0;
@@ -536,12 +537,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     private Object closingListenerLock = new Object();
     private WindowClosingMode defaultCloseOperation = WindowClosingMode.DISPOSE_ON_CLOSE;
 
+    @Override
     public WindowClosingMode getDefaultCloseOperation() {
         synchronized (closingListenerLock) {
             return defaultCloseOperation;
         }
     }
 
+    @Override
     public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
         synchronized (closingListenerLock) {
             WindowClosingMode _op = defaultCloseOperation;
@@ -956,6 +959,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             this.visible = visible;
         }
 
+        @Override
         public final void run() {
             setVisibleActionImpl(visible);
         }
@@ -983,6 +987,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             this.disregardFS = disregardFS;
         }
 
+        @Override
         public final void run() {
             final RecursiveLock _lock = windowLock;
             _lock.lock();
@@ -1035,6 +1040,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     private class DestroyAction implements Runnable {
+        @Override
         public final void run() {
             boolean animatorPaused = false;
             if(null!=lifecycleHook) {
@@ -1188,6 +1194,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             screen = newScreen;
         }
 
+        @Override
         public final void run() {
             boolean animatorPaused = false;
             if(null!=lifecycleHook) {
@@ -1462,6 +1469,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     private class ReparentActionRecreate implements Runnable {
+        @Override
         public final void run() {
             final RecursiveLock _lock = windowLock;
             _lock.lock();
@@ -1514,6 +1522,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             this.undecorated = undecorated;
         }
 
+        @Override
         public final void run() {
             final RecursiveLock _lock = windowLock;
             _lock.lock();
@@ -1559,6 +1568,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             this.alwaysOnTop = alwaysOnTop;
         }
 
+        @Override
         public final void run() {
             final RecursiveLock _lock = windowLock;
             _lock.lock();
@@ -1834,6 +1844,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     private final Runnable requestFocusAction = new Runnable() {
+        @Override
         public final void run() {
             if(DEBUG_IMPLEMENTATION) {
                 System.err.println("Window.RequestFocusAction: force 0 - ("+getThreadName()+"): "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -1842,6 +1853,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
     };
     private final Runnable requestFocusActionForced = new Runnable() {
+        @Override
         public final void run() {
             if(DEBUG_IMPLEMENTATION) {
                 System.err.println("Window.RequestFocusAction: force 1 - ("+getThreadName()+"): "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -1921,6 +1933,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             this.y = y;
         }
 
+        @Override
         public final void run() {
             final RecursiveLock _lock = windowLock;
             _lock.lock();
@@ -1970,6 +1983,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
         public boolean fsOn() { return fullscreen; }
 
+        @Override
         public final void run() {
             final RecursiveLock _lock = windowLock;
             _lock.lock();
@@ -2144,6 +2158,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         List<MonitorDevice> _fullscreenMonitors = null;
         boolean _fullscreenUseMainMonitor = true;
 
+        @Override
         public void monitorModeChangeNotify(MonitorEvent me) {
             hadFocus = hasFocus();
             if(DEBUG_IMPLEMENTATION) {
@@ -2164,6 +2179,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             }
         }
 
+        @Override
         public void monitorModeChanged(MonitorEvent me, boolean success) {
             if(DEBUG_IMPLEMENTATION) {
                 System.err.println("Window.monitorModeChanged: hadFocus "+hadFocus+", "+me+", success: "+success+" @ "+Thread.currentThread().getName());
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
index 325f17278..4bcb0fc82 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
@@ -51,16 +51,19 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
         this.downstreamParent = downstreamParent;
     }
 
+    @Override
     public AWTAdapter addTo(java.awt.Component awtComponent) {
         awtComponent.addHierarchyListener(this);
         return super.addTo(awtComponent);
     }
 
+    @Override
     public AWTAdapter removeFrom(java.awt.Component awtComponent) {
         awtComponent.removeHierarchyListener(this);
         return super.removeFrom(awtComponent);
     }
 
+    @Override
     public void focusGained(java.awt.event.FocusEvent e) {
         // forward focus to NEWT child
         final com.jogamp.newt.Window newtChild = getNewtWindow();
@@ -78,12 +81,14 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
         }
     }
 
+    @Override
     public void focusLost(java.awt.event.FocusEvent e) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWT: focusLost: "+ e);
         }
     }
 
+    @Override
     public void componentResized(java.awt.event.ComponentEvent e) {
         // Need to resize the NEWT child window
         // the resized event will be send via the native window feedback.
@@ -93,6 +98,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
         }
         final Window newtWindow = getNewtWindow();
         newtWindow.runOnEDTIfAvail(false, new Runnable() {
+            @Override
             public void run() {
                 int cw = comp.getWidth();
                 int ch = comp.getHeight();
@@ -109,6 +115,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
             }});
     }
 
+    @Override
     public void componentMoved(java.awt.event.ComponentEvent e) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWT: componentMoved: "+e);
@@ -119,14 +126,17 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
         }
     }
 
+    @Override
     public void windowActivated(java.awt.event.WindowEvent e) {
         // no propagation to NEWT child window
     }
 
+    @Override
     public void windowDeactivated(java.awt.event.WindowEvent e) {
         // no propagation to NEWT child window
     }
 
+    @Override
     public void hierarchyChanged(java.awt.event.HierarchyEvent e) {
         if( null == getNewtEventListener() ) {
             long bits = e.getChangeFlags();
@@ -137,6 +147,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
                     System.err.println("AWT: hierarchyChanged SHOWING_CHANGED: showing "+showing+", "+changed+", source "+e.getComponent());
                 }
                 getNewtWindow().runOnEDTIfAvail(false, new Runnable() {
+                    @Override
                     public void run() {
                         if(getNewtWindow().isVisible() != showing) {
                             getNewtWindow().setVisible(showing);
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
index 14cc9c69d..f7722c91c 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
@@ -107,6 +107,7 @@ public class AWTCanvas extends Canvas {
     return res;
   }
 
+  @Override
   public void addNotify() {
 
     /**
@@ -160,6 +161,7 @@ public class AWTCanvas extends Canvas {
       return null != jawtWindow ? jawtWindow.isOffscreenLayerSurfaceEnabled() : false;
   }
 
+  @Override
   public void removeNotify() {
       try {
         dispose();
@@ -195,6 +197,7 @@ public class AWTCanvas extends Canvas {
    * Overridden to choose a GraphicsConfiguration on a parent container's
    * GraphicsDevice because both devices
    */
+  @Override
   public GraphicsConfiguration getGraphicsConfiguration() {
     /*
      * Workaround for problems with Xinerama and java.awt.Component.checkGD
@@ -324,6 +327,7 @@ public class AWTCanvas extends Canvas {
     if (!disableBackgroundEraseInitialized) {
       try {
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
+            @Override
             public Object run() {
               try {
                 Class<?> clazz = getToolkit().getClass();
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
index bddb43b30..4a7193306 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
@@ -218,6 +218,7 @@ public class AWTEDTUtil implements EDTUtil {
         }
         try {
             AWTEDTExecutor.singleton.invoke(true, new Runnable() {
+                @Override
                 public void run() { }
             });
         } catch (Exception e) { }
diff --git a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
index 9e716d544..d9a4a48e5 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
@@ -46,6 +46,7 @@ public class DisplayDriver extends DisplayImpl {
     public DisplayDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         aDevice = AWTGraphicsDevice.createDefault();
     }
@@ -54,6 +55,7 @@ public class DisplayDriver extends DisplayImpl {
         aDevice = d;
     }
 
+    @Override
     protected EDTUtil createEDTUtil() {
         final EDTUtil def;
         if(NewtFactory.useEDT()) {
@@ -67,10 +69,12 @@ public class DisplayDriver extends DisplayImpl {
         return def;
     }
 
+    @Override
     protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
 
+    @Override
     protected void dispatchMessagesNative() { /* nop */ }
 }
 
diff --git a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
index a2430e2bb..a4356707e 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
@@ -49,6 +49,7 @@ public class ScreenDriver extends ScreenImpl {
     public ScreenDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         aScreen = new AWTGraphicsScreen((AWTGraphicsDevice)display.getGraphicsDevice());
     }
@@ -65,8 +66,10 @@ public class ScreenDriver extends ScreenImpl {
         super.updateVirtualScreenOriginAndSize();
     }
 
+    @Override
     protected void closeNativeImpl() { }
 
+    @Override
     protected int validateScreenIndex(int idx) {
         return idx; // pass through ...
     }
diff --git a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
index db71695b7..9854524d9 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
@@ -86,6 +86,7 @@ public class WindowDriver extends WindowImpl {
     private Frame awtFrame = null;
     private AWTCanvas awtCanvas;
 
+    @Override
     protected void requestFocusImpl(boolean reparented) {
         awtContainer.requestFocus();
     }
@@ -97,6 +98,7 @@ public class WindowDriver extends WindowImpl {
         }
     }
 
+    @Override
     protected void createNativeImpl() {
         if(0!=getParentWindowHandle()) {
             throw new RuntimeException("Window parenting not supported in AWT, use AWTWindow(Frame) cstr for wrapping instead");
@@ -140,6 +142,7 @@ public class WindowDriver extends WindowImpl {
         }
     }
 
+    @Override
     protected void closeNativeImpl() {
         setWindowHandle(0);
         if(null!=awtContainer) {
@@ -176,6 +179,7 @@ public class WindowDriver extends WindowImpl {
         return res;
     }
 
+    @Override
     protected void updateInsetsImpl(javax.media.nativewindow.util.Insets insets) {
         final Insets contInsets = awtContainer.getInsets();
         insets.set(contInsets.left, contInsets.right, contInsets.top, contInsets.bottom);
@@ -214,6 +218,7 @@ public class WindowDriver extends WindowImpl {
         awtContainer.validate();
     }
 
+    @Override
     protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWTWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
@@ -266,6 +271,7 @@ public class WindowDriver extends WindowImpl {
         return true;
     }
 
+    @Override
     protected Point getLocationOnScreenImpl(int x, int y) {
         java.awt.Point ap = awtCanvas.getLocationOnScreen();
         ap.translate(x, y);
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
index 1b73cb381..9da671d37 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
@@ -61,6 +61,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
     public DisplayDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         final long handle = CreateDisplay(ScreenDriver.fixedWidth, ScreenDriver.fixedHeight);
         if (handle == EGL.EGL_NO_DISPLAY) {
@@ -69,6 +70,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
         aDevice = new EGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, handle, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT, null);
     }
 
+    @Override
     protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
             DestroyDisplay(aDevice.getHandle());
@@ -76,6 +78,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
         aDevice.close();
     }
 
+    @Override
     protected void dispatchMessagesNative() {
         // n/a .. DispatchMessages();
     }
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
index 269574adc..d3231557f 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
@@ -53,12 +53,15 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     public ScreenDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
     }
 
+    @Override
     protected void closeNativeImpl() { }
 
+    @Override
     protected int validateScreenIndex(int idx) {
         return 0; // only one screen available
     }
@@ -100,6 +103,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         return false;
     }
 
+    @Override
     protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
         vOriginSize.set(0, 0, fixedWidth, fixedHeight); // FIXME
     }
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
index bed0520ff..39f168e0f 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
@@ -52,6 +52,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     public WindowDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         if(0!=getParentWindowHandle()) {
             throw new RuntimeException("Window parenting not supported (yet)");
@@ -72,12 +73,14 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         }
     }
 
+    @Override
     protected void closeNativeImpl() {
         if(0!=windowHandleClose) {
             CloseWindow(getDisplayHandle(), windowHandleClose);
         }
     }
 
+    @Override
     protected void requestFocusImpl(boolean reparented) { }
 
     protected void setSizeImpl(int width, int height) {
@@ -89,6 +92,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         }
     }
 
+    @Override
     protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
         if(0!=getWindowHandle()) {
             if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) {
@@ -117,10 +121,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         return true;
     }
 
+    @Override
     protected Point getLocationOnScreenImpl(int x, int y) {
         return new Point(x,y);
     }
 
+    @Override
     protected void updateInsetsImpl(Insets insets) {
         // nop ..
     }
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
index 52c92a5da..d8d93f123 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
@@ -59,15 +59,18 @@ public class DisplayDriver extends DisplayImpl {
     public DisplayDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         // FIXME: map name to EGL_*_DISPLAY
         aDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
     }
 
+    @Override
     protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
 
+    @Override
     protected void dispatchMessagesNative() {
         DispatchMessages();
     }
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
index 5a1917419..dc2a8459a 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
@@ -45,13 +45,16 @@ public class ScreenDriver extends ScreenImpl {
     public ScreenDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
         initNative();
     }
 
+    @Override
     protected void closeNativeImpl() { }
 
+    @Override
     protected int validateScreenIndex(int idx) {
         return 0; // only one screen available
     }
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
index 560e49e96..4d4977776 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
@@ -55,6 +55,7 @@ public class WindowDriver extends WindowImpl {
     public WindowDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         if(0!=getParentWindowHandle()) {
             throw new RuntimeException("Window parenting not supported (yet)");
@@ -92,6 +93,7 @@ public class WindowDriver extends WindowImpl {
         focusChanged(false, true);
     }
 
+    @Override
     protected void closeNativeImpl() {
         final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) getGraphicsConfiguration().getScreen().getDevice();
 
@@ -106,10 +108,12 @@ public class WindowDriver extends WindowImpl {
         eglDevice.close();
     }
 
+    @Override
     protected void requestFocusImpl(boolean reparented) {
         focusChanged(false, true);
     }
 
+    @Override
     protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             setVisible0(nativeWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
@@ -143,10 +147,12 @@ public class WindowDriver extends WindowImpl {
         return true;
     }
 
+    @Override
     protected Point getLocationOnScreenImpl(int x, int y) {
         return new Point(x,y);
     }
 
+    @Override
     protected void updateInsetsImpl(Insets insets) {
         // nop ..
     }
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
index 4cb566bc2..cc435540f 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
@@ -59,6 +59,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
     public DisplayDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         synchronized(DisplayDriver.class) {
             if(0==initCounter) {
@@ -72,6 +73,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
         aDevice = new DefaultGraphicsDevice(NativeWindowFactory.TYPE_DEFAULT, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT, displayHandle);
     }
 
+    @Override
     protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         if(0==displayHandle) {
             throw new NativeWindowException("displayHandle null; initCnt "+initCounter);
@@ -87,6 +89,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
         aDevice.close();
     }
 
+    @Override
     protected void dispatchMessagesNative() {
         if(0!=displayHandle) {
             DispatchMessages(displayHandle, focusedWindow);
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
index b5202aaf9..44802e348 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
@@ -53,14 +53,17 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     public ScreenDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         AbstractGraphicsDevice adevice = getDisplay().getGraphicsDevice();
         GetScreenInfo(adevice.getHandle(), screen_idx);
         aScreen = new DefaultGraphicsScreen(adevice, screen_idx);
     }
 
+    @Override
     protected void closeNativeImpl() { }
 
+    @Override
     protected int validateScreenIndex(int idx) {
         return 0; // only one screen available
     }
@@ -102,6 +105,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         return false;
     }
 
+    @Override
     protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
         vOriginSize.set(0, 0, cachedWidth, cachedHeight);
     }
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
index 80821d4da..0e96c65d0 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
@@ -48,6 +48,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
 
     static long nextWindowHandle = 1;
 
+    @Override
     protected void createNativeImpl() {
         if(0!=getParentWindowHandle()) {
             throw new NativeWindowException("GDL Window does not support window parenting");
@@ -72,6 +73,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         }
     }
 
+    @Override
     protected void closeNativeImpl() {
         if(0!=surfaceHandle) {
             synchronized(WindowDriver.class) {
@@ -82,6 +84,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         }
     }
 
+    @Override
     protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
         ScreenDriver  screen = (ScreenDriver) getScreen();
 
@@ -112,6 +115,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         return true;
     }
 
+    @Override
     protected void requestFocusImpl(boolean reparented) {
         ((DisplayDriver)getScreen().getDisplay()).setFocus(this);
     }
@@ -121,10 +125,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         return surfaceHandle;
     }
 
+    @Override
     protected Point getLocationOnScreenImpl(int x, int y) {
         return new Point(x,y);
     }
 
+    @Override
     protected void updateInsetsImpl(Insets insets) {
         // nop ..
     }
diff --git a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
index 1b92ca586..929688b11 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
@@ -59,15 +59,18 @@ public class DisplayDriver extends DisplayImpl {
     public DisplayDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         // FIXME: map name to EGL_*_DISPLAY
         aDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
     }
 
+    @Override
     protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
 
+    @Override
     protected void dispatchMessagesNative() {
         DispatchMessages();
     }
diff --git a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
index 17cc5dd2f..9ebe2629a 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
@@ -51,12 +51,15 @@ public class ScreenDriver extends ScreenImpl {
     public ScreenDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
     }
 
+    @Override
     protected void closeNativeImpl() { }
 
+    @Override
     protected int validateScreenIndex(int idx) {
         return 0; // only one screen available
     }
@@ -98,6 +101,7 @@ public class ScreenDriver extends ScreenImpl {
         return false;
     }
 
+    @Override
     protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
         vOriginSize.set(0, 0, cachedWidth, cachedHeight);
     }
diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
index d30d4f025..158e6ab2f 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
@@ -56,6 +56,7 @@ public class WindowDriver extends WindowImpl {
     public WindowDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         if(0!=getParentWindowHandle()) {
             throw new RuntimeException("Window parenting not supported (yet)");
@@ -83,6 +84,7 @@ public class WindowDriver extends WindowImpl {
         windowHandleClose = eglWindowHandle;
     }
 
+    @Override
     protected void closeNativeImpl() {
         if(0!=windowHandleClose) {
             CloseWindow(windowHandleClose, windowUserData);
@@ -90,8 +92,10 @@ public class WindowDriver extends WindowImpl {
         }
     }
 
+    @Override
     protected void requestFocusImpl(boolean reparented) { }
 
+    @Override
     protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             setVisible0(eglWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
@@ -125,10 +129,12 @@ public class WindowDriver extends WindowImpl {
         return true;
     }
 
+    @Override
     protected Point getLocationOnScreenImpl(int x, int y) {
         return new Point(x,y);
     }
 
+    @Override
     protected void updateInsetsImpl(Insets insets) {
         // nop ..
     }
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
index 2dbdfdce7..c44685dc8 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
@@ -64,14 +64,17 @@ public class DisplayDriver extends DisplayImpl {
     public DisplayDriver() {
     }
 
+    @Override
     protected void dispatchMessagesNative() {
         // nop
     }
 
+    @Override
     protected void createNativeImpl() {
         aDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
     }
 
+    @Override
     protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
index 5d3b7287b..4f3cc691b 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
@@ -52,10 +52,12 @@ public class ScreenDriver extends ScreenImpl {
     public ScreenDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
     }
 
+    @Override
     protected void closeNativeImpl() { }
 
     private MonitorMode getMonitorModeImpl(MonitorModeProps.Cache cache, int crt_idx, int mode_idx) {
@@ -114,6 +116,7 @@ public class ScreenDriver extends ScreenImpl {
         return setMonitorMode0(monitor.getId(), mode.getId(), mode.getRotation());
     }
 
+    @Override
     protected int validateScreenIndex(int idx) {
         return 0; // big-desktop w/ multiple monitor attached, only one screen available
     }
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
index f36d32772..7db3e2aab 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
@@ -87,6 +87,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             isOffscreenInstance = false;
             if (0 != handle) {
                 OSXUtil.RunOnMainThread(false, new Runnable() {
+                   @Override
                    public void run() {
                        close0( handle );
                    } } );
@@ -144,6 +145,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
         if (isNativeValid()) {
             if (0 != sscSurfaceHandle) {
                 OSXUtil.RunOnMainThread(false, new Runnable() {
+                    @Override
                     public void run() {
                         orderOut0( 0 != getParentWindowHandle() ? getParentWindowHandle() : getWindowHandle() );
                     } } );
@@ -160,6 +162,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     @Override
     protected void setTitleImpl(final String title) {
         OSXUtil.RunOnMainThread(false, new Runnable() {
+            @Override
             public void run() {
                 setTitle0(getWindowHandle(), title);
             } } );
@@ -172,6 +175,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
         }
         if(!isOffscreenInstance) {
             OSXUtil.RunOnMainThread(false, new Runnable() {
+                @Override
                 public void run() {
                     requestFocus0(getWindowHandle(), force);
                 } } );
@@ -187,6 +191,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
         }
         if(!isOffscreenInstance) {
             OSXUtil.RunOnMainThread(false, new Runnable() {
+                @Override
                 public void run() {
                     resignFocus0(getWindowHandle());
                 } } );
@@ -209,6 +214,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                 System.err.println("MacWindow: updatePosition() parent["+useParent+" "+pX+"/"+pY+"] "+x+"/"+y+" ->  "+x+"/"+y+" rel-client-pos, "+p0S+" screen-client-pos");
             }
             OSXUtil.RunOnMainThread(false, new Runnable() {
+                @Override
                 public void run() {
                     setWindowClientTopLeftPoint0(handle, p0S.getX(), p0S.getY(), isVisible());
                 } } );
@@ -230,6 +236,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                     System.err.println("MacWindow: sizeChanged() parent["+useParent+" "+x+"/"+y+"] "+getX()+"/"+getY()+" "+newWidth+"x"+newHeight+" ->  "+p0S+" screen-client-pos");
                 }
                 OSXUtil.RunOnMainThread(false, new Runnable() {
+                    @Override
                     public void run() {
                         setWindowClientTopLeftPoint0(getWindowHandle(), p0S.getX(), p0S.getY(), isVisible());
                     } } );
@@ -275,6 +282,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && !setVisible ) {
             if ( !isOffscreenInstance ) {
                 OSXUtil.RunOnMainThread(false, new Runnable() {
+                    @Override
                     public void run() {
                         orderOut0(getWindowHandle());
                         visibleChanged(true, false);
@@ -297,6 +305,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             if( width>0 && height>0 ) {
                 if( !isOffscreenInstance ) {
                     OSXUtil.RunOnMainThread(false, new Runnable() {
+                        @Override
                         public void run() {
                             setWindowClientTopLeftPointAndSize0(getWindowHandle(), pClientLevelOnSreen.getX(), pClientLevelOnSreen.getY(), width, height, setVisible);
                         } } );
@@ -308,6 +317,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && setVisible ) {
                 if( !isOffscreenInstance ) {
                     OSXUtil.RunOnMainThread(false, new Runnable() {
+                        @Override
                         public void run() {
                             orderFront0(getWindowHandle());
                             visibleChanged(true, true);
@@ -476,6 +486,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                     throw new NativeWindowException("Internal Error - create w/ window, but no Newt NSView");
                 }
                 OSXUtil.RunOnMainThread(false, new Runnable() {
+                    @Override
                     public void run() {
                         changeContentView0(parentWinHandle, preWinHandle, 0);
                         close0( preWinHandle );
@@ -502,6 +513,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             final boolean isOpaque = getGraphicsConfiguration().getChosenCapabilities().isBackgroundOpaque() && !offscreenInstance;
             // Blocking initialization on main-thread!
             OSXUtil.RunOnMainThread(true, new Runnable() {
+                @Override
                 public void run() {
                     initWindow0( parentWinHandle, newWin, pS.getX(), pS.getY(), width, height,
                                  isOpaque, fullscreen, visible && !offscreenInstance, surfaceHandle);
diff --git a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
index d3c7416cc..d8ff7ecb5 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
@@ -71,16 +71,19 @@ public class DisplayDriver extends DisplayImpl {
     public DisplayDriver() {
     }
 
+    @Override
     protected void createNativeImpl() {
         sharedClass = sharedClassFactory.getSharedClass();
         aDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
     }
 
+    @Override
     protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
         sharedClassFactory.releaseSharedClass();
         aDevice.close();
     }
 
+    @Override
     protected void dispatchMessagesNative() {
         DispatchMessages0();
     }
diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
index 30405aa05..6e8ac3efa 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
@@ -127,6 +127,7 @@ public class WindowDriver extends WindowImpl {
         return false;
     }
 
+    @Override
     protected void createNativeImpl() {
         final ScreenDriver  screen = (ScreenDriver) getScreen();
         final DisplayDriver display = (DisplayDriver) screen.getDisplay();
@@ -156,6 +157,7 @@ public class WindowDriver extends WindowImpl {
         }
     }
 
+    @Override
     protected void closeNativeImpl() {
         if(windowHandleClose != 0) {
             if (hdc != 0) {
@@ -183,6 +185,7 @@ public class WindowDriver extends WindowImpl {
         hdc_old = 0;
     }
 
+    @Override
     protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("WindowsWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
@@ -210,6 +213,7 @@ public class WindowDriver extends WindowImpl {
         return true;
     }
 
+    @Override
     protected void requestFocusImpl(boolean force) {
         requestFocus0(getWindowHandle(), force);
     }
@@ -224,6 +228,7 @@ public class WindowDriver extends WindowImpl {
         final boolean[] res = new boolean[] { false };
 
         this.runOnEDTIfAvail(true, new Runnable() {
+            @Override
             public void run() {
                 res[0] = setPointerVisible0(getWindowHandle(), pointerVisible);
             }
@@ -236,6 +241,7 @@ public class WindowDriver extends WindowImpl {
         final Boolean[] res = new Boolean[] { Boolean.FALSE };
 
         this.runOnEDTIfAvail(true, new Runnable() {
+            @Override
             public void run() {
                 final Point p0 = getLocationOnScreenImpl(0, 0);
                 res[0] = Boolean.valueOf(confinePointer0(getWindowHandle(), confine,
@@ -248,6 +254,7 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected void warpPointerImpl(final int x, final int y) {
         this.runOnEDTIfAvail(true, new Runnable() {
+            @Override
             public void run() {
                 final Point sPos = getLocationOnScreenImpl(x, y);
                 warpPointer0(getWindowHandle(), sPos.getX(), sPos.getY());
@@ -256,10 +263,12 @@ public class WindowDriver extends WindowImpl {
         return;
     }
 
+    @Override
     protected Point getLocationOnScreenImpl(int x, int y) {
         return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
     }
 
+    @Override
     protected void updateInsetsImpl(Insets insets) {
         // nop - using event driven insetsChange(..)
     }
diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
index aa8067520..504839797 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
@@ -63,6 +63,7 @@ public class DisplayDriver extends DisplayImpl {
     public DisplayDriver() {
     }
 
+    @Override
     public String validateDisplayName(String name, long handle) {
         return X11Util.validateDisplayName(name, handle);
     }
@@ -72,6 +73,7 @@ public class DisplayDriver extends DisplayImpl {
      *
      * We use a private non-shared X11 Display instance for EDT window operations and one for exposed animation, eg. OpenGL.
      */
+    @Override
     protected void createNativeImpl() {
         X11Util.setX11ErrorHandler(true, DEBUG ? false : true); // make sure X11 error handler is set
         long handle = X11Util.openDisplay(name);
diff --git a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
index 7f75e03f0..bef7f60ec 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
@@ -74,6 +74,7 @@ public class ScreenDriver extends ScreenImpl {
     protected void createNativeImpl() {
         // validate screen index
         Long handle = runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Long>() {
+            @Override
             public Long run(long dpy) {
                 return new Long(GetScreen0(dpy, screen_idx));
             } } );
@@ -180,6 +181,7 @@ public class ScreenDriver extends ScreenImpl {
         if( null == rAndR ) { return null; }
 
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<MonitorMode>() {
+            @Override
             public MonitorMode run(long dpy) {
                 final int[] currentModeProps = rAndR.getCurrentMonitorModeProps(dpy, ScreenDriver.this, monitor.getId());
                 return MonitorModeProps.streamInMonitorMode(null, null, currentModeProps, 0);
@@ -192,6 +194,7 @@ public class ScreenDriver extends ScreenImpl {
 
         final long t0 = System.currentTimeMillis();
         boolean done = runWithOptTempDisplayHandle( new DisplayImpl.DisplayRunnable<Boolean>() {
+            @Override
             public Boolean run(long dpy) {
                 return Boolean.valueOf( rAndR.setCurrentMonitorMode(dpy, ScreenDriver.this, monitor, mode) );
             }
@@ -205,6 +208,7 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     private DisplayImpl.DisplayRunnable<Boolean> xineramaEnabledQueryWithTemp = new DisplayImpl.DisplayRunnable<Boolean>() {
+        @Override
         public Boolean run(long dpy) {
             return new Boolean(X11Util.XineramaIsEnabled(dpy));
         } };
@@ -236,6 +240,7 @@ public class ScreenDriver extends ScreenImpl {
                 } } );
         } else */ {
             runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
+                @Override
                 public Object run(long dpy) {
                     vOriginSize.set(0, 0, getWidth0(dpy, screen_idx), getHeight0(dpy, screen_idx));
                     return null;
diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
index 02f80c0c3..5e1f7a6ed 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
@@ -176,6 +176,7 @@ public class WindowDriver extends WindowImpl {
         final int fflags = flags;
         final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
+            @Override
             public Object run(long dpy) {
                 reconfigureWindow0( dpy, getScreenIndex(),
                                     getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
@@ -202,6 +203,7 @@ public class WindowDriver extends WindowImpl {
             }
             final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
             runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
+                @Override
                 public Object run(long dpy) {
                     reconfigureWindow0( dpy, getScreenIndex(),
                                         getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
@@ -223,6 +225,7 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected void requestFocusImpl(final boolean force) {
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
+            @Override
             public Object run(long dpy) {
                 requestFocus0(dpy, getWindowHandle(), force);
                 return null;
@@ -233,6 +236,7 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected void setTitleImpl(final String title) {
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
+            @Override
             public Object run(long dpy) {
                 setTitle0(dpy, getWindowHandle(), title);
                 return null;
@@ -243,6 +247,7 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Boolean>() {
+            @Override
             public Boolean run(long dpy) {
                 return Boolean.valueOf(setPointerVisible0(dpy, getWindowHandle(), pointerVisible));
             }
@@ -252,6 +257,7 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected boolean confinePointerImpl(final boolean confine) {
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Boolean>() {
+            @Override
             public Boolean run(long dpy) {
                 return Boolean.valueOf(confinePointer0(dpy, getWindowHandle(), confine));
             }
@@ -261,6 +267,7 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected void warpPointerImpl(final int x, final int y) {
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
+            @Override
             public Object run(long dpy) {
                 warpPointer0(dpy, getWindowHandle(), x, y);
                 return null;
@@ -271,6 +278,7 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected Point getLocationOnScreenImpl(final int x, final int y) {
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Point>() {
+            @Override
             public Point run(long dpy) {
                 return X11Lib.GetRelativeLocation(dpy, getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
             }
diff --git a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
index 08eacdee5..db89690f4 100644
--- a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
@@ -54,6 +54,7 @@ public class SWTEDTUtil implements EDTUtil {
         this.threadGroup = Thread.currentThread().getThreadGroup();
         this.name=Thread.currentThread().getName()+"-SWTDisplay-"+newtDisplay.getFQName()+"-EDT-";
         this.dispatchMessages = new Runnable() {
+            @Override
             public void run() {
                 ((jogamp.newt.DisplayImpl) newtDisplay).dispatchMessages();
             } };
@@ -252,6 +253,7 @@ public class SWTEDTUtil implements EDTUtil {
         }
         try {
             swtDisplay.syncExec(new Runnable() {
+                @Override
                 public void run() { }
             });
         } catch (Exception e) { }
-- 
cgit v1.2.3


From bde835213c584393d4be4ec7da62e7efd49430b7 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 31 Oct 2013 13:12:10 +0100
Subject: GLDrawableFactory: createDummy*(..) Pass GLCapabilitiesImmutable +
 GLCapabilitiesChooser instead of GLProfile, allowing using same or similar
 caps - important for sharing ctx

---
 make/scripts/tests.sh                              |  4 ++--
 .../javax/media/opengl/GLDrawableFactory.java      | 19 ++++++++++++------
 .../javax/media/opengl/GLSharedContextSetter.java  | 23 ++++++++++++++++++++--
 .../jogamp/opengl/GLDrawableFactoryImpl.java       |  9 ++++-----
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 10 +++++-----
 .../jogl/acore/TestSharedContextVBOES1NEWT.java    |  2 +-
 .../jogl/acore/TestSharedContextVBOES2NEWT1.java   |  2 +-
 7 files changed, 47 insertions(+), 22 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index a458d0a64..b03f0fa68 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -327,7 +327,7 @@ function testawtswt() {
 # 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 $*
 
 #
@@ -357,7 +357,7 @@ function testawtswt() {
 #testnoawt com.jogamp.opengl.test.junit.jogl.math.TestGluUnprojectFloatNOUI $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.math.TestGluUnprojectDoubleNOUI $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.math.TestFloatUtil01MatrixMatrixMultNOUI $*
-testnoawt com.jogamp.opengl.test.junit.jogl.math.TestBinary16NOUI $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestBinary16NOUI $*
 
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLVersionParsing00NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLWindowNEWT $*
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 3e53a1819..2af4ba306 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -561,7 +561,7 @@ public abstract class GLDrawableFactory {
   /**
    * Creates a {@link GLDrawable#isRealized() realized} <i>dummy</i> {@link GLAutoDrawable}
    * incl it's <i>dummy, invisible</i> {@link NativeSurface}
-   * as created with {@link #createDummyDrawable(AbstractGraphicsDevice, boolean, GLProfile)}.
+   * as created with {@link #createDummyDrawable(AbstractGraphicsDevice, boolean, GLCapabilitiesImmutable, GLCapabilitiesChooser)}.
    * <p>
    * The <i>dummy</i> {@link GLAutoDrawable}'s {@link GLDrawable} is {@link GLDrawable#isRealized() realized}
    * <i>without</i> an assigned {@link GLContext}, hence not initialized completely.<br>
@@ -574,12 +574,15 @@ public abstract class GLDrawableFactory {
    *
    * @param deviceReq which {@link AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
    * @param createNewDevice if <code>true</code> a new independent device instance is created from the <code>deviceReq</code>, otherwise <code>deviceReq</code> is used as-is and must be valid!
-   * @param glp the desired {@link GLProfile}
+   * @param capsRequested the desired {@link GLCapabilitiesImmutable}, incl. it's {@link GLProfile}.
+   *                      For shared context, same {@link GLCapabilitiesImmutable#getVisualID(javax.media.nativewindow.VisualIDHolder.VIDType)}
+   *                      across shared drawables will yield best compatibility.
+   * @param chooser the custom chooser, may be null for default
    * @return the created and realized <i>dummy</i> {@link GLAutoDrawable} instance
    *
-   * @see #createDummyDrawable(AbstractGraphicsDevice, boolean, GLProfile)
+   * @see #createDummyDrawable(AbstractGraphicsDevice, boolean, GLCapabilitiesImmutable, GLCapabilitiesChooser)
    */
-  public abstract GLAutoDrawable createDummyAutoDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp);
+  public abstract GLAutoDrawable createDummyAutoDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser);
 
   /**
    * Creates an {@link GLDrawable#isRealized() unrealized} offscreen {@link GLDrawable}
@@ -629,10 +632,14 @@ public abstract class GLDrawableFactory {
    * </p>
    * @param deviceReq which {@link AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
    * @param createNewDevice if <code>true</code> a new independent device instance is created from the <code>deviceReq</code>, otherwise <code>deviceReq</code> is used as-is and must be valid!
-   * @param glp the desired {@link GLProfile}
+   * @param capsRequested the desired {@link GLCapabilitiesImmutable}, incl. it's {@link GLProfile}.
+   *                      For shared context, same {@link GLCapabilitiesImmutable#getVisualID(javax.media.nativewindow.VisualIDHolder.VIDType) visual ID}
+   *                      or {@link GLCapabilitiesImmutable caps}
+   *                      across shared drawables will yield best compatibility.
+   * @param chooser the custom chooser, may be null for default
    * @return the created unrealized dummy {@link GLDrawable}
    */
-  public abstract GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp);
+  public abstract GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser);
 
   /**
    * Creates a proxy {@link NativeSurface} w/ defined surface handle,
diff --git a/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java b/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
index 873e4cd9f..78dd693cb 100644
--- a/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
+++ b/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
@@ -39,6 +39,10 @@ package javax.media.opengl;
  * shared {@link GLContext} w/ this master are referred as slave {@link GLContext}
  * and controls the shared object's lifecycle, i.e. their construction and destruction.
  * </p>
+ * <p>
+ * Using the nearest or same {@link GLCapabilitiesImmutable#getVisualID(javax.media.nativewindow.VisualIDHolder.VIDType) visual ID}
+ * or {@link GLCapabilitiesImmutable caps} across the shared {@link GLDrawable}s will yield best compatibility.
+ * </p>
  * <h5><a name="lifecycle">Lifecycle Considerations</a></h5>
  * <p>
  * After shared objects are created on the <i>master</i>, the OpenGL pipeline
@@ -56,7 +60,7 @@ package javax.media.opengl;
  * <i>or</i> the <i>slaves</i> validate whether the resources are still valid.
  * </p>
  * <p>
- * To simplify above lifecycle issues, one may use a {@link GLDrawableFactory#createDummyDrawable(javax.media.nativewindow.AbstractGraphicsDevice, boolean, GLProfile) dummy}
+ * To simplify above lifecycle issues, one may use a {@link GLDrawableFactory#createDummyDrawable(javax.media.nativewindow.AbstractGraphicsDevice, boolean, GLCapabilitiesImmutable, GLCapabilitiesChooser) dummy}
  * {@link GLDrawable} and it's {@link GLContext} as the <i>master</i> of all shared <i>slave</i> {@link GLContext}.
  * Since this <i>dummy instance</i> does not depend on any native windowing system, it can be controlled easily w/o being <i>in sight</i>.<br>
  * Below code creates a {@link GLAutoDrawable} based on a <i>dummy GLDrawable</i>:
@@ -66,7 +70,7 @@ package javax.media.opengl;
         final GLProfile glp = caps.getGLProfile();
         ..
         final boolean createNewDevice = true; // use 'own' display device!
-        final GLAutoDrawable sharedDrawable = GLDrawableFactory.getFactory(glp).createDummyAutoDrawable(null, createNewDevice, glp);
+        final GLAutoDrawable sharedDrawable = GLDrawableFactory.getFactory(glp).createDummyAutoDrawable(null, createNewDevice, caps, null);
         sharedDrawable.display(); // triggers GLContext object creation and native realization.
         ...
         // Later a shared 'slave' can be created e.g.:
@@ -76,6 +80,21 @@ package javax.media.opengl;
         glad.setVisible(true); // GLWindow creation ..
  * </pre>
  * </p>
+ * <h5><a name="driverissues">Known Driver Issues</a></h5>
+ * <h7><a name="intelmesa">Intel's Mesa >= 9.1.2 Backend for [Sandybridge/Ivybridge] on GNU/Linux</a></h7>
+ * <p>
+ * <pre>
+ * Error: 'intel_do_flush_locked: No such file or directory'
+ * JogAmp: <https://jogamp.org/bugzilla/show_bug.cgi?id=873>
+ * freedesktop.org: <https://bugs.freedesktop.org/show_bug.cgi?id=41736#c8>
+ * </pre>
+ * Shared context seems not to be supported w/ lock-free bound X11 display connections
+ * per OpenGL drawable/context. The error message above is thrown in this case.
+ * Hence the driver bug renders shared context use w/ JOGL impossible.
+ * </p>
+ * <h7><a name="hisilicon">Hisilicon's Immersion.16</a></h7>
+ * <p>
+ * </p>
  */
 public interface GLSharedContextSetter extends GLAutoDrawable {
     /**
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
index a9f12b17e..cadf40f02 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
@@ -328,8 +328,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   @Override
-  public final GLAutoDrawable createDummyAutoDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp) {
-      final GLDrawable drawable = createDummyDrawable(deviceReq, createNewDevice, glp);
+  public final GLAutoDrawable createDummyAutoDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+      final GLDrawable drawable = createDummyDrawable(deviceReq, createNewDevice, capsRequested, chooser);
       drawable.setRealized(true);
       final GLAutoDrawable sharedDrawable = new GLAutoDrawableDelegate(drawable, null, null, true /*ownDevice*/, null) { };
       return sharedDrawable;
@@ -366,15 +366,14 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   @Override
-  public final GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp) {
+  public final GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
     final AbstractGraphicsDevice device = createNewDevice ? getOrCreateSharedDevice(deviceReq) : deviceReq;
     if(null == device) {
         throw new GLException("No shared device for requested: "+deviceReq+", createNewDevice "+createNewDevice);
     }
     device.lock();
     try {
-        final GLCapabilities caps = new GLCapabilities(glp);
-        final ProxySurface dummySurface = createDummySurfaceImpl(device, createNewDevice, caps, caps, null, 64, 64);
+        final ProxySurface dummySurface = createDummySurfaceImpl(device, createNewDevice, capsRequested, capsRequested, chooser, 64, 64);
         return createOnscreenDrawableImpl(dummySurface);
     } finally {
         device.unlock();
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 7e41c3fce..1d73d1a44 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -74,7 +74,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected static final String unknown = "unknown";
 
     protected volatile State state;
-    private Object stateLock = new Object();
+    private final Object stateLock = new Object();
 
     protected int textureCount;
     protected int textureTarget;
@@ -170,7 +170,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      */
     protected boolean isInGLOrientation = false;
 
-    private ArrayList<GLMediaEventListener> eventListeners = new ArrayList<GLMediaEventListener>();
+    private final ArrayList<GLMediaEventListener> eventListeners = new ArrayList<GLMediaEventListener>();
 
     protected GLMediaPlayerImpl() {
         this.textureCount=0;
@@ -983,7 +983,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             final GLProfile glp = gl.getGLProfile();
             final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
             final AbstractGraphicsDevice device = glCtx.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
-            dummyDrawable = factory.createDummyDrawable(device, true, glp); // own device!
+            dummyDrawable = factory.createDummyDrawable(device, true, glCtx.getGLDrawable().getChosenGLCapabilities(), null); // own device!
             dummyDrawable.setRealized(true);
             sharedGLCtx = dummyDrawable.createContext(glCtx);
             makeCurrent(sharedGLCtx);
@@ -1248,7 +1248,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         if( this.fps != fps ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_FPS;
             this.fps = fps;
-            this.frame_duration = 1000f / (float)fps;
+            this.frame_duration = 1000f / fps;
         }
         if( this.bps_stream != bps_stream || this.bps_video != bps_video || this.bps_audio != bps_audio ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_BPS;
@@ -1431,7 +1431,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
 
-    private Object eventListenersLock = new Object();
+    private final Object eventListenersLock = new Object();
 
     protected static final String toHexString(long v) {
         return "0x"+Long.toHexString(v);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java
index 59bb13c87..0f4f8fc34 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java
@@ -92,7 +92,7 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
     }
 
     private void initShared() throws InterruptedException {
-        GLDrawable dummyDrawable = GLDrawableFactory.getFactory(glp).createDummyDrawable(null, true /* createNewDevice */, caps.getGLProfile());
+        GLDrawable dummyDrawable = GLDrawableFactory.getFactory(glp).createDummyDrawable(null, true /* createNewDevice */, caps, null);
         dummyDrawable.setRealized(true);
         sharedDrawable = new GLAutoDrawableDelegate(dummyDrawable, null, null, true /*ownDevice*/, null) { };
         Assert.assertNotNull(sharedDrawable);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java
index 928b03703..7051bac13 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java
@@ -105,7 +105,7 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
             glWindow.setVisible(true);
             sharedDrawable = glWindow;
         } else {
-            sharedDrawable = GLDrawableFactory.getFactory(glp).createDummyAutoDrawable(null, true /* createNewDevice */, caps.getGLProfile());
+            sharedDrawable = GLDrawableFactory.getFactory(glp).createDummyAutoDrawable(null, true /* createNewDevice */, caps, null);
         }
         Assert.assertNotNull(sharedDrawable);
         Assert.assertTrue(AWTRobotUtil.waitForRealized(sharedDrawable, true));
-- 
cgit v1.2.3


From f4574bf6846f2084f6a403552f7be6e845107c73 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Fri, 1 Nov 2013 12:38:54 +0100
Subject: Bug 885 - GLMediaPlayer: Allow single threaded mode - Especially
 where multiple media textures (Android) or shared GL context are not usable.

- GLMediaPlayer:
  - TEXTURE_COUNT_MIN is the new minimum: '1' - i.e. no multithreading, single threaded player
  - TEXTURE_COUNT_DEFAULT is '4' - multithreaded

- GLMediaPlayerImpl:
  - Add Single threaded mode, but perform initStreamImpl(..) off-thread.
  -
---
 make/scripts/adb-launch-activity.sh                |   3 +-
 make/scripts/tests.sh                              |   6 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |   9 +-
 .../android/av/AndroidGLMediaPlayerAPI14.java      |  32 +++--
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 152 +++++++++++++++------
 .../jogamp/opengl/util/av/NullGLMediaPlayer.java   |   4 +-
 .../test/junit/jogl/demos/es2/av/MovieCube.java    | 100 +++++++-------
 7 files changed, 194 insertions(+), 112 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/adb-launch-activity.sh b/make/scripts/adb-launch-activity.sh
index 84399520e..401bd51a6 100644
--- a/make/scripts/adb-launch-activity.sh
+++ b/make/scripts/adb-launch-activity.sh
@@ -2,7 +2,8 @@
 
 #ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.NEWTGenericActivity"
 #ANAME="com.jogamp.android.launcher/com.jogamp.android.launcher.NEWTLauncherActivity2"
-ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.NEWTGearsES2ActivityLauncher"
+#ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.NEWTGearsES2ActivityLauncher"
+ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.MovieCubeActivityLauncher0"
 
 adb $* shell "setprop log.redirect-stdio true ; setprop log.redirect-stderr true ; \
               am start -a android.intent.action.MAIN -n $ANAME"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index aa1450dc9..a93c2ed79 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -136,7 +136,7 @@ function jrun() {
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
-    #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
+    D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
     #D_ARGS="-Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
@@ -328,7 +328,7 @@ function testawtswt() {
 # 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 $*
 
 #
@@ -375,7 +375,7 @@ function testawtswt() {
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestBug669RecursiveGLContext01NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestBug669RecursiveGLContext02NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestBug692GL3VAONEWT $*
-testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestCPUSourcingAPINEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestCPUSourcingAPINEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLExtensionQueryOffscreen $*
 
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListNEWT $*
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 3f6b78d7e..f0864f949 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -186,8 +186,11 @@ public interface GLMediaPlayer extends TextureSequence {
     public static final boolean DEBUG = Debug.debug("GLMediaPlayer");
     public static final boolean DEBUG_NATIVE = Debug.debug("GLMediaPlayer.Native");
 
-    /** Minimum texture count, value {@value}. */
-    public static final int TEXTURE_COUNT_MIN = 4;
+    /** Default texture count, value {@value}. */
+    public static final int TEXTURE_COUNT_DEFAULT = 4;
+
+    /** Minimum texture count, value {@value}. Using the minimum texture count disables multi-threaded decoding. */
+    public static final int TEXTURE_COUNT_MIN = 1;
 
     /** Constant {@value} for <i>mute</i> or <i>not available</i>. See <a href="#streamIDs">Audio and video Stream IDs</a>. */
     public static final int STREAM_ID_NONE = -2;
@@ -350,7 +353,7 @@ public interface GLMediaPlayer extends TextureSequence {
      * @param vid video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>
      * @param aid video stream id, see <a href="#streamIDs">audio and video Stream IDs</a>
      * @param textureCount desired number of buffered textures to be decoded off-thread, will be validated by implementation.
-     *        The minimum value is {@link #TEXTURE_COUNT_MIN}.
+     *        The minimum value is {@link #TEXTURE_COUNT_DEFAULT}.
      *        Ignored if video is muted.
      * @throws IllegalStateException if not invoked in {@link State#Uninitialized}
      * @throws IllegalArgumentException if arguments are invalid
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 415ee65a2..25a0bc15d 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -56,6 +56,11 @@ import android.view.Surface;
  * Android implementation utilizes API level 14 (4.0.? ICS) features
  * as listed below.
  * <p>
+ * Implementation is single threaded only, since we are not able to utilize multiple textures.
+ * We would need to add an implementation for API level 16 using MediaCodec/MediaExtractor
+ * to expose multithreading on multiple surface/textures.
+ * </p>
+ * <p>
  * We utilize the {@link MediaPlayer} with direct to texture streaming.
  * The MediaPlayer uses <code>libstagefright</code> to access the OpenMAX AL implementation
  * for hardware decoding.
@@ -248,8 +253,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final void initStreamImpl(int vid, int aid) throws IOException {
-
+    protected final void initStreamImpl(final int vid, final int aid) throws IOException {
         if( null == streamLoc ) {
             return;
         }
@@ -297,6 +301,21 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                              mp.getVideoWidth(), mp.getVideoHeight(), 0,
                              0, 0, 0f,
                              0, 0, mp.getDuration(), icodec, icodec);
+            /**
+                mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
+                    @Override
+                    public void onPrepared(final MediaPlayer mp) {
+                        final int r_aid = GLMediaPlayer.STREAM_ID_NONE == aid ? GLMediaPlayer.STREAM_ID_NONE : 1; // fake
+                        final String icodec = "android";
+                        updateAttributes(0, r_aid, // fake
+                                         mp.getVideoWidth(), mp.getVideoHeight(), 0,
+                                         0, 0, 0f,
+                                         0, 0, mp.getDuration(), icodec, icodec);
+                    }
+                });
+                mp.prepareAsync();
+             *
+             */
         } else if( null != cam ) {
             final String icodec = "android";
             final int[] fpsRange = { 0, 0 };
@@ -336,23 +355,20 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     /**
      * {@inheritDoc}
      * <p>
-     * Returns 2 - implementation duplicates single texture
+     * Returns {@link #TEXTURE_COUNT_MIN}, using a single texture
      * </p>
      */
     @Override
     protected int validateTextureCount(int desiredTextureCount) {
-        return 2;
+        return TEXTURE_COUNT_MIN;
     }
 
     @Override
     protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
         int pts = TimeFrameI.INVALID_PTS;
         if(null != mp || null != cam) {
-            final SurfaceTextureFrame sTexFrame = (SurfaceTextureFrame) nextFrame;
+            final SurfaceTextureFrame sTexFrame = null != nextFrame ? (SurfaceTextureFrame) nextFrame : singleSTexFrame;
             final SurfaceTexture surfTex = sTexFrame.surfaceTex;
-            if( sTexFrame != singleSTexFrame ) {
-                throw new InternalError("XXX: sTexFrame: "+sTexFrame+", singleSTexFrame "+singleSTexFrame);
-            }
             if( !sTexFrameAttached ) {
                 sTexFrameAttached = true;
                 final Surface surface;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 1d73d1a44..91647394d 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -304,7 +304,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         if( null != audioSink ) {
                             audioSink.play(); // cont. w/ new data
                         }
-                        streamWorker.doResume();
+                        if( null != streamWorker ) {
+                            streamWorker.doResume();
+                        }
                         changeState(0, State.Playing);
                     }
                 default:
@@ -325,7 +327,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             if( State.Playing == state ) {
                 event_mask = addStateEventMask(event_mask, GLMediaPlayer.State.Paused);
                 state = State.Paused;
-                streamWorker.doPause();
+                if( null != streamWorker ) {
+                    streamWorker.doPause();
+                }
                 if( flush ) {
                     resetAVPTSAndFlush();
                 } else if( null != audioSink ) {
@@ -348,8 +352,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     private final State destroyImpl(GL gl, int event_mask) {
         synchronized( stateLock ) {
-            streamWorker.doStop();
-            streamWorker = null;
+            if( null != streamWorker ) {
+                streamWorker.doStop();
+                streamWorker = null;
+            }
             destroyImpl(gl);
             removeAllTextureFrames(gl);
             textureCount=0;
@@ -369,14 +375,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 case Paused:
                     final State _state = state;
                     state = State.Paused;
-                    streamWorker.doPause();
+                    if( null != streamWorker ) {
+                        streamWorker.doPause();
+                    }
                     pts1 = seekImpl(msec);
                     resetAVPTSAndFlush();
                     if( null != audioSink && State.Playing == _state ) {
                         audioSink.play(); // cont. w/ new data
                     }
                     System.err.println("SEEK XXX: "+getPerfString());
-                    streamWorker.doResume();
+                    if( null != streamWorker ) {
+                        streamWorker.doResume();
+                    }
                     state = _state;
                     break;
                 default:
@@ -476,7 +486,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
-    public final void initStream(URI streamLoc, int vid, int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
+    public final void initStream(URI streamLoc, final int vid, final int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
         synchronized( stateLock ) {
             if(State.Uninitialized != state) {
                 throw new IllegalStateException("Instance not in state unintialized: "+this);
@@ -486,8 +496,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
             if( STREAM_ID_NONE != vid ) {
                 textureCount = validateTextureCount(reqTextureCount);
-                if( textureCount < 2 ) {
-                    throw new InternalError("Validated texture count < 2: "+textureCount);
+                if( textureCount < TEXTURE_COUNT_MIN ) {
+                    throw new InternalError("Validated texture count < "+TEXTURE_COUNT_MIN+": "+textureCount);
                 }
             } else {
                 textureCount = 0;
@@ -515,8 +525,21 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
             this.vid = vid;
             this.aid = aid;
-            if (this.streamLoc != null) {
-                streamWorker = new StreamWorker();
+            if ( this.streamLoc != null ) {
+                if( TEXTURE_COUNT_MIN < textureCount ) {
+                    streamWorker = new StreamWorker();
+                } else {
+                    new Thread() {
+                        public void run() {
+                            try {
+                                initStreamImpl(vid, aid);
+                            } catch (Throwable t) {
+                                streamErr = new StreamException(t.getClass().getSimpleName()+" while initializing: "+GLMediaPlayerImpl.this.toString(), t);
+                                changeState(GLMediaEventListener.EVENT_CHANGE_ERR, GLMediaPlayer.State.Uninitialized);
+                            } // also initializes width, height, .. etc
+                        }
+                    }.start();
+                }
             }
         }
     }
@@ -537,13 +560,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
     @Override
     public final StreamException getStreamException() {
+        final StreamException e;
         synchronized( stateLock ) {
-            if( null != streamWorker ) {
-                return streamWorker.getStreamErr();
-            } else {
-                return null;
-            }
+            e = streamErr;
+            streamErr = null;
         }
+        return e;
     }
 
     @Override
@@ -552,11 +574,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             if(State.Initialized != state ) {
                 throw new IllegalStateException("Stream not in state initialized: "+this);
             }
-            final StreamException streamInitErr = streamWorker.getStreamErr();
-            if( null != streamInitErr ) {
-                streamWorker = null; // already terminated!
-                destroy(null);
-                throw streamInitErr;
+            if( null != streamWorker ) {
+                final StreamException streamInitErr = getStreamException();
+                if( null != streamInitErr ) {
+                    streamWorker = null; // already terminated!
+                    destroy(null);
+                    throw streamInitErr;
+                }
             }
             try {
                 if( STREAM_ID_NONE != vid ) {
@@ -566,10 +590,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         System.err.println("initGLImpl.X "+this);
                     }
                     videoFramesOrig = createTexFrames(gl, textureCount);
-                    videoFramesFree = new LFRingbuffer<TextureFrame>(videoFramesOrig);
-                    videoFramesDecoded = new LFRingbuffer<TextureFrame>(TextureFrame[].class, textureCount);
-                    lastFrame = videoFramesFree.getBlocking( );
-                    streamWorker.initGL(gl);
+                    if( TEXTURE_COUNT_MIN == textureCount ) {
+                        videoFramesFree = null;
+                        videoFramesDecoded = null;
+                        lastFrame = videoFramesOrig[0];
+                    } else {
+                        videoFramesFree = new LFRingbuffer<TextureFrame>(videoFramesOrig);
+                        videoFramesDecoded = new LFRingbuffer<TextureFrame>(TextureFrame[].class, textureCount);
+                        lastFrame = videoFramesFree.getBlocking( );
+                    }
+                    if( null != streamWorker ) {
+                        streamWorker.initGL(gl);
+                    }
                 } else {
                     removeAllTextureFrames(null);
                     initGLImpl(null);
@@ -601,10 +633,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     /**
      * Returns the validated number of textures to be handled.
      * <p>
-     * Default is {@link #TEXTURE_COUNT_MIN} minimum textures.
+     * Default is {@link #TEXTURE_COUNT_DEFAULT} minimum textures, if <code>desiredTextureCount</code>
+     * is < {@link #TEXTURE_COUNT_MIN}, {@link #TEXTURE_COUNT_MIN} is returned.
      * </p>
      * <p>
-     * Implementation must at least return a texture count of <i>two</i>, the last texture and the decoding texture.
+     * Implementation must at least return a texture count of {@link #TEXTURE_COUNT_MIN}, <i>two</i>, the last texture and the decoding texture.
      * </p>
      */
     protected int validateTextureCount(int desiredTextureCount) {
@@ -737,7 +770,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             cachedFrame = null;
                             presentedFrameCount--;
                         } else if( STREAM_ID_NONE != vid ) {
-                            nextFrame = videoFramesDecoded.get();
+                            if( null != videoFramesDecoded ) { // single threaded ? TEXTURE_COUNT_MIN == textureCount
+                                nextFrame = videoFramesDecoded.get();
+                            } else {
+                                nextFrame = getNextSingleThreaded(gl, lastFrame);
+                            }
                         }
                         currentTimeMillis = Platform.currentTimeMillis();
                         if( null != nextFrame ) {
@@ -785,7 +822,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                     if( dt > maxVideoDelay ) {
                                         cachedFrame = nextFrame;
                                         nextFrame = null;
-                                    } else if ( !droppedFrame && dt < -maxVideoDelay && videoFramesDecoded.size() > 0 ) {
+                                    } else if ( !droppedFrame && dt < -maxVideoDelay && null != videoFramesDecoded && videoFramesDecoded.size() > 0 ) {
                                         // only drop if prev. frame has not been dropped and
                                         // frame is too late and one decoded frame is already available.
                                         dropFrame = true;
@@ -802,7 +839,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             } else if( DEBUG ) {
                                 System.err.println("Invalid PTS: "+nextFrame);
                             }
-                            if( null != nextFrame ) {
+                            if( null != nextFrame && null != videoFramesFree ) {
+                                // Had frame and not single threaded ? (TEXTURE_COUNT_MIN < textureCount)
                                 final TextureFrame _lastFrame = lastFrame;
                                 lastFrame = nextFrame;
                                 videoFramesFree.putBlocking(_lastFrame);
@@ -857,6 +895,27 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      */
     protected abstract int getNextTextureImpl(GL gl, TextureFrame nextFrame);
 
+    protected final TextureFrame getNextSingleThreaded(final GL gl, final TextureFrame nextFrame) throws InterruptedException {
+        if( STREAM_ID_NONE != vid ) {
+            preNextTextureImpl(gl);
+            final int vPTS = getNextTextureImpl(gl, nextFrame);
+            postNextTextureImpl(gl);
+            if( TimeFrameI.INVALID_PTS != vPTS ) {
+                newFrameAvailable(nextFrame, Platform.currentTimeMillis());
+                return nextFrame;
+            }
+        } else {
+            // audio only
+            final int vPTS = getNextTextureImpl(null, null);
+            if( TimeFrameI.INVALID_PTS != vPTS && TimeFrameI.END_OF_STREAM_PTS == vPTS ) {
+                // state transition incl. notification
+                pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
+            }
+        }
+        return null;
+    }
+
+
     /**
      * {@inheritDoc}
      * <p>
@@ -887,8 +946,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             videoFramesFree.resetFull(videoFramesOrig);
             lastFrame = videoFramesFree.get();
             if( null == lastFrame ) { throw new InternalError("XXX"); }
-        }
-        if( null != videoFramesDecoded ) {
             videoFramesDecoded.clear();
         }
         cachedFrame = null;
@@ -933,7 +990,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         private volatile boolean shallPause = true;
         private volatile boolean shallStop = false;
 
-        private volatile StreamException streamErr = null;
         private volatile GLContext sharedGLCtx = null;
         private boolean sharedGLCtxCurrent = false;
         private GLDrawable dummyDrawable = null;
@@ -977,7 +1033,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
         }
 
-        public synchronized void initGL(GL gl) {
+        public final synchronized void initGL(GL gl) {
             final GLContext glCtx = gl.getContext();
             final boolean glCtxCurrent = glCtx.isCurrent();
             final GLProfile glp = gl.getGLProfile();
@@ -993,7 +1049,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 sharedGLCtx.release();
             }
         }
-        public synchronized void doPause() {
+        public final synchronized void doPause() {
             if( isActive ) {
                 shallPause = true;
                 if( Thread.currentThread() != this ) {
@@ -1010,7 +1066,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 }
             }
         }
-        public synchronized void doResume() {
+        public final synchronized void doResume() {
             if( isRunning && !isActive ) {
                 shallPause = false;
                 if( Thread.currentThread() != this ) {
@@ -1025,7 +1081,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 }
             }
         }
-        public synchronized void doStop() {
+        public final synchronized void doStop() {
             if( isRunning ) {
                 shallStop = true;
                 if( Thread.currentThread() != this ) {
@@ -1043,12 +1099,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 }
             }
         }
-        public boolean isRunning() { return isRunning; }
-        public boolean isActive() { return isActive; }
-        public StreamException getStreamErr() { return streamErr; }
+        public final boolean isRunning() { return isRunning; }
+        public final boolean isActive() { return isActive; }
 
         @Override
-        public void run() {
+        public final void run() {
             setName(getName()+"-StreamWorker_"+StreamWorkerInstanceId);
             StreamWorkerInstanceId++;
 
@@ -1109,9 +1164,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 if( !shallStop ) {
                     TextureFrame nextFrame = null;
                     try {
-                        final GL gl;
                         isBlocked = true;
-                        if( null != videoFramesFree ) {
+                        final GL gl;
+                        if( STREAM_ID_NONE != vid ) {
                             nextFrame = videoFramesFree.getBlocking();
                             nextFrame.setPTS( TimeFrameI.INVALID_PTS ); // mark invalid until processed!
                             gl = sharedGLCtx.getGL();
@@ -1178,6 +1233,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     static int StreamWorkerInstanceId = 0;
     private StreamWorker streamWorker = null;
+    private volatile StreamException streamErr = null;
 
     protected final int addStateEventMask(int event_mask, State newState) {
         if( state != newState ) {
@@ -1396,8 +1452,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         } else {
             audioSinkInfo = "";
         }
-        final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
-        final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
+        final int freeVideoFrames, decVideoFrames;
+        if( null != videoFramesFree ) {
+            freeVideoFrames = videoFramesFree.size();
+            decVideoFrames = videoFramesDecoded.size();
+        } else {
+            freeVideoFrames = 0;
+            decVideoFrames = 0;
+        }
         return state+", frames[(p "+presentedFrameCount+", d "+decodedFrameCount+") / "+videoFrames+", "+tt+" s], "+
                "speed " + playSpeed+", dAV "+( d_vpts - d_apts )+", vSCR "+video_scr+", vpts "+video_pts+", dSCR["+d_vpts+", avrg "+video_dpts_avg_diff+"], "+
                "aSCR "+audio_scr+", apts "+audio_pts+" ( "+d_apts+" ), "+audioSinkInfo+
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index 840149272..fc621a1dd 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -150,12 +150,12 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     /**
      * {@inheritDoc}
      * <p>
-     * Returns 2
+     * Returns {@link GLMediaPlayer#TEXTURE_COUNT_MIN}.
      * </p>
      */
     @Override
     protected int validateTextureCount(int desiredTextureCount) {
-        return 2;
+        return TEXTURE_COUNT_MIN;
     }
 
     @Override
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index fe11f6aca..a7636fce4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -58,7 +58,7 @@ import com.jogamp.opengl.util.av.GLMediaPlayerFactory;
 import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 /**
- * Simple cube movie player w/ aspect ration true projection on a cube. 
+ * Simple cube movie player w/ aspect ration true projection on a cube.
  */
 public class MovieCube implements GLEventListener {
     private static boolean waitForKey = false;
@@ -68,7 +68,7 @@ public class MovieCube implements GLEventListener {
     private int swapInterval = 1;
     private long lastPerfPos = 0;
     private volatile boolean resetGLState = false;
-    
+
     /** Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream. */
     public static final URI defURI;
     static {
@@ -80,18 +80,18 @@ public class MovieCube implements GLEventListener {
         }
         defURI = _defURI;
     }
-        
-    /** 
-     * Default constructor which also issues {@link #initStream(URI, int, int, int)} w/ default values 
+
+    /**
+     * Default constructor which also issues {@link #initStream(URI, int, int, int)} w/ default values
      * and polls until the {@link GLMediaPlayer} is {@link GLMediaPlayer.State#Initialized}.
      * If {@link GLMediaEventListener#EVENT_CHANGE_EOS} is reached, the stream is started over again.
      * <p>
      * This default constructor is merely useful for some <i>drop-in</i> test, e.g. using an applet.
-     * </p> 
+     * </p>
      */
     public MovieCube() throws IOException, URISyntaxException {
         this(-2.3f, 0f, 0f);
-        
+
         mPlayer.addEventListener(new GLMediaEventListener() {
             @Override
             public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
@@ -108,9 +108,9 @@ public class MovieCube implements GLEventListener {
                     mPlayer.seek(0);
                     mPlayer.play();
                 }
-            }            
+            }
         });
-        initStream(defURI, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 3 /* textureCount */);
+        initStream(defURI, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.TEXTURE_COUNT_DEFAULT);
         StreamException se = null;
         while( null == se && GLMediaPlayer.State.Initialized != mPlayer.getState() ) {
             try {
@@ -123,7 +123,7 @@ public class MovieCube implements GLEventListener {
             throw new RuntimeException(se);
         }
     }
-    
+
     /** Custom constructor, user needs to issue {@link #initStream(URI, int, int, int)} afterwards. */
     public MovieCube(float zoom0, float rotx, float roty) throws IOException {
         this.zoom0 = zoom0;
@@ -136,20 +136,20 @@ public class MovieCube implements GLEventListener {
         mPlayer.initStream(streamLoc, vid, aid, textureCount);
         System.out.println("pC.1b "+mPlayer);
     }
-    
+
     public void setSwapInterval(int v) { this.swapInterval = v; }
-    
+
     public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
-    
+
     public void resetGLState() {
         resetGLState = true;
     }
-    
+
     private final KeyListener keyAction = new KeyAdapter() {
         public void keyReleased(KeyEvent e)  {
             if( e.isAutoRepeat() ) {
                 return;
-            }            
+            }
             System.err.println("MC "+e);
             int pts0 = mPlayer.getVideoPTS();
             int pts1 = 0;
@@ -175,7 +175,7 @@ public class MovieCube implements GLEventListener {
                     break;
                 }
                 case KeyEvent.VK_MULTIPLY:
-                      mPlayer.setPlaySpeed(1.0f); 
+                      mPlayer.setPlaySpeed(1.0f);
                       break;
                 case KeyEvent.VK_SUBTRACT: {
                       float playSpeed = mPlayer.getPlaySpeed();
@@ -184,7 +184,7 @@ public class MovieCube implements GLEventListener {
                       } else {
                           playSpeed -= 0.1f;
                       }
-                      mPlayer.setPlaySpeed(playSpeed); 
+                      mPlayer.setPlaySpeed(playSpeed);
                     } break;
                 case KeyEvent.VK_ADD: {
                       float playSpeed = mPlayer.getPlaySpeed();
@@ -193,7 +193,7 @@ public class MovieCube implements GLEventListener {
                       } else {
                           playSpeed += 0.1f;
                       }
-                      mPlayer.setPlaySpeed(playSpeed); 
+                      mPlayer.setPlaySpeed(playSpeed);
                     } break;
                 case KeyEvent.VK_M: {
                       float audioVolume = mPlayer.getAudioVolume();
@@ -202,16 +202,16 @@ public class MovieCube implements GLEventListener {
                       } else {
                           audioVolume = 1f;
                       }
-                      mPlayer.setAudioVolume(audioVolume); 
+                      mPlayer.setAudioVolume(audioVolume);
                     } break;
             }
-            
+
             if( 0 != pts1 ) {
                 mPlayer.seek(pts1);
             }
-        }        
+        }
     };
-    
+
     @Override
     public void init(GLAutoDrawable drawable) {
         if(null == mPlayer) {
@@ -224,16 +224,16 @@ public class MovieCube implements GLEventListener {
             // throw new IllegalStateException("mPlayer has no VID/stream selected: "+mPlayer);
         }
         resetGLState = false;
-        
+
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
 
-        cube = new TextureSequenceCubeES2(mPlayer, false, zoom0, rotx, roty);        
-        
+        cube = new TextureSequenceCubeES2(mPlayer, false, zoom0, rotx, roty);
+
         if(waitForKey) {
             UITestCase.waitForKey("Init>");
         }
-    
+
         if( GLMediaPlayer.State.Initialized == mPlayer.getState() ) {
             try {
                 mPlayer.initGL(gl);
@@ -252,11 +252,11 @@ public class MovieCube implements GLEventListener {
 
         boolean added;
         final Object upstreamWidget = drawable.getUpstreamWidget();
-        if (upstreamWidget instanceof Window) {            
+        if (upstreamWidget instanceof Window) {
             final Window window = (Window) upstreamWidget;
             window.addKeyListener(keyAction);
             added = true;
-        } else { added = false; }       
+        } else { added = false; }
         System.err.println("MC.init: kl-added "+added+", "+drawable.getClass().getName());
     }
 
@@ -275,11 +275,11 @@ public class MovieCube implements GLEventListener {
         System.err.println(Thread.currentThread()+" MovieCube.dispose ... ");
         disposeImpl(drawable, true);
     }
-    
+
     private void disposeImpl(GLAutoDrawable drawable, boolean disposePlayer) {
         if(null == mPlayer) { return; }
         final Object upstreamWidget = drawable.getUpstreamWidget();
-        if (upstreamWidget instanceof Window) {            
+        if (upstreamWidget instanceof Window) {
             final Window window = (Window) upstreamWidget;
             window.removeKeyListener(keyAction);
         }
@@ -289,14 +289,14 @@ public class MovieCube implements GLEventListener {
             mPlayer=null;
         }
         cube.dispose(drawable);
-        cube=null;        
+        cube=null;
     }
-    
+
 
     @Override
     public void display(GLAutoDrawable drawable) {
         if(null == mPlayer) { return; }
-        
+
         if( resetGLState ) {
             resetGLState = false;
             System.err.println("XXX resetGLState");
@@ -304,11 +304,11 @@ public class MovieCube implements GLEventListener {
             init(drawable);
             reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
         }
-        
+
         final long currentPos = System.currentTimeMillis();
         if( currentPos - lastPerfPos > 2000 ) {
             System.err.println( mPlayer.getPerfString() );
-            lastPerfPos = currentPos;  
+            lastPerfPos = currentPos;
         }
         cube.display(drawable);
     }
@@ -317,7 +317,7 @@ public class MovieCube implements GLEventListener {
         int swapInterval = 1;
         int width = 510;
         int height = 300;
-        int textureCount = 3; // default - threaded
+        int textureCount = GLMediaPlayer.TEXTURE_COUNT_DEFAULT; // default - threaded
 
         boolean forceES2 = false;
         boolean forceES3 = false;
@@ -326,10 +326,10 @@ public class MovieCube implements GLEventListener {
         int vid = GLMediaPlayer.STREAM_ID_AUTO;
         int aid = GLMediaPlayer.STREAM_ID_AUTO;
         final boolean origSize;
-        
+
         String url_s=null;
         {
-            boolean _origSize = false;        
+            boolean _origSize = false;
             for(int i=0; i<args.length; i++) {
                 if(args[i].equals("-vid")) {
                     i++;
@@ -382,10 +382,10 @@ public class MovieCube implements GLEventListener {
         System.err.println("forceGL3   "+forceGL3);
         System.err.println("forceGLDef "+forceGLDef);
         System.err.println("swapInterval "+swapInterval);
-        
+
         final MovieCube mc = new MovieCube(-2.3f, 0f, 0f);
         mc.setSwapInterval(swapInterval);
-        
+
         final GLProfile glp;
         if(forceGLDef) {
             glp = GLProfile.getDefault();
@@ -397,19 +397,19 @@ public class MovieCube implements GLEventListener {
             glp = GLProfile.get(GLProfile.GLES2);
         } else {
             glp = GLProfile.getGL2ES2();
-        }        
+        }
         System.err.println("GLProfile: "+glp);
         final GLWindow window = GLWindow.create(new GLCapabilities(glp));
         final Animator anim = new Animator(window);
         window.addWindowListener(new WindowAdapter() {
             public void windowDestroyed(WindowEvent e) {
                 anim.stop();
-            }                
+            }
         });
         window.setSize(width, height);
         window.setVisible(true);
         anim.start();
-        
+
         mc.mPlayer.addEventListener(new GLMediaEventListener() {
             @Override
             public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
@@ -434,15 +434,15 @@ public class MovieCube implements GLEventListener {
                 if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
                     final StreamException se = mc.mPlayer.getStreamException();
                     if( null != se ) {
-                        se.printStackTrace();                        
+                        se.printStackTrace();
                     }
                     new Thread() {
                         public void run() {
                             window.destroy();
                         } }.start();
                 }
-            }            
-        });        
+            }
+        });
         mc.initStream(streamLoc, vid, aid, textureCount);
     }
 }
-- 
cgit v1.2.3


From 2dce639c479f820d1a1e701f5eddffc4b02f5e0f Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 7 Nov 2013 08:36:46 +0100
Subject: Bug 890 - Fix GLES3 Profile Mapping, i.e. GL2ES2 queries and
 mappings; Validate isGLES*() usage and definition ; Add and use
 ShaderCode.createExtensionDirective(..)

- Fix GLES3 Profile Mapping, i.e. GL2ES2 queries and mappings
  - GLProfile: Add GL2ES2 -> ES3 mapping
  - EGLContext: Reuqest major '3' for ES3
  - EGLGLCapabilities/EGLGraphicsConfiguration: Consider EGLExt.EGL_OPENGL_ES3_BIT_KHR

- Validate isGLES*() usage and definition
  - Fix BuildComposablePipeline's isGLES() code

  - For GLSL related queries use isGLES() instead of isGLES2(),
    which would exclude ES3

- Add and use ShaderCode.createExtensionDirective(..)
  - Supporting creating GLSL extension directives while reusing strings from GLExtensions

- Minor cleanup of GLContextImpl.setGLFuncAvail(..)
---
 make/scripts/tests.sh                              |  4 +-
 .../gluegen/opengl/BuildComposablePipeline.java    |  2 +-
 .../com/jogamp/graph/curve/opengl/Renderer.java    |  2 +-
 .../classes/com/jogamp/opengl/GLExtensions.java    |  1 +
 .../com/jogamp/opengl/util/glsl/ShaderCode.java    | 28 +++++++++++--
 .../opengl/util/texture/TextureSequence.java       |  1 -
 src/jogl/classes/javax/media/opengl/GLBase.java    |  2 +-
 src/jogl/classes/javax/media/opengl/GLProfile.java | 49 ++++++++++++----------
 .../graph/curve/opengl/RegionRendererImpl01.java   |  5 ++-
 .../graph/curve/opengl/TextRendererImpl01.java     |  5 ++-
 src/jogl/classes/jogamp/opengl/GLContextImpl.java  | 34 ++++++++-------
 src/jogl/classes/jogamp/opengl/egl/EGLContext.java | 21 ++++++----
 .../classes/jogamp/opengl/egl/EGLDrawable.java     |  4 +-
 .../jogamp/opengl/egl/EGLDrawableFactory.java      |  9 +---
 .../jogamp/opengl/egl/EGLGLCapabilities.java       |  7 +++-
 .../opengl/egl/EGLGraphicsConfiguration.java       |  2 +
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   |  4 +-
 .../jogl/demos/es2/TextureSequenceCubeES2.java     |  5 ++-
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  |  5 ++-
 19 files changed, 117 insertions(+), 73 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 53e4e22cd..029866d4e 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -308,7 +308,7 @@ function testawtswt() {
 #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.acore.TestGLProfile00NEWT $*
+testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile00NEWT $*
 #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 $*
@@ -337,7 +337,7 @@ function testawtswt() {
 #
 #testnoawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001RawInit00NEWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit01AWT $*
-testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit02AWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit02AWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLWindowInit03NEWT $*
 
 #
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
index b7a9c270e..df60d2f73 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
@@ -667,7 +667,7 @@ public class BuildComposablePipeline {
             if( 0 != (GEN_GL_IDENTITY_BY_ASSIGNABLE_CLASS & getMode() ) ) {
                 output.println("  @Override");
                 output.println("  public final boolean isGLES() {");
-                output.println("    return isGLES2() || isGLES1();");
+                output.println("    return isGLES3() || isGLES2() || isGLES1();");
                 output.println("  }");
             } else {
                 emitGLIsMethod(output, "GLES");
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
index c642fb652..8783906c2 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
@@ -279,7 +279,7 @@ public abstract class Renderer {
     public static final String es2_precision_fp = "\nprecision mediump float;\nprecision mediump int;\nprecision mediump sampler2D;\n";
 
     protected String getFragmentShaderPrecision(GL2ES2 gl) {
-        if( gl.isGLES2() ) {
+        if( gl.isGLES() ) {
             return es2_precision_fp;
         }
         if( ShaderCode.requiresGL3DefaultPrecision(gl) ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
index c7aadcd14..da9e08a32 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
@@ -72,6 +72,7 @@ public class GLExtensions {
   public static final String OES_read_format                 = "GL_OES_read_format";
   public static final String OES_single_precision            = "GL_OES_single_precision";
   public static final String OES_EGL_image_external          = "GL_OES_EGL_image_external";
+  public static final String OES_standard_derivatives        = "GL_OES_standard_derivatives";
 
   public static final String ARB_gpu_shader_fp64             = "GL_ARB_gpu_shader_fp64";
   public static final String ARB_shader_objects              = "GL_ARB_shader_objects";
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
index 206aa0fd7..6a64edeb5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -843,8 +843,28 @@ public class ShaderCode {
     /** Default precision of GLSL &ge; 1.30 as required until &lt; 1.50 for {@link GL2ES2#GL_FRAGMENT_SHADER fragment-shader}: {@value #gl3_default_precision_fp}. See GLSL Spec 1.30-1.50 Section 4.5.3. */
     public static final String gl3_default_precision_fp = "\nprecision highp float;\nprecision mediump int;\n/*precision mediump sampler2D;*/\n";
 
-    /** Prefer <code>enable</code> over <code>require</code>, since it won't force a failure. */
-    public static final String extOESDerivativesEnable = "#extension GL_OES_standard_derivatives : enable\n";
+    /** <i>Behavior</i> for GLSL extension directive, see {@link #createExtensionDirective(String, String)}, value {@value}. */
+    public static final String REQUIRE = "require";
+    /** <i>Behavior</i> for GLSL extension directive, see {@link #createExtensionDirective(String, String)}, value {@value}. */
+    public static final String ENABLE = "enable";
+    /** <i>Behavior</i> for GLSL extension directive, see {@link #createExtensionDirective(String, String)}, value {@value}. */
+    public static final String DISABLE = "disable";
+    /** <i>Behavior</i> for GLSL extension directive, see {@link #createExtensionDirective(String, String)}, value {@value}. */
+    public static final String WARN = "warn";
+
+    /**
+     * Creates a GLSL extension directive.
+     * <p>
+     * Prefer {@link #ENABLE} over {@link #REQUIRE}, since the latter will force a failure if not supported.
+     * </p>
+     *
+     * @param extensionName
+     * @param behavior shall be either {@link #REQUIRE}, {@link #ENABLE}, {@link #DISABLE} or {@link #WARN}
+     * @return the complete extension directive
+     */
+    public static String createExtensionDirective(String extensionName, String behavior) {
+        return "#extension " + extensionName + " : " + behavior;
+    }
 
     /**
      * Add GLSL version at the head of this shader source code.
@@ -915,7 +935,7 @@ public class ShaderCode {
 
     /** Returns true, if GLSL version requires default precision, i.e. ES2 or GLSL [1.30 .. 1.50[. */
     public static final boolean requiresDefaultPrecision(GL2ES2 gl) {
-        if( gl.isGLES2() || gl.isGLES3() ) {
+        if( gl.isGLES() ) {
             return true;
         }
         return requiresGL3DefaultPrecision(gl);
@@ -979,7 +999,7 @@ public class ShaderCode {
         } else {
             pos = 0;
         }
-        if( gl.isGLES2() && null != esDefaultPrecision ) {
+        if( gl.isGLES() && null != esDefaultPrecision ) {
             pos = insertShaderSource(0, pos, esDefaultPrecision);
         } else {
             pos = addDefaultShaderPrecision(gl, pos);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index c34e019c2..6f1dd4c64 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -105,7 +105,6 @@ import com.jogamp.opengl.util.TimeFrameI;
  *
  */
 public interface TextureSequence {
-    public static final String GL_OES_EGL_image_external_Required_Prelude = "#extension GL_OES_EGL_image_external : enable\n";
     public static final String samplerExternalOES = "samplerExternalOES";
     public static final String sampler2D = "sampler2D";
 
diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java
index e84dd7be9..a19a99196 100644
--- a/src/jogl/classes/javax/media/opengl/GLBase.java
+++ b/src/jogl/classes/javax/media/opengl/GLBase.java
@@ -150,7 +150,7 @@ public interface GLBase {
 
   /**
    * Indicates whether this GL object conforms to one of the OpenGL ES profiles,
-   * see {@link #isGLES1()} and {@link #isGLES2()}.
+   * see {@link #isGLES1()}, {@link #isGLES2()} and {@link #isGLES3()}.
    * @see GLContext#isGLES()
    */
   public boolean isGLES();
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index c04971176..64c8a6243 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -278,7 +278,7 @@ public class GLProfile {
         if(useIndent) {
             doIndent(sb, indent, indentCount).append("Natives");
             indentCount++;
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4bc).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4bc+" ").append(indent);
         } else {
             sb.append("Natives["+GL4bc+" ");
         }
@@ -291,7 +291,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4+" ").append(indent);
         } else {
             sb.append(", "+GL4+" ");
         }
@@ -304,7 +304,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES3).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES3+" ").append(indent);
         } else {
             sb.append(", "+GLES3+" ");
         }
@@ -317,7 +317,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL3bc).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL3bc+" ").append(indent);
         } else {
             sb.append(", "+GL3bc+" ");
         }
@@ -330,7 +330,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL3).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL3+" ").append(indent);
         } else {
             sb.append(", "+GL3+" ");
         }
@@ -343,7 +343,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2+" ").append(indent);
         } else {
             sb.append(", "+GL2+" ");
         }
@@ -356,7 +356,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES2).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES2+" ").append(indent);
         } else {
             sb.append(", "+GLES2+" ");
         }
@@ -369,7 +369,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES1).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES1+" ").append(indent);
         } else {
             sb.append(", "+GLES1+" ");
         }
@@ -391,7 +391,7 @@ public class GLProfile {
         }
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4ES3).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4ES3+" ").append(indent);
         } else {
             sb.append(", "+GL4ES3+" ");
         }
@@ -399,7 +399,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2GL3).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2GL3+" ").append(indent);
         } else {
             sb.append(", "+GL2GL3+" ");
         }
@@ -407,7 +407,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2ES2).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2ES2+" ").append(indent);
         } else {
             sb.append(", "+GL2ES2+" ");
         }
@@ -415,7 +415,7 @@ public class GLProfile {
         allCount++;
 
         if(useIndent) {
-            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2ES1).append(indent);
+            doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2ES1+" ").append(indent);
         } else {
             sb.append(", "+GL2ES1+" ");
         }
@@ -438,7 +438,7 @@ public class GLProfile {
                     if(useIndent) {
                         doIndent(sb.append(Platform.getNewline()), indent, indentCount);
                     }
-                    sb.append(entry.getKey()+(useIndent?"\t":" ")+entry.getValue());
+                    sb.append(entry.getKey()+(useIndent?" \t":" ")+entry.getValue());
                     if(!useIndent) {
                         sb.append(", ");
                     }
@@ -1208,17 +1208,17 @@ public class GLProfile {
 
     /** Indicates whether this profile uses the native OpenGL ES2 implementations. */
     public final boolean usesNativeGLES2() {
-        return GLES3 == getImplName() || GLES2 == getImplName();
+        return GLES2 == getImplName();
     }
 
-    /** Indicates whether this profile uses the native OpenGL ES2 implementations. */
+    /** Indicates whether this profile uses the native OpenGL ES3 implementations. */
     public final boolean usesNativeGLES3() {
         return GLES3 == getImplName();
     }
 
     /** Indicates whether this profile uses either of the native OpenGL ES implementations. */
     public final boolean usesNativeGLES() {
-        return usesNativeGLES2() || usesNativeGLES1();
+        return usesNativeGLES3() || usesNativeGLES2() || usesNativeGLES1();
     }
 
     /**
@@ -1945,33 +1945,40 @@ public class GLProfile {
             final boolean es2HardwareRasterizer[] = new boolean[1];
             final boolean gles2Available = hasGLES3Impl && ( esCtxUndef || GLContext.isGLES2Available(device, es2HardwareRasterizer) );
             final boolean gles2HWAvailable = gles2Available && es2HardwareRasterizer[0] ;
+            final boolean es3HardwareRasterizer[] = new boolean[1];
+            final boolean gles3Available = hasGLES3Impl && ( esCtxUndef || GLContext.isGLES3Available(device, es3HardwareRasterizer) );
+            final boolean gles3HWAvailable = gles3Available && es3HardwareRasterizer[0] ;
             if(hasGL234Impl) {
                 if(GLContext.isGL4Available(device, isHardwareRasterizer)) {
-                    if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+                    if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
                         return GL4;
                     }
                 }
                 if(GLContext.isGL4bcAvailable(device, isHardwareRasterizer)) {
-                    if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+                    if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
                         return GL4bc;
                     }
                 }
                 if(GLContext.isGL3Available(device, isHardwareRasterizer)) {
-                    if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+                    if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
                         return GL3;
                     }
                 }
                 if(GLContext.isGL3bcAvailable(device, isHardwareRasterizer)) {
-                    if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+                    if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
                         return GL3bc;
                     }
                 }
                 if(desktopCtxUndef || GLContext.isGL2Available(device, isHardwareRasterizer)) {
-                    if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+                    if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
                         return GL2;
                     }
                 }
             }
+            if(gles3Available && ( !gles2HWAvailable || gles3HWAvailable ) ) {
+                isHardwareRasterizer[0] = es3HardwareRasterizer[0];
+                return GLES3;
+            }
             if(gles2Available) {
                 isHardwareRasterizer[0] = es2HardwareRasterizer[0];
                 return GLES2;
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
index 012b1d1dd..31ad974d0 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
@@ -36,6 +36,7 @@ import com.jogamp.graph.curve.Region;
 import com.jogamp.graph.curve.opengl.GLRegion;
 import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.opengl.GLExtensions;
 import com.jogamp.opengl.util.glsl.ShaderCode;
 import com.jogamp.opengl.util.glsl.ShaderProgram;
 import com.jogamp.opengl.util.glsl.ShaderState;
@@ -57,8 +58,8 @@ public class RegionRendererImpl01 extends RegionRenderer {
         rsVp.defaultShaderCustomization(gl, true, true);
         // rsFp.defaultShaderCustomization(gl, true, true);
         int pos = rsFp.addGLSLVersion(gl);
-        if( gl.isGLES2() ) {
-            pos = rsFp.insertShaderSource(0, pos, ShaderCode.extOESDerivativesEnable);
+        if( gl.isGLES() ) {
+            pos = rsFp.insertShaderSource(0, pos, ShaderCode.createExtensionDirective(GLExtensions.OES_standard_derivatives, ShaderCode.ENABLE));
         }
         final String rsFpDefPrecision =  getFragmentShaderPrecision(gl);
         if( null != rsFpDefPrecision ) {
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
index 60758b90b..4ec4d1d98 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
@@ -36,6 +36,7 @@ import jogamp.graph.curve.text.GlyphString;
 import com.jogamp.graph.curve.opengl.RenderState;
 import com.jogamp.graph.curve.opengl.TextRenderer;
 import com.jogamp.graph.font.Font;
+import com.jogamp.opengl.GLExtensions;
 import com.jogamp.opengl.util.glsl.ShaderCode;
 import com.jogamp.opengl.util.glsl.ShaderProgram;
 import com.jogamp.opengl.util.glsl.ShaderState;
@@ -56,8 +57,8 @@ public class TextRendererImpl01 extends TextRenderer {
         rsVp.defaultShaderCustomization(gl, true, true);
         // rsFp.defaultShaderCustomization(gl, true, true);
         int pos = rsFp.addGLSLVersion(gl);
-        if( gl.isGLES2() ) {
-            pos = rsFp.insertShaderSource(0, pos, ShaderCode.extOESDerivativesEnable);
+        if( gl.isGLES() ) {
+            pos = rsFp.insertShaderSource(0, pos, ShaderCode.createExtensionDirective(GLExtensions.OES_standard_derivatives, ShaderCode.ENABLE));
         }
         final String rsFpDefPrecision =  getFragmentShaderPrecision(gl);
         if( null != rsFpDefPrecision ) {
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index d43da2c3e..42c877ad5 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -1305,11 +1305,8 @@ public abstract class GLContextImpl extends GLContext {
    * <p>
    * If the GL query fails, major will be zero.
    * </p>
-   * <p>
-   * Note: Non ARB ctx is limited to GL 3.0.
-   * </p>
    */
-  private final boolean getGLIntVersion(int[] glIntMajor, int[] glIntMinor, int ctp)  {
+  private final boolean getGLIntVersion(int[] glIntMajor, int[] glIntMinor)  {
     glIntMajor[0] = 0; // clear
     final GLDynamicLookupHelper glDynLookupHelper = getDrawableImpl().getGLDynamicLookupHelper();
     final long _glGetIntegerv = glDynLookupHelper.dynamicLookupFunction("glGetIntegerv");
@@ -1408,14 +1405,15 @@ public abstract class GLContextImpl extends GLContext {
     if (DEBUG) {
         System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Pre version verification - expected "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+", strictMatch "+strictMatch+", glVersionsMapping " +withinGLVersionsMapping);
     }
-    boolean versionValidated = false;
-    boolean versionGL3IntFailed = false;
+
+    final boolean versionGL3IntOK;
     {
-        // Validate the requested version w/ the GL-version from an integer query.
+        // Validate the requested version w/ the GL-version from an integer query,
+        // as supported by GL [ES] >= 3.0 implementation.
         final VersionNumber hasGLVersionByInt;
         {
             final int[] glIntMajor = new int[] { 0 }, glIntMinor = new int[] { 0 };
-            final boolean getGLIntVersionOK = getGLIntVersion(glIntMajor, glIntMinor, ctxProfileBits);
+            final boolean getGLIntVersionOK = getGLIntVersion(glIntMajor, glIntMinor);
             if( !getGLIntVersionOK ) {
                 final String errMsg = "Fetching GL Integer Version failed. "+adevice+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, null);
                 if( strictMatch ) {
@@ -1432,7 +1430,7 @@ public abstract class GLContextImpl extends GLContext {
             hasGLVersionByInt = new VersionNumber(glIntMajor[0], glIntMinor[0], 0);
         }
         if (DEBUG) {
-            System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Version verification (Int): "+glVersion+", "+hasGLVersionByInt);
+            System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Version verification (Int): String "+glVersion+", Number "+hasGLVersionByInt);
         }
 
         // Only validate if a valid int version was fetched, otherwise cont. w/ version-string method -> 3.0 > Version || Version > MAX!
@@ -1455,16 +1453,20 @@ public abstract class GLContextImpl extends GLContext {
             // Use returned GL version!
             major = hasGLVersionByInt.getMajor();
             minor = hasGLVersionByInt.getMinor();
-            versionValidated = true;
+            versionGL3IntOK = true;
         } else {
-            versionGL3IntFailed = true;
+            versionGL3IntOK = false;
         }
     }
-    if( !versionValidated ) {
+    final boolean versionValidated;
+
+    if( versionGL3IntOK ) {
+        versionValidated = true;
+    } else {
         // Validate the requested version w/ the GL-version from the version string.
         final VersionNumber hasGLVersionByString = getGLVersionNumber(ctxProfileBits, glVersion);
         if (DEBUG) {
-            System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Version verification (String): "+glVersion+", "+hasGLVersionByString);
+            System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Version verification (String): String "+glVersion+", Number "+hasGLVersionByString);
         }
 
         // Only validate if a valid string version was fetched -> MIN > Version || Version > MAX!
@@ -1484,7 +1486,7 @@ public abstract class GLContextImpl extends GLContext {
                 }
                 return false;
             }
-            if( strictMatch && versionGL3IntFailed && major >= 3 ) {
+            if( strictMatch && !versionGL3IntOK && major >= 3 ) {
                 if(DEBUG) {
                     System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL3/ES3 version Int failed, String: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+hasGLVersionByString);
                 }
@@ -1494,6 +1496,8 @@ public abstract class GLContextImpl extends GLContext {
             major = hasGLVersionByString.getMajor();
             minor = hasGLVersionByString.getMinor();
             versionValidated = true;
+        } else {
+            versionValidated = false;
         }
     }
     if( strictMatch && !versionValidated ) {
@@ -1506,7 +1510,7 @@ public abstract class GLContextImpl extends GLContext {
         System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Post version verification req "+
                 GLContext.getGLVersion(reqGLVersion.getMajor(), reqGLVersion.getMinor(), reqCtxProfileBits, null)+" -> has "+
                 GLContext.getGLVersion(major, minor, ctxProfileBits, null)+
-                ", strictMatch "+strictMatch+", versionValidated "+versionValidated+", versionGL3IntFailed "+versionGL3IntFailed);
+                ", strictMatch "+strictMatch+", versionValidated "+versionValidated+", versionGL3IntOK "+versionGL3IntOK);
     }
 
     if( major < 2 ) { // there is no ES2/3-compat for a profile w/ major < 2
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
index 903a4c461..b2f06dce6 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -135,13 +135,7 @@ public class EGLContext extends GLContextImpl {
 
     @Override
     protected void destroyImpl() throws GLException {
-      if (!EGL.eglDestroyContext(drawable.getNativeSurface().getDisplayHandle(), contextHandle)) {
-          final int eglError = EGL.eglGetError();
-          if(EGL.EGL_SUCCESS != eglError) { /* oops, Mesa EGL impl. may return false, but has no EGL error */
-              throw new GLException("Error destroying OpenGL context " + toHexString(contextHandle) +
-                                    ": error code " + toHexString(eglError));
-          }
-      }
+        destroyContextARBImpl(contextHandle);
     }
 
     @Override
@@ -151,7 +145,13 @@ public class EGLContext extends GLContextImpl {
 
     @Override
     protected void destroyContextARBImpl(long _context) {
-        // FIXME
+        if (!EGL.eglDestroyContext(drawable.getNativeSurface().getDisplayHandle(), _context)) {
+            final int eglError = EGL.eglGetError();
+            if(EGL.EGL_SUCCESS != eglError) { /* oops, Mesa EGL impl. may return false, but has no EGL error */
+                throw new GLException("Error destroying OpenGL context " + toHexString(_context) +
+                        ": error code " + toHexString(eglError));
+            }
+        }
     }
 
     @Override
@@ -180,12 +180,14 @@ public class EGLContext extends GLContextImpl {
             }
         }
 
+        // Cannot check extension 'EGL_KHR_create_context' before having one current!
+
         final IntBuffer contextAttrsNIO;
         final int contextVersionReq, contextVersionAttr;
         {
             if ( glProfile.usesNativeGLES3() ) {
                 contextVersionReq = 3;
-                contextVersionAttr = 2;
+                contextVersionAttr = 3;
             } else if ( glProfile.usesNativeGLES2() ) {
                 contextVersionReq = 2;
                 contextVersionAttr = 2;
@@ -195,6 +197,7 @@ public class EGLContext extends GLContextImpl {
             } else {
                 throw new GLException("Error creating OpenGL context - invalid GLProfile: "+glProfile);
             }
+            // EGLExt.EGL_CONTEXT_MAJOR_VERSION_KHR == EGL.EGL_CONTEXT_CLIENT_VERSION
             final int[] contextAttrs = new int[] { EGL.EGL_CONTEXT_CLIENT_VERSION, contextVersionAttr, EGL.EGL_NONE };
             contextAttrsNIO = Buffers.newDirectIntBuffer(contextAttrs);
         }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
index ab28fb3fb..f184edae3 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
@@ -166,7 +166,9 @@ public abstract class EGLDrawable extends GLDrawableImpl {
 
     @Override
     public GLDynamicLookupHelper getGLDynamicLookupHelper() {
-        if (getGLProfile().usesNativeGLES2()) {
+        if (getGLProfile().usesNativeGLES3()) {
+            return getFactoryImpl().getGLDynamicLookupHelper(3);
+        } else if (getGLProfile().usesNativeGLES2()) {
             return getFactoryImpl().getGLDynamicLookupHelper(2);
         } else if (getGLProfile().usesNativeGLES1()) {
             return getFactoryImpl().getGLDynamicLookupHelper(1);
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index 4202c7454..1438107fe 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -615,12 +615,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         }
         if( null != eglES2DynamicLookupHelper ) {
             madeCurrentES3 = mapAvailableEGLESConfig(adevice, 3, hasPBufferES3ES2, rendererQuirksES3ES2, ctpES3ES2);
-            if( madeCurrentES3 ) {
-                // Only support highest - FIXME: Proper ES2/ES3 profile selection
-                madeCurrentES2 = false;
-            } else {
-                madeCurrentES2 = mapAvailableEGLESConfig(adevice, 2, hasPBufferES3ES2, rendererQuirksES3ES2, ctpES3ES2);
-            }
+            madeCurrentES2 = mapAvailableEGLESConfig(adevice, 2, hasPBufferES3ES2, rendererQuirksES3ES2, ctpES3ES2);
         } else {
             madeCurrentES2 = false;
             madeCurrentES3 = false;
@@ -668,7 +663,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
 
     @Override
     public GLDynamicLookupHelper getGLDynamicLookupHelper(int esProfile) {
-        if (2==esProfile) {
+        if ( 2==esProfile || 3==esProfile ) {
             return eglES2DynamicLookupHelper;
         } else if (1==esProfile) {
             return eglES1DynamicLookupHelper;
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
index b61624d79..e28b53235 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
@@ -101,7 +101,6 @@ public class EGLGLCapabilities extends GLCapabilities {
     if(null == glp) {
         return true;
     }
-    /** FIXME: EGLExt.EGL_OPENGL_ES3_BIT_KHR OK ? */
     if(0 != (renderableType & EGLExt.EGL_OPENGL_ES3_BIT_KHR) && glp.usesNativeGLES3()) {
         return true;
     }
@@ -118,6 +117,9 @@ public class EGLGLCapabilities extends GLCapabilities {
   }
 
   public static GLProfile getCompatible(EGLGraphicsDevice device, int renderableType) {
+    if(0 != (renderableType & EGLExt.EGL_OPENGL_ES3_BIT_KHR) && GLProfile.isAvailable(device, GLProfile.GLES3)) {
+        return GLProfile.get(device, GLProfile.GLES3);
+    }
     if(0 != (renderableType & EGL.EGL_OPENGL_ES2_BIT) && GLProfile.isAvailable(device, GLProfile.GLES2)) {
         return GLProfile.get(device, GLProfile.GLES2);
     }
@@ -145,6 +147,9 @@ public class EGLGLCapabilities extends GLCapabilities {
     if(0 != (renderableType & EGL.EGL_OPENGL_ES2_BIT)) {
         if(!first) sink.append(", "); sink.append("GLES2");  first=false;
     }
+    if(0 != (renderableType & EGLExt.EGL_OPENGL_ES3_BIT_KHR)) {
+        if(!first) sink.append(", "); sink.append("GLES3");  first=false;
+    }
     if(0 != (renderableType & EGL.EGL_OPENVG_API)) {
         if(!first) sink.append(", "); sink.append("VG");  first=false;
     }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
index dd7bf99cb..789168b68 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -415,6 +415,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
             attrs.put(idx++, EGL.EGL_OPENGL_ES_BIT);
         } else if(caps.getGLProfile().usesNativeGLES2()) {
             attrs.put(idx++, EGL.EGL_OPENGL_ES2_BIT);
+        } else if(caps.getGLProfile().usesNativeGLES3()) {
+            attrs.put(idx++, EGLExt.EGL_OPENGL_ES3_BIT_KHR);
         } else {
             attrs.put(idx++, EGL.EGL_OPENGL_BIT);
         }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 91647394d..86e19c920 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -49,9 +49,11 @@ import com.jogamp.common.net.URIQueryProps;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.LFRingbuffer;
 import com.jogamp.common.util.Ringbuffer;
+import com.jogamp.opengl.GLExtensions;
 import com.jogamp.opengl.util.TimeFrameI;
 import com.jogamp.opengl.util.av.AudioSink;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.glsl.ShaderCode;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
 import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
@@ -221,7 +223,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public String getRequiredExtensionsShaderStub() throws IllegalStateException {
         checkGLInit();
         if(GLES2.GL_TEXTURE_EXTERNAL_OES == textureTarget) {
-            return TextureSequence.GL_OES_EGL_image_external_Required_Prelude;
+            return ShaderCode.createExtensionDirective(GLExtensions.OES_EGL_image_external, ShaderCode.ENABLE);
         }
         return "";
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
index e38b9c6e3..a2d3eb6bf 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
@@ -43,6 +43,7 @@ import com.jogamp.newt.Window;
 import com.jogamp.newt.event.MouseAdapter;
 import com.jogamp.newt.event.MouseEvent;
 import com.jogamp.newt.event.MouseListener;
+import com.jogamp.opengl.GLExtensions;
 import com.jogamp.opengl.JoglVersion;
 import com.jogamp.opengl.util.GLArrayDataServer;
 import com.jogamp.opengl.util.PMVMatrix;
@@ -196,8 +197,8 @@ public class TextureSequenceCubeES2 implements GLEventListener {
         final Texture tex= frame.getTexture();
         
         final boolean useExternalTexture = GLES2.GL_TEXTURE_EXTERNAL_OES == tex.getTarget();
-        if(useExternalTexture && !gl.isExtensionAvailable("GL_OES_EGL_image_external")) {
-            throw new GLException("GL_OES_EGL_image_external requested but not available");
+        if(useExternalTexture && !gl.isExtensionAvailable(GLExtensions.OES_EGL_image_external)) {
+            throw new GLException(GLExtensions.OES_EGL_image_external+" requested but not available");
         }
         
         initShader(gl);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index d29381f35..a087e7e46 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -54,6 +54,7 @@ import com.jogamp.newt.event.MouseListener;
 import com.jogamp.newt.event.WindowAdapter;
 import com.jogamp.newt.event.WindowEvent;
 import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.GLExtensions;
 import com.jogamp.opengl.JoglVersion;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
@@ -386,8 +387,8 @@ public class MovieSimple implements GLEventListener {
             }
             tex = mPlayer.getLastTexture().getTexture();
             useExternalTexture = GLES2.GL_TEXTURE_EXTERNAL_OES == tex.getTarget();
-            if(useExternalTexture && !gl.isExtensionAvailable("GL_OES_EGL_image_external")) {
-                throw new GLException("GL_OES_EGL_image_external requested but not available");
+            if(useExternalTexture && !gl.isExtensionAvailable(GLExtensions.OES_EGL_image_external)) {
+                throw new GLException(GLExtensions.OES_EGL_image_external+" requested but not available");
             }
             if(!mPlayerShared) {
                 mPlayer.setTextureMinMagFilter( new int[] { GL.GL_NEAREST, GL.GL_LINEAR } );
-- 
cgit v1.2.3


From c6ab1bc932d9a0b3897b24d289e4d561bf8bb65c Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Wed, 11 Dec 2013 06:21:42 +0100
Subject: Bug 918 (1/2): Use StreamWorker in 'Audio Only' mode, since no
 'getNextTexture(..)' is issued here!

Thanks to Xerxes to analyze this issue thoroughly.

TODO: Implement EOS for 'Audio Only' and test seek, pause, etc .. - Apply manual tests in MovieSimple
---
 make/scripts/tests.sh                                         | 6 +++---
 src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java | 2 +-
 src/jogl/native/libav/ffmpeg_impl_template.c                  | 7 +------
 3 files changed, 5 insertions(+), 10 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 9b7d43453..e9d612f64 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -141,7 +141,7 @@ function jrun() {
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
-    #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
+    D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
     #D_ARGS="-Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
@@ -345,7 +345,7 @@ function testawtswt() {
 #
 #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.MovieSimple $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
 
 #
 # performance tests
@@ -608,7 +608,7 @@ function testawtswt() {
 #testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01aAWT $*
 #testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01bAWT $*
 #testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01cAWT $*
-testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01dAWT $*
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01dAWT $*
 #testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting02AWT $*
 #testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting03AWT $*
 #testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting04AWT $*
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 86e19c920..04a8beb48 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -528,7 +528,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             this.vid = vid;
             this.aid = aid;
             if ( this.streamLoc != null ) {
-                if( TEXTURE_COUNT_MIN < textureCount ) {
+                if( TEXTURE_COUNT_MIN < textureCount || STREAM_ID_NONE == vid ) { // Enable StreamWorker for 'audio only' as well (Bug 918).
                     streamWorker = new StreamWorker();
                 } else {
                     new Thread() {
diff --git a/src/jogl/native/libav/ffmpeg_impl_template.c b/src/jogl/native/libav/ffmpeg_impl_template.c
index 24fddd2c0..b46586acc 100644
--- a/src/jogl/native/libav/ffmpeg_impl_template.c
+++ b/src/jogl/native/libav/ffmpeg_impl_template.c
@@ -846,14 +846,9 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
         pAV->frames_audio = pAV->pAStream->nb_frames;
         pAV->aSinkSupport = _isAudioFormatSupported(env, pAV->ffmpegMediaPlayer, pAV->aSampleFmt, pAV->aSampleRate, pAV->aChannels);
         if( pAV->verbose ) {
-            fprintf(stderr, "A channels %d [l %"PRId64"], sample_rate %d, frame_size %d, frame_number %d, [afps %f, rfps %f, cfps %f, sfps %f], nb_frames %"PRId64", [maxChan %d, prefRate %d, req_chan_layout %"PRId64", req_chan %d], sink-support %d \n", 
+            fprintf(stderr, "A channels %d [l %"PRId64"], sample_rate %d, frame_size %d, frame_number %d, [afps %f, cfps %f, sfps %f], nb_frames %"PRId64", [maxChan %d, prefRate %d, req_chan_layout %"PRId64", req_chan %d], sink-support %d \n", 
                 pAV->aChannels, pAV->pACodecCtx->channel_layout, pAV->aSampleRate, pAV->aFrameSize, pAV->pACodecCtx->frame_number,
                 my_av_q2f(pAV->pAStream->avg_frame_rate),
-                #if LIBAVCODEC_VERSION_MAJOR < 55
-                    my_av_q2f(pAV->pVStream->r_frame_rate),
-                #else
-                    0.0f,
-                #endif
                 my_av_q2f_r(pAV->pAStream->codec->time_base),
                 my_av_q2f_r(pAV->pAStream->time_base),
                 pAV->pAStream->nb_frames,
-- 
cgit v1.2.3


From a1be0f69bacb315e40a017b8997ef1c610da576e Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Wed, 11 Dec 2013 07:41:31 +0100
Subject: Bug 918: GLMediaPlayer: Fix Deadlock if EOS happens after
 pause/resume (seek) - Tested w/ seeking 'Audio Only' and Matroska

Test stream was default of MovieSimple:
  http://video.webmfiles.org/big-buck-bunny_trailer.webm

while disabling video (-vid -2)
---
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 28 ++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 04a8beb48..ae3f901a1 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -385,7 +385,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     if( null != audioSink && State.Playing == _state ) {
                         audioSink.play(); // cont. w/ new data
                     }
-                    System.err.println("SEEK XXX: "+getPerfString());
+                    if(DEBUG) {
+                        System.err.println("Seek("+msec+"): "+getPerfString());
+                    }
                     if( null != streamWorker ) {
                         streamWorker.doResume();
                     }
@@ -1073,7 +1075,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 shallPause = false;
                 if( Thread.currentThread() != this ) {
                     while( !isActive ) {
-                        this.notify();  // wake-up pause-block
+                        this.notifyAll();  // wake-up pause-block
                         try {
                             this.wait(); // wait until resumed
                         } catch (InterruptedException e) {
@@ -1091,7 +1093,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         this.interrupt();
                     }
                     while( isRunning ) {
-                        this.notify();  // wake-up pause-block (opt)
+                        this.notifyAll();  // wake-up pause-block (opt)
                         try {
                             this.wait();  // wait until stopped
                         } catch (InterruptedException e) {
@@ -1133,7 +1135,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         }
                         while( shallPause && !shallStop ) {
                             isActive = false;
-                            this.notify();   // wake-up doPause()
+                            this.notifyAll();   // wake-up doPause()
                             try {
                                 this.wait(); // wait until resumed
                             } catch (InterruptedException e) {
@@ -1147,7 +1149,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             preNextTextureImpl(sharedGLCtx.getGL());
                         }
                         isActive = true;
-                        this.notify(); // wake-up doResume()
+                        this.notifyAll(); // wake-up doResume()
                     }
                 }
                 if( !sharedGLCtxCurrent && null != sharedGLCtx ) {
@@ -1191,8 +1193,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 // audio only
                                 if( TimeFrameI.END_OF_STREAM_PTS == vPTS ) {
                                     // state transition incl. notification
-                                    shallPause = true;
-                                    isActive = false;
+                                    synchronized ( this ) {
+                                        shallPause = true;
+                                        isActive = false;
+                                        this.notifyAll(); // wake-up potential do*()
+                                    }
                                     pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
                                 }
                             }
@@ -1215,8 +1220,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 t.printStackTrace();
                             }
                             // state transition incl. notification
-                            shallPause = true;
-                            isActive = false;
+                            synchronized ( this ) {
+                                shallPause = true;
+                                isActive = false;
+                                this.notifyAll(); // wake-up potential do*()
+                            }
                             pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_ERR);
                         }
                     }
@@ -1229,7 +1237,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 destroySharedGL();
                 isRunning = false;
                 isActive = false;
-                this.notify(); // wake-up doStop()
+                this.notifyAll(); // wake-up doStop()
             }
         }
     }
-- 
cgit v1.2.3


From 8a8ed735f6631b2da7bf605c5c3dda4e0fc13905 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Wed, 11 Dec 2013 20:46:04 +0100
Subject: Bug 918 (2/2): Determine StreamWorker usage after stream-init ; Fix
 seek(..) ; Fallback for EOS Detection ; MovieSimple uses full GLEventListener
 for 'Audio Only' as well to test seek

Determine StreamWorker usage after init
  - To support audio only files, we need to determine to use StreamWorker
	after completion of stream-init.

Fix seek(..)
  - FFMPeg: pos0 needs to use aPTS for audio-only
  - Clip target time [0..duration[

Fallback for EOS Detection
  In case the backend does not report proper EOS:

  - Utilize 'nullFramesCount >= MAX' -> EOS,
    where MAX is number of frames for 3s play duraction
    and where 'nullFramesCount' is increased if no valid packet is available
    and no decoded-video or -audio in the queue.

  - Utilize pts > duration -> EOS

MovieSimple uses full GLEventListener for 'Audio Only' as well to test seek
  - Matroska seek for audio-only leads to EOS ..
    http://video.webmfiles.org/big-buck-bunny_trailer.webm

  - MP4 audio-only seek works
    http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4

MovieSimple/MovieCube:
  - Use audio-pts in audio-only to calc target time

Tested:
  - A, V and A+V
  - Pause, Stop and Seek
  - GNU/Linux
---
 make/scripts/tests.sh                              |   2 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |   5 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   | 261 ++++++++++++++-------
 src/jogl/native/libav/ffmpeg_impl_template.c       |  16 +-
 .../test/junit/jogl/demos/es2/av/MovieCube.java    |   2 +-
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  | 193 +++++++++------
 6 files changed, 310 insertions(+), 169 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index e9d612f64..cb60028aa 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -141,7 +141,7 @@ function jrun() {
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
-    D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
     #D_ARGS="-Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index b0a645cbb..22a5cfb32 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -358,7 +358,10 @@ public interface GLMediaPlayer extends TextureSequence {
     public void initStream(URI streamLoc, int vid, int aid, int textureCount) throws IllegalStateException, IllegalArgumentException;
 
     /**
-     * Returns the {@link StreamException} caught in the decoder thread, or <code>null</code>.
+     * Returns the {@link StreamException} caught in the decoder thread, or <code>null</code> if none occured.
+     * <p>
+     * Method clears the cached {@link StreamException}, hence an immediate subsequent call will return <code>null</code>.
+     * </p>
      * @see GLMediaEventListener#EVENT_CHANGE_ERR
      * @see StreamException
      */
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index ae3f901a1..e6a0012d3 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -138,6 +138,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected int displayedFrameCount = 0;
     protected volatile int video_pts_last = 0;
 
+    /**
+     * Help detect EOS, limit is {@link #MAX_FRAMELESS_MS_UNTIL_EOS}.
+     * To be used either by getNextTexture(..) or StreamWorker for audio-only.
+     */
+    private int nullFrameCount = 0;
+    private int maxNullFrameCountUntilEOS = 0;
+    /**
+     * Help detect EOS, limit {@value} milliseconds without a valid frame.
+     */
+    private static final int MAX_FRAMELESS_MS_UNTIL_EOS = 5000;
+    private static final int MAX_FRAMELESS_UNTIL_EOS_DEFAULT =  MAX_FRAMELESS_MS_UNTIL_EOS / 30; // default value assuming 30fps
+
     /** See {@link #getAudioSink()}. Set by implementation if used from within {@link #initStreamImpl(int, int)}! */
     protected AudioSink audioSink = null;
     protected boolean audioSinkPlaySpeedSet = false;
@@ -380,6 +392,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     if( null != streamWorker ) {
                         streamWorker.doPause();
                     }
+                    // Adjust target ..
+                    if( msec >= duration ) {
+                        msec = duration - (int)Math.floor(frame_duration);
+                    } else if( msec < 0 ) {
+                        msec = 0;
+                    }
                     pts1 = seekImpl(msec);
                     resetAVPTSAndFlush();
                     if( null != audioSink && State.Playing == _state ) {
@@ -509,6 +527,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             decodedFrameCount = 0;
             presentedFrameCount = 0;
             displayedFrameCount = 0;
+            nullFrameCount = 0;
+            maxNullFrameCountUntilEOS = MAX_FRAMELESS_UNTIL_EOS_DEFAULT;
             this.streamLoc = streamLoc;
 
             // Pre-parse for camera-input scheme
@@ -530,20 +550,17 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             this.vid = vid;
             this.aid = aid;
             if ( this.streamLoc != null ) {
-                if( TEXTURE_COUNT_MIN < textureCount || STREAM_ID_NONE == vid ) { // Enable StreamWorker for 'audio only' as well (Bug 918).
-                    streamWorker = new StreamWorker();
-                } else {
-                    new Thread() {
-                        public void run() {
-                            try {
-                                initStreamImpl(vid, aid);
-                            } catch (Throwable t) {
-                                streamErr = new StreamException(t.getClass().getSimpleName()+" while initializing: "+GLMediaPlayerImpl.this.toString(), t);
-                                changeState(GLMediaEventListener.EVENT_CHANGE_ERR, GLMediaPlayer.State.Uninitialized);
-                            } // also initializes width, height, .. etc
-                        }
-                    }.start();
-                }
+                new Thread() {
+                    public void run() {
+                        try {
+                            // StreamWorker may be used, see API-doc of StreamWorker
+                            initStreamImpl(vid, aid);
+                        } catch (Throwable t) {
+                            streamErr = new StreamException(t.getClass().getSimpleName()+" while initializing: "+GLMediaPlayerImpl.this.toString(), t);
+                            changeState(GLMediaEventListener.EVENT_CHANGE_ERR, GLMediaPlayer.State.Uninitialized);
+                        } // also initializes width, height, .. etc
+                    }
+                }.start();
             }
         }
     }
@@ -748,6 +765,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected TextureFrame cachedFrame = null;
     protected long lastTimeMillis = 0;
 
+    private final boolean[] stGotVFrame = { false };
+
     @Override
     public final TextureFrame getNextTexture(GL gl) throws IllegalStateException {
         synchronized( stateLock ) {
@@ -755,12 +774,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 throw new IllegalStateException("Instance not paused or playing: "+this);
             }
             if(State.Playing == state) {
-                TextureFrame nextFrame = null;
                 boolean dropFrame = false;
                 try {
                     do {
-                        final long currentTimeMillis;
-                        final boolean playCached = null != cachedFrame;
                         final boolean droppedFrame;
                         if( dropFrame ) {
                             presentedFrameCount--;
@@ -769,24 +785,69 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         } else {
                             droppedFrame = false;
                         }
+                        final boolean playCached = null != cachedFrame;
+                        final int video_pts;
+                        final boolean hasVideoFrame;
+                        TextureFrame nextFrame;
                         if( playCached ) {
                             nextFrame = cachedFrame;
                             cachedFrame = null;
                             presentedFrameCount--;
-                        } else if( STREAM_ID_NONE != vid ) {
-                            if( null != videoFramesDecoded ) { // single threaded ? TEXTURE_COUNT_MIN == textureCount
+                            video_pts = nextFrame.getPTS();
+                            hasVideoFrame = true;
+                        } else {
+                            if( null != videoFramesDecoded ) {
+                                // multi-threaded and video available
                                 nextFrame = videoFramesDecoded.get();
+                                if( null != nextFrame ) {
+                                    video_pts = nextFrame.getPTS();
+                                    hasVideoFrame = true;
+                                } else {
+                                    video_pts = TimeFrameI.INVALID_PTS;
+                                    hasVideoFrame = false;
+                                }
                             } else {
-                                nextFrame = getNextSingleThreaded(gl, lastFrame);
+                                // single-threaded or audio-only
+                                video_pts = getNextSingleThreaded(gl, lastFrame, stGotVFrame);
+                                nextFrame = lastFrame;
+                                hasVideoFrame = stGotVFrame[0];
                             }
                         }
-                        currentTimeMillis = Platform.currentTimeMillis();
-                        if( null != nextFrame ) {
-                            presentedFrameCount++;
-                            final int video_pts = nextFrame.getPTS();
-                            if( video_pts == TimeFrameI.END_OF_STREAM_PTS ) {
-                                pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
-                            } else if( video_pts != TimeFrameI.INVALID_PTS ) {
+                        final long currentTimeMillis = Platform.currentTimeMillis();
+
+                        if( TimeFrameI.END_OF_STREAM_PTS == video_pts ||
+                            duration <= video_pts || maxNullFrameCountUntilEOS <= nullFrameCount )
+                        {
+                            // EOS
+                            if( DEBUG ) {
+                                System.err.println( "AV-EOS (getNextTexture): EOS_PTS "+(TimeFrameI.END_OF_STREAM_PTS == video_pts)+", "+this);
+                            }
+                            pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
+
+                        } else if( TimeFrameI.INVALID_PTS == video_pts ) { // no audio or video frame
+                            if( null == videoFramesDecoded || !videoFramesDecoded.isEmpty() ) {
+                                nullFrameCount++;
+                            }
+                            if( DEBUG ) {
+                                final int audio_pts = getAudioPTSImpl();
+                                final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
+                                final int d_apts;
+                                if( audio_pts != TimeFrameI.INVALID_PTS ) {
+                                    d_apts = audio_pts - audio_scr;
+                                } else {
+                                    d_apts = 0;
+                                }
+                                final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed );
+                                final int d_vpts = video_pts - video_scr;
+                                System.err.println( "AV~: dT "+(currentTimeMillis-lastTimeMillis)+", nullFrames "+nullFrameCount+
+                                        getPerfStringImpl( video_scr, video_pts, d_vpts, audio_scr, audio_pts, d_apts, 0 ) + ", droppedFrame "+droppedFrame);
+                            }
+                        } else { // valid pts: has audio or video frame
+                            nullFrameCount=0;
+
+                            if( hasVideoFrame ) { // has video frame
+                                presentedFrameCount++;
+
                                 final int audio_pts = getAudioPTSImpl();
                                 final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
                                 final int d_apts;
@@ -840,29 +901,16 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                                                    ", avg dpy-fps "+avg_dpy_duration+" ms/f, maxD "+maxVideoDelay+" ms, "+_nextFrame+", playCached " + playCached + ", dropFrame "+dropFrame);
                                     }
                                 }
-                            } else if( DEBUG ) {
-                                System.err.println("Invalid PTS: "+nextFrame);
-                            }
-                            if( null != nextFrame && null != videoFramesFree ) {
-                                // Had frame and not single threaded ? (TEXTURE_COUNT_MIN < textureCount)
-                                final TextureFrame _lastFrame = lastFrame;
-                                lastFrame = nextFrame;
+                            } // has video frame
+                        } // has audio or video frame
+
+                        if( null != videoFramesFree && null != nextFrame ) {
+                            // Had frame and not single threaded ? (TEXTURE_COUNT_MIN < textureCount)
+                            final TextureFrame _lastFrame = lastFrame;
+                            lastFrame = nextFrame;
+                            if( null != _lastFrame ) {
                                 videoFramesFree.putBlocking(_lastFrame);
                             }
-                        } else if( DEBUG ) {
-                            final int video_pts = lastFrame.getPTS();
-                            final int audio_pts = getAudioPTSImpl();
-                            final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
-                            final int d_apts;
-                            if( audio_pts != TimeFrameI.INVALID_PTS ) {
-                                d_apts = audio_pts - audio_scr;
-                            } else {
-                                d_apts = 0;
-                            }
-                            final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed );
-                            final int d_vpts = video_pts - video_scr;
-                            System.err.println( "AV~: dT "+(currentTimeMillis-lastTimeMillis)+", "+
-                                    getPerfStringImpl( video_scr, video_pts, d_vpts, audio_scr, audio_pts, d_apts, 0 ) + ", droppedFrame "+droppedFrame);
                         }
                         lastTimeMillis = currentTimeMillis;
                     } while( dropFrame );
@@ -899,24 +947,24 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      */
     protected abstract int getNextTextureImpl(GL gl, TextureFrame nextFrame);
 
-    protected final TextureFrame getNextSingleThreaded(final GL gl, final TextureFrame nextFrame) throws InterruptedException {
+    protected final int getNextSingleThreaded(final GL gl, final TextureFrame nextFrame, boolean[] gotVFrame) throws InterruptedException {
+        final int pts;
         if( STREAM_ID_NONE != vid ) {
             preNextTextureImpl(gl);
-            final int vPTS = getNextTextureImpl(gl, nextFrame);
+            pts = getNextTextureImpl(gl, nextFrame);
             postNextTextureImpl(gl);
-            if( TimeFrameI.INVALID_PTS != vPTS ) {
+            if( TimeFrameI.INVALID_PTS != pts ) {
                 newFrameAvailable(nextFrame, Platform.currentTimeMillis());
-                return nextFrame;
+                gotVFrame[0] = true;
+            } else {
+                gotVFrame[0] = false;
             }
         } else {
             // audio only
-            final int vPTS = getNextTextureImpl(null, null);
-            if( TimeFrameI.INVALID_PTS != vPTS && TimeFrameI.END_OF_STREAM_PTS == vPTS ) {
-                // state transition incl. notification
-                pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
-            }
+            pts = getNextTextureImpl(null, null);
+            gotVFrame[0] = false;
         }
-        return null;
+        return pts;
     }
 
 
@@ -964,6 +1012,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
     private void resetAVPTS() {
+        nullFrameCount = 0;
         presentedFrameCount = 0;
         displayedFrameCount = 0;
         decodedFrameCount = 0;
@@ -986,6 +1035,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
 
+    /**
+     * After {@link GLMediaPlayerImpl#initStreamImpl(int, int) initStreamImpl(..)} is completed via
+     * {@link GLMediaPlayerImpl#updateAttributes(int, int, int, int, int, int, int, float, int, int, int, String, String) updateAttributes(..)},
+     * the latter decides whether StreamWorker is being used.
+     */
     class StreamWorker extends Thread {
         private volatile boolean isRunning = false;
         private volatile boolean isActive = false;
@@ -1000,14 +1054,23 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
         /**
          * Starts this daemon thread,
-         * which initializes the stream first via {@link GLMediaPlayerImpl#initStreamImpl(int, int)} first.
          * <p>
-         * After stream initialization, this thread pauses!
+         * This thread pauses after it's started!
          * </p>
          **/
         StreamWorker() {
             setDaemon(true);
-            start();
+            synchronized(this) {
+                start();
+                while( !isRunning ) {
+                    this.notifyAll();  // wake-up startup-block
+                    try {
+                        this.wait();  // wait until started
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
         }
 
         private void makeCurrent(GLContext ctx) {
@@ -1113,17 +1176,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
             synchronized ( this ) {
                 isRunning = true;
-                try {
-                    isBlocked = true;
-                    initStreamImpl(vid, aid);
-                    isBlocked = false;
-                } catch (Throwable t) {
-                    streamErr = new StreamException(t.getClass().getSimpleName()+" while initializing: "+GLMediaPlayerImpl.this.toString(), t);
-                    isBlocked = false;
-                    isRunning = false;
-                    changeState(GLMediaEventListener.EVENT_CHANGE_ERR, GLMediaPlayer.State.Uninitialized);
-                    return; // end of thread!
-                } // also initializes width, height, .. etc
+                this.notifyAll(); // wake-up ctor()
             }
 
             while( !shallStop ){
@@ -1179,6 +1232,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         }
                         isBlocked = false;
                         final int vPTS = getNextTextureImpl(gl, nextFrame);
+                        boolean audioEOS = false;
                         if( TimeFrameI.INVALID_PTS != vPTS ) {
                             if( null != nextFrame ) {
                                 if( STREAM_WORKER_DELAY > 0 ) {
@@ -1191,16 +1245,30 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 nextFrame = null;
                             } else {
                                 // audio only
-                                if( TimeFrameI.END_OF_STREAM_PTS == vPTS ) {
-                                    // state transition incl. notification
-                                    synchronized ( this ) {
-                                        shallPause = true;
-                                        isActive = false;
-                                        this.notifyAll(); // wake-up potential do*()
-                                    }
-                                    pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
+                                if( TimeFrameI.END_OF_STREAM_PTS == vPTS || duration < vPTS ) {
+                                    audioEOS = true;
+                                } else {
+                                    nullFrameCount = 0;
                                 }
                             }
+                        } else if( null == nextFrame ) {
+                            // audio only
+                            audioEOS = maxNullFrameCountUntilEOS <= nullFrameCount;
+                            if( null == audioSink || 0 == audioSink.getEnqueuedFrameCount() ) {
+                                nullFrameCount++;
+                            }
+                        }
+                        if( audioEOS ) {
+                            // state transition incl. notification
+                            synchronized ( this ) {
+                                shallPause = true;
+                                isActive = false;
+                                this.notifyAll(); // wake-up potential do*()
+                            }
+                            if( DEBUG ) {
+                                System.err.println( "AV-EOS (StreamWorker): EOS_PTS "+(TimeFrameI.END_OF_STREAM_PTS == vPTS)+", "+GLMediaPlayerImpl.this);
+                            }
+                            pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
                         }
                     } catch (InterruptedException e) {
                         isBlocked = false;
@@ -1242,7 +1310,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
     static int StreamWorkerInstanceId = 0;
-    private StreamWorker streamWorker = null;
+    private volatile StreamWorker streamWorker = null;
     private volatile StreamException streamErr = null;
 
     protected final int addStateEventMask(int event_mask, State newState) {
@@ -1288,7 +1356,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                           int bps_video, int bps_audio, float fps,
                                           int videoFrames, int audioFrames, int duration, String vcodec, String acodec) {
         int event_mask = 0;
-        if( state == State.Uninitialized ) {
+        final boolean wasUninitialized = state == State.Uninitialized;
+
+        if( wasUninitialized ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_INIT;
             state = State.Initialized;
         }
@@ -1314,7 +1384,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         if( this.fps != fps ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_FPS;
             this.fps = fps;
-            this.frame_duration = 1000f / fps;
+            if( 0 != fps ) {
+                this.frame_duration = 1000f / fps;
+                this.maxNullFrameCountUntilEOS = MAX_FRAMELESS_MS_UNTIL_EOS / (int)this.frame_duration;
+            } else {
+                this.frame_duration = 0;
+                this.maxNullFrameCountUntilEOS = MAX_FRAMELESS_UNTIL_EOS_DEFAULT;
+            }
         }
         if( this.bps_stream != bps_stream || this.bps_video != bps_video || this.bps_audio != bps_audio ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_BPS;
@@ -1339,6 +1415,17 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         if(0==event_mask) {
             return;
         }
+        if( wasUninitialized ) {
+            if( null != streamWorker ) {
+                throw new InternalError("XXX: StreamWorker not null - "+this);
+            }
+            if( TEXTURE_COUNT_MIN < textureCount || STREAM_ID_NONE == vid ) { // Enable StreamWorker for 'audio only' as well (Bug 918).
+                streamWorker = new StreamWorker();
+            }
+            if( DEBUG ) {
+                System.err.println("XXX Initialize @ updateAttributes: "+this);
+            }
+        }
         attributesUpdated(event_mask);
     }
 
@@ -1434,9 +1521,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
         final int video_scr = video_scr_pts + (int) ( ( Platform.currentTimeMillis() - video_scr_t0 ) * playSpeed );
         final String camPath = null != cameraPath ? ", camera: "+cameraPath : "";
-        return "GLMediaPlayer["+state+", vSCR "+video_scr+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
-               "speed "+playSpeed+", "+bps_stream+" bps, "+
-               "Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", tagt "+toHexString(textureTarget)+", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+
+        return "GLMediaPlayer["+state+", vSCR "+video_scr+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s), z "+nullFrameCount+" / "+maxNullFrameCountUntilEOS+"], "+
+               "speed "+playSpeed+", "+bps_stream+" bps, hasSW "+(null!=streamWorker)+
+               ", Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", tagt "+toHexString(textureTarget)+", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+
                "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", glOrient "+isInGLOrientation+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
                "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]";
     }
@@ -1470,7 +1557,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             freeVideoFrames = 0;
             decVideoFrames = 0;
         }
-        return state+", frames[(p "+presentedFrameCount+", d "+decodedFrameCount+") / "+videoFrames+", "+tt+" s], "+
+        return state+", frames[(p "+presentedFrameCount+", d "+decodedFrameCount+") / "+videoFrames+", "+tt+" s, z "+nullFrameCount+" / "+maxNullFrameCountUntilEOS+"], "+
                "speed " + playSpeed+", dAV "+( d_vpts - d_apts )+", vSCR "+video_scr+", vpts "+video_pts+", dSCR["+d_vpts+", avrg "+video_dpts_avg_diff+"], "+
                "aSCR "+audio_scr+", apts "+audio_pts+" ( "+d_apts+" ), "+audioSinkInfo+
                ", Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+"]";
diff --git a/src/jogl/native/libav/ffmpeg_impl_template.c b/src/jogl/native/libav/ffmpeg_impl_template.c
index b46586acc..44acfe46a 100644
--- a/src/jogl/native/libav/ffmpeg_impl_template.c
+++ b/src/jogl/native/libav/ffmpeg_impl_template.c
@@ -1144,6 +1144,11 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
     pkt_odata = packet.data;
     pkt_osize = packet.size;
     if( AVERROR_EOF == avRes || ( pAV->pFormatCtx->pb && pAV->pFormatCtx->pb->eof_reached ) ) {
+        if( pAV->verbose ) {
+            fprintf(stderr, "EOS: avRes[res %d, eos %d], pb-EOS %d\n", 
+                avRes, AVERROR_EOF == avRes, 
+                ( pAV->pFormatCtx->pb && pAV->pFormatCtx->pb->eof_reached ) );
+        }
         resPTS = END_OF_STREAM_PTS;
     } else if( 0 <= avRes ) {
         if( pAV->verbose ) {
@@ -1475,15 +1480,16 @@ JNIEXPORT jint JNICALL FF_FUNC(seek0)
   (JNIEnv *env, jobject instance, jlong ptr, jint pos1)
 {
     const FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)((void *)((intptr_t)ptr));
-    const int64_t pos0 = pAV->vPTS;
-    int64_t pts0;
+    int64_t pos0, pts0;
     int streamID;
     AVRational time_base;
     if( pAV->vid >= 0 ) {
+        pos0 = pAV->vPTS;
         streamID = pAV->vid;
         time_base = pAV->pVStream->time_base;
         pts0 = pAV->pVFrame->pkt_pts;
     } else if( pAV->aid >= 0 ) {
+        pos0 = pAV->aPTS;
         streamID = pAV->aid;
         time_base = pAV->pAStream->time_base;
         pts0 = pAV->pAFrames[pAV->aFrameCurrent]->pkt_pts;
@@ -1493,16 +1499,16 @@ JNIEXPORT jint JNICALL FF_FUNC(seek0)
     int64_t pts1 = (int64_t) (pos1 * (int64_t) time_base.den)
                            / (1000 * (int64_t) time_base.num);
     if(pAV->verbose) {
-        fprintf(stderr, "SEEK: vid %d, aid %d, pos1 %d, pts: %"PRId64" -> %"PRId64"\n", pAV->vid, pAV->aid, pos1, pts0, pts1);
+        fprintf(stderr, "SEEK: vid %d, aid %d, pos0 %d, pos1 %d, pts: %"PRId64" -> %"PRId64"\n", pAV->vid, pAV->aid, pos0, pos1, pts0, pts1);
     }
     int flags = 0;
     if(pos1 < pos0) {
         flags |= AVSEEK_FLAG_BACKWARD;
     }
-    int res;
+    int res = -2;
     if(HAS_FUNC(sp_av_seek_frame)) {
         if(pAV->verbose) {
-            fprintf(stderr, "SEEK.0: pre  : s %"PRId64" / %"PRId64" -> t %d / %"PRId64"\n", pos0, pts0, pos1, pts1);
+            fprintf(stderr, "SEEK.0: pre  : s %d / %"PRId64" -> t %d / %"PRId64"\n", pos0, pts0, pos1, pts1);
         }
         sp_av_seek_frame(pAV->pFormatCtx, streamID, pts1, flags);
     } else if(HAS_FUNC(sp_avformat_seek_file)) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index 8f27e19c4..c1ccf7c39 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -153,7 +153,7 @@ public class MovieCube implements GLEventListener {
                 return;
             }
             System.err.println("MC "+e);
-            int pts0 = mPlayer.getVideoPTS();
+            final int pts0 = GLMediaPlayer.STREAM_ID_NONE != mPlayer.getVID() ? mPlayer.getVideoPTS() : mPlayer.getAudioPTS();
             int pts1 = 0;
             switch(e.getKeyCode()) {
                 case KeyEvent.VK_RIGHT:      pts1 = pts0 +  1000; break;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 1a9914bb7..ddf5c709c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -150,7 +150,8 @@ public class MovieSimple implements GLEventListener {
 
             if(y>winHeight/2) {
                 final float dp  = (float)(x-prevMouseX)/(float)winWidth;
-                mPlayer.seek(mPlayer.getVideoPTS() + (int) (mPlayer.getDuration() * dp));
+                final int pts0 = GLMediaPlayer.STREAM_ID_NONE != mPlayer.getVID() ? mPlayer.getVideoPTS() : mPlayer.getAudioPTS();
+                mPlayer.seek(pts0 + (int) (mPlayer.getDuration() * dp));
             } else {
                 mPlayer.play();
                 rotate = 1;
@@ -174,7 +175,7 @@ public class MovieSimple implements GLEventListener {
                 return;
             }
             System.err.println("MC "+e);
-            int pts0 = mPlayer.getVideoPTS();
+            final int pts0 = GLMediaPlayer.STREAM_ID_NONE != mPlayer.getVID() ? mPlayer.getVideoPTS() : mPlayer.getAudioPTS();
             int pts1 = 0;
             switch(e.getKeyCode()) {
                 case KeyEvent.VK_RIGHT:      pts1 = pts0 +  1000; break;
@@ -372,9 +373,7 @@ public class MovieSimple implements GLEventListener {
         if( GLMediaPlayer.State.Uninitialized == mPlayer.getState() ) {
             throw new IllegalStateException("mPlayer in uninitialized state: "+mPlayer);
         }
-        if( GLMediaPlayer.STREAM_ID_NONE == mPlayer.getVID() ) {
-            throw new IllegalStateException("mPlayer has no VID/stream selected: "+mPlayer);
-        }
+        final boolean hasVideo = GLMediaPlayer.STREAM_ID_NONE != mPlayer.getVID();
         resetGLState = false;
 
         zoom0 =  orthoProjection ? 0f : -2.5f;
@@ -397,10 +396,20 @@ public class MovieSimple implements GLEventListener {
             }
             System.out.println("p1 "+mPlayer+", shared "+mPlayerShared);
             final TextureFrame frame = mPlayer.getLastTexture();
-            if( null == frame ) {
-                throw new InternalError("XXX: "+mPlayer);
+            if( null != frame ) {
+                if( !hasVideo ) {
+                    throw new InternalError("XXX: "+mPlayer);
+                }
+                tex = frame.getTexture();
+                if( null == tex ) {
+                    throw new InternalError("XXX: "+mPlayer);
+                }
+            } else {
+                tex = null;
+                if( hasVideo ) {
+                    throw new InternalError("XXX: "+mPlayer);
+                }
             }
-            tex = mPlayer.getLastTexture().getTexture();
             if(!mPlayerShared) {
                 mPlayer.setTextureMinMagFilter( new int[] { GL.GL_NEAREST, GL.GL_LINEAR } );
             }
@@ -413,74 +422,76 @@ public class MovieSimple implements GLEventListener {
             throw new GLException(glex);
         }
 
-        initShader(gl);
+        if( hasVideo ) {
+            initShader(gl);
 
-        // Push the 1st uniform down the path
-        st.useProgram(gl, true);
+            // Push the 1st uniform down the path
+            st.useProgram(gl, true);
 
-        int[] viewPort = new int[] { 0, 0, drawable.getWidth(), drawable.getHeight()};
-        pmvMatrix = new PMVMatrix();
-        reshapePMV(viewPort[2], viewPort[3]);
-        pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
-        if(!st.uniform(gl, pmvMatrixUniform)) {
-            throw new GLException("Error setting PMVMatrix in shader: "+st);
-        }
-        if(!st.uniform(gl, new GLUniformData("mgl_ActiveTexture", mPlayer.getTextureUnit()))) {
-            throw new GLException("Error setting mgl_ActiveTexture in shader: "+st);
-        }
+            int[] viewPort = new int[] { 0, 0, drawable.getWidth(), drawable.getHeight()};
+            pmvMatrix = new PMVMatrix();
+            reshapePMV(viewPort[2], viewPort[3]);
+            pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
+            if(!st.uniform(gl, pmvMatrixUniform)) {
+                throw new GLException("Error setting PMVMatrix in shader: "+st);
+            }
+            if(!st.uniform(gl, new GLUniformData("mgl_ActiveTexture", mPlayer.getTextureUnit()))) {
+                throw new GLException("Error setting mgl_ActiveTexture in shader: "+st);
+            }
 
-        float dWidth = drawable.getWidth();
-        float dHeight = drawable.getHeight();
-        float mWidth = mPlayer.getWidth();
-        float mHeight = mPlayer.getHeight();
-        float mAspect = mWidth/mHeight;
-        System.err.println("XXX0: mov aspect: "+mAspect);
-        float xs, ys;
-        if(orthoProjection) {
-            if(mPlayerScaleOrig && mWidth < dWidth && mHeight < dHeight) {
-                xs   = mWidth/2f;                ys   = xs / mAspect;
+            float dWidth = drawable.getWidth();
+            float dHeight = drawable.getHeight();
+            float mWidth = mPlayer.getWidth();
+            float mHeight = mPlayer.getHeight();
+            float mAspect = mWidth/mHeight;
+            System.err.println("XXX0: mov aspect: "+mAspect);
+            float xs, ys;
+            if(orthoProjection) {
+                if(mPlayerScaleOrig && mWidth < dWidth && mHeight < dHeight) {
+                    xs   = mWidth/2f;                ys   = xs / mAspect;
+                } else {
+                    xs   = dWidth/2f;                ys   = xs / mAspect; // w>h
+                }
             } else {
-                xs   = dWidth/2f;                ys   = xs / mAspect; // w>h
+                if(mPlayerScaleOrig && mWidth < dWidth && mHeight < dHeight) {
+                    xs   = mAspect * ( mWidth / dWidth ) ; ys   =  xs / mAspect ;
+                } else {
+                    xs   = mAspect; ys   = 1f; // b>h
+                }
             }
-        } else {
-            if(mPlayerScaleOrig && mWidth < dWidth && mHeight < dHeight) {
-                xs   = mAspect * ( mWidth / dWidth ) ; ys   =  xs / mAspect ;
-            } else {
-                xs   = mAspect; ys   = 1f; // b>h
+            verts = new float[] { -1f*xs, -1f*ys, 0f, // LB
+                                   1f*xs,  1f*ys, 0f  // RT
+                                };
+            {
+                System.err.println("XXX0: pixel  LB: "+verts[0]+", "+verts[1]+", "+verts[2]);
+                System.err.println("XXX0: pixel  RT: "+verts[3]+", "+verts[4]+", "+verts[5]);
+                float[] winLB = new float[3];
+                float[] winRT = new float[3];
+                pmvMatrix.gluProject(verts[0], verts[1], verts[2], viewPort, 0, winLB, 0);
+                pmvMatrix.gluProject(verts[3], verts[4], verts[5], viewPort, 0, winRT, 0);
+                System.err.println("XXX0: win   LB: "+winLB[0]+", "+winLB[1]+", "+winLB[2]);
+                System.err.println("XXX0: win   RT: "+winRT[0]+", "+winRT[1]+", "+winRT[2]);
             }
-        }
-        verts = new float[] { -1f*xs, -1f*ys, 0f, // LB
-                               1f*xs,  1f*ys, 0f  // RT
-                            };
-        {
-            System.err.println("XXX0: pixel  LB: "+verts[0]+", "+verts[1]+", "+verts[2]);
-            System.err.println("XXX0: pixel  RT: "+verts[3]+", "+verts[4]+", "+verts[5]);
-            float[] winLB = new float[3];
-            float[] winRT = new float[3];
-            pmvMatrix.gluProject(verts[0], verts[1], verts[2], viewPort, 0, winLB, 0);
-            pmvMatrix.gluProject(verts[3], verts[4], verts[5], viewPort, 0, winRT, 0);
-            System.err.println("XXX0: win   LB: "+winLB[0]+", "+winLB[1]+", "+winLB[2]);
-            System.err.println("XXX0: win   RT: "+winRT[0]+", "+winRT[1]+", "+winRT[2]);
-        }
 
-        interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
-        {
-            interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);
-            interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);
-            interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
-        }
-        updateInterleavedVBO(gl, tex);
+            interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
+            {
+                interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);
+                interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);
+                interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
+            }
+            updateInterleavedVBO(gl, tex);
 
-        st.ownAttribute(interleavedVBO, true);
-        gl.glClearColor(0.3f, 0.3f, 0.3f, 0.3f);
+            st.ownAttribute(interleavedVBO, true);
+            gl.glClearColor(0.3f, 0.3f, 0.3f, 0.3f);
 
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+            gl.glEnable(GL2ES2.GL_DEPTH_TEST);
 
-        st.useProgram(gl, false);
+            st.useProgram(gl, false);
 
-        // Let's show the completed shader state ..
-        System.out.println("iVBO: "+interleavedVBO);
-        System.out.println(st);
+            // Let's show the completed shader state ..
+            System.out.println("iVBO: "+interleavedVBO);
+            System.out.println(st);
+        }
 
         if(!mPlayerShared) {
             mPlayer.play();
@@ -697,6 +708,7 @@ public class MovieSimple implements GLEventListener {
         int textureCount = 3; // default - threaded
         boolean ortho = true;
         boolean zoom = false;
+        boolean _loopEOS = false;
 
         boolean forceES2 = false;
         boolean forceES3 = false;
@@ -742,6 +754,8 @@ public class MovieSimple implements GLEventListener {
                     ortho=false;
                 } else if(args[i].equals("-zoom")) {
                     zoom=true;
+                } else if(args[i].equals("-loop")) {
+                    _loopEOS=true;
                 } else if(args[i].equals("-url")) {
                     i++;
                     url_s = args[i];
@@ -757,6 +771,7 @@ public class MovieSimple implements GLEventListener {
             }
             origSize = _origSize;
         }
+        final boolean loopEOS = _loopEOS;
         final URI streamLoc;
         if( null != url_s ) {
             streamLoc = new URI(url_s);
@@ -827,6 +842,7 @@ public class MovieSimple implements GLEventListener {
                     System.err.println("MovieSimple AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
                     System.err.println("MovieSimple State: "+mp);
                     if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
+                        System.err.println("MovieSimple State: CHANGE_SIZE");
                         if( origSize ) {
                             window.setSize(mp.getWidth(), mp.getHeight());
                         }
@@ -834,11 +850,14 @@ public class MovieSimple implements GLEventListener {
                         ms.resetGLState();
                     }
                     if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
-                        if( GLMediaPlayer.STREAM_ID_NONE != ms.mPlayer.getVID() ) {
-                            window.addGLEventListener(ms);
-                            anim.setUpdateFPSFrames(60, System.err);
-                            anim.resetFPSCounter();
-                        } else {
+                        System.err.println("MovieSimple State: INIT");
+                        // Use GLEventListener in all cases [A+V, V, A]
+                        window.addGLEventListener(ms);
+                        anim.setUpdateFPSFrames(60, System.err);
+                        anim.resetFPSCounter();
+                        /**
+                         * Kick off player w/o GLEventListener, i.e. for audio only.
+                         *
                             try {
                                 ms.mPlayer.initGL(null);
                             } catch (Exception e) {
@@ -848,12 +867,38 @@ public class MovieSimple implements GLEventListener {
                             }
                             ms.mPlayer.play();
                             System.out.println("play.1 "+ms.mPlayer);
+                        */
+                    }
+                    boolean destroy = false;
+                    Throwable err = null;
+
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_EOS & event_mask ) ) {
+                        err = ms.mPlayer.getStreamException();
+                        if( null != err ) {
+                            System.err.println("MovieSimple State: EOS + Exception");
+                            destroy = true;
+                        } else {
+                            System.err.println("MovieSimple State: EOS");
+                            if( loopEOS ) {
+                                ms.mPlayer.seek(0);
+                                ms.mPlayer.play();
+                            } else {
+                                destroy = true;
+                            }
+                        }
+                    }
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_ERR & event_mask ) ) {
+                        err = ms.mPlayer.getStreamException();
+                        if( null != err ) {
+                            System.err.println("MovieSimple State: ERR + Exception");
+                        } else {
+                            System.err.println("MovieSimple State: ERR");
                         }
+                        destroy = true;
                     }
-                    if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
-                        final StreamException se = ms.mPlayer.getStreamException();
-                        if( null != se ) {
-                            se.printStackTrace();
+                    if( destroy ) {
+                        if( null != err ) {
+                            err.printStackTrace();
                         }
                         destroyWindow();
                     }
-- 
cgit v1.2.3


From a0b23035bf9de987f5ad1b00fe3630c102f4e513 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Wed, 11 Dec 2013 21:09:59 +0100
Subject: Bug 918: Fix EOS Regression: Only use pts>duration for EOS if
 duration > 0 (camera or other sources may not have duration)

Regression of commit 8a8ed735f6631b2da7bf605c5c3dda4e0fc13905
---
 src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java         | 4 ++--
 .../com/jogamp/opengl/test/android/MovieCubeActivityLauncher0.java    | 2 +-
 .../com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index e6a0012d3..0de308cd1 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -816,7 +816,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         final long currentTimeMillis = Platform.currentTimeMillis();
 
                         if( TimeFrameI.END_OF_STREAM_PTS == video_pts ||
-                            duration <= video_pts || maxNullFrameCountUntilEOS <= nullFrameCount )
+                            ( duration > 0 && duration <= video_pts ) || maxNullFrameCountUntilEOS <= nullFrameCount )
                         {
                             // EOS
                             if( DEBUG ) {
@@ -1245,7 +1245,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                                 nextFrame = null;
                             } else {
                                 // audio only
-                                if( TimeFrameI.END_OF_STREAM_PTS == vPTS || duration < vPTS ) {
+                                if( TimeFrameI.END_OF_STREAM_PTS == vPTS || ( duration > 0 && duration < vPTS ) ) {
                                     audioEOS = true;
                                 } else {
                                     nullFrameCount = 0;
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0.java
index fb7faf90b..1e0d6067f 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0.java
@@ -58,7 +58,7 @@ public class MovieCubeActivityLauncher0 extends LauncherUtil.BaseActivityLaunche
        // props.setProperty("jogl.debug.GLProfile", "true");
        // props.setProperty("jogl.debug.GLDrawable", "true");
        // props.setProperty("jogl.debug.GLContext", "true");
-       // props.setProperty("jogl.debug.GLMediaPlayer", "true");
+       props.setProperty("jogl.debug.GLMediaPlayer", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
        // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // props.setProperty("jogl.debug.GLSLState", "true");
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
index 79b8b210d..c4eea084a 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
@@ -57,7 +57,7 @@ public class MovieCubeActivityLauncher1a extends LauncherUtil.BaseActivityLaunch
        // props.setProperty("jogl.debug.GLProfile", "true");
        // props.setProperty("jogl.debug.GLDrawable", "true");
        // props.setProperty("jogl.debug.GLContext", "true");
-       // props.setProperty("jogl.debug.GLMediaPlayer", "true");
+       props.setProperty("jogl.debug.GLMediaPlayer", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
        // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // props.setProperty("jogl.debug.GLSLState", "true");
-- 
cgit v1.2.3


From 8a032a2c1f247819bdb08382fbebcc4cd896b3f2 Mon Sep 17 00:00:00 2001
From: Xerxes Rånby <xerxes@zafena.se>
Date: Wed, 18 Dec 2013 17:54:45 +0100
Subject: ALAudioSink GLMediaPlayerImpl FFMPEGMediaPlayer: Verbosity only w/
 DEBUG flag.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Xerxes Rånby <xerxes@zafena.se>
---
 src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java          | 2 +-
 src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java      | 6 ++++--
 src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java | 2 ++
 3 files changed, 7 insertions(+), 3 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
index 1229eb7b8..8b12f8a28 100644
--- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
@@ -487,7 +487,7 @@ public class ALAudioSink implements AudioSink {
                     // clip wait at [2 .. 100] ms
                     final int avgBufferDura = chosenFormat.getBytesDuration( alBufferBytesQueued / alFramesPlaying.size() );
                     final int sleep = Math.max(2, Math.min(100, releaseBufferLimes * avgBufferDura));
-                    if( DEBUG || true ) {
+                    if( DEBUG ) {
                         System.err.println(getThreadName()+": ALAudioSink: Dequeue.wait["+i+"]: avgBufferDura "+avgBufferDura+", releaseBufferLimes "+releaseBufferLimes+", sleep "+sleep+" ms, playImpl "+(AL.AL_PLAYING == getSourceState())+", processed "+val[0]+", "+this);
                     }
                     unlockContext();
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 0de308cd1..0bd1aa932 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -757,7 +757,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     }
                     texFrames[i] = null;
                 }
-                System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null");
+                if( DEBUG ) {
+                    System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null");
+                }
             }
         }
     }
@@ -1609,4 +1611,4 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
         return 0;
     }
-}
\ No newline at end of file
+}
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 034b9457e..20e80c9f2 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -185,6 +185,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             final boolean avResampleLoaded = FFMPEGDynamicLibraryBundleInfo.avResampleLoaded();
             final VersionNumber swResampleVersion = FFMPEGDynamicLibraryBundleInfo.swResampleVersion;
             final boolean swResampleLoaded = FFMPEGDynamicLibraryBundleInfo.swResampleLoaded();
+            if( DEBUG ) {
             System.err.println("LIB_AV Codec   : "+avCodecVersion+" [cc "+avCodecMajorVersionCC+"]");
             System.err.println("LIB_AV Format  : "+avFormatVersion+" [cc "+avFormatMajorVersionCC+"]");
             System.err.println("LIB_AV Util    : "+avUtilVersion+" [cc "+avUtilMajorVersionCC+"]");
@@ -192,6 +193,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("LIB_SW Resample: "+swResampleVersion+" [cc "+swResampleMajorVersionCC+", loaded "+swResampleLoaded+"]");
             System.err.println("LIB_AV Device  : [loaded "+FFMPEGDynamicLibraryBundleInfo.avDeviceLoaded()+"]");
             System.err.println("LIB_AV Class   : "+(null!= natives ? natives.getClass().getSimpleName() : "n/a"));
+            }
             libAVVersionGood = avCodecMajorVersionCC  == avCodecVersion.getMajor() &&
                                avFormatMajorVersionCC == avFormatVersion.getMajor() &&
                                avUtilMajorVersionCC   == avUtilVersion.getMajor() &&
-- 
cgit v1.2.3


From 323476249dd94e605b6627582ad0dbcaede0159e Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sun, 26 Jan 2014 03:00:36 +0100
Subject: GLMediaPlayer: Add user attached objects, similar to GLContext -
 Allowing GLMediaEventListener impl. to access GLMediaPlayer associated
 objects

---
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java     | 20 +++++++++++++++++++-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java     | 19 +++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)

(limited to 'src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java')

diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 22a5cfb32..9957f2093 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -391,7 +391,7 @@ public interface GLMediaPlayer extends TextureSequence {
     public AudioSink getAudioSink();
 
     /**
-     * Releases the GL and stream resources.
+     * Releases the GL, stream and other resources, including {@link #attachObject(String, Object) attached user objects}.
      * <p>
      * <a href="#lifecycle">Lifecycle</a>: <code>ANY</code> -> {@link State#Uninitialized}
      * </p>
@@ -626,4 +626,22 @@ public interface GLMediaPlayer extends TextureSequence {
 
     /** Return all {@link GLMediaEventListener} of this player. */
     public GLMediaEventListener[] getEventListeners();
+
+    /**
+     * Returns the attached user object for the given name.
+     */
+    public Object getAttachedObject(String name);
+
+    /**
+     * Attaches the user object for the given name.
+     * Returns the previously set object, may be null.
+     */
+    public Object attachObject(String name, Object obj);
+
+    /**
+     * Detaches the user object for the given name.
+     * Returns the previously set object, may be null.
+     */
+    public Object detachObject(String name);
+
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 0bd1aa932..7cea51dc8 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -30,6 +30,7 @@ package jogamp.opengl.util.av;
 import java.io.IOException;
 import java.net.URI;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -374,6 +375,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             removeAllTextureFrames(gl);
             textureCount=0;
             changeState(event_mask, State.Uninitialized);
+            attachedObjects.clear();
             return state;
         }
     }
@@ -1594,6 +1596,23 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
     private final Object eventListenersLock = new Object();
 
+    @Override
+    public final Object getAttachedObject(String name) {
+        return attachedObjects.get(name);
+    }
+
+    @Override
+    public final Object attachObject(String name, Object obj) {
+        return attachedObjects.put(name, obj);
+    }
+
+    @Override
+    public final Object detachObject(String name) {
+        return attachedObjects.remove(name);
+    }
+
+    private final HashMap<String, Object> attachedObjects = new HashMap<String, Object>();
+
     protected static final String toHexString(long v) {
         return "0x"+Long.toHexString(v);
     }
-- 
cgit v1.2.3