• 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 I_AUDIO_CAPTURER_SINK_INTF_H
17 #define I_AUDIO_CAPTURER_SINK_INTF_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 typedef struct {
24     const char *adapterName;
25     uint32_t open_mic_speaker;
26     enum AudioFormat format;
27     uint32_t sampleFmt;
28     uint32_t sampleRate;
29     uint32_t channel;
30     float volume;
31     uint32_t bufferSize;
32     bool isBigEndian;
33     const char *filePath;
34     const char *deviceNetworkId;
35     int32_t device_type;
36 } IAudioSourceAttr;
37 
38 int32_t FillinSourceWapper(const char *deviceClass, const char *deviceNetworkId, void **wapper);
39 int32_t IAudioCapturerSourceInit(void *wapper, IAudioSourceAttr *attr);
40 void IAudioCapturerSourceDeInit(void *wapper);
41 int32_t IAudioCapturerSourceStart(void *wapper);
42 int32_t IAudioCapturerSourceStop(void *wapper);
43 int32_t IAudioCapturerSourceFrame(void *wapper, char *frame, uint64_t requestBytes, uint64_t *replyBytes);
44 int32_t IAudioCapturerSourceSetVolume(void *wapper, float left, float right);
45 bool IAudioCapturerSourceIsMuteRequired(void *wapper);
46 int32_t IAudioCapturerSourceSetMute(void *wapper, bool isMute);
47 int32_t IAudioCapturerSourceGetVolume(void *wapper, float *left, float *right);
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif  // AUDIO_CAPTURER_SINK_INTF_H
53