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 HDF_I_AUDIO_ATTRIBUTE_H 17 #define HDF_I_AUDIO_ATTRIBUTE_H 18 19 namespace OHOS { 20 namespace DistributedHardware { 21 class IAudioAttribute { 22 virtual int32_t GetFrameSize(uint64_t &size) = 0; 23 24 virtual int32_t GetFrameCount(uint64_t &count) = 0; 25 26 virtual int32_t SetSampleAttributes(const AudioSampleAttributesHAL &attrs) = 0; 27 28 virtual int32_t GetSampleAttributes(AudioSampleAttributesHAL &attrs) = 0; 29 30 virtual int32_t GetCurrentChannelId(uint32_t &channelId) = 0; 31 32 virtual int32_t SetExtraParams(const std::string &keyValueList) = 0; 33 34 virtual int32_t GetExtraParams(std::string &keyValueList) = 0; 35 36 virtual int32_t ReqMmapBuffer(int32_t reqSize, AudioMmapBufferDescriptorHAL &desc) = 0; 37 38 virtual int32_t GetMmapPosition(uint64_t &frames, AudioTimeStampHAL &time) = 0; 39 }; 40 } // namespace DistributedHardware 41 } // namespace OHOS 42 #endif // HDF_I_AUDIO_ATTRIBUTE_H