blob: f732cb24f8bfb722e9a9835f9c473c6d7097a5bf [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#ifndef PC_MEDIASESSION_H_
14#define PC_MEDIASESSION_H_
henrike@webrtc.org28e20752013-07-10 00:45:36 +000015
buildbot@webrtc.orga09a9992014-08-13 17:26:08 +000016#include <algorithm>
deadbeef0ed85b22016-02-23 17:24:52 -080017#include <map>
Steve Anton1a9d3c32018-12-10 17:18:54 -080018#include <memory>
henrike@webrtc.org28e20752013-07-10 00:45:36 +000019#include <string>
20#include <vector>
henrike@webrtc.org28e20752013-07-10 00:45:36 +000021
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020022#include "api/mediatypes.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020023#include "media/base/mediaconstants.h"
24#include "media/base/mediaengine.h" // For DataChannelType
Jonas Oreland1cd39fa2018-10-11 07:47:12 +020025#include "p2p/base/icecredentialsiterator.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020026#include "p2p/base/transportdescriptionfactory.h"
Zhi Huang365381f2018-04-13 16:44:34 -070027#include "pc/jseptransport.h"
Steve Anton4ab68ee2017-12-19 14:26:11 -080028#include "pc/sessiondescription.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;
Amit Hilbuchc63ddb22019-01-02 10:13:58 -080079 // |receive_rids| and |receive_simulcast_layers| are used with spec-compliant
80 // simulcast. When Simulcast is used, they should both not be empty.
81 // All RIDs in |receive_simulcast_layers| must appear in receive_rids as well.
82 // |receive_rids| could also be used outside of simulcast. It is possible to
83 // add restrictions on the incoming stream during negotiation outside the
84 // simulcast scenario. This is currently not fully supported, as meaningful
85 // restrictions are not handled by this library.
86 std::vector<RidDescription> receive_rids;
87 SimulcastLayerList receive_simulcast_layers;
zhihuang1c378ed2017-08-17 14:10:50 -070088
89 private:
90 // Doesn't DCHECK on |type|.
91 void AddSenderInternal(const std::string& track_id,
Steve Anton8ffb9c32017-08-31 15:45:38 -070092 const std::vector<std::string>& stream_ids,
Amit Hilbuchc63ddb22019-01-02 10:13:58 -080093 const std::vector<RidDescription>& rids,
94 const SimulcastLayerList& simulcast_layers,
olka3c747662017-08-17 06:50:32 -070095 int num_sim_layers);
zhihuang1c378ed2017-08-17 14:10:50 -070096};
olka3c747662017-08-17 06:50:32 -070097
zhihuang1c378ed2017-08-17 14:10:50 -070098// Provides a mechanism for describing how m= sections should be generated.
99// The m= section with index X will use media_description_options[X]. There
100// must be an option for each existing section if creating an answer, or a
101// subsequent offer.
102struct MediaSessionOptions {
103 MediaSessionOptions() {}
olka3c747662017-08-17 06:50:32 -0700104
zhihuang1c378ed2017-08-17 14:10:50 -0700105 bool has_audio() const { return HasMediaDescription(MEDIA_TYPE_AUDIO); }
106 bool has_video() const { return HasMediaDescription(MEDIA_TYPE_VIDEO); }
107 bool has_data() const { return HasMediaDescription(MEDIA_TYPE_DATA); }
108
109 bool HasMediaDescription(MediaType type) const;
110
111 DataChannelType data_channel_type = DCT_NONE;
zhihuang1c378ed2017-08-17 14:10:50 -0700112 bool vad_enabled = true; // When disabled, removes all CN codecs from SDP.
113 bool rtcp_mux_enabled = true;
114 bool bundle_enabled = false;
Johannes Kron89f874e2018-11-12 10:25:48 +0100115 bool offer_extmap_allow_mixed = false;
zhihuang1c378ed2017-08-17 14:10:50 -0700116 std::string rtcp_cname = kDefaultRtcpCname;
Benjamin Wrighta54daf12018-10-11 15:33:17 -0700117 webrtc::CryptoOptions crypto_options;
zhihuang1c378ed2017-08-17 14:10:50 -0700118 // List of media description options in the same order that the media
119 // descriptions will be generated.
120 std::vector<MediaDescriptionOptions> media_description_options;
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200121 std::vector<IceParameters> pooled_ice_credentials;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000122};
123
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000124// Creates media session descriptions according to the supplied codecs and
125// other fields, as well as the supplied per-call options.
126// When creating answers, performs the appropriate negotiation
127// of the various fields to determine the proper result.
128class MediaSessionDescriptionFactory {
129 public:
130 // Default ctor; use methods below to set configuration.
131 // The TransportDescriptionFactory is not owned by MediaSessionDescFactory,
132 // so it must be kept alive by the user of this class.
133 explicit MediaSessionDescriptionFactory(
134 const TransportDescriptionFactory* factory);
135 // This helper automatically sets up the factory to get its configuration
136 // from the specified ChannelManager.
137 MediaSessionDescriptionFactory(ChannelManager* cmanager,
138 const TransportDescriptionFactory* factory);
139
ossudedfd282016-06-14 07:12:39 -0700140 const AudioCodecs& audio_sendrecv_codecs() const;
ossu075af922016-06-14 03:29:38 -0700141 const AudioCodecs& audio_send_codecs() const;
142 const AudioCodecs& audio_recv_codecs() const;
143 void set_audio_codecs(const AudioCodecs& send_codecs,
144 const AudioCodecs& recv_codecs);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000145 void set_audio_rtp_header_extensions(const RtpHeaderExtensions& extensions) {
146 audio_rtp_extensions_ = extensions;
147 }
Amit Hilbuch77938e62018-12-21 09:23:38 -0800148 RtpHeaderExtensions audio_rtp_header_extensions() const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000149 const VideoCodecs& video_codecs() const { return video_codecs_; }
150 void set_video_codecs(const VideoCodecs& codecs) { video_codecs_ = codecs; }
151 void set_video_rtp_header_extensions(const RtpHeaderExtensions& extensions) {
152 video_rtp_extensions_ = extensions;
153 }
Amit Hilbuch77938e62018-12-21 09:23:38 -0800154 RtpHeaderExtensions video_rtp_header_extensions() const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000155 const DataCodecs& data_codecs() const { return data_codecs_; }
156 void set_data_codecs(const DataCodecs& codecs) { data_codecs_ = codecs; }
157 SecurePolicy secure() const { return secure_; }
158 void set_secure(SecurePolicy s) { secure_ = s; }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000159
jbauch5869f502017-06-29 12:31:36 -0700160 void set_enable_encrypted_rtp_header_extensions(bool enable) {
161 enable_encrypted_rtp_header_extensions_ = enable;
162 }
163
Steve Anton8f66ddb2018-12-10 16:08:05 -0800164 void set_is_unified_plan(bool is_unified_plan) {
165 is_unified_plan_ = is_unified_plan;
166 }
167
Steve Anton6fe1fba2018-12-11 10:15:23 -0800168 std::unique_ptr<SessionDescription> CreateOffer(
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000169 const MediaSessionOptions& options,
170 const SessionDescription* current_description) const;
Steve Anton6fe1fba2018-12-11 10:15:23 -0800171 std::unique_ptr<SessionDescription> CreateAnswer(
zstein4b2e0822017-02-17 19:48:38 -0800172 const SessionDescription* offer,
173 const MediaSessionOptions& options,
174 const SessionDescription* current_description) const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000175
176 private:
ossu075af922016-06-14 03:29:38 -0700177 const AudioCodecs& GetAudioCodecsForOffer(
Steve Anton1d03a752017-11-27 14:30:09 -0800178 const webrtc::RtpTransceiverDirection& direction) const;
ossu075af922016-06-14 03:29:38 -0700179 const AudioCodecs& GetAudioCodecsForAnswer(
Steve Anton1d03a752017-11-27 14:30:09 -0800180 const webrtc::RtpTransceiverDirection& offer,
181 const webrtc::RtpTransceiverDirection& answer) const;
Steve Anton5c72e712018-12-10 14:25:30 -0800182 void GetCodecsForOffer(
183 const std::vector<const ContentInfo*>& current_active_contents,
184 AudioCodecs* audio_codecs,
185 VideoCodecs* video_codecs,
186 DataCodecs* data_codecs) const;
187 void GetCodecsForAnswer(
188 const std::vector<const ContentInfo*>& current_active_contents,
189 const SessionDescription& remote_offer,
190 AudioCodecs* audio_codecs,
191 VideoCodecs* video_codecs,
192 DataCodecs* data_codecs) const;
193 void GetRtpHdrExtsToOffer(
194 const std::vector<const ContentInfo*>& current_active_contents,
Steve Anton5c72e712018-12-10 14:25:30 -0800195 RtpHeaderExtensions* audio_extensions,
196 RtpHeaderExtensions* video_extensions) const;
Yves Gerey665174f2018-06-19 15:03:05 +0200197 bool AddTransportOffer(const std::string& content_name,
198 const TransportOptions& transport_options,
199 const SessionDescription* current_desc,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200200 SessionDescription* offer,
201 IceCredentialsIterator* ice_credentials) const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000202
Steve Anton1a9d3c32018-12-10 17:18:54 -0800203 std::unique_ptr<TransportDescription> CreateTransportAnswer(
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000204 const std::string& content_name,
205 const SessionDescription* offer_desc,
206 const TransportOptions& transport_options,
deadbeefb7892532017-02-22 19:35:18 -0800207 const SessionDescription* current_desc,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200208 bool require_transport_attributes,
209 IceCredentialsIterator* ice_credentials) const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000210
Yves Gerey665174f2018-06-19 15:03:05 +0200211 bool AddTransportAnswer(const std::string& content_name,
212 const TransportDescription& transport_desc,
213 SessionDescription* answer_desc) const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000214
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000215 // Helpers for adding media contents to the SessionDescription. Returns true
216 // it succeeds or the media content is not needed, or false if there is any
217 // error.
218
219 bool AddAudioContentForOffer(
zhihuang1c378ed2017-08-17 14:10:50 -0700220 const MediaDescriptionOptions& media_description_options,
221 const MediaSessionOptions& session_options,
222 const ContentInfo* current_content,
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000223 const SessionDescription* current_description,
224 const RtpHeaderExtensions& audio_rtp_extensions,
225 const AudioCodecs& audio_codecs,
226 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200227 SessionDescription* desc,
228 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000229
230 bool AddVideoContentForOffer(
zhihuang1c378ed2017-08-17 14:10:50 -0700231 const MediaDescriptionOptions& media_description_options,
232 const MediaSessionOptions& session_options,
233 const ContentInfo* current_content,
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000234 const SessionDescription* current_description,
235 const RtpHeaderExtensions& video_rtp_extensions,
236 const VideoCodecs& video_codecs,
237 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200238 SessionDescription* desc,
239 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000240
241 bool AddDataContentForOffer(
zhihuang1c378ed2017-08-17 14:10:50 -0700242 const MediaDescriptionOptions& media_description_options,
243 const MediaSessionOptions& session_options,
244 const ContentInfo* current_content,
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000245 const SessionDescription* current_description,
zhihuang1c378ed2017-08-17 14:10:50 -0700246 const DataCodecs& data_codecs,
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000247 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200248 SessionDescription* desc,
249 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000250
zhihuang1c378ed2017-08-17 14:10:50 -0700251 bool AddAudioContentForAnswer(
252 const MediaDescriptionOptions& media_description_options,
253 const MediaSessionOptions& session_options,
254 const ContentInfo* offer_content,
255 const SessionDescription* offer_description,
256 const ContentInfo* current_content,
257 const SessionDescription* current_description,
258 const TransportInfo* bundle_transport,
259 const AudioCodecs& audio_codecs,
260 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200261 SessionDescription* answer,
262 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000263
zhihuang1c378ed2017-08-17 14:10:50 -0700264 bool AddVideoContentForAnswer(
265 const MediaDescriptionOptions& media_description_options,
266 const MediaSessionOptions& session_options,
267 const ContentInfo* offer_content,
268 const SessionDescription* offer_description,
269 const ContentInfo* current_content,
270 const SessionDescription* current_description,
271 const TransportInfo* bundle_transport,
272 const VideoCodecs& video_codecs,
273 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200274 SessionDescription* answer,
275 IceCredentialsIterator* ice_credentials) const;
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000276
zhihuang1c378ed2017-08-17 14:10:50 -0700277 bool AddDataContentForAnswer(
278 const MediaDescriptionOptions& media_description_options,
279 const MediaSessionOptions& session_options,
280 const ContentInfo* offer_content,
281 const SessionDescription* offer_description,
282 const ContentInfo* current_content,
283 const SessionDescription* current_description,
284 const TransportInfo* bundle_transport,
285 const DataCodecs& data_codecs,
286 StreamParamsVec* current_streams,
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200287 SessionDescription* answer,
288 IceCredentialsIterator* ice_credentials) const;
zhihuang1c378ed2017-08-17 14:10:50 -0700289
290 void ComputeAudioCodecsIntersectionAndUnion();
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000291
Steve Anton8f66ddb2018-12-10 16:08:05 -0800292 bool is_unified_plan_ = false;
ossu075af922016-06-14 03:29:38 -0700293 AudioCodecs audio_send_codecs_;
294 AudioCodecs audio_recv_codecs_;
zhihuang1c378ed2017-08-17 14:10:50 -0700295 // Intersection of send and recv.
ossu075af922016-06-14 03:29:38 -0700296 AudioCodecs audio_sendrecv_codecs_;
zhihuang1c378ed2017-08-17 14:10:50 -0700297 // Union of send and recv.
298 AudioCodecs all_audio_codecs_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000299 RtpHeaderExtensions audio_rtp_extensions_;
300 VideoCodecs video_codecs_;
301 RtpHeaderExtensions video_rtp_extensions_;
302 DataCodecs data_codecs_;
jbauch5869f502017-06-29 12:31:36 -0700303 bool enable_encrypted_rtp_header_extensions_ = false;
zhihuang1c378ed2017-08-17 14:10:50 -0700304 // TODO(zhihuang): Rename secure_ to sdec_policy_; rename the related getter
305 // and setter.
306 SecurePolicy secure_ = SEC_DISABLED;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000307 const TransportDescriptionFactory* transport_desc_factory_;
308};
309
310// Convenience functions.
311bool IsMediaContent(const ContentInfo* content);
312bool IsAudioContent(const ContentInfo* content);
313bool IsVideoContent(const ContentInfo* content);
314bool IsDataContent(const ContentInfo* content);
deadbeef0ed85b22016-02-23 17:24:52 -0800315const ContentInfo* GetFirstMediaContent(const ContentInfos& contents,
316 MediaType media_type);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000317const ContentInfo* GetFirstAudioContent(const ContentInfos& contents);
318const ContentInfo* GetFirstVideoContent(const ContentInfos& contents);
319const ContentInfo* GetFirstDataContent(const ContentInfos& contents);
Steve Antonad7bffc2018-01-22 10:21:56 -0800320const ContentInfo* GetFirstMediaContent(const SessionDescription* sdesc,
321 MediaType media_type);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000322const ContentInfo* GetFirstAudioContent(const SessionDescription* sdesc);
323const ContentInfo* GetFirstVideoContent(const SessionDescription* sdesc);
324const ContentInfo* GetFirstDataContent(const SessionDescription* sdesc);
325const AudioContentDescription* GetFirstAudioContentDescription(
326 const SessionDescription* sdesc);
327const VideoContentDescription* GetFirstVideoContentDescription(
328 const SessionDescription* sdesc);
329const DataContentDescription* GetFirstDataContentDescription(
330 const SessionDescription* sdesc);
Taylor Brandstetterdc4eb8c2016-05-12 08:14:50 -0700331// Non-const versions of the above functions.
332// Useful when modifying an existing description.
Steve Anton36b29d12017-10-30 09:57:42 -0700333ContentInfo* GetFirstMediaContent(ContentInfos* contents, MediaType media_type);
334ContentInfo* GetFirstAudioContent(ContentInfos* contents);
335ContentInfo* GetFirstVideoContent(ContentInfos* contents);
336ContentInfo* GetFirstDataContent(ContentInfos* contents);
Steve Antonad7bffc2018-01-22 10:21:56 -0800337ContentInfo* GetFirstMediaContent(SessionDescription* sdesc,
338 MediaType media_type);
Taylor Brandstetterdc4eb8c2016-05-12 08:14:50 -0700339ContentInfo* GetFirstAudioContent(SessionDescription* sdesc);
340ContentInfo* GetFirstVideoContent(SessionDescription* sdesc);
341ContentInfo* GetFirstDataContent(SessionDescription* sdesc);
342AudioContentDescription* GetFirstAudioContentDescription(
343 SessionDescription* sdesc);
344VideoContentDescription* GetFirstVideoContentDescription(
345 SessionDescription* sdesc);
346DataContentDescription* GetFirstDataContentDescription(
347 SessionDescription* sdesc);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000348
deadbeef7914b8c2017-04-21 03:23:33 -0700349// Helper functions to return crypto suites used for SDES.
Benjamin Wrighta54daf12018-10-11 15:33:17 -0700350void GetSupportedAudioSdesCryptoSuites(
351 const webrtc::CryptoOptions& crypto_options,
352 std::vector<int>* crypto_suites);
353void GetSupportedVideoSdesCryptoSuites(
354 const webrtc::CryptoOptions& crypto_options,
355 std::vector<int>* crypto_suites);
356void GetSupportedDataSdesCryptoSuites(
357 const webrtc::CryptoOptions& crypto_options,
358 std::vector<int>* crypto_suites);
deadbeef7914b8c2017-04-21 03:23:33 -0700359void GetSupportedAudioSdesCryptoSuiteNames(
Benjamin Wrighta54daf12018-10-11 15:33:17 -0700360 const webrtc::CryptoOptions& crypto_options,
Guo-wei Shieh521ed7b2015-11-18 19:41:53 -0800361 std::vector<std::string>* crypto_suite_names);
deadbeef7914b8c2017-04-21 03:23:33 -0700362void GetSupportedVideoSdesCryptoSuiteNames(
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 GetSupportedDataSdesCryptoSuiteNames(
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);
368
Steve Antonfa2260d2017-12-28 16:38:23 -0800369// Returns true if the given media section protocol indicates use of RTP.
370bool IsRtpProtocol(const std::string& protocol);
371
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000372} // namespace cricket
373
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200374#endif // PC_MEDIASESSION_H_