#ifndef __CAMERAWRAPPER_CLIENT_H__ #define __CAMERAWRAPPER_CLIENT_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* pipeLineRender; PL_RTSPClient_Config rtspConfig; PL_AndroidMediaCodecDecoder_Config amcdConfig; PL_AndroidSurfaceViewRender_Config asvrConfig; PL_Scale_Config plScaleCfg; int faceCount; int cameraIdx; bool faceCountChanged; JavaVM* javaVM; JNIEnv* javaEnv; jclass faceCallbackClazz; jmethodID faceCallbackFunc; void* windowRender; void* windowDecode; pthread_t decoder_thid; pthread_t live_daemon_thid; pthread_t jni_call_thid; pthread_mutex_t live_daemon_mut; bool running; volatile bool killed; time_t lastAliveTime; bool faceCacheLocked; //FaceCache faceCache; FaceCacheForPLBG faceCache; PLPLContext plplContext; std::map faceLabels; std::string fontPath; CameraWrapper() : pipeLineDecoderDetector(nullptr), pipeLineRender(nullptr), rtspConfig(), amcdConfig(), asvrConfig(), cameraIdx(0), javaVM(nullptr), javaEnv(nullptr), faceCallbackClazz(0), faceCallbackFunc(0), windowRender(nullptr), windowDecode(nullptr), decoder_thid(0), live_daemon_thid(0),jni_call_thid(0), live_daemon_mut(), running(false), killed(false), lastAliveTime(0), faceCacheLocked(false), faceCache(), plplContext(), faceLabels(), fontPath() { } ~CameraWrapper(); bool start(); void stop(); bool initPl(); void lockFace(); void releaseFace(); void fireFaceCount(int faceCount); void setFaceLabel(int st_track_id, const std::wstring& label); private: static void* decoder_thd(void *arg); static void* live_daemon_thd(void *arg); static void* jni_call_thd(void *arg); bool resetPl(); bool initPl_DecoderPl(); }; #endif