libmix: set EOS flag in the last output frame

BZ: 134842

set eos flag in the last output frame if draining flag is set

Change-Id: I7ca213833cf94cb495b0f6b029d441d079df11da
Signed-off-by: ywan171 <yi.a.wang@intel.com>
Reviewed-on: http://android.intel.com:8080/133482
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: Ding, Haitao <haitao.ding@intel.com>
Tested-by: Ding, Haitao <haitao.ding@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
diff --git a/videodecoder/VideoDecoderBase.cpp b/videodecoder/VideoDecoderBase.cpp
index a050f7b..f2d72d6 100755
--- a/videodecoder/VideoDecoderBase.cpp
+++ b/videodecoder/VideoDecoderBase.cpp
@@ -234,6 +234,9 @@
         vaStatus = vaSetTimestampForSurface(mVADisplay, outputByPos->renderBuffer.surface, outputByPos->renderBuffer.timeStamp);
         if (useGraphicBuffer)
             vaSyncSurface(mVADisplay, outputByPos->renderBuffer.surface);
+        if (draining && mOutputTail == NULL) {
+            outputByPos->renderBuffer.flag |= IS_EOS;
+        }
         return &(outputByPos->renderBuffer);
     }
 
@@ -284,6 +287,9 @@
     if (useGraphicBuffer)
         vaSyncSurface(mVADisplay, output->renderBuffer.surface);
 
+    if (draining && mOutputTail == NULL) {
+        output->renderBuffer.flag |= IS_EOS;
+    }
     return &(output->renderBuffer);
 }
 
diff --git a/videodecoder/VideoDecoderDefs.h b/videodecoder/VideoDecoderDefs.h
index 4f44adf..8f94cde 100644
--- a/videodecoder/VideoDecoderDefs.h
+++ b/videodecoder/VideoDecoderDefs.h
@@ -102,6 +102,9 @@
     // indicate whether video decoder buffer contains secure data
     IS_SECURE_DATA = 0x8000,
 
+    // indicate it's the last output frame of the sequence
+    IS_EOS = 0x10000,
+
 } VIDEO_BUFFER_FLAG;
 
 struct VideoDecodeBuffer {