Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions HdcpProfile/HdcpProfile.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check failure on line 1 in HdcpProfile/HdcpProfile.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'HdcpProfile/HdcpProfile.cpp' (Match: HariniElangovan890/rdkservices/d73bf6eda46ff140b2d678f5a2eaf3fca1c07bbd, 304 lines, url: https://github.com/HariniElangovan890/rdkservices/archive/d73bf6eda46ff140b2d678f5a2eaf3fca1c07bbd.tar.gz, file: HdcpProfile/HdcpProfile.cpp)
* If not stated otherwise in this file or this component's LICENSE
* file the following copyright and licenses apply:
*
Expand Down Expand Up @@ -77,20 +77,18 @@
: PluginHost::JSONRPC()
{
RegisterAll();
_engine = Core::ProxyType<RPC::InvokeServerType<1, 0, 4>>::Create();
_communicatorClient = Core::ProxyType<RPC::CommunicatorClient>::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType<Core::IIPCServer>(_engine));
}

HdcpProfile::~HdcpProfile()
{
UnregisterAll();
}

const string HdcpProfile::Initialize(PluginHost::IShell * /* service */)
const string HdcpProfile::Initialize(PluginHost::IShell *service)
{
HdcpProfile::_instance = this;
InitializeIARM();
InitializePowerManager();
InitializePowerManager(service);
try
{
device::Manager::Initialize();
Expand All @@ -109,27 +107,16 @@
_powerManagerPlugin.Reset();
}

LOGINFO("Disconnect from the COM-RPC socket\n");

// Disconnect from the COM-RPC socket
if (_communicatorClient.IsValid()) {
_communicatorClient->Close(RPC::CommunicationTimeOut);
_communicatorClient.Release();
}
if (_engine.IsValid()) {
_engine.Release();
}
HdcpProfile::_instance = nullptr;
// No need to run device::Manager::DeInitialize for individual plugin. As it is a singleton instance
// and shared among all wpeframework plugins
DeinitializeIARM();
}

void HdcpProfile::InitializePowerManager()
void HdcpProfile::InitializePowerManager(PluginHost::IShell *service)
{
_powerManagerPlugin = PowerManagerInterfaceBuilder(_communicatorClient, _T("org.rdk.PowerManager"))
.withTimeout(3000)
.withVersion(~0)
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
.withIShell(service)
.createInterface();
}

Expand Down
4 changes: 1 addition & 3 deletions HdcpProfile/HdcpProfile.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check failure on line 1 in HdcpProfile/HdcpProfile.h

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'HdcpProfile/HdcpProfile.h' (Match: HariniElangovan890/rdkservices/d73bf6eda46ff140b2d678f5a2eaf3fca1c07bbd, 86 lines, url: https://github.com/HariniElangovan890/rdkservices/archive/d73bf6eda46ff140b2d678f5a2eaf3fca1c07bbd.tar.gz, file: HdcpProfile/HdcpProfile.h)
* If not stated otherwise in this file or this component's LICENSE
* file the following copyright and licenses apply:
*
Expand Down Expand Up @@ -46,16 +46,14 @@
// We do not allow this plugin to be copied !!
HdcpProfile(const HdcpProfile&) = delete;
HdcpProfile& operator=(const HdcpProfile&) = delete;
Core::ProxyType<RPC::InvokeServerType<1, 0, 4> > _engine;
Core::ProxyType<RPC::CommunicatorClient> _communicatorClient;
static PowerManagerInterfaceRef _powerManagerPlugin;

void InitializeIARM();
void DeinitializeIARM();

void RegisterAll();
void UnregisterAll();
void InitializePowerManager();
void InitializePowerManager(PluginHost::IShell * service);

//Begin methods
uint32_t getHDCPStatusWrapper(const JsonObject& parameters, JsonObject& response);
Expand Down
24 changes: 5 additions & 19 deletions HdmiCecSink/HdmiCecSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,16 +687,14 @@ namespace WPEFramework
, _registeredEventHandlers(false)
{
LOGWARN("Initlaizing HdmiCecSink");
_engine = Core::ProxyType<RPC::InvokeServerType<1, 0, 4>>::Create();
_communicatorClient = Core::ProxyType<RPC::CommunicatorClient>::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType<Core::IIPCServer>(_engine));
}

HdmiCecSink::~HdmiCecSink()
{
}
const std::string HdmiCecSink::Initialize(PluginHost::IShell * /* service */)
const std::string HdmiCecSink::Initialize(PluginHost::IShell *service)
{
InitializePowerManager();
InitializePowerManager(service);
profileType = searchRdkProfile();

if (profileType == STB || profileType == NOT_FOUND)
Expand Down Expand Up @@ -826,17 +824,6 @@ namespace WPEFramework
{
_powerManagerPlugin.Reset();
}
LOGINFO("Disconnect from the COM-RPC socket\n");
// Disconnect from the COM-RPC socket
if (_communicatorClient.IsValid())
{
_communicatorClient->Close(RPC::CommunicationTimeOut);
_communicatorClient.Release();
}
if(_engine.IsValid())
{
_engine.Release();
}
_registeredEventHandlers = false;

profileType = searchRdkProfile();
Expand Down Expand Up @@ -910,11 +897,10 @@ namespace WPEFramework
}
}

void HdmiCecSink::InitializePowerManager()
void HdmiCecSink::InitializePowerManager(PluginHost::IShell *service)
{
_powerManagerPlugin = PowerManagerInterfaceBuilder(_communicatorClient, _T("org.rdk.PowerManager"))
.withTimeout(3000)
.withVersion(~0)
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
.withIShell(service)
.createInterface();
registerEventHandlers();
}
Expand Down
4 changes: 1 addition & 3 deletions HdmiCecSink/HdmiCecSink.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ namespace WPEFramework {
uint32_t getAudioDeviceConnectedStatusWrapper(const JsonObject& parameters, JsonObject& response);
uint32_t requestAudioDevicePowerStatusWrapper(const JsonObject& parameters, JsonObject& response);
uint32_t setLatencyInfoWrapper(const JsonObject& parameters, JsonObject& response);
void InitializePowerManager();
void InitializePowerManager(PluginHost::IShell *service);
//End methods
std::string logicalAddressDeviceType;
bool cecSettingEnabled;
Expand Down Expand Up @@ -690,8 +690,6 @@ namespace WPEFramework {
std::vector<uint8_t> m_connectedDevices;
HdmiCecSinkProcessor *msgProcessor;
HdmiCecSinkFrameListener *msgFrameListener;
Core::ProxyType<RPC::InvokeServerType<1, 0, 4> > _engine;
Core::ProxyType<RPC::CommunicatorClient> _communicatorClient;
PowerManagerInterfaceRef _powerManagerPlugin;
Core::Sink<PowerManagerNotification> _pwrMgrNotification;
bool _registeredEventHandlers;
Expand Down
24 changes: 5 additions & 19 deletions HdmiCecSource/HdmiCecSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,16 +404,14 @@ namespace WPEFramework
, _registeredEventHandlers(false)
{
LOGWARN("ctor");
_engine = Core::ProxyType<RPC::InvokeServerType<1, 0, 4>>::Create();
_communicatorClient = Core::ProxyType<RPC::CommunicatorClient>::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType<Core::IIPCServer>(_engine));
}

HdmiCecSource::~HdmiCecSource()
{
LOGWARN("dtor");
}

const string HdmiCecSource::Initialize(PluginHost::IShell* /* service */)
const string HdmiCecSource::Initialize(PluginHost::IShell *service)
{
LOGWARN("Initlaizing CEC_2");
uint32_t res = Core::ERROR_GENERAL;
Expand Down Expand Up @@ -456,7 +454,7 @@ namespace WPEFramework

//CEC plugin functionalities will only work if CECmgr is available. If plugin Initialize failure upper layer will call dtor directly.
InitializeIARM();
InitializePowerManager();
InitializePowerManager(service);

// load persistence setting
loadSettings();
Expand Down Expand Up @@ -539,17 +537,6 @@ namespace WPEFramework
{
_powerManagerPlugin.Reset();
}
LOGINFO("Disconnect from the COM-RPC socket\n");
// Disconnect from the COM-RPC socket
if (_communicatorClient.IsValid())
{
_communicatorClient->Close(RPC::CommunicationTimeOut);
_communicatorClient.Release();
}
if(_engine.IsValid())
{
_engine.Release();
}
_registeredEventHandlers = false;

profileType = searchRdkProfile();
Expand Down Expand Up @@ -729,12 +716,11 @@ namespace WPEFramework
return ret;
}

void HdmiCecSource::InitializePowerManager()
void HdmiCecSource::InitializePowerManager(PluginHost::IShell *service)
{
LOGINFO("Connect the COM-RPC socket\n");
_powerManagerPlugin = PowerManagerInterfaceBuilder(_communicatorClient, _T("org.rdk.PowerManager"))
.withTimeout(3000)
.withVersion(~0)
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
.withIShell(service)
.createInterface();
registerEventHandlers();
}
Expand Down
4 changes: 1 addition & 3 deletions HdmiCecSource/HdmiCecSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ namespace WPEFramework {

HdmiCecSourceProcessor *msgProcessor;
HdmiCecSourceFrameListener *msgFrameListener;
void InitializePowerManager();
void InitializePowerManager(PluginHost::IShell *service);
const void InitializeIARM();
void DeinitializeIARM();
static void dsHdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len);
Expand Down Expand Up @@ -329,8 +329,6 @@ namespace WPEFramework {
static void threadHotPlugEventHandler(int data);
static void threadCecDaemonInitHandler();
static void threadCecStatusUpdateHandler(int data);
Core::ProxyType<RPC::InvokeServerType<1, 0, 4> > _engine;
Core::ProxyType<RPC::CommunicatorClient> _communicatorClient;
PowerManagerInterfaceRef _powerManagerPlugin;
Core::Sink<PowerManagerNotification> _pwrMgrNotification;
bool _registeredEventHandlers;
Expand Down
24 changes: 5 additions & 19 deletions HdmiCec_2/HdmiCec_2.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check failure on line 1 in HdmiCec_2/HdmiCec_2.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'HdmiCec_2/HdmiCec_2.cpp' (Match: rdkcentral/rdkservices/1, 1776 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: HdmiCec_2/HdmiCec_2.cpp)
* If not stated otherwise in this file or this component's LICENSE
* file the following copyright and licenses apply:
*
Expand Down Expand Up @@ -405,8 +405,6 @@
Register(HDMICEC2_METHOD_GET_ACTIVE_SOURCE_STATUS, &HdmiCec_2::getActiveSourceStatus, this);
Register(HDMICEC2_METHOD_SEND_KEY_PRESS,&HdmiCec_2::sendRemoteKeyPressWrapper,this);
Register("getDeviceList", &HdmiCec_2::getDeviceList, this);
_engine = Core::ProxyType<RPC::InvokeServerType<1, 0, 4>>::Create();
_communicatorClient = Core::ProxyType<RPC::CommunicatorClient>::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType<Core::IIPCServer>(_engine));
}

HdmiCec_2::~HdmiCec_2()
Expand All @@ -415,7 +413,7 @@
LOGWARN("dtor");
}

const string HdmiCec_2::Initialize(PluginHost::IShell* /* service */)
const string HdmiCec_2::Initialize(PluginHost::IShell* service)
{
LOGWARN("Initlaizing CEC_2");
string msg;
Expand Down Expand Up @@ -448,7 +446,7 @@

//CEC plugin functionalities will only work if CECmgr is available. If plugin Initialize failure upper layer will call dtor directly.
InitializeIARM();
InitializePowerManager();
InitializePowerManager(service);

// load persistence setting
loadSettings();
Expand Down Expand Up @@ -520,17 +518,6 @@
{
_powerManagerPlugin.Reset();
}
LOGINFO("Disconnect from the COM-RPC socket\n");
// Disconnect from the COM-RPC socket
if (_communicatorClient.IsValid())
{
_communicatorClient->Close(RPC::CommunicationTimeOut);
_communicatorClient.Release();
}
if(_engine.IsValid())
{
_engine.Release();
}
_registeredEventHandlers = false;
if(true == getEnabled())
{
Expand All @@ -554,12 +541,11 @@
}
}

void HdmiCec_2::InitializePowerManager()
void HdmiCec_2::InitializePowerManager(PluginHost::IShell* service)
{
LOGINFO("Connect the COM-RPC socket\n");
_powerManagerPlugin = PowerManagerInterfaceBuilder(_communicatorClient, _T("org.rdk.PowerManager"))
.withTimeout(3000)
.withVersion(~0)
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
.withIShell(service)
.createInterface();
registerEventHandlers();
}
Expand Down
4 changes: 1 addition & 3 deletions HdmiCec_2/HdmiCec_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,10 @@ namespace WPEFramework {

HdmiCec_2Processor *msgProcessor;
HdmiCec_2FrameListener *msgFrameListener;
Core::ProxyType<RPC::InvokeServerType<1, 0, 4> > _engine;
Core::ProxyType<RPC::CommunicatorClient> _communicatorClient;
PowerManagerInterfaceRef _powerManagerPlugin;
Core::Sink<PowerManagerNotification> _pwrMgrNotification;
bool _registeredEventHandlers;
void InitializePowerManager();
void InitializePowerManagerPluginHost::IShell *service
const void InitializeIARM();
void DeinitializeIARM();
static void cecMgrEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len);
Expand Down
Loading
Loading