aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
Commit message (Collapse)AuthorAgeFilesLines
...
* Added JavaDoc references, split version fields according to spec.Bernhard Haumacher2024-02-031-6/+100
|
* Documentation for `HeadTable`Bernhard Haumacher2024-02-0332-55/+439
| | | | | | | | | | | | | | | | | | | * Added documentation to fields in `HeadTable` taken from https://docs.microsoft.com/en-us/typography/opentype/spec/head. * Added `LongDateTime` conversion of date values encoded as "seconds since 1904". * Added `getType()` API to `Table` interface. # Conflicts: # src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java # src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java # src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java # src/jogl/classes/jogamp/graph/font/typecast/ot/table/SbixTable.java Original commit from typecast merge: From 43c20bb2e7644aef7002caeb93e1770be5cacaab Mon Sep 17 00:00:00 2001 From: Bernhard Haumacher <[email protected]> Date: Sat, 9 May 2020 12:49:39 +0200
* Graph/GraphUI: Move getDefault*() to FontFactory and add ↵Sven Göthel2024-02-033-0/+58
| | | | {get,set}FallbackFont() + Font.getBestCoverage(..); Use fallback-font in MediaButton in case chosen font doesn't match (foreign languages, e.g. 'zho' Chinese .. )
* Bug 1493: Supply language code to SubtitleEvent, perhaps allowsing player to ↵Sven Göthel2024-02-026-29/+44
| | | | select font for ASS/Text rendering; Remove GLMediaPlayer's getStreamLang() as replaced by getLang()
* OutlineShape: Earmark coloring task when triangulating ..Sven Göthel2024-02-021-0/+10
|
* Remove Clonable and clone() in favor of explicit determined copy() and ↵Sven Göthel2024-02-028-71/+36
| | | | copy-ctor in com.jogamp.graph.* and com.jogamp.math.*
* GLMediaPlayerImpl: Disable subDEBUG flagSven Göthel2024-02-021-1/+1
|
* GLMediaPlayer: Adjust API doc and certain names differentiating video (from ↵Sven Göthel2024-02-022-16/+28
| | | | subtititle) etc.
* GLMediaPlayerImpl.StreamWorker: Don't grow videoFramesFree since having ↵Sven Göthel2024-02-021-4/+0
| | | | removed buffer grow in commit 68ca5b14966cb7eec9501c17dc8b3b465421a68e
* GLMediaPlayerImpl: Allow one frame to be shown paused when issuing seek(), ↵Sven Göthel2024-02-021-5/+14
| | | | | | i.e. 'oneVideoFrameOnce'. This allows a player to see the current seek'ed position while paused.
* Bug 1494 - GLMediaPlayer/GraphUI: Support Displaying Bitmap'ed Subtitles ↵Sven Göthel2024-02-0217-277/+621
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (PGS ..) via FFMPEGFMediaPlayer/FFmpeg FFMPEGFMediaPlayer related changes: - Add libswscale (6th FFmpeg lib used) for sws_getCachedContext(), sws_scale() and sws_freeContext(), used natively to convert the palette'ed bitmap into RGBA colorspace -> GL texture - Handling AVSubtitleRect.type SUBTITLE_BITMAP -- only handled if libswscale is available -- config/adjust texture object -- sws_scale palette'ed bitmap to texture -- intermediate memory is cached, may be resized and free'ed at destroy -- texture objects are managed and passed from GLMediaPlayerImpl, as they are also forwarded to player client via SubBitmapEvent - Passing the AVCodecID to GLMediaPlayerImpl, converted to our CodecID enum. - Unifying creation and opening of AVCodecContext with 'createOpenedAVCodecContext(..)' +++ SubtitleEvent* - SubTextEvent now also handles ASS.Dialogue (FFmpeg 4) besides ASS.Event (FFmpeg 5, 6, ..). +++ GLMediaPlayerImpl - Added ringbuffer subTexFree, managing Texture for bitmap'ed subtitles -- Uses 1 bitmap-subtitle Texture per used textureCount in cache, as one bitmap-subtile can be displayed per frame. Could be potentially reduced to just 2 .. but resources used are relatively low here. - Validating subTexFree + videoFramesFree usage, use blocking get/put ringbuffer due to utilization from different threads. - Receives subtitle content from native getNextPacket0() via callback, creates SubtitleEvent instance and passes it to a SubtitleEventListener - if exists. (See MediaButton example) -- SubBitmapEvent also gets its special SubBitmapEvent.TextureOwner to handle client releasing the event and allowing us to put back the Texture resource to 'subTexFree'. This passing through of the Texture object is probably a weakness of this lifecycle and requires the client to ensure SubtitleEvent.release() gets called. See MediaButton example! - Exposing CodecID, allowing clients like MediaButton to handle SubtitleEvent content according to codec
* Bug 805: Graph/GraphUI TextureSequence Scale: Move ↵Sven Göthel2024-02-0111-38/+266
| | | | | | | | | Region.COLORTEXTURE_LETTERBOX_RENDERING_BIT to TextureSequence and add enabling/disabling of aratio adjustment + letter-box back-color TextureSequence color-texture params fetched from Graph VBORegion* and fed into shader. This allows more flexibility in aspect-ratio adjustment as well as setting a clipping background color for the added letter-box space.
* Vec[234][ifd]: Add toArray(..) methodSven Göthel2024-02-015-0/+39
|
* Bug 1494: Clarify SubtitleEvent class, adding general FFmpeg analog CodecID ↵Sven Göthel2024-02-016-45/+737
| | | | and hence also promoting VideoPixelFormat
* Graph shader (pass1 simple): USE_COLOR_TEXTURE: Clip to vec4(0) color using ↵Sven Göthel2024-01-311-4/+4
| | | | alpha 0 instead of the debug color white vec4(1), which leads to the white seam if out of gcu_ColorTexBBox
* Add Vec2f.set(Vec2i) and Vec2f(Vec2i); Add Texture.set(..) allowing a ↵Sven Göthel2024-01-312-0/+30
| | | | pending setup/update of texture and image dimensions
* GraphUI: Only issue Shape.mark*Dirty() if values were updated or data ↵Sven Göthel2024-01-311-4/+16
| | | | available; JOGL ImageSequence: Add addFrame(GL, TextureFrame), remove*Frame() and isSequenceAnimating()
* GLMediaPlayer: Split GLMediaFrameListener (rarely used) from ↵Sven Göthel2024-01-313-52/+129
| | | | | | | | | | GLMediaEventListener, easing listener callbacks; Prepare SubtitleEventListener generalization (Bug 1494) Moves pushSound(), pushSubtitle*() from FFMPEGMediaPlayer to GLMediaPlayerImpl, as it is handled in a generic way - even though currently only called by native FFMPEGMediaPlayer implementation. Note: This patch is incomplete, i.e. not even compile clean. But choses as-is to semantically split the work to ease review.
* Bug 1494: Add SubTextureEvent & SubEmptyEvent; Add SubtitleEvent.release() ↵Sven Göthel2024-01-315-31/+220
| | | | provided by owner to take back borrowed resources (texture of bitmap subtitle)
* GLMediaPlayer: Add getSubtitleCodec()Sven Göthel2024-01-292-2/+11
|
* FFMPEGPlayer: Prep for bitmap'ed subtitles: Use glEnable()/glBindTexture() ↵Sven Göthel2024-01-285-13/+36
| | | | | | | func-ptr in native; readNextPacket0() passes video+subtitle texTarget and texID For bitmap subtitles we need to push the bitmap into its own texture. Hence readNextPacket0() must switch to used texture using glEnable() on !core and glBindTexture().
* GLMediaPlayer/FFMPEGMediaPlayer: Add working subtitle (text + ass/saa) ↵Sven Göthel2024-01-288-27/+242
| | | | | | | | support via FFMpeg TODO: - We may want to refine subtitle PTS handling - We may want to support bitmapped subtitles
* GLMediaPlayer: Support tile metadataSven Göthel2024-01-274-26/+56
|
* GLMediaPlayer: Add initial subtitle support, track audio/video/subtitle ↵Sven Göthel2024-01-2710-79/+313
| | | | | | | | streams and languages and add convenient switchStream(..) entry. audio/video/subtitle streams and language metadata is maintained by arrays holding the stream-IDs and language string identifier. Implementation added in FFMPEGPlayer for these data-sets.
* GraphUI MediaPlayer: seek from display-thread, don't act on ↵Sven Göthel2024-01-271-3/+3
| | | | SliderAdapter.clicked() as dragged is always called
* GLMediaPlayerImpl: Throw out video_queue_growthSven Göthel2024-01-271-35/+2
|
* GLMediaPlayer: Fix playing with single-threaded mode w/ texture-count 1Sven Göthel2024-01-262-8/+15
|
* Math Vec*: Rename {scale->mul}(..) for non-scalar types (n-dim); Add div(..)Sven Göthel2024-01-266-50/+114
|
* Bug 1491: GLMediaPlayerImpl: Use a shared *GraphicsDevice for all compatible ↵Sven Göthel2024-01-251-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shared GLContext, removing resource restrictions In a use case with hundreds of GLMediaPlayer instances, this causes the application to bail out due to running out of resources. +++ GLMediaPlayer exposes resource restrictions and locking related with the created off-thread shared GLContext due to its newly created NativeWindow *GraphicsDevice instance (on X11). On the X11 platform, the *GraphicsDevice actually uses a native resource (X11 Display handle) and hence creating such device is costly and limited. To operate an off-thread GLContext w/o actual X11 input handling, it is *NOT* required to use a new instance. +++ Further more, the device is using locking. To operate an off-thread GLContext, it is *NOT* required to use locking on it as it does not perform actual X11 input handling etc. All operations are performed on the shared GL context. +++ Solution is to create a shared non-locking device clone compatible with the source. A share counter shall determine that the last one actually gets destructed. The usual ..
* Bug 1491: FFMPEGMediaPlayer: Lock moviePtr lifecycle phase in-between ↵Sven Göthel2024-01-251-69/+73
| | | | | | | | | [initStreamImpl - destruction] initStreamImpl() calls ffmpeg natives.setStream0(..), which in turn callsback to the GLMediaPlayerImpl and FFMPEGPlayer and hence requires a valid moviePtr. In total, it covers a longer time period. This patch uses a moviePtrLock object avoiding destruction while within initStreamImpl.
* Bug 1491: Add missing rename ↵Sven Göthel2024-01-251-2/+2
| | | | DefaultGraphicsDevice.swap{Device->}HandleAndOwnership()
* NativeWindowFactory.createDevice(..) w/ unitID for cloning; ↵Sven Göthel2024-01-251-3/+7
| | | | | | | | | | DefaultGraphicsDevice: Move ownership (Object) code into base class ensuring same code NativeWindowFactory.createDevice(..) w/ unitID - Allows cloning a device instance with same parameter. DefaultGraphicsDevice: Move ownership (Object) code final into base class ensuring same code - Rename DefaultGraphicsDevice.swapDeviceHandleAndOwnership() -> swapHandleAndOwnership()
* Bug 1488: Complete/Fix producing the 64-bit shaderKey: Use long values in ↵Sven Göthel2024-01-251-36/+28
| | | | | | | | | | bit-shift expressions and simplify it commit 1dcfdf71c09c6d774ac47012c05e09da4a085d7b - still used the 'hash code' bit shift pattern, not necessary -> simplified - the value as not ensured to be long, hence conversion occured This caused Graph's MSAA not being picked up properly using the shaderKey.
* Graph: Drop non-existing 'JAVA' font from FontFactorySven Göthel2024-01-252-192/+1
|
* VBORegionSPES2: Disable verbose flag in TextureSequence.setTexCoordBBox() .. ↵Sven Göthel2024-01-221-1/+1
| | | | oops
* Bug 1488: FFMPEGMediaPlayer: Fix getTextureFragmentShaderHashID(), i.e. use ↵Sven Göthel2024-01-221-6/+3
| | | | actual tc_w_1 = (float)getWidth() / (float)texWidth value as hardcoded within the shader.
* Bug 1488 - Graph RegionRenderer: Use a more deterministic 64-bit shaderKey: ↵Sven Göthel2024-01-221-31/+62
| | | | | | | | | | | | | | | | | | | | | | | [0-31] bit values and state, [32-63] colorTexSeqHash This leaves only room for a key collision on the 32-bit colorTexSeqHash value and hence should be save within our shader-code environment. + // # | s | + // 0 | 1 | isTwoPass + // 1 | 1 | pass1 + // 2 | 5 | ShaderModeSelector1 + // 7 | 1 | hasFrustumClipping + // 8 | 1 | hasColorChannel + // 9 | 1 | hasColorTexture + // 32 | 32 | colorTexSeqHash + long hash = ( isTwoPass ? 1 : 0 ); + hash = ( hash << 1 ) | ( pass1 ? 1 : 0 ) ; + hash = ( hash << 1 ) | sms.ordinal(); // incl. pass2Quality + sampleCount + hash = ( hash << 5 ) | ( hasFrustumClipping ? 1 : 0 ); + hash = ( hash << 1 ) | ( hasColorChannel ? 1 : 0 ); + hash = ( hash << 1 ) | ( hasColorTexture ? 1 : 0 ); + hash = ( hash << 1 ) | ( ( colorTexSeqHash & 0xFFFFFFL ) << 32 );
* Bug 1488 - Graph RegionRenderer: Ensure shaderPrograms1 path is disabled ↵Sven Göthel2024-01-221-6/+8
| | | | | | using 'static final boolean useShaderPrograms0 = true' For now, let's leave the dead shaderPrograms1 code path inside the class for further consideration.
* Bug 1490 - GraphUI Group: Resolve Performance Issues with Shape Mv Transform ↵Sven Göthel2024-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | -> PMVMatrix4f Shape.setTransformMv() is called for each renderer frame and for each shape, involving 6 Matrix4f.mul() and set*() operations. Since mutation of shape's position, rotation or scale is less frequent than rendering one frame (for all shapes), it is more efficient to maintain a local Matrix4f and update it on such single mutations. Rendering then only needs to perform one Matrix4f.mul() operation using this internal matrix. +++ Also changes name from setTransformMv(PMVMatrix4f) to applyMatToMv(PMVMatrix4f), as its name might be misleading.
* Bug 1488 - Graph RegionRenderer Shader Mapping: Revert to IntObjectHashMap ↵Sven Göthel2024-01-221-64/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and throw exception on shaderKey collision Commit 6363ae5fb6975a6f2e7c1093ce81f25b699e3e61 changed RegionRenderer.useShaderProgram()'s shader mapping using a new ShaderKey instance. Such ShaderKey instance is created every time @ RegionRenderer.useShaderProgram() to retrieve the ShaderProgram from the HashMap<ShaderKey, Shader Program>. While this is most correct, creating the ShaderKey instance causes a lot of temp objects. ShaderKey also uses the optional colorTexSeq shader code for equality test in case of hash-collisions. Previous code simply ignored hash-collisions and used a 1:1 hashCode -> ShaderProgram mapping using our IntObjectHashMap. However, there was no test whether collision occur. +++ Solution would be either 1- Revert fully to the previous code just using an IntObjectHashMap, but throwing a RuntimeException in case of hashCode collisions. In case of a collisions, we would need to produce a better hashCode. This is possible, as the underlying data is fully internal .. etc. 2- Use the IntObjectHashMap as long there is no hashCode collision, then revert back to HashMap<ShaderKey, Shader Program>. +++ This patch implements variant (1), so far no exception has been thrown on multiple demos w/ and w/o diff color-textures.
* Graph Clipping: Use Frustum Clipping using AABBox -> Mv transformed Cube -> ↵Sven Göthel2024-01-2017-130/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | Frustum mapping + GraphUI Support AABBox clipping naturally couldn't be transformed into 3D Model-View (Mv) Space, as it is axis aligned and only provided 2 points (min/max). Therefor we map the Group's AABBox to a 8-point Cube, perform the Mv-transformation and then produce the 6-plane Frustum. As before, we cull fully outside shapes within the Group's draw method and perform fragment clipping with same Frustum planes in the shader. With clipping enabled, the 3D z-axis getBounds() depth will be slightly increased for functional Frustum operation. This is also done for setFixedSize(Vec2f). The Frustum planes are copied to the Graph shader via float[4*6] -> uniform vec4 gcu_ClipFrustum[6]; // L, R, B, T, N, F each {n.x, n.y, n.z, d} +++ Concludes related work of below commits - 1040bed4ecc6f4598ea459f1073a9240583fc3c3 - 5cca51e32999a882e2a5f00cb45ecafc824ffd86
* Frustum: Revise code and its Plane definition to support Cube->Frustum as ↵Sven Göthel2024-01-194-51/+199
| | | | | | | | | | | | | | | | | | | | | | | | | well as to extract planes for float[] vec4-shader uniforms. commit 1040bed4ecc6f4598ea459f1073a9240583fc3c3 added AABBox -> Cube -> Frustum mapping (incomplete) and requires Frustum.Plane.set(..) by normal and point-on-plane for distance. Frustum.isOutside(Cube) has been added, testing all its 8-points similar to AABBox. Further all 6 Frustum.Plane shall be extracted to Vec4f and float[], the latter to pass the whole float[4*6] as a vec4[6] uniform array to the shader. +++ Constructor, setter and getter have been adjusted accordingly. Most of the loops have been unrolled. +++ Method names to query Frustum, i.e. 'is*Outside(<Type>)' have been reduced to 'isOutside(<Type>)' where <Type> uniquely indenticates the purpose. Hence only 'isSphereOutside()' is left over.
* Add Cube to Frustum Plane mapping, supporting transformation of object-space ↵Sven Göthel2024-01-192-1/+251
| | | | AABBox into model-view Cube to Frustum.Plane for culling (cpu) and clipping (gpu)
* AABBox: Rename private fields {bl, tr} -> {lo, hi} denoting proper ↵Sven Göthel2024-01-191-137/+137
| | | | | | | | | | | orientation in API doc br, tr wasn't sufficient as in commit d778889f36bd6bee999ceb502c5f0ce265b014bf while working on Frustum, as it doesn't properly reflect axis order not z. Hence going back to 'low' and 'high' semantics, but using same length identifier and emphasizing far (lo) < near (hi) of our model-view coordinate system.
* Graph/GraphUI AA-Quality + SampleCount (shader): Push params down to ↵Sven Göthel2024-01-168-101/+136
| | | | | | | | | | | | | | | | | | RegionRenderer's RenderState usually rarely set from top of user API, reducing complexity. Discussion: Alternative was to pass AA-Quality same as SampleCount from the top (e.g. GraphUI Scene), however, this convolutes the API even more. Both parameter modify the resulting shader code in pass2 rendering (only). The used 'renderMode' is still maintained within the Region, since it contains more dynamic states individual to each Region instance (color-texture, ..). This despite 'renderMode' also changes the RenderState's shader program. In the end, it really doesn't matter and is a choice of frequency - the pipeline is usually rendering from on OpenGL rendering thread sequentially. AA-Quality and SampleCount simply usually don't change that often and are set only once.
* AABBox: Add intersects(AABBox), contains(AABBox), scale(float, float, float) ↵Sven Göthel2024-01-151-0/+59
| | | | and scale2(float, float, float)
* AABBox: Rename private fields low -> bl and hight -> tr for readability; ↵Sven Göthel2024-01-151-149/+187
| | | | Unroll getRayIntersection()'s 'find candidate planes'
* Graph/GraphUI AA-Quality (shader): Region: Add DEFAULT_AA_QUALITY and ↵Sven Göthel2024-01-153-20/+34
| | | | | | | | | | | | | | | | | | | | | | | | clipping funs for aaQuality/sampleCount; TextRegionUtil: Pass quality parameter in draw-functions Region.DEFAULT_AA_QUALITY defaults to MAX_AA_QUALITY still - TODO: AA shader is subject to change .. Region.draw(..) clips the quality param (save) TextRegionUtil: Pass quality parameter in draw-functions - Allowing to select the AA shader GraphUI Scene and some demos add the AA-quality param to the status line or screenshot-filename. - See Region.getRenderModeString(..) +++ TestTextRendererNEWT20 and TestTextRendererNEWT21 now iterate through all fonts, AA-quality shader and sample-sizes. Most demos and some more tests take AA-quality into acount, demos via CommandlineOptions.graphAAQuality
* Bump (c) -2024 for edited files + LICENSE.txtSven Göthel2024-01-1412-14/+14
|
* Graph/GraphUI: Revise Graph Region ShaderMapping, fix AABBox-Clipping for ↵Sven Göthel2024-01-1419-327/+481
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass2-AA, revise Pass2 AA Quality parameter .. Misc: - Graph VBORegion2PVBAAES2: Drop unused FBO rescale - Move MIN/MAX QUALITY/SAMPLE from GraphUI Scene -> Graph Region +++ Quality -> Pass2 AA Quality - Drop quality field in region - Pass quality to GLRegion.draw(..) similar to sampleCount for dynamic shader and switch - TODO: Pass quality parameter in TextRegionUtil's functions Fix RegionRenderer Shader Mapping - Use ShaderKey class to properly implement the hash value and equals method - For this, TextureSequence.getTextureFragmentShaderHashID() has been added to provide actual shader-snippet for the equals function - All required criterias are included in the hash value and equals method Fix AABBox Clipping for Pass-2 AA - Clipping in pass2-AA must happen in pass2 on actual gcu_PMVMatrix01 (not ortho) +++ GraphUI GraphShape - Rename: [get,set]{->AA}Quality() GraphUI Scene - Rename: mark{All->}ShapesDirty(), set{AllShapes->}Sharpness(), set{AllShapes->AA}Quality() - Fix setSampleCount(..), i.e. markStatesDirty() not markShapesDirty() - Fix setAAQuality(), markShapesDirty() and markStatesDirty(): Use forAll(..) to traverse through all shapes and groups. GraphUI Group - Add setFixedSize() - Add setClipOnBox() - Document setRelayoutOnDirtyShapes(), isShapeDirty()