summaryrefslogtreecommitdiff
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorDave Burke <daveburke@google.com>2012-04-19 00:14:27 -0700
committerDave Burke <daveburke@google.com>2012-04-25 22:02:58 -0700
commitaeb8fd460ed87d032b3fb8bb61e21eb542ce0f5b (patch)
treef8b459d895acef1717c96cb7133675dda3e458b7 /media/libstagefright/ACodec.cpp
parente0fa467e1150c65a7b1b1ed904c579b40f97c9df (diff)
Add Fraunhofer AAC encoder with AAC-ELD support.
Change-Id: I6cd499d257d72f50a5b508bed97796a591a51506
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 5ac34c9e..c303146f 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -852,13 +852,16 @@ status_t ACodec::configureCodec(
|| !msg->findInt32("sample-rate", &sampleRate)) {
err = INVALID_OPERATION;
} else {
- int32_t isADTS;
+ int32_t isADTS, aacProfile;
if (!msg->findInt32("is-adts", &isADTS)) {
isADTS = 0;
}
+ if (!msg->findInt32("aac-profile", &aacProfile)) {
+ aacProfile = OMX_AUDIO_AACObjectNull;
+ }
err = setupAACCodec(
- encoder, numChannels, sampleRate, bitRate, isADTS != 0);
+ encoder, numChannels, sampleRate, bitRate, aacProfile, isADTS != 0);
}
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AMR_NB)) {
err = setupAMRCodec(encoder, false /* isWAMR */, bitRate);
@@ -960,8 +963,8 @@ status_t ACodec::selectAudioPortFormat(
}
status_t ACodec::setupAACCodec(
- bool encoder,
- int32_t numChannels, int32_t sampleRate, int32_t bitRate, bool isADTS) {
+ bool encoder, int32_t numChannels, int32_t sampleRate,
+ int32_t bitRate, int32_t aacProfile, bool isADTS) {
if (encoder && isADTS) {
return -EINVAL;
}
@@ -1026,7 +1029,7 @@ status_t ACodec::setupAACCodec(
profile.nFrameLength = 0;
profile.nAACtools = OMX_AUDIO_AACToolAll;
profile.nAACERtools = OMX_AUDIO_AACERNone;
- profile.eAACProfile = OMX_AUDIO_AACObjectLC;
+ profile.eAACProfile = (OMX_AUDIO_AACPROFILETYPE) aacProfile;
profile.eAACStreamFormat = OMX_AUDIO_AACStreamFormatMP4FF;
err = mOMX->setParameter(