blob: 1be46d613d4dd3e763588a0877c1253274fb5e31 [file] [log] [blame]
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -08001/*
Shuzhen Wangc28189a2017-11-27 23:05:10 -08002 * Copyright (C) 2013-2018 The Android Open Source Project
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -08003 *
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_CAMERA_CAMERADEVICEBASE_H
18#define ANDROID_SERVERS_CAMERA_CAMERADEVICEBASE_H
19
Shuzhen Wang0129d522016-10-30 22:43:41 -070020#include <list>
21
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -080022#include <utils/RefBase.h>
23#include <utils/String8.h>
24#include <utils/String16.h>
25#include <utils/Vector.h>
Emilian Peev40ead602017-09-26 15:46:36 +010026#include <utils/KeyedVector.h>
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -080027#include <utils/Timers.h>
Jianing Wei90e59c92014-03-12 18:29:36 -070028#include <utils/List.h>
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -080029
30#include "hardware/camera2.h"
31#include "camera/CameraMetadata.h"
Jianing Weicb0652e2014-03-12 18:29:36 -070032#include "camera/CaptureResult.h"
Chien-Yu Chen618ff8a2015-03-13 11:27:17 -070033#include "gui/IGraphicBufferProducer.h"
Zhijun He125684a2015-12-26 15:07:30 -080034#include "device3/Camera3StreamInterface.h"
Shuzhen Wange8675782019-12-05 09:12:14 -080035#include "device3/StatusTracker.h"
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080036#include "binder/Status.h"
Emilian Peevfaa4bde2020-01-23 12:19:37 -080037#include "FrameProducer.h"
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -080038
Yin-Chia Yehb978c382019-10-30 00:22:37 -070039#include "CameraOfflineSessionBase.h"
40
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -080041namespace android {
42
Emilian Peevf4816702020-04-03 15:44:51 -070043namespace camera3 {
44
45typedef enum camera_request_template {
46 CAMERA_TEMPLATE_PREVIEW = 1,
47 CAMERA_TEMPLATE_STILL_CAPTURE = 2,
48 CAMERA_TEMPLATE_VIDEO_RECORD = 3,
49 CAMERA_TEMPLATE_VIDEO_SNAPSHOT = 4,
50 CAMERA_TEMPLATE_ZERO_SHUTTER_LAG = 5,
51 CAMERA_TEMPLATE_MANUAL = 6,
52 CAMERA_TEMPLATE_COUNT,
53 CAMERA_VENDOR_TEMPLATE_START = 0x40000000
54} camera_request_template_t;
55
56typedef enum camera_stream_configuration_mode {
57 CAMERA_STREAM_CONFIGURATION_NORMAL_MODE = 0,
58 CAMERA_STREAM_CONFIGURATION_CONSTRAINED_HIGH_SPEED_MODE = 1,
59 CAMERA_VENDOR_STREAM_CONFIGURATION_MODE_START = 0x8000
60} camera_stream_configuration_mode_t;
61
62typedef struct camera_jpeg_blob {
63 uint16_t jpeg_blob_id;
64 uint32_t jpeg_size;
65} camera_jpeg_blob_t;
66
67enum {
68 CAMERA_JPEG_BLOB_ID = 0x00FF,
69 CAMERA_JPEG_APP_SEGMENTS_BLOB_ID = 0x0100,
70};
71
72} // namespace camera3
73
74using camera3::camera_request_template_t;;
75using camera3::camera_stream_configuration_mode_t;
76using camera3::camera_stream_rotation_t;
77
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -080078class CameraProviderManager;
79
Shuzhen Wang0129d522016-10-30 22:43:41 -070080// Mapping of output stream index to surface ids
81typedef std::unordered_map<int, std::vector<size_t> > SurfaceMap;
82
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -080083/**
84 * Base interface for version >= 2 camera device classes, which interface to
85 * camera HAL device versions >= 2.
86 */
Emilian Peevfaa4bde2020-01-23 12:19:37 -080087class CameraDeviceBase : public virtual FrameProducer {
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -080088 public:
89 virtual ~CameraDeviceBase();
90
Igor Murashkin71381052013-03-04 14:53:08 -080091 /**
Emilian Peev00420d22018-02-05 21:33:13 +000092 * The device vendor tag ID
93 */
94 virtual metadata_vendor_id_t getVendorTagId() const = 0;
95
Emilian Peevbd8c5032018-02-14 23:05:40 +000096 virtual status_t initialize(sp<CameraProviderManager> manager, const String8& monitorTags) = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -080097 virtual status_t disconnect() = 0;
98
Jianing Weicb0652e2014-03-12 18:29:36 -070099 virtual status_t dump(int fd, const Vector<String16> &args) = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800100
101 /**
Shuzhen Wang2e7f58f2018-07-11 14:00:29 -0700102 * The physical camera device's static characteristics metadata buffer
103 */
Emilian Peevfaa4bde2020-01-23 12:19:37 -0800104 virtual const CameraMetadata& infoPhysical(const String8& physicalId) const = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800105
Emilian Peevaebbe412018-01-15 13:53:24 +0000106 struct PhysicalCameraSettings {
107 std::string cameraId;
108 CameraMetadata metadata;
109 };
110 typedef List<PhysicalCameraSettings> PhysicalCameraSettingsList;
111
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800112 /**
113 * Submit request for capture. The CameraDevice takes ownership of the
114 * passed-in buffer.
Jianing Weicb0652e2014-03-12 18:29:36 -0700115 * Output lastFrameNumber is the expected frame number of this request.
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800116 */
Jianing Weicb0652e2014-03-12 18:29:36 -0700117 virtual status_t capture(CameraMetadata &request, int64_t *lastFrameNumber = NULL) = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800118
119 /**
Jianing Wei90e59c92014-03-12 18:29:36 -0700120 * Submit a list of requests.
Jianing Weicb0652e2014-03-12 18:29:36 -0700121 * Output lastFrameNumber is the expected last frame number of the list of requests.
Jianing Wei90e59c92014-03-12 18:29:36 -0700122 */
Emilian Peevaebbe412018-01-15 13:53:24 +0000123 virtual status_t captureList(const List<const PhysicalCameraSettingsList> &requests,
Shuzhen Wang0129d522016-10-30 22:43:41 -0700124 const std::list<const SurfaceMap> &surfaceMaps,
Jianing Weicb0652e2014-03-12 18:29:36 -0700125 int64_t *lastFrameNumber = NULL) = 0;
Jianing Wei90e59c92014-03-12 18:29:36 -0700126
127 /**
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800128 * Submit request for streaming. The CameraDevice makes a copy of the
129 * passed-in buffer and the caller retains ownership.
Jianing Weicb0652e2014-03-12 18:29:36 -0700130 * Output lastFrameNumber is the last frame number of the previous streaming request.
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800131 */
Jianing Weicb0652e2014-03-12 18:29:36 -0700132 virtual status_t setStreamingRequest(const CameraMetadata &request,
133 int64_t *lastFrameNumber = NULL) = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800134
135 /**
Jianing Wei90e59c92014-03-12 18:29:36 -0700136 * Submit a list of requests for streaming.
Jianing Weicb0652e2014-03-12 18:29:36 -0700137 * Output lastFrameNumber is the last frame number of the previous streaming request.
Jianing Wei90e59c92014-03-12 18:29:36 -0700138 */
Emilian Peevaebbe412018-01-15 13:53:24 +0000139 virtual status_t setStreamingRequestList(const List<const PhysicalCameraSettingsList> &requests,
Shuzhen Wang0129d522016-10-30 22:43:41 -0700140 const std::list<const SurfaceMap> &surfaceMaps,
Jianing Weicb0652e2014-03-12 18:29:36 -0700141 int64_t *lastFrameNumber = NULL) = 0;
Jianing Wei90e59c92014-03-12 18:29:36 -0700142
143 /**
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800144 * Clear the streaming request slot.
Jianing Weicb0652e2014-03-12 18:29:36 -0700145 * Output lastFrameNumber is the last frame number of the previous streaming request.
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800146 */
Jianing Weicb0652e2014-03-12 18:29:36 -0700147 virtual status_t clearStreamingRequest(int64_t *lastFrameNumber = NULL) = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800148
149 /**
150 * Wait until a request with the given ID has been dequeued by the
151 * HAL. Returns TIMED_OUT if the timeout duration is reached. Returns
152 * immediately if the latest request received by the HAL has this id.
153 */
154 virtual status_t waitUntilRequestReceived(int32_t requestId,
155 nsecs_t timeout) = 0;
156
157 /**
Yin-Chia Yehb97babb2015-03-12 13:42:44 -0700158 * Create an output stream of the requested size, format, rotation and dataspace
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800159 *
Eino-Ville Talvala3d82c0d2015-02-23 15:19:19 -0800160 * For HAL_PIXEL_FORMAT_BLOB formats, the width and height should be the
161 * logical dimensions of the buffer, not the number of bytes.
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800162 */
Eino-Ville Talvala727d1722015-06-09 13:44:19 -0700163 virtual status_t createStream(sp<Surface> consumer,
Eino-Ville Talvala3d82c0d2015-02-23 15:19:19 -0800164 uint32_t width, uint32_t height, int format,
Emilian Peevf4816702020-04-03 15:44:51 -0700165 android_dataspace dataSpace, camera_stream_rotation_t rotation, int *id,
Shuzhen Wangc28189a2017-11-27 23:05:10 -0800166 const String8& physicalCameraId,
Emilian Peev40ead602017-09-26 15:46:36 +0100167 std::vector<int> *surfaceIds = nullptr,
Zhijun He5d677d12016-05-29 16:52:39 -0700168 int streamSetId = camera3::CAMERA3_STREAM_SET_ID_INVALID,
Emilian Peev050f5dc2017-05-18 14:43:56 +0100169 bool isShared = false, uint64_t consumerUsage = 0) = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800170
171 /**
Shuzhen Wang0129d522016-10-30 22:43:41 -0700172 * Create an output stream of the requested size, format, rotation and
173 * dataspace with a number of consumers.
174 *
175 * For HAL_PIXEL_FORMAT_BLOB formats, the width and height should be the
176 * logical dimensions of the buffer, not the number of bytes.
177 */
178 virtual status_t createStream(const std::vector<sp<Surface>>& consumers,
179 bool hasDeferredConsumer, uint32_t width, uint32_t height, int format,
Emilian Peevf4816702020-04-03 15:44:51 -0700180 android_dataspace dataSpace, camera_stream_rotation_t rotation, int *id,
Shuzhen Wangc28189a2017-11-27 23:05:10 -0800181 const String8& physicalCameraId,
Emilian Peev40ead602017-09-26 15:46:36 +0100182 std::vector<int> *surfaceIds = nullptr,
Shuzhen Wang0129d522016-10-30 22:43:41 -0700183 int streamSetId = camera3::CAMERA3_STREAM_SET_ID_INVALID,
Emilian Peev050f5dc2017-05-18 14:43:56 +0100184 bool isShared = false, uint64_t consumerUsage = 0) = 0;
Shuzhen Wang0129d522016-10-30 22:43:41 -0700185
186 /**
Chien-Yu Chen618ff8a2015-03-13 11:27:17 -0700187 * Create an input stream of width, height, and format.
188 *
189 * Return value is the stream ID if non-negative and an error if negative.
190 */
191 virtual status_t createInputStream(uint32_t width, uint32_t height,
192 int32_t format, /*out*/ int32_t *id) = 0;
193
Emilian Peev710c1422017-08-30 11:19:38 +0100194 struct StreamInfo {
195 uint32_t width;
196 uint32_t height;
Eino-Ville Talvala91cd3f82017-08-21 16:12:50 -0700197
Emilian Peev710c1422017-08-30 11:19:38 +0100198 uint32_t format;
199 bool formatOverridden;
200 uint32_t originalFormat;
Eino-Ville Talvala91cd3f82017-08-21 16:12:50 -0700201
Emilian Peev710c1422017-08-30 11:19:38 +0100202 android_dataspace dataSpace;
Eino-Ville Talvala91cd3f82017-08-21 16:12:50 -0700203 bool dataSpaceOverridden;
204 android_dataspace originalDataSpace;
205
Emilian Peev710c1422017-08-30 11:19:38 +0100206 StreamInfo() : width(0), height(0), format(0), formatOverridden(false), originalFormat(0),
Eino-Ville Talvala91cd3f82017-08-21 16:12:50 -0700207 dataSpace(HAL_DATASPACE_UNKNOWN), dataSpaceOverridden(false),
208 originalDataSpace(HAL_DATASPACE_UNKNOWN) {}
Emilian Peev710c1422017-08-30 11:19:38 +0100209 /**
210 * Check whether the format matches the current or the original one in case
211 * it got overridden.
212 */
Eino-Ville Talvala91cd3f82017-08-21 16:12:50 -0700213 bool matchFormat(uint32_t clientFormat) const {
Emilian Peev710c1422017-08-30 11:19:38 +0100214 if ((formatOverridden && (originalFormat == clientFormat)) ||
215 (format == clientFormat)) {
216 return true;
217 }
218 return false;
219 }
Eino-Ville Talvala91cd3f82017-08-21 16:12:50 -0700220
221 /**
222 * Check whether the dataspace matches the current or the original one in case
223 * it got overridden.
224 */
225 bool matchDataSpace(android_dataspace clientDataSpace) const {
226 if ((dataSpaceOverridden && (originalDataSpace == clientDataSpace)) ||
227 (dataSpace == clientDataSpace)) {
228 return true;
229 }
230 return false;
231 }
232
Emilian Peev710c1422017-08-30 11:19:38 +0100233 };
234
Chien-Yu Chen618ff8a2015-03-13 11:27:17 -0700235 /**
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800236 * Get information about a given stream.
237 */
Emilian Peev710c1422017-08-30 11:19:38 +0100238 virtual status_t getStreamInfo(int id, StreamInfo *streamInfo) = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800239
240 /**
241 * Set stream gralloc buffer transform
242 */
243 virtual status_t setStreamTransform(int id, int transform) = 0;
244
245 /**
246 * Delete stream. Must not be called if there are requests in flight which
247 * reference that stream.
248 */
249 virtual status_t deleteStream(int id) = 0;
250
251 /**
Igor Murashkine2d167e2014-08-19 16:19:59 -0700252 * Take the currently-defined set of streams and configure the HAL to use
253 * them. This is a long-running operation (may be several hundered ms).
254 *
255 * The device must be idle (see waitUntilDrained) before calling this.
256 *
257 * Returns OK on success; otherwise on error:
258 * - BAD_VALUE if the set of streams was invalid (e.g. fmts or sizes)
259 * - INVALID_OPERATION if the device was in the wrong state
260 */
Emilian Peev5fbe0ba2017-10-20 15:45:45 +0100261 virtual status_t configureStreams(const CameraMetadata& sessionParams,
Emilian Peevf4816702020-04-03 15:44:51 -0700262 int operatingMode =
263 camera_stream_configuration_mode_t::CAMERA_STREAM_CONFIGURATION_NORMAL_MODE) = 0;
Igor Murashkine2d167e2014-08-19 16:19:59 -0700264
Emilian Peevcc0b7952020-01-07 13:54:47 -0800265 /**
266 * Retrieve a list of all stream ids that were advertised as capable of
267 * supporting offline processing mode by Hal after the last stream configuration.
268 */
269 virtual void getOfflineStreamIds(std::vector<int> *offlineStreamIds) = 0;
270
Chien-Yu Chen618ff8a2015-03-13 11:27:17 -0700271 // get the buffer producer of the input stream
272 virtual status_t getInputBufferProducer(
273 sp<IGraphicBufferProducer> *producer) = 0;
274
Igor Murashkine2d167e2014-08-19 16:19:59 -0700275 /**
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800276 * Create a metadata buffer with fields that the HAL device believes are
277 * best for the given use case
278 */
Emilian Peevf4816702020-04-03 15:44:51 -0700279 virtual status_t createDefaultRequest(camera_request_template_t templateId,
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800280 CameraMetadata *request) = 0;
281
282 /**
283 * Wait until all requests have been processed. Returns INVALID_OPERATION if
284 * the streaming slot is not empty, or TIMED_OUT if the requests haven't
285 * finished processing in 10 seconds.
286 */
287 virtual status_t waitUntilDrained() = 0;
288
289 /**
Zhijun He28c9b6f2014-08-08 12:00:47 -0700290 * Get Jpeg buffer size for a given jpeg resolution.
291 * Negative values are error codes.
292 */
293 virtual ssize_t getJpegBufferSize(uint32_t width, uint32_t height) const = 0;
294
295 /**
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800296 * Connect HAL notifications to a listener. Overwrites previous
297 * listener. Set to NULL to stop receiving notifications.
298 */
Yin-Chia Yehe1c80632016-08-08 14:48:05 -0700299 virtual status_t setNotifyCallback(wp<NotificationListener> listener) = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800300
301 /**
Eino-Ville Talvala46910bd2013-07-18 19:15:17 -0700302 * Whether the device supports calling notifyAutofocus, notifyAutoExposure,
303 * and notifyAutoWhitebalance; if this returns false, the client must
304 * synthesize these notifications from received frame metadata.
305 */
306 virtual bool willNotify3A() = 0;
307
308 /**
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800309 * Trigger auto-focus. The latest ID used in a trigger autofocus or cancel
310 * autofocus call will be returned by the HAL in all subsequent AF
311 * notifications.
312 */
313 virtual status_t triggerAutofocus(uint32_t id) = 0;
314
315 /**
316 * Cancel auto-focus. The latest ID used in a trigger autofocus/cancel
317 * autofocus call will be returned by the HAL in all subsequent AF
318 * notifications.
319 */
320 virtual status_t triggerCancelAutofocus(uint32_t id) = 0;
321
322 /**
323 * Trigger pre-capture metering. The latest ID used in a trigger pre-capture
324 * call will be returned by the HAL in all subsequent AE and AWB
325 * notifications.
326 */
327 virtual status_t triggerPrecaptureMetering(uint32_t id) = 0;
328
329 /**
Eino-Ville Talvalaabaa51d2013-08-14 11:37:00 -0700330 * Flush all pending and in-flight requests. Blocks until flush is
331 * complete.
Jianing Weicb0652e2014-03-12 18:29:36 -0700332 * Output lastFrameNumber is the last frame number of the previous streaming request.
Eino-Ville Talvalaabaa51d2013-08-14 11:37:00 -0700333 */
Jianing Weicb0652e2014-03-12 18:29:36 -0700334 virtual status_t flush(int64_t *lastFrameNumber = NULL) = 0;
Eino-Ville Talvalaabaa51d2013-08-14 11:37:00 -0700335
Zhijun He204e3292014-07-14 17:09:23 -0700336 /**
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700337 * Prepare stream by preallocating buffers for it asynchronously.
338 * Calls notifyPrepared() once allocation is complete.
339 */
340 virtual status_t prepare(int streamId) = 0;
341
342 /**
Eino-Ville Talvalab25e3c82015-07-15 16:04:27 -0700343 * Free stream resources by dumping its unused gralloc buffers.
344 */
345 virtual status_t tearDown(int streamId) = 0;
346
347 /**
Shuzhen Wangb0fdc1e2016-03-20 23:21:39 -0700348 * Add buffer listener for a particular stream in the device.
349 */
350 virtual status_t addBufferListenerForStream(int streamId,
351 wp<camera3::Camera3StreamBufferListener> listener) = 0;
352
353 /**
Ruben Brunkc78ac262015-08-13 17:58:46 -0700354 * Prepare stream by preallocating up to maxCount buffers for it asynchronously.
355 * Calls notifyPrepared() once allocation is complete.
356 */
357 virtual status_t prepare(int maxCount, int streamId) = 0;
358
359 /**
Zhijun He5d677d12016-05-29 16:52:39 -0700360 * Set the deferred consumer surface and finish the rest of the stream configuration.
361 */
Shuzhen Wang758c2152017-01-10 18:26:18 -0800362 virtual status_t setConsumerSurfaces(int streamId,
Emilian Peev40ead602017-09-26 15:46:36 +0100363 const std::vector<sp<Surface>>& consumers, std::vector<int> *surfaceIds /*out*/) = 0;
Zhijun He5d677d12016-05-29 16:52:39 -0700364
Emilian Peev40ead602017-09-26 15:46:36 +0100365 /**
366 * Update a given stream.
367 */
368 virtual status_t updateStream(int streamId, const std::vector<sp<Surface>> &newSurfaces,
369 const std::vector<android::camera3::OutputStreamInfo> &outputInfo,
370 const std::vector<size_t> &removedSurfaceIds,
371 KeyedVector<sp<Surface>, size_t> *outputMap/*out*/) = 0;
Chien-Yu Chena936ac22017-10-23 15:59:49 -0700372
373 /**
374 * Drop buffers for stream of streamId if dropping is true. If dropping is false, do not
375 * drop buffers for stream of streamId.
376 */
377 virtual status_t dropStreamBuffers(bool /*dropping*/, int /*streamId*/) = 0;
Emilian Peev2a8e2832019-08-23 13:00:31 -0700378
379 /**
380 * Returns the maximum expected time it'll take for all currently in-flight
381 * requests to complete, based on their settings
382 */
383 virtual nsecs_t getExpectedInFlightDuration() = 0;
Yin-Chia Yehb978c382019-10-30 00:22:37 -0700384
385 /**
386 * switch to offline session
387 */
388 virtual status_t switchToOffline(
389 const std::vector<int32_t>& streamsToKeep,
390 /*out*/ sp<CameraOfflineSessionBase>* session) = 0;
Eino-Ville Talvalaf2e37092020-01-07 15:32:32 -0800391
392 /**
393 * Set the current behavior for the ROTATE_AND_CROP control when in AUTO.
394 *
395 * The value must be one of the ROTATE_AND_CROP_* values besides AUTO,
396 * and defaults to NONE.
397 */
398 virtual status_t setRotateAndCropAutoBehavior(
399 camera_metadata_enum_android_scaler_rotate_and_crop_t rotateAndCropValue) = 0;
400
Shuzhen Wange8675782019-12-05 09:12:14 -0800401 /**
Eino-Ville Talvala305cec62020-11-12 14:18:17 -0800402 * Whether camera muting (producing black-only output) is supported.
403 *
404 * Calling setCameraMute(true) when this returns false will return an
405 * INVALID_OPERATION error.
406 */
407 virtual bool supportsCameraMute() = 0;
408
409 /**
410 * Mute the camera.
411 *
412 * When muted, black image data is output on all output streams.
413 */
414 virtual status_t setCameraMute(bool enabled) = 0;
415
416 /**
Shuzhen Wange8675782019-12-05 09:12:14 -0800417 * Get the status tracker of the camera device
418 */
419 virtual wp<camera3::StatusTracker> getStatusTracker() = 0;
Shuzhen Wangabbcb6b2020-12-09 22:32:44 -0800420
421 /**
422 * Set bitmask for image dump flag
423 */
424 void setImageDumpMask(int mask) { mImageDumpMask = mask; }
425
426protected:
427 bool mImageDumpMask = 0;
Eino-Ville Talvala7fa43f32013-02-06 17:20:07 -0800428};
429
430}; // namespace android
431
432#endif