• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 /**
17  * @addtogroup Audio Effect
18  * @{
19  *
20  * @brief Defines audio-related APIs, including custom data types and functions for loading drivers,
21  * accessing a audio effect factory, a effect controller.
22  *
23  * @since 4.0
24  * @version 1.0
25  */
26 
27 /**
28  * @file effect_host_common.h
29  *
30  * @brief Defines custom data types used in API declarations for the effect module.
31  *
32  * @version 1.0
33  */
34 
35 #ifndef EFFECT_HOST_COMMON_H
36 #define EFFECT_HOST_COMMON_H
37 
38 #include "effect_compatible_access.h"
39 #include "v1_0/effect_types.h"
40 #include "v1_0/ieffect_control.h"
41 #include "v1_0/ieffect_model.h"
42 #include "hdf_dlist.h"
43 
44 #define HDF_EFFECT_LIB_NAME_LEN 64
45 #define HDF_LOG_TAG HDF_AUDIO_EFFECT
46 #define AEM_INIT_LIST_HEAD(name) { &(name), &(name) }
47 #define AEM_GET_INITED_DLIST(name) \
48     struct DListHead name = AEM_INIT_LIST_HEAD(name)
49 
50 struct EffectModelService {
51     struct IEffectModel interface;
52 };
53 
54 struct ControllerManager {
55     struct IEffectControl ctrlImpls;
56     struct EffectControl *ctrlOps;
57     char *effectId;
58     char libName[HDF_EFFECT_LIB_NAME_LEN];
59 };
60 
61 /* declare functions */
62 int32_t EffectControlEffectProcess(struct IEffectControl *self, const struct AudioEffectBuffer *input,
63                                    struct AudioEffectBuffer *output);
64 int32_t EffectControlSendCommand(struct IEffectControl *self, uint32_t cmdId, const int8_t *cmdData,
65     uint32_t cmdDataLen, int8_t *replyData, uint32_t *replyDataLen);
66 int32_t EffectGetOwnDescriptor(struct IEffectControl *self, struct EffectControllerDescriptor *desc);
67 int32_t EffectControlEffectReverse(struct IEffectControl *self, const struct AudioEffectBuffer *input,
68                                    struct AudioEffectBuffer *output);
69 
70 #endif
71