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
bcc8b43f
Commit
bcc8b43f
authored
Sep 08, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move video streaming initialization away from QGCApplication.
parent
8dabbb98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
45 deletions
+7
-45
QGCApplication.pro
QGCApplication.pro
+2
-0
QGCApplication.cc
src/QGCApplication.cc
+5
-45
No files found.
QGCApplication.pro
View file @
bcc8b43f
...
...
@@ -668,12 +668,14 @@ INCLUDEPATH += \
HEADERS
+=
\
src
/
VideoStreaming
/
VideoItem
.
h
\
src
/
VideoStreaming
/
VideoReceiver
.
h
\
src
/
VideoStreaming
/
VideoStreaming
.
h
\
src
/
VideoStreaming
/
VideoSurface
.
h
\
src
/
VideoStreaming
/
VideoSurface_p
.
h
\
SOURCES
+=
\
src
/
VideoStreaming
/
VideoItem
.
cc
\
src
/
VideoStreaming
/
VideoReceiver
.
cc
\
src
/
VideoStreaming
/
VideoStreaming
.
cc
\
src
/
VideoStreaming
/
VideoSurface
.
cc
\
contains
(
DEFINES
,
DISABLE_VIDEOSTREAMING
)
{
...
...
src/QGCApplication.cc
View file @
bcc8b43f
...
...
@@ -40,13 +40,7 @@
#include <QDebug>
#include <VideoItem.h>
#include <VideoSurface.h>
#if defined(QGC_GST_STREAMING)
G_BEGIN_DECLS
GST_PLUGIN_STATIC_DECLARE
(
QTVIDEOSINK_NAME
);
G_END_DECLS
#endif
#include "VideoStreaming.h"
#include "configuration.h"
#include "QGC.h"
...
...
@@ -277,49 +271,15 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
settings
.
setValue
(
_settingsVersionKey
,
QGC_SETTINGS_VERSION
);
}
//----------------------------------------------------------------
//-- Video Streaming
#if defined(QGC_GST_STREAMING)
#ifdef Q_OS_MAC
#ifndef __ios__
#ifdef QGC_INSTALL_RELEASE
QString
currentDir
=
QCoreApplication
::
applicationDirPath
();
qgcputenv
(
"GST_PLUGIN_SCANNER"
,
currentDir
,
"/gst-plugin-scanner"
);
qgcputenv
(
"GTK_PATH"
,
currentDir
,
"/../Frameworks/GStreamer.framework/Versions/Current"
);
qgcputenv
(
"GIO_EXTRA_MODULES"
,
currentDir
,
"/../Frameworks/GStreamer.framework/Versions/Current/lib/gio/modules"
);
qgcputenv
(
"GST_PLUGIN_SYSTEM_PATH_1_0"
,
currentDir
,
"/../Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0"
);
qgcputenv
(
"GST_PLUGIN_SYSTEM_PATH"
,
currentDir
,
"/../Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0"
);
qgcputenv
(
"GST_PLUGIN_PATH_1_0"
,
currentDir
,
"/../Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0"
);
qgcputenv
(
"GST_PLUGIN_PATH"
,
currentDir
,
"/../Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0"
);
// QStringList env = QProcessEnvironment::systemEnvironment().keys();
// foreach(QString key, env) {
// qDebug() << key << QProcessEnvironment::systemEnvironment().value(key);
// }
#endif
#endif
#endif
#endif
qmlRegisterType
<
VideoItem
>
(
"QGroundControl.QgcQtGStreamer"
,
1
,
0
,
"VideoItem"
);
qmlRegisterUncreatableType
<
VideoSurface
>
(
"QGroundControl.QgcQtGStreamer"
,
1
,
0
,
"VideoSurface"
,
QLatin1String
(
"VideoSurface from QML is not supported"
));
#if defined(QGC_GST_STREAMING)
GError
*
error
=
NULL
;
if
(
!
gst_init_check
(
&
argc
,
&
argv
,
&
error
))
{
qCritical
()
<<
"gst_init_check() failed: "
<<
error
->
message
;
g_error_free
(
error
);
}
GST_PLUGIN_STATIC_REGISTER
(
QTVIDEOSINK_NAME
);
#endif
// Initialize Video Streaming
initializeVideoStreaming
(
argc
,
argv
);
}
QGCApplication
::~
QGCApplication
()
{
_destroySingletons
();
#if defined(QGC_GST_STREAMING)
gst_deinit
();
#endif
shutdownVideoStreaming
();
}
void
QGCApplication
::
_initCommon
(
void
)
...
...
@@ -349,7 +309,7 @@ void QGCApplication::_initCommon(void)
qmlRegisterType
<
ScreenToolsController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ScreenToolsController"
);
#ifndef __mobile__
qmlRegisterType
<
FirmwareUpgradeController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"FirmwareUpgradeController"
);
qmlRegisterType
<
FirmwareUpgradeController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"FirmwareUpgradeController"
);
qmlRegisterType
<
JoystickConfigController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"JoystickConfigController"
);
#endif
...
...
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