Add basic implementation for MediaStreamAudioDestinationNode
https://bugs.webkit.org/show_bug.cgi?id=101815

Reviewed by Chris Rogers.

Source/Platform:

Adds the consumer interface and related functionality to WebMediaStreamSource.

* chromium/public/WebAudioDestinationConsumer.h: Added.
(WebKit):
(WebAudioDestinationConsumer):
(WebKit::WebAudioDestinationConsumer::~WebAudioDestinationConsumer):
* chromium/public/WebMediaStreamSource.h:
(WebKit):
(WebMediaStreamSource):

Source/WebCore:

Implements an audio destination node which has a MediaStream.
This can be added to a PeerConnection with peerConnection.addStream().
Please see use case (3):
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/webrtc-integration.html

Test: webaudio/mediastreamaudiodestinationnode.html

* Modules/webaudio/AudioContext.cpp:
(WebCore):
(WebCore::AudioContext::createMediaStreamDestination):
* Modules/webaudio/AudioContext.h:
(WebCore):
(AudioContext):
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp: Added.
(WebCore):
(WebCore::MediaStreamAudioDestinationNode::create):
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
(WebCore::MediaStreamAudioDestinationNode::mediaStreamSource):
(WebCore::MediaStreamAudioDestinationNode::~MediaStreamAudioDestinationNode):
(WebCore::MediaStreamAudioDestinationNode::process):
(WebCore::MediaStreamAudioDestinationNode::reset):
* Modules/webaudio/MediaStreamAudioDestinationNode.h: Added.
(WebCore):
(MediaStreamAudioDestinationNode):
(WebCore::MediaStreamAudioDestinationNode::stream):
* Modules/webaudio/MediaStreamAudioDestinationNode.idl: Added.
* WebCore.gypi:
* platform/audio/AudioDestinationConsumer.h: Copied from Source/WebCore/platform/mediastream/MediaStreamSource.cpp.
(WebCore):
(AudioDestinationConsumer):
(WebCore::AudioDestinationConsumer::~AudioDestinationConsumer):
* platform/chromium/support/WebMediaStreamSource.cpp:
(WebKit::WebMediaStreamSource::extraData):
(WebKit::WebMediaStreamSource::setExtraData):
(WebKit::WebMediaStreamSource::requiresAudioConsumer):
(WebKit):
(ConsumerWrapper):
(WebKit::ConsumerWrapper::create):
(WebKit::ConsumerWrapper::consumer):
(WebKit::ConsumerWrapper::ConsumerWrapper):
(WebKit::ConsumerWrapper::consumeAudio):
(WebKit::WebMediaStreamSource::addAudioConsumer):
(WebKit::WebMediaStreamSource::removeAudioConsumer):
* platform/mediastream/MediaStreamSource.cpp:
(WebCore::MediaStreamSource::create):
(WebCore::MediaStreamSource::MediaStreamSource):
(WebCore::MediaStreamSource::addAudioConsumer):
(WebCore):
(WebCore::MediaStreamSource::removeAudioConsumer):
(WebCore::MediaStreamSource::consumeAudio):
* platform/mediastream/MediaStreamSource.h:
(WebCore):
(MediaStreamSource):
(WebCore::MediaStreamSource::requiresAudioConsumer):
(WebCore::MediaStreamSource::audioConsumers):

Tools:

Adds a bit of code that exercises the WebKit API.

* DumpRenderTree/chromium/MockWebMediaStreamCenter.cpp:
(MockWebMediaStreamSourceConsumer):
(MockWebMediaStreamSourceConsumer::~MockWebMediaStreamSourceConsumer):
(MockWebMediaStreamCenter::didCreateMediaStream):

LayoutTests:

* webaudio/mediastreamaudiodestinationnode-expected.txt: Added.
* webaudio/mediastreamaudiodestinationnode.html: Added.


git-svn-id: https://svn.webkit.org/repository/webkit/trunk/Source/Platform/chromium/public@135985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2 files changed
tree: 48d3402b4c9c796189e8fa3f02a2dfbe70ca2f98
  1. android/
  2. default/
  3. linux/
  4. mac/
  5. win/
  6. Platform.h
  7. WebAnimation.h
  8. WebAnimationCurve.h
  9. WebAnimationDelegate.h
  10. WebAudioBus.h
  11. WebAudioDestinationConsumer.h
  12. WebAudioDevice.h
  13. WebBlobData.h
  14. WebBlobRegistry.h
  15. WebCanvas.h
  16. WebClipboard.h
  17. WebColor.h
  18. WebCommon.h
  19. WebCompositorFrame.h
  20. WebCompositorFrameAck.h
  21. WebCompositorOutputSurface.h
  22. WebCompositorOutputSurfaceClient.h
  23. WebCompositorSoftwareOutputDevice.h
  24. WebCompositorSupport.h
  25. WebCompositorTransferableResourceList.h
  26. WebContentLayer.h
  27. WebContentLayerClient.h
  28. WebCookie.h
  29. WebCookieJar.h
  30. WebCString.h
  31. WebData.h
  32. WebDelegatedRendererLayer.h
  33. WebDragData.h
  34. WebExternalTextureLayer.h
  35. WebExternalTextureLayerClient.h
  36. WebFileInfo.h
  37. WebFileSystem.h
  38. WebFileUtilities.h
  39. WebFilterOperation.h
  40. WebFilterOperations.h
  41. WebFlingAnimator.h
  42. WebFloatAnimationCurve.h
  43. WebFloatKeyframe.h
  44. WebFloatPoint.h
  45. WebFloatQuad.h
  46. WebFloatRect.h
  47. WebGamepad.h
  48. WebGamepads.h
  49. WebGestureCurve.h
  50. WebGestureCurveTarget.h
  51. WebGraphicsContext3D.h
  52. WebGraphicsMemoryAllocation.h
  53. WebGraphicsMemoryStats.h
  54. WebHTTPBody.h
  55. WebHTTPHeaderVisitor.h
  56. WebHTTPLoadInfo.h
  57. WebImage.h
  58. WebImageLayer.h
  59. WebInputHandler.h
  60. WebInputHandlerClient.h
  61. WebIOSurfaceLayer.h
  62. WebLayer.h
  63. WebLayerScrollClient.h
  64. WebLayerTreeView.h
  65. WebLayerTreeViewClient.h
  66. WebLocalizedString.h
  67. WebMediaConstraints.h
  68. WebMediaStreamCenter.h
  69. WebMediaStreamCenterClient.h
  70. WebMediaStreamComponent.h
  71. WebMediaStreamDescriptor.h
  72. WebMediaStreamSource.h
  73. WebMediaStreamSourcesRequest.h
  74. WebMessagePortChannel.h
  75. WebMessagePortChannelClient.h
  76. WebMimeRegistry.h
  77. WebNonCopyable.h
  78. WebPoint.h
  79. WebPrerender.h
  80. WebPrerenderingSupport.h
  81. WebPrivateOwnPtr.h
  82. WebPrivatePtr.h
  83. WebRect.h
  84. WebReferrerPolicy.h
  85. WebRenderingStats.h
  86. WebRTCConfiguration.h
  87. WebRTCDataChannel.h
  88. WebRTCICECandidate.h
  89. WebRTCPeerConnectionHandler.h
  90. WebRTCPeerConnectionHandlerClient.h
  91. WebRTCSessionDescription.h
  92. WebRTCSessionDescriptionRequest.h
  93. WebRTCStatsRequest.h
  94. WebRTCStatsResponse.h
  95. WebRTCVoidRequest.h
  96. WebScreenInfo.h
  97. WebScrollbar.h
  98. WebScrollbarLayer.h
  99. WebScrollbarThemeGeometry.h
  100. WebScrollbarThemePainter.h
  101. WebSharedGraphicsContext3D.h
  102. WebSize.h
  103. WebSocketStreamError.h
  104. WebSocketStreamHandle.h
  105. WebSocketStreamHandleClient.h
  106. WebSolidColorLayer.h
  107. WebStorageArea.h
  108. WebStorageNamespace.h
  109. WebString.h
  110. WebThread.h
  111. WebThreadSafeData.h
  112. WebTransformAnimationCurve.h
  113. WebTransformationMatrix.h
  114. WebTransformKeyframe.h
  115. WebTransformOperations.h
  116. WebURL.h
  117. WebURLError.h
  118. WebURLLoader.h
  119. WebURLLoaderClient.h
  120. WebURLLoadTiming.h
  121. WebURLRequest.h
  122. WebURLResponse.h
  123. WebVector.h
  124. WebVideoFrame.h
  125. WebVideoFrameProvider.h
  126. WebVideoLayer.h
  127. WebWorkerRunLoop.h