summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2019-12-10 15:06:53 -0800
committer Alec Mouri <alecmouri@google.com> 2020-02-03 10:21:38 -0800
commitca87ad94879593d8f0c7b7580dd74779ed95cd88 (patch)
tree07a4422ccc91ae55f39c0a720d9fc9fd86c8e4fc
parent5a377dd1be593ba62381f5509aba3564d7ef0797 (diff)
[ANativeWindow] add ANativeWindow_getNextFrameId api.
Stable API for getNextFrameNumber. Here the naming is mirroring the existing EGL api for eglGetNextFrameIdANDROID. Bug: 137012798 Test: builds Change-Id: I8bf6fb198055a295b8aa68d3b9db2577376d39b1
-rw-r--r--libs/nativewindow/ANativeWindow.cpp4
-rw-r--r--libs/nativewindow/include/apex/window.h7
-rw-r--r--libs/nativewindow/libnativewindow.map.txt1
3 files changed, 12 insertions, 0 deletions
diff --git a/libs/nativewindow/ANativeWindow.cpp b/libs/nativewindow/ANativeWindow.cpp
index 2caffca828..a1c9eb806b 100644
--- a/libs/nativewindow/ANativeWindow.cpp
+++ b/libs/nativewindow/ANativeWindow.cpp
@@ -331,3 +331,7 @@ int ANativeWindow_setQueueBufferInterceptor(ANativeWindow* window,
void ANativeWindow_allocateBuffers(ANativeWindow* window) {
window->perform(window, NATIVE_WINDOW_ALLOCATE_BUFFERS);
}
+
+int64_t ANativeWindow_getNextFrameId(ANativeWindow* window) {
+ return query64(window, NATIVE_WINDOW_GET_NEXT_FRAME_ID);
+}
diff --git a/libs/nativewindow/include/apex/window.h b/libs/nativewindow/include/apex/window.h
index 3dec011a93..02b886c4f0 100644
--- a/libs/nativewindow/include/apex/window.h
+++ b/libs/nativewindow/include/apex/window.h
@@ -212,4 +212,11 @@ int ANativeWindow_setDequeueTimeout(ANativeWindow* window, int64_t timeout);
*/
void ANativeWindow_allocateBuffers(ANativeWindow* window);
+/**
+ * Retrieves an identifier for the next frame to be queued by this window.
+ *
+ * \return -errno on error, otherwise returns the next frame id.
+ */
+int64_t ANativeWindow_getNextFrameId(ANativeWindow* window);
+
__END_DECLS
diff --git a/libs/nativewindow/libnativewindow.map.txt b/libs/nativewindow/libnativewindow.map.txt
index 427f317406..e0e20c3ae2 100644
--- a/libs/nativewindow/libnativewindow.map.txt
+++ b/libs/nativewindow/libnativewindow.map.txt
@@ -26,6 +26,7 @@ LIBNATIVEWINDOW {
ANativeWindow_getLastDequeueDuration; # apex # introduced=30
ANativeWindow_getLastDequeueStartTime; # apex # introduced=30
ANativeWindow_getLastQueueDuration; # apex # introduced=30
+ ANativeWindow_getNextFrameId; # apex # introduced=30
ANativeWindow_getWidth;
ANativeWindow_lock;
ANativeWindow_query; # llndk