blob: 21ca79e91fbc10bbafd4cb6425f3187ee81ae11d [file] [log] [blame]
Changyeon Jo2400b692019-07-18 21:32:48 -07001/*
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
17package android.hardware.automotive.evs@1.1;
18
19import @1.0::IEvsCamera;
Changyeon Jo0d0228d2019-08-17 21:40:28 -070020import @1.0::IEvsDisplay;
Changyeon Jo2400b692019-07-18 21:32:48 -070021import @1.0::EvsResult;
22import IEvsCameraStream;
23
24/**
25 * Represents a single camera and is the primary interface for capturing images.
26 */
27interface IEvsCamera extends @1.0::IEvsCamera {
28 /**
29 * Requests to pause EVS camera stream events.
30 *
31 * Like stopVideoStream(), events may continue to arrive for some time
32 * after this call returns. Delivered frame buffers must be returned.
33 *
34 * @return result EvsResult::OK is returned if this call is successful.
35 */
36 pauseVideoStream() generates (EvsResult result);
37
38 /**
39 * Requests to resume EVS camera stream.
40 *
41 * @return result EvsResult::OK is returned if this call is successful.
42 */
43 resumeVideoStream() generates (EvsResult result);
44
45 /**
46 * Returns a frame that was delivered by to the IEvsCameraStream.
47 *
48 * When done consuming a frame delivered to the IEvsCameraStream
49 * interface, it must be returned to the IEvsCamera for reuse.
50 * A small, finite number of buffers are available (possibly as small
51 * as one), and if the supply is exhausted, no further frames may be
52 * delivered until a buffer is returned.
53 *
54 * @param buffer A buffer to be returned.
55 * @return result Return EvsResult::OK if this call is successful.
56 */
57 doneWithFrame_1_1(BufferDesc buffer) generates (EvsResult result);
Changyeon Jod2a82462019-07-30 11:57:17 -070058
59 /**
60 * Requests to be a master client.
61 *
62 * When multiple clients subscribe to a single camera hardware and one of
63 * them adjusts a camera parameter such as the contrast, it may disturb
64 * other clients' operations. Therefore, the client must call this method
65 * to be a master client. Once it becomes a master, it will be able to
66 * change camera parameters until either it dies or explicitly gives up the
67 * role.
68 *
69 * @return result EvsResult::OK if a master role is granted.
70 * EvsResult::OWNERSHIP_LOST if there is already a
71 * master client.
72 */
73 setMaster() generates (EvsResult result);
74
Changyeon Jo0d0228d2019-08-17 21:40:28 -070075 /**
76 * Sets to be a master client forcibly.
77 *
78 * The client, which owns the display, has a high priority and can take over
79 * a master role from other clients without the display.
80 *
81 * @param display IEvsDisplay handle. If a given display is in either
82 * NOT_VISIBLE, VISIBLE_ON_NEXT_FRAME, or VISIBLE state, the
83 * calling client is considered as the high priority client
84 * and therefore allowed to take over a master role from
85 * existing master client.
86 *
87 * @return result EvsResult::OK if a master role is granted.
88 * EvsResult::INVALID_ARG if a given display handle is null
89 * or in valid states.
90 */
91 forceMaster(IEvsDisplay display) generates (EvsResult result);
Changyeon Jod2a82462019-07-30 11:57:17 -070092
93 /**
94 * Retires from a master client role.
95 *
96 * @return result EvsResult::OK if this call is successful.
97 * EvsResult::INVALID_ARG if the caller client is not a
98 * master client.
99 */
100 unsetMaster() generates (EvsResult result);
101
102 /**
103 * Requests to set a camera parameter.
104 *
105 * @param id The identifier of camera parameter, CameraParam enum.
106 * value A desired parameter value.
107 * @return result EvsResult::OK if it succeeds to set a parameter.
108 * EvsResult::INVALID_ARG if either the request is
109 * not made by a master client, or a requested
110 * parameter is not supported.
111 * EvsResult::UNDERLYING_SERVICE_ERROR if it fails to
112 * program a value by any other reason.
113 * effectiveValue A programmed parameter value. This may differ
114 * from what the client gives if, for example, the
115 * driver does not support a target parameter.
116 */
117 setParameter(CameraParam id, int32_t value)
118 generates (EvsResult result, int32_t effectiveValue);
119
120 /**
121 * Retrieves a value of given camera parameter.
122 *
123 * @param id The identifier of camera parameter, CameraParam enum.
124 * @return result EvsResult::OK if it succeeds to read a parameter.
125 * EvsResult::INVALID_ARG if either a requested parameter is
126 * not supported.
127 * value A value of requested camera parameter.
128 */
129 getParameter(CameraParam id) generates(EvsResult result, int32_t value);
Changyeon Jo2400b692019-07-18 21:32:48 -0700130};