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
a9305264
Commit
a9305264
authored
Oct 04, 2017
by
Jacob Walser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add gstreamer debug log option, and dot file output
parent
cf4bbcc9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
73 additions
and
8 deletions
+73
-8
QGCApplication.cc
src/QGCApplication.cc
+13
-1
AppMessages.qml
src/QmlControls/AppMessages.qml
+20
-0
App.SettingsGroup.json
src/Settings/App.SettingsGroup.json
+7
-0
AppSettings.cc
src/Settings/AppSettings.cc
+11
-0
AppSettings.h
src/Settings/AppSettings.h
+4
-0
VideoReceiver.cc
src/VideoStreaming/VideoReceiver.cc
+4
-0
VideoStreaming.cc
src/VideoStreaming/VideoStreaming.cc
+13
-6
VideoStreaming.h
src/VideoStreaming/VideoStreaming.h
+1
-1
No files found.
src/QGCApplication.cc
View file @
a9305264
...
...
@@ -311,8 +311,20 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
}
#endif
// gstreamer debug settings
QString
savePath
,
gstDebugLevel
;
if
(
settings
.
contains
(
AppSettings
::
savePathName
))
{
savePath
=
settings
.
value
(
"SavePath"
).
toString
()
+
"/Logs/gst"
;
// hardcode log path here, appsetting is not available yet
if
(
!
QDir
(
savePath
).
exists
())
{
QDir
().
mkdir
(
savePath
);
}
}
if
(
settings
.
contains
(
AppSettings
::
gstDebugName
))
{
gstDebugLevel
=
"*:"
+
settings
.
value
(
"GstreamerDebugLevel"
).
toString
();
}
// Initialize Video Streaming
initializeVideoStreaming
(
argc
,
argv
);
initializeVideoStreaming
(
argc
,
argv
,
savePath
.
toUtf8
().
data
(),
gstDebugLevel
.
toUtf8
().
data
()
);
_toolbox
=
new
QGCToolbox
(
this
);
_toolbox
->
setChildToolboxes
();
...
...
src/QmlControls/AppMessages.qml
View file @
a9305264
...
...
@@ -15,6 +15,8 @@ import QtQuick.Dialogs 1.2
import
QGroundControl
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
ScreenTools
1.0
...
...
@@ -140,6 +142,24 @@ QGCView {
text
:
qsTr
(
"
Save App Log
"
)
}
QGCLabel
{
id
:
gstLabel
anchors.baseline
:
gstCombo
.
baseline
anchors.right
:
gstCombo
.
left
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
text
:
"
gstreamer debug level:
"
}
FactComboBox
{
id
:
gstCombo
anchors.right
:
followTail
.
left
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
*
20
anchors.bottom
:
parent
.
bottom
width
:
ScreenTools
.
defaultFontPixelWidth
*
20
model
:
[
"
disabled
"
,
"
1
"
,
"
2
"
,
"
3
"
,
"
4
"
,
"
5
"
,
"
6
"
,
"
7
"
,
"
8
"
]
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
gstDebug
}
BusyIndicator
{
id
:
writeBusy
anchors.bottom
:
writeButton
.
bottom
...
...
src/Settings/App.SettingsGroup.json
View file @
a9305264
...
...
@@ -103,6 +103,13 @@
"type"
:
"bool"
,
"defaultValue"
:
false
},
{
"name"
:
"GstreamerDebugLevel"
,
"shortDescription"
:
"Video streaming debug"
,
"longDescription"
:
"Sets the environment variable GST_DEBUG for all pipeline elements on boot."
,
"type"
:
"uint8"
,
"defaultValue"
:
0
},
{
"name"
:
"AutoLoadMissions"
,
"shortDescription"
:
"AutoLoad mission on vehicle connect"
,
...
...
src/Settings/AppSettings.cc
View file @
a9305264
...
...
@@ -36,6 +36,7 @@ const char* AppSettings::autoLoadMissionsName = "AutoLoa
const
char
*
AppSettings
::
mapboxTokenName
=
"MapboxToken"
;
const
char
*
AppSettings
::
esriTokenName
=
"EsriToken"
;
const
char
*
AppSettings
::
defaultFirmwareTypeName
=
"DefaultFirmwareType"
;
const
char
*
AppSettings
::
gstDebugName
=
"GstreamerDebugLevel"
;
const
char
*
AppSettings
::
parameterFileExtension
=
"params"
;
const
char
*
AppSettings
::
planFileExtension
=
"plan"
;
...
...
@@ -75,6 +76,7 @@ AppSettings::AppSettings(QObject* parent)
,
_mapboxTokenFact
(
NULL
)
,
_esriTokenFact
(
NULL
)
,
_defaultFirmwareTypeFact
(
NULL
)
,
_gstDebugFact
(
NULL
)
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
AppSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"AppSettings"
,
"Reference only"
);
...
...
@@ -232,6 +234,15 @@ Fact* AppSettings::virtualJoystick(void)
return
_virtualJoystickFact
;
}
Fact
*
AppSettings
::
gstDebug
(
void
)
{
if
(
!
_gstDebugFact
)
{
_gstDebugFact
=
_createSettingsFact
(
gstDebugName
);
}
return
_gstDebugFact
;
}
Fact
*
AppSettings
::
indoorPalette
(
void
)
{
if
(
!
_indoorPaletteFact
)
{
...
...
src/Settings/AppSettings.h
View file @
a9305264
...
...
@@ -40,6 +40,7 @@ public:
Q_PROPERTY
(
Fact
*
mapboxToken
READ
mapboxToken
CONSTANT
)
Q_PROPERTY
(
Fact
*
esriToken
READ
esriToken
CONSTANT
)
Q_PROPERTY
(
Fact
*
defaultFirmwareType
READ
defaultFirmwareType
CONSTANT
)
Q_PROPERTY
(
Fact
*
gstDebug
READ
gstDebug
CONSTANT
)
Q_PROPERTY
(
QString
missionSavePath
READ
missionSavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
parameterSavePath
READ
parameterSavePath
NOTIFY
savePathsChanged
)
...
...
@@ -75,6 +76,7 @@ public:
Fact
*
mapboxToken
(
void
);
Fact
*
esriToken
(
void
);
Fact
*
defaultFirmwareType
(
void
);
Fact
*
gstDebug
(
void
);
QString
missionSavePath
(
void
);
QString
parameterSavePath
(
void
);
...
...
@@ -107,6 +109,7 @@ public:
static
const
char
*
mapboxTokenName
;
static
const
char
*
esriTokenName
;
static
const
char
*
defaultFirmwareTypeName
;
static
const
char
*
gstDebugName
;
// Application wide file extensions
static
const
char
*
parameterFileExtension
;
...
...
@@ -154,6 +157,7 @@ private:
SettingsFact
*
_mapboxTokenFact
;
SettingsFact
*
_esriTokenFact
;
SettingsFact
*
_defaultFirmwareTypeFact
;
SettingsFact
*
_gstDebugFact
;
};
#endif
src/VideoStreaming/VideoReceiver.cc
View file @
a9305264
...
...
@@ -366,6 +366,7 @@ VideoReceiver::start()
bus
=
NULL
;
}
GST_DEBUG_BIN_TO_DOT_FILE
(
GST_BIN
(
_pipeline
),
GST_DEBUG_GRAPH_SHOW_ALL
,
"pipeline-paused"
);
running
=
gst_element_set_state
(
_pipeline
,
GST_STATE_PLAYING
)
!=
GST_STATE_CHANGE_FAILURE
;
}
while
(
0
);
...
...
@@ -419,6 +420,7 @@ VideoReceiver::start()
_running
=
false
;
}
else
{
GST_DEBUG_BIN_TO_DOT_FILE
(
GST_BIN
(
_pipeline
),
GST_DEBUG_GRAPH_SHOW_ALL
,
"pipeline-playing"
);
_running
=
true
;
qCDebug
(
VideoReceiverLog
)
<<
"Running"
;
}
...
...
@@ -676,6 +678,8 @@ VideoReceiver::startRecording(const QString &videoFile)
gst_pad_link
(
_sink
->
teepad
,
sinkpad
);
gst_object_unref
(
sinkpad
);
GST_DEBUG_BIN_TO_DOT_FILE
(
GST_BIN
(
_pipeline
),
GST_DEBUG_GRAPH_SHOW_ALL
,
"pipeline-recording"
);
_recording
=
true
;
emit
recordingChanged
();
qCDebug
(
VideoReceiverLog
)
<<
"Recording started"
;
...
...
src/VideoStreaming/VideoStreaming.cc
View file @
a9305264
...
...
@@ -101,7 +101,7 @@ int start_logger(const char *app_name)
}
#endif
void
initializeVideoStreaming
(
int
&
argc
,
char
*
argv
[])
void
initializeVideoStreaming
(
int
&
argc
,
char
*
argv
[]
,
char
*
logpath
,
char
*
debuglevel
)
{
#if defined(QGC_GST_STREAMING)
#ifdef __macos__
...
...
@@ -119,12 +119,19 @@ void initializeVideoStreaming(int &argc, char* argv[])
QString
currentDir
=
QCoreApplication
::
applicationDirPath
();
qgcputenv
(
"GST_PLUGIN_PATH"
,
currentDir
,
"/gstreamer-plugins"
);
#endif
// Initialize GStreamer
#ifdef ANDDROID_GST_DEBUG
start_logger
(
"gst_log"
);
qputenv
(
"GST_DEBUG"
,
"*:4"
);
qputenv
(
"GST_DEBUG_NO_COLOR"
,
"1"
);
#endif
if
(
logpath
)
{
if
(
debuglevel
)
{
qputenv
(
"GST_DEBUG"
,
debuglevel
);
}
qputenv
(
"GST_DEBUG_NO_COLOR"
,
"1"
);
qputenv
(
"GST_DEBUG_FILE"
,
QString
(
"%1/%2"
).
arg
(
logpath
).
arg
(
"gstreamer-log.txt"
).
toUtf8
());
qputenv
(
"GST_DEBUG_DUMP_DOT_DIR"
,
logpath
);
}
GError
*
error
=
NULL
;
if
(
!
gst_init_check
(
&
argc
,
&
argv
,
&
error
))
{
qCritical
()
<<
"gst_init_check() failed: "
<<
error
->
message
;
...
...
src/VideoStreaming/VideoStreaming.h
View file @
a9305264
...
...
@@ -17,7 +17,7 @@
#ifndef VIDEO_STREAMING_H
#define VIDEO_STREAMING_H
extern
void
initializeVideoStreaming
(
int
&
argc
,
char
*
argv
[]);
extern
void
initializeVideoStreaming
(
int
&
argc
,
char
*
argv
[]
,
char
*
filename
,
char
*
debuglevel
);
extern
void
shutdownVideoStreaming
();
#endif // VIDEO_STREAMING_H
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