diff options
author | James Dong <jdong@google.com> | 2011-08-14 16:14:12 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-08-16 10:02:17 -0700 |
commit | 92d6ea3e83f29047bef4fd8dcf378b757967dc00 (patch) | |
tree | 8b5b699de6fc122b88235596f7eaf12f0f9ea8ad /media | |
parent | 0f2da17a9523fc40bceb5209cabd044df648e98e (diff) | |
download | frameworks_base-92d6ea3e83f29047bef4fd8dcf378b757967dc00.zip frameworks_base-92d6ea3e83f29047bef4fd8dcf378b757967dc00.tar.gz frameworks_base-92d6ea3e83f29047bef4fd8dcf378b757967dc00.tar.bz2 |
Don't time out prematurely for video encoding waiting for output buffers
o For timelapse video encoding, the timelapse between two neighoring
input frames could be very long
Change-Id: I2b6f9c392f2237deae71c894efc7fc3692431796
related-to-bug: 5160548
Diffstat (limited to 'media')
-rwxr-xr-x | media/libstagefright/OMXCodec.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 644c413..27dfeab 100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -3199,9 +3199,16 @@ void OMXCodec::setState(State newState) { } status_t OMXCodec::waitForBufferFilled_l() { + + if (mIsEncoder) { + // For timelapse video recording, the timelapse video recording may + // not send an input frame for a _long_ time. Do not use timeout + // for video encoding. + return mBufferFilled.wait(mLock); + } status_t err = mBufferFilled.waitRelative(mLock, kBufferFilledEventTimeOutUs); if (err != OK) { - LOGE("Timed out waiting for buffers from video encoder: %d/%d", + CODEC_LOGE("Timed out waiting for output buffers: %d/%d", countBuffersWeOwn(mPortBuffers[kPortIndexInput]), countBuffersWeOwn(mPortBuffers[kPortIndexOutput])); } |