[WebRTC] Add support for libwebrtc negotiation needed event
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2017 01:23:39 +0000 (01:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2017 01:23:39 +0000 (01:23 +0000)
commit10d87587e2902cdeee8a5c41c521663d4bb0cbbe
tree5a014564e5f55ae1c796a33263054d8da79be2e2
parent5273dab8a1fbf13f6f9c20ab89f52be56132e0de
[WebRTC] Add support for libwebrtc negotiation needed event
https://bugs.webkit.org/show_bug.cgi?id=168267

Patch by Youenn Fablet <youennf@gmail.com> on 2017-02-14
Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/negotiatedneeded-event-addStream.html

Moving generic code (markAsNeedingNegotiation) from MediaEndpointPeerConnection to PeerConnectionBackend.
This code handles the control of sending or not the negotiationneeded event.

Updating mock to use markAsNeedingNegotiation when streams are changed.
Updating libwebrtc backend to call markAsNeedingNegotiation when required by libwebrtc implementation.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::markAsNeedingNegotiation):
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::isNegotiationNeeded):
(WebCore::PeerConnectionBackend::clearNegotiationNeededState):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::AddStream):
(WebCore::MockLibWebRTCPeerConnection::RemoveStream):

LayoutTests:

* fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt:
* platform/gtk/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt.
* webrtc/negotiatedneeded-event-addStream-expected.txt: Added.
* webrtc/negotiatedneeded-event-addStream.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/negotiatedneeded-event-addStream-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/negotiatedneeded-event-addStream.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h
Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp