From 3172e2028b191ed485385f02a443b1f9b0d730f9 Mon Sep 17 00:00:00 2001 From: Steven Thomas Date: Mon, 6 Jan 2020 19:25:30 -0800 Subject: 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 --- libs/gui/ConsumerBase.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libs/gui/ConsumerBase.cpp') 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, ""); } -- cgit v1.2.3-59-g8ed1b