Bug 189930 - [MediaStream] Update constraints supported by getDisplayMedia
Summary: [MediaStream] Update constraints supported by getDisplayMedia
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-09-24 14:26 PDT by Eric Carlson
Modified: 2018-09-25 14:31 PDT (History)
3 users (show)

See Also:


Attachments
Patch (19.73 KB, patch)
2018-09-24 14:33 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch for landing (25.45 KB, patch)
2018-09-25 10:29 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Fix broken API tests (1.96 KB, patch)
2018-09-25 13:54 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2018-09-24 14:26:57 PDT
The spec has changed the constraints that getDisplayMedia supports.
Comment 1 Eric Carlson 2018-09-24 14:33:57 PDT
Created attachment 350686 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2018-09-24 14:34:39 PDT
<rdar://problem/44740305>
Comment 3 youenn fablet 2018-09-24 21:43:39 PDT
Comment on attachment 350686 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=350686&action=review

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:163
> +    // 2. For each member present in constraints whose value, value, is a dictionary, run the following steps:

s/, value,//

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:175
> +

Remove this line?

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:213
> +        case MediaConstraintType::EchoCancellation:

From your quote of the spec, we should also reject if any of these value has a min/exact value.
Maybe we should add some tests for these values.

> Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp:245
> +            if (request.type != MediaStreamRequest::Type::UserMedia || !request.audioConstraints.isValid)

To improve readability, we could try to split more getDisplayDevice vs. getUserMedia code path.
For instance, have one top level request.type check in this function and introduce getCaptureDevices and getScreenDevices to iterate over relevant devices according request.type.
Comment 4 Eric Carlson 2018-09-25 10:27:43 PDT
Comment on attachment 350686 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=350686&action=review

>> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:163
>> +    // 2. For each member present in constraints whose value, value, is a dictionary, run the following steps:
> 
> s/, value,//

This is verbatim from the spec.

>> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:175
>> +
> 
> Remove this line?

OK

>> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:213
>> +        case MediaConstraintType::EchoCancellation:
> 
> From your quote of the spec, we should also reject if any of these value has a min/exact value.
> Maybe we should add some tests for these values.

These are audio-only constraints, and we don't support audio with getDisplayMedia. Good idea about the test, I will add an invalid audio constraint to the test.

>> Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp:245
>> +            if (request.type != MediaStreamRequest::Type::UserMedia || !request.audioConstraints.isValid)
> 
> To improve readability, we could try to split more getDisplayDevice vs. getUserMedia code path.
> For instance, have one top level request.type check in this function and introduce getCaptureDevices and getScreenDevices to iterate over relevant devices according request.type.

Good idea, I will do that.
Comment 5 Eric Carlson 2018-09-25 10:29:56 PDT
Created attachment 350756 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2018-09-25 11:37:38 PDT
Comment on attachment 350756 [details]
Patch for landing

Clearing flags on attachment: 350756

Committed r236465: <https://trac.webkit.org/changeset/236465>
Comment 7 WebKit Commit Bot 2018-09-25 11:37:41 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Eric Carlson 2018-09-25 13:54:02 PDT
Reopening to attach new patch.
Comment 9 Eric Carlson 2018-09-25 13:54:03 PDT
Created attachment 350787 [details]
Fix broken API tests
Comment 10 WebKit Commit Bot 2018-09-25 14:31:38 PDT
Comment on attachment 350787 [details]
Fix broken API tests

Clearing flags on attachment: 350787

Committed r236476: <https://trac.webkit.org/changeset/236476>
Comment 11 WebKit Commit Bot 2018-09-25 14:31:39 PDT
All reviewed patches have been landed.  Closing bug.