From 6b300252187e4856920795ae412d0537f630c518 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 11 Aug 2016 13:23:58 -0700 Subject: [PATCH 1/4] Fix GStreamer setup --- src/VideoStreaming/VideoStreaming.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/VideoStreaming/VideoStreaming.cc b/src/VideoStreaming/VideoStreaming.cc index 92bd7e8..4b45adb 100644 --- a/src/VideoStreaming/VideoStreaming.cc +++ b/src/VideoStreaming/VideoStreaming.cc @@ -42,16 +42,12 @@ #endif #if defined(QGC_GST_STREAMING) -#if defined(__macos__) -#ifdef QGC_INSTALL_RELEASE static void qgcputenv(const QString& key, const QString& root, const QString& path) { QString value = root + path; qputenv(key.toStdString().c_str(), QByteArray(value.toStdString().c_str())); } #endif -#endif -#endif void initializeVideoStreaming(int &argc, char* argv[]) { @@ -67,6 +63,9 @@ void initializeVideoStreaming(int &argc, char* argv[]) 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"); #endif + #elif defined(Q_OS_WIN) + QString currentDir = QCoreApplication::applicationDirPath(); + qgcputenv("GST_PLUGIN_PATH", currentDir, "/gstreamer-plugins"); #endif // Initialize GStreamer GError* error = NULL; From 3340dd7b1a87fcc60dcdee582d0cfc079c7345f3 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 11 Aug 2016 13:24:10 -0700 Subject: [PATCH 2/4] Fix GStreamer setup --- src/VideoStreaming/VideoStreaming.pri | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/VideoStreaming/VideoStreaming.pri b/src/VideoStreaming/VideoStreaming.pri index 554c2bd..51b8d4b 100644 --- a/src/VideoStreaming/VideoStreaming.pri +++ b/src/VideoStreaming/VideoStreaming.pri @@ -51,29 +51,25 @@ LinuxBuild { GST_ROOT = c:/gstreamer/1.0/x86 exists($$GST_ROOT) { CONFIG += VideoEnabled - LIBS += -L$$GST_ROOT/lib/gstreamer-1.0/static -lgstreamer-1.0 -lgstvideo-1.0 -lgstbase-1.0 - LIBS += -L$$GST_ROOT/lib -lglib-2.0 -lintl -lgobject-2.0 + + LIBS += -L$$GST_ROOT/lib -lgstreamer-1.0 -lgstvideo-1.0 -lgstbase-1.0 + LIBS += -lglib-2.0 -lintl -lgobject-2.0 + INCLUDEPATH += \ $$GST_ROOT/include/gstreamer-1.0 \ $$GST_ROOT/include/glib-2.0 \ $$GST_ROOT/lib/gstreamer-1.0/include \ - $$GST_ROOT/lib/glib-2.0/include - COPY_FILE_LIST = \ - $$GST_ROOT\\bin\\libffi-6.dll \ - $$GST_ROOT\\bin\\libglib-2.0-0.dll \ - $$GST_ROOT\\bin\\libgmodule-2.0-0.dll \ - $$GST_ROOT\\bin\\libgobject-2.0-0.dll \ - $$GST_ROOT\\bin\\libgstbase-1.0-0.dll \ - $$GST_ROOT\\bin\\libgstreamer-1.0-0.dll \ - $$GST_ROOT\\bin\\libgstvideo-1.0-0.dll \ - $$GST_ROOT\\bin\\libintl-8.dll \ - $$GST_ROOT\\bin\\liborc-0.4-0.dll \ - $$GST_ROOT\\bin\\libwinpthread-1.dll + $$GST_ROOT/lib/glib-2.0/include + DESTDIR_WIN = $$replace(DESTDIR, "/", "\\") - for(COPY_FILE, COPY_FILE_LIST) { - QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$COPY_FILE\" \"$$DESTDIR_WIN\" - } - QMAKE_POST_LINK += $$escape_expand(\\n) + GST_ROOT_WIN = $$replace(GST_ROOT, "/", "\\") + + # Copy main GStreamer runtime files + QMAKE_POST_LINK += $$escape_expand(\\n) xcopy \"$$GST_ROOT_WIN\\bin\*.dll\" \"$$DESTDIR_WIN\" /S/Y $$escape_expand(\\n) + QMAKE_POST_LINK += xcopy \"$$GST_ROOT_WIN\\bin\*.\" \"$$DESTDIR_WIN\" /S/Y $$escape_expand(\\n) + + # Copy GStreamer plugins + QMAKE_POST_LINK += $$escape_expand(\\n) xcopy \"$$GST_ROOT_WIN\\lib\\gstreamer-1.0\\*.dll\" \"$$DESTDIR_WIN\\gstreamer-plugins\\\" /S/Y $$escape_expand(\\n) } } else:AndroidBuild { #- gstreamer assumed to be installed in $$PWD/../../android/gstreamer-1.0-android-armv7-1.5.2 From bd19fc83ff381cc2c5db0b22508eb79fb8d02d75 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 11 Aug 2016 16:19:47 -0700 Subject: [PATCH 3/4] Fix compiler warning --- src/VideoStreaming/VideoStreaming.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/VideoStreaming/VideoStreaming.cc b/src/VideoStreaming/VideoStreaming.cc index 4b45adb..3b1662c 100644 --- a/src/VideoStreaming/VideoStreaming.cc +++ b/src/VideoStreaming/VideoStreaming.cc @@ -42,12 +42,14 @@ #endif #if defined(QGC_GST_STREAMING) +#if (defined(__macos) && defined(QGC_INSTALL_RELEASE)) || defined(Q_OS_WIN) static void qgcputenv(const QString& key, const QString& root, const QString& path) { QString value = root + path; qputenv(key.toStdString().c_str(), QByteArray(value.toStdString().c_str())); } #endif +#endif void initializeVideoStreaming(int &argc, char* argv[]) { From 4d1db1a1633f7a1e4b6ba86a144e1e031fc8092c Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 11 Aug 2016 18:45:00 -0700 Subject: [PATCH 4/4] Fix type --- src/VideoStreaming/VideoStreaming.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VideoStreaming/VideoStreaming.cc b/src/VideoStreaming/VideoStreaming.cc index 3b1662c..69c2fa9 100644 --- a/src/VideoStreaming/VideoStreaming.cc +++ b/src/VideoStreaming/VideoStreaming.cc @@ -42,7 +42,7 @@ #endif #if defined(QGC_GST_STREAMING) -#if (defined(__macos) && defined(QGC_INSTALL_RELEASE)) || defined(Q_OS_WIN) +#if (defined(__macos__) && defined(QGC_INSTALL_RELEASE)) || defined(Q_OS_WIN) static void qgcputenv(const QString& key, const QString& root, const QString& path) { QString value = root + path;