RTCOfferOptions iceRestart should be supported
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Apr 2017 04:01:48 +0000 (04:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Apr 2017 04:01:48 +0000 (04:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170966

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-18
Reviewed by Alex Christensen.

No ability to test iceRestart as of now.
Passing iceRestart value to libwebrtc.
Passing also voiceActivityDetection value to libwebrtc.
Updating mock to use the new overloaded CreateOffer method.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doCreateOffer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::CreateOffer):
* testing/MockLibWebRTCPeerConnection.h:

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

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp
Source/WebCore/testing/MockLibWebRTCPeerConnection.h

index fc84a0c..8548dd2 100644 (file)
@@ -1,3 +1,26 @@
+2017-04-18  Youenn Fablet  <youenn@apple.com>
+
+        RTCOfferOptions iceRestart should be supported
+        https://bugs.webkit.org/show_bug.cgi?id=170966
+
+        Reviewed by Alex Christensen.
+
+        No ability to test iceRestart as of now.
+        Passing iceRestart value to libwebrtc.
+        Passing also voiceActivityDetection value to libwebrtc.
+        Updating mock to use the new overloaded CreateOffer method.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+        (WebCore::LibWebRTCPeerConnectionBackend::doCreateOffer):
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
+        * testing/MockLibWebRTCPeerConnection.cpp:
+        (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
+        * testing/MockLibWebRTCPeerConnection.h:
+
 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [WK2] Support DataTransfer::files() when performing a DHTML data interaction
index 075a338..fe6a23d 100644 (file)
@@ -38,6 +38,7 @@
 #include "PlatformStrategies.h"
 #include "RTCDataChannel.h"
 #include "RTCDataChannelEvent.h"
+#include "RTCOfferOptions.h"
 #include "RTCPeerConnection.h"
 #include "RTCSessionDescription.h"
 #include "RTCStatsReport.h"
@@ -201,10 +202,13 @@ void LibWebRTCMediaEndpoint::removeTrack(RTCRtpSender& sender)
     m_backend->RemoveTrack(rtcSender.get());
 }
 
-void LibWebRTCMediaEndpoint::doCreateOffer()
+void LibWebRTCMediaEndpoint::doCreateOffer(const RTCOfferOptions& options)
 {
     m_isInitiator = true;
-    m_backend->CreateOffer(&m_createSessionDescriptionObserver, nullptr);
+    webrtc::PeerConnectionInterface::RTCOfferAnswerOptions rtcOptions;
+    rtcOptions.ice_restart = options.iceRestart;
+    rtcOptions.voice_activity_detection = options.voiceActivityDetection;
+    m_backend->CreateOffer(&m_createSessionDescriptionObserver, rtcOptions);
 }
 
 void LibWebRTCMediaEndpoint::doCreateAnswer()
index 71c05c9..2ae269f 100644 (file)
@@ -64,7 +64,7 @@ public:
     webrtc::PeerConnectionInterface& backend() const { ASSERT(m_backend); return *m_backend.get(); }
     void doSetLocalDescription(RTCSessionDescription&);
     void doSetRemoteDescription(RTCSessionDescription&);
-    void doCreateOffer();
+    void doCreateOffer(const RTCOfferOptions&);
     void doCreateAnswer();
     void getStats(MediaStreamTrack*, const DeferredPromise&);
     std::unique_ptr<RTCDataChannelHandler> createDataChannel(const String&, const RTCDataChannelInit&);
index bedf101..310204b 100644 (file)
@@ -151,9 +151,9 @@ void LibWebRTCPeerConnectionBackend::doSetRemoteDescription(RTCSessionDescriptio
     }
 }
 
-void LibWebRTCPeerConnectionBackend::doCreateOffer(RTCOfferOptions&&)
+void LibWebRTCPeerConnectionBackend::doCreateOffer(RTCOfferOptions&& options)
 {
-    m_endpoint->doCreateOffer();
+    m_endpoint->doCreateOffer(options);
 }
 
 void LibWebRTCPeerConnectionBackend::doCreateAnswer(RTCAnswerOptions&&)
index 000ccb5..4cd461e 100644 (file)
@@ -122,7 +122,7 @@ public:
     virtual ~MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer() = default;
 
 private:
-    void CreateOffer(webrtc::CreateSessionDescriptionObserver* observer, const webrtc::MediaConstraintsInterface*) final { releaseInNetworkThread(*this, *observer); }
+    void CreateOffer(webrtc::CreateSessionDescriptionObserver* observer, const webrtc::PeerConnectionInterface::RTCOfferAnswerOptions&) final { releaseInNetworkThread(*this, *observer); }
 };
 
 class MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats : public MockLibWebRTCPeerConnection {
@@ -267,7 +267,7 @@ bool MockLibWebRTCPeerConnection::RemoveTrack(webrtc::RtpSenderInterface* sender
     });
 }
 
-void MockLibWebRTCPeerConnection::CreateOffer(webrtc::CreateSessionDescriptionObserver* observer, const webrtc::MediaConstraintsInterface*)
+void MockLibWebRTCPeerConnection::CreateOffer(webrtc::CreateSessionDescriptionObserver* observer, const webrtc::PeerConnectionInterface::RTCOfferAnswerOptions&)
 {
     LibWebRTCProvider::callOnWebRTCSignalingThread([this, observer] {
         std::ostringstream sdp;
index 9f32069..d59937a 100644 (file)
@@ -71,7 +71,7 @@ protected:
 
     void SetLocalDescription(webrtc::SetSessionDescriptionObserver*, webrtc::SessionDescriptionInterface*) override;
     bool GetStats(webrtc::StatsObserver*, webrtc::MediaStreamTrackInterface*, StatsOutputLevel) override { return false; }
-    void CreateOffer(webrtc::CreateSessionDescriptionObserver*, const webrtc::MediaConstraintsInterface*) override;
+    void CreateOffer(webrtc::CreateSessionDescriptionObserver*, const webrtc::PeerConnectionInterface::RTCOfferAnswerOptions&) override;
 
     virtual void gotLocalDescription() { }