blob: 8962fac3d27f6c4fc9ec95d286f1a86a7661efd7 [file] [log] [blame]
Igor Murashkinae500e52013-04-22 14:03:54 -07001/*
2 * Copyright (C) 2013 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#ifndef ANDROID_SERVERS_CAMERA3_STREAM_INTERFACE_H
18#define ANDROID_SERVERS_CAMERA3_STREAM_INTERFACE_H
19
20#include <utils/RefBase.h>
Shuzhen Wang68ac7ad2019-01-30 14:03:28 -080021
Shuzhen Wange4208922022-02-01 16:52:48 -080022#include <camera/camera2/OutputConfiguration.h>
Shuzhen Wang68ac7ad2019-01-30 14:03:28 -080023#include <camera/CameraMetadata.h>
Igor Murashkinae500e52013-04-22 14:03:54 -070024#include "Camera3StreamBufferListener.h"
Yin-Chia Yehbe83fa72017-03-30 13:35:36 -070025#include "Camera3StreamBufferFreedListener.h"
Igor Murashkinae500e52013-04-22 14:03:54 -070026
Igor Murashkinae500e52013-04-22 14:03:54 -070027namespace android {
28
29namespace camera3 {
30
Emilian Peevf4816702020-04-03 15:44:51 -070031typedef enum camera_buffer_status {
32 CAMERA_BUFFER_STATUS_OK = 0,
33 CAMERA_BUFFER_STATUS_ERROR = 1
34} camera_buffer_status_t;
35
36typedef enum camera_stream_type {
37 CAMERA_STREAM_OUTPUT = 0,
38 CAMERA_STREAM_INPUT = 1,
39 CAMERA_NUM_STREAM_TYPES
40} camera_stream_type_t;
41
42typedef enum camera_stream_rotation {
43 /* No rotation */
44 CAMERA_STREAM_ROTATION_0 = 0,
45
46 /* Rotate by 90 degree counterclockwise */
47 CAMERA_STREAM_ROTATION_90 = 1,
48
49 /* Rotate by 180 degree counterclockwise */
50 CAMERA_STREAM_ROTATION_180 = 2,
51
52 /* Rotate by 270 degree counterclockwise */
53 CAMERA_STREAM_ROTATION_270 = 3
54} camera_stream_rotation_t;
55
56typedef struct camera_stream {
57 camera_stream_type_t stream_type;
58 uint32_t width;
59 uint32_t height;
60 int format;
61 uint32_t usage;
62 uint32_t max_buffers;
63 android_dataspace_t data_space;
64 camera_stream_rotation_t rotation;
65 const char* physical_camera_id;
Jayant Chowdhary13f9b2f2020-12-02 22:46:15 -080066
67 std::unordered_set<int32_t> sensor_pixel_modes_used;
Emilian Peev2295df72021-11-12 18:14:10 -080068 int dynamic_range_profile;
Shuzhen Wangc8ab4522021-12-14 20:12:42 -080069 int use_case;
Emilian Peevf4816702020-04-03 15:44:51 -070070} camera_stream_t;
71
72typedef struct camera_stream_buffer {
73 camera_stream_t *stream;
74 buffer_handle_t *buffer;
75 camera_buffer_status_t status;
76 int acquire_fence;
77 int release_fence;
78} camera_stream_buffer_t;
79
Shuzhen Wang83bff122020-11-20 15:51:39 -080080struct Size {
81 uint32_t width;
82 uint32_t height;
83 explicit Size(uint32_t w = 0, uint32_t h = 0) : width(w), height(h){}
84};
85
Zhijun He125684a2015-12-26 15:07:30 -080086enum {
87 /**
88 * This stream set ID indicates that the set ID is invalid, and this stream doesn't intend to
89 * share buffers with any other stream. It is illegal to register this kind of stream to
90 * Camera3BufferManager.
91 */
92 CAMERA3_STREAM_SET_ID_INVALID = -1,
93
94 /**
95 * Invalid output stream ID.
96 */
97 CAMERA3_STREAM_ID_INVALID = -1,
98};
99
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -0700100class StatusTracker;
101
Emilian Peev40ead602017-09-26 15:46:36 +0100102// OutputStreamInfo describes the property of a camera stream.
103class OutputStreamInfo {
104 public:
105 int width;
106 int height;
107 int format;
108 android_dataspace dataSpace;
109 uint64_t consumerUsage;
110 bool finalized = false;
Emilian Peevcc0b7952020-01-07 13:54:47 -0800111 bool supportsOffline = false;
Jayant Chowdhary13f9b2f2020-12-02 22:46:15 -0800112 std::unordered_set<int32_t> sensorPixelModesUsed;
Emilian Peev2295df72021-11-12 18:14:10 -0800113 int dynamicRangeProfile;
Shuzhen Wangc8ab4522021-12-14 20:12:42 -0800114 int streamUseCase;
Shuzhen Wange4208922022-02-01 16:52:48 -0800115 int timestampBase;
Emilian Peev40ead602017-09-26 15:46:36 +0100116 OutputStreamInfo() :
117 width(-1), height(-1), format(-1), dataSpace(HAL_DATASPACE_UNKNOWN),
Emilian Peev2295df72021-11-12 18:14:10 -0800118 consumerUsage(0),
Shuzhen Wangc8ab4522021-12-14 20:12:42 -0800119 dynamicRangeProfile(ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD),
Shuzhen Wange4208922022-02-01 16:52:48 -0800120 streamUseCase(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT),
121 timestampBase(OutputConfiguration::TIMESTAMP_BASE_DEFAULT) {}
Emilian Peev40ead602017-09-26 15:46:36 +0100122 OutputStreamInfo(int _width, int _height, int _format, android_dataspace _dataSpace,
Emilian Peev2295df72021-11-12 18:14:10 -0800123 uint64_t _consumerUsage, const std::unordered_set<int32_t>& _sensorPixelModesUsed,
Shuzhen Wange4208922022-02-01 16:52:48 -0800124 int _dynamicRangeProfile, int _streamUseCase, int _timestampBase) :
Emilian Peev40ead602017-09-26 15:46:36 +0100125 width(_width), height(_height), format(_format),
Jayant Chowdhary13f9b2f2020-12-02 22:46:15 -0800126 dataSpace(_dataSpace), consumerUsage(_consumerUsage),
Shuzhen Wangc8ab4522021-12-14 20:12:42 -0800127 sensorPixelModesUsed(_sensorPixelModesUsed), dynamicRangeProfile(_dynamicRangeProfile),
Shuzhen Wange4208922022-02-01 16:52:48 -0800128 streamUseCase(_streamUseCase), timestampBase(_timestampBase) {}
Emilian Peev40ead602017-09-26 15:46:36 +0100129};
130
Igor Murashkinae500e52013-04-22 14:03:54 -0700131/**
132 * An interface for managing a single stream of input and/or output data from
133 * the camera device.
134 */
135class Camera3StreamInterface : public virtual RefBase {
136 public:
Ruben Brunkc78ac262015-08-13 17:58:46 -0700137
138 enum {
139 ALLOCATE_PIPELINE_MAX = 0, // Allocate max buffers used by a given surface
140 };
141
Igor Murashkinae500e52013-04-22 14:03:54 -0700142 /**
143 * Get the stream's ID
144 */
145 virtual int getId() const = 0;
146
147 /**
Zhijun He125684a2015-12-26 15:07:30 -0800148 * Get the output stream set id.
149 */
150 virtual int getStreamSetId() const = 0;
151
152 /**
Shuzhen Wang99080502021-03-07 21:08:20 -0800153 * Is this stream part of a multi-resolution stream set
154 */
155 virtual bool isMultiResolution() const = 0;
156
157 /**
158 * Get the HAL stream group id for a multi-resolution stream set
159 */
160 virtual int getHalStreamGroupId() const = 0;
161
162 /**
Igor Murashkinae500e52013-04-22 14:03:54 -0700163 * Get the stream's dimensions and format
164 */
165 virtual uint32_t getWidth() const = 0;
166 virtual uint32_t getHeight() const = 0;
167 virtual int getFormat() const = 0;
Emilian Peev2295df72021-11-12 18:14:10 -0800168 virtual int getDynamicRangeProfile() const = 0;
Eino-Ville Talvalad46a6b92015-05-14 17:26:24 -0700169 virtual android_dataspace getDataSpace() const = 0;
Emilian Peev710c1422017-08-30 11:19:38 +0100170 virtual void setFormatOverride(bool formatOverriden) = 0;
Eino-Ville Talvala91cd3f82017-08-21 16:12:50 -0700171 virtual bool isFormatOverridden() const = 0;
172 virtual int getOriginalFormat() const = 0;
173 virtual void setDataSpaceOverride(bool dataSpaceOverriden) = 0;
174 virtual bool isDataSpaceOverridden() const = 0;
175 virtual android_dataspace getOriginalDataSpace() const = 0;
Shuzhen Wang316781a2020-08-18 18:11:01 -0700176 virtual int getMaxHalBuffers() const = 0;
177 virtual int getMaxTotalBuffers() const = 0;
Igor Murashkinae500e52013-04-22 14:03:54 -0700178
179 /**
Yin-Chia Yeh5fd603e2019-11-20 11:22:27 -0800180 * Offline processing
181 */
182 virtual void setOfflineProcessingSupport(bool support) = 0;
183 virtual bool getOfflineProcessingSupport() const = 0;
184
185 /**
Emilian Peevf4816702020-04-03 15:44:51 -0700186 * Get a handle for the stream, without starting stream configuration.
Eino-Ville Talvala0b1cb142016-12-19 16:29:17 -0800187 */
Emilian Peevf4816702020-04-03 15:44:51 -0700188 virtual camera_stream* asHalStream() = 0;
Eino-Ville Talvala0b1cb142016-12-19 16:29:17 -0800189
190 /**
Igor Murashkinae500e52013-04-22 14:03:54 -0700191 * Start the stream configuration process. Returns a handle to the stream's
Emilian Peevf4816702020-04-03 15:44:51 -0700192 * information to be passed into the device's configure_streams call.
Igor Murashkinae500e52013-04-22 14:03:54 -0700193 *
194 * Until finishConfiguration() is called, no other methods on the stream may
Emilian Peevf4816702020-04-03 15:44:51 -0700195 * be called. The usage and max_buffers fields of camera_stream may be
Igor Murashkinae500e52013-04-22 14:03:54 -0700196 * modified between start/finishConfiguration, but may not be changed after
Emilian Peevf4816702020-04-03 15:44:51 -0700197 * that. The priv field of camera_stream may be modified at any time after
Igor Murashkinae500e52013-04-22 14:03:54 -0700198 * startConfiguration.
199 *
200 * Returns NULL in case of error starting configuration.
201 */
Emilian Peevf4816702020-04-03 15:44:51 -0700202 virtual camera_stream* startConfiguration() = 0;
Igor Murashkinae500e52013-04-22 14:03:54 -0700203
204 /**
205 * Check if the stream is mid-configuration (start has been called, but not
206 * finish). Used for lazy completion of configuration.
207 */
208 virtual bool isConfiguring() const = 0;
209
210 /**
211 * Completes the stream configuration process. During this call, the stream
212 * may call the device's register_stream_buffers() method. The stream
213 * information structure returned by startConfiguration() may no longer be
214 * modified after this call, but can still be read until the destruction of
215 * the stream.
216 *
Yin-Chia Yeh573a2702019-04-17 10:08:55 -0700217 * streamReconfigured: set to true when a stream is being reconfigured.
218 *
Igor Murashkinae500e52013-04-22 14:03:54 -0700219 * Returns:
220 * OK on a successful configuration
221 * NO_INIT in case of a serious error from the HAL device
222 * NO_MEMORY in case of an error registering buffers
223 * INVALID_OPERATION in case connecting to the consumer failed
224 */
Yin-Chia Yeh573a2702019-04-17 10:08:55 -0700225 virtual status_t finishConfiguration(/*out*/bool* streamReconfigured = nullptr) = 0;
Igor Murashkinae500e52013-04-22 14:03:54 -0700226
227 /**
Eino-Ville Talvala17543512014-08-06 14:32:02 -0700228 * Cancels the stream configuration process. This returns the stream to the
229 * initial state, allowing it to be configured again later.
230 * This is done if the HAL rejects the proposed combined stream configuration
231 */
232 virtual status_t cancelConfiguration() = 0;
233
234 /**
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700235 * Determine whether the stream has already become in-use (has received
236 * a valid filled buffer), which determines if a stream can still have
237 * prepareNextBuffer called on it.
238 */
239 virtual bool isUnpreparable() = 0;
240
241 /**
Emilian Peevf0348ae2021-01-13 13:39:45 -0800242 * Mark the stream as unpreparable.
243 */
244 virtual void markUnpreparable() = 0;
245
246 /**
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700247 * Start stream preparation. May only be called in the CONFIGURED state,
Ruben Brunkc78ac262015-08-13 17:58:46 -0700248 * when no valid buffers have yet been returned to this stream. Prepares
249 * up to maxCount buffers, or the maximum number of buffers needed by the
250 * pipeline if maxCount is ALLOCATE_PIPELINE_MAX.
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700251 *
252 * If no prepartion is necessary, returns OK and does not transition to
253 * PREPARING state. Otherwise, returns NOT_ENOUGH_DATA and transitions
254 * to PREPARING.
255 *
Shuzhen Wangb3a0fb52018-09-13 17:24:08 -0700256 * blockRequest specifies whether prepare will block upcoming capture
257 * request. This flag should only be set to false if the caller guarantees
258 * the whole buffer preparation process is done before capture request
259 * comes in.
260 *
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700261 * Returns:
262 * OK if no more buffers need to be preallocated
263 * NOT_ENOUGH_DATA if calls to prepareNextBuffer are needed to finish
264 * buffer pre-allocation, and transitions to the PREPARING state.
265 * NO_INIT in case of a serious error from the HAL device
266 * INVALID_OPERATION if called when not in CONFIGURED state, or a
267 * valid buffer has already been returned to this stream.
268 */
Shuzhen Wangb3a0fb52018-09-13 17:24:08 -0700269 virtual status_t startPrepare(int maxCount, bool blockRequest) = 0;
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700270
271 /**
Shuzhen Wangb3a0fb52018-09-13 17:24:08 -0700272 * Check if the request on a stream is blocked by prepare.
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700273 */
Shuzhen Wangb3a0fb52018-09-13 17:24:08 -0700274 virtual bool isBlockedByPrepare() const = 0;
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700275
276 /**
277 * Continue stream buffer preparation by allocating the next
278 * buffer for this stream. May only be called in the PREPARED state.
279 *
280 * Returns OK and transitions to the CONFIGURED state if all buffers
281 * are allocated after the call concludes. Otherwise returns NOT_ENOUGH_DATA.
282 *
283 * Returns:
284 * OK if no more buffers need to be preallocated, and transitions
285 * to the CONFIGURED state.
286 * NOT_ENOUGH_DATA if more calls to prepareNextBuffer are needed to finish
287 * buffer pre-allocation.
288 * NO_INIT in case of a serious error from the HAL device
289 * INVALID_OPERATION if called when not in CONFIGURED state, or a
290 * valid buffer has already been returned to this stream.
291 */
292 virtual status_t prepareNextBuffer() = 0;
293
294 /**
295 * Cancel stream preparation early. In case allocation needs to be
296 * stopped, this method transitions the stream back to the CONFIGURED state.
297 * Buffers that have been allocated with prepareNextBuffer remain that way,
298 * but a later use of prepareNextBuffer will require just as many
299 * calls as if the earlier prepare attempt had not existed.
300 *
301 * Returns:
302 * OK if cancellation succeeded, and transitions to the CONFIGURED state
303 * INVALID_OPERATION if not in the PREPARING state
304 * NO_INIT in case of a serious error from the HAL device
305 */
306 virtual status_t cancelPrepare() = 0;
307
308 /**
Eino-Ville Talvalab25e3c82015-07-15 16:04:27 -0700309 * Tear down memory for this stream. This frees all unused gralloc buffers
310 * allocated for this stream, but leaves it ready for operation afterward.
311 *
312 * May only be called in the CONFIGURED state, and keeps the stream in
313 * the CONFIGURED state.
314 *
315 * Returns:
316 * OK if teardown succeeded.
317 * INVALID_OPERATION if not in the CONFIGURED state
318 * NO_INIT in case of a serious error from the HAL device
319 */
320 virtual status_t tearDown() = 0;
321
322 /**
Emilian Peevf4816702020-04-03 15:44:51 -0700323 * Fill in the camera_stream_buffer with the next valid buffer for this
Igor Murashkinae500e52013-04-22 14:03:54 -0700324 * stream, to hand over to the HAL.
325 *
Shuzhen Wangbee0f0a2017-01-24 14:51:37 -0800326 * Multiple surfaces could share the same HAL stream, but a request may
327 * be only for a subset of surfaces. In this case, the
328 * Camera3StreamInterface object needs the surface ID information to acquire
329 * buffers for those surfaces. For the case of single surface for a HAL
330 * stream, surface_ids parameter has no effect.
331 *
Igor Murashkinae500e52013-04-22 14:03:54 -0700332 * This method may only be called once finishConfiguration has been called.
333 * For bidirectional streams, this method applies to the output-side
334 * buffers.
335 *
336 */
Emilian Peevf4816702020-04-03 15:44:51 -0700337 virtual status_t getBuffer(camera_stream_buffer *buffer,
Yin-Chia Yehb3a80b12018-09-04 12:13:05 -0700338 nsecs_t waitBufferTimeout,
Shuzhen Wangbee0f0a2017-01-24 14:51:37 -0800339 const std::vector<size_t>& surface_ids = std::vector<size_t>()) = 0;
Igor Murashkinae500e52013-04-22 14:03:54 -0700340
Yin-Chia Yeh14ef48d2020-02-10 15:06:37 -0800341 struct OutstandingBuffer {
342 camera_stream_buffer* outBuffer;
343
344 /**
345 * Multiple surfaces could share the same HAL stream, but a request may
346 * be only for a subset of surfaces. In this case, the
347 * Camera3StreamInterface object needs the surface ID information to acquire
348 * buffers for those surfaces. For the case of single surface for a HAL
349 * stream, surface_ids parameter has no effect.
350 */
351 std::vector<size_t> surface_ids;
352 };
353 /**
354 * Similar to getBuffer() except this method fills multiple buffers.
355 */
356 virtual status_t getBuffers(std::vector<OutstandingBuffer>* buffers,
357 nsecs_t waitBufferTimeout) = 0;
358
Igor Murashkinae500e52013-04-22 14:03:54 -0700359 /**
360 * Return a buffer to the stream after use by the HAL.
361 *
Yin-Chia Yeh58b1b4e2018-10-15 12:18:36 -0700362 * Multiple surfaces could share the same HAL stream, but a request may
363 * be only for a subset of surfaces. In this case, the
364 * Camera3StreamInterface object needs the surface ID information to attach
365 * buffers for those surfaces. For the case of single surface for a HAL
366 * stream, surface_ids parameter has no effect.
367 *
Igor Murashkinae500e52013-04-22 14:03:54 -0700368 * This method may only be called for buffers provided by getBuffer().
369 * For bidirectional streams, this method applies to the output-side buffers
370 */
Emilian Peevf4816702020-04-03 15:44:51 -0700371 virtual status_t returnBuffer(const camera_stream_buffer &buffer,
Shuzhen Wang90708ea2021-11-04 11:40:49 -0700372 nsecs_t timestamp, nsecs_t readoutTimestamp, bool timestampIncreasing = true,
Emilian Peev538c90e2018-12-17 18:03:19 +0000373 const std::vector<size_t>& surface_ids = std::vector<size_t>(),
Emilian Peev5104fe92021-10-21 14:27:09 -0700374 uint64_t frameNumber = 0, int32_t transform = -1) = 0;
Igor Murashkinae500e52013-04-22 14:03:54 -0700375
376 /**
Emilian Peevf4816702020-04-03 15:44:51 -0700377 * Fill in the camera_stream_buffer with the next valid buffer for this
Igor Murashkinae500e52013-04-22 14:03:54 -0700378 * stream, to hand over to the HAL.
379 *
380 * This method may only be called once finishConfiguration has been called.
381 * For bidirectional streams, this method applies to the input-side
382 * buffers.
383 *
Eino-Ville Talvalaba435252017-06-21 16:07:25 -0700384 * Normally this call will block until the handed out buffer count is less than the stream
385 * max buffer count; if respectHalLimit is set to false, this is ignored.
Igor Murashkinae500e52013-04-22 14:03:54 -0700386 */
Shuzhen Wang83bff122020-11-20 15:51:39 -0800387 virtual status_t getInputBuffer(camera_stream_buffer *buffer,
388 Size *size, bool respectHalLimit = true) = 0;
Igor Murashkinae500e52013-04-22 14:03:54 -0700389
390 /**
391 * Return a buffer to the stream after use by the HAL.
392 *
393 * This method may only be called for buffers provided by getBuffer().
394 * For bidirectional streams, this method applies to the input-side buffers
395 */
Emilian Peevf4816702020-04-03 15:44:51 -0700396 virtual status_t returnInputBuffer(const camera_stream_buffer &buffer) = 0;
Igor Murashkinae500e52013-04-22 14:03:54 -0700397
398 /**
Chien-Yu Chen618ff8a2015-03-13 11:27:17 -0700399 * Get the buffer producer of the input buffer queue.
400 *
401 * This method only applies to input streams.
402 */
403 virtual status_t getInputBufferProducer(sp<IGraphicBufferProducer> *producer) = 0;
404
405 /**
Igor Murashkinae500e52013-04-22 14:03:54 -0700406 * Whether any of the stream's buffers are currently in use by the HAL,
407 * including buffers that have been returned but not yet had their
408 * release fence signaled.
409 */
410 virtual bool hasOutstandingBuffers() const = 0;
411
Yin-Chia Yehd5cd5ff2018-10-01 14:43:04 -0700412 /**
413 * Get number of buffers currently handed out to HAL
414 */
415 virtual size_t getOutstandingBuffersCount() const = 0;
416
Igor Murashkinae500e52013-04-22 14:03:54 -0700417 enum {
418 TIMEOUT_NEVER = -1
419 };
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -0700420
Igor Murashkinae500e52013-04-22 14:03:54 -0700421 /**
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -0700422 * Set the state tracker to use for signaling idle transitions.
Igor Murashkinae500e52013-04-22 14:03:54 -0700423 */
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -0700424 virtual status_t setStatusTracker(sp<StatusTracker> statusTracker) = 0;
Igor Murashkinae500e52013-04-22 14:03:54 -0700425
426 /**
427 * Disconnect stream from its non-HAL endpoint. After this,
428 * start/finishConfiguration must be called before the stream can be used
429 * again. This cannot be called if the stream has outstanding dequeued
430 * buffers.
431 */
432 virtual status_t disconnect() = 0;
433
434 /**
Chien-Yu Chene8c535e2016-04-14 12:18:26 -0700435 * Return if the buffer queue of the stream is abandoned.
436 */
437 virtual bool isAbandoned() const = 0;
438
439 /**
Igor Murashkinae500e52013-04-22 14:03:54 -0700440 * Debug dump of the stream's state.
441 */
442 virtual void dump(int fd, const Vector<String16> &args) const = 0;
443
444 virtual void addBufferListener(
445 wp<Camera3StreamBufferListener> listener) = 0;
446 virtual void removeBufferListener(
447 const sp<Camera3StreamBufferListener>& listener) = 0;
Yin-Chia Yehbe83fa72017-03-30 13:35:36 -0700448
449 /**
450 * Setting listner will remove previous listener (if exists)
451 * Only allow set listener during stream configuration because stream is guaranteed to be IDLE
452 * at this state, so setBufferFreedListener won't collide with onBufferFreed callbacks.
453 * Client is responsible to keep the listener object alive throughout the lifecycle of this
454 * Camera3Stream.
455 */
Yin-Chia Yehdb1e8642017-07-14 15:19:30 -0700456 virtual void setBufferFreedListener(wp<Camera3StreamBufferFreedListener> listener) = 0;
Emilian Peev538c90e2018-12-17 18:03:19 +0000457
458 /**
459 * Notify buffer stream listeners about incoming request with particular frame number.
460 */
Shuzhen Wang68ac7ad2019-01-30 14:03:28 -0800461 virtual void fireBufferRequestForFrameNumber(uint64_t frameNumber,
462 const CameraMetadata& settings) = 0;
Igor Murashkinae500e52013-04-22 14:03:54 -0700463};
464
465} // namespace camera3
466
467} // namespace android
468
469#endif