|Andrew Coutts <email@example.com>
|Wed May 03 14:51:04 2023 -0400
|Wed May 03 18:51:04 2023 +0000
[camera_platform_interface] [camera] [camera_android] Add NV21 as an image stream format (#3277) ### Note: this is a re-created PR from https://github.com/flutter/plugins/pull/6985 --- This PR adds NV21 as an image stream format for android devices. This is the format required for things like MLKit. Unfortunately a lot of people tend to implement the yuv->nv21 incorrectly in dart, which results in countless issues of users saying the image stream doesn't work, or that mlkit doesn't work. By allowing the plugin to send NV21 to dart, this will fix all of those yuv conversion issues. Highlights: - Added an abstraction aroundÂ `ImageReader`Â calledÂ `ImageStreamReader`Â and moved the image stream logic into this class to clean up theÂ `Camera`Â class. This allows us to test the image stream handler in isolation. - Added tests forÂ `ImageStreamReader`Â to make sure it only calls theÂ `removePlaneBufferPadding`Â function for planes that contain padding. - Added a new utility class calledÂ `ImageStreamReaderUtils`Â which contains the logic for trimming the padding. - Added tests forÂ `ImageStreamReaderUtils`Â to make sure it only removes padding when a given buffer contains padding to be removed. - There are tests to confirm both thatÂ `removePlaneBufferPadding`Â is only called when padding is present, and to confirm that ifÂ `removePlaneBufferPadding`Â does happen to be called with a buffer containing no padding, it still returns a valid buffer. *List which issues are fixed by this PR. You must list at least one issue.* - https://github.com/flutter/flutter/issues/118350 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
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.
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.
These are the packages hosted in this repository: