blob: ebebfbe57e1a7b602249cac1c17c39a75659117b [file] [log] [blame]
Mathias Agopiand0566bc2011-11-17 17:49:17 -08001/*
2 * Copyright (C) 2011 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
Dan Stozaa5f61dd2017-03-30 16:09:13 -070017#pragma once
Mathias Agopiand0566bc2011-11-17 17:49:17 -080018
19#include <binder/IInterface.h>
20
Dan Stozaa5f61dd2017-03-30 16:09:13 -070021#include <utils/Errors.h>
22
23#include <sys/types.h>
24#include <cstdint>
25
Mathias Agopiand0566bc2011-11-17 17:49:17 -080026namespace android {
Mathias Agopiand0566bc2011-11-17 17:49:17 -080027
28class BitTube;
29
Dan Stozaa5f61dd2017-03-30 16:09:13 -070030class IDisplayEventConnection : public IInterface {
Mathias Agopiand0566bc2011-11-17 17:49:17 -080031public:
Colin Cross17576de2016-09-26 13:07:06 -070032 DECLARE_META_INTERFACE(DisplayEventConnection)
Mathias Agopiand0566bc2011-11-17 17:49:17 -080033
Mathias Agopian478ae5e2011-12-06 17:22:19 -080034 /*
35 * getDataChannel() returns a BitTube where to receive the events from
36 */
Dan Stozae1c599b2017-03-30 16:37:19 -070037 virtual status_t getDataChannel(sp<BitTube>* outChannel) const = 0;
Mathias Agopian478ae5e2011-12-06 17:22:19 -080038
39 /*
Dan Stozaa5f61dd2017-03-30 16:09:13 -070040 * setVsyncRate() sets the vsync event delivery rate. A value of 1 returns every vsync event.
41 * A value of 2 returns every other event, etc. A value of 0 returns no event unless
42 * requestNextVsync() has been called.
Mathias Agopian478ae5e2011-12-06 17:22:19 -080043 */
Dan Stozae1c599b2017-03-30 16:37:19 -070044 virtual status_t setVsyncRate(uint32_t count) = 0;
Mathias Agopian478ae5e2011-12-06 17:22:19 -080045
46 /*
Dan Stozaa5f61dd2017-03-30 16:09:13 -070047 * requestNextVsync() schedules the next vsync event. It has no effect if the vsync rate is > 0.
Mathias Agopian478ae5e2011-12-06 17:22:19 -080048 */
Dan Stozaa5f61dd2017-03-30 16:09:13 -070049 virtual void requestNextVsync() = 0; // Asynchronous
Mathias Agopiand0566bc2011-11-17 17:49:17 -080050};
51
Dan Stozaa5f61dd2017-03-30 16:09:13 -070052class BnDisplayEventConnection : public BnInterface<IDisplayEventConnection> {
Mathias Agopiand0566bc2011-11-17 17:49:17 -080053public:
Dan Stozaa5f61dd2017-03-30 16:09:13 -070054 virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply,
55 uint32_t flags = 0);
Mathias Agopiand0566bc2011-11-17 17:49:17 -080056};
57
Dan Stozaa5f61dd2017-03-30 16:09:13 -070058} // namespace android