Skip to content
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

[camerax] Fix _getResolutionSelectorFromPreset NPE #5287

Merged
merged 49 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
dec3d69
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 May 1, 2023
0e0333b
Merge remote-tracking branch 'upstream/main'
camsim99 May 2, 2023
bd7ac99
Merge remote-tracking branch 'upstream/main'
camsim99 May 3, 2023
5c3363b
Merge remote-tracking branch 'upstream/main'
camsim99 May 10, 2023
fed9621
Undo changes
camsim99 May 10, 2023
5aabe34
Merge remote-tracking branch 'upstream/main'
camsim99 May 12, 2023
2b9a352
Merge remote-tracking branch 'upstream/main'
camsim99 May 25, 2023
a1173da
Merge remote-tracking branch 'upstream/main'
camsim99 May 30, 2023
cbc3d6b
Merge remote-tracking branch 'upstream/main'
camsim99 May 30, 2023
cae5a4c
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 1, 2023
72283db
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 5, 2023
166a77c
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 5, 2023
399780e
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 14, 2023
8d5d0e7
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 26, 2023
084d960
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 12, 2023
d2a59ac
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 17, 2023
a1422bf
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 17, 2023
bdd87a6
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 18, 2023
137a28b
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 19, 2023
bc0db5a
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 20, 2023
d04b466
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 21, 2023
a9cfe87
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 24, 2023
a32def1
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 2, 2023
4785148
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 14, 2023
7a8fc69
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 15, 2023
b02e15f
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 15, 2023
c6e5868
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 17, 2023
0c0065a
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 28, 2023
9dfe259
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 29, 2023
bfcc0df
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 30, 2023
b80cc86
Merge remote-tracking branch 'upstream/main'
camsim99 Sep 5, 2023
4663838
Merge remote-tracking branch 'upstream/main'
camsim99 Sep 13, 2023
33fe515
Merge remote-tracking branch 'upstream/main'
camsim99 Sep 21, 2023
0c34fb6
Merge remote-tracking branch 'upstream/main'
camsim99 Sep 26, 2023
b4b6347
Merge remote-tracking branch 'upstream/main'
camsim99 Sep 28, 2023
ea4387d
Merge remote-tracking branch 'upstream/main'
camsim99 Oct 9, 2023
5c22eb8
Merge remote-tracking branch 'upstream/main'
camsim99 Oct 10, 2023
49b4743
Merge remote-tracking branch 'upstream/main'
camsim99 Oct 24, 2023
87d1382
Merge remote-tracking branch 'upstream/main'
camsim99 Oct 25, 2023
4ba04e0
Merge remote-tracking branch 'upstream/main'
camsim99 Oct 25, 2023
dc8e8f3
Merge remote-tracking branch 'upstream/main'
camsim99 Oct 26, 2023
3affd3a
Merge remote-tracking branch 'upstream/main'
camsim99 Oct 27, 2023
cf4b868
Merge remote-tracking branch 'upstream/main'
camsim99 Oct 30, 2023
4275f62
Merge remote-tracking branch 'upstream/main'
camsim99 Oct 31, 2023
672b683
Fix bug
camsim99 Oct 31, 2023
861b75f
Bump version
camsim99 Oct 31, 2023
6bf6d3b
Remove typo
camsim99 Nov 1, 2023
bb074c2
refactor
camsim99 Nov 2, 2023
1d5722a
refactor for consistency
camsim99 Nov 2, 2023
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_android_camerax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.0+22

* Fixes `_getResolutionSelectorFromPreset` null pointer error.

## 0.5.0+21

* Changes fallback resolution strategies for camera use cases to look for a higher resolution if neither the desired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,28 +880,30 @@ class AndroidCameraCameraX extends CameraPlatform {
break;
case ResolutionPreset.max:
// Automatically set strategy to choose highest available.
resolutionStrategy = _shouldCreateDetachedObjectForTesting
? ResolutionStrategy.detachedHighestAvailableStrategy()
: ResolutionStrategy.highestAvailableStrategy();
break;
if (_shouldCreateDetachedObjectForTesting) {
resolutionStrategy =
ResolutionStrategy.detachedHighestAvailableStrategy();
return ResolutionSelector.detached(
resolutionStrategy: resolutionStrategy);
}
resolutionStrategy = ResolutionStrategy.highestAvailableStrategy();
return ResolutionSelector(resolutionStrategy: resolutionStrategy);
case null:
// If no preset is specified, default to CameraX's default behavior
// for each UseCase.
return null;
}

if (_shouldCreateDetachedObjectForTesting) {
resolutionStrategy ??= ResolutionStrategy.detached(
resolutionStrategy = ResolutionStrategy.detached(
boundSize: boundSize, fallbackRule: fallbackRule);
return ResolutionSelector.detached(
resolutionStrategy: resolutionStrategy);
}

resolutionStrategy ??=
ResolutionStrategy(boundSize: boundSize!, fallbackRule: fallbackRule);
return ResolutionSelector(
resolutionStrategy: ResolutionStrategy(
boundSize: boundSize!, fallbackRule: fallbackRule));
resolutionStrategy =
ResolutionStrategy(boundSize: boundSize, fallbackRule: fallbackRule);
return ResolutionSelector(resolutionStrategy: resolutionStrategy);
}

/// Returns the [QualitySelector] that maps to the specified resolution
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android_camerax/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_android_camerax
description: Android implementation of the camera plugin using the CameraX library.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.5.0+21
version: 0.5.0+22

environment:
sdk: ">=2.19.0 <4.0.0"
Expand Down