#ifndef __CameraWrapper_H__ #define __CameraWrapper_H__ #define MAX_FACE 5 #define MAX_FACE_WIDTH 240 #define MAX_FACE_HEIGHT 320 #include "FaceCache.h" #include #include #include #include #include #include #include //#include "looper.h" #include #include #include #include class CameraWrapper { public: PipeLine* pipeLineDecoderDetector; PipeLine* pipeLineAnalyzer; PipeLine* pipeLineRender; PL_Queue* queueFrame; PL_RTSPClient_Config rtspConfig; PL_AndroidMediaCodecDecoder_Config amcdConfig; PL_AndroidSurfaceViewRender_Config asvrConfig; SensetimeFaceTrackConfig sftConfig; int cameraIdx; JavaVM* javaVM; JNIEnv* javaEnv; jclass faceCallbackClazz; jmethodID faceCallbackFunc; void* windowRender; void* windowDecode; pthread_t decoder_thid; pthread_t analyzer_thid; bool running; bool faceCacheLocked; //FaceCache faceCache; FaceCacheForPLBG faceCache; PLPLContext plplContext; std::map 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), faceCacheLocked(false), faceCache(), plplContext(), faceLabels() { } ~CameraWrapper(); bool start(); void stop(); bool initPl(); void lockFace(); void releaseFace(); void setFaceLabel(int st_track_id, const std::string& label); private: static void* decoder_thd(void *arg); static void* analyzer_thd(void *arg); }; #endif