| 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. |
| 9 | */ |
| 10 |
| 11 | #include "media/base/test_utils.h" |
| 12 |
| 13 | #include <cstdint> |
| 14 |
| 15 | #include "api/video/video_frame.h" |
| 16 | #include "api/video/video_source_interface.h" |
| 17 |
| 18 | namespace cricket { |
| 19 |
| 20 | cricket::StreamParams CreateSimStreamParams( |
| 21 | const std::string& cname, |
| 22 | const std::vector<uint32_t>& ssrcs) { |
| 23 | cricket::StreamParams sp; |
| 24 | cricket::SsrcGroup sg(cricket::kSimSsrcGroupSemantics, ssrcs); |
| 25 | sp.ssrcs = ssrcs; |
| 26 | sp.ssrc_groups.push_back(sg); |
| 27 | sp.cname = cname; |
| 28 | return sp; |
| 29 | } |
| 30 |
| 31 | // There should be an rtx_ssrc per ssrc. |
| 32 | cricket::StreamParams CreateSimWithRtxStreamParams( |
| 33 | const std::string& cname, |
| 34 | const std::vector<uint32_t>& ssrcs, |
| 35 | const std::vector<uint32_t>& rtx_ssrcs) { |
| 36 | cricket::StreamParams sp = CreateSimStreamParams(cname, ssrcs); |
| 37 | for (size_t i = 0; i < ssrcs.size(); ++i) { |
| 38 | sp.AddFidSsrc(ssrcs[i], rtx_ssrcs[i]); |
| 39 | } |
| 40 | return sp; |
| 41 | } |
| 42 |
| 43 | // There should be one fec ssrc per ssrc. |
| 44 | cricket::StreamParams CreatePrimaryWithFecFrStreamParams( |
| 45 | const std::string& cname, |
| 46 | uint32_t primary_ssrc, |
| 47 | uint32_t flexfec_ssrc) { |
| 48 | cricket::StreamParams sp; |
| 49 | sp.ssrcs = {primary_ssrc}; |
| 50 | sp.cname = cname; |
| 51 | sp.AddFecFrSsrc(primary_ssrc, flexfec_ssrc); |
| 52 | return sp; |
| 53 | } |
| 54 |
| 55 | } // namespace cricket |
| 56 |