Loading media/libstagefright/ACodec.cpp +13 −0 Original line number Original line Diff line number Diff line Loading @@ -960,6 +960,19 @@ status_t ACodec::configureCodec( err = setupVideoDecoder(mime, width, height); err = setupVideoDecoder(mime, width, height); } } } } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_MPEG)) { int32_t numChannels, sampleRate; if (!msg->findInt32("channel-count", &numChannels) || !msg->findInt32("sample-rate", &sampleRate)) { // Since we did not always check for these, leave them optional // and have the decoder figure it all out. err = OK; } else { err = setupRawAudioFormat( encoder ? kPortIndexInput : kPortIndexOutput, sampleRate, numChannels); } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) { } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) { int32_t numChannels, sampleRate; int32_t numChannels, sampleRate; if (!msg->findInt32("channel-count", &numChannels) if (!msg->findInt32("channel-count", &numChannels) Loading media/libstagefright/OMXCodec.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -522,6 +522,17 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) { CODEC_LOGE("setAACFormat() failed (err = %d)", err); CODEC_LOGE("setAACFormat() failed (err = %d)", err); return err; return err; } } } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_MPEG, mMIME)) { int32_t numChannels, sampleRate; if (meta->findInt32(kKeyChannelCount, &numChannels) && meta->findInt32(kKeySampleRate, &sampleRate)) { // Since we did not always check for these, leave them optional // and have the decoder figure it all out. setRawAudioFormat( mIsEncoder ? kPortIndexInput : kPortIndexOutput, sampleRate, numChannels); } } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_ALAW, mMIME) } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_ALAW, mMIME) || !strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_MLAW, mMIME)) { || !strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_MLAW, mMIME)) { // These are PCM-like formats with a fixed sample rate but // These are PCM-like formats with a fixed sample rate but Loading media/libstagefright/codecs/mp3dec/SoftMP3.cpp +15 −0 Original line number Original line Diff line number Diff line Loading @@ -166,6 +166,21 @@ OMX_ERRORTYPE SoftMP3::internalSetParameter( return OMX_ErrorNone; return OMX_ErrorNone; } } case OMX_IndexParamAudioPcm: { const OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (const OMX_AUDIO_PARAM_PCMMODETYPE *)params; if (pcmParams->nPortIndex != 1) { return OMX_ErrorUndefined; } mNumChannels = pcmParams->nChannels; mSamplingRate = pcmParams->nSamplingRate; return OMX_ErrorNone; } default: default: return SimpleSoftOMXComponent::internalSetParameter(index, params); return SimpleSoftOMXComponent::internalSetParameter(index, params); } } Loading Loading
media/libstagefright/ACodec.cpp +13 −0 Original line number Original line Diff line number Diff line Loading @@ -960,6 +960,19 @@ status_t ACodec::configureCodec( err = setupVideoDecoder(mime, width, height); err = setupVideoDecoder(mime, width, height); } } } } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_MPEG)) { int32_t numChannels, sampleRate; if (!msg->findInt32("channel-count", &numChannels) || !msg->findInt32("sample-rate", &sampleRate)) { // Since we did not always check for these, leave them optional // and have the decoder figure it all out. err = OK; } else { err = setupRawAudioFormat( encoder ? kPortIndexInput : kPortIndexOutput, sampleRate, numChannels); } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) { } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) { int32_t numChannels, sampleRate; int32_t numChannels, sampleRate; if (!msg->findInt32("channel-count", &numChannels) if (!msg->findInt32("channel-count", &numChannels) Loading
media/libstagefright/OMXCodec.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -522,6 +522,17 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) { CODEC_LOGE("setAACFormat() failed (err = %d)", err); CODEC_LOGE("setAACFormat() failed (err = %d)", err); return err; return err; } } } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_MPEG, mMIME)) { int32_t numChannels, sampleRate; if (meta->findInt32(kKeyChannelCount, &numChannels) && meta->findInt32(kKeySampleRate, &sampleRate)) { // Since we did not always check for these, leave them optional // and have the decoder figure it all out. setRawAudioFormat( mIsEncoder ? kPortIndexInput : kPortIndexOutput, sampleRate, numChannels); } } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_ALAW, mMIME) } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_ALAW, mMIME) || !strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_MLAW, mMIME)) { || !strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_MLAW, mMIME)) { // These are PCM-like formats with a fixed sample rate but // These are PCM-like formats with a fixed sample rate but Loading
media/libstagefright/codecs/mp3dec/SoftMP3.cpp +15 −0 Original line number Original line Diff line number Diff line Loading @@ -166,6 +166,21 @@ OMX_ERRORTYPE SoftMP3::internalSetParameter( return OMX_ErrorNone; return OMX_ErrorNone; } } case OMX_IndexParamAudioPcm: { const OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (const OMX_AUDIO_PARAM_PCMMODETYPE *)params; if (pcmParams->nPortIndex != 1) { return OMX_ErrorUndefined; } mNumChannels = pcmParams->nChannels; mSamplingRate = pcmParams->nSamplingRate; return OMX_ErrorNone; } default: default: return SimpleSoftOMXComponent::internalSetParameter(index, params); return SimpleSoftOMXComponent::internalSetParameter(index, params); } } Loading