/* * Copyright ., Ltd. 2019-2020. All rights reserved. * * File Name: aacenc_interface.c * Description: audio transcode function interface as example */ #include #include #include #include #include #include "fdkaac/libAACenc/include/aacenc_lib.h" #include "cvi_type.h" #include "cvi_aacenc.h" #define MAX_CHANNELS 2 #define AACENC_BLOCKSIZE 1024 #define _VERSION_TAG_ "audio_aac_fdkaac_enc_20210407" #define AACLC_ENC_AOT 2 #define HEAAC_ENC_AOT 5 #define HEAAC_PLUS_ENC_AOT 29 #define AACLD_ENC_AOT 23 #define AACELD_ENC_AOT 39 int CodecArray[5] = { AACLC_ENC_AOT, HEAAC_ENC_AOT, HEAAC_PLUS_ENC_AOT, AACLD_ENC_AOT, AACELD_ENC_AOT }; int TransportTable[3] = { TT_MP4_ADTS, TT_MP4_LOAS, TT_MP4_LATM_MCP1 }; /** *brief Get version information. *attention \n *N/A *param[in] pVersion version describe struct *retval ::CVI_SUCCESS : Success *retval ::CVI_FAILURE : FAILURE *see \n *N/A */ CVI_S32 CVI_AACENC_GetVersion(AACENC_VERSION_S *pVersion) { printf("[%s][%s]\n", __func__, _VERSION_TAG_); strcpy((char *)pVersion->aVersion, (const char *)_VERSION_TAG_); return 0; } /** *brief get reasonable default configuration. *attention \n *N/A *param[in] pstConfig pointer to an configuration information structure *retval ::CVI_SUCCESS : Success *retval ::CVI_FAILURE : FAILURE *see \n *N/A */ int AACInitDefaultConfig(AACENC_CONFIG *pstConfig) { #if 0 typedef struct { AuQuality quality; AuEncoderFormat coderFormat; short bitsPerSample; int sampleRate; /**