From 64e1d5da551aca0694fd72dce2ca7728c48cae04 Mon Sep 17 00:00:00 2001 From: Holden Date: Fri, 19 Apr 2024 19:08:49 -0400 Subject: [PATCH] CMake: Make qmlglsink Private --- libs/qmlglsink/CMakeLists.txt | 3 --- src/VideoReceiver/CMakeLists.txt | 16 ++++++++++------ src/VideoReceiver/GStreamer.cc | 2 +- src/VideoReceiver/GStreamer.h | 5 +++-- src/VideoReceiver/GstVideoReceiver.cc | 6 +++--- src/VideoReceiver/GstVideoReceiver.h | 10 +++++----- src/VideoReceiver/VideoReceiver.h | 4 ++-- 7 files changed, 24 insertions(+), 22 deletions(-) diff --git a/libs/qmlglsink/CMakeLists.txt b/libs/qmlglsink/CMakeLists.txt index 4fb6af35b2ed..5e2177fe92ea 100644 --- a/libs/qmlglsink/CMakeLists.txt +++ b/libs/qmlglsink/CMakeLists.txt @@ -208,9 +208,6 @@ if(QGC_ENABLE_VIDEOSTREAMING) PRIVATE HAVE_QT_QPA_HEADER QT_QPA_HEADER= - PUBLIC - QGC_GST_STREAMING - QGC_CMAKE_GST ) if(LINUX) target_compile_definitions(qmlglsink PRIVATE HAVE_QT_X11) diff --git a/src/VideoReceiver/CMakeLists.txt b/src/VideoReceiver/CMakeLists.txt index ee8c91096737..c5caa63fcfea 100644 --- a/src/VideoReceiver/CMakeLists.txt +++ b/src/VideoReceiver/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(Qt6 REQUIRED COMPONENTS Core Multimedia) +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_library(VideoReceiver STATIC VideoReceiver.h @@ -6,15 +6,14 @@ qt_add_library(VideoReceiver STATIC target_link_libraries(VideoReceiver PUBLIC - Qt6::Multimedia - Qt6::OpenGL - Qt6::Quick - Utilities + Qt6::Core ) target_include_directories(VideoReceiver PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) if(GST_FOUND) + find_package(Qt6 REQUIRED COMPONENTS Quick) + target_sources(VideoReceiver PRIVATE gstqgc.c @@ -26,11 +25,16 @@ if(GST_FOUND) ) target_link_libraries(VideoReceiver - PUBLIC + PRIVATE qmlglsink + Utilities + PUBLIC + Qt6::Quick Settings ) + target_compile_definitions(VideoReceiver PUBLIC QGC_GST_STREAMING) + if(CMAKE_BUILD_TYPE STREQUAL "Release") target_compile_definitions(VideoReceiver PRIVATE QGC_INSTALL_RELEASE) endif() diff --git a/src/VideoReceiver/GStreamer.cc b/src/VideoReceiver/GStreamer.cc index 743994437abd..11a225e6f4d5 100644 --- a/src/VideoReceiver/GStreamer.cc +++ b/src/VideoReceiver/GStreamer.cc @@ -14,7 +14,7 @@ * @author Gus Grubba */ -#include +#include #include "GStreamer.h" #include "GstVideoReceiver.h" diff --git a/src/VideoReceiver/GStreamer.h b/src/VideoReceiver/GStreamer.h index fd4515431ead..29c4fdbb8b93 100644 --- a/src/VideoReceiver/GStreamer.h +++ b/src/VideoReceiver/GStreamer.h @@ -1,14 +1,15 @@ #pragma once #include -#include +#include #include "Settings/VideoDecoderOptions.h" -#include "VideoReceiver.h" Q_DECLARE_LOGGING_CATEGORY(GStreamerLog) Q_DECLARE_LOGGING_CATEGORY(GStreamerAPILog) +class VideoReceiver; + class GStreamer { public: static void blacklist(VideoDecoderOptions option); diff --git a/src/VideoReceiver/GstVideoReceiver.cc b/src/VideoReceiver/GstVideoReceiver.cc index 7e83fd62558c..820ccf6be0e7 100644 --- a/src/VideoReceiver/GstVideoReceiver.cc +++ b/src/VideoReceiver/GstVideoReceiver.cc @@ -17,9 +17,9 @@ #include "GstVideoReceiver.h" #include "QGCLoggingCategory.h" -#include -#include -#include +#include +#include +#include QGC_LOGGING_CATEGORY(VideoReceiverLog, "VideoReceiverLog") diff --git a/src/VideoReceiver/GstVideoReceiver.h b/src/VideoReceiver/GstVideoReceiver.h index 61d8262aba78..367e85ac7aaa 100644 --- a/src/VideoReceiver/GstVideoReceiver.h +++ b/src/VideoReceiver/GstVideoReceiver.h @@ -16,11 +16,11 @@ #pragma once #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "VideoReceiver.h" diff --git a/src/VideoReceiver/VideoReceiver.h b/src/VideoReceiver/VideoReceiver.h index 7e2a272d3c95..1cf04cdc9326 100644 --- a/src/VideoReceiver/VideoReceiver.h +++ b/src/VideoReceiver/VideoReceiver.h @@ -15,8 +15,8 @@ #pragma once -#include -#include +#include +#include class VideoReceiver : public QObject {