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 17package android.hardware.automotive.evs@1.0; 18 19import types; 20import IEvsCamera; 21import IEvsDisplay; 22 23 24/** 25 * Provides the mechanism for EVS camera discovery 26 */ 27interface IEvsEnumerator { 28 29 /** 30 * Returns a list of all EVS cameras available to the system 31 */ 32 getCameraList() generates (vec<CameraDesc> cameras); 33 34 /** 35 * Get the IEvsCamera associated with a cameraId from a CameraDesc 36 * 37 * Given a camera's unique cameraId from CameraDesc, returns the 38 * IEvsCamera interface associated with the specified camera. When 39 * done using the camera, the caller may release it by calling closeCamera(). 40 * Note: Reliance on the sp<> going out of scope is not recommended 41 * because the resources may not be released right away due to asynchronos 42 * behavior in the hardware binder (ref b/36122635). 43 */ 44 openCamera(string cameraId) generates (IEvsCamera carCamera); 45 46 /** 47 * Return the specified IEvsCamera interface as no longer in use 48 * 49 * When the IEvsCamera object is no longer required, it must be released. 50 * NOTE: Video streaming must be cleanly stopped before making this call. 51 */ 52 closeCamera(IEvsCamera carCamera); 53 54 55 /** 56 * Get exclusive access to IEvsDisplay for the system 57 * 58 * There can be at most one EVS display object for the system and this function 59 * requests access to it. If the EVS display is not available or is already in use, 60 * the old instance shall be closed and give the new caller exclusive 61 * access. 62 * When done using the display, the caller may release it by calling closeDisplay(). 63 * TODO(b/36122635) Reliance on the sp<> going out of scope is not recommended because the 64 * resources may not be released right away due to asynchronos behavior in the hardware binder. 65 */ 66 openDisplay() generates (IEvsDisplay display); 67 68 /** 69 * Return the specified IEvsDisplay interface as no longer in use 70 * 71 * When the IEvsDisplay object is no longer required, it must be released. 72 * NOTE: All buffers must have been returned to the display before making this call. 73 */ 74 closeDisplay(IEvsDisplay display); 75 76 /** 77 * This call requests the current state of the display 78 * 79 * If there is no open display, this returns DisplayState::NOT_OPEN. otherwise, it returns 80 * the actual state of the active display. This call is replicated on the IEvsEnumerator 81 * interface in order to allow secondary clients to monitor the state of the EVS display 82 * without acquiring exclusive ownership of the display. 83 */ 84 getDisplayState() generates (DisplayState state); 85}; 86 87