Warning, /plasma/kpipewire/tests/webcamtest.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2023 Aleix Pol Gonzalez <aleixpol@kde.org>
0003
0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006
0007 import QtQuick
0008 import QtQuick.Layouts
0009 import QtQuick.Controls
0010 import org.kde.kirigami as Kirigami
0011 import org.kde.pipewire.monitor as PWMonitor
0012 import org.kde.pipewire as PipeWire
0013 import org.kde.pipewire.record as PWR
0014
0015 Kirigami.ApplicationWindow
0016 {
0017 id: root
0018 width: 500
0019 height: 500
0020 visible: true
0021 property QtObject app
0022
0023 pageStack.initialPage: Kirigami.Page {
0024 ColumnLayout {
0025 anchors.fill: parent
0026
0027 Repeater {
0028 id: rep
0029 model: PWMonitor.MediaMonitor {
0030 role: PWMonitor.MediaMonitor.Camera
0031 }
0032
0033 delegate: Item {
0034 Layout.fillWidth: true
0035 Layout.fillHeight: true
0036 PipeWire.PipeWireSourceItem {
0037 nodeId: model.objectSerial
0038 fd: model.fd
0039 anchors.fill: parent
0040 }
0041
0042 Label {
0043 text: model.display + " xxx " + model.objectSerial
0044 }
0045 PWR.PipeWireRecord {
0046 id: rec
0047 nodeId: model.objectSerial
0048 fd: model.fd
0049 active: recButton.checked
0050 output: "/tmp/banana.webm"
0051 }
0052 Button {
0053 id: recButton
0054 icon.name: "media-record"
0055 checkable: true
0056 }
0057 }
0058 }
0059 }
0060 }
0061 }