RDK Documentation (Open Sourced RDK Components)
Components_VideoOutput.cpp
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.cpp
22  * @brief This source file contains the APIs of TR069 Components VideoOutput.
23  */
24 
25 /**
26 * @defgroup tr69hostif
27 * @{
28 * @defgroup hostif
29 * @{
30 **/
31 
32 
33 #include "dsTypes.h"
34 #include "illegalArgumentException.hpp"
35 #include "exception.hpp"
36 #include "Components_VideoOutput.h"
37 #include "safec_lib.h"
38 
39 #define DEV_NAME "VideoOutput"
40 #define BASE_NAME "Device.Services.STBService.1.Components.VideoOutput"
41 #define UPDATE_FORMAT_STRING "%s.%d.%s"
42 
43 #define STATUS_STRING "Status"
44 #define ENABLE_STRING "Enable"
45 #define DISPLAY_FORMAT_STRING "DisplayFormat"
46 #define VIDEO_FORMAT_STRING "VideoFormat"
47 #define AR_BEHAVIOR_STRING "AspectRatioBehaviour"
48 #define HDCP_STRING "HDCP"
49 #define DISPLAY_NAME_STRING "Name"
50 #define ENABLED_STRING "Enabled"
51 #define DISABLED_STRING "Disabled"
52 
53 GHashTable * hostIf_STBServiceVideoOutput::ifHash = NULL;
54 GMutex * hostIf_STBServiceVideoOutput::m_mutex = NULL;
55 
56 hostIf_STBServiceVideoOutput* hostIf_STBServiceVideoOutput::getInstance(int dev_id)
57 {
58  hostIf_STBServiceVideoOutput* pRet = NULL;
59 
60  if(ifHash)
61  {
62  pRet = (hostIf_STBServiceVideoOutput *)g_hash_table_lookup(ifHash,(gpointer) dev_id);
63  }
64  else
65  {
66  ifHash = g_hash_table_new(NULL,NULL);
67  }
68 
69  if(!pRet)
70  {
71  try {
72  // TODO: We only create 1 videooutput currently. Fix this to return a count from ds.
73  std::string strVideoPort = device::Host::getInstance().getDefaultVideoPortName();
74  std::string videoPortName = strVideoPort.substr(0, strVideoPort.size()-1);
75  pRet = new hostIf_STBServiceVideoOutput(dev_id, device::Host::getInstance().getVideoOutputPort(videoPortName.append(int_to_string(dev_id-1))));
76  g_hash_table_insert(ifHash, (gpointer)dev_id, pRet);
77  }
78  catch (const device::IllegalArgumentException &e)
79  {
80  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught device::IllegalArgumentException, not able create STB service %s Interface instance %d..\n", DEV_NAME, dev_id);
81  }
82  catch (const int &e)
83  {
84  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create STB service %s Interface instance %d..\n", DEV_NAME, dev_id);
85  }
86  catch (const dsError_t &e)
87  {
88  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Caught dsError_t %d, not able create STB service %s Interface instance %d..\n", e, DEV_NAME, dev_id);
89  }
90  catch (const device::Exception &e)
91  {
92  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught device::Exception %d \"%s\", not able create STB service %s Interface instance %d..\n", e.getCode(), e.getMessage().c_str(), DEV_NAME, dev_id);
93  }
94  }
95  return pRet;
96 }
97 
98 GList* hostIf_STBServiceVideoOutput::getAllInstances()
99 {
100  if(ifHash)
101  return g_hash_table_get_keys(ifHash);
102  return NULL;
103 }
104 
105 void hostIf_STBServiceVideoOutput::closeInstance(hostIf_STBServiceVideoOutput *pDev)
106 {
107  if(pDev)
108  {
109  g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id);
110  delete pDev;
111  }
112 }
113 
114 void hostIf_STBServiceVideoOutput::closeAllInstances()
115 {
116  if(ifHash)
117  {
118  GList* tmp_list = g_hash_table_get_values (ifHash);
119 
120  while(tmp_list)
121  {
123  tmp_list = tmp_list->next;
124  closeInstance(pDev);
125  }
126  }
127 }
128 
129 void hostIf_STBServiceVideoOutput::getLock()
130 {
131  if(!m_mutex)
132  {
133  m_mutex = g_mutex_new();
134  }
135  g_mutex_lock(m_mutex);
136 }
137 
138 void hostIf_STBServiceVideoOutput::releaseLock()
139 {
140  g_mutex_unlock(m_mutex);
141 }
142 
143 /**
144  * @brief Class Constructor of the class hostIf_STBServiceVideoOutput.
145  *
146  * It will initialize the device id and video output port.
147  *
148  * @param[in] devid Identification number of the device.
149  * @param[in] port Video output port number.
150  */
152 {
153  errno_t rc = -1;
154  rc=strcpy_s(backupAspectRatioBehaviour,sizeof(backupAspectRatioBehaviour)," ");
155  if(rc!=EOK)
156  {
157  ERR_CHK(rc);
158  }
159  rc=strcpy_s(backupDisplayFormat,sizeof(backupDisplayFormat)," ");
160  if(rc!=EOK)
161  {
162  ERR_CHK(rc);
163  }
164  rc=strcpy_s(backupDisplayName,sizeof(backupDisplayName)," ");
165  if(rc!=EOK)
166  {
167  ERR_CHK(rc);
168  }
169  rc=strcpy_s(backupVideoFormat,sizeof(backupVideoFormat)," ");
170  if(rc!=EOK)
171  {
172  ERR_CHK(rc);
173  }
174  backupHDCP = false;
175  rc=strcpy_s(backupVideoOutputStatus,sizeof(backupVideoOutputStatus)," ");
176  if(rc!=EOK)
177  {
178  ERR_CHK(rc);
179  }
180 
181  bCalledAspectRatioBehaviour = false;
182  bCalledDisplayFormat = false;
183  bCalledDisplayName = false;
184  bCalledVideoFormat = false;
185  bCalledHDCP = false;
186  bCalledVideoOutputStatus = false;
187 
188 }
189 
190 /**
191  * @brief This function set the video interface attribute value such as status, display format,
192  * video format, aspect ratio and HDPC(High-Bandwidth Digital Content Protection) in the connected
193  * video port etc.. Currently not implemented.
194  *
195  * @param[in] paramName Video service name string.
196  * @param[in] stMsgData HostIf Message Request param contains the video attribute value.
197  *
198  * @return Returns an Integer value.
199  * @retval 0 If successfully set the hostIf video interface attribute.
200  * @retval -1 If Not able to set the hostIf video interface attribute.
201  * @retval -2 If Not handle the hostIf video interface attribute.
202  * @ingroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT_API
203  */
204 int hostIf_STBServiceVideoOutput::handleSetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData)
205 {
206  int ret = NOT_HANDLED;
207  return ret;
208 }
209 
210 /**
211  * @brief This function get the video interface attribute value such as status, display format,
212  * video format, aspect ratio and HDPC(High-Bandwidth Digital Content Protection) in the connected
213  * video port etc..
214  *
215  * @param[in] paramName Video service name.
216  * @param[in] stMsgData HostIf Message Request param which contains the video attribute value.
217  *
218  * @return Returns an Integer value.
219  * @retval 0 If successfully get the hostIf video interface attribute.
220  * @retval -1 If Not able to get the hostIf video interface attribute.
221  * @retval -2 If Not handle the hostIf video interface attribute.
222  * @ingroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT_API
223  */
224 int hostIf_STBServiceVideoOutput::handleGetMsg(const char *paramName, HOSTIF_MsgData_t *stMsgData)
225 {
226  int ret = NOT_HANDLED;
227  if(strcasecmp(paramName, STATUS_STRING) == 0)
228  {
229  ret = getStatus(stMsgData);
230  }
231  else if(strcasecmp(paramName, ENABLE_STRING) == 0)
232  {
233  put_boolean(stMsgData->paramValue,true);
234  stMsgData->paramtype = hostIf_BooleanType;
235  stMsgData->paramLen = sizeof(bool);
236  ret = OK;
237  }
238  else if(strcasecmp(paramName, DISPLAY_FORMAT_STRING) == 0)
239  {
240  ret = getDisplayFormat(stMsgData);
241  }
242  else if(strcasecmp(paramName, VIDEO_FORMAT_STRING) == 0)
243  {
244  ret = getVideoFormat(stMsgData);
245  }
246  else if(strcasecmp(paramName, AR_BEHAVIOR_STRING) == 0)
247  {
248  ret = getAspectRatioBehaviour(stMsgData);
249  }
250  else if(strcasecmp(paramName, HDCP_STRING) == 0)
251  {
252  ret = getHDCP(stMsgData);
253  }
254  else if(strcasecmp(paramName, DISPLAY_NAME_STRING) == 0)
255  {
256  ret = getName(stMsgData);
257  }
258 
259  return ret;
260 }
261 
262 /**
263  * @brief This function updates the video interface such as status, display format, video format,
264  * aspect ratio and HDPC (High-Bandwidth Digital Content Protection) in a connected video port using
265  * callback mechanism.
266  *
267  * @param[in] mUpdateCallback Callback function which updates the hostIf video interface.
268  * @ingroup TR69_HOSTIF_STBSERVICES_VIDEOOUTPUT_API
269  */
270 void hostIf_STBServiceVideoOutput::doUpdates(updateCallback mUpdateCallback)
271 {
272  HOSTIF_MsgData_t msgData;
273  bool bChanged;
274  char tmp_buff[PARAM_LEN];
275 
276  memset(&msgData,0,sizeof(msgData));
277  memset(tmp_buff,0,PARAM_LEN);
278  bChanged = false;
279  msgData.instanceNum=dev_id;
280  getStatus(&msgData,&bChanged);
281  if(bChanged)
282  {
283  snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, STATUS_STRING);
284  if(mUpdateCallback)
285  {
286  mUpdateCallback(IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED,tmp_buff, msgData.paramValue, msgData.paramtype);
287  }
288  }
289  memset(&msgData,0,sizeof(msgData));
290  memset(tmp_buff,0,PARAM_LEN);
291  bChanged = false;
292  msgData.instanceNum=dev_id;
293  getDisplayFormat(&msgData,&bChanged);
294  if(bChanged)
295  {
296  snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, DISPLAY_FORMAT_STRING);
297  if(mUpdateCallback)
298  {
299  mUpdateCallback(IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED,tmp_buff, msgData.paramValue, msgData.paramtype);
300  }
301  }
302  memset(&msgData,0,sizeof(msgData));
303  memset(tmp_buff,0,PARAM_LEN);
304  bChanged = false;
305  msgData.instanceNum=dev_id;
306  getName(&msgData,&bChanged);
307  if(bChanged)
308  {
309  snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, DISPLAY_NAME_STRING);
310  if(mUpdateCallback)
311  {
312  mUpdateCallback(IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED,tmp_buff, msgData.paramValue, msgData.paramtype);
313  }
314  }
315  memset(&msgData,0,sizeof(msgData));
316  memset(tmp_buff,0,PARAM_LEN);
317  bChanged = false;
318  msgData.instanceNum=dev_id;
319  getVideoFormat(&msgData,&bChanged);
320  if(bChanged)
321  {
322  snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, VIDEO_FORMAT_STRING);
323  if(mUpdateCallback)
324  {
325  mUpdateCallback(IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED,tmp_buff, msgData.paramValue, msgData.paramtype);
326  }
327  }
328  memset(&msgData,0,sizeof(msgData));
329  memset(tmp_buff,0,PARAM_LEN);
330  bChanged = false;
331  msgData.instanceNum=dev_id;
332  getAspectRatioBehaviour(&msgData,&bChanged);
333  if(bChanged)
334  {
335  snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, AR_BEHAVIOR_STRING);
336  if(mUpdateCallback)
337  {
338  mUpdateCallback(IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED,tmp_buff, msgData.paramValue, msgData.paramtype);
339  }
340  }
341  memset(&msgData,0,sizeof(msgData));
342  memset(tmp_buff,0,PARAM_LEN);
343  bChanged = false;
344  msgData.instanceNum=dev_id;
345  getHDCP(&msgData,&bChanged);
346  if(bChanged)
347  {
348  snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, HDCP_STRING);
349  if(mUpdateCallback)
350  {
351  mUpdateCallback(IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED,tmp_buff, msgData.paramValue, msgData.paramtype);
352  }
353  }
354 }
355 
356 // Impl of accessors below.
357 
358 // This is all coded to use the HDMI port, but I think there's incorrect assumptions being made here...
359 
360 /************************************************************
361  * Description : Get VideoOutputPort Enable / Disable status
362  * Precondition : None
363  * Input : stMsgData for result return.
364  pChanged
365 
366  * Return : OK -> Success
367  NOK -> Failure
368  stMsgData->paramValue -> "Enabled", "Disabled"
369 ************************************************************/
370 int hostIf_STBServiceVideoOutput::getStatus(HOSTIF_MsgData_t *stMsgData,bool *pChanged)
371 {
372  try {
373 
374  /*
375  Following logic
376  - If HDMI not connected - Disabled.
377  - If HDMI connected and Port power is off - Disabled.
378  - If HDMI connected and if Port power is ON and HDCP disabled - Disabled.
379  - If HDMI connected and if Port power is ON and HDCP enabled - Enabled.
380  */
381  if (true == vPort.isDisplayConnected())
382  {
383  //g_printf("[%s] In getHDMIEnable(): vPort.isEnabled(): %d \n",__FUNCTION__, vPort.isEnabled());
384  if (vPort.isEnabled())
385  strncpy(stMsgData->paramValue, ENABLED_STRING, PARAM_LEN);
386  else
387  strncpy(stMsgData->paramValue, DISABLED_STRING, PARAM_LEN);
388 
389  }
390  else
391  {
392  memset(stMsgData->paramValue, '\0', sizeof (stMsgData->paramValue));
393  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s] HDMI Display is NOT connected\r\n",__FUNCTION__);
394  strncpy(stMsgData->paramValue, DISABLED_STRING, PARAM_LEN);
395  }
396  stMsgData->paramValue[PARAM_LEN-1] = '\0';
397  stMsgData->paramtype = hostIf_StringType;
398  stMsgData->paramLen = strlen(stMsgData->paramValue);
399  RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s] HDCP Status is [%s]\r\n",__FUNCTION__,stMsgData->paramValue);
400  if(bCalledVideoOutputStatus && pChanged && strcmp(backupVideoOutputStatus, stMsgData->paramValue))
401  {
402  *pChanged = true;
403  }
404  bCalledVideoOutputStatus = true;
405  strncpy(backupVideoOutputStatus,stMsgData->paramValue,_BUF_LEN_16-1);
406  backupVideoOutputStatus[_BUF_LEN_16-1] = '\0';
407  }
408  catch (const std::exception e) {
409  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"[%s] Exception\r\n",__FUNCTION__);
410  return NOK;
411  }
412 
413  return OK;
414 }
415 
416 /************************************************************
417  * Description : Get VideoOutput AspectRatioBehaviour value
418  * Precondition : None
419  * Input : stMsgData for result return.
420  pChanged
421 
422  * Return : OK -> Success
423  NOK -> Failure
424  stMsgData->paramValue -> AspectRatioBehaviour
425 
426 ************************************************************/
427 int hostIf_STBServiceVideoOutput::getAspectRatioBehaviour(HOSTIF_MsgData_t *stMsgData,bool *pChanged)
428 {
429  // TODO: Decoder? Is this impl correct?
430  try {
432  strncpy(stMsgData->paramValue, decoder.getDFC().getName().c_str(), PARAM_LEN);
433  RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s] : Value: %s \n",__FUNCTION__, stMsgData->paramValue);
434  stMsgData->paramValue[PARAM_LEN-1] = '\0';
435  stMsgData->paramtype = hostIf_StringType;
436  stMsgData->paramLen = strlen(stMsgData->paramValue);
437  if(bCalledAspectRatioBehaviour && pChanged && strncmp(backupAspectRatioBehaviour,stMsgData->paramValue,_BUF_LEN_16-1))
438  {
439  *pChanged = true;
440  }
441  bCalledAspectRatioBehaviour = true;
442  strncpy(backupAspectRatioBehaviour,stMsgData->paramValue,_BUF_LEN_16-1);
443  backupAspectRatioBehaviour[_BUF_LEN_16-1] = '\0';
444  }
445  catch (const std::exception e) {
446  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"[%s] Exception\r\n",__FUNCTION__);
447  return NOK;
448  }
449 
450  return OK;
451 }
452 
453 /************************************************************
454  * Description : Get the currently active video output format.
455  * Precondition : None
456  * Input : stMsgData for result return.
457  pChanged
458 
459  * Return : OK -> Success
460  NOK -> Failure
461  value -> HDMI(XI3 by default, it is HDMI)
462  DVI.
463 TODO: Need correct implementation. Here's what TR-135 says:
464  Comma-separated list of strings. Each entry is a supported display format and
465  MUST be in the form of “x:y”, such as for example “4:3, 16:9, 14:9".
466 ************************************************************/
467 int hostIf_STBServiceVideoOutput::getVideoFormat(HOSTIF_MsgData_t *stMsgData,bool *pChanged)
468 {
469  try {
470  /*By default, XI3 only supports HDMI */
471  snprintf(stMsgData->paramValue, PARAM_LEN, "%s","HDMI");
472  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"[%s] : Value: %s \n",__FUNCTION__, stMsgData->paramValue);
473  stMsgData->paramtype = hostIf_StringType;
474  stMsgData->paramLen = strlen(stMsgData->paramValue);
475  if(bCalledVideoFormat && pChanged && strcmp(backupVideoFormat, stMsgData->paramValue))
476  {
477  *pChanged = true;
478  }
479  bCalledVideoFormat = true;
480  strncpy(backupVideoFormat,stMsgData->paramValue,_BUF_LEN_16-1);
481  backupVideoFormat[_BUF_LEN_16-1] = '\0';
482  }
483  catch (const std::exception e) {
484  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"[%s] Exception\r\n",__FUNCTION__);
485  return NOK;
486  }
487 
488  return OK;
489 }
490 
491 
492 /************************************************************
493  //TODO
494  * Description : Get VideoOutput Display format
495  * Precondition : None
496  * Input : stMsgData for result return.
497  pChanged
498 
499  * Return : OK -> Success
500  NOK -> Failure
501  stMsgData->paramValue -> Display format string.
502 
503 ************************************************************/
504 int hostIf_STBServiceVideoOutput::getDisplayFormat(HOSTIF_MsgData_t *stMsgData,bool *pChanged)
505 {
506  try {
507  sprintf(stMsgData->paramValue,"%s",vPort.getResolution().getName().c_str());
508  RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s] : Value: %s \n",__FUNCTION__, stMsgData->paramValue);
509  stMsgData->paramtype = hostIf_StringType;
510  stMsgData->paramLen = strlen(stMsgData->paramValue);
511  if(bCalledDisplayFormat && pChanged && strcmp(backupDisplayFormat, stMsgData->paramValue))
512  {
513  *pChanged = true;
514  }
515  bCalledDisplayFormat = true;
516  strncpy(backupDisplayFormat,stMsgData->paramValue,_BUF_LEN_16-1);
517  backupDisplayFormat[_BUF_LEN_16-1] = '\0';
518  }
519  catch (const std::exception e) {
520  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"[%s] Exception\r\n",__FUNCTION__);
521  return NOK;
522  }
523 
524  return OK;
525 }
526 
527 /************************************************************
528  //TODO
529  * Description : Get VideoOutput Display Name
530  * Precondition : None
531  * Input : stMsgData for result return.
532  pChanged
533 
534  * Return : OK -> Success
535  NOK -> Failure
536  stMsgData->paramValue -> Display Name string.
537 
538 ************************************************************/
539 int hostIf_STBServiceVideoOutput::getName(HOSTIF_MsgData_t *stMsgData,bool *pChanged)
540 {
541  try {
542  sprintf(stMsgData->paramValue,"%s",vPort.getName().c_str());
543  RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s] : Value: %s \n",__FUNCTION__, stMsgData->paramValue);
544  stMsgData->paramtype = hostIf_StringType;
545  stMsgData->paramLen = strlen(stMsgData->paramValue);
546  if(bCalledDisplayName && pChanged && strcmp(backupDisplayName, stMsgData->paramValue))
547  {
548  *pChanged = true;
549  }
550  bCalledDisplayName = true;
551  strncpy(backupDisplayName,stMsgData->paramValue,_BUF_LEN_16-1);
552  backupDisplayName[_BUF_LEN_16-1] = '\0';
553  }
554  catch (const std::exception e) {
555  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"[%s] Exception\r\n",__FUNCTION__);
556  return NOK;
557  }
558 
559  return OK;
560 }
561 /************************************************************
562  * Description : Get if HDCP is being used in this Video Output or not.
563  * Precondition : None
564  * Input : stMsgData for result return.
565  pChanged
566 
567  * Return : OK -> Success
568  NOK -> Failure
569  stMsgData->paramValue -> 1 : HDCP Supported
570  0 : HDCP Not Supported.
571 ************************************************************/
572 int hostIf_STBServiceVideoOutput::getHDCP(HOSTIF_MsgData_t *stMsgData,bool *pChanged)
573 {
574  int hdpcStatus = 0;
575  bool isHDCPSupported = false;
576  try {
577  if(vPort.isDisplayConnected())
578  {
579  hdpcStatus = vPort.getHDCPStatus();
580  isHDCPSupported = (hdpcStatus == dsHDCP_STATUS_AUTHENTICATED)?true:false;
581  }
582 
583  put_boolean(stMsgData->paramValue, isHDCPSupported);
584 
585  stMsgData->paramtype = hostIf_BooleanType;
586  stMsgData->paramLen = sizeof(bool);
587  RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s] Value: %s \n",__FUNCTION__, stMsgData->paramValue);
588  if(bCalledHDCP && pChanged && (backupHDCP != get_boolean(stMsgData->paramValue)))
589  {
590  *pChanged = true;
591  }
592  bCalledHDCP = true;
593  backupHDCP = get_boolean(stMsgData->paramValue);
594  }
595  catch (const std::exception e) {
596  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"[%s] Exception\r\n",__FUNCTION__);
597  return NOK;
598  }
599 
600  return OK;
601 }
602 
603 
604 
605 
606 /** @} */
607 /** @} */
hostIf_STBServiceVideoOutput::hostIf_STBServiceVideoOutput
hostIf_STBServiceVideoOutput(int devid, device::VideoOutputPort &port)
Class Constructor of the class hostIf_STBServiceVideoOutput.
Definition: Components_VideoOutput.cpp:151
_HostIf_MsgData_t::instanceNum
short instanceNum
Definition: hostIf_tr69ReqHandler.h:176
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::getName
const std::string & getName() const
This API gets the name of the VideoOutputPort. The VideoOutputPort names can be HDMI,...
Definition: videoOutputPort.hpp:225
Components_VideoOutput.h
The header file provides capabilities video output information APIs.
dsHDCP_STATUS_AUTHENTICATED
@ dsHDCP_STATUS_AUTHENTICATED
Definition: dsTypes.h:416
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::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
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.
_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
put_boolean
void put_boolean(char *ptr, bool val)
This function converts the input data to Boolean type.
Definition: hostIf_utils.cpp:191
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
_HostIf_MsgData_t::paramtype
HostIf_ParamType_t paramtype
Definition: hostIf_tr69ReqHandler.h:177
RDK_LOG
#define RDK_LOG
Definition: rdk_debug.h:258
device::Host::getVideoDevices
List< VideoDevice > getVideoDevices()
This API is used to get the list of the video devices (i.e. Decoders) supported on the device....
Definition: host.cpp:331
device::Exception::getCode
virtual int getCode() const
This function is used to get the error code of the exception.
Definition: exception.hpp:104
device::VideoDevice::getDFC
const VideoDFC & getDFC()
This API is used to get the current DFC setting.
Definition: videoDevice.cpp:220
device::DSConstant::getName
virtual const std::string & getName() const
This function is used to the get the data member name.
Definition: dsConstant.hpp:141
device::Exception
This class handles exceptions occurring in DS module.
Definition: exception.hpp:52
_HostIf_MsgData_t::paramValue
char paramValue[(4 *1024)]
Definition: hostIf_tr69ReqHandler.h:172
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::VideoDevice
class extending DSConstant to implement the videoDevice interface.
Definition: videoDevice.hpp:53
device::Exception::getMessage
virtual const std::string & getMessage() const
This function is used to get the message string of the exception.
Definition: exception.hpp:93
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
device::IllegalArgumentException
This class extends Exception class to manage the expections caused due to illegal arguments.
Definition: illegalArgumentException.hpp:51
dsError_t
dsError_t
Device Settings API Error return codes.
Definition: dsError.h:84
IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED
@ IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED
Definition: hostIf_tr69ReqHandler.h:189
_HostIf_MsgData_t::paramLen
short paramLen
Definition: hostIf_tr69ReqHandler.h:175