• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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_IF_LIB_RENDER_H
17 #define AUDIO_IF_LIB_RENDER_H
18 
19 #include "audio_if_lib_common.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #define RENDER_CMD  "render" // For Bind render service
26 
27 enum AudioInterfaceLibRenderCtrl {
28     AUDIODRV_CTL_IOCTL_ELEM_INFO = CTRL_NUM, // Ctrl
29     AUDIODRV_CTL_IOCTL_ELEM_READ,
30     AUDIODRV_CTL_IOCTL_ELEM_WRITE,
31     AUDIODRV_CTL_IOCTL_MUTE_READ,     // mute
32     AUDIODRV_CTL_IOCTL_MUTE_WRITE,
33     AUDIODRV_CTL_IOCTL_PAUSE_WRITE,
34     AUDIODRV_CTL_IOCTL_CHANNEL_MODE_READ,
35     AUDIODRV_CTL_IOCTL_CHANNEL_MODE_WRITE,
36     AUDIODRV_CTL_IOCTL_GAIN_WRITE,    // gain
37     AUDIODRV_CTL_IOCTL_GAIN_READ,
38     AUDIODRV_CTL_IOCTL_SCENESELECT_WRITE, // scene selsect
39     AUDIODRV_CTL_IOCTL_GAINTHRESHOLD_READ, // scene threshold
40     AUDIODRV_CTL_IOCTL_VOL_THRESHOLD_READ,  // get VolThreshold
41 };
42 
43 int32_t AudioOutputRenderOpen(const struct DevHandle *handle,
44     int cmdId, const struct AudioHwRenderParam *handleData);
45 int32_t AudioOutputRenderHwParams(const struct DevHandle *handle,
46     int cmdId, const struct AudioHwRenderParam *handleData);
47 int32_t AudioOutputRenderClose(const struct DevHandle *handle,
48     int cmdId, const struct AudioHwRenderParam *handleData);
49 int32_t AudioOutputRenderPrepare(const struct DevHandle *handle,
50     int cmdId, const struct AudioHwRenderParam *handleData);
51 int32_t AudioOutputRenderStart(const struct DevHandle *handle,
52     int cmdId, const struct AudioHwRenderParam *handleData);
53 int32_t AudioOutputRenderGetMmapPosition(const struct DevHandle *handle,
54     int cmdId, struct AudioHwRenderParam *handleData);
55 struct DevHandle *AudioBindServiceRender(const char *name);
56 void AudioCloseServiceRender(const struct DevHandle *handle);
57 int32_t AudioInterfaceLibModeRender(const struct DevHandle *handle,
58     struct AudioHwRenderParam *handleData, int cmdId);
59 int32_t AudioOutputRenderHwParams(const struct DevHandle *handle,
60     int cmdId, const struct AudioHwRenderParam *handleData);
61 int32_t AudioOutputRenderWrite(const struct DevHandle *handle,
62     int cmdId, const struct AudioHwRenderParam *handleData);
63 int32_t AudioOutputRenderStop(const struct DevHandle *handle,
64     int cmdId, const struct AudioHwRenderParam *handleData);
65 int32_t AudioOutputRenderStartPrepare(const struct DevHandle *handle,
66     int cmdId, const struct AudioHwRenderParam *handleData);
67 int32_t AudioCtlRenderGetVolume(const struct DevHandle *handle,
68     int cmdId, struct AudioHwRenderParam *handleData);
69 int32_t AudioCtlRenderSetVolume(const struct DevHandle *handle,
70     int cmdId, const struct AudioHwRenderParam *handleData);
71 int32_t AudioCtlRenderGetMuteStu(const struct DevHandle *handle,
72     int cmdId, struct AudioHwRenderParam *handleData);
73 int32_t AudioCtlRenderSetMuteStu(const struct DevHandle *handle,
74     int cmdId, const struct AudioHwRenderParam *handleData);
75 int32_t AudioCtlRenderSetPauseStu(const struct DevHandle *handle,
76     int cmdId, const struct AudioHwRenderParam *handleData);
77 int32_t AudioCtlRenderGetChannelMode(const struct DevHandle *handle,
78     int cmdId, struct AudioHwRenderParam *handleData);
79 int32_t AudioCtlRenderSetChannelMode(const struct DevHandle *handle,
80     int cmdId, const struct AudioHwRenderParam *handleData);
81 int32_t AudioCtlRenderSetGainStu(const struct DevHandle *handle,
82     int cmdId, const struct AudioHwRenderParam *handleData);
83 int32_t AudioCtlRenderGetGainStu(const struct DevHandle *handle,
84     int cmdId, struct AudioHwRenderParam *handleData);
85 int32_t AudioCtlRenderSceneSelect(const struct DevHandle *handle,
86     int cmdId, const struct AudioHwRenderParam *handleData);
87 int32_t AudioCtlRenderSceneGetGainThreshold(const struct DevHandle *handle,
88     int cmdId, struct AudioHwRenderParam *handleData);
89 int32_t AudioCtlRenderGetVolThreshold(const struct DevHandle *handle,
90     int cmdId, struct AudioHwRenderParam *handleData);
91 int32_t AudioOutputRenderReqMmapBuffer(const struct DevHandle *handle,
92     int cmdId, const struct AudioHwRenderParam *handleData);
93 #ifdef __cplusplus
94 }
95 #endif
96 #endif /* AUDIO_IF_LIB_RENDER_H */
97