⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 219127 in webkit


Ignore:
Timestamp:
Jul 5, 2017, 8:53:17 AM (9 years ago)
Author:
commit-queue@webkit.org
Message:

Receiving tracks should be ended when peer connection is being closed
​https://bugs.webkit.org/show_bug.cgi?id=174109

Patch by Youenn Fablet <​youenn@apple.com> on 2017-07-05
Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/peer-connection-track-end.html

As per ​https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close, tracks should be ended when peer connection is closed.
Also updating transceiver stopped state.

  • Modules/mediastream/RTCPeerConnection.cpp:

(WebCore::RTCPeerConnection::doClose):

  • Modules/mediastream/RTCRtpReceiver.cpp:

(WebCore::RTCRtpReceiver::stop):

  • Modules/mediastream/RTCRtpReceiver.h:

LayoutTests:

  • webrtc/peer-connection-track-end-expected.txt: Added.
  • webrtc/peer-connection-track-end.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r219121 r219127  
     12017-07-05  Youenn Fablet  <youenn@apple.com>
     2
     3        Receiving tracks should be ended when peer connection is being closed
     4        https://bugs.webkit.org/show_bug.cgi?id=174109
     5
     6        Reviewed by Eric Carlson.
     7
     8        * webrtc/peer-connection-track-end-expected.txt: Added.
     9        * webrtc/peer-connection-track-end.html: Added.
     10
    1112017-07-04  Antti Koivisto  <antti@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r219125 r219127  
     12017-07-05  Youenn Fablet  <youenn@apple.com>
     2
     3        Receiving tracks should be ended when peer connection is being closed
     4        https://bugs.webkit.org/show_bug.cgi?id=174109
     5
     6        Reviewed by Eric Carlson.
     7
     8        Test: webrtc/peer-connection-track-end.html
     9
     10        As per https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close, tracks should be ended when peer connection is closed.
     11        Also updating transceiver stopped state.
     12
     13        * Modules/mediastream/RTCPeerConnection.cpp:
     14        (WebCore::RTCPeerConnection::doClose):
     15        * Modules/mediastream/RTCRtpReceiver.cpp:
     16        (WebCore::RTCRtpReceiver::stop):
     17        * Modules/mediastream/RTCRtpReceiver.h:
     18
    1192017-07-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
    220
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

    r218994 r219127  
    388388    m_iceConnectionState = RTCIceConnectionState::Closed;
    389389
    390     for (RTCRtpReceiver& receiver : m_transceiverSet->receivers())
    391         receiver.stop();
    392 
    393     for (RTCRtpSender& sender : m_transceiverSet->senders())
    394         sender.stop();
     390    for (auto& transceiver : m_transceiverSet->list()) {
     391        transceiver->stop();
     392        transceiver->sender().stop();
     393        transceiver->receiver().stop();
     394    }
    395395
    396396    return true;
  • trunk/Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp

    r214420 r219127  
    4444}
    4545
     46void RTCRtpReceiver::stop()
     47{
     48    m_backend = nullptr;
     49
     50    if (m_track)
     51        m_track->stopTrack(MediaStreamTrack::StopMode::PostEvent);
     52}
     53
    4654} // namespace WebCore
    4755
  • trunk/Source/WebCore/Modules/mediastream/RTCRtpReceiver.h

    r214420 r219127  
    5252    }
    5353
    54     void stop() { m_backend = nullptr; }
     54    void stop();
     55
    5556    // FIXME: We should pass a UniqueRef here.
    5657    void setBackend(std::unique_ptr<Backend>&& backend) { m_backend = WTFMove(backend); }
Note: See TracChangeset for help on using the changeset viewer.