RDK Documentation (Open Sourced RDK Components)
getVideoOutputPorts.cpp
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 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 
21 
22 /**
23 * @defgroup devicesettings
24 * @{
25 * @defgroup sample
26 * @{
27 **/
28 
29 
30 #include <iostream>
31 #include "host.hpp"
32 #include "videoOutputPort.hpp"
33 #include "videoOutputPortType.hpp"
34 #include "videoResolution.hpp"
35 #include "manager.hpp"
37 
38 #include "dsUtl.h"
39 #include "dsError.h"
40 #include "list.hpp"
41 #include "libIBus.h"
42 
43 
44 int main(int argc, char *argv[])
45 {
46 
47  IARM_Bus_Init("SampleDSClient");
49 
51 
53  for (size_t i = 0; i < vPorts.size(); i++) {
54  device::VideoOutputPort &vPort = vPorts.at(i);
55  printf("VideoOuputPort Name- [%s] =======================\r\n", vPort.getName().c_str());
56  printf("\t Enabled- [%s]\r\n", vPort.isEnabled() ? "Yes" : "No");
57  try {
58  printf("\t Active - [%s]\r\n", vPort.isActive() ? "Yes" : "No");
59  }
61  printf("RxSense is NOT supported\r\n");
62  }
63  printf("\t Connected- [%s]\r\n", vPort.isDisplayConnected() ? "Yes" : "No");
64 
66  {
67  printf("Resolution Size [%d] =======================\r\n",resolutions.size());
68 
69  for (size_t j = 0; j < resolutions.size(); j++) {
70  device::VideoResolution resolution = resolutions.at(j);
71  printf("Resolution Name Name- [%s] =======================\r\n",resolution.getName().c_str());
72  }
73  }
74 
75  printf("\t Content Protected- [%s]\r\n", vPort.isContentProtected() ? "Yes" : "No");
76  printf("\t Support Dynamic Configuration- [%s]\r\n", vPort.isDynamicResolutionSupported() ? "Yes" : "No");
77  printf("\t Port Type- [%s]\r\n", vPort.getType().getName().c_str());
78  printf("\t\tDTCP Support- [%s]\r\n", vPort.getType().isDTCPSupported() ? "Yes" : "No");
79  printf("\t\tHDCP Support- [%s]\r\n", vPort.getType().isHDCPSupported() ? "Yes" : "No");
80  printf("\t\tResolution Restriction- [%d]\r\n", vPort.getType().getRestrictedResolution());
81  printf("\t\tCurrent Resolution- [%s]\r\n", vPort.getResolution().getName().c_str());
82  printf(" ==========================================\r\n\r\n");
83  }
84 
87  IARM_Bus_Term();
88 
89  return 0;
90 }
91 
92 
93 /** @} */
94 /** @} */
device::VideoOutputPort::isActive
bool isActive() const
This API is used to check if Port is connected to active port of Sink device.
Definition: videoOutputPort.cpp:415
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::getName
const std::string & getName() const
This API gets the name of the VideoOutputPort. The VideoOutputPort names can be HDMI,...
Definition: videoOutputPort.hpp:225
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
device::VideoOutputPort::isEnabled
bool isEnabled() const
This API is used to check whether this Video output port is enabled or not.
Definition: videoOutputPort.cpp:398
device::VideoResolution
Class extending DSConstant to implement the videoResolution interface.
Definition: videoResolution.hpp:57
device::Host::getVideoOutputPorts
List< VideoOutputPort > getVideoOutputPorts()
This API is used to get the list of the video output ports supported on the device....
Definition: host.cpp:285
device::VideoOutputPortType::isDTCPSupported
bool isDTCPSupported() const
This API is used to query if DTCP is supported by the port type.
Definition: videoOutputPortType.cpp:258
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
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
manager.hpp
It contains class referenced by manager.cpp file.
device::VideoOutputPortType::isHDCPSupported
bool isHDCPSupported() const
This API is used to query if HDCP is supported by the port type.
Definition: videoOutputPortType.cpp:272
dsError.h
Device Settings HAL error codes.
device::List::size
size_t size()
This function gets the size of the container.
Definition: list.hpp:118
dsUtl.h
Device Settings HAL utilities.
device::VideoOutputPort::getType
const VideoOutputPortType & getType() const
This API is used to get the type of the video output port. A type of the video output port represent ...
Definition: videoOutputPort.cpp:265
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
IARM_Bus_Disconnect
IARM_Result_t IARM_Bus_Disconnect(void)
This API disconnect Application from IARM Bus so the application will not receive any IARM event or R...
videoOutputPortType.hpp
It contains structures and class referenced by the videoOutputportTypes.cpp file.
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
videoResolution.hpp
It contains class and structure refrenced by the videoResolution.cpp file.
libIBus.h
RDK IARM-Bus API Declarations.
device::VideoOutputPortType::getSupportedResolutions
const List< VideoResolution > getSupportedResolutions() const
This API is used to get a list of supported Video Resolutions by the port type.
Definition: videoOutputPortType.cpp:311
device::DSConstant::getName
virtual const std::string & getName() const
This function is used to the get the data member name.
Definition: dsConstant.hpp:141
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
device::UnsupportedOperationException
This class extends Exception class to manage unsupported operations in devicesettings.
Definition: unsupportedOperationException.hpp:50
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::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::VideoOutputPortType::getRestrictedResolution
int getRestrictedResolution() const
This function is used to get the resolution type which has been restricted from usage.
Definition: videoOutputPortType.cpp:298
device::List< device::VideoOutputPort >
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
device::VideoOutputPort::isDynamicResolutionSupported
bool isDynamicResolutionSupported() const
This API is used to check whether the video output port supports the dynamic super resolution or not.
Definition: videoOutputPort.cpp:438
unsupportedOperationException.hpp
This file defines UnsupportedOperationException class.
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