Comments (3)
Comment w3c/mediacapture-main#1 and comment w3c/mediacapture-main#2 address completely different issues.
"Try all possible combinations" is a description of what result we want, not an implementation prescription; the more efficient implementation for numeric constraints is to treat it as a ~linear programming problem (defining the part of the search space that can contain a solution, and seeing if existing solutions are in that part of the solution space). We do have an open source implementation of this.
The WG long ago decided to not prescribe exactly which permissible device to return when more than one was permissible (since the example you give has no exact constraints, all devices will be permissible).
The lack of an API for generating fake devices makes it very difficult to test this stuff in Web Platform Tests, but I think you're working on a solution for that, right?
Re comment w3c/mediacapture-main#2, trying one constraint at a time:
If you want this algorithm, you write it as {deviceid: 'abcdef', advanced: { width: 1920, height: 1080, framerate: 60}} - embedding a specific choice of priority into the browser when we don't have to seems to me like a wrong decision.
from mediacapture-extensions.
As an example: getUserMedia({ deviceId: 'abcdef', width: 1920, height: 1080, frameRate: 60 })
If device 'abcdef' is there and is not HD, it may or may not be selected depending on whether there is a HD camera.
A simpler algorithm would be to try doing the search on one constraint at a time, following always the same order.
For instance deviceId > groupId > facingMode > width ...
In the above example, if 'abcdef' is found, it would always be the one that is selected.
One way to implement this with the existing algorithm is to provide a weight to each constraint.
If deviceId has a weight of 32, groupId 16, facingMode 8...
from mediacapture-extensions.
The lack of an API for generating fake devices makes it very difficult to test this stuff in Web Platform Tests, but I think you're working on a solution for that, right?
let dev = navigator.mediaDevices.createDevices(bring_and_or_dynamically_create_your_own_devices)
will be helpful. Where to track development of that feature?
from mediacapture-extensions.
Related Issues (20)
- [Track Stats API] Rename deliveredFrames to deliverableFrames HOT 2
- [Track Stats API] SameObject is a confusing API shape HOT 23
- [Track Stats API] When to initialize frame counting HOT 3
- Should web applications be aware of reaction effects added by OS to camera feeds? HOT 17
- [Audio Stats] Add current latency HOT 2
- Background Blur: Unprocessed video should be mandatory to support HOT 8
- [Track Stats API] Make stats attribute nullable instead of throwing when unsupported HOT 2
- [Stats] Example uses ratio, not percentage
- [Audio Stats] Add average, min and max latency HOT 5
- [Audio Stats] Disagreement about audio dropped counters HOT 19
- volume is not working HOT 1
- Move MediaStreamTrack stats in its own spec? HOT 10
- Clarify how `track.stats.resetLatency()` relates to run-to-completion semantics HOT 1
- https://w3c.github.io/mediacapture-extensions/#transferable-mediastreamtrack should talk about the MediaStreamTrack's application-set content hint
- Moving the source of a track HOT 1
- Should we add reasons to MediaStreamTrack.onended HOT 4
- Add a blackFrames counter to MediaStreamTrackVideoStats HOT 7
- Consider adding onVoiceActivity event on MediaStreamTrack for audio HOT 3
- How to select camera presets that have better power efficiency at the expense of quality? HOT 2
- Clarifying Transferable MediaStreamTrack Types HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediacapture-extensions.