On Dec 11 2018, at 10:26 am, René Hansen <[email protected]> wrote:
> So far I haven't seen a case where the VideoOutput doesn't get the
> orientation correct on a Camera preview, but that's still only from a 5-10
> different devices I've tested, (ios, android, mac). That's where I got the
> logic from in my original reply. Have a look at:
>
> https://github.com/qt/qtmultimedia/blob/5.11/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
>
> (https://link.getmailspring.com/link/[email protected]/0?redirect=https%3A%2F%2Fgithub.com%2Fqt%2Fqtmultimedia%2Fblob%2F5.11%2Fsrc%2Fqtmultimediaquicktools%2Fqdeclarativevideooutput.cpp&recipient=aW50ZXJlc3RAcXQtcHJvamVjdC5vcmc%3D)
>
>
Yeah, VideoOutput's orientation - is what I used in first attempt to
'un-rotate' resulting QImage from onImageSaved. But it turned out it works fine
only on 2 devices from 4. (although all of them shows preview properly
rotated!) Seems like actual rotation of resulting image can be calculated as
'rotation from auto-rotated VideoOutput' + 'some device-specific constant'
(which for two devices was zero, for other two - maybe -90 or something).
Unfortunately this 'device-specific constant' doesn't seem to be calculable
from 'camera.orientation', 'Screen.nativeOrientation' (btw, why doesn't it
exposed to QML ?), 'Screen.primaryOrientation' and 'Screen.orientation'.
p.s. I still need to try your original suggestion with taking orientation from
'mediaObject' / C++...
Regards, Alexander
_______________________________________________
Interest mailing list
[email protected]
https://lists.qt-project.org/listinfo/interest