[camera] Implement video capture for CameraX android camera re-write
This PR implements video capture for the CameraX re-write of the android camera plugin.
https://github.com/flutter/flutter/issues/111138
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.
- [ ] 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.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
before continuing my pass I need the cla to be figured out.
Heads up that I have created a new version of this pr with commits up to this point squashed to fix the CLA issue @reidbaker pointed out. Leaving this open temporarily while the outstanding comments are unresolved.
https://github.com/flutter/packages/pull/3899
Merging currently blocked due to a test failure that I believe is unrelated and should be resolved by https://github.com/flutter/packages/pull/3947
To make reviewing easier (because this has been updated a lot), since your last review @reidbaker the summary of changes is:
- Added logic in startVideoRecording to explicitly do nothing if recording is not null (there is an active recording).
- Added a test for this case where we call startVideoRecording twice, and verify the methods we expect to be called only once are indeed called only once (covering the above case).
- Made a change to the stopVideoRecording error case where the videoOutputPath is null so that we clean up the recording objects (stop the recording, set recording and pendingRecording to null) because we can't recover from this case without starting a new recording as videoOutputPath is set in the startVideoRecording. This way change (1) doesn't get us stuck forever in the null videoOutputPath case.
- Added a test to cover the above.
Merging manually to unblock https://github.com/flutter/packages/pull/3878