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 | * |
| 37 | * Given a camera's unique cameraId from ca CameraDesc, returns |
Scott Randolph | de9880e | 2017-03-30 14:04:12 -0700 | [diff] [blame^] | 38 | * the ICamera interface associated with the specified camera. |
| 39 | * When done using the camera, the caller may release it by calling closeCamera(). |
| 40 | * TODO(b/36122635) Reliance on the sp<> going out of scope is not recommended because the |
| 41 | * 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] | 42 | */ |
| 43 | openCamera(string cameraId) generates (IEvsCamera carCamera); |
| 44 | |
| 45 | /** |
| 46 | * Return the specified IEvsCamera interface as no longer in use |
| 47 | * |
| 48 | * When the IEvsCamera object is no longer required, it must be released. |
| 49 | * NOTE: Video streaming must be cleanly stopped before making this call. |
| 50 | */ |
| 51 | closeCamera(IEvsCamera carCamera); |
| 52 | |
| 53 | |
| 54 | /** |
| 55 | * Get exclusive access to IEvsDisplay for the system |
| 56 | * |
| 57 | * There can be at most one EVS display object for the system and this function |
| 58 | * requests access to it. If the EVS display is not available or is already in use, |
| 59 | * a null pointer is returned. |
Scott Randolph | de9880e | 2017-03-30 14:04:12 -0700 | [diff] [blame^] | 60 | * When done using the display, the caller may release it by calling closeDisplay(). |
| 61 | * TODO(b/36122635) Reliance on the sp<> going out of scope is not recommended because the |
| 62 | * 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] | 63 | */ |
| 64 | openDisplay() generates (IEvsDisplay display); |
| 65 | |
| 66 | /** |
| 67 | * Return the specified IEvsDisplay interface as no longer in use |
| 68 | * |
| 69 | * When the IEvsDisplay object is no longer required, it must be released. |
Scott Randolph | de9880e | 2017-03-30 14:04:12 -0700 | [diff] [blame^] | 70 | * 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] | 71 | */ |
| 72 | closeDisplay(IEvsDisplay display); |
Scott Randolph | db5a598 | 2017-01-23 12:35:05 -0800 | [diff] [blame] | 73 | |
| 74 | /** |
| 75 | * This call requests the current state of the display |
| 76 | * |
| 77 | * If there is no open display, this returns DisplayState::NOT_OPEN. otherwise, it returns |
| 78 | * the actual state of the active display. This call is replicated on the IEvsEnumerator |
| 79 | * interface in order to allow secondary clients to monitor the state of the EVS display |
| 80 | * without acquiring exclusive ownership of the display. |
| 81 | */ |
| 82 | getDisplayState() generates (DisplayState state); |
Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame] | 83 | }; |
| 84 | |