Chromium Code Reviews| 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 3c71c6383506c2870b8d9b73414ef8648ef8e2e5..c9de401d7103d15f1cd06454e7728bdbe12b0586 100644 |
| --- a/webrtc/modules/rtp_rtcp/source/ulpfec_generator.cc |
| +++ b/webrtc/modules/rtp_rtcp/source/ulpfec_generator.cc |
| @@ -94,7 +94,10 @@ size_t RedPacket::length() const { |
| } |
| UlpfecGenerator::UlpfecGenerator() |
| - : fec_(ForwardErrorCorrection::CreateUlpfec()), |
| + : UlpfecGenerator(ForwardErrorCorrection::CreateUlpfec()) {} |
| + |
| +UlpfecGenerator::UlpfecGenerator(std::unique_ptr<ForwardErrorCorrection> fec) |
|
stefan-webrtc
2016/11/02 13:02:42
This is a bit weird. Why not have a single constru
brandtr
2016/11/02 14:04:37
Yes, it's a bit weird. With your suggestion howeve
stefan-webrtc
2016/11/03 13:42:40
I see, you do need both constructors? I thought th
|
| + : fec_(std::move(fec)), |
| num_protected_frames_(0), |
| min_num_media_packets_(1) { |
| memset(¶ms_, 0, sizeof(params_)); |
| @@ -140,7 +143,7 @@ int UlpfecGenerator::AddRtpPacketAndGenerateFec(const uint8_t* data_buffer, |
| bool complete_frame = false; |
| const bool marker_bit = (data_buffer[1] & kRtpMarkerBitMask) ? true : false; |
| if (media_packets_.size() < kUlpfecMaxMediaPackets) { |
| - // Generic FEC can only protect up to |kUlpfecMaxMediaPackets| packets. |
| + // Our packet masks can only protect up to |kUlpfecMaxMediaPackets| packets. |
| std::unique_ptr<ForwardErrorCorrection::Packet> packet( |
| new ForwardErrorCorrection::Packet()); |
| packet->length = payload_length + rtp_header_length; |