|
|
|
#ifndef FFMPEGVIDEODLG_H
|
|
|
|
#define FFMPEGVIDEODLG_H
|
|
|
|
|
|
|
|
#include "cffmpeg_decode.h"
|
|
|
|
#include "ffmpeginclude.h"
|
|
|
|
#include "ffmpegpushstream.h"
|
|
|
|
#include <QCoreApplication>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QPaintEvent>
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QThread>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ffmpegvideoDlg;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ffmpegvideoDlg : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ffmpegvideoDlg(QWidget *parent = nullptr);
|
|
|
|
~ffmpegvideoDlg();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief 设置视频保存路径
|
|
|
|
* @param saveDirPath: 保存路径
|
|
|
|
*/
|
|
|
|
void setVedioSaveFileDirPath(QString saveDirPath);
|
|
|
|
|
|
|
|
// 拉流
|
|
|
|
void play(QString);
|
|
|
|
void stop();
|
|
|
|
bool Isplay(bool IsstopPlay);
|
|
|
|
/**
|
|
|
|
* @brief 设置拉流地址
|
|
|
|
* @param streamURL:
|
|
|
|
*/
|
|
|
|
void setStreamIP(QString streamURL);
|
|
|
|
|
|
|
|
// 推流
|
|
|
|
void setPushStreamIP(QString pushStreamURL);
|
|
|
|
void setPushStream(bool bPush);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief 视频播放
|
|
|
|
* @param bPlay: 是否播放
|
|
|
|
*/
|
|
|
|
void setPlayVideo(bool bPlay);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::ffmpegvideoDlg *ui;
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool m_PlayStatus = false;
|
|
|
|
double m_setVideoAreaWidth;
|
|
|
|
double m_setVideoAreaHeight;
|
|
|
|
double m_ax;
|
|
|
|
double m_ay;
|
|
|
|
|
|
|
|
QString m_flowType;
|
|
|
|
|
|
|
|
bool m_bVideoPlayFlag = false; // 视频播放标志
|
|
|
|
bool m_bPushStreamFlag = false; // 推流标志
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *);
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void receiveQImage(const QImage &rImg);
|
|
|
|
void showMessagBox(int);
|
|
|
|
signals:
|
|
|
|
void operate();
|
|
|
|
void setUrlSign(QString);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Cffmpeg_decode *ffmpeg;
|
|
|
|
QThread workerThread;
|
|
|
|
QImage img;
|
|
|
|
QString videoSaveDirPath;
|
|
|
|
QThread *pushStreamThread;
|
|
|
|
FFmpegPushStream *ffmpegPushStream;
|
|
|
|
QString m_pushStreamIP;
|
|
|
|
QString m_streamIP;
|
|
|
|
// bool bPushStream
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FFMPEGVIDEODLG_H
|