Skip to content

Commit

Permalink
Linux: Fix AppRun for GStreamer
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Oct 17, 2024
1 parent 13031c3 commit c466b51
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
28 changes: 14 additions & 14 deletions deploy/linux/AppRun
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash

set -e
if [ -z "$APPDIR" ]; then
APPDIR="$(dirname "$(readlink -f "$0")")"
fi

HERE="$(dirname "$(readlink -f "${0}")")"

# export LD_LIBRARY_PATH="$HERE/usr/lib:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${APPDIR}/usr/lib/gstreamer-1.0:${LD_LIBRARY_PATH}"

export GST_REGISTRY_REUSE_PLUGIN_SCANNER="no"
export GIO_EXTRA_MODULES="$HERE/usr/lib/gio/modules"
export GIO_EXTRA_MODULES="${APPDIR}/usr/lib/gio/modules"

export GST_PLUGIN_SYSTEM_PATH="$HERE/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH_1_0="$HERE/usr/lib/gstreamer-1.0"
export GST_PLUGIN_PATH="$HERE/usr/lib/gstreamer-1.0"
export GST_PLUGIN_PATH_1_0="$HERE/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SCANNER="$HERE/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
export GST_PLUGIN_SCANNER_1_0="$HERE/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
export GST_PTP_HELPER="$HERE/usr/lib/gstreamer1.0/gstreamer-1.0/gst-ptp-helper"
export GST_PTP_HELPER_1_0="$HERE/usr/lib/gstreamer1.0/gstreamer-1.0/gst-ptp-helper"
export GST_PLUGIN_SYSTEM_PATH="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_PATH="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SCANNER="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
export GST_PLUGIN_SCANNER_1_0="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
export GST_PTP_HELPER="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-ptp-helper"
export GST_PTP_HELPER_1_0="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-ptp-helper"

exec "$HERE/usr/bin/QGroundControl" "$@"
exec "${APPDIR}/usr/bin/QGroundControl" "$@"
13 changes: 7 additions & 6 deletions src/VideoManager/VideoReceiver/GStreamer/GStreamer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ GST_PLUGIN_STATIC_DECLARE(mpegtsdemux);
GST_PLUGIN_STATIC_DECLARE(opengl);
GST_PLUGIN_STATIC_DECLARE(tcp);
GST_PLUGIN_STATIC_DECLARE(asf);
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_MAC)
GST_PLUGIN_STATIC_DECLARE(va);
#endif
// #ifndef Q_OS_ANDROID
// GST_PLUGIN_STATIC_DECLARE(va);
// #endif
#ifdef Q_OS_ANDROID
GST_PLUGIN_STATIC_DECLARE(androidmedia);
#elif defined(Q_OS_IOS)
Expand Down Expand Up @@ -115,6 +115,7 @@ static void _setGstEnvVars()
_qgcputenv("GST_PLUGIN_SYSTEM_PATH", currentDir, "/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0");
_qgcputenv("GST_PLUGIN_PATH_1_0", currentDir, "/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0");
_qgcputenv("GST_PLUGIN_PATH", currentDir, "/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0");
_qgcputenv("GTK_PATH", currentDir, "/../Frameworks/GStreamer.framework/Versions/1.0");
#elif defined(Q_OS_WIN)
_qgcputenv("GST_REGISTRY_REUSE_PLUGIN_SCANNER", "no");
_qgcputenv("GST_PLUGIN_SCANNER", currentDir, "/../libexec/gstreamer-1.0/gst-plugin-scanner");
Expand Down Expand Up @@ -145,9 +146,9 @@ static void _registerPlugins()
GST_PLUGIN_STATIC_REGISTER(opengl);
GST_PLUGIN_STATIC_REGISTER(tcp);
GST_PLUGIN_STATIC_REGISTER(asf);
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_MAC)
GST_PLUGIN_STATIC_REGISTER(va);
#endif
// #ifndef Q_OS_ANDROID
// GST_PLUGIN_STATIC_REGISTER(va);
// #endif
#ifdef Q_OS_ANDROID
GST_PLUGIN_STATIC_REGISTER(androidmedia);
#elif defined(Q_OS_IOS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ endif()

if(LINUX)
install(DIRECTORY ${GSTREAMER_LIB_PATH}/gstreamer1.0 DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(CODE "execute_process(COMMAND chmod +x \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner\")")
install(CODE "execute_process(COMMAND chmod +x \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/gstreamer1.0/gstreamer-1.0/gst-ptp-helper\")")
install(DIRECTORY ${GSTREAMER_LIB_PATH}/gio DESTINATION ${CMAKE_INSTALL_LIBDIR})
get_target_property(LINKED_PLUGINS GStreamer::Plugins INTERFACE_LINK_LIBRARIES)
install(FILES ${LINKED_PLUGINS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gstreamer-1.0)
Expand Down

0 comments on commit c466b51

Please sign in to comment.