|
|
|
#ifndef FFMPEGVIDEODLG_H
|
|
|
|
#define FFMPEGVIDEODLG_H
|
|
|
|
|
|
|
|
#include "cffmpeg_decode.h"
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QPaintEvent>
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QThread>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
|
|
|
|
#include <libavutil/channel_layout.h>
|
|
|
|
#include <libavutil/common.h>
|
|
|
|
#include <libavutil/frame.h>
|
|
|
|
#include <libavutil/imgutils.h>
|
|
|
|
#include <libavutil/mem.h>
|
|
|
|
#include <libavutil/opt.h>
|
|
|
|
#include <libavutil/parseutils.h>
|
|
|
|
#include <libavutil/samplefmt.h>
|
|
|
|
|
|
|
|
#include <libswscale/swscale.h>
|
|
|
|
|
|
|
|
#include <libavformat/avformat.h>
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ffmpegvideoDlg;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ffmpegvideoDlg : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ffmpegvideoDlg(QWidget *parent = nullptr);
|
|
|
|
~ffmpegvideoDlg();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::ffmpegvideoDlg *ui;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void iniWindow();
|
|
|
|
void setVedioSaveFileDirPath(QString saveDirPath);
|
|
|
|
|
|
|
|
void play(QString);
|
|
|
|
void stop();
|
|
|
|
bool Isplay(bool IsstopPlay);
|
|
|
|
bool m_PlayStatus = false;
|
|
|
|
|
|
|
|
double m_setVideoAreaWidth;
|
|
|
|
double m_setVideoAreaHeight;
|
|
|
|
double m_ax;
|
|
|
|
double m_ay;
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FFMPEGVIDEODLG_H
|