diff options
Diffstat (limited to 'src/plugins/android/src/wrappers')
-rw-r--r-- | src/plugins/android/src/wrappers/jni/androidsurfacetexture.cpp | 16 | ||||
-rw-r--r-- | src/plugins/android/src/wrappers/jni/androidsurfacetexture.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/android/src/wrappers/jni/androidsurfacetexture.cpp b/src/plugins/android/src/wrappers/jni/androidsurfacetexture.cpp index 9a25b7e28..2cea896e1 100644 --- a/src/plugins/android/src/wrappers/jni/androidsurfacetexture.cpp +++ b/src/plugins/android/src/wrappers/jni/androidsurfacetexture.cpp @@ -146,6 +146,22 @@ jobject AndroidSurfaceTexture::surfaceHolder() return m_surfaceHolder.object(); } +void AndroidSurfaceTexture::attachToGLContext(int texName) +{ + if (QtAndroidPrivate::androidSdkVersion() < 16 || !m_surfaceTexture.isValid()) + return; + + m_surfaceTexture.callMethod<void>("attachToGLContext", "(I)V", texName); +} + +void AndroidSurfaceTexture::detachFromGLContext() +{ + if (QtAndroidPrivate::androidSdkVersion() < 16 || !m_surfaceTexture.isValid()) + return; + + m_surfaceTexture.callMethod<void>("detachFromGLContext"); +} + bool AndroidSurfaceTexture::initJNI(JNIEnv *env) { // SurfaceTexture is available since API 11. diff --git a/src/plugins/android/src/wrappers/jni/androidsurfacetexture.h b/src/plugins/android/src/wrappers/jni/androidsurfacetexture.h index ac2af694e..a08483e5e 100644 --- a/src/plugins/android/src/wrappers/jni/androidsurfacetexture.h +++ b/src/plugins/android/src/wrappers/jni/androidsurfacetexture.h @@ -58,6 +58,9 @@ public: void release(); // API level 14 void updateTexImage(); + void attachToGLContext(int texName); // API level 16 + void detachFromGLContext(); // API level 16 + static bool initJNI(JNIEnv *env); Q_SIGNALS: |