-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.5
-
- Qt 6.5.5
- Clang arm64-v8a
- Android 9 ~ 14
Steps to Reproduce
- Launch the camera.
- Navigate to another screen (pop() or push() with StackView).
Hypothesis
- It is assumed that the camera component cannot terminate properly when navigating to another screen.
Request
- Ensure that the camera component terminates properly.
- On Android armeabi-v7a, it works correctly with just active: true, so please align the behavior accordingly.
Snippet
Rectangle {
id: cameraArea
anchors.horizontalCenter: parent.horizontalCenter
width: appWidth >= tabletWidth ? appWidth * 0.45 : useNameArea.width // Use the width of the sibling
height: width
color: "transparent"
MediaDevices {
id: mediaDevices
}
CaptureSession {
camera: Camera {
id: camera
cameraDevice: mediaDevices.defaultVideoInput
whiteBalanceMode: Camera.WhiteBalanceFlash
exposureMode: "ExposureBarcode"
focusMode: Camera.FocusModeAuto
}
imageCapture: ImageCapture {
id: imageCapture
onPreviewChanged: {
decoder.decodeImageQML(imageCapture.preview); // Decode from QR code
}
}
videoOutput: videoOutput
}
VideoOutput {
id: videoOutput
anchors.fill: parent
fillMode: VideoOutput.PreserveAspectCrop
}
}
Workaround
- The screen does not freeze when stopping the camera when the depth of the StackView is changed.
Connections {
target: stack
function onDepthChanged () {
if (camera.active) {
camera.stop()
}
}
}
Supplement
- When active: true is set, the following errors and warnings are displayed
E CameraCaptureSession: Session 0: Failed to create capture session; configuration failed W QtCamera2: Failed to create a capture session:android.hardware.camera2.CameraAccessException: CAMERA_DISCONNECTED (2): checkPidStatus:2212: The camera device has been disconnected
- When zoomFactor is set, the following warning occurs:
W QtCamera2: Cannot set zoom on invalid camera