summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-06-20 13:23:14 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-20 13:23:14 -0700
commit8c67a583db53eebe65bd0c3abb41909c60a02eb0 (patch)
tree1dc7037676992cede5c3ab779cea693a9877d714 /media/libstagefright
parente6ebb09642944b1d0cc06a788308e9b843dee595 (diff)
parent03168ed2f76e12e5dd41740697ea8206759924c1 (diff)
downloadframeworks_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.cpp19
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);