AAC音频编码库FAAC和解码库FAAD移植
前言
本博客是基于海思产品上完成的,x86平台使用的是默认的gcc编译工具链,arm平台使用的编译工具链是arm-hisiv300-linux,--enable-shared=no可选。在编译和安装的时候尽可能少用sudo,sudo使用的是root权限和配置文件,如果root用户没有安装相应的工具链或库,就会报错。
1、编码库FAAC
下载地址:http://www.audiocoding.com/faac.html
下载faac-1.28.tar.gz压缩包,解压tar -zxvf faac-1.28.tar.gz
1.1、编译x86平台
#./configure --prefix=/home/hepengcheng/toolchain/arm-hisiv300-linux/faac_x86 --enable-shared=no
#make -j8
编译FAAC-1.28时遇到错误:
mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’
解决方法:common/mp4v2/mpeg4ip.h
从123行开始修改此文件mpeg4ip.h,到129行结束。
修改前:
#ifdef __cplusplus
extern "C" {
#endif
char *strcasestr(const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif
修改后:
#ifdef __cplusplus
extern "C++" {
#endif
const char *strcasestr(const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif
error解决后重新编译
#make -j8
#make install
1.2、编译arm平台
#./configure --prefix=/home/hepengcheng/toolchain/arm-hisiv300-linux/faac --host=arm-hisiv300-linux --enable-shared=no
#make -j8
#make install
2、解码库FAAD
下载地址:http://www.audiocoding.com/faad2.html
下载faad2-2.7.tar.gz压缩包,解压tar -zxvf faad2-2.7.tar.gz
2.1、编译x86平台
#./configure --prefix=/home/hepengcheng/toolchain/arm-hisiv300-linux/faad_x86 --enable-shared=no
#make -j8
#make install
2.2、编译arm平台
#./configure --prefix=/home/hepengcheng/toolchain/arm-hisiv300-linux/faad --host=arm-hisiv300-linux --enable-shared=no
#make -j8
#make install