summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-03-19 20:27:59 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-19 20:27:59 +0000
commit2ceebb30a1ee5282d36bc47840f4c5a6187a7a92 (patch)
tree0f84b7a6e8522ed0c03f9c9c9900c5da01405e0e /media/libstagefright/OMXCodec.cpp
parent46d1b4ab7e83c677532587c7c8bd46eb8b30fc67 (diff)
parentbd1f8f0a5cc55761edfbd2a472e229dd4b0d2cdf (diff)
downloadframeworks_av-2ceebb30a1ee5282d36bc47840f4c5a6187a7a92.zip
frameworks_av-2ceebb30a1ee5282d36bc47840f4c5a6187a7a92.tar.gz
frameworks_av-2ceebb30a1ee5282d36bc47840f4c5a6187a7a92.tar.bz2
am bd1f8f0a: am fb28c384: am 1faa4170: stagefright: allow for minUndequeuedBufs to be one less
* commit 'bd1f8f0a5cc55761edfbd2a472e229dd4b0d2cdf': stagefright: allow for minUndequeuedBufs to be one less
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rw-r--r--media/libstagefright/OMXCodec.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 545ca9d..1cfe6c0 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1806,7 +1806,8 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
}
// FIXME: assume that surface is controlled by app (native window
// returns the number for the case when surface is not controlled by app)
- minUndequeuedBufs++;
+ // FIXME2: This means that minUndeqeueudBufs can be 1 larger than reported
+ // For now, try to allocate 1 more buffer, but don't fail if unsuccessful
// Use conservative allocation while also trying to reduce starvation
//
@@ -1814,10 +1815,11 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
// minimum needed for the consumer to be able to work
// 2. try to allocate two (2) additional buffers to reduce starvation from
// the consumer
- CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d",
+ // plus an extra buffer to account for incorrect minUndequeuedBufs
+ CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1",
def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs);
- for (OMX_U32 extraBuffers = 2; /* condition inside loop */; extraBuffers--) {
+ for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) {
OMX_U32 newBufferCount =
def.nBufferCountMin + minUndequeuedBufs + extraBuffers;
def.nBufferCountActual = newBufferCount;
@@ -1836,7 +1838,7 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
return err;
}
}
- CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d",
+ CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1",
def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs);
err = native_window_set_buffer_count(