Skip to content

Commit

Permalink
Update GStreamer versions to 1.24.2
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Apr 16, 2024
1 parent e05473a commit 9ac28c1
Show file tree
Hide file tree
Showing 49 changed files with 7,187 additions and 253 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
dir: ${{ runner.temp }}
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
cache: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
tools: 'tools_cmake tools_ninja'

- name: Install Qt6 for Android (armv7)
uses: ./install-qt-action/action/
Expand Down Expand Up @@ -141,11 +142,12 @@ jobs:
- name: Install gstreamer
working-directory: ${{ github.workspace }}
env:
GST_VERSION: 1.18.5
GST_VERSION: 1.24.2
run: |
wget --quiet https://gstreamer.freedesktop.org/data/pkg/android/${GST_VERSION}/gstreamer-1.0-android-universal-${GST_VERSION}.tar.xz
mkdir gstreamer-1.0-android-universal-${GST_VERSION}
tar xf gstreamer-1.0-android-universal-${GST_VERSION}.tar.xz -C gstreamer-1.0-android-universal-${GST_VERSION}
wget --quiet https://gstreamer.freedesktop.org/data/pkg/android/${{ env.GST_VERSION }}/gstreamer-1.0-android-universal-${{ env.GST_VERSION }}.tar.xz
mkdir gstreamer-1.0-android-universal-${{ env.GST_VERSION }}
tar xf gstreamer-1.0-android-universal-${{ env.GST_VERSION }}.tar.xz -C gstreamer-1.0-android-universal-${{ env.GST_VERSION }}
rm gstreamer-1.0-android-universal-${{ env.GST_VERSION }}.tar.xz
- name: Install dependencies
run: sudo apt-get install -y ninja-build
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,44 @@ jobs:
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
setup-python: true
cache: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
tools: 'tools_cmake tools_ninja'

- name: Install Dependencies
run: |
chmod a+x ./tools/setup/ubuntu.sh
./tools/setup/ubuntu.sh
python3 -m pip install meson ninja
- uses: actions/checkout@v4
with:
repository: GStreamer/gstreamer
ref: 1.24.2

# - name: Clone GStreamer
# working-directory: ${{ runner.temp }}
# run: git clone --depth 1 --branch 1.24.2 https://github.com/GStreamer/gstreamer.git

- name: Configure GStreamer
working-directory: ${{ runner.temp }}/gstreamer
run: meson setup
--prefix=${{ runner.temp }}/gst
-Dgst-full-target-type=static_library
-Dauto_features=disabled
build
# --prefix=${{ runner.temp }}/gst
# --buildtype=${{ matrix.BuildType }}
# -Dauto_features=disabled -Dgood=enabled -Dgst-plugins-good:qml6=enabled -Dgst-plugins-good:qt-egl=enabled -Dgst-plugins-good:qt-wayland=enabled -Dgst-plugins-good:qt-x11=enabled -Dbase=enabled -Dgst-plugins-base:gl=enabled -Dgst-plugins-base:gl_platform=glx,egl -Dgst-plugins-base:gl_winsys=x11,wayland -Dgst-plugins-base:x11=enabled build
# -Dgst-full-target-type=static_library
# --default-library=static -Dgst-full-libraries=app,video
# -Dges=disabled -Dtests=disabled -Dexamples=disabled -Dgst-examples=disabled -Ddoc=disabled -Dgtk_doc=disabled -Dgpl=enabled build

- name: Compile GStreamer
working-directory: ${{ runner.temp }}/gstreamer
run: meson compile -C build

- name: Install GStreamer
working-directory: ${{ runner.temp }}/gstreamer
run: meson install -C build

- name: Create build directory
run: mkdir ${{ runner.temp }}/shadow_build_dir
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/macos_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ jobs:
- name: Install Dependencies
run: brew install ninja SDL2

- name: Setup GStreamer
uses: blinemedical/setup-gstreamer@v1
with:
version: 1.18.6
- name: Install Gstreamer
env:
GST_VERSION: 1.24.2
run: |
wget https://gstreamer.freedesktop.org/data/pkg/osx/${{ env.GST_VERSION }}/gstreamer-1.0-devel-${{ env.GST_VERSION }}-universal.pkg
wget https://gstreamer.freedesktop.org/data/pkg/osx/${{ env.GST_VERSION }}/gstreamer-1.0-${{ env.GST_VERSION }}-universal.pkg
for package in *.pkg ;
do sudo installer -verbose -pkg "$package" -target /
done
- name: Create build directory
run: mkdir ${{ runner.temp }}/shadow_build_dir
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/macos_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ jobs:
cache: true

- name: Install Gstreamer
env:
GST_VERSION: 1.24.2
run: |
wget https://gstreamer.freedesktop.org/data/pkg/osx/1.18.6/gstreamer-1.0-devel-1.18.6-x86_64.pkg
wget https://gstreamer.freedesktop.org/data/pkg/osx/1.18.6/gstreamer-1.0-1.18.6-x86_64.pkg
wget https://gstreamer.freedesktop.org/data/pkg/osx/${{ env.GST_VERSION }}/gstreamer-1.0-devel-${{ env.GST_VERSION }}-universal.pkg
wget https://gstreamer.freedesktop.org/data/pkg/osx/${{ env.GST_VERSION }}/gstreamer-1.0-${{ env.GST_VERSION }}-universal.pkg
for package in *.pkg ;
do sudo installer -verbose -pkg "$package" -target /
done
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ jobs:
- name: Install Gstreamer
uses: blinemedical/setup-gstreamer@v1
with:
version: 1.18.6
# run: choco install --no-progress gstreamer gstreamer-devel --version=1.18.6
version: 1.24.2

- name: Install Dependencies
run: choco install --no-progress ninja -y
Expand Down
3 changes: 2 additions & 1 deletion QGCCommon.pri
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ linux {
QMAKE_CXXFLAGS_WARN_ON += -Werror \
-Wno-unused-parameter \ # gst-plugins-good
-Wno-unused-but-set-variable \ # QGCTileCacheWorker.cpp
-Wno-deprecated-declarations
-Wno-deprecated-declarations \
-Wno-unused-private-field
} else {
error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
}
Expand Down
11 changes: 11 additions & 0 deletions cmake/DownloadGstreamer.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set(GST_VERSION "1.24.2")
if(ANDROID)
set(GST_URL https://gstreamer.freedesktop.org/data/pkg/android/${GST_VERSION}/gstreamer-1.0-android-universal-${GST_VERSION}.tar.xz)
set(GST_ZIP_PATH ${CMAKE_SOURCE_DIR}/gstreamer-1.0-android-universal.tar.xz)
set(GST_TARGET_PATH ${CMAKE_SOURCE_DIR}/gstreamer-1.0-android-universal)
if(NOT EXISTS "${GST_TARGET_PATH}")
file(DOWNLOAD ${GST_URL} ${GST_ZIP_PATH})
execute_process(COMMAND mkdir gstreamer-1.0-android-universal)
execute_process(COMMAND tar xf ${GST_ZIP_PATH} -C ${GST_TARGET_PATH})
endif()
endif()
133 changes: 110 additions & 23 deletions libs/qmlglsink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ option(QGC_ENABLE_VIDEOSTREAMING "Enable video streaming" ON)
if(QGC_ENABLE_VIDEOSTREAMING)
message(STATUS "Enabling video streaming support")

# include(DownloadGstreamer)

if(ANDROID)
set(GST_STATIC_BUILD ON)
else()
set(GST_STATIC_BUILD OFF)
endif()

if(LINUX)
set(GST_TARGET_VERSION 1.16)
set(GST_TARGET_VERSION 1.16.0)
elseif(ANDROID)
set(GST_TARGET_VERSION 1.18.5)
set(GST_TARGET_VERSION 1.24.2)
else()
set(GST_TARGET_VERSION 1.18)
set(GST_TARGET_VERSION 1.24.0)
endif()

set(GST_TARGET_PLUGINS
Expand Down Expand Up @@ -46,8 +48,39 @@ if(QGC_ENABLE_VIDEOSTREAMING)
)
if(LINUX)
list(APPEND GST_TARGET_MODULES egl)
# gstreamer-gl-x11-1.0
# gstreamer-gl-wayland-1.0
# gstreamer-gl-egl-1.0
endif()

# gstreamer-rtsp-1.0
# gstreamer-audio-1.0
# # gstreamer-plugins-base-1.0
# gstreamer-codecparsers-1.0
# gstreamer-rtp-1.0
# gstreamer-pbutils-1.0
# gstreamer-net-1.0
# gstreamer-tag-1.0
# gstreamer-mpegts-1.0
# gstreamer-riff-1.0
# gstreamer-photography-1.0
# gstreamer-controller-1.0
# gmodule-2.0
# graphene-1.0
# orc-0.4
# bzip2
# libffi
# libpcre2-8
# zlib
# # libpng
# # libjpeg
# # libavcodec
# # libavfilter
# # libavformat
# # libavutil
# # x264
# )

# find_library(GSTREAMER_${_upper_name}_LIBRARY
# NAMES
# gst${_lower_name}-${_abi_version}
Expand Down Expand Up @@ -76,14 +109,15 @@ if(QGC_ENABLE_VIDEOSTREAMING)
elseif(MACOS)
set(GSTREAMER_ROOT "/Library/Frameworks/GStreamer.framework")
elseif(ANDROID)
set(GSTREAMER_ROOT ${CMAKE_SOURCE_DIR}/gstreamer-1.0-android-universal-${GST_TARGET_VERSION})
if(${ANDROID_ABI} STREQUAL armeabi-v7a)
set(GSTREAMER_ROOT ${CMAKE_SOURCE_DIR}/gstreamer-1.0-android-universal-${GST_TARGET_VERSION}/armv7)
set(GSTREAMER_ROOT ${GSTREAMER_ROOT}/armv7)
elseif(${ANDROID_ABI} STREQUAL arm64-v8a)
set(GSTREAMER_ROOT ${CMAKE_SOURCE_DIR}/gstreamer-1.0-android-universal-${GST_TARGET_VERSION}/arm64)
set(GSTREAMER_ROOT ${GSTREAMER_ROOT}/arm64)
elseif(${ANDROID_ABI} STREQUAL x86)
set(GSTREAMER_ROOT ${CMAKE_SOURCE_DIR}/gstreamer-1.0-android-universal-${GST_TARGET_VERSION}/x86)
set(GSTREAMER_ROOT ${GSTREAMER_ROOT}/x86)
elseif(${ANDROID_ABI} STREQUAL x86_64)
set(GSTREAMER_ROOT ${CMAKE_SOURCE_DIR}/gstreamer-1.0-android-universal-${GST_TARGET_VERSION}/x86_64)
set(GSTREAMER_ROOT ${GSTREAMER_ROOT}/x86_64)
endif()
endif()

Expand Down Expand Up @@ -159,28 +193,65 @@ if(QGC_ENABLE_VIDEOSTREAMING)
endif()
endif()
# file(GET_RUNTIME_DEPENDENCIES)
# target_link_libraries(qmlglsink
# PUBLIC
# iconv
# # x264
# z
# png16
# jpeg
# android
# )
endif()
else()
message(WARNING "Gstreamer Not Found")
endif()

if(GST_FOUND)
message(STATUS "GST Modules Found")
target_sources(qmlglsink
PRIVATE
qt6/gstplugin.cc
qt6/gstqml6glsink.cc
qt6/gstqml6glsink.h
qt6/gstqsg6glnode.cc
qt6/gstqsg6glnode.h
qt6/gstqt6element.cc
qt6/gstqt6elements.h
qt6/gstqt6gl.h
qt6/gstqt6glutility.cc
qt6/gstqt6glutility.h
qt6/qt6glitem.cc
qt6/qt6glitem.h
)
if(LINUX)
target_sources(qmlglsink
PRIVATE
qt6-linux/gstplugin.cc
qt6-linux/gstqml6glsink.cc
qt6-linux/gstqml6glsink.h
qt6-linux/gstqsg6glnode.cc
qt6-linux/gstqsg6glnode.h
qt6-linux/gstqt6element.cc
qt6-linux/gstqt6elements.h
qt6-linux/gstqt6gl.h
qt6-linux/gstqt6glutility.cc
qt6-linux/gstqt6glutility.h
qt6-linux/qt6glitem.cc
qt6-linux/qt6glitem.h
)
else()
target_sources(qmlglsink
PRIVATE
qt6/gstplugin.cc
qt6/gstqml6glmixer.cc
qt6/gstqml6glmixer.h
qt6/gstqml6gloverlay.cc
qt6/gstqml6gloverlay.h
qt6/gstqml6glsink.cc
qt6/gstqml6glsink.h
qt6/gstqml6glsrc.cc
qt6/gstqml6glsrc.h
qt6/gstqsg6material.cc
qt6/gstqsg6material.h
qt6/gstqt6element.cc
qt6/gstqt6elements.h
qt6/gstqt6gl.h
qt6/gstqt6glutility.cc
qt6/gstqt6glutility.h
qt6/qt6glitem.cc
qt6/qt6glitem.h
qt6/qt6glrenderer.cc
qt6/qt6glrenderer.h
qt6/qt6glwindow.cc
qt6/qt6glwindow.h
)
endif()

find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL Qml Quick)
target_link_libraries(qmlglsink
Expand All @@ -203,6 +274,9 @@ if(QGC_ENABLE_VIDEOSTREAMING)
endif()

target_include_directories(qmlglsink PUBLIC qt6)
if(WIN32)
# target_include_directories(qmlglsink PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/windows)
endif()

target_compile_definitions(qmlglsink
PRIVATE
Expand Down Expand Up @@ -240,6 +314,19 @@ if(QGC_ENABLE_VIDEOSTREAMING)
)
endif()

qt_add_resources(qmlglsink "gst"
PREFIX "/org/freedesktop/gstreamer/qml6"
FILES
qt6/RGBA.frag
qt6/vertex.vert
qt6/YUV_TRIPLANAR.frag
)
# qt_add_qml_module(qmlglsink
# URI org.freedesktop.gstreamer.qml6
# VERSION 1.0
# IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY}
# )

message(STATUS "GStreamer version: ${GST_gstreamer-1.0_VERSION}")
message(STATUS "GStreamer prefix: ${GST_gstreamer-1.0_PREFIX}")
message(STATUS "GStreamer include dir: ${GST_gstreamer-1.0_INCLUDEDIR}")
Expand Down Expand Up @@ -283,5 +370,5 @@ if(QGC_ENABLE_VIDEOSTREAMING)
message(WARNING "GST Modules Not Found")
endif()
else()
message(STATUS "Video streaming disabled")
message(STATUS "Video streaming disabled")
endif()
Loading

0 comments on commit 9ac28c1

Please sign in to comment.