1 /* 2 * Copyright (c) 2022-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HISTREAMER_AUDIO_CAPTURE_TYPE_TRANSLATE_H 17 #define HISTREAMER_AUDIO_CAPTURE_TYPE_TRANSLATE_H 18 19 #include <cstdint> 20 #include "audio_info.h" 21 #include "plugin/common/plugin_audio_tags.h" 22 #include "plugin/common/plugin_types.h" 23 24 namespace OHOS { 25 namespace Media { 26 namespace AuCapturePlugin { 27 bool SampleRateEnum2Num (OHOS::AudioStandard::AudioSamplingRate enumVal, uint32_t& numVal); 28 bool SampleRateNum2Enum (uint32_t numVal, OHOS::AudioStandard::AudioSamplingRate& enumVal); 29 30 bool SampleFmt2PluginFmt(OHOS::AudioStandard::AudioSampleFormat aFmt, OHOS::Media::Plugin::AudioSampleFormat& pFmt); 31 bool PluginFmt2SampleFmt(OHOS::Media::Plugin::AudioSampleFormat pFmt, OHOS::AudioStandard::AudioSampleFormat& aFmt); 32 33 bool ChannelNumEnum2Num(OHOS::AudioStandard::AudioChannel enumVal, uint32_t& numVal); 34 bool ChannelNumNum2Enum(uint32_t numVal, OHOS::AudioStandard::AudioChannel& enumVal); 35 Plugin::Status Error2Status(int32_t err); 36 } // AuCapturePlugin 37 } // Media 38 } // OHOS 39 #endif // HISTREAMER_AUDIO_CAPTURE_TYPE_TRANSLATE_H 40