blob: 02579e636829ac4ea6c876079071ce06e09cc827 [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
19// descriptor for audio inputs. Used to maintain current configuration of each opened audio input
20// and keep track of the usage of this input.
21class AudioInputDescriptor: public AudioPortConfig
22{
23public:
24 AudioInputDescriptor(const sp<IOProfile>& profile);
25
26 status_t dump(int fd);
27
28 audio_port_handle_t mId;
29 audio_io_handle_t mIoHandle; // input handle
30 audio_devices_t mDevice; // current device this input is routed to
31 AudioMix *mPolicyMix; // non NULL when used by a dynamic policy
32 audio_patch_handle_t mPatchHandle;
33 uint32_t mRefCount; // number of AudioRecord clients using
34 // this input
35 uint32_t mOpenRefCount;
36 audio_source_t mInputSource; // input source selected by application
37 //(mediarecorder.h)
38 const sp<IOProfile> mProfile; // I/O profile this output derives from
39 SortedVector<audio_session_t> mSessions; // audio sessions attached to this input
40 bool mIsSoundTrigger; // used by a soundtrigger capture
41
42 virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
43 const struct audio_port_config *srcConfig = NULL) const;
44 virtual sp<AudioPort> getAudioPort() const { return mProfile; }
45 void toAudioPort(struct audio_port *port) const;
46};
47
48}; // namespace android