Skip to content

Commit 229320c

Browse files
committed
AVInput COM-RPC Support: Removed debug
1 parent 35e9aca commit 229320c

File tree

6 files changed

+18
-94
lines changed

6 files changed

+18
-94
lines changed

AVInput/AVInput.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@
2828
#define API_VERSION_NUMBER_MINOR 7
2929
#define API_VERSION_NUMBER_PATCH 1
3030

31-
// <pca>
3231
// Explicitly implementing getInputDevices method instead of autogenerating via IAVInput.h
3332
// because it requires optional parameters which are not supported in Thunder 4.x. This can
3433
// be refactored after migrating to 5.x.
3534
#define AVINPUT_METHOD_GET_INPUT_DEVICES "getInputDevices"
3635
#define HDMI 0
3736
#define COMPOSITE 1
38-
// </pca>
3937

4038
namespace WPEFramework {
4139
namespace {
@@ -89,9 +87,6 @@ namespace Plugin {
8987
_avInput = service->Root<Exchange::IAVInput>(_connectionId, 5000, _T("AVInputImplementation"));
9088

9189
if (nullptr != _avInput) {
92-
// <pca>
93-
_avInput->InitializeIARM();
94-
// </pca>
9590

9691
// Register for notifications
9792
_avInput->Register(_avInputNotification.baseInterface<Exchange::IAVInput::IDevicesChangedNotification>());
@@ -121,9 +116,6 @@ namespace Plugin {
121116
_service->Unregister(&_avInputNotification);
122117

123118
if (nullptr != _avInput) {
124-
// <pca>
125-
_avInput->DeinitializeIARM();
126-
// </pca>
127119

128120
_avInput->Unregister(_avInputNotification.baseInterface<Exchange::IAVInput::IDevicesChangedNotification>());
129121
_avInput->Unregister(_avInputNotification.baseInterface<Exchange::IAVInput::ISignalChangedNotification>());
@@ -171,7 +163,6 @@ namespace Plugin {
171163
SYSLOG(Logging::Shutdown, (string(_T("AVInput de-initialised"))));
172164
}
173165

174-
// <pca>
175166
JsonArray AVInput::getInputDevices(int iType)
176167
{
177168
JsonArray list;
@@ -211,7 +202,6 @@ namespace Plugin {
211202
return list;
212203
}
213204

214-
// <pca>
215205
int getTypeOfInput(string sType)
216206
{
217207
int iType = -1;
@@ -223,7 +213,6 @@ namespace Plugin {
223213
throw "Invalide type of INPUT, please specify HDMI/COMPOSITE";
224214
return iType;
225215
}
226-
// </pca>
227216

228217
uint32_t AVInput::getInputDevicesWrapper(const JsonObject& parameters, JsonObject& response)
229218
{
@@ -250,7 +239,6 @@ namespace Plugin {
250239
}
251240
returnResponse(true);
252241
}
253-
// </pca>
254242

255243
string AVInput::Information() const
256244
{

AVInput/AVInput.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,8 @@ namespace Plugin {
158158

159159
void Deactivated(RPC::IRemoteConnection* connection);
160160

161-
// <pca>
162161
JsonArray getInputDevices(int iType);
163162
uint32_t getInputDevicesWrapper(const JsonObject& parameters, JsonObject& response);
164-
// </pca>
165163

166164
}; // AVInput
167165
} // namespace Plugin

AVInput/AVInputImplementation.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,12 @@ namespace Plugin {
4949
{
5050
LOGINFO("Create AVInputImplementation Instance");
5151
AVInputImplementation::_instance = this;
52-
// <pca>
53-
//InitializeIARM();
54-
// </pca>
52+
InitializeIARM();
5553
}
5654

5755
AVInputImplementation::~AVInputImplementation()
5856
{
59-
// <pca>
60-
//DeinitializeIARM();
61-
// </pca>
62-
57+
DeinitializeIARM();
6358
AVInputImplementation::_instance = nullptr;
6459
_service = nullptr;
6560
}
@@ -1128,7 +1123,6 @@ namespace Plugin {
11281123
return ret;
11291124
}
11301125

1131-
// <pca>
11321126
Core::hresult AVInputImplementation::GetVRRFrameRate(const int portId, double& currentVRRVideoFrameRate, bool& success)
11331127
{
11341128
dsHdmiInVrrStatus_t vrrStatus;
@@ -1142,7 +1136,6 @@ namespace Plugin {
11421136

11431137
return Core::ERROR_NONE;
11441138
}
1145-
// </pca>
11461139

11471140
Core::hresult AVInputImplementation::GetRawSPD(const int portId, string& HDMISPD, bool& success)
11481141
{

AVInput/AVInputImplementation.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,6 @@ namespace Plugin {
117117
_avInputImplementation->Dispatch(_event, _params);
118118
}
119119

120-
// <pca>
121-
void InitializeIARM();
122-
void DeinitializeIARM();
123-
// </pca>
124-
125120
protected:
126121

127122
Job(AVInputImplementation* avInputImplementation, Event event, ParamsType& params)
@@ -206,10 +201,8 @@ namespace Plugin {
206201
int m_primVolume;
207202
int m_inputVolume; // Player Volume
208203

209-
// <pca>
210-
// void InitializeIARM();
211-
// void DeinitializeIARM();
212-
// </pca>
204+
void InitializeIARM();
205+
void DeinitializeIARM();
213206

214207
void dispatchEvent(Event, const ParamsType params);
215208
void Dispatch(Event event, const ParamsType params);

Tests/L1Tests/CMakeLists.txt

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,25 +100,24 @@ macro(add_plugin_test plugin_name test_files)
100100

101101
add_plugin_test_ex(${plugin_opt} "${test_files}" "../../${plugin_name}" "${NAMESPACE}${plugin_name}")
102102
endmacro()
103-
# <pca> debug
104-
# # PLUGIN_HDCPPROFILE
105-
# set (HDCPPROFILE_INC ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/HdcpProfile ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/helpers)
106-
# set (HDCPPROFILE_LIBS ${NAMESPACE}HdcpProfile ${NAMESPACE}HdcpProfileImplementation)
107-
# add_plugin_test_ex(PLUGIN_HDCPPROFILE tests/test_HdcpProfile.cpp "${HDCPPROFILE_INC}" "${HDCPPROFILE_LIBS}")
108103

104+
# PLUGIN_HDCPPROFILE
105+
set (HDCPPROFILE_INC ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/HdcpProfile ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/helpers)
106+
set (HDCPPROFILE_LIBS ${NAMESPACE}HdcpProfile ${NAMESPACE}HdcpProfileImplementation)
107+
add_plugin_test_ex(PLUGIN_HDCPPROFILE tests/test_HdcpProfile.cpp "${HDCPPROFILE_INC}" "${HDCPPROFILE_LIBS}")
109108

110-
# # PLUGIN_HDMICEC2
111-
# add_plugin_test_ex(PLUGIN_HDMICEC2 tests/test_HdmiCec2.cpp "../../HdmiCec_2" "${NAMESPACE}HdmiCec_2")
112109

113-
# # PLUGIN_HDMICECSINK
114-
# set (HDMICECSINK_INC ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/HdmiCecSink ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/helpers)
115-
# add_plugin_test_ex(PLUGIN_HDMICECSINK tests/test_HdmiCecSink.cpp "${HDMICECSINK_INC}" "${NAMESPACE}HdmiCecSink")
110+
# PLUGIN_HDMICEC2
111+
add_plugin_test_ex(PLUGIN_HDMICEC2 tests/test_HdmiCec2.cpp "../../HdmiCec_2" "${NAMESPACE}HdmiCec_2")
116112

117-
# # PLUGIN_HDMICECSOURCE
118-
# set (HDMICECSOURCE_INC ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/HdmiCecSource ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/helpers)
119-
# set (HDMICECSOURCE_LIBS ${NAMESPACE}HdmiCecSource ${NAMESPACE}HdmiCecSourceImplementation)
120-
# add_plugin_test_ex(PLUGIN_HDMICECSOURCE tests/test_HdmiCecSource.cpp "${HDMICECSOURCE_INC}" "${HDMICECSOURCE_LIBS}")
121-
# </pca>
113+
# PLUGIN_HDMICECSINK
114+
set (HDMICECSINK_INC ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/HdmiCecSink ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/helpers)
115+
add_plugin_test_ex(PLUGIN_HDMICECSINK tests/test_HdmiCecSink.cpp "${HDMICECSINK_INC}" "${NAMESPACE}HdmiCecSink")
116+
117+
# PLUGIN_HDMICECSOURCE
118+
set (HDMICECSOURCE_INC ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/HdmiCecSource ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/helpers)
119+
set (HDMICECSOURCE_LIBS ${NAMESPACE}HdmiCecSource ${NAMESPACE}HdmiCecSourceImplementation)
120+
add_plugin_test_ex(PLUGIN_HDMICECSOURCE tests/test_HdmiCecSource.cpp "${HDMICECSOURCE_INC}" "${HDMICECSOURCE_LIBS}")
122121

123122
# PLUGIN_AVINPUT
124123
set (AVINPUT_INC ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/AVInput ${CMAKE_SOURCE_DIR}/../entservices-inputoutput/helpers)

Tests/L1Tests/tests/test_AVInput.cpp

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@
2121
#include <gmock/gmock.h>
2222

2323
#include "AVInput.h"
24-
// <pca>
2524
#include "AVInputImplementation.h"
2625
#include "COMLinkMock.h"
2726
#include "WorkerPoolImplementation.h"
2827
#include "WrapsMock.h"
2928
#include "AVInputMock.h"
30-
// </pca>
3129

3230
#include "CompositeInputMock.h"
3331
#include "FactoriesImplementation.h"
@@ -44,7 +42,6 @@ using ::testing::NiceMock;
4442
class AVInputTest : public ::testing::Test {
4543
protected:
4644
Core::ProxyType<Plugin::AVInput> plugin;
47-
// <pca>
4845
IarmBusImplMock* p_iarmBusImplMock = nullptr;
4946
Core::ProxyType<Plugin::AVInputImplementation> AVInputImpl;
5047
Core::ProxyType<WorkerPoolImplementation> workerPool;
@@ -60,7 +57,6 @@ class AVInputTest : public ::testing::Test {
6057
Exchange::IAVInput::IVideoStreamInfoUpdateNotification *OnVideoStreamInfoUpdateNotification = nullptr;
6158
Exchange::IAVInput::IGameFeatureStatusUpdateNotification *OnGameFeatureStatusUpdateNotification = nullptr;
6259
Exchange::IAVInput::IHdmiContentTypeUpdateNotification *OnHdmiContentTypeUpdateNotification = nullptr;
63-
// </pca>
6460

6561
Core::JSONRPC::Handler& handler;
6662
DECL_CORE_JSONRPC_CONX connection;
@@ -69,13 +65,9 @@ class AVInputTest : public ::testing::Test {
6965
AVInputTest()
7066
: plugin(Core::ProxyType<Plugin::AVInput>::Create())
7167
, handler(*(plugin))
72-
// <pca>
73-
//, INIT_CONX(1, 0)
7468
, INIT_CONX(1, 0) , workerPool(Core::ProxyType<WorkerPoolImplementation>::Create(
7569
2, Core::Thread::DefaultStackSize(), 16))
76-
// </pca>
7770
{
78-
// <pca>
7971
TEST_LOG("*** _DEBUG: AVInputTest Constructor: Mark 1");
8072
p_serviceMock = new NiceMock <ServiceMock>;
8173

@@ -146,11 +138,8 @@ class AVInputTest : public ::testing::Test {
146138

147139
plugin->Initialize(&service);
148140
TEST_LOG("*** _DEBUG: AVInputTest Constructor: Mark 5");
149-
// </pca>
150141
}
151142

152-
// <pca>
153-
//virtual ~AVInputTest() = default;
154143
virtual ~AVInputTest()
155144
{
156145
TEST_LOG("*** _DEBUG: AVInputTest Destructor");
@@ -184,7 +173,6 @@ class AVInputTest : public ::testing::Test {
184173
p_iarmBusImplMock = nullptr;
185174
}
186175
}
187-
// </pca>
188176
};
189177

190178
TEST_F(AVInputTest, RegisteredMethods)
@@ -332,24 +320,14 @@ TEST_F(AVInputDsTest, getVRRFrameRate)
332320

333321
class AVInputInit : public AVInputDsTest {
334322
protected:
335-
// <pca> debug
336-
//IarmBusImplMock* p_iarmBusImplMock = nullptr;
337-
// </pca>
338323
NiceMock<FactoriesImplementation> factoriesImplementation;
339324
PLUGINHOST_DISPATCHER* dispatcher;
340-
// <pca> debug
341-
//NiceMock<ServiceMock> service;
342-
// </pca>
343325
Core::JSONRPC::Message message;
344326

345327
AVInputInit()
346328
: AVInputDsTest()
347329
{
348330
TEST_LOG("*** _DEBUG: AVInputInit Constructor");
349-
// <pca> debug
350-
// p_iarmBusImplMock = new NiceMock<IarmBusImplMock>;
351-
// IarmBus::setImpl(p_iarmBusImplMock);
352-
// </pca>
353331

354332
ON_CALL(*p_iarmBusImplMock, IARM_Bus_RegisterEventHandler(::testing::_, ::testing::_, ::testing::_))
355333
.WillByDefault(::testing::Invoke(
@@ -400,9 +378,6 @@ class AVInputInit : public AVInputDsTest {
400378
}
401379
return IARM_RESULT_SUCCESS;
402380
}));
403-
// <pca> debug
404-
//EXPECT_EQ(string(""), plugin->Initialize(&service));
405-
// </pca>
406381

407382
PluginHost::IFactories::Assign(&factoriesImplementation);
408383
dispatcher = static_cast<PLUGINHOST_DISPATCHER*>(
@@ -417,17 +392,6 @@ class AVInputInit : public AVInputDsTest {
417392
dispatcher->Release();
418393
PluginHost::IFactories::Assign(nullptr);
419394

420-
// <pca> debug
421-
//plugin->Deinitialize(&service);
422-
// </pca>
423-
424-
// <pca> debug
425-
// IarmBus::setImpl(nullptr);
426-
// if (p_iarmBusImplMock != nullptr) {
427-
// delete p_iarmBusImplMock;
428-
// p_iarmBusImplMock = nullptr;
429-
// }
430-
// </pca>
431395
TEST_LOG("*** _DEBUG: AVInputInit Destructor: exit");
432396
}
433397
};
@@ -441,10 +405,7 @@ TEST_F(AVInputInit, getInputDevices)
441405
.WillOnce(::testing::Return(1));
442406
EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("getInputDevices"), _T("{}"), response));
443407
TEST_LOG("*** _DEBUG: TEST_F(AVInputInit, getInputDevices): response=%s", response.c_str());
444-
// <pca>
445408
EXPECT_EQ(response, string("{\"devices\":[{\"id\":0,\"connected\":false,\"locator\":\"hdmiin:\\/\\/localhost\\/deviceid\\/0\"},{\"id\":0,\"connected\":false,\"locator\":\"cvbsin:\\/\\/localhost\\/deviceid\\/0\"}],\"success\":true}"));
446-
//EXPECT_EQ(response, string("{\"devices\":[{\"id\":0,\"locator\":\"hdmiin:\\/\\/localhost\\/deviceid\\/0\",\"connected\":false}],\"success\":true}"));
447-
// </pca>
448409
}
449410

450411
TEST_F(AVInputInit, getInputDevices_HDMI)
@@ -730,10 +691,6 @@ TEST_F(AVInputInit, getGameFeatureStatus_VRR_FREESYNC_PREMIUM_PRO)
730691
EXPECT_EQ(response, string("{\"mode\":true,\"success\":true}"));
731692
}
732693

733-
// <pca> debug
734-
#if 1
735-
// </pca>
736-
737694
TEST_F(AVInputInit, onDevicesChangedHDMI)
738695
{
739696
Core::Event onDevicesChanged(false, true);
@@ -2013,7 +1970,3 @@ TEST_F(AVInputInit, aviContentTypeUpdate_HDMI)
20131970

20141971
EVENT_UNSUBSCRIBE(0, _T("aviContentTypeUpdate"), _T("org.rdk.AVInput"), message);
20151972
}
2016-
2017-
// <pca> debug
2018-
#endif
2019-
// </pca>

0 commit comments

Comments
 (0)