Improve vie_autotest_rtp_rtcp by reenabling important tests and reducing flakiness.
R=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1567004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4118 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
15c1c61e2c
commit
3496ef1087
@ -246,8 +246,8 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
|
|||||||
|
|
||||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetStartSequenceNumber(
|
EXPECT_EQ(0, ViE.rtp_rtcp->SetStartSequenceNumber(
|
||||||
tbChannel.videoChannel, startSequenceNumber));
|
tbChannel.videoChannel, startSequenceNumber));
|
||||||
EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel));
|
|
||||||
EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel));
|
EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel));
|
||||||
|
EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel));
|
||||||
|
|
||||||
AutoTestSleep(kAutoTestSleepTimeMs);
|
AutoTestSleep(kAutoTestSleepTimeMs);
|
||||||
|
|
||||||
@ -432,39 +432,59 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
|
|||||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetNACKStatus(tbChannel.videoChannel, true));
|
EXPECT_EQ(0, ViE.rtp_rtcp->SetNACKStatus(tbChannel.videoChannel, true));
|
||||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
EXPECT_EQ(0, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
||||||
tbChannel.videoChannel, true));
|
tbChannel.videoChannel, true));
|
||||||
|
unsigned int bytes_sent_before = 0;
|
||||||
|
unsigned int packets_sent_before = 0;
|
||||||
|
unsigned int bytes_received_before = 0;
|
||||||
|
unsigned int packets_received_before = 0;
|
||||||
|
unsigned int bytes_sent_after = 0;
|
||||||
|
unsigned int packets_sent_after = 0;
|
||||||
|
unsigned int bytes_received_after = 0;
|
||||||
|
unsigned int packets_received_after = 0;
|
||||||
|
EXPECT_EQ(0, ViE.rtp_rtcp->GetRTPStatistics(tbChannel.videoChannel,
|
||||||
|
bytes_sent_before,
|
||||||
|
packets_sent_before,
|
||||||
|
bytes_received_before,
|
||||||
|
packets_received_before));
|
||||||
EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel));
|
EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel));
|
||||||
EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel));
|
EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel));
|
||||||
|
|
||||||
// Real-time mode.
|
// Real-time mode.
|
||||||
AutoTestSleep(kAutoTestSleepTimeMs);
|
AutoTestSleep(kAutoTestSleepTimeMs);
|
||||||
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
|
EXPECT_EQ(0, ViE.rtp_rtcp->GetRTPStatistics(tbChannel.videoChannel,
|
||||||
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
|
bytes_sent_after,
|
||||||
sentFecBitrate, sentNackBitrate));
|
packets_sent_after,
|
||||||
|
bytes_received_after,
|
||||||
|
packets_received_after));
|
||||||
if (FLAGS_include_timing_dependent_tests) {
|
if (FLAGS_include_timing_dependent_tests) {
|
||||||
EXPECT_GT(sentTotalBitrate, 0u);
|
EXPECT_GT(bytes_received_after, bytes_received_before);
|
||||||
}
|
}
|
||||||
|
bytes_received_before = bytes_received_after;
|
||||||
// Simulate lost reception and verify that nothing is sent during that time.
|
// Simulate lost reception and verify that nothing is sent during that time.
|
||||||
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, false);
|
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, false);
|
||||||
ViETest::Log("Network Down...\n");
|
ViETest::Log("Network Down...\n");
|
||||||
AutoTestSleep(kAutoTestSleepTimeMs);
|
AutoTestSleep(kAutoTestSleepTimeMs);
|
||||||
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
|
EXPECT_EQ(0, ViE.rtp_rtcp->GetRTPStatistics(tbChannel.videoChannel,
|
||||||
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
|
bytes_sent_after,
|
||||||
sentFecBitrate, sentNackBitrate));
|
packets_sent_after,
|
||||||
|
bytes_received_after,
|
||||||
|
packets_received_after));
|
||||||
if (FLAGS_include_timing_dependent_tests) {
|
if (FLAGS_include_timing_dependent_tests) {
|
||||||
EXPECT_EQ(sentTotalBitrate, 0u);
|
EXPECT_EQ(bytes_received_before, bytes_received_after);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Network reception back. Video should now be sent.
|
// Network reception back. Video should now be sent.
|
||||||
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, true);
|
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, true);
|
||||||
ViETest::Log("Network Up...\n");
|
ViETest::Log("Network Up...\n");
|
||||||
AutoTestSleep(kAutoTestSleepTimeMs);
|
AutoTestSleep(kAutoTestSleepTimeMs);
|
||||||
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
|
EXPECT_EQ(0, ViE.rtp_rtcp->GetRTPStatistics(tbChannel.videoChannel,
|
||||||
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
|
bytes_sent_before,
|
||||||
sentFecBitrate, sentNackBitrate));
|
packets_sent_before,
|
||||||
|
bytes_received_before,
|
||||||
|
packets_received_before));
|
||||||
if (FLAGS_include_timing_dependent_tests) {
|
if (FLAGS_include_timing_dependent_tests) {
|
||||||
EXPECT_GT(sentTotalBitrate, 0u);
|
EXPECT_GT(bytes_received_before, bytes_received_after);
|
||||||
}
|
}
|
||||||
|
bytes_received_after = bytes_received_before;
|
||||||
// Buffering mode.
|
// Buffering mode.
|
||||||
EXPECT_EQ(0, ViE.base->StopSend(tbChannel.videoChannel));
|
EXPECT_EQ(0, ViE.base->StopSend(tbChannel.videoChannel));
|
||||||
EXPECT_EQ(0, ViE.base->StopReceive(tbChannel.videoChannel));
|
EXPECT_EQ(0, ViE.base->StopReceive(tbChannel.videoChannel));
|
||||||
@ -478,34 +498,37 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
|
|||||||
EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel));
|
EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel));
|
||||||
EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel));
|
EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel));
|
||||||
AutoTestSleep(kAutoTestSleepTimeMs);
|
AutoTestSleep(kAutoTestSleepTimeMs);
|
||||||
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
|
|
||||||
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
|
|
||||||
sentFecBitrate, sentNackBitrate));
|
|
||||||
if (FLAGS_include_timing_dependent_tests) {
|
|
||||||
EXPECT_GT(sentTotalBitrate, 0u);
|
|
||||||
}
|
|
||||||
// Simulate lost reception and verify that nothing is sent during that time.
|
// Simulate lost reception and verify that nothing is sent during that time.
|
||||||
ViETest::Log("Network Down...\n");
|
ViETest::Log("Network Down...\n");
|
||||||
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, false);
|
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, false);
|
||||||
|
EXPECT_EQ(0, ViE.rtp_rtcp->GetRTPStatistics(tbChannel.videoChannel,
|
||||||
|
bytes_sent_before,
|
||||||
|
packets_sent_before,
|
||||||
|
bytes_received_before,
|
||||||
|
packets_received_before));
|
||||||
|
if (FLAGS_include_timing_dependent_tests) {
|
||||||
|
EXPECT_GT(bytes_received_before, bytes_received_after);
|
||||||
|
}
|
||||||
AutoTestSleep(kAutoTestSleepTimeMs);
|
AutoTestSleep(kAutoTestSleepTimeMs);
|
||||||
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
|
EXPECT_EQ(0, ViE.rtp_rtcp->GetRTPStatistics(tbChannel.videoChannel,
|
||||||
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
|
bytes_sent_after,
|
||||||
sentFecBitrate, sentNackBitrate));
|
packets_sent_after,
|
||||||
// TODO(pwestin): This is incorrect due to the fact that we measure the bitrate
|
bytes_received_after,
|
||||||
// before the pacer and not after.
|
packets_received_after));
|
||||||
//
|
if (FLAGS_include_timing_dependent_tests) {
|
||||||
// if (FLAGS_include_timing_dependent_tests) {
|
EXPECT_EQ(bytes_received_after, bytes_received_before);
|
||||||
// EXPECT_EQ(sentTotalBitrate, 0u);
|
}
|
||||||
// }
|
|
||||||
// Network reception back. Video should now be sent.
|
// Network reception back. Video should now be sent.
|
||||||
ViETest::Log("Network Up...\n");
|
ViETest::Log("Network Up...\n");
|
||||||
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, true);
|
ViE.network->SetNetworkTransmissionState(tbChannel.videoChannel, true);
|
||||||
AutoTestSleep(kAutoTestSleepTimeMs);
|
AutoTestSleep(kAutoTestSleepTimeMs);
|
||||||
EXPECT_EQ(0, ViE.rtp_rtcp->GetBandwidthUsage(
|
EXPECT_EQ(0, ViE.rtp_rtcp->GetRTPStatistics(tbChannel.videoChannel,
|
||||||
tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate,
|
bytes_sent_before,
|
||||||
sentFecBitrate, sentNackBitrate));
|
packets_sent_before,
|
||||||
|
bytes_received_before,
|
||||||
|
packets_received_before));
|
||||||
if (FLAGS_include_timing_dependent_tests) {
|
if (FLAGS_include_timing_dependent_tests) {
|
||||||
EXPECT_GT(sentTotalBitrate, 0u);
|
EXPECT_GT(bytes_received_before, bytes_received_after);
|
||||||
}
|
}
|
||||||
// TODO(holmer): Verify that the decoded framerate doesn't decrease on an
|
// TODO(holmer): Verify that the decoded framerate doesn't decrease on an
|
||||||
// outage when in buffering mode. This isn't currently possible because we
|
// outage when in buffering mode. This isn't currently possible because we
|
||||||
|
@ -226,7 +226,7 @@ int TbExternalTransport::SendPacket(int channel, const void *data, int len)
|
|||||||
_statCrit.Enter();
|
_statCrit.Enter();
|
||||||
_dropCount++;
|
_dropCount++;
|
||||||
_statCrit.Leave();
|
_statCrit.Leave();
|
||||||
return 0;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoPacket* newPacket = new VideoPacket();
|
VideoPacket* newPacket = new VideoPacket();
|
||||||
|
Loading…
Reference in New Issue
Block a user