RecordControlApplication/Channel.h

65 lines
1.3 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,
Finish
};
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* record;
int duration = 1 * 60 * 1000; // 单个视频时长
bool isRecord = false;
static QString curRecordFilename; // 当前正在录制的文件名
int playbackDuration = 0;
LinkObject* file;
LinkObject* image;
LinkObject* videoDecoder;
LinkObject* audioDecoder;
PlaybackState state = Stop;
static LinkObject* rtspServer;
LinkObject* rtsp;
QString pushCode;
void startRecord();
void stopRecord();
bool startPlayback(QString path);
void forward();
void back();
void togglePause();
void startPlayLive();
void showFinishPromot();
signals:
void playEnd();
void showRecordState(bool state);
};
#endif // CHANNEL_H