1 /* 2 * Copyright (c) 2021 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 /** 17 * @addtogroup Audio 18 * @{ 19 * 20 * @brief Defines audio-related APIs, including custom data types and functions for loading drivers, 21 * accessing a driver adapter, and rendering and capturing audios. 22 * 23 * @since 1.0 24 * @version 1.0 25 */ 26 27 /** 28 * @file audio_manager.h 29 * 30 * @brief Declares APIs for audio adapter management and loading. 31 * 32 * @since 1.0 33 * @version 1.0 34 */ 35 36 #ifndef AUDIO_PROXY_MANAGER_H 37 #define AUDIO_PROXY_MANAGER_H 38 #include <servmgr_hdi.h> 39 #include "audio_adapter.h" 40 namespace OHOS::HDI::Audio_Bluetooth { 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 struct AudioProxyManager { 46 struct HdfRemoteService *remote; 47 int32_t (*GetAllAdapters)(struct AudioProxyManager *manager, struct AudioAdapterDescriptor **descs, int32_t *size); 48 int32_t (*LoadAdapter)(struct AudioProxyManager *manager, const struct AudioAdapterDescriptor *desc, 49 struct AudioAdapter **adapter); 50 void (*UnloadAdapter)(const struct AudioProxyManager *manager, const struct AudioAdapter *adapter); 51 }; 52 53 int32_t AudioProxyManagerGetAllAdapters(struct AudioProxyManager *manager, 54 struct AudioAdapterDescriptor **descs, 55 int *size); 56 int32_t AudioProxyManagerLoadAdapter(struct AudioProxyManager *manager, const struct AudioAdapterDescriptor *desc, 57 struct AudioAdapter **adapter); 58 void AudioProxyManagerUnloadAdapter(const struct AudioProxyManager *manager, const struct AudioAdapter *adapter); 59 60 struct AudioProxyManager *GetAudioProxyManagerFuncs(void); 61 62 #ifdef __cplusplus 63 } 64 #endif 65 } 66 #endif /* AUDIO_MANAGER_H */ 67 /** @} */ 68