Android: Pass resolution from QImageCapture to still image reader
QImageCapture allows setting image resolution, but this wasn't fully
utilized by the capturing pipeline which was set up with the preview
resolution.
Add QAndroidCamera::setStillCaptureResolution, called from the new
QFFmpegImageCapture::applySettingsToVideoSource() hook. Use this to
create the still ImageReader at the requested resolution, if supported.
Changing the resolution requires switching the CaptureSession, as
readers in the previous one don't support other resolutions. Callbacks
of a replaced session are ignored, so events from an old CaptureSession
don't interfere after swapping to a new one. If the swap fails, restart
the camera as a fallback.
Fixes: QTBUG-149925
Pick-to: 6.12
Change-Id: I9f8a45dd4a6ffef59c93a48d53ae8d32e6fa50e6
Reviewed-by: Nils Petter Skålerud <nils.petter.skalerud@qt.io>
| commit | 5a6aaf898feefa8bae19834b002d817c88c4a7cf |
| parent | 482e18fb3312db70d5913278ad1161f78ea048df |
| author | Mikko Hallamaa <mikko.hallamaa@qt.io> |
| committer | Mikko Hallamaa <mikko.hallamaa@qt.io> |
| commit time | Fri, 9 Oct 2026 07:12:35 +0000 |
- M src/android/jar/src/org/qtproject/qt/android/multimedia/qffmpeg/CameraCaptureSessionStateCallback.java
- M src/android/jar/src/org/qtproject/qt/android/multimedia/qffmpeg/QtCamera2.java
- M src/plugins/multimedia/ffmpeg/android/qandroidcamera.cpp
- M src/plugins/multimedia/ffmpeg/android/qandroidcamera_p.h
- M src/plugins/multimedia/ffmpeg/android/qandroidimagecapture.cpp
- M src/plugins/multimedia/ffmpeg/android/qandroidimagecapture_p.h
- M src/plugins/multimedia/ffmpeg/qffmpegimagecapture.cpp
- M src/plugins/multimedia/ffmpeg/qffmpegimagecapture_p.h
- M tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
- M tests/auto/unit/multimedia/qimagecapture/tst_qimagecapture.cpp