diff options
author | Andreas Huber <andih@google.com> | 2012-03-16 13:15:53 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-16 13:15:53 -0700 |
commit | 4108fbc299bb0c02293ff53fa670308ed81607f7 (patch) | |
tree | ad9ac2575b9d64dc104fe71738dcaa7ffe080afd | |
parent | 561d7a43c15ea87a60ae7f6939725ae4b2bd3353 (diff) | |
parent | ad3e7e223309ba1c1b485d722517bc1be10e27c0 (diff) | |
download | frameworks_base-4108fbc299bb0c02293ff53fa670308ed81607f7.zip frameworks_base-4108fbc299bb0c02293ff53fa670308ed81607f7.tar.gz frameworks_base-4108fbc299bb0c02293ff53fa670308ed81607f7.tar.bz2 |
Merge "ACodec is a little more aggressive in its error checking now."
-rw-r--r-- | media/libstagefright/ACodec.cpp | 11 | ||||
-rwxr-xr-x | media/libstagefright/OMXCodec.cpp | 6 | ||||
-rw-r--r-- | media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp | 12 | ||||
-rw-r--r-- | media/libstagefright/codecs/g711/dec/SoftG711.cpp | 6 |
4 files changed, 27 insertions, 8 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 09e4e45..e5ad4b7 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -746,6 +746,10 @@ status_t ACodec::setComponentRole( "audio_decoder.aac", "audio_encoder.aac" }, { MEDIA_MIMETYPE_AUDIO_VORBIS, "audio_decoder.vorbis", "audio_encoder.vorbis" }, + { MEDIA_MIMETYPE_AUDIO_G711_MLAW, + "audio_decoder.g711mlaw", "audio_encoder.g711mlaw" }, + { MEDIA_MIMETYPE_AUDIO_G711_ALAW, + "audio_decoder.g711alaw", "audio_encoder.g711alaw" }, { MEDIA_MIMETYPE_VIDEO_AVC, "video_decoder.avc", "video_encoder.avc" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, @@ -855,10 +859,6 @@ status_t ACodec::configureCodec( } } - if (err != OK) { - return err; - } - int32_t maxInputSize; if (msg->findInt32("max-input-size", &maxInputSize)) { err = setMinBufferSize(kPortIndexInput, (size_t)maxInputSize); @@ -2770,6 +2770,9 @@ bool ACodec::LoadedState::onConfigureComponent( status_t err = mCodec->configureCodec(mime.c_str(), msg); if (err != OK) { + ALOGE("[%s] configureCodec returning error %d", + mCodec->mComponentName.c_str(), err); + mCodec->signalError(OMX_ErrorUndefined, err); return false; } diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 278e3a2..d5e6bec 100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1332,8 +1332,6 @@ void OMXCodec::setComponentRole( "audio_decoder.mp1", "audio_encoder.mp1" }, { MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II, "audio_decoder.mp2", "audio_encoder.mp2" }, - { MEDIA_MIMETYPE_AUDIO_MPEG, - "audio_decoder.mp3", "audio_encoder.mp3" }, { MEDIA_MIMETYPE_AUDIO_AMR_NB, "audio_decoder.amrnb", "audio_encoder.amrnb" }, { MEDIA_MIMETYPE_AUDIO_AMR_WB, @@ -1342,6 +1340,10 @@ void OMXCodec::setComponentRole( "audio_decoder.aac", "audio_encoder.aac" }, { MEDIA_MIMETYPE_AUDIO_VORBIS, "audio_decoder.vorbis", "audio_encoder.vorbis" }, + { MEDIA_MIMETYPE_AUDIO_G711_MLAW, + "audio_decoder.g711mlaw", "audio_encoder.g711mlaw" }, + { MEDIA_MIMETYPE_AUDIO_G711_ALAW, + "audio_decoder.g711alaw", "audio_encoder.g711alaw" }, { MEDIA_MIMETYPE_VIDEO_AVC, "video_decoder.avc", "video_encoder.avc" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, diff --git a/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp index 7602f2d..796caa4 100644 --- a/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp +++ b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp @@ -236,6 +236,18 @@ OMX_ERRORTYPE SoftAMR::internalSetParameter( return OMX_ErrorNone; } + case OMX_IndexParamAudioPcm: + { + const OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = + (OMX_AUDIO_PARAM_PCMMODETYPE *)params; + + if (pcmParams->nPortIndex != 1) { + return OMX_ErrorUndefined; + } + + return OMX_ErrorNone; + } + default: return SimpleSoftOMXComponent::internalSetParameter(index, params); } diff --git a/media/libstagefright/codecs/g711/dec/SoftG711.cpp b/media/libstagefright/codecs/g711/dec/SoftG711.cpp index 32ef003..bcdd3c7 100644 --- a/media/libstagefright/codecs/g711/dec/SoftG711.cpp +++ b/media/libstagefright/codecs/g711/dec/SoftG711.cpp @@ -140,7 +140,7 @@ OMX_ERRORTYPE SoftG711::internalSetParameter( OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (OMX_AUDIO_PARAM_PCMMODETYPE *)params; - if (pcmParams->nPortIndex != 0) { + if (pcmParams->nPortIndex != 0 && pcmParams->nPortIndex != 1) { return OMX_ErrorUndefined; } @@ -148,7 +148,9 @@ OMX_ERRORTYPE SoftG711::internalSetParameter( return OMX_ErrorUndefined; } - mNumChannels = pcmParams->nChannels; + if(pcmParams->nPortIndex == 0) { + mNumChannels = pcmParams->nChannels; + } return OMX_ErrorNone; } |