diff options
Diffstat (limited to 'third_party/libwebrtc/rtc_tools/rtp_generator')
-rw-r--r-- | third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.cc | 11 | ||||
-rw-r--r-- | third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.h | 6 |
2 files changed, 7 insertions, 10 deletions
diff --git a/third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.cc b/third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.cc index e50c125876..0c6d3e3a48 100644 --- a/third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.cc +++ b/third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.cc @@ -14,7 +14,7 @@ #include <memory> #include <utility> -#include "api/task_queue/default_task_queue_factory.h" +#include "api/environment/environment_factory.h" #include "api/test/create_frame_generator.h" #include "api/video_codecs/video_decoder_factory_template.h" #include "api/video_codecs/video_decoder_factory_template_dav1d_adapter.h" @@ -171,6 +171,7 @@ absl::optional<RtpGeneratorOptions> ParseRtpGeneratorOptionsFromFile( RtpGenerator::RtpGenerator(const RtpGeneratorOptions& options) : options_(options), + env_(CreateEnvironment()), video_encoder_factory_( std::make_unique<webrtc::VideoEncoderFactoryTemplate< webrtc::LibvpxVp8EncoderTemplateAdapter, @@ -183,9 +184,7 @@ RtpGenerator::RtpGenerator(const RtpGeneratorOptions& options) webrtc::Dav1dDecoderTemplateAdapter>>()), video_bitrate_allocator_factory_( CreateBuiltinVideoBitrateAllocatorFactory()), - event_log_(std::make_unique<RtcEventLogNull>()), - call_(Call::Create(CallConfig(event_log_.get()))), - task_queue_(CreateDefaultTaskQueueFactory()) { + call_(Call::Create(CallConfig(env_))) { constexpr int kMinBitrateBps = 30000; // 30 Kbps constexpr int kMaxBitrateBps = 2500000; // 2.5 Mbps @@ -246,11 +245,11 @@ RtpGenerator::RtpGenerator(const RtpGeneratorOptions& options) // Setup the fake video stream for this. std::unique_ptr<test::FrameGeneratorCapturer> frame_generator = std::make_unique<test::FrameGeneratorCapturer>( - Clock::GetRealTimeClock(), + &env_.clock(), test::CreateSquareFrameGenerator(send_config.video_width, send_config.video_height, absl::nullopt, absl::nullopt), - send_config.video_fps, *task_queue_); + send_config.video_fps, env_.task_queue_factory()); frame_generator->Init(); VideoSendStream* video_send_stream = call_->CreateVideoSendStream( diff --git a/third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.h b/third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.h index e9d23362ef..2f178d3466 100644 --- a/third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.h +++ b/third_party/libwebrtc/rtc_tools/rtp_generator/rtp_generator.h @@ -16,9 +16,8 @@ #include <vector> #include "api/call/transport.h" +#include "api/environment/environment.h" #include "api/media_types.h" -#include "api/rtc_event_log/rtc_event_log.h" -#include "api/task_queue/task_queue_factory.h" #include "api/video/builtin_video_bitrate_allocator_factory.h" #include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_encoder_factory.h" @@ -104,18 +103,17 @@ class RtpGenerator final : public webrtc::Transport { test::RtpPacket DataToRtpPacket(const uint8_t* packet, size_t packet_len); const RtpGeneratorOptions options_; + const Environment env_; std::unique_ptr<VideoEncoderFactory> video_encoder_factory_; std::unique_ptr<VideoDecoderFactory> video_decoder_factory_; std::unique_ptr<VideoBitrateAllocatorFactory> video_bitrate_allocator_factory_; - std::unique_ptr<RtcEventLog> event_log_; std::unique_ptr<Call> call_; std::unique_ptr<test::RtpFileWriter> rtp_dump_writer_; std::vector<std::unique_ptr<test::FrameGeneratorCapturer>> frame_generators_; std::vector<VideoSendStream*> video_send_streams_; std::vector<uint32_t> durations_ms_; uint32_t start_ms_ = 0; - std::unique_ptr<TaskQueueFactory> task_queue_; }; } // namespace webrtc |