1 /* 2 * Copyright 2020 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 18 #ifndef INCLUDE_RT_MPI_MPI_COMM_AF_H_ 19 #define INCLUDE_RT_MPI_MPI_COMM_AF_H_ 20 21 #include "rk_type.h" 22 #include "rk_comm_aio.h" 23 24 #ifdef __cplusplus 25 #if __cplusplus 26 extern "C" { 27 #endif 28 #endif /* __cplusplus */ 29 30 typedef enum rkAUDIO_FILTER_TYPE_E { 31 AUDIO_FILTER_RESAMPLE = 0, 32 AUDIO_FILTER_3A = 1, 33 AUDIO_FILTER_BUTT 34 } AUDIO_FILTER_TYPE_E; 35 36 typedef struct rkAF_RESAMPLE_ATTR_S { 37 RK_U32 u32InRate; 38 RK_U32 u32InChn; 39 AUDIO_BIT_WIDTH_E enInBitWidth; 40 41 RK_U32 u32OutRate; 42 RK_U32 u32OutChn; 43 AUDIO_BIT_WIDTH_E enOutBitWidth; 44 } AF_RESAMPLE_ATTR_S; 45 46 typedef struct rkAF_3A_ATTR_S { 47 char cfgPath[MAX_AUDIO_FILE_PATH_LEN]; 48 RK_U32 u32SampleRate; 49 RK_U32 u32Channels; 50 AUDIO_BIT_WIDTH_E enBitWidth; 51 RK_U32 u32ChnLayout; 52 RK_U32 u32RefLayout; 53 RK_U32 u32RecLayout; 54 } AF_3A_ATTR_S; 55 56 typedef struct rkAF_ATTR_S { 57 AUDIO_FILTER_TYPE_E enType; 58 RK_U32 u32InBufCount; /* max buffer count for input cache */ 59 RK_U32 u32OutBufCount; /* max buffer count for output cache */ 60 union { 61 AF_RESAMPLE_ATTR_S stResAttr; 62 AF_3A_ATTR_S st3AAttr; 63 }; 64 } AF_ATTR_S; 65 66 /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 67 #define RK_ERR_AF_INVALID_CHNID RK_DEF_ERR(RK_ID_AF, RK_ERR_LEVEL_ERROR, RK_ERR_INVALID_CHNID) 68 #define RK_ERR_AF_EXIST RK_DEF_ERR(RK_ID_AF, RK_ERR_LEVEL_ERROR, RK_ERR_EXIST) 69 #define RK_ERR_AF_UNEXIST RK_DEF_ERR(RK_ID_AF, RK_ERR_LEVEL_ERROR, RK_ERR_UNEXIST) 70 #define RK_ERR_AF_ILLEGAL_PARAM RK_DEF_ERR(RK_ID_AF, RK_ERR_LEVEL_ERROR, RK_ERR_ILLEGAL_PARAM) 71 #define RK_ERR_AF_NULL_PTR RK_DEF_ERR(RK_ID_AF, RK_ERR_LEVEL_ERROR, RK_ERR_NULL_PTR) 72 #define RK_ERR_AF_BUF_FULL RK_DEF_ERR(RK_ID_AF, RK_ERR_LEVEL_ERROR, RK_ERR_BUF_FULL) 73 #define RK_ERR_AF_NOBUF RK_DEF_ERR(RK_ID_AF, RK_ERR_LEVEL_ERROR, RK_ERR_NOBUF) 74 #define RK_ERR_AF_SYS_NOTREADY RK_DEF_ERR(RK_ID_AF, RK_ERR_LEVEL_ERROR, RK_ERR_NOTREADY) 75 76 #ifdef __cplusplus 77 #if __cplusplus 78 } 79 #endif 80 #endif /* End of #ifdef __cplusplus */ 81 82 #endif // INCLUDE_RT_MPI_MPI_COMM_AF_H_ 83