addTransceiver should trigger mid generation in the SDP
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Jun 2017 00:27:33 +0000 (00:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Jun 2017 00:27:33 +0000 (00:27 +0000)
commit9c77b1242273b4d57a020c5e1e98a03e7ef9fda1
tree16c3052cdb9e243c9ad85c6706d8faafa20b3a27
parent7241e49ec7732d59863d5894d0507e77876dee3f
addTransceiver should trigger mid generation in the SDP
https://bugs.webkit.org/show_bug.cgi?id=173452

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

Source/WebCore:

Test: webrtc/video-addTransceiver.html

Adding support for recvonly SDP based on call to addTransceiver.
Using offer_to_receive options of libwebrtc for that purpose.

Making sure that addTransceiver and using a real track afterwards is working too.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::enqueueReplaceTrackTask): notify the backend that a track is added in case the sender has no track.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio): Detect whether some audio mid should be recvonly.
(WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo): Detect whether some video mid should be recvonly.
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

LayoutTests:

* webrtc/routines.js:
(createConnections):
* webrtc/video-addTransceiver-expected.txt: Added.
* webrtc/video-addTransceiver.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/webrtc/routines.js
LayoutTests/webrtc/video-addTransceiver-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/video-addTransceiver.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h