RecordControlApplication/Channel.h

67 lines
1.2 KiB
C
Raw Normal View History

2024-01-18 15:41:43 +08:00
#ifndef CHANNEL_H
#define CHANNEL_H
#include "Link.h"
#include <QObject>
#include <QTimer>
class Channel : public QObject {
Q_OBJECT
public:
2024-03-04 16:22:40 +08:00
enum PlaybackState {
Stop,
Playback,
Pause,
Error,
Finish
2024-03-04 16:22:40 +08:00
};
2024-01-18 15:41:43 +08:00
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;
2024-03-04 16:22:40 +08:00
// 单个视频时长
int duration = 1 * 60 * 1000;
2024-01-18 15:41:43 +08:00
bool isRecord = false;
2024-03-04 16:22:40 +08:00
LinkObject* file;
LinkObject* image;
LinkObject* videoDecoder;
LinkObject* audioDecoder;
PlaybackState state = Stop;
2024-01-18 15:41:43 +08:00
static LinkObject* rtspServer;
LinkObject* rtsp;
QString pushCode;
void startRecord();
void stopRecord();
2024-03-04 16:22:40 +08:00
int playbackDuration = 0;
bool startPlayback(QString path);
2024-01-18 15:41:43 +08:00
void forward();
2024-03-04 16:22:40 +08:00
void back();
2024-01-18 15:41:43 +08:00
void togglePause();
2024-03-04 16:22:40 +08:00
2024-01-18 15:41:43 +08:00
void startPlayLive();
void showFinishPromot();
2024-01-18 15:41:43 +08:00
signals:
void playEnd();
2024-03-04 16:22:40 +08:00
void showRecordState(bool state);
2024-01-18 15:41:43 +08:00
};
#endif // CHANNEL_H