blob: 21c5029258c24515567b2dacefe56a544df579f2 [file] [log] [blame]
Alec Mouricf3ad872020-04-27 22:36:17 -07001/*
2 * Copyright 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <private/android/choreographer.h>
18
19using namespace android;
20
21AChoreographer* AChoreographer_getInstance() {
22 return AChoreographer_routeGetInstance();
23}
24void AChoreographer_postFrameCallback(AChoreographer* choreographer,
25 AChoreographer_frameCallback callback, void* data) {
26 return AChoreographer_routePostFrameCallback(choreographer, callback, data);
27}
28void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer,
29 AChoreographer_frameCallback callback, void* data,
30 long delayMillis) {
31 return AChoreographer_routePostFrameCallbackDelayed(choreographer, callback, data, delayMillis);
32}
33void AChoreographer_postFrameCallback64(AChoreographer* choreographer,
34 AChoreographer_frameCallback64 callback, void* data) {
35 return AChoreographer_routePostFrameCallback64(choreographer, callback, data);
36}
37void AChoreographer_postFrameCallbackDelayed64(AChoreographer* choreographer,
38 AChoreographer_frameCallback64 callback, void* data,
39 uint32_t delayMillis) {
40 return AChoreographer_routePostFrameCallbackDelayed64(choreographer, callback, data,
41 delayMillis);
42}
Rachel Lee1a44c622022-02-15 18:12:01 -080043void AChoreographer_postVsyncCallback(AChoreographer* choreographer,
44 AChoreographer_vsyncCallback callback, void* data) {
45 return AChoreographer_routePostVsyncCallback(choreographer, callback, data);
Rachel Lee6350ff02021-09-01 13:30:13 -070046}
Alec Mouricf3ad872020-04-27 22:36:17 -070047void AChoreographer_registerRefreshRateCallback(AChoreographer* choreographer,
48 AChoreographer_refreshRateCallback callback,
49 void* data) {
50 return AChoreographer_routeRegisterRefreshRateCallback(choreographer, callback, data);
51}
52void AChoreographer_unregisterRefreshRateCallback(AChoreographer* choreographer,
53 AChoreographer_refreshRateCallback callback,
54 void* data) {
55 return AChoreographer_routeUnregisterRefreshRateCallback(choreographer, callback, data);
56}
Rachel Lee6350ff02021-09-01 13:30:13 -070057int64_t AChoreographerFrameCallbackData_getFrameTimeNanos(
58 const AChoreographerFrameCallbackData* data) {
59 return AChoreographerFrameCallbackData_routeGetFrameTimeNanos(data);
60}
61size_t AChoreographerFrameCallbackData_getFrameTimelinesLength(
62 const AChoreographerFrameCallbackData* data) {
63 return AChoreographerFrameCallbackData_routeGetFrameTimelinesLength(data);
64}
65size_t AChoreographerFrameCallbackData_getPreferredFrameTimelineIndex(
66 const AChoreographerFrameCallbackData* data) {
67 return AChoreographerFrameCallbackData_routeGetPreferredFrameTimelineIndex(data);
68}
Rachel Lee7e47b3d2022-01-12 14:28:26 -080069AVsyncId AChoreographerFrameCallbackData_getFrameTimelineVsyncId(
Rachel Lee6350ff02021-09-01 13:30:13 -070070 const AChoreographerFrameCallbackData* data, size_t index) {
71 return AChoreographerFrameCallbackData_routeGetFrameTimelineVsyncId(data, index);
72}
Rachel Lee1a44c622022-02-15 18:12:01 -080073int64_t AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTimeNanos(
Rachel Lee6350ff02021-09-01 13:30:13 -070074 const AChoreographerFrameCallbackData* data, size_t index) {
Rachel Lee1a44c622022-02-15 18:12:01 -080075 return AChoreographerFrameCallbackData_routeGetFrameTimelineExpectedPresentationTimeNanos(
76 data, index);
Rachel Lee6350ff02021-09-01 13:30:13 -070077}
Rachel Lee545adcd2022-01-12 17:27:32 -080078int64_t AChoreographerFrameCallbackData_getFrameTimelineDeadlineNanos(
Rachel Lee6350ff02021-09-01 13:30:13 -070079 const AChoreographerFrameCallbackData* data, size_t index) {
Rachel Lee545adcd2022-01-12 17:27:32 -080080 return AChoreographerFrameCallbackData_routeGetFrameTimelineDeadlineNanos(data, index);
Rachel Lee6350ff02021-09-01 13:30:13 -070081}