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 #ifndef PARSE_EFFECT_CONFIG_H 17 #define PARSE_EFFECT_CONFIG_H 18 19 #include <stdint.h> 20 21 #define HDF_EFFECT_LIB_NUM_MAX 32 22 23 struct LibraryConfigDescriptor { 24 const char *libName; 25 const char *libPath; 26 }; 27 28 struct EffectConfigDescriptor { 29 const char *name; 30 const char *library; 31 const char *effectId; 32 }; 33 34 struct ConfigDescriptor { 35 struct LibraryConfigDescriptor *libCfgDescs; 36 uint32_t libNum; 37 struct EffectConfigDescriptor *effectCfgDescs; 38 uint32_t effectNum; 39 }; 40 41 /** 42 * @brief Parse the effect profile and get the effect config descriptor. 43 * 44 * @param path Indicates the effect configuration file path. 45 * @param cfgDesc Indicates pointer of the effect config descriptor. 46 * 47 * @return Returns <b>0</b> if the process success; returns a non-zero value otherwise. 48 * 49 * @since 4.0 50 * @version 1.0 51 */ 52 int32_t AudioEffectGetConfigDescriptor(const char *path, struct ConfigDescriptor **cfgDesc); 53 54 /** 55 * @brief Release the effect config descriptor. 56 * 57 * @param cfgDesc Indicates pointer of the effect config descriptor. 58 * 59 * @return Returns <b>0</b> if the process success; returns a non-zero value otherwise. 60 * 61 * @since 4.0 62 * @version 1.0 63 */ 64 void AudioEffectReleaseCfgDesc(struct ConfigDescriptor *cfgDesc); 65 66 #endif 67