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 #ifndef AUDIO_PROXY_COMMON_H
16 #define AUDIO_PROXY_COMMON_H
17 
18 #include <servmgr_hdi.h>
19 #include "audio_internal.h"
20 #include "hdf_audio_server.h"
21 
22 #ifdef LOG_DOMAIN
23 #undef LOG_DOMAIN
24 #endif
25 
26 #define LOG_DOMAIN 0xD000105
27 
28 namespace OHOS::HDI::Audio_Bluetooth {
29 #define CONFIG_CHANNEL_COUNT  2 // two channels
30 #define GAIN_MAX 50.0
31 #define STR_MAX 512
32 
33 struct HdfSBuf *AudioProxyObtainHdfSBuf(void);
34 void AudioProxyBufReplyRecycle(struct HdfSBuf *data, struct HdfSBuf *reply);
35 int32_t AudioProxyPreprocessSBuf(struct HdfSBuf **data, struct HdfSBuf **reply);
36 int32_t AudioProxyDispatchCall(struct HdfRemoteService *self, int32_t id, struct HdfSBuf *data, struct HdfSBuf *reply);
37 int32_t AudioProxyPreprocessRender(struct AudioHwRender *render, struct HdfSBuf **data, struct HdfSBuf **reply);
38 int32_t AudioProxyWriteSampleAttributes(struct HdfSBuf *data, const struct AudioSampleAttributes *attrs);
39 int32_t AudioProxyReadSapmleAttrbutes(struct HdfSBuf *reply, struct AudioSampleAttributes *attrs);
40 int32_t AudioProxyCommonSetRenderCtrlParam(int cmId, AudioHandle handle, float param);
41 int32_t AudioProxyCommonGetRenderCtrlParam(int cmId, AudioHandle handle, float *param);
42 int32_t AudioProxyGetMmapPositionRead(struct HdfSBuf *reply, uint64_t *frames, struct AudioTimeStamp *time);
43 int32_t AudioProxyReqMmapBufferWrite(struct HdfSBuf *data, int32_t reqSize,
44     const struct AudioMmapBufferDescriptor *desc);
45 }
46 #endif
47