-
Notifications
You must be signed in to change notification settings - Fork 3
[RDKEMW-6163] [RDKEMW-6164] CEC source and sink changes #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/RDKEMW-6163-k1
Are you sure you want to change the base?
Changes from 2 commits
5b1743f
55ceafa
f8c01b3
7a0d569
bef0aa3
7c031cf
a0fa4dc
eac3ee0
08b3562
e7f3075
b334b82
81cc8f5
5979423
2bf6395
1ea0522
ff6eeee
922fb7f
3501b16
f2c5780
bc803aa
0623a75
e9cd34f
f8ea54c
76a6dd1
6ae6bd0
73a1113
0c48f19
97af88f
8f16519
27b02c7
2e3aada
8b5c432
8b0cc04
60c25bd
ff83a02
da3518c
24d314b
14f2003
ebd3200
6993a8d
a22b587
51b2c7f
a0ccdbb
6eacd50
96b094d
cc42754
a3c694f
abc1156
7415208
72bfc2a
f73190e
2515fdd
91b669a
6e18267
11c0a7d
408cdc5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||||
/** | ||||||
Check failure on line 1 in HdmiCecSink/HdmiCecSink.cpp
|
||||||
* If not stated otherwise in this file or this component's LICENSE | ||||||
* file the following copyright and licenses apply: | ||||||
* | ||||||
|
@@ -753,7 +753,11 @@ | |||||
|
||||||
int err; | ||||||
dsHdmiInGetNumberOfInputsParam_t hdmiInput; | ||||||
#ifdef IO_HCEC_ENABLE_IARM | ||||||
InitializeIARM(); | ||||||
#else | ||||||
device::Host::getInstance().Register(this, "WPE[HdmiCecSink]"); | ||||||
#endif /* IO_HCEC_ENABLE_IARM */ | ||||||
m_sendKeyEventThreadExit = false; | ||||||
m_sendKeyEventThread = std::thread(threadSendKeyEvent); | ||||||
|
||||||
|
@@ -879,7 +883,12 @@ | |||||
} | ||||||
|
||||||
HdmiCecSink::_instance = nullptr; | ||||||
DeinitializeIARM(); | ||||||
#ifdef IO_HCEC_ENABLE_IARM | ||||||
DeinitializeIARM(); | ||||||
#else | ||||||
device::Host::getInstance().UnRegister(this); | ||||||
#endif /* IO_HCEC_ENABLE_IARM */ | ||||||
|
||||||
LOGWARN(" HdmiCecSink Deinitialize() Done"); | ||||||
} | ||||||
|
||||||
|
@@ -920,6 +929,7 @@ | |||||
} | ||||||
} | ||||||
|
||||||
#ifdef IO_HCEC_ENABLE_IARM | ||||||
void HdmiCecSink::dsHdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len) | ||||||
{ | ||||||
if(!HdmiCecSink::_instance) | ||||||
|
@@ -934,6 +944,16 @@ | |||||
HdmiCecSink::_instance->onHdmiHotPlug(portId,isHdmiConnected); | ||||||
} | ||||||
} | ||||||
#else | ||||||
void HdmiCecSink::OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected) | ||||||
{ | ||||||
if(!HdmiCecSink::_instance) | ||||||
return; | ||||||
|
||||||
LOGINFO("Received IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG event port: %d isConnected: %d \r\n", port, isConnected); | ||||||
HdmiCecSink::_instance->onHdmiHotPlug((int) port, (int) isConnected); | ||||||
|
HdmiCecSink::_instance->onHdmiHotPlug((int) port, (int) isConnected); | |
HdmiCecSink::_instance->onHdmiHotPlug((int) port, isConnected); |
Copilot uses AI. Check for mistakes.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
Check failure on line 1 in HdmiCecSink/HdmiCecSink.h
|
||
* If not stated otherwise in this file or this component's LICENSE | ||
* file the following copyright and licenses apply: | ||
* | ||
|
@@ -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; | ||
|
@@ -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, device::Host::IHdmiInEvents { | ||
|
||
enum { | ||
POLL_THREAD_STATE_NONE, | ||
|
@@ -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; | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||||
/** | ||||||
Check failure on line 1 in HdmiCecSource/HdmiCecSourceImplementation.cpp
|
||||||
* If not stated otherwise in this file or this component's LICENSE | ||||||
* file the following copyright and licenses apply: | ||||||
* | ||||||
|
@@ -390,7 +390,12 @@ | |||||
} | ||||||
_registeredEventHandlers = false; | ||||||
|
||||||
#ifdef IO_HCEC_ENABLE_IARM | ||||||
karuppaiyak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
DeinitializeIARM(); | ||||||
#else | ||||||
device::Host::getInstance().UnRegister(this); | ||||||
#endif /* IO_HCEC_ENABLE_IARM */ | ||||||
|
||||||
} | ||||||
|
||||||
Core::hresult HdmiCecSourceImplementation::Configure(PluginHost::IShell* service) | ||||||
|
@@ -409,7 +414,9 @@ | |||||
logicalAddress = 0xFF; | ||||||
|
||||||
//CEC plugin functionalities will only work if CECmgr is available. If plugin Initialize failure upper layer will call dtor directly. | ||||||
#ifdef IO_HCEC_ENABLE_IARM | ||||||
InitializeIARM(); | ||||||
#endif /* IO_HCEC_ENABLE_IARM */ | ||||||
InitializePowerManager(service); | ||||||
|
||||||
// load persistence setting | ||||||
|
@@ -418,6 +425,11 @@ | |||||
{ | ||||||
//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(); | ||||||
|
||||||
#ifndef IO_HCEC_ENABLE_IARM | ||||||
device::Host::getInstance().Register(this, "WPE[HdmiCecSource]"); | ||||||
|
||||||
#endif /* IO_HCEC_ENABLE_IARM */ | ||||||
|
||||||
std::string strVideoPort = device::Host::getInstance().getDefaultVideoPortName(); | ||||||
device::VideoOutputPort vPort = device::Host::getInstance().getVideoOutputPort(strVideoPort.c_str()); | ||||||
if (vPort.isDisplayConnected()) | ||||||
|
@@ -759,6 +771,7 @@ | |||||
LOGINFO("Exit threadHotPlugEventHandler \r\n"); | ||||||
} | ||||||
|
||||||
#ifdef IO_HCEC_ENABLE_IARM | ||||||
void HdmiCecSourceImplementation::dsHdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len) | ||||||
{ | ||||||
if(!HdmiCecSourceImplementation::_instance || !_instance->cecEnableStatus) | ||||||
|
@@ -779,7 +792,24 @@ | |||||
} | ||||||
} | ||||||
} | ||||||
#else | ||||||
void HdmiCecSourceImplementation::OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent) | ||||||
{ | ||||||
LOGINFO("OnDisplayHDMIHotPlug : displayEvent = %d ", displayEvent); | ||||||
|
||||||
if(!HdmiCecSourceImplementation::_instance || !_instance->cecEnableStatus) | ||||||
{ | ||||||
LOGINFO("Return from dsHdmiEventHandler due HdmiCecSourceImplementation::_instance:%p cecEnableStatus:%d \r\n", HdmiCecSourceImplementation::_instance, _instance->cecEnableStatus); | ||||||
|
LOGINFO("Return from dsHdmiEventHandler due HdmiCecSourceImplementation::_instance:%p cecEnableStatus:%d \r\n", HdmiCecSourceImplementation::_instance, _instance->cecEnableStatus); | |
LOGINFO("Return from OnDisplayHDMIHotPlug due HdmiCecSourceImplementation::_instance:%p cecEnableStatus:%d \r\n", HdmiCecSourceImplementation::_instance, _instance->cecEnableStatus); |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
device::manager::Initialize()
called before register ?