2024-02-01 18:28:27 +08:00
|
|
|
|
#ifndef HXDEVICE_H
|
|
|
|
|
#define HXDEVICE_H
|
|
|
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
|
|
typedef enum __CONNECTION_TYPE_
|
|
|
|
|
{
|
|
|
|
|
File = 0,
|
|
|
|
|
Rtsp = 1,
|
|
|
|
|
}connection_type;
|
|
|
|
|
|
|
|
|
|
class HxDevice : public HxThread
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
HxDevice(int millisecond = 1);
|
|
|
|
|
void startup(int type, QString url, QString file = "");
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void frame_read_process(void);
|
|
|
|
|
int mv_convert_images(VideoFrameDataInfo *src_buffer, VideoFrameDataInfo *dst_buffer);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void action() override;
|
|
|
|
|
void continue_with() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int type;
|
|
|
|
|
int connection_type;
|
|
|
|
|
|
|
|
|
|
int frame_id;
|
|
|
|
|
|
|
|
|
|
QString address;
|
|
|
|
|
|
|
|
|
|
QMutex mutex;
|
|
|
|
|
QQueue<cv::Mat> frames;
|
|
|
|
|
|
|
|
|
|
/* 视频图像帧信息 */
|
|
|
|
|
VideoFrameDataInfo bgr_frame_buffer, detect_frame_buffer;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // HXDEVICE_H
|