• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 OH_AUDIO_STREAM_MANAGER_H
17 #define OH_AUDIO_STREAM_MANAGER_H
18 
19 #include "audio_common_log.h"
20 #include "native_audio_stream_manager.h"
21 #include "native_audio_common.h"
22 #include "audio_stream_manager.h"
23 
24 namespace OHOS {
25 namespace AudioStandard {
26 
27 class OHAudioStreamManager {
28 public:
29     ~OHAudioStreamManager();
30 
GetInstance()31     static OHAudioStreamManager* GetInstance()
32     {
33         if (!ohAudioStreamManager_) {
34             ohAudioStreamManager_ = new OHAudioStreamManager();
35         }
36         return ohAudioStreamManager_;
37     }
38 
39     OH_AudioStream_DirectPlaybackMode GetDirectPlaybackSupport(AudioStreamInfo streamInfo, StreamUsage usage);
40 
41     bool IsAcousticEchoCancelerSupported(SourceType sourceType);
42 
43     bool IsFastPlaybackSupported(AudioStreamInfo &streamInfo, StreamUsage usage);
44     bool IsFastRecordingSupported(AudioStreamInfo &streamInfo, SourceType source);
45 
46 private:
47     OHAudioStreamManager();
48     static OHAudioStreamManager *ohAudioStreamManager_;
49     AudioStreamManager *audioStreamManager_ = AudioStreamManager::GetInstance();
50 };
51 OHAudioStreamManager* OHAudioStreamManager::ohAudioStreamManager_ = nullptr;
52 
53 } // namespace AudioStandard
54 } // namespace OHOS
55 #endif // OH_AUDIO_STREAM_MANAGER_H
56