-
Notifications
You must be signed in to change notification settings - Fork 3
RDKEMW-6120: Updating Hdcp, AvInput and HdmiCEC DS MGR client to use libds client library #262
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b72bb9d
RDKEMW-6120: Updating Hdcp, AvInput and HdmiCEC DS MGR client to use …
KaleeswaranGnanagurusamy edb275d
Updated testframework branch to resolve native build issue
KaleeswaranGnanagurusamy f80bf13
Update tests-trigger.yml
KaleeswaranGnanagurusamy 05c3676
coverity fix for _instance dereference
karuppaiyak af29084
Updated the develop branch in yml file
KaleeswaranGnanagurusamy bfcdbb8
Reverted the HdmiCecSink changes
KaleeswaranGnanagurusamy ac3c9dc
Merge branch 'develop' into feature/RDKEMW-6166-B1
KaleeswaranGnanagurusamy ef2d7ed
L1 testframework changed to PR branch
KaleeswaranGnanagurusamy 6bb5cc0
HdmiCecSink changes moved to COMRPC latest
KaleeswaranGnanagurusamy a7a4725
Updated the ds plugin related test modifications
KaleeswaranGnanagurusamy b858a4f
testframework branch updated to develop
KaleeswaranGnanagurusamy 6569e88
Merge branch 'develop' into feature/RDKEMW-6166-B1
apatel859 eb0ce17
Update HdmiCecSinkImplementation.h
KaleeswaranGnanagurusamy 1ac973b
Update HdmiCecSinkImplementation.cpp
KaleeswaranGnanagurusamy 82ec3d3
Update test_HdmiCecSink.cpp
KaleeswaranGnanagurusamy 34b7aeb
Update test_HdmiCecSink.cpp
KaleeswaranGnanagurusamy 02925f1
Update test_HdmiCecSink.cpp
KaleeswaranGnanagurusamy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
Check failure on line 1 in AVInput/AVInput.h
|
||
* If not stated otherwise in this file or this component's LICENSE | ||
* file the following copyright and licenses apply: | ||
* | ||
|
@@ -21,7 +21,10 @@ | |
|
||
#include "Module.h" | ||
#include "libIBus.h" | ||
|
||
#include "dsTypes.h" | ||
#include "host.hpp" | ||
#include "manager.hpp" | ||
|
||
#define DEFAULT_PRIM_VOL_LEVEL 25 | ||
#define MAX_PRIM_VOL_LEVEL 100 | ||
|
@@ -30,9 +33,13 @@ | |
namespace WPEFramework { | ||
namespace Plugin { | ||
|
||
class AVInput: public PluginHost::IPlugin, public PluginHost::JSONRPC | ||
{ | ||
class AVInput: public PluginHost::IPlugin, | ||
public PluginHost::JSONRPC, | ||
public device::Host::IHdmiInEvents, | ||
public device::Host::ICompositeInEvents{ | ||
|
||
private: | ||
|
||
AVInput(const AVInput &) = delete; | ||
AVInput &operator=(const AVInput &) = delete; | ||
|
||
|
@@ -45,6 +52,15 @@ | |
INTERFACE_ENTRY(PluginHost::IDispatcher) | ||
END_INTERFACE_MAP | ||
|
||
private: | ||
|
||
template <typename T> | ||
T* baseInterface() | ||
{ | ||
static_assert(std::is_base_of<T, AVInput>(), "base type mismatch"); | ||
return static_cast<T*>(this); | ||
} | ||
|
||
int m_primVolume; | ||
int m_inputVolume; //Player Volume | ||
|
||
|
@@ -57,9 +73,7 @@ | |
virtual string Information() const override; | ||
|
||
protected: | ||
void InitializeIARM(); | ||
void DeinitializeIARM(); | ||
|
||
|
||
void RegisterAll(); | ||
void UnregisterAll(); | ||
|
||
|
@@ -124,6 +138,30 @@ | |
|
||
void hdmiInputAviContentTypeChange(int port, int content_type); | ||
static void dsAviContentTypeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len); | ||
|
||
private: | ||
|
||
bool _registeredDsEventHandlers; | ||
|
||
public: | ||
|
||
/* HdmiInEventNotification*/ | ||
|
||
void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected) override; | ||
void OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus) override; | ||
void OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented) override; | ||
void OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution) override; | ||
void OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus) override; | ||
void OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType) override; | ||
void OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType) override; | ||
|
||
/* CompositeInEventNotification */ | ||
|
||
void OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected) override; | ||
void OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus) override; | ||
void OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented) override; | ||
void OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution) override; | ||
|
||
public: | ||
static AVInput* _instance; | ||
}; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
Check failure on line 1 in HdcpProfile/HdcpProfileImplementation.cpp
|
||
* If not stated otherwise in this file or this component's LICENSE | ||
* file the following copyright and licenses apply: | ||
* | ||
|
@@ -23,14 +23,9 @@ | |
|
||
#include "videoOutputPort.hpp" | ||
#include "videoOutputPortConfig.hpp" | ||
#include "dsMgr.h" | ||
#include "manager.hpp" | ||
#include "host.hpp" | ||
|
||
#include "UtilsJsonRpc.h" | ||
#include "UtilsIarm.h" | ||
|
||
#include "UtilsSynchroIarm.hpp" | ||
|
||
#define HDMI_HOT_PLUG_EVENT_CONNECTED 0 | ||
#define HDMI_HOT_PLUG_EVENT_DISCONNECTED 1 | ||
|
@@ -61,14 +56,15 @@ | |
HdcpProfileImplementation::~HdcpProfileImplementation() | ||
{ | ||
LOGINFO("Call HdcpProfileImplementation destructor\n"); | ||
device::Host::getInstance().UnRegister(baseInterface<device::Host::IVideoOutputPortEvents>()); | ||
device::Host::getInstance().UnRegister(baseInterface<device::Host::IDisplayDeviceEvents>()); | ||
if (_powerManagerPlugin) { | ||
_powerManagerPlugin.Reset(); | ||
} | ||
if(_service != nullptr) | ||
{ | ||
_service->Release(); | ||
} | ||
DeinitializeIARM(); | ||
HdcpProfileImplementation::_instance = nullptr; | ||
mShell = nullptr; | ||
} | ||
|
@@ -82,26 +78,7 @@ | |
.createInterface(); | ||
} | ||
|
||
void HdcpProfileImplementation::InitializeIARM() | ||
{ | ||
Utils::IARM::init(); | ||
|
||
IARM_Result_t res; | ||
IARM_CHECK( Utils::Synchro::RegisterLockedIarmEventHandler<HdcpProfileImplementation>(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, dsHdmiEventHandler) ); | ||
IARM_CHECK( Utils::Synchro::RegisterLockedIarmEventHandler<HdcpProfileImplementation>(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDCP_STATUS, dsHdmiEventHandler) ); | ||
} | ||
|
||
void HdcpProfileImplementation::DeinitializeIARM() | ||
{ | ||
if (Utils::IARM::isConnected()) | ||
{ | ||
IARM_Result_t res; | ||
IARM_CHECK( Utils::Synchro::RemoveLockedEventHandler<HdcpProfileImplementation>(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, dsHdmiEventHandler) ); | ||
IARM_CHECK( Utils::Synchro::RemoveLockedEventHandler<HdcpProfileImplementation>(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDCP_STATUS, dsHdmiEventHandler) ); | ||
} | ||
} | ||
|
||
void HdcpProfileImplementation::onHdmiOutputHotPlug(int connectStatus) | ||
void HdcpProfileImplementation::onHdmiOutputHotPlug(dsDisplayEvent_t connectStatus) | ||
{ | ||
if (HDMI_HOT_PLUG_EVENT_CONNECTED == connectStatus) | ||
{ | ||
|
@@ -137,49 +114,36 @@ | |
status.hdcpReason); | ||
} | ||
|
||
void HdcpProfileImplementation::onHdmiOutputHDCPStatusEvent(int hdcpStatus) | ||
void HdcpProfileImplementation::onHdmiOutputHDCPStatusEvent(dsHdcpStatus_t hdcpStatus) | ||
{ | ||
LOGINFO("hdcpStatus[%d]",hdcpStatus); | ||
onHdcpProfileDisplayConnectionChanged(); | ||
} | ||
|
||
void HdcpProfileImplementation::dsHdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len) | ||
void HdcpProfileImplementation::OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent) | ||
{ | ||
LOGINFO("Received OnDisplayHDMIHotPlug event data:%d \r\n", displayEvent); | ||
HdcpProfileImplementation::_instance->onHdmiOutputHotPlug(displayEvent); | ||
} | ||
|
||
void HdcpProfileImplementation::OnHDCPStatusChange(dsHdcpStatus_t hdcpStatus) | ||
{ | ||
uint32_t res = Core::ERROR_GENERAL; | ||
PowerState pwrStateCur = WPEFramework::Exchange::IPowerManager::POWER_STATE_UNKNOWN; | ||
PowerState pwrStatePrev = WPEFramework::Exchange::IPowerManager::POWER_STATE_UNKNOWN; | ||
|
||
if(!HdcpProfileImplementation::_instance) | ||
return; | ||
|
||
if (IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG == eventId) | ||
{ | ||
IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; | ||
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); | ||
|
||
HdcpProfileImplementation::_instance->onHdmiOutputHotPlug(hdmi_hotplug_event); | ||
} | ||
else if (IARM_BUS_DSMGR_EVENT_HDCP_STATUS == eventId) | ||
{ | ||
ASSERT (_powerManagerPlugin); | ||
if (_powerManagerPlugin){ | ||
res = _powerManagerPlugin->GetPowerState(pwrStateCur, pwrStatePrev); | ||
if (Core::ERROR_NONE != res) | ||
{ | ||
LOGWARN("Failed to Invoke RPC method: GetPowerState"); | ||
} | ||
else | ||
{ | ||
IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; | ||
int hdcpStatus = eventData->data.hdmi_hdcp.hdcpStatus; | ||
LOGINFO("Received IARM_BUS_DSMGR_EVENT_HDCP_STATUS event data:%d param.curState: %d \r\n", hdcpStatus,pwrStateCur); | ||
HdcpProfileImplementation::_instance->onHdmiOutputHDCPStatusEvent(hdcpStatus); | ||
} | ||
|
||
ASSERT (_powerManagerPlugin); | ||
if (_powerManagerPlugin){ | ||
res = _powerManagerPlugin->GetPowerState(pwrStateCur, pwrStatePrev); | ||
if (Core::ERROR_NONE != res) | ||
{ | ||
LOGWARN("Failed to Invoke RPC method: GetPowerState"); | ||
} | ||
LOGINFO("Received OnHDCPStatusChange event data:%d param.curState: %d \r\n", hdcpStatus,pwrStateCur); | ||
HdcpProfileImplementation::_instance->onHdmiOutputHDCPStatusEvent(hdcpStatus); | ||
} | ||
} | ||
|
||
/** | ||
* Register a notification callback | ||
*/ | ||
|
@@ -243,7 +207,8 @@ | |
_service = service; | ||
_service->AddRef(); | ||
ASSERT(service != nullptr); | ||
InitializeIARM(); | ||
device::Host::getInstance().Register(baseInterface<device::Host::IVideoOutputPortEvents>(),"WPE::HdcpProfile"); | ||
device::Host::getInstance().Register(baseInterface<device::Host::IDisplayDeviceEvents>(),"WPE::HdcpProfile"); | ||
InitializePowerManager(service); | ||
return result; | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.