diff options
author | Xerxes Rånby <[email protected]> | 2013-06-24 19:39:56 +0200 |
---|---|---|
committer | Xerxes Rånby <[email protected]> | 2013-06-24 19:39:56 +0200 |
commit | 6509c313dec8947723a932e7d1646a78dd6ac49a (patch) | |
tree | a031b69a7d341a8f1c6c7aa10b06d048e40b66a7 | |
parent | 11e27bf78f5fc1a117e02aba8a58b6c5fa088514 (diff) |
AudioSink: interface add isAudioSinkAvailable
Signed-off-by: Xerxes Rånby <[email protected]>
5 files changed, 16 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java index db01d3a38..c8004d6b3 100644 --- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java +++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java @@ -161,7 +161,8 @@ public class ALAudioSink implements AudioSink { return (NUM_BUFFERS-val[0])*4096; } - public static boolean isAvailable() { + @Override + public boolean isAudioSinkAvailable() { return available; } } diff --git a/src/jogl/classes/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/AudioSink.java index fedead713..504e4b2db 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/AudioSink.java +++ b/src/jogl/classes/jogamp/opengl/util/av/AudioSink.java @@ -2,6 +2,8 @@ package jogamp.opengl.util.av; public interface AudioSink { + boolean isAudioSinkAvailable(); + int getDataAvailable(); boolean isDataAvailable(int data_size); diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java index 0e2806322..653a02111 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java +++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java @@ -71,7 +71,8 @@ public class JavaSoundAudioSink implements AudioSink { return auline.available()>=data_size; } - public static boolean isAvailable() { + @Override + public boolean isAudioSinkAvailable() { return available; } diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java index 81259f4c5..d92967849 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java +++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java @@ -15,4 +15,9 @@ public class NullAudioSink implements AudioSink { @Override public void writeData(byte[] sampleData, int data_size) { } + + @Override + public boolean isAudioSinkAvailable() { + return true; + } } 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 9ae1541f9..9c0c9bd94 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java @@ -130,11 +130,12 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl { System.err.println("LIB_AV Codec : "+avCodecVersion); initIDs0(); available = true; - audioSink = new NullAudioSink(); - if(ALAudioSink.isAvailable()) { - audioSink = new ALAudioSink(); - } else if(JavaSoundAudioSink.isAvailable()) { + audioSink = new ALAudioSink(); + if(!audioSink.isAudioSinkAvailable()) { audioSink = new JavaSoundAudioSink(); + if(!audioSink.isAudioSinkAvailable()) { + audioSink = new NullAudioSink(); + } } maxAvailableAudio = audioSink.getDataAvailable(); |