refine DRC for MPEG4/H263

BZ: 154291

if the resolution change in the middle of MPEG4/H263 during playing,
update the video format in order to info the upper layer of the change

Change-Id: Ie4e3ee4cf4fa5904c60e2a1d5266bcd3c03d6841
Signed-off-by: ywan171 <yi.a.wang@intel.com>
diff --git a/videodecoder/VideoDecoderMPEG4.cpp b/videodecoder/VideoDecoderMPEG4.cpp
index b99ed2e..0f72095 100644
--- a/videodecoder/VideoDecoderMPEG4.cpp
+++ b/videodecoder/VideoDecoderMPEG4.cpp
@@ -92,14 +92,21 @@
         CHECK_STATUS("startVA");
     }
 
-    status = decodeFrame(buffer, data);
-    CHECK_STATUS("decodeFrame");
-    if (mSizeChanged) {
-        mSizeChanged = false;
+    if ((mVideoFormatInfo.width != (int32_t)data->codec_data.video_object_layer_width ||
+        mVideoFormatInfo.height != (int32_t)data->codec_data.video_object_layer_height) &&
+        data->codec_data.video_object_layer_width &&
+        data->codec_data.video_object_layer_height) {
+        // update  encoded image size
+        mVideoFormatInfo.width = data->codec_data.video_object_layer_width;
+        mVideoFormatInfo.height = data->codec_data.video_object_layer_height;
         flushSurfaceBuffers();
+        ITRACE("Video size is changed.");
         return DECODE_FORMAT_CHANGE;
     }
 
+    status = decodeFrame(buffer, data);
+    CHECK_STATUS("decodeFrame");
+
     return status;
 }