Jean-Michel Trivi | 56ec4ff | 2015-01-23 16:45:18 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
François Gaffie | ad3183e | 2015-03-18 16:55:35 +0100 | [diff] [blame^] | 17 | #pragma once |
| 18 | |
| 19 | #include "Devices.h" |
| 20 | #include <utils/RefBase.h> |
| 21 | #include <utils/String8.h> |
| 22 | #include <utils/Errors.h> |
| 23 | #include <utils/Vector.h> |
| 24 | #include <system/audio.h> |
| 25 | #include <cutils/config_utils.h> |
| 26 | |
Jean-Michel Trivi | 56ec4ff | 2015-01-23 16:45:18 -0800 | [diff] [blame] | 27 | namespace android { |
| 28 | |
François Gaffie | ad3183e | 2015-03-18 16:55:35 +0100 | [diff] [blame^] | 29 | class IOProfile; |
| 30 | |
Jean-Michel Trivi | 56ec4ff | 2015-01-23 16:45:18 -0800 | [diff] [blame] | 31 | class HwModule : public RefBase |
| 32 | { |
| 33 | public: |
| 34 | HwModule(const char *name); |
| 35 | ~HwModule(); |
| 36 | |
| 37 | status_t loadOutput(cnode *root); |
| 38 | status_t loadInput(cnode *root); |
| 39 | status_t loadDevice(cnode *root); |
| 40 | |
| 41 | status_t addOutputProfile(String8 name, const audio_config_t *config, |
| 42 | audio_devices_t device, String8 address); |
| 43 | status_t removeOutputProfile(String8 name); |
| 44 | status_t addInputProfile(String8 name, const audio_config_t *config, |
| 45 | audio_devices_t device, String8 address); |
| 46 | status_t removeInputProfile(String8 name); |
| 47 | |
| 48 | void dump(int fd); |
| 49 | |
| 50 | const char *const mName; // base name of the audio HW module (primary, a2dp ...) |
| 51 | uint32_t mHalVersion; // audio HAL API version |
| 52 | audio_module_handle_t mHandle; |
| 53 | Vector < sp<IOProfile> > mOutputProfiles; // output profiles exposed by this module |
| 54 | Vector < sp<IOProfile> > mInputProfiles; // input profiles exposed by this module |
| 55 | DeviceVector mDeclaredDevices; // devices declared in audio_policy.conf |
| 56 | }; |
| 57 | |
| 58 | }; // namespace android |