summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/openal
Commit message (Collapse)AuthorAgeFilesLines
* Common av classes (*AudioSink, ..) are promoted to gluegen (commit ↵Sven Gothel2023-05-172-1009/+0
| | | | 270172bcbd91f96d4a38a3d73e23d744f57a25b8) and joal (commit 03f4bb63ce8a358b1c2ef303480e1887d72ecb2e)
* GLMediaPlayer: Overhaul and simplify states, allow usage before stream ready ↵Sven Gothel2023-03-131-0/+1
| | | | | | | | | | | | | | | showing test-texture. Adding stop(); (API Change) - allow multiple initGL(..) @ uninitialized and initialized - allows usage before stream is ready - using a test-texture @ uninitialized - adding stop() API change - initStream() -> playStream() - play() -> resume() FFMPEG: Added 'ready' check for robustness
* Bug 1270 - Fix OSX El Capitan 10.11 stuttering: ALAudioSink: DEBUG: Show ↵Sven Gothel2015-11-151-5/+17
| | | | OpenAL Version
* Use ExceptionUtils.dumpStack(..) instead of Thread.dumpStack()Sven Gothel2014-10-261-5/+5
|
* Bug 1031: Remove Deprecated Classes and Methods (JOGL)Sven Gothel2014-07-101-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed Deprecated Class: - com/jogamp/opengl/util/TGAWriter.java - Use TextureIO w/ .tga suffix - com/jogamp/opengl/util/awt/Screenshot.java - Use: - com.jogamp.opengl.util.GLReadBufferUtil, or - com.jogamp.opengl.util.awt.AWTGLReadBufferUtil The latter for reading into AWT BufferedImage See: TestBug461FBOSupersamplingSwingAWT, TestBug605FlippedImageAWT - javax/media/opengl/GLPbuffer.java - Use: caps.setPBuffer(true); final GLAutoDrawable pbuffer = GLDrawableFactory.getFactory( caps.getGLProfile() ).createOffscreenAutoDrawable(null, caps, null, 512, 512); - See: TestPBufferDeadlockAWT, .. Removed Deprecated Methods: - Constructor of AWT-GLCanvas, SWT-GLCanvas, AWT-GLJPanel with argument 'final GLContext shareWith' See GLSharedContextSetter, i.e. glCanvas.setSharedContext(..) ! - GLDrawableFactory.createOffscreenAutoDrawable(..) with argument 'final GLContext shareWith' See GLSharedContextSetter, i.e. offscreenAutoDrawable.setSharedContext(..) ! - GLDrawableFactory.createGLPbuffer(..), see above! - com.jogamp.opengl.util.av.AudioSink 'enqueueData(AudioDataFrame audioDataFrame)', use 'enqueueData(int, ByteBuffer, int)' - GLSharedContextSetter.areAllGLEventListenerInitialized(), migrated to GLAutoDrawable ! - GLBase's - glGetBoundBuffer(int), use getBoundBuffer(int) - glGetBufferSize(int), use getBufferStorage(int).getSize() - glIsVBOArrayBound(), use isVBOArrayBound() - glIsVBOElementArrayBound(), use isVBOElementArrayBound() - NEWT MouseEvent.BUTTON_NUMBER, use BUTTON_COUNT
* Findbugs.increment_volatile: Use AtomicInteger or add comment that operation ↵Sven Gothel2014-07-081-1/+1
| | | | is safe!
* Findbugs.not-written.null: Fix referencing non-written fields (never written ↵Sven Gothel2014-07-081-7/+7
| | | | | | | | | | | | | | | or due branching) - AWT TextRenderer: Add throw new InternalError("fontRenderContext never initialized!"); FIXME! - GLContextImpl.hasFBOImpl(): Fix serious NPE issue if extCache is null - GLDrawableFactoryImpl.createOffscreenDrawableImpl(..): - Fix NPE issue w/ null drawable - Fix resetting GammaRamp by ensuring originalGammaRamp will be set at 1st setGammaRamp(..) - AndroidGLMediaPlayerAPI14: Fix NPE: Use already resolved local referenced - EGLDrawableFactory: Fix NPE: Only operate on non null surface! - ALAudioSink.dequeueBuffer(..): Only resolve releasedBuffer elements if not null -
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-032-62/+65
| | | | | | | | | | | | | 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
* Fix 'typo' in messages: 'Catched' -> 'Caught'Sven Gothel2014-06-281-5/+5
|
* Bug 1011 / Bug 1012: GLMediaPlayer Audio/Video stuttering w/ OSX and ↵Sven Gothel2014-06-111-5/+35
| | | | OpenAL/JOAL (works using openal-soft default on all platforms now)
* GLMediaPlayer: Fix video stutter if using NullAudioSinkSven Gothel2014-06-091-0/+5
| | | | | NullAudioSink shall return the last enqueued PTS in getPTS() not causing a-v delta measure based on lagging audio in player.
* ALAudioSink: Add thread-name to exceptions; stopImpl shall not throw an ↵Sven Gothel2014-02-221-22/+38
| | | | exception at destroy
* Bug 927 - Multithreading (MT) issues ALAudioSinkSven Gothel2014-02-221-53/+54
| | | | | | | Add global synchronization around ALAudioSink constructor code, which 'magically' solves the openal-soft multithreading issues .. This is a workaround.
* Bug 927 - Multithreading (MT) issues with ALAudioSink (openal-soft)Sven Gothel2014-02-151-31/+102
| | | | | | | | | | | | | | - Using update openal-soft (commit 7297c3214a4c648aaee81a9877da15b88f798197) - Analyzed openal-soft threading issues: - a global-lock would have removed the issue - turns out that using ALC_EXT_thread_local_context's alcSetThreadContext(..) instead of alcMakeContextCurrent(..) solves the issue - Cleaned up al*GetError() queries and handling - Simplified flush/dequeue buffers
* ALAudioSink GLMediaPlayerImpl FFMPEGMediaPlayer: Verbosity only w/ DEBUG flag.Xerxes Rånby2013-12-181-1/+1
| | | | Signed-off-by: Xerxes Rånby <[email protected]>
* ALAudioSink: Fix stop and flush of OpenAL sourceSven Gothel2013-12-111-115/+125
| | | | | | | | | | - stopImpl() shall always issue alSourceStop(..) if state is not STOPPED - Remove 'flush' hint for dequeueBuffer(..), we perform proper flush in respective method, see below - flush() needs to issue: - stopImpl() - which should already dequeue all buffers - Explicitly dequeue all buffers: via 'alSourcei(alSource[0], AL.AL_BUFFER, 0)' - Then dequeue manually processed buffers: dequeueBuffer( false /* wait */ ); - And dequeue _all_ buffers: dequeueForceAll();
* ALAudioSink: Remove force DEBUG infoSven Gothel2013-08-261-1/+1
|
* libav/ffmpeg: Compile/Link 2 versions of native FFMPEGMediaPlayer methods ↵Sven Gothel2013-08-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FFMPEGNatives -> FFMPEGv08Natives + FFMPEGv09Natives Enables FFMPEGMediaPlayer to work w/ either ffmpeg/libav version 8 or 9 w/ same JOGL binary Same C source code is compiled against 1: version 0.8 FFMPEGv08Natives lavc53.lavf53.lavu51 2: version 0.9 FFMPEGv09Natives lavc54.lavf54.lavu52.lavr01 FFMPEGv08Natives and FFMPEGv09Natives implements FFMPEGNatives, native C code uses CPP '##' macro concatenation to produce unique function names. To enable 'cpp' to find the libav* header files matching the desired version, we have placed them in the c-file's folder, issued '#include "path/file.h" and added symbolic links to allow finding same module and 'sister modules': ls -l libavformat/ .. lrwxrwxrwx 1 sven sven 13 Aug 26 12:56 libavcodec -> ../libavcodec lrwxrwxrwx 1 sven sven 14 Aug 26 12:56 libavformat -> ../libavformat lrwxrwxrwx 1 sven sven 12 Aug 26 12:57 libavutil -> ../libavutil .. At static init FFMPEGDynamicLibraryBundleInfo, determines the runtime version and instantiates the matching FFMPEGNatives, or null if non matches. FFMPEGMediaPlayer still compares the compile-time and runtime versions. FFMPEGMediaPlayer passes it's own instance to FFMPEGNatives for callbacks.
* AudioSink: Fixe type names ; Enhance AudioFormat negotiation ; ALAudioSink ↵Sven Gothel2013-08-261-35/+99
| | | | | | | | | | | | | | | | | | | | | | adds AL_SOFT_buffer_samples support w/ full AL caps - Fixe type names: - Remove AudioDataType, we only support PCM here anyways - AudioDataFormat -> AudioFormat / Add 'planar' attribute to distingush packed/planar data type - Validate float types - Enhance AudioFormat negotiation - Add 'isSupported(AudioFormat format)' which _shall_ be used before 'init(..)' to test/negotiate format - Add getMaxSupportedChannels(), which may be used w/ getPreferredFormat() if orig requested format fails via 'isSupported(..)' - 'init(..)' returns boolean only. - ALAudioSink adds AL_SOFT_buffer_samples support w/ full AL caps - Determine whether AL_SOFT_buffer_samples is supported - Use new JOAL ALHelper to convert AudioFormat -> AL-types, which also answers the 'isSupported(..)' query. - Now allows multiple: channles, sample-types, etc.
* GLMediaPlayer/AudioSink: Add set[Audio]Volume(float v)/get[Audio]Volume() ↵Sven Gothel2013-08-251-1/+30
| | | | allowing to change the audio volume.
* AudioSink.init(..) abstract 'frame count' -> duration [ms] allowing ↵Sven Gothel2013-08-241-8/+15
| | | | | | | | | | | | | | | | | | | non-frame based AudioSink's to deal w/ desired queue sizes. - Rename AudioSink.initSink(..) -> AudioSink.init(..) - Move: "int initialFrameCount, int frameGrowAmount, int frameLimit" to "int initialQueueSize, int queueGrowAmount, int queueLimit" based on milliseconds instead of frame count. - Passing hint 'float frameDuration' to calculate frame count for fame based audio sink, i.e. ALAudioSink. - Adding sensible static final default values - AudioDataFormat: Add convenient conversion routines (samples/bytes/frame-count) - FFMPEGMediaPlayer: Retrieve audio frame size in samples per channel, pass it to AudioSink.init(..) to properly calculate frame count/limits based on duration.
* *AudioSink: Add byte/time calc to AudioDataFormat, *AudioFrame OO changes, ↵Sven Gothel2013-08-241-106/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | Reuses ALAudioFrames to ease GC, Ringbuffer changes - Adapt to Ringbuffer changes of GlueGen commit f9f881e59c78e3036cb3f956bc97cfc3197f620d - Favor AudioSink 'AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount)', - Impl. shall reuse AudioFrame's instead of creating them on the fly - User shall simply pass the net data required, while receiving an internal AudioFrame - Add byte/time calc to AudioDataFormat: - Add getDuration(byteCount) and getByteCount(ms). - *AudioFrame OO changes: - abstract AudioFrame extends TimeFrameI - allow setting of all components to reuse instanced (GC clean) - ALAudioSink reuses ALAudioFrames to ease GC: - Remove creating temporary objects to ease GC - ALAudioFrame holds ALBuffer name, remove ActiveBuffer type. - Use ALAudioFrame similar to TextureFrame in GLMediaPlayerImpl, i.e. fill them in 'full' Ringbuffer and move them in-between 'full'/'playing' Ringbuffer. -
* AudioSink: Add END_OF_STREAM_PTS, initSink(..) args: frameGrowAmount and ↵Sven Gothel2013-08-221-58/+132
| | | | frameLimit allowing an optional used Ringbuffer to grow in implementation.
* GLMediaPlayer Multithreaded Decoding: GLMediaPlayer* (Part-4) - WIPSven Gothel2013-08-161-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use Platform.currentTimeMillis() for accurate timing! - GLMediaPlayer / GLMediaPlayerImpl - Add DEBUG_NATIVE property jogl.debug.GLMediaPlayer.Native for verbose impl. messages, i.e. ffmpeg/libav - Add 'synchronization' section in GLMediaPlayer API doc (WIP) - Use passive non-blocking video synchronization, i.e. repeat frames instead of 'sleep'. Thx to Xerxes's suggestion. - Add flushing of cached decoded frames, allowing to remove complicated 'videoSCR_reset_latch' - FramePusher (threaded decoding): - Always create a shared context! - Release context while pausing - Pre/post 'getNextTextureImpl()' actions only at makeCurrent/release. - newFrameAvailable(..) signal after decoded frame is enqueued - FFMPEGDynamicLibraryBundleInfo - Bind add. functions of libavcodec: + "av_init_packet", + "av_new_packet", + "av_destruct_packet", - Bind add. functions of libavformat: + "avformat_seek_file", + "av_read_play", + "av_read_pause", - DEBUG property := FFMPEGMediaPlayer.DEBUG || DynamicLibraryBundleInfo.DEBUG; - FFMPEGMediaPlayer - Use libavformat's 'av_read_play()' and 'av_read_pause()', which may get utilized for network streams, e.g. RTSP - getNextTextureImpl(..): - Fix retry loop - Use postNextTextureImpl/preNextTextureImpl if desired (PSM) - Native: - Use fixed my_av_q2i32(..) macro (again) - Use INVALID_PTS marker (synced w/ Java code) - DEBUG: Dump more detailed frame information - TODO: Consider passing frame_delay, especially for repeated frames! - Tests (MovieSimple, MovieCube): - Refine KeyEvents control for seek and speed. - TODO: - Proper audio clock calculation - difficult w/ OpenAL ! - Video / Audio sync: - seek ! - streams w/ very async A/V frames - Test Streams: - Five-minute-sync-test.mp4 - Audio-Video-Sync-Test-Calibration-23.98fps-24fps.mp4 - sound_in_sync_test.mp4 - big_buck_bunny_1080p_surround.avi
* GLMediaPlayer Multithreaded Decoding: AudioSink (Part-2) - WIPSven Gothel2013-08-141-146/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | - AudioSink.AudioDataFormat - add fixedP (fixed-point or floating-point) - AudioSink - rename 'buffer count' to 'frame count' - add setPlaySpeed(..) - add isPlaying() - add play() - add pause() - add flush() - add: getFrameCount(), getQueuedFrameCount(), getFreeFrameCount(), getEnqueuedFrameCount(), - rename: writeData() -> enqueueData(..) - ALAudioSink - multithreaded usage - make ALCcontext current per thread, now required for multithreaded use Use RecursiveLock encapsulating the ALCcontext's makeCurrent/release/destroy, since the native operations seem to be buggy. NOTE: Think about adding these general methods to ALCcontext - implement new methods -
* FFMPEGPlayer Audio Sink Refactoring ..Sven Gothel2013-07-191-116/+368
| | | | | | | | | | | | | | | | - AudioSink w/ AudioFrame and formats public - ALAudioSink uses a circular buffer now, hence relaxes the one-threaded player mode - FFMPEGMediaPlayer uses multiple audio frames (equal to the ALAudioSink number) and wraps data to NIO buffer w/o copy. - FFMPEGMediaPlayer audio threading currently disabled: distorted sound Seems that the ALAudioSink's circular buffer usage is good enough for now. - Verbosity only w/ DEBUG flag - New SyncedRingbuffer for effcient synced buffering
* ALAudioSink: Reduce exessive CPU usage caused by polling alGetSourcei.Xerxes Rånby2013-07-161-0/+8
| | | | Signed-off-by: Xerxes Rånby <[email protected]>
* AudioSink: interface add isAudioSinkAvailableXerxes Rånby2013-06-241-1/+2
| | | | Signed-off-by: Xerxes Rånby <[email protected]>
* ALAudioSink: Fill buffers before sourcing them.Xerxes Rånby2013-06-241-1/+0
| | | | | | Fixes OpenAL invalid argument error when trying to fill buffers. Signed-off-by: Xerxes Rånby <[email protected]>
* ALAudioSink: Buffer and playback audio data.Xerxes Rånby2013-06-201-22/+80
| | | | | | | There is still something wrong with the buffering part; OpenAL will complain at runtime. Signed-off-by: Xerxes Rånby <[email protected]>
* FFMPEGMediaPlayer: Add AudioSink interface.Xerxes Rånby2013-06-191-0/+110
| | | | | | | | | Use ALAudioSink when available and fallback to JavaSoundAudioSink when JOAL are not found on classpath. Java Sound playback moved from FFMPEGMediaPlayer into JavaSoundAudioSink. Signed-off-by: Xerxes Rånby <[email protected]>
* Add optional JOAL dependency, enabling JOAL usage for our 'av' package. ↵Sven Gothel2013-06-181-0/+19
Note: May be relocated to external project later! Assumption: gluegen/ joal/ jogl/ For OpenAL / JOAL code: - use the package jogamp.opengl.openal (like jogamp.opengl.android) - will be build _before_ the other 2nd pass java files - do not expose OpenAL/JOAL APIs, if being used by other packages, since only this package is being compiled w/ JOAL jar files!