diff options
author | James Dong <jdong@google.com> | 2011-06-20 11:40:52 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-06-20 12:09:49 -0700 |
commit | 32bb368a51e053823a9c3d95919f49acae7ddc87 (patch) | |
tree | d3d955d466fb5a2559d9e175148bf34722d62fae /media | |
parent | 9c8e735817b8ff57070a035d2463f22eea50b8d4 (diff) | |
download | frameworks_base-32bb368a51e053823a9c3d95919f49acae7ddc87.zip frameworks_base-32bb368a51e053823a9c3d95919f49acae7ddc87.tar.gz frameworks_base-32bb368a51e053823a9c3d95919f49acae7ddc87.tar.bz2 |
When a recording session is stopped, no outstanding input video frames exist for the output buffers returned from OMX component to SF.
When this happens, default value of 0 will be used for the "decoding" time for these output buffers.
These buffers do not contain valid media data anyway.
related-to-bug: 4725803
Change-Id: I0eaf248bb2ac022ff072eaffd0ed3f21171f824e
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/OMXCodec.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index c4fcc79..bb8a8be 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1983,7 +1983,14 @@ OMXCodec::BufferInfo* OMXCodec::dequeueBufferFromNativeWindow() { int64_t OMXCodec::retrieveDecodingTimeUs(bool isCodecSpecific) { CHECK(mIsEncoder); - CHECK(!mDecodingTimeList.empty()); + + if (mDecodingTimeList.empty()) { + CHECK(mNoMoreOutputData); + // No corresponding input frame available. + // This could happen when EOS is reached. + return 0; + } + List<int64_t>::iterator it = mDecodingTimeList.begin(); int64_t timeUs = *it; @@ -2152,11 +2159,6 @@ void OMXCodec::on_message(const omx_message &msg) { buffer->meta_data()->setInt32(kKeyIsUnreadable, true); } - if (mIsEncoder) { - int64_t decodingTimeUs = retrieveDecodingTimeUs(isCodecSpecific); - buffer->meta_data()->setInt64(kKeyDecodingTime, decodingTimeUs); - } - buffer->meta_data()->setPointer( kKeyPlatformPrivate, msg.u.extended_buffer_data.platform_private); @@ -2170,6 +2172,11 @@ void OMXCodec::on_message(const omx_message &msg) { mNoMoreOutputData = true; } + if (mIsEncoder) { + int64_t decodingTimeUs = retrieveDecodingTimeUs(isCodecSpecific); + buffer->meta_data()->setInt64(kKeyDecodingTime, decodingTimeUs); + } + if (mTargetTimeUs >= 0) { CHECK(msg.u.extended_buffer_data.timestamp <= mTargetTimeUs); |