Fixes for flexfec crash in scenario tests.

Bug: webrtc:9510
Change-Id: I39bb4ed9afc4837f88f0db798495f34b685f4c24
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/142232
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28309}
This commit is contained in:
Sebastian Jansson 2019-06-18 16:08:23 +02:00 committed by Commit Bot
parent 58ee187554
commit 342f98b117
2 changed files with 38 additions and 4 deletions

View File

@ -540,7 +540,10 @@ ReceiveVideoStream::ReceiveVideoStream(CallClient* receiver,
flexfec.protected_media_ssrcs = send_stream->rtx_ssrcs_;
flexfec.local_ssrc = recv_config.rtp.local_ssrc;
receiver_->ssrc_media_types_[flexfec.remote_ssrc] = MediaType::VIDEO;
flecfec_stream_ = receiver_->call_->CreateFlexfecReceiveStream(flexfec);
receiver_->SendTask([this, &flexfec] {
flecfec_stream_ = receiver_->call_->CreateFlexfecReceiveStream(flexfec);
});
}
receiver_->ssrc_media_types_[recv_config.rtp.remote_ssrc] =
MediaType::VIDEO;

View File

@ -21,8 +21,7 @@ using Codec = VideoStreamConfig::Encoder::Codec;
using CodecImpl = VideoStreamConfig::Encoder::Implementation;
} // namespace
// TODO(srte): Enable this after resolving flakiness issues.
TEST(VideoStreamTest, DISABLED_ReceivesFramesFromFileBasedStreams) {
TEST(VideoStreamTest, ReceivesFramesFromFileBasedStreams) {
TimeDelta kRunTime = TimeDelta::ms(500);
std::vector<int> kFrameRates = {15, 30};
std::deque<std::atomic<int>> frame_counts(2);
@ -68,7 +67,6 @@ TEST(VideoStreamTest, DISABLED_ReceivesFramesFromFileBasedStreams) {
EXPECT_GE(frame_counts[1], expected_counts[1]);
}
// TODO(srte): Enable this after resolving flakiness issues.
TEST(VideoStreamTest, RecievesVp8SimulcastFrames) {
TimeDelta kRunTime = TimeDelta::ms(500);
int kFrameRate = 30;
@ -115,5 +113,38 @@ TEST(VideoStreamTest, RecievesVp8SimulcastFrames) {
EXPECT_GE(frame_counts[1], kExpectedCount);
EXPECT_GE(frame_counts[2], kExpectedCount);
}
TEST(VideoStreamTest, SendsFecWithUlpFec) {
Scenario s;
auto route =
s.CreateRoutes(s.CreateClient("caller", CallClientConfig()),
{s.CreateSimulationNode([](NetworkSimulationConfig* c) {
c->loss_rate = 0.1;
})},
s.CreateClient("callee", CallClientConfig()),
{s.CreateSimulationNode(NetworkSimulationConfig())});
auto video = s.CreateVideoStream(route->forward(), [&](VideoStreamConfig* c) {
c->stream.use_ulpfec = true;
});
s.RunFor(TimeDelta::seconds(5));
VideoSendStream::Stats video_stats = video->send()->GetStats();
EXPECT_GT(video_stats.substreams.begin()->second.rtp_stats.fec.packets, 0u);
}
TEST(VideoStreamTest, SendsFecWithFlexFec) {
Scenario s;
auto route =
s.CreateRoutes(s.CreateClient("caller", CallClientConfig()),
{s.CreateSimulationNode([](NetworkSimulationConfig* c) {
c->loss_rate = 0.1;
})},
s.CreateClient("callee", CallClientConfig()),
{s.CreateSimulationNode(NetworkSimulationConfig())});
auto video = s.CreateVideoStream(route->forward(), [&](VideoStreamConfig* c) {
c->stream.use_flexfec = true;
});
s.RunFor(TimeDelta::seconds(5));
VideoSendStream::Stats video_stats = video->send()->GetStats();
EXPECT_GT(video_stats.substreams.begin()->second.rtp_stats.fec.packets, 0u);
}
} // namespace test
} // namespace webrtc