packages
packages copied to clipboard
[camera_avfoundation] Adds support for discovering external camera devices on iOS 17 onwards.
This PR adds support for discovering external cameras in iOS devices with USB-C i.e. iPad.
This should address https://github.com/flutter/flutter/issues/130073
Pre-launch Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
- [x] I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use
dart format.) - [x] I signed the CLA.
- [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g.
[shared_preferences] - [x] I listed at least one issue that this PR fixes in the description above.
- [x] I updated
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes. - [x] I updated
CHANGELOG.mdto add a description of the change, following repository CHANGELOG style. - [x] I updated/added relevant documentation (doc comments with
///). - [x] I added new tests to check the change I am making, or this PR is test-exempt.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).
If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?
Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.
I was having trouble getting the changelog command working throwing
ProcessException: fatal: Not a valid object name upstream\main
Command: git merge-base upstream\main HEAD
any insight would be helpful, then I can resolve some of the failing checks
The error thrown by XCode says that Use of undeclared identifier 'AVCaptureDeviceTypeExternal' but this is known to be a correct identifer tested on XCode 15 and the package builds and runs correctly when run using XCode 15.2
I was having trouble getting the changelog command working throwing
ProcessException: fatal: Not a valid object name upstream\main Command: git merge-base upstream\main HEADany insight would be helpful, then I can resolve some of the failing checks
See https://github.com/flutter/packages/blob/main/script/tool/README.md#update-changelog-and-version, in particular the last paragraph. If you use a different repo setup than our docs recommend, then you need to modify commands that reference repositories and branches accordingly.
but this is known to be a correct identifer tested on XCode 15
Our CI currently uses Xcode 14; updating is still an ongoing project.
I guess the PR is blocked until the CI is updated to xcode 15?
Landing it is blocked on https://github.com/flutter/flutter/issues/132237, but it can be reviewed in the meantime.
@bibaswan-bhawal The change makes sense. Does external camera work after this change? (e.g. preview, taking picture/video, etc)
Yes they do
@stuartmorgan does your comment from the other PR (https://github.com/flutter/packages/pull/5957#issuecomment-1906818335) also apply to this PR?
@stuartmorgan does your comment from the other PR (#5957 (comment)) also apply to this PR?
In theory yes; I realized after writing that though that this specific case is probably not something we need to block on. camera_windows already has this problem, and in some cases Android as well (we don't discover external cameras, but on some Android devices apparently external cameras that are plugged in when the device boots are reported as non-external, and thus are discovered). So on some platforms we already have the problem that if someone removes a camera while using a Flutter app, the app probably doesn't have a good way to gracefully handle that. And it's a pretty niche case; I think most people are probably not going to remove cameras they are actively using most of the time.
So I'll file an issue about the need to add API to get notifications about camera availability changes, but I'm okay not blocking this specific change on that.
So I'll file an issue about the need to add API to get notifications about camera availability changes
https://github.com/flutter/flutter/issues/142239
Fixed all broken tests
@bibaswan-bhawal Is this ready for re-review?
@bibaswan-bhawal Please mark as ready for review when you'd like it to be re-reviewed.
Since this is marked as a draft and hasn't been updated in several months I'm going to close it to clean out our review queue. Please don't hesitate to submit a new PR if you decide to revisit this. Thanks!