Use display-specific capture factories instead of having the video factory also create display capture devices.
<rdar://problem/44834412>
Created attachment 351050 [details] Patch
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 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
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
Created attachment 351109 [details] Patch for landing
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.
Created attachment 351179 [details] Patch for landing
Created attachment 351199 [details] Another patch for landing
Comment on attachment 351199 [details] Another patch for landing Clearing flags on attachment: 351199 Committed r236645: <https://trac.webkit.org/changeset/236645>
All reviewed patches have been landed. Closing bug.