Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
083af0b3
Commit
083af0b3
authored
Feb 25, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow setting the video streaming aspect ratio.
parent
8d5151b8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
20 deletions
+53
-20
FlightDisplayViewVideo.qml
src/FlightDisplay/FlightDisplayViewVideo.qml
+11
-15
Video.SettingsGroup.json
src/Settings/Video.SettingsGroup.json
+8
-0
VideoSettings.cc
src/Settings/VideoSettings.cc
+15
-4
VideoSettings.h
src/Settings/VideoSettings.h
+5
-1
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+14
-0
No files found.
src/FlightDisplay/FlightDisplayViewVideo.qml
View file @
083af0b3
...
...
@@ -23,35 +23,31 @@ import QGroundControl.Controllers 1.0
Item
{
id
:
root
property
double
_ar
:
QGroundControl
.
settingsManager
.
videoSettings
.
aspectRatio
.
rawValue
Rectangle
{
id
:
noVideo
anchors.fill
:
parent
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
visible
:
!
QGroundControl
.
videoManager
.
videoRunning
QGCLabel
{
text
:
qsTr
(
"
NO
VIDEO
"
)
text
:
qsTr
(
"
WAITING FOR
VIDEO
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
"
white
"
font.pointSize
:
_mainIsMap
?
ScreenTools
.
smallFontPointSize
:
ScreenTools
.
largeFontPointSize
anchors.centerIn
:
parent
}
}
QGCVideoBackground
{
Rectangle
{
anchors.fill
:
parent
display
:
QGroundControl
.
videoManager
.
videoSurface
receiver
:
QGroundControl
.
videoManager
.
videoReceiver
color
:
"
black
"
visible
:
QGroundControl
.
videoManager
.
videoRunning
/* TODO: Come up with a way to make this an option
QGCAttitudeHUD {
id: attitudeHUD
visible: !_mainIsMap
rollAngle: _activeVehicle ? _activeVehicle.roll.value : 0
pitchAngle: _activeVehicle ? _activeVehicle.pitch.value : 0
width: ScreenTools.defaultFontPixelHeight * (30)
height: ScreenTools.defaultFontPixelHeight * (30)
active: QGroundControl.multiVehicleManager.activeVehicleAvailable
z: QGroundControl.zOrderWidgets
QGCVideoBackground
{
height
:
parent
.
height
width
:
_ar
!=
0.0
?
height
*
_ar
:
parent
.
width
anchors.centerIn
:
parent
display
:
QGroundControl
.
videoManager
.
videoSurface
receiver
:
QGroundControl
.
videoManager
.
videoReceiver
visible
:
QGroundControl
.
videoManager
.
videoRunning
}
*/
}
}
src/Settings/Video.SettingsGroup.json
View file @
083af0b3
...
...
@@ -27,5 +27,13 @@
"longDescription"
:
"Directory to save videos to."
,
"type"
:
"string"
,
"defaultValue"
:
""
},
{
"name"
:
"VideoAspectRatio"
,
"shortDescription"
:
"Video Aspect Ratio"
,
"longDescription"
:
"Video Aspect Ratio (width / height). Use 0.0 to ignore it."
,
"type"
:
"float"
,
"decimalPlaces"
:
6
,
"defaultValue"
:
1.777777
}
]
src/Settings/VideoSettings.cc
View file @
083af0b3
...
...
@@ -19,10 +19,11 @@
const
char
*
VideoSettings
::
videoSettingsGroupName
=
"Video"
;
const
char
*
VideoSettings
::
videoSourceName
=
"VideoSource"
;
const
char
*
VideoSettings
::
udpPortName
=
"VideoUDPPort"
;
const
char
*
VideoSettings
::
rtspUrlName
=
"VideoRTSPUrl"
;
const
char
*
VideoSettings
::
videoSavePathName
=
"VideoSavePath"
;
const
char
*
VideoSettings
::
videoSourceName
=
"VideoSource"
;
const
char
*
VideoSettings
::
udpPortName
=
"VideoUDPPort"
;
const
char
*
VideoSettings
::
rtspUrlName
=
"VideoRTSPUrl"
;
const
char
*
VideoSettings
::
videoSavePathName
=
"VideoSavePath"
;
const
char
*
VideoSettings
::
videoAspectRatioName
=
"VideoAspectRatio"
;
const
char
*
VideoSettings
::
videoSourceNoVideo
=
"No Video Available"
;
const
char
*
VideoSettings
::
videoSourceUDP
=
"UDP Video Stream"
;
...
...
@@ -34,6 +35,7 @@ VideoSettings::VideoSettings(QObject* parent)
,
_udpPortFact
(
NULL
)
,
_rtspUrlFact
(
NULL
)
,
_videoSavePathFact
(
NULL
)
,
_videoAspectRatioFact
(
NULL
)
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
VideoSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"VideoSettings"
,
"Reference only"
);
...
...
@@ -104,3 +106,12 @@ Fact* VideoSettings::videoSavePath(void)
return
_videoSavePathFact
;
}
Fact
*
VideoSettings
::
aspectRatio
(
void
)
{
if
(
!
_videoAspectRatioFact
)
{
_videoAspectRatioFact
=
_createSettingsFact
(
videoAspectRatioName
);
}
return
_videoAspectRatioFact
;
}
src/Settings/VideoSettings.h
View file @
083af0b3
...
...
@@ -15,7 +15,7 @@
class
VideoSettings
:
public
SettingsGroup
{
Q_OBJECT
public:
VideoSettings
(
QObject
*
parent
=
NULL
);
...
...
@@ -23,11 +23,13 @@ public:
Q_PROPERTY
(
Fact
*
udpPort
READ
udpPort
CONSTANT
)
Q_PROPERTY
(
Fact
*
rtspUrl
READ
rtspUrl
CONSTANT
)
Q_PROPERTY
(
Fact
*
videoSavePath
READ
videoSavePath
CONSTANT
)
Q_PROPERTY
(
Fact
*
aspectRatio
READ
aspectRatio
CONSTANT
)
Fact
*
videoSource
(
void
);
Fact
*
udpPort
(
void
);
Fact
*
rtspUrl
(
void
);
Fact
*
videoSavePath
(
void
);
Fact
*
aspectRatio
(
void
);
static
const
char
*
videoSettingsGroupName
;
...
...
@@ -35,6 +37,7 @@ public:
static
const
char
*
udpPortName
;
static
const
char
*
rtspUrlName
;
static
const
char
*
videoSavePathName
;
static
const
char
*
videoAspectRatioName
;
static
const
char
*
videoSourceNoVideo
;
static
const
char
*
videoSourceUDP
;
...
...
@@ -45,6 +48,7 @@ private:
SettingsFact
*
_udpPortFact
;
SettingsFact
*
_rtspUrlFact
;
SettingsFact
*
_videoSavePathFact
;
SettingsFact
*
_videoAspectRatioFact
;
};
#endif
src/ui/preferences/GeneralSettings.qml
View file @
083af0b3
...
...
@@ -503,6 +503,20 @@ QGCView {
fact
:
QGroundControl
.
settingsManager
.
videoSettings
.
rtspUrl
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
<
2
QGCLabel
{
anchors.baseline
:
aspectField
.
baseline
text
:
qsTr
(
"
Aspect Ratio:
"
)
width
:
_labelWidth
}
FactTextField
{
id
:
aspectField
width
:
_editFieldWidth
fact
:
QGroundControl
.
settingsManager
.
videoSettings
.
aspectRatio
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
settingsManager
.
videoSettings
.
videoSavePath
.
visible
&&
QGroundControl
.
videoManager
.
isGStreamer
&&
QGroundControl
.
videoManager
.
recordingEnabled
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment