Reason for revert:
Breaks fuzzer.
Original issue's description:
> Only compare sequence numbers from the same SSRC in ForwardErrorCorrection.
>
> Prior to this CL, the ForwardErrorCorrection state would be reset whenever
> the difference in sequence numbers of the last recovered media packet
> and the new packet (media or FEC) was too large. This comparison did not
> take into account that FlexFEC uses a different SSRC for the FEC packets,
> meaning that the the state would be reset very frequently when FlexFEC
> is used. This should not have led to any major problems, except for a
> decreased decoding efficiency.
>
> This CL verifies that whenever we compare sequence numbers in
> ForwardErrorCorrection, they do indeed belong to the same SSRC.
>
> BUG=webrtc:5654
>
> Review-Url: https://codereview.webrtc.org/2893293003
> Cr-Commit-Position: refs/heads/master@{#18399}
> Committed: 1476a9d789TBR=stefan@webrtc.org,holmer@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5654
Review-Url: https://codereview.webrtc.org/2919313005
Cr-Commit-Position: refs/heads/master@{#18446}
Prior to this CL, the ForwardErrorCorrection state would be reset whenever
the difference in sequence numbers of the last recovered media packet
and the new packet (media or FEC) was too large. This comparison did not
take into account that FlexFEC uses a different SSRC for the FEC packets,
meaning that the the state would be reset very frequently when FlexFEC
is used. This should not have led to any major problems, except for a
decreased decoding efficiency.
This CL verifies that whenever we compare sequence numbers in
ForwardErrorCorrection, they do indeed belong to the same SSRC.
BUG=webrtc:5654
Review-Url: https://codereview.webrtc.org/2893293003
Cr-Commit-Position: refs/heads/master@{#18399}
Add classes that can read and finalize FlexFEC headers.
BUG=webrtc:5654
Review-Url: https://codereview.webrtc.org/2269903002
Cr-Commit-Position: refs/heads/master@{#14469}
- Split out reading/writing of FEC headers to classes separate
from ForwardErrorCorrection. This makes ForwardErrorCorrection
oblivious to what FEC header scheme is used, and lets it focus on
encoding/decoding the FEC payloads.
- Add unit tests for FEC header readers/writers.
- Split ForwardErrorCorrection::XorPackets into XorHeaders and
XorPayloads and reuse these functions for both encoding and
decoding.
- Rename AttemptRecover -> AttemptRecovery in ForwardErrorCorrection.
BUG=webrtc:5654
R=danilchap@webrtc.org, stefan@webrtc.org
Review URL: https://codereview.webrtc.org/2260803002 .
Cr-Commit-Position: refs/heads/master@{#14316}
- Rename GenerateFec -> EncodeFec in ForwardErrorCorrection. This naming
is more consistent with DecodeFec.
- Add appropriate using directives, to reduce clutter in tests.
- Move ConstructMediaPackets to fec_test_helper.{h,cc}. This will help
future tests of ULPFEC/FlexFEC header formatters.
- Generalize tests in rtp_fec_unittest.cc to typed tests. This will help
testing ForwardErrorCorrection with both ULPFEC and FlexFEC.
This CL should not impact functionality or performance.
BUG=webrtc:5654
Review-Url: https://codereview.webrtc.org/2267393002
Cr-Commit-Position: refs/heads/master@{#14314}
- Rename GetNumberOfFecPackets -> NumFecPackets and
PacketOverhead -> MaxPacketOverhead in ForwardErrorCorrection.
- Rename FECPacketOverhead -> FecPacketOverhead in ProducerFec.
- Move ownership of ForwardErrorCorrection from RTPSenderVideo
to ProducerFec.
- Make MaxPacketOverhead a member function of ForwardErrorCorrection.
This will allow for changing it, based on FEC header types, later on.
BUG=webrtc:5654
Review-Url: https://codereview.webrtc.org/2275443002
Cr-Commit-Position: refs/heads/master@{#14194}
This CL expands the test coverage by checking that the FEC can
handle reordered received media packets. Specifically, this checks
that |recovered_packets| is kept in sorted order.
BUG=webrtc:5654
Review-Url: https://codereview.webrtc.org/2101253002
Cr-Commit-Position: refs/heads/master@{#13693}
This CL converts the ForwardErrorCorrection class to use std::unique_ptr
for memory management, rather than manually delete'ing allocated memory.
It further renames some data structures and types to distinguish between
generated FEC packets (i.e. coming from the encode operation) and
received FEC packets (i.e. coming in over the wire, intended for the
decode operation).
BUG=webrtc:5654
Review-Url: https://codereview.webrtc.org/2099243003
Cr-Commit-Position: refs/heads/master@{#13687}
This CL mainly updates the FEC code to use more C++11 features and
to be more in line with the style guide. These changes should
have no impact on the functionality provided by the FEC.
Summary of style fixes:
- Use range-based for loops, where applicable.
- Use auto type deduction for iterator type names.
- Use RTC_DCHECK instead of assert.
- Rename FEC to Fec, where applicable.
- Update test_fec.cc to use variable_names rather than variableNames.
- Avoid redefining the PacketList types outside ForwardErrorCorrection.
Another minor change is that storage for the packet masks, as these
are generated, now is provided by a member variable, rather than
being dynamically allocated on every call to GenerateFec.
BUG=webrtc:5654
R=danilchap@webrtc.org, stefan@webrtc.org
Review URL: https://codereview.webrtc.org/2080553003 .
Cr-Commit-Position: refs/heads/master@{#13403}
rand() usage replaced with new Random class, which also makes it clearer what interval random number is in.
BUG=webrtc:5277
R=mflodman
Review URL: https://codereview.webrtc.org/1519503002
Cr-Commit-Position: refs/heads/master@{#11019}