Repository navigation
[camera_windows] Fall back to a physical stream for cameras that reject preferred-stream selectors - #12748
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Windows camera implementation to resolve and use explicit source stream indices for preview, record, and photo capture, falling back to physical streams when preferred-stream selectors are rejected. This change addresses initialization failures on multi-stream USB cameras. The review feedback suggests modifying the stream resolution logic to prefer the first encountered video capture stream rather than the last.
|
@llfbandit Would you be able to rebase on |
| capture_controller = nullptr; | ||
| engine = nullptr; | ||
| camera = nullptr; | ||
| texture_registrar = nullptr; |
There was a problem hiding this comment.
Is any of this necessary? A unique_ptr will clean itself up when the scope exits
There was a problem hiding this comment.
Manual cleanup has been removed with test split.
| texture_registrar = nullptr; | ||
| } | ||
|
|
||
| TEST(CaptureController, StartPreviewFallsBackToPhysicalStreamWhenSelectorRejected) { |
There was a problem hiding this comment.
Could we write distinct tests that check each fallback to default path and the ultimate selection path here?
There was a problem hiding this comment.
Done, split into 8 tests with shared helper to keep them short as possible.
5be13d7 to
fbe0d29
Compare
|
autosubmit label was removed for flutter/packages/12748, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.
|
loic-sharma
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
flutter/packages@1383427...93baed9 2026-10-22 [email protected] [material_ui] Port flutter/flutter flutter#186777 MaterialColor test (flutter/packages#12858) 2026-10-21 [email protected] [rfw] Migrate to material_ui (flutter/packages#12811) 2026-10-21 [email protected] [cupertino_ui] Fix the installing command of the cupertino_ui package (flutter/packages#13141) 2026-10-21 [email protected] [cupertino_ui] Unskip web tests that pass on CanvasKit and Skwasm: date_picker_test, spell_check_suggestions_toolbar_test (flutter/packages#13367) 2026-10-21 [email protected] [video_player] Convert player classes to Swift (flutter/packages#13197) 2026-10-21 [email protected] [camera_windows] Fall back to a physical stream for cameras that reject preferred-stream selectors (flutter/packages#12748) 2026-10-21 [email protected] [google_sign_in_ios, video_player] Specify types for pattern variable declarations (flutter/packages#13362) 2026-10-21 [email protected] [google_maps_flutter_web] Issue 64073 implement my location (flutter/packages#12186) 2026-10-21 [email protected] [material_ui] Unskip web tests that pass on CanvasKit and Skwasm: app_bar_theme_test, input_decorator_test, paginated_data_table_test, spell_check_suggestions_toolbar_test (flutter/packages#13352) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@1383427...93baed9 2026-10-22 [email protected] [material_ui] Port flutter/flutter flutter#186777 MaterialColor test (flutter/packages#12858) 2026-10-21 [email protected] [rfw] Migrate to material_ui (flutter/packages#12811) 2026-10-21 [email protected] [cupertino_ui] Fix the installing command of the cupertino_ui package (flutter/packages#13141) 2026-10-21 [email protected] [cupertino_ui] Unskip web tests that pass on CanvasKit and Skwasm: date_picker_test, spell_check_suggestions_toolbar_test (flutter/packages#13367) 2026-10-21 [email protected] [video_player] Convert player classes to Swift (flutter/packages#13197) 2026-10-21 [email protected] [camera_windows] Fall back to a physical stream for cameras that reject preferred-stream selectors (flutter/packages#12748) 2026-10-21 [email protected] [google_sign_in_ios, video_player] Specify types for pattern variable declarations (flutter/packages#13362) 2026-10-21 [email protected] [google_maps_flutter_web] Issue 64073 implement my location (flutter/packages#12186) 2026-10-21 [email protected] [material_ui] Unskip web tests that pass on CanvasKit and Skwasm: app_bar_theme_test, input_decorator_test, paginated_data_table_test, spell_check_suggestions_toolbar_test (flutter/packages#13352) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes #140014
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
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