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