Changeset 260814 in webkit


Ignore:
Timestamp:
Apr 28, 2020 3:08:53 AM (4 years ago)
Author:
youenn@apple.com
Message:

RTCPeerConnection should not remove its created remote MediaStream objects until getting close
https://bugs.webkit.org/show_bug.cgi?id=211070

Reviewed by Alex Christensen.

Source/WebCore:

Remove no longer needed code.
This aligns with the spec and Firefox implementation.
Test: webrtc/direction-change.html

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::LibWebRTCMediaEndpoint::transceiverBackendFromSender):

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:

LayoutTests:

  • webrtc/direction-change-expected.txt: Added.
  • webrtc/direction-change.html: Added.
  • webrtc/routines.js:
  • webrtc/video-setDirection-expected.txt:
  • webrtc/video-setDirection.html:
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r260808 r260814  
     12020-04-28  Youenn Fablet  <youenn@apple.com>
     2
     3        RTCPeerConnection should not remove its created remote MediaStream objects until getting close
     4        https://bugs.webkit.org/show_bug.cgi?id=211070
     5
     6        Reviewed by Alex Christensen.
     7
     8        * webrtc/direction-change-expected.txt: Added.
     9        * webrtc/direction-change.html: Added.
     10        * webrtc/routines.js:
     11        * webrtc/video-setDirection-expected.txt:
     12        * webrtc/video-setDirection.html:
     13
    1142020-04-27  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/LayoutTests/webrtc/routines.js

    r260364 r260814  
    7777    console.log("addIceCandidate error: " + error)
    7878    assert_unreached();
     79}
     80
     81async function renegotiate(pc1, pc2)
     82{
     83    let d = await pc1.createOffer();
     84    await pc1.setLocalDescription(d);
     85    await pc2.setRemoteDescription(d);
     86    d = await pc2.createAnswer();
     87    await pc1.setRemoteDescription(d);
     88    await pc2.setLocalDescription(d);
    7989}
    8090
  • trunk/LayoutTests/webrtc/video-setDirection-expected.txt

    r240152 r260814  
    22
    33PASS Going from sendrecv to inactive and back to sendrecv
    4 FAIL The MediaStream should remain the same assert_equals: expected object "[object MediaStream]" but got object "[object MediaStream]"
     4PASS The MediaStream should remain the same
    55
  • trunk/LayoutTests/webrtc/video-setDirection.html

    r240152 r260814  
    4545
    4646var pc1, pc2;
    47 async function renegotiate()
    48 {
    49     let d = await pc1.createOffer();
    50     await pc1.setLocalDescription(d);
    51     await pc2.setRemoteDescription(d);
    52     d = await pc2.createAnswer();
    53     await pc1.setRemoteDescription(d);
    54     await pc2.setLocalDescription(d);
    55 }
    5647
    5748promise_test(async (t) => {
     
    8172
    8273    pc1.getTransceivers()[0].direction = "inactive";
    83     await renegotiate();
     74    await renegotiate(pc1, pc2);
    8475    await promise;
    8576
     
    9384    });
    9485
    95     await renegotiate();
     86    await renegotiate(pc1, pc2);
    9687    video.srcObject = await streamPromise;
    9788    await promise;
  • trunk/Source/WebCore/ChangeLog

    r260813 r260814  
     12020-04-28  Youenn Fablet  <youenn@apple.com>
     2
     3        RTCPeerConnection should not remove its created remote MediaStream objects until getting close
     4        https://bugs.webkit.org/show_bug.cgi?id=211070
     5
     6        Reviewed by Alex Christensen.
     7
     8        Remove no longer needed code.
     9        This aligns with the spec and Firefox implementation.
     10        Test: webrtc/direction-change.html
     11
     12        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
     13        (WebCore::LibWebRTCMediaEndpoint::transceiverBackendFromSender):
     14        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
     15
    1162020-04-28  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp

    r260813 r260814  
    482482}
    483483
    484 void LibWebRTCMediaEndpoint::removeRemoteStream(webrtc::MediaStreamInterface& rtcStream)
    485 {
    486     bool removed = m_remoteStreamsById.remove(fromStdString(rtcStream.id()));
    487     ASSERT_UNUSED(removed, removed);
    488 }
    489 
    490 void LibWebRTCMediaEndpoint::OnRemoveStream(rtc::scoped_refptr<webrtc::MediaStreamInterface> stream)
    491 {
    492     callOnMainThread([protectedThis = makeRef(*this), stream = WTFMove(stream)] {
    493         if (protectedThis->isStopped())
    494             return;
    495         ASSERT(stream);
    496         protectedThis->removeRemoteStream(*stream.get());
    497     });
    498 }
    499 
    500484void LibWebRTCMediaEndpoint::OnTrack(rtc::scoped_refptr<webrtc::RtpTransceiverInterface> transceiver)
    501485{
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h

    r258326 r260814  
    123123    // webrtc::PeerConnectionObserver API
    124124    void OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState) final;
    125     void OnRemoveStream(rtc::scoped_refptr<webrtc::MediaStreamInterface>) final;
    126125    void OnDataChannel(rtc::scoped_refptr<webrtc::DataChannelInterface>) final;
    127126    void OnTrack(rtc::scoped_refptr<webrtc::RtpTransceiverInterface>) final;
     
    140139    void setRemoteSessionDescriptionSucceeded();
    141140    void setRemoteSessionDescriptionFailed(ExceptionCode, const char*);
    142     void removeRemoteStream(webrtc::MediaStreamInterface&);
    143141    void newTransceiver(rtc::scoped_refptr<webrtc::RtpTransceiverInterface>&&);
    144142    void removeRemoteTrack(rtc::scoped_refptr<webrtc::RtpReceiverInterface>&&);
Note: See TracChangeset for help on using the changeset viewer.