qt6 support

no qml. examples are wip.
fix #1381, #1294, #1389
This commit is contained in:
wang-bin
2022-01-08 17:09:43 +08:00
parent b156991fa6
commit ce21c55b6e
46 changed files with 215 additions and 115 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ libqtav.file = src/libQtAV.pro
libqtavwidgets.depends = libqtav
examples.depends += libqtavwidgets #TODO: enable widgets based examples
}
greaterThan(QT_MAJOR_VERSION, 4) {
isEqual(QT_MAJOR_VERSION, 5) {
# qtHaveModule does not exist in Qt5.0
isEqual(QT_MINOR_VERSION, 0)|qtHaveModule(quick) {
SUBDIRS += libqmlav
+5 -1
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV Player Demo: this file is part of QtAV examples
Copyright (C) 2012-2017 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -305,7 +305,11 @@ void Config::reload()
settings.beginGroup(QString::fromLatin1("decoder"));
settings.beginGroup(QString::fromLatin1("video"));
QString decs_default(QString::fromLatin1("HW FFmpeg")); // HW is ignored
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
setDecoderPriorityNames(settings.value(QString::fromLatin1("priority"), decs_default).toString().split(QString::fromLatin1(" "), Qt::SkipEmptyParts));
#else
setDecoderPriorityNames(settings.value(QString::fromLatin1("priority"), decs_default).toString().split(QString::fromLatin1(" "), QString::SkipEmptyParts));
#endif
setZeroCopy(settings.value(QString::fromLatin1("zeroCopy"), true).toBool());
settings.endGroup(); //video
settings.endGroup(); //decoder
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QOptions: make command line options easy. https://github.com/wang-bin/qoptions
Copyright (C) 2011-2015 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2011-2022 Wang Bin <wbsecg1@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -241,7 +241,7 @@ bool QOptions::parse(int argc, const char *const*argv)
QString sname = it_list->shortName();
int sname_len = sname.length(); //usally is 1
//TODO: startsWith(-height,-h) Not endsWith, -oabco
if (it->midRef(1).compare(sname) == 0) {
if (it->mid(1).compare(sname) == 0) {
if (it_list->type() == QOption::NoToken) {
it_list->setValue(true);
it = args.erase(it);
+5 -5
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2013)
@@ -22,7 +22,7 @@
#include "SimpleFilter.h"
#include <QWidget>
#include <math.h>
#include <QTime>
namespace QtAV {
SimpleFilter::SimpleFilter(QObject *parent):
@@ -124,10 +124,10 @@ void SimpleFilter::process(Statistics *statistics, VideoFrame *frame)
int i16 = (t+i) & 15;
ctx->pen.setColor(QColor::fromHsv((15-i16)*16, 255, 255));
if (mCanRot)
ctx->drawPlainText(QPointF(x-fm.width(mText)/2-ctx->rect.x(), y-sin_tbl[i16]*h/400), mText.mid(i, 1));
ctx->drawPlainText(QPointF(x-fm.boundingRect(mText).width()/2-ctx->rect.x(), y-sin_tbl[i16]*h/400), mText.mid(i, 1));
else
ctx->drawPlainText(QPointF(x, y-sin_tbl[i16]*h/400), mText.mid(i, 1));
x += fm.width(mText[i]);
x += fm.boundingRect(mText[i]).width();
}
} else {
qreal c = fabs(sin((float)t));
@@ -142,7 +142,7 @@ void SimpleFilter::process(Statistics *statistics, VideoFrame *frame)
return;
if (mCanRot) {
QFontMetrics fm(ctx->font);
ctx->drawPlainText(QRectF(-fm.width(mText)/2, ctx->rect.y(), ctx->rect.width(), ctx->rect.height()), Qt::TextWordWrap, mText);
ctx->drawPlainText(QRectF(-fm.boundingRect(mText).width()/2, ctx->rect.y(), ctx->rect.width(), ctx->rect.height()), Qt::TextWordWrap, mText);
} else {
ctx->drawPlainText(ctx->rect, Qt::TextWordWrap, mText);
}
+2 -2
View File
@@ -23,7 +23,7 @@
#define QTAV_EXAMPLE_SIMPLEFILTER_H
#include <QtAV/Filter.h>
#include <QtCore/QTime>
#include <QtCore/QElapsedTimer>
#include <QtGui/QMatrix4x4>
namespace QtAV {
@@ -52,7 +52,7 @@ protected:
private:
bool mCanRot;
bool mWave;
QTime mTime;
QElapsedTimer mTime;
qreal mStartValue;
QString mText;
QMatrix4x4 mMat;
+3 -1
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV Player Demo: this file is part of QtAV examples
Copyright (C) 2012-2014 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -60,7 +60,9 @@ void TVView::load()
if (!tv_file.open(QIODevice::ReadOnly))
return;
QTextStream ts(&tv_file);
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
ts.setCodec("UTF-8");
#endif
QTreeWidgetItem *nodeItem = new QTreeWidgetItem(mpView);
nodeItem->setData(0, Qt::DisplayRole, QString());
mpView->addTopLevelItem(nodeItem);
+22 -4
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV Player Demo: this file is part of QtAV examples
Copyright (C) 2012-2015 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -144,15 +144,33 @@ int main(int argc, char *argv[])
QString aos(op.value().toString());
QStringList ao;
if (aos.contains(QString::fromLatin1(";")))
ao = aos.split(QString::fromLatin1(";"), QString::SkipEmptyParts);
ao = aos.split(QString::fromLatin1(";"),
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
else
ao = aos.split(QString::fromLatin1(","), QString::SkipEmptyParts);
ao = aos.split(QString::fromLatin1(","),
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
window.setAudioBackends(ao);
}
op = options.option(QString::fromLatin1("vd"));
if (op.isSet()) {
QStringList vd = op.value().toString().split(QString::fromLatin1(";"), QString::SkipEmptyParts);
QStringList vd = op.value().toString().split(QString::fromLatin1(";"),
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
if (!vd.isEmpty())
window.setVideoDecoderNames(vd);
}
+1
View File
@@ -1,6 +1,7 @@
TARGET = Player
TEMPLATE = app
contains(QT_CONFIG, opengl): QT += opengl
greaterThan(QT_MAJOR_VERSION, 5): QT += opengl
QT += sql svg
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TRANSLATIONS = res/player_zh_CN.ts res/player.ts
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
this file is part of QtAV examples
Copyright (C) 2012-2015 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -21,7 +21,7 @@
#include "videoplayer.h"
#include <QGraphicsView>
#ifndef QT_NO_OPENGL
#if !defined(QT_NO_OPENGL) && QT_VERSION < QT_VERSION_CHECK(6,0,0)
#include <QtOpenGL/QGLWidget>
#endif
+12 -9
View File
@@ -1,6 +1,6 @@
/******************************************************************************
VideoGroup: this file is part of QtAV examples
Copyright (C) 2012-2015 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -20,14 +20,17 @@
#include "videogroup.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QEvent>
#include <QFileDialog>
#include <QGridLayout>
#include <QtCore/QUrl>
#include <QtAV/AudioOutput.h>
#include <QtAVWidgets>
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
#define DESKTOP_RECT() qApp->desktop()->rect()
#else
#define DESKTOP_RECT() qApp->primaryScreen()->availableGeometry()
#endif
using namespace QtAV;
VideoGroup::VideoGroup(QObject *parent) :
@@ -114,7 +117,7 @@ void VideoGroup::setSingleWindow(bool s)
if (view)
return;
view = new QWidget;
view->resize(qApp->desktop()->size());
view->resize(DESKTOP_RECT().size());
QGridLayout *layout = new QGridLayout;
layout->setSizeConstraint(QLayout::SetMaximumSize);
layout->setSpacing(1);
@@ -227,14 +230,14 @@ void VideoGroup::addRenderer()
wf |= Qt::FramelessWindowHint;
}
renderer->widget()->setWindowFlags(wf);
int w = view ? view->frameGeometry().width()/c : qApp->desktop()->width()/c;
int h = view ? view->frameGeometry().height()/r : qApp->desktop()->height()/r;
int w = view ? view->frameGeometry().width()/c : DESKTOP_RECT().width()/c;
int h = view ? view->frameGeometry().height()/r : DESKTOP_RECT().height()/r;
renderer->widget()->resize(w, h);
mpPlayer->addVideoRenderer(renderer);
int i = (mRenderers.size()-1)/cols();
int j = (mRenderers.size()-1)%cols();
if (view) {
view->resize(qApp->desktop()->size());
view->resize(DESKTOP_RECT().size());
((QGridLayout*)view->layout())->addWidget(renderer->widget(), i, j);
view->show();
} else {
@@ -268,8 +271,8 @@ void VideoGroup::updateROI()
}
return;
}
int W = view ? view->frameGeometry().width() : qApp->desktop()->width();
int H = view ? view->frameGeometry().height() : qApp->desktop()->height();
int W = view ? view->frameGeometry().width() : DESKTOP_RECT().width();
int H = view ? view->frameGeometry().height() : DESKTOP_RECT().height();
int w = W / c;
int h = H / r;
for (int i = 0; i < mRenderers.size(); ++i) {
+1
View File
@@ -1,6 +1,7 @@
TEMPLATE = app
CONFIG -= app_bundle
QT = core gui
greaterThan(QT_MAJOR_VERSION, 5): QT += opengl
PROJECTROOT = $$PWD/../..
include($$PROJECTROOT/src/libQtAV.pri)
preparePaths($$OUT_PWD/../../out)
+3 -3
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -76,8 +76,8 @@ void MediaMetaData::setValuesFromStatistics(const QtAV::Statistics &st)
setValue(TrackNumber, it.value().toInt());
continue;
}
setValue(TrackNumber, it.value().leftRef(slash).string()->toInt()); //QStringRef.toInt(): Qt5.2
setValue(TrackCount, it.value().midRef(slash+1).string()->toInt());
setValue(TrackNumber, it.value().left(slash).string()->toInt()); //QStringRef.toInt(): Qt5.2
setValue(TrackCount, it.value().mid(slash+1).string()->toInt());
continue;
}
if (keyName == QLatin1String("date")
+10 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2017 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
theoribeiro <theo@fictix.com.br>
* This file is part of QtAV (from 2013)
@@ -112,9 +112,17 @@ bool QQuickItemRenderer::event(QEvent *e)
return true;
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
void QQuickItemRenderer::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
#else
void QQuickItemRenderer::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
#endif
{
QQuickItem::geometryChanged(newGeometry, oldGeometry); //geometry will be updated
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
QQuickItem::geometryChange(newGeometry, oldGeometry);
#else
QQuickItem::geometryChanged(newGeometry, oldGeometry);
#endif
DPTR_D(QQuickItemRenderer);
resizeRenderer(newGeometry.size().toSize());
if (d.fill_mode == PreserveAspectCrop) {
+4 -4
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2017 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2015)
@@ -27,13 +27,13 @@
#include "QtAV/private/mkid.h"
#include "QtAV/private/factory.h"
#include <QtCore/QCoreApplication>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QOpenGLFramebufferObject>
#include <QOpenGLFunctions>
#include <QOpenGLFramebufferObject>
#include <QtQuick/QQuickWindow>
// for dynamicgl. qglfunctions before qt5.3 does not have portable gl functions
// use qt gl func if possible to avoid linking to opengl directly
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
#include <QtGui/QOpenGLFunctions>
#include <QOpenGLFunctions>
#define DYGL(glFunc) QOpenGLContext::currentContext()->functions()->glFunc
#else
#define DYGL(glFunc) glFunc
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -24,7 +24,7 @@
#include "QtAV/VideoShader.h"
#include "QtAV/VideoFrame.h"
#include <QtCore/QScopedPointer>
#include <QtGui/QOpenGLFunctions>
#include <QOpenGLFunctions>
#include <QtQuick/QSGMaterial>
#include <QtQuick/QSGMaterialShader>
+10 -1
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2018 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -23,6 +23,7 @@
#include "QtAV/private/AVCompat.h"
#include <QtCore/QMutex>
#include <QtCore/QStringList>
#include <QtCore/QIODevice>
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
#include <QtCore/QElapsedTimer>
#else
@@ -366,10 +367,18 @@ static void getFFmpegInputFormats(QStringList* formats, QStringList* extensions)
av_register_all(); // MUST register all input/output formats
while ((i = av_iformat_next(i))) {
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
if (i->extensions)
e << QString::fromLatin1(i->extensions).split(QLatin1Char(','), Qt::SkipEmptyParts);
if (i->name)
f << QString::fromLatin1(i->name).split(QLatin1Char(','), Qt::SkipEmptyParts);
#else
if (i->extensions)
e << QString::fromLatin1(i->extensions).split(QLatin1Char(','), QString::SkipEmptyParts);
if (i->name)
f << QString::fromLatin1(i->name).split(QLatin1Char(','), QString::SkipEmptyParts);
#endif
}
foreach (const QString& v, e) {
exts.append(v.trimmed());
+11 -4
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2018 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2015)
@@ -198,10 +198,17 @@ static void getFFmpegOutputFormats(QStringList* formats, QStringList* extensions
AVOutputFormat *o = NULL;
while ((o = av_oformat_next(o))) {
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
if (o->extensions)
e << QString::fromLatin1(o->extensions).split(QLatin1Char(','), Qt::SkipEmptyParts);
if (o->name)
f << QString::fromLatin1(o->name).split(QLatin1Char(','), Qt::SkipEmptyParts);
#else
if (o->extensions)
e << QString::fromLatin1(o->extensions).split(QLatin1Char(','), QString::SkipEmptyParts);
if (o->name)
f << QString::fromLatin1(o->name).split(QLatin1Char(','), QString::SkipEmptyParts);
#endif
}
foreach (const QString& v, e) {
exts.append(v.trimmed());
@@ -528,15 +535,15 @@ void AVMuxer::Private::applyOptionsForDict()
if (options.contains(QStringLiteral("avformat")))
opt = options.value(QStringLiteral("avformat"));
Internal::setOptionsToDict(opt, &dict);
if (opt.type() == QVariant::Map) {
const auto type = opt.type();
if (type == QVariant::Map) {
QVariantMap avformat_dict(opt.toMap());
if (avformat_dict.contains(QStringLiteral("format_whitelist"))) {
const QString fmts(avformat_dict[QStringLiteral("format_whitelist")].toString());
if (!fmts.contains(QLatin1Char(',')) && !fmts.isEmpty())
format_forced = fmts; // reset when media changed
}
} else if (opt.type() == QVariant::Hash) {
} else if (type == QVariant::Hash) {
QVariantHash avformat_dict(opt.toHash());
if (avformat_dict.contains(QStringLiteral("format_whitelist"))) {
const QString fmts(avformat_dict[QStringLiteral("format_whitelist")].toString());
+3 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2017 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -28,6 +28,7 @@
#include "QtAV/MediaIO.h"
#include "QtAV/VideoCapture.h"
#include "QtAV/private/AVCompat.h"
#include <QtCore/QIODevice>
#if AV_MODULE_CHECK(LIBAVFORMAT, 55, 18, 0, 39, 100)
extern "C" {
#include <libavutil/display.h>
@@ -243,7 +244,7 @@ void AVPlayer::Private::initBaseStatistics()
return;
}
statistics.bit_rate = fmt_ctx->bit_rate;
statistics.format = QString().sprintf("%s - %s", fmt_ctx->iformat->name, fmt_ctx->iformat->long_name);
statistics.format = QString().asprintf("%s - %s", fmt_ctx->iformat->name, fmt_ctx->iformat->long_name);
//AV_TIME_BASE_Q: msvc error C2143
//fmt_ctx->duration may be AV_NOPTS_VALUE. AVDemuxer.duration deals with this case
AVDictionaryEntry *tag = NULL;
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -222,7 +222,7 @@ void Packet::skip(int bytes)
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const Packet &pkt)
{
dbg.nospace() << "QtAV::Packet.data " << hex << (qptrdiff)pkt.data.constData() << "+" << dec << pkt.data.size();
dbg.nospace() << "QtAV::Packet.data " << Qt::hex << (qptrdiff)pkt.data.constData() << "+" << Qt::dec << pkt.data.size();
dbg.nospace() << ", dts: " << pkt.dts;
dbg.nospace() << ", pts: " << pkt.pts;
dbg.nospace() << ", duration: " << pkt.duration;
+3 -3
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2017 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2016)
@@ -23,10 +23,10 @@
#include <QtAV/Geometry.h>
#define QT_VAO (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
#if QT_VAO
#include <QtGui/QOpenGLVertexArrayObject>
#include <QOpenGLVertexArrayObject>
#endif //QT_VAO
# if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QOpenGLBuffer>
#include <QOpenGLBuffer>
#else
#include <QtOpenGL/QGLBuffer>
typedef QGLBuffer QOpenGLBuffer;
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -24,7 +24,7 @@
#include <QtAV/VideoRenderer.h>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QOpenGLFunctions>
#include <QOpenGLFunctions>
#elif QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
#include <QtOpenGL/QGLFunctions>
#define QOpenGLFunctions QGLFunctions
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2018 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -28,7 +28,7 @@
#include <QtGui/QMatrix4x4>
#include <QtCore/QObject>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QOpenGLContext>
#include <QOpenGLContext>
#else
#include <QtOpenGL/QGLContext>
#define QOpenGLContext QGLContext
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2014-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2014-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -22,7 +22,7 @@
#ifndef QTAV_OPENGLWINDOWRENDERER_H
#define QTAV_OPENGLWINDOWRENDERER_H
#ifndef QT_NO_OPENGL
#include <QtGui/QOpenGLWindow>
#include <QOpenGLWindow>
#include <QtAV/OpenGLRendererBase.h>
namespace QtAV {
+3 -3
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2017 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -46,7 +46,7 @@
#include <QtAV/GLSLFilter.h>
#include <QtAV/LibAVFilter.h>
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0) && !defined(QT_NO_OPENGL)) || defined(QT_OPENGL_LIB)
#if (QT_VERSION == QT_VERSION_CHECK(5,0,0) && !defined(QT_NO_OPENGL)) || (QT_VERSION >= QT_VERSION_CHECK(6,0,0) && defined(QT_OPENGL_LIB))
#include <QtAV/Geometry.h>
#include <QtAV/GeometryRenderer.h>
#include <QtAV/VideoShader.h>
@@ -65,7 +65,7 @@
#include <QtAV/VideoOutput.h>
//The following renderer headers can be removed
#include <QtAV/QPainterRenderer.h>
#if QT_VERSION >= QT_VERSION_CHECK(5,4,0)
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0)) || (QT_VERSION >= QT_VERSION_CHECK(6,0,0) && defined(QT_OPENGL_LIB))
#include <QtAV/OpenGLWindowRenderer.h>
#endif
#include <QtAV/Subtitle.h>
+3 -3
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -25,8 +25,8 @@
#include <QtAV/OpenGLTypes.h>
#include <QtAV/VideoFrame.h>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QOpenGLShaderProgram>
#include <QtGui/QOpenGLShader>
#include <QOpenGLShaderProgram>
#include <QOpenGLShader>
#else
#include <QtOpenGL/QGLShaderProgram>
#include <QtOpenGL/QGLShader>
+4 -4
View File
@@ -1,7 +1,7 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
This library is free software; you can redistribute it and/or
@@ -47,14 +47,14 @@ public:
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setRenderHint(QPainter::TextAntialiasing, false);
painter->setRenderHint(QPainter::SmoothPixmapTransform, false);
painter->setRenderHint(QPainter::HighQualityAntialiasing, false);
painter->setRenderHint(QPainter::Antialiasing, false);
break;
case VideoRenderer::QualityBest:
default:
painter->setRenderHint(QPainter::Antialiasing, true);
painter->setRenderHint(QPainter::TextAntialiasing, true);
painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
painter->setRenderHint(QPainter::HighQualityAntialiasing, true);
painter->setRenderHint(QPainter::Antialiasing, true);
break;
}
}
+4 -4
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -27,9 +27,9 @@
#include "ColorTransform.h"
#include <QVector4D>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QOpenGLBuffer>
#include <QtGui/QOpenGLShaderProgram>
#include <QtGui/QOpenGLFunctions>
#include <QOpenGLBuffer>
#include <QOpenGLShaderProgram>
#include <QOpenGLFunctions>
#else
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
#include <QtOpenGL/QGLFunctions>
+9 -5
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2019 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -22,7 +22,12 @@
#include "QtAV/QtAV_Global.h"
#include <QtCore/QLibraryInfo>
#include <QtCore/QObject>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QtCore/QRegularExpression>
using QRegExp = QRegularExpression;
#else
#include <QtCore/QRegExp>
#endif
#include "QtAV/version.h"
#include "QtAV/private/AVCompat.h"
#include "utils/internal.h"
@@ -85,14 +90,13 @@ static unsigned get_qt_version() {
static const depend_component* get_depend_component(const depend_component* info = 0)
{
// DO NOT use QStringLiteral here because the install script use strings to search "Qt-" in the library. QStringLiteral will place it in .ro and strings can not find it
static const QByteArray qt_license(QLibraryInfo::licensee().prepend(QLatin1String("Qt-" QT_VERSION_STR " licensee: ")).toUtf8());
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
static const char* qt_build_info = get_qt_version() >= QT_VERSION_CHECK(5, 3, 0) ? QLibraryInfo::build() : "";
#else
static const char* qt_build_info = "";
#endif
static const depend_component components[] = {
{ "Qt", QT_VERSION, get_qt_version(), qt_build_info, qt_license.constData() },
{ "Qt", QT_VERSION, get_qt_version(), qt_build_info, "" },
//TODO: auto check loaded libraries
#define FF_COMPONENT(name, NAME) #name, LIB##NAME##_VERSION_INT, name##_version(), name##_configuration(), name##_license()
{ FF_COMPONENT(avutil, AVUTIL) },
@@ -259,7 +263,7 @@ static void qtav_ffmpeg_log_callback(void* ctx, int level,const char* fmt, va_li
if (level > Internal::gAVLogLevel)
return;
AVClass *c = ctx ? *(AVClass**)ctx : 0;
QString qmsg = QString().sprintf("[FFmpeg:%s] ", c ? c->item_name(ctx) : "?") + QString().vsprintf(fmt, vl);
QString qmsg = QString().asprintf("[FFmpeg:%s] ", c ? c->item_name(ctx) : "?") + QString().vasprintf(fmt, vl);
qmsg = qmsg.trimmed();
if (level > AV_LOG_WARNING)
qDebug() << qPrintable(qmsg);
@@ -465,6 +469,6 @@ namespace {
public:
ResourceLoader() { initResources(); }
};
ResourceLoader QtAV_QRCLoader;
}
+5 -5
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -260,7 +260,7 @@ public:
}
if (!pkt.isValid()) {
qWarning("VideoFrameExtractor failed to get a packet at %lld", value);
err = QString().sprintf("failed to get a packet at %lld",value);
err = QString().asprintf("failed to get a packet at %lld",value);
return false;
}
decoder->flush(); //must flush otherwise old frames will be decoded at the beginning
@@ -350,7 +350,7 @@ public:
if (diff > range && t > pts) {
qWarning("out pts out of range. diff=%lld, range=%d", diff, range);
frame = VideoFrame();
err = QString().sprintf("out pts out of range. diff=%lld, range=%d", diff, range);
err = QString().asprintf("out pts out of range. diff=%lld, range=%d", diff, range);
return false;
}
}
@@ -538,9 +538,9 @@ void VideoFrameExtractor::extractInternal(qint64 pos)
extractOk = d.extractInPrecision(pos, precision(), err, isAborted);
if (!extractOk) {
if (isAborted)
Q_EMIT aborted(QString().sprintf("Abort at position %lld: %s",pos,err.toLatin1().constData()));
Q_EMIT aborted(QString().asprintf("Abort at position %lld: %s",pos,err.toLatin1().constData()));
else
Q_EMIT error(QString().sprintf("Cannot extract frame at position %lld: %s",pos,err.toLatin1().constData()));
Q_EMIT error(QString().asprintf("Cannot extract frame at position %lld: %s",pos,err.toLatin1().constData()));
return;
}
Q_EMIT frameExtracted(d.frame);
+6 -1
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2018 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -85,7 +85,12 @@ static void VideoDecoder_RegisterAll()
QVector<VideoDecoderId> VideoDecoder::registered()
{
VideoDecoder_RegisterAll();
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
const auto ids = VideoDecoderFactory::Instance().registeredIds();
return {ids.begin(), ids.end()};
#else
return QVector<VideoDecoderId>::fromStdVector(VideoDecoderFactory::Instance().registeredIds());
#endif
}
QStringList VideoDecoder::supportedCodecs()
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2016)
@@ -24,7 +24,7 @@
#include "QtAV/VideoFrame.h"
#include "opengl/OpenGLHelper.h"
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QOpenGLFramebufferObject>
#include <QOpenGLFramebufferObject>
#else
#include <QtOpenGL/QGLFramebufferObject>
#endif
+1
View File
@@ -3,6 +3,7 @@ MODULE_INCNAME = QtAV # for mac framework. also used in install_sdk.pro
TARGET = QtAV
QT += core gui
#CONFIG *= ltcg
greaterThan(QT_MAJOR_VERSION, 5): QT += opengl
greaterThan(QT_MAJOR_VERSION, 4) {
contains(QT_CONFIG, opengl) {
CONFIG *= config_opengl
+8 -3
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -22,8 +22,13 @@
#include "OpenGLHelper.h"
#include <string.h> //strstr
#include <QtCore/QCoreApplication>
#include <QtCore/QRegExp>
#include <QtGui/QMatrix4x4>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QtCore/QRegularExpression>
using QRegExp = QRegularExpression;
#else
#include <QtCore/QRegExp>
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
#include <QtOpenGL/QGLFunctions>
@@ -32,7 +37,7 @@
#include <QtGui/QGuiApplication>
#endif
#ifdef QT_OPENGL_DYNAMIC
#include <QtGui/QOpenGLFunctions_1_0>
#include <QOpenGLFunctions_1_0>
#endif
#if QTAV_HAVE(EGL_CAPI) // && QTAV_HAVE(QT_EGL) //make sure no crash if no egl library
#define EGL_CAPI_NS
+14 -1
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2016)
@@ -20,7 +20,11 @@
******************************************************************************/
#include "QtAV/OpenGLTypes.h"
#include "opengl/OpenGLHelper.h"
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QtCore/QRegularExpression>
#else
#include <QtCore/QRegExp>
#endif
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include "utils/Logger.h"
@@ -275,12 +279,21 @@ QVector<Uniform> ParseUniforms(const QByteArray &text, GLuint programId = 0)
line = line.trimmed();
if (!line.startsWith(QStringLiteral("uniform ")))
continue;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
auto rx = QRegularExpression(exp_array).match(line);
if (!rx.hasMatch()) {
rx = QRegularExpression(exp).match(line);
if (!rx.hasMatch())
continue;
}
#else
QRegExp rx(exp_array);
if (rx.indexIn(line) < 0) {
rx = QRegExp(exp);
if (rx.indexIn(line) < 0)
continue;
}
#endif
Uniform u;
const QStringList x = rx.capturedTexts();
//qDebug() << x;
+3 -3
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2016)
@@ -25,8 +25,8 @@
#include <QtAV/OpenGLTypes.h>
#include "opengl/OpenGLHelper.h"
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QOpenGLShaderProgram>
#include <QtGui/QOpenGLShader>
#include <QOpenGLShaderProgram>
#include <QOpenGLShader>
#else
#include <QtOpenGL/QGLShaderProgram>
#include <QtOpenGL/QGLShader>
+1 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -26,7 +26,6 @@
#include <cmath>
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
#include <QtCore/QRegExp>
#include <QtCore/QStringList>
#include "utils/Logger.h"
+5 -5
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2016)
@@ -24,10 +24,10 @@
#ifndef QT_NO_OPENGL
#include <qglobal.h>
# if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QOpenGLBuffer>
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <QOpenGLContext>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
# elif defined(QT_OPENGL_LIB)
# if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
#include <QtOpenGL/QGLFunctions>
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2017 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -79,7 +79,7 @@ void QPainterRenderer::drawBackground()
const QRegion bgRegion(backgroundRegion());
if (bgRegion.isEmpty())
return;
#if 0
#if 1
d.painter->save();
d.painter->setClipRegion(bgRegion);
d.painter->fillRect(QRect(QPoint(), rendererSize()), backgroundColor());
+19 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -28,12 +28,19 @@
#include <QtCore/QFileInfo>
#include <QtCore/QIODevice>
#include <QtCore/QList>
#include <QtCore/QRegExp>
#include <QtCore/QRunnable>
#include <QtCore/QThreadPool>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtCore/QTextCodec>
#endif
#include <QtCore/QTextStream>
#include <QtCore/QMutexLocker>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QtCore/QRegularExpression>
using QRegExp = QRegularExpression;
#else
#include <QtCore/QRegExp>
#endif
#include "subtitle/CharsetDetector.h"
#include "utils/Logger.h"
@@ -724,15 +731,23 @@ QStringList Subtitle::Private::find()
foreach (const QString& suf, sfx) {
if (list.isEmpty())
break;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
auto rx = QRegularExpression::fromWildcard(QStringLiteral("*.") + suf);
#else
QRegExp rx(QStringLiteral("*.") + suf);
rx.setPatternSyntax(QRegExp::Wildcard);
#endif
QFileInfoList::iterator it = list.begin();
while (it != list.end()) {
if (!it->fileName().startsWith(name) && !it->fileName().startsWith(base_name)) {// why it happens?
it = list.erase(it);
continue;
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (!rx.match(it->fileName()).hasMatch()) {
#else
if (!rx.exactMatch(it->fileName())) {
#endif
++it;
continue;
}
@@ -761,6 +776,7 @@ QByteArray Subtitle::Private::readFromFile(const QString &path)
}
QTextStream ts(&f);
ts.setAutoDetectUnicode(true);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (!codec.isEmpty()) {
if (codec.toLower() == "system") {
ts.setCodec(QTextCodec::codecForLocale());
@@ -777,6 +793,7 @@ QByteArray Subtitle::Private::readFromFile(const QString &path)
ts.setCodec(QTextCodec::codecForName(codec));
}
}
#endif
return ts.readAll().toUtf8();
}
+2 -1
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2018 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -26,6 +26,7 @@
#include "QtAV/private/AVCompat.h"
#include "PlainText.h"
#include "utils/Logger.h"
#include <QIODevice>
namespace QtAV {
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2013)
@@ -49,7 +49,7 @@ static void log_helper(QtMsgType msgType, const QMessageLogger *qlog, const char
QString qmsg(gQtAVLogTag);
QString formated;
if (msg) {
formated = QString().vsprintf(msg, ap);
formated = QString().vasprintf(msg, ap);
}
// repeate check
if (last_type == msgType && last_msg == formated) {
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -22,7 +22,7 @@
#ifndef QTAV_GLWIDGETRENDERER2_H
#define QTAV_GLWIDGETRENDERER2_H
#ifndef QT_NO_OPENGL
#if !defined(QT_NO_OPENGL) && QT_VERSION < QT_VERSION_CHECK(6,0,0)
#include <QtAVWidgets/global.h>
#include <QtOpenGL/QGLWidget>
#include <QtAV/OpenGLRendererBase.h>
+3 -3
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2014)
@@ -24,7 +24,7 @@
#include <QtAVWidgets/global.h>
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
#include <QtWidgets/QOpenGLWidget>
#include <QOpenGLWidget>
#else
#include <QtAVWidgets/QOpenGLWidget.h>
#endif //QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
@@ -54,7 +54,7 @@ class Q_AVWIDGETS_EXPORT OpenGLWidgetRenderer : public QOpenGLWidget, public Ope
Q_PROPERTY(QSize videoFrameSize READ videoFrameSize NOTIFY videoFrameSizeChanged)
Q_ENUMS(Quality)
public:
explicit OpenGLWidgetRenderer(QWidget* parent = 0, Qt::WindowFlags f = 0);
explicit OpenGLWidgetRenderer(QWidget* parent = 0, Qt::WindowFlags f = Qt::Widget);
virtual VideoRendererId id() const Q_DECL_OVERRIDE;
virtual QWidget* widget() Q_DECL_OVERRIDE { return this; }
Q_SIGNALS:
+3 -3
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV (from 2015)
@@ -26,8 +26,8 @@
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#error "Qt5 is required!"
#endif
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QOpenGLPaintDevice>
#include <QOpenGLFunctions>
#include <QOpenGLPaintDevice>
#include <QtGui/QSurfaceFormat>
#include <QtWidgets/QWidget>
+2 -2
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2022 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -49,7 +49,7 @@ class Q_AVWIDGETS_EXPORT WidgetRenderer : public QWidget, public QPainterRendere
Q_PROPERTY(QSize videoFrameSize READ videoFrameSize NOTIFY videoFrameSizeChanged)
Q_ENUMS(Quality)
public:
explicit WidgetRenderer(QWidget *parent = 0, Qt::WindowFlags f = 0);
explicit WidgetRenderer(QWidget *parent = 0, Qt::WindowFlags f = Qt::Widget);
virtual VideoRendererId id() const Q_DECL_OVERRIDE;
virtual QWidget* widget() Q_DECL_OVERRIDE { return this; }
Q_SIGNALS:
+2 -1
View File
@@ -3,6 +3,7 @@ MODULE_INCNAME = QtAVWidgets # for mac framework. also used in install_sdk.pro
TARGET = QtAVWidgets
QT += gui
config_gl: QT += opengl
greaterThan(QT_MAJOR_VERSION, 5): QT += openglwidgets
greaterThan(QT_MAJOR_VERSION, 4) {
# qtHaveModule does not exist in Qt5.0
qtHaveModule(widgets) {
@@ -74,7 +75,7 @@ contains(QT_CONFIG, opengl):greaterThan(QT_MAJOR_VERSION, 4) {
}
}
config_gl {
lessThan(QT_MAJOR_VERSION, 6):config_gl {
DEFINES *= QTAV_HAVE_GL=1
SOURCES += GLWidgetRenderer2.cpp
SDK_HEADERS += QtAVWidgets/GLWidgetRenderer2.h