summaryrefslogtreecommitdiff
path: root/libs/nativewindow/include/system/window.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/nativewindow/include/system/window.h')
-rw-r--r--libs/nativewindow/include/system/window.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/libs/nativewindow/include/system/window.h b/libs/nativewindow/include/system/window.h
index b78fc5dbbc..7f0113500d 100644
--- a/libs/nativewindow/include/system/window.h
+++ b/libs/nativewindow/include/system/window.h
@@ -255,6 +255,8 @@ enum {
NATIVE_WINDOW_ALLOCATE_BUFFERS = 45, /* private */
NATIVE_WINDOW_GET_LAST_QUEUED_BUFFER = 46, /* private */
NATIVE_WINDOW_SET_QUERY_INTERCEPTOR = 47, /* private */
+ NATIVE_WINDOW_SET_FRAME_TIMELINE_INFO = 48, /* private */
+ NATIVE_WINDOW_GET_LAST_QUEUED_BUFFER2 = 49, /* private */
// clang-format on
};
@@ -1017,9 +1019,16 @@ static inline int native_window_set_auto_prerotation(struct ANativeWindow* windo
}
static inline int native_window_set_frame_rate(struct ANativeWindow* window, float frameRate,
- int8_t compatibility) {
+ int8_t compatibility, int8_t changeFrameRateStrategy) {
return window->perform(window, NATIVE_WINDOW_SET_FRAME_RATE, (double)frameRate,
- (int)compatibility);
+ (int)compatibility, (int)changeFrameRateStrategy);
+}
+
+static inline int native_window_set_frame_timeline_info(struct ANativeWindow* window,
+ int64_t frameTimelineVsyncId,
+ int32_t inputEventId) {
+ return window->perform(window, NATIVE_WINDOW_SET_FRAME_TIMELINE_INFO,
+ frameTimelineVsyncId, inputEventId);
}
// ------------------------------------------------------------------------------------------------
@@ -1053,6 +1062,31 @@ static inline int ANativeWindow_getLastQueuedBuffer(ANativeWindow* window,
}
/**
+ * Retrieves the last queued buffer for this window, along with the fence that
+ * fires when the buffer is ready to be read. The cropRect & transform should be applied to the
+ * buffer's content.
+ *
+ * If there was no buffer previously queued, then outBuffer will be NULL and
+ * the value of outFence will be -1.
+ *
+ * Note that if outBuffer is not NULL, then the caller will hold a reference
+ * onto the buffer. Accordingly, the caller must call AHardwareBuffer_release
+ * when the buffer is no longer needed so that the system may reclaim the
+ * buffer.
+ *
+ * \return NO_ERROR on success.
+ * \return NO_MEMORY if there was insufficient memory.
+ * \return STATUS_UNKNOWN_TRANSACTION if this ANativeWindow doesn't support this method, callers
+ * should fall back to ANativeWindow_getLastQueuedBuffer instead.
+ */
+static inline int ANativeWindow_getLastQueuedBuffer2(ANativeWindow* window,
+ AHardwareBuffer** outBuffer, int* outFence,
+ ARect* outCropRect, uint32_t* outTransform) {
+ return window->perform(window, NATIVE_WINDOW_GET_LAST_QUEUED_BUFFER2, outBuffer, outFence,
+ outCropRect, outTransform);
+}
+
+/**
* Retrieves an identifier for the next frame to be queued by this window.
*
* \return the next frame id.