summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/qmlvideo
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia/video/qmlvideo')
-rw-r--r--examples/multimedia/video/qmlvideo/CMakeLists.txt58
-rw-r--r--examples/multimedia/video/qmlvideo/Info.plist.in48
-rw-r--r--examples/multimedia/video/qmlvideo/doc/images/qmlvideo-menu.jpgbin0 -> 21959 bytes
-rw-r--r--examples/multimedia/video/qmlvideo/doc/images/qmlvideo-overlay.jpgbin0 -> 23787 bytes
-rw-r--r--examples/multimedia/video/qmlvideo/doc/src/qmlvideo.qdoc115
-rw-r--r--examples/multimedia/video/qmlvideo/frequencymonitor.cpp216
-rw-r--r--examples/multimedia/video/qmlvideo/frequencymonitor.h67
-rw-r--r--examples/multimedia/video/qmlvideo/frequencymonitor/CMakeLists.txt30
-rw-r--r--examples/multimedia/video/qmlvideo/frequencymonitor/FrequencyItem.qml67
-rw-r--r--examples/multimedia/video/qmlvideo/frequencymonitor/qmldir3
-rw-r--r--examples/multimedia/video/qmlvideo/frequencymonitordeclarative.cpp10
-rw-r--r--examples/multimedia/video/qmlvideo/main.cpp143
-rw-r--r--examples/multimedia/video/qmlvideo/performancemonitor.cpp31
-rw-r--r--examples/multimedia/video/qmlvideo/performancemonitor.h33
-rw-r--r--examples/multimedia/video/qmlvideo/performancemonitor/CMakeLists.txt31
-rw-r--r--examples/multimedia/video/qmlvideo/performancemonitor/PerformanceItem.qml100
-rw-r--r--examples/multimedia/video/qmlvideo/performancemonitor/qmldir3
-rw-r--r--examples/multimedia/video/qmlvideo/performancemonitordeclarative.cpp12
-rw-r--r--examples/multimedia/video/qmlvideo/performancemonitordeclarative.h11
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/Button.qml90
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraBasic.qml56
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraDrag.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraDummy.qml78
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraFullScreen.qml56
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraFullScreenInverted.qml56
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraItem.qml77
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraMove.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraOverlay.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraResize.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraRotate.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraSpin.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/Content.qml165
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml118
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/FileBrowser.qml419
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/Scene.qml83
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneBasic.qml94
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneDrag.qml81
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneFullScreen.qml112
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneFullScreenInverted.qml117
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneMove.qml96
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml130
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneResize.qml88
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneRotate.qml109
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneSelectionPanel.qml151
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneSpin.qml81
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoBasic.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoDrag.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoDummy.qml84
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFillMode.qml95
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFullScreen.qml56
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFullScreenInverted.qml56
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoItem.qml87
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoMetadata.qml135
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoMove.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoOverlay.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoPlaybackRate.qml115
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoResize.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoRotate.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoSeek.qml81
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoSpin.qml55
-rw-r--r--examples/multimedia/video/qmlvideo/qml/qmlvideo/main.qml284
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo.pro88
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo.qrc51
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CMakeLists.txt81
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraBasic.qml7
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraDrag.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraDummy.qml31
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraFullScreen.qml7
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraFullScreenInverted.qml7
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraItem.qml47
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraMove.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraOverlay.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraResize.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraRotate.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/CameraSpin.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/Content.qml125
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml70
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/Main.qml188
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/Scene.qml31
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneBasic.qml47
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneDrag.qml34
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneFullScreen.qml67
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneFullScreenInverted.qml70
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneMove.qml49
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneMulti.qml (renamed from examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneMulti.qml)110
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneOverlay.qml83
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneResize.qml41
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneRotate.qml57
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneSelectionPanel.qml88
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SceneSpin.qml34
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/SeekControl.qml (renamed from examples/multimedia/video/qmlvideo/qml/qmlvideo/SeekControl.qml)73
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoBasic.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoDrag.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoDummy.qml37
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoFillMode.qml49
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoFullScreen.qml7
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoFullScreenInverted.qml7
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoItem.qml42
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoMetadata.qml80
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoMove.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoOverlay.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoPlaybackRate.qml65
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoResize.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoRotate.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoSeek.qml36
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/VideoSpin.qml6
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/images/folder.png (renamed from examples/multimedia/video/qmlvideo/images/folder.png)bin1829 -> 1829 bytes
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/images/leaves.jpg (renamed from examples/multimedia/video/qmlvideo/images/leaves.jpg)bin257378 -> 257378 bytes
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/images/up.png (renamed from examples/multimedia/video/qmlvideo/images/up.png)bin1268 -> 1268 bytes
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/qmldir44
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/qmlvideo_global.h10
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/videosingleton.cpp54
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/videosingleton.h48
-rw-r--r--examples/multimedia/video/qmlvideo/trace.h100
114 files changed, 2776 insertions, 4310 deletions
diff --git a/examples/multimedia/video/qmlvideo/CMakeLists.txt b/examples/multimedia/video/qmlvideo/CMakeLists.txt
new file mode 100644
index 000000000..43975d584
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/CMakeLists.txt
@@ -0,0 +1,58 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(qmlvideoexample LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/multimedia/video/qmlvideo")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia Qml Quick)
+
+qt_standard_project_setup(REQUIRES 6.5)
+
+qt_add_executable(qmlvideoexample
+ frequencymonitor.cpp frequencymonitor.h
+ frequencymonitordeclarative.cpp
+ performancemonitor.cpp performancemonitor.h
+ performancemonitordeclarative.cpp performancemonitordeclarative.h
+ main.cpp
+ trace.h
+)
+
+set_target_properties(qmlvideoexample PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
+)
+
+target_compile_definitions(qmlvideoexample PUBLIC
+ FREQUENCYMONITOR_SUPPORT
+ PERFORMANCEMONITOR_SUPPORT
+)
+
+add_subdirectory(qmlvideo)
+add_subdirectory(performancemonitor)
+add_subdirectory(frequencymonitor)
+
+target_link_libraries(qmlvideoexample PRIVATE
+ Qt::Core
+ Qt::Gui
+ Qt::Multimedia
+ Qt::Qml
+ Qt::Quick
+ qmlvideo
+ performancemonitor
+ frequencymonitor
+)
+
+install(TARGETS qmlvideoexample
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/multimedia/video/qmlvideo/Info.plist.in b/examples/multimedia/video/qmlvideo/Info.plist.in
new file mode 100644
index 000000000..85aa9c26e
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/Info.plist.in
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+
+ <key>CFBundleName</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+ <key>CFBundleExecutable</key>
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+
+ <key>CFBundleVersion</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+ <key>CFBundleLongVersionString</key>
+ <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
+
+ <key>LSMinimumSystemVersion</key>
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+
+ <key>CFBundleGetInfoString</key>
+ <string>${MACOSX_BUNDLE_INFO_STRING}</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+
+ <key>CFBundleIconFile</key>
+ <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+
+ <key>NSCameraUsageDescription</key>
+ <string>Qt Multimedia Example</string>
+ <key>NSMicrophoneUsageDescription</key>
+ <string>Qt Multimedia Example</string>
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+</dict>
+</plist>
diff --git a/examples/multimedia/video/qmlvideo/doc/images/qmlvideo-menu.jpg b/examples/multimedia/video/qmlvideo/doc/images/qmlvideo-menu.jpg
new file mode 100644
index 000000000..54ab877a1
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/doc/images/qmlvideo-menu.jpg
Binary files differ
diff --git a/examples/multimedia/video/qmlvideo/doc/images/qmlvideo-overlay.jpg b/examples/multimedia/video/qmlvideo/doc/images/qmlvideo-overlay.jpg
new file mode 100644
index 000000000..6a0d48ae6
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/doc/images/qmlvideo-overlay.jpg
Binary files differ
diff --git a/examples/multimedia/video/qmlvideo/doc/src/qmlvideo.qdoc b/examples/multimedia/video/qmlvideo/doc/src/qmlvideo.qdoc
new file mode 100644
index 000000000..81f7cf05c
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/doc/src/qmlvideo.qdoc
@@ -0,0 +1,115 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\example video/qmlvideo
+\title QML Video Example
+\ingroup multimedia_examples
+\examplecategory {Multimedia}
+\brief Transforming video and camera viewfinder content.
+
+\e{QML Video} demonstrates the various transformations (move; resize; rotate;
+change aspect ratio) that can be applied to QML \l VideoOutput and \l Camera
+types.
+
+It also shows how native code can be combined with QML to implement more
+advanced functionality - in this case, C++ code is used to calculate the QML
+frame rate. This value is rendered in QML in a semi-transparent item
+overlaid on the video content.
+
+The following image shows the application executing the video-overlay scene,
+which creates a dummy overlay item (just a semi-transparent \l{Rectangle}),
+which moves across the \l{VideoOutput} item.
+
+\image qmlvideo-overlay.jpg
+
+\include examples-run.qdocinc
+
+\section1 Application Structure
+
+The \c Main.qml file creates a UI which includes the following items:
+
+\list
+ \li Two \c Button instances, each of which displays a filename, and can be
+ used to launch a \c FileDialog.
+ \li An exit \c Button.
+ \li A \c SceneSelectionPanel, which is a flickable list displaying the
+ available scenes.
+ \li At the lower left, an item which displays the QML repainting rate - the
+ upper number is the instantaneous frame rate and the lower number is the
+ average over the past second.
+\endlist
+
+\image qmlvideo-menu.jpg
+
+Each scene in the flickable list is implemented in its own QML file - for
+example the video-basic scene (which just displays a static \l{VideoOutput}
+in the center of the screen) is implemented in the \c VideoBasic.qml file. As
+you can see from the code, this makes use of a type of inheritance; a
+\c VideoBasic item ...
+
+\quotefromfile video/qmlvideo/qmlvideo/VideoBasic.qml
+\skipto SceneBasic
+\printuntil /^\}/
+
+... is of type \c SceneBasic ...
+
+\quotefromfile video/qmlvideo/qmlvideo/SceneBasic.qml
+\skipto import
+\printuntil contentType
+\dots
+\skipto Content
+\printuntil content
+\dots
+\skipto }
+\printuntil /^\}/
+
+... which itself is a \c Scene:
+
+\quotefromfile video/qmlvideo/qmlvideo/Scene.qml
+\skipto import
+\printuntil root
+\dots
+\skipto property QtObject content
+\printuntil content
+\dots
+\skipto Button
+\printuntil /^\}/
+
+\c SceneBasic describes the structure and behavior of the scene, but is
+agnostic of the type of content which will be displayed - this is abstracted
+by \c Content.
+
+This pattern allows us to define a particular use case (in this case, simply
+display a static piece of content), and then instantiate that use case for
+both video content (\c {VideoBasic}) and camera content \c ({CameraBasic}).
+This approach is used to implement many of the other scenes - for example,
+\e {"repeatedly slide the content from left to right and back again"} is
+implemented by \c SceneMove, on which \c VideoMove and \c CameraMove are based.
+
+Depending on the value of the contentType property in the top-level scene
+instance, the embedded \c Content item creates either a
+\l[QML]{MediaPlayer} or a \l[QML]{Camera} item.
+
+\section1 Calculating and Displaying QML Painting Rate
+
+\input multimedia/doc/src/examples/video-qml-paint-rate.qdocinc
+
+All that remains is to connect the afterRendering() signal of the QQuickView
+object to a JavaScript function, which will eventually call
+\c frequencyItem.notify():
+
+\quotefromfile video/qmlvideo/main.cpp
+\skipto int main(
+\printuntil ;
+\dots
+\skipto QQuickView
+\printuntil ;
+\dots
+\skipto QQuickItem
+\printuntil ;
+\dots
+\skipto QObject::connect
+\printuntil SLOT(qmlFramePainted()));
+
+*/
diff --git a/examples/multimedia/video/qmlvideo/frequencymonitor.cpp b/examples/multimedia/video/qmlvideo/frequencymonitor.cpp
new file mode 100644
index 000000000..d6f1953f6
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/frequencymonitor.cpp
@@ -0,0 +1,216 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "frequencymonitor.h"
+
+#include <QDebug>
+#include <QElapsedTimer>
+#include <QString>
+#include <QTime>
+#include <QTimer>
+
+//#define VERBOSE_TRACE
+
+inline QDebug qtTrace()
+{
+ return qDebug() << "[frequencymonitor]";
+}
+#ifdef VERBOSE_TRACE
+inline QDebug qtVerboseTrace()
+{
+ return qtTrace();
+}
+#else
+inline QNoDebug qtVerboseTrace()
+{
+ return QNoDebug();
+}
+#endif
+
+static const int DefaultSamplingInterval = 100;
+static const int DefaultTraceInterval = 0;
+
+class FrequencyMonitorPrivate : public QObject
+{
+ Q_OBJECT
+
+public:
+ FrequencyMonitorPrivate(FrequencyMonitor *parent);
+ void calculateInstantaneousFrequency();
+
+private slots:
+ void calculateAverageFrequency();
+ void stalled();
+
+public:
+ FrequencyMonitor *const q_ptr;
+ QString m_label;
+ bool m_active;
+ qreal m_instantaneousFrequency;
+ QElapsedTimer m_instantaneousElapsed;
+ QTimer *m_averageTimer;
+ QElapsedTimer m_averageElapsed;
+ int m_count;
+ qreal m_averageFrequency;
+ QTimer *m_traceTimer;
+ QTimer *m_stalledTimer;
+};
+
+FrequencyMonitorPrivate::FrequencyMonitorPrivate(FrequencyMonitor *parent)
+ : QObject(parent),
+ q_ptr(parent),
+ m_active(false),
+ m_instantaneousFrequency(0),
+ m_averageTimer(new QTimer(this)),
+ m_count(0),
+ m_averageFrequency(0),
+ m_traceTimer(new QTimer(this)),
+ m_stalledTimer(new QTimer(this))
+{
+ m_instantaneousElapsed.start();
+ connect(m_averageTimer, &QTimer::timeout, this,
+ &FrequencyMonitorPrivate::calculateAverageFrequency);
+ if (DefaultSamplingInterval)
+ m_averageTimer->start(DefaultSamplingInterval);
+ m_averageElapsed.start();
+ connect(m_traceTimer, &QTimer::timeout, q_ptr, &FrequencyMonitor::trace);
+ if (DefaultTraceInterval)
+ m_traceTimer->start(DefaultTraceInterval);
+ m_stalledTimer->setSingleShot(true);
+ connect(m_stalledTimer, &QTimer::timeout, this, &FrequencyMonitorPrivate::stalled);
+}
+
+void FrequencyMonitorPrivate::calculateInstantaneousFrequency()
+{
+ const qint64 ms = m_instantaneousElapsed.restart();
+ m_instantaneousFrequency = ms ? qreal(1000) / ms : 0;
+ m_stalledTimer->start(3 * ms);
+ if (m_instantaneousFrequency)
+ q_ptr->setActive(true);
+ emit q_ptr->instantaneousFrequencyChanged(m_instantaneousFrequency);
+ emit q_ptr->frequencyChanged();
+}
+
+void FrequencyMonitorPrivate::calculateAverageFrequency()
+{
+ const qint64 ms = m_averageElapsed.restart();
+ m_averageFrequency = qreal(m_count * 1000) / ms;
+ emit q_ptr->averageFrequencyChanged(m_averageFrequency);
+ emit q_ptr->frequencyChanged();
+ m_count = 0;
+}
+
+void FrequencyMonitorPrivate::stalled()
+{
+ if (m_instantaneousFrequency) {
+ m_instantaneousFrequency = 0;
+ emit q_ptr->instantaneousFrequencyChanged(m_instantaneousFrequency);
+ emit q_ptr->frequencyChanged();
+ }
+}
+
+FrequencyMonitor::FrequencyMonitor(QObject *parent) : QObject(parent)
+{
+ d_ptr = new FrequencyMonitorPrivate(this);
+}
+
+FrequencyMonitor::~FrequencyMonitor() = default;
+
+QString FrequencyMonitor::label() const
+{
+ return d_func()->m_label;
+}
+
+bool FrequencyMonitor::active() const
+{
+ return d_func()->m_active;
+}
+
+int FrequencyMonitor::samplingInterval() const
+{
+ return d_ptr->m_averageTimer->isActive() ? d_ptr->m_averageTimer->interval() : 0;
+}
+
+int FrequencyMonitor::traceInterval() const
+{
+ return d_ptr->m_traceTimer->isActive() ? d_ptr->m_traceTimer->interval() : 0;
+}
+
+qreal FrequencyMonitor::instantaneousFrequency() const
+{
+ return d_func()->m_instantaneousFrequency;
+}
+
+qreal FrequencyMonitor::averageFrequency() const
+{
+ return d_func()->m_averageFrequency;
+}
+
+void FrequencyMonitor::notify()
+{
+ Q_D(FrequencyMonitor);
+ ++(d->m_count);
+ d->calculateInstantaneousFrequency();
+}
+
+void FrequencyMonitor::trace()
+{
+ Q_D(FrequencyMonitor);
+ const QString value = QStringLiteral("instant %1 average %2")
+ .arg(d->m_instantaneousFrequency, 0, 'f', 2)
+ .arg(d->m_averageFrequency, 0, 'f', 2);
+ if (d->m_label.isEmpty())
+ qtTrace() << "FrequencyMonitor::trace" << value;
+ else
+ qtTrace() << "FrequencyMonitor::trace"
+ << "label" << d->m_label << value;
+}
+
+void FrequencyMonitor::setLabel(const QString &value)
+{
+ Q_D(FrequencyMonitor);
+ if (d->m_label != value) {
+ d->m_label = value;
+ emit labelChanged(d->m_label);
+ }
+}
+
+void FrequencyMonitor::setActive(bool value)
+{
+ Q_D(FrequencyMonitor);
+ if (d->m_active != value) {
+ d->m_active = value;
+ emit activeChanged(d->m_active);
+ }
+}
+
+void FrequencyMonitor::setSamplingInterval(int value)
+{
+ Q_D(FrequencyMonitor);
+ if (samplingInterval() != value) {
+ if (value) {
+ d->m_averageTimer->setInterval(value);
+ d->m_averageTimer->start();
+ } else {
+ d->m_averageTimer->stop();
+ }
+ emit samplingIntervalChanged(value);
+ }
+}
+
+void FrequencyMonitor::setTraceInterval(int value)
+{
+ Q_D(FrequencyMonitor);
+ if (traceInterval() != value) {
+ if (value) {
+ d->m_traceTimer->setInterval(value);
+ d->m_traceTimer->start();
+ } else {
+ d->m_traceTimer->stop();
+ }
+ emit traceIntervalChanged(value);
+ }
+}
+
+#include "frequencymonitor.moc"
+#include "moc_frequencymonitor.cpp"
diff --git a/examples/multimedia/video/qmlvideo/frequencymonitor.h b/examples/multimedia/video/qmlvideo/frequencymonitor.h
new file mode 100644
index 000000000..a1756dc88
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/frequencymonitor.h
@@ -0,0 +1,67 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef FREQUENCYMONITOR_H
+#define FREQUENCYMONITOR_H
+
+#include <QObject>
+#include <QTimer>
+
+class FrequencyMonitorPrivate;
+
+/**
+ * Class for measuring frequency of events
+ *
+ * Occurrence of the event is notified by the client via the notify() slot.
+ * On a regular interval, both an instantaneous and a rolling average
+ * event frequency are calculated.
+ */
+class FrequencyMonitor : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(FrequencyMonitor)
+ Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
+ Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
+ Q_PROPERTY(int samplingInterval READ samplingInterval WRITE setSamplingInterval NOTIFY
+ samplingIntervalChanged)
+ Q_PROPERTY(
+ int traceInterval READ traceInterval WRITE setTraceInterval NOTIFY traceIntervalChanged)
+ Q_PROPERTY(qreal instantaneousFrequency READ instantaneousFrequency NOTIFY
+ instantaneousFrequencyChanged)
+ Q_PROPERTY(qreal averageFrequency READ averageFrequency NOTIFY averageFrequencyChanged)
+
+public:
+ FrequencyMonitor(QObject *parent = nullptr);
+ ~FrequencyMonitor();
+
+ static void qmlRegisterType();
+
+ QString label() const;
+ bool active() const;
+ int samplingInterval() const;
+ int traceInterval() const;
+ qreal instantaneousFrequency() const;
+ qreal averageFrequency() const;
+
+signals:
+ void labelChanged(const QString &value);
+ void activeChanged(bool);
+ void samplingIntervalChanged(int value);
+ void traceIntervalChanged(int value);
+ void frequencyChanged();
+ void instantaneousFrequencyChanged(qreal value);
+ void averageFrequencyChanged(qreal value);
+
+public slots:
+ Q_INVOKABLE void notify();
+ Q_INVOKABLE void trace();
+ void setActive(bool value);
+ void setLabel(const QString &value);
+ void setSamplingInterval(int value);
+ void setTraceInterval(int value);
+
+private:
+ FrequencyMonitorPrivate *d_ptr;
+};
+
+#endif // FREQUENCYMONITOR_H
diff --git a/examples/multimedia/video/qmlvideo/frequencymonitor/CMakeLists.txt b/examples/multimedia/video/qmlvideo/frequencymonitor/CMakeLists.txt
new file mode 100644
index 000000000..4a205fa28
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/frequencymonitor/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ message(FATAL_ERROR "This module is part of the 'qmlvideo' example, and should not be built independently.")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/multimedia/video/qmlvideo/frequencymonitor")
+
+qt_add_qml_module(frequencymonitor
+ URI frequencymonitor
+ QML_FILES
+ "FrequencyItem.qml"
+)
+
+target_link_libraries(frequencymonitor PRIVATE
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Quick
+)
+
+install(TARGETS frequencymonitor
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir
+ DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/multimedia/video/qmlvideo/frequencymonitor/FrequencyItem.qml b/examples/multimedia/video/qmlvideo/frequencymonitor/FrequencyItem.qml
new file mode 100644
index 000000000..49a7eea9b
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/frequencymonitor/FrequencyItem.qml
@@ -0,0 +1,67 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import FrequencyMonitor 1.0
+
+Rectangle {
+ id: root
+ property bool logging: true
+ property bool displayed: true
+ property bool enabled: logging || displayed
+ property alias active: monitor.active
+ property int samplingInterval: 500
+ property color textColor: "yellow"
+ property int textSize: 20
+ property alias label: monitor.label
+
+ border.width: 1
+ border.color: "yellow"
+ width: 5.5 * root.textSize
+ height: 3.0 * root.textSize
+ color: "black"
+ opacity: 0.5
+ radius: 10
+ visible: displayed && active
+
+ // This should ensure that the monitor is on top of all other content
+ z: 999
+
+ function notify() {
+ monitor.notify()
+ }
+
+ FrequencyMonitor {
+ id: monitor
+ samplingInterval: root.enabled ? root.samplingInterval : 0
+ onAverageFrequencyChanged: {
+ if (root.logging) trace()
+ averageFrequencyText.text = monitor.averageFrequency.toFixed(2)
+ }
+ }
+
+ Text {
+ id: labelText
+ anchors {
+ left: parent.left
+ top: parent.top
+ margins: 10
+ }
+ color: root.textColor
+ font.pixelSize: 0.6 * root.textSize
+ text: root.label
+ width: root.width - 2*anchors.margins
+ elide: Text.ElideRight
+ }
+
+ Text {
+ id: averageFrequencyText
+ anchors {
+ right: parent.right
+ bottom: parent.bottom
+ margins: 10
+ }
+ color: root.textColor
+ font.pixelSize: root.textSize
+ }
+}
diff --git a/examples/multimedia/video/qmlvideo/frequencymonitor/qmldir b/examples/multimedia/video/qmlvideo/frequencymonitor/qmldir
new file mode 100644
index 000000000..a935d2c53
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/frequencymonitor/qmldir
@@ -0,0 +1,3 @@
+module frequencymonitor
+
+FrequencyItem 1.0 FrequencyItem.qml
diff --git a/examples/multimedia/video/qmlvideo/frequencymonitordeclarative.cpp b/examples/multimedia/video/qmlvideo/frequencymonitordeclarative.cpp
new file mode 100644
index 000000000..6ed2019ff
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/frequencymonitordeclarative.cpp
@@ -0,0 +1,10 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "frequencymonitor.h"
+#include <qqml.h>
+
+void FrequencyMonitor::qmlRegisterType()
+{
+ ::qmlRegisterType<FrequencyMonitor>("FrequencyMonitor", 1, 0, "FrequencyMonitor");
+}
diff --git a/examples/multimedia/video/qmlvideo/main.cpp b/examples/multimedia/video/qmlvideo/main.cpp
index 01178acaa..94c5bfea0 100644
--- a/examples/multimedia/video/qmlvideo/main.cpp
+++ b/examples/multimedia/video/qmlvideo/main.cpp
@@ -1,82 +1,24 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-#include <QtCore/QStandardPaths>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtQml/QQmlContext>
-#include <QtQml/QQmlEngine>
-#include <QtGui/QGuiApplication>
-#include <QtQuick/QQuickItem>
-#include <QtQuick/QQuickView>
+#include "performancemonitor.h"
#include "trace.h"
-
+#include "qmlvideo/videosingleton.h"
#ifdef PERFORMANCEMONITOR_SUPPORT
-#include "performancemonitordeclarative.h"
+# include "performancemonitordeclarative.h"
#endif
-#ifdef REQUEST_PERMISSIONS_ON_ANDROID
-#include <QtAndroid>
-
-bool requestStoragePermission() {
- using namespace QtAndroid;
-
- QString permission = QStringLiteral("android.permission.WRITE_EXTERNAL_STORAGE");
- const QHash<QString, PermissionResult> results = requestPermissionsSync(QStringList({permission}));
- if (!results.contains(permission) || results[permission] == PermissionResult::Denied) {
- qWarning() << "Couldn't get permission: " << permission;
- return false;
- }
-
- return true;
-}
+#include <QGuiApplication>
+#include <QQmlContext>
+#include <QQmlEngine>
+#include <QQuickItem>
+#include <QQuickView>
+#include <QStandardPaths>
+#include <QString>
+#include <QStringList>
+
+#if QT_CONFIG(permissions)
+ #include <QPermission>
#endif
static const QString DefaultFileName1 = "";
@@ -89,10 +31,6 @@ int main(int argc, char *argv[])
#ifdef PERFORMANCEMONITOR_SUPPORT
PerformanceMonitor::qmlRegisterTypes();
#endif
-#ifdef REQUEST_PERMISSIONS_ON_ANDROID
- if (!requestStoragePermission())
- return -1;
-#endif
QString source1, source2;
qreal volume = 0.5;
@@ -105,7 +43,7 @@ int main(int argc, char *argv[])
const QByteArray arg = args.at(i).toUtf8();
if (arg.startsWith('-')) {
if ("-volume" == arg) {
- if (i+1 < args.count())
+ if (i + 1 < args.count())
volume = 0.01 * args.at(++i).toInt();
else
qtTrace() << "Option \"-volume\" takes a value";
@@ -141,36 +79,47 @@ int main(int argc, char *argv[])
url2 = QUrl::fromLocalFile(source2);
}
+ const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
+ const QUrl videoPath = QUrl::fromLocalFile(moviesLocation.isEmpty() ? app.applicationDirPath()
+ : moviesLocation.front());
+
QQuickView viewer;
- viewer.setSource(QUrl("qrc:///qml/qmlvideo/main.qml"));
+ VideoSingleton* singleton = viewer.engine()->singletonInstance<VideoSingleton*>("qmlvideo", "VideoSingleton");
+ singleton->setVideoPath(videoPath);
+ singleton->setSource1(source1);
+ singleton->setSource2(source2);
+ singleton->setVolume(volume);
+ viewer.loadFromModule("qmlvideo", "Main");
QObject::connect(viewer.engine(), &QQmlEngine::quit, &viewer, &QQuickView::close);
- QQuickItem *rootObject = viewer.rootObject();
- rootObject->setProperty("source1", url1);
- rootObject->setProperty("source2", url2);
- rootObject->setProperty("volume", volume);
-
#ifdef PERFORMANCEMONITOR_SUPPORT
+ QQuickItem *rootObject = viewer.rootObject();
if (performanceMonitorState.valid) {
rootObject->setProperty("perfMonitorsLogging", performanceMonitorState.logging);
rootObject->setProperty("perfMonitorsVisible", performanceMonitorState.visible);
}
- QObject::connect(&viewer, SIGNAL(afterRendering()),
- rootObject, SLOT(qmlFramePainted()));
+ QObject::connect(&viewer, SIGNAL(afterRendering()), rootObject, SLOT(qmlFramePainted()));
#endif
- const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
- const QUrl videoPath =
- QUrl::fromLocalFile(moviesLocation.isEmpty() ?
- app.applicationDirPath() :
- moviesLocation.front());
- viewer.rootContext()->setContextProperty("videoPath", videoPath);
-
QMetaObject::invokeMethod(rootObject, "init");
- viewer.setMinimumSize(QSize(640, 360));
- viewer.show();
+ auto setupView = [&viewer]() {
+ viewer.setMinimumSize(QSize(640, 360));
+ viewer.show();
+ };
+
+#if QT_CONFIG(permissions)
+ QCameraPermission cameraPermission;
+ qApp->requestPermission(cameraPermission, [&setupView](const QPermission &permission) {
+ // Show UI in any case. If there is no permission, the UI will just
+ // be disabled.
+ if (permission.status() != Qt::PermissionStatus::Granted)
+ qWarning("Camera permission is not granted! Camera will not be available.");
+ setupView();
+ });
+#else
+ setupView();
+#endif
return app.exec();
}
-
diff --git a/examples/multimedia/video/qmlvideo/performancemonitor.cpp b/examples/multimedia/video/qmlvideo/performancemonitor.cpp
new file mode 100644
index 000000000..26f0fae2a
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/performancemonitor.cpp
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "performancemonitor.h"
+
+namespace PerformanceMonitor {
+
+bool State::parseArgument(const QByteArray &arg)
+{
+ bool result = false;
+ if (arg == "-log-perf") {
+ logging = true;
+ valid = true;
+ result = true;
+ } else if (arg == "-no-log-perf") {
+ logging = false;
+ valid = true;
+ result = true;
+ } else if (arg == "-show-perf") {
+ visible = true;
+ valid = true;
+ result = true;
+ } else if (arg == "-hide-perf") {
+ visible = false;
+ valid = true;
+ result = true;
+ }
+ return result;
+}
+
+} // namespace PerformanceMonitor
diff --git a/examples/multimedia/video/qmlvideo/performancemonitor.h b/examples/multimedia/video/qmlvideo/performancemonitor.h
new file mode 100644
index 000000000..683468619
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/performancemonitor.h
@@ -0,0 +1,33 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef PERFORMANCEMONITOR_H
+#define PERFORMANCEMONITOR_H
+
+#include <QByteArray>
+
+namespace PerformanceMonitor {
+
+struct State
+{
+ State() : valid(true), logging(false), visible(true) { }
+ State(bool l, bool v) : valid(true), logging(l), visible(v) { }
+ bool operator==(const State &other) const
+ {
+ return logging == other.logging && visible == other.visible;
+ }
+ bool operator!=(const State &other) const
+ {
+ return logging != other.logging || visible != other.visible;
+ }
+
+ bool parseArgument(const QByteArray &arg);
+
+ bool valid;
+ bool logging;
+ bool visible;
+};
+
+} // namespace PerformanceMonitor
+
+#endif // PERFORMANCEMONITOR_H
diff --git a/examples/multimedia/video/qmlvideo/performancemonitor/CMakeLists.txt b/examples/multimedia/video/qmlvideo/performancemonitor/CMakeLists.txt
new file mode 100644
index 000000000..beb9e2e08
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/performancemonitor/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ message(FATAL_ERROR "This module is part of the 'qmlvideo' example, and should not be built independently.")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/multimedia/video/qmlvideo/performancemonitor")
+
+qt_add_qml_module(performancemonitor
+ URI performancemonitor
+ QML_FILES
+ "PerformanceItem.qml"
+)
+
+target_link_libraries(performancemonitor PRIVATE
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Quick
+)
+
+install(TARGETS performancemonitor
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir
+ DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
+
diff --git a/examples/multimedia/video/qmlvideo/performancemonitor/PerformanceItem.qml b/examples/multimedia/video/qmlvideo/performancemonitor/PerformanceItem.qml
new file mode 100644
index 000000000..5b501b104
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/performancemonitor/PerformanceItem.qml
@@ -0,0 +1,100 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Rectangle {
+ id: root
+ property bool logging: true
+ property bool displayed: true
+ property bool videoActive
+ property int margins: 5
+ property bool enabled: true
+
+ color: "transparent"
+
+ // This should ensure that the monitor is on top of all other content
+ z: 999
+
+ Column {
+ id: column
+ anchors {
+ fill: root
+ margins: 10
+ }
+ spacing: 10
+ }
+
+ QtObject {
+ id: d
+ property Item qmlFrameRateItem: null
+ property Item videoFrameRateItem: null
+ }
+
+ Connections {
+ id: videoFrameRateActiveConnections
+ ignoreUnknownSignals: true
+ function onActiveChanged() { root.videoActive = videoFrameRateActiveConnections.target.active }
+ }
+
+ states: [
+ State {
+ name: "hidden"
+ PropertyChanges {
+ root.opacity: 0
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ properties: "opacity"
+ easing.type: Easing.OutQuart
+ duration: 500
+ }
+ }
+ ]
+
+ state: enabled ? "baseState" : "hidden"
+
+ function createQmlFrameRateItem() {
+ let component = Qt.createComponent("frequencymonitor", "FrequencyItem")
+ if (component.status === Component.Ready)
+ d.qmlFrameRateItem = component.createObject(column, { label: qsTr("QML frame rate"),
+ displayed: root.displayed,
+ logging: root.logging
+ });
+ }
+
+ function createVideoFrameRateItem() {
+ let component = Qt.createComponent("frequencymonitor", "FrequencyItem")
+ if (component.status === Component.Ready)
+ d.videoFrameRateItem = component.createObject(column, { label: qsTr("Video frame rate"),
+ displayed: root.displayed,
+ logging: root.logging
+ });
+ videoFrameRateActiveConnections.target = d.videoFrameRateItem
+ }
+
+
+ function init() {
+ createQmlFrameRateItem()
+ createVideoFrameRateItem()
+ }
+
+ function videoFramePainted() {
+ d.videoFrameRateItem?.notify()
+ }
+
+ function qmlFramePainted() {
+ d.qmlFrameRateItem?.notify()
+ }
+
+ onVideoActiveChanged: {
+ if (d.videoFrameRateItem)
+ d.videoFrameRateItem.active = root.videoActive
+ }
+}
diff --git a/examples/multimedia/video/qmlvideo/performancemonitor/qmldir b/examples/multimedia/video/qmlvideo/performancemonitor/qmldir
new file mode 100644
index 000000000..636abaf99
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/performancemonitor/qmldir
@@ -0,0 +1,3 @@
+module performancemonitor
+
+PerformanceItem 1.0 PerformanceItem.qml
diff --git a/examples/multimedia/video/qmlvideo/performancemonitordeclarative.cpp b/examples/multimedia/video/qmlvideo/performancemonitordeclarative.cpp
new file mode 100644
index 000000000..a2ad1ca82
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/performancemonitordeclarative.cpp
@@ -0,0 +1,12 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "frequencymonitor.h"
+
+namespace PerformanceMonitor {
+
+void qmlRegisterTypes()
+{
+ FrequencyMonitor::qmlRegisterType();
+}
+}
diff --git a/examples/multimedia/video/qmlvideo/performancemonitordeclarative.h b/examples/multimedia/video/qmlvideo/performancemonitordeclarative.h
new file mode 100644
index 000000000..4514d5041
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/performancemonitordeclarative.h
@@ -0,0 +1,11 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef PERFORMANCEMONITORDECLARATIVE_H
+#define PERFORMANCEMONITORDECLARATIVE_H
+
+namespace PerformanceMonitor {
+void qmlRegisterTypes();
+}
+
+#endif // PERFORMANCEMONITORDECLARATIVE_H
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/Button.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/Button.qml
deleted file mode 100644
index e2d296e98..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/Button.qml
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Item {
- id: root
-
- property string text
- property color bgColor: "#757575"
- property color bgColorSelected: "#bdbdbd"
- property color textColor: "white"
- property color textColorSelected: "black"
- property alias enabled: mouseArea.enabled
- property alias radius: bgr.radius
-
- signal clicked
-
- Rectangle {
- id: bgr
- anchors.fill: parent
- color: mouseArea.pressed ? bgColorSelected : bgColor
- radius: height / 15
-
- Text {
- id: text
- anchors.centerIn: parent
- text: root.text
- font.pixelSize: 0.4 * parent.height
- color: mouseArea.pressed ? textColorSelected : textColor
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- root.clicked()
- }
- }
- }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraBasic.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraBasic.qml
deleted file mode 100644
index c17f90162..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraBasic.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneBasic {
- contentType: "camera"
- started: true
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraDrag.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraDrag.qml
deleted file mode 100644
index 395261c1b..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraDrag.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneDrag {
- contentType: "camera"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraDummy.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraDummy.qml
deleted file mode 100644
index 6439bea16..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraDummy.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-// Item which is loaded by CameraItem if Qt Multimedia is not available
-Rectangle {
- id: root
- color: "grey"
- height: width
-
- signal fatalError
- signal sizeChanged
- signal framePainted
-
- Text {
- anchors.fill: parent
- anchors.margins: 10
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- text: "Failed to create Camera item\n\nCheck that Qt Multimedia is installed"
- verticalAlignment: Text.AlignVCenter
- wrapMode: Text.Wrap
- }
-
- onWidthChanged: height = width
- onHeightChanged: root.sizeChanged()
-
- function start() { }
- function stop() { }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraFullScreen.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraFullScreen.qml
deleted file mode 100644
index 125d18246..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraFullScreen.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneFullScreen {
- contentType: "camera"
-}
-
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraFullScreenInverted.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraFullScreenInverted.qml
deleted file mode 100644
index e7372b2c3..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraFullScreenInverted.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneFullScreenInverted {
- contentType: "camera"
-}
-
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraItem.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraItem.qml
deleted file mode 100644
index 9fd3f9cfa..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraItem.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtMultimedia 5.0
-
-VideoOutput {
- id: root
- height: width
- source: camera
-
- signal fatalError
- signal sizeChanged
-
- onHeightChanged: root.sizeChanged()
-
- Camera {
- id: camera
-
- onError: {
- if (Camera.NoError != error) {
- console.log("[qmlvideo] CameraItem.onError error " + error + " errorString " + errorString)
- root.fatalError()
- }
- }
- }
-
- function start() { camera.start() }
- function stop() { camera.stop() }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraMove.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraMove.qml
deleted file mode 100644
index 39d18cf4f..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraMove.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneMove {
- contentType: "camera"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraOverlay.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraOverlay.qml
deleted file mode 100644
index 5401a51f2..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraOverlay.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneOverlay {
- contentType: "camera"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraResize.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraResize.qml
deleted file mode 100644
index d9719659c..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraResize.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneResize {
- contentType: "camera"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraRotate.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraRotate.qml
deleted file mode 100644
index 5b02392b7..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraRotate.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneRotate {
- contentType: "camera"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraSpin.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraSpin.qml
deleted file mode 100644
index a81652e7c..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/CameraSpin.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneSpin {
- contentType: "camera"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/Content.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/Content.qml
deleted file mode 100644
index ffa04e200..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/Content.qml
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: root
- border.color: "white"
- border.width: showBorder ? 1 : 0
- color: "transparent"
- property string contentType // "camera" or "video"
- property string source
- property real volume
- property bool dummy: false
- property bool autoStart: true
- property bool started: false
- property bool showFrameRate: false
- property bool showBorder: false
-
- signal initialized
- signal error
- signal videoFramePainted
-
- Loader {
- id: contentLoader
- }
-
- Connections {
- id: framePaintedConnection
- onFramePainted: {
- if (frameRateLoader.item)
- frameRateLoader.item.notify()
- root.videoFramePainted()
- }
- ignoreUnknownSignals: true
- }
-
- Connections {
- id: errorConnection
- onFatalError: {
- console.log("[qmlvideo] Content.onFatalError")
- stop()
- root.error()
- }
- ignoreUnknownSignals: true
- }
-
- Loader {
- id: frameRateLoader
- source: root.showFrameRate ? "../frequencymonitor/FrequencyItem.qml" : ""
- onLoaded: {
- item.parent = root
- item.anchors.top = root.top
- item.anchors.right = root.right
- item.anchors.margins = 10
- }
- }
-
- onWidthChanged: {
- if (contentItem())
- contentItem().width = width
- }
-
- onHeightChanged: {
- if (contentItem())
- contentItem().height = height
- }
-
- function initialize() {
- if ("video" == contentType) {
- contentLoader.source = "VideoItem.qml"
- if (Loader.Error == contentLoader.status) {
- contentLoader.source = "VideoDummy.qml"
- dummy = true
- }
- contentLoader.item.volume = volume
- } else if ("camera" == contentType) {
- contentLoader.source = "CameraItem.qml"
- if (Loader.Error == contentLoader.status) {
- contentLoader.source = "CameraDummy.qml"
- dummy = true
- }
- } else {
- console.log("[qmlvideo] Content.initialize: error: invalid contentType")
- }
- if (contentLoader.item) {
- contentLoader.item.sizeChanged.connect(updateRootSize)
- contentLoader.item.parent = root
- contentLoader.item.width = root.width
- framePaintedConnection.target = contentLoader.item
- errorConnection.target = contentLoader.item
- if (root.autoStart)
- root.start()
- }
- root.initialized()
- }
-
- function start() {
- if (contentLoader.item) {
- if (root.contentType == "video")
- contentLoader.item.mediaSource = root.source
- contentLoader.item.start()
- root.started = true
- }
- }
-
- function stop() {
- if (contentLoader.item) {
- contentLoader.item.stop()
- if (root.contentType == "video")
- contentLoader.item.mediaSource = ""
- root.started = false
- }
- }
-
- function contentItem() { return contentLoader.item }
- function updateRootSize() { root.height = contentItem().height }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml
deleted file mode 100644
index 442eb42c1..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: root
- color: "transparent"
- opacity: 0.0
- property alias enabled: mouseArea.enabled
- property int dialogWidth: 300
- property int dialogHeight: 200
- state: enabled ? "on" : "baseState"
-
- states: [
- State {
- name: "on"
- PropertyChanges {
- target: root
- opacity: 1.0
- }
- }
- ]
-
- transitions: [
- Transition {
- from: "*"
- to: "*"
- NumberAnimation {
- properties: "opacity"
- easing.type: Easing.OutQuart
- duration: 500
- }
- }
- ]
-
- Rectangle {
- anchors.fill: parent
- color: "black"
- opacity: 0.75
- }
-
- Rectangle {
- anchors.centerIn: parent
- width: dialogWidth
- height: dialogHeight
- radius: 5
- color: "white"
-
- Text {
- id: text
- anchors.fill: parent
- anchors.margins: 10
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- color: "black"
- wrapMode: Text.WordWrap
- }
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: root.enabled = false
- }
-
- function show(msg) {
- text.text = "<b>Error</b><br><br>" + msg
- root.enabled = true
- }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/FileBrowser.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/FileBrowser.qml
deleted file mode 100644
index 3fe5a5204..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/FileBrowser.qml
+++ /dev/null
@@ -1,419 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import Qt.labs.folderlistmodel 2.0
-
-Rectangle {
- id: fileBrowser
- color: "transparent"
-
- property string folder
-
- property int itemHeight: Math.min(parent.width, parent.height) / 15
- property int buttonHeight: Math.min(parent.width, parent.height) / 12
-
- signal fileSelected(string file)
-
- function selectFile(file) {
- if (file !== "") {
- folder = loader.item.folders.folder
- fileBrowser.fileSelected(file)
- }
- loader.sourceComponent = undefined
- }
-
- Loader {
- id: loader
- }
-
- function show() {
- loader.sourceComponent = fileBrowserComponent
- loader.item.parent = fileBrowser
- loader.item.anchors.fill = fileBrowser
- loader.item.folder = fileBrowser.folder
- }
-
- Component {
- id: fileBrowserComponent
-
- Rectangle {
- id: root
- color: "black"
- property bool showFocusHighlight: false
- property variant folders: folders1
- property variant view: view1
- property alias folder: folders1.folder
- property color textColor: "white"
-
- FolderListModel {
- id: folders1
- folder: folder
- }
-
- FolderListModel {
- id: folders2
- folder: folder
- }
-
- SystemPalette {
- id: palette
- }
-
- Component {
- id: folderDelegate
-
- Rectangle {
- id: wrapper
- function launch() {
- var path = "file://";
- if (filePath.length > 2 && filePath[1] === ':') // Windows drive logic, see QUrl::fromLocalFile()
- path += '/';
- path += filePath;
- if (folders.isFolder(index))
- down(path);
- else
- fileBrowser.selectFile(path)
- }
- width: root.width
- height: folderImage.height
- color: "transparent"
-
- Rectangle {
- id: highlight
- visible: false
- anchors.fill: parent
- anchors.leftMargin: 5
- anchors.rightMargin: 5
- color: "#212121"
- }
-
- Item {
- id: folderImage
- width: itemHeight
- height: itemHeight
- Image {
- id: folderPicture
- source: "qrc:/folder.png"
- width: itemHeight * 0.9
- height: itemHeight * 0.9
- anchors.left: parent.left
- anchors.margins: 5
- visible: folders.isFolder(index)
- }
- }
-
- Text {
- id: nameText
- anchors.fill: parent;
- verticalAlignment: Text.AlignVCenter
- text: fileName
- anchors.leftMargin: itemHeight + 10
- color: (wrapper.ListView.isCurrentItem && root.showFocusHighlight) ? palette.highlightedText : textColor
- elide: Text.ElideRight
- }
-
- MouseArea {
- id: mouseRegion
- anchors.fill: parent
- onPressed: {
- root.showFocusHighlight = false;
- wrapper.ListView.view.currentIndex = index;
- }
- onClicked: { if (folders === wrapper.ListView.view.model) launch() }
- }
-
- states: [
- State {
- name: "pressed"
- when: mouseRegion.pressed
- PropertyChanges { target: highlight; visible: true }
- PropertyChanges { target: nameText; color: palette.highlightedText }
- }
- ]
- }
- }
-
- ListView {
- id: view1
- anchors.top: titleBar.bottom
- anchors.bottom: cancelButton.top
- width: parent.width
- model: folders1
- delegate: folderDelegate
- highlight: Rectangle {
- color: "#212121"
- visible: root.showFocusHighlight && view1.count != 0
- width: view1.currentItem == null ? 0 : view1.currentItem.width
- }
- highlightMoveVelocity: 1000
- pressDelay: 100
- focus: true
- state: "current"
- states: [
- State {
- name: "current"
- PropertyChanges { target: view1; x: 0 }
- },
- State {
- name: "exitLeft"
- PropertyChanges { target: view1; x: -root.width }
- },
- State {
- name: "exitRight"
- PropertyChanges { target: view1; x: root.width }
- }
- ]
- transitions: [
- Transition {
- to: "current"
- SequentialAnimation {
- NumberAnimation { properties: "x"; duration: 250 }
- }
- },
- Transition {
- NumberAnimation { properties: "x"; duration: 250 }
- NumberAnimation { properties: "x"; duration: 250 }
- }
- ]
- Keys.onPressed: root.keyPressed(event.key)
- }
-
- ListView {
- id: view2
- anchors.top: titleBar.bottom
- anchors.bottom: parent.bottom
- x: parent.width
- width: parent.width
- model: folders2
- delegate: folderDelegate
- highlight: Rectangle {
- color: "#212121"
- visible: root.showFocusHighlight && view2.count != 0
- width: view1.currentItem == null ? 0 : view1.currentItem.width
- }
- highlightMoveVelocity: 1000
- pressDelay: 100
- states: [
- State {
- name: "current"
- PropertyChanges { target: view2; x: 0 }
- },
- State {
- name: "exitLeft"
- PropertyChanges { target: view2; x: -root.width }
- },
- State {
- name: "exitRight"
- PropertyChanges { target: view2; x: root.width }
- }
- ]
- transitions: [
- Transition {
- to: "current"
- SequentialAnimation {
- NumberAnimation { properties: "x"; duration: 250 }
- }
- },
- Transition {
- NumberAnimation { properties: "x"; duration: 250 }
- }
- ]
- Keys.onPressed: root.keyPressed(event.key)
- }
-
- Rectangle {
- width: parent.width
- height: buttonHeight + 10
- anchors.bottom: parent.bottom
- color: "black"
- }
-
- Rectangle {
- id: cancelButton
- width: parent.width
- height: buttonHeight
- color: "#212121"
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: 5
- radius: buttonHeight / 15
-
- Text {
- anchors.fill: parent
- text: "Cancel"
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: fileBrowser.selectFile("")
- }
- }
-
- Keys.onPressed: {
- root.keyPressed(event.key);
- if (event.key === Qt.Key_Return || event.key === Qt.Key_Select || event.key === Qt.Key_Right) {
- view.currentItem.launch();
- event.accepted = true;
- } else if (event.key === Qt.Key_Left) {
- up();
- }
- }
-
-
- Rectangle {
- id: titleBar
- width: parent.width
- height: buttonHeight + 10
- anchors.top: parent.top
- color: "black"
-
- Rectangle {
- width: parent.width;
- height: buttonHeight
- color: "#212121"
- anchors.margins: 5
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- radius: buttonHeight / 15
-
- Rectangle {
- id: upButton
- width: buttonHeight
- height: buttonHeight
- color: "transparent"
- Image {
- width: itemHeight
- height: itemHeight
- anchors.centerIn: parent
- source: "qrc:/up.png"
- }
- MouseArea { id: upRegion; anchors.centerIn: parent
- width: buttonHeight
- height: buttonHeight
- onClicked: up()
- }
- states: [
- State {
- name: "pressed"
- when: upRegion.pressed
- PropertyChanges { target: upButton; color: palette.highlight }
- }
- ]
- }
-
- Text {
- anchors.left: upButton.right; anchors.right: parent.right; height: parent.height
- anchors.leftMargin: 5; anchors.rightMargin: 5
- text: folders.folder
- color: "white"
- elide: Text.ElideLeft;
- horizontalAlignment: Text.AlignLeft;
- verticalAlignment: Text.AlignVCenter
- }
- }
- }
-
- function down(path) {
- if (folders == folders1) {
- view = view2
- folders = folders2;
- view1.state = "exitLeft";
- } else {
- view = view1
- folders = folders1;
- view2.state = "exitLeft";
- }
- view.x = root.width;
- view.state = "current";
- view.focus = true;
- folders.folder = path;
- }
-
- function up() {
- var path = folders.parentFolder;
- if (path.toString().length === 0 || path.toString() === 'file:')
- return;
- if (folders == folders1) {
- view = view2
- folders = folders2;
- view1.state = "exitRight";
- } else {
- view = view1
- folders = folders1;
- view2.state = "exitRight";
- }
- view.x = -root.width;
- view.state = "current";
- view.focus = true;
- folders.folder = path;
- }
-
- function keyPressed(key) {
- switch (key) {
- case Qt.Key_Up:
- case Qt.Key_Down:
- case Qt.Key_Left:
- case Qt.Key_Right:
- root.showFocusHighlight = true;
- break;
- default:
- // do nothing
- break;
- }
- }
- }
- }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/Scene.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/Scene.qml
deleted file mode 100644
index 4f98241a6..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/Scene.qml
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: root
- color: "black"
- property alias buttonHeight: closeButton.height
- property string source1
- property string source2
- property int contentWidth: parent.width / 2
- property real volume: 0.25
- property int margins: 5
- property QtObject content
-
- signal close
- signal videoFramePainted
-
- Button {
- id: closeButton
- anchors {
- top: parent.top
- right: parent.right
- margins: root.margins
- }
- width: Math.max(parent.width, parent.height) / 12
- height: Math.min(parent.width, parent.height) / 12
- z: 2.0
- bgColor: "#212121"
- bgColorSelected: "#757575"
- textColorSelected: "white"
- text: "Back"
- onClicked: root.close()
- }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneBasic.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneBasic.qml
deleted file mode 100644
index 6c9c3ae2a..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneBasic.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property string contentType
- property bool autoStart: false
- property bool started: false
-
- Content {
- id: content
- autoStart: parent.autoStart
- started: parent.started
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: parent.contentType
- source: parent.source1
- volume: parent.volume
- onVideoFramePainted: root.videoFramePainted()
- }
-
- Text {
- anchors {
- horizontalCenter: parent.horizontalCenter
- bottom: parent.bottom
- margins: 20
- }
- text: content.started ? "Tap the screen to stop content"
- : "Tap the screen to start content"
- color: "#e0e0e0"
- z: 2.0
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (content.started)
- content.stop()
- else
- content.start()
- }
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneDrag.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneDrag.qml
deleted file mode 100644
index 0c7444e02..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneDrag.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property int margin: 20
- property string contentType
-
- Image {
- id: background
- source: "qrc:/images/leaves.jpg"
- x: (parent.width - width) / 2
- y: (parent.height - height) / 2
-
- Content {
- id: content
- anchors.centerIn: parent
- width: root.contentWidth
- contentType: root.contentType
- source: root.source1
- volume: root.volume
- onVideoFramePainted: root.videoFramePainted()
- }
- }
-
- MouseArea {
- anchors.fill: parent
- drag.target: background
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneFullScreen.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneFullScreen.qml
deleted file mode 100644
index 2ce10ce39..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneFullScreen.qml
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property string contentType
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: root.contentType
- source: parent.source1
- volume: parent.volume
- state: "left"
-
- states: [
- State {
- name: "fullScreen"
- PropertyChanges { target: content; width: content.parent.width }
- PropertyChanges { target: content; height: content.parent.height }
- }
- ]
-
- transitions: [
- Transition {
- ParallelAnimation {
- PropertyAnimation {
- property: "width"
- easing.type: Easing.Linear
- duration: 250
- }
- PropertyAnimation {
- property: "height"
- easing.type: Easing.Linear
- duration: 250
- }
- }
- }
- ]
-
- MouseArea {
- anchors.fill: parent
- onClicked: content.state = (content.state == "fullScreen") ? "baseState" : "fullScreen"
- }
-
- onVideoFramePainted: root.videoFramePainted()
- }
-
- Text {
- anchors {
- horizontalCenter: parent.horizontalCenter
- bottom: parent.bottom
- margins: 20
- }
- text: "Tap on the content to toggle full-screen mode"
- color: "#e0e0e0"
- z: 2.0
- }
-
- Component.onCompleted: root.content = content
-}
-
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneFullScreenInverted.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneFullScreenInverted.qml
deleted file mode 100644
index 7e7eb7039..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneFullScreenInverted.qml
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property string contentType
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.width
- height: parent.height
- contentType: root.contentType
- source: parent.source1
- volume: parent.volume
- state: "left"
-
- states: [
- State {
- name: "nonFullScreen"
- PropertyChanges { target: content; width: content.parent.contentWidth }
- }
- ]
-
- transitions: [
- Transition {
- ParallelAnimation {
- PropertyAnimation {
- property: "width"
- easing.type: Easing.Linear
- duration: 250
- }
- PropertyAnimation {
- property: "height"
- easing.type: Easing.Linear
- duration: 250
- }
- }
- }
- ]
-
- MouseArea {
- anchors.fill: parent
- onClicked: content.state = (content.state == "nonFullScreen") ? "baseState" : "nonFullScreen"
- }
-
- onVideoFramePainted: root.videoFramePainted()
-
- onInitialized: {
- width = parent.width
- height = parent.height
- }
- }
-
- Text {
- anchors {
- horizontalCenter: parent.horizontalCenter
- bottom: parent.bottom
- margins: 20
- }
- text: "Tap on the content to toggle full-screen mode"
- color: "#e0e0e0"
- z: 2.0
- }
-
- Component.onCompleted: root.content = content
-}
-
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneMove.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneMove.qml
deleted file mode 100644
index adf414daa..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneMove.qml
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property int margin: 20
- property string contentType
-
- Content {
- id: content
- anchors.verticalCenter: parent.verticalCenter
- width: parent.contentWidth
- contentType: root.contentType
- source: parent.source1
- volume: parent.volume
-
- SequentialAnimation on x {
- id: animation
- loops: Animation.Infinite
- property int from: margin
- property int to: 100
- property int duration: 1500
- running: false
- PropertyAnimation {
- from: animation.from
- to: animation.to
- duration: animation.duration
- easing.type: Easing.InOutCubic
- }
- PropertyAnimation {
- from: animation.to
- to: animation.from
- duration: animation.duration
- easing.type: Easing.InOutCubic
- }
- }
-
- onVideoFramePainted: root.videoFramePainted()
- }
-
- onWidthChanged: {
- animation.to = root.width - content.width - margin
- animation.start()
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml
deleted file mode 100644
index b3f7350eb..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property int margin: 20
- property string contentType
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: root.contentType
- source: parent.source1
- volume: parent.volume
- onVideoFramePainted: root.videoFramePainted()
- }
-
- Rectangle {
- id: overlay
- y: 0.5 * parent.height
- width: content.width
- height: content.height
- color: "#e0e0e0"
- opacity: 0.5
-
- SequentialAnimation on x {
- id: xAnimation
- loops: Animation.Infinite
- property int from: margin
- property int to: 100
- property int duration: 1500
- running: false
- PropertyAnimation {
- from: xAnimation.from
- to: xAnimation.to
- duration: xAnimation.duration
- easing.type: Easing.InOutCubic
- }
- PropertyAnimation {
- from: xAnimation.to
- to: xAnimation.from
- duration: xAnimation.duration
- easing.type: Easing.InOutCubic
- }
- }
-
- SequentialAnimation on y {
- id: yAnimation
- loops: Animation.Infinite
- property int from: margin
- property int to: 180
- property int duration: 1500
- running: false
- PropertyAnimation {
- from: yAnimation.from
- to: yAnimation.to
- duration: yAnimation.duration
- easing.type: Easing.InOutCubic
- }
- PropertyAnimation {
- from: yAnimation.to
- to: yAnimation.from
- duration: yAnimation.duration
- easing.type: Easing.InOutCubic
- }
- }
- }
-
- onWidthChanged: {
- xAnimation.to = root.width - content.width - margin
- xAnimation.start()
- }
-
- onHeightChanged: {
- //yAnimation.to = root.height - content.height - margin
- yAnimation.start()
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneResize.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneResize.qml
deleted file mode 100644
index 778d81dd5..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneResize.qml
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property string contentType
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: root.contentType
- source: parent.source1
- volume: parent.volume
-
- SequentialAnimation on scale {
- id: animation
- loops: Animation.Infinite
- property int duration: 1500
- running: true
- PropertyAnimation {
- from: 1.5
- to: 0.5
- duration: animation.duration
- easing.type: Easing.InOutCubic
- }
- PropertyAnimation {
- from: 0.5
- to: 1.5
- duration: animation.duration
- easing.type: Easing.InOutCubic
- }
- }
-
- onVideoFramePainted: root.videoFramePainted()
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneRotate.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneRotate.qml
deleted file mode 100644
index f9549fdca..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneRotate.qml
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property int margin: 20
- property int delta: 30
- property string contentType
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: root.contentType
- source: parent.source1
- volume: parent.volume
- onVideoFramePainted: root.videoFramePainted()
- }
-
- Button {
- id: rotatePositiveButton
- anchors {
- right: parent.right
- bottom: rotateNegativeButton.top
- margins: parent.margins
- }
- width: Math.max(parent.width, parent.height) / 10
- height: root.buttonHeight
- text: "Rotate +" + delta
- onClicked: content.rotation = content.rotation + delta
- }
-
- Button {
- id: rotateNegativeButton
- anchors {
- right: parent.right
- verticalCenter: parent.verticalCenter
- margins: parent.margins
- }
- width: Math.max(parent.width, parent.height) / 10
- height: root.buttonHeight
- text: "Rotate -" + delta
- onClicked: content.rotation = content.rotation - delta
- }
-
- Button {
- id: rotateValueButton
- anchors {
- left: parent.left
- verticalCenter: parent.verticalCenter
- margins: parent.margins
- }
- width: Math.max(parent.width, parent.height) / 25
- height: root.buttonHeight
- enabled: false
- text: content.rotation % 360
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneSelectionPanel.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneSelectionPanel.qml
deleted file mode 100644
index e36fe6045..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneSelectionPanel.qml
+++ /dev/null
@@ -1,151 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: root
- property int itemHeight: 25
- property string sceneSource: ""
-
- ListModel {
- id: videolist
- ListElement { name: "Multi"; source: "SceneMulti.qml" }
- ListElement { name: "Video"; source: "VideoBasic.qml" }
- ListElement { name: "Drag"; source: "VideoDrag.qml" }
- ListElement { name: "Fillmode"; source: "VideoFillMode.qml" }
- ListElement { name: "Fullscreen"; source: "VideoFullScreen.qml" }
- ListElement { name: "Fullscreen-inverted"; source: "VideoFullScreenInverted.qml" }
- ListElement { name: "Metadata"; source: "VideoMetadata.qml" }
- ListElement { name: "Move"; source: "VideoMove.qml" }
- ListElement { name: "Overlay"; source: "VideoOverlay.qml" }
- ListElement { name: "Playback Rate"; source: "VideoPlaybackRate.qml" }
- ListElement { name: "Resize"; source: "VideoResize.qml" }
- ListElement { name: "Rotate"; source: "VideoRotate.qml" }
- ListElement { name: "Spin"; source: "VideoSpin.qml" }
- ListElement { name: "Seek"; source: "VideoSeek.qml" }
- }
-
- ListModel {
- id: cameralist
- ListElement { name: "Camera"; source: "CameraBasic.qml" }
- ListElement { name: "Drag"; source: "CameraDrag.qml" }
- ListElement { name: "Fullscreen"; source: "CameraFullScreen.qml" }
- ListElement { name: "Fullscreen-inverted"; source: "CameraFullScreenInverted.qml" }
- ListElement { name: "Move"; source: "CameraMove.qml" }
- ListElement { name: "Overlay"; source: "CameraOverlay.qml" }
- ListElement { name: "Resize"; source: "CameraResize.qml" }
- ListElement { name: "Rotate"; source: "CameraRotate.qml" }
- ListElement { name: "Spin"; source: "CameraSpin.qml" }
- }
-
- Component {
- id: leftDelegate
- Item {
- width: root.width / 2
- height: 0.8 * itemHeight
-
- Button {
- anchors.fill: parent
- anchors.margins: 5
- anchors.rightMargin: 2.5
- anchors.bottomMargin: 0
- text: name
- onClicked: root.sceneSource = source
- }
- }
- }
-
- Component {
- id: rightDelegate
- Item {
- width: root.width / 2
- height: 0.8 * itemHeight
-
- Button {
- anchors.fill: parent
- anchors.margins: 5
- anchors.leftMargin: 2.5
- anchors.bottomMargin: 0
- text: name
- onClicked: root.sceneSource = source
- }
- }
- }
-
- Flickable {
- anchors.fill: parent
- contentHeight: (itemHeight * videolist.count) + 10
- clip: true
-
- Row {
- id: layout
- anchors {
- fill: parent
- topMargin: 5
- bottomMargin: 5
- }
-
- Column {
- Repeater {
- model: videolist
- delegate: leftDelegate
- }
- }
-
- Column {
- Repeater {
- model: cameralist
- delegate: rightDelegate
- }
- }
- }
- }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneSpin.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneSpin.qml
deleted file mode 100644
index 925b92566..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneSpin.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property int margin: 20
- property string contentType
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: root.contentType
- source: parent.source1
- volume: parent.volume
-
- PropertyAnimation on rotation {
- id: animation
- loops: Animation.Infinite
- running: true
- from: 0
- to: 360
- duration: 3000
- easing.type: Easing.Linear
- }
-
- onVideoFramePainted: root.videoFramePainted()
- }
-
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoBasic.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoBasic.qml
deleted file mode 100644
index 09f890670..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoBasic.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneBasic {
- contentType: "video"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoDrag.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoDrag.qml
deleted file mode 100644
index b24bb4517..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoDrag.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneDrag {
- contentType: "video"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoDummy.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoDummy.qml
deleted file mode 100644
index 371173973..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoDummy.qml
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-// Item which is loaded by VideoItem if Qt Multimedia is not available
-Rectangle {
- id: root
- color: "grey"
- height: width
- property int duration: 0
- property int position: 0
- property string source
- property real volume: 1.0
- property real playbackRate: 1.0
-
- signal fatalError
- signal sizeChanged
- signal framePainted
-
- Text {
- anchors.fill: parent
- anchors.margins: 10
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- text: "Failed to create Video item\n\nCheck that Qt Multimedia is installed"
- verticalAlignment: Text.AlignVCenter
- wrapMode: Text.Wrap
- }
-
- onWidthChanged: height = width
- onHeightChanged: root.sizeChanged()
-
- function start() { }
- function stop() { }
- function seek() { }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFillMode.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFillMode.qml
deleted file mode 100644
index 68157584e..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFillMode.qml
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtMultimedia 5.0
-
-Scene {
- id: root
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: "video"
- source: parent.source1
- volume: parent.volume
- onVideoFramePainted: root.videoFramePainted()
- }
-
- Button {
- id: button
- anchors {
- right: parent.right
- verticalCenter: parent.verticalCenter
- margins: parent.margins
- }
- width: Math.max(parent.width, parent.height) / 5
- height: root.buttonHeight
- text: "PreserveAspectFit"
- onClicked: {
- if (!content.dummy) {
- var video = content.contentItem()
- if (video.fillMode === VideoOutput.Stretch) {
- video.fillMode = VideoOutput.PreserveAspectFit
- text = "PreserveAspectFit"
- } else if (video.fillMode === VideoOutput.PreserveAspectFit) {
- video.fillMode = VideoOutput.PreserveAspectCrop
- text = "PreserveAspectCrop"
- } else {
- video.fillMode = VideoOutput.Stretch
- text = "Stretch"
- }
- }
- }
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFullScreen.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFullScreen.qml
deleted file mode 100644
index 480d6824d..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFullScreen.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneFullScreen {
- contentType: "video"
-}
-
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFullScreenInverted.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFullScreenInverted.qml
deleted file mode 100644
index c65c33872..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoFullScreenInverted.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneFullScreenInverted {
- contentType: "video"
-}
-
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoItem.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoItem.qml
deleted file mode 100644
index 8372acb7e..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoItem.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtMultimedia 5.0
-
-VideoOutput {
- id: root
- height: width
- source: mediaPlayer
-
- property alias duration: mediaPlayer.duration
- property alias mediaSource: mediaPlayer.source
- property alias metaData: mediaPlayer.metaData
- property alias playbackRate: mediaPlayer.playbackRate
- property alias position: mediaPlayer.position
- property alias volume: mediaPlayer.volume
-
- signal sizeChanged
- signal fatalError
-
- onHeightChanged: root.sizeChanged()
-
- MediaPlayer {
- id: mediaPlayer
- autoLoad: false
- loops: Audio.Infinite
-
- onError: {
- if (MediaPlayer.NoError != error) {
- console.log("[qmlvideo] VideoItem.onError error " + error + " errorString " + errorString)
- root.fatalError()
- }
- }
- }
-
- function start() { mediaPlayer.play() }
- function stop() { mediaPlayer.stop() }
- function seek(position) { mediaPlayer.seek(position); }
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoMetadata.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoMetadata.qml
deleted file mode 100644
index b9672f1c5..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoMetadata.qml
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property string contentType: "video"
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: "video"
- source: parent.source1
- volume: parent.volume
- onInitialized: {
- if (!dummy)
- metadata.createObject(root)
- }
- onVideoFramePainted: root.videoFramePainted()
- }
-
- Component {
- id: metadata
- Column {
- anchors.fill: parent
- Text {
- color: "#e0e0e0"
- text: "Title:" + content.contentItem().metaData.title
- }
- Text {
- color: "#e0e0e0"
- text: "Size:" + content.contentItem().metaData.size
- }
- Text {
- color: "#e0e0e0"
- text: "Resolution:" + content.contentItem().metaData.resolution
- }
- Text {
- color: "#e0e0e0"
- text: "Media type:" + content.contentItem().metaData.mediaType
- }
- Text {
- color: "#e0e0e0"
- text: "Video codec:" + content.contentItem().metaData.videoCodec
- }
- Text {
- color: "#e0e0e0"
- text: "Video bit rate:" + content.contentItem().metaData.videoBitRate
- }
- Text {
- color: "#e0e0e0"
- text: "Video frame rate:" +content.contentItem().metaData.videoFrameRate
- }
- Text {
- color: "#e0e0e0"
- text: "Audio codec:" + content.contentItem().metaData.audioCodec
- }
- Text {
- color: "#e0e0e0"
- text: "Audio bit rate:" + content.contentItem().metaData.audioBitRate
- }
- Text {
- color: "#e0e0e0"
- text: "Date:" + content.contentItem().metaData.date
- }
- Text {
- color: "#e0e0e0"
- text: "Description:" + content.contentItem().metaData.description
- }
- Text {
- color: "#e0e0e0"
- text: "Copyright:" + content.contentItem().metaData.copyright
- }
- Text {
- color: "#e0e0e0"
- text: "Seekable:" + content.contentItem().metaData.seekable
- }
- Text {
- color: "#e0e0e0"
- text: "Orientation:" + content.contentItem().metaData.orientation
- }
- }
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoMove.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoMove.qml
deleted file mode 100644
index 56e3a96b9..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoMove.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneMove {
- contentType: "video"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoOverlay.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoOverlay.qml
deleted file mode 100644
index 4313a33db..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoOverlay.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneOverlay {
- contentType: "video"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoPlaybackRate.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoPlaybackRate.qml
deleted file mode 100644
index 80a12d3db..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoPlaybackRate.qml
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property int margin: 20
- property real delta: 0.1
- property string contentType: "video"
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: "video"
- source: parent.source1
- volume: parent.volume
- onVideoFramePainted: root.videoFramePainted()
- }
-
- Button {
- id: increaseButton
- anchors {
- right: parent.right
- bottom: decreaseButton.top
- margins: parent.margins
- }
- width: Math.max(parent.width, parent.height) / 10
- height: root.buttonHeight
- text: "Increase"
- onClicked: {
- var video = content.contentItem()
- video.playbackRate += delta
- }
- }
-
- Button {
- id: decreaseButton
- anchors {
- right: parent.right
- verticalCenter: parent.verticalCenter
- margins: parent.margins
- }
- width: Math.max(parent.width, parent.height) / 10
- height: root.buttonHeight
- text: "Decrease"
- onClicked: {
- var video = content.contentItem()
- video.playbackRate -= delta
- }
- }
-
- Button {
- id: valueButton
- anchors {
- left: parent.left
- verticalCenter: parent.verticalCenter
- margins: parent.margins
- }
- width: Math.max(parent.width, parent.height) / 25
- height: root.buttonHeight
- enabled: false
- text: Math.round(10 * content.contentItem().playbackRate) / 10
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoResize.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoResize.qml
deleted file mode 100644
index f83465f48..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoResize.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneResize {
- contentType: "video"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoRotate.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoRotate.qml
deleted file mode 100644
index 0eb198d20..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoRotate.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneRotate {
- contentType: "video"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoSeek.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoSeek.qml
deleted file mode 100644
index 8e3575920..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoSeek.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Scene {
- id: root
- property string contentType: "video"
- contentWidth: parent.width
-
- Content {
- id: content
- anchors.centerIn: parent
- width: parent.contentWidth
- contentType: "video"
- source: parent.source1
- volume: parent.volume
- onVideoFramePainted: root.videoFramePainted()
- }
-
- SeekControl {
- anchors {
- left: parent.left
- right: parent.right
- margins: 10
- bottom: parent.bottom
- }
- duration: content.contentItem() ? content.contentItem().duration : 0
- playPosition: content.contentItem() ? content.contentItem().position : 0
- onSeekPositionChanged: content.contentItem().seek(seekPosition);
- }
-
- Component.onCompleted: root.content = content
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoSpin.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoSpin.qml
deleted file mode 100644
index cb46797f6..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/VideoSpin.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-SceneSpin {
- contentType: "video"
-}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/main.qml b/examples/multimedia/video/qmlvideo/qml/qmlvideo/main.qml
deleted file mode 100644
index 43f827e97..000000000
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/main.qml
+++ /dev/null
@@ -1,284 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: root
- anchors.fill: parent
- color: "black"
-
- property string source1
- property string source2
- property color bgColor: "black"
- property real volume: 0.25
- property bool perfMonitorsLogging: false
- property bool perfMonitorsVisible: false
-
- QtObject {
- id: d
- property int itemHeight: root.height > root.width ? root.width / 10 : root.height / 10
- property int buttonHeight: 0.8 * itemHeight
- property int margins: 5
- }
-
- Loader {
- id: performanceLoader
-
- Connections {
- target: inner
- onVisibleChanged:
- if (performanceLoader.item)
- performanceLoader.item.enabled = !inner.visible
- ignoreUnknownSignals: true
- }
-
- function init() {
- var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
- source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
- }
-
- onLoaded: {
- item.parent = root
- item.anchors.fill = root
- item.logging = root.perfMonitorsLogging
- item.displayed = root.perfMonitorsVisible
- item.enabled = false
- item.init()
- }
- }
-
- Rectangle {
- id: inner
- anchors.fill: parent
- color: root.bgColor
-
- Button {
- id: openFile1Button
- anchors {
- top: parent.top
- left: parent.left
- right: exitButton.left
- margins: d.margins
- }
- bgColor: "#212121"
- bgColorSelected: "#757575"
- textColorSelected: "white"
- height: d.buttonHeight
- text: (root.source1 == "") ? "Select file 1" : root.source1
- onClicked: fileBrowser1.show()
- }
-
- Button {
- id: openFile2Button
- anchors {
- top: openFile1Button.bottom
- left: parent.left
- right: exitButton.left
- margins: d.margins
- }
- bgColor: "#212121"
- bgColorSelected: "#757575"
- textColorSelected: "white"
- height: d.buttonHeight
- text: (root.source2 == "") ? "Select file 2" : root.source2
- onClicked: fileBrowser2.show()
- }
-
- Button {
- id: exitButton
- anchors {
- top: parent.top
- right: parent.right
- margins: d.margins
- }
- bgColor: "#212121"
- bgColorSelected: "#757575"
- textColorSelected: "white"
- width: parent.width / 10
- height: d.buttonHeight
- text: "Exit"
- onClicked: Qt.quit()
- }
-
- Row {
- id: modes
- anchors.top: openFile2Button.bottom
- anchors.margins: 0
- anchors.topMargin: 5
- Button {
- width: root.width / 2
- height: 0.8 * d.itemHeight
- bgColor: "#212121"
- radius: 0
- text: "Video Modes"
- enabled: false
- }
- Button {
- width: root.width / 2
- height: 0.8 * d.itemHeight
- bgColor: "#212121"
- radius: 0
- text: "Camera Modes"
- enabled: false
- }
- }
-
- Rectangle {
- id: divider
- height: 1
- width: parent.width
- color: "black"
- anchors.top: modes.bottom
- }
-
- SceneSelectionPanel {
- id: sceneSelectionPanel
- itemHeight: d.itemHeight
- color: "#212121"
- anchors {
- top: divider.bottom
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- radius: 0
- onSceneSourceChanged: {
- sceneLoader.source = sceneSource
- var scene = null
- var innerVisible = true
- if (sceneSource == "") {
- if (performanceLoader.item)
- performanceLoader.item.videoActive = false
- } else {
- scene = sceneLoader.item
- if (scene) {
- if (scene.contentType === "video" && source1 === "") {
- errorDialog.show("You must first select a video file")
- sceneSource = ""
- } else {
- scene.parent = root
- scene.color = root.bgColor
- scene.buttonHeight = d.buttonHeight
- scene.source1 = source1
- scene.source2 = source2
- scene.volume = volume
- scene.anchors.fill = root
- scene.close.connect(closeScene)
- scene.content.initialize()
- innerVisible = false
- }
- }
- }
- videoFramePaintedConnection.target = scene
- inner.visible = innerVisible
- }
- }
- }
-
- Loader {
- id: sceneLoader
- }
-
- Connections {
- id: videoFramePaintedConnection
- onVideoFramePainted: {
- if (performanceLoader.item)
- performanceLoader.item.videoFramePainted()
- }
- ignoreUnknownSignals: true
- }
-
- FileBrowser {
- id: fileBrowser1
- anchors.fill: root
- onFolderChanged: fileBrowser2.folder = folder
- Component.onCompleted: fileSelected.connect(root.openFile1)
- }
-
- FileBrowser {
- id: fileBrowser2
- anchors.fill: root
- onFolderChanged: fileBrowser1.folder = folder
- Component.onCompleted: fileSelected.connect(root.openFile2)
- }
-
- function openFile1(path) {
- root.source1 = path
- }
-
- function openFile2(path) {
- root.source2 = path
- }
-
- ErrorDialog {
- id: errorDialog
- anchors.fill: root
- dialogWidth: d.itemHeight * 5
- dialogHeight: d.itemHeight * 3
- enabled: false
- }
-
- // Called from main() once root properties have been set
- function init() {
- performanceLoader.init()
- fileBrowser1.folder = videoPath
- fileBrowser2.folder = videoPath
- }
-
- function qmlFramePainted() {
- if (performanceLoader.item)
- performanceLoader.item.qmlFramePainted()
- }
-
- function closeScene() {
- sceneSelectionPanel.sceneSource = ""
- }
-}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo.pro b/examples/multimedia/video/qmlvideo/qmlvideo.pro
index dbd3a42a1..b61339264 100644
--- a/examples/multimedia/video/qmlvideo/qmlvideo.pro
+++ b/examples/multimedia/video/qmlvideo/qmlvideo.pro
@@ -7,15 +7,88 @@ android: qtHaveModule(androidextras) {
DEFINES += REQUEST_PERMISSIONS_ON_ANDROID
}
-LOCAL_SOURCES = main.cpp
-LOCAL_HEADERS = trace.h
+DEFINES += \
+ FREQUENCYMONITOR_SUPPORT \
+ PERFORMANCEMONITOR_SUPPORT
-SOURCES += $$LOCAL_SOURCES
-HEADERS += $$LOCAL_HEADERS
-RESOURCES += qmlvideo.qrc
+SOURCES += \
+ frequencymonitor.cpp \
+ frequencymonitordeclarative.cpp \
+ main.cpp \
+ performancemonitor.cpp \
+ performancemonitordeclarative.cpp \
+ qmlvideo/videosingleton.cpp
-SNIPPETS_PATH = ../snippets
-include($$SNIPPETS_PATH/performancemonitor/performancemonitordeclarative.pri)
+INCLUDEPATH += qmlvideo
+
+DEFINES += QMLVIDEO_LIB
+
+HEADERS += \
+ frequencymonitor.h \
+ performancemonitor.h \
+ performancemonitordeclarative.h \
+ trace.h \
+ qmlvideo/videosingleton.h
+
+resources.files = \
+ frequencymonitor/FrequencyItem.qml \
+ frequencymonitor/qmldir \
+ performancemonitor/PerformanceItem.qml \
+ performancemonitor/qmldir \
+ qmlvideo/CameraBasic.qml \
+ qmlvideo/CameraDrag.qml \
+ qmlvideo/CameraDummy.qml \
+ qmlvideo/CameraFullScreen.qml \
+ qmlvideo/CameraFullScreenInverted.qml \
+ qmlvideo/CameraItem.qml \
+ qmlvideo/CameraMove.qml \
+ qmlvideo/CameraOverlay.qml \
+ qmlvideo/CameraResize.qml \
+ qmlvideo/CameraRotate.qml \
+ qmlvideo/CameraSpin.qml \
+ qmlvideo/Content.qml \
+ qmlvideo/ErrorDialog.qml \
+ qmlvideo/Main.qml \
+ qmlvideo/Scene.qml \
+ qmlvideo/SceneBasic.qml \
+ qmlvideo/SceneDrag.qml \
+ qmlvideo/SceneFullScreen.qml \
+ qmlvideo/SceneFullScreenInverted.qml \
+ qmlvideo/SceneMove.qml \
+ qmlvideo/SceneMulti.qml \
+ qmlvideo/SceneOverlay.qml \
+ qmlvideo/SceneResize.qml \
+ qmlvideo/SceneRotate.qml \
+ qmlvideo/SceneSelectionPanel.qml \
+ qmlvideo/SceneSpin.qml \
+ qmlvideo/SeekControl.qml \
+ qmlvideo/VideoBasic.qml \
+ qmlvideo/VideoDrag.qml \
+ qmlvideo/VideoDummy.qml \
+ qmlvideo/VideoFillMode.qml \
+ qmlvideo/VideoFullScreen.qml \
+ qmlvideo/VideoFullScreenInverted.qml \
+ qmlvideo/VideoItem.qml \
+ qmlvideo/VideoMetadata.qml \
+ qmlvideo/VideoMove.qml \
+ qmlvideo/VideoOverlay.qml \
+ qmlvideo/VideoPlaybackRate.qml \
+ qmlvideo/VideoResize.qml \
+ qmlvideo/VideoRotate.qml \
+ qmlvideo/VideoSeek.qml \
+ qmlvideo/VideoSpin.qml \
+ qmlvideo/images/folder.png \
+ qmlvideo/images/leaves.jpg \
+ qmlvideo/images/up.png \
+ qmlvideo/qmldir
+
+resources.prefix = /qt/qml/
+
+RESOURCES += resources
+
+CONFIG += qmltypes
+QML_IMPORT_NAME = qmlvideo
+QML_IMPORT_MAJOR_VERSION = 1
target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/video/qmlvideo
INSTALLS += target
@@ -23,3 +96,4 @@ INSTALLS += target
EXAMPLE_FILES += \
qmlvideo.png \
qmlvideo.svg
+
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo.qrc b/examples/multimedia/video/qmlvideo/qmlvideo.qrc
deleted file mode 100644
index 6418215d0..000000000
--- a/examples/multimedia/video/qmlvideo/qmlvideo.qrc
+++ /dev/null
@@ -1,51 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file alias="leaves.jpg">images/leaves.jpg</file>
- <file alias="folder.png">images/folder.png</file>
- <file alias="up.png">images/up.png</file>
- <file>qml/qmlvideo/Button.qml</file>
- <file>qml/qmlvideo/CameraBasic.qml</file>
- <file>qml/qmlvideo/CameraDrag.qml</file>
- <file>qml/qmlvideo/CameraDummy.qml</file>
- <file>qml/qmlvideo/CameraFullScreen.qml</file>
- <file>qml/qmlvideo/CameraFullScreenInverted.qml</file>
- <file>qml/qmlvideo/CameraItem.qml</file>
- <file>qml/qmlvideo/CameraMove.qml</file>
- <file>qml/qmlvideo/CameraOverlay.qml</file>
- <file>qml/qmlvideo/CameraResize.qml</file>
- <file>qml/qmlvideo/CameraRotate.qml</file>
- <file>qml/qmlvideo/CameraSpin.qml</file>
- <file>qml/qmlvideo/Content.qml</file>
- <file>qml/qmlvideo/ErrorDialog.qml</file>
- <file>qml/qmlvideo/FileBrowser.qml</file>
- <file>qml/qmlvideo/main.qml</file>
- <file>qml/qmlvideo/Scene.qml</file>
- <file>qml/qmlvideo/SceneBasic.qml</file>
- <file>qml/qmlvideo/SceneDrag.qml</file>
- <file>qml/qmlvideo/SceneFullScreen.qml</file>
- <file>qml/qmlvideo/SceneFullScreenInverted.qml</file>
- <file>qml/qmlvideo/SceneMove.qml</file>
- <file>qml/qmlvideo/SceneMulti.qml</file>
- <file>qml/qmlvideo/SceneOverlay.qml</file>
- <file>qml/qmlvideo/SceneResize.qml</file>
- <file>qml/qmlvideo/SceneRotate.qml</file>
- <file>qml/qmlvideo/SceneSelectionPanel.qml</file>
- <file>qml/qmlvideo/SceneSpin.qml</file>
- <file>qml/qmlvideo/SeekControl.qml</file>
- <file>qml/qmlvideo/VideoBasic.qml</file>
- <file>qml/qmlvideo/VideoDrag.qml</file>
- <file>qml/qmlvideo/VideoDummy.qml</file>
- <file>qml/qmlvideo/VideoFillMode.qml</file>
- <file>qml/qmlvideo/VideoFullScreen.qml</file>
- <file>qml/qmlvideo/VideoFullScreenInverted.qml</file>
- <file>qml/qmlvideo/VideoItem.qml</file>
- <file>qml/qmlvideo/VideoMetadata.qml</file>
- <file>qml/qmlvideo/VideoMove.qml</file>
- <file>qml/qmlvideo/VideoOverlay.qml</file>
- <file>qml/qmlvideo/VideoPlaybackRate.qml</file>
- <file>qml/qmlvideo/VideoResize.qml</file>
- <file>qml/qmlvideo/VideoRotate.qml</file>
- <file>qml/qmlvideo/VideoSeek.qml</file>
- <file>qml/qmlvideo/VideoSpin.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CMakeLists.txt b/examples/multimedia/video/qmlvideo/qmlvideo/CMakeLists.txt
new file mode 100644
index 000000000..84a65710e
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CMakeLists.txt
@@ -0,0 +1,81 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ message(FATAL_ERROR "This module is part of the 'qmlvideo' example, and should not be built independently.")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/multimedia/video/qmlvideo/qmlvideo")
+
+qt_add_qml_module(qmlvideo
+ URI qmlvideo
+ SOURCES
+ videosingleton.cpp
+ videosingleton.h
+ qmlvideo_global.h
+ QML_FILES
+ "CameraBasic.qml"
+ "CameraDrag.qml"
+ "CameraDummy.qml"
+ "CameraFullScreen.qml"
+ "CameraFullScreenInverted.qml"
+ "CameraItem.qml"
+ "CameraMove.qml"
+ "CameraOverlay.qml"
+ "CameraResize.qml"
+ "CameraRotate.qml"
+ "CameraSpin.qml"
+ "Content.qml"
+ "ErrorDialog.qml"
+ "Main.qml"
+ "Scene.qml"
+ "SceneBasic.qml"
+ "SceneDrag.qml"
+ "SceneFullScreen.qml"
+ "SceneFullScreenInverted.qml"
+ "SceneMove.qml"
+ "SceneMulti.qml"
+ "SceneOverlay.qml"
+ "SceneResize.qml"
+ "SceneRotate.qml"
+ "SceneSelectionPanel.qml"
+ "SceneSpin.qml"
+ "SeekControl.qml"
+ "VideoBasic.qml"
+ "VideoDrag.qml"
+ "VideoDummy.qml"
+ "VideoFillMode.qml"
+ "VideoFullScreen.qml"
+ "VideoFullScreenInverted.qml"
+ "VideoItem.qml"
+ "VideoMetadata.qml"
+ "VideoMove.qml"
+ "VideoOverlay.qml"
+ "VideoPlaybackRate.qml"
+ "VideoResize.qml"
+ "VideoRotate.qml"
+ "VideoSeek.qml"
+ "VideoSpin.qml"
+ RESOURCES
+ "images/folder.png"
+ "images/leaves.jpg"
+ "images/up.png"
+)
+
+target_compile_definitions(qmlvideo PRIVATE QMLVIDEO_LIB)
+
+target_link_libraries(qmlvideo PRIVATE
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Quick
+)
+
+install(TARGETS qmlvideo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir
+ DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraBasic.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraBasic.qml
new file mode 100644
index 000000000..77072c6c9
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraBasic.qml
@@ -0,0 +1,7 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneBasic {
+ contentType: "camera"
+ started: true
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraDrag.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraDrag.qml
new file mode 100644
index 000000000..2ea3672c6
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraDrag.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneDrag {
+ contentType: "camera"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraDummy.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraDummy.qml
new file mode 100644
index 000000000..c9d14e595
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraDummy.qml
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+// Item which is loaded by CameraItem if Qt Multimedia is not available
+Rectangle {
+ id: root
+ color: "grey"
+ height: width
+
+ signal fatalError
+ signal sizeChanged
+ signal framePainted
+
+ Label {
+ anchors.fill: parent
+ anchors.margins: 10
+ horizontalAlignment: Text.AlignHCenter
+ text: qsTr("Failed to create Camera item\n\nCheck that Qt Multimedia is installed")
+ verticalAlignment: Text.AlignVCenter
+ wrapMode: Text.Wrap
+ }
+
+ onWidthChanged: height = width
+ onHeightChanged: root.sizeChanged()
+
+ function start() { }
+ function stop() { }
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraFullScreen.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraFullScreen.qml
new file mode 100644
index 000000000..b204e74ab
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraFullScreen.qml
@@ -0,0 +1,7 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneFullScreen {
+ contentType: "camera"
+}
+
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraFullScreenInverted.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraFullScreenInverted.qml
new file mode 100644
index 000000000..ff7a40253
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraFullScreenInverted.qml
@@ -0,0 +1,7 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneFullScreenInverted {
+ contentType: "camera"
+}
+
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() }
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraMove.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraMove.qml
new file mode 100644
index 000000000..c4c5da914
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraMove.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneMove {
+ contentType: "camera"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraOverlay.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraOverlay.qml
new file mode 100644
index 000000000..13136be00
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraOverlay.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneOverlay {
+ contentType: "camera"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraResize.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraResize.qml
new file mode 100644
index 000000000..d89eef3ad
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraResize.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneResize {
+ contentType: "camera"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraRotate.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraRotate.qml
new file mode 100644
index 000000000..8394fb6fd
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraRotate.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneRotate {
+ contentType: "camera"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/CameraSpin.qml b/examples/multimedia/video/qmlvideo/qmlvideo/CameraSpin.qml
new file mode 100644
index 000000000..642a0edfd
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/CameraSpin.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneSpin {
+ contentType: "camera"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/Content.qml b/examples/multimedia/video/qmlvideo/qmlvideo/Content.qml
new file mode 100644
index 000000000..b08d19325
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/Content.qml
@@ -0,0 +1,125 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import frequencymonitor
+
+Rectangle {
+ id: root
+ border.color: palette.window
+ border.width: showBorder ? 1 : 0
+ color: "transparent"
+ property string contentType // "camera" or "video"
+ property string source
+ property real volume
+ property bool dummy: false
+ property bool autoStart: true
+ property bool started: false
+ property bool showFrameRate: false
+ property bool showBorder: false
+ property alias contentItem: contentLoader.item
+
+ signal initialized
+ signal error
+ signal videoFramePainted
+
+ Loader {
+ id: contentLoader
+ }
+
+ Connections {
+ id: framePaintedConnection
+ function onFramePainted() {
+ (frameRateLoader.item as FrequencyItem)?.notify()
+ root.videoFramePainted()
+ }
+ ignoreUnknownSignals: true
+ }
+
+ Connections {
+ id: errorConnection
+ function onFatalError() {
+ console.log("[qmlvideo] Content.onFatalError")
+ root.stop()
+ root.error()
+ }
+ ignoreUnknownSignals: true
+ }
+
+ Component {
+ id: frequencyItem
+ FrequencyItem {}
+ }
+
+ Loader {
+ id: frameRateLoader
+ sourceComponent: root.showFrameRate ? frequencyItem : undefined
+ onLoaded: {
+ item.parent = root
+ item.anchors.top = root.top
+ item.anchors.right = root.right
+ item.anchors.margins = 10
+ }
+ }
+
+ onWidthChanged: {
+ if (root.contentItem)
+ root.contentItem.width = width
+ }
+
+ onHeightChanged: {
+ if (root.contentItem)
+ root.contentItem.height = height
+ }
+
+ function initialize() {
+ if ("video" == contentType) {
+ contentLoader.source = "VideoItem.qml"
+ if (Loader.Error == contentLoader.status) {
+ contentLoader.source = "VideoDummy.qml"
+ dummy = true
+ }
+ contentLoader.item.volume = volume
+ } else if ("camera" == contentType) {
+ contentLoader.source = "CameraItem.qml"
+ if (Loader.Error == contentLoader.status) {
+ contentLoader.source = "CameraDummy.qml"
+ dummy = true
+ }
+ } else {
+ console.log("[qmlvideo] Content.initialize: error: invalid contentType")
+ }
+ if (contentLoader.item) {
+ contentLoader.item.sizeChanged.connect(updateRootSize)
+ contentLoader.item.parent = root
+ contentLoader.item.width = root.width
+ framePaintedConnection.target = contentLoader.item
+ errorConnection.target = contentLoader.item
+ if (root.autoStart)
+ root.start()
+ }
+ root.initialized()
+ }
+
+ function start() {
+ if (contentLoader.item) {
+ if (root.contentType == "video")
+ contentLoader.item.mediaSource = root.source
+ contentLoader.item.start()
+ root.started = true
+ }
+ }
+
+ // qmllint disable
+ function stop() {
+ if (contentLoader.item) {
+ contentLoader.item.stop()
+ if (root.contentType == "video")
+ contentLoader.item.mediaSource = ""
+ root.started = false
+ }
+ }
+ // qmllint enable
+
+ function updateRootSize() { root.height = (root.contentItem as Item).height }
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml b/examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml
new file mode 100644
index 000000000..f06079a35
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml
@@ -0,0 +1,70 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Rectangle {
+ id: root
+ color: "transparent"
+ opacity: 0.0
+ property alias enabled: mouseArea.enabled
+ property int dialogWidth: 300
+ property int dialogHeight: 200
+ state: enabled ? "on" : "baseState"
+
+ states: [
+ State {
+ name: "on"
+ PropertyChanges {
+ root.opacity: 1.0
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ properties: "opacity"
+ easing.type: Easing.OutQuart
+ duration: 500
+ }
+ }
+ ]
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"
+ opacity: 0.75
+ }
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: root.dialogWidth
+ height: root.dialogHeight
+ radius: 5
+ color: "white"
+
+ Text {
+ id: text
+ anchors.fill: parent
+ anchors.margins: 10
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: "black"
+ wrapMode: Text.WordWrap
+ }
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: root.enabled = false
+ }
+
+ function show(msg) {
+ text.text = "<b>Error</b><br><br>" + msg
+ root.enabled = true
+ }
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/Main.qml b/examples/multimedia/video/qmlvideo/qmlvideo/Main.qml
new file mode 100644
index 000000000..49b94590c
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/Main.qml
@@ -0,0 +1,188 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
+import performancemonitor
+
+Rectangle {
+ id: root
+ anchors.fill: parent
+ color: palette.window
+
+ property bool perfMonitorsLogging: false
+ property bool perfMonitorsVisible: false
+
+ Loader {
+ id: performanceLoader
+
+ Connections {
+ target: columnLayout
+ function onVisibleChanged() {
+ if (performanceLoader.item)
+ performanceLoader.item.enabled = !columnLayout.visible
+ }
+ ignoreUnknownSignals: true
+ }
+
+ Component {
+ id: performanceItem
+ PerformanceItem {}
+ }
+
+ function init() {
+ var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
+ sourceComponent = enabled ? performanceItem : undefined
+ }
+
+ onLoaded: {
+ item.parent = root
+ item.anchors.fill = root
+ item.logging = root.perfMonitorsLogging
+ item.displayed = root.perfMonitorsVisible
+ item.enabled = false
+ item.init()
+ }
+ }
+
+ ColumnLayout {
+ id: columnLayout
+ anchors.fill: parent
+ spacing: 5
+
+ Button {
+ id: openFile1Button
+ text: (VideoSingleton.source1 == '') ? qsTr("Select file 1") : VideoSingleton.source1
+ Component.onCompleted: console.log("source1: " + VideoSingleton.source1)
+ onClicked: {
+ fileDialog.setFirstSource = true
+ fileDialog.open()
+ }
+
+ Layout.fillWidth: true
+ }
+
+ Button {
+ id: openFile2Button
+ text: (VideoSingleton.source2 == '') ? qsTr("Select file 2") : VideoSingleton.source2
+ Component.onCompleted: console.log("source2: " + VideoSingleton.source2)
+ onClicked: {
+ fileDialog.setFirstSource = false
+ fileDialog.open()
+ }
+
+ Layout.fillWidth: true
+ }
+
+ RowLayout {
+ Layout.fillWidth: true
+
+ Label {
+ text: qsTr("Video Modes")
+
+ horizontalAlignment: Qt.AlignHCenter
+ Layout.preferredWidth: 50
+ Layout.fillWidth: true
+ }
+ Label {
+ text: qsTr("Camera Modes")
+
+ horizontalAlignment: Qt.AlignHCenter
+ Layout.preferredWidth: 50
+ Layout.fillWidth: true
+ }
+ }
+
+ SceneSelectionPanel {
+ id: sceneSelectionPanel
+ itemHeight: Math.min(width / 10, height / 10)
+ color: palette.dark
+ radius: 0
+ onSceneSourceChanged: {
+ sceneLoader.source = sceneSource
+ var scene = null
+ var innerVisible = true
+ if (sceneSource == "") {
+ if (performanceLoader.item)
+ performanceLoader.item.videoActive = false
+ } else {
+ scene = sceneLoader.item
+ if (scene) {
+ if (scene.contentType === "video" && VideoSingleton.source1 === "") {
+ errorDialog.show(qsTr("You must first select a video file"))
+ sceneSource = ""
+ } else {
+ scene.parent = root
+ scene.color = root.palette.window
+ scene.source1 = VideoSingleton.source1
+ scene.source2 = VideoSingleton.source2
+ scene.volume = VideoSingleton.volume
+ scene.anchors.fill = root
+ scene.close.connect(closeScene)
+ scene.content.initialize()
+ innerVisible = false
+ }
+ }
+ }
+ videoFramePaintedConnection.target = scene
+ columnLayout.visible = innerVisible
+ }
+
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ }
+ }
+
+ Loader {
+ id: sceneLoader
+ }
+
+ Connections {
+ id: videoFramePaintedConnection
+ // qmllint disable
+ function onVideoFramePainted() {
+ if (performanceLoader.item)
+ performanceLoader.item.videoFramePainted()
+ }
+ // qmllint enable
+ ignoreUnknownSignals: true
+ }
+
+ FileDialog {
+ id: fileDialog
+ property bool setFirstSource
+ onAccepted: function() {
+ if (setFirstSource)
+ VideoSingleton.source1 = selectedFile
+ else
+ VideoSingleton.source2 = selectedFile
+ }
+ }
+
+ ErrorDialog {
+ id: errorDialog
+ anchors.fill: root
+ dialogWidth: Math.min(root.width, root.height) * 0.5
+ dialogHeight: Math.min(root.width, root.height) * 0.3
+ enabled: false
+ }
+
+ // Called from main() once root properties have been set
+ function init() {
+ performanceLoader.init()
+ fileDialog.currentFolder = VideoSingleton.videoPath
+ }
+
+ // qmllint disable
+ function qmlFramePainted() {
+ if (performanceLoader.item)
+ performanceLoader.item.qmlFramePainted()
+ }
+ // qmllint enable
+
+ function closeScene() {
+ sceneSelectionPanel.sceneSource = ""
+ }
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/Scene.qml b/examples/multimedia/video/qmlvideo/qmlvideo/Scene.qml
new file mode 100644
index 000000000..e16478d41
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/Scene.qml
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+Rectangle {
+ id: root
+ color: palette.window
+ property string source1
+ property string source2
+ property int contentWidth: parent.width / 2
+ property real volume: 0.25
+ property int margins: 5
+ property QtObject content
+
+ signal close
+ signal videoFramePainted
+
+ Button {
+ id: closeButton
+ anchors {
+ top: parent.top
+ right: parent.right
+ margins: root.margins
+ }
+ z: 2.0
+ text: qsTr("Back")
+ onClicked: root.close()
+ }
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneBasic.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneBasic.qml
new file mode 100644
index 000000000..8ad6c99b8
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneBasic.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 QtQuick.Controls
+
+Scene {
+ id: root
+ property string contentType
+ property bool autoStart: false
+ property bool started: false
+
+ Content {
+ id: content
+ autoStart: parent.autoStart
+ started: parent.started
+ anchors.fill: parent
+ width: parent.contentWidth
+ contentType: parent.contentType
+ source: parent.source1
+ volume: parent.volume
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ Label {
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ bottom: parent.bottom
+ margins: 20
+ }
+ text: content.started ? qsTr("Tap the screen to stop content")
+ : qsTr("Tap the screen to start content")
+ z: 2.0
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (content.started)
+ content.stop()
+ else
+ content.start()
+ }
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneDrag.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneDrag.qml
new file mode 100644
index 000000000..99a7cb7f1
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneDrag.qml
@@ -0,0 +1,34 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Scene {
+ id: root
+ property int margin: 20
+ property string contentType
+
+ Image {
+ id: background
+ source: "images/leaves.jpg"
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: root.contentWidth
+ contentType: root.contentType
+ source: root.source1
+ volume: root.volume
+ onVideoFramePainted: root.videoFramePainted()
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: background
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneFullScreen.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneFullScreen.qml
new file mode 100644
index 000000000..ec8564311
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneFullScreen.qml
@@ -0,0 +1,67 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+Scene {
+ id: root
+ property string contentType
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: parent.contentWidth
+ contentType: root.contentType
+ source: parent.source1
+ volume: parent.volume
+ state: "left"
+
+ states: [
+ State {
+ name: "fullScreen"
+ PropertyChanges {
+ content.width: content.parent.width
+ content.height: content.parent.height
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ ParallelAnimation {
+ PropertyAnimation {
+ property: "width"
+ easing.type: Easing.Linear
+ duration: 250
+ }
+ PropertyAnimation {
+ property: "height"
+ easing.type: Easing.Linear
+ duration: 250
+ }
+ }
+ }
+ ]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: content.state = (content.state == "fullScreen") ? "baseState" : "fullScreen"
+ }
+
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ Label {
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ bottom: parent.bottom
+ margins: 20
+ }
+ text: qsTr("Tap on the content to toggle full-screen mode")
+ z: 2.0
+ }
+
+ Component.onCompleted: root.content = content
+}
+
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneFullScreenInverted.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneFullScreenInverted.qml
new file mode 100644
index 000000000..cb96ac134
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneFullScreenInverted.qml
@@ -0,0 +1,70 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+Scene {
+ id: root
+ property string contentType
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ contentType: root.contentType
+ source: parent.source1
+ volume: parent.volume
+ state: "left"
+
+ states: [
+ State {
+ name: "nonFullScreen"
+ PropertyChanges { content.width: root.contentWidth }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ ParallelAnimation {
+ PropertyAnimation {
+ property: "width"
+ easing.type: Easing.Linear
+ duration: 250
+ }
+ PropertyAnimation {
+ property: "height"
+ easing.type: Easing.Linear
+ duration: 250
+ }
+ }
+ }
+ ]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: content.state = (content.state === "nonFullScreen") ? "baseState" : "nonFullScreen"
+ }
+
+ onVideoFramePainted: root.videoFramePainted()
+
+ onInitialized: {
+ width = parent.width
+ height = parent.height
+ }
+ }
+
+ Label {
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ bottom: parent.bottom
+ margins: 20
+ }
+ text: qsTr("Tap on the content to toggle full-screen mode")
+ z: 2.0
+ }
+
+ Component.onCompleted: root.content = content
+}
+
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneMove.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneMove.qml
new file mode 100644
index 000000000..d1512831e
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneMove.qml
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Scene {
+ id: root
+ property int margin: 20
+ property string contentType
+
+ Content {
+ id: content
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.contentWidth
+ contentType: root.contentType
+ source: parent.source1
+ volume: parent.volume
+
+ SequentialAnimation on x {
+ id: animation
+ loops: Animation.Infinite
+ property int from: root.margin
+ property int to: 100
+ property int duration: 1500
+ running: false
+ PropertyAnimation {
+ from: animation.from
+ to: animation.to
+ duration: animation.duration
+ easing.type: Easing.InOutCubic
+ }
+ PropertyAnimation {
+ from: animation.to
+ to: animation.from
+ duration: animation.duration
+ easing.type: Easing.InOutCubic
+ }
+ }
+
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ onWidthChanged: {
+ animation.to = root.width - content.width - margin
+ animation.start()
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneMulti.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneMulti.qml
index 01d82ac33..f93dabcdd 100644
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneMulti.qml
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneMulti.qml
@@ -1,54 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
Scene {
id: root
@@ -71,28 +25,30 @@ Scene {
id: root
color: "transparent"
- function content() {
- return root.parent
- }
+ signal start
+ signal stop
- Text {
+ Label {
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
margins: 20
}
- text: content() ? content().started ? "Tap to stop" : "Tap to start" : ""
- color: "#e0e0e0"
+ // qmllint disable
+ text: root.started ? qsTr("Tap to stop") : qsTr("Tap to start")
+ // qmllint enable
}
MouseArea {
anchors.fill: parent
+ // qmllint disable
onClicked: {
- if (content().started)
- content().stop()
+ if (root.started)
+ root.stop()
else
- content().start()
+ root.start()
}
+ // qmllint enable
}
}
}
@@ -110,14 +66,19 @@ Scene {
showBorder: true
showFrameRate: started
source: parent.source1
- width: itemWidth
+ width: root.itemWidth
volume: parent.volume
Loader {
id: video1StartStopLoader
+
+ property bool started: parent.started
+
onLoaded: {
item.parent = video1
item.anchors.fill = video1
+ item.start.connect(video1.start)
+ item.stop.connect(video1.stop)
}
}
@@ -126,26 +87,28 @@ Scene {
Rectangle {
id: cameraHolder
+
+ property bool started: false
+
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: root.itemTopMargin
}
border.width: 1
- border.color: "white"
+ border.color: palette.base
color: "transparent"
- width: itemWidth
+ width: root.itemWidth
height: width
- property bool started: false
Loader {
id: cameraLoader
onLoaded: {
item.parent = cameraHolder
- item.centerIn = cameraHolder
+ item.anchors.centerIn = cameraHolder
item.contentType = "camera"
item.showFrameRate = true
- item.width = itemWidth
+ item.width = root.itemWidth
item.z = 1.0
cameraErrorConnection.target = item
item.initialize()
@@ -154,20 +117,26 @@ Scene {
Loader {
id: cameraStartStopLoader
+
+ property bool started: parent.started
+
sourceComponent: startStopComponent
onLoaded: {
item.parent = cameraHolder
item.anchors.fill = cameraHolder
item.z = 2.0
+ item.start.connect(cameraHolder.start)
+ item.stop.connect(cameraHolder.stop)
}
}
Connections {
id: cameraErrorConnection
- onError: {
+ function onError() {
console.log("[qmlvideo] SceneMulti.camera.onError")
cameraHolder.stop()
}
+ ignoreUnknownSignals: true
}
function start() {
@@ -194,14 +163,19 @@ Scene {
showBorder: true
showFrameRate: started
source: parent.source2
- width: itemWidth
+ width: root.itemWidth
volume: parent.volume
Loader {
id: video2StartStopLoader
+
+ property bool started: parent.started
+
onLoaded: {
item.parent = video2
item.anchors.fill = video2
+ item.start.connect(video2.start)
+ item.stop.connect(video2.stop)
}
}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneOverlay.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneOverlay.qml
new file mode 100644
index 000000000..5863d618c
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneOverlay.qml
@@ -0,0 +1,83 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Scene {
+ id: root
+ property int margin: 20
+ property string contentType
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: parent.contentWidth
+ contentType: root.contentType
+ source: parent.source1
+ volume: parent.volume
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ Rectangle {
+ id: overlay
+ y: 0.5 * parent.height
+ width: content.width
+ height: content.height
+ color: "#e0e0e0"
+ opacity: 0.5
+
+ SequentialAnimation on x {
+ id: xAnimation
+ loops: Animation.Infinite
+ property int from: root.margin
+ property int to: 100
+ property int duration: 1500
+ running: false
+ PropertyAnimation {
+ from: xAnimation.from
+ to: xAnimation.to
+ duration: xAnimation.duration
+ easing.type: Easing.InOutCubic
+ }
+ PropertyAnimation {
+ from: xAnimation.to
+ to: xAnimation.from
+ duration: xAnimation.duration
+ easing.type: Easing.InOutCubic
+ }
+ }
+
+ SequentialAnimation on y {
+ id: yAnimation
+ loops: Animation.Infinite
+ property int from: root.margin
+ property int to: 180
+ property int duration: 1500
+ running: false
+ PropertyAnimation {
+ from: yAnimation.from
+ to: yAnimation.to
+ duration: yAnimation.duration
+ easing.type: Easing.InOutCubic
+ }
+ PropertyAnimation {
+ from: yAnimation.to
+ to: yAnimation.from
+ duration: yAnimation.duration
+ easing.type: Easing.InOutCubic
+ }
+ }
+ }
+
+ onWidthChanged: {
+ xAnimation.to = root.width - content.width - margin
+ xAnimation.start()
+ }
+
+ onHeightChanged: {
+ //yAnimation.to = root.height - content.height - margin
+ yAnimation.start()
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneResize.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneResize.qml
new file mode 100644
index 000000000..4e2f15588
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneResize.qml
@@ -0,0 +1,41 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Scene {
+ id: root
+ property string contentType
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: parent.contentWidth
+ contentType: root.contentType
+ source: parent.source1
+ volume: parent.volume
+
+ SequentialAnimation on scale {
+ id: animation
+ loops: Animation.Infinite
+ property int duration: 1500
+ running: true
+ PropertyAnimation {
+ from: 1.5
+ to: 0.5
+ duration: animation.duration
+ easing.type: Easing.InOutCubic
+ }
+ PropertyAnimation {
+ from: 0.5
+ to: 1.5
+ duration: animation.duration
+ easing.type: Easing.InOutCubic
+ }
+ }
+
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneRotate.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneRotate.qml
new file mode 100644
index 000000000..1362522e6
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneRotate.qml
@@ -0,0 +1,57 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+Scene {
+ id: root
+ property int margin: 20
+ property int delta: 30
+ property string contentType
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: parent.contentWidth
+ contentType: root.contentType
+ source: parent.source1
+ volume: parent.volume
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ Button {
+ id: rotatePositiveButton
+ anchors {
+ right: parent.right
+ bottom: rotateNegativeButton.top
+ margins: parent.margins
+ }
+ text: qsTr("Rotate +%1").arg(root.delta)
+ onClicked: content.rotation = content.rotation + root.delta
+ }
+
+ Button {
+ id: rotateNegativeButton
+ anchors {
+ right: parent.right
+ verticalCenter: parent.verticalCenter
+ margins: parent.margins
+ }
+ text: qsTr("Rotate -%1").arg(root.delta)
+ onClicked: content.rotation = content.rotation - root.delta
+ }
+
+ Button {
+ id: rotateValueButton
+ anchors {
+ left: parent.left
+ verticalCenter: parent.verticalCenter
+ margins: parent.margins
+ }
+ enabled: false
+ text: content.rotation % 360
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneSelectionPanel.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneSelectionPanel.qml
new file mode 100644
index 000000000..91e7c6ad4
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneSelectionPanel.qml
@@ -0,0 +1,88 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+pragma ComponentBehavior: Bound
+
+Rectangle {
+ id: root
+ property int itemHeight: 25
+ property string sceneSource: ""
+
+ ListModel {
+ id: videolist
+ ListElement { name: qsTr("Multi"); source: "SceneMulti.qml" }
+ ListElement { name: qsTr("Video"); source: "VideoBasic.qml" }
+ ListElement { name: qsTr("Drag"); source: "VideoDrag.qml" }
+ ListElement { name: qsTr("Fillmode"); source: "VideoFillMode.qml" }
+ ListElement { name: qsTr("Fullscreen"); source: "VideoFullScreen.qml" }
+ ListElement { name: qsTr("Fullscreen-inverted"); source: "VideoFullScreenInverted.qml" }
+ ListElement { name: qsTr("Metadata"); source: "VideoMetadata.qml" }
+ ListElement { name: qsTr("Move"); source: "VideoMove.qml" }
+ ListElement { name: qsTr("Overlay"); source: "VideoOverlay.qml" }
+ ListElement { name: qsTr("Playback Rate"); source: "VideoPlaybackRate.qml" }
+ ListElement { name: qsTr("Resize"); source: "VideoResize.qml" }
+ ListElement { name: qsTr("Rotate"); source: "VideoRotate.qml" }
+ ListElement { name: qsTr("Spin"); source: "VideoSpin.qml" }
+ ListElement { name: qsTr("Seek"); source: "VideoSeek.qml" }
+ }
+
+ ListModel {
+ id: cameralist
+ ListElement { name: qsTr("Camera"); source: "CameraBasic.qml" }
+ ListElement { name: qsTr("Drag"); source: "CameraDrag.qml" }
+ ListElement { name: qsTr("Fullscreen"); source: "CameraFullScreen.qml" }
+ ListElement { name: qsTr("Fullscreen-inverted"); source: "CameraFullScreenInverted.qml" }
+ ListElement { name: qsTr("Move"); source: "CameraMove.qml" }
+ ListElement { name: qsTr("Overlay"); source: "CameraOverlay.qml" }
+ ListElement { name: qsTr("Resize"); source: "CameraResize.qml" }
+ ListElement { name: qsTr("Rotate"); source: "CameraRotate.qml" }
+ ListElement { name: qsTr("Spin"); source: "CameraSpin.qml" }
+ }
+
+ Component {
+ id: buttonDelegate
+ Button {
+ required property string name
+ required property string source
+
+ width: root.width / 2
+ height: root.itemHeight
+
+ text: name
+ padding: 3
+ onClicked: root.sceneSource = source
+ }
+ }
+
+ Flickable {
+ anchors.fill: parent
+ contentHeight: (root.itemHeight * videolist.count) + 10
+ clip: true
+
+ Row {
+ id: layout
+ anchors {
+ fill: parent
+ topMargin: 5
+ bottomMargin: 5
+ }
+
+ Column {
+ Repeater {
+ model: videolist
+ delegate: buttonDelegate
+ }
+ }
+
+ Column {
+ Repeater {
+ model: cameralist
+ delegate: buttonDelegate
+ }
+ }
+ }
+ }
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneSpin.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneSpin.qml
new file mode 100644
index 000000000..3e280d3b1
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneSpin.qml
@@ -0,0 +1,34 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Scene {
+ id: root
+ property int margin: 20
+ property string contentType
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: parent.contentWidth
+ contentType: root.contentType
+ source: parent.source1
+ volume: parent.volume
+
+ PropertyAnimation on rotation {
+ id: animation
+ loops: Animation.Infinite
+ running: true
+ from: 0
+ to: 360
+ duration: 3000
+ easing.type: Easing.Linear
+ }
+
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SeekControl.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SeekControl.qml
index fbba32903..646e5e8ef 100644
--- a/examples/multimedia/video/qmlvideo/qml/qmlvideo/SeekControl.qml
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/SeekControl.qml
@@ -1,54 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
id: seekControl
@@ -62,7 +15,7 @@ Item {
Rectangle {
id: background
anchors.fill: parent
- color: "white"
+ color: palette.base
opacity: 0.3
radius: parent.height / 15
}
@@ -71,7 +24,7 @@ Item {
id: progressBar
anchors { left: parent.left; top: parent.top; bottom: parent.bottom }
width: seekControl.duration == 0 ? 0 : background.width * seekControl.playPosition / seekControl.duration
- color: "black"
+ color: palette.highlight
opacity: 0.7
}
@@ -80,9 +33,9 @@ Item {
anchors { left: parent.left; top: parent.top; bottom: parent.bottom; leftMargin: 10 }
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
- color: "white"
+ color: palette.windowText
smooth: true
- text: formatTime(playPosition)
+ text: seekControl.formatTime(seekControl.playPosition)
}
Text {
@@ -90,16 +43,16 @@ Item {
anchors { right: parent.right; top: parent.top; bottom: parent.bottom; rightMargin: 10 }
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
- color: "white"
+ color: palette.windowText
smooth: true
- text: formatTime(duration)
+ text: seekControl.formatTime(seekControl.duration)
}
Rectangle {
id: progressHandle
height: parent.height
width: parent.height / 2
- color: "white"
+ color: palette.accent
opacity: 0.5
anchors.verticalCenter: progressBar.verticalCenter
x: seekControl.duration == 0 ? 0 : seekControl.playPosition / seekControl.duration * background.width
@@ -123,7 +76,7 @@ Item {
seekControl.seekPosition = progressHandle.x * seekControl.duration / background.width
seekControl.seeking = false
}
- onReleased: {
+ onReleased: (mouse) => {
seekControl.seekPosition = progressHandle.x * seekControl.duration / background.width
seekControl.seeking = false
mouse.accepted = true
@@ -143,8 +96,8 @@ Item {
function formatTime(timeInMs) {
if (!timeInMs || timeInMs <= 0) return "0:00"
- var seconds = timeInMs / 1000;
- var minutes = Math.floor(seconds / 60)
+ let seconds = timeInMs / 1000;
+ let minutes = Math.floor(seconds / 60)
seconds = Math.floor(seconds % 60)
if (seconds < 10) seconds = "0" + seconds;
return minutes + ":" + seconds
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoBasic.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoBasic.qml
new file mode 100644
index 000000000..15c25c978
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoBasic.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneBasic {
+ contentType: "video"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoDrag.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoDrag.qml
new file mode 100644
index 000000000..4a5c5d49b
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoDrag.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneDrag {
+ contentType: "video"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoDummy.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoDummy.qml
new file mode 100644
index 000000000..a30b9ebf6
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoDummy.qml
@@ -0,0 +1,37 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+// Item which is loaded by VideoItem if Qt Multimedia is not available
+Rectangle {
+ id: root
+ color: "grey"
+ height: width
+ property int duration: 0
+ property int position: 0
+ property string source
+ property real volume: 1.0
+ property real playbackRate: 1.0
+
+ signal fatalError
+ signal sizeChanged
+ signal framePainted
+
+ Label {
+ anchors.fill: parent
+ anchors.margins: 10
+ horizontalAlignment: Text.AlignHCenter
+ text: qsTr("Failed to create Video item\n\nCheck that Qt Multimedia is installed")
+ verticalAlignment: Text.AlignVCenter
+ wrapMode: Text.Wrap
+ }
+
+ onWidthChanged: height = width
+ onHeightChanged: root.sizeChanged()
+
+ function start() { }
+ function stop() { }
+ function seek() { }
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoFillMode.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoFillMode.qml
new file mode 100644
index 000000000..af950c735
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoFillMode.qml
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtMultimedia
+
+Scene {
+ id: root
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: parent.contentWidth
+ contentType: "video"
+ source: parent.source1
+ volume: parent.volume
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ Button {
+ id: button
+ anchors {
+ right: parent.right
+ verticalCenter: parent.verticalCenter
+ margins: parent.margins
+ }
+ text: qsTr("PreserveAspectFit")
+ // qmllint disable
+ onClicked: {
+ if (!content.dummy) {
+ let video = content.contentItem
+ if (video.fillMode === VideoOutput.Stretch) {
+ video.fillMode = VideoOutput.PreserveAspectFit
+ text = qsTr("PreserveAspectFit")
+ } else if (video.fillMode === VideoOutput.PreserveAspectFit) {
+ video.fillMode = VideoOutput.PreserveAspectCrop
+ text = qsTr("PreserveAspectCrop")
+ } else {
+ video.fillMode = VideoOutput.Stretch
+ text = qsTr("Stretch")
+ }
+ }
+ }
+ // qmllint enable
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoFullScreen.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoFullScreen.qml
new file mode 100644
index 000000000..e49faadb6
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoFullScreen.qml
@@ -0,0 +1,7 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneFullScreen {
+ contentType: "video"
+}
+
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoFullScreenInverted.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoFullScreenInverted.qml
new file mode 100644
index 000000000..0bf82941e
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoFullScreenInverted.qml
@@ -0,0 +1,7 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneFullScreenInverted {
+ contentType: "video"
+}
+
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoItem.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoItem.qml
new file mode 100644
index 000000000..2ea796de8
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoItem.qml
@@ -0,0 +1,42 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtMultimedia
+
+VideoOutput {
+ id: root
+ height: width
+
+ property alias duration: mediaPlayer.duration
+ property alias mediaSource: mediaPlayer.source
+ property alias metaData: mediaPlayer.metaData
+ property alias playbackRate: mediaPlayer.playbackRate
+ property alias position: mediaPlayer.position
+ property alias seekable: mediaPlayer.seekable
+ property alias volume: audioOutput.volume
+
+ signal sizeChanged
+ signal fatalError
+
+ onHeightChanged: root.sizeChanged()
+
+ MediaPlayer {
+ id: mediaPlayer
+ videoOutput: root;
+ audioOutput: AudioOutput {
+ id: audioOutput
+ }
+
+ onErrorOccurred: function(error, errorString) {
+ if (MediaPlayer.NoError !== error) {
+ console.log("[qmlvideo] VideoItem.onError error " + error + " errorString " + errorString)
+ root.fatalError()
+ }
+ }
+ }
+
+ function start() { mediaPlayer.play() }
+ function stop() { mediaPlayer.stop() }
+ function seek(position) { mediaPlayer.setPosition(position); }
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoMetadata.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoMetadata.qml
new file mode 100644
index 000000000..f83cbffe9
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoMetadata.qml
@@ -0,0 +1,80 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtMultimedia
+
+pragma ComponentBehavior: Bound
+
+Scene {
+ id: root
+ property string contentType: "video"
+
+ Content {
+ id: videoContent
+ anchors.centerIn: parent
+ width: parent.contentWidth
+ contentType: "video"
+ source: parent.source1
+ volume: parent.volume
+ onInitialized: {
+ if (!dummy)
+ metadata.createObject(root)
+ }
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ Component {
+ id: metadata
+ Column {
+ anchors.fill: parent
+ // qmllint disable
+ property var videoMetaData: videoContent.contentItem?.metaData
+ // qmllint enable
+ Label {
+ text: qsTr("Title: %1").arg(parent.videoMetaData?.value(MediaMetaData.Title) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Resolution: %1").arg(parent.videoMetaData?.value(MediaMetaData.Resolution) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Media type: %1").arg(parent.videoMetaData?.value(MediaMetaData.MediaType) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Video codec: %1").arg(parent.videoMetaData?.value(MediaMetaData.VideoCodec) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Video bit rate: %1").arg(parent.videoMetaData?.value(MediaMetaData.VideoBitRate) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Video frame rate: %1").arg(parent.videoMetaData?.value(MediaMetaData.VideoFrameRate) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Audio codec: %1").arg(parent.videoMetaData?.value(MediaMetaData.AudioCodec) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Audio bit rate: %1").arg(parent.videoMetaData?.value(MediaMetaData.AudioBitRate) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Date: %1").arg(parent.videoMetaData?.value(MediaMetaData.Date) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Description: %1").arg(parent.videoMetaData?.value(MediaMetaData.Description) ?? qsTr("Unknown"))
+ }
+ Label {
+ text: qsTr("Copyright: %1").arg(parent.videoMetaData?.value(MediaMetaData.Copyright) ?? qsTr("Unknown"))
+ }
+ Label {
+ // qmllint disable
+ text: qsTr("Seekable: %1").arg(videoContent.contentItem?.seekable ?? qsTr("Unknown"))
+ // qmllint enable
+ }
+ Label {
+ text: qsTr("Orientation: %1").arg(parent.videoMetaData?.value(MediaMetaData.Orientation) ?? qsTr("Unknown"))
+ }
+ }
+ }
+
+ Component.onCompleted: root.content = videoContent
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoMove.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoMove.qml
new file mode 100644
index 000000000..2b9230f3c
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoMove.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneMove {
+ contentType: "video"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoOverlay.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoOverlay.qml
new file mode 100644
index 000000000..576b33ff9
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoOverlay.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneOverlay {
+ contentType: "video"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoPlaybackRate.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoPlaybackRate.qml
new file mode 100644
index 000000000..55e38ef19
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoPlaybackRate.qml
@@ -0,0 +1,65 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+Scene {
+ id: root
+ property int margin: 20
+ property real delta: 0.1
+ property string contentType: "video"
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: parent.contentWidth
+ contentType: "video"
+ source: parent.source1
+ volume: parent.volume
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ Button {
+ id: increaseButton
+ anchors {
+ right: parent.right
+ bottom: decreaseButton.top
+ margins: parent.margins
+ }
+ text: qsTr("Increase")
+ onClicked: {
+ let video = (content.contentItem as VideoItem)
+ video.playbackRate += root.delta
+ }
+ }
+
+ Button {
+ id: decreaseButton
+ anchors {
+ right: parent.right
+ verticalCenter: parent.verticalCenter
+ margins: parent.margins
+ }
+ text: qsTr("Decrease")
+ onClicked: {
+ let video = (content.contentItem as VideoItem)
+ video.playbackRate -= root.delta
+ }
+ }
+
+ Button {
+ id: valueButton
+ anchors {
+ left: parent.left
+ verticalCenter: parent.verticalCenter
+ margins: parent.margins
+ }
+ enabled: false
+ // qmllint disable
+ text: Math.round(10 * content.contentItem?.playbackRate ?? 1) / 10
+ // qmllint enable
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoResize.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoResize.qml
new file mode 100644
index 000000000..88fe7a2d2
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoResize.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneResize {
+ contentType: "video"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoRotate.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoRotate.qml
new file mode 100644
index 000000000..d429ec413
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoRotate.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneRotate {
+ contentType: "video"
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoSeek.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoSeek.qml
new file mode 100644
index 000000000..5e2584fb6
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoSeek.qml
@@ -0,0 +1,36 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Scene {
+ id: root
+ property string contentType: "video"
+ contentWidth: parent.width
+
+ Content {
+ id: content
+ anchors.centerIn: parent
+ width: parent.contentWidth
+ contentType: "video"
+ source: parent.source1
+ volume: parent.volume
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ SeekControl {
+ anchors {
+ left: parent.left
+ right: parent.right
+ margins: 10
+ bottom: parent.bottom
+ }
+ // qmllint disable
+ duration: content.contentItem?.duration ?? 0
+ playPosition: content.contentItem?.position ?? 0
+ onSeekPositionChanged: content.contentItem?.seek(seekPosition);
+ // qmllint enable
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/VideoSpin.qml b/examples/multimedia/video/qmlvideo/qmlvideo/VideoSpin.qml
new file mode 100644
index 000000000..7c365ddc7
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/VideoSpin.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+SceneSpin {
+ contentType: "video"
+}
diff --git a/examples/multimedia/video/qmlvideo/images/folder.png b/examples/multimedia/video/qmlvideo/qmlvideo/images/folder.png
index 62d97004f..62d97004f 100644
--- a/examples/multimedia/video/qmlvideo/images/folder.png
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/images/folder.png
Binary files differ
diff --git a/examples/multimedia/video/qmlvideo/images/leaves.jpg b/examples/multimedia/video/qmlvideo/qmlvideo/images/leaves.jpg
index 66533b34a..66533b34a 100644
--- a/examples/multimedia/video/qmlvideo/images/leaves.jpg
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/images/leaves.jpg
Binary files differ
diff --git a/examples/multimedia/video/qmlvideo/images/up.png b/examples/multimedia/video/qmlvideo/qmlvideo/images/up.png
index 6823de004..6823de004 100644
--- a/examples/multimedia/video/qmlvideo/images/up.png
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/images/up.png
Binary files differ
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/qmldir b/examples/multimedia/video/qmlvideo/qmlvideo/qmldir
new file mode 100644
index 000000000..1cba13d95
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/qmldir
@@ -0,0 +1,44 @@
+module qmlvideo
+
+CameraBasic 1.0 CameraBasic.qml
+CameraDrag 1.0 CameraDrag.qml
+CameraDummy 1.0 CameraDummy.qml
+CameraFullScreen 1.0 CameraFullScreen.qml
+CameraFullScreenInverted 1.0 CameraFullScreenInverted.qml
+CameraItem 1.0 CameraItem.qml
+CameraMove 1.0 CameraMove.qml
+CameraOverlay 1.0 CameraOverlay.qml
+CameraResize 1.0 CameraResize.qml
+CameraRotate 1.0 CameraRotate.qml
+CameraSpin 1.0 CameraSpin.qml
+CameraContent 1.0 Content.qml
+ErrorDialog 1.0 ErrorDialog.qml
+Scene 1.0 Scene.qml
+SceneBasic 1.0 SceneBasic.qml
+SceneDrag 1.0 SceneDrag.qml
+SceneFullScreen 1.0 SceneFullScreen.qml
+SceneFullScreeninverted 1.0 SceneFullScreenInverted.qml
+SceneMoved 1.0 SceneMove.qml
+SceneMulti 1.0 SceneMulti.qml
+SceneOverlay 1.0 SceneOverlay.qml
+SceneResize 1.0 SceneResize.qml
+SceneRotate 1.0 SceneRotate.qml
+SceneSelectionPanel 1.0 SceneSelectionPanel.qml
+SceneSpin 1.0 SceneSpin.qml
+SeekControl 1.0 SeekControl.qml
+VideoBasic 1.0 VideoBasic.qml
+VideoDrag 1.0 VideoDrag.qml
+VideoDummy 1.0 VideoDummy.qml
+VideoFillMode 1.0 VideoFillMode.qml
+VideoFullScreen 1.0 VideoFullScreen.qml
+VideoFullScreenInverted 1.0 VideoFullScreenInverted.qml
+VideoItem 1.0 VideoItem.qml
+VideoMetadata 1.0 VideoMetadata.qml
+VideoMove 1.0 VideoMove.qml
+VideoOverlay 1.0 VideoOverlay.qml
+VideoPlaybackRate 1.0 VideoPlaybackRate.qml
+VideoResize 1.0 VideoResize.qml
+VideoRotate 1.0 VideoRotate.qml
+VideoSeek 1.0 VideoSeek.qml
+VideoSpin 1.0 VideoSpin.qml
+Main 1.0 Main.qml
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/qmlvideo_global.h b/examples/multimedia/video/qmlvideo/qmlvideo/qmlvideo_global.h
new file mode 100644
index 000000000..8df5b5b64
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/qmlvideo_global.h
@@ -0,0 +1,10 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QtCore/QtGlobal>
+
+#if defined(QMLVIDEO_LIB)
+#define QMLVIDEO_LIB_EXPORT Q_DECL_EXPORT
+#else
+#define QMLVIDEO_LIB_EXPORT Q_DECL_IMPORT
+#endif
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/videosingleton.cpp b/examples/multimedia/video/qmlvideo/qmlvideo/videosingleton.cpp
new file mode 100644
index 000000000..2b02fa505
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/videosingleton.cpp
@@ -0,0 +1,54 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "videosingleton.h"
+
+VideoSingleton::VideoSingleton(QObject * parent) : QObject(parent)
+{ }
+
+QUrl VideoSingleton::source1() const
+{
+ return m_source1;
+}
+void VideoSingleton::setSource1(const QUrl &source1)
+{
+ if (source1 == m_source1)
+ return;
+ m_source1 = source1;
+ emit source1Changed();
+}
+QUrl VideoSingleton::source2() const
+{
+ return m_source2;
+}
+void VideoSingleton::setSource2(const QUrl &source2)
+{
+ if (source2 == m_source2)
+ return;
+ m_source2 = source2;
+ emit source2Changed();
+}
+qreal VideoSingleton::volume() const
+{
+ return m_volume;
+}
+void VideoSingleton::setVolume(qreal volume)
+{
+ if (volume == m_volume)
+ return;
+ m_volume = volume;
+ emit volumeChanged();
+}
+QUrl VideoSingleton::videoPath() const
+{
+ return m_videoPath;
+}
+void VideoSingleton::setVideoPath(const QUrl &videoPath)
+{
+ if (m_videoPath == videoPath)
+ return;
+ m_videoPath = videoPath;
+ emit videoPathChanged();
+}
+
+#include "moc_videosingleton.cpp"
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/videosingleton.h b/examples/multimedia/video/qmlvideo/qmlvideo/videosingleton.h
new file mode 100644
index 000000000..3e0d56247
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/videosingleton.h
@@ -0,0 +1,48 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef QMLVIDEOSINGLETON_H
+#define QMLVIDEOSINGLETON_H
+
+#include "qmlvideo_global.h"
+
+#include <QtQml/qqml.h>
+
+class QMLVIDEO_LIB_EXPORT VideoSingleton : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl source1 READ source1 WRITE setSource1 NOTIFY source1Changed FINAL)
+ Q_PROPERTY(QUrl source2 READ source2 WRITE setSource2 NOTIFY source2Changed FINAL)
+ Q_PROPERTY(QUrl videoPath READ videoPath WRITE setVideoPath NOTIFY videoPathChanged FINAL)
+ Q_PROPERTY(qreal volume READ volume WRITE setVolume NOTIFY volumeChanged FINAL)
+ QML_SINGLETON
+ QML_ELEMENT
+
+public:
+ explicit VideoSingleton(QObject *parent = nullptr);
+
+ QUrl source1() const;
+ void setSource1(const QUrl &source1);
+ QUrl source2() const;
+ void setSource2(const QUrl &source2);
+ QUrl videoPath() const;
+ void setVideoPath(const QUrl &videoPath);
+ qreal volume() const;
+ void setVolume(qreal volume);
+
+Q_SIGNALS:
+ void source1Changed();
+ void source2Changed();
+ void volumeChanged();
+ void videoPathChanged();
+
+private:
+ QUrl m_source1;
+ QUrl m_source2;
+ QUrl m_videoPath;
+ qreal m_volume = 0.5;
+};
+
+QML_DECLARE_TYPE(VideoSingleton);
+
+#endif // QMLVIDEOSINGLETON_H
diff --git a/examples/multimedia/video/qmlvideo/trace.h b/examples/multimedia/video/qmlvideo/trace.h
index 0ad9b5167..bd7f63b68 100644
--- a/examples/multimedia/video/qmlvideo/trace.h
+++ b/examples/multimedia/video/qmlvideo/trace.h
@@ -1,57 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef TRACE_H
#define TRACE_H
-#include <QtCore/QDebug>
+#include <QDebug>
#define ENABLE_TRACE
//#define VERBOSE_TRACE
@@ -61,13 +14,19 @@ namespace Trace {
class NullDebug
{
public:
- template <typename T>
- NullDebug& operator<<(const T&) { return *this; }
+ template<typename T>
+ NullDebug &operator<<(const T &)
+ {
+ return *this;
+ }
};
-inline NullDebug nullDebug() { return NullDebug(); }
+inline NullDebug nullDebug()
+{
+ return NullDebug();
+}
-template <typename T>
+template<typename T>
struct PtrWrapper
{
PtrWrapper(const T *ptr) : m_ptr(ptr) { }
@@ -76,8 +35,8 @@ struct PtrWrapper
} // namespace Trace
-template <typename T>
-inline QDebug& operator<<(QDebug &debug, const Trace::PtrWrapper<T> &wrapper)
+template<typename T>
+inline QDebug &operator<<(QDebug &debug, const Trace::PtrWrapper<T> &wrapper)
{
QDebugStateSaver saver(debug);
debug.nospace() << '[' << static_cast<const void *>(wrapper.m_ptr) << ']';
@@ -86,20 +45,37 @@ inline QDebug& operator<<(QDebug &debug, const Trace::PtrWrapper<T> &wrapper)
template<typename T>
inline const void *qtVoidPtr(const T *ptr)
-{ return static_cast<const void *>(ptr); }
+{
+ return static_cast<const void *>(ptr);
+}
#define qtThisPtr() qtVoidPtr(this)
#ifdef ENABLE_TRACE
- inline QDebug qtTrace() { return qDebug() << "[qmlvideo]"; }
+inline QDebug qtTrace()
+{
+ return qDebug() << "[qmlvideo]";
+}
# ifdef VERBOSE_TRACE
- inline QDebug qtVerboseTrace() { return qtTrace(); }
+inline QDebug qtVerboseTrace()
+{
+ return qtTrace();
+}
# else
- inline Trace::NullDebug qtVerboseTrace() { return Trace::nullDebug(); }
+inline Trace::NullDebug qtVerboseTrace()
+{
+ return Trace::nullDebug();
+}
# endif
#else
- inline Trace::NullDebug qtTrace() { return Trace::nullDebug(); }
- inline Trace::NullDebug qtVerboseTrace() { return Trace::nullDebug(); }
+inline Trace::NullDebug qtTrace()
+{
+ return Trace::nullDebug();
+}
+inline Trace::NullDebug qtVerboseTrace()
+{
+ return Trace::nullDebug();
+}
#endif
#endif // TRACE_H