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
32a13b19
Commit
32a13b19
authored
Nov 18, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly initialize GStreamer on iOS
parent
fa8172e7
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1162 additions
and
5 deletions
+1162
-5
VideoStreaming.cc
src/VideoStreaming/VideoStreaming.cc
+11
-4
VideoStreaming.pri
src/VideoStreaming/VideoStreaming.pri
+7
-0
glutils.h
src/VideoStreaming/gstqtvideosink/utils/glutils.h
+1
-1
gst_ios_init.h
src/VideoStreaming/iOS/gst_ios_init.h
+45
-0
gst_ios_init.m
src/VideoStreaming/iOS/gst_ios_init.m
+1098
-0
No files found.
src/VideoStreaming/VideoStreaming.cc
View file @
32a13b19
...
...
@@ -22,6 +22,9 @@
#ifdef __android__
//#define ANDDROID_GST_DEBUG
#endif
#if defined(__ios__)
#include "gst_ios_init.h"
#endif
#endif
#include "VideoStreaming.h"
...
...
@@ -120,8 +123,12 @@ void initializeVideoStreaming(int &argc, char* argv[], char* logpath, char* debu
qgcputenv
(
"GST_PLUGIN_PATH"
,
currentDir
,
"/gstreamer-plugins"
);
#endif
// Initialize GStreamer
#if !defined(__ios__)
// Initialize GStreamer
#if defined(__ios__)
//-- iOS specific initialization
gst_ios_init
();
#else
//-- Generic initialization
if
(
logpath
)
{
if
(
debuglevel
)
{
qputenv
(
"GST_DEBUG"
,
debuglevel
);
...
...
@@ -130,16 +137,16 @@ void initializeVideoStreaming(int &argc, char* argv[], char* logpath, char* debu
qputenv
(
"GST_DEBUG_FILE"
,
QString
(
"%1/%2"
).
arg
(
logpath
).
arg
(
"gstreamer-log.txt"
).
toUtf8
());
qputenv
(
"GST_DEBUG_DUMP_DOT_DIR"
,
logpath
);
}
#endif
GError
*
error
=
nullptr
;
if
(
!
gst_init_check
(
&
argc
,
&
argv
,
&
error
))
{
qCritical
()
<<
"gst_init_check() failed: "
<<
error
->
message
;
g_error_free
(
error
);
}
#endif
// Our own plugin
GST_PLUGIN_STATIC_REGISTER
(
QGC_VIDEOSINK_PLUGIN
);
// The static plugins we use
#if defined(__
mobile__) && !defined(Q_OS_MAC
)
#if defined(__
android__
)
GST_PLUGIN_STATIC_REGISTER
(
coreelements
);
GST_PLUGIN_STATIC_REGISTER
(
libav
);
GST_PLUGIN_STATIC_REGISTER
(
rtp
);
...
...
src/VideoStreaming/VideoStreaming.pri
View file @
32a13b19
...
...
@@ -178,6 +178,13 @@ VideoEnabled {
$$PWD/gstqtvideosink/utils/bufferformat.cpp \
$$PWD/gstqtvideosink/utils/utils.cpp \
iOSBuild {
OBJECTIVE_SOURCES += \
$$PWD/ios/gst_ios_init.m
INCLUDEPATH += \
$$PWD/ios
}
} else {
LinuxBuild|MacBuild|iOSBuild|WindowsBuild|AndroidBuild {
message("Skipping support for video streaming (GStreamer libraries not installed)")
...
...
src/VideoStreaming/gstqtvideosink/utils/glutils.h
View file @
32a13b19
...
...
@@ -16,7 +16,7 @@
#pragma once
#if defined(__
mobile__) && !defined(Q_OS_MAC
)
#if defined(__
andoid__) || defined(__ios__
)
#include <QOpenGLFunctions>
#define getQOpenGLFunctions() QOpenGLContext::currentContext()->functions()
#define QOpenGLFunctionsDef QOpenGLFunctions
...
...
src/VideoStreaming/iOS/gst_ios_init.h
0 → 100644
View file @
32a13b19
#ifndef __GST_IOS_INIT_H__
#define __GST_IOS_INIT_H__
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_G_IO_MODULE_DECLARE(name) \
extern void G_PASTE(g_io_module_, G_PASTE(name, _load_static)) (void)
#define GST_G_IO_MODULE_LOAD(name) \
G_PASTE(g_io_module_, G_PASTE(name, _load_static)) ()
/* Uncomment each line to enable the plugin categories that your application needs.
* You can also enable individual plugins. See gst_ios_init.c to see their names
*/
//#define GST_IOS_PLUGINS_GES
#define GST_IOS_PLUGINS_CORE
//#define GST_IOS_PLUGINS_CAPTURE
//#define GST_IOS_PLUGINS_CODECS_RESTRICTED
//#define GST_IOS_PLUGINS_ENCODING
//#define GST_IOS_PLUGINS_CODECS_GPL
//#define GST_IOS_PLUGINS_NET_RESTRICTED
//#define GST_IOS_PLUGINS_SYS
//#define GST_IOS_PLUGINS_VIS
//#define GST_IOS_PLUGINS_PLAYBACK
//#define GST_IOS_PLUGINS_EFFECTS
//#define GST_IOS_PLUGINS_CODECS
#define GST_IOS_PLUGINS_NET
//-- Specific to QGC
#define GST_IOS_PLUGIN_X264
#define GST_IOS_PLUGIN_LIBAV
#define GST_IOS_PLUGIN_ISOMP4
#define GST_IOS_PLUGIN_VIDEOPARSERSBAD
#define GST_IOS_PLUGIN_MATROSKA
//#define GST_IOS_GIO_MODULE_GNUTLS
void
gst_ios_init
(
void
);
G_END_DECLS
#endif
src/VideoStreaming/iOS/gst_ios_init.m
0 → 100644
View file @
32a13b19
This diff is collapsed.
Click to expand it.
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