blob: d85e12773f5b981585cd1af446cbcb39b2b75e9a [file] [log] [blame]
jlmiller@webrtc.org5f93d0a2015-01-20 21:36:13 +00001/*
kjellander1afca732016-02-07 20:46:45 -08002 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
jlmiller@webrtc.org5f93d0a2015-01-20 21:36:13 +00003 *
kjellander1afca732016-02-07 20:46:45 -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.
jlmiller@webrtc.org5f93d0a2015-01-20 21:36:13 +00009 */
henrike@webrtc.org28e20752013-07-10 00:45:36 +000010
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "media/base/mediaengine.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000012
skvladdc1c62c2016-03-16 19:07:43 -070013namespace cricket {
14
15webrtc::RtpParameters CreateRtpParametersWithOneEncoding() {
16 webrtc::RtpParameters parameters;
17 webrtc::RtpEncodingParameters encoding;
18 parameters.encodings.push_back(encoding);
19 return parameters;
20}
21
Zach Stein3ca452b2018-01-18 10:01:24 -080022webrtc::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 Kjellanderb2528562016-03-29 17:47:19 +020036}; // namespace cricket