• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef AUDIO_ADAPTER_INFO_COMMON_H
17 #define AUDIO_ADAPTER_INFO_COMMON_H
18 
19 #include <stdio.h>
20 #include <dlfcn.h>
21 #include <sys/stat.h>
22 #include <sys/types.h>
23 #include <fcntl.h>
24 #include <stdlib.h>
25 #include <errno.h>
26 #include <string.h>
27 #include <time.h>
28 #include "securec.h"
29 #include "audio_types.h"
30 #include "audio_internal.h"
31 
32 struct AudioAdapterDescriptor *AudioAdapterGetConfigOut(void);
33 struct AudioAdapterDescriptor *AudioAdapterGetConfigDescs(void);
34 int32_t AudioAdapterGetAdapterNum(void);
35 int32_t AudioAdaptersForUser(struct AudioAdapterDescriptor **descs, int *size);
36 int32_t AudioAdapterExist(const char *adapterName);
37 int32_t HdmiPortInit(struct AudioPort portIndex, struct AudioPortCapability *capabilityIndex);
38 int32_t KeyValueListToMap(const char *keyValueList, struct ParamValMap mParamValMap[], int32_t *count);
39 int32_t AddElementToList(char *keyValueList, int32_t listLenth, const char *key, void *value);
40 int32_t GetErrorReason(int reason, char* reasonDesc);
41 int32_t GetCurrentTime(char *time);
42 int32_t CheckAttrRoute(long param);
43 int32_t CheckAttrChannel(unsigned long param);
44 int32_t TransferRoute(const char *value, int32_t *route);
45 int32_t TransferFormat(const char *value, int32_t *format);
46 int32_t TransferChannels(const char *value, uint32_t *channels);
47 int32_t TransferFrames(const char *value, uint64_t *frames);
48 int32_t TransferSampleRate(const char *value, uint32_t *sampleRate);
49 int32_t FormatToBits(enum AudioFormat format, uint32_t *formatBits);
50 int32_t BitsToFormat(enum AudioFormat *format, long formatBits);
51 int32_t SetExtParam(const char *key, const char *value, struct ExtraParams *mExtraParams);
52 int32_t AudioSetExtraParams(const char *keyValueList, int32_t *count,
53     struct ExtraParams *mExtraParams, int32_t *sumOk);
54 void AudioAdapterAddrMgrInit(void);
55 int32_t AudioAddAdapterAddrToList(AudioHandle adapter, const struct AudioAdapterDescriptor *desc);
56 int32_t AudioCheckAdapterAddr(AudioHandle adapter);
57 int32_t AudioDelAdapterAddrFromList(AudioHandle adapter);
58 int32_t AudioAddRenderAddrToList(AudioHandle render);
59 int32_t AudioCheckRenderAddr(AudioHandle render);
60 int32_t AudioDelRenderAddrFromList(AudioHandle render);
61 int32_t AudioAddCaptureAddrToList(AudioHandle capture);
62 int32_t AudioCheckCaptureAddr(AudioHandle capture);
63 int32_t AudioDelCaptureAddrFromList(AudioHandle capture);
64 void AudioSetFuzzCheckFlag(bool check);
65 
66 #endif
67