• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 Plugin {
27 namespace AuCapturePlugin {
28 bool SampleRateEnum2Num (OHOS::AudioStandard::AudioSamplingRate enumVal, uint32_t& numVal);
29 bool SampleRateNum2Enum (uint32_t numVal, OHOS::AudioStandard::AudioSamplingRate& enumVal);
30 
31 bool SampleFmt2PluginFmt(OHOS::AudioStandard::AudioSampleFormat aFmt, AudioSampleFormat& pFmt);
32 bool PluginFmt2SampleFmt(AudioSampleFormat pFmt, OHOS::AudioStandard::AudioSampleFormat& aFmt);
33 
34 bool ChannelNumEnum2Num(OHOS::AudioStandard::AudioChannel enumVal, uint32_t& numVal);
35 bool ChannelNumNum2Enum(uint32_t numVal, OHOS::AudioStandard::AudioChannel& enumVal);
36 Status Error2Status(int32_t err);
37 } // namespace AuCapturePlugin
38 } // namespace Plugin
39 } // namespace Media
40 } // namespace OHOS
41 #endif // HISTREAMER_AUDIO_CAPTURE_TYPE_TRANSLATE_H
42