Ubuntu Pastebin

Paste from greyback at Tue, 7 Jul 2015 14:59:19 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import QtQuick 2.0
import QtMultimedia 5.0
Rectangle {
    width: 800
    height: 600
    color: "black"
    MediaPlayer {
        id: player
        source: "file:///home/gerry/dev/projects/ubuntu-ui-toolkit/sdk-research/libdui/demos/widgetsgallery/data/media/trailer-bigbuckbunny-wg.mp4"
        autoPlay: true
    }
    VideoOutput {
        id: videoOutput
        source: player
        anchors.fill: parent
        layer.enabled: true
    }

    ShaderEffect {
        width: 200
        height: 300
        property variant src: videoOutput
                    vertexShader: "
                uniform highp mat4 qt_Matrix;
                attribute highp vec4 qt_Vertex;
                attribute highp vec2 qt_MultiTexCoord0;
                varying highp vec2 coord;
                void main() {
                    coord = qt_MultiTexCoord0;
                    gl_Position = qt_Matrix * qt_Vertex;
                }"
        fragmentShader: "
                varying highp vec2 coord;
                uniform sampler2D src;
                uniform lowp float qt_Opacity;
                void main() {
                    gl_FragColor = texture2D(src, coord);
                }"
    }
}
Download as text