summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-08-14 10:28:14 -0700
committerAndreas Huber <andih@google.com>2013-08-14 10:28:14 -0700
commit0167414e261f88a96b5e4bf6cb592e6ca11e5a95 (patch)
tree1510cccda507a05fa1b410b4a6a8d4828a1740cc /media/libstagefright/ACodec.cpp
parentcd06d357ed4fcde991aa55dc97317d97cb287332 (diff)
downloadframeworks_av-0167414e261f88a96b5e4bf6cb592e6ca11e5a95.zip
frameworks_av-0167414e261f88a96b5e4bf6cb592e6ca11e5a95.tar.gz
frameworks_av-0167414e261f88a96b5e4bf6cb592e6ca11e5a95.tar.bz2
You can now opt-in to having the video decoder push blank buffers to the
surface on the transition from executing->idle by specifying the key "push-blank-buffers-on-shutdown" with a value of 1 in the call to configure. Change-Id: I1155fccf89f18e717728c985e590651597595515
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 7b0bce0..2e55c4f 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1114,6 +1114,12 @@ status_t ACodec::configureCodec(
ALOGV("[%s] storeMetaDataInBuffers succeeded", mComponentName.c_str());
mStoreMetaDataInOutputBuffers = true;
}
+
+ int32_t push;
+ if (msg->findInt32("push-blank-buffers-on-shutdown", &push)
+ && push != 0) {
+ mFlags |= kFlagPushBlankBuffersToNativeWindowOnShutdown;
+ }
}
if (video) {
@@ -3584,6 +3590,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) {
if (componentName.endsWith(".secure")) {
mCodec->mFlags |= kFlagIsSecure;
+ mCodec->mFlags |= kFlagPushBlankBuffersToNativeWindowOnShutdown;
}
mCodec->mQuirks = quirks;
@@ -4413,7 +4420,8 @@ void ACodec::ExecutingToIdleState::changeStateIfWeOwnAllBuffers() {
CHECK_EQ(mCodec->freeBuffersOnPort(kPortIndexInput), (status_t)OK);
CHECK_EQ(mCodec->freeBuffersOnPort(kPortIndexOutput), (status_t)OK);
- if (mCodec->mFlags & kFlagIsSecure && mCodec->mNativeWindow != NULL) {
+ if ((mCodec->mFlags & kFlagPushBlankBuffersToNativeWindowOnShutdown)
+ && mCodec->mNativeWindow != NULL) {
// We push enough 1x1 blank buffers to ensure that one of
// them has made it to the display. This allows the OMX
// component teardown to zero out any protected buffers