4import QGroundControl.Controls
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.
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
16 label: root._codec.label
17 model: [qsTr("Auto")].concat(root._codecs.map(key => root._camera.recordingCodecName(key)))
19 onActivated: (index) => {
20 root._codec.rawValue = (index > 0) ? root._codecs[index - 1] : ""
23 // Follows the setting, also after the user picked an entry.
26 property: "currentIndex"
27 value: root._codecs.indexOf(root._codec.rawValue) + 1