Allow setting RTCRtpTransceiver.direction
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2018 02:12:32 +0000 (02:12 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2018 02:12:32 +0000 (02:12 +0000)
commit9d7cc906c6dd909747d0f1e305d69168d2c5f310
tree1ff3272ef29d674f6fb536cc7b02f98966720e63
parent241ff7a139930f6571d88c01b8a2ec3576d817a5
Allow setting RTCRtpTransceiver.direction
https://bugs.webkit.org/show_bug.cgi?id=191346

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-remote-track-mute.https-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-transceivers.https-expected.txt:
* web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt:

Source/WebCore:

Remove readonly from the direction attribute.
Keep setDirection for now as it is in use, with an intent to remove it.
Driven-by fix as in some cases, the rtc source track might be changed
and current implementation is not expecting that.
In such a case, stop observing the old track (which should no longer call us)
before observing the new one.

Covered by rebased tests.

* Modules/mediastream/RTCRtpTransceiver.idl:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::setSourceTrack):
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::setSourceTrack):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-remote-track-mute.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-transceivers.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/RTCRtpTransceiver.idl
Source/WebCore/platform/mediastream/RealtimeIncomingAudioSource.cpp
Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.cpp