summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiogo Ferreira <defer@cyngn.com>2016-08-30 11:41:42 +0100
committerDiogo Ferreira <defer@cyngn.com>2016-08-30 11:41:42 +0100
commitbdb54da9baf8349a1f030064c3af4ff7318f4771 (patch)
tree3cb5aa4574b8002fca709586e14718f6f72a5419
parent16d14e178003b193db1422c11c95bc0b1d44b690 (diff)
downloadframeworks_av-bdb54da9baf8349a1f030064c3af4ff7318f4771.zip
frameworks_av-bdb54da9baf8349a1f030064c3af4ff7318f4771.tar.gz
frameworks_av-bdb54da9baf8349a1f030064c3af4ff7318f4771.tar.bz2
libstagefright: mtk: Use vendor extensions to check if we should fixup cropping
For mediatek video codecs, validate that the current cropped rectangle is valid and use the full frame size otherwise. This fixes a bug where format changes in the same native window would preserve the previous cropping and cause most of the image to be off-screen. Change-Id: If56ca11453f5d2e04a4138b2efe28203f30ba569 Ticket: PORRIDGE-440
-rw-r--r--media/libstagefright/ACodec.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 427728f..e00e673 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -4209,6 +4209,16 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> &notify) {
rect.nWidth = videoDef->nFrameWidth;
rect.nHeight = videoDef->nFrameHeight;
}
+#ifdef MTK_HARDWARE
+ if (!strncmp(mComponentName.c_str(), "OMX.MTK.", 8) && mOMX->getConfig(
+ mNode, (OMX_INDEXTYPE) 0x7f00001c /* OMX_IndexVendorMtkOmxVdecGetCropInfo */,
+ &rect, sizeof(rect)) != OK) {
+ rect.nLeft = 0;
+ rect.nTop = 0;
+ rect.nWidth = videoDef->nFrameWidth;
+ rect.nHeight = videoDef->nFrameHeight;
+ }
+#endif
if (rect.nLeft < 0 ||
rect.nTop < 0 ||