Add advanced constraint support to MediaStreamTrack.applyConstraints.
<rdar://problem/28195461>
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>