1d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent/*
2d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent * Copyright (C) 2015 The Android Open Source Project
3d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent *
4d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent * Licensed under the Apache License, Version 2.0 (the "License");
5d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent * you may not use this file except in compliance with the License.
6d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent * You may obtain a copy of the License at
7d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent *
8d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent *      http://www.apache.org/licenses/LICENSE-2.0
9d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent *
10d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent * Unless required by applicable law or agreed to in writing, software
11d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent * distributed under the License is distributed on an "AS IS" BASIS,
12d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent * See the License for the specific language governing permissions and
14d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent * limitations under the License.
15d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent */
16d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
17d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent#pragma once
18d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
19d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent#include <system/audio.h>
20d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent#include <utils/Errors.h>
21d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent#include <utils/KeyedVector.h>
22d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent#include <utils/RefBase.h>
23d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent#include <RoutingStrategy.h>
24d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent#include <AudioPatch.h>
25d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
26d60560af7cb559762593161c8202459cc01fb0f5Eric Laurentnamespace android {
27d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
28d60560af7cb559762593161c8202459cc01fb0f5Eric Laurentclass SwAudioOutputDescriptor;
29d60560af7cb559762593161c8202459cc01fb0f5Eric Laurentclass HwAudioOutputDescriptor;
30d60560af7cb559762593161c8202459cc01fb0f5Eric Laurentclass DeviceDescriptor;
31d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
32d60560af7cb559762593161c8202459cc01fb0f5Eric Laurentclass AudioSourceDescriptor: public RefBase
33d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent{
34d60560af7cb559762593161c8202459cc01fb0f5Eric Laurentpublic:
35d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    AudioSourceDescriptor(const sp<DeviceDescriptor> device, const audio_attributes_t *attributes,
36d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent                          uid_t uid) :
37d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent        mDevice(device), mAttributes(*attributes), mUid(uid) {}
38d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    virtual ~AudioSourceDescriptor() {}
39d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
40d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    audio_patch_handle_t getHandle() const { return mPatchDesc->mHandle; }
41d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
42d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    status_t    dump(int fd);
43d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
44d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    const sp<DeviceDescriptor> mDevice;
45d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    const audio_attributes_t mAttributes;
46d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    uid_t mUid;
47d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    sp<AudioPatch> mPatchDesc;
48d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    wp<SwAudioOutputDescriptor> mSwOutput;
49d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    wp<HwAudioOutputDescriptor> mHwOutput;
50d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent};
51d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
52d60560af7cb559762593161c8202459cc01fb0f5Eric Laurentclass AudioSourceCollection :
53a13cde98a880341f0a56d91da6364b093fb5d24eGlenn Kasten        public DefaultKeyedVector< audio_io_handle_t, sp<AudioSourceDescriptor> >
54d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent{
55d60560af7cb559762593161c8202459cc01fb0f5Eric Laurentpublic:
56d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent    status_t dump(int fd) const;
57d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent};
58d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent
59d60560af7cb559762593161c8202459cc01fb0f5Eric Laurent}; // namespace android
60