RESOLVED FIXED Bug 161715
[MediaStream] applyConstraints pt. 2 - advanced constraints
https://bugs.webkit.org/show_bug.cgi?id=161715
Summary [MediaStream] applyConstraints pt. 2 - advanced constraints
Eric Carlson
Reported 2016-09-07 14:58:24 PDT
Add advanced constraint support to MediaStreamTrack.applyConstraints.
Attachments
Proposed patch. (47.23 KB, patch)
2016-09-07 15:29 PDT, Eric Carlson
dino: review+
Patch for landing. (47.17 KB, patch)
2016-09-07 16:31 PDT, Eric Carlson
no flags
Radar WebKit Bug Importer
Comment 1 2016-09-07 14:59:21 PDT
Eric Carlson
Comment 2 2016-09-07 15:29:46 PDT
Created attachment 288194 [details] Proposed patch.
Dean Jackson
Comment 3 2016-09-07 16:02:27 PDT
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?
Eric Carlson
Comment 4 2016-09-07 16:30:43 PDT
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.
Eric Carlson
Comment 5 2016-09-07 16:31:18 PDT
Created attachment 288202 [details] Patch for landing.
WebKit Commit Bot
Comment 6 2016-09-07 17:03:29 PDT
Comment on attachment 288202 [details] Patch for landing. Clearing flags on attachment: 288202 Committed r205574: <http://trac.webkit.org/changeset/205574>
Note You need to log in before you can comment on or make changes to this bug.