[MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Apr 2017 19:22:23 +0000 (19:22 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Apr 2017 19:22:23 +0000 (19:22 +0000)
commit8b016576f2b16e11cc10ce89d3f943d5bfb03a28
tree2ebbff81811ae1898321dae96014859dd5aad262
parentfbb82f42c33592cc0a93ddeec7524e4c481eeba6
[MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=171021

Reviewed by Eric Carlson.

Source/WebCore:

Refactor the creation of RealtimeMediaSources to take a persistent device ID rather
than a CaptureDevice directly. This allows WebKit2 to iterate devices in the UIProcess
rather than the WebProcess.

* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::create):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
(WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
* platform/mock/MockRealtimeAudioSource.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:

Source/WebKit2:

Pass a deviceID rather than a CaptureDevice across the process boundary.

* Shared/WebCoreArgumentCoders.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints):
* WebProcess/cocoa/UserMediaCaptureManager.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215568 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/RealtimeMediaSource.h
Source/WebCore/platform/mediastream/mac/AVAudioCaptureSource.mm
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp
Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h
Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp
Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebCoreArgumentCoders.h
Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp
Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h
Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in
Source/WebKit2/WebProcess/cocoa/UserMediaCaptureManager.cpp
Source/WebKit2/WebProcess/cocoa/UserMediaCaptureManager.h