1、交叉编译版
#:git clone https://github.com/allwinner-zh/media-codec
#:cd media-codec/sunxi-cedarx/SOURCE/
#: apt-get install libtool autoconf
#: ./bootstrap
#: ./configure --host=arm-linux-gnueabihf --enable-static
#: make clean
#: make ARCH=arm
#: make install ARCH=arm
在 /usr/local/lib/ 中多了文件夹 full-package-name 说明库安装成功
接下来编译官方提供的demo
#: cd ../demo/vencoder/
修改 Makefile 文件
第 6 行 原:-L/home/bz/tmp/out/lib/full-package-name/ \
改:-L /usr/local/lib/full-package-name/ \
第 7 行 原:-lcedar_vencoder -lcedar_common -lcedar_base\
改:-lcedar_vencoder -lcedar_common -lcedar_base -lpthread -ldl\
第 8 行 原:-I../../libs/base/include/ \
改:-I../../SOURCE/base/include/ \
第 9 行 原:-I../../libs/vencoder/include/ \
改:-I../../SOURCE/vencoder/include/ \
第 10 行 加:-static
#: make
生成文件 a.out,将该文件复制到基于全志芯片的任意平台
#: chmod 777 a.out
#: ./a.out
出现 error : awplayer : open in_file fail 说明 CedarX 库可用
2、全志ARM版
#:git clone https://github.com/allwinner-zh/media-codec
#:cd media-codec/sunxi-cedarx/SOURCE/
#: apt-get install libtool autoconf
#: ./bootstrap
#: ./configure
#: make clean
#: make
#: make install
在 /usr/local/lib/ 中多了文件夹 full-package-name 说明库安装成功
接下来编译官方提供的demo
#: cd ../demo/vencoder/
修改 Makefile 文件
第 6 行 原:-L/home/bz/tmp/out/lib/full-package-name/ \
改:-L /usr/local/lib/full-package-name/ \
第 8 行 原:-I../../libs/base/include/ \
改:-I../../SOURCE/base/include/ \
第 9 行 原:-I../../libs/vencoder/include/ \
改:-I../../SOURCE/vencoder/include/ \
#: make
生成文件 a.out
#: ./a.out
出现 error : awplayer : open in_file fail 说明 CedarX 库可用
3、其他
3.1 CedarX库的资料:http://linux-sunxi.org/CedarX
3.2 CedarX库在编译的时候可能会出错,出现有关于 if 的错误,只需根据其错误提示在将 if 中的内容加上大括号“{}”
再修改以下文件
../media-codec/sunxi-cedarx/SOURCE/base/include/log.h 给所有 fmt 关键字两边增加一个空格