• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-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 I_AUDIO_PROCESS_STREAM_H
17 #define I_AUDIO_PROCESS_STREAM_H
18 
19 #include <memory>
20 
21 #include "oh_audio_buffer.h"
22 
23 namespace OHOS {
24 namespace AudioStandard {
25 class IAudioProcessStream {
26 public:
27     /**
28      * Get buffer of client for AudioEndpoint.
29     */
30     virtual std::shared_ptr<OHAudioBuffer> GetStreamBuffer() = 0;
31 
32     virtual AudioStreamInfo GetStreamInfo() = 0;
33 
34     virtual uint32_t GetAudioSessionId() = 0;
35 
36     virtual AudioStreamType GetAudioStreamType() = 0;
37 
38     virtual void SetInnerCapState(bool isInnerCapped, int32_t innerCapId) = 0;
39     virtual bool GetInnerCapState(int32_t innerCapId) = 0;
40     virtual std::unordered_map<int32_t, bool> GetInnerCapState() = 0;
41 
42     virtual AppInfo GetAppInfo() = 0;
43 
44     virtual BufferDesc &GetConvertedBuffer() = 0;
45 
46     virtual bool GetMuteState() = 0;
47 
48     virtual AudioProcessConfig GetAudioProcessConfig() = 0;
49 
50     virtual void WriteDumpFile(void *buffer, size_t bufferSize) = 0;
51 
52     virtual int32_t SetDefaultOutputDevice(const DeviceType defaultOutputDevice) = 0;
53 
54     virtual int32_t SetSilentModeAndMixWithOthers(bool on) = 0;
55 
56     virtual void EnableStandby();
57 
58     virtual ~IAudioProcessStream() = default;
59 
60     virtual std::time_t GetStartMuteTime() = 0;
61     virtual void SetStartMuteTime(std::time_t time) = 0;
62 
63     virtual bool GetSilentState() = 0;
64     virtual void SetSilentState(bool state) = 0;
65     virtual void AddMuteWriteFrameCnt(int64_t muteFrameCnt) = 0;
66 };
67 } // namespace AudioStandard
68 } // namespace OHOS
69 #endif // I_AUDIO_PROCESS_STREAM_H
70