summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManikanta Sivapala <msivap@codeaurora.org>2015-11-17 01:33:02 +0530
committerManikanta Sivapala <msivap@codeaurora.org>2015-11-17 11:48:29 +0530
commita99ddd922157a1312cb901f2b8a6ba1d338b4e25 (patch)
treef35898508dacb93d273e49fb6aea36825f633c1f
parent5018d5cc324f78c46b8f00e0b2a8af738ef18990 (diff)
downloadandroid_hardware_qcom_media-a99ddd922157a1312cb901f2b8a6ba1d338b4e25.tar.gz
android_hardware_qcom_media-a99ddd922157a1312cb901f2b8a6ba1d338b4e25.tar.bz2
android_hardware_qcom_media-a99ddd922157a1312cb901f2b8a6ba1d338b4e25.zip
dashplayer: Set dpb size on dashplayer
Missing chnage in DashPlayerDecoder to compute and set dpb size on player. Change-Id: Id071e0cf454500b2377cc173e87f5008bfc7471d
-rw-r--r--dashplayer/DashPlayerDecoder.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/dashplayer/DashPlayerDecoder.cpp b/dashplayer/DashPlayerDecoder.cpp
index ec66c1db..f17c0b39 100644
--- a/dashplayer/DashPlayerDecoder.cpp
+++ b/dashplayer/DashPlayerDecoder.cpp
@@ -335,9 +335,36 @@ bool DashPlayer::Decoder::handleAnOutputBuffer() {
return false;
}
+ /* Computation of dpbSize
+
+ #dpbSize = #output buffers
+ - 2 extrabuffers allocated by firmware
+ - minUndequeuedBufs (query from native window)
+ - 3 extrabuffers allocated by codec
+ If extrabuffers allocated by firmware or ACodec changes,
+ above eq. needs to be updated
+ */
+
+ int dpbSize = 0;
+ if (mNativeWindow != NULL) {
+ sp<ANativeWindow> nativeWindow = mNativeWindow.get();
+ if (nativeWindow != NULL) {
+ int minUndequeuedBufs = 0;
+ status_t err = nativeWindow->query(nativeWindow.get(),
+ NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &minUndequeuedBufs);
+ if (err == NO_ERROR) {
+ dpbSize = (mOutputBuffers.size() - minUndequeuedBufs - 5) > 0 ?
+ (mOutputBuffers.size() - minUndequeuedBufs - 5) : 0;
+ DPD_MSG_ERROR("[%s] computed DPB size of video stream = %d",
+ mComponentName.c_str(), dpbSize);
+ }
+ }
+ }
+
sp<AMessage> notify = mNotify->dup();
notify->setInt32("what", kWhatOutputFormatChanged);
notify->setMessage("format", format);
+ notify->setInt32("dpb-size", dpbSize);
notify->post();
return true;
} else if (res == INFO_DISCONTINUITY) {