blob: 72f767e9c03784a0b5d99ed59d891d477dbd9592 [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 -080017package android.hardware.automotive.evs@1.0;
Scott Randolph5c99d852016-11-15 17:01:23 -080018
Scott Randolph5c99d852016-11-15 17:01:23 -080019
20/**
21 * Represents a single camera and is the primary interface for capturing images.
22 */
23interface IEvsDisplay {
24
25 /**
26 * Returns basic information about the EVS display provided by the system.
27 *
Scott Randolphde9880e2017-03-30 14:04:12 -070028 * See the description of the DisplayDesc structure for details.
Changyeon Jo1d0f0242019-07-18 10:00:12 -070029 *
30 * @return info The description of this display. Please see the description
31 * of the DisplayDesc structure for details.
Scott Randolph5c99d852016-11-15 17:01:23 -080032 */
33 getDisplayInfo() generates (DisplayDesc info);
34
35
36 /**
37 * Clients may set the display state to express their desired state.
38 *
39 * The HAL implementation must gracefully accept a request for any state while in
40 * any other state, although the response may be to defer or ignore the request. The display
41 * is defined to start in the NOT_VISIBLE state upon initialization. The client is
42 * then expected to request the VISIBLE_ON_NEXT_FRAME state, and then begin providing
43 * video. When the display is no longer required, the client is expected to request
44 * the NOT_VISIBLE state after passing the last video frame.
45 * Returns INVALID_ARG if the requested state is not a recognized value.
Changyeon Jo1d0f0242019-07-18 10:00:12 -070046 *
47 * @param state Desired new DisplayState.
48 * @return result EvsResult::OK is returned if this call is successful.
Scott Randolph5c99d852016-11-15 17:01:23 -080049 */
50 setDisplayState(DisplayState state) generates (EvsResult result);
51
52
53 /**
54 * This call requests the current state of the display
55 *
56 * The HAL implementation should report the actual current state, which might
57 * transiently differ from the most recently requested state. Note, however, that
58 * the logic responsible for changing display states should generally live above
59 * the device layer, making it undesirable for the HAL implementation to spontaneously
60 * change display states.
Changyeon Jo1d0f0242019-07-18 10:00:12 -070061 *
62 * @return state Current DisplayState of this Display.
Scott Randolph5c99d852016-11-15 17:01:23 -080063 */
64 getDisplayState() generates (DisplayState state);
65
66
67 /**
68 * This call returns a handle to a frame buffer associated with the display.
69 *
Changyeon Jo1d0f0242019-07-18 10:00:12 -070070 * @return buffer A handle to a frame buffer. The returned buffer may be
71 * locked and written to by software and/or GL. This buffer
72 * must be returned via a call to
73 * returnTargetBufferForDisplay() even if the display is no
74 * longer visible.
Scott Randolph5c99d852016-11-15 17:01:23 -080075 */
Scott Randolphdb5a5982017-01-23 12:35:05 -080076 getTargetBuffer() generates (BufferDesc buffer);
Scott Randolph5c99d852016-11-15 17:01:23 -080077
78
79 /**
80 * This call tells the display that the buffer is ready for display.
81 *
82 * The buffer is no longer valid for use by the client after this call.
83 * There is no maximum time the caller may hold onto the buffer before making this
84 * call. The buffer may be returned at any time and in any DisplayState, but all
85 * buffers are expected to be returned before the IEvsDisplay interface is destroyed.
Changyeon Jo1d0f0242019-07-18 10:00:12 -070086 *
87 * @param buffer A buffer handle to the frame that is ready for display.
88 * @return result EvsResult::OK is returned if this call is successful.
Scott Randolph5c99d852016-11-15 17:01:23 -080089 */
Scott Randolphdb5a5982017-01-23 12:35:05 -080090 returnTargetBufferForDisplay(BufferDesc buffer) generates (EvsResult result);
Scott Randolph5c99d852016-11-15 17:01:23 -080091};