Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(758)

Unified Diff: webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h

Issue 2260803002: Generalize FEC header formatting. (pt. 4) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Lint fix. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c61aea872c54ac612c30ba35469d914ed2571468 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,17 @@
namespace webrtc {
-// Packet mask size in bytes (L bit is set).
-constexpr size_t kMaskSizeLBitSet = 6;
-// Packet mask size in bytes (L bit is cleared).
-constexpr size_t kMaskSizeLBitClear = 2;
+// Maximum number of media packets that can be protected
+// by these packet masks.
+constexpr size_t kUlpfecMaxMediaPackets = 48;
+
+// Packet mask size in bytes (given L bit).
+constexpr size_t kUlpfecPacketMaskSizeLBitClear = 2;
+constexpr size_t kUlpfecPacketMaskSizeLBitSet = 6;
+
+// Convenience constants.
+constexpr size_t kUlpfecMinPacketMaskSize = kUlpfecPacketMaskSizeLBitClear;
+constexpr size_t kUlpfecMaxPacketMaskSize = kUlpfecPacketMaskSizeLBitSet;
namespace internal {
@@ -65,6 +72,10 @@ void GeneratePacketMasks(int num_media_packets, int num_fec_packets,
const PacketMaskTable& mask_table,
uint8_t* packet_mask);
+// Returns the required packet mask size, given the number of sequence numbers
+// that will be covered.
+size_t PacketMaskSize(size_t num_sequence_numbers);
+
// 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

Powered by Google App Engine
This is Rietveld 408576698