Make passing PlatformAudioData in audioSamplesAvaliable const-correct.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2017 20:28:44 +0000 (20:28 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2017 20:28:44 +0000 (20:28 +0000)
commit9749d15aec3a86bc385b71b3bdf13d84634e6afa
tree3c86494e32723b586f43efa50e209d84438b0a1a
parent74eeed544a2bad5f2a68fd862f5b31963b071f28
Make passing PlatformAudioData in audioSamplesAvaliable const-correct.
https://bugs.webkit.org/show_bug.cgi?id=168051

Reviewed by Eric Carlson.

Modify all the functions which take a (conceptually) read-only audio buffer const-correct.

Drive-by fix: AudioSampleBufferList::copyFrom() set a ivar pointer to the passed in
AudioBufferList. Ensure that the ivar is reset when copyFrom() returns by using a
SetForScope.

* platform/audio/mac/AudioSampleBufferList.cpp:
(WebCore::AudioSampleBufferList::copyFrom):
* platform/audio/mac/AudioSampleBufferList.h:
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pushSamples):
* platform/audio/mac/AudioSampleDataSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::audioSamplesAvailable):
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/audio/mac/AudioSampleBufferList.cpp
Source/WebCore/platform/audio/mac/AudioSampleBufferList.h
Source/WebCore/platform/audio/mac/AudioSampleDataSource.cpp
Source/WebCore/platform/audio/mac/AudioSampleDataSource.h
Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSource.h
Source/WebCore/platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp
Source/WebCore/platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h