From ad80ce23000b88857d0c012ec7809b1303f47e5c Mon Sep 17 00:00:00 2001
From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期二, 04 七月 2017 17:23:30 +0800
Subject: [PATCH] aaaa

---
 VisitFace/RtspNativeCodec/app/src/main/cpp/RtspNativeCodecJNI.cpp |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/VisitFace/RtspNativeCodec/app/src/main/cpp/RtspNativeCodecJNI.cpp b/VisitFace/RtspNativeCodec/app/src/main/cpp/RtspNativeCodecJNI.cpp
index 2607ae2..6aa67c6 100644
--- a/VisitFace/RtspNativeCodec/app/src/main/cpp/RtspNativeCodecJNI.cpp
+++ b/VisitFace/RtspNativeCodec/app/src/main/cpp/RtspNativeCodecJNI.cpp
@@ -1,5 +1,6 @@
 #include "RtspNativeCodecJNI.h"
 #include "CameraWrapper.h"
+#include "CaptureCamera.h"
 #include <logger.h>
 #include <Logger/src/logger.hpp>
 
@@ -27,6 +28,8 @@
 static std::string g_stface_license_str;
 
 CameraWrapper g_CameraWrappers[CAMERA_COUNT];
+
+CaptureCamera g_CaptureCamera;
 
 extern "C"
 {
@@ -242,7 +245,7 @@
         }
         else if (cameraWrapper.rtspConfig.rtspURL.find("/h264_2") != std::string::npos)
         {
-            w=640;h=480;
+            w=800;h=600;
         }
         else if (cameraWrapper.rtspConfig.rtspURL.find("/h264") != std::string::npos)
         {
@@ -446,7 +449,7 @@
     evpHeader->size = sizeof(EVPHeader) + sizeof(FDP_FaceDetectPB) + buffSize;
     buffSize = evpHeader->size;
 
-    FDP_FaceDetectPB* fdpFaceDetectPB = new (buffer + sizeof(EVPHeader)) FDP_FaceDetectPB(dbId);
+    FDP_FaceDetectPB* fdpFaceDetectPB = new (buffer + sizeof(EVPHeader)) FDP_FaceDetectPB(dbId, cameraIdx + 1);
 
     evpHeader->hton();
     fdpFaceDetectPB->hton();
@@ -649,4 +652,42 @@
     //LOG_ERROR << g_stface_license_str << LOG_ERROR;
 }
 
+void Java_cn_com_basic_face_util_RtspFaceNative_setCaptureSurface(JNIEnv *env, jclass clazz, jobject surfaceCapture)
+{
+    if (g_CaptureCamera.windowRender != nullptr)
+    {
+        ANativeWindow_release((ANativeWindow*)(g_CaptureCamera.windowRender));
+        g_CaptureCamera.windowRender = NULL;
+    }
+    g_CaptureCamera.windowRender = ANativeWindow_fromSurface(env, surfaceCapture);
+}
+
+bool Java_cn_com_basic_face_util_RtspFaceNative_startCapturePlayer(JNIEnv *env, jclass clazz, jstring uri)
+{
+    std::string _uri;
+    {
+        const char *utfFunc = env->GetStringUTFChars(uri, NULL);
+        _uri = utfFunc;
+        env->ReleaseStringUTFChars(uri, utfFunc);
+    }
+
+    if (_uri.empty())
+        return false;
+    if (g_CaptureCamera.windowRender == nullptr)
+        return false;
+
+    g_CaptureCamera.cameraUri = _uri;
+    return g_CaptureCamera.start();
+}
+
+void Java_cn_com_basic_face_util_RtspFaceNative_stopCapturePlayer(JNIEnv *env, jclass clazz)
+{
+
+}
+
+jobject Java_cn_com_basic_face_util_RtspFaceNative_getCaptureImages(JNIEnv* env, jclass clazz)
+{
+
+}
+
 }

--
Gitblit v1.8.0