xuxiuxi
2017-07-23 94e704acde59df60bd42f6f90b94d462d1bfa37c
VisitFace/RtspNativeCodec/app/src/main/cpp/CameraWrapper.h
@@ -13,8 +13,6 @@
#include <PL_SensetimeFaceTrack.h>
#include <PL_Paint.h>
#include <PL_Scale.h>
#include <PL_Queue.h>
//#include "looper.h"
#include <android/native_window_jni.h>
#include <media/NdkMediaCodec.h>
@@ -29,38 +27,39 @@
   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::wstring> faceLabels;
   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()
   {
@@ -71,7 +70,7 @@
   bool start();
   void stop();
   bool initPl();
   void lockFace();
   void releaseFace();
@@ -79,7 +78,10 @@
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