blob: fcf4a06f95e32e7ff76c30e24e348c103a84cdb7 [file] [log] [blame]
Scott Randolph5c99d852016-11-15 17:01:23 -08001/*
2 * Copyright (C) 2016 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
Scott Randolph83422792017-03-01 20:32:59 -080017#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_0_EVSDISPLAY_H
18#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_0_EVSDISPLAY_H
Scott Randolph5c99d852016-11-15 17:01:23 -080019
Scott Randolph83422792017-03-01 20:32:59 -080020#include <android/hardware/automotive/evs/1.0/IEvsDisplay.h>
Scott Randolph5c99d852016-11-15 17:01:23 -080021#include <ui/GraphicBuffer.h>
22
23namespace android {
24namespace hardware {
Scott Randolph83422792017-03-01 20:32:59 -080025namespace automotive {
Scott Randolph5c99d852016-11-15 17:01:23 -080026namespace evs {
27namespace V1_0 {
28namespace implementation {
29
30class EvsDisplay : public IEvsDisplay {
31public:
Scott Randolph83422792017-03-01 20:32:59 -080032 // Methods from ::android::hardware::automotive::evs::V1_0::IEvsDisplay follow.
Scott Randolph5c99d852016-11-15 17:01:23 -080033 Return<void> getDisplayInfo(getDisplayInfo_cb _hidl_cb) override;
34 Return<EvsResult> setDisplayState(DisplayState state) override;
35 Return<DisplayState> getDisplayState() override;
36 Return<void> getTargetBuffer(getTargetBuffer_cb _hidl_cb) override;
Scott Randolphdb5a5982017-01-23 12:35:05 -080037 Return<EvsResult> returnTargetBufferForDisplay(const BufferDesc& buffer) override;
Scott Randolph5c99d852016-11-15 17:01:23 -080038
39 // Implementation details
40 EvsDisplay();
41 virtual ~EvsDisplay() override;
42
43private:
44 DisplayDesc mInfo = {};
Scott Randolphdb5a5982017-01-23 12:35:05 -080045 BufferDesc mBuffer = {}; // A graphics buffer into which we'll store images
Scott Randolph5c99d852016-11-15 17:01:23 -080046
Scott Randolphdb5a5982017-01-23 12:35:05 -080047 bool mFrameBusy = false; // A flag telling us our buffer is in use
Scott Randolph5c99d852016-11-15 17:01:23 -080048 DisplayState mRequestedState = DisplayState::NOT_VISIBLE;
49
50 std::mutex mAccessLock;
51};
52
53} // namespace implementation
54} // namespace V1_0
55} // namespace evs
Scott Randolph83422792017-03-01 20:32:59 -080056} // namespace automotive
Scott Randolph5c99d852016-11-15 17:01:23 -080057} // namespace hardware
58} // namespace android
59
Scott Randolph83422792017-03-01 20:32:59 -080060#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_0_EVSDISPLAY_H