blob: d9e6cdfb98fdf65dd9d1fb0787570e3e957dac0f [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
François Gaffiead3183e2015-03-18 16:55:35 +010017#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 Trivi56ec4ff2015-01-23 16:45:18 -080027namespace android {
28
François Gaffiead3183e2015-03-18 16:55:35 +010029class IOProfile;
30
Jean-Michel Trivi56ec4ff2015-01-23 16:45:18 -080031class HwModule : public RefBase
32{
33public:
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