-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New iOS backend, build system and desktop updates. #77
New iOS backend, build system and desktop updates. #77
Conversation
…5, partially works
This removes support for 32-bit Linux x86
A small update on the progress: In the last days I focused on getting Linux builds to work, and on building and testing the included test projects. I also updated the github actions to work with the Gradle changes, but I couldn't test the changes to snapshot and release publishing. Known Issues / Things that I'll still work on:
As I won't have much time the next weeks, I'll skip the preload system for now and focus on fixing bugs and making the current version more stable. Once this is done I'll mark this PR as ready for review. I still think the build and documentation updates and the iOS backend benefit the library users and potential new contributors. I don't want to delay this until the preload system is fully done. |
On desktop, this removes the custom I/O and fixes issues with uninitialized audio and video buffers.
Here are some more comments about the changes to the build system: Gradle and dependency versionsGradle and the dependencies are brought up to the same versions as current libGDX:
This required replacing the 'maven' plugin with 'maven-publish'. Github ActionsThe actions were updated to work with the updated gradle versions. For this, the java and gradle setup were borrowed from libGDX's actions. Also, the natives builds were split up into Linux, Mac and Windows. These jobs upload to a common 'desktop-natives' artifact, which is consumed by the final 'gradle-build' job. The 'desktop-natives' artifact is also comfortable to download and use for local building and testing. Desktop natives building(gdx-video-desktop/build.gradle) The compile steps for the desktop natives remain the same: First, a custom build of FFmpeg is compiled. Then, this build is combined with own logic via gdx-jnigen to produce a shared library with everything included. The configuration of the compile tasks works slightly different now. A
The flags were updated to work with the updated FFmpeg version and additional support for AV1/Opus |
Here are some more comments about the updated desktop implementation: The FFmpeg submodule was updated to version 5.1.3. This required significant changes to the VideoDecoder class, but also allowed to make some things simpler. The FFmpeg initialization and custom I/O methods are not required anymore. An overview what the code does:
|
On the iOS implementation: I feel it is quite straight forward overall. When calling update, we check the video output for new frames and create a libGDX Texture from it. |
gdx-video-robovm/src/com/badlogic/gdx/video/VideoPlayerIos.java
Outdated
Show resolved
Hide resolved
public void draw (Batch batch, float parentAlpha) { | ||
Texture texture = player.getTexture(); | ||
if (texture == null) return; | ||
texture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to set a TextureFilter
? Is it needed to be set on every draw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt the steps were too visible from the default Nearest
filter, when resizing the window from the examples. But to be honest, what looks best is subjective.
The filter stays on the texture once it is set, so there is no need to set it multiple times. However, setting it just once doesn't always work, as the texture object may change in some cases. So this implementation is simple and reliable rather than optimal.
Looking at it a second time however, I don't like how this doesn't allow users of VideoActor to set another filter if it fits their game better.
I could make the filter configurable in VideoActor and make the implementation more optimal. Or just remove it from VideoActor for now and let the user handle all of it. Which would you prefer for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think removing it is the best option for now. Another solution would be to set the filter as an attribute for the player, so when a new texture is created, it can be applied
Thanks for the massive work! |
On desktop, AV1 seems not to work. Any thoughts? Only tried on Windows and encoding with
After reading the error, I tried encoding with |
Hello everyone,
This draft PR includes larger changes to add video support into our game.
Original changes:
Added later:
I focused on the features and platforms that are needed in our game, so GWT and Windows aren't as thoroughly tested. (edited)
I understand that this is quite a lot to review as one, but I could not separate the code from the build system changes.
Still, please feel free to test the current state and leave feedback, questions or suggestions.