RDK Documentation (Open Sourced RDK Components)
dsAudioSettings_sample.h
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 hal
26 * @{
27 **/
28 
29 
30 #ifndef _DS_AUDIOOUTPUTPORTSETTINGS_H
31 #define _DS_AUDIOOUTPUTPORTSETTINGS_H
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
38 #include "dsUtl.h"
39 #include "dsTypes.h"
40 
41 namespace {
42 
43 
44 /*
45  * Enumerate the supported configurations here.
46  */
47 static const dsAudioPortType_t kSupportedPortTypes[] = { dsAUDIOPORT_TYPE_HDMI, dsAUDIOPORT_TYPE_SPDIF };
48 static const dsAudioEncoding_t kSupportedHDMIEncodings[] = { dsAUDIO_ENC_PCM, dsAUDIO_ENC_AC3};
49 static const dsAudioCompression_t kSupportedHDMICompressions[] = { dsAUDIO_CMP_NONE, dsAUDIO_CMP_LIGHT, dsAUDIO_CMP_MEDIUM, dsAUDIO_CMP_HEAVY, };
50 static const dsAudioStereoMode_t kSupportedHDMIStereoModes[] = { dsAUDIO_STEREO_STEREO, dsAUDIO_STEREO_SURROUND, };
51 static const dsAudioEncoding_t kSupportedSPDIFEncodings[] = { dsAUDIO_ENC_PCM, dsAUDIO_ENC_AC3, };
52 static const dsAudioCompression_t kSupportedSPDIFCompressions[] = { dsAUDIO_CMP_NONE, dsAUDIO_CMP_LIGHT, dsAUDIO_CMP_MEDIUM, dsAUDIO_CMP_HEAVY, };
53 static const dsAudioStereoMode_t kSupportedSPDIFStereoModes[] = { dsAUDIO_STEREO_STEREO, dsAUDIO_STEREO_SURROUND, };
54 
55 /*
56  * Enumerate the supported Audio port types
57  */
58 static const dsAudioTypeConfig_t kConfigs[]= {
59  {
60  /*.typeId = */ dsAUDIOPORT_TYPE_HDMI,
61  /*.name = */ "HDMI", //HDMI
62  /*.numSupportedCompressions = */dsUTL_DIM(kSupportedHDMICompressions),
63  /*.compressions = */ kSupportedHDMICompressions,
64  /*.numSupportedEncodings = */ dsUTL_DIM(kSupportedHDMIEncodings),
65  /*.encodings = */ kSupportedHDMIEncodings,
66  /*.numSupportedStereoModes = */ dsUTL_DIM(kSupportedHDMIStereoModes),
67  /*.stereoModes = */ kSupportedHDMIStereoModes,
68  },
69  {
70  /*.typeId = */ dsAUDIOPORT_TYPE_SPDIF,
71  /*.name = */ "SPDIF", //SPDIF
72  /*.numSupportedCompressions = */dsUTL_DIM(kSupportedSPDIFCompressions),
73  /*.compressions = */ kSupportedSPDIFCompressions,
74  /*.numSupportedEncodings = */ dsUTL_DIM(kSupportedSPDIFEncodings),
75  /*.encodings = */ kSupportedSPDIFEncodings,
76  /*.numSupportedStereoModes = */ dsUTL_DIM(kSupportedSPDIFStereoModes),
77  /*.stereoModes = */ kSupportedSPDIFStereoModes,
78  }
79 };
80 
81 /*
82  * Enumerate the Video Ports that are connected to each Audio port.
83  */
84 static const dsVideoPortPortId_t connectedVOPs[dsAUDIOPORT_TYPE_MAX][dsVIDEOPORT_TYPE_MAX] = {
85  {/*VOPs connected to LR Audio */
86 
87  },
88  {/*VOPs connected to HDMI Audio */
90  },
91  {/*VOPs connected to SPDIF Audio */
93  },
94 };
95 
96 /*
97  * Enumerate the Audio Ports available on the device.
98  */
99 static const dsAudioPortConfig_t kPorts[] = {
100  {
101  /*.typeId = */ {dsAUDIOPORT_TYPE_HDMI, 0},
102  /*.connectedVOPs = */ connectedVOPs[dsAUDIOPORT_TYPE_HDMI],
103  },
104  {
105  /*.typeId = */ {dsAUDIOPORT_TYPE_SPDIF, 0},
106  /*.connectedVOPs = */ connectedVOPs[dsAUDIOPORT_TYPE_SPDIF],
107  },
108 };
109 
110 }
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif
116 
117 
118 
119 /** @} */
120 /** @} */
dsAUDIOPORT_TYPE_MAX
@ dsAUDIOPORT_TYPE_MAX
Definition: dsTypes.h:172
dsVIDEOPORT_TYPE_HDMI
@ dsVIDEOPORT_TYPE_HDMI
Definition: dsTypes.h:441
dsAudioPortType_t
enum _dsAudioPortType_t dsAudioPortType_t
dsTypes.h
Device Settings HAL types.
dsAUDIO_STEREO_STEREO
@ dsAUDIO_STEREO_STEREO
Definition: dsTypes.h:376
dsAUDIO_ENC_PCM
@ dsAUDIO_ENC_PCM
Definition: dsTypes.h:186
dsUtl.h
Device Settings HAL utilities.
_dsAudioTypeConfig_t
Structure that defines audio output device configuration.
Definition: dsTypes.h:627
dsAUDIO_STEREO_SURROUND
@ dsAUDIO_STEREO_SURROUND
Definition: dsTypes.h:377
dsAudioStereoMode_t
enum StereoMode dsAudioStereoMode_t
dsAUDIOPORT_TYPE_SPDIF
@ dsAUDIOPORT_TYPE_SPDIF
Definition: dsTypes.h:168
dsAUDIO_CMP_LIGHT
@ dsAUDIO_CMP_LIGHT
Definition: dsTypes.h:202
dsVIDEOPORT_TYPE_MAX
@ dsVIDEOPORT_TYPE_MAX
Definition: dsTypes.h:445
dsAUDIO_ENC_AC3
@ dsAUDIO_ENC_AC3
Definition: dsTypes.h:187
_dsVideoPortPortId_t
Structure that defines port id associated with video port.
Definition: dsTypes.h:664
dsAUDIO_CMP_HEAVY
@ dsAUDIO_CMP_HEAVY
Definition: dsTypes.h:204
dsUTL_DIM
#define dsUTL_DIM(arr)
Device Settings general Array dimension calculation inline definition.
Definition: dsUtl.h:85
dsAUDIO_CMP_NONE
@ dsAUDIO_CMP_NONE
Definition: dsTypes.h:201
dsAudioCompression_t
enum _dsAudioCompression_t dsAudioCompression_t
_dsAudioPortConfig_t
Structure that defines audio port configuration.
Definition: dsTypes.h:726
dsAUDIOPORT_TYPE_HDMI
@ dsAUDIOPORT_TYPE_HDMI
Definition: dsTypes.h:167
dsAudioEncoding_t
enum _dsAudioEncoding_t dsAudioEncoding_t
dsAUDIO_CMP_MEDIUM
@ dsAUDIO_CMP_MEDIUM
Definition: dsTypes.h:203