tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_utils.cc (1652B)


      1 /*
      2 *  Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
      3 *
      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.
      9 */
     10 
     11 #include "media/base/test_utils.h"
     12 
     13 #include <cstddef>
     14 #include <cstdint>
     15 #include <string>
     16 #include <vector>
     17 
     18 #include "media/base/stream_params.h"
     19 
     20 namespace webrtc {
     21 
     22 StreamParams CreateSimStreamParams(const std::string& cname,
     23                                   const std::vector<uint32_t>& ssrcs) {
     24  StreamParams sp;
     25  SsrcGroup sg(kSimSsrcGroupSemantics, ssrcs);
     26  sp.ssrcs = ssrcs;
     27  sp.ssrc_groups.push_back(sg);
     28  sp.cname = cname;
     29  return sp;
     30 }
     31 
     32 // There should be an rtx_ssrc per ssrc.
     33 StreamParams CreateSimWithRtxStreamParams(
     34    const std::string& cname,
     35    const std::vector<uint32_t>& ssrcs,
     36    const std::vector<uint32_t>& rtx_ssrcs) {
     37  StreamParams sp = CreateSimStreamParams(cname, ssrcs);
     38  for (size_t i = 0; i < ssrcs.size(); ++i) {
     39    sp.AddFidSsrc(ssrcs[i], rtx_ssrcs[i]);
     40  }
     41  return sp;
     42 }
     43 
     44 // There should be one fec ssrc per ssrc.
     45 StreamParams CreatePrimaryWithFecFrStreamParams(const std::string& cname,
     46                                                uint32_t primary_ssrc,
     47                                                uint32_t flexfec_ssrc) {
     48  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 webrtc