summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-02-12 08:53:01 +0100
committerLars Knoll <lars.knoll@qt.io>2021-02-17 08:27:44 +0000
commitb94b47d472c70124c38d4feb546df26d8015b3be (patch)
treeab744206fb98b100a4bcfcaa6a2d55c8b9f7ed3f
parent4b45c95b5601acbdcd8aee52cf0d8af136b982e3 (diff)
Kill QMediaSource and QMediaSink
Those aren't used anymore, get rid of them. Change-Id: I5a17f18a3c87c2c13a9009b1f99ef9e708f7636a Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/imports/multimedia/plugins.qmltypes21
-rw-r--r--src/imports/multimedia/qdeclarativemediametadata_p.h1
-rw-r--r--src/multimedia/CMakeLists.txt2
-rw-r--r--src/multimedia/audio/qaudiodecoder.cpp16
-rw-r--r--src/multimedia/camera/qcamera.cpp6
-rw-r--r--src/multimedia/camera/qcamera.h2
-rw-r--r--src/multimedia/camera/qcamera_p.h5
-rw-r--r--src/multimedia/camera/qcameraexposure.cpp5
-rw-r--r--src/multimedia/camera/qcameraexposure.h3
-rw-r--r--src/multimedia/camera/qcamerafocus.cpp8
-rw-r--r--src/multimedia/camera/qcamerafocus.h3
-rw-r--r--src/multimedia/camera/qcameraimagecapture.cpp4
-rw-r--r--src/multimedia/camera/qcameraimagecapture.h3
-rw-r--r--src/multimedia/camera/qcameraimageprocessing.cpp4
-rw-r--r--src/multimedia/camera/qcameraimageprocessing.h5
-rw-r--r--src/multimedia/controls/qcameracontrol.h3
-rw-r--r--src/multimedia/controls/qcameraexposurecontrol.h3
-rw-r--r--src/multimedia/controls/qcamerafocuscontrol.h3
-rw-r--r--src/multimedia/controls/qcameraimageprocessingcontrol.h3
-rw-r--r--src/multimedia/multimedia.pro5
-rw-r--r--src/multimedia/playback/qmediaplayer.cpp18
-rw-r--r--src/multimedia/playback/qmediaplaylist.h3
-rw-r--r--src/multimedia/playback/qmediaplaylist_p.h1
-rw-r--r--src/multimedia/playback/qplaylistfileparser.cpp2
-rw-r--r--src/multimedia/qmediasink.cpp89
-rw-r--r--src/multimedia/qmediasink.h69
-rw-r--r--src/multimedia/qmediasource.cpp216
-rw-r--r--src/multimedia/qmediasource.h91
-rw-r--r--src/multimedia/qmediasource_p.h82
-rw-r--r--src/multimedia/recording/qmediarecorder.cpp19
-rw-r--r--src/multimedia/recording/qmediarecorder.h4
-rw-r--r--src/multimediawidgets/qgraphicsvideoitem.cpp11
-rw-r--r--src/multimediawidgets/qgraphicsvideoitem.h1
-rw-r--r--src/multimediawidgets/qvideowidget.cpp12
-rw-r--r--src/multimediawidgets/qvideowidget.h4
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput.cpp7
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_p.h1
-rw-r--r--tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp2
-rw-r--r--tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp11
-rw-r--r--tests/auto/unit/mockbackend/CMakeLists.txt1
-rw-r--r--tests/auto/unit/mockbackend/common.pri1
-rw-r--r--tests/auto/unit/mockbackend/mockmediasource.h44
-rw-r--r--tests/auto/unit/multimedia/CMakeLists.txt2
-rw-r--r--tests/auto/unit/multimedia/multimedia.pro2
-rw-r--r--tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp1
-rw-r--r--tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp3
-rw-r--r--tests/auto/unit/multimedia/qmediasink/CMakeLists.txt17
-rw-r--r--tests/auto/unit/multimedia/qmediasink/qmediasink.pro9
-rw-r--r--tests/auto/unit/multimedia/qmediasink/tst_qmediasink.cpp108
-rw-r--r--tests/auto/unit/multimedia/qmediasource/CMakeLists.txt17
-rw-r--r--tests/auto/unit/multimedia/qmediasource/qmediasource.pro7
-rw-r--r--tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp110
-rw-r--r--tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp1
53 files changed, 68 insertions, 1003 deletions
diff --git a/src/imports/multimedia/plugins.qmltypes b/src/imports/multimedia/plugins.qmltypes
index 4dc0f7c90..d7fc43966 100644
--- a/src/imports/multimedia/plugins.qmltypes
+++ b/src/imports/multimedia/plugins.qmltypes
@@ -307,7 +307,7 @@ Module {
}
Component {
name: "QCamera"
- prototype: "QMediaSource"
+ prototype: "QObject"
Enum {
name: "Status"
values: {
@@ -1743,25 +1743,6 @@ Module {
Parameter { name: "rectangle"; type: "QRectF" }
}
}
- Component {
- name: "QMediaSource"
- prototype: "QObject"
- Property { name: "notifyInterval"; type: "int" }
- Signal {
- name: "notifyIntervalChanged"
- Parameter { name: "milliSeconds"; type: "int" }
- }
- Signal {
- name: "metaDataAvailableChanged"
- Parameter { name: "available"; type: "bool" }
- }
- Signal { name: "metaDataChanged" }
- Signal {
- name: "metaDataChanged"
- Parameter { name: "key"; type: "string" }
- Parameter { name: "value"; type: "QVariant" }
- }
- }
Component { name: "QSGVideoItemSurface"; prototype: "QAbstractVideoSurface" }
Component {
name: "QSoundEffect"
diff --git a/src/imports/multimedia/qdeclarativemediametadata_p.h b/src/imports/multimedia/qdeclarativemediametadata_p.h
index 9c5353de8..3c5313b04 100644
--- a/src/imports/multimedia/qdeclarativemediametadata_p.h
+++ b/src/imports/multimedia/qdeclarativemediametadata_p.h
@@ -54,7 +54,6 @@
#include <QtQml/qqml.h>
#include <QtMultimedia/qmediametadata.h>
#include <QtMultimedia/qmediaservice.h>
-#include "qmediasource.h"
#include "qmediametadata.h"
QT_BEGIN_NAMESPACE
diff --git a/src/multimedia/CMakeLists.txt b/src/multimedia/CMakeLists.txt
index 1b59bc192..c9f7dce35 100644
--- a/src/multimedia/CMakeLists.txt
+++ b/src/multimedia/CMakeLists.txt
@@ -55,8 +55,6 @@ qt_internal_add_module(Multimedia
qmediametadata.cpp qmediametadata.h
qmediapluginloader.cpp qmediapluginloader_p.h
qmediaservice.cpp qmediaservice.h qmediaservice_p.h
- qmediasink.cpp qmediasink.h
- qmediasource.cpp qmediasource.h qmediasource_p.h
qmediastoragelocation.cpp qmediastoragelocation_p.h
qmediatimerange.cpp qmediatimerange.h
qmultimedia.cpp qmultimedia.h
diff --git a/src/multimedia/audio/qaudiodecoder.cpp b/src/multimedia/audio/qaudiodecoder.cpp
index 94cca780a..aba7e5f58 100644
--- a/src/multimedia/audio/qaudiodecoder.cpp
+++ b/src/multimedia/audio/qaudiodecoder.cpp
@@ -40,11 +40,11 @@
#include "qtmultimediaglobal_p.h"
#include "qaudiodecoder.h"
-#include "qmediasource_p.h"
#include <qmediaservice.h>
#include "qaudiodecodercontrol.h"
#include <private/qmediaplatformintegration_p.h>
+#include <private/qobject_p.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qmetaobject.h>
@@ -72,15 +72,11 @@ QT_BEGIN_NAMESPACE
\sa QAudioBuffer
*/
-static void qRegisterAudioDecoderMetaTypes()
-{
- qRegisterMetaType<QAudioDecoder::State>("QAudioDecoder::State");
- qRegisterMetaType<QAudioDecoder::Error>("QAudioDecoder::Error");
-}
+#define Q_DECLARE_NON_CONST_PUBLIC(Class) \
+ inline Class* q_func() { return static_cast<Class *>(q_ptr); } \
+ friend class Class;
-Q_CONSTRUCTOR_FUNCTION(qRegisterAudioDecoderMetaTypes)
-
-class QAudioDecoderPrivate : public QMediaSourcePrivate
+class QAudioDecoderPrivate : public QObjectPrivate
{
Q_DECLARE_NON_CONST_PUBLIC(QAudioDecoder)
@@ -94,6 +90,8 @@ public:
void _q_error(int error, const QString &errorString);
};
+#undef Q_DECLARE_NON_CONST_PUBLIC
+
void QAudioDecoderPrivate::_q_stateChanged(QAudioDecoder::State ps)
{
Q_Q(QAudioDecoder);
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp
index a1928bfb2..40f0b24fd 100644
--- a/src/multimedia/camera/qcamera.cpp
+++ b/src/multimedia/camera/qcamera.cpp
@@ -289,7 +289,11 @@ QCameraImageProcessing *QCamera::imageProcessing() const
}
/*!
- Sets the QMediaSink based camera \a viewfinder.
+ Sets a QObject based camera \a viewfinder.
+
+ A QObject based viewfinder is expected to have an invokable videoSurface()
+ method that returns a QAbstractVideoSurface.
+
The previously set viewfinder is detached.
*/
void QCamera::setViewfinder(QObject *viewfinder)
diff --git a/src/multimedia/camera/qcamera.h b/src/multimedia/camera/qcamera.h
index 8946aabf3..44afdbd03 100644
--- a/src/multimedia/camera/qcamera.h
+++ b/src/multimedia/camera/qcamera.h
@@ -46,7 +46,7 @@
#include <QtCore/qpoint.h>
#include <QtCore/qrect.h>
-#include <QtMultimedia/qmediasource.h>
+#include <QtCore/qobject.h>
#include <QtMultimedia/qcameraexposure.h>
#include <QtMultimedia/qcamerafocus.h>
diff --git a/src/multimedia/camera/qcamera_p.h b/src/multimedia/camera/qcamera_p.h
index fc80540b4..ec61a002b 100644
--- a/src/multimedia/camera/qcamera_p.h
+++ b/src/multimedia/camera/qcamera_p.h
@@ -51,7 +51,7 @@
// We mean it.
//
-#include "qmediasource_p.h"
+#include "private/qobject_p.h"
#include "qcamera.h"
#include "qcamerainfo.h"
@@ -62,7 +62,7 @@ class QMediaPlatformCaptureInterface;
class QCameraPrivate : public QObjectPrivate
{
- Q_DECLARE_NON_CONST_PUBLIC(QCamera)
+ Q_DECLARE_PUBLIC(QCamera)
public:
QCameraPrivate()
: QObjectPrivate(),
@@ -85,7 +85,6 @@ public:
QCameraFocus *cameraFocus = nullptr;
QCameraImageProcessing *imageProcessing = nullptr;
- QMediaSink *viewfinder = nullptr;
QObject *capture = nullptr;
QCamera::State state;
diff --git a/src/multimedia/camera/qcameraexposure.cpp b/src/multimedia/camera/qcameraexposure.cpp
index 0c8668c60..b18337792 100644
--- a/src/multimedia/camera/qcameraexposure.cpp
+++ b/src/multimedia/camera/qcameraexposure.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qcameraexposure.h"
-#include "qmediasource_p.h"
+#include "private/qobject_p.h"
#include <qcamera.h>
#include <qcameraexposurecontrol.h>
@@ -63,10 +63,9 @@ QT_BEGIN_NAMESPACE
//#define DEBUG_EXPOSURE_CHANGES 1
-
class QCameraExposurePrivate
{
- Q_DECLARE_NON_CONST_PUBLIC(QCameraExposure)
+ Q_DECLARE_PUBLIC(QCameraExposure)
public:
void init(QCameraControl *cameraControl);
QCameraExposure *q_ptr;
diff --git a/src/multimedia/camera/qcameraexposure.h b/src/multimedia/camera/qcameraexposure.h
index d6550c6e3..9c3e8cbff 100644
--- a/src/multimedia/camera/qcameraexposure.h
+++ b/src/multimedia/camera/qcameraexposure.h
@@ -40,7 +40,8 @@
#ifndef QCAMERAEXPOSURE_H
#define QCAMERAEXPOSURE_H
-#include <QtMultimedia/qmediasource.h>
+#include <QtCore/qobject.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmediaenumdebug.h>
QT_BEGIN_NAMESPACE
diff --git a/src/multimedia/camera/qcamerafocus.cpp b/src/multimedia/camera/qcamerafocus.cpp
index badc765c3..6fbec82e9 100644
--- a/src/multimedia/camera/qcamerafocus.cpp
+++ b/src/multimedia/camera/qcamerafocus.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qcamerafocus.h"
-#include "qmediasource_p.h"
+#include "private/qobject_p.h"
#include <qcamera.h>
#include <qcameracontrol.h>
@@ -247,8 +247,11 @@ void QCameraFocusZone::setStatus(QCameraFocusZone::FocusZoneStatus status)
\sa QCameraFocusZone
*/
+#define Q_DECLARE_NON_CONST_PUBLIC(Class) \
+ inline Class* q_func() { return static_cast<Class *>(q_ptr); } \
+ friend class Class;
-class QCameraFocusPrivate : public QMediaSourcePrivate
+class QCameraFocusPrivate : public QObjectPrivate
{
Q_DECLARE_NON_CONST_PUBLIC(QCameraFocus)
public:
@@ -261,6 +264,7 @@ public:
float zoomFactor = 1.;
};
+#undef Q_DECLARE_NON_CONST_PUBLIC
void QCameraFocusPrivate::init(QCameraControl *cameraControl)
{
diff --git a/src/multimedia/camera/qcamerafocus.h b/src/multimedia/camera/qcamerafocus.h
index ecdb7b623..92946e1ae 100644
--- a/src/multimedia/camera/qcamerafocus.h
+++ b/src/multimedia/camera/qcamerafocus.h
@@ -46,8 +46,9 @@
#include <QtCore/qpoint.h>
#include <QtCore/qrect.h>
#include <QtCore/qshareddata.h>
+#include <QtCore/qobject.h>
-#include <QtMultimedia/qmediasource.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmediaenumdebug.h>
QT_BEGIN_NAMESPACE
diff --git a/src/multimedia/camera/qcameraimagecapture.cpp b/src/multimedia/camera/qcameraimagecapture.cpp
index 6f1d610f5..6b0d4cb9e 100644
--- a/src/multimedia/camera/qcameraimagecapture.cpp
+++ b/src/multimedia/camera/qcameraimagecapture.cpp
@@ -42,7 +42,7 @@
#include <qmediametadata.h>
#include <private/qmediaplatformcaptureinterface_p.h>
-#include "qmediasource_p.h"
+#include "private/qobject_p.h"
#include <qmediaservice.h>
#include <qcamera.h>
#include <qcameracontrol.h>
@@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE
class QCameraImageCapturePrivate
{
- Q_DECLARE_NON_CONST_PUBLIC(QCameraImageCapture)
+ Q_DECLARE_PUBLIC(QCameraImageCapture)
public:
QCamera *camera = nullptr;
diff --git a/src/multimedia/camera/qcameraimagecapture.h b/src/multimedia/camera/qcameraimagecapture.h
index 4b7684ca4..1ca4111bc 100644
--- a/src/multimedia/camera/qcameraimagecapture.h
+++ b/src/multimedia/camera/qcameraimagecapture.h
@@ -40,9 +40,8 @@
#ifndef QCAMERAIMAGECAPTURE_H
#define QCAMERAIMAGECAPTURE_H
-#include <QtMultimedia/qmediasource.h>
+#include <QtCore/qobject.h>
#include <QtMultimedia/qmediaencodersettings.h>
-#include <QtMultimedia/qmediasink.h>
#include <QtMultimedia/qvideoframe.h>
#include <QtMultimedia/qmediaenumdebug.h>
diff --git a/src/multimedia/camera/qcameraimageprocessing.cpp b/src/multimedia/camera/qcameraimageprocessing.cpp
index 502bcf07a..49e77b023 100644
--- a/src/multimedia/camera/qcameraimageprocessing.cpp
+++ b/src/multimedia/camera/qcameraimageprocessing.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qcameraimageprocessing.h"
-#include "qmediasource_p.h"
+#include "private/qobject_p.h"
#include <qcameracontrol.h>
#include <qcameraimageprocessingcontrol.h>
@@ -81,7 +81,7 @@ QT_BEGIN_NAMESPACE
\sa QCameraImageProcessingControl
*/
-class QCameraImageProcessingPrivate : public QMediaSourcePrivate
+class QCameraImageProcessingPrivate : public QObjectPrivate
{
public:
void init(QCameraControl *cameraControl);
diff --git a/src/multimedia/camera/qcameraimageprocessing.h b/src/multimedia/camera/qcameraimageprocessing.h
index d77e9a694..b2e31536d 100644
--- a/src/multimedia/camera/qcameraimageprocessing.h
+++ b/src/multimedia/camera/qcameraimageprocessing.h
@@ -45,10 +45,9 @@
#include <QtCore/qsize.h>
#include <QtCore/qpoint.h>
#include <QtCore/qrect.h>
+#include <QtCore/qobject.h>
-#include <QtMultimedia/qmediaservice.h>
-#include <QtMultimedia/qmediasource.h>
-#include <QtMultimedia/qmediaservice.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmediaenumdebug.h>
QT_BEGIN_NAMESPACE
diff --git a/src/multimedia/controls/qcameracontrol.h b/src/multimedia/controls/qcameracontrol.h
index 0541e26aa..f542eefbe 100644
--- a/src/multimedia/controls/qcameracontrol.h
+++ b/src/multimedia/controls/qcameracontrol.h
@@ -40,8 +40,9 @@
#ifndef QCAMERACONTROL_H
#define QCAMERACONTROL_H
+#include <QtCore/qobject.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmediaservice.h>
-#include <QtMultimedia/qmediasource.h>
#include <QtMultimedia/qcamera.h>
diff --git a/src/multimedia/controls/qcameraexposurecontrol.h b/src/multimedia/controls/qcameraexposurecontrol.h
index 7fc8ae93b..862355bdb 100644
--- a/src/multimedia/controls/qcameraexposurecontrol.h
+++ b/src/multimedia/controls/qcameraexposurecontrol.h
@@ -40,8 +40,9 @@
#ifndef QCAMERAEXPOSURECONTROL_H
#define QCAMERAEXPOSURECONTROL_H
+#include <QtCore/qobject.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmediaservice.h>
-#include <QtMultimedia/qmediasource.h>
#include <QtMultimedia/qcameraexposure.h>
#include <QtMultimedia/qcamera.h>
diff --git a/src/multimedia/controls/qcamerafocuscontrol.h b/src/multimedia/controls/qcamerafocuscontrol.h
index cf5c391bd..1d066a1cb 100644
--- a/src/multimedia/controls/qcamerafocuscontrol.h
+++ b/src/multimedia/controls/qcamerafocuscontrol.h
@@ -40,8 +40,9 @@
#ifndef QCAMERAFOCUSCONTROL_H
#define QCAMERAFOCUSCONTROL_H
+#include <QtCore/qobject.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmediaservice.h>
-#include <QtMultimedia/qmediasource.h>
#include <QtMultimedia/qcamerafocus.h>
diff --git a/src/multimedia/controls/qcameraimageprocessingcontrol.h b/src/multimedia/controls/qcameraimageprocessingcontrol.h
index ee5aa1c0e..ce8ed50ad 100644
--- a/src/multimedia/controls/qcameraimageprocessingcontrol.h
+++ b/src/multimedia/controls/qcameraimageprocessingcontrol.h
@@ -40,8 +40,9 @@
#ifndef QCAMERAIMAGEPROCESSINGCONTROL_H
#define QCAMERAIMAGEPROCESSINGCONTROL_H
+#include <QtCore/qobject.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmediaservice.h>
-#include <QtMultimedia/qmediasource.h>
#include <QtMultimedia/qcamera.h>
#include <QtMultimedia/qmediaenumdebug.h>
diff --git a/src/multimedia/multimedia.pro b/src/multimedia/multimedia.pro
index 7657fec00..47ed2414c 100644
--- a/src/multimedia/multimedia.pro
+++ b/src/multimedia/multimedia.pro
@@ -11,7 +11,6 @@ INCLUDEPATH *= .
PRIVATE_HEADERS += \
qtmultimediaglobal_p.h \
- qmediasource_p.h \
qmediapluginloader_p.h \
qmediaservice_p.h \
qmediastoragelocation_p.h \
@@ -20,22 +19,18 @@ PRIVATE_HEADERS += \
PUBLIC_HEADERS += \
qtmultimediaglobal.h \
qmediadevicemanager.h \
- qmediasink.h \
qmediaenumdebug.h \
qmediametadata.h \
- qmediasource.h \
qmediaservice.h \
qmediatimerange.h \
qmultimedia.h \
qmediaformat.h
SOURCES += \
- qmediasink.cpp \
qmediadevicemanager.cpp \
qmediametadata.cpp \
qmediapluginloader.cpp \
qmediaservice.cpp \
- qmediasource.cpp \
qmediatimerange.cpp \
qmediastoragelocation.cpp \
qmultimedia.cpp \
diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp
index 5dbe9aa2a..b0b978388 100644
--- a/src/multimedia/playback/qmediaplayer.cpp
+++ b/src/multimedia/playback/qmediaplayer.cpp
@@ -40,7 +40,7 @@
#include "qmediaplayer.h"
#include "qvideosurfaces_p.h"
-#include "qmediasource_p.h"
+#include "private/qobject_p.h"
#include <qmediaservice.h>
#include <qmediaplayercontrol.h>
#include <private/qmediaplatformplayerinterface_p.h>
@@ -75,15 +75,7 @@ QT_BEGIN_NAMESPACE
QVideoWidget can be used with QMediaPlayer for video rendering.
- Since QMediaPlayer is a QMediaSource, you can use several of the QMediaSource
- functions for things like:
-
- \list
- \li Accessing the currently playing media's metadata (\l {QMediaSource::metaData()} and \l {QMediaMetaData}{predefined meta-data keys})
- \li Checking to see if the media playback service is currently available (\l {QMediaSource::availability()})
- \endlist
-
- \sa QMediaSource, QMediaService, QVideoWidget
+ \sa QVideoWidget
*/
static void qRegisterMediaPlayerMetaTypes()
@@ -95,9 +87,9 @@ static void qRegisterMediaPlayerMetaTypes()
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaPlayerMetaTypes)
-class QMediaPlayerPrivate : public QMediaSourcePrivate
+class QMediaPlayerPrivate : public QObjectPrivate
{
- Q_DECLARE_NON_CONST_PUBLIC(QMediaPlayer)
+ Q_DECLARE_PUBLIC(QMediaPlayer)
public:
QMediaPlayerPrivate() : notifyTimer(nullptr) {}
@@ -1030,7 +1022,7 @@ QStringList QMediaPlayer::supportedCustomAudioRoles() const
The value is the current playback position, expressed in milliseconds since
the beginning of the media. Periodically changes in the position will be
indicated with the signal positionChanged(), the interval between updates
- can be set with QMediaSource's method setNotifyInterval().
+ can be set with setNotifyInterval().
*/
/*!
diff --git a/src/multimedia/playback/qmediaplaylist.h b/src/multimedia/playback/qmediaplaylist.h
index 506a3348a..aada813de 100644
--- a/src/multimedia/playback/qmediaplaylist.h
+++ b/src/multimedia/playback/qmediaplaylist.h
@@ -42,8 +42,7 @@
#include <QtCore/qobject.h>
-#include <QtMultimedia/qmediasource.h>
-#include <QtMultimedia/qmediasink.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmediaenumdebug.h>
diff --git a/src/multimedia/playback/qmediaplaylist_p.h b/src/multimedia/playback/qmediaplaylist_p.h
index 958d925d0..2a789aec0 100644
--- a/src/multimedia/playback/qmediaplaylist_p.h
+++ b/src/multimedia/playback/qmediaplaylist_p.h
@@ -54,7 +54,6 @@
#include "qmediaplaylist.h"
#include "qmediaplayer.h"
#include "qmediaplayercontrol.h"
-#include "qmediasource_p.h"
#include "qplaylistfileparser_p.h"
#include <QtCore/qdebug.h>
diff --git a/src/multimedia/playback/qplaylistfileparser.cpp b/src/multimedia/playback/qplaylistfileparser.cpp
index 885129823..42e8a7601 100644
--- a/src/multimedia/playback/qplaylistfileparser.cpp
+++ b/src/multimedia/playback/qplaylistfileparser.cpp
@@ -41,10 +41,10 @@
#include <qfileinfo.h>
#include <QtCore/QDebug>
#include <QtCore/qiodevice.h>
+#include <QtCore/qpointer.h>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
#include "qmediaplayer.h"
-#include "qmediasource_p.h"
#include "qmediametadata.h"
QT_BEGIN_NAMESPACE
diff --git a/src/multimedia/qmediasink.cpp b/src/multimedia/qmediasink.cpp
deleted file mode 100644
index 0ad0abf1e..000000000
--- a/src/multimedia/qmediasink.cpp
+++ /dev/null
@@ -1,89 +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$
-**
-****************************************************************************/
-
-#include <qmediasink.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QMediaSink
- \inmodule QtMultimedia
-
- \ingroup multimedia
- \ingroup multimedia_core
-
-
- \brief The QMediaSink class is the base class for objects extending media objects functionality.
-
- \sa
-*/
-
-/*!
- Destroys a media helper object.
-*/
-
-QMediaSink::~QMediaSink()
-{
-}
-
-/*!
- \fn QMediaSink::mediaSource() const
-
- Return the currently attached media object.
-*/
-
-
-/*!
- \fn QMediaSink::setMediaSource(QMediaSource *object)
-
- Attaches to the media \a object.
- Returns true if attached successfully, otherwise returns false.
-*/
-
-/*!
- \fn QObject *QMediaSink::asObject()
-
- returns this QMediaSink cast to a QObject
-
- Reimplement this method to simply return the object that implements the QMediaSink interface.
- This is required so Qt can operate with QObjects when connecting QMediaSource's to QMediaSink's.
-*/
-
-QT_END_NAMESPACE
-
diff --git a/src/multimedia/qmediasink.h b/src/multimedia/qmediasink.h
deleted file mode 100644
index 062f3048c..000000000
--- a/src/multimedia/qmediasink.h
+++ /dev/null
@@ -1,69 +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 QMEDIASINK_H
-#define QMEDIASINK_H
-
-#include <QtMultimedia/qmediasource.h>
-
-QT_BEGIN_NAMESPACE
-
-
-class QMediaSource;
-
-class Q_MULTIMEDIA_EXPORT QMediaSink
-{
-public:
- virtual ~QMediaSink();
-
- virtual QMediaSource *mediaSource() const = 0;
- virtual QObject *asObject() = 0;
-
-protected:
- friend class QMediaSource;
- virtual bool setMediaSource(QMediaSource *object) = 0;
-};
-
-#define QMediaSink_iid "org.qt-project.qt.mediasink/5.0"
-Q_DECLARE_INTERFACE(QMediaSink, QMediaSink_iid)
-
-QT_END_NAMESPACE
-
-
-#endif // QMEDIASINK_H
diff --git a/src/multimedia/qmediasource.cpp b/src/multimedia/qmediasource.cpp
deleted file mode 100644
index 5015f7e77..000000000
--- a/src/multimedia/qmediasource.cpp
+++ /dev/null
@@ -1,216 +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$
-**
-****************************************************************************/
-
-#include <QtCore/qmetaobject.h>
-#include <QtCore/qdebug.h>
-
-#include "qmediasource_p.h"
-
-#include <qmediaservice.h>
-#include <qmediasink.h>
-#include <qmediametadata.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QMediaSource
-
- \brief The QMediaSource class provides a common base for multimedia objects.
- \inmodule QtMultimedia
-
- \ingroup multimedia
- \ingroup multimedia_core
-
- It provides some basic functionality that is common to other high level classes
- like \l QMediaPlayer, \l QAudioDecoder and \l QCamera, including availability
- and meta-data functionality.
-
- The higher level QMediaSource derived classes provide the actual multimedia
- functionality, by internally using a QMediaService. Each media object
- hosts a QMediaService and uses the QMediaControl interfaces implemented by the service to implement its
- API. These controls can be accessed from the media object if necessary, but in general
- the useful functionality can be accessed from the higher level classes.
-
- Most media objects when constructed will request a new
- QMediaService instance, but some like
- QMediaRecorder and QMediaRecorder will share a service with another object.
-
- \sa QMediaService, QMediaControl
-*/
-
-/*!
- Destroys this media object.
-*/
-
-QMediaSource::~QMediaSource()
-{
-}
-
-/*!
- Returns the availability of the functionality offered by this object.
-
- In some cases the functionality may not be available (for example, if
- the current operating system or platform does not provide the required
- functionality), or it may be temporarily unavailable (for example,
- audio playback during a phone call or similar).
-*/
-
-QMultimedia::AvailabilityStatus QMediaSource::availability() const
-{
- if (d_func()->service == nullptr)
- return QMultimedia::ServiceMissing;
-
- return QMultimedia::Available;
-}
-
-/*!
- \fn bool QMediaSource::isAvailable() const
-
- Returns true if the service is available for use.
-*/
-
-/*!
- Returns the media service that provides the functionality of this multimedia object.
-*/
-
-QMediaService* QMediaSource::service() const
-{
- return d_func()->service;
-}
-
-/*!
- Bind \a object to this QMediaSource instance.
-
- This method establishes a relationship between this media object and a
- helper object. The nature of the relationship depends on both parties. This
- methods returns true if the helper was successfully bound, false otherwise.
-
- Most subclasses of QMediaSource provide more convenient functions
- that wrap this functionality, so this function rarely needs to be
- called directly.
-
- The object passed must implement the QMediaSink interface.
-
- \sa QMediaSink
-*/
-bool QMediaSource::bind(QMediaSink *sink)
-{
- if (!sink)
- return false;
-
- QMediaSource *currentObject = sink->mediaSource();
-
- if (currentObject == this)
- return true;
-
- if (currentObject)
- currentObject->unbind(sink);
-
- return sink->setMediaSource(this);
-}
-
-/*!
- Detach \a object from the QMediaSource instance.
-
- Unbind the helper object from this media object. A warning
- will be generated if the object was not previously bound to this
- object.
-
- \sa QMediaSink
-*/
-void QMediaSource::unbind(QMediaSink *sink)
-{
- if (sink && sink->mediaSource() == this)
- sink->setMediaSource(nullptr);
- else
- qWarning() << "QMediaSource: Trying to unbind not connected helper object";
-}
-
-/*!
- Constructs a media object which uses the functionality provided by a media \a service.
-
- The \a parent is passed to QObject.
-
- This class is meant as a base class for multimedia objects so this
- constructor is protected.
-*/
-
-QMediaSource::QMediaSource(QObject *parent, QMediaService *service)
- : QObject(*new QMediaSourcePrivate, parent)
-{
- Q_D(QMediaSource);
-
- d->service = service;
-}
-
-/*!
- \internal
-*/
-
-QMediaSource::QMediaSource(QMediaSourcePrivate &dd, QObject *parent, QMediaService *service)
- : QObject(dd, parent)
-{
- Q_D(QMediaSource);
-
- d->service = service;
-}
-
-/*!
- Returns the value associated with a meta-data \a key.
-
- See the list of predefined \l {QMediaMetaData}{meta-data keys}.
-*/
-QMediaMetaData QMediaSource::metaData() const
-{
- return QMediaMetaData();
-}
-
-/*!
- \fn QMediaSource::metaDataChanged()
-
- Signals that this media object's meta-data has changed.
-
- If multiple meta-data elements are changed,
- metaDataChanged(const QString &key, const QVariant &value) signal is emitted
- for each of them with metaDataChanged() changed emitted once.
-*/
-
-QT_END_NAMESPACE
-
-#include "moc_qmediasource.cpp"
diff --git a/src/multimedia/qmediasource.h b/src/multimedia/qmediasource.h
deleted file mode 100644
index 42db044f1..000000000
--- a/src/multimedia/qmediasource.h
+++ /dev/null
@@ -1,91 +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 QABSTRACTMEDIASOURCE_H
-#define QABSTRACTMEDIASOURCE_H
-
-#include <QtCore/qobject.h>
-#include <QtCore/qstringlist.h>
-
-#include <QtMultimedia/qtmultimediaglobal.h>
-#include <QtMultimedia/qmultimedia.h>
-
-QT_BEGIN_NAMESPACE
-
-
-class QMediaService;
-class QMediaSink;
-class QMediaMetaData;
-
-class QMediaSourcePrivate;
-class Q_MULTIMEDIA_EXPORT QMediaSource : public QObject
-{
- Q_OBJECT
-public:
- ~QMediaSource();
-
- virtual QMultimedia::AvailabilityStatus availability() const;
- bool isAvailable() const
- {
- return availability() == QMultimedia::Available;
- }
-
- virtual QMediaService* service() const;
-
- bool bind(QMediaSink *);
- void unbind(QMediaSink *);
-
- virtual QMediaMetaData metaData() const;
-
-Q_SIGNALS:
- void metaDataChanged();
-
-protected:
- QMediaSource(QObject *parent, QMediaService *service);
- QMediaSource(QMediaSourcePrivate &dd, QObject *parent, QMediaService *service);
-
-private:
- Q_DECLARE_PRIVATE(QMediaSource)
-};
-
-
-QT_END_NAMESPACE
-
-
-#endif // QABSTRACTMEDIASOURCE_H
diff --git a/src/multimedia/qmediasource_p.h b/src/multimedia/qmediasource_p.h
deleted file mode 100644
index 756c86955..000000000
--- a/src/multimedia/qmediasource_p.h
+++ /dev/null
@@ -1,82 +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 QABSTRACTMEDIAOBJECT_P_H
-#define QABSTRACTMEDIAOBJECT_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/qbytearray.h>
-#include <QtCore/qset.h>
-#include <QtCore/qtimer.h>
-
-#include "qmediasource.h"
-#include "private/qobject_p.h"
-
-QT_BEGIN_NAMESPACE
-
-#define Q_DECLARE_NON_CONST_PUBLIC(Class) \
- inline Class* q_func() { return static_cast<Class *>(q_ptr); } \
- friend class Class;
-
-
-class QMediaSourcePrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QMediaSource)
-
-public:
- QMediaSourcePrivate() : service(nullptr) {}
- virtual ~QMediaSourcePrivate() {}
-
- QMediaService *service;
-};
-
-QT_END_NAMESPACE
-
-
-#endif
diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp
index 6097752df..5190afa8d 100644
--- a/src/multimedia/recording/qmediarecorder.cpp
+++ b/src/multimedia/recording/qmediarecorder.cpp
@@ -41,7 +41,6 @@
#include "qmediarecorder_p.h"
#include <qmediarecordercontrol.h>
-#include "qmediasource_p.h"
#include <qmediaservice.h>
#include <qaudiodeviceinfo.h>
#include <qcamera.h>
@@ -53,6 +52,7 @@
#include <QtCore/qurl.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qmetaobject.h>
+#include <QtCore/qtimer.h>
#include <qaudioformat.h>
@@ -149,23 +149,8 @@ void QMediaRecorderPrivate::restartCamera()
}
}
-class QAudioRecorderObject : public QMediaSource
-{
-public:
- QAudioRecorderObject(QObject *parent, QMediaService *service)
- : QMediaSource(parent, service)
- {
- }
-
- ~QAudioRecorderObject() override
- {
- }
-};
-
/*!
- Constructs a media recorder which records the media produced by \a mediaSource.
-
- The \a parent is passed to QMediaSource.
+ Constructs a media recorder which records the media produced by a microphone and camera.
*/
QMediaRecorder::QMediaRecorder(QMediaRecorder::CaptureMode mode, QObject *parent)
diff --git a/src/multimedia/recording/qmediarecorder.h b/src/multimedia/recording/qmediarecorder.h
index 1d1c815a3..4b7cfa109 100644
--- a/src/multimedia/recording/qmediarecorder.h
+++ b/src/multimedia/recording/qmediarecorder.h
@@ -40,10 +40,10 @@
#ifndef QMEDIARECORDER_H
#define QMEDIARECORDER_H
+#include <QtCore/qobject.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmultimedia.h>
-#include <QtMultimedia/qmediasource.h>
#include <QtMultimedia/qmediaencodersettings.h>
-#include <QtMultimedia/qmediasink.h>
#include <QtMultimedia/qmediaenumdebug.h>
#include <QtMultimedia/qmediametadata.h>
diff --git a/src/multimediawidgets/qgraphicsvideoitem.cpp b/src/multimediawidgets/qgraphicsvideoitem.cpp
index 871d5e3f8..66f09d672 100644
--- a/src/multimediawidgets/qgraphicsvideoitem.cpp
+++ b/src/multimediawidgets/qgraphicsvideoitem.cpp
@@ -63,7 +63,6 @@ public:
QGraphicsVideoItem *q_ptr = nullptr;
QPainterVideoSurface *surface = nullptr;
- QPointer<QMediaSource> mediaSource;
QMediaService *service = nullptr;
Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio;
QRectF rect;
@@ -151,22 +150,20 @@ void QGraphicsVideoItemPrivate::_q_serviceDestroyed()
/*!
\class QGraphicsVideoItem
- \brief The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaSource.
+ \brief The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaPlayer or QCamera.
\inmodule QtMultimediaWidgets
\ingroup multimedia
- Attaching a QGraphicsVideoItem to a QMediaSource allows it to display
- the video or image output of that media object. A QGraphicsVideoItem
- is attached to a media object by passing a pointer to the QMediaSource
- to the setMediaSource() function.
+ Attaching a QGraphicsVideoItem to a QMediaPlayer or QCamera allows it to display
+ the video or image output of that media object.
\snippet multimedia-snippets/video.cpp Video graphics item
\b {Note}: Only a single display output can be attached to a media
object at one time.
- \sa QMediaSource, QMediaPlayer, QVideoWidget
+ \sa QMediaPlayer, QVideoWidget, QCamera
*/
/*!
diff --git a/src/multimediawidgets/qgraphicsvideoitem.h b/src/multimediawidgets/qgraphicsvideoitem.h
index 0121de7b4..ab193b327 100644
--- a/src/multimediawidgets/qgraphicsvideoitem.h
+++ b/src/multimediawidgets/qgraphicsvideoitem.h
@@ -43,7 +43,6 @@
#include <QtWidgets/qgraphicsitem.h>
#include <QtMultimediaWidgets/qvideowidget.h>
-#include <QtMultimedia/qmediasink.h>
#if QT_CONFIG(graphicsview)
diff --git a/src/multimediawidgets/qvideowidget.cpp b/src/multimediawidgets/qvideowidget.cpp
index 819ea7bfd..73c7930df 100644
--- a/src/multimediawidgets/qvideowidget.cpp
+++ b/src/multimediawidgets/qvideowidget.cpp
@@ -41,8 +41,8 @@
#include "qvideowidget_p.h"
#include "qpaintervideosurface_p.h"
-#include <qmediasource.h>
-#include <qmediaservice.h>
+#include <QtCore/qobject.h>
+#include <QtMultimedia/qtmultimediaglobal.h>
#include <qvideowindowcontrol.h>
#include <qvideorenderercontrol.h>
@@ -297,17 +297,15 @@ void QVideoWidgetPrivate::_q_dimensionsChanged()
\ingroup multimedia
\inmodule QtMultimediaWidgets
- Attaching a QVideoWidget to a QMediaSource allows it to display the
- video or image output of that media object. A QVideoWidget is attached
- to media object by passing a pointer to the QMediaSource in its
- constructor, and detached by destroying the QVideoWidget.
+ Attaching a QVideoWidget to a QMediaPlayer or QCamera allows it to display the
+ video or image output of that object.
\snippet multimedia-snippets/video.cpp Video widget
\b {Note}: Only a single display output can be attached to a media
object at one time.
- \sa QMediaSource, QMediaPlayer, QGraphicsVideoItem
+ \sa QCamera, QMediaPlayer, QGraphicsVideoItem
*/
/*!
diff --git a/src/multimediawidgets/qvideowidget.h b/src/multimediawidgets/qvideowidget.h
index 44f265b7b..866e5fef4 100644
--- a/src/multimediawidgets/qvideowidget.h
+++ b/src/multimediawidgets/qvideowidget.h
@@ -43,13 +43,9 @@
#include <QtWidgets/qwidget.h>
#include <QtMultimediaWidgets/qtmultimediawidgetdefs.h>
-#include <QtMultimedia/qmediasink.h>
QT_BEGIN_NAMESPACE
-
-class QMediaSource;
-
class QVideoWidgetPrivate;
class QAbstractVideoSurface;
class Q_MULTIMEDIAWIDGETS_EXPORT QVideoWidget : public QWidget
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
index 93fbd75ab..68515af95 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
@@ -166,13 +166,6 @@ QAbstractVideoSurface *QDeclarativeVideoOutput::videoSurface() const
\qmlproperty variant QtMultimedia::VideoOutput::source
This property holds the source item providing the video frames like MediaPlayer or Camera.
-
- If you are extending your own C++ classes to interoperate with VideoOutput, you can
- either provide a QObject based class with a \c mediaSource property that exposes a
- QMediaSource derived class that has a QVideoRendererControl available, or you can
- provide a QObject based class with a writable \c videoSurface property that can
- accept a QAbstractVideoSurface based class and can follow the correct protocol to
- deliver QVideoFrames to it.
*/
void QDeclarativeVideoOutput::setSource(QObject *source)
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_p.h b/src/qtmultimediaquicktools/qdeclarativevideooutput_p.h
index 6927bccd8..9686aacf9 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_p.h
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_p.h
@@ -64,7 +64,6 @@ Q_MOC_INCLUDE("QtMultimedia/qabstractvideosurface.h")
QT_BEGIN_NAMESPACE
-class QMediaSource;
class QMediaService;
class QDeclarativeVideoBackend;
class QVideoOutputOrientationHandler;
diff --git a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
index c4e65fcdd..9350be709 100644
--- a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
+++ b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
@@ -40,8 +40,6 @@
#include <qvideorenderercontrol.h>
#include <qvideosurfaceformat.h>
-#include <qmediasource.h>
-
class SurfaceHolder : public QObject
{
Q_OBJECT
diff --git a/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp b/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp
index 5fc6c27a6..2bdace79e 100644
--- a/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp
+++ b/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp
@@ -36,7 +36,6 @@
#include <QtQml/qqmlcomponent.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickview.h>
-#include <QtMultimedia/qmediasource.h>
#include <QtMultimedia/qmediaservice.h>
#include <QtMultimedia/qvideowindowcontrol.h>
@@ -47,7 +46,7 @@ class SourceObject : public QObject
Q_OBJECT
Q_PROPERTY(QObject *mediaSource READ mediaSource CONSTANT)
public:
- explicit SourceObject(QMediaSource *mediaSource, QObject *parent = nullptr)
+ explicit SourceObject(QObject *mediaSource, QObject *parent = nullptr)
: QObject(parent), m_mediaSource(mediaSource)
{}
@@ -55,7 +54,7 @@ public:
{ return m_mediaSource; }
private:
- QMediaSource *m_mediaSource;
+ QObject *m_mediaSource;
};
class QtTestWindowControl : public QVideoWindowControl
@@ -129,12 +128,12 @@ public:
QtTestWindowControl *windowControl;
};
-class QtTestVideoObject : public QMediaSource
+class QtTestVideoObject : public QObject
{
Q_OBJECT
public:
- explicit QtTestVideoObject(QtTestVideoService *service):
- QMediaSource(nullptr, service)
+ explicit QtTestVideoObject(QtTestVideoService */*service*/)
+ : QObject(nullptr)
{
}
};
diff --git a/tests/auto/unit/mockbackend/CMakeLists.txt b/tests/auto/unit/mockbackend/CMakeLists.txt
index b63e1f635..5b43b75a9 100644
--- a/tests/auto/unit/mockbackend/CMakeLists.txt
+++ b/tests/auto/unit/mockbackend/CMakeLists.txt
@@ -25,7 +25,6 @@ target_sources(QtMultimediaMockBackend INTERFACE
mockmediarecordercontrol.h
mockmediarecorderservice.h
mockmediaservice.h
- mockmediasource.h
mockmediastreamscontrol.h
mockvideosurface.h
qmockdevicemanager.cpp
diff --git a/tests/auto/unit/mockbackend/common.pri b/tests/auto/unit/mockbackend/common.pri
index cba7b96c7..fd64fe21b 100644
--- a/tests/auto/unit/mockbackend/common.pri
+++ b/tests/auto/unit/mockbackend/common.pri
@@ -1,5 +1,4 @@
INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/mockmediaservice.h \
- $$PWD/mockmediasource.h \
$$PWD/mockvideosurface.h
diff --git a/tests/auto/unit/mockbackend/mockmediasource.h b/tests/auto/unit/mockbackend/mockmediasource.h
deleted file mode 100644
index 5417027a6..000000000
--- a/tests/auto/unit/mockbackend/mockmediasource.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** 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 General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** 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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MOCKMEDIASOURCE_H
-#define MOCKMEDIASOURCE_H
-
-#include "qmediasource.h"
-
-class MockMediaSource : public QMediaSource
-{
- Q_OBJECT
-public:
- MockMediaSource(QObject *parent, QMediaService *service):
- QMediaSource(parent, service)
- {
- }
-};
-
-#endif // MOCKMEDIASOURCE_H
diff --git a/tests/auto/unit/multimedia/CMakeLists.txt b/tests/auto/unit/multimedia/CMakeLists.txt
index dadc0108a..d41004d59 100644
--- a/tests/auto/unit/multimedia/CMakeLists.txt
+++ b/tests/auto/unit/multimedia/CMakeLists.txt
@@ -8,8 +8,6 @@ add_subdirectory(qaudionamespace)
add_subdirectory(qcamera)
add_subdirectory(qcamerainfo)
add_subdirectory(qcameraimagecapture)
-add_subdirectory(qmediasink)
-add_subdirectory(qmediasource)
add_subdirectory(qmediaplayer)
add_subdirectory(qmediaplaylist)
add_subdirectory(qmediapluginloader)
diff --git a/tests/auto/unit/multimedia/multimedia.pro b/tests/auto/unit/multimedia/multimedia.pro
index 9c24c6a7d..6c7906202 100644
--- a/tests/auto/unit/multimedia/multimedia.pro
+++ b/tests/auto/unit/multimedia/multimedia.pro
@@ -9,8 +9,6 @@ SUBDIRS += \
qcamera \
qcamerainfo \
qcameraimagecapture \
- qmediasink \
- qmediasource \
qmediaplayer \
qmediaplaylist \
qmediapluginloader \
diff --git a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp
index 59593c277..9d8a25982 100644
--- a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp
+++ b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp
@@ -35,7 +35,6 @@
#include <qmediarecordercontrol.h>
#include <qaudiodeviceinfo.h>
#include <qaudioinput.h>
-#include <qmediasource.h>
//TESTED_COMPONENT=src/multimedia
diff --git a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp
index 48b14bd4a..f9066d037 100644
--- a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp
+++ b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp
@@ -31,8 +31,6 @@
#include <QtTest/QtTest>
#include <QDebug>
#include <QtMultimedia/qmediametadata.h>
-#include <qmediasource.h>
-#include <qmediaservice.h>
#include <qmediaservice.h>
#include <qmediarecordercontrol.h>
#include <qmediarecorder.h>
@@ -41,7 +39,6 @@
#include "mockmediarecorderservice.h"
#include "mockmediarecordercontrol.h"
-#include "mockmediasource.h"
QT_USE_NAMESPACE
diff --git a/tests/auto/unit/multimedia/qmediasink/CMakeLists.txt b/tests/auto/unit/multimedia/qmediasink/CMakeLists.txt
deleted file mode 100644
index 5ed35ac3c..000000000
--- a/tests/auto/unit/multimedia/qmediasink/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# Generated from qmediasink.pro.
-
-#####################################################################
-## tst_qmediasink Test:
-#####################################################################
-
-qt_add_test(tst_qmediasink
- SOURCES
- tst_qmediasink.cpp
- INCLUDE_DIRECTORIES
- ../../mockbackend
- PUBLIC_LIBRARIES
- # Remove: L${CMAKE_CURRENT_SOURCE_DIR}
- Qt::Gui
- Qt::MultimediaPrivate
- QtMultimediaMockBackend
-)
diff --git a/tests/auto/unit/multimedia/qmediasink/qmediasink.pro b/tests/auto/unit/multimedia/qmediasink/qmediasink.pro
deleted file mode 100644
index 51743bdbe..000000000
--- a/tests/auto/unit/multimedia/qmediasink/qmediasink.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qmediasink
-
-QT += multimedia-private testlib
-
-SOURCES += \
- tst_qmediasink.cpp
-
-include (../../mockbackend/mockbackend.pri)
diff --git a/tests/auto/unit/multimedia/qmediasink/tst_qmediasink.cpp b/tests/auto/unit/multimedia/qmediasink/tst_qmediasink.cpp
deleted file mode 100644
index 612200841..000000000
--- a/tests/auto/unit/multimedia/qmediasink/tst_qmediasink.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** 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 General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** 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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//TESTED_COMPONENT=src/multimedia
-
-#include <QtTest/QtTest>
-#include <qmediasource.h>
-#include <qmediaservice.h>
-#include <qmediaservice.h>
-#include <qmediarecordercontrol.h>
-#include <qmediarecorder.h>
-#include <qaudioformat.h>
-#include <qcamera.h>
-
-#include "mockmediarecordercontrol.h"
-#include "mockmediasource.h"
-
-QT_USE_NAMESPACE
-
-class TestBindableService : public QMediaService
-{
- Q_OBJECT
-public:
- TestBindableService(QObject *parent, QObject *control):
- QMediaService(parent),
- mockControl(control),
- hasControls(true)
- {
- }
-
- QObject *requestControl(const char *name) override
- {
- if (hasControls && qstrcmp(name,QMediaRecorderControl_iid) == 0)
- return mockControl;
-
- return nullptr;
- }
-
- void releaseControl(QObject *) override {}
- //Initialising the objects for the media
- QObject *mockControl;
- bool hasControls;
-};
-
-class tst_QMediaSink:public QObject
-{
- Q_OBJECT
-private slots:
- void init()
- {
-
- }
-
- void cleanup()
- {
-
- }
-
- void testMediaSource() //Verifying the mediasource api
- {
- MockMediaRecorderControl recorderControl(nullptr);
- TestBindableService service(nullptr, &recorderControl);
- QCamera object;
- QMediaRecorder recorder(&object);
- QCamera *obj = recorder.camera();
- QVERIFY(obj != nullptr);
- QVERIFY(obj->isAvailable());
- }
-
- void testDestructor() //Invoking the destructor
- {
- MockMediaRecorderControl recorderControl(nullptr);
- TestBindableService service(nullptr, &recorderControl);
- QCamera object;
- QMediaRecorder *recorder = new QMediaRecorder(&object);
- QVERIFY(recorder->isAvailable());
- delete recorder;
- recorder = nullptr;
- }
-};
-
-QTEST_MAIN(tst_QMediaSink)
-#include "tst_qmediasink.moc"
diff --git a/tests/auto/unit/multimedia/qmediasource/CMakeLists.txt b/tests/auto/unit/multimedia/qmediasource/CMakeLists.txt
deleted file mode 100644
index a281449e0..000000000
--- a/tests/auto/unit/multimedia/qmediasource/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# Generated from qmediasource.pro.
-
-#####################################################################
-## tst_qmediasource Test:
-#####################################################################
-
-qt_add_test(tst_qmediasource
- SOURCES
- tst_qmediasource.cpp
- INCLUDE_DIRECTORIES
- ../../mockbackend
- PUBLIC_LIBRARIES
- # Remove: L${CMAKE_CURRENT_SOURCE_DIR}
- Qt::Gui
- Qt::MultimediaPrivate
- QtMultimediaMockBackend
-)
diff --git a/tests/auto/unit/multimedia/qmediasource/qmediasource.pro b/tests/auto/unit/multimedia/qmediasource/qmediasource.pro
deleted file mode 100644
index 5bc4a884f..000000000
--- a/tests/auto/unit/multimedia/qmediasource/qmediasource.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qmediasource
-QT += multimedia-private testlib
-
-include (../../mockbackend/mockbackend.pri)
-
-SOURCES += tst_qmediasource.cpp
diff --git a/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp b/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp
deleted file mode 100644
index 08452b8fd..000000000
--- a/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** 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 General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** 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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//TESTED_COMPONENT=src/multimedia
-
-#include <QtTest/QtTest>
-
-#include <QtMultimedia/qmediametadata.h>
-#include <qmediasource.h>
-#include <qmediaservice.h>
-
-#include "mockmediarecorderservice.h"
-
-class QtTestMediaObjectService : public QMediaService
-{
- Q_OBJECT
-public:
- QtTestMediaObjectService(QObject *parent = nullptr)
- : QMediaService(parent)
- {
- }
-
- QObject *requestControl(const char *) override
- {
- return nullptr;
- }
-
- void releaseControl(QObject *) override
- {
- }
-};
-
-QT_USE_NAMESPACE
-
-class tst_QMediaSource : public QObject
-{
- Q_OBJECT
-
-private slots:
- void availability();
- void service();
-};
-class QtTestMediaObject : public QMediaSource
-{
- Q_OBJECT
-
-public:
- QtTestMediaObject(QMediaService *service = nullptr): QMediaSource(nullptr, service) {}
-};
-
-void tst_QMediaSource::availability()
-{
- {
- QtTestMediaObject nullObject(nullptr);
- QCOMPARE(nullObject.isAvailable(), false);
- QCOMPARE(nullObject.availability(), QMultimedia::ServiceMissing);
- }
-
- {
- QtTestMediaObjectService service;
- QtTestMediaObject object(&service);
- QCOMPARE(object.isAvailable(), true);
- QCOMPARE(object.availability(), QMultimedia::Available);
- }
-}
-
- void tst_QMediaSource::service()
- {
- // Create the mediaobject with service.
- QtTestMediaObjectService service;
- QtTestMediaObject mediaObject1(&service);
-
- // Get service and Compare if it equal to the service passed as an argument in mediaObject1.
- QMediaService *service1 = mediaObject1.service();
- QVERIFY(service1 != nullptr);
- QCOMPARE(service1,&service);
-
- // Create the mediaobject with empty service and verify that service() returns NULL.
- QtTestMediaObject mediaObject2;
- QMediaService *service2 = mediaObject2.service();
- QVERIFY(service2 == nullptr);
-}
-
-QTEST_GUILESS_MAIN(tst_QMediaSource)
-#include "tst_qmediasource.moc"
diff --git a/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp b/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp
index 126d24763..f2a8dddc4 100644
--- a/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp
+++ b/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp
@@ -31,7 +31,6 @@
#include <qtmultimediaglobal.h>
#include "qgraphicsvideoitem.h"
#include <QtTest/QtTest>
-#include "qmediasource.h"
#include "qmediaservice.h"
#include <private/qpaintervideosurface_p.h>
#include "qvideorenderercontrol.h"