RecordControlApplication/Channel.h

77 lines
1.4 KiB
C++
Executable File

#ifndef CHANNEL_H
#define CHANNEL_H
#include "Link.h"
#include <QObject>
#include <QTimer>
class Channel : public QObject {
Q_OBJECT
public:
enum PlaybackState {
Stop,
Playback,
Pause,
Error
};
explicit Channel(QObject* parent = nullptr);
void init();
QString channelName;
LinkObject* videoInput;
LinkObject* videoEncoder;
QVariantMap videoEncoderParams;
LinkObject* videoOutput;
static LinkObject* audioInput;
static LinkObject* audioOutput;
LinkObject* audioEncoder;
QVariantMap audioEncoderParams;
LinkObject* overlay;
LinkObject* record;
LinkObject* snap;
// 单个视频时长
int duration = 1 * 60 * 1000;
bool isRecord = false;
LinkObject* file;
LinkObject* image;
LinkObject* videoDecoder;
LinkObject* audioDecoder;
PlaybackState state = Stop;
static LinkObject* rtspServer;
LinkObject* rtsp;
QString pushCode;
void startRecord();
void stopRecord();
int playbackDuration = 0;
bool startPlayback(QString path);
void forward();
void back();
void togglePause();
void startPlayLive();
signals:
void playEnd();
void showRecordState(bool state);
private slots:
void onTimeout();
private:
// 用于分段录制的计时器
QTimer* timer;
private:
bool isMountDisk();
};
#endif // CHANNEL_H