Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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):


Canonical link: https://commits.webkit.org/172756@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197053 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
adam-be committed Feb 24, 2016
1 parent d844fe0 commit 7e8ace6
Show file tree
Hide file tree
Showing 13 changed files with 1,050 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Source/WebCore/CMakeLists.txt
Expand Up @@ -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
Expand Down
155 changes: 155 additions & 0 deletions Source/WebCore/ChangeLog
@@ -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
Expand Down
40 changes: 40 additions & 0 deletions Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
Expand Up @@ -35,6 +35,7 @@

#include "DOMError.h"
#include "JSDOMError.h"
#include <wtf/MainThread.h>

namespace WebCore {

Expand Down Expand Up @@ -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)
Expand Up @@ -33,6 +33,7 @@

#if ENABLE(MEDIA_STREAM)

#include "MediaEndpoint.h"
#include "NotImplemented.h"
#include "PeerConnectionBackend.h"
#include "RTCSessionDescription.h"
Expand All @@ -42,7 +43,7 @@ namespace WebCore {

class MediaStreamTrack;

class MediaEndpointPeerConnection : public PeerConnectionBackend {
class MediaEndpointPeerConnection : public PeerConnectionBackend, public MediaEndpointClient {
public:
MediaEndpointPeerConnection(PeerConnectionBackendClient*);

Expand Down Expand Up @@ -71,6 +72,13 @@ class MediaEndpointPeerConnection : public PeerConnectionBackend {
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
Expand Down

0 comments on commit 7e8ace6

Please sign in to comment.