QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
UVCRecordingCodecComboBox.qml
Go to the documentation of this file.
1import QtQuick
2
3import QGroundControl
4import QGroundControl.Controls
5
6// Picks the codec a recording Qt encodes tries first, a USB camera's or a stream's with the Qt Multimedia video backend,
7// from the ones Qt can encode here. Auto, or a stored codec Qt can't encode here, leaves the choice to the recorder:
8// the first of its fallbacks that encodes.
9LabelledComboBox {
10 id: root
11
12 readonly property Fact _codec: QGroundControl.settingsManager.videoSettings.uvcRecordingCodec
13 readonly property UVCCameraController _camera: QGroundControl.videoManager.uvcCamera
14 readonly property list<string> _codecs: root._camera.recordingCodecs
15
16 label: root._codec.label
17 model: [qsTr("Auto")].concat(root._codecs.map(key => root._camera.recordingCodecName(key)))
18
19 onActivated: (index) => {
20 root._codec.rawValue = (index > 0) ? root._codecs[index - 1] : ""
21 }
22
23 // Follows the setting, also after the user picked an entry.
24 Binding {
25 target: root
26 property: "currentIndex"
27 value: root._codecs.indexOf(root._codec.rawValue) + 1
28 }
29}