summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueConsumer.cpp
diff options
context:
space:
mode:
author Steven Thomas <steventhomas@google.com> 2020-01-06 19:25:30 -0800
committer Steven Thomas <steventhomas@google.com> 2020-01-16 14:24:13 -0800
commit3172e2028b191ed485385f02a443b1f9b0d730f9 (patch)
treed966fcda885b7188cb8b03973e8d6398e03fdaf8 /libs/gui/BufferQueueConsumer.cpp
parent92bd250eda0de9b0d3d966f285a8a75fcfd85149 (diff)
Add plumbing for upcoming setFrameRate() api
Add plumbing from the app to surface flinger for the ANativeWindow_setFrameRate() and ASurfaceTransaction_setFrameRate() api calls we'll be adding soon. We don't do anything in surface flinger with this data yet. Bug: 143912624 Test: Added a new test, SetFrameRateTest. Change-Id: I1cab87f3ce5afca4591a39d8e7a42cb1e86a368f
Diffstat (limited to 'libs/gui/BufferQueueConsumer.cpp')
-rw-r--r--libs/gui/BufferQueueConsumer.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp
index 6418e8c9a9..9b74fef752 100644
--- a/libs/gui/BufferQueueConsumer.cpp
+++ b/libs/gui/BufferQueueConsumer.cpp
@@ -775,6 +775,18 @@ status_t BufferQueueConsumer::discardFreeBuffers() {
return NO_ERROR;
}
+status_t BufferQueueConsumer::setFrameRate(float frameRate) {
+ std::lock_guard<std::mutex> lock(mCore->mMutex);
+ mCore->mFrameRate = frameRate;
+ return NO_ERROR;
+}
+
+status_t BufferQueueConsumer::getFrameRate(float* frameRate) const {
+ std::lock_guard<std::mutex> lock(mCore->mMutex);
+ *frameRate = mCore->mFrameRate;
+ return NO_ERROR;
+}
+
status_t BufferQueueConsumer::dumpState(const String8& prefix, String8* outResult) const {
struct passwd* pwd = getpwnam("shell");
uid_t shellUid = pwd ? pwd->pw_uid : 0;