packages
packages copied to clipboard
[camera] add video stabilization
Adds support for video stabilization to camera_platform_interface, camera_avfoundation, camera_android_camerax and camera packages.
The video stabilization modes are defined in the new VideoStabilizationMode enum defined in camera_platform_interface:
/// The possible video stabilization modes that can be capturing video.
enum VideoStabilizationMode {
/// Video stabilization is disabled.
off,
/// Basic video stabilization is enabled.
/// Maps to CONTROL_VIDEO_STABILIZATION_MODE_ON on Android
/// and throws CameraException on iOS.
on,
/// Standard video stabilization is enabled.
/// Maps to CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION on Android
/// (camera_android_camerax) and to AVCaptureVideoStabilizationModeStandard
/// on iOS.
standard,
/// Cinematic video stabilization is enabled.
/// Maps to CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION on Android
/// (camera_android_camerax) and to AVCaptureVideoStabilizationModeCinematic
/// on iOS.
cinematic,
/// Extended cinematic video stabilization is enabled.
/// Maps to AVCaptureVideoStabilizationModeCinematicExtended on iOS and
/// throws CameraException on Android.
cinematicExtended,
}
There is some subjectivity on the way with which I mapped the modes to both platforms, and here's a document that compares the several modes: https://docs.google.com/spreadsheets/d/1TLOLZHR5AcyPlr-y75aN-DbR0ssZLJjpV_OAJkRC1FI/edit?usp=sharing, which you can comment on.
List which issues are fixed by this PR. You must list at least one issue. Partially implements https://github.com/flutter/flutter/issues/89525
Pre-launch Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene 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 linked to at least one issue that this PR fixes in the description above.
- [x] I updated
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes. - [x] I updated
CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes. - [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.