You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit de3c258
Browse filesBrowse the repository at this point in the historyBrowse files
iOS implementation of the zero-shutter-lag API added in
camera_platform_interface 2.14.0 (this bumps the constraint to
^2.14.0). Part of flutter/flutter#190598.
## What
- `isZeroShutterLagSupported` ->
[`AVCapturePhotoOutput.isZeroShutterLagSupported`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/iszeroshutterlagsupported)
(iOS 17+/macOS 14+; `false` on older versions)
- `setZeroShutterLagEnabled` ->
[`AVCapturePhotoOutput.isZeroShutterLagEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/iszeroshutterlagenabled)
## Why explicit control when iOS auto-enables it
Per the `AVCapturePhotoOutput.h` header, "For apps linked on or after
iOS 17 zero shutter lag is automatically enabled when supported." The
documented role of the setter is the explicit opt-out (WWDC23 session
10105: "you can set AVCapturePhotoOutput.isZeroShutterLagEnabled to
false to opt out" - https://developer.apple.com/videos/play/wwdc2023/10105/),
plus deterministic re-enable: support can be revoked by configuration
changes, and when it is, the enabled state silently reverts.
Because of that auto-enable, iOS 17+ starts with zero shutter lag on
while Android starts with it off, so the same Dart call is an opt-out
here and an opt-in there. No latency numbers are quoted for iOS: the
platform already enables the mode by default, so this change is about
making that state explicit and controllable, not about improving it.
<details><summary>Guard and configuration timing</summary>
The header states the property "may only be set to YES if
zeroShutterLagSupported is YES, otherwise an NSInvalidArgumentException
is thrown", and that changing it "requires a lengthy reconfiguration of
the capture render pipeline", to be done within
`beginConfiguration`/`commitConfiguration` while running. The
implementation guards enabling on the support query and wraps the write
in a configuration block. Availability is handled inside the
`CapturePhotoOutput` protocol passthrough (`flutter`-prefixed members,
matching the existing `CaptureDevice.flutterActiveFormat` pattern), so
callers need no availability checks and pre-iOS 17 devices report
unsupported / ignore writes.
</details>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copy file name to clipboardExpand all lines: packages/camera/camera_avfoundation/darwin/camera_avfoundation/Sources/camera_avfoundation/CameraPlugin.swift
Copy file name to clipboardExpand all lines: packages/camera/camera_avfoundation/darwin/camera_avfoundation/Sources/camera_avfoundation/CaptureOutput.swift
Copy file name to clipboardExpand all lines: packages/camera/camera_avfoundation/darwin/camera_avfoundation/Sources/camera_avfoundation/DefaultCamera.swift
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -858,6 +858,30 @@ final class DefaultCamera: NSObject, Camera {
0 commit comments