blob: 3ddd5493acbaeadc9b42d628fc15beaf16acf4ef [file] [log] [blame]
Alec Mouri9fa2cb62019-07-15 17:36:26 -07001/*
2 * Copyright 2019 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#pragma once
18
19#include <nativebase/nativebase.h>
20
21// apex is a superset of the NDK
22#include <android/native_window.h>
23
24__BEGIN_DECLS
25
26/**
27 * Retrieves how long it took for the last time a buffer was dequeued.
28 *
29 * \return a negative value on error, otherwise returns the duration in
30 * microseconds.
31 */
32int ANativeWindow_getLastDequeueDuration(ANativeWindow* window);
33
Alec Mouri0d1398b2019-08-14 10:53:50 -070034/**
35 * Retrieves how long it took for the last time a buffer was queued.
36 *
37 * \return a negative value on error, otherwise returns the duration in
38 * microseconds
39 */
40int ANativeWindow_getLastQueueDuration(ANativeWindow* window);
41
Alec Mouria1619662019-08-21 19:30:48 -070042/**
43 * Retrieves the system time in nanoseconds when the last time a buffer
44 * was dequeued.
45 *
46 * \return a negative value on error, otherwise returns the duration in
47 * nanoseconds.
48 */
49int64_t ANativeWindow_getLastDequeueStartTime(ANativeWindow* window);
50
Alec Mouri9fa2cb62019-07-15 17:36:26 -070051__END_DECLS