From 556d92b63555a085b25e32b1cd55afce24edd07a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 3 Jul 2014 16:21:36 +0200 Subject: Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines --- .../jogamp/opengl/util/av/AudioSampleFormat.java | 2 +- .../jogamp/opengl/util/av/EGLMediaPlayerImpl.java | 14 +-- .../jogamp/opengl/util/av/GLMediaPlayerImpl.java | 117 +++++++++++---------- .../jogamp/opengl/util/av/JavaSoundAudioSink.java | 18 ++-- .../jogamp/opengl/util/av/NullAudioSink.java | 10 +- .../jogamp/opengl/util/av/NullGLMediaPlayer.java | 24 ++--- .../jogamp/opengl/util/av/VideoPixelFormat.java | 2 +- .../av/impl/FFMPEGDynamicLibraryBundleInfo.java | 14 +-- .../opengl/util/av/impl/FFMPEGMediaPlayer.java | 51 ++++----- .../jogamp/opengl/util/av/impl/FFMPEGNatives.java | 2 +- .../opengl/util/av/impl/FFMPEGStaticNatives.java | 2 +- .../opengl/util/av/impl/OMXGLMediaPlayer.java | 22 ++-- 12 files changed, 140 insertions(+), 138 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/util/av') diff --git a/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java b/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java index fdbcc9864..4c48b90e8 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java +++ b/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java @@ -54,7 +54,7 @@ public enum AudioSampleFormat { * * @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. SampleFormat.values().length-1 ] */ - public static AudioSampleFormat valueOf(int ordinal) throws IllegalArgumentException { + public static AudioSampleFormat valueOf(final int ordinal) throws IllegalArgumentException { final AudioSampleFormat[] all = AudioSampleFormat.values(); if( 0 <= ordinal && ordinal < all.length ) { return all[ordinal]; diff --git a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java index 25686a170..f9df9153f 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java +++ b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java @@ -50,14 +50,14 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl { public final int id; - TextureType(int id){ + TextureType(final int id){ this.id = id; } } public static class EGLTextureFrame extends TextureSequence.TextureFrame { - public EGLTextureFrame(Buffer clientBuffer, Texture t, long khrImage, long khrSync) { + public EGLTextureFrame(final Buffer clientBuffer, final Texture t, final long khrImage, final long khrSync) { super(t); this.clientBuffer = clientBuffer; this.image = khrImage; @@ -78,14 +78,14 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl { } - protected EGLMediaPlayerImpl(TextureType texType, boolean useKHRSync) { + protected EGLMediaPlayerImpl(final TextureType texType, final boolean useKHRSync) { super(); this.texType = texType; this.useKHRSync = useKHRSync; } @Override - protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) { + protected TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) { final Texture texture = super.createTexImageImpl(gl, texName, getWidth(), getHeight()); final Buffer clientBuffer; final long image; @@ -106,7 +106,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl { } if(TextureType.KHRImage == texType) { - IntBuffer nioTmp = Buffers.newDirectIntBuffer(1); + final IntBuffer nioTmp = Buffers.newDirectIntBuffer(1); // create EGLImage from texture clientBuffer = null; // FIXME nioTmp.put(0, EGL.EGL_NONE); @@ -122,7 +122,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl { } if(useKHRSync) { - IntBuffer tmp = Buffers.newDirectIntBuffer(1); + final IntBuffer tmp = Buffers.newDirectIntBuffer(1); // Create sync object so that we can be sure that gl has finished // rendering the EGLImage texture before we tell OpenMAX to fill // it with a new frame. @@ -138,7 +138,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl { } @Override - protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) { + protected void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame frame) { final boolean eglUsage = TextureType.KHRImage == texType || useKHRSync ; final EGLContext eglCtx; final EGLExt eglExt; diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java index 73b14b3d1..9cfa94a60 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java +++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java @@ -37,6 +37,7 @@ import java.util.Map; import javax.media.nativewindow.AbstractGraphicsDevice; import javax.media.opengl.GL; import javax.media.opengl.GL2; +import javax.media.opengl.GL2GL3; import javax.media.opengl.GLContext; import javax.media.opengl.GLDrawable; import javax.media.opengl.GLDrawableFactory; @@ -201,7 +202,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } @Override - public final void setTextureUnit(int u) { texUnit = u; } + public final void setTextureUnit(final int u) { texUnit = u; } @Override public final int getTextureUnit() { return texUnit; } @@ -216,20 +217,20 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { @Override public final int getTextureCount() { return textureCount; } - protected final void setTextureTarget(int target) { textureTarget=target; } - protected final void setTextureFormat(int internalFormat, int format) { + protected final void setTextureTarget(final int target) { textureTarget=target; } + protected final void setTextureFormat(final int internalFormat, final int format) { textureInternalFormat=internalFormat; textureFormat=format; } - protected final void setTextureType(int t) { textureType=t; } + protected final void setTextureType(final int t) { textureType=t; } @Override - public final void setTextureMinMagFilter(int[] minMagFilter) { texMinMagFilter[0] = minMagFilter[0]; texMinMagFilter[1] = minMagFilter[1];} + public final void setTextureMinMagFilter(final 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];} + public final void setTextureWrapST(final int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];} @Override public final int[] getTextureWrapST() { return texWrapST; } @@ -253,7 +254,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { checkGLInit(); switch(textureTarget) { case GL.GL_TEXTURE_2D: - case GL2.GL_TEXTURE_RECTANGLE: + case GL2GL3.GL_TEXTURE_RECTANGLE: return TextureSequence.sampler2D; case GLES2.GL_TEXTURE_EXTERNAL_OES: return TextureSequence.samplerExternalOES; @@ -269,7 +270,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { * if not overridden by specialization. */ @Override - public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException { + public String getTextureLookupFunctionName(final String desiredFuncName) throws IllegalStateException { checkGLInit(); return "texture2D"; } @@ -355,10 +356,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { protected abstract boolean playImpl(); @Override - public final State pause(boolean flush) { + public final State pause(final boolean flush) { return pauseImpl(flush, 0); } - private final State pauseImpl(boolean flush, int event_mask) { + private final State pauseImpl(final boolean flush, int event_mask) { synchronized( stateLock ) { final State preState = state; if( State.Playing == state ) { @@ -384,10 +385,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { protected abstract boolean pauseImpl(); @Override - public final State destroy(GL gl) { + public final State destroy(final GL gl) { return destroyImpl(gl, 0); } - private final State destroyImpl(GL gl, int event_mask) { + private final State destroyImpl(final GL gl, final int event_mask) { synchronized( stateLock ) { if( null != streamWorker ) { streamWorker.doStop(); @@ -475,7 +476,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { * at {@link AudioSink#enqueueData(com.jogamp.opengl.util.av.AudioSink.AudioFrame)}. *

*/ - protected boolean setPlaySpeedImpl(float rate) { + protected boolean setPlaySpeedImpl(final float rate) { if( null != audioSink ) { audioSinkPlaySpeedSet = audioSink.setPlaySpeed(rate); } @@ -521,7 +522,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { /** * Override if not using AudioSink, or AudioSink's {@link AudioSink#setVolume(float)} is not sufficient! */ - protected boolean setAudioVolumeImpl(float v) { + protected boolean setAudioVolumeImpl(final float v) { if( null != audioSink ) { return audioSink.setVolume(v); } @@ -530,7 +531,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } @Override - public final void initStream(URI streamLoc, final int vid, final int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException { + public final void initStream(final URI streamLoc, final int vid, final int aid, final int reqTextureCount) throws IllegalStateException, IllegalArgumentException { synchronized( stateLock ) { if(State.Uninitialized != state) { throw new IllegalStateException("Instance not in state unintialized: "+this); @@ -577,7 +578,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { try { // StreamWorker may be used, see API-doc of StreamWorker initStreamImpl(vid, aid); - } catch (Throwable t) { + } catch (final 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 @@ -612,7 +613,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } @Override - public final void initGL(GL gl) throws IllegalStateException, StreamException, GLException { + public final void initGL(final GL gl) throws IllegalStateException, StreamException, GLException { synchronized( stateLock ) { if(State.Initialized != state ) { throw new IllegalStateException("Stream not in state initialized: "+this); @@ -656,7 +657,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { lastFrame = null; } changeState(0, State.Paused); - } catch (Throwable t) { + } catch (final Throwable t) { destroyImpl(gl, GLMediaEventListener.EVENT_CHANGE_ERR); // -> GLMediaPlayer.State.Uninitialized throw new GLException("Error initializing GL resources", t); } @@ -683,11 +684,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { * Implementation must at least return a texture count of {@link #TEXTURE_COUNT_MIN}, two, the last texture and the decoding texture. *

*/ - protected int validateTextureCount(int desiredTextureCount) { + protected int validateTextureCount(final int desiredTextureCount) { return desiredTextureCount < TEXTURE_COUNT_MIN ? TEXTURE_COUNT_MIN : desiredTextureCount; } - protected TextureFrame[] createTexFrames(GL gl, final int count) { + protected TextureFrame[] createTexFrames(final GL gl, final int count) { final int[] texNames = new int[count]; gl.glGenTextures(count, texNames, 0); final int err = gl.glGetError(); @@ -702,7 +703,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) { + protected final Texture createTexImageImpl(final GL gl, final int texName, final int tWidth, final int tHeight) { if( 0 > texName ) { throw new RuntimeException("TextureName "+toHexString(texName)+" invalid."); } @@ -749,7 +750,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { tWidth, tHeight, width, height, !isInGLOrientation); } - protected void destroyTexFrame(GL gl, TextureFrame frame) { + protected void destroyTexFrame(final GL gl, final TextureFrame frame) { frame.getTexture().destroy(gl); } @@ -766,7 +767,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { return lastFrame; } - private final void removeAllTextureFrames(GL gl) { + private final void removeAllTextureFrames(final GL gl) { final TextureFrame[] texFrames = videoFramesOrig; videoFramesOrig = null; videoFramesFree = null; @@ -794,7 +795,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { private final boolean[] stGotVFrame = { false }; @Override - public final TextureFrame getNextTexture(GL gl) throws IllegalStateException { + public final TextureFrame getNextTexture(final GL gl) throws IllegalStateException { synchronized( stateLock ) { if( State.Paused != state && State.Playing != state ) { throw new IllegalStateException("Instance not paused or playing: "+this); @@ -940,7 +941,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } lastTimeMillis = currentTimeMillis; } while( dropFrame ); - } catch (InterruptedException e) { + } catch (final InterruptedException e) { e.printStackTrace(); } } @@ -948,8 +949,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { return lastFrame; } } - protected void preNextTextureImpl(GL gl) {} - protected void postNextTextureImpl(GL gl) {} + protected void preNextTextureImpl(final GL gl) {} + protected void postNextTextureImpl(final 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. @@ -973,7 +974,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { */ protected abstract int getNextTextureImpl(GL gl, TextureFrame nextFrame); - protected final int getNextSingleThreaded(final GL gl, final TextureFrame nextFrame, boolean[] gotVFrame) throws InterruptedException { + protected final int getNextSingleThreaded(final GL gl, final TextureFrame nextFrame, final boolean[] gotVFrame) throws InterruptedException { final int pts; if( STREAM_ID_NONE != vid ) { preNextTextureImpl(gl); @@ -1013,7 +1014,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { * w/ current pts value in milliseconds. * @param audio_scr_t0 */ - protected void setFirstAudioPTS2SCR(int pts) { + protected void setFirstAudioPTS2SCR(final int pts) { if( audioSCR_reset ) { audio_scr_t0 = Platform.currentTimeMillis() - pts; audioSCR_reset = false; @@ -1049,13 +1050,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { return (int) ( video_dpts_cum * (1.0f - VIDEO_DPTS_COEFF) + 0.5f ); } - private final void newFrameAvailable(TextureFrame frame, long currentTimeMillis) { + private final void newFrameAvailable(final TextureFrame frame, final long currentTimeMillis) { decodedFrameCount++; if( 0 == frame.getDuration() ) { // patch frame duration if not set already frame.setDuration( (int) frame_duration ); } synchronized(eventListenersLock) { - for(Iterator i = eventListeners.iterator(); i.hasNext(); ) { + for(final Iterator i = eventListeners.iterator(); i.hasNext(); ) { i.next().newFrameAvailable(this, frame, currentTimeMillis); } } @@ -1092,14 +1093,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { this.notifyAll(); // wake-up startup-block try { this.wait(); // wait until started - } catch (InterruptedException e) { + } catch (final InterruptedException e) { e.printStackTrace(); } } } } - private void makeCurrent(GLContext ctx) { + private void makeCurrent(final GLContext ctx) { if( GLContext.CONTEXT_NOT_CURRENT >= ctx.makeCurrent() ) { throw new GLException("Couldn't make ctx current: "+ctx); } @@ -1112,7 +1113,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { // so we can continue with the destruction. try { sharedGLCtx.destroy(); - } catch (GLException gle) { + } catch (final GLException gle) { gle.printStackTrace(); } } @@ -1126,7 +1127,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } } - public final synchronized void initGL(GL gl) { + public final synchronized void initGL(final GL gl) { final GLContext glCtx = gl.getContext(); final boolean glCtxCurrent = glCtx.isCurrent(); final GLProfile glp = gl.getGLProfile(); @@ -1152,7 +1153,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { while( isActive && isRunning ) { try { this.wait(); // wait until paused - } catch (InterruptedException e) { + } catch (final InterruptedException e) { e.printStackTrace(); } } @@ -1167,7 +1168,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { this.notifyAll(); // wake-up pause-block try { this.wait(); // wait until resumed - } catch (InterruptedException e) { + } catch (final InterruptedException e) { e.printStackTrace(); } } @@ -1185,7 +1186,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { this.notifyAll(); // wake-up pause-block (opt) try { this.wait(); // wait until stopped - } catch (InterruptedException e) { + } catch (final InterruptedException e) { e.printStackTrace(); } } @@ -1217,7 +1218,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { this.notifyAll(); // wake-up doPause() try { this.wait(); // wait until resumed - } catch (InterruptedException e) { + } catch (final InterruptedException e) { if( !shallPause ) { e.printStackTrace(); } @@ -1296,12 +1297,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS); } - } catch (InterruptedException e) { + } catch (final InterruptedException e) { isBlocked = false; if( !shallStop && !shallPause ) { streamErr = new StreamException("InterruptedException while decoding: "+GLMediaPlayerImpl.this.toString(), e); } - } catch (Throwable t) { + } catch (final Throwable t) { streamErr = new StreamException(t.getClass().getSimpleName()+" while decoding: "+GLMediaPlayerImpl.this.toString(), t); } finally { if( null != nextFrame ) { // put back @@ -1339,7 +1340,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { private volatile StreamWorker streamWorker = null; private volatile StreamException streamErr = null; - protected final int addStateEventMask(int event_mask, State newState) { + protected final int addStateEventMask(int event_mask, final State newState) { if( state != newState ) { switch( newState ) { case Uninitialized: @@ -1359,18 +1360,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { return event_mask; } - protected final void attributesUpdated(int event_mask) { + protected final void attributesUpdated(final int event_mask) { if( 0 != event_mask ) { final long now = Platform.currentTimeMillis(); synchronized(eventListenersLock) { - for(Iterator i = eventListeners.iterator(); i.hasNext(); ) { + for(final Iterator i = eventListeners.iterator(); i.hasNext(); ) { i.next().attributesChanged(this, event_mask, now); } } } } - protected final void changeState(int event_mask, State newState) { + protected final void changeState(int event_mask, final State newState) { event_mask = addStateEventMask(event_mask, newState); if( 0 != event_mask ) { setState( newState ); @@ -1381,9 +1382,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } } - 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) { + protected final void updateAttributes(int vid, final int aid, final int width, final int height, final int bps_stream, + final int bps_video, final int bps_audio, final float fps, + final int videoFrames, final int audioFrames, final int duration, final String vcodec, final String acodec) { int event_mask = 0; final boolean wasUninitialized = state == State.Uninitialized; @@ -1458,7 +1459,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { attributesUpdated(event_mask); } - protected void setIsGLOriented(boolean isGLOriented) { + protected void setIsGLOriented(final boolean isGLOriented) { if( isInGLOrientation != isGLOriented ) { if( DEBUG ) { System.err.println("XXX gl-orient "+isInGLOrientation+" -> "+isGLOriented); @@ -1569,7 +1570,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } @Override - public final void addEventListener(GLMediaEventListener l) { + public final void addEventListener(final GLMediaEventListener l) { if(l == null) { return; } @@ -1579,7 +1580,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } @Override - public final void removeEventListener(GLMediaEventListener l) { + public final void removeEventListener(final GLMediaEventListener l) { if (l == null) { return; } @@ -1598,33 +1599,33 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { private final Object eventListenersLock = new Object(); @Override - public final Object getAttachedObject(String name) { + public final Object getAttachedObject(final String name) { return attachedObjects.get(name); } @Override - public final Object attachObject(String name, Object obj) { + public final Object attachObject(final String name, final Object obj) { return attachedObjects.put(name, obj); } @Override - public final Object detachObject(String name) { + public final Object detachObject(final String name) { return attachedObjects.remove(name); } private final HashMap attachedObjects = new HashMap(); - protected static final String toHexString(long v) { + protected static final String toHexString(final long v) { return "0x"+Long.toHexString(v); } - protected static final String toHexString(int v) { + protected static final String toHexString(final int v) { return "0x"+Integer.toHexString(v); } - protected static final int getPropIntVal(Map props, String key) { + protected static final int getPropIntVal(final Map props, final String key) { final String val = props.get(key); try { return Integer.valueOf(val).intValue(); - } catch (NumberFormatException nfe) { + } catch (final NumberFormatException nfe) { if(DEBUG) { System.err.println("Not a valid integer for <"+key+">: <"+val+">"); } diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java index f5b2dd8ea..a24e77b7d 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java +++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java @@ -43,7 +43,7 @@ public class JavaSoundAudioSink implements AudioSink { try { AudioSystem.getAudioFileTypes(); ok = true; - } catch (Throwable t) { + } catch (final Throwable t) { } staticAvailable=ok; @@ -59,7 +59,7 @@ public class JavaSoundAudioSink implements AudioSink { public final float getPlaySpeed() { return 1.0f; } // FIXME @Override - public final boolean setPlaySpeed(float rate) { + public final boolean setPlaySpeed(final float rate) { return false; // FIXME } @@ -70,7 +70,7 @@ public class JavaSoundAudioSink implements AudioSink { } @Override - public final boolean setVolume(float v) { + public final boolean setVolume(final float v) { // FIXME volume = v; return true; @@ -87,12 +87,12 @@ public class JavaSoundAudioSink implements AudioSink { } @Override - public final boolean isSupported(AudioSink.AudioFormat format) { + public final boolean isSupported(final AudioSink.AudioFormat format) { return true; } @Override - public boolean init(AudioSink.AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) { + public boolean init(final AudioSink.AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) { if( !staticAvailable ) { return false; } @@ -112,7 +112,7 @@ public class JavaSoundAudioSink implements AudioSink { System.out.println("JavaSound audio sink"); initialized=true; chosenFormat = requestedFormat; - } catch (Exception e) { + } catch (final Exception e) { initialized=false; } return true; @@ -186,7 +186,7 @@ public class JavaSoundAudioSink implements AudioSink { } @Override - public AudioFrame enqueueData(AudioDataFrame audioDataFrame) { + public AudioFrame enqueueData(final AudioDataFrame audioDataFrame) { int byteSize = audioDataFrame.getByteSize(); final ByteBuffer byteBuffer = audioDataFrame.getData(); final byte[] bytes = new byte[byteSize]; @@ -206,7 +206,7 @@ public class JavaSoundAudioSink implements AudioSink { } @Override - public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) { + public AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) { return enqueueData(new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), bytes, byteCount)); } @@ -224,7 +224,7 @@ public class JavaSoundAudioSink implements AudioSink { public int getQueuedTime() { return getQueuedTimeImpl( getQueuedByteCount() ); } - private final int getQueuedTimeImpl(int byteCount) { + private final int getQueuedTimeImpl(final int byteCount) { final int bytesPerSample = chosenFormat.sampleSize >>> 3; // /8 return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) ); } diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java index 4ab90322d..3aa9d7ab6 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java +++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java @@ -70,7 +70,7 @@ public class NullAudioSink implements AudioSink { } @Override - public final boolean setVolume(float v) { + public final boolean setVolume(final float v) { // FIXME volume = v; return true; @@ -87,7 +87,7 @@ public class NullAudioSink implements AudioSink { } @Override - public final boolean isSupported(AudioFormat format) { + public final boolean isSupported(final AudioFormat format) { /** * If we like to emulate constraints .. * @@ -102,7 +102,7 @@ public class NullAudioSink implements AudioSink { } @Override - public boolean init(AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) { + public boolean init(final AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) { chosenFormat = requestedFormat; return true; } @@ -171,12 +171,12 @@ public class NullAudioSink implements AudioSink { } @Override - public AudioFrame enqueueData(AudioDataFrame audioDataFrame) { + public AudioFrame enqueueData(final AudioDataFrame audioDataFrame) { return enqueueData(audioDataFrame.getPTS(), audioDataFrame.getData(), audioDataFrame.getByteSize()); } @Override - public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) { + public AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) { if( !initialized || null == chosenFormat ) { 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 2b4a386d4..4a15c7422 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java @@ -61,7 +61,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { } @Override - protected final boolean setPlaySpeedImpl(float rate) { + protected final boolean setPlaySpeedImpl(final float rate) { return false; } @@ -77,14 +77,14 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { } @Override - protected final int seekImpl(int msec) { + protected final int seekImpl(final int msec) { pos_ms = msec; validatePos(); return pos_ms; } @Override - protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) { + protected final int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) { final int pts = getAudioPTSImpl(); nextFrame.setPTS( pts ); return pts; @@ -98,7 +98,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { } @Override - protected final void destroyImpl(GL gl) { + protected final void destroyImpl(final GL gl) { if(null != texData) { texData.destroy(); texData = null; @@ -108,17 +108,17 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { public final static TextureData createTestTextureData() { TextureData res = null; try { - URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-28x16.png", NullGLMediaPlayer.class.getClassLoader()); + final URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-28x16.png", NullGLMediaPlayer.class.getClassLoader()); if(null != urlConn) { res = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, TextureIO.PNG); } - } catch (Exception e) { + } catch (final Exception e) { e.printStackTrace(); } if(null == res) { final int w = 160; final int h = 90; - ByteBuffer buffer = Buffers.newDirectByteBuffer(w*h*4); + final 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); } @@ -132,7 +132,7 @@ public class NullGLMediaPlayer 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 { texData = createTestTextureData(); final float _fps = 24f; final int _duration = 10*60*1000; // msec @@ -143,7 +143,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { _totalFrames, 0, _duration, "png-static", null); } @Override - protected final void initGLImpl(GL gl) throws IOException, GLException { + protected final void initGLImpl(final GL gl) throws IOException, GLException { setIsGLOriented(true); } @@ -154,12 +154,12 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { *

*/ @Override - protected int validateTextureCount(int desiredTextureCount) { + protected int validateTextureCount(final int desiredTextureCount) { return TEXTURE_COUNT_MIN; } @Override - protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) { + protected final TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) { final Texture texture = super.createTexImageImpl(gl, texName, getWidth(), getHeight()); if(null != texData) { texture.updateImage(gl, texData); @@ -168,7 +168,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { } @Override - protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) { + protected final void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame frame) { super.destroyTexFrame(gl, frame); } diff --git a/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java b/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java index 380ff9ea8..44d83e78d 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java +++ b/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java @@ -181,7 +181,7 @@ public enum VideoPixelFormat { * * @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. PixelFormat.values().length-1 ] */ - public static VideoPixelFormat valueOf(int ordinal) throws IllegalArgumentException { + public static VideoPixelFormat valueOf(final int ordinal) throws IllegalArgumentException { final VideoPixelFormat[] all = VideoPixelFormat.values(); if( 0 <= ordinal && ordinal < all.length ) { return all[ordinal]; 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 e7a425a54..42a908f93 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java @@ -188,12 +188,12 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { GLProfile.initSingleton(); boolean _ready = false; /** util, format, codec, device, avresample, swresample */ - boolean[] _loaded= new boolean[6]; + final boolean[] _loaded= new boolean[6]; /** util, format, codec, avresample, swresample */ - VersionNumber[] _versions = new VersionNumber[5]; + final VersionNumber[] _versions = new VersionNumber[5]; try { _ready = initSymbols(_loaded, _versions); - } catch (Throwable t) { + } catch (final Throwable t) { t.printStackTrace(); } libsUFCLoaded = _loaded[LIB_IDX_UTI] && _loaded[LIB_IDX_FMT] && _loaded[LIB_IDX_COD]; @@ -250,7 +250,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { * @param versions 5: util, format, codec, avresample, swresample * @return */ - private static final boolean initSymbols(boolean[] loaded, VersionNumber[] versions) { + private static final boolean initSymbols(final boolean[] loaded, final VersionNumber[] versions) { for(int i=0; i<6; i++) { loaded[i] = false; } @@ -331,7 +331,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { @Override public final List> getToolLibNames() { - List> libsList = new ArrayList>(); + final List> libsList = new ArrayList>(); // 6: util, format, codec, device, avresample, swresample @@ -424,12 +424,12 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { } @Override - public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) { + public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) { return 0; } @Override - public final boolean useToolGetProcAdressFirst(String funcName) { + public final boolean useToolGetProcAdressFirst(final String funcName) { return false; } 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 9cfd3d80e..8ac1232b5 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java @@ -49,6 +49,7 @@ import com.jogamp.opengl.util.av.AudioSinkFactory; import com.jogamp.opengl.util.av.GLMediaPlayer; import com.jogamp.opengl.util.texture.Texture; +import jogamp.common.os.PlatformPropsImpl; import jogamp.opengl.GLContextImpl; import jogamp.opengl.util.av.AudioSampleFormat; import jogamp.opengl.util.av.GLMediaPlayerImpl; @@ -265,7 +266,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { } @Override - protected final void destroyImpl(GL gl) { + protected final void destroyImpl(final GL gl) { if (moviePtr != 0) { natives.destroyInstance0(moviePtr); moviePtr = 0; @@ -283,7 +284,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { public static final String dev_video_linux = "/dev/video"; @Override - protected final void initStreamImpl(int vid, int aid) throws IOException { + protected final void initStreamImpl(final int vid, final int aid) throws IOException { if(0==moviePtr) { throw new GLException("FFMPEG native instance null"); } @@ -309,7 +310,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { int rw=-1, rh=-1, rr=-1; String sizes = null; if( isCameraInput ) { - switch(Platform.OS_TYPE) { + switch(PlatformPropsImpl.OS_TYPE) { case ANDROID: // ?? case FREEBSD: @@ -351,7 +352,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { } @Override - protected final void initGLImpl(GL gl) throws IOException, GLException { + protected final void initGLImpl(final GL gl) throws IOException, GLException { if(0==moviePtr) { throw new GLException("FFMPEG native instance null"); } @@ -406,7 +407,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { if( null != gl && STREAM_ID_NONE != getVID() ) { int tf, tif=GL.GL_RGBA; // texture format and internal format - int tt = GL.GL_UNSIGNED_BYTE; + final int tt = GL.GL_UNSIGNED_BYTE; switch(vBytesPerPixelPerPlane) { case 1: if( gl.isGL3ES3() ) { @@ -414,22 +415,22 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { 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"; + tf = GL.GL_ALPHA; tif=GL.GL_ALPHA; singleTexComp = "a"; } break; case 2: if( vPixelFmt == VideoPixelFormat.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; + tf = GL.GL_RGBA; tif=GL.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 3: tf = GL.GL_RGB; tif=GL.GL_RGB; break; case 4: if( vPixelFmt == VideoPixelFormat.BGRA ) { - tf = GL2ES2.GL_BGRA; tif=GL.GL_RGBA; break; + tf = GL.GL_BGRA; tif=GL.GL_RGBA; break; } else { - tf = GL2ES2.GL_RGBA; tif=GL.GL_RGBA; break; + tf = GL.GL_RGBA; tif=GL.GL_RGBA; break; } default: throw new RuntimeException("Unsupported bytes-per-pixel / plane "+vBytesPerPixelPerPlane); } @@ -442,7 +443,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { } } @Override - protected final TextureFrame createTexImage(GL gl, int texName) { + protected final TextureFrame createTexImage(final GL gl, final int texName) { return new TextureFrame( createTexImageImpl(gl, texName, texWidth, texHeight) ); } @@ -464,7 +465,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { * @param audioSampleRate sample rate in Hz (1/s) * @param audioChannels number of channels */ - final boolean isAudioFormatSupported(int audioSampleFmt, int audioSampleRate, int audioChannels) { + final boolean isAudioFormatSupported(final int audioSampleFmt, final int audioSampleRate, final int audioChannels) { final AudioSampleFormat avFmt = AudioSampleFormat.valueOf(audioSampleFmt); final AudioFormat audioFormat = avAudioFormat2Local(avFmt, audioSampleRate, audioChannels); final boolean res = audioSink.isSupported(audioFormat); @@ -480,7 +481,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { * @param audioSampleRate sample rate in Hz (1/s) * @param audioChannels number of channels */ - private final AudioFormat avAudioFormat2Local(AudioSampleFormat audioSampleFmt, int audioSampleRate, int audioChannels) { + private final AudioFormat avAudioFormat2Local(final AudioSampleFormat audioSampleFmt, final int audioSampleRate, final int audioChannels) { final int sampleSize; boolean planar = true; boolean fixedP = true; @@ -540,10 +541,10 @@ 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, - int tWd0, int tWd1, int tWd2, int vW, int vH, - int aid, int audioSampleFmt, int audioSampleRate, - int audioChannels, int audioSamplesPerFrameAndChannel) { + void setupFFAttributes(final int vid, final int pixFmt, final int planes, final int bitsPerPixel, final int bytesPerPixelPerPlane, + final int tWd0, final int tWd1, final int tWd2, final int vW, final int vH, + final int aid, final int audioSampleFmt, final int audioSampleRate, + final int audioChannels, final int audioSamplesPerFrameAndChannel) { // defaults .. vPixelFmt = null; vPlanes = 0; @@ -641,8 +642,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { * @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) { + void updateVidAttributes(final boolean isInGLOrientation, final int pixFmt, final int planes, final int bitsPerPixel, final int bytesPerPixelPerPlane, + final int tWd0, final int tWd1, final int tWd2, final int vW, final int vH) { } /** @@ -653,7 +654,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { * Otherwise the call is delegated to it's super class. */ @Override - public final String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException { + public final String getTextureLookupFunctionName(final String desiredFuncName) throws IllegalStateException { if( State.Uninitialized == getState() ) { throw new IllegalStateException("Instance not initialized: "+this); } @@ -785,7 +786,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { } @Override - protected final synchronized int seekImpl(int msec) { + protected final synchronized int seekImpl(final int msec) { if(0==moviePtr) { throw new GLException("FFMPEG native instance null"); } @@ -793,18 +794,18 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { } @Override - protected void preNextTextureImpl(GL gl) { + protected void preNextTextureImpl(final GL gl) { psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1 gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit()); } @Override - protected void postNextTextureImpl(GL gl) { + protected void postNextTextureImpl(final GL gl) { psm.restore(gl); } @Override - protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) { + protected final int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) { if(0==moviePtr) { throw new GLException("FFMPEG native instance null"); } @@ -825,7 +826,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { return vPTS; } - final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) { + final void pushSound(final ByteBuffer sampleData, final int data_size, final int audio_pts) { setFirstAudioPTS2SCR( audio_pts ); if( 1.0f == getPlaySpeed() || 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 99e5a805b..8fd439082 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java @@ -33,7 +33,7 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame; private static final Object mutex_avcodec_openclose_jni = new Object(); - final boolean initSymbols0(long[] symbols, int count) { + final boolean initSymbols0(final long[] symbols, final int count) { return initSymbols0(mutex_avcodec_openclose_jni, symbols, count); } abstract boolean initSymbols0(Object mutex_avcodec_openclose, long[] symbols, int count); 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 22a045825..65a7e3618 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java @@ -30,7 +30,7 @@ package jogamp.opengl.util.av.impl; import com.jogamp.common.util.VersionNumber; class FFMPEGStaticNatives { - static VersionNumber getAVVersion(int vers) { + static VersionNumber getAVVersion(final int vers) { return new VersionNumber( ( vers >> 16 ) & 0xFF, ( vers >> 8 ) & 0xFF, ( vers >> 0 ) & 0xFF ); 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 ecf91124e..0eeb54bf6 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java @@ -74,19 +74,19 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { } @Override - protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) { + protected TextureSequence.TextureFrame createTexImage(final GL gl, final 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) { + protected void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame imgTex) { super.destroyTexFrame(gl, imgTex); } @Override - protected void destroyImpl(GL gl) { + protected void destroyImpl(final GL gl) { if (moviePtr != 0) { _stop(moviePtr); _detachVideoRenderer(moviePtr); @@ -96,7 +96,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { } @Override - protected void initStreamImpl(int vid, int aid) throws IOException { + protected void initStreamImpl(final int vid, final int aid) throws IOException { if(0==moviePtr) { throw new GLException("OMX native instance null"); } @@ -117,7 +117,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { } } @Override - protected final void initGLImpl(GL gl) throws IOException, GLException { + protected final void initGLImpl(final GL gl) throws IOException, GLException { // NOP setIsGLOriented(true); } @@ -128,7 +128,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { } @Override - protected boolean setPlaySpeedImpl(float rate) { + protected boolean setPlaySpeedImpl(final float rate) { if(0==moviePtr) { throw new GLException("OMX native instance null"); } @@ -157,7 +157,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { /** @return time position after issuing the command */ @Override - protected int seekImpl(int msec) { + protected int seekImpl(final int msec) { if(0==moviePtr) { throw new GLException("OMX native instance null"); } @@ -165,7 +165,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { } @Override - protected int getNextTextureImpl(GL gl, TextureFrame nextFrame) { + protected int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) { if(0==moviePtr) { throw new GLException("OMX native instance null"); } @@ -182,8 +182,8 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { return 0; // FIXME: return pts } - private String replaceAll(String orig, String search, String repl) { - StringBuilder dest = new StringBuilder(); + private String replaceAll(final String orig, final String search, final String repl) { + final StringBuilder dest = new StringBuilder(); // In case replaceAll / java.util.regex.* is not supported (-> CVM) int i=0,j; while((j=orig.indexOf(search, i))>=0) { @@ -194,7 +194,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { return dest.append(orig.substring(i, orig.length())).toString(); } - private void errorCheckEGL(String s) { + private void errorCheckEGL(final String s) { int e; if( (e=EGL.eglGetError()) != EGL.EGL_SUCCESS ) { System.out.println("EGL Error: ("+s+"): 0x"+Integer.toHexString(e)); -- cgit v1.2.3