50 lines
965 B
C++
50 lines
965 B
C++
#ifndef HXDEVICE_H
|
|
#define HXDEVICE_H
|
|
|
|
#include "main.h"
|
|
#include "HxDecoder.h"
|
|
|
|
class HxDevice
|
|
{
|
|
public:
|
|
HxDevice();
|
|
void startup(int type, QString rtspurl);
|
|
|
|
/**
|
|
* @brief 判断报警检测时间
|
|
* @param event_type 报警类型
|
|
* @return true: 超过设置阈值; false: 未超过设置阈值
|
|
*/
|
|
bool determine_alarm_detection_timestamp(int event_type);
|
|
|
|
|
|
private:
|
|
void frame_read_process(void);
|
|
void frame_decode_process(void);
|
|
|
|
private:
|
|
int type;
|
|
int frame_id;
|
|
|
|
QString rtspurl;
|
|
|
|
/* 当前解码时间戳 */
|
|
QDateTime current_decoder_timestamp;
|
|
|
|
AVFormatContext *ifmt_ctx;
|
|
|
|
HxDecoder decoder;
|
|
|
|
/* 解码帧队列及锁 */
|
|
QMutex decoder_frames_mutex;
|
|
QQueue<HxVideoFrame> decoder_frames;
|
|
|
|
/* 报警检测时间 */
|
|
QMap<int, QDateTime> alarm_detection_timestamps;
|
|
|
|
/* 视频图像帧信息 */
|
|
VideoFrameDataInfo detect_frame_buffer;
|
|
};
|
|
|
|
#endif // HXDEVICE_H
|