#ifndef __CameraWrapper_H__
|
#define __CameraWrapper_H__
|
|
#define MAX_FACE 5
|
#define MAX_FACE_WIDTH 240
|
#define MAX_FACE_HEIGHT 320
|
#include "FaceCache.h"
|
|
#include <PipeLine.h>
|
#include <PL_RTSPClient.h>
|
#include <PL_AndroidMediaCodecDecoder.h>
|
#include <PL_SensetimeFaceTrack.h>
|
|
//#include "looper.h"
|
#include <android/native_window_jni.h>
|
#include <media/NdkMediaCodec.h>
|
|
#include <pthread.h>
|
|
class CameraWrapper
|
{
|
public:
|
PipeLine* pipeLine;
|
|
PL_RTSPClient_Config rtspConfig;
|
PL_AndroidMediaCodecDecoder_Config amcdConfig;
|
SensetimeFaceTrackConfig sftConfig;
|
|
int cameraIdx;
|
jmethodID faceCallback;
|
ANativeWindow* window;
|
|
pthread_t live_daemon_thid;
|
bool running;
|
|
bool faceCacheLocked;
|
FaceCache faceCache;
|
|
CameraWrapper() :
|
pipeLine(nullptr), rtspConfig(), amcdConfig(), sftConfig(),
|
cameraIdx(0), faceCallback(0), window(nullptr),
|
live_daemon_thid(0), running(false),
|
faceCacheLocked(false), faceCache()
|
{
|
}
|
|
~CameraWrapper();
|
|
bool start();
|
void stop();
|
bool initPl();
|
|
void lockFace();
|
void releaseFace();
|
|
private:
|
static void* live_daemon_thd(void* arg);
|
};
|
|
#endif
|