Skip to content

Commit e8b29df

Browse files
Kishoredarmaradjessitar583
authored andcommitted
RDKEMW-1014 : Add COM-RPC support to HdcpProfile plugin
1 parent 3b09679 commit e8b29df

File tree

161 files changed

+16849
-686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+16849
-686
lines changed

HdcpProfile/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ add_library(${MODULE_NAME} SHARED
3333
HdcpProfile.cpp
3434
Module.cpp)
3535

36+
3637
set_target_properties(${MODULE_NAME} PROPERTIES
3738
CXX_STANDARD 11
3839
CXX_STANDARD_REQUIRED YES)
@@ -67,6 +68,7 @@ endif (USE_THUNDER_R4)
6768

6869
find_package(DS)
6970
find_package(IARMBus)
71+
find_package(CEC)
7072

7173
if (RDK_SERVICE_L2_TEST)
7274
message ("L2 test Enabled")
@@ -82,11 +84,12 @@ endif()
8284
target_include_directories(${PLUGIN_IMPLEMENTATION} PRIVATE ${IARMBUS_INCLUDE_DIRS})
8385
target_include_directories(${PLUGIN_IMPLEMENTATION} PRIVATE ${DS_INCLUDE_DIRS})
8486
target_include_directories(${PLUGIN_IMPLEMENTATION} PRIVATE ../helpers)
87+
target_include_directories(${PLUGIN_IMPLEMENTATION} PRIVATE ${CEC_INCLUDE_DIRS})
8588

8689

8790
set_source_files_properties(HdcpProfile.cpp PROPERTIES COMPILE_FLAGS "-fexceptions")
8891

89-
target_link_libraries(${PLUGIN_IMPLEMENTATION} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${IARMBUS_LIBRARIES} ${DS_LIBRARIES} )
92+
target_link_libraries(${PLUGIN_IMPLEMENTATION} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${IARMBUS_LIBRARIES} ${DS_LIBRARIES} ${CEC_LIBRARIES})
9093

9194
install(TARGETS ${PLUGIN_IMPLEMENTATION}
9295
DESTINATION lib/${STORAGE_DIRECTORY}/plugins)

HdcpProfile/HdcpProfile.cpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
* limitations under the License.
1818
**/
1919

20-
21-
2220
#include "HdcpProfile.h"
23-
#include <interfaces/IConfiguration.h>
2421

2522
#define API_VERSION_NUMBER_MAJOR 1
2623
#define API_VERSION_NUMBER_MINOR 0
@@ -61,7 +58,7 @@ namespace WPEFramework
6158
SYSLOG(Logging::Shutdown, (string(_T("HdcpProfile Destructor"))));
6259
}
6360

64-
const string HdcpProfile::Initialize(PluginHost::IShell *service)
61+
const string HdcpProfile::Initialize(PluginHost::IShell *service)
6562
{
6663
string message = "";
6764

@@ -75,18 +72,26 @@ namespace WPEFramework
7572
_service = service;
7673
_service->AddRef();
7774
_service->Register(&_hdcpProfileNotification);
78-
_hdcpProfile = _service->Root<Exchange::IHdcpProfile>(_connectionId, 5000, _T("HdcpProfile"));
75+
_hdcpProfile = _service->Root<Exchange::IHdcpProfile>(_connectionId, 5000, _T("HdcpProfileImplementation"));
7976

8077
if (nullptr != _hdcpProfile)
8178
{
82-
auto configConnection = _hdcpProfile->QueryInterface<Exchange::IConfiguration>();
83-
if (configConnection != nullptr)
79+
configure = _hdcpProfile->QueryInterface<Exchange::IConfiguration>();
80+
if (configure != nullptr)
8481
{
85-
configConnection->Configure(service);
86-
configConnection->Release();
82+
uint32_t result = configure->Configure(_service);
83+
if(result != Core::ERROR_NONE)
84+
{
85+
message = _T("HdcpProfile could not be configured");
86+
}
87+
}
88+
else
89+
{
90+
message = _T("HdcpProfile implementation did not provide a configuration interface");
8791
}
8892
// Register for notifications
8993
_hdcpProfile->Register(&_hdcpProfileNotification);
94+
9095
// Invoking Plugin API register to wpeframework
9196
Exchange::JHdcpProfile::Register(*this, _hdcpProfile);
9297
}
@@ -98,6 +103,7 @@ namespace WPEFramework
98103

99104
if (0 != message.length())
100105
{
106+
printf("HdcpProfile::Initialize: Failed to initialise HdcpProfile plugin");
101107
Deinitialize(service);
102108
}
103109

@@ -107,7 +113,7 @@ namespace WPEFramework
107113
void HdcpProfile::Deinitialize(PluginHost::IShell *service)
108114
{
109115
ASSERT(_service == service);
110-
116+
printf("HdcpProfile::Deinitialize: service = %p", service);
111117
SYSLOG(Logging::Shutdown, (string(_T("HdcpProfile::Deinitialize"))));
112118

113119
// Make sure the Activated and Deactivated are no longer called before we start cleaning up..
@@ -117,6 +123,7 @@ namespace WPEFramework
117123
}
118124
if (nullptr != _hdcpProfile)
119125
{
126+
120127
_hdcpProfile->Unregister(&_hdcpProfileNotification);
121128
Exchange::JHdcpProfile::Unregister(*this);
122129

@@ -151,7 +158,7 @@ namespace WPEFramework
151158
}
152159
SYSLOG(Logging::Shutdown, (string(_T("HdcpProfile de-initialised"))));
153160
}
154-
string HdcpProfile::Information() const
161+
string HdcpProfile::Information() const
155162
{
156163
return ("This HdcpProfile Plugin facilitates to persist event data for monitoring applications");
157164
}

HdcpProfile/HdcpProfile.h

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
#pragma once
2121

2222
#include "Module.h"
23-
#include <interfaces/IHdcpProfile.h>
24-
#include <interfaces/json/JHdcpProfile.h>
23+
#include <interfaces/IHdcpProfile.h> // Ensure this includes the definition of HDCPStatus
2524
#include <interfaces/json/JsonData_HdcpProfile.h>
26-
#include <interfaces/IHdcpProfile.h> // Ensure this includes the definition of HDCPStatus
25+
#include <interfaces/json/JHdcpProfile.h>
26+
#include <interfaces/IConfiguration.h>
2727
#include "UtilsLogging.h"
28-
#include "UtilsJsonRpc.h" // for JsonValue, JsonObject
2928
#include "tracing/Logging.h"
3029

3130

31+
3232
namespace WPEFramework {
3333

3434
namespace Plugin {
@@ -39,45 +39,45 @@ namespace WPEFramework {
3939
class Notification : public RPC::IRemoteConnection::INotification, public Exchange::IHdcpProfile::INotification
4040
{
4141
private:
42-
Notification() = delete;
43-
Notification(const Notification&) = delete;
44-
Notification& operator=(const Notification&) = delete;
42+
Notification() = delete;
43+
Notification(const Notification&) = delete;
44+
Notification& operator=(const Notification&) = delete;
4545

46-
public:
47-
explicit Notification(HdcpProfile *parent)
48-
: _parent(*parent)
49-
{
50-
ASSERT(parent != nullptr);
51-
}
52-
53-
virtual ~Notification()
54-
{
55-
}
56-
57-
BEGIN_INTERFACE_MAP(Notification)
58-
INTERFACE_ENTRY(Exchange::IHdcpProfile::INotification)
59-
INTERFACE_ENTRY(RPC::IRemoteConnection::INotification)
60-
END_INTERFACE_MAP
46+
public:
47+
explicit Notification(HdcpProfile *parent)
48+
: _parent(*parent)
49+
{
50+
ASSERT(parent != nullptr);
51+
}
52+
53+
virtual ~Notification()
54+
{
55+
}
6156

62-
void Activated(RPC::IRemoteConnection *) override
63-
{
57+
BEGIN_INTERFACE_MAP(Notification)
58+
INTERFACE_ENTRY(Exchange::IHdcpProfile::INotification)
59+
INTERFACE_ENTRY(RPC::IRemoteConnection::INotification)
60+
END_INTERFACE_MAP
61+
62+
void Activated(RPC::IRemoteConnection *) override
63+
{
6464
LOGINFO("HdcpProfile Notification Activated");
65-
}
66-
67-
void Deactivated(RPC::IRemoteConnection *connection) override
68-
{
69-
LOGINFO("HdcpProfile Notification Deactivated");
70-
_parent.Deactivated(connection);
71-
}
65+
}
66+
67+
void Deactivated(RPC::IRemoteConnection *connection) override
68+
{
69+
LOGINFO("HdcpProfile Notification Deactivated");
70+
_parent.Deactivated(connection);
71+
}
7272

73-
void OnDisplayConnectionChanged(const Exchange::IHdcpProfile::HDCPStatus& hdcpstatus) override
74-
{
75-
LOGINFO("OnDisplayConnectionChanged: isConnected: %d isHDCPCompliant: %d isHDCPEnabled: %d hdcpReason: %d supportedHDCPVersion: %s receiverHDCPVersion: %s currentHDCPVersion: %s", hdcpstatus.isConnected, hdcpstatus.isHDCPCompliant, hdcpstatus.isHDCPEnabled, hdcpstatus.hdcpReason, hdcpstatus.supportedHDCPVersion.c_str(), hdcpstatus.receiverHDCPVersion.c_str(), hdcpstatus.currentHDCPVersion.c_str());
76-
Exchange::JHdcpProfile::Event::OnDisplayConnectionChanged(_parent, hdcpstatus);
77-
}
78-
79-
private:
80-
HdcpProfile &_parent;
73+
void OnDisplayConnectionChanged(const Exchange::IHdcpProfile::HDCPStatus& hdcpstatus) override
74+
{
75+
LOGINFO("OnDisplayConnectionChanged: isConnected: %d isHDCPCompliant: %d isHDCPEnabled: %d hdcpReason: %d supportedHDCPVersion: %s receiverHDCPVersion: %s currentHDCPVersion: %s", hdcpstatus.isConnected, hdcpstatus.isHDCPCompliant, hdcpstatus.isHDCPEnabled, hdcpstatus.hdcpReason, hdcpstatus.supportedHDCPVersion.c_str(), hdcpstatus.receiverHDCPVersion.c_str(), hdcpstatus.currentHDCPVersion.c_str());
76+
Exchange::JHdcpProfile::Event::OnDisplayConnectionChanged(_parent, hdcpstatus);
77+
}
78+
79+
private:
80+
HdcpProfile &_parent;
8181
};
8282

8383
public:
@@ -86,27 +86,28 @@ namespace WPEFramework {
8686

8787
HdcpProfile();
8888
virtual ~HdcpProfile();
89-
89+
9090
BEGIN_INTERFACE_MAP(HdcpProfile)
9191
INTERFACE_ENTRY(PluginHost::IPlugin)
9292
INTERFACE_ENTRY(PluginHost::IDispatcher)
9393
INTERFACE_AGGREGATE(Exchange::IHdcpProfile, _hdcpProfile)
9494
END_INTERFACE_MAP
9595

9696
// IPlugin methods
97-
// -------------------------------------------------------------------------------------------------------
98-
const string Initialize(PluginHost::IShell* service) override;
99-
void Deinitialize(PluginHost::IShell* service) override;
100-
string Information() const override;
97+
// -------------------------------------------------------------------------------------------------------
98+
const string Initialize(PluginHost::IShell* service) override;
99+
void Deinitialize(PluginHost::IShell* service) override;
100+
string Information() const override;
101101

102-
private:
103-
void Deactivated(RPC::IRemoteConnection* connection);
102+
private:
103+
void Deactivated(RPC::IRemoteConnection* connection);
104104

105-
private:
106-
PluginHost::IShell *_service{};
107-
uint32_t _connectionId{};
108-
Exchange::IHdcpProfile *_hdcpProfile{};
109-
Core::Sink<Notification> _hdcpProfileNotification;
105+
private:
106+
PluginHost::IShell *_service{};
107+
uint32_t _connectionId{};
108+
Exchange::IHdcpProfile *_hdcpProfile{};
109+
Core::Sink<Notification> _hdcpProfileNotification;
110+
Exchange::IConfiguration* configure;
110111
};
111112

112113
} // namespace Plugin

0 commit comments

Comments
 (0)