2015-01-20 21:36:13 +00:00
|
|
|
/*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
|
2015-01-20 21:36:13 +00:00
|
|
|
*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2015-01-20 21:36:13 +00:00
|
|
|
*/
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "media/base/mediaengine.h"
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2016-03-16 19:07:43 -07:00
|
|
|
namespace cricket {
|
|
|
|
|
|
2018-04-09 14:24:52 +02:00
|
|
|
RtpCapabilities::RtpCapabilities() = default;
|
|
|
|
|
RtpCapabilities::~RtpCapabilities() = default;
|
|
|
|
|
|
2016-03-16 19:07:43 -07:00
|
|
|
webrtc::RtpParameters CreateRtpParametersWithOneEncoding() {
|
|
|
|
|
webrtc::RtpParameters parameters;
|
|
|
|
|
webrtc::RtpEncodingParameters encoding;
|
|
|
|
|
parameters.encodings.push_back(encoding);
|
|
|
|
|
return parameters;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-18 10:01:24 -08:00
|
|
|
webrtc::RtpParameters CreateRtpParametersWithEncodings(StreamParams sp) {
|
|
|
|
|
std::vector<uint32_t> primary_ssrcs;
|
|
|
|
|
sp.GetPrimarySsrcs(&primary_ssrcs);
|
|
|
|
|
size_t encoding_count = primary_ssrcs.size();
|
|
|
|
|
|
|
|
|
|
std::vector<webrtc::RtpEncodingParameters> encodings(encoding_count);
|
|
|
|
|
for (size_t i = 0; i < encodings.size(); ++i) {
|
|
|
|
|
encodings[i].ssrc = primary_ssrcs[i];
|
|
|
|
|
}
|
|
|
|
|
webrtc::RtpParameters parameters;
|
|
|
|
|
parameters.encodings = encodings;
|
2018-05-24 16:24:21 +02:00
|
|
|
parameters.rtcp.cname = sp.cname;
|
2018-01-18 10:01:24 -08:00
|
|
|
return parameters;
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-29 17:47:19 +02:00
|
|
|
}; // namespace cricket
|