Add qmlvideo and qmlvideofx examples
Based on code imported from master branch of QtMobility repo, ported to Qt Quick 2. Task-number: QTBUG-23118 Change-Id: Ifd297de0e595c675ff1a8e3218d91b03629295b9 Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
147
doc/src/examples/qmlvideo.qdoc
Normal file
@@ -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()));
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
221
doc/src/examples/qmlvideofx.qdoc
Normal file
@@ -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()));
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
43
doc/src/examples/video-qml-paint-rate.qdocinc
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
BIN
doc/src/images/qmlcamera-menu.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
doc/src/images/qmlvideo-menu.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
doc/src/images/qmlvideo-overlay.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
doc/src/images/qmlvideofx-camera-glow.png
Normal file
|
After Width: | Height: | Size: 245 KiB |
BIN
doc/src/images/qmlvideofx-camera-magnify.png
Normal file
|
After Width: | Height: | Size: 200 KiB |
BIN
doc/src/images/qmlvideofx-effects-menu.png
Normal file
|
After Width: | Height: | Size: 167 KiB |
BIN
doc/src/images/qmlvideofx-source-menu.png
Normal file
|
After Width: | Height: | Size: 251 KiB |
BIN
doc/src/images/qmlvideofx-video-edgedetection.png
Normal file
|
After Width: | Height: | Size: 273 KiB |
BIN
doc/src/images/qmlvideofx-video-pagecurl.png
Normal file
|
After Width: | Height: | Size: 215 KiB |
BIN
doc/src/images/video-graphics-memory.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
doc/src/images/video-qml-paint-rate.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
@@ -334,6 +334,30 @@ write a camera application in C++.
|
|||||||
The \l {QML Camera Example} demonstrates still image capture and controls
|
The \l {QML Camera Example} demonstrates still image capture and controls
|
||||||
using the QML plugin. Video recording is not currently available.
|
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
|
\section1 Reference documentation
|
||||||
|
|
||||||
|
|||||||
BIN
examples/video/qmlvideo/images/close.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
examples/video/qmlvideo/images/folder.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
examples/video/qmlvideo/images/leaves.jpg
Normal file
|
After Width: | Height: | Size: 251 KiB |
35
examples/video/qmlvideo/images/progress_handle.svg
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="10px"
|
||||||
|
height="46px"
|
||||||
|
version="1.1">
|
||||||
|
<g>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="MyGradient1" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||||
|
<stop offset="0%" stop-color="lightcyan" />
|
||||||
|
<stop offset="100%" stop-color="dodgerblue" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect
|
||||||
|
stroke="white"
|
||||||
|
fill="url(#MyGradient1)"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
width="8"
|
||||||
|
height="44"
|
||||||
|
x="1"
|
||||||
|
y="1"
|
||||||
|
rx="4"
|
||||||
|
ry="4"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
35
examples/video/qmlvideo/images/progress_handle_pressed.svg
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="10px"
|
||||||
|
height="46px"
|
||||||
|
version="1.1">
|
||||||
|
<g>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="MyGradient1" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||||
|
<stop offset="0%" stop-color="skyblue" />
|
||||||
|
<stop offset="100%" stop-color="darkblue" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect
|
||||||
|
stroke="white"
|
||||||
|
fill="url(#MyGradient1)"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
width="8"
|
||||||
|
height="44"
|
||||||
|
x="1"
|
||||||
|
y="1"
|
||||||
|
rx="4"
|
||||||
|
ry="4"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
BIN
examples/video/qmlvideo/images/titlebar.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
5
examples/video/qmlvideo/images/titlebar.sci
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
border.left: 10
|
||||||
|
border.top: 12
|
||||||
|
border.bottom: 12
|
||||||
|
border.right: 10
|
||||||
|
source: titlebar.png
|
||||||
BIN
examples/video/qmlvideo/images/up.png
Normal file
|
After Width: | Height: | Size: 662 B |
133
examples/video/qmlvideo/main.cpp
Normal file
@@ -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 <QtCore/QString>
|
||||||
|
#include <QtCore/QStringList>
|
||||||
|
#include <QtGui/QGuiApplication>
|
||||||
|
#include <QtQuick/QQuickItem>
|
||||||
|
#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; i<args.count(); ++i) {
|
||||||
|
const QString &arg = args.at(i);
|
||||||
|
if (arg.startsWith('-')) {
|
||||||
|
if ("-volume" == arg) {
|
||||||
|
if (i+1 < args.count())
|
||||||
|
volume = 0.01 * args.at(++i).toInt();
|
||||||
|
else
|
||||||
|
qtTrace() << "Option \"-volume\" takes a value";
|
||||||
|
}
|
||||||
|
#ifdef PERFORMANCEMONITOR_SUPPORT
|
||||||
|
else if (PerformanceMonitor::parseArgument(arg, performanceMonitorState)) {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
else if ("-url" == arg) {
|
||||||
|
sourceIsUrl = true;
|
||||||
|
} else {
|
||||||
|
qtTrace() << "Option" << arg << "ignored";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (source1.isEmpty())
|
||||||
|
source1 = arg;
|
||||||
|
else if (source2.isEmpty())
|
||||||
|
source2 = arg;
|
||||||
|
else
|
||||||
|
qtTrace() << "Argument" << arg << "ignored";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QUrl url1, url2;
|
||||||
|
if (sourceIsUrl) {
|
||||||
|
url1 = source1;
|
||||||
|
url2 = source2;
|
||||||
|
} else {
|
||||||
|
if (!source1.isEmpty())
|
||||||
|
url1 = QUrl::fromLocalFile(source1);
|
||||||
|
if (!source2.isEmpty())
|
||||||
|
url2 = QUrl::fromLocalFile(source2);
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlApplicationViewer viewer;
|
||||||
|
|
||||||
|
viewer.setOrientation(Qt::LandscapeOrientation);
|
||||||
|
viewer.setMainQmlFile(QLatin1String("qml/qmlvideo/main.qml"));
|
||||||
|
QQuickItem *rootObject = viewer.rootObject();
|
||||||
|
rootObject->setProperty("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();
|
||||||
|
}
|
||||||
|
|
||||||
80
examples/video/qmlvideo/qml/qmlvideo/Button.qml
Normal file
@@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
47
examples/video/qmlvideo/qml/qmlvideo/CameraBasic.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/CameraDrag.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
69
examples/video/qmlvideo/qml/qmlvideo/CameraDummy.qml
Normal file
@@ -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() { }
|
||||||
|
}
|
||||||
47
examples/video/qmlvideo/qml/qmlvideo/CameraFullScreen.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
|
|
||||||
68
examples/video/qmlvideo/qml/qmlvideo/CameraItem.qml
Normal file
@@ -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() }
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/CameraMove.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/CameraOverlay.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/CameraResize.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/CameraRotate.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/CameraSpin.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
164
examples/video/qmlvideo/qml/qmlvideo/Content.qml
Normal file
@@ -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 }
|
||||||
|
}
|
||||||
49
examples/video/qmlvideo/qml/qmlvideo/DisableScreenSaver.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
107
examples/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml
Normal file
@@ -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 = "<b>Error</b><br><br>" + msg
|
||||||
|
root.enabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
354
examples/video/qmlvideo/qml/qmlvideo/FileBrowser.qml
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
71
examples/video/qmlvideo/qml/qmlvideo/Scene.qml
Normal file
@@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
87
examples/video/qmlvideo/qml/qmlvideo/SceneBasic.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
72
examples/video/qmlvideo/qml/qmlvideo/SceneDrag.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
104
examples/video/qmlvideo/qml/qmlvideo/SceneFullScreen.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
|
|
||||||
109
examples/video/qmlvideo/qml/qmlvideo/SceneFullScreenInverted.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
|
|
||||||
87
examples/video/qmlvideo/qml/qmlvideo/SceneMove.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
204
examples/video/qmlvideo/qml/qmlvideo/SceneMulti.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
121
examples/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
79
examples/video/qmlvideo/qml/qmlvideo/SceneResize.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
100
examples/video/qmlvideo/qml/qmlvideo/SceneRotate.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
113
examples/video/qmlvideo/qml/qmlvideo/SceneSelectionPanel.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
72
examples/video/qmlvideo/qml/qmlvideo/SceneSpin.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
143
examples/video/qmlvideo/qml/qmlvideo/SeekControl.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/VideoBasic.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/VideoDrag.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
74
examples/video/qmlvideo/qml/qmlvideo/VideoDummy.qml
Normal file
@@ -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() { }
|
||||||
|
}
|
||||||
86
examples/video/qmlvideo/qml/qmlvideo/VideoFillMode.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
47
examples/video/qmlvideo/qml/qmlvideo/VideoFullScreen.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
|
|
||||||
76
examples/video/qmlvideo/qml/qmlvideo/VideoItem.qml
Normal file
@@ -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() }
|
||||||
|
}
|
||||||
122
examples/video/qmlvideo/qml/qmlvideo/VideoMetadata.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/VideoMove.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/VideoOverlay.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
106
examples/video/qmlvideo/qml/qmlvideo/VideoPlaybackRate.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/VideoResize.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/VideoRotate.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
72
examples/video/qmlvideo/qml/qmlvideo/VideoSeek.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
46
examples/video/qmlvideo/qml/qmlvideo/VideoSpin.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
234
examples/video/qmlvideo/qml/qmlvideo/main.qml
Normal file
@@ -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 = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 <QtCore/QDir>
|
||||||
|
#include <QtCore/QFileInfo>
|
||||||
|
#include <QtDeclarative/QDeclarativeComponent>
|
||||||
|
#include <QtDeclarative/QDeclarativeEngine>
|
||||||
|
#include <QtDeclarative/QDeclarativeContext>
|
||||||
|
#include <QtGui/QGuiApplication>
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
@@ -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 <QtQuick/QQuickView>
|
||||||
|
|
||||||
|
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
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
|
|
||||||
BIN
examples/video/qmlvideo/qmlvideo.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
21
examples/video/qmlvideo/qmlvideo.pro
Normal file
@@ -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()
|
||||||
12
examples/video/qmlvideo/qmlvideo.qrc
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/images">
|
||||||
|
<file alias="leaves.jpg">images/leaves.jpg</file>
|
||||||
|
<file alias="close.png">images/close.png</file>
|
||||||
|
<file alias="folder.png">images/folder.png</file>
|
||||||
|
<file alias="titlebar.png">images/titlebar.png</file>
|
||||||
|
<file alias="titlebar.sci">images/titlebar.sci</file>
|
||||||
|
<file alias="up.png">images/up.png</file>
|
||||||
|
<file alias="progress_handle.svg">images/progress_handle.svg</file>
|
||||||
|
<file alias="progress_handle_pressed.svg">images/progress_handle_pressed.svg</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
93
examples/video/qmlvideo/qmlvideo.svg
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
height="44px"
|
||||||
|
version="1.1"
|
||||||
|
viewBox="0 0 44 44"
|
||||||
|
width="44px"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
id="svg2"
|
||||||
|
inkscape:version="0.47 r22583"
|
||||||
|
sodipodi:docname="qt.svg">
|
||||||
|
<metadata
|
||||||
|
id="metadata18">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs16">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 22 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="44 : 22 : 1"
|
||||||
|
inkscape:persp3d-origin="22 : 14.666667 : 1"
|
||||||
|
id="perspective2836" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1020"
|
||||||
|
id="namedview14"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="21.454545"
|
||||||
|
inkscape:cx="49.412871"
|
||||||
|
inkscape:cy="21.894358"
|
||||||
|
inkscape:window-x="-4"
|
||||||
|
inkscape:window-y="-4"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="g3" />
|
||||||
|
<g
|
||||||
|
transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
|
||||||
|
id="g3">
|
||||||
|
<path
|
||||||
|
d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
|
||||||
|
style="fill:#006225"
|
||||||
|
id="path5"
|
||||||
|
sodipodi:nodetypes="cccccccc" />
|
||||||
|
<path
|
||||||
|
d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
|
||||||
|
style="fill:#80c342"
|
||||||
|
id="path7" />
|
||||||
|
<path
|
||||||
|
d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
|
||||||
|
style="fill:#006225"
|
||||||
|
id="path11" />
|
||||||
|
<path
|
||||||
|
d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
|
||||||
|
style="fill:#006225"
|
||||||
|
id="path13" />
|
||||||
|
<path
|
||||||
|
id="path17"
|
||||||
|
style="fill:#ffffff"
|
||||||
|
d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
|
||||||
|
<path
|
||||||
|
d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
|
||||||
|
style="fill:#006225"
|
||||||
|
id="path19" />
|
||||||
|
<path
|
||||||
|
id="path21"
|
||||||
|
style="fill:#006225"
|
||||||
|
d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 6.4 KiB |
95
examples/video/qmlvideo/trace.h
Normal file
@@ -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 <QtCore/QDebug>
|
||||||
|
|
||||||
|
#define ENABLE_TRACE
|
||||||
|
//#define VERBOSE_TRACE
|
||||||
|
|
||||||
|
namespace Trace {
|
||||||
|
|
||||||
|
class NullDebug
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
template <typename T>
|
||||||
|
NullDebug& operator<<(const T&) { return *this; }
|
||||||
|
};
|
||||||
|
|
||||||
|
inline NullDebug nullDebug() { return NullDebug(); }
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct PtrWrapper
|
||||||
|
{
|
||||||
|
PtrWrapper(const T *ptr) : m_ptr(ptr) { }
|
||||||
|
const T *const m_ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Trace
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
inline QDebug& operator<<(QDebug &debug, const Trace::PtrWrapper<T> &wrapper)
|
||||||
|
{
|
||||||
|
debug.nospace() << "[" << (void*)wrapper.m_ptr << "]";
|
||||||
|
return debug.space();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
inline const void *qtVoidPtr(const T *ptr)
|
||||||
|
{ return static_cast<const void *>(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
|
||||||
58
examples/video/qmlvideofx/filereader.cpp
Normal file
@@ -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 <QtCore/QFile>
|
||||||
|
#include <QtCore/QTextStream>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
50
examples/video/qmlvideofx/filereader.h
Normal file
@@ -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 <QtCore/QObject>
|
||||||
|
|
||||||
|
class FileReader : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
Q_INVOKABLE QString readFile(const QString &fileName);
|
||||||
|
};
|
||||||
|
|
||||||
BIN
examples/video/qmlvideofx/images/close.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
examples/video/qmlvideofx/images/folder.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
examples/video/qmlvideofx/images/qt-logo.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
examples/video/qmlvideofx/images/titlebar.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
5
examples/video/qmlvideofx/images/titlebar.sci
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
border.left: 10
|
||||||
|
border.top: 12
|
||||||
|
border.bottom: 12
|
||||||
|
border.right: 10
|
||||||
|
source: titlebar.png
|
||||||
BIN
examples/video/qmlvideofx/images/up.png
Normal file
|
After Width: | Height: | Size: 662 B |
134
examples/video/qmlvideofx/main.cpp
Normal file
@@ -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 <QtCore/QStringList>
|
||||||
|
#include <QtDeclarative/QDeclarativeContext>
|
||||||
|
#include <QtGui/QGuiApplication>
|
||||||
|
#include <QtQuick/QQuickItem>
|
||||||
|
#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; i<args.count(); ++i) {
|
||||||
|
const QString &arg = args.at(i);
|
||||||
|
if (arg.startsWith('-')) {
|
||||||
|
if ("-volume" == arg) {
|
||||||
|
if (i+1 < args.count())
|
||||||
|
volume = 0.01 * args.at(++i).toInt();
|
||||||
|
else
|
||||||
|
qtTrace() << "Option \"-volume\" takes a value";
|
||||||
|
}
|
||||||
|
#ifdef PERFORMANCEMONITOR_SUPPORT
|
||||||
|
else if (PerformanceMonitor::parseArgument(arg, performanceMonitorState)) {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
else {
|
||||||
|
qtTrace() << "Option" << arg << "ignored";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (fileName.isEmpty())
|
||||||
|
fileName = QUrl::fromLocalFile(arg);
|
||||||
|
else
|
||||||
|
qtTrace() << "Argument" << arg << "ignored";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlApplicationViewer viewer;
|
||||||
|
|
||||||
|
viewer.setOrientation(Qt::LandscapeOrientation);
|
||||||
|
viewer.setMainQmlFile(QLatin1String("qml/qmlvideofx/") + MainQmlFile);
|
||||||
|
QQuickItem *rootObject = viewer.rootObject();
|
||||||
|
rootObject->setProperty("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();
|
||||||
|
}
|
||||||
|
|
||||||
80
examples/video/qmlvideofx/qml/qmlvideofx/Button.qml
Normal file
@@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
153
examples/video/qmlvideofx/qml/qmlvideofx/Content.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
51
examples/video/qmlvideofx/qml/qmlvideofx/ContentCamera.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
46
examples/video/qmlvideofx/qml/qmlvideofx/ContentImage.qml
Normal file
@@ -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
|
||||||
|
}
|
||||||
58
examples/video/qmlvideofx/qml/qmlvideofx/ContentVideo.qml
Normal file
@@ -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() }
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
94
examples/video/qmlvideofx/qml/qmlvideofx/Divider.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
74
examples/video/qmlvideofx/qml/qmlvideofx/Effect.qml
Normal file
@@ -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)
|
||||||
|
}
|
||||||
57
examples/video/qmlvideofx/qml/qmlvideofx/EffectBillboard.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
52
examples/video/qmlvideofx/qml/qmlvideofx/EffectEmboss.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
52
examples/video/qmlvideofx/qml/qmlvideofx/EffectGlow.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
57
examples/video/qmlvideofx/qml/qmlvideofx/EffectIsolate.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||