From f783c48a170c8ec86e4904b786a46dae5f07dfa7 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 3 Feb 2014 21:38:56 +0100 Subject: VideoOutput: fix autoOrientation with a camera source. Don't assume the camera frames are always in the same orientation as the display in its primary orientation. We now take into account the camera sensor position and orientation to calculate the viewport orientation. Change-Id: Ib333c87f1804d1010ada42cb757e4fab78d75a04 Reviewed-by: Christian Stromme --- src/multimedia/video/qvideooutputorientationhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/multimedia/video') diff --git a/src/multimedia/video/qvideooutputorientationhandler.cpp b/src/multimedia/video/qvideooutputorientationhandler.cpp index 4c966c02d..06fcb0c6f 100644 --- a/src/multimedia/video/qvideooutputorientationhandler.cpp +++ b/src/multimedia/video/qvideooutputorientationhandler.cpp @@ -73,7 +73,7 @@ void QVideoOutputOrientationHandler::screenOrientationChanged(Qt::ScreenOrientat const QScreen *screen = QGuiApplication::primaryScreen(); const QPlatformScreen *platformScreen = screen->handle(); - const int angle = (360 - screen->angleBetween(platformScreen->nativeOrientation(), orientation)); + const int angle = (360 - screen->angleBetween(platformScreen->nativeOrientation(), orientation)) % 360; if (angle == m_currentOrientation) return; -- cgit v1.2.3