CHECK(meta->findInt32(kKeyChannelCount, &numChannels));
CHECK(meta->findInt32(kKeySampleRate, &sampleRate));
- setAACFormat(numChannels, sampleRate, bitRate);
+ status_t err = setAACFormat(numChannels, sampleRate, bitRate);
+ if (err != OK) {
+ CODEC_LOGE("setAACFormat() failed (err = %d)", err);
+ return err;
+ }
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_ALAW, mMIME)
|| !strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_MLAW, mMIME)) {
// These are PCM-like formats with a fixed sample rate but
}
}
-void OMXCodec::setAACFormat(int32_t numChannels, int32_t sampleRate, int32_t bitRate) {
- CHECK(numChannels == 1 || numChannels == 2);
+status_t OMXCodec::setAACFormat(int32_t numChannels, int32_t sampleRate, int32_t bitRate) {
+ if (numChannels > 2)
+ LOGW("Number of channels: (%d) \n", numChannels);
+
if (mIsEncoder) {
//////////////// input port ////////////////////
setRawAudioFormat(kPortIndexInput, sampleRate, numChannels);
profile.nAACERtools = OMX_AUDIO_AACERNone;
profile.eAACProfile = OMX_AUDIO_AACObjectLC;
profile.eAACStreamFormat = OMX_AUDIO_AACStreamFormatMP4FF;
- CHECK_EQ(mOMX->setParameter(mNode, OMX_IndexParamAudioAac,
- &profile, sizeof(profile)), (status_t)OK);
+ err = mOMX->setParameter(mNode, OMX_IndexParamAudioAac,
+ &profile, sizeof(profile));
+ if (err != OK) {
+ CODEC_LOGE("setParameter('OMX_IndexParamAudioAac') failed (err = %d)", err);
+ return err;
+ }
} else {
OMX_AUDIO_PARAM_AACPROFILETYPE profile;
InitOMXParams(&profile);
err = mOMX->setParameter(
mNode, OMX_IndexParamAudioAac, &profile, sizeof(profile));
- CHECK_EQ(err, (status_t)OK);
+
+ if (err != OK) {
+ CODEC_LOGE("setParameter('OMX_IndexParamAudioAac') failed (err = %d)", err);
+ return err;
+ }
}
+
+ return OK;
}
void OMXCodec::setG711Format(int32_t numChannels) {