From d5adbcb1c4568deedfbec4a64a8f5f8c8c7a5e65 Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期三, 29 三月 2017 14:50:09 +0800
Subject: [PATCH]
---
VisitFace/RtspNativeCodec/app/src/main/cpp/native-codec-jni.cpp | 74 ++++++++++++++++++++++--------------
1 files changed, 45 insertions(+), 29 deletions(-)
diff --git a/VisitFace/RtspNativeCodec/app/src/main/cpp/native-codec-jni.cpp b/VisitFace/RtspNativeCodec/app/src/main/cpp/native-codec-jni.cpp
index 971fc03..a037081 100644
--- a/VisitFace/RtspNativeCodec/app/src/main/cpp/native-codec-jni.cpp
+++ b/VisitFace/RtspNativeCodec/app/src/main/cpp/native-codec-jni.cpp
@@ -307,7 +307,6 @@
live_daemon_running = false;
}
-
extern "C" {
jboolean Java_com_example_nativecodec_NativeCodec_createStreamingMediaPlayer_rtsp(JNIEnv* env,
@@ -442,24 +441,54 @@
}
// set the playing state for the streaming media player
-void Java_com_example_nativecodec_NativeCodec_setPlayingStreamingMediaPlayer(JNIEnv* env,
- jclass clazz, jboolean isPlaying)
+//void Java_com_example_nativecodec_NativeCodec_setPlayingStreamingMediaPlayer(JNIEnv* env,
+// jclass clazz, jboolean isPlaying)
+//{
+// LOGV("@@@ playpause: %d", isPlaying);
+// if (mlooper) {
+// if (isPlaying) {
+// mlooper->post(kMsgResume, &data);
+// } else {
+// mlooper->post(kMsgPause, &data);
+// }
+// }
+//}
+
+
+// rewind the streaming media player
+//void Java_RtspNativeCodec_rewindStreamingMediaPlayer(JNIEnv *env, jclass clazz)
+//{
+// LOGV("@@@ rewind");
+// if (mlooper) {
+// mlooper->post(kMsgSeek, &data);
+// }
+//}
+
+// set the surface
+void Java_RtspNativeCodec_setSurface(JNIEnv *env, jclass clazz, jint cameraIdx, jobject surface)
{
- LOGV("@@@ playpause: %d", isPlaying);
- if (mlooper) {
- if (isPlaying) {
- mlooper->post(kMsgResume, &data);
- } else {
- mlooper->post(kMsgPause, &data);
- }
+ LOGV("@@@ Java_RtspNativeCodec_setSurface");
+
+ // obtain a native window from a Java surface
+ if (data.window) {
+ ANativeWindow_release(data.window);
+ data.window = NULL;
}
+ data.window = ANativeWindow_fromSurface(env, surface);
+ LOGV("@@@ setsurface %p", data.window);
}
+jboolean Java_RtspNativeCodec_createPlayer(JNIEnv* env, jclass clazz, jobject assetMgr, jint cameraIdx, jstring uri)
+{
+ LOGV("@@@ Java_RtspNativeCodec_createPlayer");
+
+ return JNI_TRUE;
+}
// shut down the native media system
-void Java_com_example_nativecodec_NativeCodec_shutdown(JNIEnv* env, jclass clazz)
+void Java_RtspNativeCodec_shutdown(JNIEnv* env, jclass clazz, jint cameraIdx)
{
- LOGV("@@@ shutdown");
+ LOGV("@@@ Java_RtspNativeCodec_shutdown");
if (mlooper) {
mlooper->post(kMsgDecodeDone, &data, true /* flush */);
mlooper->quit();
@@ -472,27 +501,14 @@
}
}
-
-// set the surface
-void Java_com_example_nativecodec_NativeCodec_setSurface(JNIEnv *env, jclass clazz, jobject surface)
+jboolean Java_RtspNativeCodec_setFaceCallback(JNIEnv* env, jclass clazz, jobject assetMgr, jint cameraIdx, jstring func)
{
- // obtain a native window from a Java surface
- if (data.window) {
- ANativeWindow_release(data.window);
- data.window = NULL;
- }
- data.window = ANativeWindow_fromSurface(env, surface);
- LOGV("@@@ setsurface %p", data.window);
+ return JNI_TRUE;
}
-
-// rewind the streaming media player
-void Java_com_example_nativecodec_NativeCodec_rewindStreamingMediaPlayer(JNIEnv *env, jclass clazz)
+jboolean Java_RtspNativeCodec_getFaceList(JNIEnv* env, jclass clazz, jobject assetMgr, jint cameraIdx, jobjectRefType faceList)
{
- LOGV("@@@ rewind");
- if (mlooper) {
- mlooper->post(kMsgSeek, &data);
- }
+ return JNI_TRUE;
}
}
--
Gitblit v1.8.0