summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-08-15 16:12:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-15 16:12:08 +0000
commit75c16dde986e16ac5fd4d34b06b0cc6a90679866 (patch)
tree82d64dc5359021224e07e0e63fb74e4d1f3deb16
parentc85a986af84962515c10499faab3dc8f9a0948d4 (diff)
parent0167414e261f88a96b5e4bf6cb592e6ca11e5a95 (diff)
downloadframeworks_av-75c16dde986e16ac5fd4d34b06b0cc6a90679866.zip
frameworks_av-75c16dde986e16ac5fd4d34b06b0cc6a90679866.tar.gz
frameworks_av-75c16dde986e16ac5fd4d34b06b0cc6a90679866.tar.bz2
Merge "You can now opt-in to having the video decoder push blank buffers to the" into klp-dev
-rw-r--r--include/media/stagefright/ACodec.h3
-rw-r--r--media/libstagefright/ACodec.cpp10
2 files changed, 11 insertions, 2 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index 41542ec..a8ffd4a 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -124,7 +124,8 @@ private:
};
enum {
- kFlagIsSecure = 1,
+ kFlagIsSecure = 1,
+ kFlagPushBlankBuffersToNativeWindowOnShutdown = 2,
};
struct BufferInfo {
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