diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 457439a9..ca7a670b 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -144,13 +144,11 @@ endif() #secmanager/client macros if(CMAKE_USE_SECCLIENT) message("CMAKE_USE_SECCLIENT set") - set(LIB_EXT_DEPENDS "${LIB_EXT_DEPENDS} -lFireboltSDK") set(LIB_EXT_DEFINES "${LIB_EXT_DEFINES} -DUSE_SECCLIENT") list(APPEND LIB_EXT_DEPENDS -lSecClient ) endif() if(CMAKE_USE_SECMANAGER) message("CMAKE_USE_SECMANAGER set") - set(LIB_EXT_DEPENDS "${LIB_EXT_DEPENDS} -lFireboltSDK") set(LIB_EXT_DEFINES "${LIB_EXT_DEFINES} -DUSE_SECMANAGER") endif() @@ -182,8 +180,9 @@ target_link_libraries(playerfbinterface playerlogmanager) target_link_libraries(playerfbinterface baseconversion) target_link_libraries(playerfbinterface playerjsonobject) if(CMAKE_USE_SECCLIENT OR CMAKE_USE_SECMANAGER) - find_package(FireboltAamp CONFIG REQUIRED) - target_link_libraries(playerfbinterface FireboltAamp::FireboltAamp) + find_package(FireboltTransport CONFIG REQUIRED) + find_package(FireboltEntOs CONFIG REQUIRED) + target_link_libraries(playerfbinterface FireboltTransport::FireboltTransport FireboltEntOs::FireboltEntOs) endif() # Configure pkg-config file diff --git a/externals/IFirebolt/FireboltInterface.cpp b/externals/IFirebolt/FireboltInterface.cpp index 8b2b3334..27b905a5 100644 --- a/externals/IFirebolt/FireboltInterface.cpp +++ b/externals/IFirebolt/FireboltInterface.cpp @@ -68,36 +68,23 @@ FireboltInterface::FireboltInterface() bool FireboltInterface::CreateFireboltInstance(const std::string &url) { - const std::string config = "{\ - \"waitTime\": 5000,\ - \"logLevel\": \"Info\",\ - \"workerPool\":{\ - \"queueSize\": 8,\ - \"threadCount\": 3\ - },\ - \"wsUrl\": " + url + - "}"; + Firebolt::Config cfg{}; + cfg.wsUrl = url; + cfg.waitTime_ms = 5000; - auto callback = [this](bool connected, Firebolt::Error error) { - this->ConnectionChanged(connected, static_cast(error)); - }; - mIsConnected = false; - MW_LOG_ERR("CreateFireboltInstance url: %s -- config : %s", url.c_str(), config.c_str()); - Firebolt::Error errorInitialize = Firebolt::IFireboltAampAccessor::Instance().Initialize(config); - if (errorInitialize != Firebolt::Error::None) - { - MW_LOG_ERR("Failed to create FireboltInstance InitializeError:\"%d\"", static_cast(errorInitialize)); - return false; - } - auto errorConnect = Firebolt::IFireboltAampAccessor::Instance().Connect(callback); - if (!errorConnect) - { - MW_LOG_ERR("Failed to create FireboltInstance ConnectError:\"%d\"", static_cast(errorConnect.error())); - return false; - } - mListenerId = *errorConnect; - MW_LOG_INFO("Firebolt Instance created successfully, Connected to Firebolt!"); - return true; + auto callback = [this](const bool connected, const Firebolt::Error error) { + this->ConnectionChanged(connected, static_cast(error)); + }; + mIsConnected = false; + MW_LOG_ERR("CreateFireboltInstance url: %s", url.c_str()); + Firebolt::Error errorConnect = Firebolt::EntOs::IFireboltAccessor::Instance().Connect(cfg, callback); + if (errorConnect != Firebolt::Error::None) + { + MW_LOG_ERR("Failed to create FireboltInstance ConnectError:\"%d\"", static_cast(errorConnect)); + return false; + } + MW_LOG_INFO("Firebolt Instance created successfully, Connected to Firebolt!"); + return true; } void FireboltInterface::ConnectionChanged(const bool connected, int error) @@ -113,12 +100,12 @@ void FireboltInterface::ConnectionChanged(const bool connected, int error) void FireboltInterface::DestroyFireboltInstance() { MW_LOG_WARN("Destroying Firebolt instance"); - Firebolt::IFireboltAampAccessor::Instance().Disconnect(mListenerId); + Firebolt::EntOs::IFireboltAccessor::Instance().Disconnect(); } FireboltInterface::~FireboltInterface() { - Firebolt::IFireboltAampAccessor::Instance().ContentProtectionInterface().unsubscribeAll(); - Firebolt::IFireboltAampAccessor::Instance().DeviceInterface().unsubscribeAll(); + Firebolt::EntOs::IFireboltAccessor::Instance().ContentProtectionInterface().unsubscribeAll(); + Firebolt::EntOs::IFireboltAccessor::Instance().DeviceInterface().unsubscribeAll(); DestroyFireboltInstance(); } \ No newline at end of file diff --git a/externals/IFirebolt/FireboltInterface.h b/externals/IFirebolt/FireboltInterface.h index 6714199c..f1610a19 100644 --- a/externals/IFirebolt/FireboltInterface.h +++ b/externals/IFirebolt/FireboltInterface.h @@ -24,7 +24,7 @@ #pragma once -#include "fireboltaamp.h" +#include "firebolt/entos/firebolt.h" #include @@ -44,8 +44,6 @@ class FireboltInterface{ bool mIsConnected = false; - unsigned int mListenerId; - FireboltInterface(); bool CreateFireboltInstance(const std::string &url); diff --git a/externals/contentsecuritymanager/IFirebolt/ContentProtectionFirebolt.cpp b/externals/contentsecuritymanager/IFirebolt/ContentProtectionFirebolt.cpp index edd608e0..a284c391 100644 --- a/externals/contentsecuritymanager/IFirebolt/ContentProtectionFirebolt.cpp +++ b/externals/contentsecuritymanager/IFirebolt/ContentProtectionFirebolt.cpp @@ -22,8 +22,7 @@ #include "_base64.h" #include "PlayerJsonObject.h" #include "PlayerLogManager.h" -#include "contentprotection.h" -#include "fireboltaamp.h" +#include "firebolt/entos/firebolt.h" #include "FireboltInterface.h" #include @@ -36,7 +35,7 @@ std::condition_variable mConnectionCV; std::mutex mConnectionMutex; -using namespace Firebolt; +using namespace Firebolt::EntOs; uint64_t ContentProtectionFirebolt::mSubscriptionId = 0; //Lookup table to convert CPS error to secmanager error @@ -96,7 +95,7 @@ ContentProtectionFirebolt::~ContentProtectionFirebolt() // TODO- Yet to test Watermark Events as ContentProtection Thunder Plugin have issues. void ContentProtectionFirebolt::SubscribeEvents() { - auto result = Firebolt::IFireboltAampAccessor::Instance().ContentProtectionInterface().subscribeOnWatermarkStatusChanged( + auto result = Firebolt::EntOs::IFireboltAccessor::Instance().ContentProtectionInterface().subscribeOnWatermarkStatusChanged( [this](const auto& status) { HandleWatermarkEvent(status.sessionId, status.status, status.appId); @@ -117,7 +116,7 @@ void ContentProtectionFirebolt::UnSubscribeEvents() { MW_LOG_INFO("Unsubscribing from Firebolt Content Protection events %lld", mSubscriptionId); auto result = - Firebolt::IFireboltAampAccessor::Instance().ContentProtectionInterface().unsubscribe(mSubscriptionId); + Firebolt::EntOs::IFireboltAccessor::Instance().ContentProtectionInterface().unsubscribe(mSubscriptionId); if (result.error() != Firebolt::Error::None) { MW_LOG_ERR("Failed to Unsubscribe to watermark events: %d", static_cast(result.error())); @@ -436,7 +435,7 @@ void ContentProtectionFirebolt::CloseDrmSession(int64_t sessionId) } std::lock_guard lock(mContentProtectionMutex); // Call the closeDrmSession method from the interface - auto result = Firebolt::IFireboltAampAccessor::Instance().ContentProtectionInterface().closeDrmSession(std::to_string(sessionId)); + auto result = Firebolt::EntOs::IFireboltAccessor::Instance().ContentProtectionInterface().closeDrmSession(std::to_string(sessionId)); // Check for errors if (result.error() == Firebolt::Error::None) { @@ -459,18 +458,18 @@ bool ContentProtectionFirebolt::SetDrmSessionState(int64_t sessionId, bool activ MW_LOG_ERR("Firebolt is not active (or) channel couldn't be opened"); return ret; } - Firebolt::ContentProtection::SessionState sessionState; + Firebolt::EntOs::ContentProtection::SessionState sessionState; if (active) { - sessionState = Firebolt::ContentProtection::SessionState::ACTIVE; + sessionState = Firebolt::EntOs::ContentProtection::SessionState::ACTIVE; } else { - sessionState = Firebolt::ContentProtection::SessionState::INACTIVE; + sessionState = Firebolt::EntOs::ContentProtection::SessionState::INACTIVE; } std::lock_guard lock(mContentProtectionMutex); // Call the setDrmSessionState method from the interface - auto result = Firebolt::IFireboltAampAccessor::Instance().ContentProtectionInterface().setDrmSessionState(std::to_string(sessionId), sessionState); + auto result = Firebolt::EntOs::IFireboltAccessor::Instance().ContentProtectionInterface().setDrmSessionState(std::to_string(sessionId), sessionState); // Check for errors if (result.error() == Firebolt::Error::None) { @@ -499,7 +498,7 @@ bool ContentProtectionFirebolt::SetPlaybackPosition(int64_t sessionId, float spe } std::lock_guard lock(mContentProtectionMutex); // Call the setPlaybackPosition method from the interface - auto result = Firebolt::IFireboltAampAccessor::Instance().ContentProtectionInterface().setPlaybackPosition(std::to_string(sessionId), speed, position); + auto result = Firebolt::EntOs::IFireboltAccessor::Instance().ContentProtectionInterface().setPlaybackPosition(std::to_string(sessionId), speed, position); // Check for errors if (result.error() == Firebolt::Error::None) { @@ -527,7 +526,7 @@ void ContentProtectionFirebolt::ShowWatermark(bool show, int64_t sessionId) std::lock_guard lock(mContentProtectionMutex); // Call the showWatermark method from the interface - auto result = Firebolt::IFireboltAampAccessor::Instance().ContentProtectionInterface().showWatermark(std::to_string(sessionId), show, 0); + auto result = Firebolt::EntOs::IFireboltAccessor::Instance().ContentProtectionInterface().showWatermark(std::to_string(sessionId), show, 0); // Check for errors if (result.error() == Firebolt::Error::None) { // No error, watermark visibility was successfully set @@ -537,24 +536,24 @@ void ContentProtectionFirebolt::ShowWatermark(bool show, int64_t sessionId) MW_LOG_ERR("showWatermark failed. Firebolt Error: \"%d\"", static_cast(result.error())); } } -static Firebolt::ContentProtection::KeySystem convertStringToKeySystem(const std::string& keySystemStr) +static Firebolt::EntOs::ContentProtection::KeySystem convertStringToKeySystem(const std::string& keySystemStr) { if (keySystemStr.find("widevine") != std::string::npos) { - return Firebolt::ContentProtection::KeySystem::WIDEVINE; + return Firebolt::EntOs::ContentProtection::KeySystem::WIDEVINE; } else if (keySystemStr.find("playready") != std::string::npos) { - return Firebolt::ContentProtection::KeySystem::PLAYREADY; + return Firebolt::EntOs::ContentProtection::KeySystem::PLAYREADY; } else if (keySystemStr.find("clearkey") != std::string::npos) { - return Firebolt::ContentProtection::KeySystem::CLEARKEY; + return Firebolt::EntOs::ContentProtection::KeySystem::CLEARKEY; } else { MW_LOG_ERR("Unknown KeySystem string: %s returning to default", keySystemStr.c_str()); - return Firebolt::ContentProtection::KeySystem::WIDEVINE; // safest fallback default + return Firebolt::EntOs::ContentProtection::KeySystem::WIDEVINE; // safest fallback default } } bool ContentProtectionFirebolt::OpenDrmSession(std::string& clientId, std::string appId, std::string keySystem, std::string licenseRequest, std::string initData, int64_t &sessionId, int32_t &errorCode, std::string &response) @@ -565,8 +564,8 @@ bool ContentProtectionFirebolt::OpenDrmSession(std::string& clientId, std::strin MW_LOG_ERR("Firebolt is not active (or) channel couldn't be opened"); return false; // Return false if system is not active } -// Firebolt::ContentProtection::DRMSession drmSession; - auto drmSession = Firebolt::IFireboltAampAccessor::Instance() +// Firebolt::EntOs::ContentProtection::DRMSession drmSession; + auto drmSession = Firebolt::EntOs::IFireboltAccessor::Instance() .ContentProtectionInterface() .openDrmSession(clientId, appId, convertStringToKeySystem(keySystem), licenseRequest, initData); @@ -593,7 +592,7 @@ bool ContentProtectionFirebolt::UpdateDrmSession(int64_t sessionId, int32_t &err return false; // Return false if system is not active } - auto drmSession = Firebolt::IFireboltAampAccessor::Instance() + auto drmSession = Firebolt::EntOs::IFireboltAccessor::Instance() .ContentProtectionInterface() .updateDrmSession(std::to_string(sessionId), licenseRequest, initData); diff --git a/externals/rdk/IFirebolt/DeviceFireboltInterface.cpp b/externals/rdk/IFirebolt/DeviceFireboltInterface.cpp index 2f08631b..aa7c5e20 100644 --- a/externals/rdk/IFirebolt/DeviceFireboltInterface.cpp +++ b/externals/rdk/IFirebolt/DeviceFireboltInterface.cpp @@ -33,7 +33,7 @@ IFirebolt folder to be deleted, as IARM is no longer available as an alternative */ #include "DeviceFireboltInterface.h" -#include "fireboltaamp.h" +#include "firebolt/entos/firebolt.h" #include "PlayerLogManager.h" #include "PlayerExternalsRdkInterface.h" #include "PlayerExternalUtils.h" @@ -49,9 +49,9 @@ std::shared_ptr s_pDeviceFireboltInterface = nullptr; std::mutex mFireboltConnectionMutex; std::condition_variable mFireboltConnectionCV; -static void HDCPEventHandlerFirebolt(const Firebolt::Device::HDCPVersionMap& t_HDCPVersionMap); -static void ResolutionHandlerFirebolt(const std::string& t_res); -static void getActiveInterfaceEventHandlerFirebolt (const Firebolt::Device::NetworkInfoResult& t_NetworkInfoResult); +static void HDCPEventHandlerFirebolt(const Firebolt::EntOs::Device::HDCPVersionMap& t_HDCPVersionMap); +static void ResolutionHandlerFirebolt(const Firebolt::EntOs::Device::Resolution& t_res); +static void getActiveInterfaceEventHandlerFirebolt (const Firebolt::EntOs::Device::NetworkInfoResult& t_NetworkInfoResult); std::shared_ptr DeviceFireboltInterface::GetInstance() { @@ -99,7 +99,7 @@ void DeviceFireboltInterface::RegisterDsMgrEventHandler() MW_PRE_LOGGER_LOG("Subscribing to Firebolt hdcp change event \n"); - auto result = Firebolt::IFireboltAampAccessor::Instance().DeviceInterface().subscribeOnHdcpChanged( + auto result = Firebolt::EntOs::IFireboltAccessor::Instance().DeviceInterface().subscribeOnHdcpChanged( [](const auto& hdcpProtocol) { MW_LOG_ERR("[Event] HDCP changed"); HDCPEventHandlerFirebolt(hdcpProtocol); @@ -118,10 +118,10 @@ void DeviceFireboltInterface::RegisterDsMgrEventHandler() MW_PRE_LOGGER_LOG("Subscribing to Firebolt resolution change event \n"); - result = Firebolt::IFireboltAampAccessor::Instance().DeviceInterface().subscribeOnVideoResolutionChanged( - [](const std::string& videoResolution) + result = Firebolt::EntOs::IFireboltAccessor::Instance().DeviceInterface().subscribeOnVideoResolutionChanged( + [](const Firebolt::EntOs::Device::Resolution& videoResolution) { - MW_LOG_WARN("[Event] Video resolution changed: %s" , videoResolution.c_str()); + MW_LOG_WARN("[Event] Video resolution changed"); ResolutionHandlerFirebolt(videoResolution); }); if(result) @@ -139,14 +139,14 @@ void DeviceFireboltInterface::RegisterDsMgrEventHandler() void DeviceFireboltInterface::RemoveEventHandlers() { //removes everything ... - Firebolt::IFireboltAampAccessor::Instance().DeviceInterface().unsubscribeAll(); + Firebolt::EntOs::IFireboltAccessor::Instance().DeviceInterface().unsubscribeAll(); } void DeviceFireboltInterface::RegisterNtwMgrEventHandler() { MW_PRE_LOGGER_LOG("Subscribing to Firebolt Network change event\n"); - auto result = Firebolt::IFireboltAampAccessor::Instance().DeviceInterface().subscribeOnNetworkChanged( + auto result = Firebolt::EntOs::IFireboltAccessor::Instance().DeviceInterface().subscribeOnNetworkChanged( [](const auto& network) { MW_LOG_ERR("[Event] network changed"); getActiveInterfaceEventHandlerFirebolt(network); @@ -165,11 +165,11 @@ void DeviceFireboltInterface::RegisterNtwMgrEventHandler() std::shared_ptr pInstance = PlayerExternalsRdkInterface::GetPlayerExternalsRdkInterfaceInstance(); - auto network = Firebolt::IFireboltAampAccessor::Instance().DeviceInterface().network(); + auto network = Firebolt::EntOs::IFireboltAccessor::Instance().DeviceInterface().network(); if(network) { - if(network.value().type == Firebolt::Device::NetworkType::WIFI) + if(network.value().type == Firebolt::EntOs::Device::NetworkType::WIFI) { MW_PRE_LOGGER_LOG("Active interface wifi\n"); pInstance->SetActiveInterface(true); @@ -189,20 +189,20 @@ char * DeviceFireboltInterface::GetTR181Config(const char * paramName, size_t & return nullptr; } -static void getActiveInterfaceEventHandlerFirebolt (const Firebolt::Device::NetworkInfoResult& t_NetworkInfoResult) +static void getActiveInterfaceEventHandlerFirebolt (const Firebolt::EntOs::Device::NetworkInfoResult& t_NetworkInfoResult) { std::shared_ptr pInstance = PlayerExternalsRdkInterface::GetPlayerExternalsRdkInterfaceInstance(); - if(t_NetworkInfoResult.state == Firebolt::Device::NetworkState::CONNECTED) + if(t_NetworkInfoResult.state == Firebolt::EntOs::Device::NetworkState::CONNECTED) { std::string interface = "unknown"; - if(t_NetworkInfoResult.type == Firebolt::Device::NetworkType::WIFI) + if(t_NetworkInfoResult.type == Firebolt::EntOs::Device::NetworkType::WIFI) { interface = "wlan"; pInstance->SetActiveInterface(true); MW_LOG_INFO("Network interface changed to wifi"); } - else if(t_NetworkInfoResult.type == Firebolt::Device::NetworkType::ETHERNET) + else if(t_NetworkInfoResult.type == Firebolt::EntOs::Device::NetworkType::ETHERNET) { interface = "eth"; pInstance->SetActiveInterface(false); @@ -225,7 +225,7 @@ static void getActiveInterfaceEventHandlerFirebolt (const Firebolt::Device::Netw /** * @brief IARM event handler for HDCP and HDMI hot plug events */ -static void HDCPEventHandlerFirebolt(const Firebolt::Device::HDCPVersionMap& t_HDCPVersionMap) +static void HDCPEventHandlerFirebolt(const Firebolt::EntOs::Device::HDCPVersionMap& t_HDCPVersionMap) { std::shared_ptr pInstance = PlayerExternalsRdkInterface::GetPlayerExternalsRdkInterfaceInstance(); @@ -251,14 +251,14 @@ static void HDCPEventHandlerFirebolt(const Firebolt::Device::HDCPVersionMap& t_H /** * @brief IARM event handler for resolution changes */ -static void ResolutionHandlerFirebolt(const std::string& t_res) +static void ResolutionHandlerFirebolt(const Firebolt::EntOs::Device::Resolution& t_res) { int width = 1280; int height = 720; - MW_LOG_INFO("Resolution: %s", t_res.c_str()); + MW_LOG_INFO("Resolution changed"); - auto curr_network = Firebolt::IFireboltAampAccessor::Instance().DeviceInterface().videoResolution(); + auto curr_network = Firebolt::EntOs::IFireboltAccessor::Instance().DeviceInterface().videoResolution(); if(curr_network) {