aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common
Commit message (Collapse)AuthorAgeFilesLines
* Buffers.copyNativeToDirectByteBuffer(): Remove unused varSven Gothel2023-06-161-1/+0
|
* GlueGen Struct [1]: Enhance com.jogamp.common.nio.* to serve a most ↵Sven Gothel2023-06-166-185/+867
| | | | | | | | | | | | | | | | | | | | | | | | | | | native-free-code Struct-Code generation Recfactored all NIO buffer utils to Buffers, i.e. buffer <-> address, memcpy, strnlen, etc Buffers: - Added copyNativeToDirectByteBuffer(..), allowing to copy a native memory slice into a direct buffer. - Added typeNameToBufferClass(String) and sizeOfBufferElem(Class<? extends Buffer>) - Completed slize2<Type>(..) buffer-mapping methods - Exposure of safe getDirectByteBuffer(..) w/ null-check (package private) Added NativeBuffer.storeDirectAddress(..), allowing to write the array address into a native buffer (struct, etc), allowing to referencing the ElementBuffer (linear array of elements) and PointerBuffer (array of pointer). Hint: This can be read via PointerBuffer.wrap(..).get(0) Added ElementBuffer (a NativeBuffer) mapping an array of elements, completing native abstraction next to PointerBuffer (array of pointer). ElementBuffer can dereference an existing element-array by native address via ElementBuffer.derefPointer(..). Views of its content can be directly accessed via ElementBuffer.slice(..). +++ These utilities and buffer abstractions will allow to reuse code and simplify the GlueGen struct get/set implementations and help to reduce native code injection.
* AudioSink: Drop getMaxSupportedChannels(), use getNativeFormat(), ↵Sven Gothel2023-05-231-24/+41
| | | | | | | | | | | getPreferredFormat() and isSupported(); Add setChannelLimit() impacting Add setChannelLimit() impacting getPreferredFormat() and isSupported(), i.e. to limit channels for e.g. JOAL/OpenAL spatial 3D sound usage. getNativeFormat() shall be unaffected. getMaxSupportedChannels() is redudandant -> getPreferredFormat()
* AudioSink: Refine context locking where supported, have a more usable ↵Sven Gothel2023-05-231-6/+27
| | | | universal API interface
* AudioFormat/AudioSink: Use float in seconds for duration to avoid losing ↵Sven Gothel2023-05-213-22/+56
| | | | precision when dealing with stats, averages etc
* AudioSink: Add getAvgFrameDuration(); API-Doc: Default*: 'frame' -> ↵Sven Gothel2023-05-212-15/+25
| | | | | | | | | | | | | | AudioFrame; init(): Use getAvgFrameDuration() for queue growth and limit. This change renders buffer dequeueing, growth and limit sticking w/ [ms] values while getAvgFrameDuration() assists frame count determination. getAvgFrameDuration() is calculated when buffer is fully filled (queuedBytes / queuedFrames), i.e. a proper representation to be used to dequeue in duration range as well as for growth. This further decouples the frameDuration{->Hint} parameter in init(), as it is now only used for the initial buffer count (and latency adjustment).
* AudioSink: Enhance description re 'AudioFrame' and 'frameDuration' also ↵Sven Gothel2023-05-211-6/+19
| | | | using enqueueData() -> 1 AudioFrame
* JarUtil.getRelativeOf(): Make'cutOffInclSubDir' optional, i.e. ignore if ↵Sven Gothel2023-05-201-6/+15
| | | | null in case no sub-directory is desired
* AudioSink.init(): Detail 'frameDuration' intend and impact of underlying ↵Sven Gothel2023-05-201-3/+14
| | | | JOAL/OpenAL implementation
* Add AudioSink.getSourceCount(), refine Audio* API docSven Gothel2023-05-202-10/+34
|
* AudioSink: Add latency query, init(..) frameDuration in ms shall be int, fix ↵Sven Gothel2023-05-191-8/+34
| | | | API doc
* AudioFormat: Fix rounding/int-truncate errors, all millisecond params use ↵Sven Gothel2023-05-191-7/+7
| | | | type int
* Place AudioFormat in its own file outside AudioSink, JOAL's ALAudioSink has ↵Sven Gothel2023-05-183-151/+180
| | | | moved to com.jogamp.openal.util.ALAudioSink (public)
* AudioSink: Add exclusive locking allowing implementations to short-cut for ↵Sven Gothel2023-05-171-0/+12
| | | | less management overhead (-> OpenAL + Synthesizer)
* Promote common av (audio/video) classes (AudioSink, ..) from JOGL to GlueGen ↵Sven Gothel2023-05-173-0/+598
| | | | | | | for cross module usage in JOAL, JOGL, ... Supply AudioSink: NullAudioSink and JavaSoundAudioSink by GlueGen, ALAudioSink is supplied via JOAL.
* IOUtil.copyStreamChunk2ByteBuffer(..): Added new method to copy a chunk ↵Sven Gothel2023-05-041-0/+33
| | | | | | | | | | (segment) of the input stream (skipBytes, byteCount) This method is inspired by Bug 1280, <https://github.com/sgothel/joal/pull/16>, 'copy only needed bytes' for JOAL's com.jogamp.openal.util.WAVData.loadFromStream(..). This method is a revised version of the proposed IOHelpers.copyFromStream2ByteBuffer(..), see <https://github.com/OndrejSpanel/joal/commit/1616659e98904270af4faca25b770d0983609735>
* IOUtil.copyStream2Byte{Array|Buffer}(..): API Doc: Clarify that the complete ↵Sven Gothel2023-05-041-6/+4
| | | | stream is copied.
* IOUtil.copyStream2{File|Stream)(..): Drop unused and misleading ↵Sven Gothel2023-05-042-15/+11
| | | | 'totalNumBytes' argument, since we have no user-feedback callback passed.
* Clock: Use Clock.currentNanos() instead of System.nanoTime()Sven Gothel2023-03-072-4/+5
|
* Clock: Consider return code on failed native clock_gettime(..) call; Add ↵Sven Gothel2023-03-071-9/+18
| | | | | | | | | | | | | Win32 clock_gettime() implementation. Consider return code on failed native clock_gettime(..) call - Return Instant.EPOCH for all Instant variations (essentially 0) - Return 0 for all 'long' variations (ms, ns) Add Win32 clock_gettime() implementation. - Source: https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-libraries/winpthreads/src/clock.c - Public Domain within mingw-w64, included here to simplify linkage. - Tested on Win10 64bit w/ TestTextRendererNEWT00, all values are OK
* Clock: Rename currentTimeNanos() -> currentNanos() as it represents the ↵Sven Gothel2023-03-062-17/+25
| | | | duration since module startup and not time.
* Fix Clock for performance counter: Add currentTimeNanos() since module ↵Sven Gothel2023-03-062-27/+85
| | | | | | | | | | | startup, retrievable via getMonotonicStartupTime(). (performance) Settings two long fields in getMonotonicTime() and creating Instant and using Duration for high-frequency counter is too expensive. currentTimeNanos() subtracts the startup time from the current monotonic time and returns the resulting duration in nanoseconds, which lasts for 292 years since module startup. This satisfies performance counter requirements.
* Add PerfCounterCtrl, a simple performance counter controllerSven Gothel2023-03-061-0/+44
|
* Add Clock, implementing proper monotonic and wallclock time using Instant ↵Sven Gothel2023-03-062-20/+102
| | | | | | | | | (sec + nsec), currentTimeMillis() is also monotonic now, reused by Platform. Dropped Platform.currentTimeMicros() Clock and its implementation was copied from jaulibs, a spin-off from Direct-BT. The implementation uses `clock_gettime(CLOCK_MONOTONIC, &t)` and is considered safe and high-performant as it avoids a kernel call via VDSO (GNU/Linux).
* Buffers: Add put[34][bsifd](..) and array-put variants for ↵Sven Gothel2023-03-061-1/+468
| | | | | | flexibility/performance. Notable: The array-put is slower than small range single-puts, e.g. put3i(..).
* MappedByteBufferInputStream: Reduce dependency to PlatformSven Gothel2023-01-231-5/+5
|
* NativeLibrary.enumerateLibraryPaths(): Reduce relative/absolute path mapping ↵Sven Gothel2023-01-231-9/+12
| | | | to 'java.library.path', others are absolute
* JNILibLoaderBase.loadLibraryInternal(): Produce own detailed exception if ↵Sven Gothel2023-01-231-3/+6
| | | | | | lib couldn't be loaded (avoid showing misleading orig exception) .. and detail some debug output. Both, own exception and debug output expose NativeLibrary.getSystemEnvLibraryPaths()
* NativeLibrary.enumerateLibraryPaths(): Using addPaths() ensures given 'path' ↵Sven Gothel2023-01-231-14/+51
| | | | | | is being resolved as absolute-canonical as required for System.load*() Further, detailed DEBUG messages are added on -Djogamp.debug.NativeLibrary
* NativeLibrary: Add getSystemEnvLibraryPaths(), i.e. LD_LIBRARY_PATH, PATH, ↵Sven Gothel2023-01-231-0/+35
| | | | .. content
* Formatting: BindingJNILibLoader, AWTEDTExecutorSven Gothel2023-01-231-10/+10
|
* SecurityUtil: Skip System's SecurityManager action for getSecurityManager() ↵Sven Gothel2023-01-151-7/+31
| | | | and doPrivileged() for Java17+
* Default build is JDK-17, prepare up to Java-21 (next LTS); ↵Sven Gothel2023-01-151-3/+11
| | | | | | | | PlatformPropsImpl: Remove static OSXVersion and Version* vars, add JAVA_17 and JAVA_21 flag. PlatformPropsImpl's static OSXVersion is JOGL specific and will be moved into its GLContextImpl. PlatformPropsImpl's static Version are not required and eats up memory where it can be used transitionary.
* Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged()Sven Gothel2023-01-1410-26/+43
|
* WeakIdentityHashMap: Always null check on weakRef.get(); ↵Sven Gothel2019-12-311-18/+23
| | | | IdentityWeakReference: hash is final.
* WeakIdentityHashMap: Refine capacity computation; Bitfield.Util add ↵Sven Gothel2019-12-312-2/+105
| | | | 'PowerOf2' functions
* WeakIdentityHashMap: Cleanup; Implement putAll(..); Make ↵Sven Gothel2019-12-311-30/+61
| | | | IdentityWeakReference static
* Add WeakIdentityHashMap implementation (from Apache Avro)Sven Gothel2019-12-301-0/+229
| | | | | | | | | | Origin <https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/util/WeakIdentityHashMap.java> from their commit 70260919426f89825ca148f5ee815f3b2cf4764d. Apache License Version 2.0 until. Using our JogAmp 'New BSD 2-Clause License' for changes after this initial commit. Related to Bug 1312, where we like to utilize a WeakIdentityHashMap, allowing to have cached shared GLContext to disappear .. a compromise.
* Bug 1417 - Android: Add new x86 MachineDataInfo, differs due to smaller ↵Sven Gothel2019-12-101-0/+3
| | | | 'long double' than regular x86_32_unix
* Bug 1417 - Android: Complete 1st round: ↵Sven Gothel2019-12-101-1/+2
| | | | | | | | | make/lib/gluegen-cpptask-android-<abi>.xml and scripts All aligned now - gluegen-cpptasks-android-aarch64.xml - gluegen-cpptasks-android-armv6.xml (this has ld flag --no-undefined disabled, due to internal missing symbols) - gluegen-cpptasks-android-x86.xml
* Bug 1363: Java 11: Extract and extend sun.misc.Unsafe functionality to ↵java11iosSven Gothel2019-09-042-28/+234
| | | | | | | | | | | | | | | UnsafeUtil UnsafeUtil centralizes the workarounds (hack) of certain Java>=9 modularization encapsulation pitfalls, where no exports have been defined. The last resort. 1) Buffers utilizes UnsafeUtil for Java>=9 invokeCleaner. 2) To gain access for certain methods + fields w/o 'illegal access warnings', we have to temporarily disable the IllegalAccessLogger. Hence we provide a method 'T doWithoutIllegalAccessLogger(..<T> action)' for our essential module access under Java >= 9.
* Bug 1363: Java 11: Resolve Buffers.Cleaner implementationSven Gothel2019-08-191-8/+46
| | | | | | | | | | | As of Java9, sun.misc.Cleaner has moved to jdk.internal.ref.Cleaner. However, access has been made (under the table) via sun.misc.Unsafe, which we are using for now as we cannot set the jdk.internal.ref.Cleaner method accessible. In this regard, we had to change our Cleaner.clean(..) method using a ByteBuffer instead of a Buffer object paramter. All tests have passed, no more illegal access case running on Java11 has been exposed.
* Bug 1363: Java 11: Complete renaming JEP 178 compatible native lib basename ↵Sven Gothel2019-08-184-5/+5
| | | | | | | | | | gluegen-rt -> gluegen_rt - Fix finding native library for Elf parsing - Fix one unit test - Fix comments Completes commit 330dad069dee5a0cc0480cf5cd9052000004223a
* MacOS shall only scan for .dylib, dropping .jnilib search in NativeLibrarySven Gothel2019-08-181-5/+0
|
* iOS: NativeLibrary: Refine iOS, use proper alt system path for iOS+OSX, ↵Sven Gothel2019-06-212-28/+38
| | | | relax closeLibrary(..)
* Bug 1363: Java 11: Recognize Java9+ ..; Support JEP 178 static linkage ↵Sven Gothel2019-06-173-2/+9
| | | | | | | | | | | | | | | | | | | | | libgluegen-rt[.so] -> libgluegen_rt[.so|.a] Recognize Java9+ .. - Recognize new Java9+ version string as of JEP 223 - Avoid Classpath's private findLibrary call +++ Support JEP 178 static linkage (OpenJDK 1.8) - Need to change native library basename: libgluegen-rt[.so] -> libgluegen_rt[.so|.a] since the dash '-' is not supported in a ANSI-c function name. - Added 'JNI_OnLoad_gluegen_rt' to recognize statical linked JNI code - Added JNI_VERSION_1_8 to jni/jni.h
* iOS: Initial iOS support commit: build.xml targets, java code-path etcSven Gothel2019-06-176-8/+18
| | | | | | | | | | | | Current build system for JogAmp iOS Build is: - Build Machine: OSX Mojave 10.14 - Using own (still proprietary) OpenJDK 9 iOS Build - OpenJDK 1.8 (This will be replaced by OpenJDK 11 soon) - Xcode 10.2
* Bug 1369: SCC: Hide SHA Algorithm bit size in literals of SpecificationSven Gothel2019-04-032-37/+36
| | | | | Implementation currently uses 256 bit Secure Hash (SHA) algorithm, but this may change in the future. Hence only use 'SHA' in the names, not 'SHA256'.
* Bug 1369: Source Certification Contract (SCC): Initial SHA256 fingerprint & ↵Sven Gothel2019-04-035-0/+502
| | | | | | | | | | | | | | | | | | | | | runtime validation This change implements a strong SHA256 signature over: 1) source tree inclusive make recipe (SHA256-Source) 2) all class files (SHA256-Classes) 3) all native libraries (SHA256-Natives) 4) the class files as deployed in the jar (SHA256-Classes-this) 5) the native libraries as deployed in the jar (SHA256-Natives-this) and drops all of these in the deployed Jar file. This allows SHA256 validation of (4) + (5) at runtime and further complete validation (1), (2) and (3) offline. Full SCC would now required (1) - (3) to be placed on a server for further validation. Optionally we may use GPG <https://gnupg.org/> or PGP to validate the build entity to implement the chain of trust <https://en.wikipedia.org/wiki/Chain_of_trust> The SHA256 runtime validation is tested via: com.jogamp.common.util.TestVersionInfo
* Bug 1367: Make TempFileCache & TempJarCache even if temp folder can't handle ↵Sven Gothel2019-04-036-40/+130
| | | | executables