Chromium Code Reviews| Index: webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h |
| diff --git a/webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h b/webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h |
| index 82f02c21e56855511b509dcd5527b7cd861024bb..3f61af4c4b3075fb3533654baacf6cfe0f2f5e4c 100644 |
| --- a/webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h |
| +++ b/webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h |
| @@ -16,10 +16,15 @@ |
| namespace webrtc { |
| -// Packet mask size in bytes (L bit is set). |
| -constexpr size_t kMaskSizeLBitSet = 6; |
| +// Maximum number of media packets that can be protected |
| +// by these packet masks. |
| +constexpr size_t kUlpfecMaxMediaPackets = 48; |
|
danilchap
2016/08/25 17:49:15
Probably put these constants into internal too.
si
brandtr
2016/08/26 11:22:22
I will get rid of the internal namespace, since th
|
| + |
| // Packet mask size in bytes (L bit is cleared). |
| -constexpr size_t kMaskSizeLBitClear = 2; |
| +constexpr size_t kUlpfecPacketMaskSizeLBitClear = 2; |
| + |
| +// Packet mask size in bytes (L bit is set). |
| +constexpr size_t kUlpfecPacketMaskSizeLBitSet = 6; |
| namespace internal { |
| @@ -65,6 +70,11 @@ void GeneratePacketMasks(int num_media_packets, int num_fec_packets, |
| const PacketMaskTable& mask_table, |
| uint8_t* packet_mask); |
| +// Given a sequence number spread (i.e., the difference between the largest |
| +// and smallest sequence number, plus one), returns the required packet |
| +// mask size. |
| +size_t PacketMaskSize(size_t seq_num_spread); |
| + |
| // Inserts |num_zeros| zero columns into |new_mask| at position |
| // |new_bit_index|. If the current byte of |new_mask| can't fit all zeros, the |
| // byte will be filled with zeros from |new_bit_index|, but the next byte will |