summaryrefslogtreecommitdiff
path: root/libs/nativewindow/ANativeWindow.cpp
diff options
context:
space:
mode:
author Rachel Lee <rnlee@google.com> 2024-10-14 14:18:17 -0700
committer Rachel Lee <rnlee@google.com> 2024-10-25 13:25:59 -0700
commitaaa80ee34494e2612366600e5211fd92931bfc64 (patch)
tree6833fc867a0cc50470f30d23c8ca6ccedfabdf64 /libs/nativewindow/ANativeWindow.cpp
parentfc8ace08bb2b9f764b9e56fb105609fc20421f4e (diff)
Add new ANativeWindow_setFrameRateParams API
The new overload uses same plumbing and same logic as the other setFrameRate-like functions. This plumbing and logic will be upgraded to accommodate new parameters in a future CL. Bug: 362798998 Test: atest SetFrameRateTest Flag: EXEMPT NDK Change-Id: If29c32a92b48c36fe06c70db5505f73cea482637
Diffstat (limited to 'libs/nativewindow/ANativeWindow.cpp')
-rw-r--r--libs/nativewindow/ANativeWindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/nativewindow/ANativeWindow.cpp b/libs/nativewindow/ANativeWindow.cpp
index f97eed5db3..ac3a832168 100644
--- a/libs/nativewindow/ANativeWindow.cpp
+++ b/libs/nativewindow/ANativeWindow.cpp
@@ -263,6 +263,16 @@ int32_t ANativeWindow_setFrameRateWithChangeStrategy(ANativeWindow* window, floa
return native_window_set_frame_rate(window, frameRate, compatibility, changeFrameRateStrategy);
}
+int32_t ANativeWindow_setFrameRateParams(
+ ANativeWindow* window, float desiredMinRate, float desiredMaxRate, float fixedSourceRate,
+ ANativeWindow_ChangeFrameRateStrategy changeFrameRateStrategy) {
+ if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) {
+ return -EINVAL;
+ }
+ return native_window_set_frame_rate_params(window, desiredMinRate, desiredMaxRate,
+ fixedSourceRate, changeFrameRateStrategy);
+}
+
/**************************************************************************************************
* vndk-stable
**************************************************************************************************/