blob: 4980dbff5ecb32e5ae31ac00c3fbb132b9cbc34e [file] [log] [blame]
Steve Anton4ab68ee2017-12-19 14:26:11 -08001/*
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
11#ifndef PC_SESSIONDESCRIPTION_H_
12#define PC_SESSIONDESCRIPTION_H_
13
14#include <string>
15#include <vector>
16
Steve Antonafd8e8c2017-12-19 16:35:35 -080017#include "api/cryptoparams.h"
18#include "api/rtpparameters.h"
19#include "api/rtptransceiverinterface.h"
20#include "media/base/codec.h"
21#include "media/base/mediachannel.h"
22#include "media/base/streamparams.h"
Steve Anton4ab68ee2017-12-19 14:26:11 -080023#include "p2p/base/transportinfo.h"
24#include "rtc_base/constructormagic.h"
25
26namespace cricket {
27
Steve Antonafd8e8c2017-12-19 16:35:35 -080028typedef std::vector<AudioCodec> AudioCodecs;
29typedef std::vector<VideoCodec> VideoCodecs;
30typedef std::vector<DataCodec> DataCodecs;
31typedef std::vector<CryptoParams> CryptoParamsVec;
32typedef std::vector<webrtc::RtpExtension> RtpHeaderExtensions;
33
34// RTC4585 RTP/AVPF
35extern const char kMediaProtocolAvpf[];
36// RFC5124 RTP/SAVPF
37extern const char kMediaProtocolSavpf[];
38
39extern const char kMediaProtocolDtlsSavpf[];
40
41extern const char kMediaProtocolRtpPrefix[];
42
43extern const char kMediaProtocolSctp[];
44extern const char kMediaProtocolDtlsSctp[];
45extern const char kMediaProtocolUdpDtlsSctp[];
46extern const char kMediaProtocolTcpDtlsSctp[];
47
48// Options to control how session descriptions are generated.
49const int kAutoBandwidth = -1;
50
Steve Anton5adfafd2017-12-20 16:34:00 -080051class AudioContentDescription;
52class VideoContentDescription;
53class DataContentDescription;
Steve Anton4ab68ee2017-12-19 14:26:11 -080054
Steve Anton5adfafd2017-12-20 16:34:00 -080055// Describes a session description media section. There are subclasses for each
56// media type (audio, video, data) that will have additional information.
57class MediaContentDescription {
Steve Antonafd8e8c2017-12-19 16:35:35 -080058 public:
Steve Anton5adfafd2017-12-20 16:34:00 -080059 MediaContentDescription() = default;
60 virtual ~MediaContentDescription() = default;
Steve Antonafd8e8c2017-12-19 16:35:35 -080061
62 virtual MediaType type() const = 0;
Steve Anton5adfafd2017-12-20 16:34:00 -080063
64 // Try to cast this media description to an AudioContentDescription. Returns
65 // nullptr if the cast fails.
66 virtual AudioContentDescription* as_audio() { return nullptr; }
67 virtual const AudioContentDescription* as_audio() const { return nullptr; }
68
69 // Try to cast this media description to a VideoContentDescription. Returns
70 // nullptr if the cast fails.
71 virtual VideoContentDescription* as_video() { return nullptr; }
72 virtual const VideoContentDescription* as_video() const { return nullptr; }
73
74 // Try to cast this media description to a DataContentDescription. Returns
75 // nullptr if the cast fails.
76 virtual DataContentDescription* as_data() { return nullptr; }
77 virtual const DataContentDescription* as_data() const { return nullptr; }
78
Steve Antonafd8e8c2017-12-19 16:35:35 -080079 virtual bool has_codecs() const = 0;
80
Steve Anton5adfafd2017-12-20 16:34:00 -080081 virtual MediaContentDescription* Copy() const = 0;
82
Steve Antonafd8e8c2017-12-19 16:35:35 -080083 // |protocol| is the expected media transport protocol, such as RTP/AVPF,
84 // RTP/SAVPF or SCTP/DTLS.
85 std::string protocol() const { return protocol_; }
86 void set_protocol(const std::string& protocol) { protocol_ = protocol; }
87
88 webrtc::RtpTransceiverDirection direction() const { return direction_; }
89 void set_direction(webrtc::RtpTransceiverDirection direction) {
90 direction_ = direction;
91 }
92
93 bool rtcp_mux() const { return rtcp_mux_; }
94 void set_rtcp_mux(bool mux) { rtcp_mux_ = mux; }
95
96 bool rtcp_reduced_size() const { return rtcp_reduced_size_; }
97 void set_rtcp_reduced_size(bool reduced_size) {
98 rtcp_reduced_size_ = reduced_size;
99 }
100
101 int bandwidth() const { return bandwidth_; }
102 void set_bandwidth(int bandwidth) { bandwidth_ = bandwidth; }
103
104 const std::vector<CryptoParams>& cryptos() const { return cryptos_; }
105 void AddCrypto(const CryptoParams& params) { cryptos_.push_back(params); }
106 void set_cryptos(const std::vector<CryptoParams>& cryptos) {
107 cryptos_ = cryptos;
108 }
109
110 const RtpHeaderExtensions& rtp_header_extensions() const {
111 return rtp_header_extensions_;
112 }
113 void set_rtp_header_extensions(const RtpHeaderExtensions& extensions) {
114 rtp_header_extensions_ = extensions;
115 rtp_header_extensions_set_ = true;
116 }
117 void AddRtpHeaderExtension(const webrtc::RtpExtension& ext) {
118 rtp_header_extensions_.push_back(ext);
119 rtp_header_extensions_set_ = true;
120 }
121 void AddRtpHeaderExtension(const cricket::RtpHeaderExtension& ext) {
122 webrtc::RtpExtension webrtc_extension;
123 webrtc_extension.uri = ext.uri;
124 webrtc_extension.id = ext.id;
125 rtp_header_extensions_.push_back(webrtc_extension);
126 rtp_header_extensions_set_ = true;
127 }
128 void ClearRtpHeaderExtensions() {
129 rtp_header_extensions_.clear();
130 rtp_header_extensions_set_ = true;
131 }
132 // We can't always tell if an empty list of header extensions is
133 // because the other side doesn't support them, or just isn't hooked up to
134 // signal them. For now we assume an empty list means no signaling, but
135 // provide the ClearRtpHeaderExtensions method to allow "no support" to be
136 // clearly indicated (i.e. when derived from other information).
137 bool rtp_header_extensions_set() const { return rtp_header_extensions_set_; }
138 const StreamParamsVec& streams() const { return streams_; }
139 // TODO(pthatcher): Remove this by giving mediamessage.cc access
140 // to MediaContentDescription
141 StreamParamsVec& mutable_streams() { return streams_; }
142 void AddStream(const StreamParams& stream) { streams_.push_back(stream); }
143 // Legacy streams have an ssrc, but nothing else.
144 void AddLegacyStream(uint32_t ssrc) {
145 streams_.push_back(StreamParams::CreateLegacy(ssrc));
146 }
147 void AddLegacyStream(uint32_t ssrc, uint32_t fid_ssrc) {
148 StreamParams sp = StreamParams::CreateLegacy(ssrc);
149 sp.AddFidSsrc(ssrc, fid_ssrc);
150 streams_.push_back(sp);
151 }
152 // Sets the CNAME of all StreamParams if it have not been set.
153 void SetCnameIfEmpty(const std::string& cname) {
154 for (cricket::StreamParamsVec::iterator it = streams_.begin();
155 it != streams_.end(); ++it) {
156 if (it->cname.empty())
157 it->cname = cname;
158 }
159 }
160 uint32_t first_ssrc() const {
161 if (streams_.empty()) {
162 return 0;
163 }
164 return streams_[0].first_ssrc();
165 }
166 bool has_ssrcs() const {
167 if (streams_.empty()) {
168 return false;
169 }
170 return streams_[0].has_ssrcs();
171 }
172
173 void set_conference_mode(bool enable) { conference_mode_ = enable; }
174 bool conference_mode() const { return conference_mode_; }
175
176 // https://tools.ietf.org/html/rfc4566#section-5.7
177 // May be present at the media or session level of SDP. If present at both
178 // levels, the media-level attribute overwrites the session-level one.
179 void set_connection_address(const rtc::SocketAddress& address) {
180 connection_address_ = address;
181 }
182 const rtc::SocketAddress& connection_address() const {
183 return connection_address_;
184 }
185
Johannes Kron0854eb62018-10-10 22:33:20 +0200186 // Determines if it's allowed to mix one- and two-byte rtp header extensions
187 // within the same rtp stream.
Johannes Kron9ac3c912018-10-12 10:54:26 +0200188 enum ExtmapAllowMixedHeaders { kNo, kSession, kMedia };
189 void set_extmap_allow_mixed_headers(
190 ExtmapAllowMixedHeaders new_extmap_allow_mixed) {
191 if (new_extmap_allow_mixed == kMedia &&
192 extmap_allow_mixed_headers_ == kSession) {
Johannes Kron0854eb62018-10-10 22:33:20 +0200193 // Do not downgrade from session level to media level.
194 return;
195 }
Johannes Kron9ac3c912018-10-12 10:54:26 +0200196 extmap_allow_mixed_headers_ = new_extmap_allow_mixed;
Johannes Kron0854eb62018-10-10 22:33:20 +0200197 }
Johannes Kron9ac3c912018-10-12 10:54:26 +0200198 ExtmapAllowMixedHeaders extmap_allow_mixed_headers() const {
199 return extmap_allow_mixed_headers_;
200 }
201 bool mixed_one_two_byte_header_extensions_supported() const {
202 return extmap_allow_mixed_headers_ != kNo;
Johannes Kron0854eb62018-10-10 22:33:20 +0200203 }
204
Steve Antonafd8e8c2017-12-19 16:35:35 -0800205 protected:
206 bool rtcp_mux_ = false;
207 bool rtcp_reduced_size_ = false;
208 int bandwidth_ = kAutoBandwidth;
209 std::string protocol_;
210 std::vector<CryptoParams> cryptos_;
211 std::vector<webrtc::RtpExtension> rtp_header_extensions_;
212 bool rtp_header_extensions_set_ = false;
213 StreamParamsVec streams_;
214 bool conference_mode_ = false;
215 webrtc::RtpTransceiverDirection direction_ =
216 webrtc::RtpTransceiverDirection::kSendRecv;
217 rtc::SocketAddress connection_address_;
Johannes Kron0854eb62018-10-10 22:33:20 +0200218 // Mixed one- and two-byte header not included in offer on media level or
219 // session level, but we will respond that we support it. The plan is to add
220 // it to our offer on session level. See todo in SessionDescription.
Johannes Kron9ac3c912018-10-12 10:54:26 +0200221 ExtmapAllowMixedHeaders extmap_allow_mixed_headers_ = kNo;
Steve Antonafd8e8c2017-12-19 16:35:35 -0800222};
223
Steve Anton5adfafd2017-12-20 16:34:00 -0800224// TODO(bugs.webrtc.org/8620): Remove this alias once downstream projects have
225// updated.
226using ContentDescription = MediaContentDescription;
227
Steve Antonafd8e8c2017-12-19 16:35:35 -0800228template <class C>
229class MediaContentDescriptionImpl : public MediaContentDescription {
230 public:
231 typedef C CodecType;
232
233 // Codecs should be in preference order (most preferred codec first).
234 const std::vector<C>& codecs() const { return codecs_; }
235 void set_codecs(const std::vector<C>& codecs) { codecs_ = codecs; }
236 virtual bool has_codecs() const { return !codecs_.empty(); }
237 bool HasCodec(int id) {
238 bool found = false;
239 for (typename std::vector<C>::iterator iter = codecs_.begin();
240 iter != codecs_.end(); ++iter) {
241 if (iter->id == id) {
242 found = true;
243 break;
244 }
245 }
246 return found;
247 }
248 void AddCodec(const C& codec) { codecs_.push_back(codec); }
249 void AddOrReplaceCodec(const C& codec) {
250 for (typename std::vector<C>::iterator iter = codecs_.begin();
251 iter != codecs_.end(); ++iter) {
252 if (iter->id == codec.id) {
253 *iter = codec;
254 return;
255 }
256 }
257 AddCodec(codec);
258 }
259 void AddCodecs(const std::vector<C>& codecs) {
260 typename std::vector<C>::const_iterator codec;
261 for (codec = codecs.begin(); codec != codecs.end(); ++codec) {
262 AddCodec(*codec);
263 }
264 }
265
266 private:
267 std::vector<C> codecs_;
268};
269
270class AudioContentDescription : public MediaContentDescriptionImpl<AudioCodec> {
271 public:
272 AudioContentDescription() {}
273
Steve Antonb1c1de12017-12-21 15:14:30 -0800274 virtual AudioContentDescription* Copy() const {
Steve Antonafd8e8c2017-12-19 16:35:35 -0800275 return new AudioContentDescription(*this);
276 }
277 virtual MediaType type() const { return MEDIA_TYPE_AUDIO; }
Steve Anton5adfafd2017-12-20 16:34:00 -0800278 virtual AudioContentDescription* as_audio() { return this; }
279 virtual const AudioContentDescription* as_audio() const { return this; }
Steve Antonafd8e8c2017-12-19 16:35:35 -0800280};
281
282class VideoContentDescription : public MediaContentDescriptionImpl<VideoCodec> {
283 public:
Steve Antonb1c1de12017-12-21 15:14:30 -0800284 virtual VideoContentDescription* Copy() const {
Steve Antonafd8e8c2017-12-19 16:35:35 -0800285 return new VideoContentDescription(*this);
286 }
287 virtual MediaType type() const { return MEDIA_TYPE_VIDEO; }
Steve Anton5adfafd2017-12-20 16:34:00 -0800288 virtual VideoContentDescription* as_video() { return this; }
289 virtual const VideoContentDescription* as_video() const { return this; }
Steve Antonafd8e8c2017-12-19 16:35:35 -0800290};
291
292class DataContentDescription : public MediaContentDescriptionImpl<DataCodec> {
293 public:
294 DataContentDescription() {}
295
Steve Antonb1c1de12017-12-21 15:14:30 -0800296 virtual DataContentDescription* Copy() const {
Steve Antonafd8e8c2017-12-19 16:35:35 -0800297 return new DataContentDescription(*this);
298 }
299 virtual MediaType type() const { return MEDIA_TYPE_DATA; }
Steve Anton5adfafd2017-12-20 16:34:00 -0800300 virtual DataContentDescription* as_data() { return this; }
301 virtual const DataContentDescription* as_data() const { return this; }
Steve Antonafd8e8c2017-12-19 16:35:35 -0800302
303 bool use_sctpmap() const { return use_sctpmap_; }
304 void set_use_sctpmap(bool enable) { use_sctpmap_ = enable; }
305
306 private:
307 bool use_sctpmap_ = true;
308};
309
Steve Anton5adfafd2017-12-20 16:34:00 -0800310// Protocol used for encoding media. This is the "top level" protocol that may
311// be wrapped by zero or many transport protocols (UDP, ICE, etc.).
312enum class MediaProtocolType {
313 kRtp, // Section will use the RTP protocol (e.g., for audio or video).
314 // https://tools.ietf.org/html/rfc3550
315 kSctp // Section will use the SCTP protocol (e.g., for a data channel).
316 // https://tools.ietf.org/html/rfc4960
317};
318
319// TODO(bugs.webrtc.org/8620): Remove once downstream projects have updated.
320constexpr MediaProtocolType NS_JINGLE_RTP = MediaProtocolType::kRtp;
321constexpr MediaProtocolType NS_JINGLE_DRAFT_SCTP = MediaProtocolType::kSctp;
322
323// Represents a session description section. Most information about the section
324// is stored in the description, which is a subclass of MediaContentDescription.
Steve Anton4ab68ee2017-12-19 14:26:11 -0800325struct ContentInfo {
Steve Antonb1c1de12017-12-21 15:14:30 -0800326 friend class SessionDescription;
327
Steve Anton5adfafd2017-12-20 16:34:00 -0800328 explicit ContentInfo(MediaProtocolType type) : type(type) {}
329
330 // Alias for |name|.
331 std::string mid() const { return name; }
332 void set_mid(const std::string& mid) { this->name = mid; }
333
334 // Alias for |description|.
335 MediaContentDescription* media_description() { return description; }
336 const MediaContentDescription* media_description() const {
337 return description;
338 }
Steve Anton81712112018-01-05 11:27:54 -0800339 void set_media_description(MediaContentDescription* desc) {
340 description = desc;
Steve Anton5adfafd2017-12-20 16:34:00 -0800341 }
342
Steve Anton81712112018-01-05 11:27:54 -0800343 // TODO(bugs.webrtc.org/8620): Rename this to mid.
Steve Anton4ab68ee2017-12-19 14:26:11 -0800344 std::string name;
Steve Anton5adfafd2017-12-20 16:34:00 -0800345 MediaProtocolType type;
Steve Anton4ab68ee2017-12-19 14:26:11 -0800346 bool rejected = false;
347 bool bundle_only = false;
Steve Anton81712112018-01-05 11:27:54 -0800348 // TODO(bugs.webrtc.org/8620): Switch to the getter and setter, and make this
349 // private.
Steve Antonb1c1de12017-12-21 15:14:30 -0800350 MediaContentDescription* description = nullptr;
Steve Anton4ab68ee2017-12-19 14:26:11 -0800351};
352
353typedef std::vector<std::string> ContentNames;
354
355// This class provides a mechanism to aggregate different media contents into a
356// group. This group can also be shared with the peers in a pre-defined format.
357// GroupInfo should be populated only with the |content_name| of the
358// MediaDescription.
359class ContentGroup {
360 public:
361 explicit ContentGroup(const std::string& semantics);
362 ContentGroup(const ContentGroup&);
363 ContentGroup(ContentGroup&&);
364 ContentGroup& operator=(const ContentGroup&);
365 ContentGroup& operator=(ContentGroup&&);
366 ~ContentGroup();
367
368 const std::string& semantics() const { return semantics_; }
369 const ContentNames& content_names() const { return content_names_; }
370
371 const std::string* FirstContentName() const;
372 bool HasContentName(const std::string& content_name) const;
373 void AddContentName(const std::string& content_name);
374 bool RemoveContentName(const std::string& content_name);
375
376 private:
377 std::string semantics_;
378 ContentNames content_names_;
379};
380
381typedef std::vector<ContentInfo> ContentInfos;
382typedef std::vector<ContentGroup> ContentGroups;
383
384const ContentInfo* FindContentInfoByName(const ContentInfos& contents,
385 const std::string& name);
386const ContentInfo* FindContentInfoByType(const ContentInfos& contents,
387 const std::string& type);
388
Steve Antone831b8c2018-02-01 12:22:16 -0800389// Determines how the MSID will be signaled in the SDP. These can be used as
390// flags to indicate both or none.
391enum MsidSignaling {
392 // Signal MSID with one a=msid line in the media section.
393 kMsidSignalingMediaSection = 0x1,
394 // Signal MSID with a=ssrc: msid lines in the media section.
395 kMsidSignalingSsrcAttribute = 0x2
396};
397
Steve Anton4ab68ee2017-12-19 14:26:11 -0800398// Describes a collection of contents, each with its own name and
399// type. Analogous to a <jingle> or <session> stanza. Assumes that
400// contents are unique be name, but doesn't enforce that.
401class SessionDescription {
402 public:
403 SessionDescription();
Steve Anton4ab68ee2017-12-19 14:26:11 -0800404 ~SessionDescription();
405
406 SessionDescription* Copy() const;
407
408 // Content accessors.
409 const ContentInfos& contents() const { return contents_; }
410 ContentInfos& contents() { return contents_; }
411 const ContentInfo* GetContentByName(const std::string& name) const;
412 ContentInfo* GetContentByName(const std::string& name);
Steve Antonb1c1de12017-12-21 15:14:30 -0800413 const MediaContentDescription* GetContentDescriptionByName(
Steve Anton4ab68ee2017-12-19 14:26:11 -0800414 const std::string& name) const;
Steve Antonb1c1de12017-12-21 15:14:30 -0800415 MediaContentDescription* GetContentDescriptionByName(const std::string& name);
Steve Anton5adfafd2017-12-20 16:34:00 -0800416 const ContentInfo* FirstContentByType(MediaProtocolType type) const;
Steve Anton4ab68ee2017-12-19 14:26:11 -0800417 const ContentInfo* FirstContent() const;
418
419 // Content mutators.
420 // Adds a content to this description. Takes ownership of ContentDescription*.
421 void AddContent(const std::string& name,
Steve Anton5adfafd2017-12-20 16:34:00 -0800422 MediaProtocolType type,
Steve Antonb1c1de12017-12-21 15:14:30 -0800423 MediaContentDescription* description);
Steve Anton4ab68ee2017-12-19 14:26:11 -0800424 void AddContent(const std::string& name,
Steve Anton5adfafd2017-12-20 16:34:00 -0800425 MediaProtocolType type,
Steve Anton4ab68ee2017-12-19 14:26:11 -0800426 bool rejected,
Steve Antonb1c1de12017-12-21 15:14:30 -0800427 MediaContentDescription* description);
Steve Anton4ab68ee2017-12-19 14:26:11 -0800428 void AddContent(const std::string& name,
Steve Anton5adfafd2017-12-20 16:34:00 -0800429 MediaProtocolType type,
Steve Anton4ab68ee2017-12-19 14:26:11 -0800430 bool rejected,
431 bool bundle_only,
Steve Antonb1c1de12017-12-21 15:14:30 -0800432 MediaContentDescription* description);
Johannes Kron9ac3c912018-10-12 10:54:26 +0200433 void AddContent(ContentInfo* content);
434
Steve Anton4ab68ee2017-12-19 14:26:11 -0800435 bool RemoveContentByName(const std::string& name);
436
437 // Transport accessors.
438 const TransportInfos& transport_infos() const { return transport_infos_; }
439 TransportInfos& transport_infos() { return transport_infos_; }
440 const TransportInfo* GetTransportInfoByName(const std::string& name) const;
441 TransportInfo* GetTransportInfoByName(const std::string& name);
442 const TransportDescription* GetTransportDescriptionByName(
443 const std::string& name) const {
444 const TransportInfo* tinfo = GetTransportInfoByName(name);
445 return tinfo ? &tinfo->description : NULL;
446 }
447
448 // Transport mutators.
449 void set_transport_infos(const TransportInfos& transport_infos) {
450 transport_infos_ = transport_infos;
451 }
452 // Adds a TransportInfo to this description.
453 // Returns false if a TransportInfo with the same name already exists.
454 bool AddTransportInfo(const TransportInfo& transport_info);
455 bool RemoveTransportInfoByName(const std::string& name);
456
457 // Group accessors.
458 const ContentGroups& groups() const { return content_groups_; }
459 const ContentGroup* GetGroupByName(const std::string& name) const;
460 bool HasGroup(const std::string& name) const;
461
462 // Group mutators.
463 void AddGroup(const ContentGroup& group) { content_groups_.push_back(group); }
464 // Remove the first group with the same semantics specified by |name|.
465 void RemoveGroupByName(const std::string& name);
466
467 // Global attributes.
468 void set_msid_supported(bool supported) { msid_supported_ = supported; }
469 bool msid_supported() const { return msid_supported_; }
470
Steve Antone831b8c2018-02-01 12:22:16 -0800471 // Determines how the MSIDs were/will be signaled. Flag value composed of
472 // MsidSignaling bits (see enum above).
473 void set_msid_signaling(int msid_signaling) {
474 msid_signaling_ = msid_signaling;
475 }
476 int msid_signaling() const { return msid_signaling_; }
477
Johannes Kron0854eb62018-10-10 22:33:20 +0200478 // Determines if it's allowed to mix one- and two-byte rtp header extensions
479 // within the same rtp stream.
Johannes Kron9ac3c912018-10-12 10:54:26 +0200480 void set_extmap_allow_mixed_headers(bool supported) {
481 extmap_allow_mixed_headers_ = supported;
482 MediaContentDescription::ExtmapAllowMixedHeaders media_level_setting =
Johannes Kron0854eb62018-10-10 22:33:20 +0200483 supported ? MediaContentDescription::kSession
484 : MediaContentDescription::kNo;
485 for (auto& content : contents_) {
Johannes Kron9ac3c912018-10-12 10:54:26 +0200486 // Do not set to kNo if the current setting is kMedia.
487 if (supported ||
488 content.media_description()->extmap_allow_mixed_headers() !=
489 MediaContentDescription::kMedia) {
490 content.media_description()->set_extmap_allow_mixed_headers(
491 media_level_setting);
492 }
Johannes Kron0854eb62018-10-10 22:33:20 +0200493 }
494 }
Johannes Kron9ac3c912018-10-12 10:54:26 +0200495 bool extmap_allow_mixed_headers() const {
496 return extmap_allow_mixed_headers_;
Johannes Kron0854eb62018-10-10 22:33:20 +0200497 }
498
Steve Anton4ab68ee2017-12-19 14:26:11 -0800499 private:
500 SessionDescription(const SessionDescription&);
501
502 ContentInfos contents_;
503 TransportInfos transport_infos_;
504 ContentGroups content_groups_;
505 bool msid_supported_ = true;
Steve Antone831b8c2018-02-01 12:22:16 -0800506 // Default to what Plan B would do.
507 // TODO(bugs.webrtc.org/8530): Change default to kMsidSignalingMediaSection.
508 int msid_signaling_ = kMsidSignalingSsrcAttribute;
Johannes Kron0854eb62018-10-10 22:33:20 +0200509 // TODO(kron): Activate mixed one- and two-byte header extension in offer at
510 // session level. It's currently not included in offer by default because
511 // clients prior to https://bugs.webrtc.org/9712 cannot parse this correctly.
512 // If it's included in offer to us we will respond that we support it.
Johannes Kron9ac3c912018-10-12 10:54:26 +0200513 bool extmap_allow_mixed_headers_ = false;
Steve Anton4ab68ee2017-12-19 14:26:11 -0800514};
515
Steve Antonb1c1de12017-12-21 15:14:30 -0800516// Indicates whether a session description was sent by the local client or
517// received from the remote client.
Steve Anton4ab68ee2017-12-19 14:26:11 -0800518enum ContentSource { CS_LOCAL, CS_REMOTE };
519
520} // namespace cricket
521
522#endif // PC_SESSIONDESCRIPTION_H_