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 | 8c67a583db53eebe65bd0c3abb41909c60a02eb0 (patch) | |
tree | 1dc7037676992cede5c3ab779cea693a9877d714 /media/libstagefright | |
parent | e6ebb09642944b1d0cc06a788308e9b843dee595 (diff) | |
parent | 03168ed2f76e12e5dd41740697ea8206759924c1 (diff) | |
download | frameworks_av-8c67a583db53eebe65bd0c3abb41909c60a02eb0.zip frameworks_av-8c67a583db53eebe65bd0c3abb41909c60a02eb0.tar.gz frameworks_av-8c67a583db53eebe65bd0c3abb41909c60a02eb0.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."
Diffstat (limited to 'media/libstagefright')
-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); |