[MediaStream] Clean up RealtimeMediaSource interfaces
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Dec 2017 01:08:40 +0000 (01:08 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Dec 2017 01:08:40 +0000 (01:08 +0000)
commit3939a038f1b4a558095c194b9eba76c79019b6cc
tree1f0715bb4ce1cf2ba39e44f94c20b11904c32b1c
parent7aeb6db1193c9f00f8e1463ff88f4d7bcd1e8513
[MediaStream] Clean up RealtimeMediaSource interfaces
https://bugs.webkit.org/show_bug.cgi?id=180934
<rdar://problem/36108648>

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests, updated http/tests/media/media-stream/disconnected-frame.html.

Wrap video and audio constraints in a struct instead of passing both around as separate
parameters. Cleanup up the interface to RealTimeMediaSourceCenter.

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getUserMedia const):
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::create):
(WebCore::UserMediaRequest::UserMediaRequest):
(WebCore::UserMediaRequest::start):
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::contextDestroyed):
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::request const):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::persistentId const):
(WebCore::CaptureDevice::label const):
(WebCore::CaptureDevice::groupId const):
(WebCore::CaptureDevice::type const):
(WebCore::CaptureDevice::setPersistentId): Deleted.
(WebCore::CaptureDevice::setLabel): Deleted.
(WebCore::CaptureDevice::setGroupId): Deleted.
(WebCore::CaptureDevice::setType): Deleted.
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::getAudioSourcesInfo): Deleted.
(CaptureDeviceManager::getVideoSourcesInfo): Deleted.
(CaptureDeviceManager::deviceWithUID): Deleted.
* platform/mediastream/CaptureDeviceManager.h:
(WebCore::CaptureDeviceManager::captureDeviceWithPersistentID):
(WebCore::CaptureDeviceManager::refreshCaptureDevices):
* platform/mediastream/MediaStreamRequest.h: Copied from Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm.
(WebCore::MediaStreamRequest::encode const):
(WebCore::MediaStreamRequest::decode):
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream):
(WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
(WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID):
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceSettings.h:
* platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
(WebCore::AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice):
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
(WebCore::AVAudioSessionCaptureDeviceManager::captureDevices):
(WebCore::AVAudioSessionCaptureDeviceManager::captureDeviceWithPersistentID):
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::captureDevicesInternal):
(WebCore::AVCaptureDeviceManager::captureDevices):
(WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType):
(WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
(WebCore::AVCaptureDeviceManager::deviceDisconnected):
(WebCore::AVCaptureDeviceManager::getAudioSourcesInfo): Deleted.
(WebCore::AVCaptureDeviceManager::getVideoSourcesInfo): Deleted.
* platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
(WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice):
* platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
(WebCore::CoreAudioCaptureDeviceManager::captureDevices):
(WebCore::CoreAudioCaptureDeviceManager::captureDeviceWithPersistentID):
(WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
* platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::startProducingData):
(WebCore::MockRealtimeAudioSource::createMuted): Deleted.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::deviceMap):
(WebCore::MockRealtimeMediaSource::captureDeviceWithPersistentID):
(WebCore::MockRealtimeMediaSource::audioDevices):
(WebCore::MockRealtimeMediaSource::videoDevices):
(WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
* platform/mock/MockRealtimeMediaSource.h:
(WebCore::MockRealtimeMediaSource::device const):
(WebCore::MockRealtimeMediaSource::deviceIndex): Deleted.
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
(WebCore::MockRealtimeVideoSource::initializeCapabilities):
(WebCore::MockRealtimeVideoSource::generateFrame):
(WebCore::MockRealtimeVideoSource::createMuted): Deleted.
* platform/mock/MockRealtimeVideoSource.h:

Source/WebKit:

* Shared/WebCoreArgumentCoders.h: Update CaptureDevice encoder.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Renamed from createRequest.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Update for
API change.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter the
vector returned by getMediaStreamDevices.
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): Update for API change.
(WebKit::UserMediaPermissionRequestProxy::allow): Ditto.
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::create):
(WebKit::UserMediaPermissionRequestProxy::requestType const):

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Ditto.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): m_blockedRequests -> m_blockedUserMediaRequests.
(WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest): Ditto.
(WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto.
(WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

LayoutTests:

* http/tests/media/media-stream/disconnected-frame-expected.txt:
* http/tests/media/media-stream/disconnected-frame.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
46 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/media/media-stream/disconnected-frame-expected.txt
LayoutTests/http/tests/media/media-stream/disconnected-frame.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaDevices.cpp
Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj.orig [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj.rej [new file with mode: 0644]
Source/WebCore/platform/mediastream/CaptureDevice.h
Source/WebCore/platform/mediastream/CaptureDeviceManager.cpp
Source/WebCore/platform/mediastream/CaptureDeviceManager.h
Source/WebCore/platform/mediastream/MediaStreamRequest.h [new file with mode: 0644]
Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceSettings.h
Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm
Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h
Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm
Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h
Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm
Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDevice.cpp
Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp
Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.h
Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp
Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp
Source/WebCore/platform/mock/MockRealtimeAudioSource.h
Source/WebCore/platform/mock/MockRealtimeMediaSource.cpp
Source/WebCore/platform/mock/MockRealtimeMediaSource.h
Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebCoreArgumentCoders.h
Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.h
Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.cpp
Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.cpp.orig [new file with mode: 0644]
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp
Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.h