1 /* 2 * Copyright (c) 2024 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 IPC_OFFLINE_STREAM_H 17 #define IPC_OFFLINE_STREAM_H 18 19 #include <memory> 20 21 #include "ipc_types.h" 22 #include "iremote_broker.h" 23 #include "iremote_proxy.h" 24 #include "iremote_stub.h" 25 26 #include "audio_info.h" 27 #include "oh_audio_buffer.h" 28 29 namespace OHOS { 30 namespace AudioStandard { 31 class IpcOfflineStream : public IRemoteBroker { 32 public: 33 virtual ~IpcOfflineStream() = default; 34 35 virtual int32_t CreateOfflineEffectChain(const std::string &chainName) = 0; 36 37 virtual int32_t ConfigureOfflineEffectChain(const AudioStreamInfo &inInfo, const AudioStreamInfo &outInfo) = 0; 38 39 virtual int32_t PrepareOfflineEffectChain(std::shared_ptr<AudioSharedMemory> &inBuffer, 40 std::shared_ptr<AudioSharedMemory> &outBuffer) = 0; 41 42 virtual int32_t ProcessOfflineEffectChain(uint32_t inSize, uint32_t outSize) = 0; 43 44 virtual void ReleaseOfflineEffectChain() = 0; 45 46 // IPC code. 47 enum IpcOfflineStreamMsg : uint32_t { 48 CREATE_OFFLINE_EFFECT_CHAIN, 49 CONFIGURE_OFFLINE_EFFECT_CHAIN, 50 PREPARE_OFFLINE_EFFECT_CHAIN, 51 PROCESS_OFFLINE_EFFECT_CHAIN, 52 RELEASE_OFFLINE_EFFECT_CHAIN, 53 IPC_OFFLINE_STREAM_MAX_MSG 54 }; 55 DECLARE_INTERFACE_DESCRIPTOR(u"IpcOfflineStream"); 56 }; 57 } // namespace AudioStandard 58 } // namespace OHOS 59 #endif // IPC_OFFLINE_STREAM_H 60