I'm writing an Android app whose main codebase is written in native code using the NDK (with SDL, specifically SDL_gpu). The app needs to stream and decode HD video in realtime though, which ideally would be composited as one of many 2D GPU Textures.
I have looked at entirely native solutions to decoding video (like this one: https://github.com/googlesamples/android-ndk/blob/master/native-media/app/src/main/cpp/native-media-jni.c), but I'm eager to avoid the extra complexity of having to write the network streaming etc in native code too.
What I'd like to do is share a GPU texture between the SDL world and its GLES textures and ExoPlayer (https://github.com/google/ExoPlayer), which lives in the Java world and has all the streaming and decoding features I need. In that way I'd either create a texture in OpenGL (or SDL_gpu) and somehow tell ExoPlayer to render to it and give callbacks when the frame is updated, OR somehow get a handle to the Android Surface ExoPlayer is rendering to anyway and compositing it alongside my other textures and OpenGL code in SDL.
I'd also be fine with a flexible "native-only" solution that avoids Java altogether (I'd even prefer it), but I've all but given up on that idea.