73 lines
1.3 KiB
C
73 lines
1.3 KiB
C
|
#ifndef BOXCONTROLLER_H
|
||
|
#define BOXCONTROLLER_H
|
||
|
|
||
|
#include "Link.h"
|
||
|
#include <QObject>
|
||
|
#include <QTimer>
|
||
|
|
||
|
class BoxController : public QObject {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
BoxController(QObject* parent = nullptr);
|
||
|
|
||
|
// io
|
||
|
LinkObject* audioInput;
|
||
|
LinkObject* videoInputA;
|
||
|
LinkObject* videoInputB;
|
||
|
LinkObject* audioOutput;
|
||
|
LinkObject* videoOutput;
|
||
|
|
||
|
// record
|
||
|
LinkObject* audioEncoder;
|
||
|
LinkObject* videoEncoder;
|
||
|
LinkObject* overlay;
|
||
|
LinkObject* record;
|
||
|
LinkObject* snap;
|
||
|
|
||
|
// stream server
|
||
|
LinkObject* rtmpServer;
|
||
|
|
||
|
// play
|
||
|
LinkObject* file;
|
||
|
LinkObject* videoDecoder;
|
||
|
LinkObject* audioDecoder;
|
||
|
|
||
|
QVariantMap videoEncodeParams;
|
||
|
QVariantMap audioEncodeParams;
|
||
|
|
||
|
// record flag
|
||
|
bool isRecord = false;
|
||
|
// video file format
|
||
|
QString format;
|
||
|
|
||
|
void startRecord();
|
||
|
void stopRecord();
|
||
|
void startRtmpServer();
|
||
|
void init();
|
||
|
|
||
|
void startPlayback(QString fileName);
|
||
|
void startPlayLive();
|
||
|
void back();
|
||
|
void forward();
|
||
|
void pause();
|
||
|
void resume();
|
||
|
|
||
|
signals:
|
||
|
void playListNeedHide();
|
||
|
|
||
|
private slots:
|
||
|
void onTimeout();
|
||
|
|
||
|
private:
|
||
|
// timer used to limit record time each time
|
||
|
QTimer* recordTimer;
|
||
|
// duration each video file
|
||
|
int videoDuration;
|
||
|
|
||
|
private:
|
||
|
QString writeCom(const QString& com);
|
||
|
bool isMountDisk();
|
||
|
};
|
||
|
|
||
|
#endif // BOXCONTROLLER_H
|