微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > mt6735 如何去掉AMR格式

mt6735 如何去掉AMR格式

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]
有些地方在 AMR 格式方面, 可能会涉及到 license 相关的问题
如果需要去除 AMR 格式, 请参考如下做法:
[SOLUTION]
1: modification of RECORD part: //录音部分的改法:
stagefirghtRecorder.cpp (php?mod=tag&id=6090" target="_blank" class="relatedlink">Frameworks/av/media/libmediaplayerservice/)
a): status_t StagefrightRecorder::setAudioEncoder(audio_encoder ae) {
ALOGV("setAudioEncoder: %d", ae);
if (ae < AUDIO_ENCODER_DEFAULT ||
ae >= AUDIO_ENCODER_LIST_END) {
ALOGE("Invalid audio encoder: %d", ae);
return BAD_VALUE;
}
if (ae == AUDIO_ENCODER_DEFAULT) {
mAudioEncoder = AUDIO_ENCODER_AMR_NB;
} else {
mAudioEncoder = ae;
}
//add begin
if(mAudioEncoder == AUDIO_ENCODER_AMR_NB || mAudioEncoder == AUDIO_ENCODER_AMR_WB){
ALOGE("force AMR to AAC for copyright reason");
mAudioEncoder = AUDIO_ENCODER_AAC;
}
//add end
return OK;
}
b): in function
status_t StagefrightRecorder::reset()
change this line:
mAudioEncoder = AUDIO_ENCODER_AMR_NB;
to following:
mAudioEncoder = AUDIO_ENCODER_AAC;

2: modification of PLAY part: //播放部分的改法
AMRExtractor.cpp (frameworks/av/media/libstagefright/)
change function fROM:
bool SniffAMR(
const sp<DataSource> &source, String8 *mimeType, float *confidence,
sp<AMessage> *) {
char header[9];
if (source->readAt(0, header, sizeof(header)) != sizeof(header)) {
return false;
}
if (!memcmp(header, "#!AMR\n", 6)) {
*mimeType = MEDIA_MIMETYPE_AUDIO_AMR_NB;
*confidence = 0.5;
return true;
} else if (!memcmp(header, "#!AMR-WB\n", 9)) {
*mimeType = MEDIA_MIMETYPE_AUDIO_AMR_WB;
*confidence = 0.5;
return true;
}
return false;
}
TO:
bool SniffAMR(
const sp<DataSource> &source, String8 *mimeType, float *confidence,
sp<AMessage> *) {
return false;
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top