WebRTC: silence data not sent for disabled audio track
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 21:43:35 +0000 (21:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 21:43:35 +0000 (21:43 +0000)
commit08224269377c6f254de64864abdd8d069dea8886
treeab97890dbbb1044780c4e347b33c674af0f85193
parentd9ee9fa520929d576ff27b95cd1e24a4e19bd838
WebRTC: silence data not sent for disabled audio track
https://bugs.webkit.org/show_bug.cgi?id=174456
<rdar://problem/33284623>

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

Source/WebCore:

Test: webrtc/audio-muted-stats.html
      webrtc/audio-muted-stats2.html

Adding a timer-based approach to send 10ms of silence every second.
This is consistent with how muted video tracks are implemented.
In case the audio track is muted at the time it is added, no silence data is sent.

* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::initializeConverter):
(WebCore::RealtimeOutgoingAudioSource::stop):
(WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
(WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
(WebCore::RealtimeOutgoingAudioSource::handleMutedIfNeeded):
(WebCore::RealtimeOutgoingAudioSource::sendSilence):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

LayoutTests:

* webrtc/audio-muted-stats-expected.txt: Added.
* webrtc/audio-muted-stats.html: Added.
* webrtc/audio-muted-stats2-expected.txt: Added.
* webrtc/audio-muted-stats2.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/webrtc/audio-muted-stats-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/audio-muted-stats.html [new file with mode: 0644]
LayoutTests/webrtc/audio-muted-stats2-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/audio-muted-stats2.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h