RDK Documentation (Open Sourced RDK Components)
Components_HDMI.h
Go to the documentation of this file.
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  * @file Components_HDMI.h
22  * @brief The header file provides capabilities HDMI information APIs.
23  */
24 
25 /**
26  * @defgroup TR69_HOSTIF_STBSERVICES_HDMI TR-069 Object (Device.STBServices.{i}.Capabilities.HDMI)
27  * A HDMI component models features of the STB HDMI functionality, such as the output
28  * resolution mode and value.
29  * It also contains a sub object providing details on the connected HDMI display device typically
30  * a TV set for instance, the delay the STB is requested to apply to audio to preserve 'lip sync'
31  * synchronization. This is a read-only parameter for the ACS, and is communicated to the STB through
32  * the HDMI interface.
33  *
34  * @ingroup TR69_HOSTIF_STBSERVICES
35  *
36  * @defgroup TR69_HOSTIF_STBSERVICES_HDMI_API TR-069 Object (Device.STBServices.{i}.Capabilities.HDMI) Public APIs
37  * Describe the details about TR-069 capabilities of HDMI APIs specifications.
38  * @ingroup TR69_HOSTIF_STBSERVICES_HDMI
39  *
40  * @defgroup TR69_HOSTIF_STBSERVICES_HDMI_CLASSES TR-069 Object (Device.STBServices.{i}.Capabilities.HDMI) Public Classes
41  * Describe the details about classes used in TR069 capabilities of HDMI.
42  * @ingroup TR69_HOSTIF_STBSERVICES_HDMI
43  */
44 
45 /**
46 * @defgroup tr69hostif
47 * @{
48 * @defgroup hostif
49 * @{
50 **/
51 
52 
53 #ifndef DEVSET_COMP_HDMI_HPP_
54 #define DEVSET_COMP_HDMI_HPP_
55 
56 #include "host.hpp"
57 #include "videoResolution.hpp"
58 #include "dsVideoResolutionSettings.h"
59 #include "dsTypes.h"
60 #include "videoOutputPortType.hpp"
61 #include "videoDevice.hpp"
62 #include "videoDFC.hpp"
63 #include "manager.hpp"
64 #include "dsUtl.h"
65 #include "dsError.h"
66 #include "list.hpp"
67 #include <exception>
68 #include <string.h>
69 #include "stdlib.h"
70 #include "hostIf_tr69ReqHandler.h"
71 #include "hostIf_updateHandler.h"
72 #include "hostIf_utils.h"
73 
75 #include "videoOutputPort.hpp"
76 
77 #define HDMI_RESOLUTION_MODE_AUTO "Auto"
78 #define HDMI_RESOLUTION_MODE_MANUAL "Manual"
79 #define HDMI_RESOLUTION_VALUE_DEFAULT "1280x720/59.94Hz" //1280x720p/60Hz"
80 
81 #ifndef PARAM_LEN
82 #define PARAM_LEN TR69HOSTIFMGR_MAX_PARAM_LEN
83 #endif
84 
85 /**
86  * @brief This class provides the TR-069 components HDMI information.
87  * @ingroup TR69_HOSTIF_STBSERVICES_HDMI_CLASSES
88  */
90 {
91  static GHashTable *ifHash;
94  static GMutex *m_mutex;
95  int dev_id;
97  hostIf_STBServiceDisplayDevice *displayDevice;
98 
99  static char dsHDMIResolutionMode[10];
100  bool backupEnable;
101  char backupStatus[_BUF_LEN_16];
102  char backupResolutionValue[_BUF_LEN_16];
103  char backupName[_BUF_LEN_256];
104 
105  bool bCalledEnable;
106  bool bCalledStatus;
107  bool bCalledResolutionValue;
108  bool bCalledName;
109 
110 private:
111  int setResolution(const HOSTIF_MsgData_t *stMsgData);
112  int getResolutionValue(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
113  int setEnableVideoPort(const HOSTIF_MsgData_t *stMsgData);
114  int getEnable(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
115  int getStatus(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
116  int getName(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
117  int setHDMIResolutionMode(const char* value);
118  static const char* getHDMIResolutionMode();
119 
120 public:
121  static hostIf_STBServiceHDMI *getInstance(int dev_id);
122  static void closeInstance(hostIf_STBServiceHDMI *);
123 /**
124  * @brief This function checks for the host IF HDMI interface updates such as Status, Enable, ResolutionMode,
125  * ResolutionValue etc in a connected HDMI port. Currently not implemented.
126  *
127  * @param[in] mUpdateCallback Callback function pointer to check for the host IF HDMI interface update.
128  * @ingroup TR69_HOSTIF_STBSERVICES_HDMI_API
129  */
130  void checkForUpdates(updateCallback mUpdateCallback);
131  static GList* getAllInstances();
132  static void closeAllInstances();
133  static void getLock();
134  static void releaseLock();
135  void doUpdates(updateCallback mUpdateCallback);
136  int handleSetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData);
137  int handleGetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData);
138 
139 };
140 
141 #endif /* DEVSET_COMP_HDMI_HPP_ */
142 
143 
144 /** @} */
145 /** @} */
hostIf_STBServiceHDMI::doUpdates
void doUpdates(updateCallback mUpdateCallback)
This function updates the HDMI interface updates such as Status, Enable, ResolutionMode,...
Definition: Components_HDMI.cpp:311
hostIf_STBServiceHDMI
This class provides the TR-069 components HDMI information.
Definition: Components_HDMI.h:89
Components_DisplayDevice.h
The header file provides components display device information APIs.
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
dsTypes.h
Device Settings HAL types.
manager.hpp
It contains class referenced by manager.cpp file.
hostIf_STBServiceDisplayDevice
This class provides the TR-069 components display device information.
Definition: Components_DisplayDevice.h:89
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_STBServiceHDMI::handleSetMsg
int handleSetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData)
This function set the HDMI interface updates such as Status, Enable, ResolutionMode,...
Definition: Components_HDMI.cpp:230
dsError.h
Device Settings HAL error codes.
dsUtl.h
Device Settings HAL utilities.
videoOutputPortType.hpp
It contains structures and class referenced by the videoOutputportTypes.cpp file.
videoResolution.hpp
It contains class and structure refrenced by the videoResolution.cpp file.
videoDevice.hpp
It contains class referenced by videoDevice.cpp file.
hostIf_STBServiceHDMI::handleGetMsg
int handleGetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData)
This function get the HDMI interface updates such as Status, Enable, ResolutionMode,...
Definition: Components_HDMI.cpp:270
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
hostIf_STBServiceHDMI::getInstance
static hostIf_STBServiceHDMI * getInstance(int dev_id)
Definition: Components_HDMI.cpp:90
hostIf_STBServiceHDMI::checkForUpdates
void checkForUpdates(updateCallback mUpdateCallback)
This function checks for the host IF HDMI interface updates such as Status, Enable,...
hostIf_STBServiceHDMI::hostIf_STBServiceHDMI
hostIf_STBServiceHDMI(int devid, device::VideoOutputPort &port)
Class Constructor of the class hostIf_STBServiceHDMI.
Definition: Components_HDMI.cpp:185
videoDFC.hpp
This file defines VideoDFC class for managing video decoder format conversion types.