Changeset 212338 in webkit
- Timestamp:
- Feb 14, 2017, 5:23:39 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 11 edited
- 1 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt (modified) (1 diff)
-
LayoutTests/platform/gtk/fast/mediastream (added)
-
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt (copied) (copied from trunk/LayoutTests/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt )
-
LayoutTests/webrtc/negotiatedneeded-event-addStream-expected.txt (added)
-
LayoutTests/webrtc/negotiatedneeded-event-addStream.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp (modified) (2 diffs)
-
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h (modified) (2 diffs)
-
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/PeerConnectionBackend.h (modified) (2 diffs)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h (modified) (1 diff)
-
Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r212337 r212338 1 2017-02-14 Youenn Fablet <youennf@gmail.com> 2 3 [WebRTC] Add support for libwebrtc negotiation needed event 4 https://bugs.webkit.org/show_bug.cgi?id=168267 5 6 Reviewed by Eric Carlson. 7 8 * fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt: 9 * platform/gtk/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt. 10 * webrtc/negotiatedneeded-event-addStream-expected.txt: Added. 11 * webrtc/negotiatedneeded-event-addStream.html: Added. 12 1 13 2017-02-14 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt
r202339 r212338 19 19 Create an answer for the audio only offer 20 20 Set answer as local description 21 PASS negotiationneededevent fired: There is local media not negotiated that needs to be negotiated in a follow-up offer22 21 PASS Answer set 23 22 PASS successfullyParsed is true -
trunk/Source/WebCore/ChangeLog
r212335 r212338 1 2017-02-14 Youenn Fablet <youennf@gmail.com> 2 3 [WebRTC] Add support for libwebrtc negotiation needed event 4 https://bugs.webkit.org/show_bug.cgi?id=168267 5 6 Reviewed by Eric Carlson. 7 8 Test: webrtc/negotiatedneeded-event-addStream.html 9 10 Moving generic code (markAsNeedingNegotiation) from MediaEndpointPeerConnection to PeerConnectionBackend. 11 This code handles the control of sending or not the negotiationneeded event. 12 13 Updating mock to use markAsNeedingNegotiation when streams are changed. 14 Updating libwebrtc backend to call markAsNeedingNegotiation when required by libwebrtc implementation. 15 16 * Modules/mediastream/MediaEndpointPeerConnection.cpp: 17 (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask): 18 * Modules/mediastream/MediaEndpointPeerConnection.h: 19 * Modules/mediastream/PeerConnectionBackend.cpp: 20 (WebCore::PeerConnectionBackend::markAsNeedingNegotiation): 21 * Modules/mediastream/PeerConnectionBackend.h: 22 (WebCore::PeerConnectionBackend::isNegotiationNeeded): 23 (WebCore::PeerConnectionBackend::clearNegotiationNeededState): 24 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: 25 (WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded): 26 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: 27 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: 28 * testing/MockLibWebRTCPeerConnection.cpp: 29 (WebCore::MockLibWebRTCPeerConnection::AddStream): 30 (WebCore::MockLibWebRTCPeerConnection::RemoveStream): 31 1 32 2017-02-14 Brady Eidson <beidson@apple.com> 2 33 -
trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
r212329 r212338 421 421 m_peerConnection.updateIceGatheringState(IceGatheringState::Gathering); 422 422 423 if (m_peerConnection.internalSignalingState() == SignalingState::Stable && m_negotiationNeeded) 424 m_peerConnection.scheduleNegotiationNeededEvent(); 425 423 markAsNeedingNegotiation(); 426 424 setLocalDescriptionSucceeded(); 427 425 } … … 732 730 } 733 731 734 void MediaEndpointPeerConnection::markAsNeedingNegotiation()735 {736 if (m_negotiationNeeded)737 return;738 739 m_negotiationNeeded = true;740 741 if (m_peerConnection.internalSignalingState() == SignalingState::Stable)742 m_peerConnection.scheduleNegotiationNeededEvent();743 }744 745 732 void MediaEndpointPeerConnection::emulatePlatformEvent(const String& action) 746 733 { -
trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h
r212329 r212338 65 65 void replaceTrack(RTCRtpSender&, RefPtr<MediaStreamTrack>&&, DOMPromise<void>&&) final; 66 66 67 bool isNegotiationNeeded() const final { return m_negotiationNeeded; };68 void markAsNeedingNegotiation() final;69 void clearNegotiationNeededState() final { m_negotiationNeeded = false; };70 71 67 void emulatePlatformEvent(const String& action) final; 72 68 … … 130 126 131 127 HashMap<String, RefPtr<MediaStream>> m_remoteStreamMap; 132 133 bool m_negotiationNeeded { false };134 128 }; 135 129 -
trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
r209390 r212338 297 297 } 298 298 299 void PeerConnectionBackend::markAsNeedingNegotiation() 300 { 301 if (m_negotiationNeeded) 302 return; 303 304 m_negotiationNeeded = true; 305 306 if (m_peerConnection.internalSignalingState() == PeerConnectionStates::SignalingState::Stable) 307 m_peerConnection.scheduleNegotiationNeededEvent(); 308 } 309 299 310 } // namespace WebCore 300 311 -
trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
r212329 r212338 96 96 virtual void replaceTrack(RTCRtpSender&, RefPtr<MediaStreamTrack>&&, DOMPromise<void>&&) = 0; 97 97 98 v irtual bool isNegotiationNeeded() const = 0;99 virtual void markAsNeedingNegotiation() = 0;100 v irtual void clearNegotiationNeededState() = 0;98 void markAsNeedingNegotiation(); 99 bool isNegotiationNeeded() const { return m_negotiationNeeded; }; 100 void clearNegotiationNeededState() { m_negotiationNeeded = false; }; 101 101 102 102 virtual void emulatePlatformEvent(const String& action) = 0; … … 138 138 std::optional<DOMPromise<void>> m_setDescriptionPromise; 139 139 std::optional<DOMPromise<void>> m_addIceCandidatePromise; 140 141 bool m_negotiationNeeded { false }; 140 142 }; 141 143 -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
r212329 r212338 381 381 void LibWebRTCMediaEndpoint::OnRenegotiationNeeded() 382 382 { 383 notImplemented(); 383 callOnMainThread([protectedThis = makeRef(*this)] { 384 if (protectedThis->isStopped()) 385 return; 386 protectedThis->m_peerConnectionBackend.markAsNeedingNegotiation(); 387 }); 384 388 } 385 389 -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
r212329 r212338 202 202 } 203 203 204 void LibWebRTCPeerConnectionBackend::markAsNeedingNegotiation()205 {206 // FIXME: Implement this207 }208 209 204 Ref<RTCRtpReceiver> LibWebRTCPeerConnectionBackend::createReceiver(const String&, const String& trackKind, const String& trackId) 210 205 { -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h
r212329 r212338 71 71 Vector<RefPtr<MediaStream>> getRemoteStreams() const final { return { }; } 72 72 void replaceTrack(RTCRtpSender&, RefPtr<MediaStreamTrack>&&, DOMPromise<void>&&) final { } 73 bool isNegotiationNeeded() const final { return false; }74 void markAsNeedingNegotiation() final;75 void clearNegotiationNeededState() final { }76 73 77 74 void emulatePlatformEvent(const String&) final { } -
trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp
r212269 r212338 227 227 { 228 228 m_stream = stream; 229 LibWebRTCProvider::callOnWebRTCSignalingThread([observer = &m_observer] { 230 observer->OnRenegotiationNeeded(); 231 }); 229 232 return true; 230 233 } … … 232 235 void MockLibWebRTCPeerConnection::RemoveStream(webrtc::MediaStreamInterface*) 233 236 { 237 LibWebRTCProvider::callOnWebRTCSignalingThread([observer = &m_observer] { 238 observer->OnRenegotiationNeeded(); 239 }); 234 240 m_stream = nullptr; 235 241 }
Note:
See TracChangeset
for help on using the changeset viewer.