summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/audio/qaudiobuffer.cpp29
-rw-r--r--src/multimedia/audio/qaudiodecoder.cpp18
-rw-r--r--src/multimedia/audio/qaudiodevicefactory.cpp8
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo.cpp6
-rw-r--r--src/multimedia/audio/qaudioprobe.cpp6
-rw-r--r--src/multimedia/audio/qsamplecache_p.cpp10
-rw-r--r--src/multimedia/audio/qsamplecache_p.h2
-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/audio/qwavedecoder_p.h2
-rw-r--r--src/multimedia/camera/qcamera.cpp46
-rw-r--r--src/multimedia/camera/qcamera_p.h24
-rw-r--r--src/multimedia/camera/qcameraexposure.cpp6
-rw-r--r--src/multimedia/camera/qcamerafocus.cpp6
-rw-r--r--src/multimedia/camera/qcameraimagecapture.cpp34
-rw-r--r--src/multimedia/camera/qcameraimageprocessing.cpp2
-rw-r--r--src/multimedia/configure.json36
-rw-r--r--src/multimedia/controls/qmediaplaylistcontrol_p.h2
-rw-r--r--src/multimedia/controls/qmediaplaylistsourcecontrol_p.h2
-rw-r--r--src/multimedia/doc/QtMultimediaDoc1
-rw-r--r--src/multimedia/doc/qtmultimedia.qdocconf5
-rw-r--r--src/multimedia/doc/src/multimedia.qdoc6
-rw-r--r--src/multimedia/doc/src/qtaudioengine.qdoc10
-rw-r--r--src/multimedia/doc/src/qtmultimedia5.qdoc29
-rw-r--r--src/multimedia/gsttools_headers/gstvideoconnector_p.h98
-rw-r--r--src/multimedia/gsttools_headers/qgstappsrc_p.h121
-rw-r--r--src/multimedia/gsttools_headers/qgstbufferpoolinterface_p.h117
-rw-r--r--src/multimedia/gsttools_headers/qgstcodecsinfo_p.h92
-rw-r--r--src/multimedia/gsttools_headers/qgstreameraudioinputselector_p.h88
-rw-r--r--src/multimedia/gsttools_headers/qgstreameraudioprobecontrol_p.h90
-rw-r--r--src/multimedia/gsttools_headers/qgstreamerbufferprobe_p.h97
-rw-r--r--src/multimedia/gsttools_headers/qgstreamerbushelper_p.h104
-rw-r--r--src/multimedia/gsttools_headers/qgstreamermessage_p.h84
-rw-r--r--src/multimedia/gsttools_headers/qgstreamermirtexturerenderer_p.h119
-rw-r--r--src/multimedia/gsttools_headers/qgstreamerplayercontrol_p.h145
-rw-r--r--src/multimedia/gsttools_headers/qgstreamerplayersession_p.h281
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideoinputdevicecontrol_p.h93
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h127
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideoprobecontrol_p.h100
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h94
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideorendererinterface_p.h85
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideowidget_p.h128
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideowindow_p.h127
-rw-r--r--src/multimedia/gsttools_headers/qgsttools_global_p.h70
-rw-r--r--src/multimedia/gsttools_headers/qgstutils_p.h169
-rw-r--r--src/multimedia/gsttools_headers/qgstvideobuffer_p.h106
-rw-r--r--src/multimedia/gsttools_headers/qgstvideorendererplugin_p.h110
-rw-r--r--src/multimedia/gsttools_headers/qgstvideorenderersink_p.h185
-rw-r--r--src/multimedia/gsttools_headers/qvideosurfacegstsink_p.h192
-rw-r--r--src/multimedia/playback/qmediacontent.cpp81
-rw-r--r--src/multimedia/playback/qmediacontent.h13
-rw-r--r--src/multimedia/playback/qmedianetworkplaylistprovider_p.h4
-rw-r--r--src/multimedia/playback/qmediaplayer.cpp86
-rw-r--r--src/multimedia/playback/qmediaplaylist.cpp6
-rw-r--r--src/multimedia/playback/qmediaplaylist_p.h12
-rw-r--r--src/multimedia/playback/qmediaplaylistioplugin_p.h2
-rw-r--r--src/multimedia/playback/qmediaplaylistnavigator.cpp2
-rw-r--r--src/multimedia/playback/qmediaplaylistnavigator_p.h2
-rw-r--r--src/multimedia/playback/qmediaplaylistprovider_p.h8
-rw-r--r--src/multimedia/playback/qmediaresource.cpp4
-rw-r--r--src/multimedia/playback/qmediaresource.h4
-rw-r--r--src/multimedia/playback/qplaylistfileparser.cpp35
-rw-r--r--src/multimedia/playback/qplaylistfileparser_p.h6
-rw-r--r--src/multimedia/qmediacontrol.h2
-rw-r--r--src/multimedia/qmediametadata.cpp4
-rw-r--r--src/multimedia/qmediaobject.cpp6
-rw-r--r--src/multimedia/qmediaobject_p.h2
-rw-r--r--src/multimedia/qmediapluginloader.cpp34
-rw-r--r--src/multimedia/qmediaresourcepolicy_p.cpp2
-rw-r--r--src/multimedia/qmediaresourcepolicyplugin_p.h2
-rw-r--r--src/multimedia/qmediaresourceset_p.h2
-rw-r--r--src/multimedia/qmediaserviceprovider.cpp29
-rw-r--r--src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h15
-rw-r--r--src/multimedia/radio/qradiodata.cpp32
-rw-r--r--src/multimedia/radio/qradiotuner.cpp58
-rw-r--r--src/multimedia/recording/qaudiorecorder.cpp16
-rw-r--r--src/multimedia/recording/qmediarecorder.cpp46
-rw-r--r--src/multimedia/video/qabstractvideobuffer.cpp4
-rw-r--r--src/multimedia/video/qabstractvideobuffer_p.h2
-rw-r--r--src/multimedia/video/qimagevideobuffer.cpp2
-rw-r--r--src/multimedia/video/qmemoryvideobuffer.cpp2
-rw-r--r--src/multimedia/video/qvideoframe.cpp40
-rw-r--r--src/multimedia/video/qvideoframe.h2
-rw-r--r--src/multimedia/video/qvideooutputorientationhandler_p.h2
-rw-r--r--src/multimedia/video/qvideoprobe.cpp6
-rw-r--r--src/multimedia/video/qvideosurfaceoutput.cpp4
-rw-r--r--src/multimedia/video/qvideosurfaceoutput_p.h2
91 files changed, 531 insertions, 3434 deletions
diff --git a/src/multimedia/audio/qaudiobuffer.cpp b/src/multimedia/audio/qaudiobuffer.cpp
index 849d79ab3..1e43ebd00 100644
--- a/src/multimedia/audio/qaudiobuffer.cpp
+++ b/src/multimedia/audio/qaudiobuffer.cpp
@@ -85,7 +85,7 @@ public:
static QAudioBufferPrivate *acquire(QAudioBufferPrivate *other)
{
if (!other)
- return 0;
+ return nullptr;
// Ref the other (if there are extant data() pointers, they will
// also point here - it's a feature, not a bug, like QByteArray)
@@ -131,7 +131,7 @@ public:
}
}
} else
- mBuffer = 0;
+ mBuffer = nullptr;
}
~QMemoryAudioBufferProvider()
@@ -178,7 +178,7 @@ QAudioBufferPrivate *QAudioBufferPrivate::clone()
}
}
- return 0;
+ return nullptr;
}
/*!
@@ -199,7 +199,7 @@ QAudioBufferPrivate *QAudioBufferPrivate::clone()
Create a new, empty, invalid buffer.
*/
QAudioBuffer::QAudioBuffer()
- : d(0)
+ : d(nullptr)
{
}
@@ -244,7 +244,7 @@ QAudioBuffer::QAudioBuffer(const QByteArray &data, const QAudioFormat &format, q
int frameCount = format.framesForBytes(data.size());
d = new QAudioBufferPrivate(new QMemoryAudioBufferProvider(data.constData(), frameCount, format, startTime));
} else
- d = 0;
+ d = nullptr;
}
/*!
@@ -259,9 +259,9 @@ QAudioBuffer::QAudioBuffer(const QByteArray &data, const QAudioFormat &format, q
QAudioBuffer::QAudioBuffer(int numFrames, const QAudioFormat &format, qint64 startTime)
{
if (format.isValid())
- d = new QAudioBufferPrivate(new QMemoryAudioBufferProvider(0, numFrames, format, startTime));
+ d = new QAudioBufferPrivate(new QMemoryAudioBufferProvider(nullptr, numFrames, format, startTime));
else
- d = 0;
+ d = nullptr;
}
/*!
@@ -394,7 +394,7 @@ qint64 QAudioBuffer::startTime() const
const void* QAudioBuffer::constData() const
{
if (!isValid())
- return 0;
+ return nullptr;
return d->mProvider->constData();
}
@@ -417,7 +417,7 @@ const void* QAudioBuffer::constData() const
const void* QAudioBuffer::data() const
{
if (!isValid())
- return 0;
+ return nullptr;
return d->mProvider->constData();
}
@@ -456,7 +456,7 @@ const void* QAudioBuffer::data() const
void *QAudioBuffer::data()
{
if (!isValid())
- return 0;
+ return nullptr;
if (d->mCount.load() != 1) {
// Can't share a writable buffer
@@ -465,7 +465,7 @@ void *QAudioBuffer::data()
// This shouldn't happen
if (!newd)
- return 0;
+ return nullptr;
d->deref();
d = newd;
@@ -489,7 +489,7 @@ void *QAudioBuffer::data()
return memBuffer->writableData();
}
- return 0;
+ return nullptr;
}
// Template helper classes worth documenting
@@ -573,35 +573,30 @@ void *QAudioBuffer::data()
/*!
\typedef QAudioBuffer::S8U
- \relates QAudioBuffer::StereoFrame
This is a predefined specialization for an unsigned stereo 8 bit sample. Each
channel is an \e {unsigned char}.
*/
/*!
\typedef QAudioBuffer::S8S
- \relates QAudioBuffer::StereoFrame
This is a predefined specialization for a signed stereo 8 bit sample. Each
channel is a \e {signed char}.
*/
/*!
\typedef QAudioBuffer::S16U
- \relates QAudioBuffer::StereoFrame
This is a predefined specialization for an unsigned stereo 16 bit sample. Each
channel is an \e {unsigned short}.
*/
/*!
\typedef QAudioBuffer::S16S
- \relates QAudioBuffer::StereoFrame
This is a predefined specialization for a signed stereo 16 bit sample. Each
channel is a \e {signed short}.
*/
/*!
\typedef QAudioBuffer::S32F
- \relates QAudioBuffer::StereoFrame
This is a predefined specialization for an 32 bit float sample. Each
channel is a \e float.
diff --git a/src/multimedia/audio/qaudiodecoder.cpp b/src/multimedia/audio/qaudiodecoder.cpp
index ea1d0e56d..b4ba854e1 100644
--- a/src/multimedia/audio/qaudiodecoder.cpp
+++ b/src/multimedia/audio/qaudiodecoder.cpp
@@ -84,8 +84,8 @@ class QAudioDecoderPrivate : public QMediaObjectPrivate
public:
QAudioDecoderPrivate()
- : provider(0)
- , control(0)
+ : provider(nullptr)
+ , control(nullptr)
, state(QAudioDecoder::StoppedState)
, error(QAudioDecoder::NoError)
{}
@@ -135,7 +135,7 @@ QAudioDecoder::QAudioDecoder(QObject *parent)
d->provider = QMediaServiceProvider::defaultServiceProvider();
if (d->service) {
d->control = qobject_cast<QAudioDecoderControl*>(d->service->requestControl(QAudioDecoderControl_iid));
- if (d->control != 0) {
+ if (d->control != nullptr) {
connect(d->control, SIGNAL(stateChanged(QAudioDecoder::State)), SLOT(_q_stateChanged(QAudioDecoder::State)));
connect(d->control, SIGNAL(error(int,QString)), SLOT(_q_error(int,QString)));
@@ -205,7 +205,7 @@ void QAudioDecoder::start()
{
Q_D(QAudioDecoder);
- if (d->control == 0) {
+ if (d->control == nullptr) {
QMetaObject::invokeMethod(this, "_q_error", Qt::QueuedConnection,
Q_ARG(int, QAudioDecoder::ServiceMissingError),
Q_ARG(QString, tr("The QAudioDecoder object does not have a valid service")));
@@ -226,7 +226,7 @@ void QAudioDecoder::stop()
{
Q_D(QAudioDecoder);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->stop();
}
@@ -256,7 +256,7 @@ void QAudioDecoder::setSourceFilename(const QString &fileName)
{
Q_D(QAudioDecoder);
- if (d->control != 0)
+ if (d->control != nullptr)
d_func()->control->setSourceFilename(fileName);
}
@@ -269,7 +269,7 @@ QIODevice *QAudioDecoder::sourceDevice() const
Q_D(const QAudioDecoder);
if (d->control)
return d->control->sourceDevice();
- return 0;
+ return nullptr;
}
/*!
@@ -285,7 +285,7 @@ void QAudioDecoder::setSourceDevice(QIODevice *device)
{
Q_D(QAudioDecoder);
- if (d->control != 0)
+ if (d->control != nullptr)
d_func()->control->setSourceDevice(device);
}
@@ -327,7 +327,7 @@ void QAudioDecoder::setAudioFormat(const QAudioFormat &format)
if (state() != QAudioDecoder::StoppedState)
return;
- if (d->control != 0)
+ if (d->control != nullptr)
d_func()->control->setAudioFormat(format);
}
diff --git a/src/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/audio/qaudiodevicefactory.cpp
index b1788f28a..cf770c468 100644
--- a/src/multimedia/audio/qaudiodevicefactory.cpp
+++ b/src/multimedia/audio/qaudiodevicefactory.cpp
@@ -77,7 +77,7 @@ class QNullInputDevice : public QAbstractAudioInput
{
public:
void start(QIODevice*) override { qWarning()<<"using null input device, none available";}
- QIODevice* start() override { qWarning()<<"using null input device, none available"; return 0; }
+ QIODevice *start() override { qWarning()<<"using null input device, none available"; return nullptr; }
void stop() override {}
void reset() override {}
void suspend() override {}
@@ -102,7 +102,7 @@ class QNullOutputDevice : public QAbstractAudioOutput
{
public:
void start(QIODevice*) override {qWarning()<<"using null output device, none available";}
- QIODevice* start() override { qWarning()<<"using null output device, none available"; return 0; }
+ QIODevice *start() override { qWarning()<<"using null output device, none available"; return nullptr; }
void stop() override {}
void reset() override {}
void suspend() override {}
@@ -194,7 +194,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultDevice(QAudio::Mode mode)
QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode)
{
- QAbstractAudioDeviceInfo *rc = 0;
+ QAbstractAudioDeviceInfo *rc = nullptr;
#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
QAudioSystemFactoryInterface* plugin =
@@ -204,7 +204,7 @@ QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &re
rc = plugin->createDeviceInfo(handle, mode);
#endif
- return rc == 0 ? new QNullDeviceInfo() : rc;
+ return rc == nullptr ? new QNullDeviceInfo() : rc;
}
QAbstractAudioInput* QAudioDeviceFactory::createDefaultInputDevice(QAudioFormat const &format)
diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp
index f4f548017..b8cac18eb 100644
--- a/src/multimedia/audio/qaudiodeviceinfo.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo.cpp
@@ -57,7 +57,7 @@ class QAudioDeviceInfoPrivate : public QSharedData
public:
QAudioDeviceInfoPrivate()
: mode(QAudio::AudioOutput)
- , info(0)
+ , info(nullptr)
{
}
@@ -67,7 +67,7 @@ public:
if (!handle.isEmpty())
info = QAudioDeviceFactory::audioDeviceInfo(realm, handle, mode);
else
- info = NULL;
+ info = nullptr;
}
QAudioDeviceInfoPrivate(const QAudioDeviceInfoPrivate &other):
@@ -213,7 +213,7 @@ bool QAudioDeviceInfo::operator !=(const QAudioDeviceInfo &other) const
*/
bool QAudioDeviceInfo::isNull() const
{
- return d->info == 0;
+ return d->info == nullptr;
}
/*!
diff --git a/src/multimedia/audio/qaudioprobe.cpp b/src/multimedia/audio/qaudioprobe.cpp
index 23687c3cb..b6fe86b11 100644
--- a/src/multimedia/audio/qaudioprobe.cpp
+++ b/src/multimedia/audio/qaudioprobe.cpp
@@ -156,7 +156,7 @@ bool QAudioProbe::setSource(QMediaObject *source)
}
}
- return (!source || d->probee != 0);
+ return (!source || d->probee != nullptr);
}
/*!
@@ -176,7 +176,7 @@ bool QAudioProbe::setSource(QMediaObject *source)
*/
bool QAudioProbe::setSource(QMediaRecorder *mediaRecorder)
{
- QMediaObject *source = mediaRecorder ? mediaRecorder->mediaObject() : 0;
+ QMediaObject *source = mediaRecorder ? mediaRecorder->mediaObject() : nullptr;
bool result = setSource(source);
if (!mediaRecorder)
@@ -195,7 +195,7 @@ bool QAudioProbe::setSource(QMediaRecorder *mediaRecorder)
*/
bool QAudioProbe::isActive() const
{
- return d->probee != 0;
+ return d->probee != nullptr;
}
/*!
diff --git a/src/multimedia/audio/qsamplecache_p.cpp b/src/multimedia/audio/qsamplecache_p.cpp
index 73fc3cd2f..35234f8bb 100644
--- a/src/multimedia/audio/qsamplecache_p.cpp
+++ b/src/multimedia/audio/qsamplecache_p.cpp
@@ -97,7 +97,7 @@ QT_BEGIN_NAMESPACE
QSampleCache::QSampleCache(QObject *parent)
: QObject(parent)
- , m_networkAccessManager(0)
+ , m_networkAccessManager(nullptr)
, m_mutex(QMutex::Recursive)
, m_capacity(0)
, m_usage(0)
@@ -331,8 +331,8 @@ void QSample::cleanup()
if (m_stream)
m_stream->deleteLater();
- m_waveDecoder = 0;
- m_stream = 0;
+ m_waveDecoder = nullptr;
+ m_stream = nullptr;
}
// Called in application thread
@@ -433,8 +433,8 @@ void QSample::onReady()
// Called in application thread, then moved to loader thread
QSample::QSample(const QUrl& url, QSampleCache *parent)
: m_parent(parent)
- , m_stream(0)
- , m_waveDecoder(0)
+ , m_stream(nullptr)
+ , m_waveDecoder(nullptr)
, m_url(url)
, m_sampleReadLength(0)
, m_state(Creating)
diff --git a/src/multimedia/audio/qsamplecache_p.h b/src/multimedia/audio/qsamplecache_p.h
index d3a348528..094e3281e 100644
--- a/src/multimedia/audio/qsamplecache_p.h
+++ b/src/multimedia/audio/qsamplecache_p.h
@@ -127,7 +127,7 @@ class Q_MULTIMEDIA_EXPORT QSampleCache : public QObject
public:
friend class QSample;
- QSampleCache(QObject *parent = 0);
+ QSampleCache(QObject *parent = nullptr);
~QSampleCache();
QSample* requestSample(const QUrl& url);
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 4a2e30185..0855c1f67 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 13df416f3..b553671fa 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/audio/qwavedecoder_p.h b/src/multimedia/audio/qwavedecoder_p.h
index 0f1cef599..3be0dbaa6 100644
--- a/src/multimedia/audio/qwavedecoder_p.h
+++ b/src/multimedia/audio/qwavedecoder_p.h
@@ -64,7 +64,7 @@ class QWaveDecoder : public QIODevice
Q_OBJECT
public:
- explicit QWaveDecoder(QIODevice *source, QObject *parent = 0);
+ explicit QWaveDecoder(QIODevice *source, QObject *parent = nullptr);
~QWaveDecoder();
QAudioFormat audioFormat() const;
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp
index bd3f30739..46c6af9ff 100644
--- a/src/multimedia/camera/qcamera.cpp
+++ b/src/multimedia/camera/qcamera.cpp
@@ -206,12 +206,12 @@ void QCameraPrivate::initControls()
error = QCamera::NoError;
} else {
- control = 0;
- locksControl = 0;
- deviceControl = 0;
- infoControl = 0;
- viewfinderSettingsControl = 0;
- viewfinderSettingsControl2 = 0;
+ control = nullptr;
+ locksControl = nullptr;
+ deviceControl = nullptr;
+ infoControl = nullptr;
+ viewfinderSettingsControl = nullptr;
+ viewfinderSettingsControl2 = nullptr;
error = QCamera::ServiceMissingError;
errorString = QCamera::tr("The camera service is missing");
@@ -241,16 +241,16 @@ void QCameraPrivate::clear()
provider->releaseService(service);
}
- cameraExposure = 0;
- cameraFocus = 0;
- imageProcessing = 0;
- control = 0;
- locksControl = 0;
- deviceControl = 0;
- infoControl = 0;
- viewfinderSettingsControl = 0;
- viewfinderSettingsControl2 = 0;
- service = 0;
+ cameraExposure = nullptr;
+ cameraFocus = nullptr;
+ imageProcessing = nullptr;
+ control = nullptr;
+ locksControl = nullptr;
+ deviceControl = nullptr;
+ infoControl = nullptr;
+ viewfinderSettingsControl = nullptr;
+ viewfinderSettingsControl2 = nullptr;
+ service = nullptr;
}
void QCameraPrivate::updateLockStatus()
@@ -328,7 +328,7 @@ QCamera::QCamera(QObject *parent):
d->init();
// Select the default camera
- if (d->service != 0 && d->deviceControl)
+ if (d->service != nullptr && d->deviceControl)
d->deviceControl->setSelectedDevice(d->deviceControl->defaultDevice());
}
@@ -409,7 +409,7 @@ QCamera::QCamera(QCamera::Position position, QObject *parent)
Q_D(QCamera);
d->init();
- if (d->service != 0 && d->deviceControl) {
+ if (d->service != nullptr && d->deviceControl) {
bool selectDefault = true;
if (d->infoControl && position != UnspecifiedPosition) {
@@ -443,7 +443,7 @@ QCamera::~QCamera()
QMultimedia::AvailabilityStatus QCamera::availability() const
{
Q_D(const QCamera);
- if (d->control == NULL)
+ if (d->control == nullptr)
return QMultimedia::ServiceMissing;
if (d->deviceControl && d->deviceControl->deviceCount() == 0)
@@ -497,7 +497,7 @@ void QCamera::setViewfinder(QVideoWidget *viewfinder)
// We don't know (in this library) that QVideoWidget inherits QObject
QObject *viewFinderObject = reinterpret_cast<QObject*>(viewfinder);
- d->viewfinder = viewFinderObject && bind(viewFinderObject) ? viewFinderObject : 0;
+ d->viewfinder = viewFinderObject && bind(viewFinderObject) ? viewFinderObject : nullptr;
}
/*!
@@ -518,7 +518,7 @@ void QCamera::setViewfinder(QGraphicsVideoItem *viewfinder)
// but QObject inheritance depends on QObject coming first, so try this out.
QObject *viewFinderObject = reinterpret_cast<QObject*>(viewfinder);
- d->viewfinder = viewFinderObject && bind(viewFinderObject) ? viewFinderObject : 0;
+ d->viewfinder = viewFinderObject && bind(viewFinderObject) ? viewFinderObject : nullptr;
}
/*!
@@ -538,14 +538,14 @@ void QCamera::setViewfinder(QAbstractVideoSurface *surface)
if (d->viewfinder)
unbind(d->viewfinder);
- d->viewfinder = 0;
+ d->viewfinder = nullptr;
if (surface && bind(&d->surfaceViewfinder))
d->viewfinder = &d->surfaceViewfinder;
} else if (!surface) {
//unbind the surfaceViewfinder if null surface is set
unbind(&d->surfaceViewfinder);
- d->viewfinder = 0;
+ d->viewfinder = nullptr;
}
}
diff --git a/src/multimedia/camera/qcamera_p.h b/src/multimedia/camera/qcamera_p.h
index 49b4376b2..99759dbd3 100644
--- a/src/multimedia/camera/qcamera_p.h
+++ b/src/multimedia/camera/qcamera_p.h
@@ -71,18 +71,18 @@ class QCameraPrivate : public QMediaObjectPrivate
public:
QCameraPrivate():
QMediaObjectPrivate(),
- provider(0),
- control(0),
- deviceControl(0),
- locksControl(0),
- infoControl(0),
- viewfinderSettingsControl(0),
- viewfinderSettingsControl2(0),
- cameraExposure(0),
- cameraFocus(0),
- imageProcessing(0),
- viewfinder(0),
- capture(0),
+ provider(nullptr),
+ control(nullptr),
+ deviceControl(nullptr),
+ locksControl(nullptr),
+ infoControl(nullptr),
+ viewfinderSettingsControl(nullptr),
+ viewfinderSettingsControl2(nullptr),
+ cameraExposure(nullptr),
+ cameraFocus(nullptr),
+ imageProcessing(nullptr),
+ viewfinder(nullptr),
+ capture(nullptr),
state(QCamera::UnloadedState),
error(QCamera::NoError),
requestedLocks(QCamera::NoLock),
diff --git a/src/multimedia/camera/qcameraexposure.cpp b/src/multimedia/camera/qcameraexposure.cpp
index d289aed33..91950c7d2 100644
--- a/src/multimedia/camera/qcameraexposure.cpp
+++ b/src/multimedia/camera/qcameraexposure.cpp
@@ -98,8 +98,8 @@ void QCameraExposurePrivate::initControls()
Q_Q(QCameraExposure);
QMediaService *service = camera->service();
- exposureControl = 0;
- flashControl = 0;
+ exposureControl = nullptr;
+ flashControl = nullptr;
if (service) {
exposureControl = qobject_cast<QCameraExposureControl *>(service->requestControl(QCameraExposureControl_iid));
flashControl = qobject_cast<QCameraFlashControl *>(service->requestControl(QCameraFlashControl_iid));
@@ -217,7 +217,7 @@ QCameraExposure::~QCameraExposure()
*/
bool QCameraExposure::isAvailable() const
{
- return d_func()->exposureControl != 0;
+ return d_func()->exposureControl != nullptr;
}
diff --git a/src/multimedia/camera/qcamerafocus.cpp b/src/multimedia/camera/qcamerafocus.cpp
index 848b33df8..e73a8ea46 100644
--- a/src/multimedia/camera/qcamerafocus.cpp
+++ b/src/multimedia/camera/qcamerafocus.cpp
@@ -339,8 +339,8 @@ void QCameraFocusPrivate::initControls()
{
Q_Q(QCameraFocus);
- focusControl = 0;
- zoomControl = 0;
+ focusControl = nullptr;
+ zoomControl = nullptr;
QMediaService *service = camera->service();
if (service) {
@@ -348,7 +348,7 @@ void QCameraFocusPrivate::initControls()
zoomControl = qobject_cast<QCameraZoomControl *>(service->requestControl(QCameraZoomControl_iid));
}
- available = focusControl != 0;
+ available = focusControl != nullptr;
if (!focusControl)
focusControl = new QCameraFocusFakeFocusControl(q);
diff --git a/src/multimedia/camera/qcameraimagecapture.cpp b/src/multimedia/camera/qcameraimagecapture.cpp
index cedae2609..8f364a686 100644
--- a/src/multimedia/camera/qcameraimagecapture.cpp
+++ b/src/multimedia/camera/qcameraimagecapture.cpp
@@ -117,11 +117,11 @@ public:
};
QCameraImageCapturePrivate::QCameraImageCapturePrivate():
- mediaObject(0),
- control(0),
- encoderControl(0),
- captureDestinationControl(0),
- bufferFormatControl(0),
+ mediaObject(nullptr),
+ control(nullptr),
+ encoderControl(nullptr),
+ captureDestinationControl(nullptr),
+ bufferFormatControl(nullptr),
error(QCameraImageCapture::NoError)
{
}
@@ -144,11 +144,11 @@ void QCameraImageCapturePrivate::_q_readyChanged(bool ready)
void QCameraImageCapturePrivate::_q_serviceDestroyed()
{
- mediaObject = 0;
- control = 0;
- encoderControl = 0;
- captureDestinationControl = 0;
- bufferFormatControl = 0;
+ mediaObject = nullptr;
+ control = nullptr;
+ encoderControl = nullptr;
+ captureDestinationControl = nullptr;
+ bufferFormatControl = nullptr;
}
/*!
@@ -284,11 +284,11 @@ bool QCameraImageCapture::setMediaObject(QMediaObject *mediaObject)
}
// without QCameraImageCaptureControl discard the media object
- d->mediaObject = 0;
- d->control = 0;
- d->encoderControl = 0;
- d->captureDestinationControl = 0;
- d->bufferFormatControl = 0;
+ d->mediaObject = nullptr;
+ d->control = nullptr;
+ d->encoderControl = nullptr;
+ d->captureDestinationControl = nullptr;
+ d->bufferFormatControl = nullptr;
return false;
}
@@ -298,7 +298,7 @@ bool QCameraImageCapture::setMediaObject(QMediaObject *mediaObject)
*/
bool QCameraImageCapture::isAvailable() const
{
- if (d_func()->control != NULL)
+ if (d_func()->control != nullptr)
return true;
else
return false;
@@ -309,7 +309,7 @@ bool QCameraImageCapture::isAvailable() const
*/
QMultimedia::AvailabilityStatus QCameraImageCapture::availability() const
{
- if (d_func()->control != NULL)
+ if (d_func()->control != nullptr)
return QMultimedia::Available;
else
return QMultimedia::ServiceMissing;
diff --git a/src/multimedia/camera/qcameraimageprocessing.cpp b/src/multimedia/camera/qcameraimageprocessing.cpp
index 737b74b73..c2cefeae7 100644
--- a/src/multimedia/camera/qcameraimageprocessing.cpp
+++ b/src/multimedia/camera/qcameraimageprocessing.cpp
@@ -130,7 +130,7 @@ void QCameraImageProcessingPrivate::initControls()
if (service)
imageControl = qobject_cast<QCameraImageProcessingControl *>(service->requestControl(QCameraImageProcessingControl_iid));
- available = (imageControl != 0);
+ available = (imageControl != nullptr);
if (!imageControl)
imageControl = new QCameraImageProcessingFakeControl(q_ptr);
diff --git a/src/multimedia/configure.json b/src/multimedia/configure.json
index 025ff7d66..6d56af5ed 100644
--- a/src/multimedia/configure.json
+++ b/src/multimedia/configure.json
@@ -9,10 +9,10 @@
"options": {
"alsa": "boolean",
"evr": { "type": "boolean" },
+ "directshow": { "type": "boolean" },
+ "wmf": { "type": "boolean" },
"gstreamer": { "type": "optionalString", "values": [ "no", "yes", "0.10", "1.0" ] },
- "pulseaudio": "boolean",
- "mediaplayer-backend": { "type": "string", "values": [ "directshow", "wmf" ] },
- "wmf-backend": { "type": "void", "name": "mediaplayer-backend", "value": "wmf" }
+ "pulseaudio": "boolean"
}
},
@@ -53,7 +53,9 @@
"test": "gstreamer",
"sources": [
{ "type": "pkgConfig",
- "args": "gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0" }
+ "args": "gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0" },
+ { "libs": "-lgstreamer-1.0 -lgstbase-1.0 -lgstaudio-1.0 -lgstvideo-1.0 -lgstpbutils-1.0 -lglib-2.0 -lgobject-2.0",
+ "condition": "config.win32 || config.macos" }
]
},
"gstreamer_app_0_10": {
@@ -71,7 +73,8 @@
"test": "gstreamer_appsrc",
"use": "gstreamer_1_0",
"sources": [
- { "type": "pkgConfig", "args": "gstreamer-app-1.0" }
+ { "type": "pkgConfig", "args": "gstreamer-app-1.0" },
+ { "libs": "-lgstapp-1.0", "condition": "config.win32 || config.macos" }
]
},
"gstreamer_photography_0_10": {
@@ -188,13 +191,6 @@
"condition": "config.win32 && libs.directshow",
"output": [ "feature", "privateFeature" ]
},
- "directshow-player": {
- "label": "DirectShow",
- "enable": "input.mediaplayer-backend == 'directshow'",
- "disable": "input.mediaplayer-backend == 'wmf'",
- "condition": "features.directshow && !features.wmf-player",
- "output": [ "privateFeature" ]
- },
"evr": {
"label": "evr.h",
"condition": "config.win32 && tests.evr",
@@ -284,13 +280,6 @@
"label": "Windows Media Foundation",
"condition": "config.win32 && libs.wmf",
"output": [ "privateFeature" ]
- },
- "wmf-player": {
- "label": "Windows Media Foundation",
- "enable": "input.mediaplayer-backend == 'wmf'",
- "disable": "input.mediaplayer-backend != 'wmf'",
- "condition": "features.wmf",
- "output": [ "privateFeature" ]
}
},
@@ -312,14 +301,7 @@
"avfoundation",
"wasapi",
"directshow",
- "wmf",
- {
- "message": "Media player backend",
- "type": "firstAvailableFeature",
- "args": "directshow-player wmf-player",
- "condition": "config.win32"
- }
-
+ "wmf"
]
}
]
diff --git a/src/multimedia/controls/qmediaplaylistcontrol_p.h b/src/multimedia/controls/qmediaplaylistcontrol_p.h
index 721a471c4..93c5a3e25 100644
--- a/src/multimedia/controls/qmediaplaylistcontrol_p.h
+++ b/src/multimedia/controls/qmediaplaylistcontrol_p.h
@@ -90,7 +90,7 @@ Q_SIGNALS:
void playbackModeChanged(QMediaPlaylist::PlaybackMode mode);
protected:
- QMediaPlaylistControl(QObject* parent = 0);
+ QMediaPlaylistControl(QObject *parent = nullptr);
};
#define QMediaPlaylistControl_iid "org.qt-project.qt.mediaplaylistcontrol/5.0"
diff --git a/src/multimedia/controls/qmediaplaylistsourcecontrol_p.h b/src/multimedia/controls/qmediaplaylistsourcecontrol_p.h
index 18bf91d5b..a98ee8738 100644
--- a/src/multimedia/controls/qmediaplaylistsourcecontrol_p.h
+++ b/src/multimedia/controls/qmediaplaylistsourcecontrol_p.h
@@ -73,7 +73,7 @@ Q_SIGNALS:
void playlistChanged(QMediaPlaylist* playlist);
protected:
- QMediaPlaylistSourceControl(QObject* parent = 0);
+ QMediaPlaylistSourceControl(QObject *parent = nullptr);
};
#define QMediaPlaylistSourceControl_iid "org.qt-project.qt.mediaplaylistsourcecontrol/5.0"
diff --git a/src/multimedia/doc/QtMultimediaDoc b/src/multimedia/doc/QtMultimediaDoc
index 5723c2a78..e57c3595b 100644
--- a/src/multimedia/doc/QtMultimediaDoc
+++ b/src/multimedia/doc/QtMultimediaDoc
@@ -1,3 +1,2 @@
#include <QtMultimedia/QtMultimedia>
#include <QtMultimediaWidgets/QtMultimediaWidgets>
-#include "../gsttools_headers/qgstutils_p.h"
diff --git a/src/multimedia/doc/qtmultimedia.qdocconf b/src/multimedia/doc/qtmultimedia.qdocconf
index b547db762..dfafd8715 100644
--- a/src/multimedia/doc/qtmultimedia.qdocconf
+++ b/src/multimedia/doc/qtmultimedia.qdocconf
@@ -1,4 +1,5 @@
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/config/exampleurl-qtmultimedia.qdocconf)
project = QtMultimedia
description = Qt Multimedia Documentation
@@ -56,9 +57,9 @@ imagedirs += src/images \
sourcedirs += ../..
-#excludedirs += ../../multimediawidgets
+excludedirs += ../../gsttools
-depends += qtcore qtdoc qtgui qtquick qtqml qtwidgets
+depends += qtcore qtdoc qtgui qtquick qtqml qtwidgets qtnetwork
navigation.landingpage = "Qt Multimedia"
navigation.cppclassespage = "Qt Multimedia C++ Classes"
diff --git a/src/multimedia/doc/src/multimedia.qdoc b/src/multimedia/doc/src/multimedia.qdoc
index 68e8ba31c..ad8273612 100644
--- a/src/multimedia/doc/src/multimedia.qdoc
+++ b/src/multimedia/doc/src/multimedia.qdoc
@@ -181,9 +181,9 @@ import QtMultimedia 5.8
\endcode
\annotatedlist multimedia_qml
The following types are accessed by using \l{Qt Audio Engine QML Types}{Qt Audio Engine}:
-\code
-import QtAudioEngine 1.1
-\endcode
+\qml \QtMinorVersion
+import QtAudioEngine 1.\1
+\endqml
\annotatedlist multimedia_audioengine
\section2 Multimedia Classes
diff --git a/src/multimedia/doc/src/qtaudioengine.qdoc b/src/multimedia/doc/src/qtaudioengine.qdoc
index bb12489de..c45d4e8af 100644
--- a/src/multimedia/doc/src/qtaudioengine.qdoc
+++ b/src/multimedia/doc/src/qtaudioengine.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
-\qmlmodule QtAudioEngine 1.1
+\qmlmodule QtAudioEngine 1.\QtMinorVersion
\title Qt Audio Engine QML Types
\ingroup qmlmodules
\brief Provides QML types for 3D positional audio playback and content management.
@@ -36,9 +36,9 @@ Engine provides types for 3D positional audio playback and content management.
The QML types can be imported into your application using the following import
statement in your .qml file:
-\code
-import QtAudioEngine 1.1
-\endcode
+\qml \QtMinorVersion
+import QtAudioEngine 1.\1
+\endqml
\section1 Qt Audio Engine Features
@@ -55,5 +55,5 @@ SoundInstance for easier QML bindings.
\li \l {AudioEngine Example}{Audio Engine}
\endlist
-\section1 QML types
+\section1 QML Types
*/
diff --git a/src/multimedia/doc/src/qtmultimedia5.qdoc b/src/multimedia/doc/src/qtmultimedia5.qdoc
index aec3d99d0..a2aaa1a80 100644
--- a/src/multimedia/doc/src/qtmultimedia5.qdoc
+++ b/src/multimedia/doc/src/qtmultimedia5.qdoc
@@ -39,11 +39,28 @@ The QML types for \l{Qt Multimedia} support the basic use cases such as:
\li and access camera settings.
\endlist
-The QML types can be imported into your application using the following import
-statement in your .qml file:
-\code
-import QtMultimedia 5.8
-\endcode
+\section1 QML Types
-\section1 QML types
+Qt Multimedia QML types can be imported into your application using the
+following import statement in your .qml file:
+
+\qml \QtMinorVersion
+import QtMultimedia 5.\1
+\endqml
+
+\generatelist qmltypesbymodule QtMultimedia
+
+\section2 Qt Audio Engine
+
+\l {QtAudioEngine}{Qt Audio Engine} provides types for 3D positional audio
+playback and content management. These types can be imported into your
+application using the following import statement in your .qml file:
+
+\qml \QtMinorVersion
+import QtAudioEngine 1.\1
+\endqml
+
+\generatelist qmltypesbymodule QtAudioEngine
+
+\noautolist
*/
diff --git a/src/multimedia/gsttools_headers/gstvideoconnector_p.h b/src/multimedia/gsttools_headers/gstvideoconnector_p.h
deleted file mode 100644
index a38ca2e65..000000000
--- a/src/multimedia/gsttools_headers/gstvideoconnector_p.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTVIDEOCONNECTOR_H
-#define QGSTVIDEOCONNECTOR_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-
-#include <gst/gst.h>
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_VIDEO_CONNECTOR \
- (gst_video_connector_get_type())
-#define GST_VIDEO_CONNECTOR(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_CONNECTOR, GstVideoConnector))
-#define GST_VIDEO_CONNECTOR_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VIDEO_CONNECTOR, GstVideoConnectorClass))
-#define GST_IS_VIDEO_CONNECTOR(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_CONNECTOR))
-#define GST_IS_VIDEO_CONNECTOR_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VIDEO_CONNECTOR))
-
-typedef struct _GstVideoConnector GstVideoConnector;
-typedef struct _GstVideoConnectorClass GstVideoConnectorClass;
-
-struct Q_GSTTOOLS_EXPORT _GstVideoConnector {
- GstElement element;
-
- GstPad *srcpad;
- GstPad *sinkpad;
-
- gboolean relinked;
- gboolean failedSignalEmited;
- GstSegment segment;
- GstBuffer *latest_buffer;
-};
-
-struct Q_GSTTOOLS_EXPORT _GstVideoConnectorClass {
- GstElementClass parent_class;
-
- /* action signal to resend new segment */
- void (*resend_new_segment) (GstElement * element, gboolean emitFailedSignal);
-};
-
-GType Q_GSTTOOLS_EXPORT gst_video_connector_get_type (void);
-
-G_END_DECLS
-
-#endif
-
diff --git a/src/multimedia/gsttools_headers/qgstappsrc_p.h b/src/multimedia/gsttools_headers/qgstappsrc_p.h
deleted file mode 100644
index c7e87037d..000000000
--- a/src/multimedia/gsttools_headers/qgstappsrc_p.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTAPPSRC_H
-#define QGSTAPPSRC_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qiodevice.h>
-
-#include <gst/gst.h>
-#include <gst/app/gstappsrc.h>
-
-#if GST_VERSION_MAJOR < 1
-#include <gst/app/gstappbuffer.h>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-class Q_GSTTOOLS_EXPORT QGstAppSrc : public QObject
-{
- Q_OBJECT
-public:
- QGstAppSrc(QObject *parent = 0);
- ~QGstAppSrc();
-
- bool setup(GstElement *);
-
- void setStream(QIODevice *);
- QIODevice *stream() const;
-
- GstAppSrc *element();
-
- qint64 queueSize() const { return m_maxBytes; }
-
- bool& enoughData() { return m_enoughData; }
- bool& dataRequested() { return m_dataRequested; }
- unsigned int& dataRequestSize() { return m_dataRequestSize; }
-
- bool isStreamValid() const
- {
- return m_stream != 0 &&
- m_stream->isOpen();
- }
-
-private slots:
- void pushDataToAppSrc();
- bool doSeek(qint64);
- void onDataReady();
-
- void streamDestroyed();
-private:
- static gboolean on_seek_data(GstAppSrc *element, guint64 arg0, gpointer userdata);
- static void on_enough_data(GstAppSrc *element, gpointer userdata);
- static void on_need_data(GstAppSrc *element, uint arg0, gpointer userdata);
- static void destroy_notify(gpointer data);
-
- void sendEOS();
-
- QIODevice *m_stream;
- GstAppSrc *m_appSrc;
- bool m_sequential;
- GstAppStreamType m_streamType;
- GstAppSrcCallbacks m_callbacks;
- qint64 m_maxBytes;
- unsigned int m_dataRequestSize;
- bool m_dataRequested;
- bool m_enoughData;
- bool m_forceData;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstbufferpoolinterface_p.h b/src/multimedia/gsttools_headers/qgstbufferpoolinterface_p.h
deleted file mode 100644
index 45e573262..000000000
--- a/src/multimedia/gsttools_headers/qgstbufferpoolinterface_p.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTBUFFERPOOLINTERFACE_P_H
-#define QGSTBUFFERPOOLINTERFACE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <qabstractvideobuffer.h>
-#include <qvideosurfaceformat.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qplugin.h>
-
-#include <gst/gst.h>
-
-QT_BEGIN_NAMESPACE
-
-const QLatin1String QGstBufferPoolPluginKey("bufferpool");
-
-/*!
- Abstract interface for video buffers allocation.
-*/
-class Q_GSTTOOLS_EXPORT QGstBufferPoolInterface
-{
-public:
- virtual ~QGstBufferPoolInterface() {}
-
- virtual bool isFormatSupported(const QVideoSurfaceFormat &format) const = 0;
- virtual GstBuffer *takeBuffer(const QVideoSurfaceFormat &format, GstCaps *caps) = 0;
- virtual void clear() = 0;
-
- virtual QAbstractVideoBuffer::HandleType handleType() const = 0;
-
- /*!
- Build an QAbstractVideoBuffer instance from GstBuffer.
- Returns NULL if GstBuffer is not compatible with this buffer pool.
-
- This method is called from gstreamer video sink thread.
- */
- virtual QAbstractVideoBuffer *prepareVideoBuffer(GstBuffer *buffer, int bytesPerLine) = 0;
-};
-
-#define QGstBufferPoolInterface_iid "org.qt-project.qt.gstbufferpool/5.0"
-Q_DECLARE_INTERFACE(QGstBufferPoolInterface, QGstBufferPoolInterface_iid)
-
-class QGstBufferPoolPlugin : public QObject, public QGstBufferPoolInterface
-{
- Q_OBJECT
- Q_INTERFACES(QGstBufferPoolInterface)
-public:
- explicit QGstBufferPoolPlugin(QObject *parent = 0);
- virtual ~QGstBufferPoolPlugin() {}
-
- bool isFormatSupported(const QVideoSurfaceFormat &format) const override = 0;
- GstBuffer *takeBuffer(const QVideoSurfaceFormat &format, GstCaps *caps) override = 0;
- void clear() override = 0;
-
- QAbstractVideoBuffer::HandleType handleType() const override = 0;
-
- /*!
- Build an QAbstractVideoBuffer instance from compatible GstBuffer.
- Returns NULL if GstBuffer is not compatible with this buffer pool.
-
- This method is called from gstreamer video sink thread.
- */
- QAbstractVideoBuffer *prepareVideoBuffer(GstBuffer *buffer, int bytesPerLine) override = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h b/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h
deleted file mode 100644
index 33ab3de4b..000000000
--- a/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTCODECSINFO_H
-#define QGSTCODECSINFO_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <QtCore/qmap.h>
-#include <QtCore/qstringlist.h>
-
-#include <gst/gst.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_GSTTOOLS_EXPORT QGstCodecsInfo
-{
-public:
- enum ElementType { AudioEncoder, VideoEncoder, Muxer };
-
- struct CodecInfo {
- QString description;
- QByteArray elementName;
- GstRank rank;
- };
-
- QGstCodecsInfo(ElementType elementType);
-
- QStringList supportedCodecs() const;
- QString codecDescription(const QString &codec) const;
- QByteArray codecElement(const QString &codec) const;
- QStringList codecOptions(const QString &codec) const;
-
-private:
- void updateCodecs(ElementType elementType);
- GList *elementFactories(ElementType elementType) const;
-
- QStringList m_codecs;
- QMap<QString, CodecInfo> m_codecInfo;
-};
-
-Q_DECLARE_TYPEINFO(QGstCodecsInfo::CodecInfo, Q_MOVABLE_TYPE);
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstreameraudioinputselector_p.h b/src/multimedia/gsttools_headers/qgstreameraudioinputselector_p.h
deleted file mode 100644
index 0c193fda9..000000000
--- a/src/multimedia/gsttools_headers/qgstreameraudioinputselector_p.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERAUDIOINPUTSELECTOR_H
-#define QGSTREAMERAUDIOINPUTSELECTOR_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <qaudioinputselectorcontrol.h>
-#include <QtCore/qstringlist.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_GSTTOOLS_EXPORT QGstreamerAudioInputSelector : public QAudioInputSelectorControl
-{
-Q_OBJECT
-public:
- QGstreamerAudioInputSelector(QObject *parent);
- ~QGstreamerAudioInputSelector();
-
- QList<QString> availableInputs() const override;
- QString inputDescription(const QString &name) const override;
- QString defaultInput() const override;
- QString activeInput() const override;
-
-public Q_SLOTS:
- void setActiveInput(const QString &name) override;
-
-private:
- void update();
- void updateAlsaDevices();
- void updateOssDevices();
- void updatePulseDevices();
-
- QString m_audioInput;
- QList<QString> m_names;
- QList<QString> m_descriptions;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERAUDIOINPUTSELECTOR_H
diff --git a/src/multimedia/gsttools_headers/qgstreameraudioprobecontrol_p.h b/src/multimedia/gsttools_headers/qgstreameraudioprobecontrol_p.h
deleted file mode 100644
index 4fc5c7704..000000000
--- a/src/multimedia/gsttools_headers/qgstreameraudioprobecontrol_p.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERAUDIOPROBECONTROL_H
-#define QGSTREAMERAUDIOPROBECONTROL_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <gst/gst.h>
-#include <qmediaaudioprobecontrol.h>
-#include <QtCore/qmutex.h>
-#include <qaudiobuffer.h>
-#include <qshareddata.h>
-
-#include <private/qgstreamerbufferprobe_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_GSTTOOLS_EXPORT QGstreamerAudioProbeControl
- : public QMediaAudioProbeControl
- , public QGstreamerBufferProbe
- , public QSharedData
-{
- Q_OBJECT
-public:
- explicit QGstreamerAudioProbeControl(QObject *parent);
- virtual ~QGstreamerAudioProbeControl();
-
-protected:
- void probeCaps(GstCaps *caps) override;
- bool probeBuffer(GstBuffer *buffer) override;
-
-private slots:
- void bufferProbed();
-
-private:
- QAudioBuffer m_pendingBuffer;
- QAudioFormat m_format;
- QMutex m_bufferMutex;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERAUDIOPROBECONTROL_H
diff --git a/src/multimedia/gsttools_headers/qgstreamerbufferprobe_p.h b/src/multimedia/gsttools_headers/qgstreamerbufferprobe_p.h
deleted file mode 100644
index 35644f934..000000000
--- a/src/multimedia/gsttools_headers/qgstreamerbufferprobe_p.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERBUFFERPROBE_H
-#define QGSTREAMERBUFFERPROBE_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <gst/gst.h>
-
-#include <QtCore/qglobal.h>
-
-
-QT_BEGIN_NAMESPACE
-
-class Q_GSTTOOLS_EXPORT QGstreamerBufferProbe
-{
-public:
- enum Flags
- {
- ProbeCaps = 0x01,
- ProbeBuffers = 0x02,
- ProbeAll = ProbeCaps | ProbeBuffers
- };
-
- explicit QGstreamerBufferProbe(Flags flags = ProbeAll);
- virtual ~QGstreamerBufferProbe();
-
- void addProbeToPad(GstPad *pad, bool downstream = true);
- void removeProbeFromPad(GstPad *pad);
-
-protected:
- virtual void probeCaps(GstCaps *caps);
- virtual bool probeBuffer(GstBuffer *buffer);
-
-private:
-#if GST_CHECK_VERSION(1,0,0)
- static GstPadProbeReturn capsProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
- static GstPadProbeReturn bufferProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
- int m_capsProbeId;
-#else
- static gboolean bufferProbe(GstElement *element, GstBuffer *buffer, gpointer user_data);
- GstCaps *m_caps;
-#endif
- int m_bufferProbeId;
- const Flags m_flags;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERAUDIOPROBECONTROL_H
diff --git a/src/multimedia/gsttools_headers/qgstreamerbushelper_p.h b/src/multimedia/gsttools_headers/qgstreamerbushelper_p.h
deleted file mode 100644
index c7d06faf8..000000000
--- a/src/multimedia/gsttools_headers/qgstreamerbushelper_p.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERBUSHELPER_P_H
-#define QGSTREAMERBUSHELPER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <QObject>
-
-#include "qgstreamermessage_p.h"
-
-#include <gst/gst.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGstreamerSyncMessageFilter {
-public:
- //returns true if message was processed and should be dropped, false otherwise
- virtual bool processSyncMessage(const QGstreamerMessage &message) = 0;
-};
-#define QGstreamerSyncMessageFilter_iid "org.qt-project.qt.gstreamersyncmessagefilter/5.0"
-Q_DECLARE_INTERFACE(QGstreamerSyncMessageFilter, QGstreamerSyncMessageFilter_iid)
-
-
-class QGstreamerBusMessageFilter {
-public:
- //returns true if message was processed and should be dropped, false otherwise
- virtual bool processBusMessage(const QGstreamerMessage &message) = 0;
-};
-#define QGstreamerBusMessageFilter_iid "org.qt-project.qt.gstreamerbusmessagefilter/5.0"
-Q_DECLARE_INTERFACE(QGstreamerBusMessageFilter, QGstreamerBusMessageFilter_iid)
-
-
-class QGstreamerBusHelperPrivate;
-
-class Q_GSTTOOLS_EXPORT QGstreamerBusHelper : public QObject
-{
- Q_OBJECT
- friend class QGstreamerBusHelperPrivate;
-
-public:
- QGstreamerBusHelper(GstBus* bus, QObject* parent = 0);
- ~QGstreamerBusHelper();
-
- void installMessageFilter(QObject *filter);
- void removeMessageFilter(QObject *filter);
-
-signals:
- void message(QGstreamerMessage const& message);
-
-private:
- QGstreamerBusHelperPrivate* d;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstreamermessage_p.h b/src/multimedia/gsttools_headers/qgstreamermessage_p.h
deleted file mode 100644
index 2f9d1745c..000000000
--- a/src/multimedia/gsttools_headers/qgstreamermessage_p.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERMESSAGE_P_H
-#define QGSTREAMERMESSAGE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <QMetaType>
-
-#include <gst/gst.h>
-
-QT_BEGIN_NAMESPACE
-
-// Required for QDoc workaround
-class QString;
-
-class Q_GSTTOOLS_EXPORT QGstreamerMessage
-{
-public:
- QGstreamerMessage();
- QGstreamerMessage(GstMessage* message);
- QGstreamerMessage(QGstreamerMessage const& m);
- ~QGstreamerMessage();
-
- GstMessage* rawMessage() const;
-
- QGstreamerMessage& operator=(QGstreamerMessage const& rhs);
-
-private:
- GstMessage* m_message;
-};
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QGstreamerMessage);
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstreamermirtexturerenderer_p.h b/src/multimedia/gsttools_headers/qgstreamermirtexturerenderer_p.h
deleted file mode 100644
index 62150f7e1..000000000
--- a/src/multimedia/gsttools_headers/qgstreamermirtexturerenderer_p.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERMIRTEXTURERENDERER_H
-#define QGSTREAMERMIRTEXTURERENDERER_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <qmediaplayer.h>
-#include <qvideorenderercontrol.h>
-#include <private/qvideosurfacegstsink_p.h>
-#include <qabstractvideosurface.h>
-
-#include "qgstreamervideorendererinterface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGstreamerMirTextureBuffer;
-class QGstreamerPlayerSession;
-class QGLContext;
-class QOpenGLContext;
-class QSurfaceFormat;
-
-class QGstreamerMirTextureRenderer : public QVideoRendererControl, public QGstreamerVideoRendererInterface
-{
- Q_OBJECT
- Q_INTERFACES(QGstreamerVideoRendererInterface)
-public:
- QGstreamerMirTextureRenderer(QObject *parent = 0, const QGstreamerPlayerSession *playerSession = 0);
- virtual ~QGstreamerMirTextureRenderer();
-
- QAbstractVideoSurface *surface() const;
- void setSurface(QAbstractVideoSurface *surface);
-
- void setPlayerSession(const QGstreamerPlayerSession *playerSession);
-
- GstElement *videoSink();
-
- void stopRenderer();
- bool isReady() const { return m_surface != 0; }
-
-signals:
- void sinkChanged();
- void readyChanged(bool);
- void nativeSizeChanged();
-
-private slots:
- void handleFormatChange();
- void updateNativeVideoSize();
- void handleFocusWindowChanged(QWindow *window);
- void renderFrame();
-
-private:
- QWindow *createOffscreenWindow(const QSurfaceFormat &format);
- static void handleFrameReady(gpointer userData);
- static GstPadProbeReturn padBufferProbe(GstPad *pad, GstPadProbeInfo *info, gpointer userData);
-
- GstElement *m_videoSink;
- QPointer<QAbstractVideoSurface> m_surface;
- QPointer<QAbstractVideoSurface> m_glSurface;
- QGLContext *m_context;
- QOpenGLContext *m_glContext;
- unsigned int m_textureId;
- QWindow *m_offscreenSurface;
- QGstreamerPlayerSession *m_playerSession;
- QGstreamerMirTextureBuffer *m_textureBuffer;
- QSize m_nativeSize;
-
- QMutex m_mutex;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERMIRTEXTURERENDRER_H
diff --git a/src/multimedia/gsttools_headers/qgstreamerplayercontrol_p.h b/src/multimedia/gsttools_headers/qgstreamerplayercontrol_p.h
deleted file mode 100644
index e2252ea52..000000000
--- a/src/multimedia/gsttools_headers/qgstreamerplayercontrol_p.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERPLAYERCONTROL_P_H
-#define QGSTREAMERPLAYERCONTROL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qstack.h>
-#include <qmediaplayercontrol.h>
-#include <private/qgsttools_global_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QMediaPlayerResourceSetInterface;
-class QGstreamerPlayerSession;
-class Q_GSTTOOLS_EXPORT QGstreamerPlayerControl : public QMediaPlayerControl
-{
- Q_OBJECT
-
-public:
- QGstreamerPlayerControl(QGstreamerPlayerSession *session, QObject *parent = 0);
- ~QGstreamerPlayerControl();
-
- QGstreamerPlayerSession *session() { return m_session; }
-
- QMediaPlayer::State state() const override;
- QMediaPlayer::MediaStatus mediaStatus() const override;
-
- qint64 position() const override;
- qint64 duration() const override;
-
- int bufferStatus() const override;
-
- int volume() const override;
- bool isMuted() const override;
-
- bool isAudioAvailable() const override;
- bool isVideoAvailable() const override;
- void setVideoOutput(QObject *output);
-
- bool isSeekable() const override;
- QMediaTimeRange availablePlaybackRanges() const override;
-
- qreal playbackRate() const override;
- void setPlaybackRate(qreal rate) override;
-
- QMediaContent media() const override;
- const QIODevice *mediaStream() const override;
- void setMedia(const QMediaContent&, QIODevice *) override;
-
- QMediaPlayerResourceSetInterface* resources() const;
-
-public Q_SLOTS:
- void setPosition(qint64 pos) override;
-
- void play() override;
- void pause() override;
- void stop() override;
-
- void setVolume(int volume) override;
- void setMuted(bool muted) override;
-
-private Q_SLOTS:
- void updateSessionState(QMediaPlayer::State state);
- void updateMediaStatus();
- void processEOS();
- void setBufferProgress(int progress);
-
- void handleInvalidMedia();
-
- void handleResourcesGranted();
- void handleResourcesLost();
- void handleResourcesDenied();
-
-private:
- void playOrPause(QMediaPlayer::State state);
-
- void pushState();
- void popAndNotifyState();
-
- QGstreamerPlayerSession *m_session;
- QMediaPlayer::State m_userRequestedState;
- QMediaPlayer::State m_currentState;
- QMediaPlayer::MediaStatus m_mediaStatus;
- QStack<QMediaPlayer::State> m_stateStack;
- QStack<QMediaPlayer::MediaStatus> m_mediaStatusStack;
-
- int m_bufferProgress;
- qint64 m_pendingSeekPosition;
- bool m_setMediaPending;
- QMediaContent m_currentResource;
- QIODevice *m_stream;
-
- QMediaPlayerResourceSetInterface *m_resources;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstreamerplayersession_p.h b/src/multimedia/gsttools_headers/qgstreamerplayersession_p.h
deleted file mode 100644
index d4b050272..000000000
--- a/src/multimedia/gsttools_headers/qgstreamerplayersession_p.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERPLAYERSESSION_P_H
-#define QGSTREAMERPLAYERSESSION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtMultimedia/private/qtmultimediaglobal_p.h>
-#include <QObject>
-#include <QtCore/qmutex.h>
-#include <QtNetwork/qnetworkrequest.h>
-#include <private/qgstreamerplayercontrol_p.h>
-#include <private/qgstreamerbushelper_p.h>
-#include <qmediaplayer.h>
-#include <qmediastreamscontrol.h>
-#include <qaudioformat.h>
-
-#if QT_CONFIG(gstreamer_app)
-#include <private/qgstappsrc_p.h>
-#endif
-
-#include <gst/gst.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGstreamerBusHelper;
-class QGstreamerMessage;
-
-class QGstreamerVideoRendererInterface;
-class QGstreamerVideoProbeControl;
-class QGstreamerAudioProbeControl;
-
-typedef enum {
- GST_AUTOPLUG_SELECT_TRY,
- GST_AUTOPLUG_SELECT_EXPOSE,
- GST_AUTOPLUG_SELECT_SKIP
-} GstAutoplugSelectResult;
-
-class Q_GSTTOOLS_EXPORT QGstreamerPlayerSession
- : public QObject
- , public QGstreamerBusMessageFilter
-{
-Q_OBJECT
-Q_INTERFACES(QGstreamerBusMessageFilter)
-
-public:
- QGstreamerPlayerSession(QObject *parent);
- virtual ~QGstreamerPlayerSession();
-
- GstElement *playbin() const;
- GstElement *pipeline() const { return m_pipeline; }
- QGstreamerBusHelper *bus() const { return m_busHelper; }
-
- QNetworkRequest request() const;
-
- QMediaPlayer::State state() const { return m_state; }
- QMediaPlayer::State pendingState() const { return m_pendingState; }
-
- qint64 duration() const;
- qint64 position() const;
-
- int volume() const;
- bool isMuted() const;
-
- bool isAudioAvailable() const;
-
- void setVideoRenderer(QObject *renderer);
- QGstreamerVideoRendererInterface *renderer() const { return m_renderer; }
- bool isVideoAvailable() const;
-
- bool isSeekable() const;
-
- qreal playbackRate() const;
- void setPlaybackRate(qreal rate);
-
- QMediaTimeRange availablePlaybackRanges() const;
-
- QMap<QByteArray ,QVariant> tags() const { return m_tags; }
- QMap<QString,QVariant> streamProperties(int streamNumber) const { return m_streamProperties[streamNumber]; }
- int streamCount() const { return m_streamProperties.count(); }
- QMediaStreamsControl::StreamType streamType(int streamNumber) { return m_streamTypes.value(streamNumber, QMediaStreamsControl::UnknownStream); }
-
- int activeStream(QMediaStreamsControl::StreamType streamType) const;
- void setActiveStream(QMediaStreamsControl::StreamType streamType, int streamNumber);
-
- bool processBusMessage(const QGstreamerMessage &message) override;
-
-#if QT_CONFIG(gstreamer_app)
- QGstAppSrc *appsrc() const { return m_appSrc; }
- static void configureAppSrcElement(GObject*, GObject*, GParamSpec*,QGstreamerPlayerSession* _this);
-#endif
-
- bool isLiveSource() const;
-
- void addProbe(QGstreamerVideoProbeControl* probe);
- void removeProbe(QGstreamerVideoProbeControl* probe);
-
- void addProbe(QGstreamerAudioProbeControl* probe);
- void removeProbe(QGstreamerAudioProbeControl* probe);
-
- void endOfMediaReset();
-
-public slots:
- void loadFromUri(const QNetworkRequest &url);
- void loadFromStream(const QNetworkRequest &url, QIODevice *stream);
- bool play();
- bool pause();
- void stop();
-
- bool seek(qint64 pos);
-
- void setVolume(int volume);
- void setMuted(bool muted);
-
- void showPrerollFrames(bool enabled);
-
-signals:
- void durationChanged(qint64 duration);
- void positionChanged(qint64 position);
- void stateChanged(QMediaPlayer::State state);
- void volumeChanged(int volume);
- void mutedStateChanged(bool muted);
- void audioAvailableChanged(bool audioAvailable);
- void videoAvailableChanged(bool videoAvailable);
- void bufferingProgressChanged(int percentFilled);
- void playbackFinished();
- void tagsChanged();
- void streamsChanged();
- void seekableChanged(bool);
- void error(int error, const QString &errorString);
- void invalidMedia();
- void playbackRateChanged(qreal);
- void rendererChanged();
- void pipelineChanged();
-
-private slots:
- void getStreamsInfo();
- void setSeekable(bool);
- void finishVideoOutputChange();
- void updateVideoRenderer();
- void updateVideoResolutionTag();
- void updateVolume();
- void updateMuted();
- void updateDuration();
-
-private:
- static void playbinNotifySource(GObject *o, GParamSpec *p, gpointer d);
- static void handleVolumeChange(GObject *o, GParamSpec *p, gpointer d);
- static void handleMutedChange(GObject *o, GParamSpec *p, gpointer d);
-#if !GST_CHECK_VERSION(1,0,0)
- static void insertColorSpaceElement(GstElement *element, gpointer data);
-#endif
- static void handleElementAdded(GstBin *bin, GstElement *element, QGstreamerPlayerSession *session);
- static void handleStreamsChange(GstBin *bin, gpointer user_data);
- static GstAutoplugSelectResult handleAutoplugSelect(GstBin *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, QGstreamerPlayerSession *session);
-
- void processInvalidMedia(QMediaPlayer::Error errorCode, const QString& errorString);
-
- void removeVideoBufferProbe();
- void addVideoBufferProbe();
- void removeAudioBufferProbe();
- void addAudioBufferProbe();
- void flushVideoProbes();
- void resumeVideoProbes();
- bool parsePipeline();
- bool setPipeline(GstElement *pipeline);
-
- QNetworkRequest m_request;
- QMediaPlayer::State m_state;
- QMediaPlayer::State m_pendingState;
- QGstreamerBusHelper* m_busHelper;
- GstElement *m_playbin = nullptr; // Can be null
- GstElement *m_pipeline = nullptr; // Never null
-
- GstElement* m_videoSink;
-
- GstElement* m_videoOutputBin;
- GstElement* m_videoIdentity;
-#if !GST_CHECK_VERSION(1,0,0)
- GstElement* m_colorSpace;
- bool m_usingColorspaceElement;
-#endif
- GstElement* m_pendingVideoSink;
- GstElement* m_nullVideoSink;
-
- GstElement* m_audioSink;
- GstElement* m_volumeElement;
-
- GstBus* m_bus;
- QObject *m_videoOutput;
- QGstreamerVideoRendererInterface *m_renderer;
-
-#if QT_CONFIG(gstreamer_app)
- QGstAppSrc *m_appSrc;
-#endif
-
- QMap<QByteArray, QVariant> m_tags;
- QList< QMap<QString,QVariant> > m_streamProperties;
- QList<QMediaStreamsControl::StreamType> m_streamTypes;
- QMap<QMediaStreamsControl::StreamType, int> m_playbin2StreamOffset;
-
- QGstreamerVideoProbeControl *m_videoProbe;
- QGstreamerAudioProbeControl *m_audioProbe;
-
- int m_volume;
- qreal m_playbackRate;
- bool m_muted;
- bool m_audioAvailable;
- bool m_videoAvailable;
- bool m_seekable;
-
- mutable qint64 m_lastPosition;
- qint64 m_duration;
- int m_durationQueries;
-
- bool m_displayPrerolledFrame;
-
- enum SourceType
- {
- UnknownSrc,
- SoupHTTPSrc,
- UDPSrc,
- MMSSrc,
- RTSPSrc,
- };
- SourceType m_sourceType;
- bool m_everPlayed;
- bool m_isLiveSource;
-
- gulong pad_probe_id;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERPLAYERSESSION_H
diff --git a/src/multimedia/gsttools_headers/qgstreamervideoinputdevicecontrol_p.h b/src/multimedia/gsttools_headers/qgstreamervideoinputdevicecontrol_p.h
deleted file mode 100644
index b660cc7b3..000000000
--- a/src/multimedia/gsttools_headers/qgstreamervideoinputdevicecontrol_p.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERVIDEOINPUTDEVICECONTROL_H
-#define QGSTREAMERVIDEOINPUTDEVICECONTROL_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <qvideodeviceselectorcontrol.h>
-#include <QtCore/qstringlist.h>
-
-#include <gst/gst.h>
-#include <qcamera.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_GSTTOOLS_EXPORT QGstreamerVideoInputDeviceControl : public QVideoDeviceSelectorControl
-{
-Q_OBJECT
-public:
- QGstreamerVideoInputDeviceControl(QObject *parent);
- QGstreamerVideoInputDeviceControl(GstElementFactory *factory, QObject *parent);
- ~QGstreamerVideoInputDeviceControl();
-
- int deviceCount() const override;
-
- QString deviceName(int index) const override;
- QString deviceDescription(int index) const override;
-
- int defaultDevice() const override;
- int selectedDevice() const override;
-
- static QString primaryCamera() { return tr("Main camera"); }
- static QString secondaryCamera() { return tr("Front camera"); }
-
-public Q_SLOTS:
- void setSelectedDevice(int index) override;
-
-private:
- GstElementFactory *m_factory;
-
- int m_selectedDevice;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERAUDIOINPUTDEVICECONTROL_H
diff --git a/src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h b/src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h
deleted file mode 100644
index f2ca8a23b..000000000
--- a/src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERVIDEOOVERLAY_P_H
-#define QGSTREAMERVIDEOOVERLAY_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgstreamerbushelper_p.h>
-#include <private/qgstreamerbufferprobe_p.h>
-#include <QtGui/qwindowdefs.h>
-#include <QtCore/qsize.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGstreamerSinkProperties;
-class QGstreamerVideoOverlay
- : public QObject
- , public QGstreamerSyncMessageFilter
- , public QGstreamerBusMessageFilter
- , private QGstreamerBufferProbe
-{
- Q_OBJECT
- Q_INTERFACES(QGstreamerSyncMessageFilter QGstreamerBusMessageFilter)
-public:
- explicit QGstreamerVideoOverlay(QObject *parent = 0, const QByteArray &elementName = QByteArray());
- virtual ~QGstreamerVideoOverlay();
-
- GstElement *videoSink() const;
- void setVideoSink(GstElement *);
- QSize nativeVideoSize() const;
-
- void setWindowHandle(WId id);
- void expose();
- void setRenderRectangle(const QRect &rect);
-
- bool isActive() const;
-
- Qt::AspectRatioMode aspectRatioMode() const;
- void setAspectRatioMode(Qt::AspectRatioMode mode);
-
- int brightness() const;
- void setBrightness(int brightness);
-
- int contrast() const;
- void setContrast(int contrast);
-
- int hue() const;
- void setHue(int hue);
-
- int saturation() const;
- void setSaturation(int saturation);
-
- bool processSyncMessage(const QGstreamerMessage &message) override;
- bool processBusMessage(const QGstreamerMessage &message) override;
-
-Q_SIGNALS:
- void nativeVideoSizeChanged();
- void activeChanged();
- void brightnessChanged(int brightness);
- void contrastChanged(int contrast);
- void hueChanged(int hue);
- void saturationChanged(int saturation);
-
-private:
- void setWindowHandle_helper(WId id);
- void updateIsActive();
- void probeCaps(GstCaps *caps) override;
- static void showPrerollFrameChanged(GObject *, GParamSpec *, QGstreamerVideoOverlay *);
-
- GstElement *m_videoSink = nullptr;
- QSize m_nativeVideoSize;
- bool m_isActive = false;
-
- QGstreamerSinkProperties *m_sinkProperties = nullptr;
- WId m_windowId = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERVIDEOOVERLAY_P_H
-
diff --git a/src/multimedia/gsttools_headers/qgstreamervideoprobecontrol_p.h b/src/multimedia/gsttools_headers/qgstreamervideoprobecontrol_p.h
deleted file mode 100644
index b15b6099c..000000000
--- a/src/multimedia/gsttools_headers/qgstreamervideoprobecontrol_p.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERVIDEOPROBECONTROL_H
-#define QGSTREAMERVIDEOPROBECONTROL_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <gst/gst.h>
-#include <gst/video/video.h>
-#include <qmediavideoprobecontrol.h>
-#include <QtCore/qmutex.h>
-#include <qvideoframe.h>
-#include <qvideosurfaceformat.h>
-
-#include <private/qgstreamerbufferprobe_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_GSTTOOLS_EXPORT QGstreamerVideoProbeControl
- : public QMediaVideoProbeControl
- , public QGstreamerBufferProbe
- , public QSharedData
-{
- Q_OBJECT
-public:
- explicit QGstreamerVideoProbeControl(QObject *parent);
- virtual ~QGstreamerVideoProbeControl();
-
- void probeCaps(GstCaps *caps) override;
- bool probeBuffer(GstBuffer *buffer) override;
-
- void startFlushing();
- void stopFlushing();
-
-private slots:
- void frameProbed();
-
-private:
- QVideoSurfaceFormat m_format;
- QVideoFrame m_pendingFrame;
- QMutex m_frameMutex;
-#if GST_CHECK_VERSION(1,0,0)
- GstVideoInfo m_videoInfo;
-#else
- int m_bytesPerLine;
-#endif
- bool m_flushing;
- bool m_frameProbed; // true if at least one frame was probed
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERVIDEOPROBECONTROL_H
diff --git a/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h b/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h
deleted file mode 100644
index d87bfcb8f..000000000
--- a/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERVIDEORENDERER_H
-#define QGSTREAMERVIDEORENDERER_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <qvideorenderercontrol.h>
-#include <private/qvideosurfacegstsink_p.h>
-#include <qabstractvideosurface.h>
-
-#include "qgstreamervideorendererinterface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class Q_GSTTOOLS_EXPORT QGstreamerVideoRenderer : public QVideoRendererControl, public QGstreamerVideoRendererInterface
-{
- Q_OBJECT
- Q_INTERFACES(QGstreamerVideoRendererInterface)
-public:
- QGstreamerVideoRenderer(QObject *parent = 0);
- virtual ~QGstreamerVideoRenderer();
-
- QAbstractVideoSurface *surface() const override;
- void setSurface(QAbstractVideoSurface *surface) override;
-
- GstElement *videoSink() override;
- void setVideoSink(GstElement *) override;
-
- void stopRenderer() override;
- bool isReady() const override { return m_surface != 0; }
-
-signals:
- void sinkChanged();
- void readyChanged(bool);
-
-private slots:
- void handleFormatChange();
-
-private:
- GstElement *m_videoSink = nullptr;
- QPointer<QAbstractVideoSurface> m_surface;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERVIDEORENDRER_H
diff --git a/src/multimedia/gsttools_headers/qgstreamervideorendererinterface_p.h b/src/multimedia/gsttools_headers/qgstreamervideorendererinterface_p.h
deleted file mode 100644
index 231c843db..000000000
--- a/src/multimedia/gsttools_headers/qgstreamervideorendererinterface_p.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERVIDEOOUTPUTCONTROL_H
-#define QGSTREAMERVIDEOOUTPUTCONTROL_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <gst/gst.h>
-
-#include <QtCore/qobject.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGstreamerVideoRendererInterface
-{
-public:
- virtual ~QGstreamerVideoRendererInterface();
- virtual GstElement *videoSink() = 0;
- virtual void setVideoSink(GstElement *) {};
-
- //stopRenderer() is called when the renderer element is stopped.
- //it can be reimplemented when video renderer can't detect
- //changes to NULL state but has to free video resources.
- virtual void stopRenderer() {}
-
- //the video output is configured, usually after the first paint event
- //(winId is known,
- virtual bool isReady() const { return true; }
-
- //signals:
- //void sinkChanged();
- //void readyChanged(bool);
-};
-
-#define QGstreamerVideoRendererInterface_iid "org.qt-project.qt.gstreamervideorenderer/5.0"
-Q_DECLARE_INTERFACE(QGstreamerVideoRendererInterface, QGstreamerVideoRendererInterface_iid)
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h b/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h
deleted file mode 100644
index 1ddb738df..000000000
--- a/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERVIDEOWIDGET_H
-#define QGSTREAMERVIDEOWIDGET_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <qvideowidgetcontrol.h>
-
-#include "qgstreamervideorendererinterface_p.h"
-#include <private/qgstreamerbushelper_p.h>
-#include <private/qgstreamervideooverlay_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_GSTTOOLS_EXPORT QGstreamerVideoWidget;
-
-class Q_GSTTOOLS_EXPORT QGstreamerVideoWidgetControl
- : public QVideoWidgetControl
- , public QGstreamerVideoRendererInterface
- , public QGstreamerSyncMessageFilter
- , public QGstreamerBusMessageFilter
-{
- Q_OBJECT
- Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter QGstreamerBusMessageFilter)
-public:
- explicit QGstreamerVideoWidgetControl(QObject *parent = 0, const QByteArray &elementName = QByteArray());
- virtual ~QGstreamerVideoWidgetControl();
-
- GstElement *videoSink() override;
- void setVideoSink(GstElement *) override;
-
- QWidget *videoWidget() override;
-
- void stopRenderer() override;
-
- Qt::AspectRatioMode aspectRatioMode() const override;
- void setAspectRatioMode(Qt::AspectRatioMode mode) override;
-
- bool isFullScreen() const override;
- void setFullScreen(bool fullScreen) override;
-
- int brightness() const override;
- void setBrightness(int brightness) override;
-
- int contrast() const override;
- void setContrast(int contrast) override;
-
- int hue() const override;
- void setHue(int hue) override;
-
- int saturation() const override;
- void setSaturation(int saturation) override;
-
- bool eventFilter(QObject *object, QEvent *event) override;
-
-signals:
- void sinkChanged();
- void readyChanged(bool);
-
-private Q_SLOTS:
- void onOverlayActiveChanged();
- void onNativeVideoSizeChanged();
-
-private:
- void createVideoWidget();
- void updateWidgetAttributes();
-
- bool processSyncMessage(const QGstreamerMessage &message) override;
- bool processBusMessage(const QGstreamerMessage &message) override;
-
- QGstreamerVideoOverlay m_videoOverlay;
- QGstreamerVideoWidget *m_widget;
- bool m_stopped;
- WId m_windowId;
- bool m_fullScreen;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERVIDEOWIDGET_H
diff --git a/src/multimedia/gsttools_headers/qgstreamervideowindow_p.h b/src/multimedia/gsttools_headers/qgstreamervideowindow_p.h
deleted file mode 100644
index 5f893f10e..000000000
--- a/src/multimedia/gsttools_headers/qgstreamervideowindow_p.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERVIDEOWINDOW_H
-#define QGSTREAMERVIDEOWINDOW_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <qvideowindowcontrol.h>
-
-#include "qgstreamervideorendererinterface_p.h"
-#include <private/qgstreamerbushelper_p.h>
-#include <private/qgstreamervideooverlay_p.h>
-#include <QtGui/qcolor.h>
-
-QT_BEGIN_NAMESPACE
-class QAbstractVideoSurface;
-
-class Q_GSTTOOLS_EXPORT QGstreamerVideoWindow :
- public QVideoWindowControl,
- public QGstreamerVideoRendererInterface,
- public QGstreamerSyncMessageFilter,
- public QGstreamerBusMessageFilter
-{
- Q_OBJECT
- Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter QGstreamerBusMessageFilter)
-public:
- explicit QGstreamerVideoWindow(QObject *parent = 0, const QByteArray &elementName = QByteArray());
- ~QGstreamerVideoWindow();
-
- WId winId() const override;
- void setWinId(WId id) override;
-
- QRect displayRect() const override;
- void setDisplayRect(const QRect &rect) override;
-
- bool isFullScreen() const override;
- void setFullScreen(bool fullScreen) override;
-
- QSize nativeSize() const override;
-
- Qt::AspectRatioMode aspectRatioMode() const override;
- void setAspectRatioMode(Qt::AspectRatioMode mode) override;
-
- void repaint() override;
-
- int brightness() const override;
- void setBrightness(int brightness) override;
-
- int contrast() const override;
- void setContrast(int contrast) override;
-
- int hue() const override;
- void setHue(int hue) override;
-
- int saturation() const override;
- void setSaturation(int saturation) override;
-
- QAbstractVideoSurface *surface() const;
-
- GstElement *videoSink() override;
-
- bool processSyncMessage(const QGstreamerMessage &message) override;
- bool processBusMessage(const QGstreamerMessage &message) override;
- bool isReady() const override { return m_windowId != 0; }
-
-signals:
- void sinkChanged();
- void readyChanged(bool);
-
-private:
- QGstreamerVideoOverlay m_videoOverlay;
- WId m_windowId;
- QRect m_displayRect;
- bool m_fullScreen;
- mutable QColor m_colorKey;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgsttools_global_p.h b/src/multimedia/gsttools_headers/qgsttools_global_p.h
deleted file mode 100644
index babcd3aaf..000000000
--- a/src/multimedia/gsttools_headers/qgsttools_global_p.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTTOOLS_GLOBAL_H
-#define QGSTTOOLS_GLOBAL_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_STATIC
-# if defined(QT_BUILD_MULTIMEDIAGSTTOOLS_LIB)
-# define Q_GSTTOOLS_EXPORT Q_DECL_EXPORT
-# else
-# define Q_GSTTOOLS_EXPORT Q_DECL_IMPORT
-# endif
-#else
-# define Q_GSTTOOLS_EXPORT
-#endif
-
-QT_END_NAMESPACE
-
-#endif // QGSTTOOLS_GLOBAL_H
diff --git a/src/multimedia/gsttools_headers/qgstutils_p.h b/src/multimedia/gsttools_headers/qgstutils_p.h
deleted file mode 100644
index 24d3e889d..000000000
--- a/src/multimedia/gsttools_headers/qgstutils_p.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTUTILS_P_H
-#define QGSTUTILS_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <QtCore/qmap.h>
-#include <QtCore/qset.h>
-#include <QtCore/qvector.h>
-#include <gst/gst.h>
-#include <gst/video/video.h>
-#include <qaudioformat.h>
-#include <qcamera.h>
-#include <qabstractvideobuffer.h>
-#include <qvideoframe.h>
-#include <QDebug>
-
-#if GST_CHECK_VERSION(1,0,0)
-# define QT_GSTREAMER_PLAYBIN_ELEMENT_NAME "playbin"
-# define QT_GSTREAMER_CAMERABIN_ELEMENT_NAME "camerabin"
-# define QT_GSTREAMER_COLORCONVERSION_ELEMENT_NAME "videoconvert"
-# define QT_GSTREAMER_RAW_AUDIO_MIME "audio/x-raw"
-# define QT_GSTREAMER_VIDEOOVERLAY_INTERFACE_NAME "GstVideoOverlay"
-#else
-# define QT_GSTREAMER_PLAYBIN_ELEMENT_NAME "playbin2"
-# define QT_GSTREAMER_CAMERABIN_ELEMENT_NAME "camerabin2"
-# define QT_GSTREAMER_COLORCONVERSION_ELEMENT_NAME "ffmpegcolorspace"
-# define QT_GSTREAMER_RAW_AUDIO_MIME "audio/x-raw-int"
-# define QT_GSTREAMER_VIDEOOVERLAY_INTERFACE_NAME "GstXOverlay"
-#endif
-
-QT_BEGIN_NAMESPACE
-
-class QSize;
-class QVariant;
-class QByteArray;
-class QImage;
-class QVideoSurfaceFormat;
-
-namespace QGstUtils {
- struct Q_GSTTOOLS_EXPORT CameraInfo
- {
- QString name;
- QString description;
- int orientation;
- QCamera::Position position;
- QByteArray driver;
- };
-
- Q_GSTTOOLS_EXPORT QMap<QByteArray, QVariant> gstTagListToMap(const GstTagList *list);
-
- Q_GSTTOOLS_EXPORT QSize capsResolution(const GstCaps *caps);
- Q_GSTTOOLS_EXPORT QSize capsCorrectedResolution(const GstCaps *caps);
- Q_GSTTOOLS_EXPORT QAudioFormat audioFormatForCaps(const GstCaps *caps);
-#if GST_CHECK_VERSION(1,0,0)
- Q_GSTTOOLS_EXPORT QAudioFormat audioFormatForSample(GstSample *sample);
-#else
- Q_GSTTOOLS_EXPORT QAudioFormat audioFormatForBuffer(GstBuffer *buffer);
-#endif
- Q_GSTTOOLS_EXPORT GstCaps *capsForAudioFormat(const QAudioFormat &format);
- Q_GSTTOOLS_EXPORT void initializeGst();
- Q_GSTTOOLS_EXPORT QMultimedia::SupportEstimate hasSupport(const QString &mimeType,
- const QStringList &codecs,
- const QSet<QString> &supportedMimeTypeSet);
-
- Q_GSTTOOLS_EXPORT QVector<CameraInfo> enumerateCameras(GstElementFactory *factory = 0);
- Q_GSTTOOLS_EXPORT QList<QByteArray> cameraDevices(GstElementFactory * factory = 0);
- Q_GSTTOOLS_EXPORT QString cameraDescription(const QString &device, GstElementFactory * factory = 0);
- Q_GSTTOOLS_EXPORT QCamera::Position cameraPosition(const QString &device, GstElementFactory * factory = 0);
- Q_GSTTOOLS_EXPORT int cameraOrientation(const QString &device, GstElementFactory * factory = 0);
- Q_GSTTOOLS_EXPORT QByteArray cameraDriver(const QString &device, GstElementFactory * factory = 0);
-
- Q_GSTTOOLS_EXPORT QSet<QString> supportedMimeTypes(bool (*isValidFactory)(GstElementFactory *factory));
-
-#if GST_CHECK_VERSION(1,0,0)
- Q_GSTTOOLS_EXPORT QImage bufferToImage(GstBuffer *buffer, const GstVideoInfo &info);
- Q_GSTTOOLS_EXPORT QVideoSurfaceFormat formatForCaps(
- GstCaps *caps,
- GstVideoInfo *info = 0,
- QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle);
-#else
- Q_GSTTOOLS_EXPORT QImage bufferToImage(GstBuffer *buffer);
- Q_GSTTOOLS_EXPORT QVideoSurfaceFormat formatForCaps(
- GstCaps *caps,
- int *bytesPerLine = 0,
- QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle);
-#endif
-
- Q_GSTTOOLS_EXPORT GstCaps *capsForFormats(const QList<QVideoFrame::PixelFormat> &formats);
- void setFrameTimeStamps(QVideoFrame *frame, GstBuffer *buffer);
-
- Q_GSTTOOLS_EXPORT void setMetaData(GstElement *element, const QMap<QByteArray, QVariant> &data);
- Q_GSTTOOLS_EXPORT void setMetaData(GstBin *bin, const QMap<QByteArray, QVariant> &data);
-
- Q_GSTTOOLS_EXPORT GstCaps *videoFilterCaps();
-
- Q_GSTTOOLS_EXPORT QSize structureResolution(const GstStructure *s);
- Q_GSTTOOLS_EXPORT QVideoFrame::PixelFormat structurePixelFormat(const GstStructure *s, int *bpp = 0);
- Q_GSTTOOLS_EXPORT QSize structurePixelAspectRatio(const GstStructure *s);
- Q_GSTTOOLS_EXPORT QPair<qreal, qreal> structureFrameRateRange(const GstStructure *s);
-
- Q_GSTTOOLS_EXPORT QString fileExtensionForMimeType(const QString &mimeType);
-}
-
-Q_GSTTOOLS_EXPORT void qt_gst_object_ref_sink(gpointer object);
-Q_GSTTOOLS_EXPORT GstCaps *qt_gst_pad_get_current_caps(GstPad *pad);
-Q_GSTTOOLS_EXPORT GstCaps *qt_gst_pad_get_caps(GstPad *pad);
-Q_GSTTOOLS_EXPORT GstStructure *qt_gst_structure_new_empty(const char *name);
-Q_GSTTOOLS_EXPORT gboolean qt_gst_element_query_position(GstElement *element, GstFormat format, gint64 *cur);
-Q_GSTTOOLS_EXPORT gboolean qt_gst_element_query_duration(GstElement *element, GstFormat format, gint64 *cur);
-Q_GSTTOOLS_EXPORT GstCaps *qt_gst_caps_normalize(GstCaps *caps);
-Q_GSTTOOLS_EXPORT const gchar *qt_gst_element_get_factory_name(GstElement *element);
-Q_GSTTOOLS_EXPORT gboolean qt_gst_caps_can_intersect(const GstCaps * caps1, const GstCaps * caps2);
-Q_GSTTOOLS_EXPORT GList *qt_gst_video_sinks();
-Q_GSTTOOLS_EXPORT void qt_gst_util_double_to_fraction(gdouble src, gint *dest_n, gint *dest_d);
-
-Q_GSTTOOLS_EXPORT QDebug operator <<(QDebug debug, GstCaps *caps);
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstvideobuffer_p.h b/src/multimedia/gsttools_headers/qgstvideobuffer_p.h
deleted file mode 100644
index c67c57021..000000000
--- a/src/multimedia/gsttools_headers/qgstvideobuffer_p.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTVIDEOBUFFER_P_H
-#define QGSTVIDEOBUFFER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <qabstractvideobuffer.h>
-#include <QtCore/qvariant.h>
-
-#include <gst/gst.h>
-#include <gst/video/video.h>
-
-QT_BEGIN_NAMESPACE
-
-#if GST_CHECK_VERSION(1,0,0)
-class Q_GSTTOOLS_EXPORT QGstVideoBuffer : public QAbstractPlanarVideoBuffer
-{
-public:
- QGstVideoBuffer(GstBuffer *buffer, const GstVideoInfo &info);
- QGstVideoBuffer(GstBuffer *buffer, const GstVideoInfo &info,
- HandleType handleType, const QVariant &handle);
-#else
-class Q_GSTTOOLS_EXPORT QGstVideoBuffer : public QAbstractVideoBuffer
-{
-public:
- QGstVideoBuffer(GstBuffer *buffer, int bytesPerLine);
- QGstVideoBuffer(GstBuffer *buffer, int bytesPerLine,
- HandleType handleType, const QVariant &handle);
-#endif
-
- ~QGstVideoBuffer();
-
- MapMode mapMode() const override;
-
-#if GST_CHECK_VERSION(1,0,0)
- int map(MapMode mode, int *numBytes, int bytesPerLine[4], uchar *data[4]) override;
-#else
- uchar *map(MapMode mode, int *numBytes, int *bytesPerLine) override;
-#endif
-
- void unmap() override;
-
- QVariant handle() const override { return m_handle; }
-private:
-#if GST_CHECK_VERSION(1,0,0)
- GstVideoInfo m_videoInfo;
- GstVideoFrame m_frame;
-#else
- int m_bytesPerLine;
-#endif
- GstBuffer *m_buffer;
- MapMode m_mode;
- QVariant m_handle;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstvideorendererplugin_p.h b/src/multimedia/gsttools_headers/qgstvideorendererplugin_p.h
deleted file mode 100644
index df36dbe09..000000000
--- a/src/multimedia/gsttools_headers/qgstvideorendererplugin_p.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTVIDEORENDERERPLUGIN_P_H
-#define QGSTVIDEORENDERERPLUGIN_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qgsttools_global_p.h>
-#include <qabstractvideobuffer.h>
-#include <qvideosurfaceformat.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qplugin.h>
-
-#include <gst/gst.h>
-
-QT_BEGIN_NAMESPACE
-
-class QAbstractVideoSurface;
-
-const QLatin1String QGstVideoRendererPluginKey("gstvideorenderer");
-
-class Q_GSTTOOLS_EXPORT QGstVideoRenderer
-{
-public:
- virtual ~QGstVideoRenderer() {}
-
- virtual GstCaps *getCaps(QAbstractVideoSurface *surface) = 0;
- virtual bool start(QAbstractVideoSurface *surface, GstCaps *caps) = 0;
- virtual void stop(QAbstractVideoSurface *surface) = 0; // surface may be null if unexpectedly deleted.
- virtual bool proposeAllocation(GstQuery *query) = 0; // may be called from a thread.
-
- virtual bool present(QAbstractVideoSurface *surface, GstBuffer *buffer) = 0;
- virtual void flush(QAbstractVideoSurface *surface) = 0; // surface may be null if unexpectedly deleted.
-};
-
-/*
- Abstract interface for video buffers allocation.
-*/
-class Q_GSTTOOLS_EXPORT QGstVideoRendererInterface
-{
-public:
- virtual ~QGstVideoRendererInterface() {}
-
- virtual QGstVideoRenderer *createRenderer() = 0;
-};
-
-#define QGstVideoRendererInterface_iid "org.qt-project.qt.gstvideorenderer/5.4"
-Q_DECLARE_INTERFACE(QGstVideoRendererInterface, QGstVideoRendererInterface_iid)
-
-class Q_GSTTOOLS_EXPORT QGstVideoRendererPlugin : public QObject, public QGstVideoRendererInterface
-{
- Q_OBJECT
- Q_INTERFACES(QGstVideoRendererInterface)
-public:
- explicit QGstVideoRendererPlugin(QObject *parent = 0);
- virtual ~QGstVideoRendererPlugin() {}
-
- QGstVideoRenderer *createRenderer() override = 0;
-
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qgstvideorenderersink_p.h b/src/multimedia/gsttools_headers/qgstvideorenderersink_p.h
deleted file mode 100644
index d2417a7c9..000000000
--- a/src/multimedia/gsttools_headers/qgstvideorenderersink_p.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTVIDEORENDERERSINK_P_H
-#define QGSTVIDEORENDERERSINK_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <gst/video/gstvideosink.h>
-#include <gst/video/video.h>
-
-#include <QtCore/qlist.h>
-#include <QtCore/qmutex.h>
-#include <QtCore/qqueue.h>
-#include <QtCore/qpointer.h>
-#include <QtCore/qwaitcondition.h>
-#include <qvideosurfaceformat.h>
-#include <qvideoframe.h>
-#include <qabstractvideobuffer.h>
-
-#include "qgstvideorendererplugin_p.h"
-
-#include "qgstvideorendererplugin_p.h"
-
-QT_BEGIN_NAMESPACE
-class QAbstractVideoSurface;
-
-class QGstDefaultVideoRenderer : public QGstVideoRenderer
-{
-public:
- QGstDefaultVideoRenderer();
- ~QGstDefaultVideoRenderer();
-
- GstCaps *getCaps(QAbstractVideoSurface *surface) override;
- bool start(QAbstractVideoSurface *surface, GstCaps *caps) override;
- void stop(QAbstractVideoSurface *surface) override;
-
- bool proposeAllocation(GstQuery *query) override;
-
- bool present(QAbstractVideoSurface *surface, GstBuffer *buffer) override;
- void flush(QAbstractVideoSurface *surface) override;
-
-private:
- QVideoSurfaceFormat m_format;
- GstVideoInfo m_videoInfo;
- bool m_flushed;
-};
-
-class QVideoSurfaceGstDelegate : public QObject
-{
- Q_OBJECT
-public:
- QVideoSurfaceGstDelegate(QAbstractVideoSurface *surface);
- ~QVideoSurfaceGstDelegate();
-
- GstCaps *caps();
-
- bool start(GstCaps *caps);
- void stop();
- void unlock();
- bool proposeAllocation(GstQuery *query);
-
- void flush();
-
- GstFlowReturn render(GstBuffer *buffer);
-
- bool event(QEvent *event) override;
-
-private slots:
- bool handleEvent(QMutexLocker *locker);
- void updateSupportedFormats();
-
-private:
- void notify();
- bool waitForAsyncEvent(QMutexLocker *locker, QWaitCondition *condition, unsigned long time);
-
- QPointer<QAbstractVideoSurface> m_surface;
-
- QMutex m_mutex;
- QWaitCondition m_setupCondition;
- QWaitCondition m_renderCondition;
- GstFlowReturn m_renderReturn;
- QList<QGstVideoRenderer *> m_renderers;
- QGstVideoRenderer *m_renderer;
- QGstVideoRenderer *m_activeRenderer;
-
- GstCaps *m_surfaceCaps;
- GstCaps *m_startCaps;
- GstBuffer *m_renderBuffer;
-
- bool m_notified;
- bool m_stop;
- bool m_flush;
-};
-
-class Q_GSTTOOLS_EXPORT QGstVideoRendererSink
-{
-public:
- GstVideoSink parent;
-
- static QGstVideoRendererSink *createSink(QAbstractVideoSurface *surface);
- static void setSurface(QAbstractVideoSurface *surface);
-
-private:
- static GType get_type();
- static void class_init(gpointer g_class, gpointer class_data);
- static void base_init(gpointer g_class);
- static void instance_init(GTypeInstance *instance, gpointer g_class);
-
- static void finalize(GObject *object);
-
- static void handleShowPrerollChange(GObject *o, GParamSpec *p, gpointer d);
-
- static GstStateChangeReturn change_state(GstElement *element, GstStateChange transition);
-
- static GstCaps *get_caps(GstBaseSink *sink, GstCaps *filter);
- static gboolean set_caps(GstBaseSink *sink, GstCaps *caps);
-
- static gboolean propose_allocation(GstBaseSink *sink, GstQuery *query);
-
- static gboolean stop(GstBaseSink *sink);
-
- static gboolean unlock(GstBaseSink *sink);
-
- static GstFlowReturn show_frame(GstVideoSink *sink, GstBuffer *buffer);
-
-private:
- QVideoSurfaceGstDelegate *delegate;
-};
-
-
-class QGstVideoRendererSinkClass
-{
-public:
- GstVideoSinkClass parent_class;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/multimedia/gsttools_headers/qvideosurfacegstsink_p.h b/src/multimedia/gsttools_headers/qvideosurfacegstsink_p.h
deleted file mode 100644
index 961cf91d2..000000000
--- a/src/multimedia/gsttools_headers/qvideosurfacegstsink_p.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef VIDEOSURFACEGSTSINK_P_H
-#define VIDEOSURFACEGSTSINK_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <gst/gst.h>
-
-#if GST_CHECK_VERSION(1,0,0)
-
-#include "qgstvideorenderersink_p.h"
-
-QT_BEGIN_NAMESPACE
-typedef QGstVideoRendererSink QVideoSurfaceGstSink;
-QT_END_NAMESPACE
-
-#else
-
-#include <gst/video/gstvideosink.h>
-
-#include <QtCore/qlist.h>
-#include <QtCore/qmutex.h>
-#include <QtCore/qqueue.h>
-#include <QtCore/qpointer.h>
-#include <QtCore/qwaitcondition.h>
-#include <qvideosurfaceformat.h>
-#include <qvideoframe.h>
-#include <qabstractvideobuffer.h>
-
-#include "qgstbufferpoolinterface_p.h"
-
-QT_BEGIN_NAMESPACE
-class QAbstractVideoSurface;
-
-class QVideoSurfaceGstDelegate : public QObject
-{
- Q_OBJECT
-public:
- QVideoSurfaceGstDelegate(QAbstractVideoSurface *surface);
- ~QVideoSurfaceGstDelegate();
-
- QList<QVideoFrame::PixelFormat> supportedPixelFormats(
- QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
-
- QVideoSurfaceFormat surfaceFormat() const;
-
- bool start(const QVideoSurfaceFormat &format, int bytesPerLine);
- void stop();
-
- void unlock();
-
- bool isActive();
-
- QGstBufferPoolInterface *pool() { return m_pool; }
- QMutex *poolMutex() { return &m_poolMutex; }
- void clearPoolBuffers();
-
- void flush();
-
- GstFlowReturn render(GstBuffer *buffer);
-
-private slots:
- void queuedStart();
- void queuedStop();
- void queuedFlush();
- void queuedRender();
-
- void updateSupportedFormats();
-
-private:
- QPointer<QAbstractVideoSurface> m_surface;
- QList<QVideoFrame::PixelFormat> m_supportedPixelFormats;
- //pixel formats of buffers pool native type
- QList<QVideoFrame::PixelFormat> m_supportedPoolPixelFormats;
- QGstBufferPoolInterface *m_pool;
- QList<QGstBufferPoolInterface *> m_pools;
- QMutex m_poolMutex;
- QMutex m_mutex;
- QWaitCondition m_setupCondition;
- QWaitCondition m_renderCondition;
- QVideoSurfaceFormat m_format;
- QVideoFrame m_frame;
- GstFlowReturn m_renderReturn;
- int m_bytesPerLine;
- bool m_started;
- bool m_startCanceled;
-};
-
-class QVideoSurfaceGstSink
-{
-public:
- GstVideoSink parent;
-
- static QVideoSurfaceGstSink *createSink(QAbstractVideoSurface *surface);
- static void setSurface(QAbstractVideoSurface *surface) { Q_UNUSED(surface); }
-
-private:
- static GType get_type();
- static void class_init(gpointer g_class, gpointer class_data);
- static void base_init(gpointer g_class);
- static void instance_init(GTypeInstance *instance, gpointer g_class);
-
- static void finalize(GObject *object);
-
- static void handleShowPrerollChange(GObject *o, GParamSpec *p, gpointer d);
-
- static GstStateChangeReturn change_state(GstElement *element, GstStateChange transition);
-
- static GstCaps *get_caps(GstBaseSink *sink);
- static gboolean set_caps(GstBaseSink *sink, GstCaps *caps);
-
- static GstFlowReturn buffer_alloc(
- GstBaseSink *sink, guint64 offset, guint size, GstCaps *caps, GstBuffer **buffer);
-
- static gboolean start(GstBaseSink *sink);
- static gboolean stop(GstBaseSink *sink);
-
- static gboolean unlock(GstBaseSink *sink);
-
-#if GST_CHECK_VERSION(0, 10, 25)
- static GstFlowReturn show_frame(GstVideoSink *sink, GstBuffer *buffer);
-#else
- static GstFlowReturn preroll(GstBaseSink *sink, GstBuffer *buffer);
- static GstFlowReturn render(GstBaseSink *sink, GstBuffer *buffer);
-#endif
-
-private:
- QVideoSurfaceGstDelegate *delegate;
-
- GstCaps *lastRequestedCaps;
- GstCaps *lastBufferCaps;
- QVideoSurfaceFormat *lastSurfaceFormat;
-};
-
-class QVideoSurfaceGstSinkClass
-{
-public:
- GstVideoSinkClass parent_class;
-};
-
-QT_END_NAMESPACE
-
-#endif
-
-#endif
diff --git a/src/multimedia/playback/qmediacontent.cpp b/src/multimedia/playback/qmediacontent.cpp
index fe377b969..95116d02f 100644
--- a/src/multimedia/playback/qmediacontent.cpp
+++ b/src/multimedia/playback/qmediacontent.cpp
@@ -61,14 +61,24 @@ public:
isPlaylistOwned(false)
{}
+#if QT_DEPRECATED_SINCE(6, 0)
QMediaContentPrivate(const QMediaResourceList &r):
- resources(r),
isPlaylistOwned(false)
- {}
+ {
+ for (auto &item : r)
+ requests << item.request();
+ }
+#endif
+
+ QMediaContentPrivate(const QNetworkRequest &r):
+ isPlaylistOwned(false)
+ {
+ requests << r;
+ }
QMediaContentPrivate(const QMediaContentPrivate &other):
QSharedData(other),
- resources(other.resources),
+ requests(other.requests),
playlist(other.playlist),
isPlaylistOwned(false)
{}
@@ -77,7 +87,7 @@ public:
playlist(pls),
isPlaylistOwned(isOwn)
{
- resources << QMediaResource(url);
+ requests << QNetworkRequest(url);
}
~QMediaContentPrivate()
@@ -88,11 +98,10 @@ public:
bool operator ==(const QMediaContentPrivate &other) const
{
- return resources == other.resources && playlist == other.playlist;
+ return requests == other.requests && playlist == other.playlist;
}
- QMediaResourceList resources;
-
+ QList<QNetworkRequest> requests;
QPointer<QMediaPlaylist> playlist;
bool isPlaylistOwned;
private:
@@ -103,20 +112,19 @@ private:
/*!
\class QMediaContent
- \brief The QMediaContent class provides access to the resources relating to a media content.
+ \brief The QMediaContent class provides access to the resource relating to a media content.
\inmodule QtMultimedia
\ingroup multimedia
\ingroup multimedia_playback
QMediaContent is used within the multimedia framework as the logical handle
- to media content. A QMediaContent object is composed of one or more
- \l {QMediaResource}s where each resource provides the URL and format
- information of a different encoding of the content.
+ to media content. A QMediaContent object contains a \l {QNetworkRequest}
+ which provides the URL of the content.
- A non-null QMediaContent will always have a primary or canonical reference to
- the content available through the canonicalUrl() or canonicalResource()
- methods, any additional resources are optional.
+ A non-null QMediaContent will always have a reference to
+ the content available through the canonicalUrl() or canonicalRequest()
+ methods.
Alternatively QMediaContent can represent a playlist and contain a pointer to a
valid QMediaPlaylist object. In this case URL is optional and can either be empty
@@ -139,7 +147,7 @@ QMediaContent::QMediaContent()
QMediaContent::QMediaContent(const QUrl &url):
d(new QMediaContentPrivate)
{
- d->resources << QMediaResource(url);
+ d->requests << QNetworkRequest(url);
}
/*!
@@ -152,20 +160,25 @@ QMediaContent::QMediaContent(const QUrl &url):
QMediaContent::QMediaContent(const QNetworkRequest &request):
d(new QMediaContentPrivate)
{
- d->resources << QMediaResource(request);
+ d->requests << request;
}
+#if QT_DEPRECATED_SINCE(6, 0)
/*!
+ \obsolete
+
Constructs a media content with \a resource providing a reference to the content.
*/
QMediaContent::QMediaContent(const QMediaResource &resource):
d(new QMediaContentPrivate)
{
- d->resources << resource;
+ d->requests << resource.request();
}
/*!
+ \obsolete
+
Constructs a media content with \a resources providing a reference to the content.
*/
@@ -173,6 +186,7 @@ QMediaContent::QMediaContent(const QMediaResourceList &resources):
d(new QMediaContentPrivate(resources))
{
}
+#endif
/*!
Constructs a copy of the media content \a other.
@@ -221,8 +235,8 @@ QMediaContent& QMediaContent::operator=(const QMediaContent &other)
bool QMediaContent::operator==(const QMediaContent &other) const
{
- return (d.constData() == 0 && other.d.constData() == 0) ||
- (d.constData() != 0 && other.d.constData() != 0 &&
+ return (d.constData() == 0 && other.d.constData() == nullptr) ||
+ (d.constData() != 0 && other.d.constData() != nullptr &&
*d.constData() == *other.d.constData());
}
@@ -241,7 +255,7 @@ bool QMediaContent::operator!=(const QMediaContent &other) const
bool QMediaContent::isNull() const
{
- return d.constData() == 0;
+ return d.constData() == nullptr;
}
/*!
@@ -250,7 +264,7 @@ bool QMediaContent::isNull() const
QUrl QMediaContent::canonicalUrl() const
{
- return canonicalResource().url();
+ return canonicalRequest().url();
}
/*!
@@ -259,31 +273,38 @@ QUrl QMediaContent::canonicalUrl() const
QNetworkRequest QMediaContent::canonicalRequest() const
{
- return canonicalResource().request();
+ return (d && !d->requests.isEmpty()) ? d->requests.first() : QNetworkRequest();
}
+#if QT_DEPRECATED_SINCE(6, 0)
/*!
+ \obsolete
+
Returns a QMediaResource that represents that canonical resource for this media content.
*/
QMediaResource QMediaContent::canonicalResource() const
{
- return d.constData() != 0
- ? d->resources.value(0)
- : QMediaResource();
+ return (d && !d->requests.isEmpty()) ? d->requests.first() : QMediaResource();
}
/*!
+ \obsolete
+
Returns a list of alternative resources for this media content. The first item in this list
is always the canonical resource.
*/
QMediaResourceList QMediaContent::resources() const
{
- return d.constData() != 0
- ? d->resources
- : QMediaResourceList();
+ QMediaResourceList list;
+ if (d) {
+ for (auto &item : d->requests)
+ list << item;
+ }
+ return list;
}
+#endif // #if QT_DEPRECATED_SINCE(6, 0)
/*!
Returns a playlist for this media content or 0 if this QMediaContent is not a playlist.
@@ -291,9 +312,9 @@ QMediaResourceList QMediaContent::resources() const
QMediaPlaylist *QMediaContent::playlist() const
{
- return d.constData() != 0
+ return d.constData() != nullptr
? d->playlist.data()
- : 0;
+ : nullptr;
}
QT_END_NAMESPACE
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/qmedianetworkplaylistprovider_p.h b/src/multimedia/playback/qmedianetworkplaylistprovider_p.h
index 3d1ffe66a..6b5220935 100644
--- a/src/multimedia/playback/qmedianetworkplaylistprovider_p.h
+++ b/src/multimedia/playback/qmedianetworkplaylistprovider_p.h
@@ -61,10 +61,10 @@ class Q_MULTIMEDIA_EXPORT QMediaNetworkPlaylistProvider : public QMediaPlaylistP
{
Q_OBJECT
public:
- QMediaNetworkPlaylistProvider(QObject *parent=0);
+ QMediaNetworkPlaylistProvider(QObject *parent = nullptr);
~QMediaNetworkPlaylistProvider();
- bool load(const QNetworkRequest &request, const char *format = 0) override;
+ bool load(const QNetworkRequest &request, const char *format = nullptr) override;
int mediaCount() const override;
QMediaContent media(int pos) const override;
diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp
index e90035cce..81d525ea8 100644
--- a/src/multimedia/playback/qmediaplayer.cpp
+++ b/src/multimedia/playback/qmediaplayer.cpp
@@ -109,12 +109,12 @@ class QMediaPlayerPrivate : public QMediaObjectPrivate
public:
QMediaPlayerPrivate()
- : provider(0)
- , control(0)
- , audioRoleControl(0)
- , customAudioRoleControl(0)
- , playlist(0)
- , networkAccessControl(0)
+ : provider(nullptr)
+ , control(nullptr)
+ , audioRoleControl(nullptr)
+ , customAudioRoleControl(nullptr)
+ , playlist(nullptr)
+ , networkAccessControl(nullptr)
, state(QMediaPlayer::StoppedState)
, status(QMediaPlayer::UnknownMediaStatus)
, error(QMediaPlayer::NoError)
@@ -148,7 +148,7 @@ public:
QMediaPlaylist *parentPlaylist(QMediaPlaylist *pls);
bool isInChain(const QUrl &url);
- void setMedia(const QMediaContent &media, QIODevice *stream = 0);
+ void setMedia(const QMediaContent &media, QIODevice *stream = nullptr);
void setPlaylist(QMediaPlaylist *playlist);
void setPlaylistMedia();
@@ -175,7 +175,7 @@ QMediaPlaylist *QMediaPlayerPrivate::parentPlaylist(QMediaPlaylist *pls)
for (QMediaPlaylist *current = rootMedia.playlist(); current && current != pls; current = current->currentMedia().playlist())
if (current->currentMedia().playlist() == pls)
return current;
- return 0;
+ return nullptr;
}
bool QMediaPlayerPrivate::isInChain(const QUrl &url)
@@ -309,7 +309,7 @@ void QMediaPlayerPrivate::_q_updateMedia(const QMediaContent &media)
const QMediaPlayer::State currentState = state;
- setMedia(media, 0);
+ setMedia(media, nullptr);
if (!media.isNull()) {
switch (currentState) {
@@ -329,8 +329,8 @@ void QMediaPlayerPrivate::_q_updateMedia(const QMediaContent &media)
void QMediaPlayerPrivate::_q_playlistDestroyed()
{
- playlist = 0;
- setMedia(QMediaContent(), 0);
+ playlist = nullptr;
+ setMedia(QMediaContent(), nullptr);
}
void QMediaPlayerPrivate::setMedia(const QMediaContent &media, QIODevice *stream)
@@ -360,7 +360,7 @@ void QMediaPlayerPrivate::setMedia(const QMediaContent &media, QIODevice *stream
// on the backend side since we can't load the new one and we want to be in the
// InvalidMedia status.
ignoreNextStatusChange = QMediaPlayer::NoMedia;
- control->setMedia(QMediaContent(), 0);
+ control->setMedia(QMediaContent(), nullptr);
} else if (hasStreamPlaybackFeature) {
control->setMedia(media, file.data());
@@ -386,7 +386,7 @@ void QMediaPlayerPrivate::setMedia(const QMediaContent &media, QIODevice *stream
tempFile->close();
file.reset(tempFile);
- control->setMedia(QMediaContent(QUrl::fromLocalFile(file->fileName())), 0);
+ control->setMedia(QMediaContent(QUrl::fromLocalFile(file->fileName())), nullptr);
#else
qWarning("Qt was built with -no-feature-temporaryfile: playback from resource file is not supported!");
#endif
@@ -447,13 +447,13 @@ void QMediaPlayerPrivate::setPlaylistMedia()
// media is not changed,
// frontend needs to emit currentMediaChanged
bool isSameMedia = (q->currentMedia() == playlist->currentMedia());
- setMedia(playlist->currentMedia(), 0);
+ setMedia(playlist->currentMedia(), nullptr);
if (isSameMedia) {
emit q->currentMediaChanged(q->currentMedia());
}
}
} else {
- setMedia(QMediaContent(), 0);
+ setMedia(QMediaContent(), nullptr);
}
}
@@ -545,7 +545,7 @@ void QMediaPlayerPrivate::_q_handlePlaylistLoadFailed()
if (playlist)
playlist->next();
else
- setMedia(QMediaContent(), 0);
+ setMedia(QMediaContent(), nullptr);
}
static QMediaService *playerService(QMediaPlayer::Flags flags)
@@ -583,12 +583,12 @@ QMediaPlayer::QMediaPlayer(QObject *parent, QMediaPlayer::Flags flags):
Q_D(QMediaPlayer);
d->provider = QMediaServiceProvider::defaultServiceProvider();
- if (d->service == 0) {
+ if (d->service == nullptr) {
d->error = ServiceMissingError;
} else {
d->control = qobject_cast<QMediaPlayerControl*>(d->service->requestControl(QMediaPlayerControl_iid));
d->networkAccessControl = qobject_cast<QMediaNetworkAccessControl*>(d->service->requestControl(QMediaNetworkAccessControl_iid));
- if (d->control != 0) {
+ if (d->control != nullptr) {
connect(d->control, SIGNAL(mediaChanged(QMediaContent)), SLOT(_q_handleMediaChanged(QMediaContent)));
connect(d->control, SIGNAL(stateChanged(QMediaPlayer::State)), SLOT(_q_stateChanged(QMediaPlayer::State)));
connect(d->control, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
@@ -631,7 +631,7 @@ QMediaPlayer::QMediaPlayer(QObject *parent, QMediaPlayer::Flags flags):
}
}
}
- if (d->networkAccessControl != 0) {
+ if (d->networkAccessControl != nullptr) {
connect(d->networkAccessControl, SIGNAL(configurationChanged(QNetworkConfiguration)),
this, SIGNAL(networkConfigurationChanged(QNetworkConfiguration)));
}
@@ -688,7 +688,7 @@ const QIODevice *QMediaPlayer::mediaStream() const
if (d->control && d->qrcMedia.isNull())
return d->control->mediaStream();
- return 0;
+ return nullptr;
}
QMediaPlaylist *QMediaPlayer::playlist() const
@@ -740,7 +740,7 @@ QMediaPlayer::State QMediaPlayer::state() const
// In case if EndOfMedia status is already received
// but state is not.
- if (d->control != 0
+ if (d->control != nullptr
&& d->status == QMediaPlayer::EndOfMedia
&& d->state != d->control->state()) {
return d->control->state();
@@ -758,7 +758,7 @@ qint64 QMediaPlayer::duration() const
{
Q_D(const QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->duration();
return -1;
@@ -768,7 +768,7 @@ qint64 QMediaPlayer::position() const
{
Q_D(const QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->position();
return 0;
@@ -778,7 +778,7 @@ int QMediaPlayer::volume() const
{
Q_D(const QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->volume();
return 0;
@@ -788,7 +788,7 @@ bool QMediaPlayer::isMuted() const
{
Q_D(const QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isMuted();
return false;
@@ -798,7 +798,7 @@ int QMediaPlayer::bufferStatus() const
{
Q_D(const QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->bufferStatus();
return 0;
@@ -808,7 +808,7 @@ bool QMediaPlayer::isAudioAvailable() const
{
Q_D(const QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isAudioAvailable();
return false;
@@ -818,7 +818,7 @@ bool QMediaPlayer::isVideoAvailable() const
{
Q_D(const QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isVideoAvailable();
return false;
@@ -828,7 +828,7 @@ bool QMediaPlayer::isSeekable() const
{
Q_D(const QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isSeekable();
return false;
@@ -838,7 +838,7 @@ qreal QMediaPlayer::playbackRate() const
{
Q_D(const QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->playbackRate();
return 0.0;
@@ -883,7 +883,7 @@ void QMediaPlayer::play()
{
Q_D(QMediaPlayer);
- if (d->control == 0) {
+ if (d->control == nullptr) {
QMetaObject::invokeMethod(this, "_q_error", Qt::QueuedConnection,
Q_ARG(int, QMediaPlayer::ServiceMissingError),
Q_ARG(QString, tr("The QMediaPlayer object does not have a valid service")));
@@ -921,7 +921,7 @@ void QMediaPlayer::pause()
{
Q_D(QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->pause();
}
@@ -933,7 +933,7 @@ void QMediaPlayer::stop()
{
Q_D(QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->stop();
// If media player didn't stop in response to control.
@@ -952,7 +952,7 @@ void QMediaPlayer::setPosition(qint64 position)
{
Q_D(QMediaPlayer);
- if (d->control == 0)
+ if (d->control == nullptr)
return;
d->control->setPosition(qMax(position, 0ll));
@@ -962,7 +962,7 @@ void QMediaPlayer::setVolume(int v)
{
Q_D(QMediaPlayer);
- if (d->control == 0)
+ if (d->control == nullptr)
return;
int clamped = qBound(0, v, 100);
@@ -976,7 +976,7 @@ void QMediaPlayer::setMuted(bool muted)
{
Q_D(QMediaPlayer);
- if (d->control == 0 || muted == isMuted())
+ if (d->control == nullptr || muted == isMuted())
return;
d->control->setMuted(muted);
@@ -986,7 +986,7 @@ void QMediaPlayer::setPlaybackRate(qreal rate)
{
Q_D(QMediaPlayer);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->setPlaybackRate(rate);
}
@@ -1014,7 +1014,7 @@ void QMediaPlayer::setMedia(const QMediaContent &media, QIODevice *stream)
QMediaContent oldMedia = d->rootMedia;
d->disconnectPlaylist();
- d->playlist = 0;
+ d->playlist = nullptr;
d->rootMedia = media;
d->nestedPlaylists = 0;
@@ -1100,7 +1100,7 @@ void QMediaPlayer::setVideoOutput(QVideoWidget *output)
// We don't know (in this library) that QVideoWidget inherits QObject
QObject *outputObject = reinterpret_cast<QObject*>(output);
- d->videoOutput = outputObject && bind(outputObject) ? outputObject : 0;
+ d->videoOutput = outputObject && bind(outputObject) ? outputObject : nullptr;
}
/*!
@@ -1122,7 +1122,7 @@ void QMediaPlayer::setVideoOutput(QGraphicsVideoItem *output)
// but QObject inheritance depends on QObject coming first, so try this out.
QObject *outputObject = reinterpret_cast<QObject*>(output);
- d->videoOutput = outputObject && bind(outputObject) ? outputObject : 0;
+ d->videoOutput = outputObject && bind(outputObject) ? outputObject : nullptr;
}
/*!
@@ -1142,14 +1142,14 @@ void QMediaPlayer::setVideoOutput(QAbstractVideoSurface *surface)
if (d->videoOutput)
unbind(d->videoOutput);
- d->videoOutput = 0;
+ d->videoOutput = nullptr;
if (surface && bind(&d->surfaceOutput))
d->videoOutput = &d->surfaceOutput;
} else if (!surface) {
//unbind the surfaceOutput if null surface is set
unbind(&d->surfaceOutput);
- d->videoOutput = 0;
+ d->videoOutput = nullptr;
}
}
@@ -1168,7 +1168,7 @@ QAudio::Role QMediaPlayer::audioRole() const
{
Q_D(const QMediaPlayer);
- if (d->audioRoleControl != NULL)
+ if (d->audioRoleControl != nullptr)
return d->audioRoleControl->audioRole();
return QAudio::UnknownRole;
diff --git a/src/multimedia/playback/qmediaplaylist.cpp b/src/multimedia/playback/qmediaplaylist.cpp
index 97fe75044..7618827da 100644
--- a/src/multimedia/playback/qmediaplaylist.cpp
+++ b/src/multimedia/playback/qmediaplaylist.cpp
@@ -124,7 +124,7 @@ QMediaPlaylist::QMediaPlaylist(QObject *parent)
d->q_ptr = this;
d->networkPlaylistControl = new QMediaNetworkPlaylistControl(this);
- setMediaObject(0);
+ setMediaObject(nullptr);
}
/*!
@@ -163,9 +163,9 @@ bool QMediaPlaylist::setMediaObject(QMediaObject *mediaObject)
return true;
QMediaService *service = mediaObject
- ? mediaObject->service() : 0;
+ ? mediaObject->service() : nullptr;
- QMediaPlaylistControl *newControl = 0;
+ QMediaPlaylistControl *newControl = nullptr;
if (service)
newControl = qobject_cast<QMediaPlaylistControl*>(service->requestControl(QMediaPlaylistControl_iid));
diff --git a/src/multimedia/playback/qmediaplaylist_p.h b/src/multimedia/playback/qmediaplaylist_p.h
index 8e081dd67..16fce00a9 100644
--- a/src/multimedia/playback/qmediaplaylist_p.h
+++ b/src/multimedia/playback/qmediaplaylist_p.h
@@ -78,9 +78,9 @@ class QMediaPlaylistPrivate
Q_DECLARE_PUBLIC(QMediaPlaylist)
public:
QMediaPlaylistPrivate()
- :mediaObject(0),
- control(0),
- networkPlaylistControl(0),
+ :mediaObject(nullptr),
+ control(nullptr),
+ networkPlaylistControl(nullptr),
error(QMediaPlaylist::NoError)
{
}
@@ -98,10 +98,10 @@ public:
void _q_mediaObjectDeleted()
{
Q_Q(QMediaPlaylist);
- mediaObject = 0;
+ mediaObject = nullptr;
if (control != networkPlaylistControl)
- control = 0;
- q->setMediaObject(0);
+ control = nullptr;
+ q->setMediaObject(nullptr);
}
QMediaObject *mediaObject;
diff --git a/src/multimedia/playback/qmediaplaylistioplugin_p.h b/src/multimedia/playback/qmediaplaylistioplugin_p.h
index 1e157d135..50bdcf9c0 100644
--- a/src/multimedia/playback/qmediaplaylistioplugin_p.h
+++ b/src/multimedia/playback/qmediaplaylistioplugin_p.h
@@ -106,7 +106,7 @@ class Q_MULTIMEDIA_EXPORT QMediaPlaylistIOPlugin : public QObject, public QMedia
Q_OBJECT
Q_INTERFACES(QMediaPlaylistIOInterface)
public:
- explicit QMediaPlaylistIOPlugin(QObject *parent = 0);
+ explicit QMediaPlaylistIOPlugin(QObject *parent = nullptr);
~QMediaPlaylistIOPlugin();
bool canRead(QIODevice *device, const QByteArray &format = QByteArray() ) const override = 0;
diff --git a/src/multimedia/playback/qmediaplaylistnavigator.cpp b/src/multimedia/playback/qmediaplaylistnavigator.cpp
index 0966c9396..120f621f5 100644
--- a/src/multimedia/playback/qmediaplaylistnavigator.cpp
+++ b/src/multimedia/playback/qmediaplaylistnavigator.cpp
@@ -63,7 +63,7 @@ class QMediaPlaylistNavigatorPrivate
Q_DECLARE_NON_CONST_PUBLIC(QMediaPlaylistNavigator)
public:
QMediaPlaylistNavigatorPrivate()
- :playlist(0),
+ :playlist(nullptr),
currentPos(-1),
lastValidPos(-1),
playbackMode(QMediaPlaylist::Sequential),
diff --git a/src/multimedia/playback/qmediaplaylistnavigator_p.h b/src/multimedia/playback/qmediaplaylistnavigator_p.h
index 3899c42d9..2ac03a62c 100644
--- a/src/multimedia/playback/qmediaplaylistnavigator_p.h
+++ b/src/multimedia/playback/qmediaplaylistnavigator_p.h
@@ -67,7 +67,7 @@ class Q_MULTIMEDIA_EXPORT QMediaPlaylistNavigator : public QObject
Q_PROPERTY(QMediaContent currentItem READ currentItem)
public:
- QMediaPlaylistNavigator(QMediaPlaylistProvider *playlist, QObject *parent = 0);
+ QMediaPlaylistNavigator(QMediaPlaylistProvider *playlist, QObject *parent = nullptr);
virtual ~QMediaPlaylistNavigator();
QMediaPlaylistProvider *playlist() const;
diff --git a/src/multimedia/playback/qmediaplaylistprovider_p.h b/src/multimedia/playback/qmediaplaylistprovider_p.h
index 899c7c8bc..ed27612b9 100644
--- a/src/multimedia/playback/qmediaplaylistprovider_p.h
+++ b/src/multimedia/playback/qmediaplaylistprovider_p.h
@@ -70,12 +70,12 @@ class Q_MULTIMEDIA_EXPORT QMediaPlaylistProvider : public QObject
{
Q_OBJECT
public:
- QMediaPlaylistProvider(QObject *parent=0);
+ QMediaPlaylistProvider(QObject *parent = nullptr);
virtual ~QMediaPlaylistProvider();
- virtual bool load(const QNetworkRequest &request, const char *format = 0);
- virtual bool load(QIODevice * device, const char *format = 0);
- virtual bool save(const QUrl &location, const char *format = 0);
+ virtual bool load(const QNetworkRequest &request, const char *format = nullptr);
+ virtual bool load(QIODevice *device, const char *format = nullptr);
+ virtual bool save(const QUrl &location, const char *format = nullptr);
virtual bool save(QIODevice * device, const char *format);
virtual int mediaCount() const = 0;
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..92e7f97e8 100644
--- a/src/multimedia/playback/qplaylistfileparser.cpp
+++ b/src/multimedia/playback/qplaylistfileparser.cpp
@@ -273,7 +273,7 @@ class QPlaylistFileParserPrivate
public:
QPlaylistFileParserPrivate(QPlaylistFileParser *q)
: q_ptr(q)
- , m_stream(0)
+ , m_stream(nullptr)
, m_type(QPlaylistFileParser::UNKNOWN)
, m_scanIndex(0)
, m_lineIndex(-1)
@@ -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 = nullptr; 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..cf96ccdbf 100644
--- a/src/multimedia/playback/qplaylistfileparser_p.h
+++ b/src/multimedia/playback/qplaylistfileparser_p.h
@@ -66,7 +66,7 @@ class Q_MULTIMEDIA_EXPORT QPlaylistFileParser : public QObject
{
Q_OBJECT
public:
- QPlaylistFileParser(QObject *parent = 0);
+ QPlaylistFileParser(QObject *parent = nullptr);
~QPlaylistFileParser();
enum FileType
@@ -86,7 +86,7 @@ public:
NetworkError
};
- void start(const QMediaContent &media, QIODevice *stream = 0);
+ void start(const QMediaContent &media, QIODevice *stream = nullptr, const QString &mimeType = QString());
void start(const QNetworkRequest &request, const QString &mimeType = QString());
void abort();
@@ -109,7 +109,7 @@ private:
const QString& mime);
static FileType findPlaylistType(const QString &suffix,
const QString& mime,
- const char *data = 0,
+ const char *data = nullptr,
quint32 size = 0);
Q_DISABLE_COPY(QPlaylistFileParser)
diff --git a/src/multimedia/qmediacontrol.h b/src/multimedia/qmediacontrol.h
index cff42e3ca..48ae44f8a 100644
--- a/src/multimedia/qmediacontrol.h
+++ b/src/multimedia/qmediacontrol.h
@@ -68,7 +68,7 @@ private:
Q_DECLARE_PRIVATE(QMediaControl)
};
-template <typename T> const char *qmediacontrol_iid() { return 0; }
+template <typename T> const char *qmediacontrol_iid() { return nullptr; }
#define Q_MEDIA_DECLARE_CONTROL(Class, IId) \
template <> inline const char *qmediacontrol_iid<Class *>() { return IId; }
diff --git a/src/multimedia/qmediametadata.cpp b/src/multimedia/qmediametadata.cpp
index 0f3d3defd..0b2343443 100644
--- a/src/multimedia/qmediametadata.cpp
+++ b/src/multimedia/qmediametadata.cpp
@@ -105,6 +105,7 @@ Q_DEFINE_METADATA(CoverArtUrlLarge);
// Image/Video
Q_DEFINE_METADATA(Resolution);
Q_DEFINE_METADATA(PixelAspectRatio);
+Q_DEFINE_METADATA(Orientation);
// Video
Q_DEFINE_METADATA(VideoFrameRate);
@@ -124,7 +125,6 @@ Q_DEFINE_METADATA(CameraManufacturer);
Q_DEFINE_METADATA(CameraModel);
Q_DEFINE_METADATA(Event);
Q_DEFINE_METADATA(Subject);
-Q_DEFINE_METADATA(Orientation);
Q_DEFINE_METADATA(ExposureTime);
Q_DEFINE_METADATA(FNumber);
Q_DEFINE_METADATA(ExposureProgram);
@@ -239,6 +239,7 @@ Q_DEFINE_METADATA(ThumbnailImage);
Image and video attributes
\row \li Resolution \li The dimensions of an image or video. \li QSize
\row \li PixelAspectRatio \li The pixel aspect ratio of an image or video. \li QSize
+ \row \li Orientation \li Orientation of an image or video. \li int (degrees)
\header \li {3,1}
Video attributes
@@ -262,7 +263,6 @@ Q_DEFINE_METADATA(ThumbnailImage);
\row \li CameraModel \li The model of the camera used to capture the media. \li QString
\row \li Event \li The event during which the media was captured. \li QString
\row \li Subject \li The subject of the media. \li QString
- \row \li Orientation \li Orientation of image. \li int (degrees)
\row \li ExposureTime \li Exposure time, given in seconds. \li qreal
\row \li FNumber \li The F Number. \li int
\row \li ExposureProgram
diff --git a/src/multimedia/qmediaobject.cpp b/src/multimedia/qmediaobject.cpp
index 71b2d148c..a12cab404 100644
--- a/src/multimedia/qmediaobject.cpp
+++ b/src/multimedia/qmediaobject.cpp
@@ -127,7 +127,7 @@ QMediaObject::~QMediaObject()
QMultimedia::AvailabilityStatus QMediaObject::availability() const
{
- if (d_func()->service == 0)
+ if (d_func()->service == nullptr)
return QMultimedia::ServiceMissing;
if (d_func()->availabilityControl)
@@ -216,7 +216,7 @@ void QMediaObject::unbind(QObject *object)
QMediaBindableInterface *helper = qobject_cast<QMediaBindableInterface*>(object);
if (helper && helper->mediaObject() == this)
- helper->setMediaObject(0);
+ helper->setMediaObject(nullptr);
else
qWarning() << "QMediaObject: Trying to unbind not connected helper object";
}
@@ -395,7 +395,7 @@ void QMediaObject::setupControls()
{
Q_D(QMediaObject);
- if (d->service != 0) {
+ if (d->service != nullptr) {
d->metaDataControl = qobject_cast<QMetaDataReaderControl*>(
d->service->requestControl(QMetaDataReaderControl_iid));
diff --git a/src/multimedia/qmediaobject_p.h b/src/multimedia/qmediaobject_p.h
index 3e663e03d..85caf9a50 100644
--- a/src/multimedia/qmediaobject_p.h
+++ b/src/multimedia/qmediaobject_p.h
@@ -73,7 +73,7 @@ class QMediaObjectPrivate
Q_DECLARE_PUBLIC(QMediaObject)
public:
- QMediaObjectPrivate(): service(0), metaDataControl(0), availabilityControl(0), notifyTimer(0), q_ptr(0) {}
+ QMediaObjectPrivate() : service(nullptr), metaDataControl(nullptr), availabilityControl(nullptr), notifyTimer(nullptr), q_ptr(nullptr) {}
virtual ~QMediaObjectPrivate() {}
void _q_notify();
diff --git a/src/multimedia/qmediapluginloader.cpp b/src/multimedia/qmediapluginloader.cpp
index bd3c525f4..78ba3207f 100644
--- a/src/multimedia/qmediapluginloader.cpp
+++ b/src/multimedia/qmediapluginloader.cpp
@@ -68,11 +68,11 @@ QStringList QMediaPluginLoader::keys() const
QObject* QMediaPluginLoader::instance(QString const &key)
{
if (!m_metadata.contains(key))
- return 0;
+ return nullptr;
int idx = m_metadata.value(key).first().value(QStringLiteral("index")).toDouble();
if (idx < 0)
- return 0;
+ return nullptr;
return m_factoryLoader->instance(idx);
}
@@ -82,6 +82,7 @@ QList<QObject*> QMediaPluginLoader::instances(QString const &key)
if (!m_metadata.contains(key))
return QList<QObject*>();
+ QList<QString> keys;
QList<QObject *> objects;
const auto list = m_metadata.value(key);
for (const QJsonObject &jsonobj : list) {
@@ -91,10 +92,39 @@ QList<QObject*> QMediaPluginLoader::instances(QString const &key)
QObject *object = m_factoryLoader->instance(idx);
if (!objects.contains(object)) {
+ QJsonArray arr = jsonobj.value(QStringLiteral("Keys")).toArray();
+ keys.append(!arr.isEmpty() ? arr.at(0).toString() : QStringLiteral(""));
objects.append(object);
}
}
+ static const bool showDebug = qEnvironmentVariableIntValue("QT_DEBUG_PLUGINS");
+ static const QStringList preferredPlugins =
+ qEnvironmentVariable("QT_MULTIMEDIA_PREFERRED_PLUGINS").split(QLatin1Char(','), QString::SkipEmptyParts);
+ for (int i = preferredPlugins.size() - 1; i >= 0; --i) {
+ auto name = preferredPlugins[i];
+ bool found = false;
+ for (int j = 0; j < keys.size(); ++j) {
+ if (!keys[j].startsWith(name))
+ continue;
+
+ auto obj = objects[j];
+ objects.removeAt(j);
+ objects.prepend(obj);
+ auto k = keys[j];
+ keys.removeAt(j);
+ keys.prepend(k);
+ found = true;
+ break;
+ }
+
+ if (showDebug && !found)
+ qWarning() << "QMediaPluginLoader: pattern" << name << "did not match any loaded plugin";
+ }
+
+ if (showDebug)
+ qDebug() << "QMediaPluginLoader: loaded plugins for key" << key << ":" << keys;
+
return objects;
}
diff --git a/src/multimedia/qmediaresourcepolicy_p.cpp b/src/multimedia/qmediaresourcepolicy_p.cpp
index 1577f11af..14dc15968 100644
--- a/src/multimedia/qmediaresourcepolicy_p.cpp
+++ b/src/multimedia/qmediaresourcepolicy_p.cpp
@@ -84,7 +84,7 @@ QObject* QMediaResourcePolicy::createResourceSet(const QString& interfaceId)
QMediaResourceSetFactoryInterface *factory =
qobject_cast<QMediaResourceSetFactoryInterface*>(resourcePolicyLoader()
->instance(QLatin1String("default")));
- QObject* obj = 0;
+ QObject *obj = nullptr;
if (factory)
obj = factory->create(interfaceId);
diff --git a/src/multimedia/qmediaresourcepolicyplugin_p.h b/src/multimedia/qmediaresourcepolicyplugin_p.h
index 7b53c3b3a..e37551390 100644
--- a/src/multimedia/qmediaresourcepolicyplugin_p.h
+++ b/src/multimedia/qmediaresourcepolicyplugin_p.h
@@ -72,7 +72,7 @@ class Q_MULTIMEDIA_EXPORT QMediaResourcePolicyPlugin : public QObject, public QM
Q_INTERFACES(QMediaResourceSetFactoryInterface)
public:
- QMediaResourcePolicyPlugin(QObject *parent = 0);
+ QMediaResourcePolicyPlugin(QObject *parent = nullptr);
~QMediaResourcePolicyPlugin();
};
diff --git a/src/multimedia/qmediaresourceset_p.h b/src/multimedia/qmediaresourceset_p.h
index a0158877f..5ad4ca7aa 100644
--- a/src/multimedia/qmediaresourceset_p.h
+++ b/src/multimedia/qmediaresourceset_p.h
@@ -80,7 +80,7 @@ Q_SIGNALS:
void availabilityChanged(bool available);
protected:
- QMediaPlayerResourceSetInterface(QObject *parent = 0);
+ QMediaPlayerResourceSetInterface(QObject *parent = nullptr);
};
QT_END_NAMESPACE
diff --git a/src/multimedia/qmediaserviceprovider.cpp b/src/multimedia/qmediaserviceprovider.cpp
index 21e34bd49..023c13008 100644
--- a/src/multimedia/qmediaserviceprovider.cpp
+++ b/src/multimedia/qmediaserviceprovider.cpp
@@ -56,7 +56,7 @@ class QMediaServiceProviderHintPrivate : public QSharedData
{
public:
QMediaServiceProviderHintPrivate(QMediaServiceProviderHint::Type type)
- :type(type), cameraPosition(QCamera::UnspecifiedPosition), features(0)
+ :type(type), cameraPosition(QCamera::UnspecifiedPosition), features(nullptr)
{
}
@@ -309,7 +309,7 @@ class QPluginServiceProvider : public QMediaServiceProvider
QByteArray type;
QMediaServiceProviderPlugin *plugin;
- MediaServiceData() : plugin(0) { }
+ MediaServiceData() : plugin(nullptr) { }
};
QMap<const QMediaService*, MediaServiceData> mediaServiceData;
@@ -329,7 +329,7 @@ public:
}
if (!plugins.isEmpty()) {
- QMediaServiceProviderPlugin *plugin = 0;
+ QMediaServiceProviderPlugin *plugin = nullptr;
switch (hint.type()) {
case QMediaServiceProviderHint::Null:
@@ -423,9 +423,9 @@ public:
break;
}
- if (plugin != 0) {
+ if (plugin != nullptr) {
QMediaService *service = plugin->create(key);
- if (service != 0) {
+ if (service != nullptr) {
MediaServiceData d;
d.type = type;
d.plugin = plugin;
@@ -437,15 +437,15 @@ public:
}
qWarning() << "defaultServiceProvider::requestService(): no service found for -" << key;
- return 0;
+ return nullptr;
}
void releaseService(QMediaService *service) override
{
- if (service != 0) {
+ if (service != nullptr) {
MediaServiceData d = mediaServiceData.take(service);
- if (d.plugin != 0)
+ if (d.plugin != nullptr)
d.plugin->release(service);
}
}
@@ -576,8 +576,11 @@ public:
const QMediaServiceDefaultDeviceInterface *iface =
qobject_cast<QMediaServiceDefaultDeviceInterface*>(obj);
- if (iface)
- return iface->defaultDevice(serviceType);
+ if (iface) {
+ QByteArray name = iface->defaultDevice(serviceType);
+ if (!name.isEmpty())
+ return name;
+ }
}
// if QMediaServiceDefaultDeviceInterface is not implemented, return the
@@ -704,7 +707,7 @@ QMediaServiceProviderHint::Features QMediaServiceProvider::supportedFeatures(con
{
Q_UNUSED(service);
- return QMediaServiceProviderHint::Features(0);
+ return QMediaServiceProviderHint::Features(nullptr);
}
/*!
@@ -798,7 +801,7 @@ int QMediaServiceProvider::cameraOrientation(const QByteArray &device) const
return 0;
}
-static QMediaServiceProvider *qt_defaultMediaServiceProvider = 0;
+static QMediaServiceProvider *qt_defaultMediaServiceProvider = nullptr;
/*!
Sets a media service \a provider as the default.
@@ -817,7 +820,7 @@ void QMediaServiceProvider::setDefaultServiceProvider(QMediaServiceProvider *pro
*/
QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider()
{
- return qt_defaultMediaServiceProvider != 0
+ return qt_defaultMediaServiceProvider != nullptr
? qt_defaultMediaServiceProvider
: static_cast<QMediaServiceProvider *>(pluginProvider());
}
diff --git a/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h b/src/multimedia/qtmultimediaquicktools_headers/qdeclarativevideooutput_p.h
index 465821cb1..8ea0dc338 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 REVISION 13)
+ 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/radio/qradiodata.cpp b/src/multimedia/radio/qradiodata.cpp
index 9ed6cb522..d71488b52 100644
--- a/src/multimedia/radio/qradiodata.cpp
+++ b/src/multimedia/radio/qradiodata.cpp
@@ -95,14 +95,14 @@ public:
};
QRadioDataPrivate::QRadioDataPrivate()
- : mediaObject(0)
- , control(0)
+ : mediaObject(nullptr)
+ , control(nullptr)
{}
void QRadioDataPrivate::_q_serviceDestroyed()
{
- mediaObject = 0;
- control = 0;
+ mediaObject = nullptr;
+ control = nullptr;
}
/*!
@@ -211,8 +211,8 @@ bool QRadioData::setMediaObject(QMediaObject *mediaObject)
}
// without QRadioDataControl discard the media object
- d->mediaObject = 0;
- d->control = 0;
+ d->mediaObject = nullptr;
+ d->control = nullptr;
return false;
}
@@ -228,7 +228,7 @@ QMultimedia::AvailabilityStatus QRadioData::availability() const
{
Q_D(const QRadioData);
- if (d->control == 0)
+ if (d->control == nullptr)
return QMultimedia::ServiceMissing;
return d->mediaObject->availability();
@@ -244,7 +244,7 @@ QString QRadioData::stationId() const
{
Q_D(const QRadioData);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->stationId();
return QString();
}
@@ -259,7 +259,7 @@ QRadioData::ProgramType QRadioData::programType() const
{
Q_D(const QRadioData);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->programType();
return QRadioData::Undefined;
@@ -275,7 +275,7 @@ QString QRadioData::programTypeName() const
{
Q_D(const QRadioData);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->programTypeName();
return QString();
}
@@ -290,7 +290,7 @@ QString QRadioData::stationName() const
{
Q_D(const QRadioData);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->stationName();
return QString();
}
@@ -305,7 +305,7 @@ QString QRadioData::radioText() const
{
Q_D(const QRadioData);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->radioText();
return QString();
}
@@ -320,7 +320,7 @@ bool QRadioData::isAlternativeFrequenciesEnabled() const
{
Q_D(const QRadioData);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isAlternativeFrequenciesEnabled();
return false;
}
@@ -329,7 +329,7 @@ void QRadioData::setAlternativeFrequenciesEnabled( bool enabled )
{
Q_D(const QRadioData);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->setAlternativeFrequenciesEnabled(enabled);
}
@@ -343,7 +343,7 @@ QRadioData::Error QRadioData::error() const
{
Q_D(const QRadioData);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->error();
return QRadioData::ResourceError;
}
@@ -357,7 +357,7 @@ QString QRadioData::errorString() const
{
Q_D(const QRadioData);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->errorString();
return QString();
}
diff --git a/src/multimedia/radio/qradiotuner.cpp b/src/multimedia/radio/qradiotuner.cpp
index 3206b4ee5..cc9abdbf8 100644
--- a/src/multimedia/radio/qradiotuner.cpp
+++ b/src/multimedia/radio/qradiotuner.cpp
@@ -88,7 +88,7 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterRadioTunerMetaTypes)
class QRadioTunerPrivate : public QMediaObjectPrivate
{
public:
- QRadioTunerPrivate():provider(0), control(0), radioData(0) {}
+ QRadioTunerPrivate():provider(nullptr), control(nullptr), radioData(nullptr) {}
QMediaServiceProvider *provider;
QRadioTunerControl* control;
QRadioData *radioData;
@@ -112,9 +112,9 @@ QRadioTuner::QRadioTuner(QObject *parent):
d->provider = QMediaServiceProvider::defaultServiceProvider();
- if (d->service != 0) {
+ if (d->service != nullptr) {
d->control = qobject_cast<QRadioTunerControl*>(d->service->requestControl(QRadioTunerControl_iid));
- if (d->control != 0) {
+ if (d->control != nullptr) {
connect(d->control, SIGNAL(stateChanged(QRadioTuner::State)), SIGNAL(stateChanged(QRadioTuner::State)));
connect(d->control, SIGNAL(bandChanged(QRadioTuner::Band)), SIGNAL(bandChanged(QRadioTuner::Band)));
connect(d->control, SIGNAL(frequencyChanged(int)), SIGNAL(frequencyChanged(int)));
@@ -154,7 +154,7 @@ QRadioTuner::~QRadioTuner()
*/
QMultimedia::AvailabilityStatus QRadioTuner::availability() const
{
- if (d_func()->control == 0)
+ if (d_func()->control == nullptr)
return QMultimedia::ServiceMissing;
if (!d_func()->control->isAntennaConnected())
@@ -187,7 +187,7 @@ QRadioTuner::Band QRadioTuner::band() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->band();
return QRadioTuner::FM;
@@ -202,7 +202,7 @@ int QRadioTuner::frequency() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->frequency();
return 0;
@@ -217,7 +217,7 @@ int QRadioTuner::frequencyStep(QRadioTuner::Band band) const
{
Q_D(const QRadioTuner);
- if(d->control != 0)
+ if (d->control != nullptr)
return d->control->frequencyStep(band);
return 0;
@@ -231,7 +231,7 @@ QPair<int,int> QRadioTuner::frequencyRange(QRadioTuner::Band band) const
{
Q_D(const QRadioTuner);
- if(d->control != 0)
+ if (d->control != nullptr)
return d->control->frequencyRange(band);
return qMakePair<int,int>(0,0);
@@ -246,7 +246,7 @@ bool QRadioTuner::isStereo() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isStereo();
return false;
@@ -262,7 +262,7 @@ QRadioTuner::StereoMode QRadioTuner::stereoMode() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->stereoMode();
return QRadioTuner::Auto;
@@ -272,7 +272,7 @@ void QRadioTuner::setStereoMode(QRadioTuner::StereoMode mode)
{
Q_D(QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->setStereoMode(mode);
}
@@ -286,7 +286,7 @@ bool QRadioTuner::isBandSupported(QRadioTuner::Band band) const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isBandSupported(band);
return false;
@@ -300,7 +300,7 @@ void QRadioTuner::start()
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->start();
}
@@ -312,7 +312,7 @@ void QRadioTuner::stop()
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->stop();
}
@@ -325,7 +325,7 @@ int QRadioTuner::signalStrength() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->signalStrength();
return 0;
@@ -341,7 +341,7 @@ int QRadioTuner::volume() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->volume();
return 0;
@@ -356,7 +356,7 @@ bool QRadioTuner::isMuted() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isMuted();
return false;
@@ -372,7 +372,7 @@ void QRadioTuner::setBand(QRadioTuner::Band band)
{
Q_D(QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->setBand(band);
}
@@ -387,7 +387,7 @@ void QRadioTuner::setFrequency(int frequency)
{
Q_D(QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->setFrequency(frequency);
}
@@ -395,7 +395,7 @@ void QRadioTuner::setVolume(int volume)
{
Q_D(QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->setVolume(volume);
}
@@ -403,7 +403,7 @@ void QRadioTuner::setMuted(bool muted)
{
Q_D(QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->setMuted(muted);
}
@@ -418,7 +418,7 @@ bool QRadioTuner::isSearching() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isSearching();
return false;
@@ -432,7 +432,7 @@ bool QRadioTuner::isAntennaConnected() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->isAntennaConnected();
return false;
@@ -448,7 +448,7 @@ void QRadioTuner::searchForward()
{
Q_D(QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->searchForward();
}
@@ -462,7 +462,7 @@ void QRadioTuner::searchBackward()
{
Q_D(QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->searchBackward();
}
@@ -490,7 +490,7 @@ void QRadioTuner::searchAllStations(QRadioTuner::SearchMode searchMode)
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->searchAllStations(searchMode);
}
@@ -504,7 +504,7 @@ void QRadioTuner::cancelSearch()
{
Q_D(QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
d->control->cancelSearch();
}
@@ -518,7 +518,7 @@ QRadioTuner::Error QRadioTuner::error() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->error();
return QRadioTuner::ResourceError;
@@ -534,7 +534,7 @@ QString QRadioTuner::errorString() const
{
Q_D(const QRadioTuner);
- if (d->control != 0)
+ if (d->control != nullptr)
return d->control->errorString();
return QString();
diff --git a/src/multimedia/recording/qaudiorecorder.cpp b/src/multimedia/recording/qaudiorecorder.cpp
index 1d3e5ba7f..dcbdabc17 100644
--- a/src/multimedia/recording/qaudiorecorder.cpp
+++ b/src/multimedia/recording/qaudiorecorder.cpp
@@ -96,11 +96,11 @@ public:
void initControls()
{
Q_Q(QAudioRecorder);
- audioInputSelector = 0;
+ audioInputSelector = nullptr;
- QMediaService *service = mediaObject ? mediaObject->service() : 0;
+ QMediaService *service = mediaObject ? mediaObject->service() : nullptr;
- if (service != 0)
+ if (service != nullptr)
audioInputSelector = qobject_cast<QAudioInputSelectorControl*>(service->requestControl(QAudioInputSelectorControl_iid));
if (audioInputSelector) {
@@ -113,8 +113,8 @@ public:
QAudioRecorderPrivate():
QMediaRecorderPrivate(),
- provider(0),
- audioInputSelector(0) {}
+ provider(nullptr),
+ audioInputSelector(nullptr) {}
QMediaServiceProvider *provider;
QAudioInputSelectorControl *audioInputSelector;
@@ -128,7 +128,7 @@ public:
*/
QAudioRecorder::QAudioRecorder(QObject *parent):
- QMediaRecorder(*new QAudioRecorderPrivate, 0, parent)
+ QMediaRecorder(*new QAudioRecorderPrivate, nullptr, parent)
{
Q_D(QAudioRecorder);
d->provider = QMediaServiceProvider::defaultServiceProvider();
@@ -145,9 +145,9 @@ QAudioRecorder::QAudioRecorder(QObject *parent):
QAudioRecorder::~QAudioRecorder()
{
Q_D(QAudioRecorder);
- QMediaService *service = d->mediaObject ? d->mediaObject->service() : 0;
+ QMediaService *service = d->mediaObject ? d->mediaObject->service() : nullptr;
QMediaObject *mediaObject = d->mediaObject;
- setMediaObject(0);
+ setMediaObject(nullptr);
if (service && d->audioInputSelector)
service->releaseControl(d->audioInputSelector);
diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp
index 3bab3dada..2b7729481 100644
--- a/src/multimedia/recording/qmediarecorder.cpp
+++ b/src/multimedia/recording/qmediarecorder.cpp
@@ -89,15 +89,15 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterMediaRecorderMetaTypes)
QMediaRecorderPrivate::QMediaRecorderPrivate():
- mediaObject(0),
- control(0),
- formatControl(0),
- audioControl(0),
- videoControl(0),
- metaDataControl(0),
- availabilityControl(0),
+ mediaObject(nullptr),
+ control(nullptr),
+ formatControl(nullptr),
+ audioControl(nullptr),
+ videoControl(nullptr),
+ metaDataControl(nullptr),
+ availabilityControl(nullptr),
settingsChanged(false),
- notifyTimer(0),
+ notifyTimer(nullptr),
state(QMediaRecorder::StoppedState),
error(QMediaRecorder::NoError)
{
@@ -135,13 +135,13 @@ void QMediaRecorderPrivate::_q_error(int error, const QString &errorString)
void QMediaRecorderPrivate::_q_serviceDestroyed()
{
- mediaObject = 0;
- control = 0;
- formatControl = 0;
- audioControl = 0;
- videoControl = 0;
- metaDataControl = 0;
- availabilityControl = 0;
+ mediaObject = nullptr;
+ control = nullptr;
+ formatControl = nullptr;
+ audioControl = nullptr;
+ videoControl = nullptr;
+ metaDataControl = nullptr;
+ availabilityControl = nullptr;
settingsChanged = true;
}
@@ -328,12 +328,12 @@ bool QMediaRecorder::setMediaObject(QMediaObject *object)
}
}
- d->control = 0;
- d->formatControl = 0;
- d->audioControl = 0;
- d->videoControl = 0;
- d->metaDataControl = 0;
- d->availabilityControl = 0;
+ d->control = nullptr;
+ d->formatControl = nullptr;
+ d->audioControl = nullptr;
+ d->videoControl = nullptr;
+ d->metaDataControl = nullptr;
+ d->availabilityControl = nullptr;
d->mediaObject = object;
@@ -407,7 +407,7 @@ bool QMediaRecorder::setMediaObject(QMediaObject *object)
}
}
- d->mediaObject = 0;
+ d->mediaObject = nullptr;
return false;
}
@@ -453,7 +453,7 @@ bool QMediaRecorder::isAvailable() const
*/
QMultimedia::AvailabilityStatus QMediaRecorder::availability() const
{
- if (d_func()->control == NULL)
+ if (d_func()->control == nullptr)
return QMultimedia::ServiceMissing;
if (d_func()->availabilityControl)
diff --git a/src/multimedia/video/qabstractvideobuffer.cpp b/src/multimedia/video/qabstractvideobuffer.cpp
index 50e38a98c..f0dd6d2eb 100644
--- a/src/multimedia/video/qabstractvideobuffer.cpp
+++ b/src/multimedia/video/qabstractvideobuffer.cpp
@@ -126,7 +126,7 @@ int QAbstractVideoBufferPrivate::map(
Constructs an abstract video buffer of the given \a type.
*/
QAbstractVideoBuffer::QAbstractVideoBuffer(HandleType type)
- : d_ptr(0)
+ : d_ptr(nullptr)
, m_type(type)
{
}
@@ -328,7 +328,7 @@ uchar *QAbstractPlanarVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPe
*bytesPerLine = strides[0];
return data[0];
} else {
- return 0;
+ return nullptr;
}
}
diff --git a/src/multimedia/video/qabstractvideobuffer_p.h b/src/multimedia/video/qabstractvideobuffer_p.h
index 9e3ced9b5..4877d3120 100644
--- a/src/multimedia/video/qabstractvideobuffer_p.h
+++ b/src/multimedia/video/qabstractvideobuffer_p.h
@@ -64,7 +64,7 @@ class QAbstractVideoBufferPrivate
{
public:
QAbstractVideoBufferPrivate()
- : q_ptr(0)
+ : q_ptr(nullptr)
{}
virtual ~QAbstractVideoBufferPrivate()
diff --git a/src/multimedia/video/qimagevideobuffer.cpp b/src/multimedia/video/qimagevideobuffer.cpp
index f407e02d0..28dacefc6 100644
--- a/src/multimedia/video/qimagevideobuffer.cpp
+++ b/src/multimedia/video/qimagevideobuffer.cpp
@@ -96,7 +96,7 @@ uchar *QImageVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine)
return d->image.bits();
} else {
- return 0;
+ return nullptr;
}
}
diff --git a/src/multimedia/video/qmemoryvideobuffer.cpp b/src/multimedia/video/qmemoryvideobuffer.cpp
index 1b52bb7cd..e05210d9d 100644
--- a/src/multimedia/video/qmemoryvideobuffer.cpp
+++ b/src/multimedia/video/qmemoryvideobuffer.cpp
@@ -112,7 +112,7 @@ uchar *QMemoryVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine)
return reinterpret_cast<uchar *>(d->data.data());
} else {
- return 0;
+ return nullptr;
}
}
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp
index bbb87b63b..e94b838f9 100644
--- a/src/multimedia/video/qvideoframe.cpp
+++ b/src/multimedia/video/qvideoframe.cpp
@@ -75,7 +75,7 @@ public:
, planeCount(0)
, pixelFormat(QVideoFrame::Format_Invalid)
, fieldType(QVideoFrame::ProgressiveFrame)
- , buffer(0)
+ , buffer(nullptr)
, mappedCount(0)
{
memset(data, 0, sizeof(data));
@@ -90,7 +90,7 @@ public:
, planeCount(0)
, pixelFormat(format)
, fieldType(QVideoFrame::ProgressiveFrame)
- , buffer(0)
+ , buffer(nullptr)
, mappedCount(0)
{
memset(data, 0, sizeof(data));
@@ -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).
@@ -401,6 +404,15 @@ QVideoFrame::~QVideoFrame()
}
/*!
+ \return underlying video buffer or \c null if there is none.
+ \since 5.13
+*/
+QAbstractVideoBuffer *QVideoFrame::buffer() const
+{
+ return d->buffer;
+}
+
+/*!
Identifies whether a video frame is valid.
An invalid frame has no video buffer associated with it.
@@ -409,7 +421,7 @@ QVideoFrame::~QVideoFrame()
*/
bool QVideoFrame::isValid() const
{
- return d->buffer != 0;
+ return d->buffer != nullptr;
}
/*!
@@ -485,7 +497,7 @@ void QVideoFrame::setFieldType(QVideoFrame::FieldType field)
bool QVideoFrame::isMapped() const
{
- return d->buffer != 0 && d->buffer->mapMode() != QAbstractVideoBuffer::NotMapped;
+ return d->buffer != nullptr && d->buffer->mapMode() != QAbstractVideoBuffer::NotMapped;
}
/*!
@@ -504,7 +516,7 @@ bool QVideoFrame::isMapped() const
*/
bool QVideoFrame::isWritable() const
{
- return d->buffer != 0 && (d->buffer->mapMode() & QAbstractVideoBuffer::WriteOnly);
+ return d->buffer != nullptr && (d->buffer->mapMode() & QAbstractVideoBuffer::WriteOnly);
}
/*!
@@ -520,7 +532,7 @@ bool QVideoFrame::isWritable() const
*/
bool QVideoFrame::isReadable() const
{
- return d->buffer != 0 && (d->buffer->mapMode() & QAbstractVideoBuffer::ReadOnly);
+ return d->buffer != nullptr && (d->buffer->mapMode() & QAbstractVideoBuffer::ReadOnly);
}
/*!
@@ -530,7 +542,7 @@ bool QVideoFrame::isReadable() const
*/
QAbstractVideoBuffer::MapMode QVideoFrame::mapMode() const
{
- return d->buffer != 0 ? d->buffer->mapMode() : QAbstractVideoBuffer::NotMapped;
+ return d->buffer != nullptr ? d->buffer->mapMode() : QAbstractVideoBuffer::NotMapped;
}
/*!
@@ -584,7 +596,7 @@ bool QVideoFrame::map(QAbstractVideoBuffer::MapMode mode)
}
}
- Q_ASSERT(d->data[0] == 0);
+ Q_ASSERT(d->data[0] == nullptr);
Q_ASSERT(d->bytesPerLine[0] == 0);
Q_ASSERT(d->planeCount == 0);
Q_ASSERT(d->mappedBytes == 0);
@@ -606,6 +618,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:
@@ -763,7 +776,7 @@ uchar *QVideoFrame::bits()
*/
uchar *QVideoFrame::bits(int plane)
{
- return plane >= 0 && plane < d->planeCount ? d->data[plane] : 0;
+ return plane >= 0 && plane < d->planeCount ? d->data[plane] : nullptr;
}
/*!
@@ -794,7 +807,7 @@ const uchar *QVideoFrame::bits() const
*/
const uchar *QVideoFrame::bits(int plane) const
{
- return plane >= 0 && plane < d->planeCount ? d->data[plane] : 0;
+ return plane >= 0 && plane < d->planeCount ? d->data[plane] : nullptr;
}
/*!
@@ -832,7 +845,7 @@ int QVideoFrame::planeCount() const
*/
QVariant QVideoFrame::handle() const
{
- return d->buffer != 0 ? d->buffer->handle() : QVariant();
+ return d->buffer != nullptr ? d->buffer->handle() : QVariant();
}
/*!
@@ -1035,6 +1048,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,
@@ -1102,7 +1116,7 @@ QImage qt_imageFromVideoFrame(const QVideoFrame &f)
// Formats supported by QImage don't need conversion
QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(frame.pixelFormat());
if (imageFormat != QImage::Format_Invalid) {
- result = QImage(frame.bits(), frame.width(), frame.height(), imageFormat).copy();
+ result = QImage(frame.bits(), frame.width(), frame.height(), frame.bytesPerLine(), imageFormat).copy();
}
// Load from JPG
@@ -1157,6 +1171,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..375f80dac 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,
@@ -119,6 +120,7 @@ public:
bool operator==(const QVideoFrame &other) const;
bool operator!=(const QVideoFrame &other) const;
+ QAbstractVideoBuffer *buffer() const;
bool isValid() const;
PixelFormat pixelFormat() const;
diff --git a/src/multimedia/video/qvideooutputorientationhandler_p.h b/src/multimedia/video/qvideooutputorientationhandler_p.h
index b5cfc089b..d04a781ab 100644
--- a/src/multimedia/video/qvideooutputorientationhandler_p.h
+++ b/src/multimedia/video/qvideooutputorientationhandler_p.h
@@ -61,7 +61,7 @@ class Q_MULTIMEDIA_EXPORT QVideoOutputOrientationHandler : public QObject
{
Q_OBJECT
public:
- explicit QVideoOutputOrientationHandler(QObject *parent = 0);
+ explicit QVideoOutputOrientationHandler(QObject *parent = nullptr);
int currentOrientation() const;
diff --git a/src/multimedia/video/qvideoprobe.cpp b/src/multimedia/video/qvideoprobe.cpp
index b1531df63..f7995b297 100644
--- a/src/multimedia/video/qvideoprobe.cpp
+++ b/src/multimedia/video/qvideoprobe.cpp
@@ -161,7 +161,7 @@ bool QVideoProbe::setSource(QMediaObject *source)
}
}
- return (!source || d->probee != 0);
+ return (!source || d->probee != nullptr);
}
/*!
@@ -179,7 +179,7 @@ bool QVideoProbe::setSource(QMediaObject *source)
*/
bool QVideoProbe::setSource(QMediaRecorder *mediaRecorder)
{
- QMediaObject *source = mediaRecorder ? mediaRecorder->mediaObject() : 0;
+ QMediaObject *source = mediaRecorder ? mediaRecorder->mediaObject() : nullptr;
bool result = setSource(source);
if (!mediaRecorder)
@@ -198,7 +198,7 @@ bool QVideoProbe::setSource(QMediaRecorder *mediaRecorder)
*/
bool QVideoProbe::isActive() const
{
- return d->probee != 0;
+ return d->probee != nullptr;
}
/*!
diff --git a/src/multimedia/video/qvideosurfaceoutput.cpp b/src/multimedia/video/qvideosurfaceoutput.cpp
index feb956dd0..ebc9e1cb6 100644
--- a/src/multimedia/video/qvideosurfaceoutput.cpp
+++ b/src/multimedia/video/qvideosurfaceoutput.cpp
@@ -55,7 +55,7 @@ QVideoSurfaceOutput::QVideoSurfaceOutput(QObject*parent)
QVideoSurfaceOutput::~QVideoSurfaceOutput()
{
if (m_control) {
- m_control.data()->setSurface(0);
+ m_control.data()->setSurface(nullptr);
m_service.data()->releaseControl(m_control.data());
}
}
@@ -76,7 +76,7 @@ void QVideoSurfaceOutput::setVideoSurface(QAbstractVideoSurface *surface)
bool QVideoSurfaceOutput::setMediaObject(QMediaObject *object)
{
if (m_control) {
- m_control.data()->setSurface(0);
+ m_control.data()->setSurface(nullptr);
m_service.data()->releaseControl(m_control.data());
}
m_control.clear();
diff --git a/src/multimedia/video/qvideosurfaceoutput_p.h b/src/multimedia/video/qvideosurfaceoutput_p.h
index a1b24abbf..5d050bcb0 100644
--- a/src/multimedia/video/qvideosurfaceoutput_p.h
+++ b/src/multimedia/video/qvideosurfaceoutput_p.h
@@ -67,7 +67,7 @@ class QVideoSurfaceOutput : public QObject, public QMediaBindableInterface
Q_OBJECT
Q_INTERFACES(QMediaBindableInterface)
public:
- QVideoSurfaceOutput(QObject*parent = 0);
+ QVideoSurfaceOutput(QObject *parent = nullptr);
~QVideoSurfaceOutput();
QMediaObject *mediaObject() const override;