Incoming G722 doesn't work
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2018 21:36:53 +0000 (21:36 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2018 21:36:53 +0000 (21:36 +0000)
commit58d36ee16b8024860c971dfa792832f1bae100ea
treed006e70de8e2c5ea7c928181bc7cb728a36f6d48
parent59b53b6356650c727b645cbd86d71f7d81992ba5
Incoming G722 doesn't work
https://bugs.webkit.org/show_bug.cgi?id=186307
<rdar://problem/40809745>

Reviewed by Eric Carlson.

Source/WebCore:

WebRTC backends usually does the following:
- Initially call RealtimeIncomingAudioSource with 16KHz data
- Switch to 48KHz when actual data is decoded.
We added a check that was discarding any 16KHz data, but in case of G722, the data remains as 16KHz and is then never read.
The solution is to remove the check that discards 16KHz information.
We then need to fix a bug in AudioTrackPrivateMediaStreamCocoa that was preventing proper handling of change of audio data configuration.

Test: webrtc/audio-peer-connection-g722.html

* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
(WebCore::RealtimeIncomingAudioSourceCocoa::OnData):

LayoutTests:

* webrtc/audio-peer-connection-g722-expected.txt: Added.
* webrtc/audio-peer-connection-g722.html: Added.
* webrtc/routines.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/webrtc/audio-peer-connection-g722-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/audio-peer-connection-g722.html [new file with mode: 0644]
LayoutTests/webrtc/routines.js
Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp
Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp