jlmiller@webrtc.org | 5f93d0a | 2015-01-20 21:36:13 +0000 | [diff] [blame] | 1 | /* |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. |
jlmiller@webrtc.org | 5f93d0a | 2015-01-20 21:36:13 +0000 | [diff] [blame] | 3 | * |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 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. |
jlmiller@webrtc.org | 5f93d0a | 2015-01-20 21:36:13 +0000 | [diff] [blame] | 9 | */ |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "media/base/mediaengine.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 12 | |
skvlad | dc1c62c | 2016-03-16 19:07:43 -0700 | [diff] [blame] | 13 | namespace cricket { |
| 14 | |
Paulina Hensman | 11b34f4 | 2018-04-09 14:24:52 +0200 | [diff] [blame] | 15 | RtpCapabilities::RtpCapabilities() = default; |
| 16 | RtpCapabilities::~RtpCapabilities() = default; |
| 17 | |
skvlad | dc1c62c | 2016-03-16 19:07:43 -0700 | [diff] [blame] | 18 | webrtc::RtpParameters CreateRtpParametersWithOneEncoding() { |
| 19 | webrtc::RtpParameters parameters; |
| 20 | webrtc::RtpEncodingParameters encoding; |
| 21 | parameters.encodings.push_back(encoding); |
| 22 | return parameters; |
| 23 | } |
| 24 | |
Zach Stein | 3ca452b | 2018-01-18 10:01:24 -0800 | [diff] [blame] | 25 | webrtc::RtpParameters CreateRtpParametersWithEncodings(StreamParams sp) { |
| 26 | std::vector<uint32_t> primary_ssrcs; |
| 27 | sp.GetPrimarySsrcs(&primary_ssrcs); |
| 28 | size_t encoding_count = primary_ssrcs.size(); |
| 29 | |
| 30 | std::vector<webrtc::RtpEncodingParameters> encodings(encoding_count); |
| 31 | for (size_t i = 0; i < encodings.size(); ++i) { |
| 32 | encodings[i].ssrc = primary_ssrcs[i]; |
| 33 | } |
| 34 | webrtc::RtpParameters parameters; |
| 35 | parameters.encodings = encodings; |
Florent Castelli | dacec71 | 2018-05-24 16:24:21 +0200 | [diff] [blame] | 36 | parameters.rtcp.cname = sp.cname; |
Zach Stein | 3ca452b | 2018-01-18 10:01:24 -0800 | [diff] [blame] | 37 | return parameters; |
| 38 | } |
| 39 | |
Henrik Kjellander | b252856 | 2016-03-29 17:47:19 +0200 | [diff] [blame] | 40 | }; // namespace cricket |