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 | 64b944106c697933a453a1ffd8bcddb137fdbc4c (patch) | |
tree | 6186c0bba24f052e39a8bb52c090743f901f9123 /media/libstagefright/OMXCodec.cpp | |
parent | a5cc7cce9b8aee73b08f6532710e186c02fdd1c0 (diff) | |
download | frameworks_av-64b944106c697933a453a1ffd8bcddb137fdbc4c.zip frameworks_av-64b944106c697933a453a1ffd8bcddb137fdbc4c.tar.gz frameworks_av-64b944106c697933a453a1ffd8bcddb137fdbc4c.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/libstagefright/OMXCodec.cpp')
-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])); } |