RDK Documentation (Open Sourced RDK Components)
videoOutputPort.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 
22 /**
23 * @defgroup devicesettings
24 * @{
25 * @defgroup ds
26 * @{
27 **/
28 
29 
30 #include "videoOutputPort.hpp"
31 #include "videoResolution.hpp"
32 #include "audioOutputPortType.hpp"
33 #include "videoOutputPortType.hpp"
34 #include "videoOutputPortConfig.hpp"
35 #include "audioOutputPortConfig.hpp"
36 #include "host.hpp"
37 #include "dslogger.h"
38 #include "dsVideoPort.h"
39 #include "dsDisplay.h"
40 #include "edid-parser.hpp"
41 
42 #include "safec_lib.h"
43 
44 #include "illegalArgumentException.hpp"
46 
47 #include <iostream>
48 #include <stdlib.h>
49 #include <string.h>
50 #include <sstream>
51 #include <thread>
52 #include <chrono>
53 using namespace std;
54 
55 
56 /**
57  * @file videoOutputPort.cpp
58  * @brief VideoOutputPort objects are instantiated by the Device Settings module upon initialization.
59  * Applications do not need to create any such objects on its own.
60  * References to the preallocated objects can be retrieved by applications via Host::getVideoOutputPort(const std::string &name).
61  * Each VideoOutputPort is associated with an instance of VideoOutputPortType.
62  */
63 
64 namespace device {
65 
66 const char * VideoOutputPort::kPropertyResolution = ".resolution";
67 
68 enum {
69  READ_EDID_RETRY_MS = 500,
70  READ_EDID_RETRY_TOTAL_MS = 2000
71 };
72 
73 /**
74  * @addtogroup dssettingsvidoutportapi
75  * @{
76  */
77 /**
78  * @fn VideoOutputPort::getInstance(int id)
79  * @brief This API is used to get the instance of the video output port based on the port id returned by the getsupported videooutput port.
80  *
81  * @param[in] id port id
82  *
83  * @return Reference to the instance of the port id
84  */
85 VideoOutputPort & VideoOutputPort::getInstance(int id)
86 {
87  return VideoOutputPortConfig::getInstance().getPort(id);
88 }
89 
90 
91 /**
92  * @fn VideoOutputPort::getInstance(const std::string &name)
93  * @brief This API is used to get the instance of the video output port based on the port name returned by the getsupported videooutput port.
94  *
95  * @param[in] name Name of the port
96  *
97  * @return Reference to the instance of the name of the port
98  */
99 VideoOutputPort & VideoOutputPort::getInstance(const std::string &name)
100 {
101  return VideoOutputPortConfig::getInstance().getPort(name);
102 
103 }
104 
105 
106 /**
107  * @fn VideoOutputPort::VideoOutputPort(const int type, const int index, const int id, int audioPortId, const std::string &resolution)
108  * @brief This function is a parameterised constructor for videooutputport. It initialises the data members of
109  * VideoOutputPort instance with the parameters passed. It also updates the details about the video port
110  * to indicate if the video port is enabled or not and also if its connected to the display or not. An
111  * IllegalArgumentException is thrown if any error occurs while accessing the information about the video
112  * port.
113  *
114  * @param[in] type Type of video output port (HDMI).
115  * @param[in] index Index of video output port (0,1,...)
116  * @param[in] id Videooutput port id.
117  * @param[in] audioPortId AudioOutput Porttype id.
118  * @param[in] resolution Supported videooutput port resolution.
119  *
120  * @return None
121  */
122 VideoOutputPort::VideoOutputPort(const int type, const int index, const int id, int audioPortId, const std::string &resolution) :
123  _type(type), _index(index), _id(id),
124  _handle(-1), _enabled(true), _contentProtected(false),
125  _displayConnected(false), _aPortId(audioPortId),
126  _defaultResolution(resolution),
127  _resolution(resolution),
128  _display(*this)
129 {
131 
132  {
133  std::stringstream out;
134  out << getType().getName() << _index;
135  _name = std::string(out.str());
136  }
137 
138  if (ret == dsERR_NONE) {
139  bool enabled = false;
140  ret = dsIsVideoPortEnabled(_handle, &enabled);
141  if (ret == dsERR_NONE) {
142  _enabled = enabled;
143  _contentProtected = false;
144 
145  bool connected = false;
146  ret = dsIsDisplayConnected(_handle, &connected);
147  if (ret == dsERR_NONE) {
148  _displayConnected = connected;
149  }
150  else {
151  throw IllegalArgumentException();
152  }
153  }
154  else {
155  }
156  }
157  else {
158  throw IllegalArgumentException();
159  }
160 }
161 
162 bool VideoOutputPort::setScartParameter(const std::string parameter, const std::string value)
163 {
164  return dsSetScartParameter(_handle, parameter.c_str(), value.c_str()) == dsERR_NONE;
165 }
166 
167 int VideoOutputPort::getVideoEOTF() const
168 {
170  dsError_t ret = dsGetVideoEOTF(_handle, &videoEotf);
171 
172  if (ret != dsERR_NONE) {
173  throw Exception(ret);
174  }
175 
176  return (int)videoEotf;
177 }
178 
179 int VideoOutputPort::getMatrixCoefficients() const
180 {
181  dsDisplayMatrixCoefficients_t matrixCoefficients = dsDISPLAY_MATRIXCOEFFICIENT_UNKNOWN;
182  dsError_t ret = dsGetMatrixCoefficients(_handle, &matrixCoefficients);
183 
184  if (ret != dsERR_NONE) {
185  throw Exception(ret);
186  }
187 
188  return (int)matrixCoefficients;
189 }
190 
191 int VideoOutputPort::getColorDepth() const
192 {
193  unsigned int colorDepth = 0;
194  dsError_t ret = dsGetColorDepth(_handle, &colorDepth);
195 
196  if (ret != dsERR_NONE) {
197  throw Exception(ret);
198  }
199 
200  return (int)colorDepth;
201 }
202 
203 int VideoOutputPort::getColorSpace() const
204 {
205  dsDisplayColorSpace_t colorSpace = dsDISPLAY_COLORSPACE_UNKNOWN;
206  dsError_t ret = dsGetColorSpace(_handle, &colorSpace);
207 
208  if (ret != dsERR_NONE) {
209  throw Exception(ret);
210  }
211 
212  return (int)colorSpace;
213 }
214 
215 int VideoOutputPort::getQuantizationRange() const
216 {
217  dsDisplayQuantizationRange_t quantizationRange = dsDISPLAY_QUANTIZATIONRANGE_UNKNOWN;
218  dsError_t ret = dsGetQuantizationRange(_handle, &quantizationRange);
219 
220  if (ret != dsERR_NONE) {
221  throw Exception(ret);
222  }
223 
224  return (int)quantizationRange;
225 }
226 
227 void VideoOutputPort::getCurrentOutputSettings(int &videoEOTF, int &matrixCoefficients, int &colorSpace, int &colorDepth, int &quantizationRange) const
228 {
229  dsHDRStandard_t _videoEOTF = dsHDRSTANDARD_NONE;
230  dsDisplayMatrixCoefficients_t _matrixCoefficients = dsDISPLAY_MATRIXCOEFFICIENT_UNKNOWN;
231  dsDisplayColorSpace_t _colorSpace = dsDISPLAY_COLORSPACE_UNKNOWN;
232  unsigned int _colorDepth = 0;
233  dsDisplayQuantizationRange_t _quantizationRange = dsDISPLAY_QUANTIZATIONRANGE_UNKNOWN;
234  dsError_t ret = dsGetCurrentOutputSettings(_handle, &_videoEOTF, &_matrixCoefficients, &_colorSpace, &_colorDepth, &_quantizationRange);
235 
236  if (ret != dsERR_NONE) {
237  throw Exception(ret);
238  }
239 
240  videoEOTF = _videoEOTF;
241  matrixCoefficients = _matrixCoefficients;
242  colorSpace = _colorSpace;
243  colorDepth = _colorDepth;
244  quantizationRange = _quantizationRange;
245 }
246 
247 /**
248  * @fn VideoOutputPort::~VideoOutputPort()
249  * @brief This is a default destructor of class VideoOutputPort.
250  *
251  * @return None.
252  */
254 {
255 }
256 
257 
258 /**
259  * @fn const VideoOutputPortType & VideoOutputPort::getType() const
260  * @brief This API is used to get the type of the video output port.
261  * A type of the video output port represent the general capabilities of the port.
262  *
263  * @return An instance to the type of the video output port
264  */
266 {
267  return VideoOutputPortConfig::getInstance().getPortType(_type);
268 }
269 
270 
271 /**
272  * @fn AudioOutputPort &VideoOutputPort::getAudioOutputPort()
273  * @brief This API is used to get the audio output port connected to the video output port.
274  * This connection is established during library initialization and cannot be modified.
275  * An Video port is connected to at most one Audio port. An Audio port however can be connected to multiple Video ports.
276  * UnsupportedOperationException will be thrown if the this Video Output Port is not connected to any Audio Output Port (i.e. on a Video-only device)
277  *
278  * @return Reference to the audio output port connected
279  */
281 {
282  return AudioOutputPortConfig::getInstance().getPort(_aPortId);
283 }
284 
285 
286 /**
287  * @fn const VideoResolution & VideoOutputPort::getResolution()
288  * @brief This API is used to get the current video resolution output from the video output port.
289  * Upon library initialization, the resolution from the persistence storage will be loaded as the initial Resolution for the video output port.
290  *
291  * @return Reference to the output resolution
292  */
294 {
295  dsVideoPortResolution_t resolution;
296  memset(&resolution, 0, sizeof(resolution));
297 
298  dsGetResolution(_handle,&resolution);
299 
300  /*Copy onto Temp - Safe*/
301  std::string temp( resolution.name,strlen(resolution.name));
302  _resolution = string(temp);
303 
304  return VideoResolution::getInstance(_resolution,true);
305 }
306 
307 
308 /**
309  * @fn const VideoOutputPort::getDefaultResolution() const
310  * @brief This API is used to get the default resolution supported by the video output port.
311  *
312  * @return Reference to the default output resolution
313  */
315 {
316  return VideoResolution::getInstance(_defaultResolution,true);
317 }
318 
319 
320 /**
321  * @fn const VideoOutputPort::Display & VideoOutputPort::getDisplay()
322  * @brief This API is used to get the display device information currently connected to the output port.
323  * Application can use isDisplayConnected() to query the display connection status before trying to get an instance of the display.
324  *
325  * @return Returns a reference to the connected display device. If the vedio port is not connected to the display then
326  * it throws an IllegalStateException.
327  */
329 {
330  if (isDisplayConnected()) {
331  dsVideoAspectRatio_t aspect;
332  dsDisplayEDID_t edid;
333  memset(&edid, 0, sizeof(edid));
334  dsError_t dsError = dsERR_NONE;
335  if (_display._handle != 0) {
336  dsGetDisplayAspectRatio(_display._handle, &aspect);
337  _display._aspectRatio = aspect;
338  dsError = dsGetEDID(_display._handle, &edid);
339  if(dsError == dsERR_NONE)
340  {
341  _display._productCode = edid.productCode;
342  _display._serialNumber = edid.serialNumber;
343  _display._manufacturerYear = edid.manufactureYear;
344  _display._manufacturerWeek = edid.manufactureWeek;
345  _display._hdmiDeviceType = edid.hdmiDeviceType;
346  /* The EDID physical Address */
347  _display._physicalAddressA = edid.physicalAddressA;
348  _display._physicalAddressB = edid.physicalAddressB;
349  _display._physicalAddressC = edid.physicalAddressC;
350  _display._physicalAddressD = edid.physicalAddressD;
351  _display._isDeviceRepeater = edid.isRepeater;
352 
353 
354  }
355  else
356  {
357  printf("VideoOutputPort::Display::dsGetEDID has dsError: %d\r\n", dsError);
358  }
359  return _display;
360  }
361  else {
363  }
364  }
365  else {
367  }
368 }
369 
370 
371 /**
372  * @fn bool VideoOutputPort::isDisplayConnected() const
373  * @brief This API is used to Check if the port is currently connected to any display device.
374  *
375  * If ret is not equal to dsERR_NONE, it will throw the ret to exception handler and it will pass message as "No message for this Exception".
376  *
377  * @return True or False
378  * @retval 1 if display is connected
379  * @retval 0 if display is not connected
380  */
382 {
383  bool connected = false;
384  dsError_t ret = dsIsDisplayConnected(_handle, &connected);
385  if (ret != dsERR_NONE) {
386  throw Exception(ret);
387  }
388  return connected;
389 }
390 
391 
392 /**
393  * @fn VideoOutputPort::isEnabled() const
394  * @brief This API is used to check whether this Video output port is enabled or not.
395  *
396  * @return None
397  */
399 {
400  bool enabled = false;
401  dsError_t ret = dsIsVideoPortEnabled(_handle, &enabled);
402  if (ret != dsERR_NONE) {
403  throw Exception(ret);
404  }
405  return enabled;
406 }
407 
408 
409 /**
410  * @fn VideoOutputPort::isActive() const
411  * @brief This API is used to check if Port is connected to active port of Sink device.
412  *
413  * @return None
414  */
416 {
417  bool active = false;
418  dsError_t ret = dsIsVideoPortActive(_handle, &active);
419  if (ret != dsERR_NONE) {
420  if (ret == dsERR_OPERATION_NOT_SUPPORTED) {
421  throw UnsupportedOperationException("RxSense is Not Supported");
422  }
423  throw Exception(ret);
424  }
425  return active;
426 }
427 
428 
429 
430 /**
431  * @fn VideoOutputPort::isDynamicResolutionSupported() const
432  * @brief This API is used to check whether the video output port supports the dynamic super resolution or not.
433  *
434  * @return True or False
435  * @retval True If video output port supports Dynamic super resolution
436  * @retval False If video output port doesnot support Dynamic super resolution
437  */
439 {
441 }
442 
443 
444 /**
445  * @fn VideoOutputPort::setResolution(const std::string &resolutionName)
446  * @brief This API is used to set the output resolution of the port by ID or its Name.
447  * The specified resolution must be one of the resolutions supported by the port.
448  * The list of supported resolutions can be retrieved via VideoOutputPortType:: getSupportedResolutions(); IllegalArgumentException will be thrown
449  * if the specified name or ID of the resolution is not recognized.
450  *
451  * @param[in] resolutionName Name of the Resoultion
452  * @param[in] persist Flag to inform whether or not to persist the resolution
453  * @param[in] isIgnoreEdid Flag to inform whether to ignore the EDID data or not
454  *
455  * @return None
456  */
457 void VideoOutputPort::setResolution(const std::string &resolutionName, bool persist/* = true*/, bool isIgnoreEdid/* = false*/)
458 {
459  printf("ResOverride VideoOutputPort::setResolution resolutionName:%s persist:%d isIgnoreEdid:%d line:%d\r\n", resolutionName.c_str(), persist, isIgnoreEdid, __LINE__);
460  if (0 && resolutionName.compare(_resolution) == 0) {
461  return;
462  }
463 
464  VideoResolution newResolution = VideoResolution::getInstance(resolutionName, isIgnoreEdid);
465 
466  dsVideoPortResolution_t resolution;
467  memset(&resolution, 0, sizeof(resolution));
468  resolution.aspectRatio = (dsVideoAspectRatio_t) newResolution.getAspectRatio().getId();
469  resolution.frameRate = (dsVideoFrameRate_t) newResolution.getFrameRate().getId();
470  resolution.interlaced = (bool) newResolution.isInterlaced();
471  resolution.pixelResolution = (dsVideoResolution_t) newResolution.getPixelResolution().getId();
473  errno_t rc = -1;
474  rc = strcpy_s(resolution.name,sizeof(resolution.name),resolutionName.c_str());
475  if(rc!=EOK)
476  {
477  ERR_CHK(rc);
478  }
479  dsError_t ret = dsSetResolution(_handle, &resolution, persist);
480 
481  if (ret != dsERR_NONE) {
482  throw Exception(ret);
483  }
484 
485  _resolution = newResolution.getName();
486 }
487 
488 void VideoOutputPort::setPreferredColorDepth(const unsigned int colordepth, bool persist/* = true*/)
489 {
490  dsError_t ret = dsSetPreferredColorDepth (_handle, (dsDisplayColorDepth_t)colordepth, persist);
491 
492  if (ret != dsERR_NONE) {
493  throw Exception(ret);
494  }
495 }
496 
497 const unsigned int VideoOutputPort::getPreferredColorDepth(bool persist/* = true*/)
498 {
499  dsDisplayColorDepth_t colordepth = dsDISPLAY_COLORDEPTH_AUTO;
500  dsError_t ret = dsGetPreferredColorDepth (_handle,&colordepth, persist);
501  if (ret != dsERR_NONE) {
502  throw Exception(ret);
503  }
504 
505  return (unsigned int)colordepth;
506 }
507 
508 void VideoOutputPort::getColorDepthCapabilities (unsigned int *capabilities) const
509 {
510  dsColorDepthCapabilities (_handle, capabilities);
511 }
512 
513 /**
514  * @fn VideoOutputPort::setDisplayConnected(const bool connected)
515  * @brief This API is used to set the video output port display to be connected.
516  *
517  * @param connected True if display is connected or False if display is not connencted
518  *
519  * @return None
520  */
521 void VideoOutputPort::setDisplayConnected(const bool connected)
522 {
523  _displayConnected = connected;
525 }
526 
527 
528 /**
529  * @fn bool VideoOutputPort::isContentProtected() const
530  * @brief This API is used to Check if the port or the content output on the port has DTCP or HDCP in use.
531  *
532  * @param None
533  *
534  * @return True or False
535  * @retval 1 if content from this port is protected by DTCP or HDCP.Otherwise
536  * @retval 0 if content from this port is not protected by DTCP or HDCP
537  */
539 {
540  bool isProtected = false;
541  dsIsHDCPEnabled (_handle, &isProtected);
542  return isProtected;
543 }
544 
545 
546 /**
547  * @fn VideoOutputPort::enable()
548  * @brief This API is used to enable the video output port.
549  *
550  * @return None
551  */
553 {
554  if (dsEnableVideoPort(_handle, true) == dsERR_NONE)
555  {
556  _enabled = true;
557  }
558 }
559 
560 
561 /**
562  * @fn VideoOutputPort::disable()
563  * @brief This API is used to disable the video output port.
564  *
565  * @return None
566  */
568 {
569  if (dsEnableVideoPort(_handle, false) == dsERR_NONE)
570  {
571  _enabled = false;
572  }
573 }
574 
575 
576 /**
577  * @fn VideoOutputPort::Display::Display(VideoOutputPort &vPort)
578  * @brief This function is used to get the display handle of a given video device.
579  *
580  * @param[in] vPort Video port handle associated with connected display.
581  * @return None.
582  */
584  _productCode(0), _serialNumber(0),
585  _manufacturerYear(0), _manufacturerWeek(0),
586  _hdmiDeviceType(true), _isSurroundCapable(false),
587  _isDeviceRepeater(false), _aspectRatio(0),
588  _physicalAddressA(1), _physicalAddressB(0),
589  _physicalAddressC(0), _physicalAddressD(0)
590 {
591  dsError_t ret = dsERR_NONE;
592  ret = dsGetDisplay((dsVideoPortType_t)vPort.getType().getId(), vPort.getIndex(), &_handle);
593  if (ret != dsERR_NONE) {
594  throw Exception(ret);
595  }
596 }
597 
598 /**
599  * @fn bool VideoOutputPort::Display::hasSurround(void) const
600  * @brief This function returns true if connected display supports surround audio
601  *
602  * @param None.
603  * @return true if the connected sink has surround capability.
604  */
606 {
607  printf("VideoOutputPort::Display::hasSurround\r\n");
608 
609  dsError_t ret = dsERR_NONE;
610  bool surround = false;
611  intptr_t vopHandle = 0;
612  ret = dsGetVideoPort(dsVIDEOPORT_TYPE_HDMI, 0, &vopHandle);
613  if (ret == dsERR_NONE) {
614  ret = dsIsDisplaySurround(vopHandle, &surround);
615  printf("VideoOutputPort::Display::hasSurround ret %d\r\n", ret);
616  }
617 
618  if (ret != dsERR_NONE) {
619  surround = false;
620  printf("VideoOutputPort::Display::hasSurround return default value false");
621  }
622 
623  return surround;
624 }
625 
626 /**
627  * @fn bool VideoOutputPort::Display::getSurroundMode(void) const
628  * @brief This function returns the supports surround audio Mode
629  *
630  * @param None.
631  * @return enum for the surround capability.
632  */
634 {
635  printf("VideoOutputPort::Display::getSurroundMode\r\n");
636 
637  dsError_t ret = dsERR_NONE;
638  int surroundMode = dsSURROUNDMODE_NONE;
639  intptr_t vopHandle = 0;
640  ret = dsGetVideoPort(dsVIDEOPORT_TYPE_HDMI, 0, &vopHandle);
641  if (ret == dsERR_NONE) {
642  ret = dsGetSurroundMode(vopHandle, &surroundMode);
643  printf("VideoOutputPort::Display::getSurroundMode ret %d\r\n", ret);
644  }
645 
646  if (ret != dsERR_NONE) {
647  surroundMode = dsSURROUNDMODE_NONE;
648  printf("VideoOutputPort::Display::getSurroundMode return default value dsSURROUNDMODE_NONE");
649  }
650 
651  return surroundMode;
652 }
653 
654 
655 /**
656  * @fn void VideoOutputPort::Display::getEDIDBytes(std::vector<uint8_t> &edid) const
657  * @brief This function is used to get the EDID information of the connected video display.
658  * After it gets the EDID information , it clears the old edid information and inserts it.
659  * The EDID bytes are verified before returning them. If invalid EDID bytes are detected, the
660  * EDID bytes are read again after READ_EDID_RETRY_MS millis. This repeats for a maximum
661  * of READ_EDID_RETRY_TOTAL_MS millis.
662  * If ret is not equal to dsERR_NONE, it will throw the ret to exception handler and it will pass message as "dsGetEDIDBytes failed".
663  * If invalid EDID is read, even after retries, it throws exception with message "EDID verification failed"
664  * If EDID bytes length > 1024 it throws exception with message "EDID length > 1024"
665  *
666  * @param edid The EDID raw buffer of the display. The HAL implementation should
667  * malloc() the buffer and return it to the application. The
668  * application is required to free() the buffer after using it;
669  * If HDMI is not connected no data should be returned,
670  * and the API returns dsERR_INVALID_STATE.
671  * @return None.
672  */
673 void VideoOutputPort::Display::getEDIDBytes(std::vector<uint8_t> &edid) const
674 {
675  using namespace std::chrono;
676 
677  printf("VideoOutputPort::Display::getEDIDBytes \r\n");
678 
679  dsError_t ret = dsERR_NONE;
680  int length = 0;
681 
682  struct MemGuard {
683  MemGuard() : edidBytes(NULL) {}
684  ~MemGuard() {
685  if (edidBytes) {
686  free(edidBytes);
687  edidBytes = NULL;
688  }
689  }
690  unsigned char *edidBytes;
691  } memguard;
692 
693  const auto reading_edid_start = system_clock::now();
694  const char* exceptionstr = "";
695  bool retry_get_edid;
696  do {
697  retry_get_edid = false;
698  const auto get_edid_bytes_start = system_clock::now();
699  ret = dsGetEDIDBytes(_handle, &memguard.edidBytes, &length);
700 
701  printf("VideoOutputPort::Display::getEDIDBytes has ret %d\r\n", ret);
702  if (ret == dsERR_NONE) {
703  if (length <= 1024) {
704  printf("VideoOutputPort::Display::getEDIDBytes has %d bytes\r\n", length);
705  if (edid_parser::EDID_STATUS_OK == edid_parser::EDID_Verify(memguard.edidBytes, length)) {
706  edid.clear();
707  edid.insert(edid.begin(), memguard.edidBytes, memguard.edidBytes + length);
708  } else {
709  ret = dsERR_GENERAL;
710  exceptionstr = "EDID verification failed";
711  auto now = system_clock::now();
712  if (now + milliseconds(READ_EDID_RETRY_MS) < reading_edid_start + milliseconds(READ_EDID_RETRY_TOTAL_MS)) {
713  std::this_thread::sleep_for(milliseconds(READ_EDID_RETRY_MS) - (now - get_edid_bytes_start));
714  retry_get_edid = true;
715  }
716  }
717  } else {
719  exceptionstr = "EDID length > 1024";
720  }
721  } else {
722  exceptionstr = "dsGetEDIDBytes failed";
723  }
724  } while (retry_get_edid);
725 
726  if (ret != dsERR_NONE) {
727  throw Exception(ret, exceptionstr);
728  }
729 }
730 
731 
732 /**
733  * @fn VideoOutputPort::Display::~Display()
734  * @brief This function is a default destructor of class Display.
735  *
736  * @return None.
737  */
739 {
740 }
741 
742 
743 int VideoOutputPort::getHDCPStatus()
744 {
745  dsHdcpStatus_t hdcpStatus;
746  int _hdcpStatus = 0;
747 
748  dsError_t ret = dsGetHDCPStatus(_handle, &hdcpStatus);
749 
750  if (ret != dsERR_NONE) {
751  throw Exception(ret);
752  }
753 
754  _hdcpStatus = hdcpStatus;
755  return _hdcpStatus;
756 }
757 
758 int VideoOutputPort::getHDCPProtocol()
759 {
760  dsHdcpProtocolVersion_t hdcpProtocol;
761  dsError_t ret = dsGetHDCPProtocol(_handle, &hdcpProtocol);
762 
763  if (ret != dsERR_NONE) {
764  throw Exception(ret);
765  }
766 
767  return hdcpProtocol;
768 }
769 
770 int VideoOutputPort::getHDCPReceiverProtocol()
771 {
772  dsHdcpProtocolVersion_t hdcpProtocol;
773 
774  dsError_t ret = dsGetHDCPReceiverProtocol(_handle, &hdcpProtocol);
775 
776  if (ret != dsERR_NONE) {
777  throw Exception(ret);
778  }
779 
780  return hdcpProtocol;
781 }
782 
783 int VideoOutputPort::getHDCPCurrentProtocol()
784 {
785  dsHdcpProtocolVersion_t hdcpProtocol;
786 
787  dsError_t ret = dsGetHDCPCurrentProtocol(_handle, &hdcpProtocol);
788 
789  if (ret != dsERR_NONE) {
790  throw Exception(ret);
791  }
792 
793  return hdcpProtocol;
794 }
795 
796 /**
797  * @fn const void VideoOutputPort::getTVHDRCapabilities(int *capabilities) const
798  * @brief This API is used to get HDR format supported by TV.
799  *
800  * @return HDR capabilities supported by TV
801  */
802 void VideoOutputPort::getTVHDRCapabilities(int *capabilities) const
803 {
804  dsGetTVHDRCapabilities(_handle, capabilities);
805 }
806 
807 /**
808  * @fn const void VideoOutputPort::getSupportedTvResolutions(int *resolutions) const
809  * @brief This API is used to get TV supported Video Resolutions.
810  *
811  * @return Resolutions supported by TV
812  */
813 void VideoOutputPort::getSupportedTvResolutions(int *resolutions) const
814 {
815  dsError_t ret = dsSupportedTvResolutions(_handle,resolutions);
816  if (ret != dsERR_NONE) {
817  throw Exception(ret);
818  }
819 }
820 
821 int VideoOutputPort::forceDisable4KSupport(bool disable)
822 {
823  dsSetForceDisable4KSupport(_handle, disable);
824  return 0;
825 }
826 
827 /**
828  * @fn const int VideoOutputPort::setForceHDRMode(dsHDRStandard_t mode)
829  * @brief This API is used to set/reset force HDR mode.
830  *
831  * @return bool status
832  */
834 {
835  return dsSetForceHDRMode(_handle, mode) == dsERR_NONE;
836 }
837 
838 /**
839  * @fn const void VideoOutputPort::IsOutputHDR()
840  * @brief This API is used to check if Video output is HDR or not.
841  *
842  * @return True if video output is HDR
843  */
845 {
846  bool hdr;
847  dsIsOutputHDR(_handle, &hdr);
848  return hdr;
849 }
850 
851 /**
852  * @fn const void VideoOutputPort::ResetOutputToSDR()
853  * @brief This API is used to reset the video output to SDR if it is HDR.
854  *
855  * @return None
856  */
857 
859 {
860  bool hdr;
861  hdr = IsOutputHDR();
862 
863  if(hdr == true){
865  }
866  else {
867  printf("ds: %s: Allready SDR\n",__FUNCTION__);
868  }
869 }
870 
871 /**
872  * @fn bool VideoOutputPort::SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol)
873  * @brief This API is used to set the Preferred HDMI Protocol
874  *
875  * @param enum dsHdcpProtocolVersion
876  * dsHDCP_VERSION_1X = 0, < HDCP Protocol version 1.x
877  * dsHDCP_VERSION_2X, < HDCP Protocol version 2.x
878  * dsHDCP_VERSION_MAX < Maximum index for HDCP protocol.
879  *
880  * @return true if no error.
881  */
882 
883 bool VideoOutputPort::SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol)
884 {
885  dsError_t ret = dsSetHdmiPreference(_handle, &hdcpProtocol);
886  if (ret != dsERR_NONE) {
887  return false;
888  }
889 
890  return true;
891 }
892 
893 /**
894  * @fn bool VideoOutputPort::GetHdmiPreference()
895  * @brief This API is used to get the HDMI Preference
896  *
897  * @return int value corresponding to : enum dsHdcpProtocolVersion
898  * dsHDCP_VERSION_1X = 0, < HDCP Protocol version 1.x
899  * dsHDCP_VERSION_2X, < HDCP Protocol version 2.x
900  * dsHDCP_VERSION_MAX < Maximum index for HDCP protocol.
901  *
902  */
903 
905 {
906  dsHdcpProtocolVersion_t hdcpProtocol;
907  dsError_t ret = dsGetHdmiPreference(_handle, &hdcpProtocol);
908 
909  if (ret != dsERR_NONE) {
910  throw Exception(ret);
911  }
912 
913  return hdcpProtocol;
914 }
915 
916 }
917 
918 /** @} */ //End of Doxygen tag
919 
920 
921 /** @} */
922 /** @} */
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::getIndex
int getIndex() const
This function returns the index of the video output port.
Definition: videoOutputPort.hpp:234
device::VideoOutputPortType::getInstance
static VideoOutputPortType & getInstance(const int id)
This function is used to get the instance of the video output port type based on the port id....
Definition: videoOutputPortType.cpp:109
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
dsGetEDIDBytes
dsError_t dsGetEDIDBytes(intptr_t handle, unsigned char **edid, int *length)
This function is used to get the EDID buffer and length of the connected display.
Definition: dsDisplay.c:149
dsGetHDCPProtocol
dsError_t dsGetHDCPProtocol(intptr_t handle, dsHdcpProtocolVersion_t *protocolVersion)
Get STB HDCP protocol version.
Definition: dsVideoPort.c:177
dsGetTVHDRCapabilities
dsError_t dsGetTVHDRCapabilities(intptr_t handle, int *capabilities)
To find the HDR capabilities of TV.
Definition: dsVideoPort.c:605
dsGetColorSpace
dsError_t dsGetColorSpace(intptr_t handle, dsDisplayColorSpace_t *color_space)
Get current color space setting.
Definition: dsVideoPort.c:883
device::VideoOutputPort::~VideoOutputPort
virtual ~VideoOutputPort()
This is a default destructor of class VideoOutputPort.
Definition: videoOutputPort.cpp:253
device::VideoOutputPort::Display::hasSurround
bool hasSurround() const
This function returns true if connected display supports surround audio.
Definition: videoOutputPort.cpp:605
device::VideoOutputPort::Display::_serialNumber
int _serialNumber
Serial number of the EDID video display device.
Definition: videoOutputPort.hpp:84
device::VideoResolution::getFrameRate
const FrameRate & getFrameRate() const
This API is used to get the frame rate of the given video output port.
Definition: videoResolution.cpp:172
dsGetMatrixCoefficients
dsError_t dsGetMatrixCoefficients(intptr_t handle, dsDisplayMatrixCoefficients_t *matrix_coefficients)
Get current matrix coefficients value.
Definition: dsVideoPort.c:825
device::VideoOutputPort::Display::_physicalAddressB
uint8_t _physicalAddressB
Physical Address for HDMI node B.
Definition: videoOutputPort.hpp:92
dsVideoAspectRatio_t
enum _dsVideoAspectRatio_t dsVideoAspectRatio_t
_dsDisplayEDID_t::hdmiDeviceType
bool hdmiDeviceType
Definition: dsTypes.h:906
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
dsSetHdmiPreference
dsError_t dsSetHdmiPreference(intptr_t handle, dsHdcpProtocolVersion_t *hdcpCurrentProtocol)
This API is used to set the Preferred HDMI Protocol.
Definition: dsVideoPort.c:741
device::VideoResolution
Class extending DSConstant to implement the videoResolution interface.
Definition: videoResolution.hpp:57
dsVIDEOPORT_TYPE_HDMI
@ dsVIDEOPORT_TYPE_HDMI
Definition: dsTypes.h:441
device::VideoOutputPort::Display::_physicalAddressD
uint8_t _physicalAddressD
Physical Address for HDMI node D.
Definition: videoOutputPort.hpp:94
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
_dsVideoPortResolution_t::stereoScopicMode
dsVideoStereoScopicMode_t stereoScopicMode
Definition: dsTypes.h:646
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
device::VideoOutputPort::_type
int _type
VideooOtputPortType.
Definition: videoOutputPort.hpp:60
dsVideoFrameRate_t
enum _dsVideoFrameRate_t dsVideoFrameRate_t
dsGetEDID
dsError_t dsGetEDID(intptr_t handle, dsDisplayEDID_t *edid)
Get the EDID information from the specified display device.
Definition: dsDisplay.c:119
dsVideoPortType_t
enum _dsVideoPortType_t dsVideoPortType_t
dsERR_INVALID_STATE
@ dsERR_INVALID_STATE
Definition: dsError.h:88
device::VideoOutputPort::_enabled
bool _enabled
Method variable to check whether VideoPort is enabled or not.
Definition: videoOutputPort.hpp:67
dsVideoPort.h
_dsDisplayEDID_t::physicalAddressC
uint8_t physicalAddressC
Definition: dsTypes.h:910
device::VideoOutputPort::IsOutputHDR
bool IsOutputHDR()
This API is used to check if Video output is HDR or not.
Definition: videoOutputPort.cpp:844
dsEnableVideoPort
dsError_t dsEnableVideoPort(intptr_t handle, bool enabled)
Enable/disable a video port.
Definition: dsVideoPort.c:328
dsGetDisplayAspectRatio
dsError_t dsGetDisplayAspectRatio(intptr_t handle, dsVideoAspectRatio_t *aspectRatio)
This function gets the aspect ratio for the dsiaply device. This function returns the aspect ratio of...
Definition: dsDisplay.c:93
device::VideoOutputPort::_index
int _index
Index of the video.
Definition: videoOutputPort.hpp:61
_dsVideoPortResolution_t::pixelResolution
dsVideoResolution_t pixelResolution
Definition: dsTypes.h:644
device::VideoOutputPort::_contentProtected
bool _contentProtected
Method variable tO check whether videoport is content protected or not.
Definition: videoOutputPort.hpp:68
device::VideoOutputPort::setDisplayConnected
void setDisplayConnected(const bool connected)
This API is used to set the video output port display to be connected.
Definition: videoOutputPort.cpp:521
device::VideoResolution::getStereoscopicMode
const StereoScopicMode & getStereoscopicMode() const
This API is used to get the stereoscopic mode of the given video output port.
Definition: videoResolution.cpp:161
dsGetDisplay
dsError_t dsGetDisplay(dsVideoPortType_t vType, int index, intptr_t *handle)
Get the handle of a display device.
Definition: dsDisplay.c:65
device::VideoResolution::isInterlaced
bool isInterlaced() const
This API is used to check the video is interlaced or not.
Definition: videoResolution.cpp:185
dsGetHDCPStatus
dsError_t dsGetHDCPStatus(intptr_t handle, dsHdcpStatus_t *status)
Get current HDCP status.
Definition: dsVideoPort.c:154
device::AudioOutputPort
Class extending Enumerable to implement the audiooutputport interface.
Definition: audioOutputPort.hpp:60
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::getDefaultResolution
const VideoResolution & getDefaultResolution() const
This API is used to get the default resolution supported by the video output port.
Definition: videoOutputPort.cpp:314
dsERR_GENERAL
@ dsERR_GENERAL
Definition: dsError.h:86
dsGetColorDepth
dsError_t dsGetColorDepth(intptr_t handle, unsigned int *color_depth)
Get current color depth value.
Definition: dsVideoPort.c:854
dsGetCurrentOutputSettings
dsError_t dsGetCurrentOutputSettings(intptr_t handle, dsHDRStandard_t *video_eotf, dsDisplayMatrixCoefficients_t *matrix_coefficients, dsDisplayColorSpace_t *color_space, unsigned int *color_depth, dsDisplayQuantizationRange_t *quantization_range)
Get current color space setting, color depth, matrix coefficients, video Electro-Optical Transfer Fun...
Definition: dsVideoPort.c:941
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
dsIsHDCPEnabled
dsError_t dsIsHDCPEnabled(intptr_t handle, bool *pContentProtected)
Indicate whether a video port is HDCP protected.
Definition: dsVideoPort.c:96
device::VideoOutputPort::getSupportedTvResolutions
void getSupportedTvResolutions(int *resolutions) const
This API is used to get TV supported Video Resolutions.
Definition: videoOutputPort.cpp:813
videoOutputPortType.hpp
It contains structures and class referenced by the videoOutputportTypes.cpp file.
dsERR_NONE
@ dsERR_NONE
Definition: dsError.h:85
device::VideoOutputPort::getDisplay
const VideoOutputPort::Display & getDisplay()
This API is used to get the display device information currently connected to the output port....
Definition: videoOutputPort.cpp:328
device::VideoOutputPortType::isDynamicResolutionsSupported
bool isDynamicResolutionsSupported() const
This function is used to query if dynamic resolutions are supported by the port type.
Definition: videoOutputPortType.cpp:286
dsVideoResolution_t
enum _dsVideoResolution_t dsVideoResolution_t
dsIsDisplaySurround
dsError_t dsIsDisplaySurround(intptr_t handle, bool *surround)
This function is used to indicate if the display connected supports surround audio.
Definition: dsVideoPort.c:273
dsSetForceHDRMode
dsError_t dsSetForceHDRMode(intptr_t handle, dsHDRStandard_t mode)
This API is used to set/reset force HDR mode.
Definition: dsVideoPort.c:974
dsGetPreferredColorDepth
dsError_t dsGetPreferredColorDepth(intptr_t handle, dsDisplayColorDepth_t *colorDepth, bool persist)
To get the preffered color depth mode.
Definition: dsVideoPort.c:436
videoResolution.hpp
It contains class and structure refrenced by the videoResolution.cpp file.
_dsDisplayEDID_t::manufactureWeek
int32_t manufactureWeek
Definition: dsTypes.h:905
dsColorDepthCapabilities
dsError_t dsColorDepthCapabilities(intptr_t handle, unsigned int *colorDepthCapability)
To find the color depth capabilities.
Definition: dsVideoPort.c:488
device::VideoResolution::getInstance
static const VideoResolution & getInstance(int id)
This API is used to get the instance of the video resolution port based on the port id returned by th...
Definition: videoResolution.cpp:56
device::VideoOutputPort::Display::_productCode
int _productCode
Product code of the EDID video display device.
Definition: videoOutputPort.hpp:83
device::VideoOutputPort::Display::_physicalAddressC
uint8_t _physicalAddressC
Physical Address for HDMI node C.
Definition: videoOutputPort.hpp:93
dsIsOutputHDR
dsError_t dsIsOutputHDR(intptr_t handle, bool *hdr)
Check Video Output is HDR or not.
Definition: dsVideoPort.c:693
dsIsVideoPortEnabled
dsError_t dsIsVideoPortEnabled(intptr_t handle, bool *enabled)
Indicate whether a video port is enabled.
Definition: dsVideoPort.c:125
device::VideoOutputPort::getTVHDRCapabilities
void getTVHDRCapabilities(int *capabilities) const
This API is used to get HDR format supported by TV.
Definition: videoOutputPort.cpp:802
_dsDisplayEDID_t::physicalAddressA
uint8_t physicalAddressA
Definition: dsTypes.h:908
dsGetHdmiPreference
dsError_t dsGetHdmiPreference(intptr_t handle, dsHdcpProtocolVersion_t *hdcpCurrentProtocol)
This API is used to get the Preferred HDMI Protocol.
Definition: dsVideoPort.c:768
_dsDisplayEDID_t::manufactureYear
int32_t manufactureYear
Definition: dsTypes.h:904
device::VideoOutputPort::setForceHDRMode
bool setForceHDRMode(dsHDRStandard_t status)
This API is used to set/reset force HDR mode.
Definition: videoOutputPort.cpp:833
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
dsHDRSTANDARD_NONE
@ dsHDRSTANDARD_NONE
Definition: dsTypes.h:693
_dsVideoPortResolution_t::aspectRatio
dsVideoAspectRatio_t aspectRatio
Definition: dsTypes.h:645
dsDisplay.h
_dsDisplayEDID_t
Defines the structure that is used to get the EDID information of the video display.
Definition: dsTypes.h:901
dsSupportedTvResolutions
dsError_t dsSupportedTvResolutions(intptr_t handle, int *resolutions)
To find the TV supported resolutions.
Definition: dsVideoPort.c:627
device::DSConstant::getName
virtual const std::string & getName() const
This function is used to the get the data member name.
Definition: dsConstant.hpp:141
dsSetResolution
dsError_t dsSetResolution(intptr_t handle, dsVideoPortResolution_t *resolution, bool persist)
Set video port's display resolution.
Definition: dsVideoPort.c:409
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
device::VideoOutputPort::ResetOutputToSDR
void ResetOutputToSDR()
This API is used to reset the video output to SDR if it is HDR.
Definition: videoOutputPort.cpp:858
dsGetHDCPReceiverProtocol
dsError_t dsGetHDCPReceiverProtocol(intptr_t handle, dsHdcpProtocolVersion_t *protocolVersion)
Get Receiver/TV HDCP protocol version.
Definition: dsVideoPort.c:200
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
dsHDRStandard_t
enum _dsHDRStandard_t dsHDRStandard_t
_dsVideoPortResolution_t
Structure that defines video port resolution settings of output video device.
Definition: dsTypes.h:642
device::UnsupportedOperationException
This class extends Exception class to manage unsupported operations in devicesettings.
Definition: unsupportedOperationException.hpp:50
device::Exception
This class handles exceptions occurring in DS module.
Definition: exception.hpp:52
dsIsVideoPortActive
dsError_t dsIsVideoPortActive(intptr_t handle, bool *active)
This function is used to indicate whether a video port is connected to a display.
Definition: dsVideoPort.c:577
device::VideoOutputPort::getAudioOutputPort
AudioOutputPort & getAudioOutputPort()
This API is used to get the audio output port connected to the video output port. This connection is ...
Definition: videoOutputPort.cpp:280
device::VideoOutputPort::Display::getSurroundMode
int getSurroundMode() const
This function returns surround mode supported by connected display.
Definition: videoOutputPort.cpp:633
device::VideoOutputPort::Display::_manufacturerYear
int _manufacturerYear
Year of manufacture of the EDID video display device.
Definition: videoOutputPort.hpp:85
device::VideoOutputPort::SetHdmiPreference
bool SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol)
This API is used to set the Preferred HDMI Protocol.
Definition: videoOutputPort.cpp:883
device::VideoOutputPort::Display::_manufacturerWeek
int _manufacturerWeek
Week of manufacture of the EDID video display device.
Definition: videoOutputPort.hpp:86
_dsDisplayEDID_t::productCode
int32_t productCode
Definition: dsTypes.h:902
_dsVideoPortResolution_t::name
char name[32]
Definition: dsTypes.h:643
device::VideoOutputPort::setResolution
void setResolution(const std::string &resolution, bool persist=true, bool isIgnoreEdid=false)
This API is used to set the output resolution of the port by ID or its Name. The specified resolution...
Definition: videoOutputPort.cpp:457
device::VideoOutputPort::Display::~Display
virtual ~Display()
This function is a default destructor of class Display.
Definition: videoOutputPort.cpp:738
device::VideoOutputPort::Display::getEDIDBytes
void getEDIDBytes(std::vector< uint8_t > &edid) const
This function is used to get the EDID information of the connected video display. After it gets the E...
Definition: videoOutputPort.cpp:673
dsGetResolution
dsError_t dsGetResolution(intptr_t handle, dsVideoPortResolution_t *resolution)
Get the video display resolution.
Definition: dsVideoPort.c:353
device::VideoOutputPort::enable
void enable()
This API is used to enable the video output port.
Definition: videoOutputPort.cpp:552
dsSetScartParameter
dsError_t dsSetScartParameter(intptr_t handle, const char *parameter_str, const char *value_str)
Sets various SCART parameters.
Definition: dsVideoPort.c:380
dsGetQuantizationRange
dsError_t dsGetQuantizationRange(intptr_t handle, dsDisplayQuantizationRange_t *quantization_range)
Get quatization range.
Definition: dsVideoPort.c:912
dsIsDisplayConnected
dsError_t dsIsDisplayConnected(intptr_t handle, bool *connected)
Indicate whether a video port is connected to a display.
Definition: dsVideoPort.c:245
_dsDisplayEDID_t::physicalAddressB
uint8_t physicalAddressB
Definition: dsTypes.h:909
device::VideoOutputPort::_displayConnected
bool _displayConnected
Method variable to check whether the video display is connected or not.
Definition: videoOutputPort.hpp:69
device::VideoOutputPort::Display
Definition: videoOutputPort.hpp:80
dsGetHDCPCurrentProtocol
dsError_t dsGetHDCPCurrentProtocol(intptr_t handle, dsHdcpProtocolVersion_t *protocolVersion)
Get current used HDCP protocol version.
Definition: dsVideoPort.c:223
dsERR_OPERATION_NOT_SUPPORTED
@ dsERR_OPERATION_NOT_SUPPORTED
Definition: dsError.h:89
audioOutputPortType.hpp
It contain variables,stuctures,class and functions referenced by audiooutputportType code.
_dsDisplayEDID_t::isRepeater
bool isRepeater
Definition: dsTypes.h:907
device::VideoOutputPort::Display::_physicalAddressA
uint8_t _physicalAddressA
Physical Address for HDMI node A.
Definition: videoOutputPort.hpp:91
device::VideoOutputPortType
Class extending DSConstant to implement the VideoOutputporttype interface.
Definition: videoOutputPortType.hpp:59
device::IllegalArgumentException
This class extends Exception class to manage the expections caused due to illegal arguments.
Definition: illegalArgumentException.hpp:51
_dsVideoPortResolution_t::frameRate
dsVideoFrameRate_t frameRate
Definition: dsTypes.h:647
dsVideoStereoScopicMode_t
enum _dsVideoStereoScopicMode_t dsVideoStereoScopicMode_t
dsGetSurroundMode
dsError_t dsGetSurroundMode(intptr_t handle, int *surround)
This function is used to get supported surround mode.
Definition: dsVideoPort.c:301
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
_dsDisplayEDID_t::physicalAddressD
uint8_t physicalAddressD
Definition: dsTypes.h:911
device::VideoResolution::getAspectRatio
const AspectRatio & getAspectRatio() const
This API is used to get the current Aspect Ratio setting of the Display Device (i....
Definition: videoResolution.cpp:149
dsERR_INVALID_PARAM
@ dsERR_INVALID_PARAM
Definition: dsError.h:87
unsupportedOperationException.hpp
This file defines UnsupportedOperationException class.
Exception
Definition: Exception.hpp:42
device::VideoOutputPort::GetHdmiPreference
int GetHdmiPreference()
This API is used to get the HDMI Preference.
Definition: videoOutputPort.cpp:904
dsGetVideoEOTF
dsError_t dsGetVideoEOTF(intptr_t handle, dsHDRStandard_t *video_eotf)
Get current video Electro-Optical Transfer Function (EOT) value;.
Definition: dsVideoPort.c:796
dsError_t
dsError_t
Device Settings API Error return codes.
Definition: dsError.h:84
dsSetPreferredColorDepth
dsError_t dsSetPreferredColorDepth(intptr_t handle, dsDisplayColorDepth_t colorDepth, bool persist)
To set the preffered color depth mode.
Definition: dsVideoPort.c:463
_dsDisplayEDID_t::serialNumber
int32_t serialNumber
Definition: dsTypes.h:903
device::DSConstant::getId
virtual int getId() const
This function is used to get the id.
Definition: dsConstant.hpp:130
dsResetOutputToSDR
dsError_t dsResetOutputToSDR()
Reset Video Output to SDR.
Definition: dsVideoPort.c:721
device::VideoOutputPort::disable
void disable()
This API is used to disable the Audio output port.
Definition: videoOutputPort.cpp:567
dsGetVideoPort
dsError_t dsGetVideoPort(dsVideoPortType_t type, int index, intptr_t *handle)
Get the video port handle.
Definition: dsVideoPort.c:64
_dsVideoPortResolution_t::interlaced
bool interlaced
Definition: dsTypes.h:648