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 | |
| 15 | webrtc::RtpParameters CreateRtpParametersWithOneEncoding() { |
| 16 | webrtc::RtpParameters parameters; |
| 17 | webrtc::RtpEncodingParameters encoding; |
| 18 | parameters.encodings.push_back(encoding); |
| 19 | return parameters; |
| 20 | } |
| 21 | |
Zach Stein | 3ca452b | 2018-01-18 10:01:24 -0800 | [diff] [blame^] | 22 | webrtc::RtpParameters CreateRtpParametersWithEncodings(StreamParams sp) { |
| 23 | std::vector<uint32_t> primary_ssrcs; |
| 24 | sp.GetPrimarySsrcs(&primary_ssrcs); |
| 25 | size_t encoding_count = primary_ssrcs.size(); |
| 26 | |
| 27 | std::vector<webrtc::RtpEncodingParameters> encodings(encoding_count); |
| 28 | for (size_t i = 0; i < encodings.size(); ++i) { |
| 29 | encodings[i].ssrc = primary_ssrcs[i]; |
| 30 | } |
| 31 | webrtc::RtpParameters parameters; |
| 32 | parameters.encodings = encodings; |
| 33 | return parameters; |
| 34 | } |
| 35 | |
Henrik Kjellander | b252856 | 2016-03-29 17:47:19 +0200 | [diff] [blame] | 36 | }; // namespace cricket |