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

[camera_web] Release the camera stream of each available video input device #4621

Merged
merged 4 commits into from
Feb 9, 2022
Merged

[camera_web] Release the camera stream of each available video input device #4621

merged 4 commits into from
Feb 9, 2022

Conversation

bselwe
Copy link
Contributor

@bselwe bselwe commented Dec 17, 2021

Accessing available cameras fetches the video stream of each video input device from MediaDevices.enumerateDevices. Those video streams are now released when the camera metadata is created. This should solve a cameraNotReadable error thrown when initializing a camera that is already in use.

The solution was proposed by @leandroveronezi in flutter/flutter#90881 (comment), thanks!

Closes flutter/flutter#90881.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Note that unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test exempt.
  • All existing and new tests are passing.

@bselwe
Copy link
Contributor Author

bselwe commented Dec 17, 2021

@ditman

Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

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

LGTM, let's give this a shot!

@ditman ditman added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Jan 5, 2022
@ditman
Copy link
Member

ditman commented Jan 5, 2022

(PS: the availableCameras method is starting to get a little bit unwieldy (100+ LoC), I wonder if there's any good logical split for all the things that happen inside of it!)

@fluttergithubbot
Copy link

This pull request is not suitable for automatic merging in its current state.

  • Please get at least one approved review if you are already a member or two member reviews if you are not a member before re-applying this label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@fluttergithubbot fluttergithubbot removed the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Jan 5, 2022
@godofredoc godofredoc changed the base branch from master to main January 6, 2022 22:40
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

Looks like this fell through the cracks on getting a second reviewer, sorry about that. LGTM with one nit.

packages/camera/camera_web/CHANGELOG.md Outdated Show resolved Hide resolved
@stuartmorgan
Copy link
Contributor

@bselwe Could you fix the conflict (and nit) here so that we can land this?

@ditman ditman added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Feb 9, 2022
@fluttergithubbot fluttergithubbot merged commit a3fd3e9 into flutter:main Feb 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 11, 2022
@bselwe
Copy link
Contributor Author

bselwe commented Feb 12, 2022

Thanks @ditman for taking care of this one!

@ditman
Copy link
Member

ditman commented Feb 15, 2022

No problem @bselwe! Thanks for the OG fix!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: camera platform-web waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[camera_web] cameraNotReadable error prevents access to the camera on some Android devices
4 participants