Summary: | [MediaStream] applyConstraints pt. 2 - advanced constraints | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Carlson <eric.carlson> | ||||||
Component: | Media | Assignee: | Eric Carlson <eric.carlson> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 160579 | ||||||||
Attachments: |
|
Description
Eric Carlson
2016-09-07 14:58:24 PDT
Created attachment 288194 [details]
Proposed patch.
Comment on attachment 288194 [details] Proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=288194&action=review > Source/WebCore/platform/mediastream/MediaConstraints.cpp:196 > + // 2. If the constraint is required ('min', 'max', or 'exact'), and the settings > + // dictionary's value for the constraint does not satisfy the constraint, the > + // fitness distance is positive infinity. > + if (!m_exact.isEmpty() && m_exact.find(value) == notFound) > + return std::numeric_limits<double>::infinity(); So there is no concept of min or max on a StringConstraint? > Source/WebCore/platform/mediastream/MediaConstraints.cpp:217 > + double distance = fitnessDistance(value); > + if (distance < minimumDistance) > + minimumDistance = distance; Maybe just minimumDistance = std::min(minimumDistance, fitnessDistance(value)); ? > Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp:447 > + // 4. If candidates is empty, return undefined as the result of the SelectSettings() algorithm. > + if (candidates.isEmpty()) > + return true; How is true == undefined? Does this mean it is a valid but empty result? Comment on attachment 288194 [details] Proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=288194&action=review >> Source/WebCore/platform/mediastream/MediaConstraints.cpp:196 >> + return std::numeric_limits<double>::infinity(); > > So there is no concept of min or max on a StringConstraint? No, only exact and idea. >> Source/WebCore/platform/mediastream/MediaConstraints.cpp:217 >> + minimumDistance = distance; > > Maybe just minimumDistance = std::min(minimumDistance, fitnessDistance(value)); ? good idea, thanks! >> Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp:447 >> + return true; > > How is true == undefined? Does this mean it is a valid but empty result? Correct, there are no valid constraints and none are impossible to support. Created attachment 288202 [details]
Patch for landing.
Comment on attachment 288202 [details] Patch for landing. Clearing flags on attachment: 288202 Committed r205574: <http://trac.webkit.org/changeset/205574> |