diff options
author | Lajos Molnar <lajos@google.com> | 2014-03-28 00:11:04 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-03-28 00:11:04 +0000 |
commit | 3d4e4fcbcfc5c16dd794591727f5c713831ab6dc (patch) | |
tree | acf2c5ba89002a15ef82677408f11dabc040adf8 | |
parent | 0370be96e33ea0c8fb4069e704deccce43b7403c (diff) | |
parent | f5ee327780ea2b538b8affafa8063f0ce0390fe0 (diff) | |
download | frameworks_av-3d4e4fcbcfc5c16dd794591727f5c713831ab6dc.zip frameworks_av-3d4e4fcbcfc5c16dd794591727f5c713831ab6dc.tar.gz frameworks_av-3d4e4fcbcfc5c16dd794591727f5c713831ab6dc.tar.bz2 |
Merge "DO NOT MERGE: Revert "stagefright: allow for minUndequeuedBufs to be one less"" into klp-dev
-rw-r--r-- | media/libstagefright/ACodec.cpp | 7 | ||||
-rw-r--r-- | media/libstagefright/OMXCodec.cpp | 10 |
2 files changed, 7 insertions, 10 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 3ad3ca7..14d99cf 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -640,8 +640,8 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( // FIXME: assume that surface is controlled by app (native window // returns the number for the case when surface is not controlled by app) - // 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 + (*minUndequeuedBuffers)++; + // Use conservative allocation while also trying to reduce starvation // @@ -649,8 +649,7 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( // minimum needed for the consumer to be able to work // 2. try to allocate two (2) additional buffers to reduce starvation from // the consumer - // plus an extra buffer to account for incorrect minUndequeuedBufs - for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) { + for (OMX_U32 extraBuffers = 2; /* condition inside loop */; extraBuffers--) { OMX_U32 newBufferCount = def.nBufferCountMin + *minUndequeuedBuffers + extraBuffers; def.nBufferCountActual = newBufferCount; diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 070e438..79a9665 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1780,8 +1780,7 @@ 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) - // 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 + minUndequeuedBufs++; // Use conservative allocation while also trying to reduce starvation // @@ -1789,11 +1788,10 @@ 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 - // plus an extra buffer to account for incorrect minUndequeuedBufs - CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1", + CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d", def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs); - for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) { + for (OMX_U32 extraBuffers = 2; /* condition inside loop */; extraBuffers--) { OMX_U32 newBufferCount = def.nBufferCountMin + minUndequeuedBufs + extraBuffers; def.nBufferCountActual = newBufferCount; @@ -1812,7 +1810,7 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { return err; } } - CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1", + CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d", def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs); err = native_window_set_buffer_count( |