diff --git a/.github/actions/gstreamer/action.yml b/.github/actions/gstreamer/action.yml index 89e97b36db5..58cfc117c3c 100644 --- a/.github/actions/gstreamer/action.yml +++ b/.github/actions/gstreamer/action.yml @@ -4,7 +4,7 @@ inputs: gst_version: description: Version of GStreamer to Build required: true - default: 1.22.11 + default: 1.22.12 build_type: description: Build Type "release" or "debug" required: true @@ -25,7 +25,10 @@ runs: run: git clone --depth 1 --branch ${{ inputs.gst_version }} https://github.com/GStreamer/gstreamer.git shell: bash - # macos https://github.com/Homebrew/homebrew-core/blob/4e00e17ab49b90949c27cf43a873ca923f3735aa/Formula/g/gstreamer.rb + - name: Install Dependencies + run: python3 -m pip install --user ninja meson + shell: bash + - name: Configure GStreamer working-directory: ${{ inputs.working_directory }}/gstreamer run: meson setup @@ -35,7 +38,7 @@ runs: --wrap-mode=forcefallback --strip -Dauto_features=disabled - -Dgst-full-libraries=gstreamer,base,controller,net,app,audio,fft,pbutils,riff,rtp,rtsp,tag,video,gl,codecparsers,photography + -Dgst-full-libraries=gstreamer,base,video,gl -Dgpl=enabled -Dlibav=enabled -Dorc=enabled @@ -88,5 +91,11 @@ runs: - name: Setup Environment working-directory: ${{ runner.temp }}/gstreamer - run: echo "PKG_CONFIG_PATH=${{ runner.temp }}/gst/lib/x86_64-linux-gnu/pkgconfig:${{ env.PKG_CONFIG_PATH }}" >> "$GITHUB_ENV" + run: echo "PKG_CONFIG_PATH=${{ inputs.install_directory }}/lib/x86_64-linux-gnu/pkgconfig:${{ inputs.install_directory }}/lib/x86_64-linux-gnu/gstreamer-1.0/pkgconfig:${{ env.PKG_CONFIG_PATH }}" >> "$GITHUB_ENV" shell: bash + + - name: Save artifact + uses: actions/upload-artifact@v4 + with: + name: GStreamer-${{ inputs.build_type }} + path: ${{ inputs.install_directory }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b41104b729d..59a79602712 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -41,6 +41,8 @@ jobs: steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main + with: + large-packages: false continue-on-error: true - name: Checkout repo diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 5a5e851f51b..12155f1ad8e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -56,7 +56,8 @@ jobs: - name: Install Dependencies run: | brew update - brew install cmake ninja ccache geographiclib SDL2 exiv2 expat zlib shapelib + brew install cmake ninja ccache geographiclib SDL2 exiv2 expat zlib shapelib pkgconfig + # pkgconf - name: Install Gstreamer run: | @@ -65,6 +66,7 @@ jobs: for package in *.pkg ; do sudo installer -verbose -pkg "$package" -target / done + echo "PKG_CONFIG_PATH=/Library/Frameworks/GStreamer.framework/lib/pkgconfig:/Library/Frameworks/GStreamer.framework/lib/gstreamer-1.0/pkgconfig:${{ env.PKG_CONFIG_PATH }}" >> "$GITHUB_ENV" - name: Set Up Cache uses: hendrikmuhs/ccache-action@v1.2 diff --git a/cmake/CreateAppImage.cmake b/cmake/CreateAppImage.cmake index e7599d8406b..0606da935fe 100644 --- a/cmake/CreateAppImage.cmake +++ b/cmake/CreateAppImage.cmake @@ -2,25 +2,26 @@ message(STATUS "Creating AppImage") # TODO: https://github.com/AppImageCommunity/AppImageUpdate set(APPDIR_PATH "${CMAKE_BINARY_DIR}/AppDir") -# set(APPIMAGETOOL_PATH "${CMAKE_BINARY_DIR}/appimagetool-x86_64.AppImage") +set(APPIMAGETOOL_PATH "${CMAKE_BINARY_DIR}/appimagetool-x86_64.AppImage") set(LD_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-x86_64.AppImage") -set(LD_APPIMAGEPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-appimage-x86_64.AppImage") +# set(LD_APPIMAGEPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-appimage-x86_64.AppImage") # set(LD_QTPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-qt-x86_64.AppImage") # set(LD_GSTPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-gstreamer.sh") # set(LD_GTKPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-gtk.sh") -# if(NOT EXISTS "${APPIMAGETOOL_PATH}") -# file(DOWNLOAD https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage "${APPIMAGETOOL_PATH}") -# execute_process(COMMAND chmod a+x "${APPIMAGETOOL_PATH}") -# endif() +if(NOT EXISTS "${APPIMAGETOOL_PATH}") + file(DOWNLOAD https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage "${APPIMAGETOOL_PATH}") + # file(DOWNLOAD https://github.com/probonopd/go-appimage/releases/download/832/appimagetool-823-x86_64.AppImage "${APPIMAGETOOL_PATH}") # TODO: Use Continuous Release + execute_process(COMMAND chmod a+x "${APPIMAGETOOL_PATH}") +endif() if(NOT EXISTS "${LD_PATH}") file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage "${LD_PATH}") execute_process(COMMAND chmod a+x "${LD_PATH}") endif() -if(NOT EXISTS "${LD_APPIMAGEPLUGIN_PATH}") - file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage "${LD_APPIMAGEPLUGIN_PATH}") - execute_process(COMMAND chmod a+x "${LD_APPIMAGEPLUGIN_PATH}") -endif() +# if(NOT EXISTS "${LD_APPIMAGEPLUGIN_PATH}") +# file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage "${LD_APPIMAGEPLUGIN_PATH}") +# execute_process(COMMAND chmod a+x "${LD_APPIMAGEPLUGIN_PATH}") +# endif() # if(NOT EXISTS "${LD_QTPLUGIN_PATH}") # file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage "${LD_QTPLUGIN_PATH}") # execute_process(COMMAND chmod a+x "${LD_QTPLUGIN_PATH}") @@ -34,17 +35,14 @@ endif() # execute_process(COMMAND chmod a+x "${LD_GSTPLUGIN_PATH}") # endif() -execute_process(COMMAND ${LD_PATH} --appdir ${APPDIR_PATH} --output appimage --custom-apprun ${CMAKE_BINARY_DIR}/AppRun) -# --exclude-library "libX*" -# --exclude-library "libglib*" -# --exclude-library "libgobject*" -# --exclude-library "libgdk_pixbuf*" -# --exclude-library "libwayland*" -# --exclude-library "libgmodule*" -# --exclude-library "libgio*" -# --exclude-library "libxcb*" -# --exclude-library "libxkbcommon*" -# --exclude-library "libdb*" +execute_process(COMMAND ${LD_PATH} + --appdir ${APPDIR_PATH} + --executable ${APPDIR_PATH}/usr/bin/QGroundControl + --desktop-file ${APPDIR_PATH}/usr/share/applications/org.mavlink.qgroundcontrol.desktop + --custom-apprun ${CMAKE_BINARY_DIR}/AppRun) # --exclude-library "libgst*" -# --exclude-library "libgthread*" # --plugin qt --plugin gtk --plugin gstreamer + +set(ENV{ARCH} x86_64) +# set(ENV{VERSION} 5.0) +execute_process(COMMAND ${APPIMAGETOOL_PATH} ${APPDIR_PATH}) diff --git a/cmake/find-modules/FindGStreamer.cmake b/cmake/find-modules/FindGStreamer.cmake index 5bd6b2230bf..c1102892bab 100644 --- a/cmake/find-modules/FindGStreamer.cmake +++ b/cmake/find-modules/FindGStreamer.cmake @@ -52,7 +52,15 @@ elseif(MACOS) set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/pkgconfig:${GSTREAMER_PREFIX}/lib/gstreamer-1.0/pkgconfig:$ENV{PKG_CONFIG_PATH}") elseif(LINUX) set(GSTREAMER_PREFIX "/usr") - set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu/pkgconfig:$ENV{PKG_CONFIG_PATH}") + set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu/pkgconfig:${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu/gstreamer-1.0/pkgconfig:$ENV{PKG_CONFIG_PATH}") + # if(QGC_GST_STATIC_BUILD) + # list(APPEND PKG_CONFIG_ARGN + # --dont-define-prefix + # --define-variable=prefix=${GSTREAMER_PREFIX} + # --define-variable=libdir=${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu + # --define-variable=includedir=${GSTREAMER_PREFIX}/include + # ) + # endif() elseif(IOS) list(APPEND CMAKE_FRAMEWORK_PATH "~/Library/Developer/GStreamer/iPhone.sdk") if(DEFINED ENV{GSTREAMER_PREFIX_IOS} AND EXISTS $ENV{GSTREAMER_PREFIX_IOS}) @@ -104,7 +112,7 @@ elseif(ANDROID) set(PKG_CONFIG_EXECUTABLE ${PKG_CONFIG_PROGRAM}) set(ENV{PKG_CONFIG_LIBDIR} "${GSTREAMER_PREFIX}/lib/pkgconfig;${GSTREAMER_PREFIX}/lib/gstreamer-1.0/pkgconfig") endif() - elseif(CMAKE_HOST_LINUX) + elseif(CMAKE_HOST_LINUX OR CMAKE_HOST_APPLE) if(PkgConfig_FOUND) set(ENV{PKG_CONFIG_LIBDIR} "${GSTREAMER_PREFIX}/lib/pkgconfig:${GSTREAMER_PREFIX}/lib/gstreamer-1.0/pkgconfig") endif() @@ -120,6 +128,16 @@ endif() list(PREPEND CMAKE_PREFIX_PATH ${GSTREAMER_PREFIX}) cmake_print_variables(GSTREAMER_PREFIX) +# TODO: find_path +if(LINUX) + set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu) +elseif(MACOS OR ANDROID OR WIN32) + set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib) +elseif(IOS) + +endif() +cmake_print_variables(GSTREAMER_LIB_PATH) + ################################################################################ include(CMakeFindDependencyMacro) @@ -238,6 +256,7 @@ function(find_gstreamer_component component) target_link_libraries(GStreamer::${component} INTERFACE ${ARGS_DEPENDENCIES}) endif() set_target_properties(GStreamer::${component} PROPERTIES VERSION ${GStreamer_VERSION}) + cmake_print_variables(component) endif() mark_as_advanced(GStreamer_${component}_INCLUDE_DIR GStreamer_${component}_LIBRARY) endif() @@ -276,18 +295,42 @@ find_gstreamer_component(Gl ################################################################################ +set(GST_DEPENDENCIES) +find_package(GLESv2 QUIET) +list(APPEND GST_DEPENDENCIES GLESv2::GLESv2) +find_package(OpenGL QUIET OPTIONAL_COMPONENTS EGL GLX OpenGL) # GLES2 GLES3 +list(APPEND GST_DEPENDENCIES OpenGL::GL OpenGL::EGL OpenGL::GLX OpenGL::OpenGL) +find_package(X11_XCB QUIET) +list(APPEND GST_DEPENDENCIES X11::XCB) +find_package(EGL QUIET) +list(APPEND GST_DEPENDENCIES EGL::EGL) +pkg_check_modules(PC_libdrm IMPORTED_TARGET libdrm) +list(APPEND GST_DEPENDENCIES PkgConfig::PC_libdrm) +pkg_check_modules(PC_gudev IMPORTED_TARGET gudev-1.0) +list(APPEND GST_DEPENDENCIES PkgConfig::PC_gudev) +cmake_print_variables(GST_DEPENDENCIES) + +################################################################################ + if(Allocators IN_LIST GStreamer_FIND_COMPONENTS) find_gstreamer_component(Allocators PC_NAME gstreamer-allocators-1.0 HEADER gst/allocators/allocators.h LIBRARY gstallocators-1.0 DEPENDENCIES GStreamer::Core) + + if(TARGET GStreamer::Allocators) + pkg_check_modules(PC_libdrm IMPORTED_TARGET libdrm) + if(TARGET PkgConfig::PC_libdrm) + target_link_libraries(GStreamer::Allocators INTERFACE PkgConfig::PC_libdrm) + endif() + endif() endif() if(App IN_LIST GStreamer_FIND_COMPONENTS) find_gstreamer_component(App PC_NAME gstreamer-app-1.0 - HEADER gst/app/gstappsink.h + HEADER gst/app/app.h LIBRARY gstapp-1.0 DEPENDENCIES GStreamer::Core GStreamer::Base) endif() @@ -319,51 +362,84 @@ endif() if(Fft IN_LIST GStreamer_FIND_COMPONENTS) find_gstreamer_component(Fft PC_NAME gstreamer-fft-1.0 - HEADER gst/fft/cfft.h + HEADER gst/fft/fft.h LIBRARY gstfft-1.0 DEPENDENCIES GStreamer::Core) endif() if(GlEgl IN_LIST GStreamer_FIND_COMPONENTS) - # find_package(EGL) find_gstreamer_component(GlEgl PC_NAME gstreamer-gl-egl-1.0 - HEADER gst/gl/egl/gstgldisplay_egl.h + HEADER gst/gl/egl/egl.h LIBRARY gstgl-1.0 - DEPENDENCIES GStreamer::Gl EGL::EGL) + DEPENDENCIES GStreamer::Gl) + + if(TARGET GStreamer::GlEgl) + find_package(EGL QUIET) + if(TARGET EGL::EGL) + target_link_libraries(GStreamer::GlEgl INTERFACE EGL::EGL) + endif() + endif() endif() if(GlPrototypes IN_LIST GStreamer_FIND_COMPONENTS) - # find_package(GLESv2) - # find_package(OpenGL OPTIONAL_COMPONENTS EGL GLX OpenGL) # GLES2 GLES3 find_gstreamer_component(GlPrototypes PC_NAME gstreamer-gl-prototypes-1.0 HEADER gst/gl/glprototypes/all_functions.h LIBRARY gstglproto-1.0 - DEPENDENCIES GStreamer::Gl GLESv2::GLESv2 OpenGL::GL) + DEPENDENCIES GStreamer::Gl) + + if(TARGET GStreamer::GlPrototypes) + find_package(GLESv2 QUIET) + find_package(OpenGL QUIET) + set(GlPrototypes_DEPENDENCIES GLESv2::GLESv2 OpenGL::GL) + foreach(dependency IN LISTS GlPrototypes_DEPENDENCIES) + if(TARGET ${dependency}) + target_link_libraries(GStreamer::GlPrototypes INTERFACE ${dependency}) + endif() + endforeach() + endif() endif() if(GlWayland IN_LIST GStreamer_FIND_COMPONENTS) - # find_package(Wayland COMPONENTS Client Cursor Egl) - # find_package(WaylandProtocols) - # find_package(WaylandScanner) - # find_package(Qt6 COMPONENTS WaylandClient) find_gstreamer_component(GlWayland PC_NAME gstreamer-gl-wayland-1.0 - HEADER gst/gl/wayland/gstgldisplay_wayland.h + HEADER gst/gl/wayland/wayland.h LIBRARY gstgl-1.0 - DEPENDENCIES GStreamer::Gl Wayland::EGL Wayland::Client) + DEPENDENCIES GStreamer::Gl) + + if(TARGET GStreamer::GlWayland) + find_package(Wayland QUIET COMPONENTS Client Cursor Egl) + # find_package(WaylandProtocols QUIET) + # find_package(WaylandScanner QUIET) + # find_package(Qt6 QUIET COMPONENTS WaylandClient) + set(GlWayland_DEPENDENCIES Wayland::Client Wayland::Cursor Wayland::Egl) + foreach(dependency IN LISTS GlWayland_DEPENDENCIES) + if(TARGET ${dependency}) + target_link_libraries(GStreamer::GlWayland INTERFACE ${dependency}) + endif() + endforeach() + endif() endif() if(GlX11 IN_LIST GStreamer_FIND_COMPONENTS) - # find_package(X11) - # find_package(XCB COMPONENTS XCB GLX) - # find_package(X11_XCB) find_gstreamer_component(GlX11 PC_NAME gstreamer-gl-x11-1.0 - HEADER gst/gl/x11/gstgldisplay_x11.h + HEADER gst/gl/x11/x11.h LIBRARY gstgl-1.0 - DEPENDENCIES GStreamer::Gl X11::XCB) + DEPENDENCIES GStreamer::Gl) + + if(TARGET GStreamer::GlX11) + # find_package(X11 QUIET) + # find_package(XCB QUIET) + find_package(X11_XCB QUIET) + set(GlX11_DEPENDENCIES X11::XCB) + foreach(dependency IN LISTS GlX11_DEPENDENCIES) + if(TARGET ${dependency}) + target_link_libraries(GStreamer::GlX11 INTERFACE ${dependency}) + endif() + endforeach() + endif() endif() if(Mpegts IN_LIST GStreamer_FIND_COMPONENTS) @@ -463,12 +539,15 @@ if(Tag IN_LIST GStreamer_FIND_COMPONENTS) endif() if(Va IN_LIST GStreamer_FIND_COMPONENTS) - # find_package(VAAPI) find_gstreamer_component(Va PC_NAME gstreamer-va-1.0 HEADER gst/va/gstva.h LIBRARY gstva-1.0 DEPENDENCIES GStreamer::Core GStreamer::Video) + + if(TARGET GSreamer::Va) + find_package(VAAPI QUIET) + endif() endif() ################################################################################ @@ -516,39 +595,34 @@ if(QGC_GST_STATIC_BUILD) target_compile_definitions(GStreamer::GStreamer INTERFACE QGC_GST_STATIC_BUILD) endif() -# TODO: find_path -if(LINUX) - set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu) -elseif(MACOS) - set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib) -elseif(ANDROID OR WIN32) - set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib) -elseif(IOS) - -endif() -set(GSTREAMER_PLUGIN_PATH ${GSTREAMER_LIB_PATH}/gstreamer-1.0) +foreach(dependency IN LISTS GST_DEPENDENCIES) + if(TARGET ${dependency}) + cmake_print_variables(dependency) + target_link_libraries(GStreamer::GStreamer INTERFACE ${dependency}) + endif() +endforeach() target_include_directories(GStreamer::GStreamer INTERFACE ${GSTREAMER_PREFIX}/include ${GSTREAMER_PREFIX}/include/glib-2.0 - ${GSTREAMER_PREFIX}/include/graphene-1.0 ${GSTREAMER_PREFIX}/include/gstreamer-1.0 ${GSTREAMER_LIB_PATH}/glib-2.0/include - ${GSTREAMER_LIB_PATH}/graphene-1.0/include - ${GSTREAMER_PLUGIN_PATH}/include + # ${GSTREAMER_PREFIX}/include/graphene-1.0 + # ${GSTREAMER_LIB_PATH}/graphene-1.0/include ) -target_link_directories(GStreamer::GStreamer - INTERFACE - ${GSTREAMER_LIB_PATH} - ${GSTREAMER_PLUGIN_PATH} -) +target_link_directories(GStreamer::GStreamer INTERFACE ${GSTREAMER_LIB_PATH}) ################################################################################ add_library(GStreamer::Plugins INTERFACE IMPORTED) +set(GSTREAMER_PLUGIN_PATH ${GSTREAMER_LIB_PATH}/gstreamer-1.0) +target_include_directories(GStreamer::GStreamer INTERFACE ${GSTREAMER_PLUGIN_PATH}/include) +target_link_directories(GStreamer::GStreamer INTERFACE ${GSTREAMER_PLUGIN_PATH}) +cmake_print_variables(GSTREAMER_PLUGIN_PATH) + set(GST_PLUGINS gstcoreelements gstisomp4 @@ -596,6 +670,10 @@ foreach(plugin IN LISTS GST_PLUGINS) set(GST_PLUGIN_${plugin}_FOUND TRUE) endif() endif() + + # if(GST_PLUGIN_${plugin}_FOUND) + # cmake_print_variables(plugin) + # endif() endforeach() if(NOT MACOS) diff --git a/deploy/linux/AppRun b/deploy/linux/AppRun index 1373a15a9da..761682126e8 100755 --- a/deploy/linux/AppRun +++ b/deploy/linux/AppRun @@ -1,21 +1,23 @@ #!/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="${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" -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 QT_QPA_PLATFORM="xcb" -exec "$HERE/usr/bin/QGroundControl" "$@" +exec "${APPDIR}/usr/bin/QGroundControl" "$@" diff --git a/src/VideoManager/VideoReceiver/GStreamer/GStreamer.cc b/src/VideoManager/VideoReceiver/GStreamer/GStreamer.cc index 7635b30d1ad..6ef042f4810 100644 --- a/src/VideoManager/VideoReceiver/GStreamer/GStreamer.cc +++ b/src/VideoManager/VideoReceiver/GStreamer/GStreamer.cc @@ -38,10 +38,10 @@ GST_PLUGIN_STATIC_DECLARE(matroska); 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 +// GST_PLUGIN_STATIC_DECLARE(asf); +// #ifndef Q_OS_ANDROID +// GST_PLUGIN_STATIC_DECLARE(va); +// #endif #ifdef Q_OS_ANDROID GST_PLUGIN_STATIC_DECLARE(androidmedia); #elif defined(Q_OS_IOS) @@ -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"); @@ -144,10 +145,10 @@ static void _registerPlugins() GST_PLUGIN_STATIC_REGISTER(mpegtsdemux); 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 + // GST_PLUGIN_STATIC_REGISTER(asf); +// #ifndef Q_OS_ANDROID +// GST_PLUGIN_STATIC_REGISTER(va); +// #endif #ifdef Q_OS_ANDROID GST_PLUGIN_STATIC_REGISTER(androidmedia); #elif defined(Q_OS_IOS) diff --git a/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt b/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt index ae73d784916..67b7b03ca0d 100644 --- a/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt +++ b/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt @@ -1,5 +1,7 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) -find_package(GStreamer REQUIRED COMPONENTS Allocators Audio Codecparsers Controller Fft Mpegts Net Pbutils Riff Rtp Rtsp Sdp Tag OPTIONAL_COMPONENTS Photography GlPrototypes Va GlX11 GlEGL GlWayland) + +set(GST_COMPONENTS Allocators Audio Codecparsers Controller Fft GlEGL GlPrototypes GlWayland GlX11 Mpegts Net Pbutils Photography Riff Rtp Rtsp Sdp Tag Va) +find_package(GStreamer REQUIRED COMPONENTS OPTIONAL_COMPONENTS ${GST_COMPONENTS}) qt_add_library(gstqml6gl STATIC) @@ -12,33 +14,13 @@ target_link_libraries(gstqml6gl Qt6::Qml Qt6::Quick GStreamer::GStreamer - GStreamer::Allocators - GStreamer::Audio - GStreamer::Codecparsers - GStreamer::Controller - GStreamer::Fft - GStreamer::Mpegts - GStreamer::Net - GStreamer::Pbutils - GStreamer::Riff - GStreamer::Rtp - GStreamer::Rtsp - GStreamer::Sdp - GStreamer::Tag ) -# Photography not found on ubuntu 20.04? -if(GStreamer_Photography_FOUND) - target_link_libraries(gstqml6gl PUBLIC GStreamer::Photography) -endif() - -if(GStreamer_GlPrototypes_FOUND) - target_link_libraries(gstqml6gl PUBLIC GStreamer::GlPrototypes) -endif() - -if(GStreamer_Va_FOUND) - target_link_libraries(gstqml6gl PUBLIC GStreamer::Va) -endif() +foreach(component IN LISTS GST_COMPONENTS) + if(GStreamer_${component}_FOUND) + target_link_libraries(gstqml6gl PUBLIC GStreamer::${component}) + endif() +endforeach() ################################################################################ @@ -56,6 +38,8 @@ else() endif() cmake_print_variables(QGC_GST_QT6_PLUGIN_PATH) +# TODO: https://gstreamer.freedesktop.org/documentation/qt6d3d11/index.html#qml6d3d11sink-page + ################################################################################ file(READ ${QGC_GST_QT6_PLUGIN_PATH}/qt6glitem.h FILE_CONTENTS) @@ -78,17 +62,14 @@ target_include_directories(gstqml6gl PUBLIC ${QGC_GST_QT6_PLUGIN_PATH}) ################################################################################ if(GStreamer_GlX11_FOUND) - target_link_libraries(gstqml6gl PUBLIC GStreamer::GlX11) target_compile_definitions(gstqml6gl PRIVATE HAVE_QT_X11) endif() if(GStreamer_GlEGL_FOUND) - target_link_libraries(gstqml6gl PUBLIC GStreamer::GlEGL) target_compile_definitions(gstqml6gl PRIVATE HAVE_QT_EGLFS) endif() if(GStreamer_GlWayland_FOUND) - target_link_libraries(gstqml6gl PUBLIC GStreamer::GlWayland) target_compile_definitions(gstqml6gl PRIVATE HAVE_QT_WAYLAND) endif() @@ -167,10 +148,14 @@ endif() ################################################################################ if(LINUX) - install(DIRECTORY ${GSTREAMER_LIB_PATH}/gstreamer1.0 DESTINATION ${CMAKE_INSTALL_LIBDIR}) - 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) + # if(NOT QGC_GST_STATIC_BUILD) + 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) + # endif() elseif(WIN32) cmake_path(CONVERT "${GSTREAMER_PREFIX}/bin/*.dll" TO_CMAKE_PATH_LIST GST_WIN_BINS_PATH) file(GLOB GST_WIN_BINS ${GST_WIN_BINS_PATH}) @@ -213,6 +198,8 @@ endif() ################################################################################ +# DYLD_LIBRARY_PATH + # LSEnvironment # # GST_REGISTRY_REUSE_PLUGIN_SCANNER diff --git a/tools/setup/install-dependencies-debian.sh b/tools/setup/install-dependencies-debian.sh index 81d9f306fc1..225de8958b4 100755 --- a/tools/setup/install-dependencies-debian.sh +++ b/tools/setup/install-dependencies-debian.sh @@ -2,10 +2,10 @@ set -e -apt update -y --quiet +apt-get update -y --quiet # Build Tools -DEBIAN_FRONTEND=noninteractive apt -y --quiet install \ +DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ appstream \ binutils \ build-essential \ @@ -29,10 +29,11 @@ DEBIAN_FRONTEND=noninteractive apt -y --quiet install \ pkgconf \ python3 \ python3-pip \ - rsync + rsync \ + zsync # Qt Required - https://doc.qt.io/qt-6/linux-requirements.html -DEBIAN_FRONTEND=noninteractive apt -y --quiet install \ +DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ libfontconfig1 \ libfreetype6 \ libx11-6 \ @@ -42,6 +43,7 @@ DEBIAN_FRONTEND=noninteractive apt -y --quiet install \ libxcb-icccm4 \ libxcb-image0 \ libxcb-keysyms1 \ + libxcb-present0 \ libxcb-randr0 \ libxcb-render-util0 \ libxcb-render0 \ @@ -60,8 +62,11 @@ DEBIAN_FRONTEND=noninteractive apt -y --quiet install \ libxkbcommon0 \ libxrender1 +DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ + libunwind-dev + # GStreamer -DEBIAN_FRONTEND=noninteractive apt -y --quiet install \ +DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ libgstreamer1.0-dev \ libgstreamer-plugins-bad1.0-dev \ libgstreamer-plugins-base1.0-dev \ @@ -83,7 +88,7 @@ if apt-cache show gstreamer1.0-qt6 >/dev/null 2>&1 && apt-cache show gstreamer1. fi # Exiv2 -DEBIAN_FRONTEND=noninteractive apt -y --quiet install \ +DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ libbrotli-dev \ libcurl4-openssl-dev \ libexiv2-dev \ @@ -94,43 +99,66 @@ DEBIAN_FRONTEND=noninteractive apt -y --quiet install \ libz-dev \ zlib1g-dev -# Additional -DEBIAN_FRONTEND=noninteractive apt -y --quiet install \ +# Speech +DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ flite1-dev \ + libspeechd-dev \ + speech-dispatcher \ + speech-dispatcher-espeak \ + speech-dispatcher-espeak-ng \ + speech-dispatcher-flite \ + +# Additional +DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ + gvfs \ intel-media-va-driver \ libasound2-dev \ libass-dev \ libdrm-dev \ + libcairo-dev \ + libelf-dev \ libegl1-mesa-dev \ libgbm-dev \ - libgl1-mesa-dev \ libgl-dev \ - libglx-dev \ + libgl1-mesa-dev \ + libgles-dev \ libgles2-mesa-dev \ - libglu1-mesa-dev \ + libglew-dev \ libglfw3-dev \ + libglib2.0-dev \ + libglu1-mesa-dev \ + libglvnd-dev \ + libglx-dev \ + libglx-mesa0 \ + libgudev-1.0-dev \ libgraphene-1.0-dev \ + libmjpegtools-dev \ + libjpeg-dev \ + libjson-glib-1.0-0 \ + libjson-glib-dev \ libopenal-dev \ + libopenjp2-7-dev \ + libopus-dev \ + libpng-dev \ libpulse-dev \ libsdl2-dev \ - libspeechd-dev \ libshp-dev \ - libunwind-dev \ + libsoup2.4-dev \ + libssl-dev \ + libtheora-dev \ libva-dev \ libvdpau-dev \ libvpx-dev \ libwayland-dev \ + libwxgtk3.*-dev \ libx11-dev \ + libxml2-dev \ libzstd-dev \ mesa-common-dev \ mesa-utils \ mesa-va-drivers \ mesa-vdpau-drivers \ mesa-vulkan-drivers \ - speech-dispatcher \ - speech-dispatcher-espeak \ - speech-dispatcher-espeak-ng \ - speech-dispatcher-flite \ vainfo if apt-cache show libvpl-dev >/dev/null 2>&1 && apt-cache show libvpl-dev 2>/dev/null | grep -q "^Package: libvpl-dev"; then