WebRTC: Add MediaEndpoint interface (WebRTC backend abstraction)
authoradam.bergkvist@ericsson.com <adam.bergkvist@ericsson.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Feb 2016 22:23:53 +0000 (22:23 +0000)
committeradam.bergkvist@ericsson.com <adam.bergkvist@ericsson.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Feb 2016 22:23:53 +0000 (22:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150165

Reviewed by Eric Carlson.

Add the MediaEndpoint interface along with its companion objects.

MediaEndpoint interface: A WebRTC platform abstraction that is used to
configure how the the WebRTC backend sends and receives. It also abstracts
ICE functionality such as generating local candidates and doing
checking on remote candidates. The RTCPeerConnection API, and other API
objects such as RTCRtpSender/Receiver, live above MediaEndpoint.

MediaEndpointConfiguration: A settings object used to configure a
MediaEndpoint with, for example, ICE helper servers and other polices.
A MediaEndpointConfiguration is used to initialize a MediaEndpoint, but
can also be used to update settings.

MediaEndpointSessionConfiguration: An object that describes how the
MediaEndpoint should send and receive. Contains PeerMediaDescription,
MediaPayload and IceCandidate objects.

Tests: The MediaEndpoint platform interface has no implementations yet.

* CMakeLists.txt:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::gotDtlsFingerprint):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
(WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
(WebCore::MediaEndpointPeerConnection::gotRemoteSource):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/IceCandidate.h: Added.
(WebCore::IceCandidate::create):
(WebCore::IceCandidate::~IceCandidate):
(WebCore::IceCandidate::type):
(WebCore::IceCandidate::setType):
(WebCore::IceCandidate::foundation):
(WebCore::IceCandidate::setFoundation):
(WebCore::IceCandidate::componentId):
(WebCore::IceCandidate::setComponentId):
(WebCore::IceCandidate::transport):
(WebCore::IceCandidate::setTransport):
(WebCore::IceCandidate::priority):
(WebCore::IceCandidate::setPriority):
(WebCore::IceCandidate::address):
(WebCore::IceCandidate::setAddress):
(WebCore::IceCandidate::port):
(WebCore::IceCandidate::setPort):
(WebCore::IceCandidate::tcpType):
(WebCore::IceCandidate::setTcpType):
(WebCore::IceCandidate::relatedAddress):
(WebCore::IceCandidate::setRelatedAddress):
(WebCore::IceCandidate::relatedPort):
(WebCore::IceCandidate::setRelatedPort):
(WebCore::IceCandidate::clone):
(WebCore::IceCandidate::IceCandidate):
* platform/mediastream/MediaEndpoint.cpp: Added.
(WebCore::createMediaEndpoint):
* platform/mediastream/MediaEndpoint.h: Added.
(WebCore::MediaEndpointClient::~MediaEndpointClient):
(WebCore::MediaEndpoint::~MediaEndpoint):
* platform/mediastream/MediaEndpointConfiguration.cpp: Added.
(WebCore::IceServerInfo::IceServerInfo):
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h: Added.
(WebCore::IceServerInfo::create):
(WebCore::IceServerInfo::~IceServerInfo):
(WebCore::IceServerInfo::urls):
(WebCore::IceServerInfo::credential):
(WebCore::IceServerInfo::username):
(WebCore::MediaEndpointConfiguration::create):
(WebCore::MediaEndpointConfiguration::iceServers):
(WebCore::MediaEndpointConfiguration::iceTransportPolicy):
(WebCore::MediaEndpointConfiguration::bundlePolicy):
* platform/mediastream/MediaEndpointSessionConfiguration.h: Added.
(WebCore::MediaEndpointSessionConfiguration::create):
(WebCore::MediaEndpointSessionConfiguration::~MediaEndpointSessionConfiguration):
(WebCore::MediaEndpointSessionConfiguration::sessionId):
(WebCore::MediaEndpointSessionConfiguration::setSessionId):
(WebCore::MediaEndpointSessionConfiguration::sessionVersion):
(WebCore::MediaEndpointSessionConfiguration::setSessionVersion):
(WebCore::MediaEndpointSessionConfiguration::mediaDescriptions):
(WebCore::MediaEndpointSessionConfiguration::addMediaDescription):
(WebCore::MediaEndpointSessionConfiguration::clone):
(WebCore::MediaEndpointSessionConfiguration::MediaEndpointSessionConfiguration):
* platform/mediastream/MediaPayload.h: Added.
(WebCore::MediaPayload::create):
(WebCore::MediaPayload::~MediaPayload):
(WebCore::MediaPayload::type):
(WebCore::MediaPayload::setType):
(WebCore::MediaPayload::encodingName):
(WebCore::MediaPayload::setEncodingName):
(WebCore::MediaPayload::clockRate):
(WebCore::MediaPayload::setClockRate):
(WebCore::MediaPayload::channels):
(WebCore::MediaPayload::setChannels):
(WebCore::MediaPayload::ccmfir):
(WebCore::MediaPayload::setCcmfir):
(WebCore::MediaPayload::nackpli):
(WebCore::MediaPayload::setNackpli):
(WebCore::MediaPayload::nack):
(WebCore::MediaPayload::setNack):
(WebCore::MediaPayload::parameters):
(WebCore::MediaPayload::addParameter):
(WebCore::MediaPayload::clone):
(WebCore::MediaPayload::MediaPayload):
* platform/mediastream/PeerMediaDescription.h: Added.
(WebCore::PeerMediaDescription::create):
(WebCore::PeerMediaDescription::~PeerMediaDescription):
(WebCore::PeerMediaDescription::type):
(WebCore::PeerMediaDescription::setType):
(WebCore::PeerMediaDescription::port):
(WebCore::PeerMediaDescription::setPort):
(WebCore::PeerMediaDescription::address):
(WebCore::PeerMediaDescription::setAddress):
(WebCore::PeerMediaDescription::mode):
(WebCore::PeerMediaDescription::setMode):
(WebCore::PeerMediaDescription::payloads):
(WebCore::PeerMediaDescription::addPayload):
(WebCore::PeerMediaDescription::setPayloads):
(WebCore::PeerMediaDescription::rtcpMux):
(WebCore::PeerMediaDescription::setRtcpMux):
(WebCore::PeerMediaDescription::rtcpAddress):
(WebCore::PeerMediaDescription::setRtcpAddress):
(WebCore::PeerMediaDescription::rtcpPort):
(WebCore::PeerMediaDescription::setRtcpPort):
(WebCore::PeerMediaDescription::mediaStreamId):
(WebCore::PeerMediaDescription::setMediaStreamId):
(WebCore::PeerMediaDescription::mediaStreamTrackId):
(WebCore::PeerMediaDescription::setMediaStreamTrackId):
(WebCore::PeerMediaDescription::dtlsSetup):
(WebCore::PeerMediaDescription::setDtlsSetup):
(WebCore::PeerMediaDescription::dtlsFingerprintHashFunction):
(WebCore::PeerMediaDescription::setDtlsFingerprintHashFunction):
(WebCore::PeerMediaDescription::dtlsFingerprint):
(WebCore::PeerMediaDescription::setDtlsFingerprint):
(WebCore::PeerMediaDescription::cname):
(WebCore::PeerMediaDescription::setCname):
(WebCore::PeerMediaDescription::ssrcs):
(WebCore::PeerMediaDescription::addSsrc):
(WebCore::PeerMediaDescription::clearSsrcs):
(WebCore::PeerMediaDescription::iceUfrag):
(WebCore::PeerMediaDescription::setIceUfrag):
(WebCore::PeerMediaDescription::icePassword):
(WebCore::PeerMediaDescription::setIcePassword):
(WebCore::PeerMediaDescription::iceCandidates):
(WebCore::PeerMediaDescription::addIceCandidate):
(WebCore::PeerMediaDescription::source):
(WebCore::PeerMediaDescription::setSource):
(WebCore::PeerMediaDescription::clone):
(WebCore::PeerMediaDescription::PeerMediaDescription):

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

13 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/mediastream/IceCandidate.h [new file with mode: 0644]
Source/WebCore/platform/mediastream/MediaEndpoint.cpp [new file with mode: 0644]
Source/WebCore/platform/mediastream/MediaEndpoint.h [new file with mode: 0644]
Source/WebCore/platform/mediastream/MediaEndpointConfiguration.cpp [new file with mode: 0644]
Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h [new file with mode: 0644]
Source/WebCore/platform/mediastream/MediaEndpointSessionConfiguration.h [new file with mode: 0644]
Source/WebCore/platform/mediastream/MediaPayload.h [new file with mode: 0644]
Source/WebCore/platform/mediastream/PeerMediaDescription.h [new file with mode: 0644]

index 74014d3..76e5894 100644 (file)
@@ -2298,6 +2298,8 @@ set(WebCore_SOURCES
     platform/graphics/transforms/TransformationMatrix.cpp
     platform/graphics/transforms/TranslateTransformOperation.cpp
 
+    platform/mediastream/MediaEndpoint.cpp
+    platform/mediastream/MediaEndpointConfiguration.cpp
     platform/mediastream/MediaStreamPrivate.cpp
     platform/mediastream/MediaStreamTrackPrivate.cpp
     platform/mediastream/RTCIceCandidateDescriptor.cpp
index 525359b..2997e93 100644 (file)
@@ -1,3 +1,158 @@
+2016-02-24  Adam Bergkvist  <adam.bergkvist@ericsson.com>
+
+        WebRTC: Add MediaEndpoint interface (WebRTC backend abstraction)
+        https://bugs.webkit.org/show_bug.cgi?id=150165
+
+        Reviewed by Eric Carlson.
+
+        Add the MediaEndpoint interface along with its companion objects.
+
+        MediaEndpoint interface: A WebRTC platform abstraction that is used to
+        configure how the the WebRTC backend sends and receives. It also abstracts
+        ICE functionality such as generating local candidates and doing
+        checking on remote candidates. The RTCPeerConnection API, and other API
+        objects such as RTCRtpSender/Receiver, live above MediaEndpoint.
+
+        MediaEndpointConfiguration: A settings object used to configure a
+        MediaEndpoint with, for example, ICE helper servers and other polices.
+        A MediaEndpointConfiguration is used to initialize a MediaEndpoint, but
+        can also be used to update settings.
+
+        MediaEndpointSessionConfiguration: An object that describes how the
+        MediaEndpoint should send and receive. Contains PeerMediaDescription,
+        MediaPayload and IceCandidate objects.
+
+        Tests: The MediaEndpoint platform interface has no implementations yet.
+
+        * CMakeLists.txt:
+        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
+        (WebCore::MediaEndpointPeerConnection::gotDtlsFingerprint):
+        (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
+        (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
+        (WebCore::MediaEndpointPeerConnection::gotRemoteSource):
+        * Modules/mediastream/MediaEndpointPeerConnection.h:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/mediastream/IceCandidate.h: Added.
+        (WebCore::IceCandidate::create):
+        (WebCore::IceCandidate::~IceCandidate):
+        (WebCore::IceCandidate::type):
+        (WebCore::IceCandidate::setType):
+        (WebCore::IceCandidate::foundation):
+        (WebCore::IceCandidate::setFoundation):
+        (WebCore::IceCandidate::componentId):
+        (WebCore::IceCandidate::setComponentId):
+        (WebCore::IceCandidate::transport):
+        (WebCore::IceCandidate::setTransport):
+        (WebCore::IceCandidate::priority):
+        (WebCore::IceCandidate::setPriority):
+        (WebCore::IceCandidate::address):
+        (WebCore::IceCandidate::setAddress):
+        (WebCore::IceCandidate::port):
+        (WebCore::IceCandidate::setPort):
+        (WebCore::IceCandidate::tcpType):
+        (WebCore::IceCandidate::setTcpType):
+        (WebCore::IceCandidate::relatedAddress):
+        (WebCore::IceCandidate::setRelatedAddress):
+        (WebCore::IceCandidate::relatedPort):
+        (WebCore::IceCandidate::setRelatedPort):
+        (WebCore::IceCandidate::clone):
+        (WebCore::IceCandidate::IceCandidate):
+        * platform/mediastream/MediaEndpoint.cpp: Added.
+        (WebCore::createMediaEndpoint):
+        * platform/mediastream/MediaEndpoint.h: Added.
+        (WebCore::MediaEndpointClient::~MediaEndpointClient):
+        (WebCore::MediaEndpoint::~MediaEndpoint):
+        * platform/mediastream/MediaEndpointConfiguration.cpp: Added.
+        (WebCore::IceServerInfo::IceServerInfo):
+        (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
+        * platform/mediastream/MediaEndpointConfiguration.h: Added.
+        (WebCore::IceServerInfo::create):
+        (WebCore::IceServerInfo::~IceServerInfo):
+        (WebCore::IceServerInfo::urls):
+        (WebCore::IceServerInfo::credential):
+        (WebCore::IceServerInfo::username):
+        (WebCore::MediaEndpointConfiguration::create):
+        (WebCore::MediaEndpointConfiguration::iceServers):
+        (WebCore::MediaEndpointConfiguration::iceTransportPolicy):
+        (WebCore::MediaEndpointConfiguration::bundlePolicy):
+        * platform/mediastream/MediaEndpointSessionConfiguration.h: Added.
+        (WebCore::MediaEndpointSessionConfiguration::create):
+        (WebCore::MediaEndpointSessionConfiguration::~MediaEndpointSessionConfiguration):
+        (WebCore::MediaEndpointSessionConfiguration::sessionId):
+        (WebCore::MediaEndpointSessionConfiguration::setSessionId):
+        (WebCore::MediaEndpointSessionConfiguration::sessionVersion):
+        (WebCore::MediaEndpointSessionConfiguration::setSessionVersion):
+        (WebCore::MediaEndpointSessionConfiguration::mediaDescriptions):
+        (WebCore::MediaEndpointSessionConfiguration::addMediaDescription):
+        (WebCore::MediaEndpointSessionConfiguration::clone):
+        (WebCore::MediaEndpointSessionConfiguration::MediaEndpointSessionConfiguration):
+        * platform/mediastream/MediaPayload.h: Added.
+        (WebCore::MediaPayload::create):
+        (WebCore::MediaPayload::~MediaPayload):
+        (WebCore::MediaPayload::type):
+        (WebCore::MediaPayload::setType):
+        (WebCore::MediaPayload::encodingName):
+        (WebCore::MediaPayload::setEncodingName):
+        (WebCore::MediaPayload::clockRate):
+        (WebCore::MediaPayload::setClockRate):
+        (WebCore::MediaPayload::channels):
+        (WebCore::MediaPayload::setChannels):
+        (WebCore::MediaPayload::ccmfir):
+        (WebCore::MediaPayload::setCcmfir):
+        (WebCore::MediaPayload::nackpli):
+        (WebCore::MediaPayload::setNackpli):
+        (WebCore::MediaPayload::nack):
+        (WebCore::MediaPayload::setNack):
+        (WebCore::MediaPayload::parameters):
+        (WebCore::MediaPayload::addParameter):
+        (WebCore::MediaPayload::clone):
+        (WebCore::MediaPayload::MediaPayload):
+        * platform/mediastream/PeerMediaDescription.h: Added.
+        (WebCore::PeerMediaDescription::create):
+        (WebCore::PeerMediaDescription::~PeerMediaDescription):
+        (WebCore::PeerMediaDescription::type):
+        (WebCore::PeerMediaDescription::setType):
+        (WebCore::PeerMediaDescription::port):
+        (WebCore::PeerMediaDescription::setPort):
+        (WebCore::PeerMediaDescription::address):
+        (WebCore::PeerMediaDescription::setAddress):
+        (WebCore::PeerMediaDescription::mode):
+        (WebCore::PeerMediaDescription::setMode):
+        (WebCore::PeerMediaDescription::payloads):
+        (WebCore::PeerMediaDescription::addPayload):
+        (WebCore::PeerMediaDescription::setPayloads):
+        (WebCore::PeerMediaDescription::rtcpMux):
+        (WebCore::PeerMediaDescription::setRtcpMux):
+        (WebCore::PeerMediaDescription::rtcpAddress):
+        (WebCore::PeerMediaDescription::setRtcpAddress):
+        (WebCore::PeerMediaDescription::rtcpPort):
+        (WebCore::PeerMediaDescription::setRtcpPort):
+        (WebCore::PeerMediaDescription::mediaStreamId):
+        (WebCore::PeerMediaDescription::setMediaStreamId):
+        (WebCore::PeerMediaDescription::mediaStreamTrackId):
+        (WebCore::PeerMediaDescription::setMediaStreamTrackId):
+        (WebCore::PeerMediaDescription::dtlsSetup):
+        (WebCore::PeerMediaDescription::setDtlsSetup):
+        (WebCore::PeerMediaDescription::dtlsFingerprintHashFunction):
+        (WebCore::PeerMediaDescription::setDtlsFingerprintHashFunction):
+        (WebCore::PeerMediaDescription::dtlsFingerprint):
+        (WebCore::PeerMediaDescription::setDtlsFingerprint):
+        (WebCore::PeerMediaDescription::cname):
+        (WebCore::PeerMediaDescription::setCname):
+        (WebCore::PeerMediaDescription::ssrcs):
+        (WebCore::PeerMediaDescription::addSsrc):
+        (WebCore::PeerMediaDescription::clearSsrcs):
+        (WebCore::PeerMediaDescription::iceUfrag):
+        (WebCore::PeerMediaDescription::setIceUfrag):
+        (WebCore::PeerMediaDescription::icePassword):
+        (WebCore::PeerMediaDescription::setIcePassword):
+        (WebCore::PeerMediaDescription::iceCandidates):
+        (WebCore::PeerMediaDescription::addIceCandidate):
+        (WebCore::PeerMediaDescription::source):
+        (WebCore::PeerMediaDescription::setSource):
+        (WebCore::PeerMediaDescription::clone):
+        (WebCore::PeerMediaDescription::PeerMediaDescription):
+
 2016-02-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         [Fetch API] Implement Fetch API Response
index c34c376..ed683d4 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "DOMError.h"
 #include "JSDOMError.h"
+#include <wtf/MainThread.h>
 
 namespace WebCore {
 
@@ -174,6 +175,45 @@ void MediaEndpointPeerConnection::markAsNeedingNegotiation()
     notImplemented();
 }
 
+void MediaEndpointPeerConnection::gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction)
+{
+    ASSERT(isMainThread());
+
+    UNUSED_PARAM(fingerprint);
+    UNUSED_PARAM(fingerprintFunction);
+
+    notImplemented();
+}
+
+void MediaEndpointPeerConnection::gotIceCandidate(unsigned mdescIndex, RefPtr<IceCandidate>&& candidate)
+{
+    ASSERT(isMainThread());
+
+    UNUSED_PARAM(mdescIndex);
+    UNUSED_PARAM(candidate);
+
+    notImplemented();
+}
+
+void MediaEndpointPeerConnection::doneGatheringCandidates(unsigned mdescIndex)
+{
+    ASSERT(isMainThread());
+
+    UNUSED_PARAM(mdescIndex);
+
+    notImplemented();
+}
+
+void MediaEndpointPeerConnection::gotRemoteSource(unsigned mdescIndex, RefPtr<RealtimeMediaSource>&& source)
+{
+    ASSERT(isMainThread());
+
+    UNUSED_PARAM(mdescIndex);
+    UNUSED_PARAM(source);
+
+    notImplemented();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(MEDIA_STREAM)
index 6cd3b18..fb6f4f1 100644 (file)
@@ -33,6 +33,7 @@
 
 #if ENABLE(MEDIA_STREAM)
 
+#include "MediaEndpoint.h"
 #include "NotImplemented.h"
 #include "PeerConnectionBackend.h"
 #include "RTCSessionDescription.h"
@@ -42,7 +43,7 @@ namespace WebCore {
 
 class MediaStreamTrack;
 
-class MediaEndpointPeerConnection : public PeerConnectionBackend {
+class MediaEndpointPeerConnection : public PeerConnectionBackend, public MediaEndpointClient {
 public:
     MediaEndpointPeerConnection(PeerConnectionBackendClient*);
 
@@ -71,6 +72,13 @@ public:
     bool isNegotiationNeeded() const override { return false; };
     void markAsNeedingNegotiation() override;
     void clearNegotiationNeededState() override { notImplemented(); };
+
+private:
+    // MediaEndpointClient
+    virtual void gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction) override;
+    virtual void gotIceCandidate(unsigned mdescIndex, RefPtr<IceCandidate>&&) override;
+    virtual void doneGatheringCandidates(unsigned mdescIndex) override;
+    virtual void gotRemoteSource(unsigned mdescIndex, RefPtr<RealtimeMediaSource>&&) override;
 };
 
 } // namespace WebCore
index d360897..d491350 100644 (file)
                5EA725D31ACABD4700EAD17B /* MediaDevices.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA725CE1ACABCD900EAD17B /* MediaDevices.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5EA725D51ACABD5700EAD17B /* NavigatorMediaDevices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA725CA1ACABCB500EAD17B /* NavigatorMediaDevices.cpp */; };
                5EA725D61ACABD5700EAD17B /* NavigatorMediaDevices.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA725CB1ACABCB500EAD17B /* NavigatorMediaDevices.h */; };
+               5EBB89311C7777FF00C65D41 /* MediaPayload.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB892F1C7777D000C65D41 /* MediaPayload.h */; };
+               5EBB89321C77782300C65D41 /* MediaEndpointSessionConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB892E1C7777D000C65D41 /* MediaEndpointSessionConfiguration.h */; };
+               5EBB89331C77782900C65D41 /* IceCandidate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB89301C7777E100C65D41 /* IceCandidate.h */; };
+               5EBB89341C77782900C65D41 /* MediaEndpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBB892A1C7777D000C65D41 /* MediaEndpoint.cpp */; };
+               5EBB89351C77782900C65D41 /* MediaEndpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB892B1C7777D000C65D41 /* MediaEndpoint.h */; };
+               5EBB89361C77782900C65D41 /* MediaEndpointConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBB892C1C7777D000C65D41 /* MediaEndpointConfiguration.cpp */; };
+               5EBB89371C77782900C65D41 /* MediaEndpointConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB892D1C7777D000C65D41 /* MediaEndpointConfiguration.h */; };
+               5EBB89391C77C39900C65D41 /* PeerMediaDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB89381C77BDA400C65D41 /* PeerMediaDescription.h */; };
                5F2DBBE9178E3C8100141486 /* CertificateInfoMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */; };
                5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F2DBBE8178E336900141486 /* CertificateInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5FC7DC26CFE2563200B85AE4 /* JSEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5EA725CD1ACABCD900EAD17B /* MediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDevices.cpp; sourceTree = "<group>"; };
                5EA725CE1ACABCD900EAD17B /* MediaDevices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaDevices.h; sourceTree = "<group>"; };
                5EA725CF1ACABCD900EAD17B /* MediaDevices.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaDevices.idl; sourceTree = "<group>"; };
+               5EBB892A1C7777D000C65D41 /* MediaEndpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaEndpoint.cpp; sourceTree = "<group>"; };
+               5EBB892B1C7777D000C65D41 /* MediaEndpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpoint.h; sourceTree = "<group>"; };
+               5EBB892C1C7777D000C65D41 /* MediaEndpointConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaEndpointConfiguration.cpp; sourceTree = "<group>"; };
+               5EBB892D1C7777D000C65D41 /* MediaEndpointConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpointConfiguration.h; sourceTree = "<group>"; };
+               5EBB892E1C7777D000C65D41 /* MediaEndpointSessionConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpointSessionConfiguration.h; sourceTree = "<group>"; };
+               5EBB892F1C7777D000C65D41 /* MediaPayload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPayload.h; sourceTree = "<group>"; };
+               5EBB89301C7777E100C65D41 /* IceCandidate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IceCandidate.h; sourceTree = "<group>"; };
+               5EBB89381C77BDA400C65D41 /* PeerMediaDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeerMediaDescription.h; sourceTree = "<group>"; };
                5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CertificateInfoMac.mm; sourceTree = "<group>"; };
                5F2DBBE8178E336900141486 /* CertificateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateInfo.h; sourceTree = "<group>"; };
                5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTarget.h; sourceTree = "<group>"; };
                        children = (
                                0729B14D17CFCCA0004F1D60 /* mac */,
                                07D6A4F61BF2307D00174146 /* AudioTrackPrivateMediaStream.h */,
+                               5EBB89301C7777E100C65D41 /* IceCandidate.h */,
                                07221B9917CF0AD400848E51 /* MediaConstraints.h */,
+                               5EBB892A1C7777D000C65D41 /* MediaEndpoint.cpp */,
+                               5EBB892B1C7777D000C65D41 /* MediaEndpoint.h */,
+                               5EBB892C1C7777D000C65D41 /* MediaEndpointConfiguration.cpp */,
+                               5EBB892D1C7777D000C65D41 /* MediaEndpointConfiguration.h */,
+                               5EBB892E1C7777D000C65D41 /* MediaEndpointSessionConfiguration.h */,
+                               5EBB892F1C7777D000C65D41 /* MediaPayload.h */,
                                070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */,
                                07221BA017CF0AD400848E51 /* MediaStreamCreationClient.h */,
                                0711588F17DF633700EDFE2B /* MediaStreamPrivate.cpp */,
                                07FFDE66181AED420072D409 /* MediaStreamTrackPrivate.cpp */,
                                07FFDE67181AED420072D409 /* MediaStreamTrackPrivate.h */,
                                076306E217E22A43005A7C4E /* MediaStreamTrackSourcesRequestClient.h */,
+                               5EBB89381C77BDA400C65D41 /* PeerMediaDescription.h */,
                                4A4F656B1AA997F100E38CDD /* RealtimeMediaSource.cpp */,
                                4A4F656C1AA997F100E38CDD /* RealtimeMediaSource.h */,
                                4A4F656D1AA997F100E38CDD /* RealtimeMediaSourceCapabilities.h */,
                                BC5EB9510E82056B00B25965 /* CounterDirectives.h in Headers */,
                                9392F14C0AD1861B00691BD4 /* CounterNode.h in Headers */,
                                D0B0556809C6700100307E43 /* CreateLinkCommand.h in Headers */,
+                               5EBB89321C77782300C65D41 /* MediaEndpointSessionConfiguration.h in Headers */,
                                514C766E0CE923A1007EF3CD /* Credential.h in Headers */,
                                3792917A1985EF3900F4B661 /* CredentialBase.h in Headers */,
                                3792917E1987678F00F4B661 /* CredentialCocoa.h in Headers */,
                                CD62FB961AF018E70012ED7D /* GenericTaskQueue.h in Headers */,
                                9746AF2414F4DDE6003E7A70 /* Geolocation.h in Headers */,
                                9746AF2514F4DDE6003E7A71 /* GeolocationClient.h in Headers */,
+                               5EBB89391C77C39900C65D41 /* PeerMediaDescription.h in Headers */,
                                9746AF2714F4DDE6003E7A70 /* GeolocationController.h in Headers */,
                                9746AF2814F4DDE6003E7A70 /* GeolocationError.h in Headers */,
                                9746AF2914F4DDE6003E7A70 /* GeolocationPosition.h in Headers */,
                                5185FC971BB4C4E80012898F /* IDBKeyData.h in Headers */,
                                5185FC991BB4C4E80012898F /* IDBKeyPath.h in Headers */,
                                5185FC9B1BB4C4E80012898F /* IDBKeyRange.h in Headers */,
+                               5EBB89351C77782900C65D41 /* MediaEndpoint.h in Headers */,
                                5185FC9E1BB4C4E80012898F /* IDBKeyRangeData.h in Headers */,
                                5185FCA01BB4C4E80012898F /* IDBObjectStore.h in Headers */,
                                516071311BD8308600DBC4F2 /* IDBObjectStoreImpl.h in Headers */,
                                2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */,
                                E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */,
                                580371641A66F1D300BAF519 /* LayerFragment.h in Headers */,
+                               5EBB89331C77782900C65D41 /* IceCandidate.h in Headers */,
                                7AA3A6A0194B59B6001CBD24 /* LayerPool.h in Headers */,
                                931D72F615FE695300C4C07E /* LayoutMilestones.h in Headers */,
                                141DC051164834B900371E5A /* LayoutPoint.h in Headers */,
                                B237C8A80D344D110013F707 /* SVGFontData.h in Headers */,
                                B2A1F2AB0CEF0ABF00442F6A /* SVGFontElement.h in Headers */,
                                B2227A150D00BF220071B782 /* SVGFontFaceElement.h in Headers */,
+                               5EBB89311C7777FF00C65D41 /* MediaPayload.h in Headers */,
                                B2227A180D00BF220071B782 /* SVGFontFaceFormatElement.h in Headers */,
                                B2227A1B0D00BF220071B782 /* SVGFontFaceNameElement.h in Headers */,
                                B2227A1E0D00BF220071B782 /* SVGFontFaceSrcElement.h in Headers */,
                                7CE68345192143A800F4D928 /* UserMessageHandlerDescriptor.h in Headers */,
                                7CE683471921821500F4D928 /* UserMessageHandlerDescriptorTypes.h in Headers */,
                                7C73FB08191EF417007DE061 /* UserMessageHandlersNamespace.h in Headers */,
+                               5EBB89371C77782900C65D41 /* MediaEndpointConfiguration.h in Headers */,
                                BCA2B061105047600043BD1C /* UserScript.h in Headers */,
                                BCA2B08B10505BCD0043BD1C /* UserScriptTypes.h in Headers */,
                                BC8BF151105813BF00A40A07 /* UserStyleSheet.h in Headers */,
                                0FB8890E167D30160010CDA5 /* ScrollingStateStickyNode.cpp in Sources */,
                                931CBD10161A44E900E4C874 /* ScrollingStateTree.cpp in Sources */,
                                1AF62F2514DAFE9E0041556C /* ScrollingThread.cpp in Sources */,
+                               5EBB89361C77782900C65D41 /* MediaEndpointConfiguration.cpp in Sources */,
                                1AF62F2414DAFE910041556C /* ScrollingThreadMac.mm in Sources */,
                                1AAADDA314DB409F00AF64B3 /* ScrollingTree.cpp in Sources */,
                                93C38C04164473DD00091EB2 /* ScrollingTreeFixedNode.mm in Sources */,
                                7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */,
                                7E8FADC4199A95B100714968 /* SubresourceLoaderCocoa.mm in Sources */,
                                E1FF8F5F1807442100132674 /* SubtleCrypto.cpp in Sources */,
+                               5EBB89341C77782900C65D41 /* MediaEndpoint.cpp in Sources */,
                                93B2D8180F9920EE006AE6B2 /* SuddenTermination.mm in Sources */,
                                572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */,
                                087558C513B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp in Sources */,
diff --git a/Source/WebCore/platform/mediastream/IceCandidate.h b/Source/WebCore/platform/mediastream/IceCandidate.h
new file mode 100644 (file)
index 0000000..5ac355e
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2015 Ericsson AB. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IceCandidate_h
+#define IceCandidate_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class IceCandidate : public RefCounted<IceCandidate> {
+public:
+    static RefPtr<IceCandidate> create()
+    {
+        return adoptRef(new IceCandidate());
+    }
+    virtual ~IceCandidate() { }
+
+    const String& type() const { return m_type; }
+    void setType(const String& type) { m_type = type; }
+
+    const String& foundation() const { return m_foundation; }
+    void setFoundation(const String& foundation) { m_foundation = foundation; }
+
+    unsigned componentId() const { return m_componentId; }
+    void setComponentId(unsigned componentId) { m_componentId = componentId; }
+
+    const String& transport() const { return m_transport; }
+    void setTransport(const String& transport) { m_transport = transport; }
+
+    int priority() const { return m_priority; }
+    void setPriority(int priority) { m_priority = priority; }
+
+    const String& address() const { return m_address; }
+    void setAddress(const String& address) { m_address = address; }
+
+    unsigned port() const { return m_port; }
+    void setPort(unsigned port) { m_port = port; }
+
+    const String& tcpType() const { return m_tcpType; }
+    void setTcpType(const String& tcpType) { m_tcpType = tcpType; }
+
+    const String& relatedAddress() const { return m_relatedAddress; }
+    void setRelatedAddress(const String& relatedAddress) { m_relatedAddress = relatedAddress; }
+
+    unsigned relatedPort() const { return m_relatedPort; }
+    void setRelatedPort(unsigned relatedPort) { m_relatedPort = relatedPort; }
+
+    RefPtr<IceCandidate> clone() const
+    {
+        RefPtr<IceCandidate> copy = create();
+
+        copy->m_type = String(m_type);
+        copy->m_foundation = String(m_foundation);
+        copy->m_componentId = m_componentId;
+        copy->m_transport = String(m_transport);
+        copy->m_priority = m_priority;
+        copy->m_address = String(m_address);
+        copy->m_port = m_port;
+        copy->m_tcpType = String(m_tcpType);
+        copy->m_relatedAddress = String(m_relatedAddress);
+        copy->m_relatedPort = m_relatedPort;
+
+        return copy;
+    }
+
+private:
+    IceCandidate() { }
+
+    String m_type;
+    String m_foundation;
+    unsigned m_componentId { 0 };
+    String m_transport;
+    int m_priority { 0 };
+    String m_address;
+    unsigned m_port { 0 };
+    String m_tcpType;
+    String m_relatedAddress;
+    unsigned m_relatedPort { 0 };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // IceCandidate_h
diff --git a/Source/WebCore/platform/mediastream/MediaEndpoint.cpp b/Source/WebCore/platform/mediastream/MediaEndpoint.cpp
new file mode 100644 (file)
index 0000000..01fb6c7
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2015 Ericsson AB. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(MEDIA_STREAM)
+#include "MediaEndpoint.h"
+
+namespace WebCore {
+
+static std::unique_ptr<MediaEndpoint> createMediaEndpoint(MediaEndpointClient*)
+{
+    return nullptr;
+}
+
+CreateMediaEndpoint MediaEndpoint::create = createMediaEndpoint;
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
diff --git a/Source/WebCore/platform/mediastream/MediaEndpoint.h b/Source/WebCore/platform/mediastream/MediaEndpoint.h
new file mode 100644 (file)
index 0000000..570688d
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2015 Ericsson AB. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MediaEndpoint_h
+#define MediaEndpoint_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "MediaEndpointConfiguration.h"
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class IceCandidate;
+class MediaEndpoint;
+class MediaEndpointSessionConfiguration;
+class MediaPayload;
+class RealtimeMediaSource;
+
+class MediaEndpointClient {
+public:
+    virtual void gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction) = 0;
+    virtual void gotIceCandidate(unsigned mdescIndex, RefPtr<IceCandidate>&&) = 0;
+    virtual void doneGatheringCandidates(unsigned mdescIndex) = 0;
+    virtual void gotRemoteSource(unsigned mdescIndex, RefPtr<RealtimeMediaSource>&&) = 0;
+
+    virtual ~MediaEndpointClient() { }
+};
+
+typedef std::unique_ptr<MediaEndpoint> (*CreateMediaEndpoint)(MediaEndpointClient*);
+
+class MediaEndpoint {
+public:
+    WEBCORE_EXPORT static CreateMediaEndpoint create;
+    virtual ~MediaEndpoint() { }
+
+    enum class UpdateResult {
+        Success,
+        SuccessWithIceRestart,
+        Failed
+    };
+
+    virtual void setConfiguration(RefPtr<MediaEndpointConfiguration>&&) = 0;
+
+    virtual void generateDtlsInfo() = 0;
+    virtual Vector<RefPtr<MediaPayload>> getDefaultAudioPayloads() = 0;
+    virtual Vector<RefPtr<MediaPayload>> getDefaultVideoPayloads() = 0;
+
+    virtual UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) = 0;
+    virtual UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) = 0;
+
+    virtual void addRemoteCandidate(IceCandidate&, unsigned mdescIndex, const String& ufrag, const String& password) = 0;
+
+    virtual void replaceSendSource(RealtimeMediaSource&, unsigned mdescIndex) = 0;
+
+    virtual void stop() = 0;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // MediaEndpoint_h
diff --git a/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.cpp b/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.cpp
new file mode 100644 (file)
index 0000000..a26acb1
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2015 Ericsson AB. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MediaEndpointConfiguration.h"
+
+#if ENABLE(MEDIA_STREAM)
+
+namespace WebCore {
+
+IceServerInfo::IceServerInfo(const Vector<String>& urls, const String& credential, const String& username)
+    : m_credential(credential)
+    , m_username(username)
+{
+    m_urls.reserveCapacity(urls.size());
+    for (auto& url : urls)
+        m_urls.append(URL(URL(), url));
+}
+
+MediaEndpointConfiguration::MediaEndpointConfiguration(Vector<RefPtr<IceServerInfo>>& iceServers, const String& iceTransportPolicy, const String& bundlePolicy)
+    : m_iceServers(iceServers)
+{
+    if (iceTransportPolicy == "none")
+        m_iceTransportPolicy = IceTransportPolicy::None;
+    else if (iceTransportPolicy == "relay")
+        m_iceTransportPolicy = IceTransportPolicy::Relay;
+    else if (iceTransportPolicy == "all")
+        m_iceTransportPolicy = IceTransportPolicy::All;
+    else
+        ASSERT_NOT_REACHED();
+
+    if (bundlePolicy == "balanced")
+        m_bundlePolicy = BundlePolicy::Balanced;
+    else if (bundlePolicy == "max-compat")
+        m_bundlePolicy = BundlePolicy::MaxCompat;
+    else if (bundlePolicy == "max-bundle")
+        m_bundlePolicy = BundlePolicy::MaxBundle;
+    else
+        ASSERT_NOT_REACHED();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
diff --git a/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h b/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h
new file mode 100644 (file)
index 0000000..2e032b4
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2015 Ericsson AB. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MediaEndpointConfiguration_h
+#define MediaEndpointConfiguration_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "URL.h"
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class IceServerInfo : public RefCounted<IceServerInfo> {
+public:
+    static RefPtr<IceServerInfo> create(const Vector<String>& urls, const String& credential, const String& username)
+    {
+        return adoptRef(new IceServerInfo(urls, credential, username));
+    }
+    virtual ~IceServerInfo() { }
+
+    const Vector<URL>& urls() const { return m_urls; }
+    const String& credential() const { return m_credential; }
+    const String& username() const { return m_username; }
+
+private:
+    IceServerInfo(const Vector<String>& urls, const String& credential, const String& username);
+
+    Vector<URL> m_urls;
+    String m_credential;
+    String m_username;
+};
+
+class MediaEndpointConfiguration : public RefCounted<MediaEndpointConfiguration> {
+public:
+    static RefPtr<MediaEndpointConfiguration> create(Vector<RefPtr<IceServerInfo>>& iceServers, const String& iceTransportPolicy, const String& bundlePolicy)
+    {
+        return adoptRef(new MediaEndpointConfiguration(iceServers, iceTransportPolicy, bundlePolicy));
+    }
+
+    enum class IceTransportPolicy {
+        None,
+        Relay,
+        All
+    };
+
+    enum class BundlePolicy {
+        Balanced,
+        MaxCompat,
+        MaxBundle
+    };
+
+    const Vector<RefPtr<IceServerInfo>>& iceServers() const { return m_iceServers; }
+    IceTransportPolicy iceTransportPolicy() const { return m_iceTransportPolicy; }
+    BundlePolicy bundlePolicy() const { return m_bundlePolicy; }
+
+private:
+    MediaEndpointConfiguration(Vector<RefPtr<IceServerInfo>>&, const String& iceTransportPolicy, const String& bundlePolicy);
+
+    Vector<RefPtr<IceServerInfo>> m_iceServers;
+    IceTransportPolicy m_iceTransportPolicy;
+    BundlePolicy m_bundlePolicy;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // MediaEndpointConfiguration_h
diff --git a/Source/WebCore/platform/mediastream/MediaEndpointSessionConfiguration.h b/Source/WebCore/platform/mediastream/MediaEndpointSessionConfiguration.h
new file mode 100644 (file)
index 0000000..cd79110
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2015 Ericsson AB. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MediaEndpointSessionConfiguration_h
+#define MediaEndpointSessionConfiguration_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "PeerMediaDescription.h"
+#include <wtf/CryptographicallyRandomNumber.h>
+
+namespace WebCore {
+
+class MediaEndpointSessionConfiguration : public RefCounted<MediaEndpointSessionConfiguration> {
+public:
+    static RefPtr<MediaEndpointSessionConfiguration> create()
+    {
+        return adoptRef(new MediaEndpointSessionConfiguration());
+    }
+    virtual ~MediaEndpointSessionConfiguration() { }
+
+    uint64_t sessionId() const { return m_sessionId; }
+    void setSessionId(uint64_t sessionId) { m_sessionId = sessionId; }
+
+    unsigned sessionVersion() const { return m_sessionVersion; }
+    void setSessionVersion(unsigned sessionVersion) { m_sessionVersion = sessionVersion; }
+
+    const Vector<RefPtr<PeerMediaDescription>>& mediaDescriptions() const { return m_mediaDescriptions; }
+    void addMediaDescription(RefPtr<PeerMediaDescription>&& description) { m_mediaDescriptions.append(WTFMove(description)); }
+
+    RefPtr<MediaEndpointSessionConfiguration> clone() const
+    {
+        RefPtr<MediaEndpointSessionConfiguration> copy = create();
+        copy->m_sessionId = m_sessionId;
+        copy->m_sessionVersion = m_sessionVersion;
+
+        for (auto& mdesc : m_mediaDescriptions)
+            copy->m_mediaDescriptions.append(mdesc->clone());
+
+        return copy;
+    }
+
+private:
+    MediaEndpointSessionConfiguration()
+    {
+        m_sessionId = cryptographicallyRandomNumber();
+        m_sessionId = m_sessionId << 32 | cryptographicallyRandomNumber();
+    }
+
+    uint64_t m_sessionId;
+    unsigned m_sessionVersion { 0 };
+
+    Vector<RefPtr<PeerMediaDescription>> m_mediaDescriptions;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // MediaEndpointSessionConfiguration_h
diff --git a/Source/WebCore/platform/mediastream/MediaPayload.h b/Source/WebCore/platform/mediastream/MediaPayload.h
new file mode 100644 (file)
index 0000000..db3f8bf
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2015 Ericsson AB. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MediaPayload_h
+#define MediaPayload_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <wtf/HashMap.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/StringHash.h>
+
+namespace WebCore {
+
+class MediaPayload : public RefCounted<MediaPayload> {
+public:
+    static RefPtr<MediaPayload> create()
+    {
+        return adoptRef(new MediaPayload());
+    }
+    virtual ~MediaPayload() { }
+
+    unsigned type() const { return m_type; }
+    void setType(unsigned type) { m_type = type; }
+
+    const String& encodingName() const { return m_encodingName; }
+    void setEncodingName(const String & encodingName) { m_encodingName = encodingName; }
+
+    unsigned clockRate() const { return m_clockRate; }
+    void setClockRate(unsigned clockRate) { m_clockRate = clockRate; }
+
+    unsigned channels() const { return m_channels; }
+    void setChannels(unsigned channels) { m_channels = channels; }
+
+    bool ccmfir() const { return m_ccmfir; }
+    void setCcmfir(bool ccmfir) { m_ccmfir = ccmfir; }
+
+    bool nackpli() const { return m_nackpli; }
+    void setNackpli(bool nackpli) { m_nackpli = nackpli; }
+
+    bool nack() const { return m_nack; }
+    void setNack(bool nack) { m_nack = nack; }
+
+    const HashMap<String, unsigned>& parameters() const { return m_parameters; }
+    void addParameter(const String& name, unsigned value) { m_parameters.set(name, value); }
+
+    RefPtr<MediaPayload> clone() const
+    {
+        RefPtr<MediaPayload> copy = create();
+
+        copy->m_type = m_type;
+        copy->m_encodingName = String(m_encodingName);
+        copy->m_clockRate = m_clockRate;
+
+        copy->m_channels = m_channels;
+
+        copy->m_ccmfir = m_ccmfir;
+        copy->m_nackpli = m_nackpli;
+        copy->m_nack = m_nack;
+
+        for (auto& key : m_parameters.keys())
+            copy->m_parameters.add(key, m_parameters.get(key));
+
+        return copy;
+    }
+
+private:
+    MediaPayload() { }
+
+    unsigned m_type { 0 };
+    String m_encodingName;
+    unsigned m_clockRate { 0 };
+
+    // audio
+    unsigned m_channels { 0 };
+
+    // video
+    bool m_ccmfir { false };
+    bool m_nackpli { false };
+    bool m_nack { false };
+
+    HashMap<String, unsigned> m_parameters;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // MediaPayload_h
diff --git a/Source/WebCore/platform/mediastream/PeerMediaDescription.h b/Source/WebCore/platform/mediastream/PeerMediaDescription.h
new file mode 100644 (file)
index 0000000..ac6c6d4
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Copyright (C) 2015 Ericsson AB. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PeerMediaDescription_h
+#define PeerMediaDescription_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "IceCandidate.h"
+#include "MediaPayload.h"
+#include "RealtimeMediaSource.h"
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class PeerMediaDescription : public RefCounted<PeerMediaDescription> {
+public:
+    static RefPtr<PeerMediaDescription> create()
+    {
+        return adoptRef(new PeerMediaDescription());
+    }
+    virtual ~PeerMediaDescription() { }
+
+    const String& type() const { return m_type; }
+    void setType(const String& type) { m_type = type; }
+
+    unsigned short port() const { return m_port; }
+    void setPort(unsigned short port) { m_port = port; }
+
+    const String& address() const { return m_address; }
+    void setAddress(const String& address) { m_address = address; }
+
+    const String& mode() const { return m_mode; }
+    void setMode(const String& mode) { m_mode = mode; }
+
+    const Vector<RefPtr<MediaPayload>>& payloads() const { return m_payloads; }
+    void addPayload(RefPtr<MediaPayload>&& payload) { m_payloads.append(WTFMove(payload)); }
+    void setPayloads(Vector<RefPtr<MediaPayload>>&& payloads) { m_payloads = payloads; }
+    void setPayloads(const Vector<RefPtr<MediaPayload>>& payloads) { m_payloads = payloads; }
+
+    bool rtcpMux() const { return m_rtcpMux; }
+    void setRtcpMux(bool rtcpMux) { m_rtcpMux = rtcpMux; }
+
+    const String& rtcpAddress() const { return m_rtcpAddress; }
+    void setRtcpAddress(const String& rtcpAddress) { m_rtcpAddress = rtcpAddress; }
+
+    unsigned short rtcpPort() const { return m_rtcpPort; }
+    void setRtcpPort(unsigned short rtcpPort) { m_rtcpPort = rtcpPort; }
+
+    const String& mediaStreamId() const { return m_mediaStreamId; }
+    void setMediaStreamId(const String& mediaStreamId) { m_mediaStreamId = mediaStreamId; }
+
+    const String& mediaStreamTrackId() const { return m_mediaStreamTrackId; }
+    void setMediaStreamTrackId(const String& mediaStreamTrackId) { m_mediaStreamTrackId = mediaStreamTrackId; }
+
+    const String& dtlsSetup() const { return m_dtlsSetup; }
+    void setDtlsSetup(const String& dtlsSetup) { m_dtlsSetup = dtlsSetup; }
+
+    const String& dtlsFingerprintHashFunction() const { return m_dtlsFingerprintHashFunction; }
+    void setDtlsFingerprintHashFunction(const String& dtlsFingerprintHashFunction) { m_dtlsFingerprintHashFunction = dtlsFingerprintHashFunction; }
+
+    const String& dtlsFingerprint() const { return m_dtlsFingerprint; }
+    void setDtlsFingerprint(const String& dtlsFingerprint) { m_dtlsFingerprint = dtlsFingerprint; }
+
+    const String& cname() const { return m_cname; }
+    void setCname(const String& cname) { m_cname = cname; }
+
+    const Vector<unsigned>& ssrcs() const { return m_ssrcs; }
+    void addSsrc(unsigned ssrc) { m_ssrcs.append(ssrc); }
+    void clearSsrcs() { m_ssrcs.clear(); }
+
+    const String& iceUfrag() const { return m_iceUfrag; }
+    void setIceUfrag(const String& iceUfrag) { m_iceUfrag = iceUfrag; }
+
+    const String& icePassword() const { return m_icePassword; }
+    void setIcePassword(const String& icePassword) { m_icePassword = icePassword; }
+
+    const Vector<RefPtr<IceCandidate>>& iceCandidates() const { return m_iceCandidates; }
+    void addIceCandidate(RefPtr<IceCandidate>&& candidate) { m_iceCandidates.append(WTFMove(candidate)); }
+
+    RealtimeMediaSource* source() const { return m_source.get(); }
+    void setSource(RefPtr<RealtimeMediaSource>&& source) { m_source = source; }
+
+    RefPtr<PeerMediaDescription> clone() const
+    {
+        RefPtr<PeerMediaDescription> copy = create();
+
+        copy->m_type = String(m_type);
+        copy->m_port = m_port;
+        copy->m_address = String(m_address);
+        copy->m_mode = String(m_mode);
+
+        for (auto& payload : m_payloads)
+            copy->m_payloads.append(payload->clone());
+
+        copy->m_rtcpMux = m_rtcpMux;
+        copy->m_rtcpAddress = String(m_rtcpAddress);
+        copy->m_rtcpPort = m_rtcpPort;
+
+        copy->m_mediaStreamId = String(m_mediaStreamId);
+        copy->m_mediaStreamTrackId = String(m_mediaStreamTrackId);
+
+        copy->m_dtlsSetup = String(m_dtlsSetup);
+        copy->m_dtlsFingerprintHashFunction = String(m_dtlsFingerprintHashFunction);
+        copy->m_dtlsFingerprint = String(m_dtlsFingerprint);
+
+        for (auto ssrc : m_ssrcs)
+            copy->m_ssrcs.append(ssrc);
+
+        copy->m_cname = String(m_cname);
+
+        copy->m_iceUfrag = String(m_iceUfrag);
+        copy->m_icePassword = String(m_icePassword);
+
+        for (auto& candidate : m_iceCandidates)
+            copy->m_iceCandidates.append(candidate->clone());
+
+        return copy;
+    }
+
+private:
+    PeerMediaDescription() { }
+
+    String m_type;
+    unsigned short m_port { 0 };
+    String m_address;
+    String m_mode;
+
+    Vector<RefPtr<MediaPayload>> m_payloads;
+
+    bool m_rtcpMux { false };
+    String m_rtcpAddress;
+    unsigned short m_rtcpPort { 0 };
+
+    String m_mediaStreamId;
+    String m_mediaStreamTrackId;
+
+    String m_dtlsSetup;
+    String m_dtlsFingerprintHashFunction;
+    String m_dtlsFingerprint;
+
+    Vector<unsigned> m_ssrcs;
+    String m_cname;
+
+    String m_iceUfrag;
+    String m_icePassword;
+    Vector<RefPtr<IceCandidate>> m_iceCandidates;
+
+    RefPtr<RealtimeMediaSource> m_source { nullptr };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // PeerMediaDescription_h