• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef ST_AUDIO_CONFIG_H
17 #define ST_AUDIO_CONFIG_H
18 
19 #include <list>
20 #include <set>
21 #include <string>
22 #include <vector>
23 
24 #include "audio_info.h"
25 #include "audio_policy_log.h"
26 
27 namespace OHOS {
28 namespace AudioStandard {
29 namespace {
30 static const char* PRIMARY_CLASS = "primary";
31 static const char* A2DP_CLASS = "a2dp";
32 static const char* USB_CLASS = "usb";
33 static const char* DP_CLASS = "dp";
34 static const char* FILE_CLASS = "file_io";
35 static const char* REMOTE_CLASS = "remote";
36 static const char* OFFLOAD_CLASS = "offload";
37 static const char* MCH_CLASS = "multichannel";
38 static const char* INVALID_CLASS = "invalid";
39 static const char* DIRECT_VOIP_CLASS = "primary_direct_voip";
40 static const char* MMAP_VOIP_CLASS = "primary_mmap_voip";
41 static const char* BLUETOOTH_SPEAKER = "Bt_Speaker";
42 static const char* BLUETOOTH_MIC = "Bt_Mic";
43 static const char* PRIMARY_SPEAKER = "Speaker";
44 static const char* OFFLOAD_PRIMARY_SPEAKER = "Offload_Speaker";
45 static const char* MCH_PRIMARY_SPEAKER = "MCH_Speaker";
46 static const char* USB_SPEAKER = "Usb_arm_speaker";
47 static const char* DP_SINK = "DP_speaker";
48 static const char* USB_MIC = "Usb_arm_mic";
49 static const char* PRIMARY_MIC = "Built_in_mic";
50 static const char* PRIMARY_WAKEUP_MIC = "Built_in_wakeup";
51 static const char* FILE_SINK = "file_sink";
52 static const char* FILE_SOURCE = "file_source";
53 static const char* PIPE_SINK = "fifo_output";
54 static const char* PIPE_SOURCE = "fifo_input";
55 static const char* INTERNAL_PORT = "internal";
56 static const char* ROLE_SOURCE = "source";
57 static const char* ROLE_SINK = "sink";
58 static const char* PORT_NONE = "none";
59 static const char* PRIMARY_DIRECT_VOIP = "direct_voip";
60 static const char* PRIMARY_MMAP_VOIP = "mmap_voip";
61 }
62 
63 enum NodeName {
64     DEVICE_CLASS,
65     MODULES,
66     MODULE,
67     PORTS,
68     PORT,
69     AUDIO_INTERRUPT_ENABLE,
70     UPDATE_ROUTE_SUPPORT,
71     AUDIO_LATENCY,
72     SINK_LATENCY,
73     VOLUME_GROUP_CONFIG,
74     INTERRUPT_GROUP_CONFIG,
75     UNKNOWN
76 };
77 
78 enum ClassType {
79     TYPE_PRIMARY,
80     TYPE_A2DP,
81     TYPE_USB,
82     TYPE_FILE_IO,
83     TYPE_REMOTE_AUDIO,
84     TYPE_DP,
85     TYPE_INVALID
86 };
87 
88 struct AudioModuleInfo {
89     std::string className;
90     std::string name;
91     std::string adapterName;
92     std::string id;
93     std::string lib;
94     std::string role;
95 
96     std::string rate;
97 
98     std::set<uint32_t> supportedRate_;
99     std::set<uint32_t> supportedChannels_;
100 
101     std::string format;
102     std::string channels;
103     std::string bufferSize;
104     std::string fixedLatency;
105     std::string sinkLatency;
106     std::string renderInIdleState;
107     std::string OpenMicSpeaker;
108     std::string fileName;
109     std::string networkId;
110     std::string deviceType;
111     std::string sceneName;
112     std::string sourceType;
113     std::string offloadEnable;
114     std::string defaultAdapterEnable;
115 
116     std::string ecType;
117     std::string ecAdapter;
118     std::string ecSamplingRate;
119     std::string ecFormat;
120     std::string ecChannels;
121     std::string openMicRef;
122     std::string micRefRate;
123     std::string micRefFormat;
124     std::string micRefChannels;
125 
126     std::list<AudioModuleInfo> ports;
127     std::string extra;
128 };
129 
130 } // namespace AudioStandard
131 } // namespace OHOS
132 
133 #endif // ST_AUDIO_CONFIG_H
134