Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g commented Nov 7, 2025

The Windows camera example was showing usage of maxVideoDuration, but the parameter is deprecated and ignored, so shouldn't be part of the example.

Also makes a minor improvement to type safety of some code interacting with Pigeon, since the Pigeon definition had already been changed to non-nullable.

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

The Windows camera example was showing usage of `maxVideoDuration`, but
the parameter is deprecated and ignored, so shouldn't be part of the
example.
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

return cameras.map((String cameraName) {
return CameraDescription(
// This type is only nullable due to Pigeon limitations, see
// https://github.com/flutter/flutter/issues/97848. The native code
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was fixed a while ago, I just missed updating this when I updated the Pigeon file.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the usage of the deprecated maxVideoDuration parameter from the Windows camera example. The changes include removing the timed recording logic, the associated state variable _recordingTimed, and the corresponding UI elements. This simplifies the example code significantly. Additionally, a minor cleanup in camera_windows.dart removes unnecessary null-safety checks for camera names, aligning with updated Pigeon-generated code. The changes are correct and improve the example's clarity.

}

Future<void> _toggleRecord() async {
if (_initialized && _cameraId > 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The check _cameraId > 0 seems incorrect. Camera IDs are non-negative integers, so camera ID 0 is valid. This check prevents video recording on the first available camera. It should probably be _cameraId >= 0.

Suggested change
if (_initialized && _cameraId > 0) {
if (_initialized && _cameraId >= 0) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant