From b98224fe56ead2b92f0cc41fe24e4c77d1188dff Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期一, 30 十二月 2019 18:11:25 +0800
Subject: [PATCH] 修改speaker
---
lib/src/main/cpp/native-lib.cpp | 38 +++-----------------------------------
1 files changed, 3 insertions(+), 35 deletions(-)
diff --git a/lib/src/main/cpp/native-lib.cpp b/lib/src/main/cpp/native-lib.cpp
index 85f60cf..b910b1b 100644
--- a/lib/src/main/cpp/native-lib.cpp
+++ b/lib/src/main/cpp/native-lib.cpp
@@ -326,7 +326,7 @@
void TextOsd(int type, const char *text)
{
- JNIEnv *env;
+/* JNIEnv *env;
bool ready_in_java_env = false;
if (sg_jvm->GetEnv((void **)&env, JNI_VERSION_1_6) != JNI_OK) {
@@ -351,7 +351,7 @@
if (sg_jvm->DetachCurrentThread() != JNI_OK) {
LOGE("%s: DetachCurrentThread() failed", __FUNCTION__);
}
- }
+ }*/
}
void DrawScreen(const Polygon *map, const Polygon *car)
@@ -412,44 +412,12 @@
DEBUG("DisplayText: %s", string);
}
-void CCL(int who)
-{
- JNIEnv *env;
- bool ready_in_java_env = false;
- static int c[2] = {0};
-
- if (sg_jvm->GetEnv((void **)&env, JNI_VERSION_1_6) != JNI_OK) {
- // Attach涓荤嚎绋�
- if (sg_jvm->AttachCurrentThread(&env, NULL) != JNI_OK) {
- LOGE("%s: AttachCurrentThread() failed", __FUNCTION__);
- return;
- }
- } else {
- ready_in_java_env = true;
- }
-
- jclass cls = env->GetObjectClass(sg_obj);
- jmethodID fun = env->GetMethodID(cls, "CCL", "(II)V");
-
- env->CallVoidMethod(sg_obj, fun, c[who], who);
-
- c[who] = !c[who];
-
- env->DeleteLocalRef(cls);
-
- if (!ready_in_java_env) {
- //Detach涓荤嚎绋�
- if (sg_jvm->DetachCurrentThread() != JNI_OK) {
- LOGE("%s: DetachCurrentThread() failed", __FUNCTION__);
- }
- }
-}
-
extern "C"
JNIEXPORT void JNICALL
Java_com_anyun_exam_lib_RemoteService_startNative(JNIEnv *env, jobject thiz) {
// TODO: implement startNative()
// 淇濆瓨鍏ㄥ眬JVM浠ヤ究鍦ㄥ瓙绾跨▼涓娇鐢�
+ DEBUG("鍚姩Native");
env->GetJavaVM(&sg_jvm);
// 涓嶈兘鐩存帴璧嬪��(g_obj = ojb)
sg_obj = env->NewGlobalRef(thiz);
--
Gitblit v1.8.0