1 /* 2 * Copyright (c) 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 OHOS_IAUDIO_CODEC_H 17 #define OHOS_IAUDIO_CODEC_H 18 19 #include <memory> 20 21 #include "audio_param.h" 22 #include "audio_data.h" 23 #include "iaudio_codec.h" 24 #include "iaudio_codec_callback.h" 25 26 namespace OHOS { 27 namespace DistributedHardware { 28 class IAudioCodec { 29 public: 30 IAudioCodec() = default; 31 virtual ~IAudioCodec() = default; 32 33 virtual int32_t ConfigureAudioCodec(const AudioCommonParam &codecParam, 34 const std::shared_ptr<IAudioCodecCallback> &codecCallback) = 0; 35 virtual int32_t ReleaseAudioCodec() = 0; 36 virtual int32_t StartAudioCodec() = 0; 37 virtual int32_t StopAudioCodec() = 0; 38 virtual int32_t FeedAudioData(const std::shared_ptr<AudioData> &inputData) = 0; 39 }; 40 } // namespace DistributedHardware 41 } // namespace OHOS 42 #endif // OHOS_IAUDIO_CODEC_H 43