Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5b1743f
CEC source and sink changes
karuppaiyak Sep 4, 2025
55ceafa
added host.hpp
karuppaiyak Sep 4, 2025
a0fa4dc
base interface template change
karuppaiyak Sep 9, 2025
eac3ee0
copilot warnings
karuppaiyak Sep 9, 2025
08b3562
review comments added
karuppaiyak Sep 9, 2025
e7f3075
moved device setting init to plugin init
karuppaiyak Sep 9, 2025
ff6eeee
reverted changes in HdmiCecSource/HdmiCecSource.cpp
karuppaiyak Sep 15, 2025
922fb7f
reverted init failure
karuppaiyak Sep 15, 2025
3501b16
test1
karuppaiyak Sep 17, 2025
f2c5780
compilation fixed
karuppaiyak Sep 17, 2025
bc803aa
added exception handling
karuppaiyak Sep 17, 2025
0623a75
corrected reference
karuppaiyak Sep 18, 2025
e9cd34f
handled return value
karuppaiyak Sep 18, 2025
f8ea54c
unit test addition
karuppaiyak Sep 19, 2025
76a6dd1
removed tests-trigger changes
karuppaiyak Sep 19, 2025
6ae6bd0
L1 unit test for source
karuppaiyak Sep 19, 2025
73a1113
instance pb
karuppaiyak Sep 19, 2025
0c48f19
Cec Sink L1 test corrected
karuppaiyak Sep 22, 2025
97af88f
enabled cec sink l1 test
karuppaiyak Sep 22, 2025
8f16519
using old tf branch
karuppaiyak Sep 22, 2025
27b02c7
host setImpl Added
karuppaiyak Sep 23, 2025
2e3aada
hdmiinput setimpl added
karuppaiyak Sep 23, 2025
8b5c432
CEC source and sink changes
karuppaiyak Sep 4, 2025
8b0cc04
added host.hpp
karuppaiyak Sep 4, 2025
60c25bd
base interface template change
karuppaiyak Sep 9, 2025
ff83a02
copilot warnings
karuppaiyak Sep 9, 2025
da3518c
review comments added
karuppaiyak Sep 9, 2025
24d314b
moved device setting init to plugin init
karuppaiyak Sep 9, 2025
14f2003
reverted changes in HdmiCecSource/HdmiCecSource.cpp
karuppaiyak Sep 15, 2025
ebd3200
reverted init failure
karuppaiyak Sep 15, 2025
6993a8d
test1
karuppaiyak Sep 17, 2025
a22b587
compilation fixed
karuppaiyak Sep 17, 2025
51b2c7f
added exception handling
karuppaiyak Sep 17, 2025
a0ccdbb
corrected reference
karuppaiyak Sep 18, 2025
6eacd50
handled return value
karuppaiyak Sep 18, 2025
96b094d
unit test addition
karuppaiyak Sep 19, 2025
cc42754
removed tests-trigger changes
karuppaiyak Sep 19, 2025
a3c694f
L1 unit test for source
karuppaiyak Sep 19, 2025
abc1156
instance pb
karuppaiyak Sep 19, 2025
7415208
Cec Sink L1 test corrected
karuppaiyak Sep 22, 2025
72bfc2a
enabled cec sink l1 test
karuppaiyak Sep 22, 2025
f73190e
using old tf branch
karuppaiyak Sep 22, 2025
2515fdd
host setImpl Added
karuppaiyak Sep 23, 2025
91b669a
hdmiinput setimpl added
karuppaiyak Sep 23, 2025
6e18267
Revert L1-tests.yml
KaleeswaranGnanagurusamy Sep 23, 2025
11c0a7d
Merge branch 'feature/RDKEMW-6163-c1' of https://github.com/rdkcentra…
karuppaiyak Sep 24, 2025
408cdc5
fw api calls validations
karuppaiyak Sep 24, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/L1-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
with:
repository: rdkcentral/entservices-testframework
path: entservices-testframework
ref: develop
ref: feature/RDKEMW-6167
token: ${{ secrets.RDKCM_RDKE }}

- name: Checkout entservices-inputoutput
Expand Down Expand Up @@ -460,8 +460,8 @@ jobs:
-DDS_FOUND=ON
-DHAS_FRONT_PANEL=ON
-DRDK_SERVICES_L1_TEST=ON
-DPLUGIN_AVINPUT=ON
-DPLUGIN_HDCPPROFILE=ON
-DPLUGIN_AVINPUT=OFF
-DPLUGIN_HDCPPROFILE=OFF
-DPLUGIN_HDMICECSOURCE=ON
-DPLUGIN_HDMICECSINK=ON
-DUSE_THUNDER_R4=ON
Expand Down
463 changes: 225 additions & 238 deletions HdmiCecSink/HdmiCecSink.cpp

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion HdmiCecSink/HdmiCecSink.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check failure on line 1 in HdmiCecSink/HdmiCecSink.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 'HdmiCecSink/HdmiCecSink.h' (Match: rdkcentral/rdkservices/1, 755 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: HdmiCecSink/HdmiCecSink.h)

Check failure on line 1 in HdmiCecSink/HdmiCecSink.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 'HdmiCecSink/HdmiCecSink.h' (Match: rdkcentral/rdkservices/1, 755 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: HdmiCecSink/HdmiCecSink.h)
* If not stated otherwise in this file or this component's LICENSE
* file the following copyright and licenses apply:
*
Expand Down Expand Up @@ -41,6 +41,8 @@
#include "UtilsLogging.h"
#include <interfaces/IPowerManager.h>
#include "PowerManagerInterface.h"
#include "host.hpp"


using namespace WPEFramework;
using PowerState = WPEFramework::Exchange::IPowerManager::PowerState;
Expand Down Expand Up @@ -482,7 +484,7 @@
// As the registration/unregistration of notifications is realized by the class PluginHost::JSONRPC,
// this class exposes a public method called, Notify(), using this methods, all subscribed clients
// will receive a JSONRPC message as a notification, in case this method is called.
class HdmiCecSink : public PluginHost::IPlugin, public PluginHost::JSONRPC {
class HdmiCecSink : public PluginHost::IPlugin, public PluginHost::JSONRPC, public device::Host::IHdmiInEvents {

enum {
POLL_THREAD_STATE_NONE,
Expand Down Expand Up @@ -530,6 +532,7 @@
virtual const string Initialize(PluginHost::IShell* shell) override;
virtual void Deinitialize(PluginHost::IShell* service) override;
virtual string Information() const override { return {}; }
virtual void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected) override;
static HdmiCecSink* _instance;
CECDeviceParams deviceList[16];
std::vector<HdmiPortMap> hdmiInputs;
Expand Down Expand Up @@ -586,6 +589,13 @@
END_INTERFACE_MAP

private:
template <typename T>
T* baseInterface()
{
static_assert(std::is_base_of<T, HdmiCecSink>(), "base type mismatch");
return static_cast<T*>(this);
}

class PowerManagerNotification : public Exchange::IPowerManager::IModeChangedNotification {
private:
PowerManagerNotification(const PowerManagerNotification&) = delete;
Expand Down
51 changes: 16 additions & 35 deletions HdmiCecSource/HdmiCecSourceImplementation.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check failure on line 1 in HdmiCecSource/HdmiCecSourceImplementation.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 'HdmiCecSource/HdmiCecSourceImplementation.cpp' (Match: rdkcentral/rdkservices/1, 1569 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: HdmiCecSource/HdmiCecSource.cpp)

Check failure on line 1 in HdmiCecSource/HdmiCecSourceImplementation.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 'HdmiCecSource/HdmiCecSourceImplementation.cpp' (Match: rdkcentral/rdkservices/1, 1569 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: HdmiCecSource/HdmiCecSource.cpp)
* If not stated otherwise in this file or this component's LICENSE
* file the following copyright and licenses apply:
*
Expand All @@ -25,7 +25,6 @@
#include "ccec/MessageEncoder.hpp"
#include "host.hpp"

#include "dsMgr.h"
#include "dsDisplay.h"
#include "videoOutputPort.hpp"
#include "manager.hpp"
Expand Down Expand Up @@ -389,8 +388,7 @@
_powerManagerPlugin.Reset();
}
_registeredEventHandlers = false;

DeinitializeIARM();
device::Host::getInstance().UnRegister(baseInterface<device::Host::IDisplayDeviceEvents>());
}

Core::hresult HdmiCecSourceImplementation::Configure(PluginHost::IShell* service)
Expand All @@ -409,7 +407,6 @@
logicalAddress = 0xFF;

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

// load persistence setting
Expand All @@ -418,6 +415,8 @@
{
//TODO(MROLLINS) this is probably per process so we either need to be running in our own process or be carefull no other plugin is calling it
device::Manager::Initialize();
device::Host::getInstance().Register(baseInterface<device::Host::IDisplayDeviceEvents>(), "WPE::CecSource");

std::string strVideoPort = device::Host::getInstance().getDefaultVideoPortName();
device::VideoOutputPort vPort = device::Host::getInstance().getVideoOutputPort(strVideoPort.c_str());
if (vPort.isDisplayConnected())
Expand Down Expand Up @@ -731,20 +730,6 @@
registerEventHandlers();
}

const void HdmiCecSourceImplementation::InitializeIARM()
{
IARM_Result_t res;
IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, dsHdmiEventHandler) );
}

void HdmiCecSourceImplementation::DeinitializeIARM()
{
if (Utils::IARM::isConnected())
{
IARM_Result_t res;
IARM_CHECK( IARM_Bus_RemoveEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG,dsHdmiEventHandler) );
}
}
void HdmiCecSourceImplementation::threadHotPlugEventHandler(int data)
{
LOGINFO("entry threadHotPlugEventHandler \r\n");
Expand All @@ -759,25 +744,21 @@
LOGINFO("Exit threadHotPlugEventHandler \r\n");
}

void HdmiCecSourceImplementation::dsHdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
void HdmiCecSourceImplementation::OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent)
{
if(!HdmiCecSourceImplementation::_instance || !_instance->cecEnableStatus)
{
LOGINFO("Return from dsHdmiEventHandler due HdmiCecSourceImplementation::_instance:%p cecEnableStatus:%d \r\n", HdmiCecSourceImplementation::_instance, _instance->cecEnableStatus);
return;
}
LOGINFO("HdmiCecSourceImplementation::OnDisplayHDMIHotPlug : displayEvent = %d ", displayEvent);

if(!HdmiCecSourceImplementation::_instance || !_instance->cecEnableStatus)
{
LOGINFO("HdmiCecSourceImplementation::OnDisplayHDMIHotPlug failed _instance:%p cecEnableStatus:%d \r\n", HdmiCecSourceImplementation::_instance, _instance->cecEnableStatus);
return;
}

int hdmi_hotplug_event = (int) displayEvent;
LOGINFO("Received IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG event data:%d \r\n", hdmi_hotplug_event);
std::thread worker(threadHotPlugEventHandler,hdmi_hotplug_event);
worker.detach();

if (owner && !strcmp(owner, IARM_BUS_DSMGR_NAME) && (IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG == eventId))
{
IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data;
if(eventData)
{
int hdmi_hotplug_event = eventData->data.hdmi_hpd.event;
LOGINFO("Received IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG event data:%d \r\n", hdmi_hotplug_event);
std::thread worker(threadHotPlugEventHandler,hdmi_hotplug_event);
worker.detach();
}
}
}

void HdmiCecSourceImplementation::onPowerModeChanged(const PowerState currentState, const PowerState newState)
Expand Down
12 changes: 11 additions & 1 deletion HdmiCecSource/HdmiCecSourceImplementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include <interfaces/IPowerManager.h>
#include "PowerManagerInterface.h"
#include <interfaces/IHdmiCecSource.h>
#include "host.hpp"


using namespace WPEFramework;
using PowerState = WPEFramework::Exchange::IPowerManager::PowerState;
Expand Down Expand Up @@ -170,7 +172,7 @@ namespace WPEFramework {
// As the registration/unregistration of notifications is realized by the class PluginHost::JSONRPC,
// this class exposes a public method called, Notify(), using this methods, all subscribed clients
// will receive a JSONRPC message as a notification, in case this method is called.
class HdmiCecSourceImplementation : public Exchange::IHdmiCecSource {
class HdmiCecSourceImplementation : public Exchange::IHdmiCecSource, public device::Host::IDisplayDeviceEvents {
enum {
VOLUME_UP = 0x41,
VOLUME_DOWN = 0x42,
Expand All @@ -196,6 +198,7 @@ namespace WPEFramework {
public:
HdmiCecSourceImplementation();
virtual ~HdmiCecSourceImplementation();
virtual void OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent) override;
void onPowerModeChanged(const PowerState currentState, const PowerState newState);
void registerEventHandlers();
static HdmiCecSourceImplementation* _instance;
Expand Down Expand Up @@ -226,6 +229,13 @@ namespace WPEFramework {


private:
template <typename T>
T* baseInterface()
{
static_assert(std::is_base_of<T, HdmiCecSourceImplementation>(), "base type mismatch");
return static_cast<T*>(this);
}

class PowerManagerNotification : public Exchange::IPowerManager::IModeChangedNotification {
private:
PowerManagerNotification(const PowerManagerNotification&) = delete;
Expand Down
93 changes: 53 additions & 40 deletions Tests/L1Tests/tests/test_HdmiCecSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#include "RfcApiMock.h"
#include "ThunderPortability.h"
#include "PowerManagerMock.h"
#include "ManagerMock.h"
#include "HostMock.h"
#include "HdmiInputMock.h"


using namespace WPEFramework;
using ::testing::NiceMock;
Expand Down Expand Up @@ -67,6 +71,9 @@
class HdmiCecSinkWOInitializeTest : public ::testing::Test {
protected:
IarmBusImplMock *p_iarmBusImplMock = nullptr ;
ManagerImplMock *p_managerImplMock = nullptr ;
HostImplMock *p_hostImplMock = nullptr ;
HdmiInputImplMock *p_hdmiInputImplMock = nullptr;
ConnectionImplMock *p_connectionImplMock = nullptr ;
MessageEncoderMock *p_messageEncoderMock = nullptr ;
LibCCECImplMock *p_libCCECImplMock = nullptr ;
Expand All @@ -88,6 +95,15 @@
p_iarmBusImplMock = new NiceMock <IarmBusImplMock>;
IarmBus::setImpl(p_iarmBusImplMock);

p_managerImplMock = new NiceMock <ManagerImplMock>;
device::Manager::setImpl(p_managerImplMock);

p_hostImplMock = new NiceMock <HostImplMock>;
device::Host::setImpl(p_hostImplMock);

p_hdmiInputImplMock = new NiceMock <HdmiInputImplMock>;
device::HdmiInput::setImpl(p_hdmiInputImplMock);

p_libCCECImplMock = new testing::NiceMock <LibCCECImplMock>;
LibCCEC::setImpl(p_libCCECImplMock);

Expand Down Expand Up @@ -121,15 +137,9 @@
ON_CALL(*p_messageEncoderMock, encode(::testing::Matcher<const UserControlPressed&>(::testing::_)))
.WillByDefault(::testing::ReturnRef(CECFrame::getInstance()));

ON_CALL(*p_iarmBusImplMock, IARM_Bus_RegisterEventHandler(::testing::_, ::testing::_, ::testing::_))
.WillByDefault(::testing::Invoke(
[&](const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler) {
if ((string(IARM_BUS_DSMGR_NAME) == string(ownerName)) && (eventId == IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG)) {
EXPECT_TRUE(handler != nullptr);
dsHdmiEventHandler = handler;
}
return IARM_RESULT_SUCCESS;
}));
EXPECT_CALL(*p_managerImplMock, Initialize())
.Times(::testing::AnyNumber())
.WillRepeatedly(::testing::Return());

ON_CALL(*p_connectionImplMock, open())
.WillByDefault(::testing::Return());
Expand All @@ -144,6 +154,24 @@
delete p_iarmBusImplMock;
p_iarmBusImplMock = nullptr;
}
device::Manager::setImpl(nullptr);
if (p_managerImplMock != nullptr)
{
delete p_managerImplMock;
p_managerImplMock = nullptr;
}
device::Host::setImpl(nullptr);
if (p_hostImplMock != nullptr)
{
delete p_hostImplMock;
p_hostImplMock = nullptr;
}
device::HdmiInput::setImpl(nullptr);
if (p_hdmiInputImplMock != nullptr)
{
delete p_hdmiInputImplMock;
p_hdmiInputImplMock = nullptr;
}
LibCCEC::setImpl(nullptr);
if (p_libCCECImplMock != nullptr)
{
Expand Down Expand Up @@ -211,31 +239,23 @@

HdmiCecSinkDsTest(): HdmiCecSinkTest()
{
ON_CALL(*p_iarmBusImplMock, IARM_Bus_Call)
.WillByDefault(
[](const char* ownerName, const char* methodName, void* arg, size_t argLen) {
if (strcmp(methodName, IARM_BUS_PWRMGR_API_GetPowerState) == 0) {
auto* param = static_cast<IARM_Bus_PWRMgr_GetPowerState_Param_t*>(arg);
param->curState = IARM_BUS_PWRMGR_POWERSTATE_ON;
}
if (strcmp(methodName, IARM_BUS_DSMGR_API_dsHdmiInGetNumberOfInputs) == 0) {
auto* param = static_cast<dsHdmiInGetNumberOfInputsParam_t*>(arg);
param->result = dsERR_NONE;
param->numHdmiInputs = 3;
}
if (strcmp(methodName, IARM_BUS_DSMGR_API_dsHdmiInGetStatus) == 0) {
auto* param = static_cast<dsHdmiInGetStatusParam_t*>(arg);
param->result = dsERR_NONE;
param->status.isPortConnected[1] = 1;
}
if (strcmp(methodName, IARM_BUS_DSMGR_API_dsGetHDMIARCPortId) == 0) {
auto* param = static_cast<dsGetHDMIARCPortIdParam_t*>(arg);
param->portId = 1;
}
return IARM_RESULT_SUCCESS;
});
EXPECT_CALL(*p_hdmiInputImplMock, getNumberOfInputs())
.WillRepeatedly(::testing::Return(3));

ON_CALL(*p_hdmiInputImplMock, isPortConnected(::testing::_))
.WillByDefault(::testing::Invoke(
[](int8_t port) {
return port == 1? true : false;
}));

ON_CALL(*p_hdmiInputImplMock, getHDMIARCPortId(::testing::_))
.WillByDefault(::testing::Invoke(
[](int &portId) {
portId = 1;
return dsERR_NONE;
}));

EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setEnabled"), _T("{\"enabled\": true}"), response));

Check failure on line 258 in Tests/L1Tests/tests/test_HdmiCecSink.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 'Tests/L1Tests/tests/test_HdmiCecSink.cpp' (Match: rdkcentral/rdkservices/1, 256 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: Tests/tests/test_HdmiCecSink.cpp)

Check failure on line 258 in Tests/L1Tests/tests/test_HdmiCecSink.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 'Tests/L1Tests/tests/test_HdmiCecSink.cpp' (Match: rdkcentral/rdkservices/1, 256 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: Tests/tests/test_HdmiCecSink.cpp)
EXPECT_EQ(response, string("{\"success\":true}"));
}
virtual ~HdmiCecSinkDsTest() override {
Expand Down Expand Up @@ -459,15 +479,8 @@
TEST_F(HdmiCecSinkInitializedEventDsTest, onHdmiOutputHDCPStatusEvent)
{

ASSERT_TRUE(dsHdmiEventHandler != nullptr);

IARM_Bus_DSMgr_EventData_t eventData;
eventData.data.hdmi_in_connect.port =dsHDMI_IN_PORT_1;
eventData.data.hdmi_in_connect.isPortConnected = true;

EVENT_SUBSCRIBE(0, _T("onDevicesChanged"), _T("client.events.onDevicesChanged"), message);

dsHdmiEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG, &eventData , 0);
plugin->OnHdmiInEventHotPlug(dsHDMI_IN_PORT_1, true);
EVENT_UNSUBSCRIBE(0, _T("onDevicesChanged"), _T("client.events.onDevicesChanged"), message);

}
Expand Down
33 changes: 4 additions & 29 deletions Tests/L1Tests/tests/test_HdmiCecSource.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the

Check failure on line 2 in Tests/L1Tests/tests/test_HdmiCecSource.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 'Tests/L1Tests/tests/test_HdmiCecSource.cpp' (Match: rdkcentral/rdkservices/1, 1377 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: Tests/tests/test_HdmiCecSource.cpp)

Check failure on line 2 in Tests/L1Tests/tests/test_HdmiCecSource.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 'Tests/L1Tests/tests/test_HdmiCecSource.cpp' (Match: rdkcentral/rdkservices/1, 1377 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: Tests/tests/test_HdmiCecSource.cpp)
* following copyright and licenses apply:
*
* Copyright 2022 RDK Management
Expand Down Expand Up @@ -342,29 +342,9 @@
.WillByDefault(::testing::Return());
ON_CALL(*p_connectionImplMock, addFrameListener(::testing::_))
.WillByDefault(::testing::Return());
ON_CALL(*p_iarmBusImplMock, IARM_Bus_RegisterEventHandler(::testing::_, ::testing::_, ::testing::_))
.WillByDefault(::testing::Invoke(
[&](const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler) {
if ((string(IARM_BUS_CECMGR_NAME) == string(ownerName)) && (eventId == IARM_BUS_CECMGR_EVENT_DAEMON_INITIALIZED)) {
EXPECT_TRUE(handler != nullptr);
cecMgrEventHandler = handler;
}
if ((string(IARM_BUS_CECMGR_NAME) == string(ownerName)) && (eventId == IARM_BUS_CECMGR_EVENT_STATUS_UPDATED)) {
EXPECT_TRUE(handler != nullptr);
cecMgrEventHandler = handler;
}
if ((string(IARM_BUS_DSMGR_NAME) == string(ownerName)) && (eventId == IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG)) {
EXPECT_TRUE(handler != nullptr);
dsHdmiEventHandler = handler;
}
if ((string(IARM_BUS_PWRMGR_NAME) == string(ownerName)) && (eventId == IARM_BUS_PWRMGR_EVENT_MODECHANGED)) {
EXPECT_TRUE(handler != nullptr);
pwrMgrEventHandler = handler;
}

return IARM_RESULT_SUCCESS;
}));

EXPECT_CALL(*p_managerImplMock, Initialize())
.Times(::testing::AnyNumber())
.WillRepeatedly(::testing::Return());
}
virtual ~HdmiCecSourceTest() override
{
Expand Down Expand Up @@ -1408,18 +1388,13 @@
iCounter ++;
}

ASSERT_TRUE(dsHdmiEventHandler != nullptr);
EXPECT_CALL(*p_hostImplMock, getDefaultVideoPortName())
.Times(1)
.WillOnce(::testing::Return("TEST"));


IARM_Bus_DSMgr_EventData_t eventData;
eventData.data.hdmi_hpd.event = 0;

EVENT_SUBSCRIBE(0, _T("onHdmiHotPlug"), _T("client.events.onHdmiHotPlug"), message);

dsHdmiEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, &eventData , 0);
Plugin::HdmiCecSourceImplementation::_instance->OnDisplayHDMIHotPlug(dsDISPLAY_EVENT_CONNECTED);

EVENT_UNSUBSCRIBE(0, _T("onHdmiHotPlug"), _T("client.events.onHdmiHotPlug"), message);
}
Expand Down
Loading