1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2016 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Worker 20*4d7e907cSAndroid Build Coastguard Worker/** 21*4d7e907cSAndroid Build Coastguard Worker * Represents a single camera and is the primary interface for capturing images. 22*4d7e907cSAndroid Build Coastguard Worker */ 23*4d7e907cSAndroid Build Coastguard Workerinterface IEvsDisplay { 24*4d7e907cSAndroid Build Coastguard Worker 25*4d7e907cSAndroid Build Coastguard Worker /** 26*4d7e907cSAndroid Build Coastguard Worker * Returns basic information about the EVS display provided by the system. 27*4d7e907cSAndroid Build Coastguard Worker * 28*4d7e907cSAndroid Build Coastguard Worker * See the description of the DisplayDesc structure for details. 29*4d7e907cSAndroid Build Coastguard Worker * 30*4d7e907cSAndroid Build Coastguard Worker * @return info The description of this display. Please see the description 31*4d7e907cSAndroid Build Coastguard Worker * of the DisplayDesc structure for details. 32*4d7e907cSAndroid Build Coastguard Worker */ 33*4d7e907cSAndroid Build Coastguard Worker getDisplayInfo() generates (DisplayDesc info); 34*4d7e907cSAndroid Build Coastguard Worker 35*4d7e907cSAndroid Build Coastguard Worker 36*4d7e907cSAndroid Build Coastguard Worker /** 37*4d7e907cSAndroid Build Coastguard Worker * Clients may set the display state to express their desired state. 38*4d7e907cSAndroid Build Coastguard Worker * 39*4d7e907cSAndroid Build Coastguard Worker * The HAL implementation must gracefully accept a request for any state while in 40*4d7e907cSAndroid Build Coastguard Worker * any other state, although the response may be to defer or ignore the request. The display 41*4d7e907cSAndroid Build Coastguard Worker * is defined to start in the NOT_VISIBLE state upon initialization. The client is 42*4d7e907cSAndroid Build Coastguard Worker * then expected to request the VISIBLE_ON_NEXT_FRAME state, and then begin providing 43*4d7e907cSAndroid Build Coastguard Worker * video. When the display is no longer required, the client is expected to request 44*4d7e907cSAndroid Build Coastguard Worker * the NOT_VISIBLE state after passing the last video frame. 45*4d7e907cSAndroid Build Coastguard Worker * Returns INVALID_ARG if the requested state is not a recognized value. 46*4d7e907cSAndroid Build Coastguard Worker * 47*4d7e907cSAndroid Build Coastguard Worker * @param state Desired new DisplayState. 48*4d7e907cSAndroid Build Coastguard Worker * @return result EvsResult::OK is returned if this call is successful. 49*4d7e907cSAndroid Build Coastguard Worker */ 50*4d7e907cSAndroid Build Coastguard Worker setDisplayState(DisplayState state) generates (EvsResult result); 51*4d7e907cSAndroid Build Coastguard Worker 52*4d7e907cSAndroid Build Coastguard Worker 53*4d7e907cSAndroid Build Coastguard Worker /** 54*4d7e907cSAndroid Build Coastguard Worker * This call requests the current state of the display 55*4d7e907cSAndroid Build Coastguard Worker * 56*4d7e907cSAndroid Build Coastguard Worker * The HAL implementation should report the actual current state, which might 57*4d7e907cSAndroid Build Coastguard Worker * transiently differ from the most recently requested state. Note, however, that 58*4d7e907cSAndroid Build Coastguard Worker * the logic responsible for changing display states should generally live above 59*4d7e907cSAndroid Build Coastguard Worker * the device layer, making it undesirable for the HAL implementation to spontaneously 60*4d7e907cSAndroid Build Coastguard Worker * change display states. 61*4d7e907cSAndroid Build Coastguard Worker * 62*4d7e907cSAndroid Build Coastguard Worker * @return state Current DisplayState of this Display. 63*4d7e907cSAndroid Build Coastguard Worker */ 64*4d7e907cSAndroid Build Coastguard Worker getDisplayState() generates (DisplayState state); 65*4d7e907cSAndroid Build Coastguard Worker 66*4d7e907cSAndroid Build Coastguard Worker 67*4d7e907cSAndroid Build Coastguard Worker /** 68*4d7e907cSAndroid Build Coastguard Worker * This call returns a handle to a frame buffer associated with the display. 69*4d7e907cSAndroid Build Coastguard Worker * 70*4d7e907cSAndroid Build Coastguard Worker * @return buffer A handle to a frame buffer. The returned buffer may be 71*4d7e907cSAndroid Build Coastguard Worker * locked and written to by software and/or GL. This buffer 72*4d7e907cSAndroid Build Coastguard Worker * must be returned via a call to 73*4d7e907cSAndroid Build Coastguard Worker * returnTargetBufferForDisplay() even if the display is no 74*4d7e907cSAndroid Build Coastguard Worker * longer visible. 75*4d7e907cSAndroid Build Coastguard Worker */ 76*4d7e907cSAndroid Build Coastguard Worker getTargetBuffer() generates (BufferDesc buffer); 77*4d7e907cSAndroid Build Coastguard Worker 78*4d7e907cSAndroid Build Coastguard Worker 79*4d7e907cSAndroid Build Coastguard Worker /** 80*4d7e907cSAndroid Build Coastguard Worker * This call tells the display that the buffer is ready for display. 81*4d7e907cSAndroid Build Coastguard Worker * 82*4d7e907cSAndroid Build Coastguard Worker * The buffer is no longer valid for use by the client after this call. 83*4d7e907cSAndroid Build Coastguard Worker * There is no maximum time the caller may hold onto the buffer before making this 84*4d7e907cSAndroid Build Coastguard Worker * call. The buffer may be returned at any time and in any DisplayState, but all 85*4d7e907cSAndroid Build Coastguard Worker * buffers are expected to be returned before the IEvsDisplay interface is destroyed. 86*4d7e907cSAndroid Build Coastguard Worker * 87*4d7e907cSAndroid Build Coastguard Worker * @param buffer A buffer handle to the frame that is ready for display. 88*4d7e907cSAndroid Build Coastguard Worker * @return result EvsResult::OK is returned if this call is successful. 89*4d7e907cSAndroid Build Coastguard Worker */ 90*4d7e907cSAndroid Build Coastguard Worker returnTargetBufferForDisplay(BufferDesc buffer) generates (EvsResult result); 91*4d7e907cSAndroid Build Coastguard Worker}; 92