summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/audio/qaudiohelpers.cpp6
-rw-r--r--src/multimedia/audio/qsamplecache_p.cpp2
-rw-r--r--src/multimedia/audio/qsoundeffect_pulse_p.cpp19
-rw-r--r--src/multimedia/camera/qcamera.cpp11
-rw-r--r--src/multimedia/camera/qcamera.h3
-rw-r--r--src/multimedia/camera/qcameraimagecapture.cpp9
-rw-r--r--src/multimedia/configure.json19
-rw-r--r--src/multimedia/controls/qaudiodecodercontrol.cpp1
-rw-r--r--src/multimedia/controls/qaudioencodersettingscontrol.cpp1
-rw-r--r--src/multimedia/controls/qaudioinputselectorcontrol.cpp1
-rw-r--r--src/multimedia/controls/qaudiooutputselectorcontrol.cpp1
-rw-r--r--src/multimedia/controls/qaudiorolecontrol.cpp1
-rw-r--r--src/multimedia/controls/qcameracapturebufferformatcontrol.cpp1
-rw-r--r--src/multimedia/controls/qcameracapturedestinationcontrol.cpp1
-rw-r--r--src/multimedia/controls/qcameracontrol.cpp1
-rw-r--r--src/multimedia/controls/qcameraexposurecontrol.cpp1
-rw-r--r--src/multimedia/controls/qcamerafeedbackcontrol.cpp1
-rw-r--r--src/multimedia/controls/qcameraflashcontrol.cpp1
-rw-r--r--src/multimedia/controls/qcamerafocuscontrol.cpp1
-rw-r--r--src/multimedia/controls/qcameraimagecapturecontrol.cpp1
-rw-r--r--src/multimedia/controls/qcameraimageprocessingcontrol.cpp1
-rw-r--r--src/multimedia/controls/qcamerainfocontrol.cpp1
-rw-r--r--src/multimedia/controls/qcameralockscontrol.cpp1
-rw-r--r--src/multimedia/controls/qcameraviewfindersettingscontrol.cpp1
-rw-r--r--src/multimedia/controls/qcamerazoomcontrol.cpp1
-rw-r--r--src/multimedia/controls/qcustomaudiorolecontrol.cpp1
-rw-r--r--src/multimedia/controls/qimageencodercontrol.cpp1
-rw-r--r--src/multimedia/controls/qmediaaudioprobecontrol.cpp1
-rw-r--r--src/multimedia/controls/qmediaavailabilitycontrol.cpp1
-rw-r--r--src/multimedia/controls/qmediacontainercontrol.cpp1
-rw-r--r--src/multimedia/controls/qmediagaplessplaybackcontrol.cpp1
-rw-r--r--src/multimedia/controls/qmedianetworkaccesscontrol.cpp7
-rw-r--r--src/multimedia/controls/qmedianetworkaccesscontrol.h15
-rw-r--r--src/multimedia/controls/qmediaplayercontrol.cpp1
-rw-r--r--src/multimedia/controls/qmediarecordercontrol.cpp1
-rw-r--r--src/multimedia/controls/qmediastreamscontrol.cpp1
-rw-r--r--src/multimedia/controls/qmediavideoprobecontrol.cpp1
-rw-r--r--src/multimedia/controls/qmetadatareadercontrol.cpp1
-rw-r--r--src/multimedia/controls/qmetadatawritercontrol.cpp1
-rw-r--r--src/multimedia/controls/qradiodatacontrol.cpp1
-rw-r--r--src/multimedia/controls/qradiotunercontrol.cpp2
-rw-r--r--src/multimedia/controls/qvideodeviceselectorcontrol.cpp1
-rw-r--r--src/multimedia/controls/qvideoencodersettingscontrol.cpp1
-rw-r--r--src/multimedia/controls/qvideorenderercontrol.cpp1
-rw-r--r--src/multimedia/controls/qvideowindowcontrol.cpp1
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/media.cpp31
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro3
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/multiple-videooutputs.qml (renamed from src/multimedia/video/qvideoframe_p.h)48
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/video.cpp23
-rw-r--r--src/multimedia/doc/src/cameraoverview.qdoc2
-rw-r--r--src/multimedia/doc/src/platform-notes-windows.qdoc5
-rw-r--r--src/multimedia/doc/src/qtmultimedia-index.qdoc3
-rw-r--r--src/multimedia/playback/qmediaplayer.cpp73
-rw-r--r--src/multimedia/playback/qmediaplayer.h31
-rw-r--r--src/multimedia/playback/qplaylistfileparser.cpp2
-rw-r--r--src/multimedia/qmediacontrol.cpp1
-rw-r--r--src/multimedia/qmediapluginloader.cpp2
-rw-r--r--src/multimedia/qmediaservice.cpp1
-rw-r--r--src/multimedia/qmediaserviceprovider.cpp6
-rw-r--r--src/multimedia/video/qabstractvideobuffer.cpp5
-rw-r--r--src/multimedia/video/qabstractvideobuffer.h1
-rw-r--r--src/multimedia/video/qmemoryvideobuffer.cpp2
-rw-r--r--src/multimedia/video/qvideoframe.cpp8
-rw-r--r--src/multimedia/video/qvideoframe.h2
-rw-r--r--src/multimedia/video/qvideosurfaces.cpp103
-rw-r--r--src/multimedia/video/qvideosurfaces_p.h77
-rw-r--r--src/multimedia/video/video.pri7
67 files changed, 485 insertions, 79 deletions
diff --git a/src/multimedia/audio/qaudiohelpers.cpp b/src/multimedia/audio/qaudiohelpers.cpp
index fae591477..1cd189d6e 100644
--- a/src/multimedia/audio/qaudiohelpers.cpp
+++ b/src/multimedia/audio/qaudiohelpers.cpp
@@ -103,19 +103,19 @@ template<class T> struct signedVersion {};
template<> struct signedVersion<quint8>
{
typedef qint8 TS;
- enum {offset = 0x80};
+ static constexpr int offset = 0x80;
};
template<> struct signedVersion<quint16>
{
typedef qint16 TS;
- enum {offset = 0x8000};
+ static constexpr int offset = 0x8000;
};
template<> struct signedVersion<quint32>
{
typedef qint32 TS;
- enum {offset = 0x80000000};
+ static constexpr uint offset = 0x80000000;
};
template<class T> void adjustUnsignedSamples(qreal factor, const void *src, void *dst, int samples)
diff --git a/src/multimedia/audio/qsamplecache_p.cpp b/src/multimedia/audio/qsamplecache_p.cpp
index 8c4fdc210..b293946cc 100644
--- a/src/multimedia/audio/qsamplecache_p.cpp
+++ b/src/multimedia/audio/qsamplecache_p.cpp
@@ -397,7 +397,7 @@ void QSample::load()
qDebug() << "QSample: load [" << m_url << "]";
#endif
m_stream = m_parent->networkAccessManager().get(QNetworkRequest(m_url));
- connect(m_stream, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(decoderError()));
+ connect(m_stream, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), SLOT(decoderError()));
m_waveDecoder = new QWaveDecoder(m_stream);
connect(m_waveDecoder, SIGNAL(formatKnown()), SLOT(decoderReady()));
connect(m_waveDecoder, SIGNAL(parsingError()), SLOT(decoderError()));
diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
index 0855c1f67..a141f7e36 100644
--- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp
+++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
@@ -528,6 +528,21 @@ qreal QSoundEffectPrivate::volume() const
return m_volume;
}
+static void volume_stream_flush_callback(pa_stream *s, int success, void *userdata)
+{
+ Q_UNUSED(s);
+ QSoundEffectRef *ref = reinterpret_cast<QSoundEffectRef *>(userdata);
+ QSoundEffectPrivate *self = ref->soundEffect();
+ ref->release();
+ if (!self)
+ return;
+
+ if (!success)
+ qWarning("QSoundEffect(pulseaudio): failed to drain");
+
+ QMetaObject::invokeMethod(self, "prepare", Qt::QueuedConnection);
+}
+
void QSoundEffectPrivate::setVolume(qreal volume)
{
QMutexLocker locker(&m_volumeLock);
@@ -537,6 +552,10 @@ void QSoundEffectPrivate::setVolume(qreal volume)
m_volume = qBound(qreal(0), volume, qreal(1));
locker.unlock();
+ if (!m_playing && m_pulseStream) {
+ PulseDaemonLocker locker;
+ pa_stream_flush(m_pulseStream, volume_stream_flush_callback, m_ref->getRef());
+ }
emit volumeChanged();
}
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp
index 40441f332..79412b961 100644
--- a/src/multimedia/camera/qcamera.cpp
+++ b/src/multimedia/camera/qcamera.cpp
@@ -109,6 +109,7 @@ void QCameraPrivate::_q_error(int error, const QString &errorString)
this->error = QCamera::Error(error);
this->errorString = errorString;
+ emit q->errorOccurred(this->error);
emit q->error(this->error);
}
@@ -823,7 +824,7 @@ void QCamera::setCaptureMode(QCamera::CaptureModes mode)
Starts the camera.
State is changed to QCamera::ActiveState if camera is started
- successfully, otherwise error() signal is emitted.
+ successfully, otherwise errorOccurred() signal is emitted.
While the camera state is changed to QCamera::ActiveState,
starting the camera service can be asynchronous with the actual
@@ -1271,6 +1272,14 @@ void QCamera::unlock()
/*!
\fn void QCamera::error(QCamera::Error value)
+ \obsolete
+
+ Use errorOccurred() instead.
+*/
+
+/*!
+ \fn void QCamera::errorOccurred(QCamera::Error value)
+ \since 5.15
Signal emitted when error state changes to \a value.
*/
diff --git a/src/multimedia/camera/qcamera.h b/src/multimedia/camera/qcamera.h
index b2582cd19..97cf4509b 100644
--- a/src/multimedia/camera/qcamera.h
+++ b/src/multimedia/camera/qcamera.h
@@ -242,7 +242,10 @@ Q_SIGNALS:
void lockStatusChanged(QCamera::LockStatus status, QCamera::LockChangeReason reason);
void lockStatusChanged(QCamera::LockType lock, QCamera::LockStatus status, QCamera::LockChangeReason reason);
+#if QT_DEPRECATED_SINCE(5,15)
void error(QCamera::Error);
+#endif
+ void errorOccurred(QCamera::Error);
private:
Q_DISABLE_COPY(QCamera)
diff --git a/src/multimedia/camera/qcameraimagecapture.cpp b/src/multimedia/camera/qcameraimagecapture.cpp
index 502812f76..7eb67daed 100644
--- a/src/multimedia/camera/qcameraimagecapture.cpp
+++ b/src/multimedia/camera/qcameraimagecapture.cpp
@@ -618,7 +618,8 @@ void QCameraImageCapture::cancelCapture()
/*!
\fn QCameraImageCapture::imageCaptured(int id, const QImage &preview);
- Signal emitted when the frame with request \a id was captured, but not processed and saved yet.
+ Signal emitted when QAbstractVideoSurface is used as a viewfinder and
+ the frame with request \a id was captured, but not processed and saved yet.
Frame \a preview can be displayed to user.
*/
@@ -634,13 +635,15 @@ void QCameraImageCapture::cancelCapture()
/*!
\fn QCameraImageCapture::imageAvailable(int id, const QVideoFrame &frame)
- Signal emitted when the \a frame with request \a id is available.
+ Signal emitted when QCameraImageCapture::CaptureToBuffer is set and
+ the \a frame with request \a id is available.
*/
/*!
\fn QCameraImageCapture::imageSaved(int id, const QString &fileName)
- Signal emitted when the frame with request \a id was saved to \a fileName.
+ Signal emitted when QCameraImageCapture::CaptureToFile is set and
+ the frame with request \a id was saved to \a fileName.
*/
QT_END_NAMESPACE
diff --git a/src/multimedia/configure.json b/src/multimedia/configure.json
index e9480dfc5..7f9b5d064 100644
--- a/src/multimedia/configure.json
+++ b/src/multimedia/configure.json
@@ -54,7 +54,7 @@
"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 gstreamer-allocators-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" },
{ "libs": "", "condition": "config.android && input.gstreamer != ''" }
@@ -109,18 +109,6 @@
{ "type": "pkgConfig", "args": "gstreamer-gl-1.0" }
]
},
- "gstreamer_imxcommon": {
- "label": "GStreamer i.MX common",
- "export": "gstreamer_imxcommon",
- "test": {
- "include": "gst/allocators/imx/phys_mem_meta.h"
- },
- "use": "gstreamer_1_0",
- "sources": [
- { "type": "pkgConfig",
- "args": "gstimxcommon" }
- ]
- },
"libresourceqt5": {
"label": "libresourceqt5",
"test": "resourcepolicy",
@@ -260,11 +248,6 @@
"condition": "features.opengl && features.gstreamer_1_0 && libs.gstreamer_gl_1_0",
"output": [ "privateFeature" ]
},
- "gstreamer_imxcommon": {
- "label": "GStreamer i.MX common",
- "condition": "(features.gstreamer_1_0 && libs.gstreamer_imxcommon)",
- "output": [ "privateFeature" ]
- },
"gpu_vivante": {
"label": "Vivante GPU",
"condition": "features.gui && features.opengles2 && tests.gpu_vivante",
diff --git a/src/multimedia/controls/qaudiodecodercontrol.cpp b/src/multimedia/controls/qaudiodecodercontrol.cpp
index 4d6d36a2f..711303174 100644
--- a/src/multimedia/controls/qaudiodecodercontrol.cpp
+++ b/src/multimedia/controls/qaudiodecodercontrol.cpp
@@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAudioDecoderControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qaudioencodersettingscontrol.cpp b/src/multimedia/controls/qaudioencodersettingscontrol.cpp
index 42f20201c..5ae473178 100644
--- a/src/multimedia/controls/qaudioencodersettingscontrol.cpp
+++ b/src/multimedia/controls/qaudioencodersettingscontrol.cpp
@@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAudioEncoderSettingsControl
+ \obsolete
\inmodule QtMultimedia
\ingroup multimedia_control
diff --git a/src/multimedia/controls/qaudioinputselectorcontrol.cpp b/src/multimedia/controls/qaudioinputselectorcontrol.cpp
index 0f8843808..649891225 100644
--- a/src/multimedia/controls/qaudioinputselectorcontrol.cpp
+++ b/src/multimedia/controls/qaudioinputselectorcontrol.cpp
@@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAudioInputSelectorControl
+ \obsolete
\brief The QAudioInputSelectorControl class provides an audio input selector media control.
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qaudiooutputselectorcontrol.cpp b/src/multimedia/controls/qaudiooutputselectorcontrol.cpp
index 20c792f8d..64886e4c9 100644
--- a/src/multimedia/controls/qaudiooutputselectorcontrol.cpp
+++ b/src/multimedia/controls/qaudiooutputselectorcontrol.cpp
@@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAudioOutputSelectorControl
+ \obsolete
\brief The QAudioOutputSelectorControl class provides an audio output selector media control.
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qaudiorolecontrol.cpp b/src/multimedia/controls/qaudiorolecontrol.cpp
index 7b2341846..01e60a914 100644
--- a/src/multimedia/controls/qaudiorolecontrol.cpp
+++ b/src/multimedia/controls/qaudiorolecontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAudioRoleControl
+ \obsolete
\inmodule QtMultimedia
\ingroup multimedia_control
\since 5.6
diff --git a/src/multimedia/controls/qcameracapturebufferformatcontrol.cpp b/src/multimedia/controls/qcameracapturebufferformatcontrol.cpp
index 553414681..8f0c3e6e9 100644
--- a/src/multimedia/controls/qcameracapturebufferformatcontrol.cpp
+++ b/src/multimedia/controls/qcameracapturebufferformatcontrol.cpp
@@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraCaptureBufferFormatControl
+ \obsolete
\brief The QCameraCaptureBufferFormatControl class provides a control for setting the capture buffer format.
diff --git a/src/multimedia/controls/qcameracapturedestinationcontrol.cpp b/src/multimedia/controls/qcameracapturedestinationcontrol.cpp
index e037ab5a9..a9a54a3b8 100644
--- a/src/multimedia/controls/qcameracapturedestinationcontrol.cpp
+++ b/src/multimedia/controls/qcameracapturedestinationcontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraCaptureDestinationControl
+ \obsolete
\brief The QCameraCaptureDestinationControl class provides a control for setting capture destination.
diff --git a/src/multimedia/controls/qcameracontrol.cpp b/src/multimedia/controls/qcameracontrol.cpp
index 03a7a073c..d33fa94c9 100644
--- a/src/multimedia/controls/qcameracontrol.cpp
+++ b/src/multimedia/controls/qcameracontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraControl
+ \obsolete
diff --git a/src/multimedia/controls/qcameraexposurecontrol.cpp b/src/multimedia/controls/qcameraexposurecontrol.cpp
index 1434f0976..2095c9cfa 100644
--- a/src/multimedia/controls/qcameraexposurecontrol.cpp
+++ b/src/multimedia/controls/qcameraexposurecontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraExposureControl
+ \obsolete
\brief The QCameraExposureControl class allows controlling camera exposure parameters.
diff --git a/src/multimedia/controls/qcamerafeedbackcontrol.cpp b/src/multimedia/controls/qcamerafeedbackcontrol.cpp
index 07074d83d..42cd7d661 100644
--- a/src/multimedia/controls/qcamerafeedbackcontrol.cpp
+++ b/src/multimedia/controls/qcamerafeedbackcontrol.cpp
@@ -44,6 +44,7 @@
/*!
\class QCameraFeedbackControl
+ \obsolete
\brief The QCameraFeedbackControl class allows controlling feedback (sounds etc) during camera operation.
diff --git a/src/multimedia/controls/qcameraflashcontrol.cpp b/src/multimedia/controls/qcameraflashcontrol.cpp
index d5d9b564f..658e2d56c 100644
--- a/src/multimedia/controls/qcameraflashcontrol.cpp
+++ b/src/multimedia/controls/qcameraflashcontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraFlashControl
+ \obsolete
\brief The QCameraFlashControl class allows controlling a camera's flash.
diff --git a/src/multimedia/controls/qcamerafocuscontrol.cpp b/src/multimedia/controls/qcamerafocuscontrol.cpp
index d963c95d4..b216882b4 100644
--- a/src/multimedia/controls/qcamerafocuscontrol.cpp
+++ b/src/multimedia/controls/qcamerafocuscontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraFocusControl
+ \obsolete
\brief The QCameraFocusControl class supplies control for
diff --git a/src/multimedia/controls/qcameraimagecapturecontrol.cpp b/src/multimedia/controls/qcameraimagecapturecontrol.cpp
index 3c110eb68..0e089d01b 100644
--- a/src/multimedia/controls/qcameraimagecapturecontrol.cpp
+++ b/src/multimedia/controls/qcameraimagecapturecontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraImageCaptureControl
+ \obsolete
\brief The QCameraImageCaptureControl class provides a control interface
for image capture services.
diff --git a/src/multimedia/controls/qcameraimageprocessingcontrol.cpp b/src/multimedia/controls/qcameraimageprocessingcontrol.cpp
index a39846642..fba4bf400 100644
--- a/src/multimedia/controls/qcameraimageprocessingcontrol.cpp
+++ b/src/multimedia/controls/qcameraimageprocessingcontrol.cpp
@@ -51,6 +51,7 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterCameraImageProcessingControlMetaTypes)
/*!
\class QCameraImageProcessingControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qcamerainfocontrol.cpp b/src/multimedia/controls/qcamerainfocontrol.cpp
index de6dc4277..8a4ef3b44 100644
--- a/src/multimedia/controls/qcamerainfocontrol.cpp
+++ b/src/multimedia/controls/qcamerainfocontrol.cpp
@@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraInfoControl
+ \obsolete
\since 5.3
\brief The QCameraInfoControl class provides a camera info media control.
diff --git a/src/multimedia/controls/qcameralockscontrol.cpp b/src/multimedia/controls/qcameralockscontrol.cpp
index 436b3b9c9..27b68cf2c 100644
--- a/src/multimedia/controls/qcameralockscontrol.cpp
+++ b/src/multimedia/controls/qcameralockscontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraLocksControl
+ \obsolete
diff --git a/src/multimedia/controls/qcameraviewfindersettingscontrol.cpp b/src/multimedia/controls/qcameraviewfindersettingscontrol.cpp
index 6fa0ded82..bd5c7a73b 100644
--- a/src/multimedia/controls/qcameraviewfindersettingscontrol.cpp
+++ b/src/multimedia/controls/qcameraviewfindersettingscontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraViewfinderSettingsControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qcamerazoomcontrol.cpp b/src/multimedia/controls/qcamerazoomcontrol.cpp
index 9c8d8d289..1f0835224 100644
--- a/src/multimedia/controls/qcamerazoomcontrol.cpp
+++ b/src/multimedia/controls/qcamerazoomcontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCameraZoomControl
+ \obsolete
\brief The QCameraZoomControl class supplies control for
diff --git a/src/multimedia/controls/qcustomaudiorolecontrol.cpp b/src/multimedia/controls/qcustomaudiorolecontrol.cpp
index 046219687..f1b89eda5 100644
--- a/src/multimedia/controls/qcustomaudiorolecontrol.cpp
+++ b/src/multimedia/controls/qcustomaudiorolecontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QCustomAudioRoleControl
+ \obsolete
\inmodule QtMultimedia
\ingroup multimedia_control
\since 5.11
diff --git a/src/multimedia/controls/qimageencodercontrol.cpp b/src/multimedia/controls/qimageencodercontrol.cpp
index c29a61662..6223c33c7 100644
--- a/src/multimedia/controls/qimageencodercontrol.cpp
+++ b/src/multimedia/controls/qimageencodercontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QImageEncoderControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qmediaaudioprobecontrol.cpp b/src/multimedia/controls/qmediaaudioprobecontrol.cpp
index 296f01888..e22135903 100644
--- a/src/multimedia/controls/qmediaaudioprobecontrol.cpp
+++ b/src/multimedia/controls/qmediaaudioprobecontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMediaAudioProbeControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qmediaavailabilitycontrol.cpp b/src/multimedia/controls/qmediaavailabilitycontrol.cpp
index 1a6d73a8a..68b404369 100644
--- a/src/multimedia/controls/qmediaavailabilitycontrol.cpp
+++ b/src/multimedia/controls/qmediaavailabilitycontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMediaAvailabilityControl
+ \obsolete
\brief The QMediaAvailabilityControl class supplies a control for reporting availability of a service.
diff --git a/src/multimedia/controls/qmediacontainercontrol.cpp b/src/multimedia/controls/qmediacontainercontrol.cpp
index b15c8acdc..2b2c8b78b 100644
--- a/src/multimedia/controls/qmediacontainercontrol.cpp
+++ b/src/multimedia/controls/qmediacontainercontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMediaContainerControl
+ \obsolete
\brief The QMediaContainerControl class provides access to the output container format of a QMediaService.
diff --git a/src/multimedia/controls/qmediagaplessplaybackcontrol.cpp b/src/multimedia/controls/qmediagaplessplaybackcontrol.cpp
index b76274972..c9f531454 100644
--- a/src/multimedia/controls/qmediagaplessplaybackcontrol.cpp
+++ b/src/multimedia/controls/qmediagaplessplaybackcontrol.cpp
@@ -42,6 +42,7 @@
/*!
\class QMediaGaplessPlaybackControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qmedianetworkaccesscontrol.cpp b/src/multimedia/controls/qmedianetworkaccesscontrol.cpp
index 9e9ad239d..bd289cc29 100644
--- a/src/multimedia/controls/qmedianetworkaccesscontrol.cpp
+++ b/src/multimedia/controls/qmedianetworkaccesscontrol.cpp
@@ -39,11 +39,15 @@
#include "qmedianetworkaccesscontrol.h"
+#ifndef QT_NO_BEARERMANAGEMENT
+
QT_BEGIN_NAMESPACE
/*!
\class QMediaNetworkAccessControl
+ \obsolete
\brief The QMediaNetworkAccessControl class allows the setting of the Network Access Point for media related activities.
+ \obsolete
\inmodule QtMultimedia
@@ -92,10 +96,13 @@ QMediaNetworkAccessControl::~QMediaNetworkAccessControl()
/*!
\fn QMediaNetworkAccessControl::configurationChanged(const QNetworkConfiguration &configuration)
+
This signal is emitted when the current active network configuration changes
to \a configuration.
*/
QT_END_NAMESPACE
+#endif
+
#include "moc_qmedianetworkaccesscontrol.cpp"
diff --git a/src/multimedia/controls/qmedianetworkaccesscontrol.h b/src/multimedia/controls/qmedianetworkaccesscontrol.h
index daae4f389..681ef61b6 100644
--- a/src/multimedia/controls/qmedianetworkaccesscontrol.h
+++ b/src/multimedia/controls/qmedianetworkaccesscontrol.h
@@ -41,17 +41,25 @@
#ifndef QMEDIANETWORKACCESSCONTROL_H
#define QMEDIANETWORKACCESSCONTROL_H
+#if 0
+#pragma qt_class(QMediaNetworkAccessControl)
+#endif
+
#include <QtMultimedia/qmediacontrol.h>
#include <QtCore/qlist.h>
#include <QtNetwork/qnetworkconfiguration.h>
+#ifndef QT_NO_BEARERMANAGEMENT
+
QT_BEGIN_NAMESPACE
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+
// Required for QDoc workaround
class QString;
-
-class Q_MULTIMEDIA_EXPORT QMediaNetworkAccessControl : public QMediaControl
+class QT_DEPRECATED_VERSION_5_15 Q_MULTIMEDIA_EXPORT QMediaNetworkAccessControl : public QMediaControl
{
Q_OBJECT
public:
@@ -71,7 +79,10 @@ protected:
#define QMediaNetworkAccessControl_iid "org.qt-project.qt.medianetworkaccesscontrol/5.0"
Q_MEDIA_DECLARE_CONTROL(QMediaNetworkAccessControl, QMediaNetworkAccessControl_iid)
+QT_WARNING_POP
+
QT_END_NAMESPACE
+#endif
#endif
diff --git a/src/multimedia/controls/qmediaplayercontrol.cpp b/src/multimedia/controls/qmediaplayercontrol.cpp
index 28b217af8..a180413b9 100644
--- a/src/multimedia/controls/qmediaplayercontrol.cpp
+++ b/src/multimedia/controls/qmediaplayercontrol.cpp
@@ -46,6 +46,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMediaPlayerControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qmediarecordercontrol.cpp b/src/multimedia/controls/qmediarecordercontrol.cpp
index f078073ef..87ace7017 100644
--- a/src/multimedia/controls/qmediarecordercontrol.cpp
+++ b/src/multimedia/controls/qmediarecordercontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMediaRecorderControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qmediastreamscontrol.cpp b/src/multimedia/controls/qmediastreamscontrol.cpp
index aa5fe007d..2db9eb6fc 100644
--- a/src/multimedia/controls/qmediastreamscontrol.cpp
+++ b/src/multimedia/controls/qmediastreamscontrol.cpp
@@ -52,6 +52,7 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterMediaStreamControlMetaTypes)
/*!
\class QMediaStreamsControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qmediavideoprobecontrol.cpp b/src/multimedia/controls/qmediavideoprobecontrol.cpp
index ea27ab057..4a85d56d0 100644
--- a/src/multimedia/controls/qmediavideoprobecontrol.cpp
+++ b/src/multimedia/controls/qmediavideoprobecontrol.cpp
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMediaVideoProbeControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qmetadatareadercontrol.cpp b/src/multimedia/controls/qmetadatareadercontrol.cpp
index e728353f6..f01ffec38 100644
--- a/src/multimedia/controls/qmetadatareadercontrol.cpp
+++ b/src/multimedia/controls/qmetadatareadercontrol.cpp
@@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMetaDataReaderControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qmetadatawritercontrol.cpp b/src/multimedia/controls/qmetadatawritercontrol.cpp
index 053597b88..6221edaa1 100644
--- a/src/multimedia/controls/qmetadatawritercontrol.cpp
+++ b/src/multimedia/controls/qmetadatawritercontrol.cpp
@@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMetaDataWriterControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qradiodatacontrol.cpp b/src/multimedia/controls/qradiodatacontrol.cpp
index df0046b5e..27e192674 100644
--- a/src/multimedia/controls/qradiodatacontrol.cpp
+++ b/src/multimedia/controls/qradiodatacontrol.cpp
@@ -46,6 +46,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QRadioDataControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qradiotunercontrol.cpp b/src/multimedia/controls/qradiotunercontrol.cpp
index ea2126319..20897150b 100644
--- a/src/multimedia/controls/qradiotunercontrol.cpp
+++ b/src/multimedia/controls/qradiotunercontrol.cpp
@@ -46,9 +46,9 @@ QT_BEGIN_NAMESPACE
/*!
\class QRadioTunerControl
+ \obsolete
\inmodule QtMultimedia
-
\ingroup multimedia_control
diff --git a/src/multimedia/controls/qvideodeviceselectorcontrol.cpp b/src/multimedia/controls/qvideodeviceselectorcontrol.cpp
index 8c4ee7ba4..420ba9150 100644
--- a/src/multimedia/controls/qvideodeviceselectorcontrol.cpp
+++ b/src/multimedia/controls/qvideodeviceselectorcontrol.cpp
@@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QVideoDeviceSelectorControl
+ \obsolete
\brief The QVideoDeviceSelectorControl class provides an video device selector media control.
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qvideoencodersettingscontrol.cpp b/src/multimedia/controls/qvideoencodersettingscontrol.cpp
index 52ae51382..64643f6db 100644
--- a/src/multimedia/controls/qvideoencodersettingscontrol.cpp
+++ b/src/multimedia/controls/qvideoencodersettingscontrol.cpp
@@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QVideoEncoderSettingsControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/controls/qvideorenderercontrol.cpp b/src/multimedia/controls/qvideorenderercontrol.cpp
index e722dfa38..eee20d59e 100644
--- a/src/multimedia/controls/qvideorenderercontrol.cpp
+++ b/src/multimedia/controls/qvideorenderercontrol.cpp
@@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QVideoRendererControl
+ \obsolete
\inmodule QtMultimedia
\brief The QVideoRendererControl class provides a media control for rendering video to a QAbstractVideoSurface.
diff --git a/src/multimedia/controls/qvideowindowcontrol.cpp b/src/multimedia/controls/qvideowindowcontrol.cpp
index e971a6925..a6b2bf407 100644
--- a/src/multimedia/controls/qvideowindowcontrol.cpp
+++ b/src/multimedia/controls/qvideowindowcontrol.cpp
@@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QVideoWindowControl
+ \obsolete
\inmodule QtMultimedia
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
index 8ec7cb072..7fd6259ea 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
@@ -56,6 +56,7 @@
#include "qaudioprobe.h"
#include "qaudiorecorder.h"
#include "qvideoprobe.h"
+#include <QAbstractVideoSurface>
class MediaExample : public QObject {
Q_OBJECT
@@ -197,6 +198,36 @@ void MediaExample::MediaPlayer()
player->play();
//! [Pipeline]
+ //! [Pipeline Surface]
+ class Surface : public QAbstractVideoSurface
+ {
+ public:
+ Surface(QObject *p) : QAbstractVideoSurface(p) { }
+ QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType) const override
+ {
+ // Make sure that the driver supports this pixel format.
+ return QList<QVideoFrame::PixelFormat>() << QVideoFrame::Format_YUYV;
+ }
+
+ // Video frames are handled here.
+ bool present(const QVideoFrame &) override { return true; }
+ };
+
+ player = new QMediaPlayer;
+ player->setVideoOutput(new Surface(player));
+ player->setMedia(QUrl("gst-pipeline: videotestsrc ! qtvideosink"));
+ player->play();
+ //! [Pipeline Surface]
+
+ //! [Pipeline Widget]
+ player = new QMediaPlayer;
+ videoWidget = new QVideoWidget;
+ videoWidget->show();
+ player->setVideoOutput(videoWidget);
+ player->setMedia(QUrl("gst-pipeline: videotestsrc ! xvimagesink name=\"qtvideosink\""));
+ player->play();
+ //! [Pipeline Widget]
+
//! [Pipeline appsrc]
QImage img("images/qt-logo.png");
img = img.convertToFormat(QImage::Format_ARGB32);
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro b/src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro
index c13090a79..a46b20bd0 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro
+++ b/src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro
@@ -22,4 +22,5 @@ SOURCES += \
OTHER_FILES += \
soundeffect.qml \
- qtvideosink.qml
+ qtvideosink.qml \
+ multiple-videooutputs.qml
diff --git a/src/multimedia/video/qvideoframe_p.h b/src/multimedia/doc/snippets/multimedia-snippets/multiple-videooutputs.qml
index d7b9dd348..e3c1587f6 100644
--- a/src/multimedia/video/qvideoframe_p.h
+++ b/src/multimedia/doc/snippets/multimedia-snippets/multiple-videooutputs.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Toolkit.
@@ -37,27 +37,31 @@
**
****************************************************************************/
-#ifndef QVIDEOFRAME_P_H
-#define QVIDEOFRAME_P_H
+import QtQuick 2.0
+import QtQuick.Window 2.2
+import QtMultimedia 5.15
-#include <QtMultimedia/qvideoframe.h>
+//! [complete]
+Item {
+ MediaPlayer {
+ id: mediaplayer
+ autoPlay: true
+ source: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
+ videoOutput: [v1, v2]
+ }
-//
-// 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.
-//
-
-QT_BEGIN_NAMESPACE
-
-Q_MULTIMEDIA_EXPORT QImage qt_imageFromVideoFrame(const QVideoFrame &frame);
-
-QT_END_NAMESPACE
-
-#endif // QVIDEOFRAME_P_H
+ VideoOutput {
+ id: v1
+ anchors.fill: parent
+ }
+ Window {
+ visible: true
+ width: 480; height: 320
+ VideoOutput {
+ id: v2
+ anchors.fill: parent
+ }
+ }
+}
+//! [complete]
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/video.cpp b/src/multimedia/doc/snippets/multimedia-snippets/video.cpp
index 3c14f7009..46327e3d6 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/video.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/video.cpp
@@ -117,6 +117,7 @@ public:
void VideoWidget();
void VideoWindowControl();
void VideoWidgetControl();
+ void VideoSurface();
private:
// Common naming
@@ -163,6 +164,28 @@ void VideoExample::VideoWidget()
//! [Setting surface in player]
}
+void VideoExample::VideoSurface()
+{
+ //! [Widget Surface]
+ QImage img = QImage("images/qt-logo.png").convertToFormat(QImage::Format_ARGB32);
+ QVideoSurfaceFormat format(img.size(), QVideoFrame::Format_ARGB32);
+ videoWidget = new QVideoWidget;
+ videoWidget->videoSurface()->start(format);
+ videoWidget->videoSurface()->present(img);
+ videoWidget->show();
+ //! [Widget Surface]
+
+ //! [GraphicsVideoItem Surface]
+ QGraphicsVideoItem *item = new QGraphicsVideoItem;
+ graphicsView->scene()->addItem(item);
+ graphicsView->show();
+ QImage img = QImage("images/qt-logo.png").convertToFormat(QImage::Format_ARGB32);
+ QVideoSurfaceFormat format(img.size(), QVideoFrame::Format_ARGB32);
+ item->videoSurface()->start(format);
+ item->videoSurface()->present(img);
+ //! [GraphicsVideoItem Surface]
+}
+
void VideoExample::VideoWidgetControl()
{
//! [Video widget control]
diff --git a/src/multimedia/doc/src/cameraoverview.qdoc b/src/multimedia/doc/src/cameraoverview.qdoc
index 6962c2c48..69631fdab 100644
--- a/src/multimedia/doc/src/cameraoverview.qdoc
+++ b/src/multimedia/doc/src/cameraoverview.qdoc
@@ -286,7 +286,7 @@ for all of these, so you shouldn't need to adjust them unless the user wants a s
If you're taking a series of images (for example, to stitch them together for
a panoramic image), you should lock the image processing settings so that all the
-images taken appear similar with \e {QCamera::lock(QCamera::LockWhiteBalance)}/
+images taken appear similar with \e {QCamera::searchAndLock(QCamera::LockWhiteBalance)}/
\section3 Canceling Asynchronous Operations
diff --git a/src/multimedia/doc/src/platform-notes-windows.qdoc b/src/multimedia/doc/src/platform-notes-windows.qdoc
index e86d6a276..a69e96d99 100644
--- a/src/multimedia/doc/src/platform-notes-windows.qdoc
+++ b/src/multimedia/doc/src/platform-notes-windows.qdoc
@@ -42,6 +42,11 @@ was introduced in Windows Vista as a replacement for DirectShow and other
multimedia APIs. Consequently, WMF plugin in Qt is supported only for
Windows Vista and later versions of the operating system.
+The environment variable \c QT_MULTIMEDIA_PREFERRED_PLUGINS can be used to
+control the priority of the plugins. For example, setting it to
+"windowsmediafoundation" or "directshow" will cause the corresponding plugin
+to be the preferred one.
+
\section1 Limitations
The WMF plugin in Qt does not currently provide a camera backend. Instead,
diff --git a/src/multimedia/doc/src/qtmultimedia-index.qdoc b/src/multimedia/doc/src/qtmultimedia-index.qdoc
index c2734f4a9..abd6a62cc 100644
--- a/src/multimedia/doc/src/qtmultimedia-index.qdoc
+++ b/src/multimedia/doc/src/qtmultimedia-index.qdoc
@@ -132,9 +132,6 @@
\li QMediaPlaylist
\li List of media to be played.
\row
- \li QRadioTuner
- \li Access radio device.
- \row
\li QAbstractVideoSurface
\li Base class for video presentation.
\endtable
diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp
index 44e91912b..382d8b30b 100644
--- a/src/multimedia/playback/qmediaplayer.cpp
+++ b/src/multimedia/playback/qmediaplayer.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qmediaplayer.h"
+#include "qvideosurfaces_p.h"
#include "qvideosurfaceoutput_p.h"
#include "qmediaobject_p.h"
@@ -115,7 +116,9 @@ public:
, audioRoleControl(nullptr)
, customAudioRoleControl(nullptr)
, playlist(nullptr)
+#ifndef QT_NO_BEARERMANAGEMENT
, networkAccessControl(nullptr)
+#endif
, state(QMediaPlayer::StoppedState)
, status(QMediaPlayer::UnknownMediaStatus)
, error(QMediaPlayer::NoError)
@@ -132,7 +135,12 @@ public:
QPointer<QObject> videoOutput;
QMediaPlaylist *playlist;
+#ifndef QT_NO_BEARERMANAGEMENT
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QMediaNetworkAccessControl *networkAccessControl;
+QT_WARNING_POP
+#endif
QVideoSurfaceOutput surfaceOutput;
QMediaContent qrcMedia;
QScopedPointer<QFile> qrcFile;
@@ -563,7 +571,7 @@ static QMediaService *playerService(QMediaPlayer::Flags flags)
{
QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider();
if (flags) {
- QMediaServiceProviderHint::Features features = 0;
+ QMediaServiceProviderHint::Features features;
if (flags & QMediaPlayer::LowLatency)
features |= QMediaServiceProviderHint::LowLatencyPlayback;
@@ -598,7 +606,12 @@ QMediaPlayer::QMediaPlayer(QObject *parent, QMediaPlayer::Flags flags):
d->error = ServiceMissingError;
} else {
d->control = qobject_cast<QMediaPlayerControl*>(d->service->requestControl(QMediaPlayerControl_iid));
+#ifndef QT_NO_BEARERMANAGEMENT
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
d->networkAccessControl = qobject_cast<QMediaNetworkAccessControl*>(d->service->requestControl(QMediaNetworkAccessControl_iid));
+QT_WARNING_POP
+#endif
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)));
@@ -642,10 +655,15 @@ QMediaPlayer::QMediaPlayer(QObject *parent, QMediaPlayer::Flags flags):
}
}
}
+#ifndef QT_NO_BEARERMANAGEMENT
if (d->networkAccessControl != nullptr) {
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
connect(d->networkAccessControl, &QMediaNetworkAccessControl::configurationChanged,
this, &QMediaPlayer::networkConfigurationChanged);
+QT_WARNING_POP
}
+#endif
}
}
@@ -730,7 +748,12 @@ void QMediaPlayer::setPlaylist(QMediaPlaylist *playlist)
setMedia(m);
}
+#ifndef QT_NO_BEARERMANAGEMENT
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
/*!
+ \obsolete
+
Sets the network access points for remote media playback.
\a configurations contains, in ascending preferential order, a list of
configuration that can be used for network access.
@@ -744,6 +767,8 @@ void QMediaPlayer::setNetworkConfigurations(const QList<QNetworkConfiguration> &
if (d->networkAccessControl)
d->networkAccessControl->setConfigurations(configurations);
}
+QT_WARNING_POP
+#endif
QMediaPlayer::State QMediaPlayer::state() const
{
@@ -869,7 +894,12 @@ QString QMediaPlayer::errorString() const
return d_func()->errorString;
}
+#ifndef QT_NO_BEARERMANAGEMENT
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
/*!
+ \obsolete
+
Returns the current network access point in use.
If a default contructed QNetworkConfiguration is returned
this feature is not available or that none of the
@@ -884,6 +914,8 @@ QNetworkConfiguration QMediaPlayer::currentNetworkConfiguration() const
return QNetworkConfiguration();
}
+QT_WARNING_POP
+#endif
//public Q_SLOTS:
/*!
@@ -1005,8 +1037,9 @@ void QMediaPlayer::setPlaybackRate(qreal rate)
Sets the current \a media source.
If a \a stream is supplied; media data will be read from it instead of resolving the media
- source. In this case the media source may still be used to resolve additional information
+ source. In this case the url should be provided to resolve additional information
about the media such as mime type. The \a stream must be open and readable.
+ For macOS the \a stream should be also seekable.
Setting the media to a null QMediaContent will cause the player to discard all
information relating to the current media source and to cease all I/O operations related
@@ -1022,8 +1055,17 @@ void QMediaPlayer::setPlaybackRate(qreal rate)
\snippet multimedia-snippets/media.cpp Pipeline
- If the pipeline contains a video sink element named \c qtvideosink,
- current QVideoWidget can be used to render the video.
+ If QAbstractVideoSurface is used as the video output,
+ \c qtvideosink can be used as a video sink element directly in the pipeline.
+ After that the surface will receive the video frames in QAbstractVideoSurface::present().
+
+ \snippet multimedia-snippets/media.cpp Pipeline Surface
+
+ If QVideoWidget is used as the video output
+ and the pipeline contains a video sink element named \c qtvideosink,
+ current QVideoWidget will be used to render the video.
+
+ \snippet multimedia-snippets/media.cpp Pipeline Widget
If the pipeline contains appsrc element, it will be used to push data from \a stream.
@@ -1176,6 +1218,24 @@ void QMediaPlayer::setVideoOutput(QAbstractVideoSurface *surface)
}
}
+/*!
+ \since 5.15
+ Sets multiple video surfaces as the video output of a media player.
+ This allows the media player to render video frames on different surfaces.
+
+ All video surfaces must support at least one shared \c QVideoFrame::PixelFormat.
+
+ If a video output has already been set on the media player the new surfaces
+ will replace it.
+
+ \sa QAbstractVideoSurface::supportedPixelFormats
+*/
+
+void QMediaPlayer::setVideoOutput(const QVector<QAbstractVideoSurface *> &surfaces)
+{
+ setVideoOutput(!surfaces.empty() ? new QVideoSurfaces(surfaces, this) : nullptr);
+}
+
/*! \reimp */
QMultimedia::AvailabilityStatus QMediaPlayer::availability() const
{
@@ -1289,7 +1349,7 @@ QStringList QMediaPlayer::supportedCustomAudioRoles() const
Defines the status of a media player's current media.
\value UnknownMediaStatus The status of the media cannot be determined.
- \value NoMedia The is no current media. The player is in the StoppedState.
+ \value NoMedia There is no current media. The player is in the StoppedState.
\value LoadingMedia The current media is being loaded. The player may be in any state.
\value LoadedMedia The current media has been loaded. The player is in the StoppedState.
\value StalledMedia Playback of the current media has stalled due to insufficient buffering or
@@ -1550,7 +1610,7 @@ QStringList QMediaPlayer::supportedCustomAudioRoles() const
This value is a multiplier applied to the media's standard play rate. By
default this value is 1.0, indicating that the media is playing at the
standard pace. Values higher than 1.0 will increase the rate of play.
- Values less than zero can be set and indicate the media will rewind at the
+ Values less than zero can be set and indicate the media should rewind at the
multiplier of the standard pace.
Not all playback services support change of the playback rate. It is
@@ -1635,6 +1695,7 @@ QStringList QMediaPlayer::supportedCustomAudioRoles() const
/*!
\fn void QMediaPlayer::networkConfigurationChanged(const QNetworkConfiguration &configuration)
+ \obsolete
Signal that the active in use network access point has been changed to \a configuration and all subsequent network access will use this \a configuration.
*/
diff --git a/src/multimedia/playback/qmediaplayer.h b/src/multimedia/playback/qmediaplayer.h
index 5d9a393e1..c579c7f40 100644
--- a/src/multimedia/playback/qmediaplayer.h
+++ b/src/multimedia/playback/qmediaplayer.h
@@ -40,6 +40,7 @@
#ifndef QMEDIAPLAYER_H
#define QMEDIAPLAYER_H
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmediaobject.h>
#include <QtMultimedia/qmediacontent.h>
#include <QtMultimedia/qmediaenumdebug.h>
@@ -131,6 +132,7 @@ public:
void setVideoOutput(QVideoWidget *);
void setVideoOutput(QGraphicsVideoItem *);
void setVideoOutput(QAbstractVideoSurface *surface);
+ void setVideoOutput(const QVector<QAbstractVideoSurface *> &surfaces);
QMediaContent media() const;
const QIODevice *mediaStream() const;
@@ -156,7 +158,12 @@ public:
Error error() const;
QString errorString() const;
- QNetworkConfiguration currentNetworkConfiguration() const;
+#ifndef QT_NO_BEARERMANAGEMENT
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+ QT_DEPRECATED_VERSION_5_15 QNetworkConfiguration currentNetworkConfiguration() const;
+QT_WARNING_POP
+#endif
QMultimedia::AvailabilityStatus availability() const override;
@@ -181,7 +188,16 @@ public Q_SLOTS:
void setMedia(const QMediaContent &media, QIODevice *stream = nullptr);
void setPlaylist(QMediaPlaylist *playlist);
- void setNetworkConfigurations(const QList<QNetworkConfiguration> &configurations);
+#ifndef QT_NO_BEARERMANAGEMENT
+#ifndef Q_MOC_RUN // moc fails to parse the expanded macro
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+#endif
+ QT_DEPRECATED_VERSION_5_15 void setNetworkConfigurations(const QList<QNetworkConfiguration> &configurations);
+#ifndef Q_MOC_RUN // moc fails to parse the expanded macro
+QT_WARNING_POP
+#endif
+#endif
Q_SIGNALS:
void mediaChanged(const QMediaContent &media);
@@ -208,7 +224,16 @@ Q_SIGNALS:
void error(QMediaPlayer::Error error);
- void networkConfigurationChanged(const QNetworkConfiguration &configuration);
+#ifndef QT_NO_BEARERMANAGEMENT
+#ifndef Q_MOC_RUN // moc fails to parse the expanded macro
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+#endif
+ QT_DEPRECATED_VERSION_5_15 void networkConfigurationChanged(const QNetworkConfiguration &configuration);
+#ifndef Q_MOC_RUN // moc fails to parse the expanded macro
+QT_WARNING_POP
+#endif
+#endif
public:
bool bind(QObject *) override;
void unbind(QObject *) override;
diff --git a/src/multimedia/playback/qplaylistfileparser.cpp b/src/multimedia/playback/qplaylistfileparser.cpp
index 9af447032..d3cd60476 100644
--- a/src/multimedia/playback/qplaylistfileparser.cpp
+++ b/src/multimedia/playback/qplaylistfileparser.cpp
@@ -552,7 +552,7 @@ void QPlaylistFileParser::start(const QNetworkRequest& request, const QString &m
d->m_source.reset(d->m_mgr.get(request));
connect(d->m_source.data(), SIGNAL(readyRead()), this, SLOT(handleData()));
connect(d->m_source.data(), SIGNAL(finished()), this, SLOT(handleData()));
- connect(d->m_source.data(), SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(handleError()));
+ connect(d->m_source.data(), SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(handleError()));
if (url.isLocalFile())
d->handleData();
diff --git a/src/multimedia/qmediacontrol.cpp b/src/multimedia/qmediacontrol.cpp
index b8f980aa0..6f0a980a2 100644
--- a/src/multimedia/qmediacontrol.cpp
+++ b/src/multimedia/qmediacontrol.cpp
@@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMediaControl
+ \obsolete
\inmodule QtMultimedia
\ingroup multimedia
diff --git a/src/multimedia/qmediapluginloader.cpp b/src/multimedia/qmediapluginloader.cpp
index 88bd591c2..3e9e6cc21 100644
--- a/src/multimedia/qmediapluginloader.cpp
+++ b/src/multimedia/qmediapluginloader.cpp
@@ -104,7 +104,7 @@ QList<QObject*> QMediaPluginLoader::instances(QString const &key)
static const bool showDebug = qEnvironmentVariableIntValue("QT_DEBUG_PLUGINS");
static const QStringList preferredPlugins =
- qEnvironmentVariable("QT_MULTIMEDIA_PREFERRED_PLUGINS").split(QLatin1Char(','), QString::SkipEmptyParts);
+ qEnvironmentVariable("QT_MULTIMEDIA_PREFERRED_PLUGINS").split(QLatin1Char(','), Qt::SkipEmptyParts);
for (int i = preferredPlugins.size() - 1; i >= 0; --i) {
auto name = preferredPlugins[i];
bool found = false;
diff --git a/src/multimedia/qmediaservice.cpp b/src/multimedia/qmediaservice.cpp
index 7ea24c6dc..ad543acae 100644
--- a/src/multimedia/qmediaservice.cpp
+++ b/src/multimedia/qmediaservice.cpp
@@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QMediaService
+ \obsolete
\brief The QMediaService class provides a common base class for media
service implementations.
\ingroup multimedia
diff --git a/src/multimedia/qmediaserviceprovider.cpp b/src/multimedia/qmediaserviceprovider.cpp
index d8ffe42ae..93b560d8c 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(nullptr)
+ : type(type)
{
}
@@ -77,7 +77,7 @@ public:
QMediaServiceProviderHint::Type type;
QByteArray device;
- QCamera::Position cameraPosition;
+ QCamera::Position cameraPosition = QCamera::UnspecifiedPosition;
QString mimeType;
QStringList codecs;
QMediaServiceProviderHint::Features features;
@@ -712,7 +712,7 @@ QMediaServiceProviderHint::Features QMediaServiceProvider::supportedFeatures(con
{
Q_UNUSED(service);
- return QMediaServiceProviderHint::Features(nullptr);
+ return {};
}
/*!
diff --git a/src/multimedia/video/qabstractvideobuffer.cpp b/src/multimedia/video/qabstractvideobuffer.cpp
index f0dd6d2eb..8762150d0 100644
--- a/src/multimedia/video/qabstractvideobuffer.cpp
+++ b/src/multimedia/video/qabstractvideobuffer.cpp
@@ -96,12 +96,15 @@ int QAbstractVideoBufferPrivate::map(
Identifies the type of a video buffers handle.
\value NoHandle The buffer has no handle, its data can only be accessed by mapping the buffer.
- \value GLTextureHandle The handle of the buffer is an OpenGL texture ID.
+ \value GLTextureHandle The handle of the buffer is an OpenGL texture ID
+ of an undefined and platform dependent target type.
\value XvShmImageHandle The handle contains pointer to shared memory XVideo image.
\value CoreImageHandle The handle contains pointer to \macos CIImage.
\value QPixmapHandle The handle of the buffer is a QPixmap.
\value EGLImageHandle The handle of the buffer is an EGLImageKHR.
\value UserHandle Start value for user defined handle types.
+ \value GLTextureRectangleHandle The handle of the buffer is an OpenGL texture ID
+ of target type \c GL_TEXTURE_RECTANGLE.
\sa handleType()
*/
diff --git a/src/multimedia/video/qabstractvideobuffer.h b/src/multimedia/video/qabstractvideobuffer.h
index 2352c0f3d..a3afc18e4 100644
--- a/src/multimedia/video/qabstractvideobuffer.h
+++ b/src/multimedia/video/qabstractvideobuffer.h
@@ -64,6 +64,7 @@ public:
CoreImageHandle,
QPixmapHandle,
EGLImageHandle,
+ GLTextureRectangleHandle,
UserHandle = 1000
};
diff --git a/src/multimedia/video/qmemoryvideobuffer.cpp b/src/multimedia/video/qmemoryvideobuffer.cpp
index e05210d9d..febcd66c8 100644
--- a/src/multimedia/video/qmemoryvideobuffer.cpp
+++ b/src/multimedia/video/qmemoryvideobuffer.cpp
@@ -101,7 +101,7 @@ uchar *QMemoryVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine)
{
Q_D(QMemoryVideoBuffer);
- if (d->mapMode == NotMapped && d->data.data() && mode != NotMapped) {
+ if (d->mapMode == NotMapped && d->data.size() && mode != NotMapped) {
d->mapMode = mode;
if (numBytes)
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp
index 5e2d6df39..fd7b74075 100644
--- a/src/multimedia/video/qvideoframe.cpp
+++ b/src/multimedia/video/qvideoframe.cpp
@@ -39,7 +39,6 @@
#include "qvideoframe.h"
-#include "qvideoframe_p.h"
#include "qimagevideobuffer_p.h"
#include "qmemoryvideobuffer_p.h"
#include "qvideoframeconversionhelper_p.h"
@@ -1112,11 +1111,12 @@ static void qInitConvertFuncsAsm()
}
/*!
- \internal
+ Based on the pixel format converts current video frame to image.
+ \since 5.15
*/
-QImage qt_imageFromVideoFrame(const QVideoFrame &f)
+QImage QVideoFrame::image() const
{
- QVideoFrame &frame = const_cast<QVideoFrame&>(f);
+ QVideoFrame frame = *this;
QImage result;
if (!frame.isValid() || !frame.map(QAbstractVideoBuffer::ReadOnly))
diff --git a/src/multimedia/video/qvideoframe.h b/src/multimedia/video/qvideoframe.h
index 8fcf47fc4..d043442a3 100644
--- a/src/multimedia/video/qvideoframe.h
+++ b/src/multimedia/video/qvideoframe.h
@@ -166,6 +166,8 @@ public:
QVariant metaData(const QString &key) const;
void setMetaData(const QString &key, const QVariant &value);
+ QImage image() const;
+
static PixelFormat pixelFormatFromImageFormat(QImage::Format format);
static QImage::Format imageFormatFromPixelFormat(PixelFormat format);
diff --git a/src/multimedia/video/qvideosurfaces.cpp b/src/multimedia/video/qvideosurfaces.cpp
new file mode 100644
index 000000000..793879382
--- /dev/null
+++ b/src/multimedia/video/qvideosurfaces.cpp
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 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$
+**
+****************************************************************************/
+
+#include "qvideosurfaces_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QVideoSurfaces::QVideoSurfaces(const QVector<QAbstractVideoSurface *> &s, QObject *parent)
+ : QAbstractVideoSurface(parent)
+ , m_surfaces(s)
+{
+ for (auto a : s) {
+ connect(a, &QAbstractVideoSurface::supportedFormatsChanged, this, [this, a] {
+ auto context = property("GLContext").value<QObject *>();
+ if (!context)
+ setProperty("GLContext", a->property("GLContext"));
+
+ emit supportedFormatsChanged();
+ });
+ }
+}
+
+QVideoSurfaces::~QVideoSurfaces()
+{
+}
+
+QList<QVideoFrame::PixelFormat> QVideoSurfaces::supportedPixelFormats(QAbstractVideoBuffer::HandleType type) const
+{
+ QList<QVideoFrame::PixelFormat> result;
+ QMap<QVideoFrame::PixelFormat, int> formats;
+ for (auto &s : m_surfaces) {
+ for (auto &p : s->supportedPixelFormats(type)) {
+ if (++formats[p] == m_surfaces.size())
+ result << p;
+ }
+ }
+
+ return result;
+}
+
+bool QVideoSurfaces::start(const QVideoSurfaceFormat &format)
+{
+ bool result = true;
+ for (auto &s : m_surfaces)
+ result &= s->start(format);
+
+ return result && QAbstractVideoSurface::start(format);
+}
+
+void QVideoSurfaces::stop()
+{
+ for (auto &s : m_surfaces)
+ s->stop();
+
+ QAbstractVideoSurface::stop();
+}
+
+bool QVideoSurfaces::present(const QVideoFrame &frame)
+{
+ bool result = true;
+ for (auto &s : m_surfaces)
+ result &= s->present(frame);
+
+ return result;
+}
+
+QT_END_NAMESPACE
diff --git a/src/multimedia/video/qvideosurfaces_p.h b/src/multimedia/video/qvideosurfaces_p.h
new file mode 100644
index 000000000..67831e74e
--- /dev/null
+++ b/src/multimedia/video/qvideosurfaces_p.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 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 QVIDEOSURFACES_P_H
+#define QVIDEOSURFACES_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 <QAbstractVideoSurface>
+#include <QVector>
+
+QT_BEGIN_NAMESPACE
+
+class QVideoSurfaces : public QAbstractVideoSurface
+{
+public:
+ QVideoSurfaces(const QVector<QAbstractVideoSurface *> &surfaces, QObject *parent = nullptr);
+ ~QVideoSurfaces();
+
+ QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType type) const override;
+ bool start(const QVideoSurfaceFormat &format) override;
+ void stop() override;
+ bool present(const QVideoFrame &frame) override;
+
+private:
+ QVector<QAbstractVideoSurface *> m_surfaces;
+ Q_DISABLE_COPY(QVideoSurfaces)
+};
+
+QT_END_NAMESPACE
+
+#endif // QVIDEOSURFACES_P_H
diff --git a/src/multimedia/video/video.pri b/src/multimedia/video/video.pri
index e5fa697ce..a3668ba4a 100644
--- a/src/multimedia/video/video.pri
+++ b/src/multimedia/video/video.pri
@@ -15,8 +15,8 @@ PRIVATE_HEADERS += \
video/qmemoryvideobuffer_p.h \
video/qvideooutputorientationhandler_p.h \
video/qvideosurfaceoutput_p.h \
- video/qvideoframe_p.h \
- video/qvideoframeconversionhelper_p.h
+ video/qvideoframeconversionhelper_p.h \
+ video/qvideosurfaces_p.h
SOURCES += \
video/qabstractvideobuffer.cpp \
@@ -29,7 +29,8 @@ SOURCES += \
video/qvideosurfaceoutput.cpp \
video/qvideoprobe.cpp \
video/qabstractvideofilter.cpp \
- video/qvideoframeconversionhelper.cpp
+ video/qvideoframeconversionhelper.cpp \
+ video/qvideosurfaces.cpp
SSE2_SOURCES += video/qvideoframeconversionhelper_sse2.cpp
SSSE3_SOURCES += video/qvideoframeconversionhelper_ssse3.cpp