RDK Documentation (Open Sourced RDK Components)
audioOutputPort.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 "audioEncoding.hpp"
31 #include "audioCompression.hpp"
32 #include "audioStereoMode.hpp"
33 #include "audioOutputPort.hpp"
34 #include "audioOutputPortType.hpp"
35 #include "audioOutputPortConfig.hpp"
36 #include "videoOutputPortConfig.hpp"
37 #include "videoOutputPort.hpp"
38 #include "illegalArgumentException.hpp"
39 #include "list.hpp"
40 #include <sstream>
41 #include <string>
42 #include <string.h>
43 #include <list>
44 #include <unistd.h>
45 #include "dsAudio.h"
46 #include "dsError.h"
47 #include "dslogger.h"
48 #include "hdmiIn.hpp"
49 
50 /**
51  * @file audioOutputPort.cpp
52  * @brief AudioOutputPort objects are instantiated by the Device Settings module upon initialization.
53  * Applications do not need to create any such objects on its own.
54  * References to these objects can be retrieved by applications via the VideoOutputPort
55  * connected to the AudioOutputPort: VideoOutputPort::getAudioOutputPort()
56  */
57 
58 extern dsError_t dsSetStereoMode(intptr_t handle, dsAudioStereoMode_t mode, bool isPersist);
59 extern dsError_t dsSetStereoAuto(intptr_t handle, int autoMode, bool isPersist);
60 extern dsError_t dsGetStereoMode(intptr_t handle, dsAudioStereoMode_t *stereoMode, bool isPersist);
61 extern dsError_t dsEnableAudioPort(intptr_t handle, bool enabled, const char* portName);
62 
63 extern dsError_t dsGetEnablePersist(intptr_t handle, const char* portName, bool* enabled);
64 extern dsError_t dsSetEnablePersist(intptr_t handle, const char* portName, bool enabled);
65 
66 namespace device {
67 
68 const uint32_t audioDelayMsMax = 300;
69 const uint32_t audioDelayOffsetMsMax = 200;
70 
71 /**
72  * @addtogroup dssettingsaudoutportapi
73  * @{
74  */
75 /**
76  * @fn AudioOutputPort::getInstance(int id)
77  * @brief This API is used to get the instance of the audio output port based on the port id returned by the getsupported audiooutput port.
78  *
79  * @param[in] id Port id
80  *
81  * @return Reference to the instance of the port id
82  */
84 {
85  return AudioOutputPortConfig::getInstance().getPort(id);
86 }
87 
88 
89 /**
90  * @fn AudioOutputPort::getInstance(const std::string &name)
91  * @brief This API is used to get the instance of the audio output port based on the port name returned by the getsupported audiooutput port.
92  *
93  * @param[in] name Name of the port
94  *
95  * @return Reference to the instance of the name of the port
96  */
98 {
99  return AudioOutputPortConfig::getInstance().getPort(name);
100 
101 }
102 
103 
104 /**
105  * @fn AudioOutputPort::AudioOutputPort(const int type, const int index, const int id)
106  * @brief This function is a default constructor for AudioOutputPort. It initialises the data members
107  * of AudioOutputPort instance with the parameters passed. It also gets the handle for the type of
108  * Audio port requested and updates the audio compression technique, type of encoding, stereo mode,
109  * audio gain, audio level, optimal audio level, maximum and minimum DB that is supported and current
110  * audio DB.
111  *
112  * @param[in] type Type of audio output port [HDMI,SPDIF]
113  * @param[in] index Index of audio output port (0,1,...)
114  * @param[in] id Audiooutput port id.
115  *
116  * @return None
117  */
118 AudioOutputPort::AudioOutputPort(const int type, const int index, const int id) :
119  _type(type), _index(index), _id(id),
120  _handle(-1), _encoding(AudioEncoding::kNone),
121  _stereoMode(AudioStereoMode::kStereo), _stereoAuto(false),
122  _gain(0.0), _db(0.0), _maxDb(0.0), _minDb(0.0), _optimalLevel(0.0),
123  _level(0.0), _loopThru(false), _muted(false), _audioDelayMs(0), _audioDelayOffsetMs(0)
124 {
125  dsError_t ret = dsERR_NONE;
126  ret = dsGetAudioPort((dsAudioPortType_t)_type, _index, &_handle);
127  {
128  /* Construct Port Name as "Type+Index", such as "HDMI0" */
129  std::stringstream out;
130  out << getType().getName() << _index;
131  _name = out.str();
132  }
133  printf ("\nAudioOutputPort init: _type:%d _index:%d _handle:%d\n", _type, _index, _handle);
134  if (dsERR_NONE == ret) {
135  //dsGetAudioCompression (_handle, (dsAudioCompression_t *)&_compression);
137  dsGetStereoMode (_handle, (dsAudioStereoMode_t *)&_stereoMode, false);
138  dsGetAudioGain (_handle, &_gain);
139  dsGetAudioLevel (_handle, &_level);
141  dsGetAudioMaxDB (_handle, &_maxDb);
142  dsGetAudioMinDB (_handle, &_minDb);
143  dsGetAudioDB (_handle, &_db);
144  dsIsAudioLoopThru (_handle, &_loopThru);
145  dsIsAudioMute (_handle, &_muted);
146  dsGetAudioDelay (_handle, &_audioDelayMs);
148  }
149 }
150 
151 
152 /**
153  * @fn AudioOutputPort::~AudioOutputPort()
154  * @brief This is a default destructor of class AudioOutputPort.
155  *
156  * @return None.
157  */
159 {
160 
161 }
162 
163 /**
164 * @fn AudioOutputPort::reInitializeAudioOutputPort()
165 * @brief This API is used to reInitialize AudioOutputPort in case when
166 * Constructor miss out
167 * the Audio output port.
168 *
169 * @return None
170 */
172 {
173  dsError_t ret = dsERR_NONE;
174  if( _handle == -1)
175  {
176  ret = dsGetAudioPort((dsAudioPortType_t)_type, _index, &_handle);
177  {
178  /* Construct Port Name as "Type+Index", such as "HDMI0" */
179  std::stringstream out;
180  out << getType().getName() << _index;
181  _name = out.str();
182  }
183 
184  printf ("\nAudioOutputPort init: _type:%d _index:%d _handle:%d\n", _type, _index, _handle);
185  if (dsERR_NONE == ret) {
186  //dsGetAudioCompression>(_handle, (dsAudioCompression_t *)&_compression);
188  dsGetStereoMode(_handle, (dsAudioStereoMode_t *)&_stereoMode, false);
189  dsGetAudioGain(_handle, &_gain);
190  dsGetAudioLevel(_handle, &_level);
192  dsGetAudioMaxDB(_handle, &_maxDb);
193  dsGetAudioMinDB(_handle, &_minDb);
194  dsGetAudioDB(_handle, &_db);
195  dsIsAudioLoopThru(_handle, &_loopThru);
196  dsIsAudioMute(_handle, &_muted);
197  dsGetAudioDelay(_handle, &_audioDelayMs);
199  }
200 
201 
202  }
203  return ret;
204 }
205 
206 /**
207  * @fn const AudioOutputPortType & AudioOutputPort::getType() const
208  * @brief This API is used to get the type of the audio output port. The type of audio output port represent the general capabilities of the port.
209  *
210  * @return An instance to the type of the audio output port
211  */
213 {
214  return AudioOutputPortConfig::getInstance().getPortType(_type);
215 }
216 
217 
218 /**
219  * @fn const List<AudioEncoding> AudioOutputPort::getSupportedEncodings() const
220  * @brief This API is used to get the list of audio encodings supported by the port.
221  *
222  * @return A list of audio encodings supported
223  */
225 {
227 }
228 
229 
230 /**
231  * @fn const List<AudioCompression> AudioOutputPort::getSupportedCompressions() const
232  * @brief This API is used to get the list of audio compressions supported by the port.
233  *
234  * @return A list of audio compressions supported
235  */
237 {
239 }
240 
241 
242 /**
243  * @fn const List<AudioStereoMode> AudioOutputPort::getSupportedStereoModes() const
244  * @breif This API is used to get the list of audio stereo modes supported by the port.
245  *
246  * @return A list of stereo modes supported
247  */
249 {
251 }
252 
253 
254 /**
255  * @fn const AudioEncoding & AudioOutputPort::getEncoding() const
256  * @brief This API is used to get the current encoding of the output port.
257  *
258  * @return Current audio encoding
259  */
261 {
264 }
265 
266 
267 /**
268  * @fn const AudioStereoMode & AudioOutputPort::getStereoMode()
269  * @brief This API is used to get the current stereo mode of the output port.
270  *
271  * @return Current audio stereo mode
272  */
274 {
275  std::cout << "AudioOutputPort::getStereoMode from " << (usePersist ? "persistence" : "effective") << std::endl;
276  int _localmode = 0;
277  dsGetStereoMode(_handle, (dsAudioStereoMode_t *)&_localmode, usePersist);
278  _stereoMode = _localmode;
280 }
281 
282 /**
283 * @fn AudioOutputPort::setEnablePort()
284 * @brief This API is used to enable and disable
285 * the Audio output port.
286 *
287 * @return None
288 */
290 {
291  dsError_t ret = dsEnableAudioPort(_handle, enabled, _name.c_str());
292  if (ret != dsERR_NONE) {
293  throw Exception(ret);
294  }
295  return ret;
296 }
297 
298 /**
299  * @fn AudioOutputPort::enable()
300  * @brief This API is used to enable the Audio output port.
301  *
302  * @return None
303  */
305 {
306  dsError_t ret = dsEnableAudioPort(_handle, true, _name.c_str());
307  if (ret != dsERR_NONE) {
308  throw Exception(ret);
309  }
310 }
311 
312 
313 /**
314  * @fn VideoOutputPort::disable()
315  * @brief This API is used to disable the Audio output port.
316  *
317  * @return None
318  */
319 void AudioOutputPort::disable()
320 {
321  dsError_t ret = dsEnableAudioPort(_handle, false, _name.c_str());
322  if (ret != dsERR_NONE) {
323  throw Exception(ret);
324  }
325 }
326 
327 /**
328  * @fn bool AudioOutputPort::getEnablePersist const
329  * @brief This API is used to check the audio port enable
330  * persist value
331  *
332  * @return True or False
333  * @retval 1 when output is enabled
334  * @retval 0 When output is disabled
335  */
336 bool AudioOutputPort::getEnablePersist () const
337 {
338  //By default all ports are enabled.
339  bool isEnabled = true;
340  dsError_t ret = dsGetEnablePersist (_handle, _name.c_str(), &isEnabled);
341  printf ("AudioOutputPort::getEnablePersist portName: %s ret:%04x isEnabled: %d\n",
342  _name.c_str(), ret, isEnabled);
343  if (ret != dsERR_NONE) {
344  throw Exception(ret);
345  }
346  return isEnabled;
347 }
348 
349 /**
350  * @fn bool AudioOutputPort::setEnablePersist const
351  * @brief This API is used to set the audio port enable
352  * persist value
353  *
354  * @return void
355  */
356 void AudioOutputPort::setEnablePersist (bool isEnabled)
357 {
358  dsError_t ret = dsSetEnablePersist (_handle, _name.c_str(), isEnabled);
359  if (ret != dsERR_NONE) {
360  throw Exception(ret);
361  }
362  return;
363 }
364 
365 
366 /**
367  * @fn const int AudioOutputPort::getStereoAuto()
368  * @brief This API is used to get the current auto mode.
369  *
370  * @return Current audio stereo mode
371  */
373 {
374  int _localmode = 0;
375  dsGetStereoAuto (_handle, &_localmode);
376  _stereoAuto = (_localmode);
377  return _stereoAuto;
378 }
379 
380 /**
381  * @fn float AudioOutputPort::getGain() const
382  * @brief This API will get the current Gain for the given audio output port.
383  *
384  * @return Current gain value in a given Audio output port
385  */
387 {
388  dsError_t ret = dsERR_NONE;
389  float gain = 0;
390  ret = dsGetAudioGain(_handle, &gain);
391  if (ret == dsERR_NONE)
392  {
393  return gain;
394  }
395  else
396  {
397  throw Exception(ret);
398  }
399 }
400 
401 
402 /**
403  * @fn float AudioOutputPort::getDB() const
404  * @brief This API will get the current Decibel value for the given Audio port.
405  *
406  * @return Current Decibel value in a given Audio port
407  */
409 {
410  return _db;
411 }
412 
413 
414 /**
415  * @fn float AudioOutputPort::getMaxDB() const
416  * @brief This API is used to get the current Maximum decibel that Audio output port can support.
417  *
418  * @return Current maximum decibel for the given audio output port
419  */
421 {
422  return _maxDb;
423 }
424 
425 
426 /**
427  * @fn float AudioOutputPort::getMinDB() const
428  * @brief This API is used to get the current minimum decibel that Audio output port can support.
429  *
430  * @return Current minimum decibel value for the given audio output port
431  */
433 {
434  return _minDb;
435 }
436 
437 
438 /**
439  * @fn float AudioOutputPort::getOptimalLevel() const
440  * @brief This API is used to get the current optimal level value for audio output port.
441  *
442  * @return Current optimal level for the given audio output port
443  */
445 {
446  return _optimalLevel;
447 }
448 
449 /**
450  * @fn bool AudioOutputPort::getAudioDelay(uint32_t& audioDelayMs) const
451  * @brief This API is used to get the current audio delay in milliseconds for audio output port.
452  *
453  * @return true if call succeded, false otherwise
454  */
455 bool AudioOutputPort::getAudioDelay(uint32_t& audioDelayMs) const
456 {
457  dsError_t ret = dsERR_NONE;
458  ret = dsGetAudioDelay(_handle, &audioDelayMs);
459  if (ret != dsERR_NONE)
460  {
461  throw Exception(ret);
462  }
463 
464  return true;
465 }
466 
467 /**
468  * @fn bool AudioOutputPort::getAudioDelayOffset(uint32_t& audioDelayOffsetMs) const
469  * @brief This API is used to get the current audio delay offset in milliseconds for audio output port.
470  *
471  * @return true if call succeded, false otherwise
472  */
473 bool AudioOutputPort::getAudioDelayOffset(uint32_t& audioDelayOffsetMs) const
474 {
475  dsError_t ret = dsERR_NONE;
476  ret = dsGetAudioDelayOffset(_handle, &audioDelayOffsetMs);
477  if (ret != dsERR_NONE)
478  {
479  throw Exception(ret);
480  }
481 
482  return true;
483 }
484 
485 
486 /**
487  * @fn float AudioOutputPort::getLevel() const
488  * @brief This API is used to get the current audio level for the given audio output port.
489  *
490  * @return Current Audio Level for the given audio output port
491  */
493  dsError_t ret = dsERR_NONE;
494  float level = 0;
495  if ((ret = dsGetAudioLevel(_handle, &level)) == dsERR_NONE)
496  {
497  return level;
498  }
499  else
500  {
501  throw Exception(ret);
502  }
503 }
504 
505 
506 /**
507  * @fn bool AudioOutputPort::isLoopThru() const
508  * @brief This API is used to check whether the given audio port is configured for loop thro'.
509  *
510  * @return TRUE or FALSE
511  * @retval 1 when output is loop thru
512  * @retval 0 When output is not loop thru
513  */
516 
517  if (ret != dsERR_NONE) throw Exception(ret);
518 
519 }
520 
521 
522 /**
523  * @fn bool AudioOutputPort::isMuted() const
524  * @brief This API is used to check whether the audio is muted or not
525  *
526  * @return True or False
527  * @retval 1 when output is muted
528  * @retval 0 When output is not muted
529  */
531 {
532  bool muted = false;
533  dsError_t ret = dsIsAudioMute(_handle, &muted);
534  if (ret != dsERR_NONE) {
535  throw Exception(ret);
536  }
537  return muted;
538 }
539 
540 
541 /**
542  * @fn bool AudioOutputPort::isEnabled() const
543  * @brief This API is used to check whether the audio is enabled or not
544  *
545  * @return True or False
546  * @retval 1 when output is enabled
547  * @retval 0 When output is disbaled
548  */
550 {
551  bool enabled = false;
552 
553  dsError_t ret = dsIsAudioPortEnabled(_handle, &enabled);
554  if (ret != dsERR_NONE) {
555  throw Exception(ret);
556  }
557  return enabled;
558 }
559 
560 /**
561  * @fn bool AudioOutputPort::isConnected() const
562  * @brief This API is used to check whether the audio output
563  * port is connected to a sink device or not.
564  *
565  * Optical/SPDIF port or any analog port is considered
566  * "Always connected". HDMI port depends on actual connectivity.
567  *
568  * @return True or False
569  * @retval 1 when output is connected
570  * @retval 0 When output is not connected
571  */
573 {
574  if (_type == dsAUDIOPORT_TYPE_HDMI) {
575  return device::VideoOutputPortConfig::getInstance().getPort("HDMI0").isDisplayConnected();
576  }
577  else if (dsAUDIOPORT_TYPE_HDMI_ARC == _type) {
578  /*get the ARC/eARC port Id*/
579  int portId = -1;
580  dsError_t ret = dsGetHDMIARCPortId(&portId);
581  if (ret != dsERR_NONE) {
582  throw Exception(ret);
583  }
585  }
586  else if (dsAUDIOPORT_TYPE_HEADPHONE == _type) {
587  bool isConn = true;
588  dsAudioOutIsConnected(_handle, &isConn);
589  printf ("AudioOutputPort::isConnected dsAUDIOPORT_TYPE_HEADPHONE isConn:%d\n", isConn);
590  return isConn;
591  }
592  else {
593  return true;
594  }
595 }
596 
597 /**
598  * @fn AudioOutputPort::setEncoding(const int newEncoding)
599  * @brief This API is used to set the Encoding method in a given audio port.
600  *
601  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
602  * it will pass the message as "No message for this exception".
603  *
604  * @param[in] newEncoding Type of Encoding method for the given Audio Output port.
605  *
606  * @return None
607  */
608 void AudioOutputPort::setEncoding(const int newEncoding)
609 {
610  dsError_t ret = dsERR_NONE;
611 
612 #if 0
613  if ( (ret = dsSetAudioEncoding(_handle, (dsAudioEncoding_t)newEncoding)) == dsERR_NONE) {
614  _encoding = (int)newEncoding;
615  }
616 
617  if (ret != dsERR_NONE) throw Exception(ret);
618 #endif
619  throw Exception("Operation not Supported");
620 }
621 
622 
623 /**
624  * @fn AudioOutputPort::setEncoding(const std::string &newEncoding)
625  * @brief This API is used to set the Encoding method in a given audio port.
626  *
627  * @param[in] newEncoding Type of Encoding method for the given Audio Output port.
628  *
629  * @return None
630  */
631 void AudioOutputPort::setEncoding(const std::string &newEncoding)
632 {
633  setEncoding(AudioEncoding::getInstance(newEncoding).getId());
634 }
635 
636 
637 /**
638  * @fn AudioOutputPort::setCompression(const int newCompression)
639  * @brief This API is used to set the compression mode in a given audio port.
640  *
641  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
642  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
643  *
644  * @param[in] newCompression Type of Compression mode for the given audio Output port.
645  *
646  * @return None
647  */
648 void AudioOutputPort::setCompression(const int newCompression)
649 {
650  dsError_t ret = dsERR_NONE;
651 
652  if ( (ret = dsSetAudioCompression(_handle, newCompression)) == dsERR_NONE) {
653  }
654 
655  if (ret != dsERR_NONE) throw Exception(ret);
656 }
657 
658 /**
659  * @fn AudioOutputPort::setDialogEnhancement(const int level)
660  * @brief This API is used to set the compression mode in a given audio port.
661  *
662  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
663  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
664  *
665  * @param[in] newCompression Type of Compression mode for the given audio Output port.
666  *
667  * @return None
668  */
670 {
671  dsError_t ret = dsERR_NONE;
672 
673  if ( (ret = dsSetDialogEnhancement(_handle, level)) == dsERR_NONE) {
674  }
675  else
676  {
677  throw Exception(ret);
678  }
679 }
680 
681 /**
682  * @fn AudioOutputPort::setDolbyVolumeMode(const bool mode)
683  * @brief This API is used to set the compression mode in a given audio port.
684  *
685  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
686  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
687  *
688  * @param[in] newCompression Type of Compression mode for the given audio Output port.
689  *
690  * @return None
691  */
693 {
694  dsError_t ret = dsERR_NONE;
695 
696  if ( (ret = dsSetDolbyVolumeMode(_handle, mode)) == dsERR_NONE) {
697  }
698  else
699  {
700  throw Exception(ret);
701  }
702 }
703 
704 /**
705  * @fn AudioOutputPort::setIntelligentEqualizerMode(const int level)
706  * @brief This API is used to set the compression mode in a given audio port.
707  *
708  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
709  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
710  *
711  * @param[in] newCompression Type of Compression mode for the given audio Output port.
712  *
713  * @return None
714  */
716 {
717  dsError_t ret = dsERR_NONE;
718 
719  if ( (ret = dsSetIntelligentEqualizerMode(_handle, mode)) == dsERR_NONE) {
720  }
721  else
722  {
723  throw Exception(ret);
724  }
725 }
726 
727 /**
728  * @fn AudioOutputPort::setVolumeLeveller(const dsVolumeLeveller_t volLeveller)
729  * @brief This API is used to set the volume leveller mode & amount for a given audio port.
730  *
731  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
732  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
733  *
734  * @param[in] dsVolumeLeveller_t for the given audio Output port.
735  *
736  * @return None
737  */
739 {
740  dsError_t ret = dsERR_NONE;
741 
742  if ( (ret = dsSetVolumeLeveller(_handle, volLeveller)) == dsERR_NONE) {
743  }
744  else
745  {
746  throw Exception(ret);
747  }
748 }
749 
750 /**
751  * @fn AudioOutputPort::setBassEnhancer(const int boost)
752  * @brief This API is used to adjust the Bass in a given audio port.
753  *
754  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
755  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
756  *
757  * @param[in] bass boost value for the given audio Output port.
758  *
759  * @return None
760  */
761 void AudioOutputPort::setBassEnhancer(const int boost)
762 {
763  dsError_t ret = dsERR_NONE;
764 
765  if ( (ret = dsSetBassEnhancer(_handle, boost)) == dsERR_NONE) {
766  }
767  else
768  {
769  throw Exception(ret);
770  }
771 }
772 
773 /**
774  * @fn AudioOutputPort::enableSurroundDecoder(const bool enable)
775  * @brief This API is used to enable/disable surround decoder in a given audio port.
776  *
777  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
778  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
779  *
780  * @param[in] enable/disable surround decoder for the given audio Output port.
781  *
782  * @return None
783  */
785 {
786  dsError_t ret = dsERR_NONE;
787 
788  if ( (ret = dsEnableSurroundDecoder(_handle, enable)) == dsERR_NONE) {
789  }
790  else
791  {
792  throw Exception(ret);
793  }
794 }
795 
796 /**
797  * @fn AudioOutputPort::setDRCMode(const int mode)
798  * @brief This API is used to set the Dynamic Range control mode in a given audio port.
799  *
800  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
801  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
802  *
803  * @param[in] dynamic range control mode for the given audio Output port.
804  *
805  * @return None
806  */
807 void AudioOutputPort::setDRCMode(const int mode)
808 {
809  dsError_t ret = dsERR_NONE;
810 
811  if ( (ret = dsSetDRCMode(_handle, mode)) == dsERR_NONE) {
812  }
813  else
814  {
815  throw Exception(ret);
816  }
817 }
818 
819 /**
820  * @fn AudioOutputPort::setSurroundVirtualizer(const dsSurroundVirtualizer_t virtualizer)
821  * @brief This API is used to set the surround virtualizer mode and boost value for a given audio port.
822  *
823  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
824  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
825  *
826  * @param[in] dsSurroundVirtualizer_t value for the given audio Output port.
827  *
828  * @return None
829  */
831 {
832  dsError_t ret = dsERR_NONE;
833 
834  if ( (ret = dsSetSurroundVirtualizer(_handle, virtualizer)) == dsERR_NONE) {
835  }
836  else
837  {
838  throw Exception(ret);
839  }
840 }
841 
842 /**
843  * @fn AudioOutputPort::setMISteering(const bool enable)
844  * @brief This API is used to enable/disable the Media Intelligent Steering in a given audio port.
845  *
846  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
847  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
848  *
849  * @param[in] enable/disable MI Steering for the given audio Output port.
850  *
851  * @return None
852  */
853 void AudioOutputPort::setMISteering(const bool enable)
854 {
855  dsError_t ret = dsERR_NONE;
856 
857  if ( (ret = dsSetMISteering(_handle, enable)) == dsERR_NONE) {
858  }
859  else
860  {
861  throw Exception(ret);
862  }
863 }
864 
865 /**
866  * @fn const AudioCompression & AudioOutputPort::getCompression() const
867  * @brief This API is used to get the current compression of the output port.
868  *
869  * @return Current audio compression
870  */
872 {
873  dsError_t ret = dsERR_NONE;
874  int _compression = 0;
875  if ( (ret = dsGetAudioCompression(_handle, &_compression)) == dsERR_NONE)
876  {
877  return _compression;
878  }
879  else
880  {
881  throw Exception(ret);
882  }
883 }
884 
885 /**
886  * @fn const int AudioOutputPort::getDialogEnhancement()
887  * @brief This API is used to get the current auto mode.
888  *
889  * @return Current audio stereo mode
890  */
892 {
893  dsError_t ret = dsERR_NONE;
894  int _enhancerLevel = 0;
895  if ((ret = dsGetDialogEnhancement(_handle, &_enhancerLevel)) == dsERR_NONE)
896  {
897  return _enhancerLevel;
898  }
899  else
900  {
901  throw Exception(ret);
902  }
903 }
904 
905 /**
906  * @fn bool AudioOutputPort::getDolbyVolumeMode()
907  * @brief This API is used to get the current auto mode.
908  *
909  * @return Current audio stereo mode
910  */
912 {
913  dsError_t ret = dsERR_NONE;
914  bool _mode = 0;
915  if ( (ret = dsGetDolbyVolumeMode(_handle, &_mode)) == dsERR_NONE)
916  {
917  return _mode;
918  }
919  else
920  {
921  throw Exception(ret);
922  }
923 }
924 
925 /**
926  * @fn const int AudioOutputPort::getDialogEnhancement()
927  * @brief This API is used to get the current auto mode.
928  *
929  * @return Current audio stereo mode
930  */
931 int AudioOutputPort::getIntelligentEqualizerMode() const
932 {
933  dsError_t ret = dsERR_NONE;
934  int _mode = 0;
935  if ((ret = dsGetIntelligentEqualizerMode(_handle, &_mode)) == dsERR_NONE)
936  {
937  return _mode;
938  }
939  else
940  {
941  throw Exception(ret);
942  }
943 }
944 
945 
946 /**
947  * @fn const dsVolumeLeveller_t AudioOutputPort::getVolumeLeveller()
948  * @brief This API is used to get the current volume leveller value.
949  *
950  * @return Current audio volume leveller settings
951  */
953 {
954  dsError_t ret = dsERR_NONE;
955  dsVolumeLeveller_t _volLeveller;
956  _volLeveller.mode = 0;
957  _volLeveller.level = 0;
958  if ((ret = dsGetVolumeLeveller(_handle, &_volLeveller)) == dsERR_NONE)
959  {
960  return _volLeveller;
961  }
962  else
963  {
964  throw Exception(ret);
965  }
966 }
967 
968 
969 /**
970  * @fn int AudioOutputPort::getBassEnhancer()
971  * @brief This API is used to get the Bass Enhancer boost value
972  *
973  * @return Current audio bass value
974  */
976 {
977  dsError_t ret = dsERR_NONE;
978  int _boost = 0;
979  if ( (ret = dsGetBassEnhancer(_handle, &_boost)) == dsERR_NONE)
980  {
981  return _boost;
982  }
983  else
984  {
985  throw Exception(ret);
986  }
987 }
988 
989 /**
990  * @fn bool AudioOutputPort::isSurroundDecoderEnabled()
991  * @brief This API is used to get status of surround decoder
992  *
993  * @return Current status of surround decoder
994  */
996 {
997  dsError_t ret = dsERR_NONE;
998  bool _enable = 0;
999  if ( (ret = dsIsSurroundDecoderEnabled(_handle, &_enable)) == dsERR_NONE)
1000  {
1001  return _enable;
1002  }
1003  else
1004  {
1005  throw Exception(ret);
1006  }
1007 }
1008 
1009 /**
1010  * @fn const int AudioOutputPort::getDRCMode()
1011  * @brief This API is used to get the Dynamic Range Control mode
1012  *
1013  * @return Current Dynamic Range control mode (line => 0, RF => 1)
1014  */
1016 {
1017  dsError_t ret = dsERR_NONE;
1018  int _mode = 0;
1019  if ((ret = dsGetDRCMode(_handle, &_mode)) == dsERR_NONE)
1020  {
1021  return _mode;
1022  }
1023  else
1024  {
1025  throw Exception(ret);
1026  }
1027 }
1028 
1029 /**
1030  * @fn const dsSurroundVirtualizer_t AudioOutputPort::getSurroundVirtualizer()
1031  * @brief This API is used to get the Surround Virtualizer Boost value
1032  *
1033  * @return Current Surround Virtualizer settings
1034  */
1036 {
1037  dsError_t ret = dsERR_NONE;
1038  dsSurroundVirtualizer_t _virtualizer;
1039  _virtualizer.mode = 0;
1040  _virtualizer.boost = 0;
1041  if ((ret = dsGetSurroundVirtualizer(_handle, &_virtualizer)) == dsERR_NONE)
1042  {
1043  return _virtualizer;
1044  }
1045  else
1046  {
1047  throw Exception(ret);
1048  }
1049 }
1050 
1051 /**
1052  * @fn bool AudioOutputPort::getMISteering()
1053  * @brief This API is used to get status of Media Intelligent Steering
1054  *
1055  * @return Current status of Media Intelligent Steering
1056  */
1058 {
1059  dsError_t ret = dsERR_NONE;
1060  bool _enable = 0;
1061  if ( (ret = dsGetMISteering(_handle, &_enable)) == dsERR_NONE)
1062  {
1063  return _enable;
1064  }
1065  else
1066  {
1067  throw Exception(ret);
1068  }
1069 }
1070 
1071 
1072 /**
1073  * @fn const int AudioOutputPort::getGraphicEqualizerMode()
1074  * @brief This API is used to get the current Graphical EQ mode.
1075  *
1076  * @return Current Graphical EQ mode
1077  */
1079 {
1080  dsError_t ret = dsERR_NONE;
1081  int _mode = 0;
1082  ret = dsGetGraphicEqualizerMode(_handle, &_mode);
1083  if (ret == dsERR_NONE)
1084  {
1085  return _mode;
1086  }
1087  else
1088  {
1089  throw Exception(ret);
1090  }
1091 }
1092 
1093 
1094 /**
1095  * @fn AudioOutputPort::setGraphicEqualizerMode(const int mode)
1096  * @brief This API is used to set the compression mode in a given audio port.
1097  *
1098  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1099  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1100  *
1101  * @param[in] New graphic EQ mode for the given audio Output port.
1102  *
1103  * @return None
1104  */
1106 {
1107  dsError_t ret = dsERR_NONE;
1108  ret = dsSetGraphicEqualizerMode(_handle, mode);
1109 
1110  if (ret != dsERR_NONE) {
1111  throw Exception(ret);
1112  }
1113 }
1114 
1115 
1116 /**
1117  * @fn void AudioOutputPort::getMS12AudioProfile(std::string profile)
1118  * @brief This API is used to get the current MS12 Audio profile
1119  *
1120  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1121  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1122  *
1123  * @return[string] Profile Name
1124  */
1125 const std::string AudioOutputPort::getMS12AudioProfile() const
1126 {
1127  dsError_t ret = dsERR_NONE;
1128  char ap[32] = {0};
1129  std::string profile;
1130  if ( (ret = dsGetMS12AudioProfile(_handle, ap)) == dsERR_NONE)
1131  {
1132  profile.assign(ap);
1133  }
1134  else
1135  {
1136  throw Exception(ret);
1137  }
1138 
1139  return profile;
1140 }
1141 
1142 
1143 /**
1144  * @fn AudioOutputPort::setMS12AudioProfile(std::string profile)
1145  * @brief This API is used to set MS12 Audio Profile
1146  *
1147  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1148  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1149  *
1150  * @param[string] Profile name to be set
1151  *
1152  * @return None
1153  */
1154 void AudioOutputPort::setMS12AudioProfile(std::string profile)
1155 {
1156  dsError_t ret = dsERR_NONE;
1157 
1158  if ( (ret = dsSetMS12AudioProfile(_handle, profile.c_str())) == dsERR_NONE) {
1159  }
1160  else
1161  {
1162  throw Exception(ret);
1163  }
1164 }
1165 
1166 
1167 /**
1168  * @fn std::vector<std::string> AudioOutputPort::getMS12AudioProfileList()
1169  * @brief This API is used to get the supported MS12 Audio profiles
1170  *
1171  * @return List of audio profiles
1172  */
1173 std::vector<std::string> AudioOutputPort::getMS12AudioProfileList() const
1174 {
1175  dsError_t ret = dsERR_NONE;
1176  int count = 0;
1177  int i = 0;
1178 
1179  std::vector<std::string> profileList;
1180  dsMS12AudioProfileList_t apList;
1181  ret = dsGetMS12AudioProfileList(_handle, &apList);
1182  if ( ret != dsERR_NONE)
1183  {
1184  throw Exception(ret);
1185  }
1186 
1187  char* token;
1188 
1189  token = strtok(apList.audioProfileList, ",");
1190  while(token != NULL) {
1191  profileList.push_back(token);
1192  token = strtok(NULL, ",");
1193  }
1194 
1195  if(profileList.size() != apList.audioProfileCount){
1196  std::cout << "Number of profiles in list doesn't match audio profile count from HAL" << std::endl;
1197  throw Exception(dsERR_GENERAL);
1198  }
1199 
1200  return profileList;
1201 }
1202 
1203 
1204 /**
1205  * @fn AudioOutputPort::setAssociatedAudioMixing(const bool mixing)
1206  * @brief This API is used to enable/disable Associated Audio Mixing.
1207  *
1208  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1209  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1210  *
1211  * @param[in] mixing enable/disable Associated Audio Mixing.
1212  *
1213  * @return None
1214  */
1216 {
1217  dsError_t ret = dsERR_NONE;
1218 
1219  if ( (ret = dsSetAssociatedAudioMixing(_handle, mixing)) == dsERR_NONE) {
1220  }
1221  else
1222  {
1223  throw Exception(ret);
1224  }
1225 }
1226 
1227 
1228 
1229 /**
1230  * @fn bool AudioOutputPort::getAssociatedAudioMixing()
1231  * @brief This API is used to get status of Associated Audio Mixing
1232  *
1233  * @return Current status of Associated Audio Mixing
1234  */
1236 {
1237  dsError_t ret = dsERR_NONE;
1238  bool _mixing = false;
1239 
1240  if(mixing == NULL) {
1241  ret = dsERR_INVALID_PARAM;
1242  throw Exception(ret);
1243  }
1244 
1245  if ( (ret = dsGetAssociatedAudioMixing(_handle, &_mixing)) == dsERR_NONE)
1246  {
1247  *mixing = _mixing;
1248  }
1249  else
1250  {
1251  throw Exception(ret);
1252  }
1253 }
1254 
1255 
1256 /**
1257  * @fn AudioOutputPort::setFaderControl(const int mixerBalance)
1258  * @brief This API is used to set the mixerbalance betweeen main and associated audio
1259  *
1260  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1261  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1262  *
1263  * @param[in] New mixerbalance betweeen main and associated audio.
1264  *
1265  * @return None
1266  */
1267 void AudioOutputPort::setFaderControl(const int mixerBalance)
1268 {
1269  dsError_t ret = dsERR_NONE;
1270  ret = dsSetFaderControl(_handle, mixerBalance);
1271 
1272  if (ret != dsERR_NONE) {
1273  throw Exception(ret);
1274  }
1275 }
1276 
1277 
1278 
1279 /**
1280  * @fn void AudioOutputPort::getFaderControl(int *mixerBalance)
1281  * @brief This API is used to get the mixerbalance betweeen main and associated audio
1282  *
1283  * @return Current mixerbalance betweeen main and associated audio
1284  */
1285 void AudioOutputPort::getFaderControl(int *mixerBalance)
1286 {
1287  dsError_t ret = dsERR_NONE;
1288  int _mixerBalance = 0;
1289 
1290  if(mixerBalance == NULL) {
1291  ret = dsERR_INVALID_PARAM;
1292  throw Exception(ret);
1293  }
1294 
1295  if ( (ret = dsGetFaderControl(_handle, &_mixerBalance)) == dsERR_NONE)
1296  {
1297  *mixerBalance = _mixerBalance;
1298  }
1299  else
1300  {
1301  throw Exception(ret);
1302  }
1303 }
1304 
1305 
1306 /**
1307  * @fn AudioOutputPort::setPrimaryLanguage(const std::string pLang)
1308  * @brief This API is used to set Primary language
1309  *
1310  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1311  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1312  *
1313  * @param[string] Primary language to be set
1314  *
1315  * @return None
1316  */
1317 void AudioOutputPort::setPrimaryLanguage(const std::string pLang)
1318 {
1319  dsError_t ret = dsERR_NONE;
1320 
1321  if ( (ret = dsSetPrimaryLanguage(_handle, pLang.c_str())) == dsERR_NONE) {
1322  }
1323  else
1324  {
1325  throw Exception(ret);
1326  }
1327 }
1328 
1329 
1330 /**
1331  * @fn void AudioOutputPort::getPrimaryLanguage(std::string &pLang)
1332  * @brief This API is used to get the current Primary language
1333  *
1334  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1335  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1336  *
1337  * @return[string] Primary language
1338  */
1339 void AudioOutputPort::getPrimaryLanguage(std::string &pLang)
1340 {
1341  dsError_t ret = dsERR_NONE;
1342  char _pLang[MAX_LANGUAGE_LEN] = {0};
1343  if ( (ret = dsGetPrimaryLanguage(_handle, _pLang)) == dsERR_NONE)
1344  {
1345  pLang.assign(_pLang);
1346  }
1347  else
1348  {
1349  throw Exception(ret);
1350  }
1351 }
1352 
1353 /**
1354  * @fn AudioOutputPort::setSecondaryLanguage(const std::string sLang)
1355  * @brief This API is used to set Secondary language
1356  *
1357  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1358  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1359  *
1360  * @param[string] Secondary language to be set
1361  *
1362  * @return None
1363  */
1364 void AudioOutputPort::setSecondaryLanguage(const std::string sLang)
1365 {
1366  dsError_t ret = dsERR_NONE;
1367 
1368  if ( (ret = dsSetSecondaryLanguage(_handle, sLang.c_str())) == dsERR_NONE) {
1369  }
1370  else
1371  {
1372  throw Exception(ret);
1373  }
1374 }
1375 
1376 
1377 /**
1378  * @fn void AudioOutputPort::getSecondaryLanguage(std::string &sLang)
1379  * @brief This API is used to get the current AC4 Secondary language
1380  *
1381  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1382  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1383  *
1384  * @return[string] AC4 Secondary language
1385  */
1387 {
1388  dsError_t ret = dsERR_NONE;
1389  char _sLang[MAX_LANGUAGE_LEN] = {0};
1390  if ( (ret = dsGetSecondaryLanguage(_handle, _sLang)) == dsERR_NONE)
1391  {
1392  sLang.assign(_sLang);
1393  }
1394  else
1395  {
1396  throw Exception(ret);
1397  }
1398 }
1399 
1400 
1401 /**
1402  * @fn AudioOutputPort::setStereoMode(const int newMode,const bool toPersist)
1403  * @brief This API is used to set the stereo mode to be used in a given audio port.If toPersist is true, the setting will persist after reboots.
1404  *
1405  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1406  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1407  *
1408  * @param[in] newMode Type of stereo mode to be used for the given audio Output port.
1409  *
1410  * @return None
1411  */
1412 void AudioOutputPort::setStereoMode(const int newMode, const bool toPersist)
1413 {
1414  dsError_t ret = dsERR_GENERAL;
1415 
1416  if (AudioOutputPortType::getInstance(_type).isModeSupported(newMode))
1417  {
1418  if ( (ret = dsSetStereoMode(_handle, (dsAudioStereoMode_t)newMode,toPersist)) == dsERR_NONE) {
1419  _stereoMode = (int)newMode;
1420  }
1421  }
1422 
1423  if (ret != dsERR_NONE)
1424  throw Exception(ret);
1425 
1426 }
1427 
1428 /**
1429  * @fn AudioOutputPort::setAudioDelay(const uint32_t audioDelayMs)
1430  * @brief This API is used to set audio delay in milliseconds
1431  *
1432  * @param[in] audioDelayMs Number of milliseconds to delay the audio (0 to +250)
1433  *
1434  * @return None
1435  */
1436 void AudioOutputPort::setAudioDelay(const uint32_t audioDelayMs)
1437 {
1438  dsError_t ret = dsERR_NONE;
1439  uint32_t ms = audioDelayMs;
1440 
1441  INT_INFO("AudioOutputPort [%s], setting delay to [%lu] ms\n", _name.c_str(), audioDelayMs);
1442 
1443  if (ms > audioDelayMsMax)
1444  {
1445  INT_ERROR("AudioOutputPort [%s], delay [%lu] ms, exceeds max [%lu]. Setting Max \n",
1446  _name.c_str(),
1447  audioDelayMs,
1448  audioDelayMsMax);
1449 
1450  ms = audioDelayMsMax;
1451  }
1452 
1453  ret = dsSetAudioDelay(_handle, ms);
1454 
1455  if (ret == dsERR_NONE)
1456  {
1457  _audioDelayMs = audioDelayMs;
1458  }
1459  else
1460  {
1461  throw Exception(ret);
1462  }
1463 }
1464 
1465 /**
1466  * @fn AudioOutputPort::setAudioDelayOffset(const uint32_t audioDelayOffsetMs)
1467  * @brief This API is used to set audio delay offset in milliseconds
1468  *
1469  * @param[in] audioDelayOffsetMs Number of milliseconds to offset(additional delay) of the audio delay(0 to +200)
1470  *
1471  * @return None
1472  */
1473 void AudioOutputPort::setAudioDelayOffset(const uint32_t audioDelayOffsetMs)
1474 {
1475  dsError_t ret = dsERR_NONE;
1476  uint32_t ms = audioDelayOffsetMs;
1477 
1478  if (ms > audioDelayOffsetMsMax)
1479  {
1480  INT_ERROR("AudioOutputPort [%s], delay offset [%lu] ms, exceeds max [%lu]. Setting Max \n",
1481  _name.c_str(), audioDelayOffsetMs, audioDelayOffsetMsMax);
1482  ms = audioDelayOffsetMsMax;
1483  }
1484 
1485  ret = dsSetAudioDelayOffset(_handle, ms);
1486 
1487  if (ret == dsERR_NONE)
1488  {
1489  _audioDelayOffsetMs = audioDelayOffsetMs;
1490  }
1491  else
1492  {
1493  throw Exception(ret);
1494  }
1495 }
1496 
1497 /**
1498  * @fn AudioOutputPort::setAudioAtmosOutputMode(bool enable)
1499  * @brief
1500  *
1501  * @param[in] Enable/Disable always Atmos output mode
1502  *
1503  * @return None
1504  */
1506 {
1507  dsError_t ret = dsERR_NONE;
1508 
1509  ret = dsSetAudioAtmosOutputMode(_handle,enable);
1510 
1511  if (ret != dsERR_NONE)
1512  {
1513  throw Exception(ret);
1514  }
1515 }
1516 
1517 /**
1518  * @fn AudioOutputPort::getSinkDeviceAtmosCapability(dsATMOSCapability_t & atmosCapability)
1519  * @brief
1520  *
1521  * @param[in/out] Sink device ATMOS capability
1522  *
1523  * @return None
1524  */
1525 void AudioOutputPort::getSinkDeviceAtmosCapability(dsATMOSCapability_t & atmosCapability)
1526 {
1527  dsError_t ret = dsERR_NONE;
1528  dsATMOSCapability_t capability;
1529 
1530  ret = dsGetSinkDeviceAtmosCapability(_handle, &capability);
1531 
1532  if (ret == dsERR_NONE)
1533  {
1534  atmosCapability = capability;
1535  }
1536  else
1537  {
1538  throw Exception(ret);
1539  }
1540 }
1541 
1542 /**
1543  * @fn void AudioOutputPort::getSupportedARCTypes(int *types)
1544  * @brief This API is used to query the supported ARC types of the connected device
1545  *
1546  * @return void
1547  */
1549 {
1550  dsError_t ret = dsGetSupportedARCTypes(_handle, types);
1551  if (ret != dsERR_NONE) {
1552  throw Exception(ret);
1553  }
1554 }
1555 
1556 /**
1557  * @fn AudioOutputPort::setSAD(std::vector<int> sad_list)
1558  * @brief This function sets SAD(Short Audio Descriptor) to configure the best available
1559  * audio format to send to the ARC device from the passed SAD list
1560  *
1561  * @param[in] sad_list List of Short Audio Descriptors from the ARC device
1562  *
1563  * @return None
1564  */
1565 void AudioOutputPort::setSAD(std::vector<int> sad_list)
1566 {
1567  dsError_t ret = dsERR_NONE;
1568  dsAudioSADList_t list;
1569  list.count = sad_list.size();
1570 
1571  for(int i=0; i<sad_list.size(); i++) {
1572  list.sad[i] = sad_list[i];
1573  }
1574 
1575  ret = dsAudioSetSAD(_handle, list);
1576 
1577  if (ret != dsERR_NONE)
1578  {
1579  throw Exception(ret);
1580  }
1581 }
1582 
1583 /**
1584  * @fn AudioOutputPort::enableARC(dsAudioARCTypes_t type, bool enable)
1585  * @brief This function enables/disables ARC/EARC and routes audio to connected device
1586  *
1587  * @param[in] type ARC/eARC
1588  * @param[in] enable true/false to control feature
1589  *
1590  * @return None
1591  */
1593 {
1594  dsError_t ret = dsERR_NONE;
1595  dsAudioARCStatus_t arcStatus;
1596 
1597  arcStatus.type = type;
1598  arcStatus.status = enable;
1599 
1600  ret = dsAudioEnableARC(_handle, arcStatus);
1601 
1602  if (ret != dsERR_NONE)
1603  {
1604  throw Exception(ret);
1605  }
1606 }
1607 
1608 /**
1609  * @fn AudioOutputPort::enableLEConfig(const bool enable)
1610  * @brief This API is used to enable Loudness Equivalence *
1611  * @param[in] enable true/false to control feature.
1612  *
1613  * @return None
1614  */
1616 {
1617  dsError_t ret = dsERR_GENERAL;
1618 
1619  ret = dsEnableLEConfig(_handle, enable);
1620 
1621  if (ret != dsERR_NONE)
1622  {
1623  printf("enableLEConfig failed with ret:%d \n",ret);
1624  }
1625 
1626  return ret;
1627 }
1628 
1629 /**
1630  * @fn AudioOutputPort::GetLEConfig()
1631  * @brief This API is used to check if Loudness Equivalence is enabled or not*
1632  *
1633  * @return true if Loudness Equivalence is enabled
1634  */
1635 
1637 {
1638  bool enable;
1639  dsError_t ret = dsERR_GENERAL;
1640 
1641  ret = dsGetLEConfig(_handle, &enable);
1642  if (ret != dsERR_NONE) throw Exception(ret);
1643 
1644  if (enable == true)
1645  return true;
1646 
1647  return false;
1648 }
1649 
1650 /**
1651  * @fn AudioOutputPort::enableMS12Config(const dsMS12FEATURE_t feature,const bool enable)
1652  * @brief This API is used to enable MS12 features such as DAPV2 adn DE *
1653  * @param[in] feature enums for feature name.
1654  * @param[in] enable true/false to control feature.
1655  *
1656  * @return None
1657  */
1658 void AudioOutputPort::enableMS12Config(const dsMS12FEATURE_t feature,const bool enable)
1659 {
1660  dsError_t ret = dsERR_GENERAL;
1661 
1662  ret = dsEnableMS12Config(_handle, feature, enable);
1663 
1664  if (ret != dsERR_NONE)
1665  printf("enableMS12Config failed with ret:%d \n",ret);
1666 }
1667 
1668 /**
1669  * @fn AudioOutputPort::setStereoAuto(const bool autoMode)
1670  * @brief This API is used to set the stereo mode to be auto;
1671  *
1672  * When in auto mode, the platform tries to set the audio mode
1673  * to the best available. Use getStereoMode() to get the effecitve
1674  * mode set by platform.
1675  *
1676  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1677  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1678  *
1679  * @param[in] newMode Type of stereo mode to be used for the given audio Output port.
1680  *
1681  * @return None
1682  */
1683 void AudioOutputPort::setStereoAuto(const bool autoMode, const bool toPersist)
1684 {
1685  dsError_t ret = dsERR_NONE;
1686 
1687  if ( (ret = dsSetStereoAuto(_handle, autoMode ? 1 : 0, toPersist)) == dsERR_NONE) {
1688  _stereoAuto = (autoMode);
1689  }
1690 
1691  if (ret != dsERR_NONE) throw Exception(ret);
1692 
1693 }
1694 /**
1695  * @fn void AudioOutputPort::setStereoMode(const std::string &newMode,const bool toPersist)
1696  * @brief This function is used to set the stereo mode for the audio port.If toPersist is true, the setting will persist after reboots.
1697  *
1698  * @param[in] newMode Type of stereo mode to be used for the given audio Output port.
1699  *
1700  * @return None
1701  */
1702 void AudioOutputPort::setStereoMode(const std::string &newMode,const bool toPersist)
1703 {
1704  setStereoMode(AudioStereoMode::getInstance(newMode).getId(),toPersist);
1705 }
1706 
1707 
1708 /**
1709  * @fn void AudioOutputPort::setDB(const float newDb)
1710  * @brief This API is used to set the audio DB value to be used in a given audio port
1711  *
1712  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1713  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1714  *
1715  * @param[in] newDb Decibel value to be used for the given output audio port
1716  *
1717  * @return None
1718  */
1719 void AudioOutputPort::setDB(const float newDb)
1720 {
1721  dsError_t ret = dsERR_NONE;
1722 
1723  if ((newDb < _minDb) || (newDb > _maxDb))
1724  ret = dsERR_INVALID_PARAM;
1725 
1726  else if (dsSetAudioDB(_handle, newDb) == dsERR_NONE)
1727  {
1728  _db = newDb;
1729  }
1730 
1731  if (ret != dsERR_NONE) throw Exception(ret);
1732 
1733 }
1734 
1735 /**
1736  * @fn void AudioOutputPort::setGain(const float newGain)
1737  * @brief This API is used to set the audio gain to be used in a given audio port.
1738  *
1739  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1740  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1741  *
1742  * @param[in] newLevel New Audio gain for a given audio output port
1743  *
1744  * @return None
1745  */
1746 void AudioOutputPort::setGain(const float newGain)
1747 {
1748  dsError_t ret = dsERR_NONE;
1749 
1750  if ((newGain < -2080) || (newGain > 480)) {
1751  ret = dsERR_INVALID_PARAM;
1752  } else if ( (ret = dsSetAudioGain(_handle, newGain)) == dsERR_NONE) {
1753  _gain = newGain;
1754  }
1755 
1756  if (ret != dsERR_NONE) throw Exception(ret);
1757 
1758 }
1759 
1760 /**
1761  * @fn void AudioOutputPort::setLevel(const float newLevel)
1762  * @brief This API is used to set the audio level to be used in a given audio port.
1763  *
1764  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1765  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1766  *
1767  * @param[in] newLevel New Audio level for a given audio output port
1768  *
1769  * @return None
1770  */
1771 void AudioOutputPort::setLevel(const float newLevel)
1772 {
1773  dsError_t ret = dsERR_NONE;
1774 
1775  if (newLevel < 0) {
1776  ret = dsERR_INVALID_PARAM;
1777  } else if ( (ret = dsSetAudioLevel(_handle, newLevel)) == dsERR_NONE) {
1778  _level = newLevel;
1779  }
1780 
1781  if (ret != dsERR_NONE) throw Exception(ret);
1782 
1783 }
1784 
1785 /**
1786  * @fn void AudioOutputPort::setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, const unsigned char level)
1787  * @brief This API is used to set the audio level to be used in a given audio port. If output mode is Passthrough/Expert this mutes the audio
1788  *
1789  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1790  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1791  *
1792  * @param[in] action action type to start or stop ducking
1793  * @param[in] type ducking type is absolute or relative to current volume level.
1794  * @param[in] level New Audio level for a given audio output port range [0 - 100]
1795  *
1796  * @return None
1797  */
1799 {
1800  dsError_t ret = dsERR_NONE;
1801 
1802  if (level > 100) {
1803  ret = dsERR_INVALID_PARAM;
1804  }
1805  else if ( (ret = dsSetAudioDucking(_handle,action,type, level)) == dsERR_NONE)
1806  {
1807  _level = level;
1808  }
1809 
1810  if (ret != dsERR_NONE) throw Exception(ret);
1811 }
1812 
1813 
1814 /**
1815  * @fn void AudioOutputPort::setLoopThru(const bool loopThru)
1816  * @brief This API is used to set the audio port to do loop thro.
1817  *
1818  * @param[in] loopThru True when output is loopthru. Otherwise False.
1819  *
1820  * @return None
1821  */
1822 void AudioOutputPort::setLoopThru(const bool loopThru)
1823 {
1825 
1826  if (ret != dsERR_NONE) throw Exception(ret);
1827 }
1828 
1829 
1830 /**
1831  * @fn void AudioOutputPort::setMuted(const bool mute)
1832  * @brief This API is used to mute/unmute the audio. It throws an IllegalArgumentException
1833  * if audio could not be muted/unmuted.
1834  *
1835  * @param[in] mute True if audio to be muted, false otherwise.
1836  *
1837  * @return None
1838  */
1839 void AudioOutputPort::setMuted(const bool mute)
1840 {
1841  dsError_t ret = dsERR_NONE;
1842 
1843  if ( (ret = dsSetAudioMute(_handle, mute)) == dsERR_NONE) {
1844  _muted = mute;
1845  }
1846  if (ret != dsERR_NONE) throw IllegalArgumentException();
1847 
1848 }
1849 
1850 /**
1851  * @fn bool AudioOutputPort::isAudioMSDecode() const
1852  * @brief This API is used to check whether the audio port supports Dolby MS11 Multistream Decode
1853  *
1854  * @return True or False
1855  * @retval True when Audio ports could be configured to support Mix PCM Audio with Surround
1856  * @retval Fals when Audio ports could not be configured to support Mix PCM Audio with Surround
1857  */
1858 
1860 {
1861  bool HasMS11Decode = false;
1862 
1863  dsError_t ret = dsIsAudioMSDecode(_handle,&HasMS11Decode);
1864  if (ret != dsERR_NONE) {
1865  throw Exception(ret);
1866  }
1867  return HasMS11Decode;
1868 }
1869 
1870 /**
1871  * @fn bool AudioOutputPort::isAudioMSi12Decode() const
1872  * @brief This API is used to check whether the audio port supports Dolby MS12 Multistream Decode
1873  *
1874  * @return True or False
1875  * @retval True when Audio ports could be configured to support Mix PCM Audio with Surround
1876  * @retval Fals when Audio ports could not be configured to support Mix PCM Audio with Surround
1877  */
1878 
1879 bool AudioOutputPort::isAudioMS12Decode() const
1880 {
1881  bool HasMS12Decode = false;
1882 
1883  dsError_t ret = dsIsAudioMS12Decode(_handle,&HasMS12Decode);
1884  if (ret != dsERR_NONE) {
1885  throw Exception(ret);
1886  }
1887  return HasMS12Decode;
1888 }
1889 
1890 /**
1891  * @fn void AudioOutputPort::getAudioCapabilities(int *capabilities)
1892  * @brief This API is used to query the Audio capabilities of the device
1893  *
1894  * @return void
1895  */
1896 
1898 {
1899  dsError_t ret = dsGetAudioCapabilities(_handle, capabilities);
1900  if (ret != dsERR_NONE) {
1901  throw Exception(ret);
1902  }
1903 }
1904 
1905 /**
1906  * @fn void AudioOutputPort::getMS12Capabilities(int *capabilities)
1907  * @brief This API is used to query the MS12 capabilities of the device
1908  *
1909  * @return void
1910  */
1911 
1913 {
1914  dsError_t ret = dsGetMS12Capabilities(_handle, capabilities);
1915  if (ret != dsERR_NONE) {
1916  throw Exception(ret);
1917  }
1918 }
1919 
1920 /**
1921  * @fn AudioOutputPort::resetDialogEnhancement()
1922  * @brief This API is used to reset the AudioOutput in a given audio port.
1923  *
1924  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1925  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1926  *
1927  *
1928  * @return None
1929  */
1931 {
1932  dsError_t ret = dsERR_NONE;
1933 
1934  if ( (ret = dsResetDialogEnhancement(_handle)) == dsERR_NONE) {
1935  }
1936  else
1937  {
1938  throw Exception(ret);
1939  }
1940 }
1941 
1942 /**
1943  * @fn AudioOutputPort::resetBassEnhancer()
1944  * @brief This API is used to reset the AudioOutput in a given audio port.
1945  *
1946  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1947  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1948  *
1949  *
1950  * @return None
1951  */
1953 {
1954  dsError_t ret = dsERR_NONE;
1955 
1956  if ( (ret = dsResetBassEnhancer(_handle)) == dsERR_NONE) {
1957  }
1958  else
1959  {
1960  throw Exception(ret);
1961  }
1962 }
1963 
1964 /**
1965  * @fn AudioOutputPort::resetSurroundVirtualizer()
1966  * @brief This API is used to reset the AudioOutput in a given audio port.
1967  *
1968  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1969  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1970  *
1971  *
1972  * @return None
1973  */
1975 {
1976  dsError_t ret = dsERR_NONE;
1977 
1978  if ( (ret = dsResetSurroundVirtualizer(_handle)) == dsERR_NONE) {
1979  }
1980  else
1981  {
1982  throw Exception(ret);
1983  }
1984 }
1985 
1986 /**
1987  * @fn AudioOutputPort::resetVolumeLeveller()
1988  * @brief This API is used to reset the AudioOutput in a given audio port.
1989  *
1990  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
1991  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
1992  *
1993  *
1994  * @return None
1995  */
1997 {
1998  dsError_t ret = dsERR_NONE;
1999 
2000  if ( (ret = dsResetVolumeLeveller(_handle)) == dsERR_NONE) {
2001  }
2002  else
2003  {
2004  throw Exception(ret);
2005  }
2006 }
2007 
2008 /**
2009  * @fn AudioOutputPort::setMS12AudioProfileSetttings()
2010  * @brief This API is used to Set the particular property of specific profile
2011  *
2012  * If return is not equal to dsERR_NONE, it will throw the ret to IllegalArgumentException Handler and
2013  * it will pass the message as "No message for this exception" with the value of "dsERR_INVALID_PARAM" from dsError type.
2014  *
2015  *
2016  * @return None
2017  */
2018 
2019 void AudioOutputPort::setMS12AudioProfileSetttingsOverride(const std::string ProfileState,const std::string ProfileName,
2020  const std::string ProfileSettingsName, const std::string ProfileSettingValue)
2021 {
2022 
2023  dsError_t ret = dsERR_NONE;
2024 
2025  if ( (ret = dsSetMS12AudioProfileSetttingsOverride(_handle, ProfileState.c_str(),ProfileName.c_str(),
2026  ProfileSettingsName.c_str(),ProfileSettingValue.c_str())) == dsERR_NONE) {
2027  }
2028  else
2029  {
2030  throw Exception(ret);
2031  }
2032 
2033 
2034 }
2035 
2036 /**
2037  * @fn void AudioOutputPort::getHdmiArcPortId(int *portId)
2038  * @brief This API is used to query the HDMI ARC Port ID
2039  *
2040  * @return void
2041  */
2042 
2044 {
2045  dsError_t ret = dsGetHDMIARCPortId(portId);
2046  if (ret != dsERR_NONE) {
2047  throw Exception(ret);
2048  }
2049 }
2050 
2051 
2052 
2053 }
2054 
2055 /** @} */
2056 
2057 /** @} */
2058 /** @} */
dsGetAudioCompression
dsError_t dsGetAudioCompression(intptr_t handle, int *compression)
Get the audio compressionof an audio port.
Definition: dsAudio.c:792
device::AudioOutputPort::isEnabled
bool isEnabled() const
This API is used to check whether the audio is enabled or not.
Definition: audioOutputPort.cpp:549
device::AudioOutputPort::enable
void enable()
This API is used to enable the Audio output port.
Definition: audioOutputPort.cpp:304
_dsAudioARCStatus_t
Structure that defines ARC status for the HDMI ARC/EARC port.
Definition: dsTypes.h:307
device::AudioOutputPort::setGain
void setGain(const float newGain)
This API is used to set the audio gain to be used in a given audio port.
Definition: audioOutputPort.cpp:1746
dsGetAudioDB
dsError_t dsGetAudioDB(intptr_t handle, float *db)
Get the current audio dB level of an audio port.
Definition: dsAudio.c:222
device::AudioOutputPort::getDialogEnhancement
int getDialogEnhancement() const
This API is used to get the current auto mode.
Definition: audioOutputPort.cpp:891
device::AudioOutputPort::setMS12AudioProfile
void setMS12AudioProfile(std::string profile)
This API is used to set MS12 Audio Profile.
Definition: audioOutputPort.cpp:1154
_dsAudioSADList_t
Definition: dsTypes.h:299
dsIsSurroundDecoderEnabled
dsError_t dsIsSurroundDecoderEnabled(intptr_t handle, bool *enabled)
To get the audio Surround Decoder.
Definition: dsAudio.c:969
device::AudioOutputPort::getDB
float getDB() const
This API will get the current Decibel value for the given Audio port.
Definition: audioOutputPort.cpp:408
device::AudioOutputPort::setBassEnhancer
void setBassEnhancer(const int boost)
This API is used to adjust the Bass in a given audio port.
Definition: audioOutputPort.cpp:761
device::AudioOutputPort::setSurroundVirtualizer
void setSurroundVirtualizer(const dsSurroundVirtualizer_t virtualizer)
This API is used to set the surround virtualizer mode and boost value for a given audio port.
Definition: audioOutputPort.cpp:830
device::HdmiInput::getInstance
static HdmiInput & getInstance()
This API is used to get the instance of the HDMI Input.
Definition: hdmiIn.cpp:110
device::AudioOutputPort::setDRCMode
void setDRCMode(const int mode)
This API is used to set the Dynamic Range control mode in a given audio port.
Definition: audioOutputPort.cpp:807
device::AudioEncoding::getInstance
static const AudioEncoding & getInstance(int id)
This function gets an AudioEncoding instance against the id parameter, only if the id passed is valid...
Definition: audioEncoding.cpp:82
device::AudioOutputPort::resetSurroundVirtualizer
void resetSurroundVirtualizer()
This API is used to reset the AudioOutput in a given audio port.
Definition: audioOutputPort.cpp:1974
dsSetAudioCompression
dsError_t dsSetAudioCompression(intptr_t handle, int compression)
Set the audio compression of an audio port.
Definition: dsAudio.c:737
device::HdmiInput::isPortConnected
bool isPortConnected(int8_t Port) const
This API is used to specify if the prvided HDMI Input port is connected (i.e. HDMI Input devie is plu...
Definition: hdmiIn.cpp:222
hdmiIn.hpp
Structures and classes for HDMI Input are defined here.
device::AudioOutputPort::getMS12AudioProfileList
std::vector< std::string > getMS12AudioProfileList() const
This API is used to get the supported MS12 Audio profiles.
Definition: audioOutputPort.cpp:1173
dsSetAssociatedAudioMixing
dsError_t dsSetAssociatedAudioMixing(intptr_t handle, bool mixing)
Enable/Disable Associated Audio Mixing.
Definition: dsAudio.c:1248
device::AudioOutputPort::setDialogEnhancement
void setDialogEnhancement(const int level)
This API is used to set the compression mode in a given audio port.
Definition: audioOutputPort.cpp:669
device::AudioOutputPort::getSurroundVirtualizer
dsSurroundVirtualizer_t getSurroundVirtualizer() const
This API is used to get the Surround Virtualizer Boost value.
Definition: audioOutputPort.cpp:1035
device::AudioOutputPort::setSecondaryLanguage
void setSecondaryLanguage(const std::string sLang)
This API is used to set Secondary language.
Definition: audioOutputPort.cpp:1364
dsSetMISteering
dsError_t dsSetMISteering(intptr_t handle, bool enabled)
To set the audio Media intelligent Steering.
Definition: dsAudio.c:1118
dsGetAudioEncoding
dsError_t dsGetAudioEncoding(intptr_t handle, dsAudioEncoding_t *encoding)
Get the encoding type of an audio port.
Definition: dsAudio.c:95
device::AudioOutputPort::getSecondaryLanguage
void getSecondaryLanguage(std::string &sLang)
This API is used to get the current AC4 Secondary language.
Definition: audioOutputPort.cpp:1386
device::AudioOutputPort::getSupportedStereoModes
const List< AudioStereoMode > getSupportedStereoModes() const
Definition: audioOutputPort.cpp:248
device::List
This class is implemented using templates and it is used to maintain a container with the list of sup...
Definition: list.hpp:51
device::AudioOutputPort::getSupportedCompressions
const List< AudioCompression > getSupportedCompressions() const
This API is used to get the list of audio compressions supported by the port.
Definition: audioOutputPort.cpp:236
dsSetStereoMode
dsError_t dsSetStereoMode(intptr_t handle, dsAudioStereoMode_t mode)
Set the stereo mode of an audio port.
device::AudioOutputPort::getDolbyVolumeMode
bool getDolbyVolumeMode() const
This API is used to get the current auto mode.
Definition: audioOutputPort.cpp:911
device::AudioOutputPort::setAudioAtmosOutputMode
void setAudioAtmosOutputMode(bool enable)
Definition: audioOutputPort.cpp:1505
device::AudioOutputPort::_audioDelayMs
uint32_t _audioDelayMs
Audio delays.
Definition: audioOutputPort.hpp:70
device::AudioOutputPort::_gain
float _gain
Audio gain value.
Definition: audioOutputPort.hpp:74
device::AudioOutputPort::getPrimaryLanguage
void getPrimaryLanguage(std::string &pLang)
This API is used to get the current Primary language.
Definition: audioOutputPort.cpp:1339
dsGetSupportedARCTypes
dsError_t dsGetSupportedARCTypes(intptr_t handle, int *types)
Get the supported ARC types of the connected ARC/eARC device.
Definition: dsAudio.c:1504
dsEnableAudioPort
dsError_t dsEnableAudioPort(intptr_t handle, bool enabled)
This function is used to enable or disable the specified Audio port.
dsSetBassEnhancer
dsError_t dsSetBassEnhancer(intptr_t handle, int boost)
To set the audio Bass.
Definition: dsAudio.c:951
dsGetIntelligentEqualizerMode
dsError_t dsGetIntelligentEqualizerMode(intptr_t handle, int *mode)
Get the Intelligent Equalizer Mode.
Definition: dsAudio.c:861
dsResetSurroundVirtualizer
dsError_t dsResetSurroundVirtualizer(intptr_t handle)
to reset the audio Surround Virtualizer level
Definition: dsAudio.c:1800
device::AudioOutputPort::getGain
float getGain() const
This API will get the current Gain for the given audio output port.
Definition: audioOutputPort.cpp:386
_dsVolumeLeveller_t
Definition: dsTypes.h:352
device::AudioOutputPort::getEncoding
const AudioEncoding & getEncoding() const
This API is used to get the current encoding of the output port.
Definition: audioOutputPort.cpp:260
dsGetAudioLevel
dsError_t dsGetAudioLevel(intptr_t handle, float *level)
Get the current audio volume level of an audio port.
Definition: dsAudio.c:229
dsSetAudioGain
dsError_t dsSetAudioGain(intptr_t handle, float gain)
Set the audio gain of an audio port.
Definition: dsAudio.c:474
dsAudioDuckingType_t
enum _dsAudioDuckingType_t dsAudioDuckingType_t
dsAudioPortType_t
enum _dsAudioPortType_t dsAudioPortType_t
device::AudioOutputPort::getVolumeLeveller
dsVolumeLeveller_t getVolumeLeveller() const
This API is used to get the current volume leveller value.
Definition: audioOutputPort.cpp:952
dsGetStereoMode
dsError_t dsGetStereoMode(intptr_t handle, dsAudioStereoMode_t *stereoMode)
Get the stereo mode of an audio port.
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::AudioOutputPortType::getInstance
static AudioOutputPortType & getInstance(int id)
This function is used to get the instance of the AudioOutputPortType based on the port id,...
Definition: audioOutputPortType.cpp:90
device::AudioOutputPort::_maxDb
float _maxDb
Maximum audio decibel value.
Definition: audioOutputPort.hpp:76
device::AudioOutputPort::GetLEConfig
bool GetLEConfig()
This API is used to check if Loudness Equivalence is enabled or not*.
Definition: audioOutputPort.cpp:1636
device::AudioOutputPort::isConnected
bool isConnected() const
This API is used to check whether the audio output port is connected to a sink device or not.
Definition: audioOutputPort.cpp:572
dsSetDialogEnhancement
dsError_t dsSetDialogEnhancement(intptr_t handle, int level)
Get the Dialog Enhancement level of an audio port.
Definition: dsAudio.c:719
device::AudioOutputPort::getMS12Capabilities
void getMS12Capabilities(int *capabilities)
This API is used to query the MS12 capabilities of the device.
Definition: audioOutputPort.cpp:1912
device::AudioOutputPort::_optimalLevel
float _optimalLevel
Optimal audio level.
Definition: audioOutputPort.hpp:78
device::AudioOutputPort::getOptimalLevel
float getOptimalLevel() const
This API is used to get the current optimal level value for audio output port.
Definition: audioOutputPort.cpp:444
device::AudioOutputPort::getStereoMode
const AudioStereoMode & getStereoMode(bool usePersist=false)
This API is used to get the current stereo mode of the output port.
Definition: audioOutputPort.cpp:273
dsIsAudioPortEnabled
dsError_t dsIsAudioPortEnabled(intptr_t handle, bool *enabled)
This function indicates whether the specified Audio port is enabled or not.
Definition: dsAudio.c:303
dsResetBassEnhancer
dsError_t dsResetBassEnhancer(intptr_t handle)
to reset the reset the audio Bass
Definition: dsAudio.c:1785
device::AudioOutputPort::_stereoAuto
bool _stereoAuto
Audio stereo mode Types.
Definition: audioOutputPort.hpp:72
dsGetAudioOptimalLevel
dsError_t dsGetAudioOptimalLevel(intptr_t handle, float *optimalLevel)
Get the optimal audio level of an audio port.
Definition: dsAudio.c:269
device::AudioOutputPort::getLevel
float getLevel() const
This API is used to get the current audio level for the given audio output port.
Definition: audioOutputPort.cpp:492
device::AudioOutputPort::_minDb
float _minDb
Minimum audio decibel value.
Definition: audioOutputPort.hpp:77
device::AudioOutputPort::~AudioOutputPort
virtual ~AudioOutputPort()
This is a default destructor of class AudioOutputPort.
Definition: audioOutputPort.cpp:158
dsGetLEConfig
dsError_t dsGetLEConfig(intptr_t handle, bool *enable)
To Get LE configuration.
Definition: dsAudio.c:1685
device::AudioOutputPort::resetDialogEnhancement
void resetDialogEnhancement()
This API is used to reset the AudioOutput in a given audio port.
Definition: audioOutputPort.cpp:1930
device::AudioOutputPort::getAssociatedAudioMixing
void getAssociatedAudioMixing(bool *mixing)
This API is used to get status of Associated Audio Mixing.
Definition: audioOutputPort.cpp:1235
device::AudioOutputPort::isLoopThru
bool isLoopThru() const
This API is used to check whether the given audio port is configured for loop thro'.
Definition: audioOutputPort.cpp:514
device::AudioOutputPort::getMISteering
bool getMISteering() const
This API is used to get status of Media Intelligent Steering.
Definition: audioOutputPort.cpp:1057
device::AudioOutputPort::setLevel
void setLevel(const float level)
This API is used to set the audio level to be used in a given audio port.
Definition: audioOutputPort.cpp:1771
device::AudioOutputPort::reInitializeAudioOutputPort
dsError_t reInitializeAudioOutputPort()
This API is used to reInitialize AudioOutputPort in case when Constructor miss out the Audio output p...
Definition: audioOutputPort.cpp:171
dsMS12FEATURE_t
enum _dsMS12FEATURE_t dsMS12FEATURE_t
dsIsAudioMute
dsError_t dsIsAudioMute(intptr_t handle, bool *muted)
Get the audio mute status of an audio port.
Definition: dsAudio.c:284
device::AudioOutputPort::setPrimaryLanguage
void setPrimaryLanguage(const std::string pLang)
This API is used to set Primary language.
Definition: audioOutputPort.cpp:1317
device::AudioStereoMode
This class extends DSConstant to implement AudioStereoMode. It manages the information related to aud...
Definition: audioStereoMode.hpp:52
dsError.h
Device Settings HAL error codes.
dsGetPrimaryLanguage
dsError_t dsGetPrimaryLanguage(intptr_t handle, char *pLang)
To get AC4 Primary language.
Definition: dsAudio.c:1371
device::AudioOutputPort::getType
const AudioOutputPortType & getType() const
This API is used to get the type of the audio output port. The type of audio output port represent th...
Definition: audioOutputPort.cpp:212
device::AudioOutputPort::setAssociatedAudioMixing
void setAssociatedAudioMixing(const bool mixing)
This API is used to enable/disable Associated Audio Mixing.
Definition: audioOutputPort.cpp:1215
dsAUDIOPORT_TYPE_HEADPHONE
@ dsAUDIOPORT_TYPE_HEADPHONE
Definition: dsTypes.h:171
dsGetMS12AudioProfileList
dsError_t dsGetMS12AudioProfileList(intptr_t handle, dsMS12AudioProfileList_t *profiles)
To get the supported MS12 audio profiles.
Definition: dsAudio.c:1178
device::AudioOutputPortType::getSupportedStereoModes
const List< AudioStereoMode > getSupportedStereoModes() const
This API is used to get the list of audio stereo modes supported by the audio port.
Definition: audioOutputPortType.cpp:164
device::AudioOutputPort::setAudioDelayOffset
void setAudioDelayOffset(const uint32_t audioDelayOffsetMs)
This API is used to set audio delay offset in milliseconds.
Definition: audioOutputPort.cpp:1473
dsGetDialogEnhancement
dsError_t dsGetDialogEnhancement(intptr_t handle, int *level)
Get the Dialog Enhancement level of an audio port.
Definition: dsAudio.c:815
device::AudioOutputPort
Class extending Enumerable to implement the audiooutputport interface.
Definition: audioOutputPort.hpp:60
device::AudioOutputPort::getInstance
static AudioOutputPort & getInstance(int id)
This API is used to get the instance of the audio output port based on the port id returned by the ge...
Definition: audioOutputPort.cpp:83
dsERR_GENERAL
@ dsERR_GENERAL
Definition: dsError.h:86
audioStereoMode.hpp
This file defines AudioStereoMode class for managing audio mode types.
dsSetMS12AudioProfileSetttingsOverride
dsError_t dsSetMS12AudioProfileSetttingsOverride(intptr_t handle, const char *profileState, const char *profileName, const char *profileSettingsName, const char *profileSettingValue)
To Set/override a specific audio setting in a specific profile.
Definition: dsAudio.c:1456
dsSetSurroundVirtualizer
dsError_t dsSetSurroundVirtualizer(intptr_t handle, dsSurroundVirtualizer_t virtualizer)
To set the audio Surround Virtualizer level.
Definition: dsAudio.c:1076
dsGetFaderControl
dsError_t dsGetFaderControl(intptr_t handle, int *mixerbalance)
To get the mixerbalance betweeen main and associated audio.
Definition: dsAudio.c:1314
device::AudioOutputPort::getSinkDeviceAtmosCapability
void getSinkDeviceAtmosCapability(dsATMOSCapability_t &atmosCapability)
Definition: audioOutputPort.cpp:1525
_dsSurroundVirtualizer_t
Definition: dsTypes.h:360
dsSetAudioLevel
dsError_t dsSetAudioLevel(intptr_t handle, float level)
This function sets the audio volume level to be used on the specified audio port.
Definition: dsAudio.c:507
dsERR_NONE
@ dsERR_NONE
Definition: dsError.h:85
device::AudioOutputPort::setGraphicEqualizerMode
void setGraphicEqualizerMode(const int mode)
This API is used to set the compression mode in a given audio port.
Definition: audioOutputPort.cpp:1105
dsSetAudioEncoding
dsError_t dsSetAudioEncoding(intptr_t handle, dsAudioEncoding_t encoding)
Set the encoding type of an audio port.
Definition: dsAudio.c:413
device::AudioOutputPort::resetVolumeLeveller
void resetVolumeLeveller()
This API is used to reset the AudioOutput in a given audio port.
Definition: audioOutputPort.cpp:1996
dsEnableSurroundDecoder
dsError_t dsEnableSurroundDecoder(intptr_t handle, bool enabled)
To set the audio Surround Decoder.
Definition: dsAudio.c:992
device::AudioOutputPort::_loopThru
bool _loopThru
Method variable to check whether audio is loop thru or not.
Definition: audioOutputPort.hpp:81
device::AudioStereoMode::getInstance
static const AudioStereoMode & getInstance(int id)
This function gets an instance of AudioStereoMode against the specified id, only if the id passed is ...
Definition: audioStereoMode.cpp:84
device::AudioOutputPort::setVolumeLeveller
void setVolumeLeveller(const dsVolumeLeveller_t volLeveller)
This API is used to set the volume leveller mode & amount for a given audio port.
Definition: audioOutputPort.cpp:738
device::AudioOutputPort::getMinDB
float getMinDB() const
This API is used to get the current minimum decibel that Audio output port can support.
Definition: audioOutputPort.cpp:432
dsSetAudioMute
dsError_t dsSetAudioMute(intptr_t handle, bool mute)
Mute or un-mute an audio port.
Definition: dsAudio.c:565
dsGetAudioDelayOffset
dsError_t dsGetAudioDelayOffset(intptr_t handle, uint32_t *audioDelayOffsetMs)
Get the audio delay offset in milliseconds.
Definition: dsAudio.c:1595
device::AudioOutputPort::getAudioDelayOffset
bool getAudioDelayOffset(uint32_t &audioDelayOffsetMs) const
This API is used to get the current audio delay offset in milliseconds for audio output port.
Definition: audioOutputPort.cpp:473
device::AudioOutputPort::enableSurroundDecoder
void enableSurroundDecoder(const bool enable)
This API is used to enable/disable surround decoder in a given audio port.
Definition: audioOutputPort.cpp:784
device::AudioOutputPort::isAudioMSDecode
bool isAudioMSDecode() const
This API is used to check whether the audio port supports Dolby MS11 Multistream Decode.
Definition: audioOutputPort.cpp:1859
dsSetMS12AudioProfile
dsError_t dsSetMS12AudioProfile(intptr_t handle, const char *profile)
To set the ms12 audio profile.
Definition: dsAudio.c:1224
dsEnableLEConfig
dsError_t dsEnableLEConfig(intptr_t handle, const bool enable)
This function is used to enable or disable Loudness Equivalence feature.
Definition: dsAudio.c:1663
dsResetVolumeLeveller
dsError_t dsResetVolumeLeveller(intptr_t handle)
to reset the Dolby volume leveller
Definition: dsAudio.c:1815
dsSetAudioDelay
dsError_t dsSetAudioDelay(intptr_t handle, const uint32_t audioDelayMs)
Set the audio delay in milliseconds.
Definition: dsAudio.c:676
dsGetAudioMaxDB
dsError_t dsGetAudioMaxDB(intptr_t handle, float *maxDb)
Get the maximum audio dB level of an audio port.
Definition: dsAudio.c:255
device::AudioOutputPort::_encoding
int _encoding
Audio Encoding Types.
Definition: audioOutputPort.hpp:68
dsAudioSetSAD
dsError_t dsAudioSetSAD(intptr_t handle, dsAudioSADList_t sad_list)
Set Short Audio Descriptor retrieved from CEC for the connected ARC device.
Definition: dsAudio.c:1527
dsSetDolbyVolumeMode
dsError_t dsSetDolbyVolumeMode(intptr_t handle, bool mode)
Get the dolby audio mode status.
Definition: dsAudio.c:755
dsSetGraphicEqualizerMode
dsError_t dsSetGraphicEqualizerMode(intptr_t handle, int mode)
Get the Graphic Equalizer Mode.
Definition: dsAudio.c:1159
dsAudioStereoMode_t
enum StereoMode dsAudioStereoMode_t
dsGetMS12AudioProfile
dsError_t dsGetMS12AudioProfile(intptr_t handle, char *profile)
To get current audio profile selection.
Definition: dsAudio.c:1201
device::AudioOutputPortType
Class extending DSConstant to implement the audiooutputport interface.
Definition: audioOutputPortType.hpp:56
device::AudioOutputPortType::getSupportedEncodings
const List< AudioEncoding > getSupportedEncodings() const
This API is used to get the list of audio encodings supported by the audio port .
Definition: audioOutputPortType.cpp:150
device::AudioOutputPort::isMuted
bool isMuted() const
This API is used to check whether the audio is muted or not.
Definition: audioOutputPort.cpp:530
dsSetPrimaryLanguage
dsError_t dsSetPrimaryLanguage(intptr_t handle, const char *pLang)
To set AC4 Primary language.
Definition: dsAudio.c:1342
dsGetSecondaryLanguage
dsError_t dsGetSecondaryLanguage(intptr_t handle, char *sLang)
To get AC4 Secondary language.
Definition: dsAudio.c:1428
device::AudioOutputPort::_audioDelayOffsetMs
uint32_t _audioDelayOffsetMs
Audio delay offset.
Definition: audioOutputPort.hpp:71
device::AudioOutputPort::_level
float _level
Audio level.
Definition: audioOutputPort.hpp:79
device::AudioOutputPort::getBassEnhancer
int getBassEnhancer() const
This API is used to get the Bass Enhancer boost value.
Definition: audioOutputPort.cpp:975
device::AudioOutputPort::setMuted
void setMuted(const bool mute)
This API is used to mute/unmute the audio. It throws an IllegalArgumentException if audio could not b...
Definition: audioOutputPort.cpp:1839
device::AudioOutputPort::setMISteering
void setMISteering(const bool enable)
This API is used to enable/disable the Media Intelligent Steering in a given audio port.
Definition: audioOutputPort.cpp:853
dsGetHDMIARCPortId
dsError_t dsGetHDMIARCPortId(int *portId)
Get the audio HDMI ARC port ID for each platform.
Definition: dsAudio.c:1830
device::AudioOutputPort::setEncoding
void setEncoding(const int encoding)
This API is used to set the Encoding method in a given audio port.
Definition: audioOutputPort.cpp:608
device::AudioOutputPort::getDRCMode
int getDRCMode() const
This API is used to get the Dynamic Range Control mode.
Definition: audioOutputPort.cpp:1015
device::AudioOutputPort::getAudioDelay
bool getAudioDelay(uint32_t &audioDelayMs) const
This API is used to get the current audio delay in milliseconds for audio output port.
Definition: audioOutputPort.cpp:455
device::AudioOutputPort::setLoopThru
void setLoopThru(const bool loopThru)
This API is used to set the audio port to do loop thro.
Definition: audioOutputPort.cpp:1822
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::AudioOutputPort::setAudioDucking
void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t, const unsigned char level)
This API is used to set the audio level to be used in a given audio port. If output mode is Passthrou...
Definition: audioOutputPort.cpp:1798
dsGetSinkDeviceAtmosCapability
dsError_t dsGetSinkDeviceAtmosCapability(intptr_t handle, dsATMOSCapability_t *capability)
Get the sink device ATMOS capability.
Definition: dsAudio.c:1640
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
dsGetSurroundVirtualizer
dsError_t dsGetSurroundVirtualizer(intptr_t handle, dsSurroundVirtualizer_t *virtualizer)
To get the audio Surround Virtualizer level.
Definition: dsAudio.c:1051
device::AudioOutputPort::getMS12AudioProfile
const std::string getMS12AudioProfile() const
This API is used to get the current MS12 Audio profile.
Definition: audioOutputPort.cpp:1125
dsAudioARCTypes_t
enum _dsAudioARCTypes_t dsAudioARCTypes_t
dsGetAssociatedAudioMixing
dsError_t dsGetAssociatedAudioMixing(intptr_t handle, bool *mixing)
To get the Associated Audio Mixing status - enabled/disabled.
Definition: dsAudio.c:1267
device::Exception
This class handles exceptions occurring in DS module.
Definition: exception.hpp:52
device::AudioOutputPort::_stereoMode
int _stereoMode
Audio stereo mode Types.
Definition: audioOutputPort.hpp:69
dsSetAudioAtmosOutputMode
dsError_t dsSetAudioAtmosOutputMode(intptr_t handle, bool enable)
Set the audio ATMOS outout mode.
Definition: dsAudio.c:1619
dsGetAudioCapabilities
dsError_t dsGetAudioCapabilities(intptr_t handle, int *capabilities)
To find the HDR capabilities of SoC.
Definition: dsAudio.c:1708
dsAudio.h
device::AudioOutputPort::setStereoAuto
void setStereoAuto(const bool autoMode, const bool toPersist=true)
This API is used to set the stereo mode to be auto;.
Definition: audioOutputPort.cpp:1683
dsGetMISteering
dsError_t dsGetMISteering(intptr_t handle, bool *enabled)
To get the audio Media intelligent Steering.
Definition: dsAudio.c:1095
device::AudioOutputPort::setIntelligentEqualizerMode
void setIntelligentEqualizerMode(const int mode)
This API is used to set the compression mode in a given audio port.
Definition: audioOutputPort.cpp:715
dsGetVolumeLeveller
dsError_t dsGetVolumeLeveller(intptr_t handle, dsVolumeLeveller_t *volLeveller)
To get the Dolby volume leveller.
Definition: dsAudio.c:884
device::AudioOutputPort::AudioOutputPort
AudioOutputPort(const int type, const int index, const int id)
This function is a default constructor for AudioOutputPort. It initialises the data members of AudioO...
Definition: audioOutputPort.cpp:118
dsSetSecondaryLanguage
dsError_t dsSetSecondaryLanguage(intptr_t handle, const char *sLang)
To set AC4 Secondary language.
Definition: dsAudio.c:1399
dsGetAudioPort
dsError_t dsGetAudioPort(dsAudioPortType_t type, int index, intptr_t *handle)
Get the audio port handle.
Definition: dsAudio.c:66
device::AudioOutputPort::_index
int _index
Index of the audio output port.
Definition: audioOutputPort.hpp:62
dsSetVolumeLeveller
dsError_t dsSetVolumeLeveller(intptr_t handle, dsVolumeLeveller_t volLeveller)
To set the Dolby volume leveller.
Definition: dsAudio.c:909
device::AudioOutputPort::getGraphicEqualizerMode
int getGraphicEqualizerMode() const
This API is used to get the current Graphical EQ mode.
Definition: audioOutputPort.cpp:1078
dsGetDRCMode
dsError_t dsGetDRCMode(intptr_t handle, int *mode)
To get the DRC Mode.
Definition: dsAudio.c:1010
device::AudioOutputPort::setAudioDelay
void setAudioDelay(const uint32_t audioDelayMs)
This API is used to set audio delay in milliseconds.
Definition: audioOutputPort.cpp:1436
dsSetAudioDelayOffset
dsError_t dsSetAudioDelayOffset(intptr_t handle, const uint32_t audioDelayOffsetMs)
Set the audio delay offset in milliseconds.
Definition: dsAudio.c:697
dsGetMS12Capabilities
dsError_t dsGetMS12Capabilities(intptr_t handle, int *capabilities)
To find the HDR capabilities of SoC.
Definition: dsAudio.c:1729
dsResetDialogEnhancement
dsError_t dsResetDialogEnhancement(intptr_t handle)
to reset the Dialog Enhancement
Definition: dsAudio.c:1769
device::AudioOutputPort::getSupportedEncodings
const List< AudioEncoding > getSupportedEncodings() const
This API is used to get the list of audio encodings supported by the port.
Definition: audioOutputPort.cpp:224
dsAudioEnableARC
dsError_t dsAudioEnableARC(intptr_t handle, dsAudioARCStatus_t arcStatus)
enable/disable ARC/EARC and route audio to connected device
Definition: dsAudio.c:1552
device::AudioOutputPort::_muted
bool _muted
Method variable to check whether audio is muted or not.
Definition: audioOutputPort.hpp:82
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.
device::AudioOutputPort::enableARC
void enableARC(dsAudioARCTypes_t type, bool enable)
This function enables/disables ARC/EARC and routes audio to connected device.
Definition: audioOutputPort.cpp:1592
device::AudioOutputPort::getStereoAuto
bool getStereoAuto()
This API is used to get the current auto mode.
Definition: audioOutputPort.cpp:372
dsGetGraphicEqualizerMode
dsError_t dsGetGraphicEqualizerMode(intptr_t handle, int *mode)
Get the Graphic Equalizer Mode.
Definition: dsAudio.c:1136
device::AudioOutputPort::resetBassEnhancer
void resetBassEnhancer()
This API is used to reset the AudioOutput in a given audio port.
Definition: audioOutputPort.cpp:1952
dsSetAudioDB
dsError_t dsSetAudioDB(intptr_t handle, float db)
This function sets the dB level to be used on the specified audio port.
Definition: dsAudio.c:499
dsGetStereoAuto
dsError_t dsGetStereoAuto(intptr_t handle, int *autoMode)
This function is used to get the current auto mode setting of the specified audio port.
Definition: dsAudio.c:173
device::AudioOutputPort::setCompression
void setCompression(const int compression)
This API is used to set the compression mode in a given audio port.
Definition: audioOutputPort.cpp:648
device::AudioOutputPort::getAudioCapabilities
void getAudioCapabilities(int *capabilities)
This API is used to query the Audio capabilities of the device.
Definition: audioOutputPort.cpp:1897
device::AudioOutputPort::setSAD
void setSAD(std::vector< int > sad_list)
This function sets SAD(Short Audio Descriptor) to configure the best available audio format to send t...
Definition: audioOutputPort.cpp:1565
dsGetDolbyVolumeMode
dsError_t dsGetDolbyVolumeMode(intptr_t handle, bool *mode)
Get the dolby audio mode status.
Definition: dsAudio.c:838
device::AudioOutputPort::setEnablePort
dsError_t setEnablePort(bool enabled)
This API is used to enable and disable the Audio output port.
Definition: audioOutputPort.cpp:289
device::IllegalArgumentException
This class extends Exception class to manage the expections caused due to illegal arguments.
Definition: illegalArgumentException.hpp:51
device::AudioEncoding
This class extends DSConstant to implement AudioEncoding which manages audio encodings.
Definition: audioEncoding.hpp:51
audioOutputPort.hpp
It contain variables,stuctures,class and functions referenced by audiooutputport code.
device::AudioOutputPort::isSurroundDecoderEnabled
bool isSurroundDecoderEnabled() const
This API is used to get status of surround decoder.
Definition: audioOutputPort.cpp:995
device::AudioOutputPort::setStereoMode
void setStereoMode(const int mode, const bool toPersist=true)
This API is used to set the stereo mode to be used in a given audio port.If toPersist is true,...
Definition: audioOutputPort.cpp:1412
dsEnableMS12Config
dsError_t dsEnableMS12Config(intptr_t handle, dsMS12FEATURE_t feature, const bool enable)
This function is used to enable or disable MS12 DAPV2 and DE feature.
Definition: dsAudio.c:653
device::AudioOutputPort::getFaderControl
void getFaderControl(int *mixerBalance)
This API is used to get the mixerbalance betweeen main and associated audio.
Definition: audioOutputPort.cpp:1285
dsGetAudioDelay
dsError_t dsGetAudioDelay(intptr_t handle, uint32_t *audioDelayMs)
Get the audio delay in milliseconds.
Definition: dsAudio.c:1572
device::AudioOutputPort::getCompression
int getCompression() const
This API is used to get the current compression of the output port.
Definition: audioOutputPort.cpp:871
dsAudioDuckingAction_t
enum _dsAudioDuckingAction_t dsAudioDuckingAction_t
dsERR_INVALID_PARAM
@ dsERR_INVALID_PARAM
Definition: dsError.h:87
Exception
Definition: Exception.hpp:42
dsIsAudioLoopThru
dsError_t dsIsAudioLoopThru(intptr_t handle, bool *loopThru)
Get the loop-through mode of an audio port.
Definition: dsAudio.c:276
dsError_t
dsError_t
Device Settings API Error return codes.
Definition: dsError.h:84
dsGetBassEnhancer
dsError_t dsGetBassEnhancer(intptr_t handle, int *boost)
To get the audio Bass.
Definition: dsAudio.c:928
device::AudioOutputPort::_type
int _type
Audiooutputporttype.
Definition: audioOutputPort.hpp:61
device::AudioOutputPort::setDB
void setDB(const float db)
This API is used to set the audio DB value to be used in a given audio port.
Definition: audioOutputPort.cpp:1719
device::AudioOutputPort::_db
float _db
Audio decibel value.
Definition: audioOutputPort.hpp:75
_dsMS12AudioProfileList_t
Definition: dsTypes.h:334
dsSetDRCMode
dsError_t dsSetDRCMode(intptr_t handle, int mode)
To set the DRC Mode.
Definition: dsAudio.c:1033
device::AudioOutputPortType::getSupportedCompressions
const List< AudioCompression > getSupportedCompressions() const
This API is used to get the list of audio compressions supported by the audio port.
Definition: audioOutputPortType.cpp:138
audioCompression.hpp
This file defines AudioCompression class for managing audio compression levels.
device::AudioOutputPort::setFaderControl
void setFaderControl(const int mixerBalance)
This API is used to set the mixerbalance betweeen main and associated audio.
Definition: audioOutputPort.cpp:1267
dsSetAudioDucking
dsError_t dsSetAudioDucking(intptr_t handle, dsAudioDuckingAction_t action, dsAudioDuckingType_t, const unsigned char level)
This function sets the audio ducking level to be used on the specified audio port based on the audio ...
Definition: dsAudio.c:531
device::AudioOutputPort::getSupportedARCTypes
void getSupportedARCTypes(int *types)
This API is used to query the supported ARC types of the connected device.
Definition: audioOutputPort.cpp:1548
device::AudioOutputPort::getMaxDB
float getMaxDB() const
This API is used to get the current Maximum decibel that Audio output port can support.
Definition: audioOutputPort.cpp:420
device::AudioOutputPort::enableLEConfig
dsError_t enableLEConfig(const bool enable)
This API is used to enable Loudness Equivalence *.
Definition: audioOutputPort.cpp:1615
dsSetFaderControl
dsError_t dsSetFaderControl(intptr_t handle, int mixerbalance)
To set the mixerbalance betweeen main and associated audio.
Definition: dsAudio.c:1294
device::AudioOutputPort::getHdmiArcPortId
void getHdmiArcPortId(int *portId)
This API is used to query the HDMI ARC Port ID.
Definition: audioOutputPort.cpp:2043
dsSetStereoAuto
dsError_t dsSetStereoAuto(intptr_t handle, int autoMode)
This function sets the auto mode to be used on the specified audio port.
device::AudioOutputPort::enableMS12Config
void enableMS12Config(const dsMS12FEATURE_t feature, const bool enable)
This API is used to enable MS12 features such as DAPV2 adn DE *.
Definition: audioOutputPort.cpp:1658
dsIsAudioMS12Decode
dsError_t dsIsAudioMS12Decode(intptr_t handle, bool *HasMS12Decode)
This function is used to check whether the audio port supports Dolby MS12 Multistream Decode.
Definition: dsAudio.c:630
audioEncoding.hpp
This file defines AudioEncoding class for managing audio encoding types.
device::AudioOutputPort::setDolbyVolumeMode
void setDolbyVolumeMode(const bool mode)
This API is used to set the compression mode in a given audio port.
Definition: audioOutputPort.cpp:692
dsAUDIOPORT_TYPE_HDMI
@ dsAUDIOPORT_TYPE_HDMI
Definition: dsTypes.h:167
dsIsAudioMSDecode
dsError_t dsIsAudioMSDecode(intptr_t handle, bool *HasMS11Decode)
This function is used to check whether the audio port supports Dolby MS11 Multistream Decode.
Definition: dsAudio.c:608
dsGetAudioMinDB
dsError_t dsGetAudioMinDB(intptr_t handle, float *minDb)
Get the minimum audio dB level of an audio port.
Definition: dsAudio.c:262
dsSetIntelligentEqualizerMode
dsError_t dsSetIntelligentEqualizerMode(intptr_t handle, int mode)
Set the Intelligent Equalizer Mode.
Definition: dsAudio.c:773
dsGetAudioGain
dsError_t dsGetAudioGain(intptr_t handle, float *gain)
Get the audio gain of an audio port.
Definition: dsAudio.c:197
dsAudioEncoding_t
enum _dsAudioEncoding_t dsAudioEncoding_t