Support setting stream ids when adding a transceiver
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Nov 2018 19:12:28 +0000 (19:12 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Nov 2018 19:12:28 +0000 (19:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191307

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

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

Source/WebCore:

Add support for streams in RTCTransceiverInit.
Add plumbing down to libwebrtc.
Covered by rebased tests.

* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::fromRtpTransceiverInit):

LayoutTests:

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238100 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/w3c/ChangeLog
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/RTCPeerConnection.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp

index e474847..609c74b 100644 (file)
@@ -1,3 +1,12 @@
+2018-11-12  Youenn Fablet  <youenn@apple.com>
+
+        Support setting stream ids when adding a transceiver
+        https://bugs.webkit.org/show_bug.cgi?id=191307
+
+        Reviewed by Eric Carlson.
+
+        * TestExpectations:
+
 2018-11-12  Antti Koivisto  <antti@apple.com>
 
         Support dynamic pseudo-classes on elements with display: contents
index dfbe5c5..2d71db9 100644 (file)
@@ -1232,7 +1232,6 @@ webrtc/datachannel/multiple-connections.html [ Slow ]
 webkit.org/b/171094 imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html [ Failure ]
 webkit.org/b/172f21 imported/w3c/web-platform-tests/webrtc/getstats.html [ Failure ]
 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCRtpTransceiver.https.html [ Failure ]
 # Skip timing out test
 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html [ Skip ]
 
index 173676f..dbecd93 100644 (file)
@@ -1,3 +1,13 @@
+2018-11-12  Youenn Fablet  <youenn@apple.com>
+
+        Support setting stream ids when adding a transceiver
+        https://bugs.webkit.org/show_bug.cgi?id=191307
+
+        Reviewed by Eric Carlson.
+
+        * web-platform-tests/webrtc/RTCPeerConnection-transceivers.https-expected.txt:
+        * web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt:
+
 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
 
         Require <iframe allow="display"> for an iframe to use getDisplayMedia
index a109620..a48b491 100644 (file)
@@ -25,8 +25,8 @@ PASS addTransceiver(track): "transceiver == {sender,receiver}"
 PASS addTransceiver(track, init): initialize direction to inactive 
 FAIL addTransceiver(track, init): initialize sendEncodings[0].active to false assert_false: expected false got true
 PASS addTransceiver(0 streams): ontrack fires with no stream 
-FAIL addTransceiver(1 stream): ontrack fires with corresponding stream assert_equals: trackEvent.streams.length == 1 expected 1 but got 0
-FAIL addTransceiver(2 streams): ontrack fires with corresponding two streams assert_equals: trackEvent.streams.length == 2 expected 2 but got 0
+PASS addTransceiver(1 stream): ontrack fires with corresponding stream 
+PASS addTransceiver(2 streams): ontrack fires with corresponding two streams 
 PASS addTrack(0 streams): ontrack fires with no stream 
 PASS addTrack(1 stream): ontrack fires with corresponding stream 
 PASS addTrack(2 streams): ontrack fires with corresponding two streams 
index ffaa6cb..221c0ab 100644 (file)
@@ -5,18 +5,18 @@ PASS checkAddTransceiverNoTrack
 PASS checkAddTransceiverWithTrack 
 PASS checkAddTransceiverWithAddTrack 
 PASS checkAddTransceiverWithDirection 
-FAIL checkAddTransceiverWithStream assert_true: offer contains the expected audio msid expected true got false
+PASS checkAddTransceiverWithStream 
 FAIL checkAddTransceiverWithOfferToReceiveAudio assert_equals: expected "[{currentDirection:null,direction:\"recvonly\",mid:null,receiver:{track:{kind:\"audio\"}},sender:{track:null},stopped:false}]" but got "[]"
 FAIL checkAddTransceiverWithOfferToReceiveVideo assert_equals: expected "[{currentDirection:null,direction:\"recvonly\",mid:null,receiver:{track:{kind:\"video\"}},sender:{track:null},stopped:false}]" but got "[]"
 FAIL checkAddTransceiverWithOfferToReceiveBoth assert_equals: expected "[{currentDirection:null,direction:\"recvonly\",mid:null,receiver:{track:{kind:\"audio\"}},sender:{track:null},stopped:false},{currentDirection:null,direction:\"recvonly\",mid:null,receiver:{track:{kind:\"video\"}},sender:{track:null},stopped:false}]" but got "[]"
-FAIL checkAddTransceiverWithSetRemoteOfferSending assert_equals: expected "[{streams:[{id:\"117b0a30-7f2b-4595-8183-98bd8a7599bb\"}],track:{}}]" but got "[{streams:[],track:{}}]"
+PASS checkAddTransceiverWithSetRemoteOfferSending 
 FAIL checkAddTransceiverWithSetRemoteOfferNoSend assert_equals: expected "[{currentDirection:null,direction:\"recvonly\",receiver:{track:{kind:\"audio\"}},sender:{track:null},stopped:false}]" but got "[]"
 PASS checkAddTransceiverBadKind 
 FAIL checkNoMidOffer promise_test: Unhandled rejection with value: object "OperationError: Failed to set remote offer sdp: The BUNDLE group contains MID:0 matching no m= section."
 PASS checkSetDirection 
 PASS checkCurrentDirection 
 PASS checkSendrecvWithNoSendTrack 
-FAIL checkSendrecvWithTracklessStream assert_equals: expected "[{streams:[{id:\"8a46ae8c-120e-42a0-9272-94c79a7745be\"}],track:{}}]" but got "[{streams:[],track:{}}]"
+PASS checkSendrecvWithTracklessStream 
 PASS checkAddTransceiverNoTrackDoesntPair 
 PASS checkAddTransceiverWithTrackDoesntPair 
 PASS checkAddTransceiverThenReplaceTrackDoesntPair 
index e6211ac..79a7d30 100644 (file)
@@ -1,3 +1,19 @@
+2018-11-12  Youenn Fablet  <youenn@apple.com>
+
+        Support setting stream ids when adding a transceiver
+        https://bugs.webkit.org/show_bug.cgi?id=191307
+
+        Reviewed by Eric Carlson.
+
+        Add support for streams in RTCTransceiverInit.
+        Add plumbing down to libwebrtc.
+        Covered by rebased tests.
+
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/mediastream/RTCPeerConnection.idl:
+        * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
+        (WebCore::fromRtpTransceiverInit):
+
 2018-11-12  Antti Koivisto  <antti@apple.com>
 
         Support dynamic pseudo-classes on elements with display: contents
index 327aebc..e8e01c9 100644 (file)
@@ -51,6 +51,7 @@
 
 namespace WebCore {
 
+class MediaStream;
 class MediaStreamTrack;
 class PeerConnectionBackend;
 class RTCController;
@@ -62,8 +63,10 @@ class RTCStatsCallback;
 struct RTCAnswerOptions;
 struct RTCOfferOptions;
 struct RTCRtpParameters;
+
 struct RTCRtpTransceiverInit {
-    RTCRtpTransceiverDirection direction;
+    RTCRtpTransceiverDirection direction { RTCRtpTransceiverDirection::Sendrecv };
+    Vector<RefPtr<MediaStream>> streams;
 };
 
 class RTCPeerConnection final
index 59711e9..17d0e6c 100644 (file)
@@ -66,7 +66,7 @@ typedef (object or DOMString) AlgorithmIdentifier;
     ImplementedAs=RTCRtpTransceiverInit
 ] dictionary RTCRtpTransceiverInit {
     RtpTransceiverDirection direction = "sendrecv";
-    // FIXME 169662: missing streams
+    sequence<MediaStream> streams = [];
     // FIXME 169662: missing sendEncodings
 };
 
index 9203411..b45d064 100644 (file)
@@ -228,9 +228,11 @@ webrtc::RtpTransceiverInit fromRtpTransceiverInit(const RTCRtpTransceiverInit& i
 {
     webrtc::RtpTransceiverInit rtcInit;
     rtcInit.direction = fromRTCRtpTransceiverDirection(init.direction);
+    for (auto& stream : init.streams)
+        rtcInit.stream_ids.push_back(stream->id().utf8().data());
     return rtcInit;
 }
 
-}; // namespace WebCore
+} // namespace WebCore
 
 #endif // USE(LIBWEBRTC)