1 /* 2 * Copyright (C) 2020 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 #pragma once 18 #include <array> 19 #include <android/hardware/audio/common/6.0/types.h> 20 #include <android/hardware/audio/6.0/types.h> 21 #include <utils/Timers.h> 22 23 namespace android { 24 namespace hardware { 25 namespace audio { 26 namespace V6_0 { 27 namespace implementation { 28 namespace util { 29 30 using ::android::hardware::hidl_bitfield; 31 using ::android::hardware::audio::common::V6_0::AudioFormat; 32 using ::android::hardware::audio::common::V6_0::AudioChannelMask; 33 using ::android::hardware::audio::common::V6_0::AudioConfig; 34 using ::android::hardware::audio::V6_0::MicrophoneInfo; 35 36 MicrophoneInfo getMicrophoneInfo(); 37 38 size_t countChannels(hidl_bitfield<AudioChannelMask>); 39 size_t getBytesPerSample(AudioFormat); 40 41 bool checkAudioConfig(bool isOut, 42 size_t duration_ms, 43 const AudioConfig &cfg, 44 AudioConfig &suggested); 45 46 TimeSpec nsecs2TimeSpec(nsecs_t); 47 48 } // namespace util 49 } // namespace implementation 50 } // namespace V6_0 51 } // namespace audio 52 } // namespace hardware 53 } // namespace android 54