Skip to content

[camera] Fix crash when setting activeFormat on FLTCaptureDevice #8630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/camera/camera_avfoundation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.18+7

* Fixes crash when setting `activeFormat` on `FLTCaptureDevice`.

## 0.9.18+6

* Refactors implementations to remove remaining usage of OCMock in internal testing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ - (AVCaptureDevicePosition)position {
return wrappedFormats;
}

- (void)setActiveFormat:(AVCaptureDeviceFormat *)format {
self.device.activeFormat = format;
- (void)setActiveFormat:(NSObject<FLTCaptureDeviceFormat> *)format {
self.device.activeFormat = format.format;
}

// Flash/Torch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ NS_ASSUME_NONNULL_BEGIN
- (AVCaptureDevicePosition)position;

// Format/Configuration
- (NSObject<FLTCaptureDeviceFormat> *)activeFormat;
- (NSArray<NSObject<FLTCaptureDeviceFormat> *> *)formats;
- (void)setActiveFormat:(NSObject<FLTCaptureDeviceFormat> *)format;
@property(nonatomic, retain) NSObject<FLTCaptureDeviceFormat> *activeFormat;
@property(nonatomic, readonly) NSArray<NSObject<FLTCaptureDeviceFormat> *> *formats;

// Flash/Torch
- (BOOL)hasFlash;
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_avfoundation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_avfoundation
description: iOS implementation of the camera plugin.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_avfoundation
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.9.18+6
version: 0.9.18+7

environment:
sdk: ^3.4.0
Expand Down