winrt: Fix camera auto rotation
There is no Windows Runtime API to find the camera sensor rotation, so assume that phones always have a camera mounting of 270 degrees. Tablet and webcams remain mounted at the default (0 degrees). As the frame is not flipped automatically by the system, the scan line direction is set to BottomToTop for front-facing cameras to achieve compatibility with other platforms. Task-number: QTBUG-41066 Change-Id: Icf17ecd4aca9fa9d5b24d94e5b21b63ee6f21f28 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
This commit is contained in:
committed by
Yoann Lopes
parent
2b181d5469
commit
791febc1d3
@@ -310,6 +310,16 @@ void QWinRTAbstractVideoRendererControl::setSize(const QSize &size)
|
||||
d->dirtyState = TextureDirty;
|
||||
}
|
||||
|
||||
void QWinRTAbstractVideoRendererControl::setScanLineDirection(QVideoSurfaceFormat::Direction scanLineDirection)
|
||||
{
|
||||
Q_D(QWinRTAbstractVideoRendererControl);
|
||||
|
||||
if (d->format.scanLineDirection() == scanLineDirection)
|
||||
return;
|
||||
|
||||
d->format.setScanLineDirection(scanLineDirection);
|
||||
}
|
||||
|
||||
void QWinRTAbstractVideoRendererControl::setActive(bool active)
|
||||
{
|
||||
Q_D(QWinRTAbstractVideoRendererControl);
|
||||
|
||||
Reference in New Issue
Block a user