aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/av
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-10-17 22:27:27 -0700
committerHarvey Harrison <[email protected]>2013-10-17 22:27:27 -0700
commit5e9c02bce7b241a0bf95c8abca9a91cd25e51ed3 (patch)
tree78e913afc74a64e519d69dfb9aa886dd41ec16ed /src/jogl/classes/com/jogamp/opengl/util/av
parent2ebf1bf35928e35ded6e38df64dee7aa578ae3c7 (diff)
jogl: remove all trailing whitespace
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/av')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java188
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java10
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java192
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java12
4 files changed, 201 insertions, 201 deletions
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()) {