blob: 98a1f070d687ec8457f3f22a8be70899d8ee5517 [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
13#ifndef TALK_SESSION_MEDIA_MEDIASESSION_H_
14#define TALK_SESSION_MEDIA_MEDIASESSION_H_
15
buildbot@webrtc.orga09a9992014-08-13 17:26:08 +000016#include <algorithm>
deadbeef0ed85b22016-02-23 17:24:52 -080017#include <map>
henrike@webrtc.org28e20752013-07-10 00:45:36 +000018#include <string>
19#include <vector>
henrike@webrtc.org28e20752013-07-10 00:45:36 +000020
kjellandera96e2d72016-02-04 23:52:28 -080021#include "webrtc/media/base/codec.h"
kjellandera96e2d72016-02-04 23:52:28 -080022#include "webrtc/media/base/cryptoparams.h"
23#include "webrtc/media/base/mediachannel.h"
kjellanderf4752772016-03-02 05:42:30 -080024#include "webrtc/media/base/mediaconstants.h"
kjellandera96e2d72016-02-04 23:52:28 -080025#include "webrtc/media/base/mediaengine.h" // For DataChannelType
26#include "webrtc/media/base/streamparams.h"
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000027#include "webrtc/p2p/base/sessiondescription.h"
28#include "webrtc/p2p/base/transport.h"
29#include "webrtc/p2p/base/transportdescriptionfactory.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000030
31namespace cricket {
32
33class ChannelManager;
34typedef std::vector<AudioCodec> AudioCodecs;
35typedef std::vector<VideoCodec> VideoCodecs;
36typedef std::vector<DataCodec> DataCodecs;
37typedef std::vector<CryptoParams> CryptoParamsVec;
38typedef std::vector<RtpHeaderExtension> RtpHeaderExtensions;
39
henrike@webrtc.org28e20752013-07-10 00:45:36 +000040enum MediaType {
41 MEDIA_TYPE_AUDIO,
42 MEDIA_TYPE_VIDEO,
43 MEDIA_TYPE_DATA
44};
45
sergeyu@chromium.org4b26e2e2014-01-15 23:15:54 +000046std::string MediaTypeToString(MediaType type);
47
henrike@webrtc.org28e20752013-07-10 00:45:36 +000048enum MediaContentDirection {
49 MD_INACTIVE,
50 MD_SENDONLY,
51 MD_RECVONLY,
52 MD_SENDRECV
53};
54
henrike@webrtc.orgb90991d2014-03-04 19:54:57 +000055enum CryptoType {
56 CT_NONE,
57 CT_SDES,
58 CT_DTLS
59};
60
henrike@webrtc.org28e20752013-07-10 00:45:36 +000061// RTC4585 RTP/AVPF
62extern const char kMediaProtocolAvpf[];
63// RFC5124 RTP/SAVPF
64extern const char kMediaProtocolSavpf[];
65
jiayl@webrtc.org8dcd43c2014-05-29 22:07:59 +000066extern const char kMediaProtocolDtlsSavpf[];
67
henrike@webrtc.org28e20752013-07-10 00:45:36 +000068extern const char kMediaProtocolRtpPrefix[];
69
70extern const char kMediaProtocolSctp[];
71extern const char kMediaProtocolDtlsSctp[];
lally@webrtc.orgec97c652015-02-24 20:18:48 +000072extern const char kMediaProtocolUdpDtlsSctp[];
lally@webrtc.orga7470932015-02-24 20:19:21 +000073extern const char kMediaProtocolTcpDtlsSctp[];
henrike@webrtc.org28e20752013-07-10 00:45:36 +000074
75// Options to control how session descriptions are generated.
76const int kAutoBandwidth = -1;
77const int kBufferedModeDisabled = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000078
79struct MediaSessionOptions {
80 MediaSessionOptions() :
jiayl@webrtc.org742922b2014-10-07 21:32:43 +000081 recv_audio(true),
82 recv_video(false),
henrike@webrtc.org28e20752013-07-10 00:45:36 +000083 data_channel_type(DCT_NONE),
84 is_muc(false),
85 vad_enabled(true), // When disabled, removes all CN codecs from SDP.
86 rtcp_mux_enabled(true),
87 bundle_enabled(false),
88 video_bandwidth(kAutoBandwidth),
89 data_bandwidth(kDataMaxBandwidth) {
90 }
91
jiayl@webrtc.org742922b2014-10-07 21:32:43 +000092 bool has_audio() const {
93 return recv_audio || HasSendMediaStream(MEDIA_TYPE_AUDIO);
94 }
95 bool has_video() const {
96 return recv_video || HasSendMediaStream(MEDIA_TYPE_VIDEO);
97 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +000098 bool has_data() const { return data_channel_type != DCT_NONE; }
99
100 // Add a stream with MediaType type and id.
101 // All streams with the same sync_label will get the same CNAME.
102 // All ids must be unique.
jiayl@webrtc.org742922b2014-10-07 21:32:43 +0000103 void AddSendStream(MediaType type,
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000104 const std::string& id,
105 const std::string& sync_label);
jiayl@webrtc.org742922b2014-10-07 21:32:43 +0000106 void AddSendVideoStream(const std::string& id,
wu@webrtc.orgcecfd182013-10-30 05:18:12 +0000107 const std::string& sync_label,
108 int num_sim_layers);
jiayl@webrtc.org742922b2014-10-07 21:32:43 +0000109 void RemoveSendStream(MediaType type, const std::string& id);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000110
wu@webrtc.orgcecfd182013-10-30 05:18:12 +0000111
112 // Helper function.
jiayl@webrtc.org742922b2014-10-07 21:32:43 +0000113 void AddSendStreamInternal(MediaType type,
wu@webrtc.orgcecfd182013-10-30 05:18:12 +0000114 const std::string& id,
115 const std::string& sync_label,
116 int num_sim_layers);
117
jiayl@webrtc.org742922b2014-10-07 21:32:43 +0000118 bool HasSendMediaStream(MediaType type) const;
119
Taylor Brandstetterf475d362016-01-08 15:35:57 -0800120 // TODO(deadbeef): Put all the audio/video/data-specific options into a map
121 // structure (content name -> options).
122 // MediaSessionDescriptionFactory assumes there will never be more than one
123 // audio/video/data content, but this will change with unified plan.
jiayl@webrtc.org742922b2014-10-07 21:32:43 +0000124 bool recv_audio;
125 bool recv_video;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000126 DataChannelType data_channel_type;
127 bool is_muc;
128 bool vad_enabled;
129 bool rtcp_mux_enabled;
130 bool bundle_enabled;
131 // bps. -1 == auto.
132 int video_bandwidth;
133 int data_bandwidth;
deadbeef0ed85b22016-02-23 17:24:52 -0800134 // content name ("mid") => options.
135 std::map<std::string, TransportOptions> transport_options;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000136
137 struct Stream {
138 Stream(MediaType type,
139 const std::string& id,
wu@webrtc.orgcecfd182013-10-30 05:18:12 +0000140 const std::string& sync_label,
141 int num_sim_layers)
142 : type(type), id(id), sync_label(sync_label),
143 num_sim_layers(num_sim_layers) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000144 }
145 MediaType type;
146 std::string id;
147 std::string sync_label;
wu@webrtc.orgcecfd182013-10-30 05:18:12 +0000148 int num_sim_layers;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000149 };
150
151 typedef std::vector<Stream> Streams;
152 Streams streams;
153};
154
155// "content" (as used in XEP-0166) descriptions for voice and video.
156class MediaContentDescription : public ContentDescription {
157 public:
deadbeef13871492015-12-09 12:37:51 -0800158 MediaContentDescription() {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000159
160 virtual MediaType type() const = 0;
161 virtual bool has_codecs() const = 0;
162
163 // |protocol| is the expected media transport protocol, such as RTP/AVPF,
164 // RTP/SAVPF or SCTP/DTLS.
165 std::string protocol() const { return protocol_; }
166 void set_protocol(const std::string& protocol) { protocol_ = protocol; }
167
168 MediaContentDirection direction() const { return direction_; }
169 void set_direction(MediaContentDirection direction) {
170 direction_ = direction;
171 }
172
173 bool rtcp_mux() const { return rtcp_mux_; }
174 void set_rtcp_mux(bool mux) { rtcp_mux_ = mux; }
175
deadbeef13871492015-12-09 12:37:51 -0800176 bool rtcp_reduced_size() const { return rtcp_reduced_size_; }
177 void set_rtcp_reduced_size(bool reduced_size) {
178 rtcp_reduced_size_ = reduced_size;
179 }
180
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000181 int bandwidth() const { return bandwidth_; }
182 void set_bandwidth(int bandwidth) { bandwidth_ = bandwidth; }
183
184 const std::vector<CryptoParams>& cryptos() const { return cryptos_; }
185 void AddCrypto(const CryptoParams& params) {
186 cryptos_.push_back(params);
187 }
188 void set_cryptos(const std::vector<CryptoParams>& cryptos) {
189 cryptos_ = cryptos;
190 }
henrike@webrtc.orgb90991d2014-03-04 19:54:57 +0000191
192 CryptoType crypto_required() const { return crypto_required_; }
193 void set_crypto_required(CryptoType type) {
194 crypto_required_ = type;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000195 }
196
197 const RtpHeaderExtensions& rtp_header_extensions() const {
198 return rtp_header_extensions_;
199 }
200 void set_rtp_header_extensions(const RtpHeaderExtensions& extensions) {
201 rtp_header_extensions_ = extensions;
202 rtp_header_extensions_set_ = true;
203 }
204 void AddRtpHeaderExtension(const RtpHeaderExtension& ext) {
205 rtp_header_extensions_.push_back(ext);
206 rtp_header_extensions_set_ = true;
207 }
208 void ClearRtpHeaderExtensions() {
209 rtp_header_extensions_.clear();
210 rtp_header_extensions_set_ = true;
211 }
212 // We can't always tell if an empty list of header extensions is
213 // because the other side doesn't support them, or just isn't hooked up to
214 // signal them. For now we assume an empty list means no signaling, but
215 // provide the ClearRtpHeaderExtensions method to allow "no support" to be
216 // clearly indicated (i.e. when derived from other information).
217 bool rtp_header_extensions_set() const {
218 return rtp_header_extensions_set_;
219 }
220 // True iff the client supports multiple streams.
221 void set_multistream(bool multistream) { multistream_ = multistream; }
222 bool multistream() const { return multistream_; }
223 const StreamParamsVec& streams() const {
224 return streams_;
225 }
226 // TODO(pthatcher): Remove this by giving mediamessage.cc access
227 // to MediaContentDescription
228 StreamParamsVec& mutable_streams() {
229 return streams_;
230 }
231 void AddStream(const StreamParams& stream) {
232 streams_.push_back(stream);
233 }
234 // Legacy streams have an ssrc, but nothing else.
Peter Boström0c4e06b2015-10-07 12:23:21 +0200235 void AddLegacyStream(uint32_t ssrc) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000236 streams_.push_back(StreamParams::CreateLegacy(ssrc));
237 }
Peter Boström0c4e06b2015-10-07 12:23:21 +0200238 void AddLegacyStream(uint32_t ssrc, uint32_t fid_ssrc) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000239 StreamParams sp = StreamParams::CreateLegacy(ssrc);
240 sp.AddFidSsrc(ssrc, fid_ssrc);
241 streams_.push_back(sp);
242 }
243 // Sets the CNAME of all StreamParams if it have not been set.
244 // This can be used to set the CNAME of legacy streams.
245 void SetCnameIfEmpty(const std::string& cname) {
246 for (cricket::StreamParamsVec::iterator it = streams_.begin();
247 it != streams_.end(); ++it) {
248 if (it->cname.empty())
249 it->cname = cname;
250 }
251 }
Peter Boström0c4e06b2015-10-07 12:23:21 +0200252 uint32_t first_ssrc() const {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000253 if (streams_.empty()) {
254 return 0;
255 }
256 return streams_[0].first_ssrc();
257 }
258 bool has_ssrcs() const {
259 if (streams_.empty()) {
260 return false;
261 }
262 return streams_[0].has_ssrcs();
263 }
264
265 void set_conference_mode(bool enable) { conference_mode_ = enable; }
266 bool conference_mode() const { return conference_mode_; }
267
268 void set_partial(bool partial) { partial_ = partial; }
269 bool partial() const { return partial_; }
270
271 void set_buffered_mode_latency(int latency) {
272 buffered_mode_latency_ = latency;
273 }
274 int buffered_mode_latency() const { return buffered_mode_latency_; }
275
276 protected:
deadbeef13871492015-12-09 12:37:51 -0800277 bool rtcp_mux_ = false;
278 bool rtcp_reduced_size_ = false;
279 int bandwidth_ = kAutoBandwidth;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000280 std::string protocol_;
281 std::vector<CryptoParams> cryptos_;
deadbeef13871492015-12-09 12:37:51 -0800282 CryptoType crypto_required_ = CT_NONE;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000283 std::vector<RtpHeaderExtension> rtp_header_extensions_;
deadbeef13871492015-12-09 12:37:51 -0800284 bool rtp_header_extensions_set_ = false;
285 bool multistream_ = false;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000286 StreamParamsVec streams_;
deadbeef13871492015-12-09 12:37:51 -0800287 bool conference_mode_ = false;
288 bool partial_ = false;
289 int buffered_mode_latency_ = kBufferedModeDisabled;
290 MediaContentDirection direction_ = MD_SENDRECV;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000291};
292
293template <class C>
294class MediaContentDescriptionImpl : public MediaContentDescription {
295 public:
deadbeef67cf2c12016-04-13 10:07:16 -0700296 typedef C CodecType;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000297
deadbeef67cf2c12016-04-13 10:07:16 -0700298 // Codecs should be in preference order (most preferred codec first).
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000299 const std::vector<C>& codecs() const { return codecs_; }
300 void set_codecs(const std::vector<C>& codecs) { codecs_ = codecs; }
301 virtual bool has_codecs() const { return !codecs_.empty(); }
302 bool HasCodec(int id) {
303 bool found = false;
304 for (typename std::vector<C>::iterator iter = codecs_.begin();
305 iter != codecs_.end(); ++iter) {
306 if (iter->id == id) {
307 found = true;
308 break;
309 }
310 }
311 return found;
312 }
313 void AddCodec(const C& codec) {
314 codecs_.push_back(codec);
315 }
jiayl@webrtc.org9c16c392014-05-01 18:30:30 +0000316 void AddOrReplaceCodec(const C& codec) {
317 for (typename std::vector<C>::iterator iter = codecs_.begin();
318 iter != codecs_.end(); ++iter) {
319 if (iter->id == codec.id) {
320 *iter = codec;
321 return;
322 }
323 }
324 AddCodec(codec);
325 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000326 void AddCodecs(const std::vector<C>& codecs) {
327 typename std::vector<C>::const_iterator codec;
328 for (codec = codecs.begin(); codec != codecs.end(); ++codec) {
329 AddCodec(*codec);
330 }
331 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000332
333 private:
334 std::vector<C> codecs_;
335};
336
337class AudioContentDescription : public MediaContentDescriptionImpl<AudioCodec> {
338 public:
339 AudioContentDescription() :
340 agc_minus_10db_(false) {}
341
342 virtual ContentDescription* Copy() const {
343 return new AudioContentDescription(*this);
344 }
345 virtual MediaType type() const { return MEDIA_TYPE_AUDIO; }
346
347 const std::string &lang() const { return lang_; }
348 void set_lang(const std::string &lang) { lang_ = lang; }
349
350 bool agc_minus_10db() const { return agc_minus_10db_; }
351 void set_agc_minus_10db(bool enable) {
352 agc_minus_10db_ = enable;
353 }
354
355 private:
356 bool agc_minus_10db_;
357
358 private:
359 std::string lang_;
360};
361
362class VideoContentDescription : public MediaContentDescriptionImpl<VideoCodec> {
363 public:
364 virtual ContentDescription* Copy() const {
365 return new VideoContentDescription(*this);
366 }
367 virtual MediaType type() const { return MEDIA_TYPE_VIDEO; }
368};
369
370class DataContentDescription : public MediaContentDescriptionImpl<DataCodec> {
371 public:
372 virtual ContentDescription* Copy() const {
373 return new DataContentDescription(*this);
374 }
375 virtual MediaType type() const { return MEDIA_TYPE_DATA; }
376};
377
378// Creates media session descriptions according to the supplied codecs and
379// other fields, as well as the supplied per-call options.
380// When creating answers, performs the appropriate negotiation
381// of the various fields to determine the proper result.
382class MediaSessionDescriptionFactory {
383 public:
384 // Default ctor; use methods below to set configuration.
385 // The TransportDescriptionFactory is not owned by MediaSessionDescFactory,
386 // so it must be kept alive by the user of this class.
387 explicit MediaSessionDescriptionFactory(
388 const TransportDescriptionFactory* factory);
389 // This helper automatically sets up the factory to get its configuration
390 // from the specified ChannelManager.
391 MediaSessionDescriptionFactory(ChannelManager* cmanager,
392 const TransportDescriptionFactory* factory);
393
394 const AudioCodecs& audio_codecs() const { return audio_codecs_; }
395 void set_audio_codecs(const AudioCodecs& codecs) { audio_codecs_ = codecs; }
396 void set_audio_rtp_header_extensions(const RtpHeaderExtensions& extensions) {
397 audio_rtp_extensions_ = extensions;
398 }
399 const RtpHeaderExtensions& audio_rtp_header_extensions() const {
400 return audio_rtp_extensions_;
401 }
402 const VideoCodecs& video_codecs() const { return video_codecs_; }
403 void set_video_codecs(const VideoCodecs& codecs) { video_codecs_ = codecs; }
404 void set_video_rtp_header_extensions(const RtpHeaderExtensions& extensions) {
405 video_rtp_extensions_ = extensions;
406 }
407 const RtpHeaderExtensions& video_rtp_header_extensions() const {
408 return video_rtp_extensions_;
409 }
410 const DataCodecs& data_codecs() const { return data_codecs_; }
411 void set_data_codecs(const DataCodecs& codecs) { data_codecs_ = codecs; }
412 SecurePolicy secure() const { return secure_; }
413 void set_secure(SecurePolicy s) { secure_ = s; }
414 // Decides if a StreamParams shall be added to the audio and video media
415 // content in SessionDescription when CreateOffer and CreateAnswer is called
416 // even if |options| don't include a Stream. This is needed to support legacy
417 // applications. |add_legacy_| is true per default.
418 void set_add_legacy_streams(bool add_legacy) { add_legacy_ = add_legacy; }
419
420 SessionDescription* CreateOffer(
421 const MediaSessionOptions& options,
422 const SessionDescription* current_description) const;
423 SessionDescription* CreateAnswer(
424 const SessionDescription* offer,
425 const MediaSessionOptions& options,
426 const SessionDescription* current_description) const;
427
428 private:
429 void GetCodecsToOffer(const SessionDescription* current_description,
430 AudioCodecs* audio_codecs,
431 VideoCodecs* video_codecs,
432 DataCodecs* data_codecs) const;
433 void GetRtpHdrExtsToOffer(const SessionDescription* current_description,
434 RtpHeaderExtensions* audio_extensions,
435 RtpHeaderExtensions* video_extensions) const;
436 bool AddTransportOffer(
437 const std::string& content_name,
438 const TransportOptions& transport_options,
439 const SessionDescription* current_desc,
440 SessionDescription* offer) const;
441
442 TransportDescription* CreateTransportAnswer(
443 const std::string& content_name,
444 const SessionDescription* offer_desc,
445 const TransportOptions& transport_options,
446 const SessionDescription* current_desc) const;
447
448 bool AddTransportAnswer(
449 const std::string& content_name,
450 const TransportDescription& transport_desc,
451 SessionDescription* answer_desc) const;
452
jiayl@webrtc.orge7d47a12014-08-05 19:19:05 +0000453 // Helpers for adding media contents to the SessionDescription. Returns true
454 // it succeeds or the media content is not needed, or false if there is any
455 // error.
456
457 bool AddAudioContentForOffer(
458 const MediaSessionOptions& options,
459 const SessionDescription* current_description,
460 const RtpHeaderExtensions& audio_rtp_extensions,
461 const AudioCodecs& audio_codecs,
462 StreamParamsVec* current_streams,
463 SessionDescription* desc) const;
464
465 bool AddVideoContentForOffer(
466 const MediaSessionOptions& options,
467 const SessionDescription* current_description,
468 const RtpHeaderExtensions& video_rtp_extensions,
469 const VideoCodecs& video_codecs,
470 StreamParamsVec* current_streams,
471 SessionDescription* desc) const;
472
473 bool AddDataContentForOffer(
474 const MediaSessionOptions& options,
475 const SessionDescription* current_description,
476 DataCodecs* data_codecs,
477 StreamParamsVec* current_streams,
478 SessionDescription* desc) const;
479
480 bool AddAudioContentForAnswer(
481 const SessionDescription* offer,
482 const MediaSessionOptions& options,
483 const SessionDescription* current_description,
484 StreamParamsVec* current_streams,
485 SessionDescription* answer) const;
486
487 bool AddVideoContentForAnswer(
488 const SessionDescription* offer,
489 const MediaSessionOptions& options,
490 const SessionDescription* current_description,
491 StreamParamsVec* current_streams,
492 SessionDescription* answer) const;
493
494 bool AddDataContentForAnswer(
495 const SessionDescription* offer,
496 const MediaSessionOptions& options,
497 const SessionDescription* current_description,
498 StreamParamsVec* current_streams,
499 SessionDescription* answer) const;
500
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000501 AudioCodecs audio_codecs_;
502 RtpHeaderExtensions audio_rtp_extensions_;
503 VideoCodecs video_codecs_;
504 RtpHeaderExtensions video_rtp_extensions_;
505 DataCodecs data_codecs_;
506 SecurePolicy secure_;
507 bool add_legacy_;
508 std::string lang_;
509 const TransportDescriptionFactory* transport_desc_factory_;
510};
511
512// Convenience functions.
513bool IsMediaContent(const ContentInfo* content);
514bool IsAudioContent(const ContentInfo* content);
515bool IsVideoContent(const ContentInfo* content);
516bool IsDataContent(const ContentInfo* content);
deadbeef0ed85b22016-02-23 17:24:52 -0800517const ContentInfo* GetFirstMediaContent(const ContentInfos& contents,
518 MediaType media_type);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000519const ContentInfo* GetFirstAudioContent(const ContentInfos& contents);
520const ContentInfo* GetFirstVideoContent(const ContentInfos& contents);
521const ContentInfo* GetFirstDataContent(const ContentInfos& contents);
522const ContentInfo* GetFirstAudioContent(const SessionDescription* sdesc);
523const ContentInfo* GetFirstVideoContent(const SessionDescription* sdesc);
524const ContentInfo* GetFirstDataContent(const SessionDescription* sdesc);
525const AudioContentDescription* GetFirstAudioContentDescription(
526 const SessionDescription* sdesc);
527const VideoContentDescription* GetFirstVideoContentDescription(
528 const SessionDescription* sdesc);
529const DataContentDescription* GetFirstDataContentDescription(
530 const SessionDescription* sdesc);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000531
Guo-wei Shieh521ed7b2015-11-18 19:41:53 -0800532void GetSupportedAudioCryptoSuites(std::vector<int>* crypto_suites);
533void GetSupportedVideoCryptoSuites(std::vector<int>* crypto_suites);
534void GetSupportedDataCryptoSuites(std::vector<int>* crypto_suites);
535void GetDefaultSrtpCryptoSuites(std::vector<int>* crypto_suites);
536void GetSupportedAudioCryptoSuiteNames(
537 std::vector<std::string>* crypto_suite_names);
538void GetSupportedVideoCryptoSuiteNames(
539 std::vector<std::string>* crypto_suite_names);
540void GetSupportedDataCryptoSuiteNames(
541 std::vector<std::string>* crypto_suite_names);
542void GetDefaultSrtpCryptoSuiteNames(
543 std::vector<std::string>* crypto_suite_names);
544
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000545} // namespace cricket
546
547#endif // TALK_SESSION_MEDIA_MEDIASESSION_H_