blob: 3af0b8014e81e3ebd912c99eb55c381ad23116f7 [file] [log] [blame]
Igor Murashkine7ee7632013-06-11 18:10:18 -07001/*
Shuzhen Wangc28189a2017-11-27 23:05:10 -08002 * Copyright (C) 2013-2018 The Android Open Source Project
Igor Murashkine7ee7632013-06-11 18:10:18 -07003 *
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_PHOTOGRAPHY_CAMERADEVICECLIENT_H
18#define ANDROID_SERVERS_CAMERA_PHOTOGRAPHY_CAMERADEVICECLIENT_H
19
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080020#include <android/hardware/camera2/BnCameraDeviceUser.h>
21#include <android/hardware/camera2/ICameraDeviceCallbacks.h>
Yin-Chia Yehb97babb2015-03-12 13:42:44 -070022#include <camera/camera2/OutputConfiguration.h>
Emilian Peev35ae8262018-11-08 13:11:32 +000023#include <camera/camera2/SessionConfiguration.h>
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080024#include <camera/camera2/SubmitInfo.h>
Emilian Peev2295df72021-11-12 18:14:10 -080025#include <unordered_map>
Eino-Ville Talvala7b82efe2013-07-25 17:12:35 -070026
Yin-Chia Yehb978c382019-10-30 00:22:37 -070027#include "CameraOfflineSessionClient.h"
Igor Murashkine7ee7632013-06-11 18:10:18 -070028#include "CameraService.h"
Eino-Ville Talvala7b82efe2013-07-25 17:12:35 -070029#include "common/FrameProcessorBase.h"
30#include "common/Camera2ClientBase.h"
Emilian Peev538c90e2018-12-17 18:03:19 +000031#include "CompositeStream.h"
Jayant Chowdhary13f9b2f2020-12-02 22:46:15 -080032#include "utils/SessionConfigurationUtils.h"
Igor Murashkine7ee7632013-06-11 18:10:18 -070033
Emilian Peev40ead602017-09-26 15:46:36 +010034using android::camera3::OutputStreamInfo;
Emilian Peev538c90e2018-12-17 18:03:19 +000035using android::camera3::CompositeStream;
Emilian Peev40ead602017-09-26 15:46:36 +010036
Igor Murashkine7ee7632013-06-11 18:10:18 -070037namespace android {
38
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080039struct CameraDeviceClientBase :
40 public CameraService::BasicClient,
41 public hardware::camera2::BnCameraDeviceUser
Igor Murashkine7ee7632013-06-11 18:10:18 -070042{
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080043 typedef hardware::camera2::ICameraDeviceCallbacks TCamCallbacks;
Igor Murashkine7ee7632013-06-11 18:10:18 -070044
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080045 const sp<hardware::camera2::ICameraDeviceCallbacks>& getRemoteCallback() {
Igor Murashkine7ee7632013-06-11 18:10:18 -070046 return mRemoteCallback;
47 }
48
49protected:
50 CameraDeviceClientBase(const sp<CameraService>& cameraService,
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080051 const sp<hardware::camera2::ICameraDeviceCallbacks>& remoteCallback,
Igor Murashkine7ee7632013-06-11 18:10:18 -070052 const String16& clientPackageName,
Jayant Chowdharyeb0169f2022-01-31 00:00:02 -080053 bool systemNativeClient,
Jooyung Hanb3f7cd22020-01-23 12:27:18 +090054 const std::optional<String16>& clientFeatureId,
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -080055 const String8& cameraId,
Yin-Chia Yehc3e9d6f2018-02-06 10:56:32 -080056 int api1CameraId,
Igor Murashkine7ee7632013-06-11 18:10:18 -070057 int cameraFacing,
Emilian Peev8b64f282021-03-25 16:49:57 -070058 int sensorOrientation,
Igor Murashkine7ee7632013-06-11 18:10:18 -070059 int clientPid,
60 uid_t clientUid,
61 int servicePid);
62
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080063 sp<hardware::camera2::ICameraDeviceCallbacks> mRemoteCallback;
Igor Murashkine7ee7632013-06-11 18:10:18 -070064};
65
66/**
67 * Implements the binder ICameraDeviceUser API,
68 * meant for HAL3-public implementation of
69 * android.hardware.photography.CameraDevice
70 */
71class CameraDeviceClient :
72 public Camera2ClientBase<CameraDeviceClientBase>,
Eino-Ville Talvala7b82efe2013-07-25 17:12:35 -070073 public camera2::FrameProcessorBase::FilteredListener
Igor Murashkine7ee7632013-06-11 18:10:18 -070074{
75public:
76 /**
77 * ICameraDeviceUser interface (see ICameraDeviceUser for details)
78 */
79
80 // Note that the callee gets a copy of the metadata.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080081 virtual binder::Status submitRequest(
82 const hardware::camera2::CaptureRequest& request,
83 bool streaming = false,
84 /*out*/
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -080085 hardware::camera2::utils::SubmitInfo *submitInfo = nullptr) override;
Jianing Wei90e59c92014-03-12 18:29:36 -070086 // List of requests are copied.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080087 virtual binder::Status submitRequestList(
88 const std::vector<hardware::camera2::CaptureRequest>& requests,
89 bool streaming = false,
90 /*out*/
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -080091 hardware::camera2::utils::SubmitInfo *submitInfo = nullptr) override;
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080092 virtual binder::Status cancelRequest(int requestId,
93 /*out*/
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -080094 int64_t* lastFrameNumber = NULL) override;
Igor Murashkine7ee7632013-06-11 18:10:18 -070095
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -080096 virtual binder::Status beginConfigure() override;
Ruben Brunkb2119af2014-05-09 19:57:56 -070097
Emilian Peev5fbe0ba2017-10-20 15:45:45 +010098 virtual binder::Status endConfigure(int operatingMode,
Emilian Peevcc0b7952020-01-07 13:54:47 -080099 const hardware::camera2::impl::CameraMetadataNative& sessionParams,
Shuzhen Wang316781a2020-08-18 18:11:01 -0700100 int64_t startTimeMs,
Emilian Peevcc0b7952020-01-07 13:54:47 -0800101 /*out*/
102 std::vector<int>* offlineStreamIds) override;
Ruben Brunkb2119af2014-05-09 19:57:56 -0700103
Emilian Peev35ae8262018-11-08 13:11:32 +0000104 // Verify specific session configuration.
105 virtual binder::Status isSessionConfigurationSupported(
106 const SessionConfiguration& sessionConfiguration,
107 /*out*/
108 bool* streamStatus) override;
109
Yin-Chia Yeh5090c732017-07-20 16:05:29 -0700110 // Returns -EBUSY if device is not idle or in error state
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800111 virtual binder::Status deleteStream(int streamId) override;
Igor Murashkine7ee7632013-06-11 18:10:18 -0700112
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800113 virtual binder::Status createStream(
114 const hardware::camera2::params::OutputConfiguration &outputConfiguration,
115 /*out*/
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800116 int32_t* newStreamId = NULL) override;
Igor Murashkine7ee7632013-06-11 18:10:18 -0700117
Chien-Yu Chen618ff8a2015-03-13 11:27:17 -0700118 // Create an input stream of width, height, and format.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800119 virtual binder::Status createInputStream(int width, int height, int format,
Shuzhen Wang83bff122020-11-20 15:51:39 -0800120 bool isMultiResolution,
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800121 /*out*/
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800122 int32_t* newStreamId = NULL) override;
Chien-Yu Chen618ff8a2015-03-13 11:27:17 -0700123
124 // Get the buffer producer of the input stream
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800125 virtual binder::Status getInputSurface(
126 /*out*/
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800127 view::Surface *inputSurface) override;
Chien-Yu Chen618ff8a2015-03-13 11:27:17 -0700128
Igor Murashkine7ee7632013-06-11 18:10:18 -0700129 // Create a request object from a template.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800130 virtual binder::Status createDefaultRequest(int templateId,
131 /*out*/
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800132 hardware::camera2::impl::CameraMetadataNative* request) override;
Igor Murashkine7ee7632013-06-11 18:10:18 -0700133
134 // Get the static metadata for the camera
135 // -- Caller owns the newly allocated metadata
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800136 virtual binder::Status getCameraInfo(
137 /*out*/
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800138 hardware::camera2::impl::CameraMetadataNative* cameraCharacteristics) override;
Igor Murashkine7ee7632013-06-11 18:10:18 -0700139
Zhijun He2ab500c2013-07-23 08:02:53 -0700140 // Wait until all the submitted requests have finished processing
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800141 virtual binder::Status waitUntilIdle() override;
Eino-Ville Talvalaabaa51d2013-08-14 11:37:00 -0700142
143 // Flush all active and pending requests as fast as possible
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800144 virtual binder::Status flush(
145 /*out*/
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800146 int64_t* lastFrameNumber = NULL) override;
Eino-Ville Talvalaabaa51d2013-08-14 11:37:00 -0700147
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700148 // Prepare stream by preallocating its buffers
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800149 virtual binder::Status prepare(int32_t streamId) override;
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700150
Eino-Ville Talvalab25e3c82015-07-15 16:04:27 -0700151 // Tear down stream resources by freeing its unused buffers
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800152 virtual binder::Status tearDown(int32_t streamId) override;
Eino-Ville Talvalab25e3c82015-07-15 16:04:27 -0700153
Ruben Brunkc78ac262015-08-13 17:58:46 -0700154 // Prepare stream by preallocating up to maxCount of its buffers
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800155 virtual binder::Status prepare2(int32_t maxCount, int32_t streamId) override;
Ruben Brunkc78ac262015-08-13 17:58:46 -0700156
Emilian Peev40ead602017-09-26 15:46:36 +0100157 // Update an output configuration
158 virtual binder::Status updateOutputConfiguration(int streamId,
159 const hardware::camera2::params::OutputConfiguration &outputConfiguration) override;
160
Shuzhen Wang758c2152017-01-10 18:26:18 -0800161 // Finalize the output configurations with surfaces not added before.
162 virtual binder::Status finalizeOutputConfigurations(int32_t streamId,
Eino-Ville Talvalabbbbe842017-02-28 17:50:56 -0800163 const hardware::camera2::params::OutputConfiguration &outputConfiguration) override;
Zhijun He5d677d12016-05-29 16:52:39 -0700164
Yin-Chia Yehcfab4e12019-09-09 13:08:28 -0700165 virtual binder::Status setCameraAudioRestriction(int32_t mode) override;
166
167 virtual binder::Status getGlobalAudioRestriction(/*out*/int32_t* outMode) override;
Yin-Chia Yehdba03232019-08-19 15:54:28 -0700168
Yin-Chia Yehb978c382019-10-30 00:22:37 -0700169 virtual binder::Status switchToOffline(
170 const sp<hardware::camera2::ICameraDeviceCallbacks>& cameraCb,
Emilian Peevb2bc5a42019-11-20 16:02:14 -0800171 const std::vector<int>& offlineOutputIds,
Yin-Chia Yehb978c382019-10-30 00:22:37 -0700172 /*out*/
173 sp<hardware::camera2::ICameraOfflineSession>* session) override;
174
Igor Murashkine7ee7632013-06-11 18:10:18 -0700175 /**
176 * Interface used by CameraService
177 */
178
179 CameraDeviceClient(const sp<CameraService>& cameraService,
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800180 const sp<hardware::camera2::ICameraDeviceCallbacks>& remoteCallback,
Igor Murashkine7ee7632013-06-11 18:10:18 -0700181 const String16& clientPackageName,
Jayant Chowdharyeb0169f2022-01-31 00:00:02 -0800182 bool clientPackageOverride,
Jooyung Hanb3f7cd22020-01-23 12:27:18 +0900183 const std::optional<String16>& clientFeatureId,
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800184 const String8& cameraId,
Igor Murashkine7ee7632013-06-11 18:10:18 -0700185 int cameraFacing,
Emilian Peev8b64f282021-03-25 16:49:57 -0700186 int sensorOrientation,
Igor Murashkine7ee7632013-06-11 18:10:18 -0700187 int clientPid,
188 uid_t clientUid,
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700189 int servicePid,
190 bool overrideForPerfClass);
Igor Murashkine7ee7632013-06-11 18:10:18 -0700191 virtual ~CameraDeviceClient();
192
Emilian Peevbd8c5032018-02-14 23:05:40 +0000193 virtual status_t initialize(sp<CameraProviderManager> manager,
194 const String8& monitorTags) override;
Igor Murashkine7ee7632013-06-11 18:10:18 -0700195
Eino-Ville Talvalaf2e37092020-01-07 15:32:32 -0800196 virtual status_t setRotateAndCropOverride(uint8_t rotateAndCrop) override;
197
Eino-Ville Talvala305cec62020-11-12 14:18:17 -0800198 virtual bool supportsCameraMute();
199 virtual status_t setCameraMute(bool enabled);
200
Igor Murashkine7ee7632013-06-11 18:10:18 -0700201 virtual status_t dump(int fd, const Vector<String16>& args);
202
Eino-Ville Talvalac4003962016-01-13 10:07:04 -0800203 virtual status_t dumpClient(int fd, const Vector<String16>& args);
204
Avichal Rakesh7e53cad2021-10-05 13:46:30 -0700205 virtual status_t startWatchingTags(const String8 &tags, int out);
206 virtual status_t stopWatchingTags(int out);
207 virtual status_t dumpWatchedEventsToVector(std::vector<std::string> &out);
208
Igor Murashkine7ee7632013-06-11 18:10:18 -0700209 /**
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -0700210 * Device listener interface
211 */
212
Shuzhen Wang316781a2020-08-18 18:11:01 -0700213 virtual void notifyIdle(int64_t requestCount, int64_t resultErrorCount, bool deviceError,
214 const std::vector<hardware::CameraStreamStats>& streamStats);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800215 virtual void notifyError(int32_t errorCode,
Jianing Weicb0652e2014-03-12 18:29:36 -0700216 const CaptureResultExtras& resultExtras);
217 virtual void notifyShutter(const CaptureResultExtras& resultExtras, nsecs_t timestamp);
Eino-Ville Talvala4d44cad2015-04-11 13:15:45 -0700218 virtual void notifyPrepared(int streamId);
Shuzhen Wang9d066012016-09-30 11:30:20 -0700219 virtual void notifyRequestQueueEmpty();
Chien-Yu Chene8c535e2016-04-14 12:18:26 -0700220 virtual void notifyRepeatingRequestError(long lastFrameNumber);
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -0700221
Shuzhen Wangabbcb6b2020-12-09 22:32:44 -0800222 void setImageDumpMask(int mask) { if (mDevice != nullptr) mDevice->setImageDumpMask(mask); }
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -0700223 /**
Igor Murashkine7ee7632013-06-11 18:10:18 -0700224 * Interface used by independent components of CameraDeviceClient.
225 */
226protected:
227 /** FilteredListener implementation **/
Jianing Weicb0652e2014-03-12 18:29:36 -0700228 virtual void onResultAvailable(const CaptureResult& result);
Igor Murashkine7ee7632013-06-11 18:10:18 -0700229 virtual void detachDevice();
230
Igor Murashkinf8b2a6f2013-09-17 17:03:28 -0700231 // Calculate the ANativeWindow transform from android.sensor.orientation
Shuzhen Wang610d7b82022-02-08 14:37:22 -0800232 status_t getRotationTransformLocked(int mirrorMode, /*out*/int32_t* transform);
Igor Murashkinf8b2a6f2013-09-17 17:03:28 -0700233
Jayant Chowdhary13f9b2f2020-12-02 22:46:15 -0800234 bool isUltraHighResolutionSensor(const String8 &cameraId);
235
236 bool isSensorPixelModeConsistent(const std::list<int> &streamIdList,
237 const CameraMetadata &settings);
238
239 const CameraMetadata &getStaticInfo(const String8 &cameraId);
240
Igor Murashkine7ee7632013-06-11 18:10:18 -0700241private:
Shuzhen Wang0129d522016-10-30 22:43:41 -0700242 // StreamSurfaceId encapsulates streamId + surfaceId for a particular surface.
243 // streamId specifies the index of the stream the surface belongs to, and the
244 // surfaceId specifies the index of the surface within the stream. (one stream
245 // could contain multiple surfaces.)
246 class StreamSurfaceId final {
247 public:
248 StreamSurfaceId() {
249 mStreamId = -1;
250 mSurfaceId = -1;
251 }
252 StreamSurfaceId(int32_t streamId, int32_t surfaceId) {
253 mStreamId = streamId;
254 mSurfaceId = surfaceId;
255 }
256 int32_t streamId() const {
257 return mStreamId;
258 }
259 int32_t surfaceId() const {
260 return mSurfaceId;
261 }
262
263 private:
264 int32_t mStreamId;
265 int32_t mSurfaceId;
266
267 }; // class StreamSurfaceId
268
269private:
Igor Murashkine7ee7632013-06-11 18:10:18 -0700270 /** ICameraDeviceUser interface-related private members */
271
272 /** Preview callback related members */
Eino-Ville Talvala7b82efe2013-07-25 17:12:35 -0700273 sp<camera2::FrameProcessorBase> mFrameProcessor;
Igor Murashkine7ee7632013-06-11 18:10:18 -0700274
Emilian Peev00420d22018-02-05 21:33:13 +0000275 std::vector<int32_t> mSupportedPhysicalRequestKeys;
276
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800277 template<typename TProviderPtr>
Emilian Peevbd8c5032018-02-14 23:05:40 +0000278 status_t initializeImpl(TProviderPtr providerPtr, const String8& monitorTags);
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800279
Igor Murashkine7ee7632013-06-11 18:10:18 -0700280 /** Utility members */
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800281 binder::Status checkPidStatus(const char* checkLocation);
Igor Murashkine7ee7632013-06-11 18:10:18 -0700282 bool enforceRequestPermissions(CameraMetadata& metadata);
283
Zhijun He5d677d12016-05-29 16:52:39 -0700284 // Create an output stream with surface deferred for future.
285 binder::Status createDeferredSurfaceStreamLocked(
286 const hardware::camera2::params::OutputConfiguration &outputConfiguration,
Shuzhen Wang758c2152017-01-10 18:26:18 -0800287 bool isShared,
Zhijun He5d677d12016-05-29 16:52:39 -0700288 int* newStreamId = NULL);
289
290 // Set the stream transform flags to automatically rotate the camera stream for preview use
291 // cases.
Shuzhen Wang610d7b82022-02-08 14:37:22 -0800292 binder::Status setStreamTransformLocked(int streamId, int mirrorMode);
Zhijun He5d677d12016-05-29 16:52:39 -0700293
Yin-Chia Yeh4dfa4cc2017-11-10 20:00:09 -0800294 // Utility method to insert the surface into SurfaceMap
295 binder::Status insertGbpLocked(const sp<IGraphicBufferProducer>& gbp,
Emilian Peevf873aa52018-01-26 14:58:28 +0000296 /*out*/SurfaceMap* surfaceMap, /*out*/Vector<int32_t>* streamIds,
297 /*out*/int32_t* currentStreamId);
Yin-Chia Yeh4dfa4cc2017-11-10 20:00:09 -0800298
Emilian Peevf4816702020-04-03 15:44:51 -0700299 // Utility method that maps AIDL request templates.
300 binder::Status mapRequestTemplate(int templateId,
301 camera_request_template_t* tempId /*out*/);
302
Shuzhen Wang0129d522016-10-30 22:43:41 -0700303 // IGraphicsBufferProducer binder -> Stream ID + Surface ID for output streams
304 KeyedVector<sp<IBinder>, StreamSurfaceId> mStreamMap;
Igor Murashkine7ee7632013-06-11 18:10:18 -0700305
Yin-Chia Yeh4dfa4cc2017-11-10 20:00:09 -0800306 // Stream ID -> OutputConfiguration. Used for looking up Surface by stream/surface index
307 KeyedVector<int32_t, hardware::camera2::params::OutputConfiguration> mConfiguredOutputs;
308
Emilian Peev2295df72021-11-12 18:14:10 -0800309 // Dynamic range profile id -> Supported dynamic profiles bitmap within an single capture
310 // request
Emilian Peevc81a7592022-02-14 17:38:18 -0800311 std::unordered_map<int64_t, int64_t> mDynamicProfileMap;
Emilian Peev2295df72021-11-12 18:14:10 -0800312
Chien-Yu Chen618ff8a2015-03-13 11:27:17 -0700313 struct InputStreamConfiguration {
314 bool configured;
315 int32_t width;
316 int32_t height;
317 int32_t format;
318 int32_t id;
319 } mInputStream;
320
Chien-Yu Chene8c535e2016-04-14 12:18:26 -0700321 // Streaming request ID
322 int32_t mStreamingRequestId;
Shuzhen Wangc9ca6782016-04-26 13:40:31 -0700323 Mutex mStreamingRequestIdLock;
Chien-Yu Chene8c535e2016-04-14 12:18:26 -0700324 static const int32_t REQUEST_ID_NONE = -1;
Igor Murashkine7ee7632013-06-11 18:10:18 -0700325
326 int32_t mRequestIdCounter;
Eino-Ville Talvala412fe562015-08-20 17:08:32 -0700327
Jayant Chowdhary13f9b2f2020-12-02 22:46:15 -0800328 std::vector<std::string> mPhysicalCameraIds;
329
Zhijun He5d677d12016-05-29 16:52:39 -0700330 // The list of output streams whose surfaces are deferred. We have to track them separately
331 // as there are no surfaces available and can not be put into mStreamMap. Once the deferred
332 // Surface is configured, the stream id will be moved to mStreamMap.
333 Vector<int32_t> mDeferredStreams;
Shuzhen Wang0129d522016-10-30 22:43:41 -0700334
Shuzhen Wang758c2152017-01-10 18:26:18 -0800335 // stream ID -> outputStreamInfo mapping
336 std::unordered_map<int32_t, OutputStreamInfo> mStreamInfoMap;
337
Jayant Chowdhary13f9b2f2020-12-02 22:46:15 -0800338 // map high resolution camera id (logical / physical) -> list of stream ids configured
339 std::unordered_map<std::string, std::unordered_set<int>> mHighResolutionCameraIdToStreamIdSet;
340
341 // set of high resolution camera id (logical / physical)
342 std::unordered_set<std::string> mHighResolutionSensors;
343
Emilian Peev2f5d6012022-01-19 16:16:50 -0800344 // Synchronize access to 'mCompositeStreamMap'
345 Mutex mCompositeLock;
Emilian Peev538c90e2018-12-17 18:03:19 +0000346 KeyedVector<sp<IBinder>, sp<CompositeStream>> mCompositeStreamMap;
347
Shuzhen Wang03d8cc12018-09-12 14:17:09 -0700348 sp<CameraProviderManager> mProviderManager;
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700349
350 // Override the camera characteristics for performance class primary cameras.
351 bool mOverrideForPerfClass;
Shuzhen Wangd26b1862022-03-07 12:05:05 -0800352
353 // The string representation of object passed into CaptureRequest.setTag.
354 std::string mUserTag;
Igor Murashkine7ee7632013-06-11 18:10:18 -0700355};
356
357}; // namespace android
358
359#endif