Commit f7be8bff authored by DoinLakeFlyer's avatar DoinLakeFlyer
Browse files

Merge remote-tracking branch 'origin/TerrainProfile' into TerrainProfile

parents ecb051f3 aa8a9ac6
......@@ -7,6 +7,6 @@
[submodule "libs/OpenSSL/android_openssl"]
path = libs/OpenSSL/android_openssl
url = https://github.com/Auterion/android_openssl
[submodule "libs/gst-plugins-good"]
[submodule "libs/qmlglsink/gst-plugins-good"]
path = libs/qmlglsink/gst-plugins-good
url = https://github.com/mavlink/gst-plugins-good.git
# VideoReceiverApp
## Application
This is a simple test application developed to make VideoReceiver library development and testing easier. It can also be used as part of CI for system tests.
## Use cases and options
Application's behaviour depends on the executable name. There are two modes - QML and console. QML mode is enabled by renaming application executable to something that starts with **Q** (for example QVideoReceiverApp). In this case **video-sink** option is not available and application always tries to use **qmlglsink** for video rendering. In regular case (executable name does not start with **Q**) **autovideosink** or **fakesink** are used, depending on options.
### Available options and required arguments
```VideoReceiverApp [options] url```
for example:
```VideoReceiverApp -d --stop-decoding 30 rtsp://127.0.0.1:8554/test```
#### Options
```-h, --help``` - displays help
```-t, --timeout <seconds>``` - specifies source timeout
```-c, --connect <attempts>``` - specifies number of connection attempts
```-d, --decode``` - enables or disables video decoding and rendering
```--no-decode``` - disables video decoding and rendering if it was enabled by default
```--stop-decoding <seconds>``` - specifies amount of seconds after which decoding should be stopped
```-r, --record <file>``` - enables record video into file
```-f, --format <format>``` - specifies recording file format, where format 0 - MKV, 1 - MOV, 2 - MP4
```--stop-recording <seconds>``` - specifies amount of seconds after which recording should be stopped
```--video-sink <sink>``` - specifies which video sink to use : 0 - autovideosink, 1 - fakesink
#### Arguments
```url``` - required, specifies video URL.
Following URLs are supported:
```rtsp://<host>:<port>/mount/point``` - usual RTSP URL
```udp://<interface>:<port>``` - H.264 over RTP/UDP
```udp265://<interface>:<port>``` - H.265 over RTP/UDP
```tsusb://<interface>:<port>``` - Taisync's forwarded H.264 byte aligned NALU stream over UDP
```tcp://<host>:<port>``` - MPEG-2 TS over TCP
```mpegts://<interface>:<port>``` - MPEG-2 TS over UDP
......@@ -155,6 +155,9 @@ private:
unsigned int _fileFormat = VideoReceiver::FILE_FORMAT_MIN;
unsigned _stopRecordingAfter = 15;
bool _useFakeSink = false;
bool _streaming = false;
bool _decoding = false;
bool _recording = false;
};
void
......@@ -299,52 +302,27 @@ VideoReceiverApp::exec()
startStreaming();
QObject::connect(_receiver, &VideoReceiver::timeout, [this](){
QObject::connect(_receiver, &VideoReceiver::timeout, [](){
qCDebug(AppLog) << "Streaming timeout";
_dispatch([this](){
if (_receiver->streaming()) {
_receiver->stop();
} else {
if (--_connect > 0) {
qCDebug(AppLog) << "Restarting streaming";
_dispatch([this](){
startStreaming();
});
} else {
qCDebug(AppLog) << "Closing...";
delete _receiver;
_app.exit();
}
}
});
});
QObject::connect(_receiver, &VideoReceiver::streamingChanged, [this](){
if (_receiver->streaming()) {
QObject::connect(_receiver, &VideoReceiver::streamingChanged, [this](bool active){
_streaming = active;
if (_streaming) {
qCDebug(AppLog) << "Streaming started";
} else {
qCDebug(AppLog) << "Streaming stopped";
_dispatch([this](){
if (--_connect > 0) {
qCDebug(AppLog) << "Restarting streaming";
startStreaming();
} else {
qCDebug(AppLog) << "Closing...";
delete _receiver;
_app.exit();
}
});
}
});
QObject::connect(_receiver, &VideoReceiver::decodingChanged, [this](){
if (_receiver->decoding()) {
QObject::connect(_receiver, &VideoReceiver::decodingChanged, [this](bool active){
_decoding = active;
if (_decoding) {
qCDebug(AppLog) << "Decoding started";
} else {
qCDebug(AppLog) << "Decoding stopped";
if (_receiver->streaming()) {
if (!_receiver->recording()) {
if (_streaming) {
if (!_recording) {
_dispatch([this](){
_receiver->stop();
});
......@@ -353,13 +331,14 @@ VideoReceiverApp::exec()
}
});
QObject::connect(_receiver, &VideoReceiver::recordingChanged, [this](){
if (_receiver->recording()) {
QObject::connect(_receiver, &VideoReceiver::recordingChanged, [this](bool active){
_recording = active;
if (_recording) {
qCDebug(AppLog) << "Recording started";
} else {
qCDebug(AppLog) << "Recording stopped";
if (_receiver->streaming()) {
if (!_receiver->decoding()) {
if (_streaming) {
if (!_decoding) {
_dispatch([this](){
_receiver->stop();
});
......@@ -368,6 +347,44 @@ VideoReceiverApp::exec()
}
});
QObject::connect(_receiver, &VideoReceiver::onStartComplete, [this](VideoReceiver::STATUS status){
if (status != VideoReceiver::STATUS_OK) {
qCDebug(AppLog) << "Video receiver start failed";
_dispatch([this](){
if (--_connect > 0) {
qCDebug(AppLog) << "Restarting ...";
_dispatch([this](){
startStreaming();
});
} else {
qCDebug(AppLog) << "Closing...";
delete _receiver;
_app.exit();
}
});
} else {
qCDebug(AppLog) << "Video receiver started";
}
});
QObject::connect(_receiver, &VideoReceiver::onStopComplete, [this](VideoReceiver::STATUS ){
qCDebug(AppLog) << "Video receiver stopped";
_dispatch([this](){
if (--_connect > 0) {
qCDebug(AppLog) << "Restarting ...";
_dispatch([this](){
startStreaming();
});
} else {
qCDebug(AppLog) << "Closing...";
delete _receiver;
_app.exit();
}
});
});
return _app.exec();
}
......
......@@ -11,7 +11,7 @@ if(DEFINED ENV{QT_MKSPEC})
set(QT_MKSPEC $ENV{QT_MKSPEC})
endif()
if(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE AND NOT ANDROID)
set(LINUX TRUE)
endif()
......
......@@ -44,8 +44,8 @@ Item {
property real _labelFieldWidth: ScreenTools.defaultFontPixelWidth * 28
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30
property real _editFieldHeight: ScreenTools.defaultFontPixelHeight * 2
property var _videoReceiver: QGroundControl.videoManager.videoReceiver
property bool _recordingLocalVideo: _videoReceiver && _videoReceiver.recording
property var _videoManager: QGroundControl.videoManager
property bool _recordingLocalVideo: QGroundControl.videoManager.recording
property var _dynamicCameras: activeVehicle ? activeVehicle.dynamicCameras : null
property bool _isCamera: _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false
......@@ -305,15 +305,15 @@ Item {
_camera.stopVideo()
//-- Local video as well
if (_recordingVideo) {
_videoReceiver.stopRecording()
_videoManager.stopRecording()
}
} else {
if(!_fullSD) {
_camera.startVideo()
}
//-- Local video as well
if(_videoReceiver) {
_videoReceiver.startRecording()
if(_videoManager) {
_videoManager.startRecording()
}
}
} else {
......
......@@ -29,12 +29,8 @@
QGC_LOGGING_CATEGORY(CustomLog, "CustomLog")
CustomVideoReceiver::CustomVideoReceiver(QObject* parent)
: VideoReceiver(parent)
: GstVideoReceiver(parent)
{
#if defined(QGC_GST_STREAMING)
//-- Shorter RTSP test interval
_restart_time_ms = 1000;
#endif
}
CustomVideoReceiver::~CustomVideoReceiver()
......
......@@ -14,7 +14,7 @@
#include "QGCCorePlugin.h"
#include "QGCOptions.h"
#include "QGCLoggingCategory.h"
#include "VideoReceiver.h"
#include "GstVideoReceiver.h"
#include "SettingsManager.h"
#include <QTranslator>
......@@ -25,7 +25,7 @@ class CustomSettings;
Q_DECLARE_LOGGING_CATEGORY(CustomLog)
//-- Our own, custom video receiver
class CustomVideoReceiver : public VideoReceiver
class CustomVideoReceiver : public GstVideoReceiver
{
Q_OBJECT
public:
......
......@@ -20,10 +20,10 @@ CustomVideoManager::CustomVideoManager(QGCApplication* app, QGCToolbox* toolbox)
//-----------------------------------------------------------------------------
void
CustomVideoManager::_updateSettings()
CustomVideoManager::_updateSettings(unsigned id)
{
if(!_videoSettings || !_videoReceiver)
return;
VideoManager::_updateSettings();
VideoManager::_updateSettings(id);
}
......@@ -23,6 +23,6 @@ public:
CustomVideoManager (QGCApplication* app, QGCToolbox* toolbox);
protected:
void _updateSettings ();
void _updateSettings (unsigned id);
};
......@@ -8595,7 +8595,8 @@ for current-based compensation [G/kA]</short_desc>
<values>
<value code="0">Disabled</value>
<value code="1">Throttle-based compensation</value>
<value code="2">Current-based compensation</value>
<value code="2">Current-based compensation (battery_status instance 0)</value>
<value code="3">Current-based compensation (battery_status instance 1)</value>
</values>
</parameter>
<parameter category="System" default="0" name="CAL_MAG_PRIME" type="INT32">
......@@ -10348,8 +10349,7 @@ How often the sensor is readout</short_desc>
</parameter>
<parameter default="0" name="TC_A_ENABLE" type="INT32">
<short_desc>Thermal compensation for accelerometer sensors</short_desc>
<min>0</min>
<max>1</max>
<reboot_required>true</reboot_required>
</parameter>
<parameter category="System" default="0" name="TC_B0_ID" type="INT32">
<short_desc>ID of Barometer that the calibration is for</short_desc>
......@@ -10452,8 +10452,7 @@ How often the sensor is readout</short_desc>
</parameter>
<parameter default="0" name="TC_B_ENABLE" type="INT32">
<short_desc>Thermal compensation for barometric pressure sensors</short_desc>
<min>0</min>
<max>1</max>
<reboot_required>true</reboot_required>
</parameter>
<parameter category="System" default="0" name="TC_G0_ID" type="INT32">
<short_desc>ID of Gyro that the calibration is for</short_desc>
......@@ -10628,8 +10627,7 @@ How often the sensor is readout</short_desc>
</parameter>
<parameter default="0" name="TC_G_ENABLE" type="INT32">
<short_desc>Thermal compensation for rate gyro sensors</short_desc>
<min>0</min>
<max>1</max>
<reboot_required>true</reboot_required>
</parameter>
</group>
<group name="UAVCAN">
......@@ -10804,9 +10802,9 @@ tailsitter, tiltrotor: main throttle</short_desc>
<increment>0.01</increment>
</parameter>
<parameter default="5.0" name="VT_DWN_PITCH_MAX" type="FLOAT">
<short_desc>Maximum allowed down-pitch the controller is able to demand. This prevents large, negative
lift values being created when facing strong winds. The vehicle will use the pusher motor
to accelerate forward if necessary</short_desc>
<short_desc>Maximum allowed angle the vehicle is allowed to pitch down to generate forward force
when fixed-wing forward actuation is active (seeVT_FW_TRHUST_EN).
If demanded down pitch exceeds this limmit, the fixed-wing forward actuators are used instead</short_desc>
<min>0.0</min>
<max>45.0</max>
</parameter>
......@@ -10814,9 +10812,24 @@ to accelerate forward if necessary</short_desc>
<short_desc>Lock elevons in multicopter mode</short_desc>
<long_desc>If set to 1 the elevons are locked in multicopter mode</long_desc>
</parameter>
<parameter default="0.0" name="VT_FWD_THRUST_SC" type="FLOAT">
<short_desc>Fixed wing thrust scale for hover forward flight</short_desc>
<long_desc>Scale applied to fixed wing thrust being used as source for forward acceleration in multirotor mode. This technique can be used to avoid the plane having to pitch down a lot in order to move forward. Setting this value to 0 (default) will disable this strategy.</long_desc>
<parameter default="0" name="VT_FWD_THRUST_EN" type="INT32">
<short_desc>Enable/disable usage of fixed-wing actuators in hover to generate forward force (instead of pitching down).
This technique can be used to avoid the plane having to pitch down in order to move forward.
This prevents large, negative lift values being created when facing strong winds.
Fixed-wing forward actuators refers to puller/pusher (standard VTOL), or forward-tilt (tiltrotor VTOL).
Only active if demaded down pitch is above VT_DWN_PITCH_MAX, and uses VT_FWD_THRUST_SC to get from
demanded down pitch to fixed-wing actuation</short_desc>
<values>
<value code="0">Disable FW forward actuation in hover.</value>
<value code="1">Enable FW forward actuation in hover in altitude, position and auto modes (except LANDING).</value>
<value code="2">Enable FW forward actuation in hover in altitude, position and auto modes if above MPC_LAND_ALT1.</value>
<value code="3">Enable FW forward actuation in hover in altitude, position and auto modes if above MPC_LAND_ALT2.</value>
<value code="4">Enable FW forward actuation in hover in altitude, position and auto modes.</value>
</values>
</parameter>
<parameter default="0.7" name="VT_FWD_THRUST_SC" type="FLOAT">
<short_desc>Fixed-wing actuator thrust scale for hover forward flight</short_desc>
<long_desc>Scale applied to the demanded down-pitch to get the fixed-wing forward actuation in hover mode. Only active if demaded down pitch is above VT_DWN_PITCH_MAX. Enabled via VT_FWD_THRUST_EN.</long_desc>
<min>0.0</min>
<max>2.0</max>
</parameter>
......
......@@ -25,7 +25,6 @@ Item {
clip: true
property double _ar: QGroundControl.videoManager.aspectRatio
property bool _showGrid: QGroundControl.settingsManager.videoSettings.gridLines.rawValue > 0
property var _videoReceiver: QGroundControl.videoManager.videoReceiver
property var _dynamicCameras: activeVehicle ? activeVehicle.dynamicCameras : null
property bool _connected: activeVehicle ? !activeVehicle.connectionLost : false
property int _curCameraIndex: _dynamicCameras ? _dynamicCameras.currentCamera : 0
......@@ -40,7 +39,7 @@ Item {
id: noVideo
anchors.fill: parent
color: Qt.rgba(0,0,0,0.75)
visible: !(_videoReceiver && _videoReceiver.decoding)
visible: !(QGroundControl.videoManager.decoding)
QGCLabel {
text: QGroundControl.settingsManager.videoSettings.streamEnabled.rawValue ? qsTr("WAITING FOR VIDEO") : qsTr("VIDEO DISABLED")
font.family: ScreenTools.demiboldFontFamily
......@@ -58,7 +57,7 @@ Item {
Rectangle {
anchors.fill: parent
color: "black"
visible: _videoReceiver && _videoReceiver.decoding
visible: QGroundControl.videoManager.decoding
function getWidth() {
//-- Fit Width or Stretch
if(_fitMode === 0 || _fitMode === 2) {
......@@ -80,10 +79,9 @@ Item {
QGCVideoBackground {
id: videoContent
objectName: "videoContent"
receiver: _videoReceiver
Connections {
target: _videoReceiver
target: QGroundControl.videoManager
onImageFileChanged: {
videoContent.grabToImage(function(result) {
if (!result.saveToFile(QGroundControl.videoManager.imageFile)) {
......@@ -130,7 +128,7 @@ Item {
height: parent.getHeight()
width: parent.getWidth()
anchors.centerIn: parent
visible: _videoReceiver && _videoReceiver.decoding
visible: QGroundControl.videoManager.decoding
sourceComponent: videoBackgroundComponent
property bool videoDisabled: QGroundControl.settingsManager.videoSettings.videoSource.rawValue === QGroundControl.settingsManager.videoSettings.disabledVideoSource
......
......@@ -38,6 +38,7 @@ MapQuickItem {
showGimbalYaw: !isNaN(missionItem.missionGimbalYaw)
highlightSelected: true
onClicked: _item.clicked()
opacity: _item.opacity
property bool _isCurrentItem: missionItem ? missionItem.isCurrentItem || missionItem.hasCurrentChildItem : false
}
......
......@@ -71,6 +71,7 @@ Rectangle {
drag.maximumX: itemDragger.parent.width - parent.width
drag.maximumY: itemDragger.parent.height - parent.height
preventStealing: true
enabled: itemDragger.visible
onClicked: {
focus = true
......
......@@ -31,9 +31,8 @@ Item {
anchors.centerIn: parent
property bool _communicationLost: activeVehicle ? activeVehicle.connectionLost : false
property var _videoReceiver: QGroundControl.videoManager.videoReceiver
property bool _recordingVideo: _videoReceiver && _videoReceiver.recording
property bool _decodingVideo: _videoReceiver && _videoReceiver.decoding
property bool _recordingVideo: QGroundControl.videoManager.recording
property bool _decodingVideo: QGroundControl.videoManager.decoding
property bool _streamingEnabled: QGroundControl.settingsManager.videoSettings.streamConfigured
property var _dynamicCameras: activeVehicle ? activeVehicle.dynamicCameras : null
property int _curCameraIndex: _dynamicCameras ? _dynamicCameras.currentCamera : 0
......@@ -70,10 +69,10 @@ Item {
onClicked: {
if(checked) {
QGroundControl.settingsManager.videoSettings.streamEnabled.rawValue = 1
_videoReceiver.start()
QGroundControl.videoManager.startVideo()
} else {
QGroundControl.settingsManager.videoSettings.streamEnabled.rawValue = 0
_videoReceiver.stop()
QGroundControl.videoManager.stopVideo()
}
}
}
......
......@@ -40,6 +40,8 @@ if(BUILD_TESTING)
SurveyComplexItemTest.h
TransectStyleComplexItemTest.cc
TransectStyleComplexItemTest.h
TransectStyleComplexItemTestBase.cc
TransectStyleComplexItemTestBase.h
VisualMissionItemTest.cc
VisualMissionItemTest.h
)
......
......@@ -301,7 +301,7 @@ Item {
sourceItem: SplitIndicator {
z: _zorderSplitHandle
onClicked: mapPolygon.splitPolygonSegment(mapQuickItem.vertexIndex)
onClicked: if(_root.interactive) mapPolygon.splitPolygonSegment(mapQuickItem.vertexIndex)
}
}
}
......@@ -366,7 +366,7 @@ Item {
}
}
onClicked: menu.popupVertex(polygonVertex)
onClicked: if(_root.interactive) menu.popupVertex(polygonVertex)
}
}
......@@ -574,7 +574,7 @@ Item {
z: QGroundControl.zOrderMapItems + 1 // Over item indicators
onClicked: {
if (mouse.button === Qt.LeftButton) {
if (mouse.button === Qt.LeftButton && _root.interactive) {
mapPolygon.appendVertex(mapControl.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */))
}
}
......@@ -596,7 +596,7 @@ Item {
height: width
radius: width / 2
color: "white"
opacity: .90
opacity: interiorOpacity * .90
}
}
}
......
......@@ -175,6 +175,7 @@ Item {
line.color: lineColor
path: mapPolyline.path
visible: _root.visible
opacity: _root.opacity
}
}
......@@ -186,6 +187,7 @@ Item {
anchorPoint.x: sourceItem.width / 2
anchorPoint.y: sourceItem.height / 2
z: _zorderSplitHandle
opacity: _root.opacity
property int vertexIndex
......@@ -205,6 +207,8 @@ Item {
property var _splitHandle
property var _vertices: mapPolyline.path
opacity: _root.opacity
function _setHandlePosition() {
var nextIndex = index + 1
var distance = _vertices[index].distanceTo(_vertices[nextIndex])
......@@ -238,6 +242,7 @@ Item {
mapControl: _root.mapControl
id: dragArea
z: _zorderDragHandle
opacity: _root.opacity
property int polylineVertex
......@@ -267,6 +272,7 @@ Item {
anchorPoint.x: dragHandle.width / 2
anchorPoint.y: dragHandle.height / 2
z: _zorderDragHandle
opacity: _root.opacity
property int polylineVertex
......@@ -292,6 +298,8 @@ Item {
delegate: Item {
property var _visuals: [ ]
opacity: _root.opacity
Component.onCompleted: {
var dragHandle = dragHandleComponent.createObject(mapControl)
dragHandle.coordinate = Qt.binding(function() { return object.coordinate })
......@@ -366,7 +374,7 @@ Item {
z: QGroundControl.zOrderMapItems + 1 // Over item indicators
onClicked: {
if (mouse.button === Qt.LeftButton) {
if (mouse.button === Qt.LeftButton && _root.interactive) {
mapPolyline.appendVertex(mapControl.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */))
}
}
......
......@@ -25,9 +25,10 @@ TransectStyleMapVisuals {
id: mapPolylineVisuals
mapControl: map
mapPolyline: object.corridorPolyline
interactive: _currentItem
interactive: _currentItem && parent.interactive
lineWidth: 3
lineColor: "#be781c"
visible: _currentItem
opacity: parent.opacity
}
}
......@@ -24,6 +24,7 @@ Item {
id: _root
property var map ///< Map control to place item in
property bool interactive: true
signal clicked(int sequenceNumber)
......@@ -178,6 +179,7 @@ Item {
MouseArea {
anchors.fill: map
z: QGroundControl.zOrderMapItems + 1 // Over item indicators
visible: _root.interactive
readonly property int _decimalPlaces: 8
......@@ -199,6 +201,7 @@ Item {
mapControl: _root.map
itemIndicator: _loiterPointObject
itemCoordinate: _missionItem.loiterCoordinate
visible: _root.interactive
property bool _preventReentrancy: false
......@@ -224,6 +227,7 @@ Item {
mapControl: _root.map
itemIndicator: _landingPointObject
itemCoordinate: _missionItem.landingCoordinate
visible: _root.interactive
onItemCoordinateChanged: _missionItem.moveLandingPosition(itemCoordinate)
}
......
......@@ -39,8 +39,8 @@ Item {
property int _borderWidthExclusion: 0
property color _interiorColorExclusion: "orange"
property color _interiorColorInclusion: "transparent"
property real _interiorOpacityExclusion: 0.2
property real _interiorOpacityInclusion: 1
property real _interiorOpacityExclusion: 0.2 * opacity
property real _interiorOpacityInclusion: 1 * opacity
function addPolygon(inclusionPolygon) {
// Initial polygon is inset to take 2/3rds space
......@@ -104,6 +104,7 @@ Item {
borderColor: _borderColor
interiorColor: object.inclusion ? _interiorColorInclusion : _interiorColorExclusion
interiorOpacity: object.inclusion ? _interiorOpacityInclusion : _interiorOpacityExclusion
interactive: _root.interactive && mapPolygon && mapPolygon.interactive
}
}
......@@ -118,6 +119,7 @@ Item {
borderColor: _borderColor
interiorColor: object.inclusion ? _interiorColorInclusion : _interiorColorExclusion
interiorOpacity: object.inclusion ? _interiorOpacityInclusion : _interiorOpacityExclusion
interactive: _root.interactive && mapCircle && mapCircle.interactive
}
}
......@@ -146,7 +148,7 @@ Item {
MissionItemIndicatorDrag {
mapControl: map
itemCoordinate: myGeoFenceController.breachReturnPoint
//visible: itemCoordinate.isValid
visible: _root.interactive
onItemCoordinateChanged: myGeoFenceController.breachReturnPoint = itemCoordinate
}
......@@ -162,6 +164,7 @@ Item {
anchorPoint.y: sourceItem.anchorPointY
z: QGroundControl.zOrderMapItems
coordinate: myGeoFenceController.breachReturnPoint
opacity: _root.opacity
sourceItem: MissionItemIndexLabel {
label: qsTr("B", "Breach Return Point item indicator")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment