From cc5be54c26c7e389674e8c13c6dc0fb10ea93be3 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Mon, 1 Apr 2019 13:34:55 +0200 Subject: [PATCH] Support for injection of FEC controller in Scenario tests. Also adding sync group for video streams. Bug: webrtc:10365 Change-Id: I9ef92de756f06bbbcd7b67524bbf51fe1365fa85 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130508 Commit-Queue: Sebastian Jansson Reviewed-by: Christoffer Rodbro Cr-Commit-Position: refs/heads/master@{#27390} --- test/scenario/BUILD.gn | 1 + test/scenario/call_client.h | 1 - test/scenario/scenario_config.h | 9 ++++++--- test/scenario/video_stream.cc | 11 +++++++++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn index 2dcd3f923b..64ce904a02 100644 --- a/test/scenario/BUILD.gn +++ b/test/scenario/BUILD.gn @@ -78,6 +78,7 @@ if (rtc_include_tests) { "../:test_common", "../:test_support", "../:video_test_common", + "../../api:fec_controller_api", "../../api:libjingle_peerconnection_api", "../../api:transport_api", "../../api/audio_codecs:builtin_audio_decoder_factory", diff --git a/test/scenario/call_client.h b/test/scenario/call_client.h index c7ef65e9eb..f080b9cdb8 100644 --- a/test/scenario/call_client.h +++ b/test/scenario/call_client.h @@ -109,7 +109,6 @@ class CallClient : public EmulatedNetworkReceiverInterface { std::unique_ptr transport_; std::unique_ptr const header_parser_; - std::unique_ptr fec_controller_factory_; // Stores the configured overhead per known destination endpoint. This is used // to subtract the overhead before processing. std::map route_overhead_; diff --git a/test/scenario/scenario_config.h b/test/scenario/scenario_config.h index 63ba1edf95..c6ddb23105 100644 --- a/test/scenario/scenario_config.h +++ b/test/scenario/scenario_config.h @@ -14,6 +14,7 @@ #include #include "absl/types/optional.h" +#include "api/fec_controller.h" #include "api/rtp_parameters.h" #include "api/transport/network_control.h" #include "api/units/data_rate.h" @@ -174,10 +175,12 @@ struct VideoStreamConfig { TimeDelta nack_history_time = TimeDelta::ms(1000); bool use_flexfec = false; bool use_ulpfec = false; + FecControllerFactoryInterface* fec_controller_factory = nullptr; } stream; - struct Renderer { + struct Rendering { enum Type { kFake } type = kFake; - }; + std::string sync_group; + } render; struct analyzer { bool log_to_file = false; std::function frame_quality_handler; @@ -221,7 +224,7 @@ struct AudioStreamConfig { ~Stream(); bool in_bandwidth_estimation = false; } stream; - struct Render { + struct Rendering { std::string sync_group; } render; }; diff --git a/test/scenario/video_stream.cc b/test/scenario/video_stream.cc index f85972c853..9a0b531073 100644 --- a/test/scenario/video_stream.cc +++ b/test/scenario/video_stream.cc @@ -328,6 +328,7 @@ VideoReceiveStream::Config CreateVideoReceiveStreamConfig( recv.rtp.rtx_associated_payload_types[CallTest::kRtxRedPayloadType] = CallTest::kRedPayloadType; } + recv.sync_group = config.render.sync_group; return recv; } } // namespace @@ -386,8 +387,14 @@ SendVideoStream::SendVideoStream(CallClient* sender, bitrate_allocator_factory_.get(); sender_->SendTask([&] { - send_stream_ = sender_->call_->CreateVideoSendStream( - std::move(send_config), std::move(encoder_config)); + if (config.stream.fec_controller_factory) { + send_stream_ = sender_->call_->CreateVideoSendStream( + std::move(send_config), std::move(encoder_config), + config.stream.fec_controller_factory->CreateFecController()); + } else { + send_stream_ = sender_->call_->CreateVideoSendStream( + std::move(send_config), std::move(encoder_config)); + } std::vector > frame_info_handlers; if (config.analyzer.frame_quality_handler)