[Android] jni: add a function to notify that hardware acceleration failed
Felix Abecassis
git at videolan.org
Tue Feb 18 20:22:45 CET 2014
vlc-ports/android | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Tue Feb 18 19:25:00 2014 +0100| [ad576857f1358f31e50ee5ba952228259dd32582] | committer: Jean-Baptiste Kempf
jni: add a function to notify that hardware acceleration failed
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=ad576857f1358f31e50ee5ba952228259dd32582
---
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)
More information about the Android
mailing list