Android编译aac编解码库

1、源码下载

http://www.audiocoding.com/downloads.html

2、faac

2.1 android.mk文件

MY_LOCAL_PATH := $(call my-dir)

#/Users/xxxxx/code/media-service/LibraryBuild/faac/faac-1.28
FAAC_PATH := $(MY_LOCAL_PATH)/../faac-1.28/

#-----FAAC-----
include $(CLEAR_VARS)

LOCAL_PATH := $(FAAC_PATH)

LOCAL_MODULE := libfaac

LOCAL_SRC_FILES := ./libfaac/aacquant.c \
   ./libfaac/backpred.c \
   ./libfaac/bitstream.c \
   ./libfaac/channels.c \
   ./libfaac/fft.c \
   ./libfaac/filtbank.c \
   ./libfaac/frame.c \
   ./libfaac/huffman.c \
   ./libfaac/ltp.c \
   ./libfaac/midside.c \
   ./libfaac/psychkni.c \
   ./libfaac/tns.c \
   ./libfaac/util.c

LOCAL_C_INCLUDES := \
   $(FAAC_PATH)/include

include $(BUILD_SHARED_LIBRARY)

2.2 Application.mk

APP_STL := gnustl_shared
APP_PLATFORM := android-14
APP_ABI := armeabi armeabi-v7a arm64-v8a

2.3 build.sh

export NDK=/Users/xxxxx/work/tools/android_sdk/ndk-bundle
export PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt
export PLATFORM=$NDK/platforms/android-21/arch-arm

CFLAGS="-fpic -DANDROID -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -D__ARM_ARCH_7__ -Wno-psabi -march=armv7 -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wa,--noexecstack -MMD -MP "  

#CFLAGS="-fpic -DANDROID -fpic -mthumb-interwork -D__ARM_ARCH_7__ -Wno-psabi -march=armv7-a -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wa, -MMD -MP "  
CROSS_COMPILE=$PREBUILT/darwin-x86_64/bin/arm-linux-androideabi-  
export CPPFLAGS="$CFLAGS"  
export CFLAGS="$CFLAGS"  
export CXXFLAGS="$CFLAGS"  
export CXX="${CROSS_COMPILE}g++ --sysroot=${PLATFORM}"  
export LDFLAGS="$LDFLAGS"  
export CC="${CROSS_COMPILE}gcc --sysroot=${PLATFORM}"  
export NM="${CROSS_COMPILE}nm"  
export STRIP="${CROSS_COMPILE}strip"  
export RANLIB="${CROSS_COMPILE}ranlib"  
export AR="${CROSS_COMPILE}ar"  

./configure --without-mp4v2 --host=arm-linux --enable-static   
make clean
make  
make install  
cp -rf /usr/local/include/faac.h /Users/xxxxx/code/android-ffmepg/libaac
cp -rf /usr/local/include/faaccfg.h /Users/xxxxx/code/android-ffmepg/libaac
cp -rf /usr/local/lib/libfaac.a /Users/xxxxx/code/android-ffmepg/libaac

3、faad

Android.mk

MY_LOCAL_PATH := $(call my-dir)

FAAD_PATH := $(MY_LOCAL_PATH)/../faad2-2.7/

#-----FAAD-----
include $(CLEAR_VARS)

LOCAL_PATH := $(FAAD_PATH)

LOCAL_MODULE := libfaad

LOCAL_SRC_FILES := ./libfaad/bits.c \
                   ./libfaad/cfft.c  \
                   ./libfaad/common.c \
                   ./libfaad/decoder.c \
                   ./libfaad/drc.c      \
                   ./libfaad/drm_dec.c   \
                   ./libfaad/error.c      \
                   ./libfaad/filtbank.c    \
                   ./libfaad/hcr.c         \
                   ./libfaad/huffman.c     \
                   ./libfaad/ic_predict.c  \
                   ./libfaad/is.c          \
                   ./libfaad/lt_predict.c  \
                   ./libfaad/mdct.c        \
                   ./libfaad/mp4.c         \
                   ./libfaad/ms.c          \
                   ./libfaad/output.c      \
                   ./libfaad/pns.c         \
                   ./libfaad/ps_dec.c      \
                   ./libfaad/ps_syntax.c   \
                   ./libfaad/pulse.c       \
                   ./libfaad/rvlc.c        \
                   ./libfaad/sbr_dct.c     \
                   ./libfaad/sbr_dec.c     \
                   ./libfaad/sbr_e_nf.c    \
                   ./libfaad/sbr_fbt.c     \
                   ./libfaad/sbr_hfadj.c   \
                   ./libfaad/sbr_hfgen.c   \
                   ./libfaad/sbr_huff.c    \
                   ./libfaad/sbr_qmf.c     \
                   ./libfaad/sbr_syntax.c  \
                   ./libfaad/sbr_tf_grid.c \
                   ./libfaad/specrec.c     \
                   ./libfaad/ssr.c         \
                   ./libfaad/ssr_fb.c      \
                   ./libfaad/ssr_ipqf.c    \
                   ./libfaad/syntax.c      \
                   ./libfaad/tns.c

LOCAL_C_INCLUDES := \
   $(FAAD_PATH)/include \
   ./libfaad/codebook

LOCAL_CFLAGS:=      \
    -DHAVE_CONFIG_H

include $(BUILD_SHARED_LIBRARY)

config.h

#ifndef VIDEOLIVE_CONFIG_H
#define VIDEOLIVE_CONFIG_H

/* config.h.  Generated from config.h.in by configure.  */
/* config.h.in.  Generated from configure.in by autoheader.  */

/* Define if you want to use libfaad together with Digital Radio Mondiale
   (DRM) */
/* #undef DRM */

/* Define if you want support for Digital Radio Mondiale (DRM) parametric
   stereo */
/* #undef DRM_PS */

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1

/* Define if needed */
/* #undef HAVE_FLOAT32_T */

/* Define to 1 if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1

/* Define to 1 if you have the `getpwuid' function. */
#define HAVE_GETPWUID 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define if you have the IOKit API */
/* #undef HAVE_IOKIT_IOKITLIB_H */

/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1

/* Define if you have C99's lrintf function. */
#define HAVE_LRINTF 1

/* Define to 1 if you have the <mathf.h> header file. */
/* #undef HAVE_MATHF_H */

/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the `strsep' function. */
#define HAVE_STRSEP 1

/* Define to 1 if you have the <sysfs/libsysfs.h> header file. */
/* #undef HAVE_SYSFS_LIBSYSFS_H */

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */

/* Name of package */
#define PACKAGE "faad2"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define PACKAGE_NAME ""

/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""

/* Define to the version of this package. */
#define PACKAGE_VERSION ""

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1

/* Version number of package */
#define VERSION "2.7.0"

/* Define to 1 if your processor stores words with the most significant byte
   first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */

/* Define to `__inline__' or `__inline' if that's what the C compiler
   calls it, or to nothing if 'inline' is not supported under any name.  */
#ifndef __cplusplus
/* #undef inline */
#endif

/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */

#endif //VIDEOLIVE_CONFIG_H
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,240评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,328评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,182评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,121评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,135评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,093评论 1 295
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,013评论 3 417
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,854评论 0 273
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,295评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,513评论 2 332
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,678评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,398评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,989评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,636评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,801评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,657评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,558评论 2 352

推荐阅读更多精彩内容