1 /*
2  * Copyright (C) 2023 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 namespace android::hardware::graphics::composer {
20 
21 class PresentListener {
22 public:
23     virtual ~PresentListener() = default;
24 
setExpectedPresentTime(int64_t __unused timestampNanos,int __unused frameIntervalNs)25     virtual void setExpectedPresentTime(int64_t __unused timestampNanos,
26                                         int __unused frameIntervalNs) {}
27 
onPresent(int32_t __unused fence)28     virtual void onPresent(int32_t __unused fence) {}
29 
onPresent(int64_t __unused presentTimeNs,__unused int flag)30     virtual void onPresent(int64_t __unused presentTimeNs, __unused int flag) {}
31 };
32 
33 class VsyncListener {
34 public:
35     virtual ~VsyncListener() = default;
36 
37     virtual void onVsync(int64_t timestamp, int32_t vsyncPeriodNanos) = 0;
38 };
39 
40 class PowerModeListener {
41 public:
42     virtual ~PowerModeListener() = default;
43 
44     virtual void onPowerStateChange(int from, int to) = 0;
45 };
46 
47 class RefreshRateChangeListener {
48 public:
49     virtual ~RefreshRateChangeListener() = default;
50 
51     virtual void onRefreshRateChange(int refreshRate) = 0;
52 };
53 
54 } // namespace android::hardware::graphics::composer
55