summaryrefslogtreecommitdiffstats
path: root/tests/manual/qml-minimal-camera/qml-minimal-camera.qml
blob: 3965c663ef04874bcaca91d265ad0f105a2b5588 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick
import QtQuick.Controls
import QtMultimedia

ApplicationWindow {
    id: window
    width: 800
    height: 600
    visible: true
    title: qsTr("QmlMinimalCamera")

    MediaDevices {
        id: mediaDevices
    }

    CaptureSession {
        id: captureSession
        videoOutput: output
        camera: Camera {
            id: camera
            cameraDevice: mediaDevices.defaultVideoInput
        }

        Component.onCompleted: camera.start()
    }

    VideoOutput {
        id: output
        visible: true
    }
}