代码改变世界

Merge AACExtractor from ICS to Froyo

2011-11-24 19:24  shaobin0604  阅读(438)  评论(0编辑  收藏  举报

上一篇文章把 ICS 中的 AACExtractor 合并到了Gingerbread,这次尝试合并到 Froyo。

AACExtractor 有一些依赖类(如 ABuffer) 在 Froyo 中没有定义,因此需要修改一些代码,修改后的代码见gist: 1391130

需要修改的源文件如下:

frameworks/base/include/media/stagefright/MediaDefs.h
----------------------------------------------------
extern const char *MEDIA_MIMETYPE_AUDIO_AAC_ADTS;

frameworks/base/media/libstagefright/include/AACExtractor.h
-----------------------------------------------------------
add file AACExtractor.h

frameworks/base/media/libstagefright/AACExtractor.cpp
-----------------------------------------------------
add file AACExtractor.cpp

frameworks/base/media/libstagefright/Android.mk
-----------------------------------------------
AACExtractor.cpp \

frameworks/base/media/libstagefright/DataSource.cpp
---------------------------------------------------
#include "include/AACExtractor.h"

RegisterSniffer(SniffAAC);

frameworks/base/media/libstagefright/MediaDefs.cpp
--------------------------------------------------
const char *MEDIA_MIMETYPE_AUDIO_AAC_ADTS = "audio/aac-adts";

frameworks/base/media/libstagefright/MediaExtractor.cpp
-------------------------------------------------------
#include "include/AACExtractor.h"

else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC_ADTS)) {
return new AACExtractor(source);
}

编译 libstagefright.so

mmm frameworks/base/media/libstagefright/

替换手机里的/system/lib/libstagefright.so, 杀掉 mediaserver。