Skip to content

Commit 7c8f784

Browse files
* 'main' of https://github.com/CaoGiaHieu-dev/packages: Update packages/go_router/CHANGELOG.md [tool] Remove use of FETCH_HEAD (flutter#10357) Roll Flutter from 027f2e410241 to e5d5c01850f2 (73 revisions) (flutter#10362) [camera_platform_interface] Adds support for video stabilization to camera_platform_interface (flutter#10337) [google_maps_flutter] Raise `MapUsedAfterWidgetDisposedError` when map controller used after map disposed (flutter#9242) [pigeon] Replace containsKey with contains in Kotlin generator (flutter#10274) [video_player] Remove `package` in example `AndroidManifest.xml` file (flutter#10245) [flutter_svg] Fixes typo of `allowDrawingOutsideViewBox` in doc comments. (flutter#10256) [in_app_purchase] Remove use of Pigeon's Dart test generator (flutter#10328) [dependabot]: Bump com.squareup.okhttp3:okhttp from 5.1.0 to 5.3.0 in /packages/espresso/android (flutter#10348) Roll Flutter from 6f8abdd77820 to 027f2e410241 (26 revisions) (flutter#10335) [google_sign_in] Remove use of OCMock (flutter#10290) [interactive_media_ads] Pin iOS dependency maximum (flutter#10349)
2 parents e9dff98 + 5d5a2b2 commit 7c8f784

File tree

73 files changed

+1411
-1794
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1411
-1794
lines changed

.ci/flutter_master.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6f8abdd77820aeb15bca424dd53ad0bf9ef222aa
1+
e5d5c01850f2d33106f00a19017682f09e83e48b

.ci/scripts/prepare_tool.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
# found in the LICENSE file.
55
set -e
66

7-
# To set FETCH_HEAD for "git merge-base" to work
7+
# Ensure that 'main' is present for diffing.
88
git fetch origin main
9+
git branch main origin/main
910

1011
cd script/tool
1112
dart pub get

packages/camera/camera_platform_interface/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ Anton Borries <[email protected]>
6565
6666
Rahul Raj <[email protected]>
6767
Mairramer <[email protected]>
68+
Rui Craveiro <[email protected]>

packages/camera/camera_platform_interface/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.12.0
2+
3+
* Adds support for video stabilization.
4+
15
## 2.11.0
26

37
* Adds a flag to configure a recording to be persistent across camera changes. See

packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,34 @@ abstract class CameraPlatform extends PlatformInterface {
281281
throw UnimplementedError('setZoomLevel() is not implemented.');
282282
}
283283

284+
/// Gets a list of video stabilization modes that are supported for the selected camera.
285+
Future<Iterable<VideoStabilizationMode>> getSupportedVideoStabilizationModes(
286+
int cameraId,
287+
) => Future<List<VideoStabilizationMode>>.value(<VideoStabilizationMode>[]);
288+
289+
/// Sets the video stabilization mode for the selected camera.
290+
Future<void> setVideoStabilizationMode(
291+
int cameraId,
292+
VideoStabilizationMode mode,
293+
) {
294+
throw UnimplementedError('setVideoStabilizationMode() is not implemented.');
295+
}
296+
297+
/// Gets the fallback mode of video stabilization [mode].
298+
///
299+
/// This method returns the video stabilization mode that [setVideoStabilizationMode]
300+
/// should set when the device does not support the given [mode].
301+
static VideoStabilizationMode? getFallbackVideoStabilizationMode(
302+
VideoStabilizationMode mode,
303+
) {
304+
return switch (mode) {
305+
VideoStabilizationMode.off => null,
306+
VideoStabilizationMode.level1 => VideoStabilizationMode.off,
307+
VideoStabilizationMode.level2 => VideoStabilizationMode.level1,
308+
VideoStabilizationMode.level3 => VideoStabilizationMode.level2,
309+
};
310+
}
311+
284312
/// Pause the active preview on the current frame for the selected camera.
285313
Future<void> pausePreview(int cameraId) {
286314
throw UnimplementedError('pausePreview() is not implemented.');

packages/camera/camera_platform_interface/lib/src/types/types.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ export 'image_format_group.dart';
1313
export 'media_settings.dart';
1414
export 'resolution_preset.dart';
1515
export 'video_capture_options.dart';
16+
export 'video_stabilization_mode.dart';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2013 The Flutter Authors
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
/// The possible video stabilization modes that can be capturing video.
6+
enum VideoStabilizationMode {
7+
/// Video stabilization is disabled.
8+
off,
9+
10+
/// Least stabilized video stabilization mode with the least latency.
11+
level1,
12+
13+
/// More stabilized video with more latency.
14+
level2,
15+
16+
/// Most stabilized video with the most latency.
17+
level3,
18+
}

packages/camera/camera_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/camera/camera
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
55
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7-
version: 2.11.0
7+
version: 2.12.0
88

99
environment:
1010
sdk: ^3.7.0

packages/camera/camera_platform_interface/test/camera_platform_interface_test.dart

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,48 @@ void main() {
531531
expect(cameraPlatform.supportsImageStreaming(), false);
532532
},
533533
);
534+
535+
test(
536+
'getFallbackVideoStabilizationMode returns level2 for mode level3',
537+
() {
538+
final VideoStabilizationMode? fallbackMode =
539+
CameraPlatform.getFallbackVideoStabilizationMode(
540+
VideoStabilizationMode.level3,
541+
);
542+
543+
expect(fallbackMode, VideoStabilizationMode.level2);
544+
},
545+
);
546+
547+
test(
548+
'getFallbackVideoStabilizationMode returns level1 for mode level2',
549+
() {
550+
final VideoStabilizationMode? fallbackMode =
551+
CameraPlatform.getFallbackVideoStabilizationMode(
552+
VideoStabilizationMode.level2,
553+
);
554+
555+
expect(fallbackMode, VideoStabilizationMode.level1);
556+
},
557+
);
558+
559+
test('getFallbackVideoStabilizationMode returns off for mode level1', () {
560+
final VideoStabilizationMode? fallbackMode =
561+
CameraPlatform.getFallbackVideoStabilizationMode(
562+
VideoStabilizationMode.level1,
563+
);
564+
565+
expect(fallbackMode, VideoStabilizationMode.off);
566+
});
567+
568+
test('getFallbackVideoStabilizationMode returns null for mode off', () {
569+
final VideoStabilizationMode? fallbackMode =
570+
CameraPlatform.getFallbackVideoStabilizationMode(
571+
VideoStabilizationMode.off,
572+
);
573+
574+
expect(fallbackMode, null);
575+
});
534576
});
535577

536578
group('exports', () {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2013 The Flutter Authors
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:camera_platform_interface/src/types/video_stabilization_mode.dart';
6+
import 'package:flutter_test/flutter_test.dart';
7+
8+
void main() {
9+
test('VideoStabilizationMode should contain 4 options', () {
10+
const List<VideoStabilizationMode> values = VideoStabilizationMode.values;
11+
12+
expect(values.length, 4);
13+
});
14+
15+
test('VideoStabilizationMode enum should have items in correct index', () {
16+
const List<VideoStabilizationMode> values = VideoStabilizationMode.values;
17+
18+
expect(values[0], VideoStabilizationMode.off);
19+
expect(values[1], VideoStabilizationMode.level1);
20+
expect(values[2], VideoStabilizationMode.level2);
21+
expect(values[3], VideoStabilizationMode.level3);
22+
});
23+
}

0 commit comments

Comments
 (0)