diff --git a/test/scenario/video_stream.cc b/test/scenario/video_stream.cc index c516ddf796..b7324bdcee 100644 --- a/test/scenario/video_stream.cc +++ b/test/scenario/video_stream.cc @@ -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; diff --git a/test/scenario/video_stream_unittest.cc b/test/scenario/video_stream_unittest.cc index 84384d0b34..ebd9d623e8 100644 --- a/test/scenario/video_stream_unittest.cc +++ b/test/scenario/video_stream_unittest.cc @@ -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 kFrameRates = {15, 30}; std::deque> 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