mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1724994 - Promote GraphRunner to higher priority on Android. r=agi,pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D123346
This commit is contained in:
parent
4e0c60c99c
commit
a7b4d10bbb
@ -14,6 +14,9 @@
|
||||
#include "prthread.h"
|
||||
#include "Tracing.h"
|
||||
#include "audio_thread_priority.h"
|
||||
#ifdef ANDROID
|
||||
# include "AndroidProcess.h"
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -95,12 +98,31 @@ auto GraphRunner::OneIteration(GraphTime aStateTime, GraphTime aIterationEnd,
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
namespace {
|
||||
void PromoteRenderingThreadAndroid() {
|
||||
MOZ_LOG(gMediaTrackGraphLog, LogLevel::Debug,
|
||||
("GraphRunner default thread priority: %d",
|
||||
java::sdk::Process::GetThreadPriority(java::sdk::Process::MyTid())));
|
||||
java::sdk::Process::SetThreadPriority(
|
||||
java::sdk::Process::THREAD_PRIORITY_URGENT_AUDIO);
|
||||
MOZ_LOG(gMediaTrackGraphLog, LogLevel::Debug,
|
||||
("GraphRunner promoted thread priority: %d",
|
||||
java::sdk::Process::GetThreadPriority(java::sdk::Process::MyTid())));
|
||||
}
|
||||
}; // namespace
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP GraphRunner::Run() {
|
||||
#ifndef XP_LINUX
|
||||
atp_handle* handle =
|
||||
atp_promote_current_thread_to_real_time(0, mGraph->GraphRate());
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
PromoteRenderingThreadAndroid();
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIThreadInternal> threadInternal = do_QueryInterface(mThread);
|
||||
threadInternal->SetObserver(mGraph);
|
||||
|
||||
|
5
widget/android/bindings/AndroidProcess-classes.txt
Normal file
5
widget/android/bindings/AndroidProcess-classes.txt
Normal file
@ -0,0 +1,5 @@
|
||||
[android.os.Process = skip:true]
|
||||
setThreadPriority =
|
||||
getThreadPriority =
|
||||
myTid =
|
||||
THREAD_PRIORITY_URGENT_AUDIO =
|
@ -14,6 +14,7 @@ generated = [
|
||||
"AndroidBuild",
|
||||
"AndroidGraphics",
|
||||
"AndroidInputType",
|
||||
"AndroidProcess",
|
||||
"AndroidRect",
|
||||
"InetAddress",
|
||||
"JavaBuiltins",
|
||||
|
Loading…
Reference in New Issue
Block a user