summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/OMX.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-03-12 14:33:12 -0800
committerAndreas Huber <andih@google.com>2010-03-12 14:33:12 -0800
commit52e71f87f1dac8d2f6bcaf77bb25b78cba664c43 (patch)
treea1afac4b99b35256d406c9be373fa5568433c5c1 /media/libstagefright/omx/OMX.cpp
parentc116510dd22091369ab15b63fbbc176e1fb39a04 (diff)
downloadframeworks_av-52e71f87f1dac8d2f6bcaf77bb25b78cba664c43.zip
frameworks_av-52e71f87f1dac8d2f6bcaf77bb25b78cba664c43.tar.gz
frameworks_av-52e71f87f1dac8d2f6bcaf77bb25b78cba664c43.tar.bz2
Boost OMX callback dispatcher thread priority to prevent audio playback stuttering under increased system load
Change-Id: I1b5339b4d39bd964f286cdf1369d0e0492a465d7 related-to-bug: 2492002
Diffstat (limited to 'media/libstagefright/omx/OMX.cpp')
-rw-r--r--media/libstagefright/omx/OMX.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index ff8757d..13cb460 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -19,6 +19,8 @@
#include <utils/Log.h>
#include <dlfcn.h>
+#include <linux/prctl.h>
+#include <sys/resource.h>
#include "../include/OMX.h"
#include "OMXRenderer.h"
@@ -29,6 +31,7 @@
#include <binder/IMemory.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/VideoRenderer.h>
+#include <utils/threads.h>
#include "OMXMaster.h"
@@ -91,6 +94,7 @@ OMX::CallbackDispatcher::~CallbackDispatcher() {
void OMX::CallbackDispatcher::post(const omx_message &msg) {
Mutex::Autolock autoLock(mLock);
+
mQueue.push_back(msg);
mQueueChanged.signal();
}
@@ -112,6 +116,9 @@ void *OMX::CallbackDispatcher::ThreadWrapper(void *me) {
}
void OMX::CallbackDispatcher::threadEntry() {
+ setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_AUDIO);
+ prctl(PR_SET_NAME, (unsigned long)"OMXCallbackDisp", 0, 0, 0);
+
for (;;) {
omx_message msg;