| 1 |
// SPDX-License-Identifier: BSD-2-Clause |
| 2 |
// |
| 3 |
// Copyright (C) 2022, Matthew Waters <[email protected]> |
| 4 |
// |
| 5 |
// Redistribution and use in source and binary forms, with or without |
| 6 |
// modification, are permitted provided that the following conditions are met: |
| 7 |
// |
| 8 |
// a) Redistributions of source code must retain the above copyright notice, |
| 9 |
// this list of conditions and the following disclaimer. |
| 10 |
// |
| 11 |
// b) Redistributions in binary form must reproduce the above copyright |
| 12 |
// notice, this list of conditions and the following disclaimer in |
| 13 |
// the documentation and/or other materials provided with the distribution. |
| 14 |
// |
| 15 |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 16 |
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 17 |
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 18 |
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 19 |
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 20 |
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 21 |
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 22 |
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 23 |
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 24 |
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 25 |
// THE POSSIBILITY OF SUCH DAMAGE. |
| 26 |
|
| 27 |
import QtQuick 6.0 |
| 28 |
import QtQuick.Controls 6.0 |
| 29 |
import QtQuick.Dialogs 6.0 |
| 30 |
import QtQuick.Window 6.0 |
| 31 |
|
| 32 |
import org.freedesktop.gstreamer.Qt6GLVideoItem 1.0 |
| 33 |
|
| 34 |
ApplicationWindow { |
| 35 |
id: window |
| 36 |
visible: true |
| 37 |
width: 640 |
| 38 |
height: 480 |
| 39 |
x: 30 |
| 40 |
y: 30 |
| 41 |
color: "black" |
| 42 |
|
| 43 |
Item { |
| 44 |
anchors.fill: parent |
| 45 |
|
| 46 |
GstGLQt6VideoItem { |
| 47 |
id: video |
| 48 |
objectName: "videoItem" |
| 49 |
anchors.centerIn: parent |
| 50 |
width: parent.width |
| 51 |
height: parent.height |
| 52 |
} |
| 53 |
|
| 54 |
Rectangle { |
| 55 |
color: Qt.rgba(1, 1, 1, 0.7) |
| 56 |
border.width: 1 |
| 57 |
border.color: "white" |
| 58 |
anchors.bottom: video.bottom |
| 59 |
anchors.bottomMargin: 15 |
| 60 |
anchors.horizontalCenter: parent.horizontalCenter |
| 61 |
width : parent.width - 30 |
| 62 |
height: parent.height - 30 |
| 63 |
radius: 8 |
| 64 |
|
| 65 |
MouseArea { |
| 66 |
id: mousearea |
| 67 |
anchors.fill: parent |
| 68 |
hoverEnabled: true |
| 69 |
onEntered: { |
| 70 |
parent.opacity = 1.0 |
| 71 |
hidetimer.start() |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
Timer { |
| 76 |
id: hidetimer |
| 77 |
interval: 5000 |
| 78 |
onTriggered: { |
| 79 |
parent.opacity = 0.0 |
| 80 |
stop() |
| 81 |
} |
| 82 |
} |
| 83 |
} |
| 84 |
} |
| 85 |
} |