summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-05-06 14:01:44 -0700
committerLajos Molnar <lajos@google.com>2015-05-07 11:46:15 -0700
commit8b23759763dbf11b0c628a7e62dc5b3dea7dc188 (patch)
treec9497edda694bfdcf2832f29480209d18e556537 /media
parent484979b1ab25aa41f503bd846323ab93b46d37e5 (diff)
downloadframeworks_av-8b23759763dbf11b0c628a7e62dc5b3dea7dc188.zip
frameworks_av-8b23759763dbf11b0c628a7e62dc5b3dea7dc188.tar.gz
frameworks_av-8b23759763dbf11b0c628a7e62dc5b3dea7dc188.tar.bz2
stagefright: support push-blank-buffers-on-shutdown for SW renderer
Bug: 20885565 Change-Id: I2a361b8dd6d39d2cf994f6748ed562be4c642b77
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/MediaCodec.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index ed4f682..44f6542 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -46,6 +46,7 @@
#include <media/stagefright/OMXClient.h>
#include <media/stagefright/OMXCodec.h>
#include <media/stagefright/PersistentSurface.h>
+#include <media/stagefright/SurfaceUtils.h>
#include <private/android_filesystem_config.h>
#include <utils/Log.h>
#include <utils/Singleton.h>
@@ -1659,6 +1660,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
sp<AMessage> format;
CHECK(msg->findMessage("format", &format));
+ int32_t push;
+ if (msg->findInt32("push-blank-buffers-on-shutdown", &push) && push != 0) {
+ mFlags |= kFlagPushBlankBuffersOnShutdown;
+ }
+
if (obj != NULL) {
format->setObject("native-window", obj);
status_t err = handleSetSurface(static_cast<Surface *>(obj.get()));
@@ -1725,6 +1731,10 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
} else {
if (err == OK) {
if (mFlags & kFlagUsesSoftwareRenderer) {
+ if (mSoftRenderer != NULL
+ && (mFlags & kFlagPushBlankBuffersOnShutdown)) {
+ pushBlankBuffersToNativeWindow(mSurface.get());
+ }
mSoftRenderer = new SoftwareRenderer(surface);
// TODO: check if this was successful
} else {
@@ -1848,6 +1858,10 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
msg->what() == kWhatStop /* keepComponentAllocated */);
returnBuffersToCodec();
+
+ if (mSoftRenderer != NULL && (mFlags & kFlagPushBlankBuffersOnShutdown)) {
+ pushBlankBuffersToNativeWindow(mSurface.get());
+ }
break;
}