Support connecting a MediaStreamAudioDestinationNode to RTCPeerConnection
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Jul 2018 00:04:30 +0000 (00:04 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Jul 2018 00:04:30 +0000 (00:04 +0000)
commit20ce743a0620f8c1a146050d75eec0585fd96133
tree1136b6f9b25014b76e3a871887baf09dc9f71683
parenta09fa9d9ddfd009da9a1506c84ed6b6d9ab731e4
Support connecting a MediaStreamAudioDestinationNode to RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=187627
<rdar://problem/35334400>

Reviewed by Jer Noble.

Source/WebCore:

When MediaStreamAudioSource is called to read new audio samples,
convert these samples to a WebAudioBufferList and call RealtimeMediaSource::audioSamplesAvailable.
This makes its observers to get the audio data.

Test: webrtc/peer-connection-createMediaStreamDestination.html

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::create): Minor refactoring.
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::createMediaStream):
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
(WebCore::MediaStreamAudioDestinationNode::process):
* Modules/webaudio/MediaStreamAudioDestinationNode.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource):
(WebCore::MediaStreamAudioSource::consumeAudio):
* Modules/webaudio/MediaStreamAudioSource.h:
* Modules/webaudio/MediaStreamAudioSourceCocoa.cpp: Added.
(WebCore::streamDescription):
(WebCore::MediaStreamAudioSource::consumeAudio):
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/AudioDestinationConsumer.h: Removed.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::create):
* platform/mediastream/MediaStreamPrivate.h:

LayoutTests:

* webrtc/peer-connection-createMediaStreamDestination-expected.txt: Added.
* webrtc/peer-connection-createMediaStreamDestination.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/webrtc/peer-connection-createMediaStreamDestination-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/peer-connection-createMediaStreamDestination.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp
Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.h
Source/WebCore/Modules/webaudio/MediaStreamAudioSource.cpp
Source/WebCore/Modules/webaudio/MediaStreamAudioSource.h
Source/WebCore/Modules/webaudio/MediaStreamAudioSourceCocoa.cpp [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/audio/AudioDestinationConsumer.h [deleted file]
Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp
Source/WebCore/platform/mediastream/MediaStreamPrivate.h