aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-10-05 13:48:18 +0200
committerSven Gothel <[email protected]>2015-10-05 13:48:18 +0200
commit4e237f265146b4c1e00856f19a8794aabf54d12c (patch)
treefaea2b8f4fd90ac9899b62e90a3ad9ac5cfc20ae /src
parent8790d4a25410c51e747f4cdd7954ef8abbb7a68b (diff)
Bug 1239: Fix GLMediaPlayer.CameraInputScheme API doc; GLMediaPlayerImpl.updateAttributes avoid div-by-zero (fps inf)
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java19
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java7
2 files changed, 19 insertions, 7 deletions
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 662cf74b7..c2de32372 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -205,22 +205,29 @@ public interface GLMediaPlayer extends TextureSequence {
* {@link Uri#scheme Uri scheme} name {@value} for camera input. E.g. <code>camera:/0</code>
* for the 1st camera device.
* <p>
- * The {@link Uri#path Uri path} is being used to identify the camera (<i>ID</i>),
+ * The {@link Uri#path Uri path} is being used to identify the camera (<i>&lt;id&gt;</i>),
* where the root fwd-slash is being cut-off.
* </p>
* <p>
- * The <i>ID</i> is usually an integer value indexing the camera
+ * The <i>&lt;id&gt;</i> is usually an integer value indexing the camera
* ranging from [0..<i>max-number</i>].
* </p>
* <p>
+ * The <i>&lt;somewhere&gt;</i> is usually empty, since it would imply a networking camera protocol.
+ * </p>
+ * <p>
* The {@link Uri#query 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>?size=640x480;rate=15
+ * camera:/&lt;id&gt;
+ * camera:/&lt;id&gt;?width=640;height=480;rate=15
+ * camera:/&lt;id&gt;?size=640x480;rate=15
+ * camera://&lt;somewhere&gt;/&lt;id&gt;
+ * camera://&lt;somewhere&gt;/&lt;id&gt;?width=640;height=480;rate=15
+ * camera://&lt;somewhere&gt;/&lt;id&gt;?size=640x480;rate=15
+ * camera:///&lt;id&gt;?width=640;height=480;rate=15
+ * camera:///&lt;id&gt;?size=640x480;rate=15
* </pre>
* <pre>
* Uri: [scheme:][//authority][path][?query][#fragment]
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 68d53909a..f09d289fa 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -1431,7 +1431,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.fps = fps;
if( 0 != fps ) {
this.frame_duration = 1000f / fps;
- this.maxNullFrameCountUntilEOS = MAX_FRAMELESS_MS_UNTIL_EOS / (int)this.frame_duration;
+ final int fdurI = (int)this.frame_duration;
+ if( 0 < fdurI ) {
+ this.maxNullFrameCountUntilEOS = MAX_FRAMELESS_MS_UNTIL_EOS / fdurI;
+ } else {
+ this.maxNullFrameCountUntilEOS = MAX_FRAMELESS_UNTIL_EOS_DEFAULT;
+ }
} else {
this.frame_duration = 0;
this.maxNullFrameCountUntilEOS = MAX_FRAMELESS_UNTIL_EOS_DEFAULT;