diff options
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 7f6bcb1..a0282a1 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -543,12 +543,7 @@ ACodec::ACodec() ACodec::~ACodec() { } -status_t ACodec::setupCustomCodec(status_t err, const char *mime, const sp<AMessage> &msg) { - if (!strncmp(mComponentName.c_str(), "OMX.ffmpeg.", 11) && !mIsEncoder) { - return FFMPEGSoftCodec::setAudioFormat( - msg, mime, mOMX, mNode); - } - +status_t ACodec::setupCustomCodec(status_t err, const char * /*mime*/, const sp<AMessage> &/*msg*/) { return err; } @@ -2019,7 +2014,7 @@ status_t ACodec::configureCodec( err = OK; } else { int32_t bitsPerSample = 16; - msg->findInt32("bit-width", &bitsPerSample); + msg->findInt32("bits-per-sample", &bitsPerSample); err = setupRawAudioFormatInternal( encoder ? kPortIndexInput : kPortIndexOutput, sampleRate, @@ -2098,11 +2093,7 @@ status_t ACodec::configureCodec( } err = setupG711Codec(encoder, sampleRate, numChannels); } -#ifdef QTI_FLAC_DECODER } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC) && encoder) { -#else - } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC)) { -#endif int32_t numChannels = 0, sampleRate = 0, compressionLevel = -1; if (encoder && (!msg->findInt32("channel-count", &numChannels) @@ -2139,7 +2130,7 @@ status_t ACodec::configureCodec( err = INVALID_OPERATION; } else { int32_t bitsPerSample = 16; - msg->findInt32("bit-width", &bitsPerSample); + msg->findInt32("bits-per-sample", &bitsPerSample); err = setupRawAudioFormatInternal(kPortIndexInput, sampleRate, numChannels, bitsPerSample); } } else if (!strncmp(mComponentName.c_str(), "OMX.google.", 11) @@ -2151,7 +2142,7 @@ status_t ACodec::configureCodec( err = INVALID_OPERATION; } else { int32_t bitsPerSample = 16; - msg->findInt32("bit-width", &bitsPerSample); + msg->findInt32("bits-per-sample", &bitsPerSample); err = setupAC3Codec(encoder, numChannels, sampleRate, bitsPerSample); } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_EAC3)) { @@ -2162,11 +2153,16 @@ status_t ACodec::configureCodec( err = INVALID_OPERATION; } else { int32_t bitsPerSample = 16; - msg->findInt32("bit-width", &bitsPerSample); + msg->findInt32("bits-per-sample", &bitsPerSample); err = setupEAC3Codec(encoder, numChannels, sampleRate, bitsPerSample); } } else { - err = setupCustomCodec(err, mime, msg); + if (!strncmp(mComponentName.c_str(), "OMX.ffmpeg.", 11) && !mIsEncoder) { + err = FFMPEGSoftCodec::setAudioFormat( + msg, mime, mOMX, mNode); + } else { + err = setupCustomCodec(err, mime, msg); + } } if (err != OK) { @@ -4277,7 +4273,7 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> ¬ify) { notify->setString("mime", MEDIA_MIMETYPE_AUDIO_RAW); notify->setInt32("channel-count", params.nChannels); notify->setInt32("sample-rate", params.nSamplingRate); - notify->setInt32("bit-width", params.nBitPerSample); + notify->setInt32("bits-per-sample", params.nBitPerSample); if (mChannelMaskPresent) { notify->setInt32("channel-mask", mChannelMask); @@ -5788,6 +5784,7 @@ bool ACodec::LoadedState::onConfigureComponent( status_t err = OK; AString mime; + if (!msg->findString("mime", &mime)) { err = BAD_VALUE; } else { |