Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 1 | /* |
| 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 Randolph | 8342279 | 2017-03-01 20:32:59 -0800 | [diff] [blame] | 17 | package android.hardware.automotive.evs@1.0; |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 18 | |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 19 | |
| 20 | /** |
| 21 | * Represents a single camera and is the primary interface for capturing images. |
| 22 | */ |
| 23 | interface IEvsDisplay { |
| 24 | |
| 25 | /** |
| 26 | * Returns basic information about the EVS display provided by the system. |
| 27 | * |
Scott Randolph | de9880e | 2017-03-30 14:04:12 -0700 | [diff] [blame] | 28 | * See the description of the DisplayDesc structure for details. |
Changyeon Jo | 1d0f024 | 2019-07-18 10:00:12 -0700 | [diff] [blame] | 29 | * |
| 30 | * @return info The description of this display. Please see the description |
| 31 | * of the DisplayDesc structure for details. |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 32 | */ |
| 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 Jo | 1d0f024 | 2019-07-18 10:00:12 -0700 | [diff] [blame] | 46 | * |
| 47 | * @param state Desired new DisplayState. |
| 48 | * @return result EvsResult::OK is returned if this call is successful. |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 49 | */ |
| 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 Jo | 1d0f024 | 2019-07-18 10:00:12 -0700 | [diff] [blame] | 61 | * |
| 62 | * @return state Current DisplayState of this Display. |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 63 | */ |
| 64 | getDisplayState() generates (DisplayState state); |
| 65 | |
| 66 | |
| 67 | /** |
| 68 | * This call returns a handle to a frame buffer associated with the display. |
| 69 | * |
Changyeon Jo | 1d0f024 | 2019-07-18 10:00:12 -0700 | [diff] [blame] | 70 | * @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 Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 75 | */ |
Scott Randolph | db5a598 | 2017-01-23 12:35:05 -0800 | [diff] [blame] | 76 | getTargetBuffer() generates (BufferDesc buffer); |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 77 | |
| 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 Jo | 1d0f024 | 2019-07-18 10:00:12 -0700 | [diff] [blame] | 86 | * |
| 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 Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 89 | */ |
Scott Randolph | db5a598 | 2017-01-23 12:35:05 -0800 | [diff] [blame] | 90 | returnTargetBufferForDisplay(BufferDesc buffer) generates (EvsResult result); |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 91 | }; |