2013-07-10 00:45:36 +00:00
|
|
|
/*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
|
2013-07-10 00:45:36 +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.
|
2013-07-10 00:45:36 +00:00
|
|
|
*/
|
|
|
|
|
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "media/base/test_utils.h"
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2018-11-28 16:47:49 +01:00
|
|
|
#include <cstdint>
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/video/video_frame.h"
|
2018-11-28 16:47:49 +01:00
|
|
|
#include "api/video/video_source_interface.h"
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
namespace cricket {
|
|
|
|
|
|
2013-12-05 00:24:06 +00:00
|
|
|
cricket::StreamParams CreateSimStreamParams(
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
const std::string& cname,
|
|
|
|
|
const std::vector<uint32_t>& ssrcs) {
|
2013-12-05 00:24:06 +00:00
|
|
|
cricket::StreamParams sp;
|
|
|
|
|
cricket::SsrcGroup sg(cricket::kSimSsrcGroupSemantics, ssrcs);
|
|
|
|
|
sp.ssrcs = ssrcs;
|
|
|
|
|
sp.ssrc_groups.push_back(sg);
|
|
|
|
|
sp.cname = cname;
|
|
|
|
|
return sp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// There should be an rtx_ssrc per ssrc.
|
|
|
|
|
cricket::StreamParams CreateSimWithRtxStreamParams(
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
const std::string& cname,
|
|
|
|
|
const std::vector<uint32_t>& ssrcs,
|
|
|
|
|
const std::vector<uint32_t>& rtx_ssrcs) {
|
2013-12-05 00:24:06 +00:00
|
|
|
cricket::StreamParams sp = CreateSimStreamParams(cname, ssrcs);
|
|
|
|
|
for (size_t i = 0; i < ssrcs.size(); ++i) {
|
|
|
|
|
sp.ssrcs.push_back(rtx_ssrcs[i]);
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
std::vector<uint32_t> fid_ssrcs;
|
2013-12-05 00:24:06 +00:00
|
|
|
fid_ssrcs.push_back(ssrcs[i]);
|
|
|
|
|
fid_ssrcs.push_back(rtx_ssrcs[i]);
|
|
|
|
|
cricket::SsrcGroup fid_group(cricket::kFidSsrcGroupSemantics, fid_ssrcs);
|
|
|
|
|
sp.ssrc_groups.push_back(fid_group);
|
|
|
|
|
}
|
|
|
|
|
return sp;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-22 00:59:48 -08:00
|
|
|
cricket::StreamParams CreatePrimaryWithFecFrStreamParams(
|
|
|
|
|
const std::string& cname,
|
|
|
|
|
uint32_t primary_ssrc,
|
|
|
|
|
uint32_t flexfec_ssrc) {
|
|
|
|
|
cricket::StreamParams sp;
|
|
|
|
|
cricket::SsrcGroup sg(cricket::kFecFrSsrcGroupSemantics,
|
|
|
|
|
{primary_ssrc, flexfec_ssrc});
|
|
|
|
|
sp.ssrcs = {primary_ssrc};
|
|
|
|
|
sp.ssrc_groups.push_back(sg);
|
|
|
|
|
sp.cname = cname;
|
|
|
|
|
return sp;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
} // namespace cricket
|