blob: 464dafba754b2045fe398cb3cecf105f3b36a68c [file] [log] [blame]
Scott Randolph5c99d852016-11-15 17:01:23 -08001/*
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 Randolph83422792017-03-01 20:32:59 -080017package android.hardware.automotive.evs@1.0;
Scott Randolph5c99d852016-11-15 17:01:23 -080018
Scott Randolph5c99d852016-11-15 17:01:23 -080019import IEvsCameraStream;
20
21
22/**
23 * Represents a single camera and is the primary interface for capturing images.
24 */
25interface IEvsCamera {
26
27 /**
28 * Returns the ID of this camera.
29 *
Changyeon Jo1d0f0242019-07-18 10:00:12 -070030 * @return info The description of this camera. This must be the same value as
31 * reported by EvsEnumerator::getCameraList().
Scott Randolph5c99d852016-11-15 17:01:23 -080032 */
Scott Randolphde9880e2017-03-30 14:04:12 -070033 getCameraInfo() generates (CameraDesc info);
Scott Randolph5c99d852016-11-15 17:01:23 -080034
35 /**
36 * Specifies the depth of the buffer chain the camera is asked to support.
37 *
38 * Up to this many frames may be held concurrently by the client of IEvsCamera.
39 * If this many frames have been delivered to the receiver without being returned
40 * by doneWithFrame, the stream must skip frames until a buffer is returned for reuse.
41 * It is legal for this call to come at any time, even while streams are already running,
42 * in which case buffers should be added or removed from the chain as appropriate.
43 * If no call is made to this entry point, the IEvsCamera must support at least one
44 * frame by default. More is acceptable.
Changyeon Jo1d0f0242019-07-18 10:00:12 -070045 *
46 * @param bufferCount Number of buffers the client of IEvsCamera may hold concurrently.
47 * @return result EvsResult::OK is returned if this call is successful.
Scott Randolph5c99d852016-11-15 17:01:23 -080048 */
49 setMaxFramesInFlight(uint32_t bufferCount) generates (EvsResult result);
50
51 /**
Changyeon Jo1d0f0242019-07-18 10:00:12 -070052 * Request to start EVS camera stream from this camera.
Scott Randolph5c99d852016-11-15 17:01:23 -080053 *
Changyeon Jo1d0f0242019-07-18 10:00:12 -070054 * The IEvsCameraStream must begin receiving calls with various events
55 * including new image frame ready until stopVideoStream() is called.
56 *
57 * @param receiver IEvsCameraStream implementation.
58 * @return result EvsResult::OK is returned if this call is successful.
Scott Randolph5c99d852016-11-15 17:01:23 -080059 */
60 startVideoStream(IEvsCameraStream receiver) generates (EvsResult result);
61
62 /**
63 * Return a frame that was delivered by to the IEvsCameraStream.
64 *
65 * When done consuming a frame delivered to the IEvsCameraStream
66 * interface, it must be returned to the IEvsCamera for reuse.
67 * A small, finite number of buffers are available (possibly as small
68 * as one), and if the supply is exhausted, no further frames may be
69 * delivered until a buffer is returned.
Changyeon Jo1d0f0242019-07-18 10:00:12 -070070 *
71 * @param buffer A buffer to be returned.
Scott Randolph5c99d852016-11-15 17:01:23 -080072 */
Scott Randolphdb5a5982017-01-23 12:35:05 -080073 oneway doneWithFrame(BufferDesc buffer);
Scott Randolph5c99d852016-11-15 17:01:23 -080074
75 /**
76 * Stop the delivery of EVS camera frames.
77 *
78 * Because delivery is asynchronous, frames may continue to arrive for
79 * some time after this call returns. Each must be returned until the
80 * closure of the stream is signaled to the IEvsCameraStream.
81 * This function cannot fail and is simply ignored if the stream isn't running.
82 */
83 stopVideoStream();
84
85 /**
86 * Request driver specific information from the HAL implementation.
87 *
88 * The values allowed for opaqueIdentifier are driver specific,
89 * but no value passed in may crash the driver. The driver should
90 * return 0 for any unrecognized opaqueIdentifier.
Changyeon Jo1d0f0242019-07-18 10:00:12 -070091 *
92 * @param opaqueIdentifier An unique identifier of the information to
93 * request.
94 * @return value Requested information. Zero is returned if the
95 * driver does not recognize a given identifier.
Scott Randolph5c99d852016-11-15 17:01:23 -080096 */
97 getExtendedInfo(uint32_t opaqueIdentifier) generates (int32_t value);
98
99 /**
100 * Send a driver specific value to the HAL implementation.
101 *
102 * This extension is provided to facilitate car specific
103 * extensions, but no HAL implementation may require this call
104 * in order to function in a default state.
105 * INVALID_ARG is returned if the opaqueValue is not meaningful to
106 * the driver implementation.
Changyeon Jo1d0f0242019-07-18 10:00:12 -0700107 *
108 * @param opaqueIdentifier An unique identifier of the information to
109 * program.
110 * opaqueValue A value to program.
111 * @return result EvsResult::OK is returned if this call is successful.
Scott Randolph5c99d852016-11-15 17:01:23 -0800112 */
113 setExtendedInfo(uint32_t opaqueIdentifier, int32_t opaqueValue) generates (EvsResult result);
114};