blob: f814dd9fc56a75a2a0648f4a5b5e007a6c02ace1 [file] [log] [blame]
Jean-Michel Trivi56ec4ff2015-01-23 16:45:18 -08001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17namespace android {
18
19class HwModule : public RefBase
20{
21public:
22 HwModule(const char *name);
23 ~HwModule();
24
25 status_t loadOutput(cnode *root);
26 status_t loadInput(cnode *root);
27 status_t loadDevice(cnode *root);
28
29 status_t addOutputProfile(String8 name, const audio_config_t *config,
30 audio_devices_t device, String8 address);
31 status_t removeOutputProfile(String8 name);
32 status_t addInputProfile(String8 name, const audio_config_t *config,
33 audio_devices_t device, String8 address);
34 status_t removeInputProfile(String8 name);
35
36 void dump(int fd);
37
38 const char *const mName; // base name of the audio HW module (primary, a2dp ...)
39 uint32_t mHalVersion; // audio HAL API version
40 audio_module_handle_t mHandle;
41 Vector < sp<IOProfile> > mOutputProfiles; // output profiles exposed by this module
42 Vector < sp<IOProfile> > mInputProfiles; // input profiles exposed by this module
43 DeviceVector mDeclaredDevices; // devices declared in audio_policy.conf
44};
45
46}; // namespace android