<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[236645] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/236645">236645</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2018-09-30 00:02:39 -0700 (Sun, 30 Sep 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>[MediaStream] Use display-specific capture factories
https://bugs.webkit.org/show_bug.cgi?id=190043
<rdar://problem/44834412>

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests, no change in functionality.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory): Deleted.
(WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream):
(WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
* platform/mediastream/RealtimeMediaSourceFactory.cpp: Added.
(WebCore::SingleSourceFactory::setActiveSource):
(WebCore::SingleSourceFactory::unsetActiveSource):
* platform/mediastream/RealtimeMediaSourceFactory.h: Added.
(WebCore::SingleSourceFactory::activeSource):
(WebCore::VideoCaptureFactory::setVideoCapturePageState):
(WebCore::DisplayCaptureFactory::setDisplayCapturePageState):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::libWebRTCVideoCaptureSourceFactory):
(WebCore::libWebRTCDisplayCaptureSourceFactory):
(WebCore::GStreamerVideoCaptureSource::factory):
(WebCore::GStreamerVideoCaptureSource::displayFactory):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory):
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::factory):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterMac::audioFactory):
(WebCore::RealtimeMediaSourceCenterMac::videoFactory):
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
(WebCore::MockRealtimeAudioSource::startProducingData):
(): Deleted.
(WebCore::mockAudioCaptureSourceFactory): Deleted.
(WebCore::MockRealtimeAudioSource::factory): Deleted.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState):
(WebCore::MockRealtimeMediaSourceCenter::audioFactory):
(WebCore::MockRealtimeMediaSourceCenter::videoFactory):
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(): Deleted.
(WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Deleted.
(WebCore::mockVideoCaptureSourceFactory): Deleted.
(WebCore::MockRealtimeVideoSource::factory): Deleted.
* platform/mock/MockRealtimeVideoSource.h:

Source/WebKit:

* WebProcess/cocoa/UserMediaCaptureManager.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRealtimeMediaSourcecpp">trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceh">trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceCentercpp">trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceCenterh">trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerGStreamerAudioCaptureSourcecpp">trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerGStreamerCaptureDeviceManagerh">trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerGStreamerVideoCaptureSourcecpp">trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerGStreamerVideoCaptureSourceh">trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerRealtimeMediaSourceCenterLibWebRTCcpp">trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerRealtimeMediaSourceCenterLibWebRTCh">trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacAVVideoCaptureSourcemm">trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacCoreAudioCaptureSourcecpp">trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacCoreAudioCaptureSourceh">trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacRealtimeMediaSourceCenterMaccpp">trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacRealtimeMediaSourceCenterMach">trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeAudioSourcecpp">trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeAudioSourceh">trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeMediaSourceCentercpp">trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeMediaSourceCenterh">trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeVideoSourcecpp">trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeVideoSourceh">trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebProcesscocoaUserMediaCaptureManagerh">trunk/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceFactorycpp">trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceFactoryh">trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/ChangeLog      2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -1,3 +1,78 @@
</span><ins>+2018-09-30  Eric Carlson  <eric.carlson@apple.com>
+
+        [MediaStream] Use display-specific capture factories
+        https://bugs.webkit.org/show_bug.cgi?id=190043
+        <rdar://problem/44834412>
+
+        Reviewed by Youenn Fablet.
+
+        No new tests, no change in functionality.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/mediastream/RealtimeMediaSource.cpp:
+        (WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory): Deleted.
+        (WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory): Deleted.
+        * platform/mediastream/RealtimeMediaSource.h:
+        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
+        (WebCore::RealtimeMediaSourceCenter::createMediaStream):
+        (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
+        * platform/mediastream/RealtimeMediaSourceCenter.h:
+        (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
+        (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
+        * platform/mediastream/RealtimeMediaSourceFactory.cpp: Added.
+        (WebCore::SingleSourceFactory::setActiveSource):
+        (WebCore::SingleSourceFactory::unsetActiveSource):
+        * platform/mediastream/RealtimeMediaSourceFactory.h: Added.
+        (WebCore::SingleSourceFactory::activeSource):
+        (WebCore::VideoCaptureFactory::setVideoCapturePageState):
+        (WebCore::DisplayCaptureFactory::setDisplayCapturePageState):
+        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
+        (WebCore::libWebRTCVideoCaptureSourceFactory):
+        (WebCore::libWebRTCDisplayCaptureSourceFactory):
+        (WebCore::GStreamerVideoCaptureSource::factory):
+        (WebCore::GStreamerVideoCaptureSource::displayFactory):
+        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
+        * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
+        (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory):
+        (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory):
+        (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory):
+        (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory):
+        * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
+        * platform/mediastream/mac/AVVideoCaptureSource.mm:
+        (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
+        (WebCore::AVVideoCaptureSource::setupCaptureSession):
+        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
+        (WebCore::CoreAudioCaptureSource::factory):
+        * platform/mediastream/mac/CoreAudioCaptureSource.h:
+        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
+        (WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory):
+        (WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory):
+        (WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory):
+        (WebCore::RealtimeMediaSourceCenterMac::audioFactory):
+        (WebCore::RealtimeMediaSourceCenterMac::videoFactory):
+        (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory):
+        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
+        * platform/mock/MockRealtimeAudioSource.cpp:
+        (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
+        (WebCore::MockRealtimeAudioSource::startProducingData):
+        (): Deleted.
+        (WebCore::mockAudioCaptureSourceFactory): Deleted.
+        (WebCore::MockRealtimeAudioSource::factory): Deleted.
+        * platform/mock/MockRealtimeAudioSource.h:
+        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
+        (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState):
+        (WebCore::MockRealtimeMediaSourceCenter::audioFactory):
+        (WebCore::MockRealtimeMediaSourceCenter::videoFactory):
+        (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
+        * platform/mock/MockRealtimeMediaSourceCenter.h:
+        * platform/mock/MockRealtimeVideoSource.cpp:
+        (): Deleted.
+        (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Deleted.
+        (WebCore::mockVideoCaptureSourceFactory): Deleted.
+        (WebCore::MockRealtimeVideoSource::factory): Deleted.
+        * platform/mock/MockRealtimeVideoSource.h:
+
</ins><span class="cx"> 2018-09-29  Oriol Brufau  <obrufau@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Properly align items next to collapsed tracks with gutters
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/Sources.txt    2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -1747,6 +1747,7 @@
</span><span class="cx"> platform/mediastream/RealtimeIncomingVideoSource.cpp
</span><span class="cx"> platform/mediastream/RealtimeMediaSource.cpp
</span><span class="cx"> platform/mediastream/RealtimeMediaSourceCenter.cpp
</span><ins>+platform/mediastream/RealtimeMediaSourceFactory.cpp
</ins><span class="cx"> platform/mediastream/RealtimeMediaSourceSettings.cpp
</span><span class="cx"> platform/mediastream/RealtimeOutgoingAudioSource.cpp
</span><span class="cx"> platform/mediastream/RealtimeOutgoingVideoSource.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -120,6 +120,7 @@
</span><span class="cx">          074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */ = {isa = PBXBuildFile; fileRef = 074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0753860214489E9800B78452 /* CachedTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0753860014489E9800B78452 /* CachedTextTrack.cpp */; };
</span><span class="cx">          0753860314489E9800B78452 /* CachedTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 0753860114489E9800B78452 /* CachedTextTrack.h */; };
</span><ins>+               0754A5EA215EA3B8002D3A99 /* RealtimeMediaSourceFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 0754A5E8215EA3B7002D3A99 /* RealtimeMediaSourceFactory.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           0757B13E214AE79900794B0D /* VideoPreset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0757B13C214AE79700794B0D /* VideoPreset.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          075BA84920618AA500FCB4AD /* VideoFullscreenLayerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 075BA84720618AA500FCB4AD /* VideoFullscreenLayerManager.h */; };
</span><span class="cx">          07638A991884487200E15A1B /* MediaSessionManagerIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 07638A971884487200E15A1B /* MediaSessionManagerIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5353,6 +5354,8 @@
</span><span class="cx">          074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformTimeRanges.h; sourceTree = "<group>"; };
</span><span class="cx">          0753860014489E9800B78452 /* CachedTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedTextTrack.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0753860114489E9800B78452 /* CachedTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTextTrack.h; sourceTree = "<group>"; };
</span><ins>+               0754A5E8215EA3B7002D3A99 /* RealtimeMediaSourceFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RealtimeMediaSourceFactory.h; sourceTree = "<group>"; };
+               0754A5EB215EADF3002D3A99 /* RealtimeMediaSourceFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RealtimeMediaSourceFactory.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           0757B13C214AE79700794B0D /* VideoPreset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoPreset.h; sourceTree = "<group>"; };
</span><span class="cx">          075BA84720618AA500FCB4AD /* VideoFullscreenLayerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFullscreenLayerManager.h; sourceTree = "<group>"; };
</span><span class="cx">          07638A971884487200E15A1B /* MediaSessionManagerIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSessionManagerIOS.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -15324,6 +15327,8 @@
</span><span class="cx">                          4A4F656D1AA997F100E38CDD /* RealtimeMediaSourceCapabilities.h */,
</span><span class="cx">                          4A0FFA9F1AAF5EA20062803B /* RealtimeMediaSourceCenter.cpp */,
</span><span class="cx">                          4A0FFAA01AAF5EA20062803B /* RealtimeMediaSourceCenter.h */,
</span><ins>+                               0754A5EB215EADF3002D3A99 /* RealtimeMediaSourceFactory.cpp */,
+                               0754A5E8215EA3B7002D3A99 /* RealtimeMediaSourceFactory.h */,
</ins><span class="cx">                           4A4F656E1AA997F100E38CDD /* RealtimeMediaSourceSettings.cpp */,
</span><span class="cx">                          4A4F656F1AA997F100E38CDD /* RealtimeMediaSourceSettings.h */,
</span><span class="cx">                          2EC41DE21C0410A300D294FE /* RealtimeMediaSourceSupportedConstraints.cpp */,
</span><span class="lines">@@ -29969,6 +29974,7 @@
</span><span class="cx">                          4A4F65721AA997F100E38CDD /* RealtimeMediaSourceCapabilities.h in Headers */,
</span><span class="cx">                          4A0FFAA21AAF5EA20062803B /* RealtimeMediaSourceCenter.h in Headers */,
</span><span class="cx">                          4A0FFAA61AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h in Headers */,
</span><ins>+                               0754A5EA215EA3B8002D3A99 /* RealtimeMediaSourceFactory.h in Headers */,
</ins><span class="cx">                           4A4F65741AA997F100E38CDD /* RealtimeMediaSourceSettings.h in Headers */,
</span><span class="cx">                          07C1C0E51BFB60ED00BD2256 /* RealtimeMediaSourceSupportedConstraints.h in Headers */,
</span><span class="cx">                          41103AAC1E39791000769F03 /* RealtimeOutgoingAudioSource.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRealtimeMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp        2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp   2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -956,14 +956,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory()
-{
-}
-
-RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory()
-{
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MEDIA_STREAM)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h  2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h     2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include "MediaSample.h"
</span><span class="cx"> #include "PlatformLayer.h"
</span><span class="cx"> #include "RealtimeMediaSourceCapabilities.h"
</span><ins>+#include "RealtimeMediaSourceFactory.h"
</ins><span class="cx"> #include <wtf/RecursiveLockAdapter.h>
</span><span class="cx"> #include <wtf/ThreadSafeRefCounted.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="lines">@@ -85,55 +86,6 @@
</span><span class="cx">         virtual void audioSamplesAvailable(const MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t /*numberOfFrames*/) { }
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    class SingleSourceFactory {
-    public:
-        void setActiveSource(RealtimeMediaSource& source)
-        {
-            if (m_activeSource == &source)
-                return;
-            if (m_activeSource && m_activeSource->isProducingData())
-                m_activeSource->setMuted(true);
-            m_activeSource = &source;
-        }
-
-        void unsetActiveSource(RealtimeMediaSource& source)
-        {
-            if (m_activeSource == &source)
-                m_activeSource = nullptr;
-        }
-
-        RealtimeMediaSource* activeSource() { return m_activeSource; }
-    private:
-        RealtimeMediaSource* m_activeSource { nullptr };
-    };
-
-    class AudioCaptureFactory
-#if PLATFORM(IOS)
-        : public RealtimeMediaSource::SingleSourceFactory
-#endif
-    {
-    public:
-        virtual ~AudioCaptureFactory();
-        virtual CaptureSourceOrError createAudioCaptureSource(const CaptureDevice&, const MediaConstraints*) = 0;
-
-    protected:
-        AudioCaptureFactory() = default;
-    };
-
-    class VideoCaptureFactory
-#if PLATFORM(IOS)
-        : public RealtimeMediaSource::SingleSourceFactory
-#endif
-    {
-    public:
-        virtual ~VideoCaptureFactory();
-        virtual CaptureSourceOrError createVideoCaptureSource(const CaptureDevice&, const MediaConstraints*) = 0;
-        virtual void setVideoCapturePageState(bool, bool) { }
-
-    protected:
-        VideoCaptureFactory() = default;
-    };
-
</del><span class="cx">     virtual ~RealtimeMediaSource() = default;
</span><span class="cx"> 
</span><span class="cx">     const String& id() const { return m_id; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceCentercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp  2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp     2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -100,7 +100,12 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (videoDevice) {
</span><del>-        auto videoSource = videoFactory().createVideoCaptureSource(WTFMove(videoDevice), &request.videoConstraints);
</del><ins>+        CaptureSourceOrError videoSource;
+        if (videoDevice.type() == CaptureDevice::DeviceType::Camera)
+            videoSource = videoFactory().createVideoCaptureSource(WTFMove(videoDevice), &request.videoConstraints);
+        else
+            videoSource = displayCaptureFactory().createDisplayCaptureSource(WTFMove(videoDevice), &request.videoConstraints);
+
</ins><span class="cx">         if (videoSource)
</span><span class="cx">             videoSources.append(videoSource.source());
</span><span class="cx">         else {
</span><span class="lines">@@ -217,7 +222,7 @@
</span><span class="cx">         if (!device.enabled())
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        auto sourceOrError = videoFactory().createVideoCaptureSource(device, { });
</del><ins>+        auto sourceOrError = displayCaptureFactory().createDisplayCaptureSource(device, { });
</ins><span class="cx">         if (sourceOrError && sourceOrError.captureSource->supportsConstraints(request.videoConstraints, invalidConstraint))
</span><span class="cx">             diaplayDeviceInfo.append({sourceOrError.captureSource->fitnessScore(), device});
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceCenterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h    2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h       2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include "ExceptionOr.h"
</span><span class="cx"> #include "MediaStreamRequest.h"
</span><span class="cx"> #include "RealtimeMediaSource.h"
</span><ins>+#include "RealtimeMediaSourceFactory.h"
</ins><span class="cx"> #include "RealtimeMediaSourceSupportedConstraints.h"
</span><span class="cx"> #include <wtf/Function.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="lines">@@ -71,12 +72,14 @@
</span><span class="cx">     
</span><span class="cx">     const RealtimeMediaSourceSupportedConstraints& supportedConstraints() { return m_supportedConstraints; }
</span><span class="cx"> 
</span><del>-    virtual void setAudioFactory(RealtimeMediaSource::AudioCaptureFactory&) { }
-    virtual void unsetAudioFactory(RealtimeMediaSource::AudioCaptureFactory&) { }
-    WEBCORE_EXPORT virtual RealtimeMediaSource::AudioCaptureFactory& audioFactory() = 0;
</del><ins>+    virtual void setAudioFactory(AudioCaptureFactory&) { }
+    virtual void unsetAudioFactory(AudioCaptureFactory&) { }
+    WEBCORE_EXPORT virtual AudioCaptureFactory& audioFactory() = 0;
</ins><span class="cx"> 
</span><del>-    virtual RealtimeMediaSource::VideoCaptureFactory& videoFactory() = 0;
</del><ins>+    virtual VideoCaptureFactory& videoFactory() = 0;
</ins><span class="cx"> 
</span><ins>+    virtual DisplayCaptureFactory& displayCaptureFactory() = 0;
+
</ins><span class="cx">     virtual CaptureDeviceManager& audioCaptureDeviceManager() = 0;
</span><span class="cx">     virtual CaptureDeviceManager& videoCaptureDeviceManager() = 0;
</span><span class="cx">     virtual CaptureDeviceManager& displayCaptureDeviceManager() = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceFactorycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.cpp (0 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.cpp                         (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.cpp    2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "RealtimeMediaSourceFactory.h"
+
+#include "CaptureDevice.h"
+#include "RealtimeMediaSource.h"
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "CaptureDeviceManager.h"
+#include "Logging.h"
+#include "MediaStreamPrivate.h"
+#include <wtf/SHA1.h>
+
+namespace WebCore {
+
+void SingleSourceFactory::setActiveSource(RealtimeMediaSource& source)
+{
+    if (m_activeSource == &source)
+        return;
+    if (m_activeSource && m_activeSource->isProducingData())
+        m_activeSource->setMuted(true);
+    m_activeSource = &source;
+}
+
+void SingleSourceFactory::unsetActiveSource(RealtimeMediaSource& source)
+{
+    if (m_activeSource == &source)
+        m_activeSource = nullptr;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceFactoryh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.h (0 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.h                           (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.h      2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(MEDIA_STREAM)
+
+namespace WebCore {
+
+class CaptureDevice;
+class RealtimeMediaSource;
+
+struct MediaConstraints;
+
+struct CaptureSourceOrError;
+
+class SingleSourceFactory {
+public:
+    void setActiveSource(RealtimeMediaSource&);
+    void unsetActiveSource(RealtimeMediaSource&);
+    RealtimeMediaSource* activeSource() { return m_activeSource; }
+
+private:
+    RealtimeMediaSource* m_activeSource { nullptr };
+};
+
+class AudioCaptureFactory
+#if PLATFORM(IOS)
+    : public SingleSourceFactory
+#endif
+{
+public:
+    virtual ~AudioCaptureFactory() = default;
+    virtual CaptureSourceOrError createAudioCaptureSource(const CaptureDevice&, const MediaConstraints*) = 0;
+
+protected:
+    AudioCaptureFactory() = default;
+};
+
+class VideoCaptureFactory
+#if PLATFORM(IOS)
+    : public SingleSourceFactory
+#endif
+{
+public:
+    virtual ~VideoCaptureFactory() = default;
+    virtual CaptureSourceOrError createVideoCaptureSource(const CaptureDevice&, const MediaConstraints*) = 0;
+    virtual void setVideoCapturePageState(bool, bool) { }
+
+protected:
+    VideoCaptureFactory() = default;
+};
+
+class DisplayCaptureFactory {
+public:
+    virtual ~DisplayCaptureFactory() = default;
+    virtual CaptureSourceOrError createDisplayCaptureSource(const CaptureDevice&, const MediaConstraints*) = 0;
+    virtual void setDisplayCapturePageState(bool , bool) { }
+
+protected:
+    DisplayCaptureFactory() = default;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerGStreamerAudioCaptureSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp      2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp 2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class GStreamerAudioCaptureSourceFactory : public RealtimeMediaSource::AudioCaptureFactory {
</del><ins>+class GStreamerAudioCaptureSourceFactory : public AudioCaptureFactory {
</ins><span class="cx"> public:
</span><span class="cx">     CaptureSourceOrError createAudioCaptureSource(const CaptureDevice& device, const MediaConstraints* constraints) final
</span><span class="cx">     {
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">     return CaptureSourceOrError(WTFMove(source));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::AudioCaptureFactory& GStreamerAudioCaptureSource::factory()
</del><ins>+AudioCaptureFactory& GStreamerAudioCaptureSource::factory()
</ins><span class="cx"> {
</span><span class="cx">     return libWebRTCAudioCaptureSourceFactory();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerGStreamerCaptureDeviceManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h      2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h 2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "CaptureDeviceManager.h"
</span><span class="cx"> #include "GRefPtrGStreamer.h"
</span><span class="cx"> #include "GStreamerCaptureDevice.h"
</span><ins>+#include "RealtimeMediaSourceFactory.h"
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -59,7 +60,7 @@
</span><span class="cx">     friend class NeverDestroyed<GStreamerVideoCaptureDeviceManager>;
</span><span class="cx"> public:
</span><span class="cx">     static GStreamerVideoCaptureDeviceManager& singleton();
</span><del>-    static RealtimeMediaSource::VideoCaptureFactory& videoFactory();
</del><ins>+    static VideoCaptureFactory& videoFactory();
</ins><span class="cx">     CaptureDevice::DeviceType deviceType() final { return CaptureDevice::DeviceType::Camera; }
</span><span class="cx"> private:
</span><span class="cx">     GStreamerVideoCaptureDeviceManager() = default;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerGStreamerVideoCaptureSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp      2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp 2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class GStreamerVideoCaptureSourceFactory final : public RealtimeMediaSource::VideoCaptureFactory {
</del><ins>+class GStreamerVideoCaptureSourceFactory final : public VideoCaptureFactory {
</ins><span class="cx"> public:
</span><span class="cx">     CaptureSourceOrError createVideoCaptureSource(const CaptureDevice& device, const MediaConstraints* constraints) final
</span><span class="cx">     {
</span><span class="lines">@@ -60,12 +60,27 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::VideoCaptureFactory& libWebRTCVideoCaptureSourceFactory()
</del><ins>+VideoCaptureFactory& libWebRTCVideoCaptureSourceFactory()
</ins><span class="cx"> {
</span><span class="cx">     static NeverDestroyed<GStreamerVideoCaptureSourceFactory> factory;
</span><span class="cx">     return factory.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class GStreamerDisplayCaptureSourceFactory final : public DisplayCaptureFactory {
+public:
+    CaptureSourceOrError createDisplayCaptureSource(const CaptureDevice&, const MediaConstraints*) final
+    {
+        // FIXME: Implement this.
+        return { };
+    }
+};
+
+DisplayCaptureFactory& libWebRTCDisplayCaptureSourceFactory()
+{
+    static NeverDestroyed<GStreamerDisplayCaptureSourceFactory> factory;
+    return factory.get();
+}
+
</ins><span class="cx"> CaptureSourceOrError GStreamerVideoCaptureSource::create(const String& deviceID, const MediaConstraints* constraints)
</span><span class="cx"> {
</span><span class="cx">     auto device = GStreamerVideoCaptureDeviceManager::singleton().gstreamerDeviceWithUID(deviceID);
</span><span class="lines">@@ -84,11 +99,16 @@
</span><span class="cx">     return CaptureSourceOrError(WTFMove(source));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::VideoCaptureFactory& GStreamerVideoCaptureSource::factory()
</del><ins>+VideoCaptureFactory& GStreamerVideoCaptureSource::factory()
</ins><span class="cx"> {
</span><span class="cx">     return libWebRTCVideoCaptureSourceFactory();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DisplayCaptureFactory& GStreamerVideoCaptureSource::displayFactory()
+{
+    return libWebRTCDisplayCaptureSourceFactory();
+}
+
</ins><span class="cx"> GStreamerVideoCaptureSource::GStreamerVideoCaptureSource(const String& deviceID, const String& name, const gchar *source_factory)
</span><span class="cx">     : RealtimeMediaSource(deviceID, RealtimeMediaSource::Type::Video, name)
</span><span class="cx">     , m_capturer(std::make_unique<GStreamerVideoCapturer>(source_factory))
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerGStreamerVideoCaptureSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h        2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h   2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -32,6 +32,9 @@
</span><span class="cx">     static CaptureSourceOrError create(const String& deviceID, const MediaConstraints*);
</span><span class="cx">     WEBCORE_EXPORT static VideoCaptureFactory& factory();
</span><span class="cx"> 
</span><ins>+    // FIXME: Implement this.
+    WEBCORE_EXPORT static DisplayCaptureFactory& displayFactory(); 
+
</ins><span class="cx">     const RealtimeMediaSourceCapabilities& capabilities() override;
</span><span class="cx">     const RealtimeMediaSourceSettings& settings() override;
</span><span class="cx">     GstElement* pipeline() { return m_capturer->pipeline(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerRealtimeMediaSourceCenterLibWebRTCcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp       2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp  2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::AudioCaptureFactory& RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory()
</del><ins>+AudioCaptureFactory& RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory()
</ins><span class="cx"> {
</span><span class="cx">     return RealtimeMediaSourceCenterLibWebRTC::singleton().audioFactory();
</span><span class="cx"> }
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::AudioCaptureFactory& RealtimeMediaSourceCenterLibWebRTC::audioFactory()
</del><ins>+AudioCaptureFactory& RealtimeMediaSourceCenterLibWebRTC::audioFactory()
</ins><span class="cx"> {
</span><span class="cx">     if (m_audioFactoryOverride)
</span><span class="cx">         return *m_audioFactoryOverride;
</span><span class="lines">@@ -65,11 +65,16 @@
</span><span class="cx">     return GStreamerAudioCaptureSource::factory();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::VideoCaptureFactory& RealtimeMediaSourceCenterLibWebRTC::videoFactory()
</del><ins>+VideoCaptureFactory& RealtimeMediaSourceCenterLibWebRTC::videoFactory()
</ins><span class="cx"> {
</span><span class="cx">     return GStreamerVideoCaptureSource::factory();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DisplayCaptureFactory& RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory()
+{
+    return GStreamerVideoCaptureSource::displayFactory();
+}
+
</ins><span class="cx"> CaptureDeviceManager& RealtimeMediaSourceCenterLibWebRTC::audioCaptureDeviceManager()
</span><span class="cx"> {
</span><span class="cx">     return GStreamerAudioCaptureDeviceManager::singleton();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerRealtimeMediaSourceCenterLibWebRTCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h 2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h    2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -38,8 +38,8 @@
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT static RealtimeMediaSourceCenterLibWebRTC& singleton();
</span><span class="cx"> 
</span><del>-    static RealtimeMediaSource::VideoCaptureFactory& videoCaptureSourceFactory();
-    static RealtimeMediaSource::AudioCaptureFactory& audioCaptureSourceFactory();
</del><ins>+    static VideoCaptureFactory& videoCaptureSourceFactory();
+    static AudioCaptureFactory& audioCaptureSourceFactory();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class NeverDestroyed<RealtimeMediaSourceCenterLibWebRTC>;
</span><span class="lines">@@ -46,17 +46,18 @@
</span><span class="cx">     RealtimeMediaSourceCenterLibWebRTC();
</span><span class="cx">     ~RealtimeMediaSourceCenterLibWebRTC();
</span><span class="cx"> 
</span><del>-    void setAudioFactory(RealtimeMediaSource::AudioCaptureFactory& factory) final { m_audioFactoryOverride = &factory; }
-    void unsetAudioFactory(RealtimeMediaSource::AudioCaptureFactory&) final { m_audioFactoryOverride = nullptr; }
</del><ins>+    void setAudioFactory(AudioCaptureFactory& factory) final { m_audioFactoryOverride = &factory; }
+    void unsetAudioFactory(AudioCaptureFactory&) final { m_audioFactoryOverride = nullptr; }
</ins><span class="cx"> 
</span><del>-    RealtimeMediaSource::AudioCaptureFactory& audioFactory() final;
-    RealtimeMediaSource::VideoCaptureFactory& videoFactory() final;
</del><ins>+    AudioCaptureFactory& audioFactory() final;
+    VideoCaptureFactory& videoFactory() final;
+    DisplayCaptureFactory& displayCaptureFactory() final;
</ins><span class="cx"> 
</span><span class="cx">     CaptureDeviceManager& audioCaptureDeviceManager() final;
</span><span class="cx">     CaptureDeviceManager& videoCaptureDeviceManager() final;
</span><span class="cx">     CaptureDeviceManager& displayCaptureDeviceManager() final;
</span><span class="cx"> 
</span><del>-    RealtimeMediaSource::AudioCaptureFactory* m_audioFactoryOverride { nullptr };
</del><ins>+    AudioCaptureFactory* m_audioFactoryOverride { nullptr };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacAVVideoCaptureSourcemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm    2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm       2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx"> AVVideoCaptureSource::~AVVideoCaptureSource()
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    RealtimeMediaSourceCenterMac::videoCaptureSourceFactory().unsetActiveSource(*this);
</del><ins>+    RealtimeMediaSourceCenter::singleton().videoFactory().unsetActiveSource(*this);
</ins><span class="cx"> #endif
</span><span class="cx">     [m_objcObserver disconnect];
</span><span class="cx"> 
</span><span class="lines">@@ -194,7 +194,6 @@
</span><span class="cx">     [m_session removeObserver:m_objcObserver.get() forKeyPath:@"rate"];
</span><span class="cx">     if ([m_session isRunning])
</span><span class="cx">         [m_session stopRunning];
</span><del>-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AVVideoCaptureSource::startProducingData()
</span><span class="lines">@@ -437,7 +436,7 @@
</span><span class="cx"> bool AVVideoCaptureSource::setupCaptureSession()
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    RealtimeMediaSourceCenterMac::videoCaptureSourceFactory().setActiveSource(*this);
</del><ins>+    RealtimeMediaSourceCenter::singleton().videoFactory().setActiveSource(*this);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     NSError *error = nil;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacCoreAudioCaptureSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp 2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp    2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -769,7 +769,7 @@
</span><span class="cx">     CoreAudioSharedUnit::singleton().reconfigureAudioUnit();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::AudioCaptureFactory& CoreAudioCaptureSource::factory()
</del><ins>+AudioCaptureFactory& CoreAudioCaptureSource::factory()
</ins><span class="cx"> {
</span><span class="cx">     return CoreAudioCaptureSourceFactory::singleton();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacCoreAudioCaptureSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h   2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h      2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "CAAudioStreamDescription.h"
</span><span class="cx"> #include "CaptureDevice.h"
</span><span class="cx"> #include "RealtimeMediaSource.h"
</span><ins>+#include "RealtimeMediaSourceFactory.h"
</ins><span class="cx"> #include <AudioToolbox/AudioToolbox.h>
</span><span class="cx"> #include <CoreAudio/CoreAudioTypes.h>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="lines">@@ -108,7 +109,7 @@
</span><span class="cx">     bool m_resumePending { false };
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-class CoreAudioCaptureSourceFactory : public RealtimeMediaSource::AudioCaptureFactory {
</del><ins>+class CoreAudioCaptureSourceFactory : public AudioCaptureFactory {
</ins><span class="cx"> public:
</span><span class="cx">     static CoreAudioCaptureSourceFactory& singleton();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacRealtimeMediaSourceCenterMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp   2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp      2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -46,15 +46,33 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class VideoCaptureSourceFactoryMac final : public RealtimeMediaSource::VideoCaptureFactory
-{
</del><ins>+class VideoCaptureSourceFactoryMac final : public VideoCaptureFactory {
</ins><span class="cx"> public:
</span><span class="cx">     CaptureSourceOrError createVideoCaptureSource(const CaptureDevice& device, const MediaConstraints* constraints) final
</span><span class="cx">     {
</span><ins>+        ASSERT(device.type() == CaptureDevice::DeviceType::Camera);
+        return AVVideoCaptureSource::create(device.persistentId(), constraints);
+    }
+
+#if PLATFORM(IOS)
+private:
+    void setVideoCapturePageState(bool interrupted, bool pageMuted)
+    {
+        if (activeSource())
+            activeSource()->setInterrupted(interrupted, pageMuted);
+    }
+#endif
+};
+
+class DisplayCaptureSourceFactoryMac final : public DisplayCaptureFactory {
+public:
+    CaptureSourceOrError createDisplayCaptureSource(const CaptureDevice& device, const MediaConstraints* constraints) final
+    {
+#if PLATFORM(IOS)
+        UNUSED_PARAM(device);
+        UNUSED_PARAM(constraints);
+#endif
</ins><span class="cx">         switch (device.type()) {
</span><del>-        case CaptureDevice::DeviceType::Camera:
-            return AVVideoCaptureSource::create(device.persistentId(), constraints);
-            break;
</del><span class="cx">         case CaptureDevice::DeviceType::Screen:
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">             return ScreenDisplayCaptureSourceMac::create(device.persistentId(), constraints);
</span><span class="lines">@@ -66,6 +84,7 @@
</span><span class="cx">         case CaptureDevice::DeviceType::Application:
</span><span class="cx">         case CaptureDevice::DeviceType::Browser:
</span><span class="cx">         case CaptureDevice::DeviceType::Microphone:
</span><ins>+        case CaptureDevice::DeviceType::Camera:
</ins><span class="cx">         case CaptureDevice::DeviceType::Unknown:
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">             break;
</span><span class="lines">@@ -73,25 +92,22 @@
</span><span class="cx"> 
</span><span class="cx">         return { };
</span><span class="cx">     }
</span><del>-
-#if PLATFORM(IOS)
-private:
-    void setVideoCapturePageState(bool interrupted, bool pageMuted)
-    {
-        if (activeSource())
-            activeSource()->setInterrupted(interrupted, pageMuted);
-    }
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::VideoCaptureFactory& RealtimeMediaSourceCenterMac::videoCaptureSourceFactory()
</del><ins>+VideoCaptureFactory& RealtimeMediaSourceCenterMac::videoCaptureSourceFactory()
</ins><span class="cx"> {
</span><span class="cx">     static NeverDestroyed<VideoCaptureSourceFactoryMac> factory;
</span><span class="cx">     return factory.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::AudioCaptureFactory& RealtimeMediaSourceCenterMac::audioCaptureSourceFactory()
</del><ins>+DisplayCaptureFactory& RealtimeMediaSourceCenterMac::displayCaptureSourceFactory()
</ins><span class="cx"> {
</span><ins>+    static NeverDestroyed<DisplayCaptureSourceFactoryMac> factory;
+    return factory.get();
+}
+
+AudioCaptureFactory& RealtimeMediaSourceCenterMac::audioCaptureSourceFactory()
+{
</ins><span class="cx">     return RealtimeMediaSourceCenterMac::singleton().audioFactory();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -112,7 +128,7 @@
</span><span class="cx"> RealtimeMediaSourceCenterMac::~RealtimeMediaSourceCenterMac() = default;
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::AudioCaptureFactory& RealtimeMediaSourceCenterMac::audioFactory()
</del><ins>+AudioCaptureFactory& RealtimeMediaSourceCenterMac::audioFactory()
</ins><span class="cx"> {
</span><span class="cx">     if (m_audioFactoryOverride)
</span><span class="cx">         return *m_audioFactoryOverride;
</span><span class="lines">@@ -120,11 +136,16 @@
</span><span class="cx">     return CoreAudioCaptureSource::factory();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RealtimeMediaSource::VideoCaptureFactory& RealtimeMediaSourceCenterMac::videoFactory()
</del><ins>+VideoCaptureFactory& RealtimeMediaSourceCenterMac::videoFactory()
</ins><span class="cx"> {
</span><span class="cx">     return videoCaptureSourceFactory();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DisplayCaptureFactory& RealtimeMediaSourceCenterMac::displayCaptureFactory()
+{
+    return displayCaptureSourceFactory();
+}
+
</ins><span class="cx"> CaptureDeviceManager& RealtimeMediaSourceCenterMac::audioCaptureDeviceManager()
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacRealtimeMediaSourceCenterMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.h     2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.h        2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -44,8 +44,9 @@
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT static RealtimeMediaSourceCenterMac& singleton();
</span><span class="cx"> 
</span><del>-    static RealtimeMediaSource::VideoCaptureFactory& videoCaptureSourceFactory();
-    static RealtimeMediaSource::AudioCaptureFactory& audioCaptureSourceFactory();
</del><ins>+    static VideoCaptureFactory& videoCaptureSourceFactory();
+    static AudioCaptureFactory& audioCaptureSourceFactory();
+    static DisplayCaptureFactory& displayCaptureSourceFactory();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class NeverDestroyed<RealtimeMediaSourceCenterMac>;
</span><span class="lines">@@ -52,17 +53,18 @@
</span><span class="cx">     RealtimeMediaSourceCenterMac();
</span><span class="cx">     ~RealtimeMediaSourceCenterMac();
</span><span class="cx"> 
</span><del>-    void setAudioFactory(RealtimeMediaSource::AudioCaptureFactory& factory) final { m_audioFactoryOverride = &factory; }
-    void unsetAudioFactory(RealtimeMediaSource::AudioCaptureFactory&) final { m_audioFactoryOverride = nullptr; }
</del><ins>+    void setAudioFactory(AudioCaptureFactory& factory) final { m_audioFactoryOverride = &factory; }
+    void unsetAudioFactory(AudioCaptureFactory&) final { m_audioFactoryOverride = nullptr; }
</ins><span class="cx"> 
</span><del>-    RealtimeMediaSource::AudioCaptureFactory& audioFactory() final;
-    RealtimeMediaSource::VideoCaptureFactory& videoFactory() final;
</del><ins>+    AudioCaptureFactory& audioFactory() final;
+    VideoCaptureFactory& videoFactory() final;
+    DisplayCaptureFactory& displayCaptureFactory() final;
</ins><span class="cx"> 
</span><span class="cx">     CaptureDeviceManager& audioCaptureDeviceManager() final;
</span><span class="cx">     CaptureDeviceManager& videoCaptureDeviceManager() final;
</span><span class="cx">     CaptureDeviceManager& displayCaptureDeviceManager() final;
</span><span class="cx"> 
</span><del>-    RealtimeMediaSource::AudioCaptureFactory* m_audioFactoryOverride { nullptr };
</del><ins>+    AudioCaptureFactory* m_audioFactoryOverride { nullptr };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeAudioSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp   2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp      2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -42,19 +42,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class MockRealtimeAudioSourceFactory : public RealtimeMediaSource::AudioCaptureFactory
-{
-public:
-    CaptureSourceOrError createAudioCaptureSource(const CaptureDevice& device, const MediaConstraints* constraints) final
-    {
-        for (auto& mockDevice : MockRealtimeMediaSourceCenter::audioDevices()) {
-            if (mockDevice.persistentId() == device.persistentId())
-                return MockRealtimeAudioSource::create(mockDevice.persistentId(), mockDevice.label(), constraints);
-        }
-        return { };
-    }
-};
-
</del><span class="cx"> #if !PLATFORM(MAC) && !PLATFORM(IOS) && !(USE(GSTREAMER) && USE(LIBWEBRTC))
</span><span class="cx"> CaptureSourceOrError MockRealtimeAudioSource::create(const String& deviceID, const String& name, const MediaConstraints* constraints)
</span><span class="cx"> {
</span><span class="lines">@@ -71,17 +58,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static MockRealtimeAudioSourceFactory& mockAudioCaptureSourceFactory()
-{
-    static NeverDestroyed<MockRealtimeAudioSourceFactory> factory;
-    return factory.get();
-}
-
-RealtimeMediaSource::AudioCaptureFactory& MockRealtimeAudioSource::factory()
-{
-    return mockAudioCaptureSourceFactory();
-}
-
</del><span class="cx"> MockRealtimeAudioSource::MockRealtimeAudioSource(const String& deviceID, const String& name)
</span><span class="cx">     : RealtimeMediaSource(deviceID, RealtimeMediaSource::Type::Audio, name)
</span><span class="cx">     , m_timer(RunLoop::current(), this, &MockRealtimeAudioSource::tick)
</span><span class="lines">@@ -94,7 +70,7 @@
</span><span class="cx"> MockRealtimeAudioSource::~MockRealtimeAudioSource()
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    MockRealtimeMediaSourceCenter::audioCaptureSourceFactory().unsetActiveSource(*this);
</del><ins>+    RealtimeMediaSourceCenter::singleton().audioFactory().unsetActiveSource(*this);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -143,7 +119,7 @@
</span><span class="cx"> void MockRealtimeAudioSource::startProducingData()
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    MockRealtimeMediaSourceCenter::audioCaptureSourceFactory().setActiveSource(*this);
</del><ins>+    RealtimeMediaSourceCenter::singleton().audioFactory().setActiveSource(*this);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (!sampleRate())
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeAudioSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.h     2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.h        2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "ImageBuffer.h"
</span><span class="cx"> #include "MockMediaDevice.h"
</span><ins>+#include "RealtimeMediaSourceFactory.h"
</ins><span class="cx"> #include <wtf/RunLoop.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -43,8 +44,6 @@
</span><span class="cx"> 
</span><span class="cx">     static CaptureSourceOrError create(const String& deviceID, const String& name, const MediaConstraints*);
</span><span class="cx"> 
</span><del>-    static AudioCaptureFactory& factory();
-
</del><span class="cx">     virtual ~MockRealtimeAudioSource();
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeMediaSourceCentercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp     2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp        2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -83,6 +83,62 @@
</span><span class="cx">     };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+class MockRealtimeVideoSourceFactory : public VideoCaptureFactory {
+public:
+    CaptureSourceOrError createVideoCaptureSource(const CaptureDevice& device, const MediaConstraints* constraints) final
+    {
+        ASSERT(device.type() == CaptureDevice::DeviceType::Camera);
+        ASSERT(MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(CaptureDevice::DeviceType::Camera, device.persistentId()));
+
+        return MockRealtimeVideoSource::create(device.persistentId(), device.label(), constraints);
+    }
+
+#if PLATFORM(IOS)
+private:
+    void setVideoCapturePageState(bool interrupted, bool pageMuted)
+    {
+        if (activeSource())
+            activeSource()->setInterrupted(interrupted, pageMuted);
+    }
+#endif
+};
+
+class MockRealtimeDisplaySourceFactory : public DisplayCaptureFactory {
+public:
+    CaptureSourceOrError createDisplayCaptureSource(const CaptureDevice& device, const MediaConstraints* constraints) final
+    {
+        ASSERT(MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(device.type(), device.persistentId()));
+
+        switch (device.type()) {
+        case CaptureDevice::DeviceType::Screen:
+        case CaptureDevice::DeviceType::Window:
+            return MockRealtimeVideoSource::create(device.persistentId(), device.label(), constraints);
+            break;
+        case CaptureDevice::DeviceType::Application:
+        case CaptureDevice::DeviceType::Browser:
+        case CaptureDevice::DeviceType::Microphone:
+        case CaptureDevice::DeviceType::Camera:
+        case CaptureDevice::DeviceType::Unknown:
+            ASSERT_NOT_REACHED();
+            break;
+        }
+
+        return { };
+    }
+};
+
+class MockRealtimeAudioSourceFactory : public AudioCaptureFactory {
+public:
+    CaptureSourceOrError createAudioCaptureSource(const CaptureDevice& device, const MediaConstraints* constraints) final
+    {
+        ASSERT(device.type() == CaptureDevice::DeviceType::Microphone);
+        ASSERT(MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(CaptureDevice::DeviceType::Microphone, device.persistentId()));
+
+        return MockRealtimeAudioSource::create(device.persistentId(), device.label(), constraints);
+    }
+};
+
</ins><span class="cx"> static Vector<MockMediaDevice>& devices()
</span><span class="cx"> {
</span><span class="cx">     static auto devices = makeNeverDestroyed([] {
</span><span class="lines">@@ -254,6 +310,24 @@
</span><span class="cx">     return displayDevices;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+AudioCaptureFactory& MockRealtimeMediaSourceCenter::audioFactory()
+{
+    static NeverDestroyed<MockRealtimeAudioSourceFactory> factory;
+    return factory.get();
+}
+
+VideoCaptureFactory& MockRealtimeMediaSourceCenter::videoFactory()
+{
+    static NeverDestroyed<MockRealtimeVideoSourceFactory> factory;
+    return factory.get();
+}
+
+DisplayCaptureFactory& MockRealtimeMediaSourceCenter::displayCaptureFactory()
+{
+    static NeverDestroyed<MockRealtimeDisplaySourceFactory> factory;
+    return factory.get();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MEDIA_STREAM)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeMediaSourceCenterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h       2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h  2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -45,9 +45,6 @@
</span><span class="cx">     WEBCORE_EXPORT static void removeDevice(const String& persistentId);
</span><span class="cx">     WEBCORE_EXPORT static void resetDevices();
</span><span class="cx"> 
</span><del>-    static RealtimeMediaSource::VideoCaptureFactory& videoCaptureSourceFactory() { return MockRealtimeVideoSource::factory(); }
-    static RealtimeMediaSource::AudioCaptureFactory& audioCaptureSourceFactory() { return MockRealtimeAudioSource::factory(); }
-
</del><span class="cx">     static Vector<CaptureDevice>& audioDevices();
</span><span class="cx">     static Vector<CaptureDevice>& videoDevices();
</span><span class="cx">     static Vector<CaptureDevice>& displayDevices();
</span><span class="lines">@@ -61,8 +58,9 @@
</span><span class="cx"> 
</span><span class="cx">     static MockRealtimeMediaSourceCenter& singleton();
</span><span class="cx"> 
</span><del>-    RealtimeMediaSource::AudioCaptureFactory& audioFactory() final { return MockRealtimeAudioSource::factory(); }
-    RealtimeMediaSource::VideoCaptureFactory& videoFactory() final { return MockRealtimeVideoSource::factory(); }
</del><ins>+    AudioCaptureFactory& audioFactory() final;
+    VideoCaptureFactory& videoFactory() final;
+    DisplayCaptureFactory& displayCaptureFactory() final;
</ins><span class="cx"> 
</span><span class="cx">     CaptureDeviceManager& audioCaptureDeviceManager() final { return m_audioCaptureDeviceManager; }
</span><span class="cx">     CaptureDeviceManager& videoCaptureDeviceManager() final { return m_videoCaptureDeviceManager; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeVideoSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp   2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp      2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -48,40 +48,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class MockRealtimeVideoSourceFactory : public RealtimeMediaSource::VideoCaptureFactory
-{
-public:
-    CaptureSourceOrError createVideoCaptureSource(const CaptureDevice& device, const MediaConstraints* constraints) final
-    {
-        ASSERT(MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(device.type(), device.persistentId()));
-
-        switch (device.type()) {
-        case CaptureDevice::DeviceType::Camera:
-        case CaptureDevice::DeviceType::Screen:
-        case CaptureDevice::DeviceType::Window:
-            return MockRealtimeVideoSource::create(device.persistentId(), device.label(), constraints);
-            break;
-        case CaptureDevice::DeviceType::Application:
-        case CaptureDevice::DeviceType::Browser:
-        case CaptureDevice::DeviceType::Microphone:
-        case CaptureDevice::DeviceType::Unknown:
-            ASSERT_NOT_REACHED();
-            break;
-        }
-
-        return { };
-    }
-
-#if PLATFORM(IOS)
-private:
-    void setVideoCapturePageState(bool interrupted, bool pageMuted)
-    {
-        if (activeSource())
-            activeSource()->setInterrupted(interrupted, pageMuted);
-    }
-#endif
-};
-
</del><span class="cx"> #if !PLATFORM(MAC) && !PLATFORM(IOS) && !(USE(GSTREAMER) && USE(LIBWEBRTC))
</span><span class="cx"> CaptureSourceOrError MockRealtimeVideoSource::create(const String& deviceID, const String& name, const MediaConstraints* constraints)
</span><span class="cx"> {
</span><span class="lines">@@ -98,17 +64,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static MockRealtimeVideoSourceFactory& mockVideoCaptureSourceFactory()
-{
-    static NeverDestroyed<MockRealtimeVideoSourceFactory> factory;
-    return factory.get();
-}
-
-RealtimeMediaSource::VideoCaptureFactory& MockRealtimeVideoSource::factory()
-{
-    return mockVideoCaptureSourceFactory();
-}
-
</del><span class="cx"> MockRealtimeVideoSource::MockRealtimeVideoSource(const String& deviceID, const String& name)
</span><span class="cx">     : RealtimeVideoSource(deviceID, name)
</span><span class="cx">     , m_emitFrameTimer(RunLoop::current(), this, &MockRealtimeVideoSource::generateFrame)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeVideoSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h     2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h        2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "FontCascade.h"
</span><span class="cx"> #include "ImageBuffer.h"
</span><span class="cx"> #include "MockMediaDevice.h"
</span><ins>+#include "RealtimeMediaSourceFactory.h"
</ins><span class="cx"> #include "RealtimeVideoSource.h"
</span><span class="cx"> #include <wtf/RunLoop.h>
</span><span class="cx"> 
</span><span class="lines">@@ -49,8 +50,6 @@
</span><span class="cx"> 
</span><span class="cx">     static CaptureSourceOrError create(const String& deviceID, const String& name, const MediaConstraints*);
</span><span class="cx"> 
</span><del>-    static VideoCaptureFactory& factory();
-
</del><span class="cx"> protected:
</span><span class="cx">     MockRealtimeVideoSource(const String& deviceID, const String& name);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebKit/ChangeLog       2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2018-09-30  Eric Carlson  <eric.carlson@apple.com>
+
+        [MediaStream] Use display-specific capture factories
+        https://bugs.webkit.org/show_bug.cgi?id=190043
+        <rdar://problem/44834412>
+
+        Reviewed by Youenn Fablet.
+
+        * WebProcess/cocoa/UserMediaCaptureManager.h:
+
</ins><span class="cx"> 2018-09-29  Commit Queue  <commit-queue@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r236631.
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcesscocoaUserMediaCaptureManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.h (236644 => 236645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.h   2018-09-29 17:40:17 UTC (rev 236644)
+++ trunk/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.h      2018-09-30 07:02:39 UTC (rev 236645)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "SharedMemory.h"
</span><span class="cx"> #include "WebProcessSupplement.h"
</span><span class="cx"> #include <WebCore/RealtimeMediaSource.h>
</span><ins>+#include <WebCore/RealtimeMediaSourceFactory.h>
</ins><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -42,7 +43,7 @@
</span><span class="cx"> class CrossProcessRealtimeAudioSource;
</span><span class="cx"> class WebProcess;
</span><span class="cx"> 
</span><del>-class UserMediaCaptureManager : public WebProcessSupplement, public IPC::MessageReceiver, public WebCore::RealtimeMediaSource::AudioCaptureFactory, public WebCore::RealtimeMediaSource::VideoCaptureFactory {
</del><ins>+class UserMediaCaptureManager : public WebProcessSupplement, public IPC::MessageReceiver, public WebCore::AudioCaptureFactory, public WebCore::VideoCaptureFactory {
</ins><span class="cx"> public:
</span><span class="cx">     explicit UserMediaCaptureManager(WebProcess&);
</span><span class="cx">     ~UserMediaCaptureManager();
</span></span></pre>
</div>
</div>

</body>
</html>