libmix: adjust video buffer count for AVC
BZ: 188633
adjust video buffer count for AVC
Change-Id: I4bd3d1108ff6e8dd996f46dcfbcb0d06bf7aba22
Signed-off-by: Tianmi Chen <tianmi.chen@intel.com>
diff --git a/videodecoder/VideoDecoderAVC.cpp b/videodecoder/VideoDecoderAVC.cpp
index 03abb3b..13dd5db 100644
--- a/videodecoder/VideoDecoderAVC.cpp
+++ b/videodecoder/VideoDecoderAVC.cpp
@@ -772,18 +772,14 @@
}
}
- // considering there is a B frame to be output, which needs to be exclued in output queue
- int diff = data->codec_data->num_ref_frames + 1 - (mOutputWindowSize - 1);
-
if (mConfigBuffer.flag & WANT_SURFACE_PROTECTION) {
mVideoFormatInfo.actualBufferNeeded = mConfigBuffer.surfaceNumber;
} else {
// The number of actual buffer needed is
- // outputQueue + nativewindow_owned + (diff > 0 ? diff : 1) + widi_need_max + 1(available buffer)
+ // outputQueue + nativewindow_owned + num_ref_frames + widi_need_max + 1(available buffer)
// while outputQueue = DPB < 8? DPB :8
- // and diff = DBPSize - (outputQ - 1)
mVideoFormatInfo.actualBufferNeeded = mOutputWindowSize + NW_CONSUMED /* Owned by native window */
- + (diff > 0 ? diff : 1)
+ + data->codec_data->num_ref_frames
#ifndef USE_GEN_HW
+ HDMI_CONSUMED /* Two extra buffers are needed for native window buffer cycling */
+ (mWiDiOn ? WIDI_CONSUMED : 0) /* WiDi maximum needs */