AudioIoDescriptor.h revision 73e26b661af50be2c0a4ff6c9ac85f7347a8b235
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
17#ifndef ANDROID_AUDIO_IO_DESCRIPTOR_H
18#define ANDROID_AUDIO_IO_DESCRIPTOR_H
19
20namespace android {
21
22enum audio_io_config_event {
23    AUDIO_OUTPUT_OPENED,
24    AUDIO_OUTPUT_CLOSED,
25    AUDIO_OUTPUT_CONFIG_CHANGED,
26    AUDIO_INPUT_OPENED,
27    AUDIO_INPUT_CLOSED,
28    AUDIO_INPUT_CONFIG_CHANGED,
29};
30
31// audio input/output descriptor used to cache output configurations in client process to avoid
32// frequent calls through IAudioFlinger
33class AudioIoDescriptor : public RefBase {
34public:
35    AudioIoDescriptor() :
36        mSamplingRate(0), mFormat(AUDIO_FORMAT_DEFAULT), mChannelMask(AUDIO_CHANNEL_NONE),
37        mFrameCount(0), mLatency(0) {}
38
39    virtual ~AudioIoDescriptor() {}
40
41    audio_io_handle_t mIoHandle;
42    uint32_t mSamplingRate;
43    audio_format_t mFormat;
44    audio_channel_mask_t mChannelMask;
45    size_t mFrameCount;
46    uint32_t mLatency;
47};
48
49
50};  // namespace android
51
52#endif  /*ANDROID_AUDIO_IO_DESCRIPTOR_H*/
53