Rename to VsyncCallback & presentation time.
Bug: 217370454
Test: atest ChoreographerNativeTest
Change-Id: Id26497b0f94845e392778954039996b9bbab834f
diff --git a/include/android/choreographer.h b/include/android/choreographer.h
index 98f0eec..63aa7ff 100644
--- a/include/android/choreographer.h
+++ b/include/android/choreographer.h
@@ -76,7 +76,7 @@
* It's passed the frame data that should not outlive the callback, as well as the data pointer
* provided by the application that registered a callback.
*/
-typedef void (*AChoreographer_extendedFrameCallback)(
+typedef void (*AChoreographer_vsyncCallback)(
const AChoreographerFrameCallbackData* callbackData, void* data);
/**
@@ -134,8 +134,8 @@
* Posts a callback to run on the next frame. The data pointer provided will
* be passed to the callback function when it's called.
*/
-void AChoreographer_postExtendedFrameCallback(AChoreographer* choreographer,
- AChoreographer_extendedFrameCallback callback, void* data)
+void AChoreographer_postVsyncCallback(AChoreographer* choreographer,
+ AChoreographer_vsyncCallback callback, void* data)
__INTRODUCED_IN(33);
/**
@@ -215,7 +215,7 @@
/**
* The time in nanoseconds which the frame at given index is expected to be presented.
*/
-int64_t AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentTimeNanos(
+int64_t AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTimeNanos(
const AChoreographerFrameCallbackData* data, size_t index) __INTRODUCED_IN(33);
/**
diff --git a/libs/nativedisplay/AChoreographer.cpp b/libs/nativedisplay/AChoreographer.cpp
index 3ce381b..a3eebdd 100644
--- a/libs/nativedisplay/AChoreographer.cpp
+++ b/libs/nativedisplay/AChoreographer.cpp
@@ -78,7 +78,7 @@
struct FrameCallback {
AChoreographer_frameCallback callback;
AChoreographer_frameCallback64 callback64;
- AChoreographer_extendedFrameCallback extendedCallback;
+ AChoreographer_vsyncCallback vsyncCallback;
void* data;
nsecs_t dueTime;
@@ -121,7 +121,7 @@
explicit Choreographer(const sp<Looper>& looper) EXCLUDES(gChoreographers.lock);
void postFrameCallbackDelayed(AChoreographer_frameCallback cb,
AChoreographer_frameCallback64 cb64,
- AChoreographer_extendedFrameCallback extendedCallback, void* data,
+ AChoreographer_vsyncCallback vsyncCallback, void* data,
nsecs_t delay);
void registerRefreshRateCallback(AChoreographer_refreshRateCallback cb, void* data)
EXCLUDES(gChoreographers.lock);
@@ -230,10 +230,10 @@
void Choreographer::postFrameCallbackDelayed(AChoreographer_frameCallback cb,
AChoreographer_frameCallback64 cb64,
- AChoreographer_extendedFrameCallback extendedCallback,
- void* data, nsecs_t delay) {
+ AChoreographer_vsyncCallback vsyncCallback, void* data,
+ nsecs_t delay) {
nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- FrameCallback callback{cb, cb64, extendedCallback, data, now + delay};
+ FrameCallback callback{cb, cb64, vsyncCallback, data, now + delay};
{
std::lock_guard<std::mutex> _l{mLock};
mFrameCallbacks.push(callback);
@@ -389,13 +389,13 @@
}
mLastVsyncEventData = vsyncEventData;
for (const auto& cb : callbacks) {
- if (cb.extendedCallback != nullptr) {
+ if (cb.vsyncCallback != nullptr) {
const ChoreographerFrameCallbackDataImpl frameCallbackData =
createFrameCallbackData(timestamp);
mInCallback = true;
- cb.extendedCallback(reinterpret_cast<const AChoreographerFrameCallbackData*>(
- &frameCallbackData),
- cb.data);
+ cb.vsyncCallback(reinterpret_cast<const AChoreographerFrameCallbackData*>(
+ &frameCallbackData),
+ cb.data);
mInCallback = false;
} else if (cb.callback64 != nullptr) {
cb.callback64(timestamp, cb.data);
@@ -522,10 +522,9 @@
void* data, uint32_t delayMillis) {
return AChoreographer_postFrameCallbackDelayed64(choreographer, callback, data, delayMillis);
}
-void AChoreographer_routePostExtendedFrameCallback(AChoreographer* choreographer,
- AChoreographer_extendedFrameCallback callback,
- void* data) {
- return AChoreographer_postExtendedFrameCallback(choreographer, callback, data);
+void AChoreographer_routePostVsyncCallback(AChoreographer* choreographer,
+ AChoreographer_vsyncCallback callback, void* data) {
+ return AChoreographer_postVsyncCallback(choreographer, callback, data);
}
void AChoreographer_routeRegisterRefreshRateCallback(AChoreographer* choreographer,
AChoreographer_refreshRateCallback callback,
@@ -553,9 +552,10 @@
const AChoreographerFrameCallbackData* data, size_t index) {
return AChoreographerFrameCallbackData_getFrameTimelineVsyncId(data, index);
}
-int64_t AChoreographerFrameCallbackData_routeGetFrameTimelineExpectedPresentTimeNanos(
+int64_t AChoreographerFrameCallbackData_routeGetFrameTimelineExpectedPresentationTimeNanos(
const AChoreographerFrameCallbackData* data, size_t index) {
- return AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentTimeNanos(data, index);
+ return AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTimeNanos(data,
+ index);
}
int64_t AChoreographerFrameCallbackData_routeGetFrameTimelineDeadlineNanos(
const AChoreographerFrameCallbackData* data, size_t index) {
@@ -589,9 +589,8 @@
AChoreographer_to_Choreographer(choreographer)
->postFrameCallbackDelayed(callback, nullptr, nullptr, data, ms2ns(delayMillis));
}
-void AChoreographer_postExtendedFrameCallback(AChoreographer* choreographer,
- AChoreographer_extendedFrameCallback callback,
- void* data) {
+void AChoreographer_postVsyncCallback(AChoreographer* choreographer,
+ AChoreographer_vsyncCallback callback, void* data) {
AChoreographer_to_Choreographer(choreographer)
->postFrameCallbackDelayed(nullptr, nullptr, callback, data, 0);
}
@@ -650,7 +649,7 @@
LOG_ALWAYS_FATAL_IF(index >= VsyncEventData::kFrameTimelinesLength, "Index out of bounds");
return frameCallbackData->vsyncEventData.frameTimelines[index].vsyncId;
}
-int64_t AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentTimeNanos(
+int64_t AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTimeNanos(
const AChoreographerFrameCallbackData* data, size_t index) {
const ChoreographerFrameCallbackDataImpl* frameCallbackData =
AChoreographerFrameCallbackData_to_ChoreographerFrameCallbackDataImpl(data);
diff --git a/libs/nativedisplay/include-private/private/android/choreographer.h b/libs/nativedisplay/include-private/private/android/choreographer.h
index d650c26..19be5bd 100644
--- a/libs/nativedisplay/include-private/private/android/choreographer.h
+++ b/libs/nativedisplay/include-private/private/android/choreographer.h
@@ -50,9 +50,8 @@
void AChoreographer_routePostFrameCallbackDelayed64(AChoreographer* choreographer,
AChoreographer_frameCallback64 callback,
void* data, uint32_t delayMillis);
-void AChoreographer_routePostExtendedFrameCallback(AChoreographer* choreographer,
- AChoreographer_extendedFrameCallback callback,
- void* data);
+void AChoreographer_routePostVsyncCallback(AChoreographer* choreographer,
+ AChoreographer_vsyncCallback callback, void* data);
void AChoreographer_routeRegisterRefreshRateCallback(AChoreographer* choreographer,
AChoreographer_refreshRateCallback callback,
void* data);
@@ -67,7 +66,7 @@
const AChoreographerFrameCallbackData* data);
AVsyncId AChoreographerFrameCallbackData_routeGetFrameTimelineVsyncId(
const AChoreographerFrameCallbackData* data, size_t index);
-int64_t AChoreographerFrameCallbackData_routeGetFrameTimelineExpectedPresentTimeNanos(
+int64_t AChoreographerFrameCallbackData_routeGetFrameTimelineExpectedPresentationTimeNanos(
const AChoreographerFrameCallbackData* data, size_t index);
int64_t AChoreographerFrameCallbackData_routeGetFrameTimelineDeadlineNanos(
const AChoreographerFrameCallbackData* data, size_t index);
diff --git a/libs/nativedisplay/libnativedisplay.map.txt b/libs/nativedisplay/libnativedisplay.map.txt
index 6579313..2da10cd 100644
--- a/libs/nativedisplay/libnativedisplay.map.txt
+++ b/libs/nativedisplay/libnativedisplay.map.txt
@@ -7,12 +7,12 @@
AChoreographer_postFrameCallbackDelayed64; # apex # introduced=30
AChoreographer_registerRefreshRateCallback; # apex # introduced=30
AChoreographer_unregisterRefreshRateCallback; # apex # introduced=30
- AChoreographer_postExtendedFrameCallback; # apex # introduced=33
+ AChoreographer_postVsyncCallback; # apex # introduced=33
AChoreographerFrameCallbackData_getFrameTimeNanos; # apex # introduced=33
AChoreographerFrameCallbackData_getFrameTimelinesLength; # apex # introduced=33
AChoreographerFrameCallbackData_getPreferredFrameTimelineIndex; # apex # introduced=33
AChoreographerFrameCallbackData_getFrameTimelineVsyncId; # apex # introduced=33
- AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentTimeNanos; # apex # introduced=33
+ AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTimeNanos; # apex # introduced=33
AChoreographerFrameCallbackData_getFrameTimelineDeadlineNanos; # apex # introduced=33
AChoreographer_create; # apex # introduced=30
AChoreographer_destroy; # apex # introduced=30
@@ -35,12 +35,12 @@
android::AChoreographer_routePostFrameCallbackDelayed64*;
android::AChoreographer_routeRegisterRefreshRateCallback*;
android::AChoreographer_routeUnregisterRefreshRateCallback*;
- android::AChoreographer_routePostExtendedFrameCallback*;
+ android::AChoreographer_routePostVsyncCallback*;
android::AChoreographerFrameCallbackData_routeGetFrameTimeNanos*;
android::AChoreographerFrameCallbackData_routeGetFrameTimelinesLength*;
android::AChoreographerFrameCallbackData_routeGetPreferredFrameTimelineIndex*;
android::AChoreographerFrameCallbackData_routeGetFrameTimelineVsyncId*;
- android::AChoreographerFrameCallbackData_routeGetFrameTimelineExpectedPresentTimeNanos*;
+ android::AChoreographerFrameCallbackData_routeGetFrameTimelineExpectedPresentationTimeNanos*;
android::AChoreographerFrameCallbackData_routeGetFrameTimelineDeadlineNanos*;
android::AChoreographer_signalRefreshRateCallbacks*;
android::AChoreographer_getFrameInterval*;