v0.9.1-android (deprecated)
Version 0.9.1
- Android FFplay Video Output: Implemented full video rendering on Android using SDL
dummyvideo driver +softwarerender driver. Each decoded frame is read from SDL's in-memory back-buffer viaSDL_RenderReadPixelsand blitted row-by-row to the registeredANativeWindowviaANativeWindow_lock/post. ASDL_CreateWindowinterceptor inffplay_lib.clogs dimensions and forwards to SDL without requiringSDLActivity. Newffmpeg_kit_android.cprovides JNI glue that retains theANativeWindowfor the playback session. - Android FFplay Audio Output: Set
SDL_AUDIODRIVER=openslESon Android to use the fully-native OpenSL ES backend (noJavaVM/JNI_OnLoadrequired). AAudio is also compiled in for API 26+ devices. - New Android Java API: Added
FFplayKitAndroid.java(com.akashskypatel.ffmpegkit) exposingsetAndroidSurface(Surface)for binding aSurfaceVieworTextureViewsurface before playback. AddedgetNativeWindowPtr(Surface)→longandreleaseNativeWindowPtr(long)for acquiring and releasingANativeWindow*references directly from Dart FFI. - New C/C++ API: Exposed
ffplay_set_android_window(ANativeWindow*)inffplay_lib.hfor native-layer surface control. Added C wrapper functionsffplay_kit_set_android_surface_ptr(int64_t)andffplay_kit_clear_android_surface()for direct Android surface management from Dart FFI. Addedffplay_kit_register_frame_callback()/ffplay_kit_unregister_frame_callback()andFFplayKitFrameCallbacktypedef for desktop (Linux/Windows) pixel delivery. Addedffmpeg_kit_get_build_stamp()for DLL version verification. - SDL2 Android Build Fix: Replaced the broken autotools
configurepath (dropped in SDL2 2.x) with a CMake build using the Android NDK toolchain. EnablesSDL_OPENSL,SDL_AAUDIO,SDL_VIDEO, andSDL_RENDERbackends. - Android AAR Orchestration: Reworked the build pipeline to collect all per-architecture targets first, then invoke
android-aar.shonce after all arch builds complete. Added--no-bundleand conditional--cleanflags for Android build steps. - Android Build Fixes: Fixed AAR creation guard (
create_bundleflag), correctedjniLibsoutput path to useWORKDIR/host_platform, fixed Maven Central namespace toio.github.akashskypatel.ffmpegkit, and corrected package status check return value. - Symbol Conflict Resolution: Fixed LLVM symbol collisions by explicitly linking system LLVM-17 before libtorch. Added proper RPATH configuration for shared library discovery on Linux/Android.
- Stats Callback Fix: Corrected stats time unit passed to the C callback — now reported in milliseconds (was fractional seconds).
- Video Stream Probe API: Added
ffplay_has_video_stream(path)toffplay_lib.handffplay_kit_has_video_stream(path)to the C ABI wrapper. Probes a file or URL for a video stream usingavformat_open_input+avformat_find_stream_infowithout decoding. Returns 1 (video present), 0 (audio-only), or -1 (error). Thread-safe. - Live Video Dimension API: Added
FFplaySession::getVideoWidth()andFFplaySession::getVideoHeight()to the C++ session API. Returns the current decoded frame dimensions from an active FFplay session, or 0 if no video stream is open. - Audio-only Size Guard:
ffplay_get_video_size()now returns0×0when no video stream is present (video_st == NULL), preventing FFplay's audio-visualization window dimensions from being mistaken for video dimensions. ffplay_get_video_sizeThread Safety: Addedffplay_api_mutexlock andactive_ffplay_ctx == ctxvalidation toffplay_get_video_size(), matching the pattern used by all other getters. Prevents use-after-free ifffplay_free()races with a concurrentgetVideoWidth()/getVideoHeight()call.- ANativeWindow Reference Leak Fix: Removed redundant
ANativeWindow_acquire()ingetNativeWindowPtr()—ANativeWindow_fromSurface()already transfers ownership.releaseNativeWindowPtr()now correctly balances the single reference. FFplayKit::setAndroidSurfaceReference Leak Fix: Added a static retainedANativeWindow*in the C++ path so the reference fromANativeWindow_fromSurface()is properly released on the next call, mirroring theg_retained_windowlifecycle inffmpeg_kit_android.c.- Pixel Buffer Performance: Replaced per-frame
av_malloc/av_freeinffplay_step()(both Android blit and desktop callback paths) with a static reusable buffer that is only reallocated when frame dimensions increase. Eliminates ~240 MB/s of allocation churn at 1080p/30fps. - Android AAR Build Script Fix:
ANDROID_PLATFORM_ARCHSarray is now populated only whenplatform == android, preventing spurious non-Android arch entries (e.g.android-x86_64from a Linux build pass) from being passed toandroid-aar.shin mixed-platform builds. - GitHub Templates: Updated issue and PR templates to reflect supported platforms (Android, Linux, Windows) and correct branch names, replacing stale upstream ffmpeg-kit references.
What's Changed
- FFplay API Update for Android, Windows and Linux by @akashskypatel in #21
Full Changelog: v0.9.0-android...v0.9.1-android