blob: 33c8c17d37190816327bddf8790d9b6975f51f9b [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
kjellander65c7f672016-02-12 00:05:01 -08002 * Copyright 2004 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00003 *
kjellander65c7f672016-02-12 00:05:01 -08004 * 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.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00009 */
10
11// Types and classes used in media session descriptions.
12
Steve Anton10542f22019-01-11 09:11:00 -080013#ifndef PC_MEDIA_SESSION_H_
14#define PC_MEDIA_SESSION_H_
henrike@webrtc.org28e20752013-07-10 00:45:36 +000015
deadbeef0ed85b22016-02-23 17:24:52 -080016#include <map>
Steve Anton1a9d3c32018-12-10 17:18:54 -080017#include <memory>
henrike@webrtc.org28e20752013-07-10 00:45:36 +000018#include <string>
19#include <vector>
henrike@webrtc.org28e20752013-07-10 00:45:36 +000020
Steve Anton10542f22019-01-11 09:11:00 -080021#include "api/media_types.h"
22#include "media/base/media_constants.h"
23#include "media/base/media_engine.h" // For DataChannelType
24#include "p2p/base/ice_credentials_iterator.h"
25#include "p2p/base/transport_description_factory.h"
26#include "pc/jsep_transport.h"
27#include "pc/session_description.h"
Amit Hilbuchbcd39d42019-01-25 17:13:56 -080028#include "rtc_base/unique_id_generator.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000029
30namespace cricket {
31
32class ChannelManager;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000033
zhihuang8f65cdf2016-05-06 18:40:30 -070034// Default RTCP CNAME for unit tests.
35const char kDefaultRtcpCname[] = "DefaultRtcpCname";
36
zhihuang1c378ed2017-08-17 14:10:50 -070037// Options for an RtpSender contained with an media description/"m=" section.
Amit Hilbuchc63ddb22019-01-02 10:13:58 -080038// Note: Spec-compliant Simulcast and legacy simulcast are mutually exclusive.
zhihuang1c378ed2017-08-17 14:10:50 -070039struct SenderOptions {
40 std::string track_id;
Steve Anton8ffb9c32017-08-31 15:45:38 -070041 std::vector<std::string> stream_ids;
Amit Hilbuchc63ddb22019-01-02 10:13:58 -080042 // Use RIDs and Simulcast Layers to indicate spec-compliant Simulcast.
43 std::vector<RidDescription> rids;
44 SimulcastLayerList simulcast_layers;
45 // Use |num_sim_layers| to indicate legacy simulcast.
zhihuang1c378ed2017-08-17 14:10:50 -070046 int num_sim_layers;
47};
jiayl@webrtc.org742922b2014-10-07 21:32:43 +000048
zhihuang1c378ed2017-08-17 14:10:50 -070049// Options for an individual media description/"m=" section.
50struct MediaDescriptionOptions {
51 MediaDescriptionOptions(MediaType type,
52 const std::string& mid,
Steve Anton1d03a752017-11-27 14:30:09 -080053 webrtc::RtpTransceiverDirection direction,
zhihuang1c378ed2017-08-17 14:10:50 -070054 bool stopped)
55 : type(type), mid(mid), direction(direction), stopped(stopped) {}
zhihuanga77e6bb2017-08-14 18:17:48 -070056
zhihuang1c378ed2017-08-17 14:10:50 -070057 // TODO(deadbeef): When we don't support Plan B, there will only be one
58 // sender per media description and this can be simplified.
59 void AddAudioSender(const std::string& track_id,
Steve Anton8ffb9c32017-08-31 15:45:38 -070060 const std::vector<std::string>& stream_ids);
zhihuang1c378ed2017-08-17 14:10:50 -070061 void AddVideoSender(const std::string& track_id,
Steve Anton8ffb9c32017-08-31 15:45:38 -070062 const std::vector<std::string>& stream_ids,
Amit Hilbuchc63ddb22019-01-02 10:13:58 -080063 const std::vector<RidDescription>& rids,
64 const SimulcastLayerList& simulcast_layers,
olka3c747662017-08-17 06:50:32 -070065 int num_sim_layers);
zhihuanga77e6bb2017-08-14 18:17:48 -070066
zhihuang1c378ed2017-08-17 14:10:50 -070067 // Internally just uses sender_options.
68 void AddRtpDataChannel(const std::string& track_id,
69 const std::string& stream_id);
olka3c747662017-08-17 06:50:32 -070070
zhihuang1c378ed2017-08-17 14:10:50 -070071 MediaType type;
72 std::string mid;
Steve Anton1d03a752017-11-27 14:30:09 -080073 webrtc::RtpTransceiverDirection direction;
zhihuang1c378ed2017-08-17 14:10:50 -070074 bool stopped;
75 TransportOptions transport_options;
76 // Note: There's no equivalent "RtpReceiverOptions" because only send
77 // stream information goes in the local descriptions.
78 std::vector<SenderOptions> sender_options;
79
80 private:
81 // Doesn't DCHECK on |type|.
82 void AddSenderInternal(const std::string& track_id,
Steve Anton8ffb9c32017-08-31 15:45:38 -070083 const std::vector<std::string>& stream_ids,
Amit Hilbuchc63ddb22019-01-02 10:13:58 -080084 const std::vector<RidDescription>& rids,
85 const SimulcastLayerList& simulcast_layers,
olka3c747662017-08-17 06:50:32 -070086 int num_sim_layers);
zhihuang1c378ed2017-08-17 14:10:50 -070087};
olka3c747662017-08-17 06:50:32 -070088
zhihuang1c378ed2017-08-17 14:10:50 -070089// Provides a mechanism for describing how m= sections should be generated.
90// The m= section with index X will use media_description_options[X]. There
91// must be an option for each existing section if creating an answer, or a
92// subsequent offer.
93struct MediaSessionOptions {
94 MediaSessionOptions() {}
olka3c747662017-08-17 06:50:32 -070095
zhihuang1c378ed2017-08-17 14:10:50 -070096 bool has_audio() const { return HasMediaDescription(MEDIA_TYPE_AUDIO); }
97 bool has_video() const { return HasMediaDescription(MEDIA_TYPE_VIDEO); }
98 bool has_data() const { return HasMediaDescription(MEDIA_TYPE_DATA); }
99
100 bool HasMediaDescription(MediaType type) const;
101
102 DataChannelType data_channel_type = DCT_NONE;
zhihuang1c378ed2017-08-17 14:10:50 -0700103 bool vad_enabled = true; // When disabled, removes all CN codecs from SDP.
104 bool rtcp_mux_enabled = true;
105 bool bundle_enabled = false;
Johannes Kron89f874e2018-11-12 10:25:48 +0100106 bool offer_extmap_allow_mixed = false;
zhihuang1c378ed2017-08-17 14:10:50 -0700107 std::string rtcp_cname = kDefaultRtcpCname;
Benjamin Wrighta54daf12018-10-11 15:33:17 -0700108 webrtc::CryptoOptions crypto_options;
zhihuang1c378ed2017-08-17 14:10:50 -0700109 // List of media description options in the same order that the media
110 // descriptions will be generated.
111 std::vector<MediaDescriptionOptions> media_description_options;
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200112 std::vector<IceParameters> pooled_ice_credentials;
Piotr (Peter) Slatalab1ae10b2019-03-01 11:14:05 -0800113
114 // An optional media transport settings.
115 // In the future we may consider using a vector here, to indicate multiple
116 // supported transports.
117 absl::optional<cricket::SessionDescription::MediaTransportSetting>
118 media_transport_settings;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000119};
120
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000121// Creates media session descriptions according to the supplied codecs and
122// other fields, as well as the supplied per-call options.
123// When creating answers, performs the appropriate negotiation
124// of the various fields to determine the proper result.
125class MediaSessionDescriptionFactory {
126 public:
Amit Hilbuchbcd39d42019-01-25 17:13:56 -0800127 // Simple constructor that does not set any configuration for the factory.
128 // When using this constructor, the methods below can be used to set the
129 // configuration.
130 // The TransportDescriptionFactory and the UniqueRandomIdGenerator are not
131 // owned by MediaSessionDescriptionFactory, so they must be kept alive by the
132 // user of this class.
133 MediaSessionDescriptionFactory(const TransportDescriptionFactory* factory,
134 rtc::UniqueRandomIdGenerator* ssrc_generator);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000135 // This helper automatically sets up the factory to get its configuration
136 // from the specified ChannelManager.
137 MediaSessionDescriptionFactory(ChannelManager* cmanager,
Amit Hilbuchbcd39d42019-01-25 17:13:56 -0800138 const TransportDescriptionFactory* factory,
139 rtc::UniqueRandomIdGenerator* ssrc_generator);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000140
ossudedfd282016-06-14 07:12:39 -0700141 const AudioCodecs& audio_sendrecv_codecs() const;
ossu075af922016-06-14 03:29:38 -0700142 const AudioCodecs& audio_send_codecs() const;
143 const AudioCodecs& audio_recv_codecs() const;
144 void set_audio_codecs(const AudioCodecs& send_codecs,
145 const AudioCodecs& recv_codecs);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000146 void set_audio_rtp_header_extensions(const RtpHeaderExtensions& extensions) {
147 audio_rtp_extensions_ = extensions;
148 }
Amit Hilbuch77938e62018-12-21 09:23:38 -0800149 RtpHeaderExtensions audio_rtp_header_extensions() const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000150 const VideoCodecs& video_codecs() const { return video_codecs_; }
151 void set_video_codecs(const VideoCodecs& codecs) { video_codecs_ = codecs; }
152 void set_video_rtp_header_extensions(const RtpHeaderExtensions& extensions) {
153 video_rtp_extensions_ = extensions;
154 }
Amit Hilbuch77938e62018-12-21 09:23:38 -0800155 RtpHeaderExtensions video_rtp_header_extensions() const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000156 const DataCodecs& data_codecs() const { return data_codecs_; }
157 void set_data_codecs(const DataCodecs& codecs) { data_codecs_ = codecs; }
158 SecurePolicy secure() const { return secure_; }
159 void set_secure(SecurePolicy s) { secure_ = s; }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000160
jbauch5869f502017-06-29 12:31:36 -0700161 void set_enable_encrypted_rtp_header_extensions(bool enable) {
162 enable_encrypted_rtp_header_extensions_ = enable;
163 }
164
Steve Anton8f66ddb2018-12-10 16:08:05 -0800165 void set_is_unified_plan(bool is_unified_plan) {
166 is_unified_plan_ = is_unified_plan;
167 }
168
Steve Anton6fe1fba2018-12-11 10:15:23 -0800169 std::unique_ptr<SessionDescription> CreateOffer(
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000170 const MediaSessionOptions& options,
171 const SessionDescription* current_description) const;
Steve Anton6fe1fba2018-12-11 10:15:23 -0800172 std::unique_ptr<SessionDescription> CreateAnswer(
zstein4b2e0822017-02-17 19:48:38 -0800173 const SessionDescription* offer,
174 const MediaSessionOptions& options,
175 const SessionDescription* current_description) const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000176
177 private:
ossu075af922016-06-14 03:29:38 -0700178 const AudioCodecs& GetAudioCodecsForOffer(
Steve Anton1d03a752017-11-27 14:30:09 -0800179 const webrtc::RtpTransceiverDirection& direction) const;
ossu075af922016-06-14 03:29:38 -0700180 const AudioCodecs& GetAudioCodecsForAnswer(
Steve Anton1d03a752017-11-27 14:30:09 -0800181 const webrtc::RtpTransceiverDirection& offer,
182 const webrtc::RtpTransceiverDirection& answer) const;
Steve Anton5c72e712018-12-10 14:25:30 -0800183 void GetCodecsForOffer(
184 const std::vector<const ContentInfo*>& current_active_contents,
185 AudioCodecs* audio_codecs,
186 VideoCodecs* video_codecs,
187 DataCodecs* data_codecs) const;
188 void GetCodecsForAnswer(
189 const std::vector<const ContentInfo*>& current_active_contents,
190 const SessionDescription& remote_offer,
191 AudioCodecs* audio_codecs,
192 VideoCodecs* video_codecs,
193 DataCodecs* data_codecs) const;
194 void GetRtpHdrExtsToOffer(
195 const std::vector<const ContentInfo*>& current_active_contents,
Steve Anton5c72e712018-12-10 14:25:30 -0800196 RtpHeaderExtensions* audio_extensions,
197 RtpHeaderExtensions* video_extensions) const;
Yves Gerey665174f2018-06-19 15:03:05 +0200198 bool AddTransportOffer(const std::string& content_name,
199 const TransportOptions& transport_options,
200 const SessionDescription* current_desc,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200201 SessionDescription* offer,
202 IceCredentialsIterator* ice_credentials) const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000203
Steve Anton1a9d3c32018-12-10 17:18:54 -0800204 std::unique_ptr<TransportDescription> CreateTransportAnswer(
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000205 const std::string& content_name,
206 const SessionDescription* offer_desc,
207 const TransportOptions& transport_options,
deadbeefb7892532017-02-22 19:35:18 -0800208 const SessionDescription* current_desc,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200209 bool require_transport_attributes,
210 IceCredentialsIterator* ice_credentials) const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000211
Yves Gerey665174f2018-06-19 15:03:05 +0200212 bool AddTransportAnswer(const std::string& content_name,
213 const TransportDescription& transport_desc,
214 SessionDescription* answer_desc) const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000215
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000216 // Helpers for adding media contents to the SessionDescription. Returns true
217 // it succeeds or the media content is not needed, or false if there is any
218 // error.
219
220 bool AddAudioContentForOffer(
zhihuang1c378ed2017-08-17 14:10:50 -0700221 const MediaDescriptionOptions& media_description_options,
222 const MediaSessionOptions& session_options,
223 const ContentInfo* current_content,
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000224 const SessionDescription* current_description,
225 const RtpHeaderExtensions& audio_rtp_extensions,
226 const AudioCodecs& audio_codecs,
227 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200228 SessionDescription* desc,
229 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000230
231 bool AddVideoContentForOffer(
zhihuang1c378ed2017-08-17 14:10:50 -0700232 const MediaDescriptionOptions& media_description_options,
233 const MediaSessionOptions& session_options,
234 const ContentInfo* current_content,
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000235 const SessionDescription* current_description,
236 const RtpHeaderExtensions& video_rtp_extensions,
237 const VideoCodecs& video_codecs,
238 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200239 SessionDescription* desc,
240 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000241
242 bool AddDataContentForOffer(
zhihuang1c378ed2017-08-17 14:10:50 -0700243 const MediaDescriptionOptions& media_description_options,
244 const MediaSessionOptions& session_options,
245 const ContentInfo* current_content,
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000246 const SessionDescription* current_description,
zhihuang1c378ed2017-08-17 14:10:50 -0700247 const DataCodecs& data_codecs,
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000248 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200249 SessionDescription* desc,
250 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000251
zhihuang1c378ed2017-08-17 14:10:50 -0700252 bool AddAudioContentForAnswer(
253 const MediaDescriptionOptions& media_description_options,
254 const MediaSessionOptions& session_options,
255 const ContentInfo* offer_content,
256 const SessionDescription* offer_description,
257 const ContentInfo* current_content,
258 const SessionDescription* current_description,
259 const TransportInfo* bundle_transport,
260 const AudioCodecs& audio_codecs,
261 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200262 SessionDescription* answer,
263 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000264
zhihuang1c378ed2017-08-17 14:10:50 -0700265 bool AddVideoContentForAnswer(
266 const MediaDescriptionOptions& media_description_options,
267 const MediaSessionOptions& session_options,
268 const ContentInfo* offer_content,
269 const SessionDescription* offer_description,
270 const ContentInfo* current_content,
271 const SessionDescription* current_description,
272 const TransportInfo* bundle_transport,
273 const VideoCodecs& video_codecs,
274 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200275 SessionDescription* answer,
276 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000277
zhihuang1c378ed2017-08-17 14:10:50 -0700278 bool AddDataContentForAnswer(
279 const MediaDescriptionOptions& media_description_options,
280 const MediaSessionOptions& session_options,
281 const ContentInfo* offer_content,
282 const SessionDescription* offer_description,
283 const ContentInfo* current_content,
284 const SessionDescription* current_description,
285 const TransportInfo* bundle_transport,
286 const DataCodecs& data_codecs,
287 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200288 SessionDescription* answer,
289 IceCredentialsIterator* ice_credentials) const;
zhihuang1c378ed2017-08-17 14:10:50 -0700290
291 void ComputeAudioCodecsIntersectionAndUnion();
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000292
Steve Anton8f66ddb2018-12-10 16:08:05 -0800293 bool is_unified_plan_ = false;
ossu075af922016-06-14 03:29:38 -0700294 AudioCodecs audio_send_codecs_;
295 AudioCodecs audio_recv_codecs_;
zhihuang1c378ed2017-08-17 14:10:50 -0700296 // Intersection of send and recv.
ossu075af922016-06-14 03:29:38 -0700297 AudioCodecs audio_sendrecv_codecs_;
zhihuang1c378ed2017-08-17 14:10:50 -0700298 // Union of send and recv.
299 AudioCodecs all_audio_codecs_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000300 RtpHeaderExtensions audio_rtp_extensions_;
301 VideoCodecs video_codecs_;
302 RtpHeaderExtensions video_rtp_extensions_;
303 DataCodecs data_codecs_;
Amit Hilbuchbcd39d42019-01-25 17:13:56 -0800304 // This object is not owned by the channel so it must outlive it.
305 rtc::UniqueRandomIdGenerator* const ssrc_generator_;
jbauch5869f502017-06-29 12:31:36 -0700306 bool enable_encrypted_rtp_header_extensions_ = false;
zhihuang1c378ed2017-08-17 14:10:50 -0700307 // TODO(zhihuang): Rename secure_ to sdec_policy_; rename the related getter
308 // and setter.
309 SecurePolicy secure_ = SEC_DISABLED;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000310 const TransportDescriptionFactory* transport_desc_factory_;
311};
312
313// Convenience functions.
314bool IsMediaContent(const ContentInfo* content);
315bool IsAudioContent(const ContentInfo* content);
316bool IsVideoContent(const ContentInfo* content);
317bool IsDataContent(const ContentInfo* content);
deadbeef0ed85b22016-02-23 17:24:52 -0800318const ContentInfo* GetFirstMediaContent(const ContentInfos& contents,
319 MediaType media_type);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000320const ContentInfo* GetFirstAudioContent(const ContentInfos& contents);
321const ContentInfo* GetFirstVideoContent(const ContentInfos& contents);
322const ContentInfo* GetFirstDataContent(const ContentInfos& contents);
Steve Antonad7bffc2018-01-22 10:21:56 -0800323const ContentInfo* GetFirstMediaContent(const SessionDescription* sdesc,
324 MediaType media_type);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000325const ContentInfo* GetFirstAudioContent(const SessionDescription* sdesc);
326const ContentInfo* GetFirstVideoContent(const SessionDescription* sdesc);
327const ContentInfo* GetFirstDataContent(const SessionDescription* sdesc);
328const AudioContentDescription* GetFirstAudioContentDescription(
329 const SessionDescription* sdesc);
330const VideoContentDescription* GetFirstVideoContentDescription(
331 const SessionDescription* sdesc);
332const DataContentDescription* GetFirstDataContentDescription(
333 const SessionDescription* sdesc);
Taylor Brandstetterdc4eb8c2016-05-12 08:14:50 -0700334// Non-const versions of the above functions.
335// Useful when modifying an existing description.
Steve Anton36b29d12017-10-30 09:57:42 -0700336ContentInfo* GetFirstMediaContent(ContentInfos* contents, MediaType media_type);
337ContentInfo* GetFirstAudioContent(ContentInfos* contents);
338ContentInfo* GetFirstVideoContent(ContentInfos* contents);
339ContentInfo* GetFirstDataContent(ContentInfos* contents);
Steve Antonad7bffc2018-01-22 10:21:56 -0800340ContentInfo* GetFirstMediaContent(SessionDescription* sdesc,
341 MediaType media_type);
Taylor Brandstetterdc4eb8c2016-05-12 08:14:50 -0700342ContentInfo* GetFirstAudioContent(SessionDescription* sdesc);
343ContentInfo* GetFirstVideoContent(SessionDescription* sdesc);
344ContentInfo* GetFirstDataContent(SessionDescription* sdesc);
345AudioContentDescription* GetFirstAudioContentDescription(
346 SessionDescription* sdesc);
347VideoContentDescription* GetFirstVideoContentDescription(
348 SessionDescription* sdesc);
349DataContentDescription* GetFirstDataContentDescription(
350 SessionDescription* sdesc);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000351
deadbeef7914b8c2017-04-21 03:23:33 -0700352// Helper functions to return crypto suites used for SDES.
Benjamin Wrighta54daf12018-10-11 15:33:17 -0700353void GetSupportedAudioSdesCryptoSuites(
354 const webrtc::CryptoOptions& crypto_options,
355 std::vector<int>* crypto_suites);
356void GetSupportedVideoSdesCryptoSuites(
357 const webrtc::CryptoOptions& crypto_options,
358 std::vector<int>* crypto_suites);
359void GetSupportedDataSdesCryptoSuites(
360 const webrtc::CryptoOptions& crypto_options,
361 std::vector<int>* crypto_suites);
deadbeef7914b8c2017-04-21 03:23:33 -0700362void GetSupportedAudioSdesCryptoSuiteNames(
Benjamin Wrighta54daf12018-10-11 15:33:17 -0700363 const webrtc::CryptoOptions& crypto_options,
Guo-wei Shieh521ed7b2015-11-18 19:41:53 -0800364 std::vector<std::string>* crypto_suite_names);
deadbeef7914b8c2017-04-21 03:23:33 -0700365void GetSupportedVideoSdesCryptoSuiteNames(
Benjamin Wrighta54daf12018-10-11 15:33:17 -0700366 const webrtc::CryptoOptions& crypto_options,
Guo-wei Shieh521ed7b2015-11-18 19:41:53 -0800367 std::vector<std::string>* crypto_suite_names);
deadbeef7914b8c2017-04-21 03:23:33 -0700368void GetSupportedDataSdesCryptoSuiteNames(
Benjamin Wrighta54daf12018-10-11 15:33:17 -0700369 const webrtc::CryptoOptions& crypto_options,
Guo-wei Shieh521ed7b2015-11-18 19:41:53 -0800370 std::vector<std::string>* crypto_suite_names);
371
Danil Chapovalovc6d1d242019-04-23 09:48:11 +0000372// Returns true if the given media section protocol indicates use of RTP.
373bool IsRtpProtocol(const std::string& protocol);
374
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000375} // namespace cricket
376
Steve Anton10542f22019-01-11 09:11:00 -0800377#endif // PC_MEDIA_SESSION_H_