Bug 190043

Summary: [MediaStream] Use display-specific capture factories
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: WebRTCAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, rniwa, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews106 for mac-sierra-wk2
none
Patch for landing
none
Patch for landing
none
Another patch for landing none

Description Eric Carlson 2018-09-27 10:17:31 PDT
Use display-specific capture factories instead of having the video factory also create display capture devices.
Comment 1 Radar WebKit Bug Importer 2018-09-27 10:18:53 PDT
<rdar://problem/44834412>
Comment 2 Eric Carlson 2018-09-27 21:32:03 PDT
Created attachment 351050 [details]
Patch
Comment 3 youenn fablet 2018-09-27 21:47:51 PDT
Comment on attachment 351050 [details]
Patch

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

> Source/WebCore/platform/mediastream/RealtimeMediaSource.h:137
> +    class DisplayCaptureFactory {

We should maybe move DisplayCaptureFactory, VideoCaptureFactory et al to their own file.
We do not gain much in having them inside RealtimeMediaSource.

> Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp:106
> +        else

We could have a specific RealtimeMediaSourceCenter::createDisplayMediaStream that would be called from UserMediaRequest::allow based on the UserMediaRequest::type.

> Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:53
> +        if (device.type() == CaptureDevice::DeviceType::Camera)

Maybe an ASSERT() is all that is needed there.
If the type is not good, the id is probably not good and capture will fail, right?
Comment 4 EWS Watchlist 2018-09-28 00:15:10 PDT
Comment on attachment 351050 [details]
Patch

Attachment 351050 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/9378054

New failing tests:
http/tests/media/media-stream/get-display-media-prompt.html
Comment 5 EWS Watchlist 2018-09-28 00:15:12 PDT
Created attachment 351061 [details]
Archive of layout-test-results from ews106 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 6 Eric Carlson 2018-09-28 14:25:57 PDT
Created attachment 351109 [details]
Patch for landing
Comment 7 Eric Carlson 2018-09-28 14:28:32 PDT
Comment on attachment 351050 [details]
Patch

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

>> Source/WebCore/platform/mediastream/RealtimeMediaSource.h:137
>> +    class DisplayCaptureFactory {
> 
> We should maybe move DisplayCaptureFactory, VideoCaptureFactory et al to their own file.
> We do not gain much in having them inside RealtimeMediaSource.

Good idea, fixed.

>> Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp:106
>> +        else
> 
> We could have a specific RealtimeMediaSourceCenter::createDisplayMediaStream that would be called from UserMediaRequest::allow based on the UserMediaRequest::type.

I'll consider this for one of the next refactorings.

>> Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:53
>> +        if (device.type() == CaptureDevice::DeviceType::Camera)
> 
> Maybe an ASSERT() is all that is needed there.
> If the type is not good, the id is probably not good and capture will fail, right?

Sure, changed.
Comment 8 Eric Carlson 2018-09-29 04:44:01 PDT
Created attachment 351179 [details]
Patch for landing
Comment 9 Eric Carlson 2018-09-29 15:12:02 PDT
Created attachment 351199 [details]
Another patch for landing
Comment 10 WebKit Commit Bot 2018-09-30 00:02:47 PDT
Comment on attachment 351199 [details]
Another patch for landing

Clearing flags on attachment: 351199

Committed r236645: <https://trac.webkit.org/changeset/236645>
Comment 11 WebKit Commit Bot 2018-09-30 00:02:48 PDT
All reviewed patches have been landed.  Closing bug.