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 13, 2024
1 parent de2bac7 commit f0e123c
Show file tree
Hide file tree
Showing 48 changed files with 7,153 additions and 248 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ 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}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/macos_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ jobs:
- name: Setup GStreamer
uses: blinemedical/setup-gstreamer@v1
with:
version: 1.18.6
version: '1.24.0'

# - name: Install Gstreamer
# run: |
# wget https://gstreamer.freedesktop.org/data/pkg/osx/1.24.0/gstreamer-1.0-devel-1.24.0-universal.pkg
# wget https://gstreamer.freedesktop.org/data/pkg/osx/1.24.0/gstreamer-1.0-1.24.0-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
19 changes: 12 additions & 7 deletions .github/workflows/macos_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,18 @@ jobs:
setup-python: false
cache: true

- name: Install Gstreamer
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
for package in *.pkg ;
do sudo installer -verbose -pkg "$package" -target /
done
- name: Setup GStreamer
uses: blinemedical/setup-gstreamer@v1
with:
version: '1.24.0'

# - name: Install Gstreamer
# run: |
# wget https://gstreamer.freedesktop.org/data/pkg/osx/1.24.0/gstreamer-1.0-devel-1.24.0-universal.pkg
# wget https://gstreamer.freedesktop.org/data/pkg/osx/1.24.0/gstreamer-1.0-1.24.0-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
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ 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
# run: choco install --no-progress gstreamer gstreamer-devel --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
17 changes: 17 additions & 0 deletions cmake/DownloadGstreamer.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set(GST_VERSION "1.24.2")
if(ANDROID)
set(GST_PATH "${CMAKE_SOURCE_DIR}"/gstreamer-1.0-android-universal.tar.xz)
if(NOT EXISTS "${GST_PATH}")
file(DOWNLOAD wget --quiet https://gstreamer.freedesktop.org/data/pkg/android/"${GST_VERSION}"/gstreamer-1.0-android-universal-"{GST_VERSION}".tar.xz "${GST_PATH}")
execute_process(COMMAND mkdir gstreamer-1.0-android-universal)
execute_process(COMMAND tar xf gstreamer-1.0-android-universal.tar.xz -C gstreamer-1.0-android-universal)
endif()
elseif(WIN32)

elseif(UNIX AND APPLE AND NOT IOS)

elseif(UNIX AND APPLE)

elseif(UNIX)

endif()
119 changes: 100 additions & 19 deletions libs/qmlglsink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ if(QGC_ENABLE_VIDEOSTREAMING)
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 @@ -48,6 +48,34 @@ if(QGC_ENABLE_VIDEOSTREAMING)
list(APPEND GST_TARGET_MODULES egl)
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 @@ -159,28 +187,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 +268,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 +308,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 +364,5 @@ if(QGC_ENABLE_VIDEOSTREAMING)
message(WARNING "GST Modules Not Found")
endif()
else()
message(STATUS "Video streaming disabled")
message(STATUS "Video streaming disabled")
endif()
62 changes: 62 additions & 0 deletions libs/qmlglsink/qt6-linux/gstplugin.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* GStreamer
* Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "gstqt6elements.h"
#include "qt6glitem.h"

#include <QtConstructorMacros>

static gboolean
plugin_init (GstPlugin * plugin)
{
gboolean ret = FALSE;
// TODO(zdanek) fix after switching to gstreamer 1.20.0+
// original code from 1.20.0
// ret |= GST_ELEMENT_REGISTER (qml6glsink, plugin);
ret |= gst_element_register_qml6glsink (plugin);

return ret;
}

static void registerMetatypes()
{
qmlRegisterType<Qt6GLVideoItem> ("org.freedesktop.gstreamer.GLVideoItem", 1, 0, "GstGLVideoItem");
}

Q_CONSTRUCTOR_FUNCTION(registerMetatypes)

#ifndef GST_PACKAGE_NAME
#define GST_PACKAGE_NAME "GStreamer Bad Plug-ins (qmake)"
#define GST_PACKAGE_ORIGIN "Unknown package origin"
#define GST_LICENSE "LGPL"
#define PACKAGE "gst-plugins-bad (qmake)"
#define PACKAGE_VERSION "1.21.0.1"
#endif

GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
qml6,
"Qt6 Qml plugin",
plugin_init, PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME,
GST_PACKAGE_ORIGIN)
Loading

0 comments on commit f0e123c

Please sign in to comment.