Note: We no longer publish the latest version of our code here. We primarily use a kumc-bmi github organization. The heron ETL repository, in particular, is not public. Peers in the informatics community should see MultiSiteDev for details on requesting access.

source: webrtc/webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h @ 0:4bda6873e34c

pub_scrub_3792 tip
Last change on this file since 0:4bda6873e34c was 0:4bda6873e34c, checked in by Michael Prittie <mprittie@…>, 6 years ago

Scrubbed password for publication.

File size: 2.9 KB
Line 
1/*
2 *  Copyright (c) 2012 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 "webrtc/modules/rtp_rtcp/source/forward_error_correction.h"
12#include "webrtc/typedefs.h"
13
14namespace webrtc {
15
16// Packet mask size in bytes (L bit is set).
17static const int kMaskSizeLBitSet = 6;
18// Packet mask size in bytes (L bit is cleared).
19static const int kMaskSizeLBitClear = 2;
20
21namespace internal {
22
23class PacketMaskTable {
24 public:
25  PacketMaskTable(FecMaskType fec_mask_type, int num_media_packets);
26  ~PacketMaskTable() {}
27  FecMaskType fec_mask_type() const { return fec_mask_type_; }
28  const uint8_t*** fec_packet_mask_table() const {
29    return fec_packet_mask_table_;
30  }
31
32 private:
33  FecMaskType InitMaskType(FecMaskType fec_mask_type, int num_media_packets);
34  const uint8_t*** InitMaskTable(FecMaskType fec_mask_type_);
35  const FecMaskType fec_mask_type_;
36  const uint8_t*** fec_packet_mask_table_;
37};
38
39// Returns an array of packet masks. The mask of a single FEC packet
40// corresponds to a number of mask bytes. The mask indicates which
41// media packets should be protected by the FEC packet.
42
43// \param[in]  num_media_packets       The number of media packets to protect.
44//                                     [1, max_media_packets].
45// \param[in]  num_fec_packets         The number of FEC packets which will
46//                                     be generated. [1, num_media_packets].
47// \param[in]  num_imp_packets         The number of important packets.
48//                                     [0, num_media_packets].
49//                                     num_imp_packets = 0 is the equal
50//                                     protection scenario.
51// \param[in]  use_unequal_protection  Enables unequal protection: allocates
52//                                     more protection to the num_imp_packets.
53// \param[in]  mask_table              An instance of the |PacketMaskTable|
54//                                     class, which contains the type of FEC
55//                                     packet mask used, and a pointer to the
56//                                     corresponding packet masks.
57// \param[out] packet_mask             A pointer to hold the packet mask array,
58//                                     of size: num_fec_packets *
59//                                     "number of mask bytes".
60void GeneratePacketMasks(int num_media_packets, int num_fec_packets,
61                         int num_imp_packets, bool use_unequal_protection,
62                         const PacketMaskTable& mask_table,
63                         uint8_t* packet_mask);
64
65}  // namespace internal
66}  // namespace webrtc
Note: See TracBrowser for help on using the repository browser.