Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2.0, 6.2.1, 6.2, 6.3.0 Alpha
-
6.2.0 RC
-
None
-
-
d7c4152a9cf9ebac86b9b07e78e675cb0ed5c937 (qt/qtmultimedia/dev) acc8442c3261e7c3cf2b397515a202a24d12b343 (qt/qtmultimedia/6.2) f698f9375c9289fe01e883c7fbaba87c81b835f8 (qt/qtmultimedia/6.2.0)
Description
This happens when multiple cameras are available and when we want to switch between those. The next capture triggered after changing the camera device systematically crashes the application:
[1] 2302 segmentation fault /Users/cyril/work/dev/tools/qt/6.2.0/macos/bin/qml -f main.qml
A sample code (a bit long) to reproduce the issue is provided below:
import QtQuick import QtQuick.Controls import QtMultimedia Window { id: root width: 1024 height: 600 visible: true MediaDevices { id: mediaDevices } CaptureSession { id: captureSession videoOutput: output camera: Camera {} imageCapture: ImageCapture { onImageSaved: function (id, path) { image.source = path } } } VideoOutput { id: output anchors.fill: parent Column { ComboBox { id: cameraComboBox model: mediaDevices.videoInputs textRole: "description" displayText: captureSession.camera.cameraDevice.description onActivated: function (index) { captureSession.camera.cameraDevice = cameraComboBox.currentValue } } Button { text: qsTr("Shot!") onClicked: { captureSession.imageCapture.captureToFile() } } } } Window { visible: true x: root.x - width y: root.y width: 250 height: 250 Image { id: image anchors.fill: parent fillMode: Image.PreserveAspectFit } } Component.onCompleted: { captureSession.camera.start() } }