RDK Documentation (Open Sourced RDK Components)
iarmMgrMocks.cpp
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2022 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #include "iarmMgrMocks.h"
21 
22 /* IARM Bus library mock. */
23 AampMockIarmBus *g_mockIarmBus;
24 
25 IARM_Result_t IARM_Bus_Call(const char *ownerName,
26  const char *methodName,
27  void *arg,
28  size_t argLen)
29 {
30  return g_mockIarmBus->IARM_Bus_Call(ownerName, methodName, arg, argLen);
31 }
32 
33 IARM_Result_t IARM_Bus_Connect(void)
34 {
35  return g_mockIarmBus->IARM_Bus_Connect();
36 }
37 
38 IARM_Result_t IARM_Bus_Init(const char *name)
39 {
40  return g_mockIarmBus->IARM_Bus_Init(name);
41 }
42 
43 IARM_Result_t IARM_Bus_RegisterEventHandler(const char *ownerName,
44  IARM_EventId_t eventId,
45  IARM_EventHandler_t handler)
46 {
47  return g_mockIarmBus->IARM_Bus_RegisterEventHandler(ownerName, eventId, handler);
48 }
49 
50 IARM_Result_t IARM_Bus_RemoveEventHandler(const char *ownerName,
51  IARM_EventId_t eventId,
52  IARM_EventHandler_t handler)
53 {
54  return g_mockIarmBus->IARM_Bus_RemoveEventHandler(ownerName, eventId, handler);
55 }
56 
57 /* Device settings library mocks. */
58 AampMockDeviceHost *g_mockDeviceHost;
59 AampMockDeviceManager *g_mockDeviceManager;
60 AampMockDeviceVideoOutputPort *g_mockDeviceVideoOutputPort;
61 
62 namespace device
63 {
64 Host::Host()
65 {
66 }
67 
68 Host::~Host()
69 {
70 }
71 
73 {
74  static Host instance;
75  return instance;
76 }
77 
78 VideoOutputPort &Host::getVideoOutputPort(const std::string &name)
79 {
80  return g_mockDeviceHost->getVideoOutputPort(name);
81 }
82 
84 {
85  g_mockDeviceManager->DeInitialize();
86 }
87 
89 {
90  g_mockDeviceManager->Initialize();
91 }
92 
94 {
95 }
96 
98 {
99 }
100 
101 const int PixelResolution::k720x480 = 0;
102 const int PixelResolution::k720x576 = 1;
103 const int PixelResolution::k1280x720 = 2;
104 const int PixelResolution::k1920x1080 = 3;
105 const int PixelResolution::k3840x2160 = 4;
106 const int PixelResolution::k4096x2160 = 5;
107 
108 VideoOutputPort::VideoOutputPort(const int type,
109  const int index,
110  const int id,
111  int audioPortId,
112  const std::string &resolution)
113 {
114 }
115 
117 {
118 }
119 
121 {
122 }
123 
125 {
126 }
127 
128 int VideoOutputPort::getHDCPCurrentProtocol()
129 {
130  return g_mockDeviceVideoOutputPort->getHDCPCurrentProtocol();
131 }
132 
133 int VideoOutputPort::getHDCPProtocol()
134 {
135  return g_mockDeviceVideoOutputPort->getHDCPProtocol();
136 }
137 
138 int VideoOutputPort::getHDCPReceiverProtocol()
139 {
140  return g_mockDeviceVideoOutputPort->getHDCPReceiverProtocol();
141 }
142 
143 int VideoOutputPort::getHDCPStatus()
144 {
145  return g_mockDeviceVideoOutputPort->getHDCPStatus();
146 }
147 
149 {
150  return g_mockDeviceVideoOutputPort->getResolution();
151 }
152 
154 {
155  return g_mockDeviceVideoOutputPort->isContentProtected();
156 }
157 
159 {
160  return g_mockDeviceVideoOutputPort->isDisplayConnected();
161 }
162 
164  const std::string &name,
165  int resolutionId,
166  int ratioid,
167  int ssModeId,
168  int frameRateId,
169  bool interlacedId,
170  bool enabled)
171 {
172 }
173 
175 {
176 }
177 
179 {
180  static PixelResolution instance(0);
181  return instance;
182 }
183 }
device::VideoOutputPort::isContentProtected
bool isContentProtected() const
This API is used to Check if the port or the content output on the port has DTCP or HDCP in use.
Definition: videoOutputPort.cpp:538
device::VideoOutputPort::VideoOutputPort
VideoOutputPort(const int type, const int index, const int id, int audioPortId, const std::string &resolution)
This function is a parameterised constructor for videooutputport. It initialises the data members of ...
Definition: videoOutputPort.cpp:122
device::VideoOutputPort::~VideoOutputPort
virtual ~VideoOutputPort()
This is a default destructor of class VideoOutputPort.
Definition: videoOutputPort.cpp:253
device::PixelResolution::k1280x720
static const int k1280x720
Indicates 1280x720 video resolution.
Definition: pixelResolution.hpp:57
device::VideoResolution
Class extending DSConstant to implement the videoResolution interface.
Definition: videoResolution.hpp:57
device::PixelResolution
This class extends DSConstant to manages the pixel resolution of the video.
Definition: pixelResolution.hpp:51
device::VideoOutputPort::isDisplayConnected
bool isDisplayConnected() const
This API is used to Check if the port is currently connected to any display device.
Definition: videoOutputPort.cpp:381
IARM_Bus_Call
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
Definition: iarmMgrMocks.cpp:25
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
device::VideoResolution::VideoResolution
VideoResolution(const int id, const std::string &name, int resolutionId, int ratioid, int ssModeId, int frameRateId, bool interlacedId, bool enabled=true)
This function is a default constructor for videoResolution. It initialises the data members of video ...
Definition: videoResolution.cpp:101
IARM_Bus_RegisterEventHandler
IARM_Result_t IARM_Bus_RegisterEventHandler(const char *ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler)
This API register to listen to event and provide the callback function for event notification....
Definition: iarmMgrMocks.cpp:43
device::PixelResolution::k3840x2160
static const int k3840x2160
Indicates 3840x2160 video resolution.
Definition: pixelResolution.hpp:60
IARM_Bus_RemoveEventHandler
IARM_Result_t IARM_Bus_RemoveEventHandler(const char *ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler)
Remove specific handler registered for the given event.
Definition: iarmMgrMocks.cpp:50
device::VideoOutputPort::getResolution
const VideoResolution & getResolution()
This API is used to get the current video resolution output from the video output port....
Definition: videoOutputPort.cpp:293
device::PixelResolution::k1920x1080
static const int k1920x1080
Indicates 1920x1080 video resolution.
Definition: pixelResolution.hpp:58
device::Manager::Initialize
static void Initialize()
This API is used to initialize the Device Setting module. Each API should be called by any client of ...
Definition: manager.cpp:97
AampMockIarmBus
Definition: iarmMgrMocks.h:33
device::PixelResolution::k720x480
static const int k720x480
Indicates 720x480 video resolution.
Definition: pixelResolution.hpp:55
AampMockDeviceVideoOutputPort
Definition: iarmMgrMocks.h:70
device::VideoResolution::getPixelResolution
const PixelResolution & getPixelResolution() const
This API is used to get the pixel format of the given video output port.
Definition: videoResolution.cpp:134
device::VideoResolution::~VideoResolution
virtual ~VideoResolution()
This is a default destructor of class VideoResolution.
Definition: videoResolution.cpp:123
device::VideoOutputPort::Display::Display
Display()
This function is default constructor and it is used to initialize the display handle and EDID informa...
Definition: videoOutputPort.hpp:105
AampMockDeviceManager
Definition: iarmMgrMocks.h:63
device::PixelResolution::k4096x2160
static const int k4096x2160
Indicates 4096x2160 video resolution.
Definition: pixelResolution.hpp:61
device::Manager::DeInitialize
static void DeInitialize()
This API is used to deinitialize the device settings module. DeInitialize() must be called to release...
Definition: manager.cpp:138
device::Host::getVideoOutputPort
VideoOutputPort & getVideoOutputPort(const std::string &name)
This API is used to get the reference to the video output port by its name. The name of the port must...
Definition: host.cpp:350
IARM_EventHandler_t
void(* IARM_EventHandler_t)(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
Function signature for event handlers.
Definition: libIBus.h:125
device::Host::getInstance
static Host & getInstance(void)
This API is used to get a reference to the single instance of the Host object.
Definition: host.cpp:88
device::Host
Class to implement the Host interface.
Definition: host.hpp:60
device::VideoOutputPort::Display::~Display
virtual ~Display()
This function is a default destructor of class Display.
Definition: videoOutputPort.cpp:738
IARM_Bus_Connect
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
Definition: iarmMgrMocks.cpp:33
AampMockDeviceHost
Definition: iarmMgrMocks.h:57
device::PixelResolution::k720x576
static const int k720x576
Indicates 720x576 video resolution.
Definition: pixelResolution.hpp:56
device::PixelResolution::~PixelResolution
virtual ~PixelResolution()
This function is the default destructor for PixelResolution.
Definition: pixelResolution.cpp:125
device::PixelResolution::PixelResolution
PixelResolution(int id)
This function is a parameterised constructor for PixelResolution. It initializes the instance with th...
Definition: pixelResolution.cpp:107
IARM_Bus_Init
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.
Definition: iarmMgrMocks.cpp:38