diff --git a/.github/workflows/Build ThunderNanoServicesRDK on MacOS.yml b/.github/workflows/Build ThunderNanoServicesRDK on MacOS.yml new file mode 100644 index 0000000..ebf3f87 --- /dev/null +++ b/.github/workflows/Build ThunderNanoServicesRDK on MacOS.yml @@ -0,0 +1,20 @@ +name: Build ThunderNanoServicesRDK on MacOS + +on: + workflow_dispatch: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +jobs: + Thunder: + uses: rdkcentral/Thunder/.github/workflows/MacOS build template.yml@master + + ThunderInterfaces: + needs: Thunder + uses: rdkcentral/ThunderInterfaces/.github/workflows/MacOS build template.yml@master + + ThunderNanoServicesRDK: + needs: ThunderInterfaces + uses: WebPlatformForEmbedded/ThunderNanoServicesRDK/.github/workflows/MacOS build template.yml@master diff --git a/.github/workflows/MacOS build template.yml b/.github/workflows/MacOS build template.yml new file mode 100644 index 0000000..7d710dc --- /dev/null +++ b/.github/workflows/MacOS build template.yml @@ -0,0 +1,81 @@ +name: MacOS build template + +on: + workflow_call: + +jobs: + ThunderNanoServicesRDK: + + runs-on: macos-14 + + strategy: + matrix: + build_type: [Debug, Release, MinSizeRel] + + name: Build type - ${{matrix.build_type}} + steps: +# --------- Packages & artifacts --------- + - name: Install necessary packages + run: | + brew update + brew upgrade + brew install ninja zlib + python3 -m venv venv + source venv/bin/activate + pip install jsonref + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: ThunderInterfaces-${{matrix.build_type}}-artifact + path: ${{matrix.build_type}} + + - name: Unpack files + run: | + tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz + rm ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz + +# ----- Checkout & Options regex ----- + - name: Checkout ThunderNanoServicesRDK + uses: actions/checkout@v4 + with: + path: ThunderNanoServicesRDK + repository: WebPlatformForEmbedded/ThunderNanoServicesRDK + + - name: Regex ThunderNanoServicesRDK + if: contains(github.event.pull_request.body, '[Options:') + id: plugins + uses: AsasInnab/regex-action@v1 + with: + regex_pattern: '(?<=\[Options:).*(?=\])' + regex_flags: 'gim' + search_string: ${{github.event.pull_request.body}} + +# ----- Build & upload artifacts ----- + - name: Build ThunderNanoServicesRDK + run: | + source venv/bin/activate + cmake -G Ninja -S ThunderNanoServicesRDK -B ${{matrix.build_type}}/build/ThunderNanoServicesRDK \ + -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror" \ + -DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror" \ + -DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \ + -DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \ + -DPLUGIN_DEVICEIDENTIFICATION=OFF \ + -DPLUGIN_DEVICEINFO=ON \ + -DPLUGIN_LOCATIONSYNC=ON \ + -DPLUGIN_MESSAGECONTROL=ON \ + -DPLUGIN_MESSENGER=ON \ + -DPLUGIN_MONITOR=ON \ + -DPLUGIN_OPENCDMI=ON \ + -DPLUGIN_PERFORMANCEMETRICS=ON \ + ${{steps.plugins.outputs.first_match}} + cmake --build ${{matrix.build_type}}/build/ThunderNanoServicesRDK --target install + + - name: Tar files + run: tar -czvf ${{matrix.build_type}}.tar.gz ${{matrix.build_type}} + + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ThunderNanoServicesRDK-${{matrix.build_type}}-artifact + path: ${{matrix.build_type}}.tar.gz diff --git a/MessageControl/MessageControl.h b/MessageControl/MessageControl.h index 87135ef..6cec80a 100644 --- a/MessageControl/MessageControl.h +++ b/MessageControl/MessageControl.h @@ -300,6 +300,9 @@ namespace Plugin { END_INTERFACE_MAP public: + using PluginHost::JSONRPC::Attach; + using PluginHost::JSONRPC::Detach; + const string Initialize(PluginHost::IShell* service) override; void Deinitialize(PluginHost::IShell* service) override; string Information() const override; diff --git a/MessageControl/MessageOutput.h b/MessageControl/MessageOutput.h index 2e80f52..9fe7e25 100644 --- a/MessageControl/MessageOutput.h +++ b/MessageControl/MessageOutput.h @@ -62,7 +62,7 @@ namespace Publishers { ~ConsoleOutput() override = default; public: - void Message(const Core::Messaging::MessageInfo& metadata, const string& text); + void Message(const Core::Messaging::MessageInfo& metadata, const string& text) override; private: Text _convertor; @@ -81,7 +81,7 @@ namespace Publishers { ~SyslogOutput() override = default; public: - void Message(const Core::Messaging::MessageInfo& metadata, const string& text); + void Message(const Core::Messaging::MessageInfo& metadata, const string& text) override; private: Text _convertor; @@ -111,7 +111,7 @@ namespace Publishers { } public: - void Message(const Core::Messaging::MessageInfo& metadata, const string& text); + void Message(const Core::Messaging::MessageInfo& metadata, const string& text) override; private: Text _convertor; @@ -377,7 +377,7 @@ namespace Publishers { } void UpdateChannel(); - void Message(const Core::Messaging::MessageInfo& metadata, const string& text); + void Message(const Core::Messaging::MessageInfo& metadata, const string& text) override; private: Text _convertor; diff --git a/Monitor/Monitor.h b/Monitor/Monitor.h index 64843e9..d38c6f8 100644 --- a/Monitor/Monitor.h +++ b/Monitor/Monitor.h @@ -440,7 +440,6 @@ namespace Plugin { class MonitorObject { public: MonitorObject() = delete; - MonitorObject& operator=(const MonitorObject&) = delete; enum evaluation { SUCCESFULL = 0x00, @@ -490,8 +489,8 @@ namespace Plugin { } } - MonitorObject(MonitorObject&) = delete; - MonitorObject& operator=(MonitorObject&) = delete; + MonitorObject(const MonitorObject&) = delete; + MonitorObject& operator=(const MonitorObject&) = delete; MonitorObject(MonitorObject&&) = delete; MonitorObject& operator=(MonitorObject&&) = delete; diff --git a/OpenCDMi/CMakeLists.txt b/OpenCDMi/CMakeLists.txt index 4797801..7d55f05 100644 --- a/OpenCDMi/CMakeLists.txt +++ b/OpenCDMi/CMakeLists.txt @@ -53,7 +53,9 @@ add_library(${MODULE_NAME} SHARED FrameworkRPC.cpp Module.cpp) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-gnu-unique") +if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-gnu-unique") +endif() set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/OpenCDMi/FrameworkRPC.cpp b/OpenCDMi/FrameworkRPC.cpp index 2425047..096035d 100644 --- a/OpenCDMi/FrameworkRPC.cpp +++ b/OpenCDMi/FrameworkRPC.cpp @@ -375,9 +375,9 @@ namespace Plugin { private: CDMi::IMediaKeySession* _mediaKeys; - CDMi::IMediaKeySessionExt* _mediaKeysExt; - uint8_t* _sessionKey; - uint32_t _sessionKeyLength; + VARIABLE_IS_NOT_USED CDMi::IMediaKeySessionExt* _mediaKeysExt; + VARIABLE_IS_NOT_USED uint8_t* _sessionKey; + VARIABLE_IS_NOT_USED uint32_t _sessionKeyLength; }; // IMediaKeys defines the MediaKeys interface. @@ -748,7 +748,7 @@ POP_WARNING() private: AccessorOCDM& _parent; mutable Core::CriticalSection _adminLock; - mutable uint32_t _refCount; + VARIABLE_IS_NOT_USED mutable uint32_t _refCount; std::string _keySystem; std::string _sessionId; CDMi::IMediaKeySession* _mediaKeySession; @@ -954,7 +954,7 @@ POP_WARNING() const std::string& keySystem, unsigned char Ids[], uint16_t idsLength, - uint32_t& count) + uint32_t& count) override { CDMi::IMediaKeysExt* systemExt = dynamic_cast(_parent.KeySystem(keySystem)); if (systemExt) { @@ -982,7 +982,7 @@ POP_WARNING() const unsigned char sessionID[], uint16_t sessionIDLength, const unsigned char serverResponse[], - uint16_t serverResponseLength) + uint16_t serverResponseLength) override { CDMi::IMediaKeysExt* systemExt = dynamic_cast(_parent.KeySystem(keySystem)); if (systemExt) { @@ -1418,21 +1418,21 @@ POP_WARNING() } } - virtual uint32_t Reset() + virtual uint32_t Reset() override { return (Core::ERROR_NONE); } - virtual RPC::IStringIterator* Systems() const + virtual RPC::IStringIterator* Systems() const override { return (Core::ServiceType::Create(_keySystems)); } - virtual RPC::IStringIterator* Designators(const string& keySystem) const + virtual RPC::IStringIterator* Designators(const string& keySystem) const override { std::list designators; LoadDesignators(keySystem, designators); return (Core::ServiceType::Create(designators)); } - virtual RPC::IStringIterator* Sessions(const string& keySystem) const + virtual RPC::IStringIterator* Sessions(const string& keySystem) const override { std::list sessions; LoadSessions(keySystem, sessions); diff --git a/OpenCDMi/Protobuf.h b/OpenCDMi/Protobuf.h index 6553315..9b57c85 100644 --- a/OpenCDMi/Protobuf.h +++ b/OpenCDMi/Protobuf.h @@ -463,7 +463,7 @@ namespace Protobuf { } return (result); } - WireType Type() const { + WireType Type() const override { return (WireType::LENGTH_DELIMITED); } diff --git a/PerformanceMetrics/PerformanceMetrics.h b/PerformanceMetrics/PerformanceMetrics.h index fd2b80e..2253b37 100644 --- a/PerformanceMetrics/PerformanceMetrics.h +++ b/PerformanceMetrics/PerformanceMetrics.h @@ -664,17 +664,17 @@ POP_WARNING() // If there is an error, return a string describing the issue why the initialisation failed. // The Service object is *NOT* reference counted, lifetime ends if the plugin is deactivated. // The lifetime of the Service object is guaranteed till the deinitialize method is called. - virtual const string Initialize(PluginHost::IShell* service); + virtual const string Initialize(PluginHost::IShell* service) override; // The plugin is unloaded from Thunder. This is call allows the module to notify clients // or to persist information if needed. After this call the plugin will unlink from the service path // and be deactivated. The Service object is the same as passed in during the Initialize. // After theis call, the lifetime of the Service object ends. - virtual void Deinitialize(PluginHost::IShell* service); + virtual void Deinitialize(PluginHost::IShell* service) override; // Returns an interface to a JSON struct that can be used to return specific metadata information with respect // to this plugin. This Metadata can be used by the MetData plugin to publish this information to the ouside world. - virtual string Information() const; + virtual string Information() const override; private: diff --git a/PerformanceMetrics/TraceOutput.cpp b/PerformanceMetrics/TraceOutput.cpp index 785586b..1ec9943 100644 --- a/PerformanceMetrics/TraceOutput.cpp +++ b/PerformanceMetrics/TraceOutput.cpp @@ -97,7 +97,7 @@ class MetricsTraceOuput : public PerformanceMetrics::IStateMetricsLogger { } } - void Activated() + void Activated() override { if( _memory != nullptr ) { TRACE(Trace::Metric, (_T("Plugin %s activated, RSS: %llu"), _callsign.c_str(), _memory->Resident())); @@ -158,7 +158,7 @@ class MetricsTraceOuputBrowser : public PerformanceMetrics::IBrowserMetricsLogge } } - void Activated() + void Activated() override { } @@ -226,7 +226,6 @@ std::unique_ptr PerformanceMetrics::L template std::unique_ptr PerformanceMetrics::LoggerFactory(); template std::unique_ptr PerformanceMetrics::LoggerFactory(); -template std::unique_ptr PerformanceMetrics::LoggerFactory(); } }