diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-04-15 14:51:40 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-04-19 11:07:14 +0000 |
commit | b1525638dc5114d3ad110740045afea0b16adec6 (patch) | |
tree | a79ad63cbecc3318124a2e829c3842c1db6ad8d5 /examples/multimedia/declarative-camera/VideoCaptureControls.qml | |
parent | 00fdf006f9740a3886ce24d885ed4907952a8c9e (diff) |
Fix the declarative-camera example
Adjust it to the API changes that happened on the QML side.
Change-Id: I17e6be334ce5a6afb4558f946d8bd7bbcd0a6d32
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples/multimedia/declarative-camera/VideoCaptureControls.qml')
-rw-r--r-- | examples/multimedia/declarative-camera/VideoCaptureControls.qml | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/examples/multimedia/declarative-camera/VideoCaptureControls.qml b/examples/multimedia/declarative-camera/VideoCaptureControls.qml index afcb4bc2c..1f13dec00 100644 --- a/examples/multimedia/declarative-camera/VideoCaptureControls.qml +++ b/examples/multimedia/declarative-camera/VideoCaptureControls.qml @@ -52,7 +52,7 @@ import QtQuick import QtMultimedia FocusScope { - property Camera camera + property CaptureSession captureSession property bool previewAvailable : false property int buttonsPanelWidth: buttonPaneShadow.width @@ -81,22 +81,22 @@ FocusScope { CameraButton { text: "Record" - visible: camera.videoRecorder.recorderStatus == CameraRecorder.LoadedStatus - onClicked: camera.videoRecorder.record() + visible: captureSession.encoder.status !== MediaEncoder.RecordingStatus + onClicked: captureSession.encoder.record() } CameraButton { id: stopButton text: "Stop" - visible: camera.videoRecorder.recorderStatus == CameraRecorder.RecordingStatus - onClicked: camera.videoRecorder.stop() + visible: captureSession.encoder.status === MediaEncoder.RecordingStatus + onClicked: captureSession.encoder.stop() } CameraButton { text: "View" onClicked: captureControls.previewSelected() //don't show View button during recording - visible: camera.videoRecorder.actualLocation && !stopButton.visible + visible: captureSession.encoder.actualLocation && !stopButton.visible } } @@ -111,8 +111,8 @@ FocusScope { spacing: 8 CameraListButton { - model: QtMultimedia.availableCameras - onValueChanged: captureControls.camera.deviceId = value + model: MediaDeviceManager.videoInputs + onValueChanged: captureSession.camera.cameraInfo = value } CameraButton { @@ -135,8 +135,8 @@ FocusScope { width : 100 height: parent.height - currentZoom: camera.digitalZoom - maximumZoom: Math.min(4.0, camera.maximumDigitalZoom) - onZoomTo: camera.setDigitalZoom(value) + currentZoom: captureSession.camera.focus.zoomFactor + maximumZoom: captureSession.camera.focus.maximumZoomFactor + onZoomTo: captureSession.camera.focus.zoomFactor = value } } |