• 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 #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 namespace OHOS::HDI::Audio_Bluetooth {
22 #define CONFIG_CHANNEL_COUNT  2 // two channels
23 #define GAIN_MAX 50.0
24 #define STR_MAX 512
25 
26 struct HdfSBuf *AudioProxyObtainHdfSBuf(void);
27 void AudioProxyBufReplyRecycle(struct HdfSBuf *data, struct HdfSBuf *reply);
28 int32_t AudioProxyPreprocessSBuf(struct HdfSBuf **data, struct HdfSBuf **reply);
29 int32_t AudioProxyDispatchCall(struct HdfRemoteService *self, int32_t id, struct HdfSBuf *data, struct HdfSBuf *reply);
30 int32_t AudioProxyPreprocessRender(struct AudioHwRender *render, struct HdfSBuf **data, struct HdfSBuf **reply);
31 int32_t AudioProxyWriteSampleAttributes(struct HdfSBuf *data, const struct AudioSampleAttributes *attrs);
32 int32_t AudioProxyReadSapmleAttrbutes(struct HdfSBuf *reply, struct AudioSampleAttributes *attrs);
33 int32_t AudioProxyCommonSetRenderCtrlParam(int cmId, AudioHandle handle, float param);
34 int32_t AudioProxyCommonGetRenderCtrlParam(int cmId, AudioHandle handle, float *param);
35 int32_t AudioProxyGetMmapPositionRead(struct HdfSBuf *reply, uint64_t *frames, struct AudioTimeStamp *time);
36 int32_t AudioProxyReqMmapBufferWrite(struct HdfSBuf *data, int32_t reqSize,
37     const struct AudioMmapBufferDescriptor *desc);
38 }
39 #endif
40