diff options
author | 2020-01-06 19:25:30 -0800 | |
---|---|---|
committer | 2020-01-16 14:24:13 -0800 | |
commit | 3172e2028b191ed485385f02a443b1f9b0d730f9 (patch) | |
tree | d966fcda885b7188cb8b03973e8d6398e03fdaf8 /libs/gui/ConsumerBase.cpp | |
parent | 92bd250eda0de9b0d3d966f285a8a75fcfd85149 (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/ConsumerBase.cpp')
-rw-r--r-- | libs/gui/ConsumerBase.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp index 9f91d9d3aa..515f45c546 100644 --- a/libs/gui/ConsumerBase.cpp +++ b/libs/gui/ConsumerBase.cpp @@ -363,6 +363,24 @@ status_t ConsumerBase::discardFreeBuffers() { return OK; } +status_t ConsumerBase::setFrameRate(float frameRate) { + Mutex::Autolock _l(mMutex); + if (mAbandoned) { + CB_LOGE("setFrameRate: ConsumerBase is abandoned!"); + return NO_INIT; + } + return mConsumer->setFrameRate(frameRate); +} + +status_t ConsumerBase::getFrameRate(float* frameRate) { + Mutex::Autolock _l(mMutex); + if (mAbandoned) { + CB_LOGE("getFrameRate: ConsumerBase is abandoned!"); + return NO_INIT; + } + return mConsumer->getFrameRate(frameRate); +} + void ConsumerBase::dumpState(String8& result) const { dumpState(result, ""); } |