Added method to request a specific camera unique identifier.#37
Added method to request a specific camera unique identifier.#37dsmurfin wants to merge 1 commit intoMetalPetal:masterfrom
Conversation
I agree. I was attempting to resolve this feature in a way that did not break existing implementations. An enum would be a better solution here. It might be desirable to provide a fallback option: enum DeviceSelection {
case .position(position: Position)
case .device(uniqueID: String)
case .device(uniqueID: String, format: AVCaptureDevice.Format)
case .device(uniqueID: String, fallback: Position)
case .device(uniqueID: String, format: AVCaptureDevice.Format, fallback: Position)
} |
This is a little confusing:
The no-fallback approach seems to be clearer and simpler. If there's an error switching to a requested device, we can catch that error and decide whether we should fallback to another device or directly present that error to our user. How about this: Just add a If you don't care about a particular device you can still use If you need to switch to a particular device you can use try camera.switchToVideoCaptureDevice(device)
try device.lockForConfiguration()
device.activeFormat = ...
device.unlockForConfiguration()This maintains the simple interface for common use and exposes a way for capture device customization. |
This makes more sense, it also removes the need for the I am a bit tight for time over the next few days, but I will look to rework some of these PRs over the next week or so as per our discussions. |
|
Amazing, thanks! Yes, I will do that over the weekend if not before. |
No description provided.