Support onremovetrack for RTCPeerConnection removed tracks
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 02:31:30 +0000 (02:31 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 02:31:30 +0000 (02:31 +0000)
commit5001201e0f6ed5a7eec1f4caf23e6851385b2619
treed8b9d8014edadaa16bac34980df03f5050c98b0a
parenta70c3ae3659b76134898757049a9e22045dc0b63
Support onremovetrack for RTCPeerConnection removed tracks
https://bugs.webkit.org/show_bug.cgi?id=191299

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https-expected.txt:

Source/WebCore:

When applying SDP, LibWebRTCMediaEndpoint gets notified of a removed track.
In that case, make sure to remove it from its remote stream(s) so as
to notify the application of the changes.
Work around the receiver missing the list of streams by storing in a map
the list of the remote streams for a given remote track.

Covered by rebased test.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::stop):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h