• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 SOURCE_ADAPTER_H
17 #define SOURCE_ADAPTER_H
18 
19 #include <stdio.h>
20 #include <stdint.h>
21 #include "intf_def.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 int32_t InitSourceAdapter(struct SourceAdapter *adapter, const char *deviceClass, const int32_t sourceType,
28     const char *info);
29 void DeInitSourceAdapter(struct SourceAdapter *adapter);
30 
31 int32_t SourceAdapterInit(struct SourceAdapter *adapter, const struct SourceAdapterAttr *attr);
32 void SourceAdapterDeInit(struct SourceAdapter *adapter);
33 
34 int32_t SourceAdapterStart(struct SourceAdapter *adapter);
35 int32_t SourceAdapterStop(struct SourceAdapter *adapter);
36 int32_t SourceAdapterCaptureFrame(struct SourceAdapter *adapter, char *frame, uint64_t requestBytes,
37     uint64_t *replyBytes);
38 int32_t SourceAdapterCaptureFrameWithEc(struct SourceAdapter *adapter, struct SourceAdapterFrameDesc *fdesc,
39     uint64_t *replyBytes, struct SourceAdapterFrameDesc *fdescEc, uint64_t *replyBytesEc);
40 
41 int32_t SourceAdapterSetVolume(struct SourceAdapter *adapter, float left, float right);
42 int32_t SourceAdapterGetVolume(struct SourceAdapter *adapter, float *left, float *right);
43 int32_t SourceAdapterSetMute(struct SourceAdapter *adapter, bool isMute);
44 bool SourceAdapterGetMute(struct SourceAdapter *adapter);
45 
46 int32_t SourceAdapterUpdateAppsUid(struct SourceAdapter *adapter, const int32_t appsUid[PA_MAX_OUTPUTS_PER_SOURCE],
47     const size_t size);
48 int32_t SourceAdapterUpdateSessionUid(struct SourceAdapter *adapter, const int32_t sessionId[PA_MAX_OUTPUTS_PER_SOURCE],
49     const size_t size);
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 #endif // SOURCE_ADAPTER_H
55