summaryrefslogtreecommitdiffstats
path: root/src/multimedia/controls
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-02-11 09:20:08 +0100
committerLars Knoll <lars.knoll@qt.io>2021-02-17 08:26:34 +0000
commita8eb585f239c2e5c0a5fed8a1a279fbd076c8446 (patch)
tree8edab7e7e297bc42e3ee214bf803e03a393e8ad8 /src/multimedia/controls
parent5b08bbc4a244416ee961e9793cc12a652994573b (diff)
Rework how to set a video output surface
Setting a video output should not require QMediaService anymore. Reverse the logic, by making QAbstractVideoSurface the primary interface. Use runtime method lookup to get a pointer to the video surface from QVideoWidget/QGraphicsVideoItem. QAbstractVideoSurface is now the primary interface for setting up a video output. We will need to add some API there to allow for windows/fullscreen rendering. With this change, QVideoRendererControl/QVideoWindowControl can also be retired as an abstraction layer in the longer term. Change-Id: Iedff18c6b95fedc7cb914075a8c84081080deab1 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia/controls')
-rw-r--r--src/multimedia/controls/qcameracontrol.h3
-rw-r--r--src/multimedia/controls/qmediaplayercontrol.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/multimedia/controls/qcameracontrol.h b/src/multimedia/controls/qcameracontrol.h
index bfe33b363..68e049d30 100644
--- a/src/multimedia/controls/qcameracontrol.h
+++ b/src/multimedia/controls/qcameracontrol.h
@@ -52,6 +52,7 @@ class QString;
class QCameraFocusControl;
class QCameraExposureControl;
class QCameraImageProcessingControl;
+class QVideoRendererControl;
class Q_MULTIMEDIA_EXPORT QCameraControl : public QObject
{
@@ -82,6 +83,8 @@ public:
virtual QCameraExposureControl *exposureControl() { return nullptr; }
virtual QCameraImageProcessingControl *imageProcessingControl() { return nullptr; }
+ virtual void setVideoSurface(QAbstractVideoSurface *surface) = 0;
+
Q_SIGNALS:
void stateChanged(QCamera::State);
void statusChanged(QCamera::Status);
diff --git a/src/multimedia/controls/qmediaplayercontrol.h b/src/multimedia/controls/qmediaplayercontrol.h
index 234e43bd4..886311917 100644
--- a/src/multimedia/controls/qmediaplayercontrol.h
+++ b/src/multimedia/controls/qmediaplayercontrol.h
@@ -103,6 +103,8 @@ public:
virtual QMediaMetaData metaData() const { return {}; }
+ virtual void setVideoSurface(QAbstractVideoSurface *surface) = 0;
+
Q_SIGNALS:
void audioRoleChanged(QAudio::Role role);
void customAudioRoleChanged(const QString &role);