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 | |
| 19 | import types; |
| 20 | import IEvsCamera; |
| 21 | import IEvsDisplay; |
| 22 | |
| 23 | |
| 24 | /** |
| 25 | * Provides the mechanism for EVS camera discovery |
| 26 | */ |
| 27 | interface IEvsEnumerator { |
| 28 | |
| 29 | /** |
| 30 | * Returns a list of all EVS cameras available to the system |
| 31 | */ |
| 32 | getCameraList() generates (vec<CameraDesc> cameras); |
| 33 | |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 34 | /** |
| 35 | * Get the IEvsCamera associated with a cameraId from a CameraDesc |
| 36 | * |
Scott Randolph | 3209fb3 | 2017-05-22 16:35:39 -0700 | [diff] [blame] | 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). |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 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 | * a null pointer is returned. |
Scott Randolph | de9880e | 2017-03-30 14:04:12 -0700 | [diff] [blame] | 61 | * When done using the display, the caller may release it by calling closeDisplay(). |
| 62 | * TODO(b/36122635) Reliance on the sp<> going out of scope is not recommended because the |
| 63 | * resources may not be released right away due to asynchronos behavior in the hardware binder. |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 64 | */ |
| 65 | openDisplay() generates (IEvsDisplay display); |
| 66 | |
| 67 | /** |
| 68 | * Return the specified IEvsDisplay interface as no longer in use |
| 69 | * |
| 70 | * When the IEvsDisplay object is no longer required, it must be released. |
Scott Randolph | de9880e | 2017-03-30 14:04:12 -0700 | [diff] [blame] | 71 | * NOTE: All buffers must have been returned to the display before making this call. |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 72 | */ |
| 73 | closeDisplay(IEvsDisplay display); |
Scott Randolph | db5a598 | 2017-01-23 12:35:05 -0800 | [diff] [blame] | 74 | |
| 75 | /** |
| 76 | * This call requests the current state of the display |
| 77 | * |
| 78 | * If there is no open display, this returns DisplayState::NOT_OPEN. otherwise, it returns |
| 79 | * the actual state of the active display. This call is replicated on the IEvsEnumerator |
| 80 | * interface in order to allow secondary clients to monitor the state of the EVS display |
| 81 | * without acquiring exclusive ownership of the display. |
| 82 | */ |
| 83 | getDisplayState() generates (DisplayState state); |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 84 | }; |
| 85 | |