Make RealtimeIncomingAudioSourceCocoa preallocate audio buffer
Created attachment 426223 [details] Patch
Comment on attachment 426223 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426223&action=review > Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:66 > + , m_numberOfChannels(1) One channel is the most common configuration? > Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:76 > + if (sampleRate != m_sampleRate) > + return; > + Why do we bail if the sample rate changes, but not the number of channels? You can remove the sample rate check in `if (!m_audioBufferList || m_sampleRate != sampleRate || m_numberOfChannels != numberOfChannels)`
Comment on attachment 426223 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426223&action=review >> Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:66 >> + , m_numberOfChannels(1) > > One channel is the most common configuration? Yes, as of now, codecs usually encode in mono. I guess we could try to improve for stereo in the future. >> Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:76 >> + > > Why do we bail if the sample rate changes, but not the number of channels? > > You can remove the sample rate check in `if (!m_audioBufferList || m_sampleRate != sampleRate || m_numberOfChannels != numberOfChannels)` LibWebRTC initially sends 16KHz data a few times before switching to 48KHz, not sure why. I will remove below sample check.
Created attachment 426403 [details] Patch for landing
Committed r276245 (236727@main): <https://commits.webkit.org/236727@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426403 [details].
<rdar://problem/77110055>