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 "audio_internal.h" 19 #include "hdf_audio_server.h" 20 21 #define CONFIG_CHANNEL_COUNT 2 // two channels 22 #define GAIN_MAX 50.0 23 #define STR_MAX 512 24 25 struct HdfSBuf *AudioProxyObtainHdfSBuf(); 26 void AudioProxyBufReplyRecycle(struct HdfSBuf *data, struct HdfSBuf *reply); 27 int32_t AudioProxyPreprocessSBuf(struct HdfSBuf **data, struct HdfSBuf **reply); 28 int32_t AudioProxyDispatchCall(struct HdfRemoteService *self, int32_t id, struct HdfSBuf *data, struct HdfSBuf *reply); 29 int32_t AudioProxyPreprocessRender(struct AudioHwRender *render, struct HdfSBuf **data, struct HdfSBuf **reply); 30 int32_t AudioProxyPreprocessCapture(struct AudioHwCapture *capture, 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 AudioProxyCommonSetCaptureCtrlParam(int cmId, AudioHandle handle, float param); 36 int32_t AudioProxyCommonGetCaptureCtrlParam(int cmId, AudioHandle handle, float *param); 37 int32_t AudioProxyGetMmapPositionRead(struct HdfSBuf *reply, uint64_t *frames, struct AudioTimeStamp *time); 38 int32_t AudioProxyReqMmapBufferWrite(struct HdfSBuf *data, int32_t reqSize, 39 const struct AudioMmapBufferDescripter *desc); 40 41 #endif 42