Improve WebRTC track enabled support
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Mar 2017 16:09:50 +0000 (16:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Mar 2017 16:09:50 +0000 (16:09 +0000)
commitebdb8651a5b23c1e6cd6878bba7059566c722297
tree55e06d805deb51576fce83448df4c9a9f3be2af1
parent95998e8db85d68d8645505e0d007676db9a1d664
Improve WebRTC track enabled support
https://bugs.webkit.org/show_bug.cgi?id=169727

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-16
Reviewed by Alex Christensen.

Source/WebCore:

Tests: webrtc/peer-connection-audio-mute2.html
       webrtc/peer-connection-remote-audio-mute.html
       webrtc/video-remote-mute.html

Making sure muted/disabled sources produce silence/black frames.
For outgoing audio/video sources, this should be done by the actual a/v providers.
We keep this filtering here until we are sure they implement that.

* platform/audio/mac/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks): Ensuring disabled audio tracks send silence.
Used for outgoing webrtc tracks.
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::render): Ditto.
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::OnData): Ditto.
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame): Generating black frames if muted.
(WebCore::RealtimeIncomingVideoSource::OnFrame):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable): Ensuring we quit after sending black frame.

LayoutTests:

* TestExpectations:
* webrtc/audio-peer-connection-webaudio.html:
* webrtc/peer-connection-audio-mute-expected.txt:
* webrtc/peer-connection-audio-mute.html:
* webrtc/peer-connection-audio-mute2-expected.txt: Added.
* webrtc/peer-connection-audio-mute2.html: Added.
* webrtc/peer-connection-remote-audio-mute-expected.txt: Added.
* webrtc/peer-connection-remote-audio-mute.html: Added.
* webrtc/video-mute-expected.txt:
* webrtc/video-mute.html:
* webrtc/video-remote-mute-expected.txt: Added.
* webrtc/video-remote-mute.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/webrtc/audio-peer-connection-webaudio.html
LayoutTests/webrtc/peer-connection-audio-mute-expected.txt
LayoutTests/webrtc/peer-connection-audio-mute.html
LayoutTests/webrtc/peer-connection-audio-mute2-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/peer-connection-audio-mute2.html [new file with mode: 0644]
LayoutTests/webrtc/peer-connection-remote-audio-mute-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/peer-connection-remote-audio-mute.html [new file with mode: 0644]
LayoutTests/webrtc/peer-connection-remote-audio-mute2-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/peer-connection-remote-audio-mute2.html [new file with mode: 0644]
LayoutTests/webrtc/video-mute-expected.txt
LayoutTests/webrtc/video-mute.html
LayoutTests/webrtc/video-remote-mute-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/video-remote-mute.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/audio/mac/AudioSampleDataSource.mm
Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.mm
Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp
Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.cpp
Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp