HxVideoCaptor/HxDevice.h

56 lines
1.2 KiB
C++

#ifndef HXDEVICE_H
#define HXDEVICE_H
#include "main.h"
#include "HxVideoWriter.h"
#include <QMutex>
class HxDevice : public HxThread
{
public:
HxDevice(int channel, bool secondary = false, int millisecond = 10);
void startup(QJsonObject object);
private:
void frame_read_process(void);
void create_recording_file(HxVideoFrame frame);
void close_recording_file(void);
void write_recording_data(HxVideoFrame frame);
int get_video_duration(QString path);
void build_video_log(QString title, QString data = "");
protected:
void action() override;
void continue_with() override;
private:
QUuid uuid;
QString code;
/* 每盘保留 GB */
int drive_threshold;
/* 分包间隔 */
int recording_split_time;
/* 存储硬盘 */
QStringList disks;
/* 通道号 */
int channel;
/* 副盘录像 */
int secondary;
/* 状态信息 */
QString status_message;
/* 流断开状态 */
bool stream_disconnect = false;
/* RTSP流地址 */
QString rtspurl;
AVFormatContext *ifmt_ctx;
QMutex mutex;
QQueue<HxVideoFrame> frames;
HxVideoWriter video_writer;
HxVideoRecord video_record;
};
#endif // HXDEVICE_H