Requests exclusive access to the device’s hardware properties.
Mac Catalyst 13.0+
On input, specify a pointer to an error object. If a lock cannot be acquired, this pointer contains an NSError object that describes the problem. You may specify nil for this property.
YES if a lock was acquired or NO if it was not.
You must call this method before attempting to configure the hardware related properties of the device. This method returns YES when it successfully locks the device for configuration by your code. After configuring the device properties, call unlockForConfiguration to release the configuration lock and allow other apps to make changes.
You may hold onto a lock (instead of releasing it) if you require the device properties to remain unchanged. However, holding the device lock unnecessarily may degrade capture quality in other apps sharing the device.