JNI, access to SurfaceTexture using native code

I need to be able to execute my own code (algorithms) on the video stream created by the device’s camera, for this I considered the capture of the OpenCV camera, unfortunately, it does not currently support Android 4.0.3 @Samsung G2, which is my target device, as alternatives I consider capture using a Java camera object and, using JNI, ~ Marshal ~ captured data in the native domain, this, however, imposes overhead marshaling (copying data), to avoid this, I considered rendering the captured image (preview) in GL Texture (using, for example, Camera.setPreviewTexture ), and by directly accessing GL Texture @’s native domain and avoiding unnecessary copying.

Is there a way to directly access TextureSurface @ native domain?

Any help would be appreciated.

Nadav In Sofina

+3
source share
1 answer

The VideoPlayback sample app released as part of the Qualcomm Vuforia SDK complements this situation, I think. I just started sorting through the code myself in the last few days, and a lot of new things for me, so I'm not 100% sure.

https://ar.qualcomm.at/content/video-playback-sample-app-posted

If I'm right, the application plays the movie file through the MediaPlayer class of the Java domain, which is displayed in SurfaceTexture, which then in turn accesses the OpenGL ES code in its own domain, which will be displayed on the actual augmented reality display.

+1
source

All Articles