[camera_avfoundation] Fixes crash when using ResolutionPreset.max with iPhone 17 (#11106) Fixes https://github.com/flutter/flutter/issues/175828 The iPhone 17 family's new camera supports a new pixel format, btp2, which is a lossy, compressed format. At 12MP+ resolutions, AVFoundation drops support for standard YUV/BGRA and strictly outputs this format (e.g., 1651798066 / btp2). The engine renderer expects raw pixels and crashes immediately when given this compressed format. (relevant engine issue: https://github.com/flutter/flutter/issues/182908) Separately, Centre Stage was introduced for iPhone 17 which is a square sensor. A side effect of this is when we request the highest non-btp resolutions, we previously selected based off total number of pixels. This meant that it was returning a wonky 4032x4032 square. I added a check to only return 4:3 resolutions that aren't square like it did previously, just to avoid previous implementations looking weird. ## Pre-Review Checklist
This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., packages developed by the core Flutter team). Check the packages directory to see all packages.
These packages are also available on pub.
Please file any issues, bugs, or feature requests in the main flutter repo. Issues pertaining to this repository are labeled “package”.
If you wish to contribute a new package to the Flutter ecosystem, please see the documentation for developing packages. You can store your package source code in any GitHub repository (the present repo is only intended for packages developed by the core Flutter team). Once your package is ready you can publish to the pub repository.
If you wish to contribute a change to any of the existing packages in this repo, please review our contribution guide, and send a pull request.
These are the packages hosted in this repository: