aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuanjun Huang <yuanjun.huang@intel.com>2015-01-23 04:01:37 +0800
committerPat Tjin <pattjin@google.com>2015-01-29 18:59:10 +0000
commitdd94f000f413fb14aaf4f61a2bb3f944033a38c8 (patch)
treece7f6ffe2cf63a93b4c8f5d58004f5e756ccc637
parent237fe154e8c1a073f74685e7cba7d4feba4317b0 (diff)
downloadandroid_hardware_intel_common_omx-components-dd94f000f413fb14aaf4f61a2bb3f944033a38c8.tar.gz
android_hardware_intel_common_omx-components-dd94f000f413fb14aaf4f61a2bb3f944033a38c8.tar.bz2
android_hardware_intel_common_omx-components-dd94f000f413fb14aaf4f61a2bb3f944033a38c8.zip
VP8 OMX component - Add flushing the decode pipeline at the beginning,
and make VP8 surface height uneccessary force to 32 bit align - keep it as same as original height. This fix a CTS case failure: android.media.cts.EncodeDecodeTest#testVP8EncodeDecodeVideoFromBufferToSurfaceQVGA Bug: 19183778 Bug: 19184881 Change-Id: Ib07798b15eb25c7f81098ba812c3d9bec5220d4e Signed-off-by: Yuanjun Huang <yuanjun.huang@intel.com>
-rw-r--r--videocodec/OMXVideoDecoderBase.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp
index cbbc9ae..6900d5c 100644
--- a/videocodec/OMXVideoDecoderBase.cpp
+++ b/videocodec/OMXVideoDecoderBase.cpp
@@ -634,6 +634,7 @@ OMX_ERRORTYPE OMXVideoDecoderBase::HandleFormatChange(void) {
uint32_t strideCropped = widthCropped;
uint32_t sliceHeightCropped = heightCropped;
int force_realloc = 0;
+ bool isVP8 = false;
#ifdef TARGET_HAS_ISV
LOGI("============== mVppBufferNum = %d\n", mVppBufferNum);
@@ -656,6 +657,10 @@ OMX_ERRORTYPE OMXVideoDecoderBase::HandleFormatChange(void) {
paramPortDefinitionInput.format.video.nFrameHeight,
width, height, widthCropped, heightCropped);
+ if (paramPortDefinitionInput.format.video.eCompressionFormat == OMX_VIDEO_CodingVP8) {
+ isVP8 = true;
+ }
+
if (!force_realloc &&
widthCropped == paramPortDefinitionOutput.format.video.nFrameWidth &&
heightCropped == paramPortDefinitionOutput.format.video.nFrameHeight) {
@@ -684,11 +689,11 @@ OMX_ERRORTYPE OMXVideoDecoderBase::HandleFormatChange(void) {
return OMX_ErrorNone;
}
- if (width > formatInfo->surfaceWidth || height > formatInfo->surfaceHeight) {
+ if (isVP8 || width > formatInfo->surfaceWidth || height > formatInfo->surfaceHeight) {
// update the real decoded resolution to outport instead of display resolution for graphic buffer reallocation
// when the width and height parsed from ES are larger than allocated graphic buffer in outport,
paramPortDefinitionOutput.format.video.nFrameWidth = width;
- paramPortDefinitionOutput.format.video.nFrameHeight = (height + 0x1f) & ~0x1f;
+ paramPortDefinitionOutput.format.video.nFrameHeight = height;
paramPortDefinitionOutput.format.video.eColorFormat = GetOutputColorFormat(
paramPortDefinitionOutput.format.video.nFrameWidth);
paramPortDefinitionOutput.format.video.nStride = stride;
@@ -706,6 +711,9 @@ OMX_ERRORTYPE OMXVideoDecoderBase::HandleFormatChange(void) {
if (mWorkingMode == GRAPHICBUFFER_MODE) {
// Make sure va_destroySurface is called before graphicbuffer is freed in case of port setting changed
mVideoDecoder->freeSurfaceBuffers();
+
+ // Also make sure all the reference frames are flushed
+ ProcessorFlush(INPORT_INDEX);
}
this->ports[OUTPORT_INDEX]->ReportPortSettingsChanged();
return OMX_ErrorNone;