Skip to content

ModinMobileSTS/GdxVideoDesktopAndroidNative

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GdxVideoDesktop Android Native

This project builds Android native replacements for desktop gdx-video library files:

  • libgdx-video-desktoparm64.so
  • libgdx-video-desktoparm.so

The JNI surface is compatible with:

  • com.badlogic.gdx.video.VideoDecoder
  • com.badlogic.gdx.video.FfMpeg

The core decoder implementation is ported from upstream gdx-video-desktop C++ code and linked against FFmpeg static libraries built for Android.

Project Layout

  • src/main/cpp/
    • Upstream decoder core (VideoDecoder.*, threading utilities)
    • JNI bridge (jni_bridge.cpp)
  • third_party/ffmpeg/
    • FFmpeg source and per-ABI build outputs
  • scripts/build_ffmpeg_android.ps1
    • Builds FFmpeg static libs for Android ABIs
  • scripts/build_native_android.ps1
    • Builds gdx-video compatibility .so using Android NDK CMake
  • scripts/inject_into_modjar.ps1
    • Injects built .so files into a mod jar root

Prerequisites

  • Windows PowerShell
  • Android NDK (detected from ANDROID_NDK_HOME / SDK path)
  • cmake in PATH
  • bash in PATH (Git Bash is supported)
  • git in PATH
  • jar in PATH (from JDK)

1) Build FFmpeg for Android

cd D:\Desktop\GdxVideoDesktopAndroidNative
.\scripts\build_ffmpeg_android.ps1

Note: asm is disabled by default for NDK compatibility when linking static FFmpeg into shared .so.

Optional:

  • Clean rebuild:
.\scripts\build_ffmpeg_android.ps1 -Clean
  • Re-enable asm (not recommended on this setup):
.\scripts\build_ffmpeg_android.ps1 -DisableAsm:$false

2) Build native gdx-video libs

.\scripts\build_native_android.ps1

Outputs:

  • out\arm64-v8a\libgdx-video-desktoparm64.so
  • out\armeabi-v7a\libgdx-video-desktoparm.so

3) Inject libs into a mod jar

.\scripts\inject_into_modjar.ps1 -ModJar "D:\path\to\your_mod.jar"

Default output jar:

  • <original-name>.android-video.jar

4) Runtime expectation

If your runtime loader maps gdx-video-desktop to:

  • libgdx-video-desktoparm64.so on arm64
  • libgdx-video-desktoparm.so on armv7

then the mod can call desktop gdx-video APIs unchanged.

Notes

  • This project targets Android-hosted JVM environments that run desktop STS mods.
  • FFmpeg feature set is intentionally constrained to common STS mod formats:
    • containers: ogg, matroska/webm, mov/mp4
    • decoders: vorbis, opus, aac, vp8, vp9, theora, av1
  • If a mod uses additional codecs, extend build_ffmpeg_android.ps1 configure flags.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors