[Android] [PATCH 2/3] jni: add a function to notify that hardware acceleration failed

Felix Abecassis felix.abecassis at gmail.com
Tue Feb 18 19:25:00 CET 2014


---
 vlc-android/jni/vout.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/vlc-android/jni/vout.c b/vlc-android/jni/vout.c
index cac3213..eea4d9e 100644
--- a/vlc-android/jni/vout.c
+++ b/vlc-android/jni/vout.c
@@ -58,6 +58,22 @@ void jni_UnlockAndroidSurface() {
     pthread_mutex_unlock(&vout_android_lock);
 }
 
+void jni_EventHardwareAccelerationError()
+{
+    if (vout_android_gui == NULL)
+        return;
+
+    JNIEnv *env;
+    (*myVm)->AttachCurrentThread(myVm, &env, NULL);
+
+    jclass cls = (*env)->GetObjectClass(env, vout_android_gui);
+    jmethodID methodId = (*env)->GetMethodID(env, cls, "eventHardwareAccelerationError", "()V");
+    (*env)->CallVoidMethod(env, vout_android_gui, methodId);
+
+    (*env)->DeleteLocalRef(env, cls);
+    (*myVm)->DetachCurrentThread(myVm);
+}
+
 void jni_SetAndroidSurfaceSizeEnv(JNIEnv *p_env, int width, int height, int visible_width, int visible_height, int sar_num, int sar_den)
 {
     if (vout_android_gui == NULL)
-- 
1.8.3.2



More information about the Android mailing list