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

Unified Diff: webrtc/modules/rtp_rtcp/source/ulpfec_generator.cc

Issue 2918333002: Reland of Only compare sequence numbers from the same SSRC in ForwardErrorCorrection. (Closed)
Patch Set: Let ForwardErrorCorrection be aware of its SSRCs. Created 3 years, 6 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/ulpfec_generator.cc
diff --git a/webrtc/modules/rtp_rtcp/source/ulpfec_generator.cc b/webrtc/modules/rtp_rtcp/source/ulpfec_generator.cc
index 4c50e222910cd3a061c51704171f6d7c09bdc46e..4aa5331d6df82f9957d1805b10405a9adc990198 100644
--- a/webrtc/modules/rtp_rtcp/source/ulpfec_generator.cc
+++ b/webrtc/modules/rtp_rtcp/source/ulpfec_generator.cc
@@ -49,6 +49,13 @@ constexpr uint8_t kHighProtectionThreshold = 80;
// |kMinMediaPackets| + 1 packets are sent to the FEC code.
constexpr float kMinMediaPacketsAdaptationThreshold = 2.0f;
+// At construction time, we don't know the SSRC that is used for the generated
+// FEC packets, but we still need to give it to the ForwardErrorCorrection ctor
+// to be used in the decoding.
+// TODO(brandtr): Get rid of this awkwardness by splitting
+// ForwardErrorCorrection in two objects -- one encoder and one decoder.
+constexpr uint32_t kUnknownSsrc = 0;
+
} // namespace
RedPacket::RedPacket(size_t length)
@@ -94,7 +101,7 @@ size_t RedPacket::length() const {
}
UlpfecGenerator::UlpfecGenerator()
- : UlpfecGenerator(ForwardErrorCorrection::CreateUlpfec()) {}
+ : UlpfecGenerator(ForwardErrorCorrection::CreateUlpfec(kUnknownSsrc)) {}
UlpfecGenerator::UlpfecGenerator(std::unique_ptr<ForwardErrorCorrection> fec)
: fec_(std::move(fec)),

Powered by Google App Engine
This is Rietveld 408576698