Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8
-
None
Description
It's happened on a few occasions that users have approached us with issues about camera rotations and it is not perfectly clear in the documentation how users should handle this.
I believe one source of confusion here is the property QCameraDevice::correctionAngle. This describes how the camera sensor is oriented relative to the device it's attached to, and so it only makes sense on mobile where the physical camera is attached to a primary device. Additionally, this information is only available on the Android platform. This can easily be misinterpreted as what you want to rely on to rotate your camera-feed in the UI.
I would even argue it's problematic to have this value as the default value, 0 rotation, in the situation where we are not using built-in phone cameras. Both iPadOS and Android supports external USB webcams where the is no orientation relation between device and camera sensor.
Most of the time, users are mostly interested in how to rotate the image so that gravity within the image is oriented correctly in their UI. The way we handle this with VideoOutput today by reading the QVideoFrameFormat::rotation(). Note that this is separate from QVideoFrame::rotation(). We should clarify in the documentation that this is what users should be looking for to make their camera-feed be correctly rotated in relation to the world.