diff options
author | Ronghua Wu <ronghuawu@google.com> | 2014-09-25 18:32:05 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-25 18:32:05 +0000 |
commit | 8ef929fe7128a3813b18174711903e62e2a96488 (patch) | |
tree | b9a6498d1474f5c45daf43d64273594279d01407 /media | |
parent | 7e12b5ac00a4544e27d39942684a68f2ca0a6cb2 (diff) | |
parent | 70a250ab52079a4d02ff0687c07a73b2bd39feaf (diff) | |
download | frameworks_av-8ef929fe7128a3813b18174711903e62e2a96488.zip frameworks_av-8ef929fe7128a3813b18174711903e62e2a96488.tar.gz frameworks_av-8ef929fe7128a3813b18174711903e62e2a96488.tar.bz2 |
am 70a250ab: Merge "SoftVideoDecoderOMXComponent: re-config the buffer size when port definition changed." into lmp-dev
* commit '70a250ab52079a4d02ff0687c07a73b2bd39feaf':
SoftVideoDecoderOMXComponent: re-config the buffer size when port definition changed.
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp index a7f7a07..3d20a79 100644 --- a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp +++ b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp @@ -345,6 +345,40 @@ OMX_ERRORTYPE SoftVideoDecoderOMXComponent::internalSetParameter( return OMX_ErrorNone; } + case OMX_IndexParamPortDefinition: + { + OMX_PARAM_PORTDEFINITIONTYPE *newParams = + (OMX_PARAM_PORTDEFINITIONTYPE *)params; + OMX_VIDEO_PORTDEFINITIONTYPE *video_def = &newParams->format.video; + OMX_PARAM_PORTDEFINITIONTYPE *def = &editPortInfo(newParams->nPortIndex)->mDef; + + uint32_t oldWidth = def->format.video.nFrameWidth; + uint32_t oldHeight = def->format.video.nFrameHeight; + uint32_t newWidth = video_def->nFrameWidth; + uint32_t newHeight = video_def->nFrameHeight; + if (newWidth != oldWidth || newHeight != oldHeight) { + bool outputPort = (newParams->nPortIndex == kOutputPortIndex); + def->format.video.nFrameWidth = + (mIsAdaptive && outputPort) ? mAdaptiveMaxWidth : newWidth; + def->format.video.nFrameHeight = + (mIsAdaptive && outputPort) ? mAdaptiveMaxHeight : newHeight; + def->format.video.nStride = def->format.video.nFrameWidth; + def->format.video.nSliceHeight = def->format.video.nFrameHeight; + def->nBufferSize = + def->format.video.nFrameWidth * def->format.video.nFrameHeight * 3 / 2; + if (outputPort) { + mWidth = newWidth; + mHeight = newHeight; + mCropLeft = 0; + mCropTop = 0; + mCropWidth = newWidth; + mCropHeight = newHeight; + } + newParams->nBufferSize = def->nBufferSize; + } + return SimpleSoftOMXComponent::internalSetParameter(index, params); + } + default: return SimpleSoftOMXComponent::internalSetParameter(index, params); } |