#ifndef CHANNEL_H #define CHANNEL_H #include "Link.h" #include #include 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* record; // 单个视频时长 int duration = 10 * 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