HxNvr/HxIVA/HxDevice.h
2024-04-17 15:31:43 +08:00

46 lines
1016 B
C++

#ifndef HXDEVICE_H
#define HXDEVICE_H
#include "main.h"
#include "HxDecoder.h"
class HxDevice : public HxThread, public HxVideoPipeline
{
public:
HxDevice(int millisecond = 10);
void set(int type);
void subscribe();
void unsubscribe();
/**
* @brief 判断报警检测时间
* @param event_type 报警类型
* @return true: 超过设置阈值; false: 未超过设置阈值
*/
bool determine_alarm_detection_timestamp(int event_type);
protected:
void device_stream_callback(HxVideoFrame frame) override;
void device_status_callback(ConnectionStatus status) override;
void action() override;
void continue_with() override;
private:
int type;
int frame_id;
HxDecoder decoder;
/* 帧队列及锁 */
QMutex mutex;
QQueue<HxVideoFrame> frames;
/* 报警检测时间 */
QMap<int, QDateTime> alarm_detection_timestamps;
/* 视频图像帧信息 */
VideoFrameDataInfo detect_frame_buffer;
};
#endif // HXDEVICE_H