Alec Mouri | cf3ad87 | 2020-04-27 22:36:17 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 19 | using namespace android; |
| 20 | |
| 21 | AChoreographer* AChoreographer_getInstance() { |
| 22 | return AChoreographer_routeGetInstance(); |
| 23 | } |
| 24 | void AChoreographer_postFrameCallback(AChoreographer* choreographer, |
| 25 | AChoreographer_frameCallback callback, void* data) { |
| 26 | return AChoreographer_routePostFrameCallback(choreographer, callback, data); |
| 27 | } |
| 28 | void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer, |
| 29 | AChoreographer_frameCallback callback, void* data, |
| 30 | long delayMillis) { |
| 31 | return AChoreographer_routePostFrameCallbackDelayed(choreographer, callback, data, delayMillis); |
| 32 | } |
| 33 | void AChoreographer_postFrameCallback64(AChoreographer* choreographer, |
| 34 | AChoreographer_frameCallback64 callback, void* data) { |
| 35 | return AChoreographer_routePostFrameCallback64(choreographer, callback, data); |
| 36 | } |
| 37 | void 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 Lee | 6350ff0 | 2021-09-01 13:30:13 -0700 | [diff] [blame] | 43 | void AChoreographer_postExtendedFrameCallback(AChoreographer* choreographer, |
| 44 | AChoreographer_extendedFrameCallback callback, |
| 45 | void* data) { |
| 46 | return AChoreographer_routePostExtendedFrameCallback(choreographer, callback, data); |
| 47 | } |
Alec Mouri | cf3ad87 | 2020-04-27 22:36:17 -0700 | [diff] [blame] | 48 | void AChoreographer_registerRefreshRateCallback(AChoreographer* choreographer, |
| 49 | AChoreographer_refreshRateCallback callback, |
| 50 | void* data) { |
| 51 | return AChoreographer_routeRegisterRefreshRateCallback(choreographer, callback, data); |
| 52 | } |
| 53 | void AChoreographer_unregisterRefreshRateCallback(AChoreographer* choreographer, |
| 54 | AChoreographer_refreshRateCallback callback, |
| 55 | void* data) { |
| 56 | return AChoreographer_routeUnregisterRefreshRateCallback(choreographer, callback, data); |
| 57 | } |
Rachel Lee | 6350ff0 | 2021-09-01 13:30:13 -0700 | [diff] [blame] | 58 | int64_t AChoreographerFrameCallbackData_getFrameTimeNanos( |
| 59 | const AChoreographerFrameCallbackData* data) { |
| 60 | return AChoreographerFrameCallbackData_routeGetFrameTimeNanos(data); |
| 61 | } |
| 62 | size_t AChoreographerFrameCallbackData_getFrameTimelinesLength( |
| 63 | const AChoreographerFrameCallbackData* data) { |
| 64 | return AChoreographerFrameCallbackData_routeGetFrameTimelinesLength(data); |
| 65 | } |
| 66 | size_t AChoreographerFrameCallbackData_getPreferredFrameTimelineIndex( |
| 67 | const AChoreographerFrameCallbackData* data) { |
| 68 | return AChoreographerFrameCallbackData_routeGetPreferredFrameTimelineIndex(data); |
| 69 | } |
Rachel Lee | 7e47b3d | 2022-01-12 14:28:26 -0800 | [diff] [blame] | 70 | AVsyncId AChoreographerFrameCallbackData_getFrameTimelineVsyncId( |
Rachel Lee | 6350ff0 | 2021-09-01 13:30:13 -0700 | [diff] [blame] | 71 | const AChoreographerFrameCallbackData* data, size_t index) { |
| 72 | return AChoreographerFrameCallbackData_routeGetFrameTimelineVsyncId(data, index); |
| 73 | } |
Rachel Lee | 545adcd | 2022-01-12 17:27:32 -0800 | [diff] [blame] | 74 | int64_t AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentTimeNanos( |
Rachel Lee | 6350ff0 | 2021-09-01 13:30:13 -0700 | [diff] [blame] | 75 | const AChoreographerFrameCallbackData* data, size_t index) { |
Rachel Lee | 545adcd | 2022-01-12 17:27:32 -0800 | [diff] [blame] | 76 | return AChoreographerFrameCallbackData_routeGetFrameTimelineExpectedPresentTimeNanos(data, |
| 77 | index); |
Rachel Lee | 6350ff0 | 2021-09-01 13:30:13 -0700 | [diff] [blame] | 78 | } |
Rachel Lee | 545adcd | 2022-01-12 17:27:32 -0800 | [diff] [blame] | 79 | int64_t AChoreographerFrameCallbackData_getFrameTimelineDeadlineNanos( |
Rachel Lee | 6350ff0 | 2021-09-01 13:30:13 -0700 | [diff] [blame] | 80 | const AChoreographerFrameCallbackData* data, size_t index) { |
Rachel Lee | 545adcd | 2022-01-12 17:27:32 -0800 | [diff] [blame] | 81 | return AChoreographerFrameCallbackData_routeGetFrameTimelineDeadlineNanos(data, index); |
Rachel Lee | 6350ff0 | 2021-09-01 13:30:13 -0700 | [diff] [blame] | 82 | } |