RDK Documentation (Open Sourced RDK Components)
Components_VideoOutput.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_VideoOutput.h
22  * @brief The header file provides capabilities video output information APIs.
23  */
24 
25 /**
26  * @defgroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT TR-069 Object (Device.STBServices.{i}.Capabilities.VideoOutput)
27  * @par VideoOutput objects
28  * It describe the functional blocks in charge of video rendering. A Video Output receives uncompressed
29  * video streams from one or more Video Decoders, and performs format adaptations as required by the
30  * relevant presentation standard e.g. analog or digital displays, possibly with an encrypted link between
31  * STB and display.
32  * Video Outputs can also provide colour bar test patterns to check the operation of the display device
33  * and the existence and quality of the connection between STB and display. Adaptation of the video to
34  * the specified output format can include various actions like
35  * - Digital-to-analog conversion,
36  * - Resizing,
37  * - Aspect ratio conversion and
38  * - Addition of analog or digital protection.
39  *
40  * Each Video Output is mapped to one or more physical output connectors. Where a Video Output
41  * is mapped directly to a SCART connector, this is indicated in the data model via a reference
42  * from the Video Output to the corresponding SCART object instance other types of physical
43  * connector are not modelled.
44  * @ingroup TR69_HOSTIF_STBSERVICES
45  *
46  * @defgroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT_API TR-069 Object (Device.STBServices.{i}.Capabilities.VideoOutput) Public APIs
47  * Describe the details about RDK TR069 capabilities of video output APIs specifications.
48  * @ingroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT
49  *
50  * @defgroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT_CLASSES TR-069 Object (Device.STBServices.{i}.Capabilities.VideoOutput) Public Classes
51  * Describe the details about classes used in TR069 capabilities of video output.
52  * @ingroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT
53  */
54 
55 /**
56 * @defgroup tr69hostif
57 * @{
58 * @defgroup hostif
59 * @{
60 **/
61 
62 
63 #ifndef DEVSET_COMP_VIDEOOUTPUT_HPP_
64 #define DEVSET_COMP_VIDEOOUTPUT_HPP_
65 
66 #include "host.hpp"
67 #include "videoResolution.hpp"
68 #include "dsVideoResolutionSettings.h"
69 #include "dsTypes.h"
70 #include "videoOutputPortType.hpp"
71 #include "videoDevice.hpp"
72 #include "videoDFC.hpp"
73 #include "manager.hpp"
74 #include "dsUtl.h"
75 #include "dsError.h"
76 #include "list.hpp"
77 #include <exception>
78 #include <string.h>
79 #include "stdlib.h"
80 #include "hostIf_tr69ReqHandler.h"
81 #include "hostIf_updateHandler.h"
82 #include "hostIf_utils.h"
83 
84 #ifndef PARAM_LEN
85 #define PARAM_LEN TR69HOSTIFMGR_MAX_PARAM_LEN
86 #endif
87 
88 /**
89  * @brief This class provides the TR-069 components video output information.
90  * @ingroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT_CLASSES
91  */
93 {
94  static GHashTable *ifHash;
97  static GMutex *m_mutex;
98  int dev_id;
100 
101  char backupAspectRatioBehaviour[_BUF_LEN_16];
102  char backupDisplayFormat[_BUF_LEN_16];
103  char backupDisplayName[_BUF_LEN_16];
104  char backupVideoFormat[_BUF_LEN_16];
105  bool backupHDCP;
106  char backupVideoOutputStatus[_BUF_LEN_16];
107 
108  bool bCalledAspectRatioBehaviour;
109  bool bCalledDisplayFormat;
110  bool bCalledDisplayName;
111  bool bCalledVideoFormat;
112  bool bCalledHDCP;
113  bool bCalledVideoOutputStatus;
114 
115 private:
116  int getAspectRatioBehaviour(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
117  int getDisplayFormat(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
118  int getName(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
119  int getVideoFormat(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
120  int getHDCP(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
121  int getStatus(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
122 
123 public:
124  static hostIf_STBServiceVideoOutput *getInstance(int dev_id);
125  static void closeInstance(hostIf_STBServiceVideoOutput *);
126 /**
127  * @brief This function checks for the host IF video interface updates such as status, display format, video format,
128  * aspect ratio and HDPC (High-Bandwidth Digital Content Protection) in a connected video port. Currently
129  * not implemented.
130  *
131  * @param[in] mUpdateCallback Callback function pointer to check for the host IF video interface update.
132  * @ingroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT_API
133  */
134  void checkForUpdates(updateCallback mUpdateCallback);
135  static GList* getAllInstances();
136  static void closeAllInstances();
137  static void getLock();
138  static void releaseLock();
139  void doUpdates(updateCallback mUpdateCallback);
140  int handleSetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData);
141  int handleGetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData);
142 
143 };
144 
145 #endif /* DEVSET_COMP_VIDEOOUTPUT_HPP_ */
146 
147 
148 /** @} */
149 /** @} */
hostIf_STBServiceVideoOutput::hostIf_STBServiceVideoOutput
hostIf_STBServiceVideoOutput(int devid, device::VideoOutputPort &port)
Class Constructor of the class hostIf_STBServiceVideoOutput.
Definition: Components_VideoOutput.cpp:151
hostIf_STBServiceVideoOutput::handleSetMsg
int handleSetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData)
This function set the video interface attribute value such as status, display format,...
Definition: Components_VideoOutput.cpp:204
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
hostIf_STBServiceVideoOutput::doUpdates
void doUpdates(updateCallback mUpdateCallback)
This function updates the video interface such as status, display format, video format,...
Definition: Components_VideoOutput.cpp:270
dsTypes.h
Device Settings HAL types.
manager.hpp
It contains class referenced by manager.cpp file.
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_STBServiceVideoOutput
This class provides the TR-069 components video output information.
Definition: Components_VideoOutput.h:92
dsError.h
Device Settings HAL error codes.
hostIf_STBServiceVideoOutput::checkForUpdates
void checkForUpdates(updateCallback mUpdateCallback)
This function checks for the host IF video interface updates such as status, display format,...
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_STBServiceVideoOutput::handleGetMsg
int handleGetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData)
This function get the video interface attribute value such as status, display format,...
Definition: Components_VideoOutput.cpp:224
videoDFC.hpp
This file defines VideoDFC class for managing video decoder format conversion types.