Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 11 | #ifndef PC_SESSION_DESCRIPTION_H_ |
| 12 | #define PC_SESSION_DESCRIPTION_H_ |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 13 | |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 14 | #include <stddef.h> |
| 15 | #include <stdint.h> |
Jonas Olsson | a4d8737 | 2019-07-05 17:08:33 | [diff] [blame] | 16 | |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 17 | #include <iosfwd> |
Harald Alvestrand | 4d7160e | 2019-04-12 05:01:29 | [diff] [blame] | 18 | #include <memory> |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 19 | #include <string> |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 20 | #include <utility> |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 21 | #include <vector> |
| 22 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 23 | #include "absl/memory/memory.h" |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 24 | #include "api/crypto_params.h" |
| 25 | #include "api/media_types.h" |
| 26 | #include "api/rtp_parameters.h" |
| 27 | #include "api/rtp_transceiver_interface.h" |
| 28 | #include "media/base/media_channel.h" |
Taylor Brandstetter | ee8c246 | 2020-07-27 22:52:02 | [diff] [blame] | 29 | #include "media/base/media_constants.h" |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 30 | #include "media/base/stream_params.h" |
| 31 | #include "p2p/base/transport_description.h" |
| 32 | #include "p2p/base/transport_info.h" |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 33 | #include "pc/media_protocol_names.h" |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 34 | #include "pc/simulcast_description.h" |
Harald Alvestrand | 8da35a6 | 2019-05-10 07:31:04 | [diff] [blame] | 35 | #include "rtc_base/deprecation.h" |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 36 | #include "rtc_base/socket_address.h" |
Mirko Bonadei | 35214fc | 2019-09-23 12:54:28 | [diff] [blame] | 37 | #include "rtc_base/system/rtc_export.h" |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 38 | |
| 39 | namespace cricket { |
| 40 | |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 41 | typedef std::vector<AudioCodec> AudioCodecs; |
| 42 | typedef std::vector<VideoCodec> VideoCodecs; |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 43 | typedef std::vector<RtpDataCodec> RtpDataCodecs; |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 44 | typedef std::vector<CryptoParams> CryptoParamsVec; |
| 45 | typedef std::vector<webrtc::RtpExtension> RtpHeaderExtensions; |
| 46 | |
| 47 | // RTC4585 RTP/AVPF |
| 48 | extern const char kMediaProtocolAvpf[]; |
| 49 | // RFC5124 RTP/SAVPF |
| 50 | extern const char kMediaProtocolSavpf[]; |
| 51 | |
| 52 | extern const char kMediaProtocolDtlsSavpf[]; |
| 53 | |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 54 | // Options to control how session descriptions are generated. |
| 55 | const int kAutoBandwidth = -1; |
| 56 | |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 57 | class AudioContentDescription; |
Steve Anton | 46afbf9 | 2019-05-10 18:15:18 | [diff] [blame] | 58 | class VideoContentDescription; |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 59 | class RtpDataContentDescription; |
| 60 | class SctpDataContentDescription; |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 61 | |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 62 | // Describes a session description media section. There are subclasses for each |
| 63 | // media type (audio, video, data) that will have additional information. |
| 64 | class MediaContentDescription { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 65 | public: |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 66 | MediaContentDescription() = default; |
| 67 | virtual ~MediaContentDescription() = default; |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 68 | |
| 69 | virtual MediaType type() const = 0; |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 70 | |
| 71 | // Try to cast this media description to an AudioContentDescription. Returns |
| 72 | // nullptr if the cast fails. |
| 73 | virtual AudioContentDescription* as_audio() { return nullptr; } |
| 74 | virtual const AudioContentDescription* as_audio() const { return nullptr; } |
| 75 | |
| 76 | // Try to cast this media description to a VideoContentDescription. Returns |
| 77 | // nullptr if the cast fails. |
| 78 | virtual VideoContentDescription* as_video() { return nullptr; } |
| 79 | virtual const VideoContentDescription* as_video() const { return nullptr; } |
| 80 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 81 | virtual RtpDataContentDescription* as_rtp_data() { return nullptr; } |
| 82 | virtual const RtpDataContentDescription* as_rtp_data() const { |
| 83 | return nullptr; |
| 84 | } |
| 85 | |
| 86 | virtual SctpDataContentDescription* as_sctp() { return nullptr; } |
| 87 | virtual const SctpDataContentDescription* as_sctp() const { return nullptr; } |
| 88 | |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 89 | virtual bool has_codecs() const = 0; |
| 90 | |
Harald Alvestrand | 0fb07f8 | 2020-02-27 19:21:37 | [diff] [blame] | 91 | // Copy operator that returns an unique_ptr. |
| 92 | // Not a virtual function. |
| 93 | // If a type-specific variant of Clone() is desired, override it, or |
| 94 | // simply use std::make_unique<typename>(*this) instead of Clone(). |
| 95 | std::unique_ptr<MediaContentDescription> Clone() const { |
| 96 | return absl::WrapUnique(CloneInternal()); |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 97 | } |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 98 | |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 99 | // |protocol| is the expected media transport protocol, such as RTP/AVPF, |
| 100 | // RTP/SAVPF or SCTP/DTLS. |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 101 | virtual std::string protocol() const { return protocol_; } |
| 102 | virtual void set_protocol(const std::string& protocol) { |
| 103 | protocol_ = protocol; |
| 104 | } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 105 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 106 | virtual webrtc::RtpTransceiverDirection direction() const { |
| 107 | return direction_; |
| 108 | } |
| 109 | virtual void set_direction(webrtc::RtpTransceiverDirection direction) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 110 | direction_ = direction; |
| 111 | } |
| 112 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 113 | virtual bool rtcp_mux() const { return rtcp_mux_; } |
| 114 | virtual void set_rtcp_mux(bool mux) { rtcp_mux_ = mux; } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 115 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 116 | virtual bool rtcp_reduced_size() const { return rtcp_reduced_size_; } |
| 117 | virtual void set_rtcp_reduced_size(bool reduced_size) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 118 | rtcp_reduced_size_ = reduced_size; |
| 119 | } |
| 120 | |
Sebastian Jansson | 97321b6 | 2019-07-24 12:01:18 | [diff] [blame] | 121 | // Indicates support for the remote network estimate packet type. This |
| 122 | // functionality is experimental and subject to change without notice. |
Sebastian Jansson | e1795f4 | 2019-07-24 09:38:03 | [diff] [blame] | 123 | virtual bool remote_estimate() const { return remote_estimate_; } |
| 124 | virtual void set_remote_estimate(bool remote_estimate) { |
| 125 | remote_estimate_ = remote_estimate; |
| 126 | } |
| 127 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 128 | virtual int bandwidth() const { return bandwidth_; } |
| 129 | virtual void set_bandwidth(int bandwidth) { bandwidth_ = bandwidth; } |
Taylor Brandstetter | ee8c246 | 2020-07-27 22:52:02 | [diff] [blame] | 130 | virtual std::string bandwidth_type() const { return bandwidth_type_; } |
| 131 | virtual void set_bandwidth_type(std::string bandwidth_type) { |
| 132 | bandwidth_type_ = bandwidth_type; |
| 133 | } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 134 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 135 | virtual const std::vector<CryptoParams>& cryptos() const { return cryptos_; } |
| 136 | virtual void AddCrypto(const CryptoParams& params) { |
| 137 | cryptos_.push_back(params); |
| 138 | } |
| 139 | virtual void set_cryptos(const std::vector<CryptoParams>& cryptos) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 140 | cryptos_ = cryptos; |
| 141 | } |
| 142 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 143 | virtual const RtpHeaderExtensions& rtp_header_extensions() const { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 144 | return rtp_header_extensions_; |
| 145 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 146 | virtual void set_rtp_header_extensions( |
| 147 | const RtpHeaderExtensions& extensions) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 148 | rtp_header_extensions_ = extensions; |
| 149 | rtp_header_extensions_set_ = true; |
| 150 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 151 | virtual void AddRtpHeaderExtension(const webrtc::RtpExtension& ext) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 152 | rtp_header_extensions_.push_back(ext); |
| 153 | rtp_header_extensions_set_ = true; |
| 154 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 155 | virtual void ClearRtpHeaderExtensions() { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 156 | rtp_header_extensions_.clear(); |
| 157 | rtp_header_extensions_set_ = true; |
| 158 | } |
| 159 | // We can't always tell if an empty list of header extensions is |
| 160 | // because the other side doesn't support them, or just isn't hooked up to |
| 161 | // signal them. For now we assume an empty list means no signaling, but |
| 162 | // provide the ClearRtpHeaderExtensions method to allow "no support" to be |
| 163 | // clearly indicated (i.e. when derived from other information). |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 164 | virtual bool rtp_header_extensions_set() const { |
| 165 | return rtp_header_extensions_set_; |
| 166 | } |
| 167 | virtual const StreamParamsVec& streams() const { return send_streams_; } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 168 | // TODO(pthatcher): Remove this by giving mediamessage.cc access |
| 169 | // to MediaContentDescription |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 170 | virtual StreamParamsVec& mutable_streams() { return send_streams_; } |
| 171 | virtual void AddStream(const StreamParams& stream) { |
Amit Hilbuch | c57d573 | 2018-12-11 23:30:11 | [diff] [blame] | 172 | send_streams_.push_back(stream); |
| 173 | } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 174 | // Legacy streams have an ssrc, but nothing else. |
| 175 | void AddLegacyStream(uint32_t ssrc) { |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 176 | AddStream(StreamParams::CreateLegacy(ssrc)); |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 177 | } |
| 178 | void AddLegacyStream(uint32_t ssrc, uint32_t fid_ssrc) { |
| 179 | StreamParams sp = StreamParams::CreateLegacy(ssrc); |
| 180 | sp.AddFidSsrc(ssrc, fid_ssrc); |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 181 | AddStream(sp); |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 182 | } |
Amit Hilbuch | c57d573 | 2018-12-11 23:30:11 | [diff] [blame] | 183 | |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 184 | // Sets the CNAME of all StreamParams if it have not been set. |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 185 | virtual void SetCnameIfEmpty(const std::string& cname) { |
Amit Hilbuch | c57d573 | 2018-12-11 23:30:11 | [diff] [blame] | 186 | for (cricket::StreamParamsVec::iterator it = send_streams_.begin(); |
| 187 | it != send_streams_.end(); ++it) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 188 | if (it->cname.empty()) |
| 189 | it->cname = cname; |
| 190 | } |
| 191 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 192 | virtual uint32_t first_ssrc() const { |
Amit Hilbuch | c57d573 | 2018-12-11 23:30:11 | [diff] [blame] | 193 | if (send_streams_.empty()) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 194 | return 0; |
| 195 | } |
Amit Hilbuch | c57d573 | 2018-12-11 23:30:11 | [diff] [blame] | 196 | return send_streams_[0].first_ssrc(); |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 197 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 198 | virtual bool has_ssrcs() const { |
Amit Hilbuch | c57d573 | 2018-12-11 23:30:11 | [diff] [blame] | 199 | if (send_streams_.empty()) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 200 | return false; |
| 201 | } |
Amit Hilbuch | c57d573 | 2018-12-11 23:30:11 | [diff] [blame] | 202 | return send_streams_[0].has_ssrcs(); |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 203 | } |
| 204 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 205 | virtual void set_conference_mode(bool enable) { conference_mode_ = enable; } |
| 206 | virtual bool conference_mode() const { return conference_mode_; } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 207 | |
| 208 | // https://tools.ietf.org/html/rfc4566#section-5.7 |
| 209 | // May be present at the media or session level of SDP. If present at both |
| 210 | // levels, the media-level attribute overwrites the session-level one. |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 211 | virtual void set_connection_address(const rtc::SocketAddress& address) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 212 | connection_address_ = address; |
| 213 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 214 | virtual const rtc::SocketAddress& connection_address() const { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 215 | return connection_address_; |
| 216 | } |
| 217 | |
Johannes Kron | 0854eb6 | 2018-10-10 20:33:20 | [diff] [blame] | 218 | // Determines if it's allowed to mix one- and two-byte rtp header extensions |
| 219 | // within the same rtp stream. |
Johannes Kron | 9581bc4 | 2018-10-23 08:17:39 | [diff] [blame] | 220 | enum ExtmapAllowMixed { kNo, kSession, kMedia }; |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 221 | virtual void set_extmap_allow_mixed_enum( |
| 222 | ExtmapAllowMixed new_extmap_allow_mixed) { |
Johannes Kron | 9ac3c91 | 2018-10-12 08:54:26 | [diff] [blame] | 223 | if (new_extmap_allow_mixed == kMedia && |
Johannes Kron | 9581bc4 | 2018-10-23 08:17:39 | [diff] [blame] | 224 | extmap_allow_mixed_enum_ == kSession) { |
Johannes Kron | 0854eb6 | 2018-10-10 20:33:20 | [diff] [blame] | 225 | // Do not downgrade from session level to media level. |
| 226 | return; |
| 227 | } |
Johannes Kron | 9581bc4 | 2018-10-23 08:17:39 | [diff] [blame] | 228 | extmap_allow_mixed_enum_ = new_extmap_allow_mixed; |
Johannes Kron | 0854eb6 | 2018-10-10 20:33:20 | [diff] [blame] | 229 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 230 | virtual ExtmapAllowMixed extmap_allow_mixed_enum() const { |
Johannes Kron | 9581bc4 | 2018-10-23 08:17:39 | [diff] [blame] | 231 | return extmap_allow_mixed_enum_; |
Johannes Kron | 9ac3c91 | 2018-10-12 08:54:26 | [diff] [blame] | 232 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 233 | virtual bool extmap_allow_mixed() const { |
| 234 | return extmap_allow_mixed_enum_ != kNo; |
| 235 | } |
Johannes Kron | 0854eb6 | 2018-10-10 20:33:20 | [diff] [blame] | 236 | |
Amit Hilbuch | a201204 | 2018-12-03 19:35:05 | [diff] [blame] | 237 | // Simulcast functionality. |
| 238 | virtual bool HasSimulcast() const { return !simulcast_.empty(); } |
| 239 | virtual SimulcastDescription& simulcast_description() { return simulcast_; } |
| 240 | virtual const SimulcastDescription& simulcast_description() const { |
| 241 | return simulcast_; |
| 242 | } |
| 243 | virtual void set_simulcast_description( |
| 244 | const SimulcastDescription& simulcast) { |
| 245 | simulcast_ = simulcast; |
| 246 | } |
Florent Castelli | b60141b | 2019-07-03 10:47:54 | [diff] [blame] | 247 | virtual const std::vector<RidDescription>& receive_rids() const { |
| 248 | return receive_rids_; |
| 249 | } |
| 250 | virtual void set_receive_rids(const std::vector<RidDescription>& rids) { |
| 251 | receive_rids_ = rids; |
| 252 | } |
Amit Hilbuch | a201204 | 2018-12-03 19:35:05 | [diff] [blame] | 253 | |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 254 | protected: |
| 255 | bool rtcp_mux_ = false; |
| 256 | bool rtcp_reduced_size_ = false; |
Sebastian Jansson | e1795f4 | 2019-07-24 09:38:03 | [diff] [blame] | 257 | bool remote_estimate_ = false; |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 258 | int bandwidth_ = kAutoBandwidth; |
Taylor Brandstetter | ee8c246 | 2020-07-27 22:52:02 | [diff] [blame] | 259 | std::string bandwidth_type_ = kApplicationSpecificBandwidth; |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 260 | std::string protocol_; |
| 261 | std::vector<CryptoParams> cryptos_; |
| 262 | std::vector<webrtc::RtpExtension> rtp_header_extensions_; |
| 263 | bool rtp_header_extensions_set_ = false; |
Amit Hilbuch | c57d573 | 2018-12-11 23:30:11 | [diff] [blame] | 264 | StreamParamsVec send_streams_; |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 265 | bool conference_mode_ = false; |
| 266 | webrtc::RtpTransceiverDirection direction_ = |
| 267 | webrtc::RtpTransceiverDirection::kSendRecv; |
| 268 | rtc::SocketAddress connection_address_; |
Johannes Kron | 0854eb6 | 2018-10-10 20:33:20 | [diff] [blame] | 269 | // Mixed one- and two-byte header not included in offer on media level or |
| 270 | // session level, but we will respond that we support it. The plan is to add |
| 271 | // it to our offer on session level. See todo in SessionDescription. |
Johannes Kron | 9581bc4 | 2018-10-23 08:17:39 | [diff] [blame] | 272 | ExtmapAllowMixed extmap_allow_mixed_enum_ = kNo; |
Amit Hilbuch | a201204 | 2018-12-03 19:35:05 | [diff] [blame] | 273 | |
| 274 | SimulcastDescription simulcast_; |
Florent Castelli | b60141b | 2019-07-03 10:47:54 | [diff] [blame] | 275 | std::vector<RidDescription> receive_rids_; |
Bjorn A Mellem | 8e1343a | 2019-09-30 22:12:47 | [diff] [blame] | 276 | |
Harald Alvestrand | 0fb07f8 | 2020-02-27 19:21:37 | [diff] [blame] | 277 | private: |
| 278 | // Copy function that returns a raw pointer. Caller will assert ownership. |
| 279 | // Should only be called by the Clone() function. Must be implemented |
| 280 | // by each final subclass. |
| 281 | virtual MediaContentDescription* CloneInternal() const = 0; |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 282 | }; |
| 283 | |
| 284 | template <class C> |
| 285 | class MediaContentDescriptionImpl : public MediaContentDescription { |
| 286 | public: |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 287 | void set_protocol(const std::string& protocol) override { |
| 288 | RTC_DCHECK(IsRtpProtocol(protocol)); |
| 289 | protocol_ = protocol; |
| 290 | } |
| 291 | |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 292 | typedef C CodecType; |
| 293 | |
| 294 | // Codecs should be in preference order (most preferred codec first). |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 295 | virtual const std::vector<C>& codecs() const { return codecs_; } |
| 296 | virtual void set_codecs(const std::vector<C>& codecs) { codecs_ = codecs; } |
| 297 | bool has_codecs() const override { return !codecs_.empty(); } |
| 298 | virtual bool HasCodec(int id) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 299 | bool found = false; |
| 300 | for (typename std::vector<C>::iterator iter = codecs_.begin(); |
| 301 | iter != codecs_.end(); ++iter) { |
| 302 | if (iter->id == id) { |
| 303 | found = true; |
| 304 | break; |
| 305 | } |
| 306 | } |
| 307 | return found; |
| 308 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 309 | virtual void AddCodec(const C& codec) { codecs_.push_back(codec); } |
| 310 | virtual void AddOrReplaceCodec(const C& codec) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 311 | for (typename std::vector<C>::iterator iter = codecs_.begin(); |
| 312 | iter != codecs_.end(); ++iter) { |
| 313 | if (iter->id == codec.id) { |
| 314 | *iter = codec; |
| 315 | return; |
| 316 | } |
| 317 | } |
| 318 | AddCodec(codec); |
| 319 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 320 | virtual void AddCodecs(const std::vector<C>& codecs) { |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 321 | typename std::vector<C>::const_iterator codec; |
| 322 | for (codec = codecs.begin(); codec != codecs.end(); ++codec) { |
| 323 | AddCodec(*codec); |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | private: |
| 328 | std::vector<C> codecs_; |
| 329 | }; |
| 330 | |
| 331 | class AudioContentDescription : public MediaContentDescriptionImpl<AudioCodec> { |
| 332 | public: |
| 333 | AudioContentDescription() {} |
| 334 | |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 335 | virtual MediaType type() const { return MEDIA_TYPE_AUDIO; } |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 336 | virtual AudioContentDescription* as_audio() { return this; } |
| 337 | virtual const AudioContentDescription* as_audio() const { return this; } |
Harald Alvestrand | 0fb07f8 | 2020-02-27 19:21:37 | [diff] [blame] | 338 | |
| 339 | private: |
| 340 | virtual AudioContentDescription* CloneInternal() const { |
| 341 | return new AudioContentDescription(*this); |
| 342 | } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 343 | }; |
| 344 | |
| 345 | class VideoContentDescription : public MediaContentDescriptionImpl<VideoCodec> { |
| 346 | public: |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 347 | virtual MediaType type() const { return MEDIA_TYPE_VIDEO; } |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 348 | virtual VideoContentDescription* as_video() { return this; } |
| 349 | virtual const VideoContentDescription* as_video() const { return this; } |
Harald Alvestrand | 0fb07f8 | 2020-02-27 19:21:37 | [diff] [blame] | 350 | |
| 351 | private: |
| 352 | virtual VideoContentDescription* CloneInternal() const { |
| 353 | return new VideoContentDescription(*this); |
| 354 | } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 355 | }; |
| 356 | |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 357 | class RtpDataContentDescription |
| 358 | : public MediaContentDescriptionImpl<RtpDataCodec> { |
| 359 | public: |
| 360 | RtpDataContentDescription() {} |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 361 | MediaType type() const override { return MEDIA_TYPE_DATA; } |
| 362 | RtpDataContentDescription* as_rtp_data() override { return this; } |
| 363 | const RtpDataContentDescription* as_rtp_data() const override { return this; } |
Harald Alvestrand | 0fb07f8 | 2020-02-27 19:21:37 | [diff] [blame] | 364 | |
| 365 | private: |
| 366 | RtpDataContentDescription* CloneInternal() const override { |
| 367 | return new RtpDataContentDescription(*this); |
| 368 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 369 | }; |
| 370 | |
| 371 | class SctpDataContentDescription : public MediaContentDescription { |
| 372 | public: |
| 373 | SctpDataContentDescription() {} |
| 374 | SctpDataContentDescription(const SctpDataContentDescription& o) |
| 375 | : MediaContentDescription(o), |
| 376 | use_sctpmap_(o.use_sctpmap_), |
| 377 | port_(o.port_), |
Harald Alvestrand | c5effc2 | 2019-06-11 09:46:59 | [diff] [blame] | 378 | max_message_size_(o.max_message_size_) {} |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 379 | MediaType type() const override { return MEDIA_TYPE_DATA; } |
| 380 | SctpDataContentDescription* as_sctp() override { return this; } |
| 381 | const SctpDataContentDescription* as_sctp() const override { return this; } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 382 | |
| 383 | bool has_codecs() const override { return false; } |
| 384 | void set_protocol(const std::string& protocol) override { |
| 385 | RTC_DCHECK(IsSctpProtocol(protocol)); |
| 386 | protocol_ = protocol; |
| 387 | } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 388 | |
| 389 | bool use_sctpmap() const { return use_sctpmap_; } |
| 390 | void set_use_sctpmap(bool enable) { use_sctpmap_ = enable; } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 391 | int port() const { return port_; } |
| 392 | void set_port(int port) { port_ = port; } |
| 393 | int max_message_size() const { return max_message_size_; } |
| 394 | void set_max_message_size(int max_message_size) { |
| 395 | max_message_size_ = max_message_size; |
| 396 | } |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 397 | |
| 398 | private: |
Harald Alvestrand | 0fb07f8 | 2020-02-27 19:21:37 | [diff] [blame] | 399 | SctpDataContentDescription* CloneInternal() const override { |
| 400 | return new SctpDataContentDescription(*this); |
| 401 | } |
Harald Alvestrand | 5fc28b1 | 2019-05-13 11:36:16 | [diff] [blame] | 402 | bool use_sctpmap_ = true; // Note: "true" is no longer conformant. |
| 403 | // Defaults should be constants imported from SCTP. Quick hack. |
| 404 | int port_ = 5000; |
Harald Alvestrand | fbb45bd | 2019-05-15 06:07:47 | [diff] [blame] | 405 | // draft-ietf-mmusic-sdp-sctp-23: Max message size default is 64K |
| 406 | int max_message_size_ = 64 * 1024; |
Steve Anton | afd8e8c | 2017-12-20 00:35:35 | [diff] [blame] | 407 | }; |
| 408 | |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 409 | // Protocol used for encoding media. This is the "top level" protocol that may |
| 410 | // be wrapped by zero or many transport protocols (UDP, ICE, etc.). |
| 411 | enum class MediaProtocolType { |
| 412 | kRtp, // Section will use the RTP protocol (e.g., for audio or video). |
| 413 | // https://tools.ietf.org/html/rfc3550 |
| 414 | kSctp // Section will use the SCTP protocol (e.g., for a data channel). |
| 415 | // https://tools.ietf.org/html/rfc4960 |
| 416 | }; |
| 417 | |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 418 | // Represents a session description section. Most information about the section |
| 419 | // is stored in the description, which is a subclass of MediaContentDescription. |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 420 | // Owns the description. |
Mirko Bonadei | 35214fc | 2019-09-23 12:54:28 | [diff] [blame] | 421 | class RTC_EXPORT ContentInfo { |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 422 | public: |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 423 | explicit ContentInfo(MediaProtocolType type) : type(type) {} |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 424 | ~ContentInfo(); |
| 425 | // Copy |
| 426 | ContentInfo(const ContentInfo& o); |
| 427 | ContentInfo& operator=(const ContentInfo& o); |
| 428 | ContentInfo(ContentInfo&& o) = default; |
| 429 | ContentInfo& operator=(ContentInfo&& o) = default; |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 430 | |
| 431 | // Alias for |name|. |
| 432 | std::string mid() const { return name; } |
| 433 | void set_mid(const std::string& mid) { this->name = mid; } |
| 434 | |
| 435 | // Alias for |description|. |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 436 | MediaContentDescription* media_description(); |
| 437 | const MediaContentDescription* media_description() const; |
| 438 | |
| 439 | void set_media_description(std::unique_ptr<MediaContentDescription> desc) { |
| 440 | description_ = std::move(desc); |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 441 | } |
| 442 | |
Steve Anton | 8171211 | 2018-01-05 19:27:54 | [diff] [blame] | 443 | // TODO(bugs.webrtc.org/8620): Rename this to mid. |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 444 | std::string name; |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 445 | MediaProtocolType type; |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 446 | bool rejected = false; |
| 447 | bool bundle_only = false; |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 448 | |
| 449 | private: |
| 450 | friend class SessionDescription; |
| 451 | std::unique_ptr<MediaContentDescription> description_; |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 452 | }; |
| 453 | |
| 454 | typedef std::vector<std::string> ContentNames; |
| 455 | |
| 456 | // This class provides a mechanism to aggregate different media contents into a |
| 457 | // group. This group can also be shared with the peers in a pre-defined format. |
| 458 | // GroupInfo should be populated only with the |content_name| of the |
| 459 | // MediaDescription. |
| 460 | class ContentGroup { |
| 461 | public: |
| 462 | explicit ContentGroup(const std::string& semantics); |
| 463 | ContentGroup(const ContentGroup&); |
| 464 | ContentGroup(ContentGroup&&); |
| 465 | ContentGroup& operator=(const ContentGroup&); |
| 466 | ContentGroup& operator=(ContentGroup&&); |
| 467 | ~ContentGroup(); |
| 468 | |
| 469 | const std::string& semantics() const { return semantics_; } |
| 470 | const ContentNames& content_names() const { return content_names_; } |
| 471 | |
| 472 | const std::string* FirstContentName() const; |
| 473 | bool HasContentName(const std::string& content_name) const; |
| 474 | void AddContentName(const std::string& content_name); |
| 475 | bool RemoveContentName(const std::string& content_name); |
| 476 | |
| 477 | private: |
| 478 | std::string semantics_; |
| 479 | ContentNames content_names_; |
| 480 | }; |
| 481 | |
| 482 | typedef std::vector<ContentInfo> ContentInfos; |
| 483 | typedef std::vector<ContentGroup> ContentGroups; |
| 484 | |
| 485 | const ContentInfo* FindContentInfoByName(const ContentInfos& contents, |
| 486 | const std::string& name); |
| 487 | const ContentInfo* FindContentInfoByType(const ContentInfos& contents, |
| 488 | const std::string& type); |
| 489 | |
Steve Anton | e831b8c | 2018-02-01 20:22:16 | [diff] [blame] | 490 | // Determines how the MSID will be signaled in the SDP. These can be used as |
| 491 | // flags to indicate both or none. |
| 492 | enum MsidSignaling { |
| 493 | // Signal MSID with one a=msid line in the media section. |
| 494 | kMsidSignalingMediaSection = 0x1, |
| 495 | // Signal MSID with a=ssrc: msid lines in the media section. |
| 496 | kMsidSignalingSsrcAttribute = 0x2 |
| 497 | }; |
| 498 | |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 499 | // Describes a collection of contents, each with its own name and |
| 500 | // type. Analogous to a <jingle> or <session> stanza. Assumes that |
| 501 | // contents are unique be name, but doesn't enforce that. |
| 502 | class SessionDescription { |
| 503 | public: |
| 504 | SessionDescription(); |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 505 | ~SessionDescription(); |
| 506 | |
Harald Alvestrand | 4d7160e | 2019-04-12 05:01:29 | [diff] [blame] | 507 | std::unique_ptr<SessionDescription> Clone() const; |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 508 | |
| 509 | // Content accessors. |
| 510 | const ContentInfos& contents() const { return contents_; } |
| 511 | ContentInfos& contents() { return contents_; } |
| 512 | const ContentInfo* GetContentByName(const std::string& name) const; |
| 513 | ContentInfo* GetContentByName(const std::string& name); |
Steve Anton | b1c1de1 | 2017-12-21 23:14:30 | [diff] [blame] | 514 | const MediaContentDescription* GetContentDescriptionByName( |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 515 | const std::string& name) const; |
Steve Anton | b1c1de1 | 2017-12-21 23:14:30 | [diff] [blame] | 516 | MediaContentDescription* GetContentDescriptionByName(const std::string& name); |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 517 | const ContentInfo* FirstContentByType(MediaProtocolType type) const; |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 518 | const ContentInfo* FirstContent() const; |
| 519 | |
| 520 | // Content mutators. |
| 521 | // Adds a content to this description. Takes ownership of ContentDescription*. |
| 522 | void AddContent(const std::string& name, |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 523 | MediaProtocolType type, |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 524 | std::unique_ptr<MediaContentDescription> description); |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 525 | void AddContent(const std::string& name, |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 526 | MediaProtocolType type, |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 527 | bool rejected, |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 528 | std::unique_ptr<MediaContentDescription> description); |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 529 | void AddContent(const std::string& name, |
Steve Anton | 5adfafd | 2017-12-21 00:34:00 | [diff] [blame] | 530 | MediaProtocolType type, |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 531 | bool rejected, |
| 532 | bool bundle_only, |
Harald Alvestrand | 1716d39 | 2019-06-03 18:35:45 | [diff] [blame] | 533 | std::unique_ptr<MediaContentDescription> description); |
| 534 | void AddContent(ContentInfo&& content); |
Johannes Kron | 9ac3c91 | 2018-10-12 08:54:26 | [diff] [blame] | 535 | |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 536 | bool RemoveContentByName(const std::string& name); |
| 537 | |
| 538 | // Transport accessors. |
| 539 | const TransportInfos& transport_infos() const { return transport_infos_; } |
| 540 | TransportInfos& transport_infos() { return transport_infos_; } |
| 541 | const TransportInfo* GetTransportInfoByName(const std::string& name) const; |
| 542 | TransportInfo* GetTransportInfoByName(const std::string& name); |
| 543 | const TransportDescription* GetTransportDescriptionByName( |
| 544 | const std::string& name) const { |
| 545 | const TransportInfo* tinfo = GetTransportInfoByName(name); |
| 546 | return tinfo ? &tinfo->description : NULL; |
| 547 | } |
| 548 | |
| 549 | // Transport mutators. |
| 550 | void set_transport_infos(const TransportInfos& transport_infos) { |
| 551 | transport_infos_ = transport_infos; |
| 552 | } |
| 553 | // Adds a TransportInfo to this description. |
Steve Anton | 06817cd | 2018-12-18 23:55:30 | [diff] [blame] | 554 | void AddTransportInfo(const TransportInfo& transport_info); |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 555 | bool RemoveTransportInfoByName(const std::string& name); |
| 556 | |
| 557 | // Group accessors. |
| 558 | const ContentGroups& groups() const { return content_groups_; } |
| 559 | const ContentGroup* GetGroupByName(const std::string& name) const; |
| 560 | bool HasGroup(const std::string& name) const; |
| 561 | |
| 562 | // Group mutators. |
| 563 | void AddGroup(const ContentGroup& group) { content_groups_.push_back(group); } |
| 564 | // Remove the first group with the same semantics specified by |name|. |
| 565 | void RemoveGroupByName(const std::string& name); |
| 566 | |
| 567 | // Global attributes. |
| 568 | void set_msid_supported(bool supported) { msid_supported_ = supported; } |
| 569 | bool msid_supported() const { return msid_supported_; } |
| 570 | |
Steve Anton | e831b8c | 2018-02-01 20:22:16 | [diff] [blame] | 571 | // Determines how the MSIDs were/will be signaled. Flag value composed of |
| 572 | // MsidSignaling bits (see enum above). |
| 573 | void set_msid_signaling(int msid_signaling) { |
| 574 | msid_signaling_ = msid_signaling; |
| 575 | } |
| 576 | int msid_signaling() const { return msid_signaling_; } |
| 577 | |
Johannes Kron | 0854eb6 | 2018-10-10 20:33:20 | [diff] [blame] | 578 | // Determines if it's allowed to mix one- and two-byte rtp header extensions |
| 579 | // within the same rtp stream. |
Johannes Kron | 9581bc4 | 2018-10-23 08:17:39 | [diff] [blame] | 580 | void set_extmap_allow_mixed(bool supported) { |
| 581 | extmap_allow_mixed_ = supported; |
| 582 | MediaContentDescription::ExtmapAllowMixed media_level_setting = |
Johannes Kron | 0854eb6 | 2018-10-10 20:33:20 | [diff] [blame] | 583 | supported ? MediaContentDescription::kSession |
| 584 | : MediaContentDescription::kNo; |
| 585 | for (auto& content : contents_) { |
Johannes Kron | 9ac3c91 | 2018-10-12 08:54:26 | [diff] [blame] | 586 | // Do not set to kNo if the current setting is kMedia. |
Johannes Kron | 9581bc4 | 2018-10-23 08:17:39 | [diff] [blame] | 587 | if (supported || content.media_description()->extmap_allow_mixed_enum() != |
| 588 | MediaContentDescription::kMedia) { |
| 589 | content.media_description()->set_extmap_allow_mixed_enum( |
Johannes Kron | 9ac3c91 | 2018-10-12 08:54:26 | [diff] [blame] | 590 | media_level_setting); |
| 591 | } |
Johannes Kron | 0854eb6 | 2018-10-10 20:33:20 | [diff] [blame] | 592 | } |
| 593 | } |
Johannes Kron | 9581bc4 | 2018-10-23 08:17:39 | [diff] [blame] | 594 | bool extmap_allow_mixed() const { return extmap_allow_mixed_; } |
Johannes Kron | 0854eb6 | 2018-10-10 20:33:20 | [diff] [blame] | 595 | |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 596 | private: |
| 597 | SessionDescription(const SessionDescription&); |
| 598 | |
| 599 | ContentInfos contents_; |
| 600 | TransportInfos transport_infos_; |
| 601 | ContentGroups content_groups_; |
| 602 | bool msid_supported_ = true; |
Steve Anton | e831b8c | 2018-02-01 20:22:16 | [diff] [blame] | 603 | // Default to what Plan B would do. |
| 604 | // TODO(bugs.webrtc.org/8530): Change default to kMsidSignalingMediaSection. |
| 605 | int msid_signaling_ = kMsidSignalingSsrcAttribute; |
Johannes Kron | 89f874e | 2018-11-12 09:25:48 | [diff] [blame] | 606 | // TODO(webrtc:9985): Activate mixed one- and two-byte header extension in |
| 607 | // offer at session level. It's currently not included in offer by default |
| 608 | // because clients prior to https://bugs.webrtc.org/9712 cannot parse this |
| 609 | // correctly. If it's included in offer to us we will respond that we support |
| 610 | // it. |
Johannes Kron | 9581bc4 | 2018-10-23 08:17:39 | [diff] [blame] | 611 | bool extmap_allow_mixed_ = false; |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 612 | }; |
| 613 | |
Steve Anton | b1c1de1 | 2017-12-21 23:14:30 | [diff] [blame] | 614 | // Indicates whether a session description was sent by the local client or |
| 615 | // received from the remote client. |
Steve Anton | 4ab68ee | 2017-12-19 22:26:11 | [diff] [blame] | 616 | enum ContentSource { CS_LOCAL, CS_REMOTE }; |
| 617 | |
| 618 | } // namespace cricket |
| 619 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 620 | #endif // PC_SESSION_DESCRIPTION_H_ |