vpp num should omit in decoder buffer comparison

BZ: 145717

vpp num should omit in decoder buffer comparison

Change-Id: Id0e08fe0ff837b96fc3fa0c0979286eb5d181de3
Signed-off-by: Yu, Linda <linda.yu@intel.com>
diff --git a/videodecoder/Android.mk b/videodecoder/Android.mk
index 18ccd15..f7b7c80 100644
--- a/videodecoder/Android.mk
+++ b/videodecoder/Android.mk
@@ -1,6 +1,10 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
+ifeq ($(TARGET_HAS_VPP),true)
+LOCAL_CFLAGS += -DTARGET_HAS_VPP
+endif
+
 LOCAL_SRC_FILES := \
     VideoDecoderHost.cpp \
     VideoDecoderBase.cpp \
diff --git a/videodecoder/VideoDecoderBase.cpp b/videodecoder/VideoDecoderBase.cpp
index 19b8fee..ec429a1 100755
--- a/videodecoder/VideoDecoderBase.cpp
+++ b/videodecoder/VideoDecoderBase.cpp
@@ -712,7 +712,11 @@
     }
 
     if (mConfigBuffer.flag & USE_NATIVE_GRAPHIC_BUFFER){
+#ifdef TARGET_HAS_VPP
+        if (mVideoFormatInfo.actualBufferNeeded > mConfigBuffer.surfaceNumber - mConfigBuffer.vppBufferNum)
+#else
         if (mVideoFormatInfo.actualBufferNeeded > mConfigBuffer.surfaceNumber)
+#endif
             return DECODE_FORMAT_CHANGE;
 
         numSurface = mConfigBuffer.surfaceNumber;
diff --git a/videodecoder/VideoDecoderDefs.h b/videodecoder/VideoDecoderDefs.h
index 8f94cde..d3deb56 100644
--- a/videodecoder/VideoDecoderDefs.h
+++ b/videodecoder/VideoDecoderDefs.h
@@ -135,6 +135,9 @@
     VideoExtensionBuffer *ext;
     void* nativeWindow;
     uint32_t rotationDegrees;
+#ifdef TARGET_HAS_VPP
+    uint32_t vppBufferNum;
+#endif
 };
 
 struct VideoRenderBuffer {