aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* GlueGen Struct [12]: Throw InternalError(..) for produced code-path where ↵Sven Gothel2023-06-181-0/+15
| | | | Ownership.Native _and_ native memory potentially gets replaced
* GlueGen Struct [11]: Formalize Ownership (enum) and elaborate generated Java ↵Sven Gothel2023-06-181-120/+208
| | | | API-Doc
* GlueGen Struct [10]: Don't skip primitive w/ platform dependent sized type ↵Sven Gothel2023-06-181-14/+7
| | | | | | | | | | in struct (like 'int') .. We already support platform dependent sizes like pointer etc, no reason to drop e.g. 'int'. Note: 'int' is also always 32bit of size within our current set of supported platforms, e.g. MachineDataInfo. Further fix and clarify primCElemFixedSize and primElemSizeExpr, only to be true and set if isPrimitive.
* GlueGen Struct [9]: Fix regression which added a pointer referencing type ↵Sven Gothel2023-06-181-0/+8
| | | | 'void', i.e. exclude if !baseCElemType.hasSize() // like 'void*' -> 'void'
* Type: Add hasSize(), change getSignature(..) for const: isConstTypedef() -> ↵Sven Gothel2023-06-181-2/+5
| | | | "typedef", isConstRaw() -> "native"
* JavaType: Add getSignature(..) like TypeSven Gothel2023-06-181-5/+14
|
* Drop .md -> .html generated docs (ugly), use our cgit md -> html via refined ↵Sven Gothel2023-06-173-1240/+2
| | | | | | pandoc styles Would need to fix my standalone pandoc setup to produce proper standalone docs.
* doc/GlueGen_Mapping.md: Remove note regarding shrinking array, resolvedSven Gothel2023-06-172-9/+0
|
* doc/JogAmpMacOSVersions.html: Replaced w/ standalone html5 w/ header (utf8)Sven Gothel2023-06-171-405/+21
|
* GlueGen Struct [8]: Revised setter (resolved shrinking array, using 'subset' ↵Sven Gothel2023-06-175-527/+672
| | | | | | | | | | | | | | | | | | | | | | flag), added (detailed) JavaDoc in generated code Revised setter: A) int32_t val[10] -> setter for a subset change only, as-is with args[src, srcPos, destPos, length] - no new memory, reuse only - no special action to be performed B) int32_t* val -> setter with toggle 'subset' with args[subset, src, srcPos, destPos, length], - replace memory w/ 'subset==false' where it also may copy 'destPos' gap from old -> new - reuse memory w/ 'subset==true', where destPos+length <= elementCount C) const int32_t* val -> setter to replace referenced memory only args[src, srcPos, length] - always replaces memory, no copy of a gap (no destPos) Hence: - case (A) stays as is - case (B) will be revised and argument 'boolean subset' added - case (C) will be revised (simplified) and argument 'destPos' removed
* ElementBuffer: Add absolute get/put multi-element with full srcElemPos, ↵Sven Gothel2023-06-171-23/+42
| | | | destElemPos, elementCount argument set and use it for the single absolute get/put methods.
* GlueGen Struct [7]: Keep struct class non-final (revert), but ensure methods ↵Sven Gothel2023-06-161-9/+9
| | | | are final. Drop useless 'final' of 'static final'.
* GlueGen Struct [6]: Simplify adding 'private ElementBuffer _eb*' memory ↵Sven Gothel2023-06-162-29/+5
| | | | buffer cache once @ 'releaseVal(..)' code creation
* Buffers.copyNativeToDirectByteBuffer(): Remove unused varSven Gothel2023-06-161-1/+0
|
* GlueGen Struct [5]: Revised Struct Mapping + DocumentationSven Gothel2023-06-1618-1407/+5375
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GlueGen Revised Struct Mapping (esp pointer to array or single element), Struct String Charset, .. and Documentation - Documentation: - Added README.md Let's have a proper face for the git repo - Added doc/GlueGen_Mapping.md (and its html conversion doc/GlueGen_Mapping.html) Created a new document covering application and implementation details suitable for users/devs. - Added doc/JogAmpMacOSVersions.md conversion to doc/JogAmpMacOSVersions.html - Updated www/index.html - Use *CodeUnit instead of PrintWriter, representing a Java or C code unit covering a set of functions and structs. The CCodeUnit also handles common code shared by its unit across functions etc. - Dropping 'static initializer', as its no more required due to simplified `JVMUtil_NewDirectByteBufferCopy()` variant. - Revised Struct Mapping: - Pure Java implementation to map primitive and struct fields within a struct by utilizing ElementBuffer. Only 'Function Pointer' fields within a struct require native code. Exposes `static boolean usesNativeCode()` to query whether native code is used/required. - Transparent native memory address API Expose `long getDirectBufferAddress()` and `static TK_Struct derefPointer(long addr)`, allowing to - pass the native struct-pointer with native code - reconstruct the struct from a native struct-pointer - have a fully functional `TK_Struct.derefPointer(struct.getDirectBufferAddress())` cycle. - Add 'boolean is<Val>Null() to query whether a pointer (array) is NULL - *Changed* array get/set method for more flexibility alike `System.arraycopy(src, srcPos, dest, destPos, len)`, where 'src' is being dropped for the getter and 'dest' is being dropped for the setter as both objects are reflected by the struct instance. - *Changed* `get<Val>ArrayLength()` -> `get<Val>ElemCount()` for clarity - Considering all ConstElemCount values with config 'ReturnedArrayLength <int>' to be owned by native code -> NativeOwnership -> Not changing the underlying memory region! JavaOwnership is considered for all pointer-arrays not of NativeOwnership. Hence any setter on a NativeOwnership pointer-array will fail with non-matching elem-count. - Add 'release<Val>()' for JavaOwnership pointer-arrays, allowing to release the Java owned native memory incl. null-ing pointer and set<Val>ElemCount(0). - Support setter for 'const <type>*' w/ JavaOwnership, i.e. pointer to const value of a primitive or struct, setter and getter using pointer to array or single element in general. - Added Config `ImmutableAccess symbol` to disable all setter for whole struct or a field - Added Config `MaxOneElement symbol` to restrict a pointer to maximum one element and unset initial value (zero elements) - Added Config `ReturnsStringOnly symbol` to restrict mapping only to a Java String, dropping the ByteBuffer variant for 'char' - String mapping default is UTF-8 and can be read and set via [get|set]Charset(..) per class. - Dynamic string length retrieval in case no `ReturnedArrayLength` has been configured has changed from `strlen()` to `strnlen(aptr, max_len)` to be on the safe site. The maximum length default is 8192 bytes and can be read and set via [get|set]MaxStrnlen(..) per class. FIXME: strnlen(..) using EOS byte non-functional for non 8-bit codecs like UTF-8, US-ASCII. This is due to e.g. UTF-16 doesn't use an EOS byte, but interprets it as part of a code point. - TODO: Perhaps a few more unit tests - TODO: Allow plain 'int' to be mapped in structs IFF their size is same for all MachineDescriptions used. Currently this is the case -> 4 bytes like int32_t.
* GlueGen Struct [4]: JavaConfiguration Change: Drop 'ManualStaticInitCall', ↵Sven Gothel2023-06-163-103/+93
| | | | | | | | | | | | | 'ForceStaticInitCode'; Add 'ReturnsStringOnly', 'MaxOneElement' and 'ImmutableAccess' Drop 'ManualStaticInitCall', 'ForceStaticInitCode': With new CCodeUnit's `JVMUtil_NewDirectByteBufferCopy(..)` implementation and generalized Buffers' methods, no specific init code is required anymore. Add 'ReturnsStringOnly', 'MaxOneElement' and 'ImmutableAccess': - 'ReturnsStringOnly' only String getter, drop ByteBuffer/byte[] - 'MaxOneElement' only one element maximum for pointer reference - 'ImmutableAccess' strict read-only, also reduces generated code a lot
* GlueGen Struct [3]: Adopt to CodeUnit Abstraction (replacing plain ↵Sven Gothel2023-06-169-640/+678
| | | | PrintWriter...)
* GlueGen Struct [2]: Add CodeUnit: Representing a generated C or Java file, ↵Sven Gothel2023-06-164-1/+261
| | | | | | | | | covering multiple FunctionEmitter allowing to unify output, decoration and dynamic helper code injection per unit - Handles file open and have public ctor emitAutogeneratedWarning(..), being self-contained - Includes `JVMUtil_NewDirectByteBufferCopy(..)` implementation in CCodeUnit, may be injected if required in customCode via emitHeader(..)
* GlueGen Struct [1]: Enhance com.jogamp.common.nio.* to serve a most ↵Sven Gothel2023-06-169-202/+901
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #1 from tgc/masterGöthel Software2023-06-111-0/+10
|\ | | | | glibc-compat-symbols.h: skip versioning on PPC64/PPC64LE
| * glibc-compat-symbols.h: skip versioning on PPC64/PPC64LETom G. Christensen2023-06-071-0/+10
|/
* Merge pull request #34 from andreas-schwab/masterGöthel Software2023-05-242-3/+40
|\ | | | | Add support for riscv64 architecture
| * Add support for riscv64 architectureAndreas Schwab2022-02-062-3/+40
| |
* | AudioSink: Drop getMaxSupportedChannels(), use getNativeFormat(), ↵Sven Gothel2023-05-233-39/+83
| | | | | | | | | | | | | | | | | | | | | | 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-233-12/+33
| | | | | | | | universal API interface
* | AudioFormat/AudioSink: Use float in seconds for duration to avoid losing ↵Sven Gothel2023-05-215-35/+65
| | | | | | | | precision when dealing with stats, averages etc
* | AudioSink: Add getAvgFrameDuration(); API-Doc: Default*: 'frame' -> ↵Sven Gothel2023-05-214-15/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-204-10/+44
| |
* | AudioSink: Add latency query, init(..) frameDuration in ms shall be int, fix ↵Sven Gothel2023-05-193-10/+57
| | | | | | | | 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-185-155/+186
| | | | | | | | moved to com.jogamp.openal.util.ALAudioSink (public)
* | AudioSink: Add exclusive locking allowing implementations to short-cut for ↵Sven Gothel2023-05-173-0/+24
| | | | | | | | less management overhead (-> OpenAL + Synthesizer)
* | Promote common av (audio/video) classes (AudioSink, ..) from JOGL to GlueGen ↵Sven Gothel2023-05-175-0/+1051
| | | | | | | | | | | | | | for cross module usage in JOAL, JOGL, ... Supply AudioSink: NullAudioSink and JavaSoundAudioSink by GlueGen, ALAudioSink is supplied via JOAL.
* | doc/JogAmpMacOSVersions.md: Fix 'Build node 12.6.5' row (11 -> 12)Sven Gothel2023-05-151-2/+2
| |
* | GlueGen 7z File Layout: Have *-java-src.zip inside jar folderSven Gothel2023-05-081-1/+1
| | | | | | | | | | | | | | This is restricted to the 7z archive only for now, not yet producing artifacts in a jar folder as joal, jogl and jocl. This is due to sub-projects referencing gluegen jar files. A compromise.
* | doc/JogAmpMacOSVersions.md 4th round (...)Sven Gothel2023-05-061-3/+6
| | | | | | | | | | | | | | For some reason the pandoc -> html works well, but integration w/ cgit css requires - newline before the list - sometimes loses the list depth and makes it flat
* | doc/JogAmpMacOSVersions.md: 3rd times a charm (space and list depth)Sven Gothel2023-05-061-13/+15
| |
* | doc/JogAmpMacOSVersions.md: Spaces (and 2nd attempt to fix the list depth in ↵Sven Gothel2023-05-061-19/+19
| | | | | | | | .. Build Setup ..
* | doc/JogAmpMacOSVersions.md Fix markdown listSven Gothel2023-05-061-2/+0
| |
* | MacOS: Using 'Minimum Deployment Target' 10.7 (Lion) and documenting MacOS ↵Sven Gothel2023-05-063-46/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | versions Note that starting with Xcode 14.3, the upcoming 'Minimum Deployment Target' is 10.13 (High Sierra). However, we are still using Xcode 14.2 and hence 10.7 is still supported. Note that I upped the 'Minimum Deployment Target' (again) from 10.5 to 10.7 to align with JOAL/openal-soft, i.e. a guaranteed common denominator. You may still try to use 10.5. Note lowest tested MacOS version (from myself) is 10.13.6 w/ x86_64) (High Sierra).
* | Roll back MacOS Min Version Requirement to 10.5 from 11.0 (macosx-version-min)Sven Gothel2023-05-043-4/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MacOSX compiler configuration. 2023-05-04 Actively supported architectures are 'x86_64' and 'arm64'. XCode 14.2 on a MacOS 12.6.5 x86_64 (mac-mini) machine is capable to produce fat-lipo code for MacOS >= 10.5 for 'x86_64' and 'arm64'. The MacOS SDK 11.3 has been re-added from a previous XCode installation. However, alternative source is <https://github.com/phracker/MacOSX-SDKs>. Only for using C++ and hence the C++ STL, the minimum version is 10.7 due to clang++ libc++. This is currently the case for JOAL's bundled openal-soft, as well as for JOGL's optional oculusvr-sdk (disabled).
* | HowToBuild: MacOS: Detail cmake commandline installation and mention 7-ZipSven Gothel2023-05-041-1/+5
| |
* | HowToBuild: Windows: We use MinGW64 w/ 'posix threads' instead of 'win32 ↵Sven Gothel2023-05-042-3/+12
| | | | | | | | threads', allowing C++ std::mutex etc to be used (openal-soft)
* | IOUtil.copyStreamChunk2ByteBuffer(..): Added new method to copy a chunk ↵Sven Gothel2023-05-042-0/+145
| | | | | | | | | | | | | | | | | | | | (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-044-17/+13
| | | | | | | | 'totalNumBytes' argument, since we have no user-feedback callback passed.
* | Clock: Use Clock.currentNanos() instead of System.nanoTime()Sven Gothel2023-03-075-30/+39
| |