Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 1aabcd6

Browse files
authored
[camera] Export VideoCaptureOptions so that implementers can use it (#6666)
* Export VideoCaptureOptions so that it is accessible to other packages Also added tests so that missing exports can be more easily tested in the future. * Fix dart analyze warnings
1 parent 283122b commit 1aabcd6

File tree

5 files changed

+52
-2
lines changed

5 files changed

+52
-2
lines changed

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.3.1
2+
3+
* Exports VideoCaptureOptions to allow dependencies to implement concurrent stream and record.
4+
15
## 2.3.0
26

37
* Adds new capture method for a camera to allow concurrent streaming and recording.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import 'package:plugin_platform_interface/plugin_platform_interface.dart';
1111

1212
import '../../camera_platform_interface.dart';
1313
import '../method_channel/method_channel_camera.dart';
14-
import '../types/video_capture_options.dart';
1514

1615
/// The interface that implementations of camera must implement.
1716
///

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ export 'flash_mode.dart';
1010
export 'focus_mode.dart';
1111
export 'image_format_group.dart';
1212
export 'resolution_preset.dart';
13+
export 'video_capture_options.dart';

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/plugins/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.3.0
7+
version: 2.3.1
88

99
environment:
1010
sdk: '>=2.12.0 <3.0.0'

packages/camera/camera_platform_interface/test/camera_platform_interface_test.dart

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,52 @@ void main() {
442442
);
443443
});
444444
});
445+
446+
group('exports', () {
447+
test('CameraDescription is exported', () {
448+
const CameraDescription(
449+
name: 'abc-123',
450+
sensorOrientation: 1,
451+
lensDirection: CameraLensDirection.external);
452+
});
453+
454+
test('CameraException is exported', () {
455+
CameraException('1', 'error');
456+
});
457+
458+
test('CameraImageData is exported', () {
459+
const CameraImageData(
460+
width: 1,
461+
height: 1,
462+
format: CameraImageFormat(ImageFormatGroup.bgra8888, raw: 1),
463+
planes: <CameraImagePlane>[],
464+
);
465+
});
466+
467+
test('ExposureMode is exported', () {
468+
// ignore: unnecessary_statements
469+
ExposureMode.auto;
470+
});
471+
472+
test('FlashMode is exported', () {
473+
// ignore: unnecessary_statements
474+
FlashMode.auto;
475+
});
476+
477+
test('FocusMode is exported', () {
478+
// ignore: unnecessary_statements
479+
FocusMode.auto;
480+
});
481+
482+
test('ResolutionPreset is exported', () {
483+
// ignore: unnecessary_statements
484+
ResolutionPreset.high;
485+
});
486+
487+
test('VideoCaptureOptions is exported', () {
488+
const VideoCaptureOptions(123);
489+
});
490+
});
445491
}
446492

447493
class ImplementsCameraPlatform implements CameraPlatform {

0 commit comments

Comments
 (0)