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

Thomas Guillem thomas at gllm.fr
Mon Jun 15 13:18:48 CEST 2020



On Fri, Jun 12, 2020, at 11:40, Alexandre Janniaux wrote:
> 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");

Same thing here, missing exception clear & check.

>  
>      /* We cannot create any SurfaceTexture if we cannot load the SurfaceTexture
>       * methods. */
> -- 
> 2.27.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list