summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/audio/qsoundeffect.cpp34
-rw-r--r--src/multimedia/audio/qsoundeffect.h2
-rw-r--r--src/multimedia/audio/qsoundeffect_pulse_p.cpp13
-rw-r--r--src/multimedia/audio/qsoundeffect_pulse_p.h2
-rw-r--r--src/multimedia/audio/qsoundeffect_qaudio_p.cpp16
-rw-r--r--src/multimedia/audio/qsoundeffect_qaudio_p.h5
-rw-r--r--src/multimedia/playback/qmediacontent.cpp46
-rw-r--r--src/multimedia/playback/qmediacontent.h13
-rw-r--r--src/multimedia/playback/qmediaresource.cpp4
-rw-r--r--src/multimedia/playback/qmediaresource.h4
-rw-r--r--src/multimedia/playback/qplaylistfileparser.cpp33
-rw-r--r--src/multimedia/playback/qplaylistfileparser_p.h2
-rw-r--r--src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h15
-rw-r--r--src/multimedia/video/qvideoframe.cpp7
-rw-r--r--src/multimedia/video/qvideoframe.h1
15 files changed, 152 insertions, 45 deletions
diff --git a/src/multimedia/audio/qsoundeffect.cpp b/src/multimedia/audio/qsoundeffect.cpp
index f093373ce..09085dca9 100644
--- a/src/multimedia/audio/qsoundeffect.cpp
+++ b/src/multimedia/audio/qsoundeffect.cpp
@@ -111,20 +111,34 @@ QT_BEGIN_NAMESPACE
sound effects.
*/
+static QSoundEffectPrivate *initPrivate(QSoundEffect *self, QSoundEffectPrivate *d)
+{
+ QObject::connect(d, &QSoundEffectPrivate::loopsRemainingChanged, self, &QSoundEffect::loopsRemainingChanged);
+ QObject::connect(d, &QSoundEffectPrivate::volumeChanged, self, &QSoundEffect::volumeChanged);
+ QObject::connect(d, &QSoundEffectPrivate::mutedChanged, self, &QSoundEffect::mutedChanged);
+ QObject::connect(d, &QSoundEffectPrivate::loadedChanged, self, &QSoundEffect::loadedChanged);
+ QObject::connect(d, &QSoundEffectPrivate::playingChanged, self, &QSoundEffect::playingChanged);
+ QObject::connect(d, &QSoundEffectPrivate::statusChanged, self, &QSoundEffect::statusChanged);
+ QObject::connect(d, &QSoundEffectPrivate::categoryChanged, self, &QSoundEffect::categoryChanged);
+
+ return d;
+}
/*!
Creates a QSoundEffect with the given \a parent.
*/
-QSoundEffect::QSoundEffect(QObject *parent) :
- QObject(parent)
+QSoundEffect::QSoundEffect(QObject *parent)
+ : QObject(parent)
+ , d(initPrivate(this, new QSoundEffectPrivate(this)))
+{
+}
+
+/*!
+ Creates a QSoundEffect with the given \a audioDevice and \a parent.
+*/
+QSoundEffect::QSoundEffect(const QAudioDeviceInfo &audioDevice, QObject *parent)
+ : QObject(parent)
+ , d(initPrivate(this, new QSoundEffectPrivate(audioDevice, this)))
{
- d = new QSoundEffectPrivate(this);
- connect(d, &QSoundEffectPrivate::loopsRemainingChanged, this, &QSoundEffect::loopsRemainingChanged);
- connect(d, &QSoundEffectPrivate::volumeChanged, this, &QSoundEffect::volumeChanged);
- connect(d, &QSoundEffectPrivate::mutedChanged, this, &QSoundEffect::mutedChanged);
- connect(d, &QSoundEffectPrivate::loadedChanged, this, &QSoundEffect::loadedChanged);
- connect(d, &QSoundEffectPrivate::playingChanged, this, &QSoundEffect::playingChanged);
- connect(d, &QSoundEffectPrivate::statusChanged, this, &QSoundEffect::statusChanged);
- connect(d, &QSoundEffectPrivate::categoryChanged, this, &QSoundEffect::categoryChanged);
}
/*!
diff --git a/src/multimedia/audio/qsoundeffect.h b/src/multimedia/audio/qsoundeffect.h
index b1c5fd22b..1185afe07 100644
--- a/src/multimedia/audio/qsoundeffect.h
+++ b/src/multimedia/audio/qsoundeffect.h
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
class QSoundEffectPrivate;
+class QAudioDeviceInfo;
class Q_MULTIMEDIA_EXPORT QSoundEffect : public QObject
{
@@ -81,6 +82,7 @@ public:
};
explicit QSoundEffect(QObject *parent = nullptr);
+ explicit QSoundEffect(const QAudioDeviceInfo &audioDevice, QObject *parent = nullptr);
~QSoundEffect();
static QStringList supportedMimeTypes();
diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
index bbaf405b6..075e639a8 100644
--- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp
+++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
@@ -58,7 +58,7 @@
#include <private/qaudiohelpers_p.h>
#include <private/qmediaresourcepolicy_p.h>
#include <private/qmediaresourceset_p.h>
-
+#include <QAudioDeviceInfo>
#include <unistd.h>
//#define QT_PA_DEBUG
@@ -360,6 +360,12 @@ QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent):
this, &QSoundEffectPrivate::handleAvailabilityChanged);
}
+QSoundEffectPrivate::QSoundEffectPrivate(const QAudioDeviceInfo &audioDevice, QObject *parent)
+ : QSoundEffectPrivate(parent)
+{
+ m_sinkName = audioDevice.deviceName();
+}
+
void QSoundEffectPrivate::handleAvailabilityChanged(bool available)
{
m_resourcesAvailable = available;
@@ -1005,8 +1011,9 @@ void QSoundEffectPrivate::createPulseStream()
}
m_pulseStream = stream;
- if (pa_stream_connect_playback(m_pulseStream, nullptr, nullptr,
- PA_STREAM_START_CORKED, nullptr, nullptr) < 0) {
+ if (pa_stream_connect_playback(m_pulseStream,
+ m_sinkName.isEmpty() ? nullptr : m_sinkName.toLatin1().constData(),
+ nullptr, PA_STREAM_START_CORKED, nullptr, nullptr) < 0) {
qWarning("QSoundEffect(pulseaudio): Failed to connect stream, error = %s",
pa_strerror(pa_context_errno(pulseDaemon()->context())));
}
diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.h b/src/multimedia/audio/qsoundeffect_pulse_p.h
index 8f74d67e7..e0073f0d5 100644
--- a/src/multimedia/audio/qsoundeffect_pulse_p.h
+++ b/src/multimedia/audio/qsoundeffect_pulse_p.h
@@ -73,6 +73,7 @@ class QSoundEffectPrivate : public QObject
Q_OBJECT
public:
explicit QSoundEffectPrivate(QObject* parent);
+ explicit QSoundEffectPrivate(const QAudioDeviceInfo &audioDevice, QObject *parent);
~QSoundEffectPrivate();
static QStringList supportedMimeTypes();
@@ -150,6 +151,7 @@ private:
static void stream_adjust_prebuffer_callback(pa_stream *s, int success, void *userdata);
pa_stream *m_pulseStream = nullptr;
+ QString m_sinkName;
int m_sinkInputId = -1;
pa_sample_spec m_pulseSpec;
int m_pulseBufferSize = 0;
diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp
index d7a19eeec..ac4dd9cf9 100644
--- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp
+++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp
@@ -66,6 +66,12 @@ QSoundEffectPrivate::QSoundEffectPrivate(QObject *parent):
{
}
+QSoundEffectPrivate::QSoundEffectPrivate(const QAudioDeviceInfo &audioDevice, QObject *parent)
+ : QObject(parent)
+ , d(new PrivateSoundSource(this, audioDevice))
+{
+}
+
QSoundEffectPrivate::~QSoundEffectPrivate()
{
}
@@ -309,8 +315,9 @@ void QSoundEffectPrivate::setCategory(const QString &category)
}
}
-PrivateSoundSource::PrivateSoundSource(QSoundEffectPrivate *s):
- QIODevice(s)
+PrivateSoundSource::PrivateSoundSource(QSoundEffectPrivate *s, const QAudioDeviceInfo &audioDevice)
+ : QIODevice(s)
+ , m_audioDevice(audioDevice)
{
soundeffect = s;
m_category = QLatin1String("game");
@@ -328,7 +335,10 @@ void PrivateSoundSource::sampleReady()
disconnect(m_sample, &QSample::error, this, &PrivateSoundSource::decoderError);
disconnect(m_sample, &QSample::ready, this, &PrivateSoundSource::sampleReady);
if (!m_audioOutput) {
- m_audioOutput = new QAudioOutput(m_sample->format());
+ if (m_audioDevice.isNull())
+ m_audioOutput = new QAudioOutput(m_sample->format());
+ else
+ m_audioOutput = new QAudioOutput(m_audioDevice, m_sample->format());
connect(m_audioOutput, &QAudioOutput::stateChanged, this, &PrivateSoundSource::stateChanged);
if (!m_muted)
m_audioOutput->setVolume(m_volume);
diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.h b/src/multimedia/audio/qsoundeffect_qaudio_p.h
index c02a85969..a3a48f60d 100644
--- a/src/multimedia/audio/qsoundeffect_qaudio_p.h
+++ b/src/multimedia/audio/qsoundeffect_qaudio_p.h
@@ -66,7 +66,7 @@ class PrivateSoundSource : public QIODevice
friend class QSoundEffectPrivate;
Q_OBJECT
public:
- PrivateSoundSource(QSoundEffectPrivate *s);
+ PrivateSoundSource(QSoundEffectPrivate *s, const QAudioDeviceInfo &audioDevice = QAudioDeviceInfo());
~PrivateSoundSource() {}
qint64 readData(char *data, qint64 len) override;
@@ -90,7 +90,7 @@ private:
bool m_sampleReady = false;
qint64 m_offset = 0;
QString m_category;
-
+ QAudioDeviceInfo m_audioDevice;
QSoundEffectPrivate *soundeffect = nullptr;
};
@@ -102,6 +102,7 @@ class QSoundEffectPrivate : public QObject
public:
explicit QSoundEffectPrivate(QObject *parent);
+ explicit QSoundEffectPrivate(const QAudioDeviceInfo &audioDevice, QObject *parent);
~QSoundEffectPrivate();
static QStringList supportedMimeTypes();
diff --git a/src/multimedia/playback/qmediacontent.cpp b/src/multimedia/playback/qmediacontent.cpp
index fe377b969..bce65ddbc 100644
--- a/src/multimedia/playback/qmediacontent.cpp
+++ b/src/multimedia/playback/qmediacontent.cpp
@@ -61,14 +61,20 @@ public:
isPlaylistOwned(false)
{}
+#if QT_DEPRECATED_SINCE(6, 0)
QMediaContentPrivate(const QMediaResourceList &r):
resources(r),
isPlaylistOwned(false)
{}
+#endif
QMediaContentPrivate(const QMediaContentPrivate &other):
QSharedData(other),
+#if QT_DEPRECATED_SINCE(6, 0)
resources(other.resources),
+#else
+ request(other.request),
+#endif
playlist(other.playlist),
isPlaylistOwned(false)
{}
@@ -77,7 +83,11 @@ public:
playlist(pls),
isPlaylistOwned(isOwn)
{
+#if QT_DEPRECATED_SINCE(6, 0)
resources << QMediaResource(url);
+#else
+ request.setUrl(url);
+#endif
}
~QMediaContentPrivate()
@@ -88,10 +98,18 @@ public:
bool operator ==(const QMediaContentPrivate &other) const
{
+#if QT_DEPRECATED_SINCE(6, 0)
return resources == other.resources && playlist == other.playlist;
+#else
+ return request == other.request && playlist == other.playlist;
+#endif
}
+#if QT_DEPRECATED_SINCE(6, 0)
QMediaResourceList resources;
+#else
+ QNetworkRequest request;
+#endif
QPointer<QMediaPlaylist> playlist;
bool isPlaylistOwned;
@@ -139,7 +157,11 @@ QMediaContent::QMediaContent()
QMediaContent::QMediaContent(const QUrl &url):
d(new QMediaContentPrivate)
{
+#if QT_DEPRECATED_SINCE(6, 0)
d->resources << QMediaResource(url);
+#else
+ d->request.setUrl(url);
+#endif
}
/*!
@@ -152,10 +174,17 @@ QMediaContent::QMediaContent(const QUrl &url):
QMediaContent::QMediaContent(const QNetworkRequest &request):
d(new QMediaContentPrivate)
{
+#if QT_DEPRECATED_SINCE(6, 0)
d->resources << QMediaResource(request);
+#else
+ d->request = request;
+#endif
}
+#if QT_DEPRECATED_SINCE(6, 0)
/*!
+ \obsolete
+
Constructs a media content with \a resource providing a reference to the content.
*/
@@ -166,6 +195,8 @@ QMediaContent::QMediaContent(const QMediaResource &resource):
}
/*!
+ \obsolete
+
Constructs a media content with \a resources providing a reference to the content.
*/
@@ -173,6 +204,7 @@ QMediaContent::QMediaContent(const QMediaResourceList &resources):
d(new QMediaContentPrivate(resources))
{
}
+#endif
/*!
Constructs a copy of the media content \a other.
@@ -250,7 +282,11 @@ bool QMediaContent::isNull() const
QUrl QMediaContent::canonicalUrl() const
{
+#if QT_DEPRECATED_SINCE(6, 0)
return canonicalResource().url();
+#else
+ return canonicalRequest().url();
+#endif
}
/*!
@@ -259,10 +295,17 @@ QUrl QMediaContent::canonicalUrl() const
QNetworkRequest QMediaContent::canonicalRequest() const
{
+#if QT_DEPRECATED_SINCE(6, 0)
return canonicalResource().request();
+#else
+ return d.constData() != 0 ? d->request : QNetworkRequest();
+#endif
}
+#if QT_DEPRECATED_SINCE(6, 0)
/*!
+ \obsolete
+
Returns a QMediaResource that represents that canonical resource for this media content.
*/
@@ -274,6 +317,8 @@ QMediaResource QMediaContent::canonicalResource() const
}
/*!
+ \obsolete
+
Returns a list of alternative resources for this media content. The first item in this list
is always the canonical resource.
*/
@@ -284,6 +329,7 @@ QMediaResourceList QMediaContent::resources() const
? d->resources
: QMediaResourceList();
}
+#endif // #if QT_DEPRECATED_SINCE(6, 0)
/*!
Returns a playlist for this media content or 0 if this QMediaContent is not a playlist.
diff --git a/src/multimedia/playback/qmediacontent.h b/src/multimedia/playback/qmediacontent.h
index f7c086752..5193a1fcc 100644
--- a/src/multimedia/playback/qmediacontent.h
+++ b/src/multimedia/playback/qmediacontent.h
@@ -58,8 +58,10 @@ public:
QMediaContent();
QMediaContent(const QUrl &contentUrl);
QMediaContent(const QNetworkRequest &contentRequest);
- QMediaContent(const QMediaResource &contentResource);
- QMediaContent(const QMediaResourceList &resources);
+#if QT_DEPRECATED_SINCE(6, 0)
+ QT_DEPRECATED QMediaContent(const QMediaResource &contentResource);
+ QT_DEPRECATED QMediaContent(const QMediaResourceList &resources);
+#endif
QMediaContent(const QMediaContent &other);
QMediaContent(QMediaPlaylist *playlist, const QUrl &contentUrl = QUrl(), bool takeOwnership = false);
~QMediaContent();
@@ -73,9 +75,10 @@ public:
QUrl canonicalUrl() const;
QNetworkRequest canonicalRequest() const;
- QMediaResource canonicalResource() const;
-
- QMediaResourceList resources() const;
+#if QT_DEPRECATED_SINCE(6, 0)
+ QT_DEPRECATED QMediaResource canonicalResource() const;
+ QT_DEPRECATED QMediaResourceList resources() const;
+#endif
QMediaPlaylist *playlist() const;
private:
diff --git a/src/multimedia/playback/qmediaresource.cpp b/src/multimedia/playback/qmediaresource.cpp
index 0a59b0de8..181b37525 100644
--- a/src/multimedia/playback/qmediaresource.cpp
+++ b/src/multimedia/playback/qmediaresource.cpp
@@ -39,6 +39,8 @@
#include "qmediaresource.h"
+#if QT_DEPRECATED_SINCE(6, 0)
+
#include <QtCore/qsize.h>
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
@@ -61,6 +63,7 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterMediaResourceMetaTypes)
\inmodule QtMultimedia
\ingroup multimedia
\ingroup multimedia_playback
+ \obsolete
A media resource is composed of a \l {url()}{URL} containing the
location of the resource and a set of properties that describe the
@@ -418,3 +421,4 @@ void QMediaResource::setResolution(int width, int height)
}
QT_END_NAMESPACE
+#endif // #if QT_DEPRECATED_SINCE(6, 0)
diff --git a/src/multimedia/playback/qmediaresource.h b/src/multimedia/playback/qmediaresource.h
index 9740166c6..8cded3128 100644
--- a/src/multimedia/playback/qmediaresource.h
+++ b/src/multimedia/playback/qmediaresource.h
@@ -46,6 +46,8 @@
#include <QtMultimedia/qtmultimediaglobal.h>
+#if QT_DEPRECATED_SINCE(6, 0)
+
QT_BEGIN_NAMESPACE
// Class forward declaration required for QDoc bug
@@ -124,4 +126,6 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QMediaResource)
Q_DECLARE_METATYPE(QMediaResourceList)
+#endif // #if QT_DEPRECATED_SINCE(6, 0)
+
#endif
diff --git a/src/multimedia/playback/qplaylistfileparser.cpp b/src/multimedia/playback/qplaylistfileparser.cpp
index 0d33f040d..49c417085 100644
--- a/src/multimedia/playback/qplaylistfileparser.cpp
+++ b/src/multimedia/playback/qplaylistfileparser.cpp
@@ -299,9 +299,10 @@ public:
struct ParserJob
{
QIODevice *m_stream;
- QMediaResource m_resource;
- bool isValid() const { return m_stream || !m_resource.isNull(); }
- void reset() { m_stream = 0; m_resource = QMediaResource(); }
+ QMediaContent m_media;
+ QString m_mimeType;
+ bool isValid() const { return m_stream || !m_media.isNull(); }
+ void reset() { m_stream = 0; m_media = QMediaContent(); m_mimeType = QString(); }
} m_pendingJob;
int m_scanIndex;
int m_lineIndex;
@@ -498,22 +499,12 @@ QPlaylistFileParser::FileType QPlaylistFileParser::findPlaylistType(const QStrin
/*
* Delegating
*/
-void QPlaylistFileParser::start(const QMediaContent &media, QIODevice *stream)
+void QPlaylistFileParser::start(const QMediaContent &media, QIODevice *stream, const QString &mimeType)
{
- const QMediaResource &mediaResource = media.canonicalResource();
- const QString &mimeType = mediaResource.mimeType();
-
- if (stream) {
- start(stream, mediaResource.mimeType());
- } else {
- const QNetworkRequest &request = mediaResource.request();
- const QUrl &url = mediaResource.url();
-
- if (request.url().isValid())
- start(request, mimeType);
- else
- start(QNetworkRequest(url), mimeType);
- }
+ if (stream)
+ start(stream, mimeType);
+ else
+ start(media.canonicalRequest(), mimeType);
}
void QPlaylistFileParser::start(QIODevice *stream, const QString &mimeType)
@@ -528,7 +519,7 @@ void QPlaylistFileParser::start(QIODevice *stream, const QString &mimeType)
if (!d->m_currentParser.isNull()) {
abort();
- d->m_pendingJob = { stream, QMediaResource(QUrl(), mimeType) };
+ d->m_pendingJob = { stream, QUrl(), mimeType };
return;
}
@@ -551,7 +542,7 @@ void QPlaylistFileParser::start(const QNetworkRequest& request, const QString &m
if (!d->m_currentParser.isNull()) {
abort();
- d->m_pendingJob = { nullptr, QMediaResource(request, mimeType) };
+ d->m_pendingJob = { nullptr, request, mimeType };
return;
}
@@ -604,7 +595,7 @@ void QPlaylistFileParserPrivate::handleParserFinished()
m_source.reset();
if (m_pendingJob.isValid())
- q->start(m_pendingJob.m_resource, m_pendingJob.m_stream);
+ q->start(m_pendingJob.m_media, m_pendingJob.m_stream, m_pendingJob.m_mimeType);
}
void QPlaylistFileParserPrivate::abort()
diff --git a/src/multimedia/playback/qplaylistfileparser_p.h b/src/multimedia/playback/qplaylistfileparser_p.h
index 927dbb739..328ecf998 100644
--- a/src/multimedia/playback/qplaylistfileparser_p.h
+++ b/src/multimedia/playback/qplaylistfileparser_p.h
@@ -86,7 +86,7 @@ public:
NetworkError
};
- void start(const QMediaContent &media, QIODevice *stream = 0);
+ void start(const QMediaContent &media, QIODevice *stream = 0, const QString &mimeType = QString());
void start(const QNetworkRequest &request, const QString &mimeType = QString());
void abort();
diff --git a/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h b/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h
index 465821cb1..894796dfb 100644
--- a/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h
+++ b/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h
@@ -79,9 +79,19 @@ class Q_MULTIMEDIAQUICK_EXPORT QDeclarativeVideoOutput : public QQuickItem
Q_PROPERTY(QRectF sourceRect READ sourceRect NOTIFY sourceRectChanged)
Q_PROPERTY(QRectF contentRect READ contentRect NOTIFY contentRectChanged)
Q_PROPERTY(QQmlListProperty<QAbstractVideoFilter> filters READ filters);
+ Q_PROPERTY(FlushMode flushMode READ flushMode WRITE setFlushMode NOTIFY flushModeChanged)
+ Q_ENUMS(FlushMode)
Q_ENUMS(FillMode)
public:
+
+ enum FlushMode
+ {
+ EmptyFrame,
+ FirstFrame,
+ LastFrame
+ };
+
enum FillMode
{
Stretch = Qt::IgnoreAspectRatio,
@@ -125,6 +135,9 @@ public:
QQmlListProperty<QAbstractVideoFilter> filters();
+ FlushMode flushMode() const { return m_flushMode; }
+ void setFlushMode(FlushMode mode);
+
Q_SIGNALS:
void sourceChanged();
void fillModeChanged(QDeclarativeVideoOutput::FillMode);
@@ -132,6 +145,7 @@ Q_SIGNALS:
void autoOrientationChanged();
void sourceRectChanged();
void contentRectChanged();
+ void flushModeChanged();
protected:
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
@@ -175,6 +189,7 @@ private:
QScopedPointer<QDeclarativeVideoBackend> m_backend;
QList<QAbstractVideoFilter *> m_filters;
+ FlushMode m_flushMode = EmptyFrame;
};
QT_END_NAMESPACE
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp
index bbb87b63b..426aaef0a 100644
--- a/src/multimedia/video/qvideoframe.cpp
+++ b/src/multimedia/video/qvideoframe.cpp
@@ -195,6 +195,9 @@ private:
\value Format_BGRA32_Premultiplied
The frame is stored using a premultiplied 32bit BGRA format.
+ \value Format_ABGR32
+ The frame is stored using a 32-bit ABGR format (0xAABBGGRR).
+
\value Format_BGR32
The frame is stored using a 32-bit BGR format (0xBBGGRRff).
@@ -606,6 +609,7 @@ bool QVideoFrame::map(QAbstractVideoBuffer::MapMode mode)
case Format_ARGB8565_Premultiplied:
case Format_BGRA32:
case Format_BGRA32_Premultiplied:
+ case Format_ABGR32:
case Format_BGR32:
case Format_BGR24:
case Format_BGR565:
@@ -1035,6 +1039,7 @@ static VideoFrameConvertFunc qConvertFuncs[QVideoFrame::NPixelFormats] = {
/* Format_ARGB8565_Premultiplied */ nullptr, // Not needed
/* Format_BGRA32 */ qt_convert_BGRA32_to_ARGB32,
/* Format_BGRA32_Premultiplied */ qt_convert_BGRA32_to_ARGB32,
+ /* Format_ABGR32 */ nullptr,
/* Format_BGR32 */ qt_convert_BGRA32_to_ARGB32,
/* Format_BGR24 */ qt_convert_BGR24_to_ARGB32,
/* Format_BGR565 */ qt_convert_BGR565_to_ARGB32,
@@ -1157,6 +1162,8 @@ QDebug operator<<(QDebug dbg, QVideoFrame::PixelFormat pf)
return dbg << "Format_BGRA32";
case QVideoFrame::Format_BGRA32_Premultiplied:
return dbg << "Format_BGRA32_Premultiplied";
+ case QVideoFrame::Format_ABGR32:
+ return dbg << "Format_ABGR32";
case QVideoFrame::Format_BGR32:
return dbg << "Format_BGR32";
case QVideoFrame::Format_BGR24:
diff --git a/src/multimedia/video/qvideoframe.h b/src/multimedia/video/qvideoframe.h
index be7517c7c..2d906cb7c 100644
--- a/src/multimedia/video/qvideoframe.h
+++ b/src/multimedia/video/qvideoframe.h
@@ -75,6 +75,7 @@ public:
Format_ARGB8565_Premultiplied,
Format_BGRA32,
Format_BGRA32_Premultiplied,
+ Format_ABGR32,
Format_BGR32,
Format_BGR24,
Format_BGR565,