summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2014-09-24 14:55:23 -0700
committerRonghua Wu <ronghuawu@google.com>2014-09-24 16:44:15 -0700
commitd5a2f55034022f2d0425fa0701894d0c4787b726 (patch)
tree083ced109691ba794c8c4e595cc55e5f57314a96 /media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
parent80ec934ae7d4e3a78af87554fdb77a58f6386ba0 (diff)
downloadframeworks_av-d5a2f55034022f2d0425fa0701894d0c4787b726.zip
frameworks_av-d5a2f55034022f2d0425fa0701894d0c4787b726.tar.gz
frameworks_av-d5a2f55034022f2d0425fa0701894d0c4787b726.tar.bz2
stagefright: fix cropping handling for SoftAVC and SoftMEPEG4.
Bug: 17326758 Change-Id: I9b0c281d92cf1803e275b1768e9edab9404ea577
Diffstat (limited to 'media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp')
-rw-r--r--media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
index 5b2ab84..d98fa80 100644
--- a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
+++ b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
@@ -295,19 +295,23 @@ bool SoftMPEG4::handlePortSettingsChange() {
ALOGV("disp_width = %d, disp_height = %d, buf_width = %d, buf_height = %d",
disp_width, disp_height, buf_width, buf_height);
- bool cropChanged = false;
- if (mCropWidth != disp_width || mCropHeight != disp_height) {
- mCropLeft = 0;
- mCropTop = 0;
- mCropWidth = disp_width;
- mCropHeight = disp_height;
- cropChanged = true;
+ CropSettingsMode cropSettingsMode = kCropUnSet;
+ if (disp_width != buf_width || disp_height != buf_height) {
+ cropSettingsMode = kCropSet;
+
+ if (mCropWidth != disp_width || mCropHeight != disp_height) {
+ mCropLeft = 0;
+ mCropTop = 0;
+ mCropWidth = disp_width;
+ mCropHeight = disp_height;
+ cropSettingsMode = kCropChanged;
+ }
}
bool portWillReset = false;
const bool fakeStride = true;
SoftVideoDecoderOMXComponent::handlePortSettingsChange(
- &portWillReset, buf_width, buf_height, cropChanged, fakeStride);
+ &portWillReset, buf_width, buf_height, cropSettingsMode, fakeStride);
if (portWillReset) {
if (mMode == MODE_H263) {
PVCleanUpVideoDecoder(mHandle);