diff --git a/src/VideoStreaming/VideoStreaming.cc b/src/VideoStreaming/VideoStreaming.cc index 92bd7e87d9ee63c5f7006b1d87e1086aec7fe66e..69c2fa9b92067e7092dd4de0b8fdbf933ef66ac4 100644 --- a/src/VideoStreaming/VideoStreaming.cc +++ b/src/VideoStreaming/VideoStreaming.cc @@ -42,8 +42,7 @@ #endif #if defined(QGC_GST_STREAMING) -#if defined(__macos__) -#ifdef QGC_INSTALL_RELEASE +#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; @@ -51,7 +50,6 @@ static void qgcputenv(const QString& key, const QString& root, const QString& pa } #endif #endif -#endif void initializeVideoStreaming(int &argc, char* argv[]) { @@ -67,6 +65,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; diff --git a/src/VideoStreaming/VideoStreaming.pri b/src/VideoStreaming/VideoStreaming.pri index 554c2bd0faba62f1050bd072449590756fb1c5d4..51b8d4b65045f5646439c49aa05d6c082f3b100b 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