Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[camera] Options to scan for physical and/or logical cameras on iOS #6023

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 16 commits into from

Conversation

rickcasson
Copy link

Based on feedback from @stuartmorgan, I have refactored my original PRs (#5957 and #5958) to not disrupt the existing functionality of the availableDevices method, while still providing the option to access the extended list of iOS cameras (both physical and logical) based on Apple's documentation:
https://developer.apple.com/documentation/avfoundation/avcapturedevice/devicetype

This changes hopefully make room to eventually add the ability to access logical cameras on Android (or other?) devices at some point, but the changes on iOS were more pressing for my project so I wanted to at least start there.

I've included external cameras as "physical devices" so this PR should fix the same issue as #5892.

List which issues are fixed by this PR. You must list at least one issue.
closes flutter/flutter#134151
closes flutter/flutter#130073
closes flutter/flutter#142025

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. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the [CLA].
  • The title of the PR starts with the name of the package 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], or this PR is [exempt from version changes].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style].
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@stuartmorgan-g
Copy link
Contributor

Based on feedback from @stuartmorgan, I have refactored my original PRs (#5957 and #5958) to not disrupt the existing functionality of the availableDevices method, while still providing the option to access the extended list of iOS cameras (both physical and logical)

My primary feedback, which continues to be true, is that this needs a full design proposal (https://github.com/flutter/flutter/wiki/Design-Documents). There are many possible ways to handle different device types, and this PR would lock us into a specific one without there having been a discussions of alternatives and the pros and cons of each.

This changes hopefully make room to eventually add the ability to access logical cameras on Android (or other?) devices at some point

If we can't confidently answer the question of whether this API will apply well to other platforms, that's a strong signal that this hasn't gone through sufficient evaluation yet. See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#platform-support

but the changes on iOS were more pressing for my project so I wanted to at least start there

Our priority is the long term health and usability of the plugin's API surface; our process is designed to support that rather than patchworks of APIs developed in small pieces based on individual contributor deadlines, as cases where the latter has happened the outcomes have often not been good.

@ditman
Copy link
Member

ditman commented Feb 14, 2024

I took a quick look at MDN, and I don't think there's a concept of Logical/Physical Cameras in the Web. Cameras (and other types) are just providers of a MediaStream that can be connected to a Canvas or a WebRTC connection.

There's also no "constraint" to select physical from logical cameras. See: MediaTrackConstraints.

(It wouldn't be the first time that the web ignores values from some parameters, though!)

@stuartmorgan-g
Copy link
Contributor

Marking as a draft pending a design document, per comment above.

@stuartmorgan-g stuartmorgan-g marked this pull request as draft March 5, 2024 20:53
@goderbauer
Copy link
Member

(triage): I am going to close this one since there hasn't been any follow-up. If you find the time to address the feedback given above please reopen this. Thank you.

@goderbauer goderbauer closed this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants