Skip to content

Commit

Permalink
will not work, but it's a start
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle committed Nov 30, 2024
1 parent e7c3d38 commit 1606b99
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 62 deletions.
11 changes: 6 additions & 5 deletions QOpenHD.pro
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,17 @@ JetsonBuild {
WindowsBuild {
# This aparently makes qt use absolute paths, otherwise we get compile issues ?
QMAKE_PROJECT_DEPTH = 0
include(app/videostreaming/avcodec/avcodec_video.pri)
#include(app/videostreaming/gstreamer/gst_video.pri)
#include(app/videostreaming/avcodec/avcodec_video.pri)
# Path to FFmpeg headers
INCLUDEPATH += C:/ffmpeg
INCLUDEPATH += C:/ffmpeg/libavutil/
# INCLUDEPATH += C:/ffmpeg
#INCLUDEPATH += C:/ffmpeg/libavutil/

# Path to FFmpeg libraries
LIBS += -LC:/ffmpeg/lib
#LIBS += -LC:/ffmpeg/lib

# Link against the required FFmpeg libraries
LIBS += -lavcodec -lavformat -lavutil -lswscale -lswresample
#LIBS += -lavcodec -lavformat -lavutil -lswscale -lswresample
}

AndroidBuild {
Expand Down
121 changes: 64 additions & 57 deletions app/videostreaming/gstreamer/gst_video.pri
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Enable GStreamer QMLGLSink for video rendering
DEFINES += QOPENHD_ENABLE_GSTREAMER_QMLGLSINK

#DEFINES += QOPENHD_GSTREAMER_PRIMARY_VIDEO
# Uncomment for primary video, keep secondary for now
# DEFINES += QOPENHD_GSTREAMER_PRIMARY_VIDEO
DEFINES += QOPENHD_GSTREAMER_SECONDARY_VIDEO

# Sources and headers specific to GStreamer
SOURCES += \
$$PWD/gstqmlglsinkstream.cpp \
$$PWD/gstrtpaudioplayer.cpp \
Expand All @@ -14,16 +17,14 @@ HEADERS += \
$$PWD/gstrtpaudioplayer.h \
$$PWD/gstrtpreceiver.h

android{
message("gst android")
# More or less taken from QGroundControl.
# this is already the "least dirty" solution I could come up with :/
#DOWNLOADED_GST_FOLDER= /home/hyperion/gstreamer-1.0-android-universal-1.20.5
#DOWNLOADED_GST_FOLDER= /home/consti10/Downloads/gstreamer-1.0-android-universal-1.20.5
#DOWNLOADED_GST_FOLDER= $$PWD/../../../lib/gstreamer_prebuilts/gstreamer-1.0-android-universal-1.20.5
DOWNLOADED_GST_FOLDER= $$PWD/../../../lib/gstreamer_prebuilts/gstreamer-1.0-android-universal
# Platform-specific configurations
android {
message("Configuring GStreamer for Android")

# Set the right folder for the compile arch
# Define the base directory for the GStreamer prebuilt binaries
DOWNLOADED_GST_FOLDER = $$PWD/../../../lib/gstreamer_prebuilts/gstreamer-1.0-android-universal

# Determine the GStreamer architecture folder based on the target architecture
GSTREAMER_ARCH_FOLDER = armv7
contains(ANDROID_TARGET_ARCH, armeabi-v7a) {
GSTREAMER_ARCH_FOLDER = armv7
Expand All @@ -32,69 +33,75 @@ android{
} else:contains(ANDROID_TARGET_ARCH, x86_64) {
GSTREAMER_ARCH_FOLDER = x86_64
} else {
message(Unknown ANDROID_TARGET_ARCH $$ANDROID_TARGET_ARCH)
message("Unknown ANDROID_TARGET_ARCH: $$ANDROID_TARGET_ARCH")
GSTREAMER_ARCH_FOLDER = armv7
}

#GSTREAMER_ARCH_FOLDER = arm64

# Define the root path for GStreamer
GSTREAMER_ROOT_ANDROID = $$DOWNLOADED_GST_FOLDER/$$GSTREAMER_ARCH_FOLDER
message(gstreamer root android:)
message($$GSTREAMER_ROOT_ANDROID)
message("GStreamer root for Android: $$GSTREAMER_ROOT_ANDROID")

GST_ROOT = $$GSTREAMER_ROOT_ANDROID

# Check if the GStreamer root directory exists
exists($$GST_ROOT) {
message(Doing QGC gstreamer stuff)
message($$GST_ROOT)
QMAKE_CXXFLAGS += -pthread
CONFIG += VideoEnabled
message("Setting up GStreamer for Android build")
QMAKE_CXXFLAGS += -pthread
CONFIG += VideoEnabled

# Link GStreamer libraries
LIBS += -L$$GST_ROOT/lib/gstreamer-1.0 \
-lgstvideo-1.0 \
-lgstcoreelements \
-lgstplayback \
-lgstudp \
-lgstrtp \
-lgstrtsp \
-lgstx264 \
-lgstlibav \
-lgstsdpelem \
-lgstvideoparsersbad \
-lgstrtpmanager \
-lgstisomp4 \
-lgstmatroska \
-lgstmpegtsdemux \
-lgstandroidmedia \
-lgstopengl \
-lgsttcp \
-lgstapp \
-lgstalaw \
-lgstautodetect


# Rest of GStreamer dependencies
-lgstvideo-1.0 -lgstcoreelements -lgstplayback -lgstudp \
-lgstrtp -lgstrtsp -lgstx264 -lgstlibav -lgstsdpelem \
-lgstvideoparsersbad -lgstrtpmanager -lgstisomp4 \
-lgstmatroska -lgstmpegtsdemux -lgstandroidmedia \
-lgstopengl -lgsttcp -lgstapp -lgstalaw -lgstautodetect

LIBS += -L$$GST_ROOT/lib \
-lgraphene-1.0 -ljpeg -lpng16 \
-lgstfft-1.0 -lm \
-lgstnet-1.0 -lgio-2.0 \
-lgstphotography-1.0 -lgstgl-1.0 -lEGL \
-lgstaudio-1.0 -lgstcodecparsers-1.0 -lgstbase-1.0 \
-lgstreamer-1.0 -lgstrtp-1.0 -lgstpbutils-1.0 -lgstrtsp-1.0 -lgsttag-1.0 \
-lgstvideo-1.0 -lavformat -lavcodec -lavutil -lx264 -lavfilter -lswresample \
-lgstriff-1.0 -lgstcontroller-1.0 -lgstapp-1.0 \
-lgraphene-1.0 -ljpeg -lpng16 -lgstfft-1.0 -lm \
-lgstnet-1.0 -lgio-2.0 -lgstphotography-1.0 -lgstgl-1.0 -lEGL \
-lgstaudio-1.0 -lgstcodecparsers-1.0 -lgstbase-1.0 -lgstreamer-1.0 \
-lgstrtp-1.0 -lgstpbutils-1.0 -lgstrtsp-1.0 -lgsttag-1.0 \
-lgstvideo-1.0 -lavformat -lavcodec -lavutil -lx264 -lavfilter \
-lswresample -lgstriff-1.0 -lgstcontroller-1.0 -lgstapp-1.0 \
-lgstsdp-1.0 -lbz2 -lgobject-2.0 -lgstmpegts-1.0 \
-Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lorc-0.4 -liconv -lffi -lintl \
-Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lorc-0.4 -liconv -lffi -lintl

# Include paths for GStreamer
INCLUDEPATH += \
$$GST_ROOT/include/gstreamer-1.0 \
$$GST_ROOT/lib/gstreamer-1.0/include \
$$GST_ROOT/include/glib-2.0 \
$$GST_ROOT/lib/glib-2.0/include
}else {
message(Gstreamer prebuilt directory does not exist)
} else {
message("GStreamer prebuilt directory does not exist")
}
} else {
# GStreamer configuration for non-Android platforms
GST_ROOT = c:/gstreamer/1.0/x86_64

exists($$GST_ROOT) {
CONFIG += VideoEnabled

# Link GStreamer libraries
LIBS += -L$$GST_ROOT/lib -lopengl32

LIBS += -lgstfft-1.0 \
-lgstnet-1.0 -lgio-2.0 \
-lgstaudio-1.0 -lgstcodecparsers-1.0 -lgstbase-1.0 \
-lgstreamer-1.0 -lgstrtp-1.0 -lgstpbutils-1.0 -lgstrtsp-1.0 -lgsttag-1.0 \
-lgstvideo-1.0 \
-lgstriff-1.0 -lgstcontroller-1.0 -lgstapp-1.0 \
-lgstsdp-1.0 -lbz2 -lgobject-2.0 \
-lgstgl-1.0 -lgraphene-1.0 -lpng16 -ljpeg -lgstphotography-1.0 \
-lgmodule-2.0 -lglib-2.0 -lorc-0.4 -lffi -lintl

# Include paths for GStreamer
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

}
}else {
message(gst linux)
CONFIG += link_pkgconfig
PKGCONFIG += gstreamer-1.0 gstreamer-video-1.0 gstreamer-gl-1.0 gstreamer-app-1.0 #gstreamer1.0-plugins-good
}

0 comments on commit 1606b99

Please sign in to comment.