databrary / datavyu-ffmpegplugin

A Java Media Player based on FFmpeg and SDL2
GNU General Public License v3.0
13 stars 4 forks source link

Enable SDL player #166

Closed TheoWolf closed 5 years ago

TheoWolf commented 5 years ago

In order to embed an SDL window into a JFrame, we need to create a dummy SDL window with OpenGL enabled and share the pixel format with the SDL window that will be embedded into another frame (this approach will remove crashes when resizing the SDL window in charge of the display). However, mixing OpenGL with SDL Renderer cause a crash when destroying the renderer during the cleaning phase (On windows: JVM crashes when destroying the player, ACCESS_Violation When destroying the renderer.) The purpose of embedding the SDL window into a JFrame (or any other Window with window handle) is to forward the key events implemented in the Java Side (in our case is Datavyu) to the Native side, this option is postponed for now, the SDL Window is displayed in the Native Side, the safest way to handle events when the SDL window is in Focus is to dispatch the key event to the Java Side and process it there.

TheoWolf commented 5 years ago

Remaining bug: SDL player mute is not working #167