summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-09-08 11:07:23 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-09 18:33:23 +0000
commit48d0bdec9f777d3093ecc0608220de53a526384c (patch)
tree8ced8ae4f4bfcfabecb49a366e2a8dcb70f8da77
parentd18e2c0bfc02fb486516a8475fce9c7c4a6a91b9 (diff)
Remove VideoOutput.autoOrientation property
Late API change. This property got overlooked in earlier reviews. It doesn't make any sense anymore, as the received video frames are always oriented the same way. Adjustments for device/screen orientation on mobile happen inside the camera backend where we rotate the video frames to are aligned with the device orientation. Fixes: QTBUG-94845 Change-Id: Iaa85bf127e2a3144f9eba9baaf9560a49ff07abb Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 4c89d87b6d6499c917f5c9e4ac2a91b13151aeab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/multimediaquick/qquickvideooutput.cpp45
-rw-r--r--src/multimediaquick/qquickvideooutput_p.h8
2 files changed, 0 insertions, 53 deletions
diff --git a/src/multimediaquick/qquickvideooutput.cpp b/src/multimediaquick/qquickvideooutput.cpp
index e18bfccb5..988b77c88 100644
--- a/src/multimediaquick/qquickvideooutput.cpp
+++ b/src/multimediaquick/qquickvideooutput.cpp
@@ -267,11 +267,6 @@ void QQuickVideoOutput::_q_updateGeometry()
emit contentRectChanged();
}
-void QQuickVideoOutput::_q_screenOrientationChanged(int orientation)
-{
- setOrientation(orientation % 360);
-}
-
/*!
\qmlproperty int QtMultimedia::VideoOutput::orientation
@@ -336,46 +331,6 @@ void QQuickVideoOutput::setOrientation(int orientation)
}
/*!
- \qmlproperty bool QtMultimedia::VideoOutput::autoOrientation
-
- This property allows you to enable and disable auto orientation
- of the video stream, so that its orientation always matches
- the orientation of the screen. If \c autoOrientation is enabled,
- the \c orientation property is overwritten.
-
- By default \c autoOrientation is disabled.
-
- \sa orientation
- \since 5.2
-*/
-bool QQuickVideoOutput::autoOrientation() const
-{
- return m_autoOrientation;
-}
-
-void QQuickVideoOutput::setAutoOrientation(bool autoOrientation)
-{
- if (autoOrientation == m_autoOrientation)
- return;
-
- m_autoOrientation = autoOrientation;
- if (m_autoOrientation) {
- m_screenOrientationHandler = new QVideoOutputOrientationHandler(this);
- connect(m_screenOrientationHandler, SIGNAL(orientationChanged(int)),
- this, SLOT(_q_screenOrientationChanged(int)));
-
- _q_screenOrientationChanged(m_screenOrientationHandler->currentOrientation());
- } else {
- disconnect(m_screenOrientationHandler, SIGNAL(orientationChanged(int)),
- this, SLOT(_q_screenOrientationChanged(int)));
- m_screenOrientationHandler->deleteLater();
- m_screenOrientationHandler = nullptr;
- }
-
- emit autoOrientationChanged();
-}
-
-/*!
\qmlproperty rectangle QtMultimedia::VideoOutput::contentRect
This property holds the item coordinates of the area that
diff --git a/src/multimediaquick/qquickvideooutput_p.h b/src/multimediaquick/qquickvideooutput_p.h
index 95c6966e8..07de752ef 100644
--- a/src/multimediaquick/qquickvideooutput_p.h
+++ b/src/multimediaquick/qquickvideooutput_p.h
@@ -74,7 +74,6 @@ class Q_MULTIMEDIAQUICK_EXPORT QQuickVideoOutput : public QQuickItem
Q_DISABLE_COPY(QQuickVideoOutput)
Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged)
Q_PROPERTY(int orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
- Q_PROPERTY(bool autoOrientation READ autoOrientation WRITE setAutoOrientation NOTIFY autoOrientationChanged)
Q_PROPERTY(QRectF sourceRect READ sourceRect NOTIFY sourceRectChanged)
Q_PROPERTY(QRectF contentRect READ contentRect NOTIFY contentRectChanged)
Q_PROPERTY(QVideoSink* videoSink READ videoSink CONSTANT)
@@ -103,9 +102,6 @@ public:
int orientation() const;
void setOrientation(int);
- bool autoOrientation() const;
- void setAutoOrientation(bool);
-
QRectF sourceRect() const;
QRectF contentRect() const;
@@ -113,7 +109,6 @@ Q_SIGNALS:
void sourceChanged();
void fillModeChanged(QQuickVideoOutput::FillMode);
void orientationChanged();
- void autoOrientationChanged();
void sourceRectChanged();
void contentRectChanged();
@@ -139,7 +134,6 @@ private:
private Q_SLOTS:
void _q_newFrame(const QVideoFrame &);
void _q_updateGeometry();
- void _q_screenOrientationChanged(int);
void _q_invalidateSceneGraph();
void _q_sceneGraphInitialized();
@@ -150,8 +144,6 @@ private:
QRectF m_lastRect; // Cache of last rect to avoid recalculating geometry
QRectF m_contentRect; // Destination pixel coordinates, unclipped
int m_orientation = 0;
- bool m_autoOrientation = false;
- QVideoOutputOrientationHandler *m_screenOrientationHandler = nullptr;
Qt::AspectRatioMode m_aspectRatioMode = Qt::KeepAspectRatio;
QPointer<QQuickWindow> m_window;