From 2e77a041e162743b49d41fef545b143ae6c3a830 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 25 Jan 2021 14:59:09 +0100 Subject: Cleanup QCameraInfo Various API changes to QCameraInfo: * Remove the camera orientation from our API This is an implementation detail that should never be exposed to the user. For fixed cameras it's uninteresting and for mobile cameras, we can use the physical orientation of the device to create a stream that is oriented the correct way. * Add a QVideoFormat class describing a video format * Add a QList videoFormats() * Add a QList photoResolutions() * Implement the API for gstreamer and macOS. Change-Id: I9ffd9caeb6d07a6f267608a6bd794d99699fffbb Reviewed-by: Doris Verria Reviewed-by: Lars Knoll --- src/qtmultimediaquicktools/qdeclarativevideooutput.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/qtmultimediaquicktools/qdeclarativevideooutput.cpp') diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp index a64a9e157..2aae59509 100644 --- a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp +++ b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -321,7 +322,7 @@ void QDeclarativeVideoOutput::_q_updateCameraInfo() if (m_mediaSource) { const QCamera *camera = qobject_cast(m_mediaSource); if (camera) { - QCameraInfo info(*camera); + QCameraInfo info = camera->cameraInfo(); if (m_cameraInfo != info) { m_cameraInfo = info; @@ -433,20 +434,6 @@ void QDeclarativeVideoOutput::_q_updateGeometry() void QDeclarativeVideoOutput::_q_screenOrientationChanged(int orientation) { - // If the source is a camera, take into account its sensor position and orientation - if (!m_cameraInfo.isNull()) { - switch (m_cameraInfo.position()) { - case QCamera::FrontFace: - // Front facing cameras are flipped horizontally, compensate the mirror - orientation += (360 - m_cameraInfo.orientation()); - break; - case QCamera::BackFace: - default: - orientation += m_cameraInfo.orientation(); - break; - } - } - setOrientation(orientation % 360); } -- cgit v1.2.3