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 OH_AUDIO_DEVICE_DESCRIPTOR_H
17 #define OH_AUDIO_DEVICE_DESCRIPTOR_H
18 
19 #include "audio_info.h"
20 #include "audio_common_log.h"
21 #include "native_audio_routing_manager.h"
22 #include "native_audio_common.h"
23 #include "native_audio_device_base.h"
24 #include "audio_system_manager.h"
25 #include "audio_routing_manager.h"
26 
27 namespace OHOS {
28 namespace AudioStandard {
29 
30 class OHAudioDeviceDescriptor {
31 public:
32     explicit OHAudioDeviceDescriptor(sptr<AudioDeviceDescriptor> audioDeviceDescriptor);
33     ~OHAudioDeviceDescriptor();
34 
35     OH_AudioCommon_Result GetDeviceRole(OH_AudioDevice_Role *deviceRole);
36     OH_AudioCommon_Result GetDeviceType(OH_AudioDevice_Type *deviceType);
37     OH_AudioCommon_Result GetDeviceId(uint32_t *id);
38     OH_AudioCommon_Result GetDeviceName(char **name);
39     OH_AudioCommon_Result GetDeviceAddress(char **address);
40     OH_AudioCommon_Result GetDeviceSampleRates(uint32_t **sampleRates, uint32_t *size);
41     OH_AudioCommon_Result GetDeviceChannelCounts(uint32_t **channelCounts, uint32_t *size);
42     OH_AudioCommon_Result GetDeviceDisplayName(char **displayName);
43     OH_AudioCommon_Result GetDeviceEncodingTypes(OH_AudioStream_EncodingType **encodingTypes, uint32_t *size);
44 
45 private:
46     sptr<AudioDeviceDescriptor> audioDeviceDescriptor_;
47     uint32_t *audioSamplingRate_ = nullptr;
48     uint32_t *audioChannel_ = nullptr;
49     OH_AudioStream_EncodingType *encodingType_ = nullptr;
50 };
51 
52 } // namespace AudioStandard
53 } // namespace OHOS
54 #endif // OH_AUDIO_DEVICE_DESCRIPTOR_H