libmix: fix a Video Editor Green Bar issue

BZ: 159760

Video Editor uses the width/heigth in the port definition of
decoder when it exports moive. Some clip's container has the
wrong width/height info and may cause green bar issue in the
raw data mode.

Change-Id: Ib7650b8149e3b7cb49442bc8ed4734980bfe93c4
Signed-off-by: Dan Liang <dan.liang@intel.com>
diff --git a/videodecoder/VideoDecoderAVC.cpp b/videodecoder/VideoDecoderAVC.cpp
index 5548625..e7fe570 100644
--- a/videodecoder/VideoDecoderAVC.cpp
+++ b/videodecoder/VideoDecoderAVC.cpp
@@ -738,6 +738,18 @@
         data->codec_data->crop_right,
         data->codec_data->crop_bottom);
 
+    if (!(mConfigBuffer.flag & USE_NATIVE_GRAPHIC_BUFFER)){
+        // BUG 159760: the port definition's height were set according to the infomation in container.
+        // In some cases, this info is not right. Need to correct it by format change notification.
+        uint32_t cropWidth = mVideoFormatInfo.width - (mVideoFormatInfo.cropLeft + mVideoFormatInfo.cropRight);
+        uint32_t cropHeight = mVideoFormatInfo.height - (mVideoFormatInfo.cropBottom + mVideoFormatInfo.cropTop);
+
+        if (width != cropWidth || height != cropHeight) {
+            mSizeChanged = true;
+            ITRACE("Raw data mode: video size is changed.");
+        }
+    }
+
     int diff = data->codec_data->num_ref_frames + 1 - mOutputWindowSize;
 
     if (mConfigBuffer.flag & WANT_SURFACE_PROTECTION) {