diff --git a/doc/src/examples/qmlvideo.qdoc b/doc/src/examples/qmlvideo.qdoc
new file mode 100644
index 00000000..b96464b0
--- /dev/null
+++ b/doc/src/examples/qmlvideo.qdoc
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\example video/qmlvideo
+\title QML Video Example
+
+\brief The QML Video Example demonstrates the various manipulations (move;
+resize; rotate; change aspect ratio) which can be applied to QML \l{VideoOutput}
+items.
+
+\section1 Overview
+
+This example demonstrates the various manipulations (move; resize; rotate;
+change aspect ratio) which can be applied to QML \l{VideoOutput} items.
+
+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.png
+
+\section1 Application structure
+
+The \l{video/qmlvideo/qml/qmlvideo/main.qml} file creates a UI which includes
+the following elements:
+
+\list
+ \o Two \l{video/qmlvideo/qml/qmlvideo/Button.qml}{Button} elements, each
+ of which displays a filename, and can be used to launch a
+ \l{video/qmlvideo/qml/qmlvideo/FileBrowser.qml}{FileBrowser}
+ \o An exit \l{video/qmlvideo/qml/qmlvideo/Button.qml}{Button}
+ \o A \l{video/qmlvideo/qml/qmlvideo/SceneSelectionPanel.qml}{SceneSelectionPanel},
+ which is a flickable list displaying the available scenes
+ \o 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.png
+
+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} element
+in the center of the screen) is implemented in the
+\l{video/qmlvideo/qml/qmlvideo/VideoBasic.qml}{VideoBasic.qml} file. As you
+can see from the code, this makes use of a type of inheritance: a
+\l{video/qmlvideo/qml/qmlvideo/VideoBasic.qml}{VideoBasic} element ...
+
+\quotefromfile video/qmlvideo/qml/qmlvideo/VideoBasic.qml
+\skipto import
+\printuntil /^\}/
+
+... is-a
+\l{video/qmlvideo/qml/qmlvideo/SceneBasic.qml}{SceneBasic} ...
+
+\quotefromfile examples/video/qmlvideo/qml/qmlvideo/SceneBasic.qml
+\skipto import
+\printuntil contentType
+\dots
+\skipto Content
+\printuntil content
+\dots
+\skipto }
+\printuntil /^\}/
+
+... which is-a
+\l{video/qmlvideo/qml/qmlvideo/Scene.qml}{Scene}:
+
+\quotefromfile video/qmlvideo/qml/qmlvideo/Scene.qml
+\skipto import
+\printuntil root
+\dots
+\skipto property QtObject content
+\printuntil content
+\dots
+\skipto Button
+\printuntil /^\}/
+
+\l{video/qmlvideo/qml/qmlvideo/SceneBasic.qml}{SceneBasic} describes the
+structure and behaviour of the scene, but is agnostic of the type of content
+which will be displayed - this is abstracted by the
+\l{video/qmlvideo/qml/qmlvideo/Content.qml}{Content} element.
+
+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
+(\l{video/qmlvideo/qml/qmlvideo/VideoBasic.qml}{VideoBasic}) and cameracontent
+(\l{video/qmlvideo/qml/qmlvideo/CameraBasic.qml}{CameraBasic}). This approach
+is used to implement many of the other scenes - for example, "repeatedly slide
+the content from left to right and back again" is implemented by
+\l{video/qmlvideo/qml/qmlvideo/SceneMove.qml}{SceneMove}, on which
+\l{video/qmlvideo/qml/qmlvideo/VideoMove.qml}{VideoMove} and
+\l{video/qmlvideo/qml/qmlvideo/CameraMove.qml}{CameraMove} are based.
+
+Depending on the value of the contentType property in the top-level scene
+element, the embedded
+\l{video/qmlvideo/qml/qmlvideo/Content.qml}{Content} item creates either a
+\l{MediaPlayer} or a \l{Camera} item.
+
+\section1 Calculating and displaying QML painting rate
+
+\include 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 frequencyItem.notify():
+
+\quotefromfile video/qmlvideo/main.cpp
+\skipto QmlApplicationViewer
+\printuntil ;
+\dots
+\skipto QQuickItem
+\printuntil ;
+\dots
+\skipto QObject::connect
+\printuntil SLOT(qmlFramePainted()));
+
+*/
+
diff --git a/doc/src/examples/qmlvideofx.qdoc b/doc/src/examples/qmlvideofx.qdoc
new file mode 100644
index 00000000..efb63050
--- /dev/null
+++ b/doc/src/examples/qmlvideofx.qdoc
@@ -0,0 +1,221 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\example video/qmlvideofx
+\title QML Video Shader Effects Example
+
+\brief The QML Video Shader Effects Example shows how the \l {ShaderEffect}
+element can be used to apply postprocessing effects, expressed in GLSL, to QML
+\l {VideoOutput} items.
+
+\section1 Overview
+
+This example shows how the \l {ShaderEffectItem} element can be used to apply
+postprocessing effects, expressed in GLSL, to QML \l {VideoOutput} items.
+
+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.
+
+Finally, this application demonstrates the use of different top-level QML
+files to handle different physical screen sizes. On small-screen devices,
+menus are by default hidden, and only appear when summoned by a gesture.
+Large-screen devices show a more traditional layout in which menus are
+displayed around the video content pane.
+
+The following screenshots show shader effects being applied. In each case,
+the effect is implemented using a fragment shader.
+
+Here we see an edge detection algorithm being applied to a video clip
+(\l{http://orange.blender.org/}{Elephant's Dream from blender.org}).
+\image qmlvideofx-video-edgedetection.png
+
+This image shows a page curl effect, applied to the same video clip.
+\image qmlvideofx-video-pagecurl.png
+
+Here we see a 'glow' effect (edge detection plus colour quantization) being
+applied to the camera viewfinder.
+\image qmlvideofx-camera-glow.png
+
+This image shows a 'lens magnification' effect applied to the viewfinder.
+\image qmlvideofx-camera-magnify.png
+
+The application includes many more effects than the ones shown here - look
+for Effect*.qml files in the list above to see the full range.
+
+\section1 Application structure
+
+Shader effects can be applied to video or viewfinder content using the
+\l{ShaderEffectItem} element, as shown in the following example, which applies
+a wiggly effect to the content:
+
+\code
+import QtQuick 2.0
+import QtMultimedia 4.0
+
+Rectangle {
+ width: 300
+ height: 300
+ color: "black"
+
+ MediaPlayer {
+ id: mediaPlayer
+ source: "test.mp4"
+ playing: true
+ }
+
+ VideoOutput {
+ id: video
+ anchors.fill: parent
+ source: mediaPlayer
+ }
+
+ ShaderEffect {
+ property variant source: ShaderEffectSource { sourceItem: video; hideSource: true }
+ property real wiggleAmount: 0.005
+ anchors.fill: video
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp float wiggleAmount;
+ void main(void)
+ {
+ highp vec2 wiggledTexCoord = qt_TexCoord0;
+ wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount;
+ gl_FragColor = texture2D(source, wiggledTexCoord.st);
+ }
+ "
+ }
+}
+\endcode
+
+In this application, the usage of the \l{ShaderEffect} and \l{VideoOutput}
+elements is a bit more complicated, for the following reasons:
+
+\list
+ \o Each effect can be applied to either a \l{VideoOutput} or an
+ \l{Image} item, so the type of the source item must be abstracted away
+ from the effect implementation
+ \o For some effects (such as the edge detection and glow examples shown in
+ the screenshots above), the transformation is applied only to pixels to
+ the left of a dividing line - this allows the effect to be easily
+ compared with the untransformed image on the right
+ \o Most effects have one or more parameters which can be modified by the
+ user - these are controlled by sliders in the UI which are connected
+ to uniform values passed into the GLSL code
+\endlist
+
+The abstraction of source item type is achieved by the
+\l{video/qmlvideofx/qml/qmlvideofx/Content.qml}{Content} element, which uses a
+\l{Loader} to create either a \l{MediaPlayer}, \l{Camera} or \l{Image} element:
+
+\quotefromfile video/qmlvideofx/qml/qmlvideofx/Content.qml
+\skipto import
+\printuntil {
+\dots
+\skipto Loader {
+\printuntil }
+\dots
+\skipto function openImage
+\printuntil "ContentImage.qml"
+\skipto contentLoader.item.source
+\printuntil path
+\skipto }
+\printuntil }
+\skipto function openVideo
+\printuntil "ContentVideo.qml"
+\skipto contentLoader.item.source
+\printuntil path
+\skipto }
+\printuntil }
+\skipto function openCamera
+\printuntil "ContentCamera.qml"
+\skipto }
+\printuntil }
+\skipto /^\}/
+\printuntil }
+
+Each effect is implemented as a QML item which is based on the
+\l{video/qmlvideofx/qml/qmlvideofx/Effect.qml}{Effect} element, which in turn
+is based on the \l{ShaderEffect} element:
+
+\quotefromfile video/qmlvideofx/qml/qmlvideofx/Effect.qml
+\skipto import
+\printuntil /^\}/
+
+The interface of the Effect element allows for derived effects to specify the
+number of parameters which they support (and therefore the number of sliders
+which should be displayed), and whether a vertical dividing line should be drawn
+between transformed and untransformed image regions. As an example, here is the
+implementation of the pixelation effect. As you can see, the pixelation effect
+supports one parameter (which controls the pixelation granularity), and states
+that the divider should be displayed.
+
+\quotefromfile video/qmlvideofx/qml/qmlvideofx/EffectPixelate.qml
+\skipto import
+\printuntil /^\}/
+
+The main.qml file shows a
+\l{video/qmlvideofx/qml/qmlvideofx/FileOpen.qml}{FileOpen} element which allows
+the user to select the input source and an
+\l{video/qmlvideofx/qml/qmlvideofx/EffectSelectionPanel.qml}{EffectSelectionPanel}
+item, which lists each of the available shader effects. As described above, a
+\l{video/qmlvideofx/qml/qmlvideofx/Content.qml}{Content} item is used to load the
+appropriate input and effect element. A
+\l{video/qmlvideofx/qml/qmlvideofx/Divider.qml}{Divider} item draws the
+vertical dividing line, which can be dragged left / right by the user. Finally,
+a \l{video/qmlvideofx/qml/qmlvideofx/ParameterPanel.qml}{ParameterPanel} item
+renders the sliders corresponding to each effect parameter.
+
+Here is the source selection menu:
+\image qmlvideofx-source-menu.png
+
+And here is the effect selection menu:
+\image qmlvideofx-effects-menu.png
+
+\section1 Calculating and displaying QML painting rate
+
+\include 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 frequencyItem.notify():
+
+\quotefromfile video/qmlvideofx/main.cpp
+\skipto QmlApplicationViewer
+\printuntil ;
+\dots
+\skipto QQuickItem
+\printuntil ;
+\dots
+\skipto QObject::connect
+\printuntil SLOT(qmlFramePainted()));
+
+*/
+
diff --git a/doc/src/examples/video-qml-paint-rate.qdocinc b/doc/src/examples/video-qml-paint-rate.qdocinc
new file mode 100644
index 00000000..bc993fd6
--- /dev/null
+++ b/doc/src/examples/video-qml-paint-rate.qdocinc
@@ -0,0 +1,43 @@
+The QML painting rate is calculated by the FrequencyMonitor class, which
+turns a stream of events (received via the notify() slot), into an
+instantaneous and an averaged frequency:
+
+\quotefromfile video/snippets/frequencymonitor/frequencymonitor.h
+\skipto class FrequencyMonitor : public QObject
+\printuntil Q_OBJECT
+\skipto Q_PROPERTY(qreal instantaneousFrequency
+\printuntil averageFrequencyChanged)
+\skipto public
+\printuntil :
+\dots
+\skipto static void qmlRegisterType
+\printuntil ;
+\skipto public slots
+\printuntil notify();
+\skipto };
+\printline };
+
+The FrequencyMonitor class is exposed to QML like this
+
+\quotefromfile video/snippets/frequencymonitor/frequencymonitordeclarative.cpp
+\skipto FrequencyMonitor::qmlRegisterType
+\printuntil }
+
+and its data is displayed by defining a QML item called FrequencyItem, like this:
+
+\quotefromfile video/snippets/frequencymonitor/qml/frequencymonitor/FrequencyItem.qml
+\skipto import FrequencyMonitor
+\printuntil id: root
+\dots
+\skipto function notify
+\printuntil id: monitor
+\skipto onAverageFrequencyChanged
+\printuntil {
+\skipto instantaneousFrequencyText
+\printuntil /^\}/
+
+The result looks like this:
+
+\image video-qml-paint-rate.png
+
+
diff --git a/doc/src/images/qmlcamera-menu.png b/doc/src/images/qmlcamera-menu.png
new file mode 100644
index 00000000..b2d77331
Binary files /dev/null and b/doc/src/images/qmlcamera-menu.png differ
diff --git a/doc/src/images/qmlvideo-menu.png b/doc/src/images/qmlvideo-menu.png
new file mode 100644
index 00000000..b2d77331
Binary files /dev/null and b/doc/src/images/qmlvideo-menu.png differ
diff --git a/doc/src/images/qmlvideo-overlay.png b/doc/src/images/qmlvideo-overlay.png
new file mode 100644
index 00000000..f5dc8390
Binary files /dev/null and b/doc/src/images/qmlvideo-overlay.png differ
diff --git a/doc/src/images/qmlvideofx-camera-glow.png b/doc/src/images/qmlvideofx-camera-glow.png
new file mode 100644
index 00000000..aca874b6
Binary files /dev/null and b/doc/src/images/qmlvideofx-camera-glow.png differ
diff --git a/doc/src/images/qmlvideofx-camera-magnify.png b/doc/src/images/qmlvideofx-camera-magnify.png
new file mode 100644
index 00000000..c3156ce9
Binary files /dev/null and b/doc/src/images/qmlvideofx-camera-magnify.png differ
diff --git a/doc/src/images/qmlvideofx-effects-menu.png b/doc/src/images/qmlvideofx-effects-menu.png
new file mode 100644
index 00000000..507fd738
Binary files /dev/null and b/doc/src/images/qmlvideofx-effects-menu.png differ
diff --git a/doc/src/images/qmlvideofx-source-menu.png b/doc/src/images/qmlvideofx-source-menu.png
new file mode 100644
index 00000000..661aaa73
Binary files /dev/null and b/doc/src/images/qmlvideofx-source-menu.png differ
diff --git a/doc/src/images/qmlvideofx-video-edgedetection.png b/doc/src/images/qmlvideofx-video-edgedetection.png
new file mode 100644
index 00000000..cedb314c
Binary files /dev/null and b/doc/src/images/qmlvideofx-video-edgedetection.png differ
diff --git a/doc/src/images/qmlvideofx-video-pagecurl.png b/doc/src/images/qmlvideofx-video-pagecurl.png
new file mode 100644
index 00000000..5f5bdfb5
Binary files /dev/null and b/doc/src/images/qmlvideofx-video-pagecurl.png differ
diff --git a/doc/src/images/video-graphics-memory.png b/doc/src/images/video-graphics-memory.png
new file mode 100644
index 00000000..9479cce4
Binary files /dev/null and b/doc/src/images/video-graphics-memory.png differ
diff --git a/doc/src/images/video-qml-paint-rate.png b/doc/src/images/video-qml-paint-rate.png
new file mode 100644
index 00000000..1519ff64
Binary files /dev/null and b/doc/src/images/video-qml-paint-rate.png differ
diff --git a/doc/src/multimedia.qdoc b/doc/src/multimedia.qdoc
index 8cdf1386..b9eba76e 100644
--- a/doc/src/multimedia.qdoc
+++ b/doc/src/multimedia.qdoc
@@ -334,6 +334,30 @@ write a camera application in C++.
The \l {QML Camera Example} demonstrates still image capture and controls
using the QML plugin. Video recording is not currently available.
+\section2 QML Video Example
+
+The \l {video/qmlvideo}{QML Video Example} demonstrates the various manipulations
+(move; resize; rotate; change aspect ratio) which can be applied to QML
+\l {VideoOutput} items.
+
+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 as a semi-transparent item overlaid
+on the video content.
+
+\section2 QML Video Shader Effects Example
+The \l {video/qmlvideofx}{QML Video Shader Effects Example} shows how the
+\l {ShaderEffect} element can be used to apply postprocessing effects,
+expressed in GLSL, to QML \l {VideoOutput} items.
+
+It re-uses the frame rate display code used by the \l {QML Video Example}.
+
+Finally, this application demonstrates the use of different top-level QML
+files to handle different physical screen sizes. On small-screen devices,
+menus are by default hidden, and only appear when summoned by a gesture.
+Large-screen devices show a more traditional layout in which menus are
+displayed around the video content pane.
+
\section1 Reference documentation
diff --git a/examples/video/qmlvideo/images/close.png b/examples/video/qmlvideo/images/close.png
new file mode 100644
index 00000000..6904df0e
Binary files /dev/null and b/examples/video/qmlvideo/images/close.png differ
diff --git a/examples/video/qmlvideo/images/folder.png b/examples/video/qmlvideo/images/folder.png
new file mode 100644
index 00000000..e53e2ad4
Binary files /dev/null and b/examples/video/qmlvideo/images/folder.png differ
diff --git a/examples/video/qmlvideo/images/leaves.jpg b/examples/video/qmlvideo/images/leaves.jpg
new file mode 100644
index 00000000..66533b34
Binary files /dev/null and b/examples/video/qmlvideo/images/leaves.jpg differ
diff --git a/examples/video/qmlvideo/images/progress_handle.svg b/examples/video/qmlvideo/images/progress_handle.svg
new file mode 100644
index 00000000..7ad9014e
--- /dev/null
+++ b/examples/video/qmlvideo/images/progress_handle.svg
@@ -0,0 +1,35 @@
+
+
+
+
diff --git a/examples/video/qmlvideo/images/progress_handle_pressed.svg b/examples/video/qmlvideo/images/progress_handle_pressed.svg
new file mode 100644
index 00000000..c9c6c486
--- /dev/null
+++ b/examples/video/qmlvideo/images/progress_handle_pressed.svg
@@ -0,0 +1,35 @@
+
+
+
+
diff --git a/examples/video/qmlvideo/images/titlebar.png b/examples/video/qmlvideo/images/titlebar.png
new file mode 100644
index 00000000..51c90082
Binary files /dev/null and b/examples/video/qmlvideo/images/titlebar.png differ
diff --git a/examples/video/qmlvideo/images/titlebar.sci b/examples/video/qmlvideo/images/titlebar.sci
new file mode 100644
index 00000000..0418d94c
--- /dev/null
+++ b/examples/video/qmlvideo/images/titlebar.sci
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 12
+border.bottom: 12
+border.right: 10
+source: titlebar.png
diff --git a/examples/video/qmlvideo/images/up.png b/examples/video/qmlvideo/images/up.png
new file mode 100644
index 00000000..b05f8025
Binary files /dev/null and b/examples/video/qmlvideo/images/up.png differ
diff --git a/examples/video/qmlvideo/main.cpp b/examples/video/qmlvideo/main.cpp
new file mode 100644
index 00000000..de15d8a9
--- /dev/null
+++ b/examples/video/qmlvideo/main.cpp
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include
+#include
+#include
+#include
+#include "qmlapplicationviewer.h"
+#include "trace.h"
+
+#ifdef PERFORMANCEMONITOR_SUPPORT
+#include "performancemonitordeclarative.h"
+#endif
+
+static const QString DefaultFileName1 = "";
+static const QString DefaultFileName2 = "";
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+#ifdef PERFORMANCEMONITOR_SUPPORT
+ PerformanceMonitor::qmlRegisterTypes();
+#endif
+
+ QString source1, source2;
+ qreal volume = 0.5;
+ QStringList args = app.arguments();
+ PerformanceMonitor::State performanceMonitorState;
+ bool sourceIsUrl = false;
+ for (int i=1; isetProperty("source1", url1);
+ rootObject->setProperty("source2", url2);
+ rootObject->setProperty("volume", volume);
+
+#ifdef PERFORMANCEMONITOR_SUPPORT
+ if (performanceMonitorState.valid) {
+ rootObject->setProperty("perfMonitorsLogging", performanceMonitorState.logging);
+ rootObject->setProperty("perfMonitorsVisible", performanceMonitorState.visible);
+ }
+ QObject::connect(&viewer, SIGNAL(afterRendering()),
+ rootObject, SLOT(qmlFramePainted()));
+#endif
+
+ QMetaObject::invokeMethod(rootObject, "init");
+
+ viewer.showExpanded();
+
+ return app.exec();
+}
+
diff --git a/examples/video/qmlvideo/qml/qmlvideo/Button.qml b/examples/video/qmlvideo/qml/qmlvideo/Button.qml
new file mode 100644
index 00000000..7b101dd6
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/Button.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ color: textColor
+ radius: 0.25 * height
+
+ property string text
+ property color bgColor: "white"
+ property color bgColorSelected: "red"
+ property color textColor: "black"
+ property alias enabled: mouseArea.enabled
+
+ signal clicked
+
+ Rectangle {
+ anchors { fill: parent; margins: 1 }
+ color: mouseArea.pressed ? bgColorSelected : bgColor
+ radius: 0.25 * height
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ text: root.text
+ font.pixelSize: 0.5 * parent.height
+ color: mouseArea.pressed ? bgColor : textColor
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ root.clicked()
+ }
+ }
+ }
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraBasic.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraBasic.qml
new file mode 100644
index 00000000..3c68acf7
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraBasic.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneBasic {
+ contentType: "camera"
+ started: true
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraDrag.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraDrag.qml
new file mode 100644
index 00000000..64125e43
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraDrag.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneDrag {
+ contentType: "camera"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraDummy.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraDummy.qml
new file mode 100644
index 00000000..06700c15
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraDummy.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+// Item which is loaded by CameraItem if QtMultimediaKit 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 QtMultimediaKit is installed"
+ verticalAlignment: Text.AlignVCenter
+ wrapMode: Text.Wrap
+ }
+
+ onWidthChanged: height = width
+ onHeightChanged: root.sizeChanged()
+
+ function start() { }
+ function stop() { }
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraFullScreen.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraFullScreen.qml
new file mode 100644
index 00000000..c4eabaf5
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraFullScreen.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneFullScreen {
+ contentType: "camera"
+}
+
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraFullScreenInverted.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraFullScreenInverted.qml
new file mode 100644
index 00000000..39f02b66
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraFullScreenInverted.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneFullScreenInverted {
+ contentType: "camera"
+}
+
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraItem.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraItem.qml
new file mode 100644
index 00000000..cb30b941
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraItem.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtMultimedia 4.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/video/qmlvideo/qml/qmlvideo/CameraMove.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraMove.qml
new file mode 100644
index 00000000..7b520ce7
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraMove.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneMove {
+ contentType: "camera"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraOverlay.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraOverlay.qml
new file mode 100644
index 00000000..610f5c03
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraOverlay.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneOverlay {
+ contentType: "camera"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraResize.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraResize.qml
new file mode 100644
index 00000000..46d4444d
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraResize.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneResize {
+ contentType: "camera"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraRotate.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraRotate.qml
new file mode 100644
index 00000000..cebee7b4
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraRotate.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneRotate {
+ contentType: "camera"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/CameraSpin.qml b/examples/video/qmlvideo/qml/qmlvideo/CameraSpin.qml
new file mode 100644
index 00000000..ea8fca2f
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/CameraSpin.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneSpin {
+ contentType: "camera"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/Content.qml b/examples/video/qmlvideo/qml/qmlvideo/Content.qml
new file mode 100644
index 00000000..b05b5464
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/Content.qml
@@ -0,0 +1,164 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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() {
+ console.log("[qmlvideo] Content.initialize: contentType " + contentType)
+ if ("video" == contentType) {
+ console.log("[qmlvideo] Content.initialize: loading VideoItem.qml")
+ contentLoader.source = "VideoItem.qml"
+ if (Loader.Error == contentLoader.status) {
+ console.log("[qmlvideo] Content.initialize: loading VideoDummy.qml")
+ contentLoader.source = "VideoDummy.qml"
+ dummy = true
+ }
+ contentLoader.item.volume = volume
+ } else if ("camera" == contentType) {
+ console.log("[qmlvideo] Content.initialize: loading CameraItem.qml")
+ contentLoader.source = "CameraItem.qml"
+ if (Loader.Error == contentLoader.status) {
+ console.log("[qmlvideo] Content.initialize: loading CameraDummy.qml")
+ 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()
+ }
+ console.log("[qmlvideo] Content.initialize: complete")
+ root.initialized()
+ }
+
+ function start() {
+ console.log("[qmlvideo] Content.start")
+ if (contentLoader.item) {
+ if (root.contentType == "video")
+ contentLoader.item.mediaSource = root.source
+ contentLoader.item.start()
+ root.started = true
+ }
+ }
+
+ function stop() {
+ console.log("[qmlvideo] Content.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/video/qmlvideo/qml/qmlvideo/DisableScreenSaver.qml b/examples/video/qmlvideo/qml/qmlvideo/DisableScreenSaver.qml
new file mode 100644
index 00000000..19b91e81
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/DisableScreenSaver.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtSystemInfo 5.0
+
+Item {
+ ScreenSaver {
+ screenSaverInhibited: true
+ }
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml b/examples/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml
new file mode 100644
index 00000000..db656493
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ color: "transparent"
+ opacity: 0.0
+ property alias enabled: mouseArea.enabled
+ 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: 300
+ height: 200
+ radius: 10
+ 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 = "Error
" + msg
+ root.enabled = true
+ }
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/FileBrowser.qml b/examples/video/qmlvideo/qml/qmlvideo/FileBrowser.qml
new file mode 100644
index 00000000..84157ea3
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/FileBrowser.qml
@@ -0,0 +1,354 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.folderlistmodel 1.0
+
+Rectangle {
+ id: root
+ color: "white"
+ property bool showFocusHighlight: false
+ property variant folders: folders1
+ property variant view: view1
+ property alias folder: folders1.folder
+ property color textColor: "black"
+
+ signal openFile(string path)
+
+ FolderListModel {
+ id: folders1
+ folder: folder
+ }
+
+ FolderListModel {
+ id: folders2
+ folder: folder
+ }
+
+ SystemPalette {
+ id: palette
+ }
+
+ Component {
+ id: folderDelegate
+
+ Rectangle {
+ id: wrapper
+ function launch() {
+ if (folders.isFolder(index))
+ down(filePath);
+ else
+ root.openFile(filePath);
+ }
+ width: root.width
+ height: 52
+ color: "transparent"
+
+ Rectangle {
+ id: highlight; visible: false
+ anchors.fill: parent
+ color: palette.highlight
+ gradient: Gradient {
+ GradientStop { id: t1; position: 0.0; color: palette.highlight }
+ GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
+ }
+ }
+
+ Item {
+ width: 48; height: 48
+ Image {
+ source: "qrc:/images/folder.png"
+ anchors.centerIn: parent
+ visible: folders.isFolder(index)
+ }
+ }
+
+ Text {
+ id: nameText
+ anchors.fill: parent; verticalAlignment: Text.AlignVCenter
+ text: fileName
+ anchors.leftMargin: 54
+ font.pixelSize: 32
+ 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 }
+ }
+ ]
+ }
+ }
+
+ Rectangle {
+ id: cancelButton
+ width: 100
+ height: titleBar.height - 7
+ color: "black"
+ anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
+
+ Text {
+ anchors { fill: parent; margins: 4 }
+ text: "Cancel"
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: 20
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: root.openFile("")
+ }
+ }
+
+ ListView {
+ id: view1
+ anchors.top: titleBar.bottom
+ anchors.bottom: cancelButton.top
+ x: 0
+ width: parent.width
+ model: folders1
+ delegate: folderDelegate
+ highlight: Rectangle {
+ color: palette.highlight
+ visible: root.showFocusHighlight && view1.count != 0
+ gradient: Gradient {
+ GradientStop { id: t1; position: 0.0; color: palette.highlight }
+ GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
+ }
+ width: view1.currentItem == null ? 0 : view1.currentItem.width
+ }
+ highlightMoveSpeed: 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: palette.highlight
+ visible: root.showFocusHighlight && view2.count != 0
+ gradient: Gradient {
+ GradientStop { id: t1; position: 0.0; color: palette.highlight }
+ GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
+ }
+ width: view1.currentItem == null ? 0 : view1.currentItem.width
+ }
+ highlightMoveSpeed: 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)
+ }
+
+ 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();
+ }
+ }
+
+ BorderImage {
+ source: "qrc:/images/titlebar.sci";
+ width: parent.width;
+ height: 52
+ y: -7
+ id: titleBar
+
+ Rectangle {
+ id: upButton
+ width: 48
+ height: titleBar.height - 7
+ color: "transparent"
+ Image { anchors.centerIn: parent; source: "qrc:/images/up.png" }
+ MouseArea { id: upRegion; anchors.centerIn: parent
+ width: 56
+ height: 56
+ onClicked: if (folders.parentFolder != "") up()
+ }
+ states: [
+ State {
+ name: "pressed"
+ when: upRegion.pressed
+ PropertyChanges { target: upButton; color: palette.highlight }
+ }
+ ]
+ }
+
+ Rectangle {
+ color: "gray"
+ x: 48
+ width: 1
+ height: 44
+ }
+
+ Text {
+ anchors.left: upButton.right; anchors.right: parent.right; height: parent.height
+ anchors.leftMargin: 4; anchors.rightMargin: 4
+ text: folders.folder
+ color: "white"
+ elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter
+ font.pixelSize: 32
+ }
+ }
+
+ 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 (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/video/qmlvideo/qml/qmlvideo/Scene.qml b/examples/video/qmlvideo/qml/qmlvideo/Scene.qml
new file mode 100644
index 00000000..eef4c199
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/Scene.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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: 250
+ property real volume: 0.25
+ property int margins: 10
+ property QtObject content
+
+ signal close
+ signal videoFramePainted
+
+ Button {
+ id: closeButton
+ anchors {
+ top: parent.top
+ right: parent.right
+ margins: root.margins
+ }
+ width: 50
+ height: 30
+ z: 2.0
+ text: "Back"
+ onClicked: root.close()
+ }
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/SceneBasic.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneBasic.qml
new file mode 100644
index 00000000..66f71021
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneBasic.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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: "yellow"
+ font.pixelSize: 20
+ z: 2.0
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ console.log("[qmlvideo] SceneBasic.onClicked, started = " + content.started)
+ if (content.started)
+ content.stop()
+ else
+ content.start()
+ }
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/SceneDrag.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneDrag.qml
new file mode 100644
index 00000000..c112e1db
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneDrag.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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/video/qmlvideo/qml/qmlvideo/SceneFullScreen.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneFullScreen.qml
new file mode 100644
index 00000000..8e19b07a
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneFullScreen.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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: "yellow"
+ font.pixelSize: 20
+ z: 2.0
+ }
+
+ Component.onCompleted: root.content = content
+}
+
diff --git a/examples/video/qmlvideo/qml/qmlvideo/SceneFullScreenInverted.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneFullScreenInverted.qml
new file mode 100644
index 00000000..7556da8b
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneFullScreenInverted.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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: "yellow"
+ font.pixelSize: 20
+ z: 2.0
+ }
+
+ Component.onCompleted: root.content = content
+}
+
diff --git a/examples/video/qmlvideo/qml/qmlvideo/SceneMove.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneMove.qml
new file mode 100644
index 00000000..2ab06761
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneMove.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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/video/qmlvideo/qml/qmlvideo/SceneMulti.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneMulti.qml
new file mode 100644
index 00000000..7c90574b
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneMulti.qml
@@ -0,0 +1,204 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Scene {
+ id: root
+
+ property real itemWidth: (width / 3) - 40
+ property real itemTopMargin: 50
+
+ QtObject {
+ id: contentProxy
+ function initialize() {
+ video1.initialize()
+ video2.initialize()
+ }
+ }
+
+ Component {
+ id: startStopComponent
+
+ Rectangle {
+ id: root
+ color: "transparent"
+
+ function content() {
+ return root.parent
+ }
+
+ Text {
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ bottom: parent.bottom
+ margins: 20
+ }
+ text: content() ? content().started ? "Tap to stop" : "Tap to start" : ""
+ color: "yellow"
+ font.pixelSize: 20
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (content().started)
+ content().stop()
+ else
+ content().start()
+ }
+ }
+ }
+ }
+
+ Content {
+ id: video1
+ anchors {
+ left: parent.left
+ leftMargin: 10
+ top: parent.top
+ topMargin: root.itemTopMargin
+ }
+ autoStart: false
+ contentType: "video"
+ showBorder: true
+ showFrameRate: started
+ source: parent.source1
+ width: itemWidth
+ volume: parent.volume
+
+ Loader {
+ id: video1StartStopLoader
+ onLoaded: {
+ item.parent = video1
+ item.anchors.fill = video1
+ }
+ }
+
+ onInitialized: video1StartStopLoader.sourceComponent = startStopComponent
+ }
+
+ Rectangle {
+ id: cameraHolder
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ top: parent.top
+ topMargin: root.itemTopMargin
+ }
+ border.width: 1
+ border.color: "white"
+ color: "transparent"
+ width: itemWidth
+ height: width
+ property bool started: false
+
+ Loader {
+ id: cameraLoader
+ onLoaded: {
+ item.parent = cameraHolder
+ item.centerIn = cameraHolder
+ item.contentType = "camera"
+ item.showFrameRate = true
+ item.width = itemWidth
+ item.z = 1.0
+ cameraErrorConnection.target = item
+ item.initialize()
+ }
+ }
+
+ Loader {
+ id: cameraStartStopLoader
+ sourceComponent: startStopComponent
+ onLoaded: {
+ item.parent = cameraHolder
+ item.anchors.fill = cameraHolder
+ item.z = 2.0
+ }
+ }
+
+ Connections {
+ id: cameraErrorConnection
+ onError: {
+ console.log("[qmlvideo] SceneMulti.camera.onError")
+ cameraHolder.stop()
+ }
+ }
+
+ function start() {
+ cameraLoader.source = "Content.qml"
+ cameraHolder.started = true
+ }
+
+ function stop() {
+ cameraLoader.source = ""
+ cameraHolder.started = false
+ }
+ }
+
+ Content {
+ id: video2
+ anchors {
+ right: parent.right
+ rightMargin: 10
+ top: parent.top
+ topMargin: root.itemTopMargin
+ }
+ autoStart: false
+ contentType: "video"
+ showBorder: true
+ showFrameRate: started
+ source: parent.source2
+ width: itemWidth
+ volume: parent.volume
+
+ Loader {
+ id: video2StartStopLoader
+ onLoaded: {
+ item.parent = video2
+ item.anchors.fill = video2
+ }
+ }
+
+ onInitialized: video2StartStopLoader.sourceComponent = startStopComponent
+ }
+
+ Component.onCompleted: root.content = contentProxy
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml
new file mode 100644
index 00000000..7c44ea21
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml
@@ -0,0 +1,121 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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: "yellow"
+ 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/video/qmlvideo/qml/qmlvideo/SceneResize.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneResize.qml
new file mode 100644
index 00000000..8c4e7f73
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneResize.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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/video/qmlvideo/qml/qmlvideo/SceneRotate.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneRotate.qml
new file mode 100644
index 00000000..11c1f5e9
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneRotate.qml
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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: 90
+ 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: 90
+ 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: 30
+ height: root.buttonHeight
+ enabled: false
+ text: content.rotation % 360
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/SceneSelectionPanel.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneSelectionPanel.qml
new file mode 100644
index 00000000..537ed070
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneSelectionPanel.qml
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ property int itemHeight: 25
+ property string sceneSource: ""
+
+ ListModel {
+ id: list
+ ListElement { name: "multi"; source: "SceneMulti.qml" }
+ ListElement { name: "video"; source: "VideoBasic.qml" }
+ ListElement { name: "video-drag"; source: "VideoDrag.qml" }
+ ListElement { name: "video-fillmode"; source: "VideoFillMode.qml" }
+ ListElement { name: "video-fullscreen"; source: "VideoFullScreen.qml" }
+ ListElement { name: "video-fullscreen-inverted"; source: "VideoFullScreenInverted.qml" }
+ ListElement { name: "video-metadata"; source: "VideoMetadata.qml" }
+ ListElement { name: "video-move"; source: "VideoMove.qml" }
+ ListElement { name: "video-overlay"; source: "VideoOverlay.qml" }
+ ListElement { name: "video-playbackrate"; source: "VideoPlaybackRate.qml" }
+ ListElement { name: "video-resize"; source: "VideoResize.qml" }
+ ListElement { name: "video-rotate"; source: "VideoRotate.qml" }
+ ListElement { name: "video-spin"; source: "VideoSpin.qml" }
+ ListElement { name: "video-seek"; source: "VideoSeek.qml" }
+ ListElement { name: "camera"; source: "CameraBasic.qml" }
+ ListElement { name: "camera-drag"; source: "CameraDrag.qml" }
+ ListElement { name: "camera-fullscreen"; source: "CameraFullScreen.qml" }
+ ListElement { name: "camera-fullscreen-inverted"; source: "CameraFullScreenInverted.qml" }
+ ListElement { name: "camera-move"; source: "CameraMove.qml" }
+ ListElement { name: "camera-overlay"; source: "CameraOverlay.qml" }
+ ListElement { name: "camera-resize"; source: "CameraResize.qml" }
+ ListElement { name: "camera-rotate"; source: "CameraRotate.qml" }
+ ListElement { name: "camera-spin"; source: "CameraSpin.qml" }
+ }
+
+ Component {
+ id: delegate
+ Item {
+ id: delegateItem
+ width: root.width
+ height: itemHeight
+
+ Button {
+ id: selectorItem
+ anchors.centerIn: parent
+ width: 0.9 * parent.width
+ height: 0.8 * itemHeight
+ text: name
+ onClicked: root.sceneSource = source
+ }
+ }
+ }
+
+ Flickable {
+ anchors.fill: parent
+ contentHeight: (itemHeight * list.count) + layout.anchors.topMargin + layout.spacing
+ clip: true
+
+ Column {
+ id: layout
+
+ anchors {
+ fill: parent
+ topMargin: 10
+ }
+
+ Repeater {
+ model: list
+ delegate: delegate
+ }
+ }
+ }
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/SceneSpin.qml b/examples/video/qmlvideo/qml/qmlvideo/SceneSpin.qml
new file mode 100644
index 00000000..cc20b48c
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SceneSpin.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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/video/qmlvideo/qml/qmlvideo/SeekControl.qml b/examples/video/qmlvideo/qml/qmlvideo/SeekControl.qml
new file mode 100644
index 00000000..6acedb12
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/SeekControl.qml
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: seekControl
+ height: 46
+ property int duration: 0
+ property int playPosition: 0
+ property int seekPosition: 0
+ property bool enabled: true
+ property bool seeking: false
+
+ Rectangle {
+ id: background
+ anchors.fill: parent
+ color: "black"
+ opacity: 0.3
+ }
+
+ Rectangle {
+ 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"
+ opacity: 0.7
+ }
+
+ Text {
+ width: 90
+ anchors { left: parent.left; top: parent.top; bottom: parent.bottom; leftMargin: 10 }
+ font { family: "Nokia Sans S60"; pixelSize: 24 }
+ horizontalAlignment: Text.AlignLeft
+ verticalAlignment: Text.AlignVCenter
+ color: "white"
+ smooth: true
+ text: formatTime(playPosition)
+ }
+
+ Text {
+ width: 90
+ anchors { right: parent.right; top: parent.top; bottom: parent.bottom; rightMargin: 10 }
+ font { family: "Nokia Sans S60"; pixelSize: 24 }
+ horizontalAlignment: Text.AlignRight
+ verticalAlignment: Text.AlignVCenter
+ color: "white"
+ smooth: true
+ text: formatTime(duration)
+ }
+
+ Image {
+ id: progressHandle
+ height: 46
+ width: 10
+ source: mouseArea.pressed ? "qrc:/images/progress_handle_pressed.svg" : "qrc:/images/progress_handle.svg"
+ anchors.verticalCenter: progressBar.verticalCenter
+ x: seekControl.duration == 0 ? 0 : seekControl.playPosition / seekControl.duration * 630
+
+ MouseArea {
+ id: mouseArea
+ anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom }
+ height: 46+16
+ width: height
+ enabled: seekControl.enabled
+ drag {
+ target: progressHandle
+ axis: Drag.XAxis
+ minimumX: 0
+ maximumX: 631
+ }
+ onPressed: {
+ seekControl.seeking = true;
+ }
+ onCanceled: {
+ seekControl.seekPosition = progressHandle.x * seekControl.duration / 630
+ seekControl.seeking = false
+ }
+ onReleased: {
+ seekControl.seekPosition = progressHandle.x * seekControl.duration / 630
+ seekControl.seeking = false
+ mouse.accepted = true
+ }
+ }
+ }
+
+ Timer { // Update position also while user is dragging the progress handle
+ id: seekTimer
+ repeat: true
+ interval: 300
+ running: seekControl.seeking
+ onTriggered: {
+ seekControl.seekPosition = progressHandle.x*seekControl.duration/630
+ }
+ }
+
+ function formatTime(timeInMs) {
+ if (!timeInMs || timeInMs <= 0) return "0:00"
+ var seconds = timeInMs / 1000;
+ var minutes = Math.floor(seconds / 60)
+ seconds = Math.floor(seconds % 60)
+ if (seconds < 10) seconds = "0" + seconds;
+ return minutes + ":" + seconds
+ }
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoBasic.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoBasic.qml
new file mode 100644
index 00000000..1d2e08bb
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoBasic.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneBasic {
+ contentType: "video"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoDrag.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoDrag.qml
new file mode 100644
index 00000000..41c00ab6
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoDrag.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneDrag {
+ contentType: "video"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoDummy.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoDummy.qml
new file mode 100644
index 00000000..52b42b2a
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoDummy.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+// Item which is loaded by VideoItem if QtMultimediaKit 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 QtMultimediaKit is installed"
+ verticalAlignment: Text.AlignVCenter
+ wrapMode: Text.Wrap
+ }
+
+ onWidthChanged: height = width
+ onHeightChanged: root.sizeChanged()
+
+ function start() { }
+ function stop() { }
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoFillMode.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoFillMode.qml
new file mode 100644
index 00000000..84cf16c0
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoFillMode.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtMultimedia 4.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: 150
+ 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/video/qmlvideo/qml/qmlvideo/VideoFullScreen.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoFullScreen.qml
new file mode 100644
index 00000000..c5cf454e
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoFullScreen.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneFullScreen {
+ contentType: "video"
+}
+
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoFullScreenInverted.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoFullScreenInverted.qml
new file mode 100644
index 00000000..0dd5a84c
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoFullScreenInverted.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneFullScreenInverted {
+ contentType: "video"
+}
+
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoItem.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoItem.qml
new file mode 100644
index 00000000..6a5686c0
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoItem.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtMultimedia 4.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
+
+ onError: {
+ if (MediaPlayer.NoError != error) {
+ console.log("[qmlvideo] VideoItem.onError error " + error + " errorString " + errorString)
+ root.fatalError()
+ }
+ }
+ }
+
+ function start() { mediaPlayer.play() }
+ function stop() { mediaPlayer.stop() }
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoMetadata.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoMetadata.qml
new file mode 100644
index 00000000..f46ca061
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoMetadata.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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: "yellow"
+ text: "Title:" + content.contentItem().metaData.title
+ }
+ Text {
+ color: "yellow"
+ text: "Size:" + content.contentItem().metaData.size
+ }
+ Text {
+ color: "yellow"
+ text: "Resolution:" + content.contentItem().metaData.resolution
+ }
+ Text {
+ color: "yellow"
+ text: "Media type:" + content.contentItem().metaData.mediaType
+ }
+ Text {
+ color: "yellow"
+ text: "Video codec:" + content.contentItem().metaData.videoCodec
+ }
+ Text {
+ color: "yellow"
+ text: "Video bit rate:" + content.contentItem().metaData.videoBitRate
+ }
+ Text {
+ color: "yellow"
+ text: "Video frame rate:" +content.contentItem().metaData.videoFrameRate
+ }
+ Text {
+ color: "yellow"
+ text: "Audio codec:" + content.contentItem().metaData.audioCodec
+ }
+ Text {
+ color: "yellow"
+ text: "Audio bit rate:" + content.contentItem().metaData.audioBitRate
+ }
+ Text {
+ color: "yellow"
+ text: "Date:" + content.contentItem().metaData.date
+ }
+ Text {
+ color: "yellow"
+ text: "Description:" + content.contentItem().metaData.description
+ }
+ Text {
+ color: "yellow"
+ text: "Copyright:" + content.contentItem().metaData.copyright
+ }
+ Text {
+ color: "yellow"
+ text: "Seekable:" + content.contentItem().metaData.seekable
+ }
+ }
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoMove.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoMove.qml
new file mode 100644
index 00000000..9f4d0408
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoMove.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneMove {
+ contentType: "video"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoOverlay.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoOverlay.qml
new file mode 100644
index 00000000..bdfd541d
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoOverlay.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneOverlay {
+ contentType: "video"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoPlaybackRate.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoPlaybackRate.qml
new file mode 100644
index 00000000..ee8f42a2
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoPlaybackRate.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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: 90
+ height: root.buttonHeight
+ text: "Increase"
+ onClicked: {
+ var video = content.contentItem()
+ video.playbackRate = video.playbackRate + delta
+ }
+ }
+
+ Button {
+ id: decreaseButton
+ anchors {
+ right: parent.right
+ verticalCenter: parent.verticalCenter
+ margins: parent.margins
+ }
+ width: 90
+ height: root.buttonHeight
+ text: "Decrease"
+ onClicked: {
+ var video = content.contentItem()
+ video.playbackRate = video.playbackRate - delta
+ }
+ }
+
+ Button {
+ id: valueButton
+ anchors {
+ left: parent.left
+ verticalCenter: parent.verticalCenter
+ margins: parent.margins
+ }
+ width: 50
+ height: root.buttonHeight
+ enabled: false
+ text: Math.round(10 * content.contentItem().playbackRate) / 10
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoResize.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoResize.qml
new file mode 100644
index 00000000..f572fea0
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoResize.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneResize {
+ contentType: "video"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoRotate.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoRotate.qml
new file mode 100644
index 00000000..8ccfe6f5
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoRotate.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneRotate {
+ contentType: "video"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoSeek.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoSeek.qml
new file mode 100644
index 00000000..1d66fd6a
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoSeek.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $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
+ onVideoFramePainted: root.videoFramePainted()
+ }
+
+ SeekControl {
+ anchors {
+ left: parent.left
+ right: parent.right
+ leftMargin: 100
+ rightMargin: 140
+ bottom: parent.bottom
+ }
+ duration: content.contentItem() ? content.contentItem().duration : 0
+ playPosition: content.contentItem() ? content.contentItem().position : 0
+ onSeekPositionChanged: { content.contentItem().position = seekPosition }
+ }
+
+ Component.onCompleted: root.content = content
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoSpin.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoSpin.qml
new file mode 100644
index 00000000..7ec5fa79
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/VideoSpin.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+SceneSpin {
+ contentType: "video"
+}
diff --git a/examples/video/qmlvideo/qml/qmlvideo/main.qml b/examples/video/qmlvideo/qml/qmlvideo/main.qml
new file mode 100644
index 00000000..7bade597
--- /dev/null
+++ b/examples/video/qmlvideo/qml/qmlvideo/main.qml
@@ -0,0 +1,234 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ width: 640
+ height: 360
+ color: "black"
+
+ property string source1
+ property string source2
+ property color bgColor: "#002244"
+ property real volume: 0.25
+ property bool perfMonitorsLogging: false
+ property bool perfMonitorsVisible: false
+
+ QtObject {
+ id: d
+ property int fileIndex
+ property int itemHeight: 40
+ property int buttonHeight: 0.8 * itemHeight
+ property int margins: 10
+ }
+
+ // Create ScreenSaver element via Loader, so this app will still run if the
+ // SystemInfo module is not available
+ Loader {
+ source: "DisableScreenSaver.qml"
+ }
+
+ Loader {
+ id: performanceLoader
+ function init() {
+ console.log("[qmlvideo] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
+ 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.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
+ }
+ height: d.buttonHeight
+ text: (root.source1 == "") ? "Select file 1" : root.source1
+ onClicked: showFileBrowser(1)
+ }
+
+ Button {
+ id: openFile2Button
+ anchors {
+ top: openFile1Button.bottom
+ left: parent.left
+ right: exitButton.left
+ margins: d.margins
+ }
+ height: d.buttonHeight
+ text: (root.source2 == "") ? "Select file 2" : root.source2
+ onClicked: showFileBrowser(2)
+ }
+
+ Button {
+ id: exitButton
+ anchors {
+ top: parent.top
+ right: parent.right
+ margins: d.margins
+ }
+ width: 50
+ height: d.buttonHeight
+ text: "Exit"
+ onClicked: Qt.quit()
+ }
+
+ SceneSelectionPanel {
+ id: sceneSelectionPanel
+ itemHeight: d.itemHeight
+ color: "#004444"
+ anchors {
+ top: openFile2Button.bottom
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ margins: d.margins
+ }
+ radius: 10
+ onSceneSourceChanged: {
+ console.log("[qmlvideo] main.onSceneSourceChanged source " + sceneSource)
+ 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
+ }
+
+ Loader {
+ id: fileBrowserLoader
+ }
+
+ ErrorDialog {
+ id: errorDialog
+ anchors.fill: parent
+ enabled: false
+ }
+
+ // Called from main() once root properties have been set
+ function init() {
+ performanceLoader.init()
+ }
+
+ function qmlFramePainted() {
+ if (performanceLoader.item)
+ performanceLoader.item.qmlFramePainted()
+ }
+
+ function showFileBrowser(index) {
+ console.log("[qmlvideo] main.showFileBrowser")
+ d.fileIndex = index
+ fileBrowserLoader.source = "FileBrowser.qml"
+ fileBrowserLoader.item.parent = root
+ fileBrowserLoader.item.anchors.fill = root
+ fileBrowserLoader.item.openFile.connect(root.openFile)
+ inner.visible = false
+ }
+
+ function openFile(path) {
+ console.log("[qmlvideo] main.openFile " + d.fileIndex + " \"" + path + "\"")
+ fileBrowserLoader.source = ""
+ if (1 == d.fileIndex)
+ root.source1 = path
+ else if (2 == d.fileIndex)
+ root.source2 = path
+ inner.visible = true
+ }
+
+ function closeScene() {
+ console.log("[qmlvideo] main.closeScene")
+ sceneSelectionPanel.sceneSource = ""
+ }
+}
diff --git a/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 00000000..526d2751
--- /dev/null
+++ b/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+class QmlApplicationViewerPrivate
+{
+ QmlApplicationViewerPrivate(QQuickView *view_) : view(view_) {}
+
+ QString mainQmlFile;
+ QQuickView *view;
+ friend class QmlApplicationViewer;
+ QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ QString pathInInstallDir;
+ const QString applicationDirPath = QCoreApplication::applicationDirPath();
+ pathInInstallDir = QString::fromAscii("%1/../%2").arg(applicationDirPath, path);
+
+ if (QFileInfo(pathInInstallDir).exists())
+ return pathInInstallDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWindow *parent)
+ : QQuickView(parent)
+ , d(new QmlApplicationViewerPrivate(this))
+{
+ connect(engine(), SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
+ setResizeMode(QQuickView::SizeRootObjectToView);
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QQuickView *view, QWindow *parent)
+ : QQuickView(parent)
+ , d(new QmlApplicationViewerPrivate(view))
+{
+ connect(view->engine(), SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
+ view->setResizeMode(QQuickView::SizeRootObjectToView);
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete d;
+}
+
+QmlApplicationViewer *QmlApplicationViewer::create()
+{
+ return new QmlApplicationViewer();
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ d->mainQmlFile = d->adjustPath(file);
+ d->view->setSource(QUrl::fromLocalFile(d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ d->view->engine()->addImportPath(d->adjustPath(path));
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#if defined(Q_WS_SIMULATOR)
+ d->view->showFullScreen();
+#else
+ d->view->show();
+#endif
+}
+
+QGuiApplication *createApplication(int &argc, char **argv)
+{
+ return new QGuiApplication(argc, argv);
+}
diff --git a/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.h b/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 00000000..9d8bd321
--- /dev/null
+++ b/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include
+
+class QGuiApplication;
+
+class QmlApplicationViewer : public QQuickView
+{
+ Q_OBJECT
+
+public:
+ explicit QmlApplicationViewer(QWindow *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ static QmlApplicationViewer *create();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+
+ void showExpanded();
+
+private:
+ explicit QmlApplicationViewer(QQuickView *view, QWindow *parent);
+ class QmlApplicationViewerPrivate *d;
+};
+
+QGuiApplication *createApplication(int &argc, char **argv);
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 00000000..fb7414df
--- /dev/null
+++ b/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,128 @@
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $OTHER_FILES *.pro *.pri
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimedia/$${TARGET}
+INSTALLS += sources
+
+QT += quick
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+win32 {
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, /, \\)
+ sourcePathSegments = $$split(source, \\)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ target = $$replace(target, /$, )
+ target = $$target/$$last(sourcePathSegments)
+ target = $$replace(target, /, \\)
+ !isEqual(source,$$target) {
+ !isEmpty(copyCommand):copyCommand += &&
+ isEqual(QMAKE_DIR_SEP, \\) {
+ copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
+ } else {
+ source = $$replace(source, \\\\, /)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ target = $$replace(target, \\\\, /)
+ copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
+ }
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ desktopfile.files = $${TARGET}.desktop
+ desktopfile.path = /usr/share/applications/hildon
+ icon.files = $${TARGET}64.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ } else:!isEmpty(MEEGO_VERSION_MAJOR) {
+ desktopfile.path = /usr/share/applications
+ icon.files = $${TARGET}80.png
+ icon.path = /usr/share/icons/hicolor/80x80/apps
+ } else { # Assumed to be a Desktop Unix
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, \\\\, /)
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ target = $$replace(target, \\\\, /)
+ target = $$replace(target, /$, )
+ sourcePathSegments = $$split(source, /)
+ targetFullPath = $$target/$$last(sourcePathSegments)
+ !isEqual(source,$$targetFullPath) {
+ !isEmpty(copyCommand):copyCommand += &&
+ copyCommand += $(MKDIR) \"$$target\"
+ copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ installPrefix = $$[QT_INSTALL_EXAMPLES]/qtmultimedia/$${TARGET}
+ !isEmpty(MEEGO_VERSION_MAJOR): installPrefix = /opt/$${TARGET}
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+
+ !isEmpty(desktopfile.path) {
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ INSTALLS += icon desktopfile
+ }
+
+ target.path = $${installPrefix}
+ export(target.path)
+ INSTALLS += target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
+
diff --git a/examples/video/qmlvideo/qmlvideo.png b/examples/video/qmlvideo/qmlvideo.png
new file mode 100644
index 00000000..707d5c4e
Binary files /dev/null and b/examples/video/qmlvideo/qmlvideo.png differ
diff --git a/examples/video/qmlvideo/qmlvideo.pro b/examples/video/qmlvideo/qmlvideo.pro
new file mode 100644
index 00000000..6ed01d48
--- /dev/null
+++ b/examples/video/qmlvideo/qmlvideo.pro
@@ -0,0 +1,21 @@
+TEMPLATE = app
+TARGET = qmlvideo
+
+SOURCES += main.cpp
+HEADERS += trace.h
+RESOURCES += qmlvideo.qrc
+
+qml_folder.source = qml/qmlvideo
+qml_folder.target = qml
+DEPLOYMENTFOLDERS = qml_folder
+
+images_folder.source = images
+images_folder.target =
+DEPLOYMENTFOLDERS += images_folder
+
+SNIPPETS_PATH = ../snippets
+include($$SNIPPETS_PATH/performancemonitor/performancemonitordeclarative.pri)
+performanceItemAddDeployment()
+
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/video/qmlvideo/qmlvideo.qrc b/examples/video/qmlvideo/qmlvideo.qrc
new file mode 100644
index 00000000..4896b336
--- /dev/null
+++ b/examples/video/qmlvideo/qmlvideo.qrc
@@ -0,0 +1,12 @@
+
+
+ images/leaves.jpg
+ images/close.png
+ images/folder.png
+ images/titlebar.png
+ images/titlebar.sci
+ images/up.png
+ images/progress_handle.svg
+ images/progress_handle_pressed.svg
+
+
diff --git a/examples/video/qmlvideo/qmlvideo.svg b/examples/video/qmlvideo/qmlvideo.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/video/qmlvideo/qmlvideo.svg
@@ -0,0 +1,93 @@
+
+
diff --git a/examples/video/qmlvideo/trace.h b/examples/video/qmlvideo/trace.h
new file mode 100644
index 00000000..2705bbaf
--- /dev/null
+++ b/examples/video/qmlvideo/trace.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TRACE_H
+#define TRACE_H
+
+#include
+
+#define ENABLE_TRACE
+//#define VERBOSE_TRACE
+
+namespace Trace {
+
+class NullDebug
+{
+public:
+ template
+ NullDebug& operator<<(const T&) { return *this; }
+};
+
+inline NullDebug nullDebug() { return NullDebug(); }
+
+template
+struct PtrWrapper
+{
+ PtrWrapper(const T *ptr) : m_ptr(ptr) { }
+ const T *const m_ptr;
+};
+
+} // namespace Trace
+
+template
+inline QDebug& operator<<(QDebug &debug, const Trace::PtrWrapper &wrapper)
+{
+ debug.nospace() << "[" << (void*)wrapper.m_ptr << "]";
+ return debug.space();
+}
+
+template
+inline const void *qtVoidPtr(const T *ptr)
+{ return static_cast(ptr); }
+
+#define qtThisPtr() qtVoidPtr(this)
+
+#ifdef ENABLE_TRACE
+ inline QDebug qtTrace() { return qDebug() << "[qmlvideo]"; }
+# ifdef VERBOSE_TRACE
+ inline QDebug qtVerboseTrace() { return qtTrace(); }
+# else
+ inline Trace::NullDebug qtVerboseTrace() { return Trace::nullDebug(); }
+# endif
+#else
+ inline Trace::NullDebug qtTrace() { return Trace::nullDebug(); }
+ inline Trace::NullDebug qtVerboseTrace() { return Trace::nullDebug(); }
+#endif
+
+#endif // TRACE_H
diff --git a/examples/video/qmlvideofx/filereader.cpp b/examples/video/qmlvideofx/filereader.cpp
new file mode 100644
index 00000000..f3c08272
--- /dev/null
+++ b/examples/video/qmlvideofx/filereader.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "filereader.h"
+#include "trace.h"
+#include
+#include
+
+QString FileReader::readFile(const QString &fileName)
+{
+ qtTrace() << "FileReader::readFile" << "fileName" << fileName;
+ QString content;
+ QFile file(fileName);
+ if (file.open(QIODevice::ReadOnly)) {
+ QTextStream stream(&file);
+ content = stream.readAll();
+ }
+ return content;
+}
+
diff --git a/examples/video/qmlvideofx/filereader.h b/examples/video/qmlvideofx/filereader.h
new file mode 100644
index 00000000..ff4ff353
--- /dev/null
+++ b/examples/video/qmlvideofx/filereader.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include
+
+class FileReader : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE QString readFile(const QString &fileName);
+};
+
diff --git a/examples/video/qmlvideofx/images/close.png b/examples/video/qmlvideofx/images/close.png
new file mode 100644
index 00000000..6904df0e
Binary files /dev/null and b/examples/video/qmlvideofx/images/close.png differ
diff --git a/examples/video/qmlvideofx/images/folder.png b/examples/video/qmlvideofx/images/folder.png
new file mode 100644
index 00000000..e53e2ad4
Binary files /dev/null and b/examples/video/qmlvideofx/images/folder.png differ
diff --git a/examples/video/qmlvideofx/images/qt-logo.png b/examples/video/qmlvideofx/images/qt-logo.png
new file mode 100644
index 00000000..7d3e97eb
Binary files /dev/null and b/examples/video/qmlvideofx/images/qt-logo.png differ
diff --git a/examples/video/qmlvideofx/images/titlebar.png b/examples/video/qmlvideofx/images/titlebar.png
new file mode 100644
index 00000000..51c90082
Binary files /dev/null and b/examples/video/qmlvideofx/images/titlebar.png differ
diff --git a/examples/video/qmlvideofx/images/titlebar.sci b/examples/video/qmlvideofx/images/titlebar.sci
new file mode 100644
index 00000000..0418d94c
--- /dev/null
+++ b/examples/video/qmlvideofx/images/titlebar.sci
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 12
+border.bottom: 12
+border.right: 10
+source: titlebar.png
diff --git a/examples/video/qmlvideofx/images/up.png b/examples/video/qmlvideofx/images/up.png
new file mode 100644
index 00000000..b05f8025
Binary files /dev/null and b/examples/video/qmlvideofx/images/up.png differ
diff --git a/examples/video/qmlvideofx/main.cpp b/examples/video/qmlvideofx/main.cpp
new file mode 100644
index 00000000..2765816c
--- /dev/null
+++ b/examples/video/qmlvideofx/main.cpp
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include
+#include
+#include
+#include
+#include "filereader.h"
+#include "qmlapplicationviewer.h"
+#include "trace.h"
+
+#ifdef SMALL_SCREEN_LAYOUT
+ static const QLatin1String MainQmlFile("main-smallscreen.qml");
+#else
+ static const QLatin1String MainQmlFile("main-largescreen.qml");
+#endif
+
+#ifdef PERFORMANCEMONITOR_SUPPORT
+#include "performancemonitordeclarative.h"
+#endif
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+#ifdef PERFORMANCEMONITOR_SUPPORT
+ PerformanceMonitor::qmlRegisterTypes();
+#endif
+
+ QUrl fileName;
+ qreal volume = 0.5;
+ QStringList args = app.arguments();
+#ifdef PERFORMANCEMONITOR_SUPPORT
+ PerformanceMonitor::State performanceMonitorState;
+#endif
+ for (int i=1; isetProperty("fileName", fileName);
+ viewer.rootObject()->setProperty("volume", volume);
+
+#ifdef PERFORMANCEMONITOR_SUPPORT
+ if (performanceMonitorState.valid) {
+ rootObject->setProperty("perfMonitorsLogging", performanceMonitorState.logging);
+ rootObject->setProperty("perfMonitorsVisible", performanceMonitorState.visible);
+ }
+ QObject::connect(&viewer, SIGNAL(afterRendering()),
+ rootObject, SLOT(qmlFramePainted()));
+#endif
+
+ FileReader fileReader;
+ viewer.rootContext()->setContextProperty("fileReader", &fileReader);
+
+#ifdef SMALL_SCREEN_PHYSICAL
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.showFullScreen();
+#else
+ viewer.showExpanded();
+#endif
+
+ // Delay invocation of init until the event loop has started, to work around
+ // a GL context issue on Harmattan: without this, we get the following error
+ // when the first ShaderEffectItem is created:
+ // "QGLShaderProgram::addShader: Program and shader are not associated with same context"
+ QMetaObject::invokeMethod(viewer.rootObject(), "init", Qt::QueuedConnection);
+
+ return app.exec();
+}
+
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/Button.qml b/examples/video/qmlvideofx/qml/qmlvideofx/Button.qml
new file mode 100644
index 00000000..7b101dd6
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/Button.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ color: textColor
+ radius: 0.25 * height
+
+ property string text
+ property color bgColor: "white"
+ property color bgColorSelected: "red"
+ property color textColor: "black"
+ property alias enabled: mouseArea.enabled
+
+ signal clicked
+
+ Rectangle {
+ anchors { fill: parent; margins: 1 }
+ color: mouseArea.pressed ? bgColorSelected : bgColor
+ radius: 0.25 * height
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ text: root.text
+ font.pixelSize: 0.5 * parent.height
+ color: mouseArea.pressed ? bgColor : textColor
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ root.clicked()
+ }
+ }
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/Content.qml b/examples/video/qmlvideofx/qml/qmlvideofx/Content.qml
new file mode 100644
index 00000000..7e1a69f9
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/Content.qml
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ color: "black"
+ property alias effect: effectLoader.item
+ property alias gripSize: divider.gripSize
+ property string effectSource
+ property real volume: 0.5
+
+ signal videoFramePainted
+
+ Divider {
+ id: divider
+ visible: false
+ z: 1.0
+ onValueChanged: updateDivider()
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ smooth: true
+ hideSource: true
+ }
+
+ Loader {
+ id: contentLoader
+ }
+
+ Loader {
+ id: effectLoader
+ source: effectSource
+ }
+
+ Connections {
+ id: videoFramePaintedConnection
+ onFramePainted: {
+ if (performanceLoader.item)
+ root.videoFramePainted()
+ }
+ ignoreUnknownSignals: true
+ }
+
+ onEffectSourceChanged: {
+ console.log("[qmlvideofx] Content.onEffectSourceChanged " + effectSource)
+ effectLoader.source = effectSource
+ effectLoader.item.parent = root
+ effectLoader.item.targetWidth = root.width
+ effectLoader.item.targetHeight = root.height
+ updateSource()
+ effectLoader.item.source = theSource
+ divider.visible = effectLoader.item.supportsDivider
+ updateDivider()
+ }
+
+ function init() {
+ console.log("[qmlvideofx] Content.init")
+ openImage("qrc:/images/qt-logo.png")
+ root.effectSource = "EffectPassThrough.qml"
+ }
+
+ function updateDivider() {
+ if (effectLoader.item && effectLoader.item.supportsDivider)
+ effectLoader.item.dividerValue = divider.value
+ }
+
+ function updateSource() {
+ console.log("[qmlvideofx] Content.updateSource")
+ if (contentLoader.item) {
+ contentLoader.item.parent = root
+ contentLoader.item.anchors.fill = root
+ theSource.sourceItem = contentLoader.item
+ if (effectLoader.item)
+ effectLoader.item.anchors.fill = contentLoader.item
+ }
+ }
+
+ function openImage(path) {
+ console.log("[qmlvideofx] Content.openImage \"" + path + "\"")
+ stop()
+ contentLoader.source = "ContentImage.qml"
+ videoFramePaintedConnection.target = null
+ contentLoader.item.source = path
+ updateSource()
+ }
+
+ function openVideo(path) {
+ console.log("[qmlvideofx] Content.openVideo \"" + path + "\"")
+ stop()
+ contentLoader.source = "ContentVideo.qml"
+ videoFramePaintedConnection.target = contentLoader.item
+ contentLoader.item.mediaSource = path
+ contentLoader.item.volume = volume
+ contentLoader.item.play()
+ updateSource()
+ }
+
+ function openCamera() {
+ console.log("[qmlvideofx] Content.openCamera")
+ stop()
+ contentLoader.source = "ContentCamera.qml"
+ videoFramePaintedConnection.target = contentLoader.item
+ updateSource()
+ }
+
+ function stop() {
+ console.log("[qmlvideofx] Content.stop")
+ if (contentLoader.source == "ContentVideo.qml")
+ contentLoader.item.stop()
+ theSource.sourceItem = null
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/ContentCamera.qml b/examples/video/qmlvideofx/qml/qmlvideofx/ContentCamera.qml
new file mode 100644
index 00000000..c9b7d6ea
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/ContentCamera.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtMultimedia 4.0
+
+VideoOutput {
+ source: camera
+
+ Camera {
+ id: camera
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/ContentImage.qml b/examples/video/qmlvideofx/qml/qmlvideofx/ContentImage.qml
new file mode 100644
index 00000000..f3cb9c02
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/ContentImage.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Image {
+ smooth: true
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/ContentVideo.qml b/examples/video/qmlvideofx/qml/qmlvideofx/ContentVideo.qml
new file mode 100644
index 00000000..29ea9587
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/ContentVideo.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtMultimedia 4.0
+
+VideoOutput {
+ source: mediaPlayer
+ property alias mediaSource: mediaPlayer.source
+ property alias volume: mediaPlayer.volume
+
+ MediaPlayer {
+ id: mediaPlayer
+ playing: true
+ volume: 0.5
+ }
+
+ function play() { mediaPlayer.play() }
+ function stop() { mediaPlayer.stop() }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/DisableScreenSaver.qml b/examples/video/qmlvideofx/qml/qmlvideofx/DisableScreenSaver.qml
new file mode 100644
index 00000000..a6ac7544
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/DisableScreenSaver.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtMobility.systeminfo 1.1
+
+Item {
+ ScreenSaver {
+ screenSaverInhibited: true
+ }
+}
+
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/Divider.qml b/examples/video/qmlvideofx/qml/qmlvideofx/Divider.qml
new file mode 100644
index 00000000..cab80662
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/Divider.qml
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ anchors.fill: parent
+ color: "transparent"
+ property alias value: grip.value
+ property alias lineWidth: line.width
+ property alias gripSize: grip.width
+
+ Rectangle {
+ id: grip
+ property real value: 0.5
+ x: (value * parent.width) - width/2
+ anchors.top: parent.top
+ width: 20
+ height: width
+ radius: width/2
+ color: "red"
+
+ MouseArea {
+ anchors.fill: parent
+
+ drag {
+ target: grip
+ axis: Drag.XAxis
+ minimumX: -parent.width/2
+ maximumX: root.width - parent.width/2
+ }
+
+ onPositionChanged: {
+ if (drag.active)
+ updatePosition()
+ }
+
+ onReleased: {
+ updatePosition()
+ }
+
+ function updatePosition() {
+ value = (grip.x + grip.width/2) / grip.parent.width
+ }
+ }
+ }
+
+ Rectangle {
+ id: line
+ anchors { top: parent.top; bottom: parent.bottom }
+ x: value * parent.width - (width / 2)
+ width: 2
+ color: "red"
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/Effect.qml b/examples/video/qmlvideofx/qml/qmlvideofx/Effect.qml
new file mode 100644
index 00000000..9a9f598a
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/Effect.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+ShaderEffect {
+ property variant source
+ property int numParameters: 0
+ property bool supportsDivider: false
+ property real targetWidth: 0
+ property real targetHeight: 0
+ property string fragmentShaderFilename
+ property string vertexShaderFilename
+
+ QtObject {
+ id: d
+ property string fragmentShaderCommon: "
+ #ifdef GL_ES
+ precision mediump float;
+ #else
+ # define lowp
+ # define mediump
+ # define highp
+ #endif // GL_ES
+ "
+ }
+
+ // The following is a workaround for the fact that ShaderEffect
+ // doesn't provide a way for shader programs to be read from a file,
+ // rather than being inline in the QML file
+
+ onFragmentShaderFilenameChanged:
+ fragmentShader = d.fragmentShaderCommon + fileReader.readFile(fragmentShaderFilename)
+ onVertexShaderFilenameChanged:
+ vertexShader = fileReader.readFile(vertexShaderFilename)
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectBillboard.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectBillboard.qml
new file mode 100644
index 00000000..d0583206
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectBillboard.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+ property real grid: 10.0 * param1Value
+
+ property real step_x: 0.0015625
+ property real step_y: targetHeight ? (step_x * targetWidth / targetHeight) : 0.0
+
+ fragmentShaderFilename: "shaders/billboard.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectBlackAndWhite.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectBlackAndWhite.qml
new file mode 100644
index 00000000..7009cb4e
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectBlackAndWhite.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ fragmentShaderFilename: "shaders/blackandwhite.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectEmboss.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectEmboss.qml
new file mode 100644
index 00000000..3426d78d
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectEmboss.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 0
+ property bool supportsDivider: true
+
+ property real dividerValue: 0.5
+
+ fragmentShaderFilename: "shaders/emboss.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectGaussianBlur.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectGaussianBlur.qml
new file mode 100644
index 00000000..5610365a
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectGaussianBlur.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://www.geeks3d.com/20100909/shader-library-gaussian-blur-post-processing-filter-in-glsl/
+
+import QtQuick 2.0
+
+Item {
+id: root
+ property alias targetWidth: verticalShader.targetWidth
+ property alias targetHeight: verticalShader.targetHeight
+ property alias source: verticalShader.source
+
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ Effect {
+ id: verticalShader
+ anchors.fill: parent
+ property real dividerValue: parent.dividerValue
+ property real blurSize: 4.0 * parent.param1Value / targetHeight
+ fragmentShaderFilename: "shaders/gaussianblur_v.fsh"
+ }
+
+ Effect {
+ id: horizontalShader
+ anchors.fill: parent
+ property real dividerValue: parent.dividerValue
+ property real blurSize: 4.0 * parent.param1Value / targetWidth
+ fragmentShaderFilename: "shaders/gaussianblur_h.fsh"
+ source: horizontalShaderSource
+
+ ShaderEffectSource {
+ id: horizontalShaderSource
+ sourceItem: verticalShader
+ smooth: true
+ hideSource: true
+ }
+ }
+}
+
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectGlow.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectGlow.qml
new file mode 100644
index 00000000..bb732161
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectGlow.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 0
+ property bool supportsDivider: true
+
+ property real dividerValue: 0.5
+
+ fragmentShaderFilename: "shaders/glow.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectIsolate.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectIsolate.qml
new file mode 100644
index 00000000..d5128775
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectIsolate.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 2
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real param2Value: 0.5
+ property real dividerValue: 0.5
+
+ property real targetHue: 360.0 * param1Value
+ property real windowWidth: 60.0 * param2Value
+
+ fragmentShaderFilename: "shaders/isolate.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml
new file mode 100644
index 00000000..a5ad4b73
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectMagnify.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ id: root
+
+ // Constant properties which must be supported by every effect
+ property int numParameters: 2
+ property bool supportsDivider: false
+
+ property real param1Value: 0.5
+ property real radius: 200 * param1Value
+
+ property real param2Value: 0.5
+ property real diffractionIndex: param2Value
+
+ property real posX: -1
+ property real posY: -1
+
+ onTargetWidthChanged: if (posX == -1) posX = targetWidth / 2
+ onTargetHeightChanged: if (posY == -1) posY = targetHeight / 2
+
+ fragmentShaderFilename: "shaders/magnify.fsh"
+
+ MouseArea {
+ anchors.fill: parent
+ onPositionChanged: { root.posX = mouse.x; root.posY = root.targetHeight - mouse.y }
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectPageCurl.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectPageCurl.qml
new file mode 100644
index 00000000..9a7335fa
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectPageCurl.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: false
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ property real curlExtent: 1.0 - param1Value
+
+ fragmentShaderFilename: "shaders/pagecurl.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectPassThrough.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectPassThrough.qml
new file mode 100644
index 00000000..c9a081a7
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectPassThrough.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectPixelate.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectPixelate.qml
new file mode 100644
index 00000000..1890ee05
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectPixelate.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ property real granularity: param1Value * 20
+
+ fragmentShaderFilename: "shaders/pixelate.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectPosterize.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectPosterize.qml
new file mode 100644
index 00000000..35836923
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectPosterize.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ property real gamma: param1Value
+ property real numColors: 8.0
+
+ fragmentShaderFilename: "shaders/posterize.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectRipple.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectRipple.qml
new file mode 100644
index 00000000..12ed139f
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectRipple.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 2
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real param2Value: 0.5
+ property real dividerValue: 0.5
+
+ property real time: 0
+
+ NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 }
+
+ property real amplitude: param1Value * 0.03
+ property real n: param2Value * 7
+
+ fragmentShaderFilename: "shaders/ripple.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectSelectionPanel.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSelectionPanel.qml
new file mode 100644
index 00000000..70c56db0
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSelectionPanel.qml
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ property int itemHeight: 25
+ property string effectSource: ""
+
+ signal clicked
+
+ QtObject {
+ id: d
+ property Item selectedItem
+ }
+
+ ListModel {
+ id: sources
+ ListElement { name: "No effect"; source: "EffectPassThrough.qml" }
+ ListElement { name: "Billboard"; source: "EffectBillboard.qml" }
+ ListElement { name: "Black & white"; source: "EffectBlackAndWhite.qml" }
+ ListElement { name: "Blur"; source: "EffectGaussianBlur.qml" }
+ ListElement { name: "Edge detection"; source: "EffectSobelEdgeDetection1.qml" }
+ //ListElement { name: "Edge detection (Sobel, #2)"; source: "EffectSobelEdgeDetection2.qml" }
+ ListElement { name: "Emboss"; source: "EffectEmboss.qml" }
+ ListElement { name: "Glow"; source: "EffectGlow.qml" }
+ ListElement { name: "Isolate"; source: "EffectIsolate.qml" }
+ ListElement { name: "Magnify"; source: "EffectMagnify.qml" }
+ ListElement { name: "Page curl"; source: "EffectPageCurl.qml" }
+ ListElement { name: "Pixelate"; source: "EffectPixelate.qml" }
+ ListElement { name: "Posterize"; source: "EffectPosterize.qml" }
+ ListElement { name: "Ripple"; source: "EffectRipple.qml" }
+ ListElement { name: "Sepia"; source: "EffectSepia.qml" }
+ ListElement { name: "Sharpen"; source: "EffectSharpen.qml" }
+ ListElement { name: "Shockwave"; source: "EffectShockwave.qml" }
+ ListElement { name: "Tilt shift"; source: "EffectTiltShift.qml" }
+ ListElement { name: "Toon"; source: "EffectToon.qml" }
+ ListElement { name: "Warhol"; source: "EffectWarhol.qml" }
+ ListElement { name: "Wobble"; source: "EffectWobble.qml" }
+ ListElement { name: "Vignette"; source: "EffectVignette.qml" }
+ }
+
+ Component {
+ id: sourceDelegate
+ Item {
+ id: sourceDelegateItem
+ width: root.width
+ height: itemHeight
+
+ Button {
+ id: sourceSelectorItem
+ anchors.centerIn: parent
+ width: 0.9 * parent.width
+ height: 0.8 * itemHeight
+ text: name
+ onClicked: {
+ if (d.selectedItem)
+ d.selectedItem.state = "baseState"
+ d.selectedItem = sourceDelegateItem
+ d.selectedItem.state = "selected"
+ effectSource = source
+ root.clicked()
+ }
+ }
+
+ states: [
+ State {
+ name: "selected"
+ PropertyChanges {
+ target: sourceSelectorItem
+ bgColor: "#ff8888"
+ }
+ }
+ ]
+
+ Component.onCompleted: {
+ if (name == "No effect") {
+ state = "selected"
+ d.selectedItem = sourceDelegateItem
+ }
+ }
+
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ ColorAnimation {
+ properties: "color"
+ easing.type: Easing.OutQuart
+ duration: 500
+ }
+ }
+ ]
+ }
+ }
+
+ Flickable {
+ anchors.fill: parent
+ contentHeight: (itemHeight * sources.count) + layout.anchors.topMargin + layout.spacing
+ clip: true
+
+ Column {
+ id: layout
+
+ anchors {
+ fill: parent
+ topMargin: 10
+ }
+
+ Repeater {
+ model: sources
+ delegate: sourceDelegate
+ }
+ }
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectSepia.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSepia.qml
new file mode 100644
index 00000000..13958940
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSepia.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 0
+ property bool supportsDivider: true
+
+ property real dividerValue: 0.5
+
+ fragmentShaderFilename: "shaders/sepia.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectSharpen.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSharpen.qml
new file mode 100644
index 00000000..c5a8659a
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSharpen.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ property real amount: 18.0 * param1Value
+
+ fragmentShaderFilename: "shaders/sharpen.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml
new file mode 100644
index 00000000..ac12cb9b
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectShockwave.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ id: root
+
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ property real granularity: param1Value * 20
+
+ property real centerX
+ property real centerY
+ property real time
+
+ SequentialAnimation {
+ running: true
+ loops: Animation.Infinite
+ ScriptAction {
+ script: {
+ centerX = Math.random()
+ centerY = Math.random()
+ }
+ }
+ NumberAnimation {
+ target: root
+ property: "time"
+ from: 0
+ to: 1
+ duration: 1000
+ }
+ }
+
+ property real weight: param1Value
+
+ fragmentShaderFilename: "shaders/shockwave.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectSobelEdgeDetection1.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSobelEdgeDetection1.qml
new file mode 100644
index 00000000..e9573793
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSobelEdgeDetection1.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ property real mixLevel: param1Value
+ property real targetSize: 250 - (200 * param1Value) // TODO: fix ...
+ property real resS: targetSize
+ property real resT: targetSize
+
+ fragmentShaderFilename: "shaders/sobeledgedetection1.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectSobelEdgeDetection2.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSobelEdgeDetection2.qml
new file mode 100644
index 00000000..5061b285
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectSobelEdgeDetection2.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ property real weight: param1Value
+
+ fragmentShaderFilename: "shaders/sobeledgedetection2.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectTiltShift.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectTiltShift.qml
new file mode 100644
index 00000000..8a81ec55
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectTiltShift.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 0
+ property bool supportsDivider: true
+
+ property real dividerValue: 0.5
+
+ fragmentShaderFilename: "shaders/tiltshift.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectToon.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectToon.qml
new file mode 100644
index 00000000..9b8235c8
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectToon.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ property real threshold: param1Value
+ property real targetSize: 250 - (200 * param1Value) // TODO: fix ...
+ property real resS: targetSize
+ property real resT: targetSize
+
+ // TODO
+ property real magTol: 0.3
+ property real quantize: 8.0
+
+ fragmentShaderFilename: "shaders/toon.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectVignette.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectVignette.qml
new file mode 100644
index 00000000..65b099d4
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectVignette.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 0
+ property bool supportsDivider: true
+
+ property real dividerValue: 0.5
+
+ fragmentShaderFilename: "shaders/vignette.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectWarhol.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectWarhol.qml
new file mode 100644
index 00000000..39ddc4e9
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectWarhol.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 0
+ property bool supportsDivider: true
+
+ property real dividerValue: 0.5
+
+ fragmentShaderFilename: "shaders/warhol.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/EffectWobble.qml b/examples/video/qmlvideofx/qml/qmlvideofx/EffectWobble.qml
new file mode 100644
index 00000000..d1b7491b
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/EffectWobble.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Effect {
+ // Constant properties which must be supported by every effect
+ property int numParameters: 1
+ property bool supportsDivider: true
+
+ property real param1Value: 0.5
+ property real dividerValue: 0.5
+
+ property real amplitude: param1Value * 0.05
+ property real frequency: 20
+ property real time: 0
+
+ NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 }
+
+ fragmentShaderFilename: "shaders/wobble.fsh"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml b/examples/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml
new file mode 100644
index 00000000..84157ea3
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml
@@ -0,0 +1,354 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.folderlistmodel 1.0
+
+Rectangle {
+ id: root
+ color: "white"
+ property bool showFocusHighlight: false
+ property variant folders: folders1
+ property variant view: view1
+ property alias folder: folders1.folder
+ property color textColor: "black"
+
+ signal openFile(string path)
+
+ FolderListModel {
+ id: folders1
+ folder: folder
+ }
+
+ FolderListModel {
+ id: folders2
+ folder: folder
+ }
+
+ SystemPalette {
+ id: palette
+ }
+
+ Component {
+ id: folderDelegate
+
+ Rectangle {
+ id: wrapper
+ function launch() {
+ if (folders.isFolder(index))
+ down(filePath);
+ else
+ root.openFile(filePath);
+ }
+ width: root.width
+ height: 52
+ color: "transparent"
+
+ Rectangle {
+ id: highlight; visible: false
+ anchors.fill: parent
+ color: palette.highlight
+ gradient: Gradient {
+ GradientStop { id: t1; position: 0.0; color: palette.highlight }
+ GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
+ }
+ }
+
+ Item {
+ width: 48; height: 48
+ Image {
+ source: "qrc:/images/folder.png"
+ anchors.centerIn: parent
+ visible: folders.isFolder(index)
+ }
+ }
+
+ Text {
+ id: nameText
+ anchors.fill: parent; verticalAlignment: Text.AlignVCenter
+ text: fileName
+ anchors.leftMargin: 54
+ font.pixelSize: 32
+ 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 }
+ }
+ ]
+ }
+ }
+
+ Rectangle {
+ id: cancelButton
+ width: 100
+ height: titleBar.height - 7
+ color: "black"
+ anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
+
+ Text {
+ anchors { fill: parent; margins: 4 }
+ text: "Cancel"
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: 20
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: root.openFile("")
+ }
+ }
+
+ ListView {
+ id: view1
+ anchors.top: titleBar.bottom
+ anchors.bottom: cancelButton.top
+ x: 0
+ width: parent.width
+ model: folders1
+ delegate: folderDelegate
+ highlight: Rectangle {
+ color: palette.highlight
+ visible: root.showFocusHighlight && view1.count != 0
+ gradient: Gradient {
+ GradientStop { id: t1; position: 0.0; color: palette.highlight }
+ GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
+ }
+ width: view1.currentItem == null ? 0 : view1.currentItem.width
+ }
+ highlightMoveSpeed: 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: palette.highlight
+ visible: root.showFocusHighlight && view2.count != 0
+ gradient: Gradient {
+ GradientStop { id: t1; position: 0.0; color: palette.highlight }
+ GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
+ }
+ width: view1.currentItem == null ? 0 : view1.currentItem.width
+ }
+ highlightMoveSpeed: 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)
+ }
+
+ 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();
+ }
+ }
+
+ BorderImage {
+ source: "qrc:/images/titlebar.sci";
+ width: parent.width;
+ height: 52
+ y: -7
+ id: titleBar
+
+ Rectangle {
+ id: upButton
+ width: 48
+ height: titleBar.height - 7
+ color: "transparent"
+ Image { anchors.centerIn: parent; source: "qrc:/images/up.png" }
+ MouseArea { id: upRegion; anchors.centerIn: parent
+ width: 56
+ height: 56
+ onClicked: if (folders.parentFolder != "") up()
+ }
+ states: [
+ State {
+ name: "pressed"
+ when: upRegion.pressed
+ PropertyChanges { target: upButton; color: palette.highlight }
+ }
+ ]
+ }
+
+ Rectangle {
+ color: "gray"
+ x: 48
+ width: 1
+ height: 44
+ }
+
+ Text {
+ anchors.left: upButton.right; anchors.right: parent.right; height: parent.height
+ anchors.leftMargin: 4; anchors.rightMargin: 4
+ text: folders.folder
+ color: "white"
+ elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter
+ font.pixelSize: 32
+ }
+ }
+
+ 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 (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/video/qmlvideofx/qml/qmlvideofx/FileOpen.qml b/examples/video/qmlvideofx/qml/qmlvideofx/FileOpen.qml
new file mode 100644
index 00000000..19f23919
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/FileOpen.qml
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ color: "white"
+ property int buttonHeight: 35
+
+ signal openImage
+ signal openVideo
+ signal openCamera
+ signal close
+
+ Rectangle {
+ anchors {
+ topMargin: 10
+ bottomMargin: 10
+ top: parent.top;
+ bottom: parent.bottom;
+ horizontalCenter: parent.horizontalCenter
+ }
+ width: 0.9 * parent.width
+ color: "transparent"
+
+ Column {
+ anchors.fill: parent
+ spacing: 5
+ Button {
+ text: "Open image"
+ height: buttonHeight
+ width: parent.width
+ onClicked: root.openImage()
+ }
+ Button {
+ text: "Open video"
+ height: buttonHeight
+ width: parent.width
+ onClicked: root.openVideo()
+ }
+ Button {
+ text: "Start camera"
+ height: buttonHeight
+ width: parent.width
+ onClicked: root.openCamera()
+ }
+ Button {
+ text: "Reset"
+ height: buttonHeight
+ width: parent.width
+ onClicked: root.close()
+ }
+ }
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/HintedMouseArea.qml b/examples/video/qmlvideofx/qml/qmlvideofx/HintedMouseArea.qml
new file mode 100644
index 00000000..7b54705f
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/HintedMouseArea.qml
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Mouse area which flashes to indicate its location on the screen
+
+import QtQuick 2.0
+
+MouseArea {
+ property alias hintColor: hintRect.color
+ property bool hintEnabled: true
+
+ Rectangle {
+ id: hintRect
+ anchors.fill: parent
+ color: "yellow"
+ opacity: 0
+
+ states: [
+ State {
+ name: "high"
+ PropertyChanges {
+ target: hintRect
+ opacity: 0.8
+ }
+ },
+ State {
+ name: "low"
+ PropertyChanges {
+ target: hintRect
+ opacity: 0.4
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "low"
+ to: "high"
+ SequentialAnimation {
+ NumberAnimation {
+ properties: "opacity"
+ easing.type: Easing.InOutSine
+ duration: 500
+ }
+ ScriptAction { script: hintRect.state = "low" }
+ }
+ },
+ Transition {
+ from: "*"
+ to: "low"
+ SequentialAnimation {
+ NumberAnimation {
+ properties: "opacity"
+ easing.type: Easing.InOutSine
+ duration: 500
+ }
+ ScriptAction { script: hintRect.state = "high" }
+ }
+ },
+ Transition {
+ from: "*"
+ to: "baseState"
+ NumberAnimation {
+ properties: "opacity"
+ easing.type: Easing.InOutSine
+ duration: 500
+ }
+ }
+ ]
+ }
+
+ onHintEnabledChanged: hintRect.state = hintEnabled ? "low" : "baseState"
+
+ Component.onCompleted: hintRect.state = "low"
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/ParameterPanel.qml b/examples/video/qmlvideofx/qml/qmlvideofx/ParameterPanel.qml
new file mode 100644
index 00000000..43e245bf
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/ParameterPanel.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ color: "transparent"
+ height: numParameters * sliderHeight + (numParameters + 1) * spacing
+ visible: numParameters > 0
+ property color lineColor: "black"
+ property int numParameters: 1
+ property alias param1Value: slider1.value
+ property alias param2Value: slider2.value
+ property bool enabled: true
+ property real gripSize: 25
+ property real spacing: 10
+ property real sliderHeight: 40
+
+ Slider {
+ id: slider1
+ color: "white"
+ enabled: parent.enabled
+ gripSize: root.gripSize
+ height: sliderHeight
+ visible: enabled
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: (root.numParameters == 1) ? root.bottom : slider2.top
+ margins: root.spacing
+ }
+ }
+
+ Slider {
+ id: slider2
+ color: "white"
+ enabled: parent.enabled && root.numParameters >= 2
+ gripSize: root.gripSize
+ height: sliderHeight
+ visible: enabled
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: root.bottom
+ margins: root.spacing
+ }
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/Slider.qml b/examples/video/qmlvideofx/qml/qmlvideofx/Slider.qml
new file mode 100644
index 00000000..c19a9df3
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/Slider.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ color: "white"
+ radius: 5
+ property alias value: grip.value
+ property color lineColor: "black"
+ property alias gripSize: grip.width
+ property alias enabled: mouseArea.enabled
+
+ Rectangle {
+ anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter }
+ height: 3
+ color: displayedColor()
+
+ Rectangle {
+ anchors { fill: parent; margins: 1 }
+ color: root.color
+ }
+ }
+
+ Rectangle {
+ id: grip
+ property real value: 0.5
+ x: (value * parent.width) - width/2
+ anchors.verticalCenter: parent.verticalCenter
+ width: 20
+ height: width
+ radius: width/2
+ color: displayedColor()
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ drag {
+ target: grip
+ axis: Drag.XAxis
+ minimumX: -parent.width/2
+ maximumX: root.width - parent.width/2
+ }
+ onPositionChanged: {
+ if (drag.active)
+ updatePosition()
+ }
+ onReleased: {
+ updatePosition()
+ }
+ function updatePosition() {
+ value = (grip.x + grip.width/2) / grip.parent.width
+ }
+ }
+
+ Rectangle {
+ anchors { fill: parent; margins: 1 }
+ radius: width/2
+ color: root.color
+ }
+ }
+
+ function displayedColor() {
+ var tint = Qt.rgba(color.r, color.g, color.b, 0.25)
+ return enabled ? lineColor : Qt.tint(color, tint)
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/main-largescreen.qml b/examples/video/qmlvideofx/qml/qmlvideofx/main-largescreen.qml
new file mode 100644
index 00000000..0c24d0dc
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/main-largescreen.qml
@@ -0,0 +1,205 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ width: 900
+ height: 600
+ color: "grey"
+ property string fileName
+ property alias volume: content.volume
+ property bool perfMonitorsLogging: false
+ property bool perfMonitorsVisible: false
+
+ QtObject {
+ id: d
+ property string openFileType
+ }
+
+ Rectangle {
+ id: inner
+ anchors.fill: parent
+ color: "grey"
+
+ Content {
+ id: content
+ anchors {
+ top: parent.top
+ left: parent.left
+ margins: 5
+ }
+ width: 600
+ height: 600
+ }
+
+ Loader {
+ id: performanceLoader
+ function init() {
+ console.log("[qmlvideofx] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
+ var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
+ source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
+ }
+ onLoaded: {
+ item.parent = content
+ item.anchors.top = content.top
+ item.anchors.left = content.left
+ item.anchors.right = content.right
+ item.height = 100
+ item.anchors.margins = 5
+ item.logging = root.perfMonitorsLogging
+ item.displayed = root.perfMonitorsVisible
+ item.init()
+ }
+ }
+
+ ParameterPanel {
+ id: parameterPanel
+ enabled: numParameters >= 1
+ numParameters: content.effect ? content.effect.numParameters : 0
+ anchors {
+ top: content.bottom
+ left: parent.left
+ bottom: parent.bottom
+ }
+ width: content.width
+ onParam1ValueChanged: updateParameters()
+ }
+
+ EffectSelectionPanel {
+ id: effectSelectionPanel
+ anchors {
+ top: parent.top
+ left: content.right
+ right: parent.right
+ margins: 5
+ }
+ height: 420
+ itemHeight: 40
+ onEffectSourceChanged: {
+ content.effectSource = effectSource
+ updateParameters()
+ }
+ }
+
+ FileOpen {
+ id: fileOpen
+ anchors {
+ top: effectSelectionPanel.bottom
+ left: content.right
+ right: parent.right
+ bottom: parent.bottom
+ margins: 5
+ }
+ buttonHeight: 32
+ }
+ }
+
+ Loader {
+ id: fileBrowserLoader
+ }
+
+ Component.onCompleted: {
+ fileOpen.openImage.connect(openImage)
+ fileOpen.openVideo.connect(openVideo)
+ fileOpen.openCamera.connect(openCamera)
+ fileOpen.close.connect(close)
+ }
+
+ function init() {
+ console.log("[qmlvideofx] main.init")
+ content.init()
+ performanceLoader.init()
+ if (fileName != "") {
+ d.openFileType = "video"
+ openFile(fileName)
+ }
+ }
+
+ function qmlFramePainted() {
+ if (performanceLoader.item)
+ performanceLoader.item.qmlFramePainted()
+ }
+
+ function updateParameters() {
+ if (content.effect.numParameters >= 1)
+ content.effect.param1Value = parameterPanel.param1Value
+ }
+
+ function openImage() {
+ d.openFileType = "image"
+ showFileBrowser("../../images")
+ }
+
+ function openVideo() {
+ d.openFileType = "video"
+ showFileBrowser("../../videos")
+ }
+
+ function openCamera() {
+ content.openCamera()
+ }
+
+ function close() {
+ content.openImage("qrc:/images/qt-logo.png")
+ }
+
+ function showFileBrowser(path) {
+ fileBrowserLoader.source = "FileBrowser.qml"
+ fileBrowserLoader.item.parent = root
+ fileBrowserLoader.item.anchors.fill = root
+ fileBrowserLoader.item.openFile.connect(root.openFile)
+ fileBrowserLoader.item.folder = path
+ inner.visible = false
+ }
+
+ function openFile(path) {
+ fileBrowserLoader.source = ""
+ if (path != "") {
+ if (d.openFileType == "image")
+ content.openImage(path)
+ else if (d.openFileType == "video")
+ content.openVideo(path)
+ }
+ inner.visible = true
+ }
+}
diff --git a/examples/video/qmlvideofx/qml/qmlvideofx/main-smallscreen.qml b/examples/video/qmlvideofx/qml/qmlvideofx/main-smallscreen.qml
new file mode 100644
index 00000000..922c57d8
--- /dev/null
+++ b/examples/video/qmlvideofx/qml/qmlvideofx/main-smallscreen.qml
@@ -0,0 +1,416 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ width: 640
+ height: 360
+ color: "grey"
+ property string fileName
+ property alias volume: content.volume
+ property bool perfMonitorsLogging: false
+ property bool perfMonitorsVisible: false
+
+ QtObject {
+ id: d
+ property string openFileType
+ }
+
+ // Create ScreenSaver element via Loader, so this app will still run if the
+ // SystemInfo module is not available
+ Loader {
+ source: "DisableScreenSaver.qml"
+ }
+
+ Loader {
+ id: performanceLoader
+ function init() {
+ console.log("[qmlvideofx] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
+ 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.init()
+ }
+ }
+
+ Rectangle {
+ id: inner
+ anchors.fill: parent
+ color: "grey"
+
+ Content {
+ id: content
+ anchors.fill: parent
+ gripSize: 40
+ onVideoFramePainted: performanceLoader.item.videoFramePainted()
+ }
+
+ ParameterPanel {
+ id: parameterPanel
+
+ anchors {
+ left: parent.left;
+ right: parent.right;
+ margins: 10
+ }
+ numParameters: content.effect.numParameters
+ y: parent.height
+ opacity: 0.75
+ gripSize: 40
+
+ states: [
+ State {
+ name: "shown"
+ PropertyChanges {
+ target: parameterPanel
+ y: parent.height - (parameterPanel.height + 10)
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ properties: "y"
+ easing.type: Easing.OutQuart
+ duration: 500
+ }
+ }
+ ]
+
+ enabled: content.effect.numParameters >= 1 && effectSelectionPanel.state != "shown"
+ state: enabled ? "shown" : "baseState"
+ onParam1ValueChanged: updateParameters()
+ onParam2ValueChanged: updateParameters()
+ }
+
+ EffectSelectionPanel {
+ id: effectSelectionPanel
+ anchors {
+ top: parent.top;
+ bottom: parameterPanel.top;
+ margins: 10
+ }
+ x: parent.width
+ width: parent.width - 40
+ opacity: 0.75
+ radius: 20
+ itemHeight: 50
+
+ states: [
+ State {
+ name: "shown"
+ PropertyChanges {
+ target: effectSelectionPanel
+ x: 20
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ properties: "x"
+ easing.type: Easing.OutQuart
+ duration: 500
+ }
+ }
+ ]
+
+ onEffectSourceChanged: {
+ content.effectSource = effectSource
+ parameterPanel.numParameters = content.effect.numParameters
+ updateParameters()
+ }
+
+ onClicked: state = "baseState"
+ }
+
+ Rectangle {
+ id: fileOpenContainer
+ anchors {
+ top: parent.top
+ bottom: parameterPanel.top
+ margins: 10
+ }
+ x: -width
+ width: parent.width - 40
+ color: "transparent"
+
+ Column {
+ anchors.fill: parent
+
+ FileOpen {
+ id: fileOpen
+ color: "transparent"
+ width: parent.width
+ height: 200
+ opacity: 0.75
+ radius: 20
+ buttonHeight: 40
+ }
+
+ MouseArea {
+ width: parent.width
+ height: 250
+ onClicked: fileOpenContainer.state = "baseState"
+ }
+ }
+
+ states: [
+ State {
+ name: "shown"
+ PropertyChanges {
+ target: fileOpenContainer
+ x: 20
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ properties: "x"
+ easing.type: Easing.OutQuart
+ duration: 500
+ }
+ }
+ ]
+ }
+
+ Rectangle {
+ id: splashScreen
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ verticalCenter: parent.verticalCenter
+ }
+ width: 300
+ height: 200
+ radius: 0.1 * height
+ color: "white"
+ opacity: 0.9
+ border { color: "black"; width: 2 }
+
+ Text {
+ anchors {
+ fill: parent
+ margins: 5
+ }
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: 24
+ text: "Tap on left side to switch between sources.\n\nTap on right side to switch between effects."
+ wrapMode: Text.WordWrap
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "hidden"
+ }
+
+ states: [
+ State {
+ name: "hidden"
+ PropertyChanges {
+ target: splashScreen
+ opacity: 0.0
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ properties: "opacity"
+ easing.type: Easing.OutQuart
+ duration: 500
+ }
+ }
+ ]
+ }
+
+ HintedMouseArea {
+ id: fileOpenMouseArea
+ anchors {
+ left: parent.left;
+ top: parent.top;
+ bottom: parameterPanel.top;
+ topMargin: 75
+ }
+ width: 100
+ onClicked: {
+ fileOpenMouseArea.hintEnabled = false
+ effectSelectionPanelMouseArea.hintEnabled = false
+ splashScreen.state = "hidden"
+ fileOpenContainer.state = "shown"
+ }
+ enabled: (fileOpenContainer.state != "shown" && effectSelectionPanel.state != "shown")
+ }
+
+ HintedMouseArea {
+ id: effectSelectionPanelMouseArea
+ anchors {
+ right: parent.right;
+ top: parent.top;
+ bottom: parameterPanel.top;
+ topMargin: 75
+ }
+ width: 100
+ onClicked: {
+ fileOpenMouseArea.hintEnabled = false
+ effectSelectionPanelMouseArea.hintEnabled = false
+ splashScreen.state = "hidden"
+ effectSelectionPanel.state = "shown"
+ }
+ enabled: (fileOpenContainer.state != "shown" && effectSelectionPanel.state != "shown")
+ }
+
+ Image {
+ source: "qrc:/images/close.png"
+
+ anchors {
+ top: parent.top
+ right: parent.right
+ margins: 5
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ fileOpen.openImage.connect(openImage)
+ fileOpen.openVideo.connect(openVideo)
+ fileOpen.openCamera.connect(openCamera)
+ fileOpen.close.connect(close)
+ }
+
+ Loader {
+ id: fileBrowserLoader
+ }
+
+ // Called from main() once root properties have been set
+ function init() {
+ console.log("[qmlvideofx] main.init")
+ content.init()
+ performanceLoader.init()
+ if (fileName != "") {
+ fileOpenMouseArea.hintEnabled = false
+ effectSelectionPanelMouseArea.hintEnabled = false
+ splashScreen.state = "hidden"
+ d.openFileType = "video"
+ openFile(fileName)
+ }
+ }
+
+ function qmlFramePainted() {
+ if (performanceLoader.item)
+ performanceLoader.item.qmlFramePainted()
+ }
+
+ function updateParameters() {
+ if (content.effect.numParameters >= 1)
+ content.effect.param1Value = parameterPanel.param1Value
+ if (content.effect.numParameters >= 2)
+ content.effect.param2Value = parameterPanel.param2Value
+ }
+
+ function openImage() {
+ fileOpenContainer.state = "baseState"
+ d.openFileType = "image"
+ showFileBrowser("../../images")
+ }
+
+ function openVideo() {
+ fileOpenContainer.state = "baseState"
+ d.openFileType = "video"
+ showFileBrowser("../../videos")
+ }
+
+ function openCamera() {
+ fileOpenContainer.state = "baseState"
+ content.openCamera()
+ }
+
+ function close() {
+ fileOpenContainer.state = "baseState"
+ content.openImage("qrc:/images/qt-logo.png")
+ }
+
+ function showFileBrowser(path) {
+ content.stop()
+ fileBrowserLoader.source = "FileBrowser.qml"
+ fileBrowserLoader.item.parent = root
+ fileBrowserLoader.item.anchors.fill = root
+ fileBrowserLoader.item.openFile.connect(root.openFile)
+ fileBrowserLoader.item.folder = path
+ inner.visible = false
+ }
+
+ function openFile(path) {
+ fileBrowserLoader.source = ""
+ if (path != "") {
+ if (d.openFileType == "image")
+ content.openImage(path)
+ else if (d.openFileType == "video")
+ content.openVideo(path)
+ }
+ inner.visible = true
+ }
+}
diff --git a/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 00000000..526d2751
--- /dev/null
+++ b/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+class QmlApplicationViewerPrivate
+{
+ QmlApplicationViewerPrivate(QQuickView *view_) : view(view_) {}
+
+ QString mainQmlFile;
+ QQuickView *view;
+ friend class QmlApplicationViewer;
+ QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ QString pathInInstallDir;
+ const QString applicationDirPath = QCoreApplication::applicationDirPath();
+ pathInInstallDir = QString::fromAscii("%1/../%2").arg(applicationDirPath, path);
+
+ if (QFileInfo(pathInInstallDir).exists())
+ return pathInInstallDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWindow *parent)
+ : QQuickView(parent)
+ , d(new QmlApplicationViewerPrivate(this))
+{
+ connect(engine(), SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
+ setResizeMode(QQuickView::SizeRootObjectToView);
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QQuickView *view, QWindow *parent)
+ : QQuickView(parent)
+ , d(new QmlApplicationViewerPrivate(view))
+{
+ connect(view->engine(), SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
+ view->setResizeMode(QQuickView::SizeRootObjectToView);
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete d;
+}
+
+QmlApplicationViewer *QmlApplicationViewer::create()
+{
+ return new QmlApplicationViewer();
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ d->mainQmlFile = d->adjustPath(file);
+ d->view->setSource(QUrl::fromLocalFile(d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ d->view->engine()->addImportPath(d->adjustPath(path));
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#if defined(Q_WS_SIMULATOR)
+ d->view->showFullScreen();
+#else
+ d->view->show();
+#endif
+}
+
+QGuiApplication *createApplication(int &argc, char **argv)
+{
+ return new QGuiApplication(argc, argv);
+}
diff --git a/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.h b/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 00000000..9d8bd321
--- /dev/null
+++ b/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include
+
+class QGuiApplication;
+
+class QmlApplicationViewer : public QQuickView
+{
+ Q_OBJECT
+
+public:
+ explicit QmlApplicationViewer(QWindow *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ static QmlApplicationViewer *create();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+
+ void showExpanded();
+
+private:
+ explicit QmlApplicationViewer(QQuickView *view, QWindow *parent);
+ class QmlApplicationViewerPrivate *d;
+};
+
+QGuiApplication *createApplication(int &argc, char **argv);
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 00000000..fb7414df
--- /dev/null
+++ b/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,128 @@
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $OTHER_FILES *.pro *.pri
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimedia/$${TARGET}
+INSTALLS += sources
+
+QT += quick
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+win32 {
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, /, \\)
+ sourcePathSegments = $$split(source, \\)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ target = $$replace(target, /$, )
+ target = $$target/$$last(sourcePathSegments)
+ target = $$replace(target, /, \\)
+ !isEqual(source,$$target) {
+ !isEmpty(copyCommand):copyCommand += &&
+ isEqual(QMAKE_DIR_SEP, \\) {
+ copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
+ } else {
+ source = $$replace(source, \\\\, /)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ target = $$replace(target, \\\\, /)
+ copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
+ }
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ desktopfile.files = $${TARGET}.desktop
+ desktopfile.path = /usr/share/applications/hildon
+ icon.files = $${TARGET}64.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ } else:!isEmpty(MEEGO_VERSION_MAJOR) {
+ desktopfile.path = /usr/share/applications
+ icon.files = $${TARGET}80.png
+ icon.path = /usr/share/icons/hicolor/80x80/apps
+ } else { # Assumed to be a Desktop Unix
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, \\\\, /)
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ target = $$replace(target, \\\\, /)
+ target = $$replace(target, /$, )
+ sourcePathSegments = $$split(source, /)
+ targetFullPath = $$target/$$last(sourcePathSegments)
+ !isEqual(source,$$targetFullPath) {
+ !isEmpty(copyCommand):copyCommand += &&
+ copyCommand += $(MKDIR) \"$$target\"
+ copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ installPrefix = $$[QT_INSTALL_EXAMPLES]/qtmultimedia/$${TARGET}
+ !isEmpty(MEEGO_VERSION_MAJOR): installPrefix = /opt/$${TARGET}
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+
+ !isEmpty(desktopfile.path) {
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ INSTALLS += icon desktopfile
+ }
+
+ target.path = $${installPrefix}
+ export(target.path)
+ INSTALLS += target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
+
diff --git a/examples/video/qmlvideofx/qmlvideofx.png b/examples/video/qmlvideofx/qmlvideofx.png
new file mode 100644
index 00000000..707d5c4e
Binary files /dev/null and b/examples/video/qmlvideofx/qmlvideofx.png differ
diff --git a/examples/video/qmlvideofx/qmlvideofx.pro b/examples/video/qmlvideofx/qmlvideofx.pro
new file mode 100644
index 00000000..b1a060cc
--- /dev/null
+++ b/examples/video/qmlvideofx/qmlvideofx.pro
@@ -0,0 +1,28 @@
+TEMPLATE = app
+TARGET = qmlvideofx
+QT += opengl
+
+SOURCES += filereader.cpp \
+ main.cpp
+HEADERS += filereader.h \
+ trace.h
+RESOURCES += qmlvideofx.qrc
+
+qml_folder.source = qml/qmlvideofx
+qml_folder.target = qml
+DEPLOYMENTFOLDERS += qml_folder
+
+images_folder.source = images
+images_folder.target =
+DEPLOYMENTFOLDERS += images_folder
+
+shaders_folder.source = shaders
+shaders_folder.target =
+DEPLOYMENTFOLDERS += shaders_folder
+
+SNIPPETS_PATH = ../snippets
+include($$SNIPPETS_PATH/performancemonitor/performancemonitordeclarative.pri)
+performanceItemAddDeployment()
+
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/video/qmlvideofx/qmlvideofx.qrc b/examples/video/qmlvideofx/qmlvideofx.qrc
new file mode 100644
index 00000000..6ca4ef54
--- /dev/null
+++ b/examples/video/qmlvideofx/qmlvideofx.qrc
@@ -0,0 +1,10 @@
+
+
+ images/close.png
+ images/folder.png
+ images/titlebar.png
+ images/titlebar.sci
+ images/up.png
+ images/qt-logo.png
+
+
diff --git a/examples/video/qmlvideofx/qmlvideofx.svg b/examples/video/qmlvideofx/qmlvideofx.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/video/qmlvideofx/qmlvideofx.svg
@@ -0,0 +1,93 @@
+
+
diff --git a/examples/video/qmlvideofx/shaders/billboard.fsh b/examples/video/qmlvideofx/shaders/billboard.fsh
new file mode 100644
index 00000000..0264f450
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/billboard.fsh
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html
+
+uniform float grid;
+uniform float dividerValue;
+uniform float step_x;
+uniform float step_y;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ float offx = floor(uv.x / (grid * step_x));
+ float offy = floor(uv.y / (grid * step_y));
+ vec3 res = texture2D(source, vec2(offx * grid * step_x , offy * grid * step_y)).rgb;
+ vec2 prc = fract(uv / vec2(grid * step_x, grid * step_y));
+ vec2 pw = pow(abs(prc - 0.5), vec2(2.0));
+ float rs = pow(0.45, 2.0);
+ float gr = smoothstep(rs - 0.1, rs + 0.1, pw.x + pw.y);
+ float y = (res.r + res.g + res.b) / 3.0;
+ vec3 ra = res / y;
+ float ls = 0.3;
+ float lb = ceil(y / ls);
+ float lf = ls * lb + 0.3;
+ res = lf * res;
+ vec3 col = mix(res, vec3(0.1, 0.1, 0.1), gr);
+ if (uv.x < dividerValue)
+ gl_FragColor = qt_Opacity * vec4(col, 1.0);
+ else
+ gl_FragColor = qt_Opacity * texture2D(source, uv);
+}
diff --git a/examples/video/qmlvideofx/shaders/blackandwhite.fsh b/examples/video/qmlvideofx/shaders/blackandwhite.fsh
new file mode 100644
index 00000000..7e0dc9d9
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/blackandwhite.fsh
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html
+
+uniform float param1Value;
+uniform float dividerValue;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec4 orig = texture2D(source, uv);
+ vec3 col = orig.rgb;
+ float y = 0.3 *col.r + 0.59 * col.g + 0.11 * col.b;
+ y = y < param1Value ? 0.0 : 1.0;
+ if (uv.x < dividerValue)
+ gl_FragColor = qt_Opacity * vec4(y, y, y, 1.0);
+ else
+ gl_FragColor = qt_Opacity * orig;
+}
diff --git a/examples/video/qmlvideofx/shaders/emboss.fsh b/examples/video/qmlvideofx/shaders/emboss.fsh
new file mode 100644
index 00000000..091e2605
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/emboss.fsh
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html
+
+uniform float dividerValue;
+const float step_w = 0.0015625;
+const float step_h = 0.0027778;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec3 t1 = texture2D(source, vec2(uv.x - step_w, uv.y - step_h)).rgb;
+ vec3 t2 = texture2D(source, vec2(uv.x, uv.y - step_h)).rgb;
+ vec3 t3 = texture2D(source, vec2(uv.x + step_w, uv.y - step_h)).rgb;
+ vec3 t4 = texture2D(source, vec2(uv.x - step_w, uv.y)).rgb;
+ vec3 t5 = texture2D(source, uv).rgb;
+ vec3 t6 = texture2D(source, vec2(uv.x + step_w, uv.y)).rgb;
+ vec3 t7 = texture2D(source, vec2(uv.x - step_w, uv.y + step_h)).rgb;
+ vec3 t8 = texture2D(source, vec2(uv.x, uv.y + step_h)).rgb;
+ vec3 t9 = texture2D(source, vec2(uv.x + step_w, uv.y + step_h)).rgb;
+ vec3 rr = -4.0 * t1 - 4.0 * t2 - 4.0 * t4 + 12.0 * t5;
+ float y = (rr.r + rr.g + rr.b) / 3.0;
+ vec3 col = vec3(y, y, y) + 0.3;
+ if (uv.x < dividerValue)
+ gl_FragColor = qt_Opacity * vec4(col, 1.0);
+ else
+ gl_FragColor = qt_Opacity * texture2D(source, uv);
+}
diff --git a/examples/video/qmlvideofx/shaders/gaussianblur_h.fsh b/examples/video/qmlvideofx/shaders/gaussianblur_h.fsh
new file mode 100644
index 00000000..249ee304
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/gaussianblur_h.fsh
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+uniform float dividerValue;
+uniform float blurSize;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec4 c = vec4(0.0);
+ if (uv.x < dividerValue) {
+ c += texture2D(source, uv - vec2(4.0*blurSize, 0.0)) * 0.05;
+ c += texture2D(source, uv - vec2(3.0*blurSize, 0.0)) * 0.09;
+ c += texture2D(source, uv - vec2(2.0*blurSize, 0.0)) * 0.12;
+ c += texture2D(source, uv - vec2(1.0*blurSize, 0.0)) * 0.15;
+ c += texture2D(source, uv) * 0.16;
+ c += texture2D(source, uv + vec2(1.0*blurSize, 0.0)) * 0.15;
+ c += texture2D(source, uv + vec2(2.0*blurSize, 0.0)) * 0.12;
+ c += texture2D(source, uv + vec2(3.0*blurSize, 0.0)) * 0.09;
+ c += texture2D(source, uv + vec2(4.0*blurSize, 0.0)) * 0.05;
+ } else {
+ c = texture2D(source, qt_TexCoord0);
+ }
+ gl_FragColor = qt_Opacity * c;
+}
diff --git a/examples/video/qmlvideofx/shaders/gaussianblur_v.fsh b/examples/video/qmlvideofx/shaders/gaussianblur_v.fsh
new file mode 100644
index 00000000..249052c9
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/gaussianblur_v.fsh
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+uniform float dividerValue;
+uniform float blurSize;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec4 c = vec4(0.0);
+ if (uv.x < dividerValue) {
+ c += texture2D(source, uv - vec2(0.0, 4.0*blurSize)) * 0.05;
+ c += texture2D(source, uv - vec2(0.0, 3.0*blurSize)) * 0.09;
+ c += texture2D(source, uv - vec2(0.0, 2.0*blurSize)) * 0.12;
+ c += texture2D(source, uv - vec2(0.0, 1.0*blurSize)) * 0.15;
+ c += texture2D(source, uv) * 0.16;
+ c += texture2D(source, uv + vec2(0.0, 1.0*blurSize)) * 0.15;
+ c += texture2D(source, uv + vec2(0.0, 2.0*blurSize)) * 0.12;
+ c += texture2D(source, uv + vec2(0.0, 3.0*blurSize)) * 0.09;
+ c += texture2D(source, uv + vec2(0.0, 4.0*blurSize)) * 0.05;
+ } else {
+ c = texture2D(source, qt_TexCoord0);
+ }
+ gl_FragColor = qt_Opacity * c;
+}
diff --git a/examples/video/qmlvideofx/shaders/glow.fsh b/examples/video/qmlvideofx/shaders/glow.fsh
new file mode 100644
index 00000000..8c40452d
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/glow.fsh
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html
+
+uniform float dividerValue;
+const float step_w = 0.0015625;
+const float step_h = 0.0027778;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec3 t1 = texture2D(source, vec2(uv.x - step_w, uv.y - step_h)).rgb;
+ vec3 t2 = texture2D(source, vec2(uv.x, uv.y - step_h)).rgb;
+ vec3 t3 = texture2D(source, vec2(uv.x + step_w, uv.y - step_h)).rgb;
+ vec3 t4 = texture2D(source, vec2(uv.x - step_w, uv.y)).rgb;
+ vec3 t5 = texture2D(source, uv).rgb;
+ vec3 t6 = texture2D(source, vec2(uv.x + step_w, uv.y)).rgb;
+ vec3 t7 = texture2D(source, vec2(uv.x - step_w, uv.y + step_h)).rgb;
+ vec3 t8 = texture2D(source, vec2(uv.x, uv.y + step_h)).rgb;
+ vec3 t9 = texture2D(source, vec2(uv.x + step_w, uv.y + step_h)).rgb;
+ vec3 xx = t1 + 2.0*t2 + t3 - t7 - 2.0*t8 - t9;
+ vec3 yy = t1 - t3 + 2.0*t4 - 2.0*t6 + t7 - t9;
+ vec3 rr = sqrt(xx * xx + yy * yy);
+ vec3 col = rr * 2.0 * t5;
+ if (uv.x < dividerValue)
+ gl_FragColor = qt_Opacity * vec4(col, 1.0);
+ else
+ gl_FragColor = qt_Opacity * texture2D(source, uv);
+}
diff --git a/examples/video/qmlvideofx/shaders/isolate.fsh b/examples/video/qmlvideofx/shaders/isolate.fsh
new file mode 100644
index 00000000..2b0fad56
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/isolate.fsh
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html
+
+uniform float targetHue;
+uniform float windowWidth;
+uniform float dividerValue;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void rgb2hsl(vec3 rgb, out float h, out float s, float l)
+{
+ float maxval = max(rgb.r, max(rgb.g, rgb.b));
+ float minval = min(rgb.r, min(rgb.g, rgb.b));
+ float delta = maxval - minval;
+ l = (minval + maxval) / 2.0;
+ s = 0.0;
+ if (l > 0.0 && l < 1.0)
+ s = delta / (l < 0.5 ? 2.0 * l : 2.0 - 2.0 * l);
+ h = 0.0;
+ if (delta > 0.0)
+ {
+ if (rgb.r == maxval && rgb.g != maxval)
+ h += (rgb.g - rgb.b ) / delta;
+ if (rgb.g == maxval && rgb.b != maxval)
+ h += 2.0 + (rgb.b - rgb.r) / delta;
+ if (rgb.b == maxval && rgb.r != maxval)
+ h += 4.0 + (rgb.r - rgb.g) / delta;
+ h *= 60.0;
+ }
+}
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec3 col = texture2D(source, uv).rgb;
+ float h, s, l;
+ rgb2hsl(col, h, s, l);
+ float h2 = (h > targetHue) ? h - 360.0 : h + 360.0;
+ float y = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b;
+ vec3 result;
+ if (uv.x > dividerValue || (abs(h - targetHue) < windowWidth) || (abs(h2 - targetHue) < windowWidth))
+ result = col;
+ else
+ result = vec3(y, y, y);
+ gl_FragColor = qt_Opacity * vec4(result, 1.0);
+}
diff --git a/examples/video/qmlvideofx/shaders/magnify.fsh b/examples/video/qmlvideofx/shaders/magnify.fsh
new file mode 100644
index 00000000..67414e31
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/magnify.fsh
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://www.reddit.com/r/programming/comments/losip/shader_toy/c2upn1e
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+uniform float radius;
+uniform float diffractionIndex;
+uniform float targetWidth;
+uniform float targetHeight;
+uniform float posX;
+uniform float posY;
+
+void main()
+{
+ float h = diffractionIndex * 0.5 * radius;
+ vec2 targetSize = vec2(targetWidth, targetHeight);
+ vec2 center = vec2(posX, posY);
+ vec2 xy = gl_FragCoord.xy - center.xy;
+ float r = sqrt(xy.x * xy.x + xy.y * xy.y);
+ vec2 new_xy = r < radius ? xy * (radius - h) / sqrt(radius * radius - r * r) : xy;
+ vec2 tc = (new_xy + center) / targetSize;
+ tc.y = 1.0 - tc.y;
+ gl_FragColor = qt_Opacity * texture2D(source, tc);
+}
diff --git a/examples/video/qmlvideofx/shaders/pagecurl.fsh b/examples/video/qmlvideofx/shaders/pagecurl.fsh
new file mode 100644
index 00000000..5334b869
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/pagecurl.fsh
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://rectalogic.github.com/webvfx/examples_2transition-shader-pagecurl_8html-example.html
+
+uniform float dividerValue;
+uniform float curlExtent;
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+const float minAmount = -0.16;
+const float maxAmount = 1.3;
+const float PI = 3.141592653589793;
+const float scale = 512.0;
+const float sharpness = 3.0;
+const vec4 bgColor = vec4(1.0, 1.0, 0.8, 1.0);
+
+float amount = curlExtent * (maxAmount - minAmount) + minAmount;
+float cylinderCenter = amount;
+// 360 degrees * amount
+float cylinderAngle = 2.0 * PI * amount;
+const float cylinderRadius = 1.0 / PI / 2.0;
+
+vec3 hitPoint(float hitAngle, float yc, vec3 point, mat3 rrotation)
+{
+ float hitPoint = hitAngle / (2.0 * PI);
+ point.y = hitPoint;
+ return rrotation * point;
+}
+
+vec4 antiAlias(vec4 color1, vec4 color2, float distance)
+{
+ distance *= scale;
+ if (distance < 0.0) return color2;
+ if (distance > 2.0) return color1;
+ float dd = pow(1.0 - distance / 2.0, sharpness);
+ return ((color2 - color1) * dd) + color1;
+}
+
+float distanceToEdge(vec3 point)
+{
+ float dx = abs(point.x > 0.5 ? 1.0 - point.x : point.x);
+ float dy = abs(point.y > 0.5 ? 1.0 - point.y : point.y);
+ if (point.x < 0.0) dx = -point.x;
+ if (point.x > 1.0) dx = point.x - 1.0;
+ if (point.y < 0.0) dy = -point.y;
+ if (point.y > 1.0) dy = point.y - 1.0;
+ if ((point.x < 0.0 || point.x > 1.0) && (point.y < 0.0 || point.y > 1.0)) return sqrt(dx * dx + dy * dy);
+ return min(dx, dy);
+}
+
+vec4 seeThrough(float yc, vec2 p, mat3 rotation, mat3 rrotation)
+{
+ float hitAngle = PI - (acos(yc / cylinderRadius) - cylinderAngle);
+ vec3 point = hitPoint(hitAngle, yc, rotation * vec3(p, 1.0), rrotation);
+ if (yc <= 0.0 && (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0))
+ return bgColor;
+ if (yc > 0.0)
+ return texture2D(source, p);
+ vec4 color = texture2D(source, point.xy);
+ vec4 tcolor = vec4(0.0);
+ return antiAlias(color, tcolor, distanceToEdge(point));
+}
+
+vec4 seeThroughWithShadow(float yc, vec2 p, vec3 point, mat3 rotation, mat3 rrotation)
+{
+ float shadow = distanceToEdge(point) * 30.0;
+ shadow = (1.0 - shadow) / 3.0;
+ if (shadow < 0.0)
+ shadow = 0.0;
+ else
+ shadow *= amount;
+ vec4 shadowColor = seeThrough(yc, p, rotation, rrotation);
+ shadowColor.r -= shadow;
+ shadowColor.g -= shadow;
+ shadowColor.b -= shadow;
+ return shadowColor;
+}
+
+vec4 backside(float yc, vec3 point)
+{
+ vec4 color = texture2D(source, point.xy);
+ float gray = (color.r + color.b + color.g) / 15.0;
+ gray += (8.0 / 10.0) * (pow(1.0 - abs(yc / cylinderRadius), 2.0 / 10.0) / 2.0 + (5.0 / 10.0));
+ color.rgb = vec3(gray);
+ return color;
+}
+
+void main(void)
+{
+ const float angle = 30.0 * PI / 180.0;
+ float c = cos(-angle);
+ float s = sin(-angle);
+ mat3 rotation = mat3(
+ c, s, 0,
+ -s, c, 0,
+ 0.12, 0.258, 1
+ );
+ c = cos(angle);
+ s = sin(angle);
+ mat3 rrotation = mat3(
+ c, s, 0,
+ -s, c, 0,
+ 0.15, -0.5, 1
+ );
+ vec3 point = rotation * vec3(qt_TexCoord0, 1.0);
+ float yc = point.y - cylinderCenter;
+ vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ if (yc < -cylinderRadius) {
+ // See through to background
+ color = bgColor;
+ } else if (yc > cylinderRadius) {
+ // Flat surface
+ color = texture2D(source, qt_TexCoord0);
+ } else {
+ float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI;
+ float hitAngleMod = mod(hitAngle, 2.0 * PI);
+ if ((hitAngleMod > PI && amount < 0.5) || (hitAngleMod > PI/2.0 && amount < 0.0)) {
+ color = seeThrough(yc, qt_TexCoord0, rotation, rrotation);
+ } else {
+ point = hitPoint(hitAngle, yc, point, rrotation);
+ if (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0) {
+ color = seeThroughWithShadow(yc, qt_TexCoord0, point, rotation, rrotation);
+ } else {
+ color = backside(yc, point);
+ vec4 otherColor;
+ if (yc < 0.0) {
+ float shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / 0.71);
+ shado *= pow(-yc / cylinderRadius, 3.0);
+ shado *= 0.5;
+ otherColor = vec4(0.0, 0.0, 0.0, shado);
+ } else {
+ otherColor = texture2D(source, qt_TexCoord0);
+ }
+ color = antiAlias(color, otherColor, cylinderRadius - abs(yc));
+
+ // This second antialiasing step causes the shader to fail to render, on
+ // Symbian devices (tested so far using IVE3.5). Running out of scratch
+ // memory?
+ }
+ }
+ }
+ gl_FragColor = qt_Opacity * color;
+}
diff --git a/examples/video/qmlvideofx/shaders/pixelate.fsh b/examples/video/qmlvideofx/shaders/pixelate.fsh
new file mode 100644
index 00000000..577e2582
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/pixelate.fsh
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://www.geeks3d.com/20101029/shader-library-pixelation-post-processing-effect-glsl/
+
+uniform float dividerValue;
+uniform float granularity;
+uniform float targetWidth;
+uniform float targetHeight;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec2 tc = qt_TexCoord0;
+ if (uv.x < dividerValue && granularity > 0.0) {
+ float dx = granularity / targetWidth;
+ float dy = granularity / targetHeight;
+ tc = vec2(dx*(floor(uv.x/dx) + 0.5),
+ dy*(floor(uv.y/dy) + 0.5));
+ }
+ gl_FragColor = qt_Opacity * texture2D(source, tc);
+}
diff --git a/examples/video/qmlvideofx/shaders/posterize.fsh b/examples/video/qmlvideofx/shaders/posterize.fsh
new file mode 100644
index 00000000..2769aac2
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/posterize.fsh
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/
+
+uniform float dividerValue;
+uniform float gamma;
+uniform float numColors;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec4 c = vec4(0.0);
+ if (uv.x < dividerValue) {
+ vec3 x = texture2D(source, uv).rgb;
+ x = pow(x, vec3(gamma, gamma, gamma));
+ x = x * numColors;
+ x = floor(x);
+ x = x / numColors;
+ x = pow(x, vec3(1.0/gamma));
+ c = vec4(x, 1.0);
+ } else {
+ c = texture2D(source, uv);
+ }
+ gl_FragColor = qt_Opacity * c;
+}
diff --git a/examples/video/qmlvideofx/shaders/ripple.fsh b/examples/video/qmlvideofx/shaders/ripple.fsh
new file mode 100644
index 00000000..08f57e39
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/ripple.fsh
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://labs.qt.nokia.com/2011/03/22/the-convenient-power-of-qml-scene-graph/
+
+uniform float dividerValue;
+uniform float targetWidth;
+uniform float targetHeight;
+uniform float time;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+const float PI = 3.1415926535;
+const int ITER = 7;
+const float RATE = 0.1;
+uniform float amplitude;
+uniform float n;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec2 tc = uv;
+ vec2 p = vec2(-1.0 + 2.0 * gl_FragCoord.x / targetWidth, -(-1.0 + 2.0 * gl_FragCoord.y / targetHeight));
+ float diffx = 0.0;
+ float diffy = 0.0;
+ vec4 col;
+ if (uv.x < dividerValue) {
+ for (int i=0; i= (time - shock.z))) {
+ float diff = (distance - time);
+ float powDiff = 1.0 - pow(abs(diff*shock.x), shock.y*weight);
+ float diffTime = diff * powDiff;
+ vec2 diffUV = normalize(uv - center);
+ tc += (diffUV * diffTime);
+ }
+ }
+ gl_FragColor = qt_Opacity * texture2D(source, tc);
+}
diff --git a/examples/video/qmlvideofx/shaders/sobeledgedetection1.fsh b/examples/video/qmlvideofx/shaders/sobeledgedetection1.fsh
new file mode 100644
index 00000000..d71b4e83
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/sobeledgedetection1.fsh
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on "Graphics Shaders: Theory and Practice" (http://cgeducation.org/ShadersBook/)
+
+uniform float dividerValue;
+uniform float mixLevel;
+uniform float resS;
+uniform float resT;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec4 c = vec4(0.0);
+ if (uv.x < dividerValue) {
+ vec2 st = qt_TexCoord0.st;
+ vec3 irgb = texture2D(source, st).rgb;
+ vec2 stp0 = vec2(1.0 / resS, 0.0);
+ vec2 st0p = vec2(0.0 , 1.0 / resT);
+ vec2 stpp = vec2(1.0 / resS, 1.0 / resT);
+ vec2 stpm = vec2(1.0 / resS, -1.0 / resT);
+ const vec3 W = vec3(0.2125, 0.7154, 0.0721);
+ float i00 = dot(texture2D(source, st).rgb, W);
+ float im1m1 = dot(texture2D(source, st-stpp).rgb, W);
+ float ip1p1 = dot(texture2D(source, st+stpp).rgb, W);
+ float im1p1 = dot(texture2D(source, st-stpm).rgb, W);
+ float ip1m1 = dot(texture2D(source, st+stpm).rgb, W);
+ float im10 = dot(texture2D(source, st-stp0).rgb, W);
+ float ip10 = dot(texture2D(source, st+stp0).rgb, W);
+ float i0m1 = dot(texture2D(source, st-st0p).rgb, W);
+ float i0p1 = dot(texture2D(source, st+st0p).rgb, W);
+ float h = -1.0*im1p1 - 2.0*i0p1 - 1.0*ip1p1 + 1.0*im1m1 + 2.0*i0m1 + 1.0*ip1m1;
+ float v = -1.0*im1m1 - 2.0*im10 - 1.0*im1p1 + 1.0*ip1m1 + 2.0*ip10 + 1.0*ip1p1;
+ float mag = 1.0 - length(vec2(h, v));
+ vec3 target = vec3(mag, mag, mag);
+ c = vec4(target, 1.0);
+ } else {
+ c = texture2D(source, qt_TexCoord0);
+ }
+ gl_FragColor = qt_Opacity * c;
+}
diff --git a/examples/video/qmlvideofx/shaders/sobeledgedetection2.fsh b/examples/video/qmlvideofx/shaders/sobeledgedetection2.fsh
new file mode 100644
index 00000000..bb97da10
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/sobeledgedetection2.fsh
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://rastergrid.com/blog/downloads/frei-chen-edge-detector/
+
+#version 130
+uniform sampler2D source;
+uniform float dividerValue;
+uniform float weight;
+mat3 G[2] = mat3[](
+ mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 ),
+ mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 )
+);
+uniform lowp float qt_Opacity;
+in vec2 qt_TexCoord0;
+out vec4 FragmentColor;
+void main() {
+ vec2 uv = qt_TexCoord0.xy;
+ vec4 c = vec4(0.0);
+ if (uv.x < dividerValue) {
+ mat3 intensity;
+ float conv[2];
+ vec3 sample;
+ for (int i=0; i<3; ++i) {
+ for (int j=0; j<3; ++j) {
+ sample = texelFetch(source, ivec2(gl_FragCoord) + ivec2(i-1, j-1), 0).rgb;
+ intensity[i][j] = length(sample) * weight;
+ }
+ }
+ for (int i=0; i<2; ++i) {
+ float dp3 = dot(G[i][0], intensity[0]) + dot(G[i][1], intensity[1]) + dot(G[i][2], intensity[2]);
+ conv[i] = dp3 * dp3;
+ }
+ c = vec4(0.5 * sqrt(conv[0]*conv[0] + conv[1]*conv[1]));
+ } else {
+ c = texture2D(source, qt_TexCoord0);
+ }
+ FragmentColor = qt_Opacity * c;
+}
diff --git a/examples/video/qmlvideofx/shaders/tiltshift.fsh b/examples/video/qmlvideofx/shaders/tiltshift.fsh
new file mode 100644
index 00000000..4323e7f0
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/tiltshift.fsh
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html
+
+uniform float dividerValue;
+const float step_w = 0.0015625;
+const float step_h = 0.0027778;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+vec3 blur()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ float y = uv.y < 0.4 ? uv.y : 1.0 - uv.y;
+ float dist = 8.0 - 20.0 * y;
+ vec3 acc = vec3(0.0, 0.0, 0.0);
+ for (float y=-2.0; y<=2.0; ++y) {
+ for (float x=-2.0; x<=2.0; ++x) {
+ acc += texture2D(source, vec2(uv.x + dist * x * step_w, uv.y + 0.5 * dist * y * step_h)).rgb;
+ }
+ }
+ return acc / 25.0;
+}
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec3 col;
+ if (uv.x < dividerValue && uv.y >= 0.4 && uv.y <= 0.6)
+ col = texture2D(source, uv).rgb;
+ else
+ col = blur();
+ gl_FragColor = qt_Opacity * vec4(col, 1.0);
+}
diff --git a/examples/video/qmlvideofx/shaders/toon.fsh b/examples/video/qmlvideofx/shaders/toon.fsh
new file mode 100644
index 00000000..5c895fa3
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/toon.fsh
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://www.geeks3d.com/20101029/shader-library-pixelation-post-processing-effect-glsl/
+
+uniform float dividerValue;
+uniform float threshold;
+uniform float resS;
+uniform float resT;
+uniform float magTol;
+uniform float quantize;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec4 color = vec4(1.0, 0.0, 0.0, 1.1);
+ vec2 uv = qt_TexCoord0.xy;
+ if (uv.x < dividerValue) {
+ vec2 st = qt_TexCoord0.st;
+ vec3 rgb = texture2D(source, st).rgb;
+ vec2 stp0 = vec2(1.0/resS, 0.0);
+ vec2 st0p = vec2(0.0 , 1.0/resT);
+ vec2 stpp = vec2(1.0/resS, 1.0/resT);
+ vec2 stpm = vec2(1.0/resS, -1.0/resT);
+ float i00 = dot( texture2D(source, st).rgb, vec3(0.2125,0.7154,0.0721));
+ float im1m1 = dot( texture2D(source, st-stpp).rgb, vec3(0.2125,0.7154,0.0721));
+ float ip1p1 = dot( texture2D(source, st+stpp).rgb, vec3(0.2125,0.7154,0.0721));
+ float im1p1 = dot( texture2D(source, st-stpm).rgb, vec3(0.2125,0.7154,0.0721));
+ float ip1m1 = dot( texture2D(source, st+stpm).rgb, vec3(0.2125,0.7154,0.0721));
+ float im10 = dot( texture2D(source, st-stp0).rgb, vec3(0.2125,0.7154,0.0721));
+ float ip10 = dot( texture2D(source, st+stp0).rgb, vec3(0.2125,0.7154,0.0721));
+ float i0m1 = dot( texture2D(source, st-st0p).rgb, vec3(0.2125,0.7154,0.0721));
+ float i0p1 = dot( texture2D(source, st+st0p).rgb, vec3(0.2125,0.7154,0.0721));
+ float h = -1.*im1p1 - 2.*i0p1 - 1.*ip1p1 + 1.*im1m1 + 2.*i0m1 + 1.*ip1m1;
+ float v = -1.*im1m1 - 2.*im10 - 1.*im1p1 + 1.*ip1m1 + 2.*ip10 + 1.*ip1p1;
+ float mag = sqrt(h*h + v*v);
+ if (mag > magTol) {
+ color = vec4(0.0, 0.0, 0.0, 1.0);
+ }
+ else {
+ rgb.rgb *= quantize;
+ rgb.rgb += vec3(0.5, 0.5, 0.5);
+ ivec3 irgb = ivec3(rgb.rgb);
+ rgb.rgb = vec3(irgb) / quantize;
+ color = vec4(rgb, 1.0);
+ }
+ } else {
+ color = texture2D(source, uv);
+ }
+ gl_FragColor = qt_Opacity * color;
+}
diff --git a/examples/video/qmlvideofx/shaders/vignette.fsh b/examples/video/qmlvideofx/shaders/vignette.fsh
new file mode 100644
index 00000000..6f89f192
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/vignette.fsh
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html
+
+uniform float dividerValue;
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec4 orig = texture2D(source, uv);
+ float cr = pow(0.1, 2.0);
+ float pt = pow(uv.x - 0.5, 2.0) + pow(uv.y - 0.5, 2.0);
+ float d = pt - cr;
+ float cf = 1.0;
+ if (d > 0.0)
+ cf = 1.0 - 2.0 * d;
+ vec3 col = cf * orig.rgb;
+ if (uv.x < dividerValue)
+ gl_FragColor = qt_Opacity * vec4(col, 1.0);
+ else
+ gl_FragColor = qt_Opacity * orig;
+}
diff --git a/examples/video/qmlvideofx/shaders/warhol.fsh b/examples/video/qmlvideofx/shaders/warhol.fsh
new file mode 100644
index 00000000..5bd438e5
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/warhol.fsh
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html
+
+uniform float dividerValue;
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec4 orig = texture2D(source, uv);
+ vec3 col = orig.rgb;
+ float y = 0.3 *col.r + 0.59 * col.g + 0.11 * col.b;
+ y = y < 0.3 ? 0.0 : (y < 0.6 ? 0.5 : 1.0);
+ if (y == 0.5)
+ col = vec3(0.8, 0.0, 0.0);
+ else if (y == 1.0)
+ col = vec3(0.9, 0.9, 0.0);
+ else
+ col = vec3(0.0, 0.0, 0.0);
+ if (uv.x < dividerValue)
+ gl_FragColor = qt_Opacity * vec4(col, 1.0);
+ else
+ gl_FragColor = qt_Opacity * orig;
+}
diff --git a/examples/video/qmlvideofx/shaders/wobble.fsh b/examples/video/qmlvideofx/shaders/wobble.fsh
new file mode 100644
index 00000000..5a8771d2
--- /dev/null
+++ b/examples/video/qmlvideofx/shaders/wobble.fsh
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on http://labs.qt.nokia.com/2011/03/22/the-convenient-power-of-qml-scene-graph/
+
+uniform float amplitude;
+uniform float dividerValue;
+uniform float frequency;
+uniform float time;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+varying vec2 qt_TexCoord0;
+
+void main()
+{
+ vec2 uv = qt_TexCoord0.xy;
+ vec2 tc = qt_TexCoord0;
+ if (uv.x < dividerValue) {
+ vec2 p = sin(time + frequency * qt_TexCoord0);
+ tc += amplitude * vec2(p.y, -p.x);
+ }
+ gl_FragColor = qt_Opacity * texture2D(source, tc);
+}
diff --git a/examples/video/qmlvideofx/trace.h b/examples/video/qmlvideofx/trace.h
new file mode 100644
index 00000000..1a695bd2
--- /dev/null
+++ b/examples/video/qmlvideofx/trace.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TRACE_H
+#define TRACE_H
+
+#include
+
+#define ENABLE_TRACE
+//#define VERBOSE_TRACE
+
+namespace Trace {
+
+class NullDebug
+{
+public:
+ template
+ NullDebug& operator<<(const T&) { return *this; }
+};
+
+inline NullDebug nullDebug() { return NullDebug(); }
+
+template
+struct PtrWrapper
+{
+ PtrWrapper(const T *ptr) : m_ptr(ptr) { }
+ const T *const m_ptr;
+};
+
+} // namespace Trace
+
+template
+inline QDebug& operator<<(QDebug &debug, const Trace::PtrWrapper &wrapper)
+{
+ debug.nospace() << "[" << (void*)wrapper.m_ptr << "]";
+ return debug.space();
+}
+
+template
+inline const void *qtVoidPtr(const T *ptr)
+{ return static_cast(ptr); }
+
+#define qtThisPtr() qtVoidPtr(this)
+
+#ifdef ENABLE_TRACE
+ inline QDebug qtTrace() { return qDebug() << "[qmlvideofx]"; }
+# ifdef VERBOSE_TRACE
+ inline QDebug qtVerboseTrace() { return qtTrace(); }
+# else
+ inline Trace::NullDebug qtVerboseTrace() { return Trace::nullDebug(); }
+# endif
+#else
+ inline Trace::NullDebug qtTrace() { return Trace::nullDebug(); }
+ inline Trace::NullDebug qtVerboseTrace() { return Trace::nullDebug(); }
+#endif
+
+#endif // TRACE_H
+
diff --git a/examples/video/snippets/frequencymonitor/frequencymonitor.cpp b/examples/video/snippets/frequencymonitor/frequencymonitor.cpp
new file mode 100644
index 00000000..0166ea46
--- /dev/null
+++ b/examples/video/snippets/frequencymonitor/frequencymonitor.cpp
@@ -0,0 +1,250 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "frequencymonitor.h"
+#include
+#include
+#include
+#include
+#include
+
+//#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, SIGNAL(timeout()),
+ this, SLOT(calculateAverageFrequency()));
+ if (DefaultSamplingInterval)
+ m_averageTimer->start(DefaultSamplingInterval);
+ m_averageElapsed.start();
+ connect(m_traceTimer, SIGNAL(timeout()),
+ q_ptr, SLOT(trace()));
+ if (DefaultTraceInterval)
+ m_traceTimer->start(DefaultTraceInterval);
+ m_stalledTimer->setSingleShot(true);
+ connect(m_stalledTimer, SIGNAL(timeout()),
+ this, SLOT(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);
+ q_ptr->emit instantaneousFrequencyChanged(m_instantaneousFrequency);
+ q_ptr->emit frequencyChanged();
+}
+
+void FrequencyMonitorPrivate::calculateAverageFrequency()
+{
+ const qint64 ms = m_averageElapsed.restart();
+ m_averageFrequency = qreal(m_count * 1000) / ms;
+ q_ptr->emit averageFrequencyChanged(m_averageFrequency);
+ q_ptr->emit frequencyChanged();
+ m_count = 0;
+}
+
+void FrequencyMonitorPrivate::stalled()
+{
+ if (m_instantaneousFrequency) {
+ qtVerboseTrace() << "FrequencyMonitor::stalled";
+ m_instantaneousFrequency = 0;
+ q_ptr->emit instantaneousFrequencyChanged(m_instantaneousFrequency);
+ q_ptr->emit frequencyChanged();
+ }
+}
+
+FrequencyMonitor::FrequencyMonitor(QObject *parent)
+: QObject(parent)
+, d_ptr(0)
+{
+ d_ptr = new FrequencyMonitorPrivate(this);
+ qtTrace() << "FrequencyMonitor::FrequencyMonitor";
+}
+
+FrequencyMonitor::~FrequencyMonitor()
+{
+
+}
+
+const 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 = QString::fromAscii("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"
diff --git a/examples/video/snippets/frequencymonitor/frequencymonitor.h b/examples/video/snippets/frequencymonitor/frequencymonitor.h
new file mode 100644
index 00000000..a949e55d
--- /dev/null
+++ b/examples/video/snippets/frequencymonitor/frequencymonitor.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FREQUENCYMONITOR_H
+#define FREQUENCYMONITOR_H
+
+#include
+
+class 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 = 0);
+ ~FrequencyMonitor();
+
+ static void qmlRegisterType();
+
+ const 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/video/snippets/frequencymonitor/frequencymonitor.pri b/examples/video/snippets/frequencymonitor/frequencymonitor.pri
new file mode 100644
index 00000000..f9dcb341
--- /dev/null
+++ b/examples/video/snippets/frequencymonitor/frequencymonitor.pri
@@ -0,0 +1,6 @@
+HEADERS += $$PWD/frequencymonitor.h
+SOURCES += $$PWD/frequencymonitor.cpp
+INCLUDEPATH += $$PWD
+DEFINES += FREQUENCYMONITOR_SUPPORT
+message("frequencymonitor.pri loaded")
+
diff --git a/examples/video/snippets/frequencymonitor/frequencymonitordeclarative.cpp b/examples/video/snippets/frequencymonitor/frequencymonitordeclarative.cpp
new file mode 100644
index 00000000..595dd083
--- /dev/null
+++ b/examples/video/snippets/frequencymonitor/frequencymonitordeclarative.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "frequencymonitor.h"
+#include
+
+void FrequencyMonitor::qmlRegisterType()
+{
+ ::qmlRegisterType("FrequencyMonitor", 1, 0, "FrequencyMonitor");
+}
diff --git a/examples/video/snippets/frequencymonitor/frequencymonitordeclarative.pri b/examples/video/snippets/frequencymonitor/frequencymonitordeclarative.pri
new file mode 100644
index 00000000..a6868385
--- /dev/null
+++ b/examples/video/snippets/frequencymonitor/frequencymonitordeclarative.pri
@@ -0,0 +1,17 @@
+include($$PWD/frequencymonitor.pri)
+QT += declarative
+SOURCES += $$PWD/frequencymonitordeclarative.cpp
+
+defineTest(frequencyItemAddDeployment) {
+ symbian: frequencyitem_folder.source = $$PWD/$$SNIPPETS_PATH/frequencymonitor/qml/frequencymonitor
+ else: frequencyitem_folder.source = $$SNIPPETS_PATH/frequencymonitor/qml/frequencymonitor
+ frequencyitem_folder.target = qml
+ DEPLOYMENTFOLDERS += frequencyitem_folder
+
+ export(frequencyitem_folder.source)
+ export(frequencyitem_folder.target)
+ export(DEPLOYMENTFOLDERS)
+}
+
+message("frequencymonitordeclarative.pri loaded")
+
diff --git a/examples/video/snippets/frequencymonitor/qml/frequencymonitor/FrequencyItem.qml b/examples/video/snippets/frequencymonitor/qml/frequencymonitor/FrequencyItem.qml
new file mode 100644
index 00000000..5108113c
--- /dev/null
+++ b/examples/video/snippets/frequencymonitor/qml/frequencymonitor/FrequencyItem.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+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: 3.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()
+ instantaneousFrequencyText.text = monitor.instantaneousFrequency.toFixed(2)
+ averageFrequencyText.text = monitor.averageFrequency.toFixed(2)
+ }
+ }
+
+ Text {
+ id: instantaneousFrequencyText
+ anchors {
+ right: parent.right
+ top: parent.top
+ margins: 10
+ }
+ color: root.textColor
+ font.pixelSize: root.textSize
+ }
+
+ Text {
+ id: averageFrequencyText
+ anchors {
+ right: parent.right
+ bottom: parent.bottom
+ margins: 10
+ }
+ color: root.textColor
+ font.pixelSize: root.textSize
+ }
+}
diff --git a/examples/video/snippets/performancemonitor/performancemonitor.cpp b/examples/video/snippets/performancemonitor/performancemonitor.cpp
new file mode 100644
index 00000000..73ebe291
--- /dev/null
+++ b/examples/video/snippets/performancemonitor/performancemonitor.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "performancemonitor.h"
+#include
+
+namespace PerformanceMonitor {
+
+ bool parseArgument(const QString &arg, State &state)
+ {
+ bool result = false;
+ if ("-log-perf" == arg) {
+ state.logging = true;
+ state.valid = true;
+ result = true;
+ } else if ("-no-log-perf" == arg) {
+ state.logging = false;
+ state.valid = true;
+ result = true;
+ } else if ("-show-perf" == arg) {
+ state.visible = true;
+ state.valid = true;
+ result = true;
+ } else if ("-hide-perf" == arg) {
+ state.visible = false;
+ state.valid = true;
+ result = true;
+ }
+ return result;
+ }
+
+}
diff --git a/examples/video/snippets/performancemonitor/performancemonitor.h b/examples/video/snippets/performancemonitor/performancemonitor.h
new file mode 100644
index 00000000..59e90550
--- /dev/null
+++ b/examples/video/snippets/performancemonitor/performancemonitor.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PERFORMANCEMONITOR_H
+#define PERFORMANCEMONITOR_H
+
+class QString;
+
+namespace PerformanceMonitor {
+ struct State {
+ bool valid;
+ bool logging;
+ bool visible;
+
+ 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 QString &arg, State &state);
+}
+
+#endif // PERFORMANCEMONITOR_H
+
diff --git a/examples/video/snippets/performancemonitor/performancemonitor.pri b/examples/video/snippets/performancemonitor/performancemonitor.pri
new file mode 100644
index 00000000..6622488b
--- /dev/null
+++ b/examples/video/snippets/performancemonitor/performancemonitor.pri
@@ -0,0 +1,7 @@
+INCLUDEPATH += $$PWD
+HEADERS += $$PWD/performancemonitor.h
+SOURCES += $$PWD/performancemonitor.cpp
+DEFINES += PERFORMANCEMONITOR_SUPPORT
+
+message("performancemonitor.pri loaded")
+
diff --git a/examples/video/snippets/performancemonitor/performancemonitordeclarative.cpp b/examples/video/snippets/performancemonitor/performancemonitordeclarative.cpp
new file mode 100644
index 00000000..85996f3a
--- /dev/null
+++ b/examples/video/snippets/performancemonitor/performancemonitordeclarative.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "frequencymonitor.h"
+#include "performancemonitor.h"
+
+namespace PerformanceMonitor {
+
+ void qmlRegisterTypes()
+ {
+ FrequencyMonitor::qmlRegisterType();
+ }
+}
diff --git a/examples/video/snippets/performancemonitor/performancemonitordeclarative.h b/examples/video/snippets/performancemonitor/performancemonitordeclarative.h
new file mode 100644
index 00000000..dccdd5eb
--- /dev/null
+++ b/examples/video/snippets/performancemonitor/performancemonitordeclarative.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PERFORMANCEMONITORDECLARATIVE_H
+#define PERFORMANCEMONITORDECLARATIVE_H
+
+#include "performancemonitor.h"
+
+namespace PerformanceMonitor {
+ void qmlRegisterTypes();
+}
+
+#endif // PERFORMANCEMONITORDECLARATIVE_H
diff --git a/examples/video/snippets/performancemonitor/performancemonitordeclarative.pri b/examples/video/snippets/performancemonitor/performancemonitordeclarative.pri
new file mode 100644
index 00000000..d8f2f8f3
--- /dev/null
+++ b/examples/video/snippets/performancemonitor/performancemonitordeclarative.pri
@@ -0,0 +1,22 @@
+include($$PWD/../frequencymonitor/frequencymonitordeclarative.pri)
+include($$PWD/performancemonitor.pri)
+
+HEADERS += $$PWD/performancemonitordeclarative.h
+SOURCES += $$PWD/performancemonitordeclarative.cpp
+
+PERFORMANCE_ROOT = $$PWD
+
+defineTest(performanceItemAddDeployment) {
+ frequencyItemAddDeployment()
+
+ symbian: performanceitem_folder.source = $$PWD/$$SNIPPETS_PATH/performancemonitor/qml/performancemonitor
+ else: performanceitem_folder.source = $$SNIPPETS_PATH/performancemonitor/qml/performancemonitor
+ performanceitem_folder.target = qml
+ DEPLOYMENTFOLDERS += performanceitem_folder
+
+ export(performanceitem_folder.source)
+ export(performanceitem_folder.target)
+ export(DEPLOYMENTFOLDERS)
+}
+
+message("performancemonitordeclarative.pri loaded")
diff --git a/examples/video/snippets/performancemonitor/qml/performancemonitor/PerformanceItem.qml b/examples/video/snippets/performancemonitor/qml/performancemonitor/PerformanceItem.qml
new file mode 100644
index 00000000..acc92cee
--- /dev/null
+++ b/examples/video/snippets/performancemonitor/qml/performancemonitor/PerformanceItem.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ property bool logging: true
+ property bool displayed: true
+ property bool videoActive
+ property int samplingInterval: 500
+ property color textColor: "yellow"
+ property int textSize: 28
+ property int margins: 5
+
+ color: "transparent"
+
+ // This should ensure that the monitor is on top of all other content
+ z: 999
+
+ Loader {
+ id: videoFrameRateItemLoader
+ function init() {
+ source = "../frequencymonitor/FrequencyItem.qml"
+ item.label = "videoFrameRate"
+ item.parent = root
+ item.anchors.left = root.left
+ item.anchors.top = root.top
+ item.anchors.margins = root.margins
+ item.logging = root.logging
+ item.displayed = root.displayed
+ videoFrameRateActiveConnections.target = item
+ }
+
+ Connections {
+ id: videoFrameRateActiveConnections
+ ignoreUnknownSignals: true
+ onActiveChanged: root.videoActive = videoFrameRateActiveConnections.target.active
+ }
+ }
+
+ Loader {
+ id: qmlFrameRateItemLoader
+ function init() {
+ source = "../frequencymonitor/FrequencyItem.qml"
+ item.label = "qmlFrameRate"
+ item.parent = root
+ item.anchors.left = root.left
+ item.anchors.bottom = root.bottom
+ item.anchors.margins = root.margins
+ item.logging = root.logging
+ item.displayed = root.displayed
+ }
+ }
+
+ function init() {
+ videoFrameRateItemLoader.init()
+ qmlFrameRateItemLoader.init()
+ }
+
+ function videoFramePainted() {
+ videoFrameRateItemLoader.item.notify()
+ }
+
+ function qmlFramePainted() {
+ qmlFrameRateItemLoader.item.notify()
+ }
+
+ onVideoActiveChanged: {
+ videoFrameRateItemLoader.item.active = root.videoActive
+ }
+}
diff --git a/examples/video/video.pro b/examples/video/video.pro
new file mode 100644
index 00000000..4f911b2b
--- /dev/null
+++ b/examples/video/video.pro
@@ -0,0 +1,15 @@
+TEMPLATE = subdirs
+
+SUBDIRS += qmlvideo
+
+# qmlvideofx requires QtOpenGL and ShaderEffectItem (added in Qt 4.7.4)
+contains(QT_CONFIG, opengl) {
+ lessThan(QT_MAJOR_VERSION, 5) {
+ !lessThan(QT_MAJOR_VERSION, 4) {
+ SUBDIRS += qmlvideofx
+ }
+ } else {
+ SUBDIRS += qmlvideofx
+ }
+}
+