QGCVideoBackground.qml 1.11 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
Gus Grubba's avatar
Gus Grubba committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


/**
 * @file
 *   @brief QGC Video Background
 *   @author Gus Grubba <mavlink@grubba.com>
 */

import QtQuick 2.4
import QtQuick.Controls 1.3
import QGroundControl.QgcQtGStreamer 1.0

VideoItem {
    id: videoBackground
    property var display
    property var receiver
dogmaphobic's avatar
dogmaphobic committed
25
    property var runVideo:  false
26
    surface: display
dogmaphobic's avatar
dogmaphobic committed
27
    onRunVideoChanged: {
28
        if(videoBackground.receiver && videoBackground.display) {
dogmaphobic's avatar
dogmaphobic committed
29
            if(videoBackground.runVideo) {
30 31 32 33
                videoBackground.receiver.start();
            } else {
                videoBackground.receiver.stop();
            }
Gus Grubba's avatar
Gus Grubba committed
34 35 36
        }
    }
    Component.onCompleted: {
dogmaphobic's avatar
dogmaphobic committed
37
        if(videoBackground.runVideo && videoBackground.receiver) {
38
            videoBackground.receiver.start();
Gus Grubba's avatar
Gus Grubba committed
39 40 41
        }
    }
}