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

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

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/fec_receiver_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc b/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc
index 110e7c0b854e881891aeac889185d09bf303c11a..d2e1ce7e6b11283a806d0afc249537f2edfda4a5 100644
--- a/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc
@@ -39,14 +39,16 @@ using ::webrtc::test::fec::RawRtpPacket;
class ReceiverFecTest : public ::testing::Test {
protected:
- ReceiverFecTest() : receiver_fec_(FecReceiver::Create(&rtp_data_callback_)) {}
+ ReceiverFecTest()
+ : fec_(ForwardErrorCorrection::CreateUlpfec()),
+ receiver_fec_(FecReceiver::Create(&rtp_data_callback_)) {}
void EncodeFec(ForwardErrorCorrection::PacketList* media_packets,
std::list<ForwardErrorCorrection::Packet*>* fec_packets,
unsigned int num_fec_packets) {
uint8_t protection_factor = num_fec_packets * 255 / media_packets->size();
- EXPECT_EQ(0, fec_.EncodeFec(*media_packets, protection_factor, 0, false,
- kFecMaskBursty, fec_packets));
+ EXPECT_EQ(0, fec_->EncodeFec(*media_packets, protection_factor, 0, false,
+ kFecMaskBursty, fec_packets));
ASSERT_EQ(num_fec_packets, fec_packets->size());
}
@@ -95,7 +97,7 @@ class ReceiverFecTest : public ::testing::Test {
uint8_t ulpfec_payload_type);
MockRtpData rtp_data_callback_;
- ForwardErrorCorrection fec_;
+ std::unique_ptr<ForwardErrorCorrection> fec_;
std::unique_ptr<FecReceiver> receiver_fec_;
FrameGenerator generator_;
};
@@ -260,9 +262,9 @@ TEST_F(ReceiverFecTest, TooManyFrames) {
GenerateFrame(1, i, &media_rtp_packets, &media_packets);
}
std::list<ForwardErrorCorrection::Packet*> fec_packets;
- EXPECT_EQ(
- -1, fec_.EncodeFec(media_packets, kNumFecPackets * 255 / kNumMediaPackets,
- 0, false, kFecMaskBursty, &fec_packets));
+ EXPECT_EQ(-1, fec_->EncodeFec(media_packets,
+ kNumFecPackets * 255 / kNumMediaPackets, 0,
+ false, kFecMaskBursty, &fec_packets));
}
TEST_F(ReceiverFecTest, PacketNotDroppedTooEarly) {
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc ('k') | webrtc/modules/rtp_rtcp/source/forward_error_correction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698