• 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_PROXY_INTERNAL_H
17 #define AUDIO_PROXY_INTERNAL_H
18 
19 #include "audio_adapter.h"
20 namespace OHOS::HDI::Audio_Bluetooth {
21 int32_t AudioProxyAdapterInitAllPorts(struct AudioAdapter *adapter);
22 int32_t AudioProxyAdapterCreateRender(struct AudioAdapter *adapter,
23     const struct AudioDeviceDescriptor *desc,
24     const struct AudioSampleAttributes *attrs,
25     struct AudioRender **render);
26 int32_t AudioProxyAdapterDestroyRender(struct AudioAdapter *adapter,
27     struct AudioRender *render);
28 int32_t AudioProxyAdapterGetPortCapability(struct AudioAdapter *adapter,
29     const struct AudioPort *port, struct AudioPortCapability *capability);
30 int32_t AudioProxyAdapterSetPassthroughMode(struct AudioAdapter *adapter,
31     const struct AudioPort *port, AudioPortPassthroughMode mode);
32 int32_t AudioProxyAdapterGetPassthroughMode(struct AudioAdapter *adapter,
33     const struct AudioPort *port, AudioPortPassthroughMode *mode);
34 int32_t AudioProxyRenderStart(AudioHandle handle);
35 int32_t AudioProxyRenderStop(AudioHandle handle);
36 int32_t AudioProxyRenderPause(AudioHandle handle);
37 int32_t AudioProxyRenderResume(AudioHandle handle);
38 int32_t AudioProxyRenderFlush(AudioHandle handle);
39 int32_t AudioProxyRenderGetFrameSize(const AudioHandle handle, uint64_t *size);
40 int32_t AudioProxyRenderGetFrameCount(const AudioHandle handle, uint64_t *count);
41 int32_t AudioProxyRenderSetSampleAttributes(const AudioHandle handle,
42     const struct AudioSampleAttributes *attrs);
43 int32_t AudioProxyRenderGetSampleAttributes(const AudioHandle handle,
44     struct AudioSampleAttributes *attrs);
45 int32_t AudioProxyRenderGetCurrentChannelId(const AudioHandle handle, uint32_t *channelId);
46 int32_t AudioProxyRenderCheckSceneCapability(const AudioHandle handle,
47     const struct AudioSceneDescriptor *scene, bool *supported);
48 int32_t AudioProxyRenderSelectScene(const AudioHandle handle,
49     const struct AudioSceneDescriptor *scene);
50 int32_t AudioProxyRenderSetMute(const AudioHandle handle, bool mute);
51 int32_t AudioProxyRenderGetMute(const AudioHandle handle, bool *mute);
52 int32_t AudioProxyRenderSetVolume(const AudioHandle handle, float volume);
53 int32_t AudioProxyRenderGetVolume(const AudioHandle handle, float *volume);
54 int32_t AudioProxyRenderGetGainThreshold(AudioHandle handle, float *min, float *max);
55 int32_t AudioProxyRenderGetGain(const AudioHandle handle, float *gain);
56 int32_t AudioProxyRenderSetGain(const AudioHandle handle, float gain);
57 int32_t AudioProxyRenderGetLatency(struct AudioRender *render, uint32_t *ms);
58 int32_t AudioProxyRenderRenderFrame(struct AudioRender *render, const void *frame,
59     uint64_t requestBytes, uint64_t *replyBytes);
60 int32_t AudioProxyRenderGetRenderPosition(struct AudioRender *render,
61     uint64_t *frames, struct AudioTimeStamp *time);
62 int32_t AudioProxyRenderSetRenderSpeed(struct AudioRender *render, float speed);
63 int32_t AudioProxyRenderGetRenderSpeed(struct AudioRender *render, float *speed);
64 int32_t AudioProxyRenderSetChannelMode(struct AudioRender *render, AudioChannelMode mode);
65 int32_t AudioProxyRenderGetChannelMode(struct AudioRender *render, AudioChannelMode *mode);
66 int32_t AudioProxyRenderSetExtraParams(AudioHandle render, const char *keyValueList);
67 int32_t AudioProxyRenderGetExtraParams(AudioHandle render, char *keyValueList, int32_t listLenth);
68 int32_t AudioProxyRenderReqMmapBuffer(AudioHandle render, int32_t reqSize, struct AudioMmapBufferDescriptor *desc);
69 int32_t AudioProxyRenderGetMmapPosition(AudioHandle render, uint64_t *frames, struct AudioTimeStamp *time);
70 int32_t AudioProxyRenderTurnStandbyMode(AudioHandle render);
71 int32_t AudioProxyRenderAudioDevDump(AudioHandle render, int32_t range, int32_t fd);
72 int32_t AudioProxyRenderRegCallback(struct AudioRender *render, RenderCallback callback, void *cookie);
73 int32_t AudioProxyRenderDrainBuffer(struct AudioRender *render, AudioDrainNotifyType *type);
74 }
75 #endif
76