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 FAST_AUDIO_RENDER_H
17 #define FAST_AUDIO_RENDER_H
18 
19 #include "audio_common.h"
20 #include "audio_manager.h"
21 #include "hdf_base.h"
22 
23 namespace OHOS::HDI::Audio_Bluetooth {
24 int32_t FastRenderStart(AudioHandle handle);
25 int32_t FastRenderStop(AudioHandle handle);
26 int32_t FastRenderPause(AudioHandle handle);
27 int32_t FastRenderResume(AudioHandle handle);
28 int32_t FastRenderFlush(AudioHandle handle);
29 int32_t FastRenderGetFrameSize(AudioHandle handle, uint64_t *size);
30 int32_t FastRenderGetFrameCount(AudioHandle handle, uint64_t *count);
31 int32_t FastRenderSetSampleAttributes(AudioHandle handle, const struct AudioSampleAttributes *attrs);
32 int32_t FastRenderGetSampleAttributes(AudioHandle handle, struct AudioSampleAttributes *attrs);
33 int32_t FastRenderGetCurrentChannelId(AudioHandle handle, uint32_t *channelId);
34 int32_t FastRenderCheckSceneCapability(AudioHandle handle, const struct AudioSceneDescriptor *scene, bool *supported);
35 int32_t FastRenderSelectScene(AudioHandle handle, const struct AudioSceneDescriptor *scene);
36 int32_t FastRenderSetMute(AudioHandle handle, bool mute);
37 int32_t FastRenderGetMute(AudioHandle handle, bool *mute);
38 int32_t FastRenderSetVolume(AudioHandle handle, float volume);
39 int32_t FastRenderGetVolume(AudioHandle handle, float *volume);
40 int32_t FastRenderGetGainThreshold(AudioHandle handle, float *min, float *max);
41 int32_t FastRenderGetGain(AudioHandle handle, float *gain);
42 int32_t FastRenderSetGain(AudioHandle handle, float gain);
43 int32_t FastRenderGetLatency(struct AudioRender *render, uint32_t *ms);
44 int32_t FastRenderRenderFrame(
45     struct AudioRender *render, const void *frame, uint64_t requestBytes, uint64_t *replyBytes);
46 int32_t FastRenderGetRenderPosition(struct AudioRender *render, uint64_t *frames, struct AudioTimeStamp *time);
47 int32_t FastRenderSetRenderSpeed(struct AudioRender *render, float speed);
48 int32_t FastRenderGetRenderSpeed(struct AudioRender *render, float *speed);
49 int32_t FastRenderSetChannelMode(struct AudioRender *render, AudioChannelMode mode);
50 int32_t FastRenderGetChannelMode(struct AudioRender *render, AudioChannelMode *mode);
51 int32_t FastRenderSetExtraParams(AudioHandle handle, const char *keyValueList);
52 int32_t FastRenderGetExtraParams(AudioHandle handle, char *keyValueList, int32_t listLength);
53 int32_t FastRenderReqMmapBuffer(AudioHandle handle, int32_t reqSize, struct AudioMmapBufferDescriptor *desc);
54 int32_t FastRenderGetMmapPosition(AudioHandle handle, uint64_t *frames, struct AudioTimeStamp *time);
55 int32_t FastRenderTurnStandbyMode(AudioHandle handle);
56 int32_t FastRenderAudioDevDump(AudioHandle handle, int32_t range, int32_t fd);
57 int32_t FastRenderRegCallback(struct AudioRender *render, RenderCallback callback, void *cookie);
58 int32_t FastRenderDrainBuffer(struct AudioRender *render, AudioDrainNotifyType *type);
59 } // namespace OHOS::HDI::Audio_Bluetooth
60 
61 #endif