Qualifier and Type |
Method Name and Description |
|---|---|
int |
Init(JNIEnv *env) 初始化Socket通道。返回0,则初始化成功;否则初始化失败,调用其他API都会失败,具体错误码参见常量。 |
int |
GetApiVersion(std::string &outStr) 获取当前API版本号,版本号为X.Y.Z格式的字符串,例如:0.9.1。 |
int |
SetFrameRate(int fps) 设置显示帧率,通过降低帧率以降低功耗或提高帧率以提升显示效果。 |
int |
恢复系统默认帧率。 |
int |
获取当前帧率。 |
int |
GetSupportedFrameRate(std::vector<int>&) 获取系统支持的帧率列表,列表的格式为int型数组,如:15 20 30 60 90。 |
int |
SetScene(const std::string &sceneDescription) 设置应用场景,当前支持的场景参见表1,5.0.5版本中该接口只针对非游戏类应用生效。 |
int |
获取当前系统性能水平等级。 |
int |
AddKeyThreads(std::vector<int32_t> &tids) 添加关键线程,系统会更及时地调度关键线程。最多可以支持三个关键线程,但只能给前台进程添加关键线程,且线程必须都在本进程内。 |
int |
RemoveKeyThreads(std::vector<int32_t> &tids) 移除关键线程。 |
int |
using SystemEventCb = std::function<void (int)> RegisterSystemEventCallback(SystemEventCb cb) 注册系统事件回调函数,回调参数类型为int,即SystemEvent定义的枚举值。当性能水平或帧率变化时,调用注册的回调函数。 |
int |
UnRegisterSystemEventCallback() 解注册系统事件回调函数。 |
int |
using PerformanceTracerCb = std::function<void (std::vector<uint32_t>&)> RegisterPerformanceTracer(int sampleRate, PerformanceTracerCb) = 0 注册系统性能追踪回调函数,按照指定周期返回CPU、GPU的负载情况,目前只支持游戏场景。 |
int |
取消注册性能追踪回调函数。 |
PerfGeniusApi * |
创建全局唯一的PerfGenius API指针。 |
void |
销毁全局唯一的PerfGenius API指针。 |