blob: d8c1f5900b57926ebafffd4dd5ff5c277c47a30c [file] [log] [blame]
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -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
17#ifndef ANDROID_SERVERS_CAMERA_CAMERAPROVIDER_H
18#define ANDROID_SERVERS_CAMERA_CAMERAPROVIDER_H
19
20#include <vector>
Peter Kalauskasa29c1352018-10-10 12:05:42 -070021#include <unordered_map>
Yin-Chia Yehc3e9d6f2018-02-06 10:56:32 -080022#include <unordered_set>
Shuzhen Wangd4abdf72021-05-28 11:22:50 -070023#include <set>
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -080024#include <string>
25#include <mutex>
Shuzhen Wang394ad702020-07-23 13:01:54 -070026#include <future>
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -080027
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -080028#include <camera/camera2/ConcurrentCamera.h>
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -080029#include <camera/CameraParameters2.h>
30#include <camera/CameraMetadata.h>
31#include <camera/CameraBase.h>
32#include <utils/Errors.h>
33#include <android/hardware/camera/common/1.0/types.h>
Eino-Ville Talvala63f36112018-12-06 14:57:03 -080034#include <android/hardware/camera/provider/2.5/ICameraProvider.h>
Shuzhen Wang43858162020-01-10 13:42:15 -080035#include <android/hardware/camera/provider/2.6/ICameraProviderCallback.h>
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -080036#include <android/hardware/camera/provider/2.6/ICameraProvider.h>
Shuzhen Wang83bff122020-11-20 15:51:39 -080037#include <android/hardware/camera/provider/2.7/ICameraProvider.h>
38#include <android/hardware/camera/device/3.7/types.h>
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -080039#include <android/hidl/manager/1.0/IServiceNotification.h>
Yin-Chia Yeh067428c2017-01-13 15:19:24 -080040#include <camera/VendorTagDescriptor.h>
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -080041
42namespace android {
43
44/**
Yin-Chia Yeh067428c2017-01-13 15:19:24 -080045 * The vendor tag descriptor class that takes HIDL vendor tag information as
46 * input. Not part of VendorTagDescriptor class because that class is used
47 * in AIDL generated sources which don't have access to HIDL headers.
48 */
49class HidlVendorTagDescriptor : public VendorTagDescriptor {
50public:
51 /**
52 * Create a VendorTagDescriptor object from the HIDL VendorTagSection
53 * vector.
54 *
55 * Returns OK on success, or a negative error code.
56 */
57 static status_t createDescriptorFromHidl(
58 const hardware::hidl_vec<hardware::camera::common::V1_0::VendorTagSection>& vts,
59 /*out*/
60 sp<VendorTagDescriptor>& descriptor);
61};
62
Jayant Chowdhary5216b212019-07-17 09:26:23 -070063enum SystemCameraKind {
64 /**
65 * These camera devices are visible to all apps and system components alike
66 */
67 PUBLIC = 0,
68
69 /**
70 * These camera devices are visible only to processes having the
71 * android.permission.SYSTEM_CAMERA permission. They are not exposed to 3P
72 * apps.
73 */
74 SYSTEM_ONLY_CAMERA,
75
76 /**
77 * These camera devices are visible only to HAL clients (that try to connect
78 * on a hwbinder thread).
79 */
80 HIDDEN_SECURE_CAMERA
81};
82
Shuzhen Wang83bff122020-11-20 15:51:39 -080083#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0)
84#define CAMERA_DEVICE_API_VERSION_3_0 HARDWARE_DEVICE_API_VERSION(3, 0)
85#define CAMERA_DEVICE_API_VERSION_3_1 HARDWARE_DEVICE_API_VERSION(3, 1)
86#define CAMERA_DEVICE_API_VERSION_3_2 HARDWARE_DEVICE_API_VERSION(3, 2)
87#define CAMERA_DEVICE_API_VERSION_3_3 HARDWARE_DEVICE_API_VERSION(3, 3)
88#define CAMERA_DEVICE_API_VERSION_3_4 HARDWARE_DEVICE_API_VERSION(3, 4)
89#define CAMERA_DEVICE_API_VERSION_3_5 HARDWARE_DEVICE_API_VERSION(3, 5)
90#define CAMERA_DEVICE_API_VERSION_3_6 HARDWARE_DEVICE_API_VERSION(3, 6)
91#define CAMERA_DEVICE_API_VERSION_3_7 HARDWARE_DEVICE_API_VERSION(3, 7)
92
Yin-Chia Yeh067428c2017-01-13 15:19:24 -080093/**
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -080094 * A manager for all camera providers available on an Android device.
95 *
96 * Responsible for enumerating providers and the individual camera devices
97 * they export, both at startup and as providers and devices are added/removed.
98 *
99 * Provides methods for requesting information about individual devices and for
100 * opening them for active use.
101 *
102 */
103class CameraProviderManager : virtual public hidl::manager::V1_0::IServiceNotification {
104public:
105
106 ~CameraProviderManager();
107
108 // Tiny proxy for the static methods in a HIDL interface that communicate with the hardware
109 // service manager, to be replacable in unit tests with a fake.
110 struct ServiceInteractionProxy {
111 virtual bool registerForNotifications(
112 const std::string &serviceName,
113 const sp<hidl::manager::V1_0::IServiceNotification>
114 &notification) = 0;
Eino-Ville Talvalaec960602019-10-15 11:46:16 -0700115 // Will not wait for service to start if it's not already running
116 virtual sp<hardware::camera::provider::V2_4::ICameraProvider> tryGetService(
117 const std::string &serviceName) = 0;
118 // Will block for service if it exists but isn't running
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800119 virtual sp<hardware::camera::provider::V2_4::ICameraProvider> getService(
120 const std::string &serviceName) = 0;
Yin-Chia Yeh177b0c12019-06-25 10:53:03 -0700121 virtual hardware::hidl_vec<hardware::hidl_string> listServices() = 0;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800122 virtual ~ServiceInteractionProxy() {}
123 };
124
125 // Standard use case - call into the normal generated static methods which invoke
126 // the real hardware service manager
127 struct HardwareServiceInteractionProxy : public ServiceInteractionProxy {
128 virtual bool registerForNotifications(
129 const std::string &serviceName,
130 const sp<hidl::manager::V1_0::IServiceNotification>
131 &notification) override {
132 return hardware::camera::provider::V2_4::ICameraProvider::registerForNotifications(
133 serviceName, notification);
134 }
Eino-Ville Talvalaec960602019-10-15 11:46:16 -0700135 virtual sp<hardware::camera::provider::V2_4::ICameraProvider> tryGetService(
136 const std::string &serviceName) override {
137 return hardware::camera::provider::V2_4::ICameraProvider::tryGetService(serviceName);
138 }
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800139 virtual sp<hardware::camera::provider::V2_4::ICameraProvider> getService(
140 const std::string &serviceName) override {
141 return hardware::camera::provider::V2_4::ICameraProvider::getService(serviceName);
142 }
Yin-Chia Yeh177b0c12019-06-25 10:53:03 -0700143
144 virtual hardware::hidl_vec<hardware::hidl_string> listServices() override;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800145 };
146
147 /**
148 * Listener interface for device/torch status changes
149 */
150 struct StatusListener : virtual public RefBase {
151 ~StatusListener() {}
152
153 virtual void onDeviceStatusChanged(const String8 &cameraId,
154 hardware::camera::common::V1_0::CameraDeviceStatus newStatus) = 0;
Shuzhen Wang43858162020-01-10 13:42:15 -0800155 virtual void onDeviceStatusChanged(const String8 &cameraId,
156 const String8 &physicalCameraId,
157 hardware::camera::common::V1_0::CameraDeviceStatus newStatus) = 0;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800158 virtual void onTorchStatusChanged(const String8 &cameraId,
159 hardware::camera::common::V1_0::TorchModeStatus newStatus) = 0;
Emilian Peevaee727d2017-05-04 16:35:48 +0100160 virtual void onNewProviderRegistered() = 0;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800161 };
162
163 /**
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700164 * Represents the mode a camera device is currently in
165 */
166 enum class DeviceMode {
167 TORCH,
168 CAMERA
169 };
170
171 /**
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800172 * Initialize the manager and give it a status listener; optionally accepts a service
173 * interaction proxy.
174 *
175 * The default proxy communicates via the hardware service manager; alternate proxies can be
176 * used for testing. The lifetime of the proxy must exceed the lifetime of the manager.
177 */
178 status_t initialize(wp<StatusListener> listener,
179 ServiceInteractionProxy *proxy = &sHardwareServiceInteractionProxy);
180
181 /**
Jayant Chowdhary847947d2019-08-30 18:02:59 -0700182 * Retrieve the total number of available cameras.
183 * This value may change dynamically as cameras are added or removed.
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800184 */
Jayant Chowdhary847947d2019-08-30 18:02:59 -0700185 std::pair<int, int> getCameraCount() const;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800186
Yin-Chia Yehc3e9d6f2018-02-06 10:56:32 -0800187 std::vector<std::string> getCameraDeviceIds() const;
188
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800189 /**
Emilian Peevf53f66e2017-04-11 14:29:43 +0100190 * Retrieve the number of API1 compatible cameras; these are internal and
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800191 * backwards-compatible. This is the set of cameras that will be
Yin-Chia Yehc3e9d6f2018-02-06 10:56:32 -0800192 * accessible via the old camera API.
193 * The return value may change dynamically due to external camera hotplug.
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800194 */
Emilian Peevf53f66e2017-04-11 14:29:43 +0100195 std::vector<std::string> getAPI1CompatibleCameraDeviceIds() const;
Yin-Chia Yehdc3134e2017-03-23 15:26:59 -0700196
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800197 /**
198 * Return true if a device with a given ID and major version exists
199 */
200 bool isValidDevice(const std::string &id, uint16_t majorVersion) const;
201
202 /**
203 * Return true if a device with a given ID has a flash unit. Returns false
204 * for devices that are unknown.
205 */
206 bool hasFlashUnit(const std::string &id) const;
207
208 /**
Shuzhen Wangdbdf72b2019-11-13 11:22:12 -0800209 * Return true if the camera device has native zoom ratio support.
210 */
211 bool supportNativeZoomRatio(const std::string &id) const;
212
213 /**
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800214 * Return the resource cost of this camera device
215 */
216 status_t getResourceCost(const std::string &id,
217 hardware::camera::common::V1_0::CameraResourceCost* cost) const;
218
219 /**
220 * Return the old camera API camera info
221 */
222 status_t getCameraInfo(const std::string &id,
223 hardware::CameraInfo* info) const;
224
225 /**
226 * Return API2 camera characteristics - returns NAME_NOT_FOUND if a device ID does
227 * not have a v3 or newer HAL version.
228 */
229 status_t getCameraCharacteristics(const std::string &id,
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700230 bool overrideForPerfClass, CameraMetadata* characteristics) const;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800231
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800232 status_t isConcurrentSessionConfigurationSupported(
233 const std::vector<hardware::camera2::utils::CameraIdAndSessionConfiguration>
234 &cameraIdsAndSessionConfigs,
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700235 const std::set<std::string>& perfClassPrimaryCameraIds,
236 int targetSdkVersion, bool *isSupported);
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800237
Jayant Chowdharycad23c22020-03-10 15:04:59 -0700238 std::vector<std::unordered_set<std::string>> getConcurrentCameraIds() const;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800239 /**
Emilian Peev35ae8262018-11-08 13:11:32 +0000240 * Check for device support of specific stream combination.
241 */
242 status_t isSessionConfigurationSupported(const std::string& id,
Shuzhen Wang83bff122020-11-20 15:51:39 -0800243 const hardware::camera::device::V3_7::StreamConfiguration &configuration,
Emilian Peev35ae8262018-11-08 13:11:32 +0000244 bool *status /*out*/) const;
245
246 /**
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800247 * Return the highest supported device interface version for this ID
248 */
249 status_t getHighestSupportedVersion(const std::string &id,
250 hardware::hidl_version *v);
251
252 /**
Yin-Chia Yehdc3134e2017-03-23 15:26:59 -0700253 * Check if a given camera device support setTorchMode API.
254 */
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700255 bool supportSetTorchMode(const std::string &id) const;
Yin-Chia Yehdc3134e2017-03-23 15:26:59 -0700256
257 /**
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800258 * Turn on or off the flashlight on a given camera device.
Yin-Chia Yehdc3134e2017-03-23 15:26:59 -0700259 * May fail if the device does not support this API, is in active use, or if the device
260 * doesn't exist, etc.
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800261 */
262 status_t setTorchMode(const std::string &id, bool enabled);
263
264 /**
Yin-Chia Yeh067428c2017-01-13 15:19:24 -0800265 * Setup vendor tags for all registered providers
266 */
267 status_t setUpVendorTags();
268
269 /**
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800270 * Inform registered providers about a device state change, such as folding or unfolding
271 */
272 status_t notifyDeviceStateChange(
273 android::hardware::hidl_bitfield<hardware::camera::provider::V2_5::DeviceState> newState);
274
275 /**
Eino-Ville Talvala0b1cb142016-12-19 16:29:17 -0800276 * Open an active session to a camera device.
277 *
278 * This fully powers on the camera device hardware, and returns a handle to a
279 * session to be used for hardware configuration and operation.
280 */
281 status_t openSession(const std::string &id,
282 const sp<hardware::camera::device::V3_2::ICameraDeviceCallback>& callback,
283 /*out*/
284 sp<hardware::camera::device::V3_2::ICameraDeviceSession> *session);
285
Eino-Ville Talvala0b1cb142016-12-19 16:29:17 -0800286 /**
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700287 * Notify that the camera or torch is no longer being used by a camera client
288 */
289 void removeRef(DeviceMode usageType, const std::string &cameraId);
290
291 /**
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800292 * IServiceNotification::onRegistration
293 * Invoked by the hardware service manager when a new camera provider is registered
294 */
295 virtual hardware::Return<void> onRegistration(const hardware::hidl_string& fqName,
296 const hardware::hidl_string& name,
297 bool preexisting) override;
298
299 /**
300 * Dump out information about available providers and devices
301 */
302 status_t dump(int fd, const Vector<String16>& args);
303
Eino-Ville Talvala0b1cb142016-12-19 16:29:17 -0800304 /**
305 * Conversion methods between HAL Status and status_t and strings
306 */
307 static status_t mapToStatusT(const hardware::camera::common::V1_0::Status& s);
308 static const char* statusToString(const hardware::camera::common::V1_0::Status& s);
309
Emilian Peev71c73a22017-03-21 16:35:51 +0000310 /*
311 * Return provider type for a specific device.
312 */
313 metadata_vendor_id_t getProviderTagIdLocked(const std::string& id,
314 hardware::hidl_version minVersion = hardware::hidl_version{0,0},
315 hardware::hidl_version maxVersion = hardware::hidl_version{1000,0}) const;
316
Shuzhen Wange8aceb52018-05-21 12:00:56 -0700317 /*
Shuzhen Wang03d8cc12018-09-12 14:17:09 -0700318 * Check if a camera is a logical camera. And if yes, return
Shuzhen Wange8aceb52018-05-21 12:00:56 -0700319 * the physical camera ids.
320 */
Shuzhen Wang03d8cc12018-09-12 14:17:09 -0700321 bool isLogicalCamera(const std::string& id, std::vector<std::string>* physicalCameraIds);
Shuzhen Wange8aceb52018-05-21 12:00:56 -0700322
Jayant Chowdhary33e8ef82019-09-27 09:20:42 -0700323 status_t getSystemCameraKind(const std::string& id, SystemCameraKind *kind) const;
324 bool isHiddenPhysicalCamera(const std::string& cameraId) const;
Emilian Peev538c90e2018-12-17 18:03:19 +0000325
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700326 status_t filterSmallJpegSizes(const std::string& cameraId);
Shuzhen Wang89db2992021-05-20 13:09:48 -0700327
Emilian Peev538c90e2018-12-17 18:03:19 +0000328 static const float kDepthARTolerance;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800329private:
330 // All private members, unless otherwise noted, expect mInterfaceMutex to be locked before use
331 mutable std::mutex mInterfaceMutex;
332
Yin-Chia Yeh52778d42016-12-22 18:20:43 -0800333 // the status listener update callbacks will lock mStatusMutex
334 mutable std::mutex mStatusListenerMutex;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800335 wp<StatusListener> mListener;
336 ServiceInteractionProxy* mServiceProxy;
337
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800338 // Current overall Android device physical status
339 android::hardware::hidl_bitfield<hardware::camera::provider::V2_5::DeviceState> mDeviceState;
340
Shuzhen Wang6ba8eb22018-07-08 13:10:44 -0700341 // mProviderLifecycleLock is locked during onRegistration and removeProvider
342 mutable std::mutex mProviderLifecycleLock;
343
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800344 static HardwareServiceInteractionProxy sHardwareServiceInteractionProxy;
345
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700346 // Mapping from CameraDevice IDs to CameraProviders. This map is used to keep the
347 // ICameraProvider alive while it is in use by the camera with the given ID for camera
348 // capabilities
349 std::unordered_map<std::string, sp<hardware::camera::provider::V2_4::ICameraProvider>>
350 mCameraProviderByCameraId;
351
352 // Mapping from CameraDevice IDs to CameraProviders. This map is used to keep the
353 // ICameraProvider alive while it is in use by the camera with the given ID for torch
354 // capabilities
355 std::unordered_map<std::string, sp<hardware::camera::provider::V2_4::ICameraProvider>>
356 mTorchProviderByCameraId;
357
358 // Lock for accessing mCameraProviderByCameraId and mTorchProviderByCameraId
359 std::mutex mProviderInterfaceMapLock;
360
Eino-Ville Talvala8d942f92017-03-13 10:09:51 -0700361 struct ProviderInfo :
Shuzhen Wang43858162020-01-10 13:42:15 -0800362 virtual public hardware::camera::provider::V2_6::ICameraProviderCallback,
Eino-Ville Talvala8d942f92017-03-13 10:09:51 -0700363 virtual public hardware::hidl_death_recipient
364 {
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800365 const std::string mProviderName;
Emilian Peevc93cac22020-08-17 16:00:10 -0700366 const std::string mProviderInstance;
Emilian Peev71c73a22017-03-21 16:35:51 +0000367 const metadata_vendor_id_t mProviderTagid;
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800368 int mMinorVersion;
Peter Kalauskas1b3c9072018-11-07 12:41:53 -0800369 sp<VendorTagDescriptor> mVendorTagDescriptor;
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700370 bool mSetTorchModeSupported;
371 bool mIsRemote;
372
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800373 // Current overall Android device physical status
374 hardware::hidl_bitfield<hardware::camera::provider::V2_5::DeviceState> mDeviceState;
375
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700376 // This pointer is used to keep a reference to the ICameraProvider that was last accessed.
377 wp<hardware::camera::provider::V2_4::ICameraProvider> mActiveInterface;
378
379 sp<hardware::camera::provider::V2_4::ICameraProvider> mSavedInterface;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800380
Emilian Peevc93cac22020-08-17 16:00:10 -0700381 ProviderInfo(const std::string &providerName, const std::string &providerInstance,
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800382 CameraProviderManager *manager);
383 ~ProviderInfo();
384
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800385 status_t initialize(sp<hardware::camera::provider::V2_4::ICameraProvider>& interface,
386 hardware::hidl_bitfield<hardware::camera::provider::V2_5::DeviceState>
387 currentDeviceState);
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700388
389 const sp<hardware::camera::provider::V2_4::ICameraProvider> startProviderInterface();
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800390
391 const std::string& getType() const;
392
393 status_t addDevice(const std::string& name,
394 hardware::camera::common::V1_0::CameraDeviceStatus initialStatus =
395 hardware::camera::common::V1_0::CameraDeviceStatus::PRESENT,
396 /*out*/ std::string *parsedId = nullptr);
397
398 status_t dump(int fd, const Vector<String16>& args) const;
399
400 // ICameraProviderCallbacks interface - these lock the parent mInterfaceMutex
Shuzhen Wang43858162020-01-10 13:42:15 -0800401 hardware::Return<void> cameraDeviceStatusChange(
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800402 const hardware::hidl_string& cameraDeviceName,
403 hardware::camera::common::V1_0::CameraDeviceStatus newStatus) override;
Shuzhen Wang43858162020-01-10 13:42:15 -0800404 hardware::Return<void> torchModeStatusChange(
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800405 const hardware::hidl_string& cameraDeviceName,
406 hardware::camera::common::V1_0::TorchModeStatus newStatus) override;
Shuzhen Wang43858162020-01-10 13:42:15 -0800407 hardware::Return<void> physicalCameraDeviceStatusChange(
408 const hardware::hidl_string& cameraDeviceName,
409 const hardware::hidl_string& physicalCameraDeviceName,
410 hardware::camera::common::V1_0::CameraDeviceStatus newStatus) override;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800411
Shuzhen Wang394ad702020-07-23 13:01:54 -0700412 status_t cameraDeviceStatusChangeLocked(
413 std::string* id, const hardware::hidl_string& cameraDeviceName,
414 hardware::camera::common::V1_0::CameraDeviceStatus newStatus);
415 status_t physicalCameraDeviceStatusChangeLocked(
416 std::string* id, std::string* physicalId,
417 const hardware::hidl_string& cameraDeviceName,
418 const hardware::hidl_string& physicalCameraDeviceName,
419 hardware::camera::common::V1_0::CameraDeviceStatus newStatus);
420
Eino-Ville Talvala8d942f92017-03-13 10:09:51 -0700421 // hidl_death_recipient interface - this locks the parent mInterfaceMutex
422 virtual void serviceDied(uint64_t cookie, const wp<hidl::base::V1_0::IBase>& who) override;
423
Peter Kalauskas1b3c9072018-11-07 12:41:53 -0800424 /**
425 * Setup vendor tags for this provider
426 */
427 status_t setUpVendorTags();
428
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800429 /**
430 * Notify provider about top-level device physical state changes
Emilian Peev7fe6c422021-09-08 13:43:20 -0700431 *
432 * Note that 'mInterfaceMutex' should not be held when calling this method.
433 * It is possible for camera providers to add/remove devices and try to
434 * acquire it.
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800435 */
436 status_t notifyDeviceStateChange(
437 hardware::hidl_bitfield<hardware::camera::provider::V2_5::DeviceState>
438 newDeviceState);
Jayant Chowdharycbe770a2020-02-14 11:14:46 -0800439
440 std::vector<std::unordered_set<std::string>> getConcurrentCameraIdCombinations();
441
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800442 /**
443 * Query the camera provider for concurrent stream configuration support
444 */
445 status_t isConcurrentSessionConfigurationSupported(
446 const hardware::hidl_vec<
Shuzhen Wang83bff122020-11-20 15:51:39 -0800447 hardware::camera::provider::V2_7::CameraIdAndStreamCombination>
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800448 &halCameraIdsAndStreamCombinations,
449 bool *isSupported);
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800450
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800451 // Basic device information, common to all camera devices
452 struct DeviceInfo {
453 const std::string mName; // Full instance name
454 const std::string mId; // ID section of full name
455 const hardware::hidl_version mVersion;
Emilian Peev71c73a22017-03-21 16:35:51 +0000456 const metadata_vendor_id_t mProviderTagid;
Shuzhen Wang03d8cc12018-09-12 14:17:09 -0700457 bool mIsLogicalCamera;
458 std::vector<std::string> mPhysicalIds;
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700459 hardware::CameraInfo mInfo;
460 sp<IBase> mSavedInterface;
Jayant Chowdhary5216b212019-07-17 09:26:23 -0700461 SystemCameraKind mSystemCameraKind = SystemCameraKind::PUBLIC;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800462
463 const hardware::camera::common::V1_0::CameraResourceCost mResourceCost;
464
465 hardware::camera::common::V1_0::CameraDeviceStatus mStatus;
466
Shuzhen Wang79680432020-03-05 11:53:46 -0800467 wp<ProviderInfo> mParentProvider;
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700468
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800469 bool hasFlashUnit() const { return mHasFlashUnit; }
Shuzhen Wangdbdf72b2019-11-13 11:22:12 -0800470 bool supportNativeZoomRatio() const { return mSupportNativeZoomRatio; }
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800471 virtual status_t setTorchMode(bool enabled) = 0;
472 virtual status_t getCameraInfo(hardware::CameraInfo *info) const = 0;
Emilian Peevf53f66e2017-04-11 14:29:43 +0100473 virtual bool isAPI1Compatible() const = 0;
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700474 virtual status_t dumpState(int fd) = 0;
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700475 virtual status_t getCameraCharacteristics(bool overrideForPerfClass,
476 CameraMetadata *characteristics) const {
477 (void) overrideForPerfClass;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800478 (void) characteristics;
479 return INVALID_OPERATION;
480 }
Shuzhen Wangf9d2c022018-08-21 12:07:35 -0700481 virtual status_t getPhysicalCameraCharacteristics(const std::string& physicalCameraId,
482 CameraMetadata *characteristics) const {
483 (void) physicalCameraId;
484 (void) characteristics;
485 return INVALID_OPERATION;
486 }
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800487
Emilian Peev35ae8262018-11-08 13:11:32 +0000488 virtual status_t isSessionConfigurationSupported(
Shuzhen Wang83bff122020-11-20 15:51:39 -0800489 const hardware::camera::device::V3_7::StreamConfiguration &/*configuration*/,
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700490 bool * /*status*/) {
Emilian Peev35ae8262018-11-08 13:11:32 +0000491 return INVALID_OPERATION;
492 }
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700493 virtual status_t filterSmallJpegSizes() = 0;
Emilian Peev35ae8262018-11-08 13:11:32 +0000494
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700495 template<class InterfaceT>
496 sp<InterfaceT> startDeviceInterface();
497
Emilian Peev71c73a22017-03-21 16:35:51 +0000498 DeviceInfo(const std::string& name, const metadata_vendor_id_t tagId,
499 const std::string &id, const hardware::hidl_version& version,
Shuzhen Wangf9d2c022018-08-21 12:07:35 -0700500 const std::vector<std::string>& publicCameraIds,
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700501 const hardware::camera::common::V1_0::CameraResourceCost& resourceCost,
502 sp<ProviderInfo> parentProvider) :
Emilian Peev71c73a22017-03-21 16:35:51 +0000503 mName(name), mId(id), mVersion(version), mProviderTagid(tagId),
Shuzhen Wang03d8cc12018-09-12 14:17:09 -0700504 mIsLogicalCamera(false), mResourceCost(resourceCost),
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800505 mStatus(hardware::camera::common::V1_0::CameraDeviceStatus::PRESENT),
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700506 mParentProvider(parentProvider), mHasFlashUnit(false),
Shuzhen Wangdbdf72b2019-11-13 11:22:12 -0800507 mSupportNativeZoomRatio(false), mPublicCameraIds(publicCameraIds) {}
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800508 virtual ~DeviceInfo();
509 protected:
Shuzhen Wangdbdf72b2019-11-13 11:22:12 -0800510 bool mHasFlashUnit; // const after constructor
511 bool mSupportNativeZoomRatio; // const after constructor
Shuzhen Wangf9d2c022018-08-21 12:07:35 -0700512 const std::vector<std::string>& mPublicCameraIds;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800513
514 template<class InterfaceT>
515 static status_t setTorchMode(InterfaceT& interface, bool enabled);
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700516
517 template<class InterfaceT>
518 status_t setTorchModeForDevice(bool enabled) {
519 // Don't save the ICameraProvider interface here because we assume that this was
520 // called from CameraProviderManager::setTorchMode(), which does save it.
521 const sp<InterfaceT> interface = startDeviceInterface<InterfaceT>();
522 return DeviceInfo::setTorchMode(interface, enabled);
523 }
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800524 };
525 std::vector<std::unique_ptr<DeviceInfo>> mDevices;
Yin-Chia Yehc3e9d6f2018-02-06 10:56:32 -0800526 std::unordered_set<std::string> mUniqueCameraIds;
Yin-Chia Yehe8e9e192017-03-16 15:23:51 -0700527 int mUniqueDeviceCount;
Shuzhen Wange8aceb52018-05-21 12:00:56 -0700528 std::vector<std::string> mUniqueAPI1CompatibleCameraIds;
Shuzhen Wangf9d2c022018-08-21 12:07:35 -0700529 // The initial public camera IDs published by the camera provider.
530 // Currently logical multi-camera is not supported for hot-plug camera.
531 // And we use this list to keep track of initial public camera IDs
532 // advertised by the provider, and to distinguish against "hidden"
533 // physical camera IDs.
534 std::vector<std::string> mProviderPublicCameraIds;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800535
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800536 // HALv3-specific camera fields, including the actual device interface
537 struct DeviceInfo3 : public DeviceInfo {
538 typedef hardware::camera::device::V3_2::ICameraDevice InterfaceT;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800539
540 virtual status_t setTorchMode(bool enabled) override;
541 virtual status_t getCameraInfo(hardware::CameraInfo *info) const override;
Emilian Peevf53f66e2017-04-11 14:29:43 +0100542 virtual bool isAPI1Compatible() const override;
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700543 virtual status_t dumpState(int fd) override;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800544 virtual status_t getCameraCharacteristics(
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700545 bool overrideForPerfClass,
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800546 CameraMetadata *characteristics) const override;
Shuzhen Wangf9d2c022018-08-21 12:07:35 -0700547 virtual status_t getPhysicalCameraCharacteristics(const std::string& physicalCameraId,
548 CameraMetadata *characteristics) const override;
Emilian Peev35ae8262018-11-08 13:11:32 +0000549 virtual status_t isSessionConfigurationSupported(
Shuzhen Wang83bff122020-11-20 15:51:39 -0800550 const hardware::camera::device::V3_7::StreamConfiguration &configuration,
Emilian Peev35ae8262018-11-08 13:11:32 +0000551 bool *status /*out*/)
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700552 override;
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700553 virtual status_t filterSmallJpegSizes() override;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800554
Emilian Peev71c73a22017-03-21 16:35:51 +0000555 DeviceInfo3(const std::string& name, const metadata_vendor_id_t tagId,
556 const std::string &id, uint16_t minorVersion,
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800557 const hardware::camera::common::V1_0::CameraResourceCost& resourceCost,
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700558 sp<ProviderInfo> parentProvider,
Shuzhen Wangf9d2c022018-08-21 12:07:35 -0700559 const std::vector<std::string>& publicCameraIds, sp<InterfaceT> interface);
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800560 virtual ~DeviceInfo3();
561 private:
562 CameraMetadata mCameraCharacteristics;
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700563 // A copy of mCameraCharacteristics without performance class
564 // override
565 std::unique_ptr<CameraMetadata> mCameraCharNoPCOverride;
Shuzhen Wangf9d2c022018-08-21 12:07:35 -0700566 std::unordered_map<std::string, CameraMetadata> mPhysicalCameraCharacteristics;
Shuzhen Wang03d8cc12018-09-12 14:17:09 -0700567 void queryPhysicalCameraIds();
Jayant Chowdhary5216b212019-07-17 09:26:23 -0700568 SystemCameraKind getSystemCameraKind();
Shuzhen Wang268a1362018-10-16 16:32:59 -0700569 status_t fixupMonochromeTags();
Jayant Chowdhary13f9b2f2020-12-02 22:46:15 -0800570 status_t addDynamicDepthTags(bool maxResolution = false);
571 status_t deriveHeicTags(bool maxResolution = false);
Eino-Ville Talvalaf2e37092020-01-07 15:32:32 -0800572 status_t addRotateCropTags();
Shuzhen Wang9bf8a6f2020-05-01 09:49:04 -0700573 status_t addPreCorrectionActiveArraySize();
Eino-Ville Talvalaf2e37092020-01-07 15:32:32 -0800574
Emilian Peev4c6d2b52019-01-04 17:13:56 +0000575 static void getSupportedSizes(const CameraMetadata& ch, uint32_t tag,
576 android_pixel_format_t format,
577 std::vector<std::tuple<size_t, size_t>> *sizes /*out*/);
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700578 static void getSupportedDurations( const CameraMetadata& ch, uint32_t tag,
Emilian Peev4c6d2b52019-01-04 17:13:56 +0000579 android_pixel_format_t format,
580 const std::vector<std::tuple<size_t, size_t>>& sizes,
581 std::vector<int64_t> *durations/*out*/);
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700582 static void getSupportedDynamicDepthDurations(
583 const std::vector<int64_t>& depthDurations,
Emilian Peev4c6d2b52019-01-04 17:13:56 +0000584 const std::vector<int64_t>& blobDurations,
585 std::vector<int64_t> *dynamicDepthDurations /*out*/);
586 static void getSupportedDynamicDepthSizes(
587 const std::vector<std::tuple<size_t, size_t>>& blobSizes,
588 const std::vector<std::tuple<size_t, size_t>>& depthSizes,
589 std::vector<std::tuple<size_t, size_t>> *dynamicDepthSizes /*out*/,
590 std::vector<std::tuple<size_t, size_t>> *internalDepthSizes /*out*/);
Shuzhen Wang268a1362018-10-16 16:32:59 -0700591 status_t removeAvailableKeys(CameraMetadata& c, const std::vector<uint32_t>& keys,
592 uint32_t keyTag);
Shuzhen Wang68ac7ad2019-01-30 14:03:28 -0800593 status_t fillHeicStreamCombinations(std::vector<int32_t>* outputs,
594 std::vector<int64_t>* durations,
595 std::vector<int64_t>* stallDurations,
596 const camera_metadata_entry& halStreamConfigs,
597 const camera_metadata_entry& halStreamDurations);
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800598 };
599
Eino-Ville Talvala0b1cb142016-12-19 16:29:17 -0800600 private:
601 std::string mType;
602 uint32_t mId;
603
Eino-Ville Talvala8d942f92017-03-13 10:09:51 -0700604 std::mutex mLock;
605
Eino-Ville Talvala0b1cb142016-12-19 16:29:17 -0800606 CameraProviderManager *mManager;
607
Shuzhen Wang394ad702020-07-23 13:01:54 -0700608 struct CameraStatusInfoT {
609 bool isPhysicalCameraStatus = false;
610 hardware::hidl_string cameraId;
611 hardware::hidl_string physicalCameraId;
612 hardware::camera::common::V1_0::CameraDeviceStatus status;
613 CameraStatusInfoT(bool isForPhysicalCamera, const hardware::hidl_string& id,
614 const hardware::hidl_string& physicalId,
615 hardware::camera::common::V1_0::CameraDeviceStatus s) :
616 isPhysicalCameraStatus(isForPhysicalCamera), cameraId(id),
617 physicalCameraId(physicalId), status(s) {}
618 };
619
620 // Lock to synchronize between initialize() and camera status callbacks
621 std::mutex mInitLock;
Yin-Chia Yehc3e9d6f2018-02-06 10:56:32 -0800622 bool mInitialized = false;
Shuzhen Wang394ad702020-07-23 13:01:54 -0700623 std::vector<CameraStatusInfoT> mCachedStatus;
624 // End of scope for mInitLock
625
626 std::future<void> mInitialStatusCallbackFuture;
627 void notifyInitialStatusChange(sp<StatusListener> listener,
628 std::unique_ptr<std::vector<CameraStatusInfoT>> cachedStatus);
Yin-Chia Yehc3e9d6f2018-02-06 10:56:32 -0800629
Jayant Chowdharycbe770a2020-02-14 11:14:46 -0800630 std::vector<std::unordered_set<std::string>> mConcurrentCameraIdCombinations;
631
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800632 // Templated method to instantiate the right kind of DeviceInfo and call the
633 // right CameraProvider getCameraDeviceInterface_* method.
634 template<class DeviceInfoT>
635 std::unique_ptr<DeviceInfo> initializeDeviceInfo(const std::string &name,
Emilian Peev71c73a22017-03-21 16:35:51 +0000636 const metadata_vendor_id_t tagId, const std::string &id,
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700637 uint16_t minorVersion);
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800638
639 // Helper for initializeDeviceInfo to use the right CameraProvider get method.
640 template<class InterfaceT>
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700641 sp<InterfaceT> startDeviceInterface(const std::string &name);
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800642
643 // Parse provider instance name for type and id
644 static status_t parseProviderName(const std::string& name,
645 std::string *type, uint32_t *id);
646
647 // Parse device instance name for device version, type, and id.
648 static status_t parseDeviceName(const std::string& name,
649 uint16_t *major, uint16_t *minor, std::string *type, std::string *id);
Emilian Peev71c73a22017-03-21 16:35:51 +0000650
651 // Generate vendor tag id
652 static metadata_vendor_id_t generateVendorTagId(const std::string &name);
Guennadi Liakhovetski6034bf52017-12-07 10:28:29 +0100653
654 void removeDevice(std::string id);
Jayant Chowdharycbe770a2020-02-14 11:14:46 -0800655
656 // Expects to have mLock locked
657 status_t reCacheConcurrentStreamingCameraIdsLocked();
658 // Expects to have mLock locked
Jayant Chowdharycad23c22020-03-10 15:04:59 -0700659 status_t getConcurrentCameraIdsInternalLocked(
Jayant Chowdharycbe770a2020-02-14 11:14:46 -0800660 sp<hardware::camera::provider::V2_6::ICameraProvider> &interface2_6);
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800661 };
662
Emilian Peev7fe6c422021-09-08 13:43:20 -0700663 /**
664 * Save the ICameraProvider while it is being used by a camera or torch client
665 */
666 void saveRef(DeviceMode usageType, const std::string &cameraId,
667 sp<hardware::camera::provider::V2_4::ICameraProvider> provider);
668
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800669 // Utility to find a DeviceInfo by ID; pointer is only valid while mInterfaceMutex is held
670 // and the calling code doesn't mutate the list of providers or their lists of devices.
Eino-Ville Talvala0b1cb142016-12-19 16:29:17 -0800671 // Finds the first device of the given ID that falls within the requested version range
672 // minVersion <= deviceVersion < maxVersion
673 // No guarantees on the order of traversal
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800674 ProviderInfo::DeviceInfo* findDeviceInfoLocked(const std::string& id,
Eino-Ville Talvala0b1cb142016-12-19 16:29:17 -0800675 hardware::hidl_version minVersion = hardware::hidl_version{0,0},
676 hardware::hidl_version maxVersion = hardware::hidl_version{1000,0}) const;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800677
Emilian Peevc93cac22020-08-17 16:00:10 -0700678 status_t addProviderLocked(const std::string& newProvider, bool preexisting = false);
679
680 status_t tryToInitializeProviderLocked(const std::string& providerName,
681 const sp<ProviderInfo>& providerInfo);
Eino-Ville Talvala8d942f92017-03-13 10:09:51 -0700682
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800683 bool isLogicalCameraLocked(const std::string& id, std::vector<std::string>* physicalCameraIds);
684
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800685 status_t removeProvider(const std::string& provider);
Eino-Ville Talvala8d942f92017-03-13 10:09:51 -0700686 sp<StatusListener> getStatusListener() const;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800687
688 bool isValidDeviceLocked(const std::string &id, uint16_t majorVersion) const;
689
Emilian Peevc93cac22020-08-17 16:00:10 -0700690 size_t mProviderInstanceId = 0;
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800691 std::vector<sp<ProviderInfo>> mProviders;
692
Peter Kalauskasa29c1352018-10-10 12:05:42 -0700693 void addProviderToMap(
694 const std::string &cameraId,
695 sp<hardware::camera::provider::V2_4::ICameraProvider> provider,
696 bool isTorchUsage);
697 void removeCameraIdFromMap(
698 std::unordered_map<std::string, sp<hardware::camera::provider::V2_4::ICameraProvider>> &map,
699 const std::string &cameraId);
700
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800701 static const char* deviceStatusToString(
702 const hardware::camera::common::V1_0::CameraDeviceStatus&);
703 static const char* torchStatusToString(
704 const hardware::camera::common::V1_0::TorchModeStatus&);
705
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700706 status_t getCameraCharacteristicsLocked(const std::string &id, bool overrideForPerfClass,
Shuzhen Wange8aceb52018-05-21 12:00:56 -0700707 CameraMetadata* characteristics) const;
708 void filterLogicalCameraIdsLocked(std::vector<std::string>& deviceIds) const;
Jayant Chowdhary847947d2019-08-30 18:02:59 -0700709
Jayant Chowdhary33e8ef82019-09-27 09:20:42 -0700710 status_t getSystemCameraKindLocked(const std::string& id, SystemCameraKind *kind) const;
711 std::pair<bool, ProviderInfo::DeviceInfo *> isHiddenPhysicalCameraInternal(const std::string& cameraId) const;
Jayant Chowdhary847947d2019-08-30 18:02:59 -0700712
713 void collectDeviceIdsLocked(const std::vector<std::string> deviceIds,
714 std::vector<std::string>& normalDeviceIds,
715 std::vector<std::string>& systemCameraDeviceIds) const;
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800716
717 status_t convertToHALStreamCombinationAndCameraIdsLocked(
718 const std::vector<hardware::camera2::utils::CameraIdAndSessionConfiguration>
719 &cameraIdsAndSessionConfigs,
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700720 const std::set<std::string>& perfClassPrimaryCameraIds,
721 int targetSdkVersion,
Shuzhen Wang83bff122020-11-20 15:51:39 -0800722 hardware::hidl_vec<hardware::camera::provider::V2_7::CameraIdAndStreamCombination>
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800723 *halCameraIdsAndStreamCombinations,
724 bool *earlyExit);
Eino-Ville Talvala2f09bac2016-12-13 11:29:54 -0800725};
726
727} // namespace android
728
729#endif