From b04cbfe15ad361387a33b21c581f1dd43cc640be Mon Sep 17 00:00:00 2001 From: Pierre Wielders Date: Sun, 10 Nov 2024 18:22:01 +0100 Subject: [PATCH 1/4] [METADATA] Define the COMSERVERS with a user friendly name. --- DisplayInfo/CMakeLists.txt | 4 +- DisplayInfo/cmake/FindLibDRM.cmake | 71 +++++++++++++++++------------- OpenCDMi/FrameworkRPC.cpp | 9 ++-- SecurityAgent/SecurityAgent.h | 2 +- 4 files changed, 48 insertions(+), 38 deletions(-) diff --git a/DisplayInfo/CMakeLists.txt b/DisplayInfo/CMakeLists.txt index 0fb9ce7..c7853ee 100644 --- a/DisplayInfo/CMakeLists.txt +++ b/DisplayInfo/CMakeLists.txt @@ -19,7 +19,7 @@ project(DisplayInfo) cmake_minimum_required(VERSION 3.15) -find_package(Thunder) +find_package(bridge) project_version(1.0.0) @@ -48,7 +48,7 @@ find_package(CompileSettingsDebug CONFIG REQUIRED) find_package(BCM_HOST QUIET) find_package(NEXUS QUIET) find_package(NXCLIENT QUIET) -find_package(LibDRM QUIET) +find_package(libdrm QUIET) add_library(${MODULE_NAME} SHARED DisplayInfo.cpp diff --git a/DisplayInfo/cmake/FindLibDRM.cmake b/DisplayInfo/cmake/FindLibDRM.cmake index 9bf34d0..3f5a225 100644 --- a/DisplayInfo/cmake/FindLibDRM.cmake +++ b/DisplayInfo/cmake/FindLibDRM.cmake @@ -1,7 +1,7 @@ # If not stated otherwise in this file or this component's license file the # following copyright and licenses apply: # -# Copyright 2020 Metrological B.V. +# Copyright 2020 RDK Management # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,34 +15,45 @@ # See the License for the specific language governing permissions and # limitations under the License. -if(LibDRM_FIND_QUIETLY) - set(_LibDRM_MODE QUIET) -elseif(LibDRM_FIND_REQUIRED) - set(_LibDRM_MODE REQUIRED) -endif() - find_package(PkgConfig) -# Just check if the libdrm.pc exist, and create the PkgConfig::libdrm target -# No version requirement (yet) -pkg_check_modules(LibDRM ${_LibDRM_MODE} IMPORTED_TARGET libdrm) - -include(FindPackageHandleStandardArgs) - -# Sets the FOUND variable to TRUE if all required variables are present and set -find_package_handle_standard_args( - LibDRM - REQUIRED_VARS - LibDRM_INCLUDE_DIRS - LibDRM_CFLAGS - LibDRM_LDFLAGS - LibDRM_LIBRARIES - LibDRM_ACTUAL_LIBRARY - VERSION_VAR - LibDRM_VERSION -) -mark_as_advanced(LibDRM_INCLUDE_DIRS LibDRM_LIBRARIES) - -if(LibDRM_FOUND) - add_library(libdrm::libdrm ALIAS PkgConfig::LibDRM) -endif() \ No newline at end of file +if(${PKG_CONFIG_FOUND}) + + # Just check if the libdrm.pc exist, and create the PkgConfig::libdrm target + # No version requirement (yet) + pkg_check_modules(libdrm QUIET IMPORTED_TARGET libdrm) + + include(FindPackageHandleStandardArgs) + + # Sets the FOUND variable to TRUE if all required variables are present and set + find_package_handle_standard_args( + libdrm + REQUIRED_VARS + libdrm_INCLUDE_DIRS + libdrm_CFLAGS + libdrm_LDFLAGS + libdrm_LIBRARIES + VERSION_VAR + libdrm_VERSION + ) + + find_library(libdrm_ACTUAL_LIBRARY NAMES drm + HINTS ${libdrm_LIBRARY_DIRS} ) + + if(libdrm_FOUND AND NOT TARGET libdrm::libdrm) + add_library(libdrm::libdrm UNKNOWN IMPORTED) + set_target_properties(libdrm::libdrm PROPERTIES + IMPORTED_LOCATION "${libdrm_ACTUAL_LIBRARY}" + INTERFACE_LINK_LIBRARIES "${libdrm_LIBRARIES}" + INTERFACE_COMPILE_OPTIONS "${libdrm_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${libdrm_INCLUDE_DIRS}" + ) + endif() + + mark_as_advanced(libdrm_INCLUDE_DIRS libdrm_LIBRARIES) + +else() + + message(STATUS "Unable to locate PkgConfig") + +endif() diff --git a/OpenCDMi/FrameworkRPC.cpp b/OpenCDMi/FrameworkRPC.cpp index 4023744..2425047 100644 --- a/OpenCDMi/FrameworkRPC.cpp +++ b/OpenCDMi/FrameworkRPC.cpp @@ -105,18 +105,17 @@ namespace Plugin { }; class ExternalAccess : public RPC::Communicator { - private: + public: ExternalAccess() = delete; ExternalAccess(const ExternalAccess&) = delete; ExternalAccess& operator=(const ExternalAccess&) = delete; - public: ExternalAccess( - const Core::NodeId& source, + const Core::NodeId& sourceNode, Exchange::IAccessorOCDM* parentInterface, const string& proxyStubPath, - const Core::ProxyType & engine) - : RPC::Communicator(source, proxyStubPath, Core::ProxyType(engine)) + const Core::ProxyType& engine) + : RPC::Communicator(sourceNode, proxyStubPath, Core::ProxyType(engine), _T("@OCDM")) , _parentInterface(parentInterface) { Open(Core::infinite); diff --git a/SecurityAgent/SecurityAgent.h b/SecurityAgent/SecurityAgent.h index d28afb3..e5f89b8 100644 --- a/SecurityAgent/SecurityAgent.h +++ b/SecurityAgent/SecurityAgent.h @@ -44,7 +44,7 @@ namespace Plugin { PluginHost::IAuthenticate* parentInterface, const Core::ProxyType& engine ) - : RPC::Communicator(source, proxyStubPath, Core::ProxyType(engine)) + : RPC::Communicator(source, proxyStubPath, Core::ProxyType(engine), _T("@SecurityAgent")) , _parentInterface(parentInterface) { if (_parentInterface != nullptr){ From 0731fc443b2b6bb9136c69db8442914cbe60a808 Mon Sep 17 00:00:00 2001 From: Pierre Wielders Date: Sun, 10 Nov 2024 18:23:57 +0100 Subject: [PATCH 2/4] Update CMakeLists.txt --- DisplayInfo/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DisplayInfo/CMakeLists.txt b/DisplayInfo/CMakeLists.txt index c7853ee..6351e57 100644 --- a/DisplayInfo/CMakeLists.txt +++ b/DisplayInfo/CMakeLists.txt @@ -19,7 +19,7 @@ project(DisplayInfo) cmake_minimum_required(VERSION 3.15) -find_package(bridge) +find_package(Thunder) project_version(1.0.0) From c602f314adcc1e341f3c80c7612bd7d3f4151422 Mon Sep 17 00:00:00 2001 From: Pierre Wielders Date: Sun, 10 Nov 2024 18:25:20 +0100 Subject: [PATCH 3/4] Update FindLibDRM.cmake --- DisplayInfo/cmake/FindLibDRM.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DisplayInfo/cmake/FindLibDRM.cmake b/DisplayInfo/cmake/FindLibDRM.cmake index 3f5a225..e798a69 100644 --- a/DisplayInfo/cmake/FindLibDRM.cmake +++ b/DisplayInfo/cmake/FindLibDRM.cmake @@ -1,7 +1,7 @@ # If not stated otherwise in this file or this component's license file the # following copyright and licenses apply: # -# Copyright 2020 RDK Management +# Copyright 2020 Metrological B.V. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 65eb357413d32a30ca8f5d6293794a275f6ab221 Mon Sep 17 00:00:00 2001 From: Pierre Wielders Date: Sun, 10 Nov 2024 18:25:59 +0100 Subject: [PATCH 4/4] Rename FindLibDRM.cmake to Findlibdrm.cmake --- DisplayInfo/cmake/{FindLibDRM.cmake => Findlibdrm.cmake} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename DisplayInfo/cmake/{FindLibDRM.cmake => Findlibdrm.cmake} (100%) diff --git a/DisplayInfo/cmake/FindLibDRM.cmake b/DisplayInfo/cmake/Findlibdrm.cmake similarity index 100% rename from DisplayInfo/cmake/FindLibDRM.cmake rename to DisplayInfo/cmake/Findlibdrm.cmake