summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/qmlvideo/qmlvideo/CameraItem.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia/video/qmlvideo/qmlvideo/CameraItem.qml')
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraItem.qml47
1 files changed, 47 insertions, 0 deletions
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraItem.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraItem.qml
new file mode 100644
index 000000000..d6e4b85b5
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraItem.qml
@@ -0,0 +1,47 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtMultimedia
+
+Item {
+ id: root
+ height: width
+
+ signal fatalError
+ signal sizeChanged
+
+ onHeightChanged: root.sizeChanged()
+
+ CaptureSession {
+ camera: Camera {
+ id: camera
+
+ onErrorOccurred: function(error, errorString) {
+ if (Camera.NoError !== error) {
+ console.log("[qmlvideo] CameraItem.onError error " + error + " errorString " + errorString)
+ root.fatalError()
+ }
+ }
+ }
+ imageCapture: ImageCapture {
+ id: imageCapture
+ }
+
+ recorder: MediaRecorder {
+ id: recorder
+// resolution: "640x480"
+// frameRate: 30
+ }
+ videoOutput: videoOutput
+ }
+
+ VideoOutput {
+ id: videoOutput
+ anchors.fill: parent
+ }
+
+
+ function start() { camera.start() }
+ function stop() { camera.stop() }
+}