commit | 4c4bb46d9dd882c180d012c62524bbb9c2b9cc3a | [log] [tgz] |
---|---|---|
author | Andrew Coutts <andrewjohncoutts@gmail.com> | Wed May 03 14:51:04 2023 -0400 |
committer | GitHub <noreply@github.com> | Wed May 03 18:51:04 2023 +0000 |
tree | 0d5686df5cfe6fd7a0f7b738007ce0139b0b2f7b | |
parent | 3fcf67195f6987d8b24baf3ccc9a16af8355d314 [diff] |
[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.
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: