[vlc-devel] [PATCH 06/14] android: utils: load SurfaceTexture JNI API

Alexandre Janniaux ajanni at videolabs.io
Fri Jun 12 11:40:49 CEST 2020


The API will be used when NDK API is not available.
---
 modules/video_output/android/utils.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/video_output/android/utils.c b/modules/video_output/android/utils.c
index 92ed9aca1d2..85ae69423e0 100644
--- a/modules/video_output/android/utils.c
+++ b/modules/video_output/android/utils.c
@@ -132,6 +132,10 @@ static struct
           jmethodID init_i;
           jmethodID init_iz;
           jmethodID init_z;
+          jmethodID updateTexImage;
+          jmethodID getTransformMatrix;
+          jmethodID detachFromGLContext;
+          jmethodID attachToGLContext;
     } SurfaceTexture;
     struct {
         jclass clazz;
@@ -653,6 +657,14 @@ LoadNativeWindowAPI(AWindowHandler *p_awh, JNIEnv *p_env)
                                jfields.SurfaceTexture.clazz, "<init>", "(IZ)V");
     jfields.SurfaceTexture.init_z = (*p_env)->GetMethodID(p_env,
                                jfields.SurfaceTexture.clazz, "<init>", "(Z)V");
+    jfields.SurfaceTexture.updateTexImage = (*p_env)->GetMethodID(p_env,
+                               jfields.SurfaceTexture.clazz, "updateTexImage", "()V");
+    jfields.SurfaceTexture.getTransformMatrix = (*p_env)->GetMethodID(p_env,
+                               jfields.SurfaceTexture.clazz, "getTransformMatrix", "([F)V");
+    jfields.SurfaceTexture.attachToGLContext = (*p_env)->GetMethodID(p_env,
+                               jfields.SurfaceTexture.clazz, "attachToGLContext", "(I)V");
+    jfields.SurfaceTexture.detachFromGLContext = (*p_env)->GetMethodID(p_env,
+                               jfields.SurfaceTexture.clazz, "detachFromGLContext", "()V");
 
     /* We cannot create any SurfaceTexture if we cannot load the SurfaceTexture
      * methods. */
-- 
2.27.0



More information about the vlc-devel mailing list