HxNvr/HxIVA/HxDevice.h

46 lines
1016 B
C
Raw Permalink Normal View History

2024-02-01 18:28:27 +08:00
#ifndef HXDEVICE_H
#define HXDEVICE_H
#include "main.h"
2024-03-02 23:15:54 +08:00
#include "HxDecoder.h"
2024-02-01 18:28:27 +08:00
2024-04-17 15:31:43 +08:00
class HxDevice : public HxThread, public HxVideoPipeline
2024-02-01 18:28:27 +08:00
{
public:
2024-04-17 15:31:43 +08:00
HxDevice(int millisecond = 10);
void set(int type);
void subscribe();
void unsubscribe();
2024-02-01 18:28:27 +08:00
2024-02-04 18:27:06 +08:00
/**
* @brief
* @param event_type
* @return true: ; false:
*/
bool determine_alarm_detection_timestamp(int event_type);
2024-04-17 15:31:43 +08:00
protected:
void device_stream_callback(HxVideoFrame frame) override;
void device_status_callback(ConnectionStatus status) override;
void action() override;
void continue_with() override;
2024-02-04 18:27:06 +08:00
2024-02-01 18:28:27 +08:00
private:
int type;
int frame_id;
2024-03-02 23:15:54 +08:00
HxDecoder decoder;
2024-02-04 18:27:06 +08:00
2024-04-17 15:31:43 +08:00
/* 帧队列及锁 */
QMutex mutex;
QQueue<HxVideoFrame> frames;
2024-02-01 18:28:27 +08:00
2024-02-04 18:27:06 +08:00
/* 报警检测时间 */
QMap<int, QDateTime> alarm_detection_timestamps;
2024-02-01 18:28:27 +08:00
/* 视频图像帧信息 */
2024-03-02 23:15:54 +08:00
VideoFrameDataInfo detect_frame_buffer;
2024-02-01 18:28:27 +08:00
};
#endif // HXDEVICE_H