diff options
author | James Dong <jdong@google.com> | 2011-06-20 13:23:14 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-20 13:23:14 -0700 |
commit | b2af97e9a11119a257289cb8c539b5de79093052 (patch) | |
tree | ff3c2c0bcae00ce017fdbf2379282b1ad949bff0 | |
parent | 1be495683c9e6dba07d36f18a0b6ae8ece7b276f (diff) | |
parent | 32bb368a51e053823a9c3d95919f49acae7ddc87 (diff) | |
download | frameworks_base-b2af97e9a11119a257289cb8c539b5de79093052.zip frameworks_base-b2af97e9a11119a257289cb8c539b5de79093052.tar.gz frameworks_base-b2af97e9a11119a257289cb8c539b5de79093052.tar.bz2 |
Merge "When a recording session is stopped, no outstanding input video frames exist for the output buffers returned from OMX component to SF."
-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); |