From 1d06edb8d9e7f5564f50ae358cea3b23d241488a Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 4 Dec 2023 09:41:48 +0100 Subject: [PATCH] [channels,tsmf] fix gstreamer detection --- channels/tsmf/client/CMakeLists.txt | 26 ++++++----------- channels/tsmf/client/gstreamer/CMakeLists.txt | 28 +++++++++++++------ 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/channels/tsmf/client/CMakeLists.txt b/channels/tsmf/client/CMakeLists.txt index 64c011582..ea8e2f052 100644 --- a/channels/tsmf/client/CMakeLists.txt +++ b/channels/tsmf/client/CMakeLists.txt @@ -20,29 +20,19 @@ define_channel_client("tsmf") message(DEPRECATION "TSMF channel is no longer maintained. Use [MS-RDPEVOR] (/video) instead.") -set(GSTREAMER_1_0_FEATURE_TYPE "RECOMMENDED") -set(GSTREAMER_1_0_FEATURE_PURPOSE "multimedia") -set(GSTREAMER_1_0_FEATURE_DESCRIPTION "multimedia redirection, audio and video playback") -if (WIN32) - set(GSTREAMER_1_0_FEATURE_TYPE "DISABLED") +find_package(PkgConfig) +if (PkgConfig_FOUND) + pkg_check_modules(gstreamer gstreamer-1.0) endif() -if (APPLE) - set(GSTREAMER_1_0_FEATURE_TYPE "OPTIONAL") - if (IOS) - set(GSTREAMER_1_0_FEATURE_TYPE "DISABLED") +if (WITH_GSTREAMER_1_0) + if(gstreamer_FOUND) + add_definitions(-DWITH_GSTREAMER_1_0) + else() + message(WARNING "gstreamer not detected, disabling support") endif() endif() -if (ANDROID) - set(GSTREAMER_1_0_FEATURE_TYPE "DISABLED") -endif() - -find_feature(GStreamer_1_0 ${GSTREAMER_1_0_FEATURE_TYPE} ${GSTREAMER_1_0_FEATURE_PURPOSE} ${GSTREAMER_1_0_FEATURE_DESCRIPTION}) - -if (WITH_GSTREAMER_1_0 AND GSTREAMER_1_0_FOUND) - add_definitions(-DWITH_GSTREAMER_1_0) -endif() set(${MODULE_PREFIX}_SRCS tsmf_audio.c diff --git a/channels/tsmf/client/gstreamer/CMakeLists.txt b/channels/tsmf/client/gstreamer/CMakeLists.txt index f9e43e03e..9490cc033 100644 --- a/channels/tsmf/client/gstreamer/CMakeLists.txt +++ b/channels/tsmf/client/gstreamer/CMakeLists.txt @@ -17,25 +17,37 @@ define_channel_client_subsystem("tsmf" "gstreamer" "decoder") -if(NOT GSTREAMER_1_0_FOUND) +if(NOT gstreamer_FOUND) message(FATAL_ERROR "GStreamer library not found, but required for TSMF module.") endif() set(SRC "tsmf_gstreamer.c") -if (GSTREAMER_1_0_FOUND) - set(LIBS ${GSTREAMER_1_0_LIBRARIES}) - include_directories(${GSTREAMER_1_0_INCLUDE_DIRS}) -endif() +pkg_check_modules(gstreamerbase gstreamer-base-1.0 REQUIRED) +pkg_check_modules(gstreamervideo gstreamer-video-1.0 REQUIRED) +pkg_check_modules(gstreamerapp gstreamer-app-1.0 REQUIRED) + +set(LIBS + ${gstreamer_LIBRARIES} + ${gstreamerbase_LIBRARIES} + ${gstreamervideo_LIBRARIES} + ${gstreamerapp_LIBRARIES} +) +include_directories( + ${gstreamer_INCLUDE_DIRS} + ${gstreamerbase_INCLUDE_DIRS} + ${gstreamervideo_INCLUDE_DIRS} + ${gstreamerapp_INCLUDE_DIRS} +) + if(ANDROID) set(SRC ${SRC} - tsmf_android.c) - set(LIBS ${LIBS}) + tsmf_android.c) else() find_package(X11 REQUIRED) - list(APPENDSRC + list(APPEND SRC tsmf_X11.c) list(APPEND LIBS ${X11_LIBRARIES}