From d475c7ab0b4bd6781c6f312b153a4f5bc780d57a Mon Sep 17 00:00:00 2001 From: chenke <chenke@454eff88-639b-444f-9e54-f578c98de674> Date: 星期四, 27 七月 2017 09:17:59 +0800 Subject: [PATCH] 重命名MitiTrd为MultiTrd --- VisitFace/RtspNativeCodec/app/src/main/cpp/CameraWrapper.h | 52 +++++++++++++++++++++++++++++----------------------- 1 files changed, 29 insertions(+), 23 deletions(-) diff --git a/VisitFace/RtspNativeCodec/app/src/main/cpp/CameraWrapper.h b/VisitFace/RtspNativeCodec/app/src/main/cpp/CameraWrapper.h index 8bb9f05..7628226 100644 --- a/VisitFace/RtspNativeCodec/app/src/main/cpp/CameraWrapper.h +++ b/VisitFace/RtspNativeCodec/app/src/main/cpp/CameraWrapper.h @@ -10,10 +10,9 @@ #include <PL_RTSPClient.h> #include <PL_AndroidMediaCodecDecoder.h> #include <PL_AndroidSurfaceViewRender.h> -#include <PL_SensetimeFaceTrack.h> +#include <PL_SensetimeFaceTrackMultiTrd.h> #include <PL_Paint.h> -#include <PL_Queue.h> - +#include <PL_Scale.h> //#include "looper.h" #include <android/native_window_jni.h> #include <media/NdkMediaCodec.h> @@ -28,39 +27,43 @@ PipeLine* pipeLineAnalyzer; PipeLine* pipeLineRender; - PL_Queue* queueFrame; - - PL_RTSPClient_Config rtspConfig; - PL_AndroidMediaCodecDecoder_Config amcdConfig; - PL_AndroidSurfaceViewRender_Config asvrConfig; - SensetimeFaceTrackConfig sftConfig; + PL_RTSPClient_Config rtspConfig; + PL_AndroidMediaCodecDecoder_Config amcdConfig; + PL_AndroidSurfaceViewRender_Config asvrConfig; + SensetimeFaceTrackConfig sftConfig; + PL_Scale_Config plScaleCfg; int cameraIdx; - JavaVM* javaVM; - JNIEnv* javaEnv; + JavaVM* javaVM; + JNIEnv* javaEnv; jclass faceCallbackClazz; jmethodID faceCallbackFunc; void* windowRender; void* windowDecode; pthread_t decoder_thid; - pthread_t analyzer_thid; + pthread_t live_daemon_thid; + pthread_mutex_t live_daemon_mut; bool running; - + volatile bool killed; + time_t lastAliveTime; + bool faceCacheLocked; - //FaceCache faceCache; - FaceCacheForPLBG faceCache; + //FaceCache faceCache; + FaceCacheForPLBG faceCache; PLPLContext plplContext; - std::map<int, std::string> faceLabels; + std::map<int, std::wstring> faceLabels; + + std::string fontPath; CameraWrapper() : - pipeLineDecoderDetector(nullptr), pipeLineAnalyzer(nullptr), pipeLineRender(nullptr), queueFrame(nullptr), rtspConfig(), amcdConfig(), asvrConfig(), sftConfig(), - cameraIdx(0), javaVM(nullptr), javaEnv(nullptr), faceCallbackClazz(0), faceCallbackFunc(0), windowRender(nullptr), windowDecode(nullptr), - decoder_thid(0), analyzer_thid(0), running(false), + pipeLineDecoderDetector(nullptr), pipeLineAnalyzer(nullptr), pipeLineRender(nullptr), rtspConfig(), amcdConfig(), asvrConfig(), sftConfig(), + cameraIdx(0), javaVM(nullptr), javaEnv(nullptr), faceCallbackClazz(0), faceCallbackFunc(0), windowRender(nullptr), windowDecode(nullptr), + decoder_thid(0), live_daemon_thid(0), live_daemon_mut(), running(false), killed(false), lastAliveTime(0), faceCacheLocked(false), faceCache(), - plplContext(), faceLabels() + plplContext(), faceLabels(), fontPath() { } @@ -69,15 +72,18 @@ bool start(); void stop(); bool initPl(); - + void lockFace(); void releaseFace(); - void setFaceLabel(int st_track_id, const std::string& label); + void setFaceLabel(int st_track_id, const std::wstring& label); private: static void* decoder_thd(void *arg); - static void* analyzer_thd(void *arg); + static void* live_daemon_thd(void *arg); + + bool resetPl(); + bool initPl_DecoderPl(); }; #endif -- Gitblit v1.8.0