summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
Commit message (Collapse)AuthorAgeFilesLines
* AWTPrintLifecycle: Add detailed API docSven Gothel2013-09-081-1/+62
|
* Test: Don't resize frame, tweek print-matrix; AWTPrintLifecycle: Add scale ↵Sven Gothel2013-09-084-90/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and convenient AWT container traversal context; GLCanvas/GLJPanel properly handle existing MSAA and req. AA; - Test: Don't resize frame, tweek print-matrix - Use scaleComp72 to scale the frame to fit on page, i.e. global print matrix - Use scaleGLMatXY = 72.0 / glDPI to locally scale on the GL drawable as being passed to AWTPrintLifecycle.setup(..) - Hence frame stays untouched/stable, no need for 'offscreen' print test, which is removed. - AWTPrintLifecycle: Add scale and convenient AWT container traversal context Use a simple decoration for all AWTPrintLifecycle impl. components within a container: final AWTPrintLifecycle.Context ctx = AWTPrintLifecycle.Context.setupPrint(frame, g2d, scaleGLMatXY, scaleGLMatXY); try { } finally { ctx.releasePrint(); } - GLCanvas/GLJPanel properly handle existing MSAA and req. AA; - GLCanvas: Workaround bug where onscreen MSAA cannot switch to offscreen FBO, i.e. stay 'onscreen' - GLJPanel: Use new offscreen FBO if MSAA is requested and not yet used. - GLJPanel.Offscreen.postGL(): always swapBufer(), was missing for !GLSL swapping Results GLCanvas / GLJPanel: - Good scaling - Stable behavior / visibility - High DPI mode works
* TiledPrintingAWTBase: Fix scaling - Fit frame to page, add MSAA ↵Sven Gothel2013-09-074-30/+52
| | | | | | | | | | | | | | RenderingHints test; setupPrint(Graphics2D): Query RenderingHints to use MSAA rendering - AWTPrintLifecycle.setupPrint(Graphics2D): Query RenderingHints to use MSAA rendering - Impl. in GLCanvas - TODO GLJPanel (would need a new offscreen buffer) - TiledPrintingAWTBase: - Fix scaling - Fit frame to page - add MSAA RenderingHints test - GLCanvas: Remove dumpStack() DEBUG output
* TileRenderer*: Fix FBO MSAA use-case, i.e. call swapBuffers() before ↵Sven Gothel2013-09-073-14/+47
| | | | | | | | | | | endTile(); Enhance unit tests for MSAA, also add TileRendererBase.TileRendererNotify to GearsES2 GL[Auto]Drawable.swapBuffers() must be called before endTile(). This is especially important if using multisampling offscreen FBO drawables, where swapBuffers() triggers the <i>downsampling</i> to the readable sampling sink. Otherwise, we will be 'one tile behind' !
* Fix TileRenderer*: Allow general usage w/ any GL profile, only image-buffer ↵Sven Gothel2013-09-073-25/+77
| | | | | | | | | | | | | requires >= GL2ES3; Always set pack-alignment, Set glReadBuffer(..) >= GL2ES3 - Allow general usage w/ any GL profile, only image-buffer requires >= GL2ES3 Due to GL2ES3.GL_PACK_ROW_LENGTH and image-width != tile-width - Always set pack-alignment Forgot for tile-buffer - Set glReadBuffer(..) >= GL2ES3 Required if using FBO offscreen, i.e. MSAA mode.
* Complete commit 54dcdf1f53c9fc1f7124cf77bbf5aa952d42053a, exposing GL2ES3 in ↵Sven Gothel2013-09-074-14/+15
| | | | GLProfile (just a query, no new profile)
* AWT/GL Printing WIP: Abstract AWT tile painting code out to AWTTilePainter, ↵Sven Gothel2013-09-073-301/+300
| | | | reused w/ GLCanvas and GLJPanel
* GLCanvas Printing WIP: Add GLJPanel; GLCanvas TILE_SIZE 512; ↵Sven Gothel2013-09-062-75/+339
| | | | print(Graphics): Don't force on AWT-EDT -> Deadlock; releasePrint(): perform reshape/display!
* Add AWTPrintLifecycle interface describing impl. w/ ↵Sven Gothel2013-09-062-1/+52
| | | | setupPrint()/releasePrint(), modularize unit test TestTiledPrintingGearsAWT
* GLCanvas Printing WIP: Perform all print* operations on AWT-EDT, clip before ↵Sven Gothel2013-09-061-147/+184
| | | | drawing image and show same; Test: Add offscreen print and add borders.
* TileRenderer*: Add more detailed 'toString()' - override for TileRendererSven Gothel2013-09-062-4/+24
|
* GLCanvas Printing WIP: Swap to offscreen at setupPrint(); Use TileRenderer @ ↵Sven Gothel2013-09-061-107/+129
| | | | | | | | | | | | | | | | | | | | | | | | print(..); Test: Add auto-print w/o UI 72dpi and 300dpi NOTE: Tile raster is added at print plus lots of debug output - WIP! - Swap to offscreen at setupPrint() - Swap GLEventListener (GLEL) and GLContext to fixed size offscreen GLAutoDrawable (GLAD) - Destroy onscreen drawable/context - Setup TileRenderer w/ offscreen GLAD - @ releasePrint() restore onscreen .. This shall ensure we don't hog the GPU resources when resizing the AWT component (upscaling). - Use TileRenderer @ print(..) The clip-rect will be used as the TileRenderer's image-size and we perform a whole tile-rendering loop. This helps to limit resources, see above. - Test: Add auto-print w/o UI 72dpi and 300dpi
* TileRenderer*: TileRenderer adds setTileOffset(..), getParam(pname) shall ↵Sven Gothel2013-09-063-36/+23
| | | | | | | | | | | | | | | | | | | always return last result, no overloading of attachToAutoDrawable(..); Fix comments TileRenderer: - adds setTileOffset(..) A tile offset might be required, i.e. via a given rectangular clip bounds - getParam(pname) shall always return last result Even when finished tiling, the last value shall be returned, otherwise a post endTile() is unable to retrieve the value. - No overloading of attachToAutoDrawable(..) No reason to complicate usage by mutating semantics, call setTileSize(..) manually TileRendererBase: - Fix API doc: TR_CURRENT_TILE_X_POS, TR_CURRENT_TILE_Y_POS
* GLDrawableUtil.swapGLContextAndAllGLEventListener: Fix comment - Add remark ↵Sven Gothel2013-09-061-0/+4
| | | | about GLAnimatorControl's which association gets swapped as well.
* GLVBOArrayHandler: Remove unused importsSven Gothel2013-09-051-3/+0
|
* GLCanvas Printing WIP - Add TestTiledPrintingGearsAWTSven Gothel2013-09-052-31/+38
|
* TileRendererBase: API-doc cleanup; Fix GLCanvas, WIP printing ..Sven Gothel2013-09-052-68/+124
|
* TileRendererBase: Add interface TileRendererNotify, to notify implementing ↵Sven Gothel2013-09-051-8/+40
| | | | | | | | | | | | | GLEventListener about attached/detached TileRenderer .. since GLEventListener's reshape(..) method must query certain tile renderer attributes (tile pos and image size), they have to be aware of the TileRendererBase. To simplify such awareness and hence automate this attachement and passing over the tile renderer reference, they should implement this new interface. Gears example implements the new interface, which caches the TR reference and pauses rotation.
* TileRendererBase: Add toString(), Proper tile unit test names, i.e. add NEWT ↵Sven Gothel2013-09-052-2/+12
| | | | for UI agnostic (no-awt tests).
* TileRenderer*: Enhance API Doc; Cleanup OO; Remove PMVMatrixCallback, use ↵Sven Gothel2013-09-054-201/+275
| | | | | | | | | | | | | GLEventListener reshape(..) or manual reshape after beginTile(..) method. GLEventListener reshape(..) method should be aware of TileRenderer usage and get the missing tile position and image size from it (-> see Gears example). TestRandomTiledRendering3GL2AWT demos AWT GLCanvas onscreen being used for random tile rendering to produce a PNG file. TestTiledRendering1GL2 is now GLAutoDrawable/GLEventListener agnostic, hence demos plain GLDrawable tile rendering usage.
* TileRenderer*: Align impl. to common abstract superclass TileRendererBase ↵Sven Gothel2013-09-043-384/+380
| | | | (cleanup / API doc)
* TileRenderer: Unify TileRenderer, add RandomTileRenderer (both utilizing ↵Sven Gothel2013-09-043-213/+630
| | | | GLPixelBuffer, and pre/post GLEventListener)
* PNGImage: Bounds check in getPixelRGBA8(..) and setPixelRGBA8(..)Sven Gothel2013-09-041-0/+8
|
* GLPixelBuffer*: Add componentCount==1 (ALPHA/RED), 'allowRowStride' ↵Sven Gothel2013-09-047-80/+152
| | | | | | | | | | | | | | | | | utilization AWTGLPixelBuffer* -> GLPixelBuffer* GLPixelBufferProvider: - Default*.getAttributes(): Add componentCount==1 (ALPHA/RED), validate values, throw exception if n/a or not supported - Add 'allowRowStride' (as for AWTGLPixelBufferProvider) - Add default for true and false GLPixelBuffer: - Add 'allowRowStride' (as for AWTGLPixelBuffer) - Fix requiresNewBuffer(..): - aquire minByteSize if passed one is <= 0 - validate minByteSize w/ currentByteSize according to allowRowStride. AWTGLPixelBuffer: 'allowRowStride' impl. moved to GLPixelBuffer.
* Cleaned up TiledRenderer capable to be used w/ GL2ES3 and TiledRenderer2 to ↵Sven Gothel2013-09-033-601/+576
| | | | | | | | | | | | | | be used w/ GLAutoDrawable. - Remove GL2 dependencies - Only requires PixelStorage ROW_LENGTH -> GL2ES3 - Position target buffer position according to skip [pixels, rows] - Use an interface PMVMatrixCallback, allowing user to reshape the custom 'PMV Matrix' according to the current rendered tile - Properly adjust tile/image buffer to written position and flip for read operation
* GLReadBufferUtil.readPixels(..): Use plain int values for inWidth/inHeight, ↵Sven Gothel2013-09-032-12/+9
| | | | instead int[] - no return value desired.
* GLPixelStorageModes: Fix API doc references, Add ↵Sven Gothel2013-09-031-5/+39
| | | | set[Pack|Unpack]RowLength(GL2ES3 gl, ..)
* GLBuffers: Align commentSven Gothel2013-09-031-1/+1
|
* GL*, GLContext: Expose isGL2ES3() and getGL2ES3() for convenience.Sven Gothel2013-09-033-0/+23
|
* Fix Bug 810: Adding Julien Gouesse's fix while moved the new ↵Sven Gothel2013-09-021-6/+2
| | | | 'addNativeJarLibsJoglCfg(..)' to GlueGen, commit c0ead6fa10280f8076704726d59f482b183fd77e
* Revert commit 4beef4fe856690b070ba06a6caf4515aebd7171b manually for testing ↵Sven Gothel2013-09-021-2/+2
| | | | purposes .. (ATI fglrx driver issues)
* X11GLXDrawableFactory.Shutdown: Disable shared context destruction since it ↵Sven Gothel2013-09-021-2/+2
| | | | | | | | | may lead to a JVM freeze .. .. on ATI fglrx driver 32bit on 64bit w/ a frozen shared GL context involved. Hence we have to rely on the driver cleanup when JVM hits 'exit', equal to the Windows implementation.
* Animator/GLWindow: Catch 'ThreadDeath/Throwable' and dump info in DEBUG mode ↵Sven Gothel2013-09-022-1/+6
| | | | (cosmetic change only); Typo in comment; TestSharedContextListNEWT2: Stop animator.
* FFMPEGMediaPlayer: Handle use-case of having [av|sw]resample lib, but not ↵Sven Gothel2013-09-011-2/+2
| | | | | | | compiled for it -> pass Scenario ffmpeg-0.10, where we are not prepared (compiled-in) for sw-resample support. Don't use if compiled in version (CC) is < 0 (n/a), and allow to pass at load time.
* GLMediaPlayer: pause() -> pause(boolean flush): Allowing to flush buffers, ↵Sven Gothel2013-08-312-17/+35
| | | | next frame after play() will provide new frame. Added API doc.
* GLContext: Add missing 'isGLESProfile()' and fix 'isGLcore()', i.e. GL2ES2 ↵Sven Gothel2013-08-311-1/+2
| | | | -> GLES2 (in profile set)
* GLMediaPlayer enhancements: State, Camera options, detect and act on ↵Sven Gothel2013-08-308-43/+140
| | | | | | | | | | | | | | | | | | | | orientation change (flipped), API-doc, - State - Fix state transition (initGL() error) - Camera options - options uses ';' as query separator - don't use 'default' options, driver should know - Detect and act on orientation change (flipped) - ffmpeg impl detects if flipped changes and triggers a SIZE update event. This allows application to react, i.e. re-init GL and use new TextureCoord's. Test: Works well on Windows w/ rawvideo dshow camera driver/codec. - API-doc - TexSeqEventListener/GLMediaEventListener usage / constraints (GL, ..) - State transition fix
* Texture: Add 'setMustFlipVertically(boolean)' allowing to change the flipped ↵Sven Gothel2013-08-301-4/+21
| | | | characteristics.
* FFMPEGMediaPlayer: Handle v-flipped 'bottom-up' pictures ; Refine API doc ↵Sven Gothel2013-08-302-4/+7
| | | | | | | | | | | | | | | | | | 'camera ID' If linesize is < 0, it is not invalid as assumed in commit eca6a5cb1e2beda84dfbafc31ed225e272f4f3fb, but vertically flipped (bottom-up). We have to adjust the data pointers, which are moved to the upper end of memory as well and can proceed as usual. TODO: - Update texture 'mustFlipVertically' to 'false' in this case. - Later: - Allow updating texture size .. - Whole pixel-fmt/texture-lookup-shader association must scale better, i.e. extract the 'knowledge' into one class, use a static shader code using uniforms instead of hard-coded values .. etc.
* Enhance GLMediaPlayer: Full FFMPeg support, 'dshow' camera support on ↵Sven Gothel2013-08-2910-158/+366
| | | | | | | | | | | | | | | | | | | | | | | | | | | | windows, 2 more pixel formats, fail-safe data handling - add support for ffmpeg 2 / libav 10 -> lavc55_lavf55_lavu52_lavr01 - add support for ffmpeg libswresample (similar to libavresample) - handle BGRA (GL type) and BGR24 (texture shader) - Change Camera URI semantics, drop 'host' and use 'path' for camera ID and use 'query' for options. - add support for Window's DShow camera selection - our camera id -> index of list of video-input devices, this gives us same behavior as w/ Linux - requires windows libs: strmiids, uuid, ole32, oleaut32 - Compiles w/ MingW64, works w/ libav/ffmpeg - TODO: test compilation w/ MingW 32bit ! - don't push data to texture if (linesize <= 0) this may happen due to buggy decoder / setup .. Tested manually on GNU/Linux x64 and Windows x64: - GNU/Linux libav 0.8, libav 9, libav 10, ffmpeg 1.2, ffmpeg 2.0 - Windows libav 0.8, libav 9, ffmpeg 2.0 - videos and camera
* Fix libav/ffmpeg compilation; FFMPEGMediaPlayer Enahncements (More YUV*, Use ↵Sven Gothel2013-08-283-154/+286
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | def. high camera options, cleanup symbols) - Fix libav/ffmpeg compilation - Split native GLContext code from JoglCommon - JoglCommon is required for ffmpeg_* c-compile/link - Supported versions now: - 0.8 53.53.51 - 9.0 54.54.52 - FFMPEGMediaPlayer - Update API doc, add compatibility .. etc - Pixel format conversions (via shader texture lookup func): - YUV420P, YUVJ420P - YUV422P, YUVJ422P - YUYV422 - Properly handle aid/vid - In camera mode: set high default values - TODO: Make it configurable via camera URI: - video_size - framerate - ? - FFMPEGDynamicLibraryBundleInfo - Cleanup symbols / remove unused (pre 53) - Add av_dict_* methods
* FFMPEGMediaPlayer: Fix av-audio-fmt -> AudioFormat parsing (fixedP was wrong ↵Sven Gothel2013-08-281-8/+7
| | | | for float values)
* GLBuffers: Add forma GL_YCBCR_422_APPLE and types ↵Sven Gothel2013-08-271-8/+32
| | | | GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE.
* GLMediaPlayer: Add camera input / FFMPEG: Fix 'av_packet' leak and add ↵Sven Gothel2013-08-278-68/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | missing symbol 'av_realloc'. - Add camera input - Use URI w/ scheme 'camera' to determine camera input is desired, use URI host as camera id. E.g. 'camera://0' for 1st camera. - AndroidGLMediaPlayerAPI14: Via 'Camera' - FFMPEG*: Via libavdevice, device name and input format - TODO: Add controls to manipulate camera if available - FFMPEG* - Add symbols - avcodec_register_all - av_realloc (was missing) - avdevice_register_all - Load libavdevice (opt) - Camera: - Use <ID> (windows) and /dev/video<ID> other OS - simply find the input format in native code - Support YUYV422 (used in video4linux2, etc.) - Stuff 2x 16bpp (YUYV) into one RGBA pixel! - Add texture format for 16bpp - Add texture lookup shader - Fix av_packet leak in readNextImpl(..) - Restore orig pointer and size values, we may have moved along within packet. Then call av_free_packet(). - Use null AudioSink if audio-id is NONE
* ALAudioSink: Remove force DEBUG infoSven Gothel2013-08-261-1/+1
|
* FFMPEGNatives*: Add missing license headerSven Gothel2013-08-264-0/+108
|
* libav/ffmpeg: Compile/Link 2 versions of native FFMPEGMediaPlayer methods ↵Sven Gothel2013-08-267-250/+383
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ffmpeg/libav: Remove 'dead' audio/video frame count relation snoop-codeSven Gothel2013-08-261-9/+5
|
* libav/ffmpeg: version9: Add libavresample support ; Proper AudioFormat ↵Sven Gothel2013-08-262-80/+171
| | | | | | | | | | | | | | negotiation w/ AudioSink; Misc - Add libavresample support - Resample if avail && (!AV_SAMPLE_FMT_S16 || !prefSampleRate || !sinkSupported) - Resample to: prefSampleRate (if set), AV_SAMPLE_FMT_S16 and min(channelCount, maxChannelCount) - Proper AudioFormat negotiation w/ AudioSink; - Utilize AudioSink's 'isSupported(AudioFormat)' - Misc - use 'av_get_bytes_per_sample(fmt)' always, don't assume 2
* AudioSink: Fixe type names ; Enhance AudioFormat negotiation ; ALAudioSink ↵Sven Gothel2013-08-264-92/+247
| | | | | | | | | | | | | | | | | | | | | | 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.