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 MULTIMEDIA_AUDIO_COMMON_H 17 #define MULTIMEDIA_AUDIO_COMMON_H 18 #include "cj_common_ffi.h" 19 #include "audio_info.h" 20 #include "audio_system_manager.h" 21 #include "multimedia_audio_ffi.h" 22 23 namespace OHOS { 24 namespace AudioStandard { 25 void Convert2AudioCapturerOptions(AudioCapturerOptions &opions, const CAudioCapturerOptions &cOptions); 26 char *MallocCString(const std::string &origin); 27 void Convert2CAudioCapturerInfo(CAudioCapturerInfo &cInfo, const AudioCapturerInfo &capturerInfo); 28 void Convert2CAudioStreamInfo(CAudioStreamInfo &cInfo, const AudioStreamInfo &streamInfo); 29 void Convert2CAudioCapturerChangeInfo(CAudioCapturerChangeInfo &cInfo, const AudioCapturerChangeInfo &changeInfo, 30 int32_t *errorCode); 31 void Convert2CArrDeviceDescriptor(CArrDeviceDescriptor &devices, 32 const std::vector<sptr<AudioDeviceDescriptor>> &deviceDescriptors, 33 int32_t *errorCode); 34 void Convert2CDeviceDescriptor(CDeviceDescriptor *device, const DeviceInfo &deviceInfo, int32_t *errorCode); 35 void Convert2CArrDeviceDescriptorByDeviceInfo(CArrDeviceDescriptor &devices, const DeviceInfo &deviceInfo, 36 int32_t *errorCode); 37 void ConvertAudioDeviceDescriptor2DeviceInfo(DeviceInfo &deviceInfo, sptr<AudioDeviceDescriptor> audioDeviceDescriptor); 38 } // namespace AudioStandard 39 } // namespace OHOS 40 #endif // MULTIMEDIA_AUDIO_COMMON_H 41