summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author James Dong <jdong@google.com> 2010-12-07 14:37:27 -0800
committer James Dong <jdong@google.com> 2010-12-13 10:34:17 -0800
commitfc8b7c9ccf33b161f07e9bfcad28171c78d752ca (patch)
tree85ca1aad4cff89d74f72ed1e0ea7f65a655505b2
parentd1e039682082dc15583b64fafb2feeec4b0c9810 (diff)
Yield the omx threads so that file writer threads have a chance to retrieve the output buffers once they become ready
bug - 3252228 Change-Id: Iab7cf1c9a87cce7b814c63b42b21fcd6a7314b36
-rw-r--r--media/libstagefright/MPEG4Writer.cpp2
-rw-r--r--media/libstagefright/OMXCodec.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 602aa9f4dddf..06c4c980681a 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -1734,6 +1734,8 @@ status_t MPEG4Writer::Track::threadEntry() {
} else {
prctl(PR_SET_NAME, (unsigned long)"VideoTrackEncoding", 0, 0, 0);
}
+ setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_AUDIO);
+
sp<MetaData> meta_data;
mNumSamples = 0;
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index b954be76ad11..43e4e970ebda 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -2029,6 +2029,9 @@ void OMXCodec::on_message(const omx_message &msg) {
mFilledBuffers.push_back(i);
mBufferFilled.signal();
+ if (mIsEncoder) {
+ sched_yield();
+ }
}
break;