新增视频监控内核mpv

This commit is contained in:
feiyangqingyun
2020-08-27 15:38:51 +08:00
parent 5bd996668c
commit 2a80cb5392
39 changed files with 7790 additions and 110 deletions

View File

@@ -1,9 +1,5 @@
#include "ffmpeg.h"
#pragma execution_character_set("utf-8")
#define TIMEMS qPrintable(QTime::currentTime().toString("HH:mm:ss zzz"))
#define STRDATETIME qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd-HH-mm-ss"))
FFmpegThread::FFmpegThread(QObject *parent) : QThread(parent)
{
setObjectName("FFmpegThread");
@@ -360,8 +356,8 @@ void FFmpegThread::stop()
//实时视频显示窗体类
FFmpegWidget::FFmpegWidget(QWidget * parent) : QWidget(parent)
{
ffmpeg = new FFmpegThread(this);
connect(ffmpeg, SIGNAL(receiveImage(QImage)), this, SLOT(updateImage(QImage)));
thread = new FFmpegThread(this);
connect(thread, SIGNAL(receiveImage(QImage)), this, SLOT(updateImage(QImage)));
image = QImage();
}
@@ -390,7 +386,7 @@ void FFmpegWidget::updateImage(const QImage &image)
void FFmpegWidget::setUrl(const QString &url)
{
ffmpeg->setUrl(url);
thread->setUrl(url);
}
void FFmpegWidget::open()
@@ -398,27 +394,27 @@ void FFmpegWidget::open()
//qDebug() << TIMEMS << "open video" << objectName();
clear();
ffmpeg->play();
ffmpeg->start();
thread->play();
thread->start();
}
void FFmpegWidget::pause()
{
ffmpeg->pause();
thread->pause();
}
void FFmpegWidget::next()
{
ffmpeg->next();
thread->next();
}
void FFmpegWidget::close()
{
//qDebug() << TIMEMS << "close video" << objectName();
if (ffmpeg->isRunning()) {
ffmpeg->stop();
ffmpeg->quit();
ffmpeg->wait(500);
if (thread->isRunning()) {
thread->stop();
thread->quit();
thread->wait(500);
}
QTimer::singleShot(1, this, SLOT(clear()));