libmix: Add handling for VP8 frames not for display

BZ: 108816

Add handling for VP8 frames not for display

Change-Id: I834c397e13dd8cf20a9410d31f3da22b78ab7e71
Signed-off-by: Tianmi Chen <tianmi.chen@intel.com>
Reviewed-on: http://android.intel.com:8080/109575
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/videodecoder/VideoDecoderBase.cpp b/videodecoder/VideoDecoderBase.cpp
index b1e9541..1eb6b3d 100755
--- a/videodecoder/VideoDecoderBase.cpp
+++ b/videodecoder/VideoDecoderBase.cpp
@@ -47,6 +47,7 @@
       mForwardReference(NULL),
       mDecodingFrame(false),
       mSizeChanged(false),
+      mShowFrame(true),
 
       // private member variables
       mLowDelay(false),
@@ -593,7 +594,11 @@
         CHECK_STATUS();
     }
     // frame is successfly decoded to the current surface,  it is ready for output
-    mAcquiredBuffer->renderBuffer.renderDone = false;
+    if (mShowFrame) {
+        mAcquiredBuffer->renderBuffer.renderDone = false;
+    } else {
+        mAcquiredBuffer->renderBuffer.renderDone = true;
+    }
 
     // decoder must set "asReference and referenceFrame" flags properly
 
@@ -615,13 +620,15 @@
         mLastReference = mAcquiredBuffer;
     }
     // add to the output list
-    if (mOutputHead == NULL) {
-        mOutputHead = mAcquiredBuffer;
-    } else {
-        mOutputTail->next = mAcquiredBuffer;
+    if (mShowFrame) {
+        if (mOutputHead == NULL) {
+            mOutputHead = mAcquiredBuffer;
+        } else {
+            mOutputTail->next = mAcquiredBuffer;
+        }
+        mOutputTail = mAcquiredBuffer;
+        mOutputTail->next = NULL;
     }
-    mOutputTail = mAcquiredBuffer;
-    mOutputTail->next = NULL;
 
     //VTRACE("Pushing POC %d to queue (pts = %.2f)", mAcquiredBuffer->pictureOrder, mAcquiredBuffer->renderBuffer.timeStamp/1E6);
 
diff --git a/videodecoder/VideoDecoderBase.h b/videodecoder/VideoDecoderBase.h
index a1ad265..2f45fec 100644
--- a/videodecoder/VideoDecoderBase.h
+++ b/videodecoder/VideoDecoderBase.h
@@ -112,6 +112,7 @@
     VideoConfigBuffer  mConfigBuffer; // only store configure meta data.
     bool mDecodingFrame; // indicate whether a frame is being decoded
     bool mSizeChanged; // indicate whether video size is changed.
+    bool mShowFrame; // indicate whether the decoded frame is for display
 
     enum {
         // TODO: move this to vbp_loader.h
diff --git a/videodecoder/VideoDecoderVP8.cpp b/videodecoder/VideoDecoderVP8.cpp
index f5362f4..c1a3545 100644
--- a/videodecoder/VideoDecoderVP8.cpp
+++ b/videodecoder/VideoDecoderVP8.cpp
@@ -138,6 +138,8 @@
                  (void**)&data);
     CHECK_STATUS("VideoDecoderBase::parseBuffer");
 
+    mShowFrame = data->codec_data->show_frame;
+
     if (!mVAStarted) {
         status = startVA(data);
         CHECK_STATUS("startVA");