From 73da79cf6646fcc2f5bd3c7df1a508fff8082193 Mon Sep 17 00:00:00 2001 From: Steve Anton Date: Mon, 27 Nov 2017 15:12:31 -0800 Subject: [PATCH] Step 1 to remove MediaContentDirection This change adds |transceiver_direction()| and |set_transceiver_direction()| to MediaContentDescription so that external users can switch off of MediaContentDirection. This deprecates the use of |direction()| and |set_direction()| for external users. Once everyone has moved off of those methods, the signiture will change to return/set RtpTransceiverDirection. Then external users can move back to these methods with the new signature. Bug: webrtc:8558 Change-Id: I7e3ba289d3a0ac738b364b0388621cc3e7bcf5d3 Reviewed-on: https://webrtc-review.googlesource.com/24743 Commit-Queue: Steve Anton Reviewed-by: Peter Thatcher Cr-Commit-Position: refs/heads/master@{#20900} --- pc/mediasession.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/pc/mediasession.h b/pc/mediasession.h index 41e867be12..edc9d495a8 100644 --- a/pc/mediasession.h +++ b/pc/mediasession.h @@ -163,11 +163,24 @@ class MediaContentDescription : public ContentDescription { std::string protocol() const { return protocol_; } void set_protocol(const std::string& protocol) { protocol_ = protocol; } - MediaContentDirection direction() const { return direction_; } - void set_direction(MediaContentDirection direction) { + // TODO(steveanton): Remove once |direction()| uses RtpTransceiverDirection. + webrtc::RtpTransceiverDirection transceiver_direction() const { + return direction_; + } + void set_transceiver_direction(webrtc::RtpTransceiverDirection direction) { direction_ = direction; } + // MediaContentDirection is deprecated; use RtpTransceiverDirection instead. + // TODO(steveanton): Change this method to return RtpTransceiverDirection once + // external users have switched to |transceiver_direction()|. + MediaContentDirection direction() const { + return MediaContentDirectionFromRtpTransceiverDirection(direction_); + } + void set_direction(MediaContentDirection direction) { + direction_ = RtpTransceiverDirectionFromMediaContentDirection(direction); + } + bool rtcp_mux() const { return rtcp_mux_; } void set_rtcp_mux(bool mux) { rtcp_mux_ = mux; } @@ -295,7 +308,8 @@ class MediaContentDescription : public ContentDescription { StreamParamsVec streams_; bool conference_mode_ = false; bool partial_ = false; - MediaContentDirection direction_ = MD_SENDRECV; + webrtc::RtpTransceiverDirection direction_ = + webrtc::RtpTransceiverDirection::kSendRecv; rtc::SocketAddress connection_address_; };