Request cpuset change for 1080p HDR using soft decoder
Keep track of cpuset change requests in ResourceManagerService,
and request changing of cpuset via SchedulingPolicyService.
Bug: 72841545
Test:
1)Using modified Youtube/Exoplayer (that uses softMediaCodec
to decode VP9 profile2), manually verify the following:
- media.codec is put into top-app cpuset playing VP9 1080p HDR
- media.codec is put back into foreground after done
- media.codec stays in foreground cpuset playing other content
- kill the app process, verify media.codec is put back to
foreground until new instances request top-app
- kill mediaserver process, verify media.codec is put back to
foreground until new instances request top-app
- kill media.codec process, starting playback again, verify new
media.codec's cpuset can be changed correctly
- kill system_server process (using 'adb shell stop &&
adb shell start'), verify media.codec is put back to
foreground. Restart playback and verify the cpuset can be
changed correctly.
2) CTS post submit tests
Change-Id: Iba50ede1c08b695821fe4f56dbfc5694eab54e7b
diff --git a/media/utils/include/mediautils/SchedulingPolicyService.h b/media/utils/include/mediautils/SchedulingPolicyService.h
index 47d8734..a33539f 100644
--- a/media/utils/include/mediautils/SchedulingPolicyService.h
+++ b/media/utils/include/mediautils/SchedulingPolicyService.h
@@ -17,8 +17,11 @@
#ifndef _ANDROID_SCHEDULING_POLICY_SERVICE_H
#define _ANDROID_SCHEDULING_POLICY_SERVICE_H
+#include <utils/RefBase.h>
+
namespace android {
+class IInterface;
// Request elevated priority for thread tid, whose thread group leader must be pid.
// The priority parameter is currently restricted to either 1 or 2.
// The asynchronous parameter should be 'true' to return immediately,
@@ -26,6 +29,14 @@
// The default value 'false' means to return after request has been enqueued and executed.
int requestPriority(pid_t pid, pid_t tid, int32_t prio, bool isForApp, bool asynchronous = false);
+// Request to move media.codec process between SP_FOREGROUND and SP_TOP_APP.
+// When 'enable' is 'true', server will attempt to move media.codec process
+// from SP_FOREGROUND into SP_TOP_APP cpuset. A valid 'client' must be provided
+// for the server to receive death notifications. When 'enable' is 'false', server
+// will attempt to move media.codec process back to the original cpuset, and
+// 'client' is ignored in this case.
+int requestCpusetBoost(bool enable, const sp<IInterface> &client);
+
} // namespace android
#endif // _ANDROID_SCHEDULING_POLICY_SERVICE_H