Device Settings HAL 0.2.0
 
Loading...
Searching...
No Matches
dsAudioSettings_sample.h
Go to the documentation of this file.
1/*
2 * If not stated otherwise in this file or this component's LICENSE 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 * @addtogroup HPK Hardware Porting Kit
22 * @{
23 * @par The Hardware Porting Kit
24 * HPK is the next evolution of the well-defined Hardware Abstraction Layer
25 * (HAL), but augmented with more comprehensive documentation and test suites
26 * that OEM or SOC vendors can use to self-certify their ports before taking
27 * them to RDKM for validation or to an operator for final integration and
28 * deployment. The Hardware Porting Kit effectively enables an OEM and/or SOC
29 * vendor to self-certify their own Video Accelerator devices, with minimal RDKM
30 * assistance.
31 *
32 */
33
34/**
35 * @addtogroup Device_Settings Device Settings Module
36 * @{
37 */
38
39/**
40 * @addtogroup Device_Settings_HAL Device Settings HAL
41 * @par Application API Specification
42 * Described herein are the DeviceSettings HAL types and functions that are part of
43 * the Audio subsystem. The Audio subsystem manages audio-specific HAL operations.
44 * @{
45 */
46
47/**
48 * @addtogroup dsAudio_HAL DS Audio HAL
49 * @{
50 * @par Application API Specification
51 * dsAudio HAL provides an interface for managing Audio related settings
52 */
53
54/**
55 * @defgroup dsAudio_Settings_H DS Audio Settings Header
56 * @{
57 * @par Application API Specification
58 * dsAudio provides a template for various Audio configurations
59 */
60
61
62#ifndef _DS_AUDIOOUTPUTPORTSETTINGS_H
63#define _DS_AUDIOOUTPUTPORTSETTINGS_H
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69
70#include "dsUtl.h"
71#include "dsTypes.h"
72
73namespace {
74
75
76/**
77 * @brief This enumeration defines the supported audio configurations
78 */
79static const dsAudioPortType_t kSupportedPortTypes[] = { dsAUDIOPORT_TYPE_HDMI, dsAUDIOPORT_TYPE_SPDIF };
80static const dsAudioEncoding_t kSupportedHDMIEncodings[] = { dsAUDIO_ENC_PCM, dsAUDIO_ENC_AC3}; /**< Audio supported port types */
81static const dsAudioCompression_t kSupportedHDMICompressions[] = { dsAUDIO_CMP_NONE, dsAUDIO_CMP_LIGHT, dsAUDIO_CMP_MEDIUM, dsAUDIO_CMP_HEAVY, }; /**< Audio supported HDMI compression types */
82static const dsAudioStereoMode_t kSupportedHDMIStereoModes[] = { dsAUDIO_STEREO_STEREO, dsAUDIO_STEREO_SURROUND, }; /**< Audio supported HDMI stereo mode types */
83static const dsAudioEncoding_t kSupportedSPDIFEncodings[] = { dsAUDIO_ENC_PCM, dsAUDIO_ENC_AC3, }; /**< Audio supported SPDIF encoding types */
84static const dsAudioCompression_t kSupportedSPDIFCompressions[] = { dsAUDIO_CMP_NONE, dsAUDIO_CMP_LIGHT, dsAUDIO_CMP_MEDIUM, dsAUDIO_CMP_HEAVY, }; /**< Audio supported SPDIF compression types */
85static const dsAudioStereoMode_t kSupportedSPDIFStereoModes[] = { dsAUDIO_STEREO_STEREO, dsAUDIO_STEREO_SURROUND, }; /**< Audio supported SPDIF stereo mode types */
86
87/**
88 * @brief This enumeration defines the supported Audio port types
89 */
90static const dsAudioTypeConfig_t kConfigs[]= {
91 {
92 /*.typeId = */ dsAUDIOPORT_TYPE_HDMI,
93 /*.name = */ "HDMI", //HDMI
94 /*.numSupportedCompressions = */dsUTL_DIM(kSupportedHDMICompressions),
95 /*.compressions = */ kSupportedHDMICompressions,
96 /*.numSupportedEncodings = */ dsUTL_DIM(kSupportedHDMIEncodings),
97 /*.encodings = */ kSupportedHDMIEncodings,
98 /*.numSupportedStereoModes = */ dsUTL_DIM(kSupportedHDMIStereoModes),
99 /*.stereoModes = */ kSupportedHDMIStereoModes,
100 },
101 {
102 /*.typeId = */ dsAUDIOPORT_TYPE_SPDIF,
103 /*.name = */ "SPDIF", //SPDIF
104 /*.numSupportedCompressions = */dsUTL_DIM(kSupportedSPDIFCompressions),
105 /*.compressions = */ kSupportedSPDIFCompressions,
106 /*.numSupportedEncodings = */ dsUTL_DIM(kSupportedSPDIFEncodings),
107 /*.encodings = */ kSupportedSPDIFEncodings,
108 /*.numSupportedStereoModes = */ dsUTL_DIM(kSupportedSPDIFStereoModes),
109 /*.stereoModes = */ kSupportedSPDIFStereoModes,
110 }
111};
112
113/**
114 * @brief This enumeration defines the video ports that are connected to each audio port
115 *
116 * This is left empty since in this example there is no LR Audio port but needs to
117 * corresponds to @link kPorts @endlink
118 *
119 */
121 {/* VOPs connected to LR Audio */
122
123 },
124 {/*VOPs connected to HDMI Audio */
126 },
127 {/*VOPs connected to SPDIF Audio */
129 },
130};
131
132/**
133 * @brief This enumeration defines the available audio ports on the device
134 */
135static const dsAudioPortConfig_t kPorts[] = {
136 {
137 /*.typeId = */ {dsAUDIOPORT_TYPE_HDMI, 0},
138 /*.connectedVOPs = */ connectedVOPs[dsAUDIOPORT_TYPE_HDMI],
139 },
140 {
141 /*.typeId = */ {dsAUDIOPORT_TYPE_SPDIF, 0},
142 /*.connectedVOPs = */ connectedVOPs[dsAUDIOPORT_TYPE_SPDIF],
143 },
144};
145
146}
147#ifdef __cplusplus
148}
149#endif
150
151#endif /* _DS_AUDIOOUTPUTPORTSETTINGS_H */
152
153/** @} */ // End of DS Audio Settings Header
154/** @} */ // End of DS Audio HAL
155/** @} */ // End of Device Settings HAL
156/** @} */ // End of Device Settings Module
157/** @} */ // End of HPK
HAL types.
Device Settings HAL utilities.
enum _dsAudioPortType_t dsAudioPortType_t
This enumeration defines the audio port types.
enum StereoMode dsAudioStereoMode_t
This enumeration defines the type of audio stereo mode.
enum _dsAudioEncoding_t dsAudioEncoding_t
This enumeration defines the audio encoding types.
enum _dsAudioCompression_t dsAudioCompression_t
This enumeration defines the type of audio compression.
@ dsAUDIOPORT_TYPE_SPDIF
SPDIF audio output
Definition dsTypes.h:102
@ dsAUDIOPORT_TYPE_HDMI
HDMI audio output
Definition dsTypes.h:101
@ dsAUDIOPORT_TYPE_MAX
Out of range.
Definition dsTypes.h:106
@ dsAUDIO_STEREO_SURROUND
Surround mode.
Definition dsTypes.h:321
@ dsAUDIO_STEREO_STEREO
Normal stereo mode (L+R)
Definition dsTypes.h:320
@ dsVIDEOPORT_TYPE_HDMI
HDMI video output.
Definition dsTypes.h:385
@ dsVIDEOPORT_TYPE_MAX
Out of range
Definition dsTypes.h:389
@ dsAUDIO_CMP_LIGHT
Light audio level compression.
Definition dsTypes.h:140
@ dsAUDIO_CMP_HEAVY
Heavy audio level compression.
Definition dsTypes.h:142
@ dsAUDIO_CMP_NONE
No audio compression.
Definition dsTypes.h:139
@ dsAUDIO_CMP_MEDIUM
Medium audio level compression.
Definition dsTypes.h:141
@ dsAUDIO_ENC_AC3
AC-3 digital audio encoding format
Definition dsTypes.h:123
@ dsAUDIO_ENC_PCM
PCM digital audio encoding format.
Definition dsTypes.h:122
#define dsUTL_DIM(arr)
Device Settings general Array dimension calculation inline definition.
Definition dsUtl.h:98
Structure that defines audio port configuration.
Definition dsTypes.h:671
Structure that defines audio output device configuration.
Definition dsTypes.h:567
Structure that defines port id associated with video port.
Definition dsTypes.h:602