Skip to content

[camera_platform_interface] Add API support query for image streaming #8307

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
3 changes: 2 additions & 1 deletion packages/camera/camera_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 2.9.0

* Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.
* Adds API support query for image streaming.

## 2.8.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ abstract class CameraPlatform extends PlatformInterface {
throw UnimplementedError('resumeVideoRecording() is not implemented.');
}

/// Check whether this platform supports image streaming via [onStreamedFrameAvailable].
bool supportsImageStreaming() => false;

/// A new streamed frame is available.
///
/// Listening to this stream will start streaming, and canceling will stop.
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/camera/camera
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.8.0
version: 2.9.0

environment:
sdk: ^3.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,19 @@ void main() {
throwsUnimplementedError,
);
});

test(
'Default implementation of supportsImageStreaming() should return false',
() {
// Arrange
final ExtendsCameraPlatform cameraPlatform = ExtendsCameraPlatform();

// Act & Assert
expect(
cameraPlatform.supportsImageStreaming(),
false,
);
});
});

group('exports', () {
Expand Down
Loading