Introduce LibWebRTC backends for sender and receiver
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2018 18:48:38 +0000 (18:48 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2018 18:48:38 +0000 (18:48 +0000)
commit42ea53d43ceca59b3c414905d0a37ac7ec7ba26b
treeaac71bcb6ef77ca0ee78d3e1f35a84bfaef98539
parent6db7334aae904b07b86bc61019f8d84e09c830af
Introduce LibWebRTC backends for sender and receiver
https://bugs.webkit.org/show_bug.cgi?id=189171

Reviewed by Alejandro G. Castro.

Rename RTCRtpSender::Backend to RTCRtpSenderBackend, ditto for RTCRtpReceiver::Backend.
Make RTCRtpSender/RTCRtpReceiver own their backend.
This will allow the backends to own a libwebrtc sender/receiver ref counted object
and might allow us to cleanly separate code from unified plan vs plan B.

Update code so that libwebrtc code specific code is now creating senders and receivers.
This moves code from RTCPeerConnection down to LibWebRTCPeerConnectionBackend, in particular for
addTrack and addTransceiver methods.

Moved some code from LibWebRTCMediaEndpoint to LibWebRTCUtils to ease readability.

A future patch will allow to tie the libwebrtc sender/receiver to WebKit DOM sender/receiver.

Covered by existing tests.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addTrack):
(WebCore::PeerConnectionBackend::addTransceiver):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::addTransceiver):
(WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpReceiver.cpp:
(WebCore::RTCRtpReceiver::RTCRtpReceiver):
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::create):
(WebCore::RTCRtpReceiver::setBackend):
* Modules/mediastream/RTCRtpReceiverBackend.h: Added.
(WebCore::RTCRtpReceiverBackend::getParameters):
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::RTCRtpSender):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSenderBackend.h: Added.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
(WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
(WebCore::LibWebRTCPeerConnectionBackend::completeAddTransceiver):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: Added.
(WebCore::LibWebRTCRtpReceiverBackend::getParameters):
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h: Added.
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: Added.
(WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
(WebCore::LibWebRTCRtpSenderBackend::getParameters const):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: Added.
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
(WebCore::fillEncodingParameters):
(WebCore::fillHeaderExtensionParameters):
(WebCore::fillCodecParameters):
(WebCore::fillRtpParameters):
* Modules/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
(WebCore::fromStdString):
* WebCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnection.h
Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp
Source/WebCore/Modules/mediastream/RTCRtpReceiver.h
Source/WebCore/Modules/mediastream/RTCRtpReceiverBackend.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCRtpSender.cpp
Source/WebCore/Modules/mediastream/RTCRtpSender.h
Source/WebCore/Modules/mediastream/RTCRtpSenderBackend.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.h [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj