Skip to content

[camera] Support image streams on Windows platform #7220

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

Closed
wants to merge 4 commits into from

Conversation

jlundOverlay
Copy link
Contributor

@jlundOverlay jlundOverlay commented Jul 25, 2024

Adds support to the to the camera plugin for streaming frames on windows as implemented in #7067

Fixes flutter/flutter#97542

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

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.

@jlundOverlay
Copy link
Contributor Author

Are we better off just removing the assertion all together, seems redundant to limit what non federated packages can do?

Copy link
Member

@loic-sharma loic-sharma left a comment

Choose a reason for hiding this comment

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

Looks great - thanks for the contribution!

For second reviewer: don't merge until #7067 lands and camera_windows 0.2.5 is published.

@loic-sharma loic-sharma requested a review from cbracken July 25, 2024 23:52
@loic-sharma
Copy link
Member

Are we better off just removing the assertion all together, seems redundant to limit what non federated packages can do?

Excellent question. Personally, I think it's good to keep these checks. This tells app developers if they use an API that's unsupported on a specific platform, which is a common mistake. If a federated platform package wants to add a feature, they can ask us to remove a particular check to allowlist them.

Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

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

LGTM (it also looks like the windows implementation has landed)

Are we better off just removing the assertion all together, seems redundant to limit what non federated packages can do?

Typically you would be correct, but the camera plugin still uses a default implementation for CameraPlatform. For newer plugins, we don't add this check since the platform interface would throw an error by default if the method wasn't supported.

@cbracken
Copy link
Member

cbracken commented Aug 16, 2024

Looks like this needs to be rebased and merge conflicts fixed. #7067 has landed, so I'm assuming once that's done, we're close to landing this?

@stuartmorgan-g
Copy link
Contributor

@jlundOverlay Are you still planning on updating this PR?

@jlundOverlay
Copy link
Contributor Author

Have fixed the merge conflicts, should be good to go.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

Looking at this PR in more detail: it does not appear that the bug I flagged here was ever fixed. We should not enable this feature when it will fail to send responses and violate the contract of the engine APIs it uses.

@stuartmorgan-g
Copy link
Contributor

Are we better off just removing the assertion all together, seems redundant to limit what non federated packages can do?

Excellent question. Personally, I think it's good to keep these checks. This tells app developers if they use an API that's unsupported on a specific platform, which is a common mistake. If a federated platform package wants to add a feature, they can ask us to remove a particular check to allowlist them.

We should fix this via this pattern which is our preferred approach; the hard-coded platform checks are a legacy of pre-federation approaches. Rather than update the hard-coding, the much better fix here would be to add a new platform interface method to query for streaming support, update the supported platforms to return true for it, and then update the app-facing package to require those minimum versions of the implementation packages (to avoid regressions) and gate on that check instead of platform.

@stuartmorgan-g
Copy link
Contributor

@jlundOverlay Are you still planning on updating this to address the issue with missing responses?

If not, we should revert the underlying PR, as that code is not correct, and would cause serious issues if ever exposed.

@yoongyo

This comment was marked as off-topic.

@gamelaster
Copy link

@yoongyo it seems as the original author of patch was doing that as part of their job, and maybe they don't work anymore. I think it would be wise to look for someone, who can continue working on this.

Of course, writing this is easy, but I already tried to put this into my job's todo-list, although, in the end, we will not use this feature ☹️ .

@stuartmorgan-g
Copy link
Contributor

Closing in light of #7951 and the lack of response here. If you decided to revisit this feature in the future, please feel free to open a new PR!

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.

[camera] Support image streams on Windows platform
7 participants