Add support for JSEP offer/answer with transceivers
This change adds support to PeerConnection's CreateOffer/ CreateAnswer/SetLocalDescription/SetRemoteDescription for Unified Plan SDP mapping to/from RtpTransceivers. This behavior is enabled using the kUnifiedPlan SDP semantics in the PeerConnection configuration. Bug: webrtc:7600 Change-Id: I4b44f5d3690887d387bf9c47eac00db8ec974571 Reviewed-on: https://webrtc-review.googlesource.com/28341 Commit-Queue: Steve Anton <steveanton@webrtc.org> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21442}
This commit is contained in:
@ -12,8 +12,14 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "pc/rtpmediautils.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, RtpTransceiverDirection direction) {
|
||||
return os << RtpTransceiverDirectionToString(direction);
|
||||
}
|
||||
|
||||
RtpTransceiver::RtpTransceiver(cricket::MediaType media_type)
|
||||
: unified_plan_(false), media_type_(media_type) {
|
||||
RTC_DCHECK(media_type == cricket::MEDIA_TYPE_AUDIO ||
|
||||
@ -142,6 +148,13 @@ rtc::scoped_refptr<RtpReceiverInterface> RtpTransceiver::receiver() const {
|
||||
return receivers_[0];
|
||||
}
|
||||
|
||||
void RtpTransceiver::set_current_direction(RtpTransceiverDirection direction) {
|
||||
current_direction_ = direction;
|
||||
if (RtpTransceiverDirectionHasSend(*current_direction_)) {
|
||||
has_ever_been_used_to_send_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool RtpTransceiver::stopped() const {
|
||||
return stopped_;
|
||||
}
|
||||
@ -152,7 +165,7 @@ RtpTransceiverDirection RtpTransceiver::direction() const {
|
||||
|
||||
void RtpTransceiver::SetDirection(RtpTransceiverDirection new_direction) {
|
||||
// TODO(steveanton): This should fire OnNegotiationNeeded.
|
||||
direction_ = new_direction;
|
||||
set_direction(new_direction);
|
||||
}
|
||||
|
||||
rtc::Optional<RtpTransceiverDirection> RtpTransceiver::current_direction()
|
||||
|
||||
Reference in New Issue
Block a user