WebAudioSourceProviderAVFObjC should not reconfigure for each data call
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jul 2017 21:01:00 +0000 (21:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jul 2017 21:01:00 +0000 (21:01 +0000)
commit9314b2403e6fcd442144850e2cca58a79c26fba2
treed75174f1b7d522b2f28da5e9515e41d62e9a9c85
parent9628fdf317bc34439f3caee9b6df93370ef49fce
WebAudioSourceProviderAVFObjC should not reconfigure for each data call
https://bugs.webkit.org/show_bug.cgi?id=174101

Patch by Youenn Fablet <youenn@apple.com> on 2017-07-03
Reviewed by Eric Carlson.

Source/WebCore:

Covered by manual testing, in particular
https://webrtc.github.io/samples/src/content/peerconnection/webaudio-output/
and https://webrtc.github.io/samples/src/content/getusermedia/volume/.
Also improved LayoutTests web audio peer connection tests to make them more robust.

Before the patch, reconfiguration of the web audio provider was happening for every audioSamplesAvailable call.
It is now happening only when the format of the audio samples is changing.
Changed some member fields from uinque_ptr to optional as a minor improvement.

* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::provideInput):
(WebCore::WebAudioSourceProviderAVFObjC::prepare):
(WebCore::WebAudioSourceProviderAVFObjC::unprepare):
(WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):

LayoutTests:

* TestExpectations:
* webrtc/peer-connection-audio-mute2.html:
* webrtc/peer-connection-remote-audio-mute2.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/webrtc/peer-connection-audio-mute2.html
LayoutTests/webrtc/peer-connection-remote-audio-mute2.html
Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h
Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm