Changyeon Jo | 2400b69 | 2019-07-18 21:32:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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 | |
| 17 | package android.hardware.automotive.evs@1.1; |
| 18 | |
| 19 | import @1.0::IEvsCamera; |
| 20 | import @1.0::EvsResult; |
| 21 | import IEvsCameraStream; |
| 22 | |
| 23 | /** |
| 24 | * Represents a single camera and is the primary interface for capturing images. |
| 25 | */ |
| 26 | interface IEvsCamera extends @1.0::IEvsCamera { |
| 27 | /** |
| 28 | * Requests to pause EVS camera stream events. |
| 29 | * |
| 30 | * Like stopVideoStream(), events may continue to arrive for some time |
| 31 | * after this call returns. Delivered frame buffers must be returned. |
| 32 | * |
| 33 | * @return result EvsResult::OK is returned if this call is successful. |
| 34 | */ |
| 35 | pauseVideoStream() generates (EvsResult result); |
| 36 | |
| 37 | /** |
| 38 | * Requests to resume EVS camera stream. |
| 39 | * |
| 40 | * @return result EvsResult::OK is returned if this call is successful. |
| 41 | */ |
| 42 | resumeVideoStream() generates (EvsResult result); |
| 43 | |
| 44 | /** |
| 45 | * Returns a frame that was delivered by to the IEvsCameraStream. |
| 46 | * |
| 47 | * When done consuming a frame delivered to the IEvsCameraStream |
| 48 | * interface, it must be returned to the IEvsCamera for reuse. |
| 49 | * A small, finite number of buffers are available (possibly as small |
| 50 | * as one), and if the supply is exhausted, no further frames may be |
| 51 | * delivered until a buffer is returned. |
| 52 | * |
| 53 | * @param buffer A buffer to be returned. |
| 54 | * @return result Return EvsResult::OK if this call is successful. |
| 55 | */ |
| 56 | doneWithFrame_1_1(BufferDesc buffer) generates (EvsResult result); |
Changyeon Jo | d2a8246 | 2019-07-30 11:57:17 -0700 | [diff] [blame] | 57 | |
| 58 | /** |
| 59 | * Requests to be a master client. |
| 60 | * |
| 61 | * When multiple clients subscribe to a single camera hardware and one of |
| 62 | * them adjusts a camera parameter such as the contrast, it may disturb |
| 63 | * other clients' operations. Therefore, the client must call this method |
| 64 | * to be a master client. Once it becomes a master, it will be able to |
| 65 | * change camera parameters until either it dies or explicitly gives up the |
| 66 | * role. |
| 67 | * |
| 68 | * @return result EvsResult::OK if a master role is granted. |
| 69 | * EvsResult::OWNERSHIP_LOST if there is already a |
| 70 | * master client. |
| 71 | */ |
| 72 | setMaster() generates (EvsResult result); |
| 73 | |
| 74 | |
| 75 | /** |
| 76 | * Retires from a master client role. |
| 77 | * |
| 78 | * @return result EvsResult::OK if this call is successful. |
| 79 | * EvsResult::INVALID_ARG if the caller client is not a |
| 80 | * master client. |
| 81 | */ |
| 82 | unsetMaster() generates (EvsResult result); |
| 83 | |
| 84 | /** |
| 85 | * Requests to set a camera parameter. |
| 86 | * |
| 87 | * @param id The identifier of camera parameter, CameraParam enum. |
| 88 | * value A desired parameter value. |
| 89 | * @return result EvsResult::OK if it succeeds to set a parameter. |
| 90 | * EvsResult::INVALID_ARG if either the request is |
| 91 | * not made by a master client, or a requested |
| 92 | * parameter is not supported. |
| 93 | * EvsResult::UNDERLYING_SERVICE_ERROR if it fails to |
| 94 | * program a value by any other reason. |
| 95 | * effectiveValue A programmed parameter value. This may differ |
| 96 | * from what the client gives if, for example, the |
| 97 | * driver does not support a target parameter. |
| 98 | */ |
| 99 | setParameter(CameraParam id, int32_t value) |
| 100 | generates (EvsResult result, int32_t effectiveValue); |
| 101 | |
| 102 | /** |
| 103 | * Retrieves a value of given camera parameter. |
| 104 | * |
| 105 | * @param id The identifier of camera parameter, CameraParam enum. |
| 106 | * @return result EvsResult::OK if it succeeds to read a parameter. |
| 107 | * EvsResult::INVALID_ARG if either a requested parameter is |
| 108 | * not supported. |
| 109 | * value A value of requested camera parameter. |
| 110 | */ |
| 111 | getParameter(CameraParam id) generates(EvsResult result, int32_t value); |
Changyeon Jo | 2400b69 | 2019-07-18 21:32:48 -0700 | [diff] [blame] | 112 | }; |