[cleanup] Prefer VCMTiming unique_ptr in VideoReceiveStream2 c'tor
Change-Id: Ifc2667ef9da38563266fb5ca7800ec757464035e Bug: None Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256363 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Evan Shrubsole <eshr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36289}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
04c881683d
commit
6dbc1723f1
@ -1154,7 +1154,7 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream(
|
||||
VideoReceiveStream2* receive_stream = new VideoReceiveStream2(
|
||||
task_queue_factory_, this, num_cpu_cores_,
|
||||
transport_send_->packet_router(), std::move(configuration),
|
||||
call_stats_.get(), clock_, new VCMTiming(clock_),
|
||||
call_stats_.get(), clock_, std::make_unique<VCMTiming>(clock_),
|
||||
&nack_periodic_processor_, decode_sync_.get());
|
||||
// TODO(bugs.webrtc.org/11993): Set this up asynchronously on the network
|
||||
// thread.
|
||||
|
@ -209,7 +209,7 @@ VideoReceiveStream2::VideoReceiveStream2(
|
||||
VideoReceiveStream::Config config,
|
||||
CallStats* call_stats,
|
||||
Clock* clock,
|
||||
VCMTiming* timing,
|
||||
std::unique_ptr<VCMTiming> timing,
|
||||
NackPeriodicProcessor* nack_periodic_processor,
|
||||
DecodeSynchronizer* decode_sync)
|
||||
: task_queue_factory_(task_queue_factory),
|
||||
@ -225,7 +225,7 @@ VideoReceiveStream2::VideoReceiveStream2(
|
||||
call->worker_thread(),
|
||||
call->trials()),
|
||||
rtp_receive_statistics_(ReceiveStatistics::Create(clock_)),
|
||||
timing_(timing),
|
||||
timing_(std::move(timing)),
|
||||
video_receiver_(clock_, timing_.get()),
|
||||
rtp_video_stream_receiver_(call->worker_thread(),
|
||||
clock_,
|
||||
|
@ -100,7 +100,7 @@ class VideoReceiveStream2
|
||||
VideoReceiveStream::Config config,
|
||||
CallStats* call_stats,
|
||||
Clock* clock,
|
||||
VCMTiming* timing,
|
||||
std::unique_ptr<VCMTiming> timing,
|
||||
NackPeriodicProcessor* nack_periodic_processor,
|
||||
DecodeSynchronizer* decode_sync);
|
||||
// Destruction happens on the worker thread. Prior to destruction the caller
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "api/test/mock_video_decoder.h"
|
||||
#include "api/test/mock_video_decoder_factory.h"
|
||||
@ -106,8 +107,8 @@ class VideoReceiveStream2Test : public ::testing::Test {
|
||||
video_receive_stream_ =
|
||||
std::make_unique<webrtc::internal::VideoReceiveStream2>(
|
||||
task_queue_factory_.get(), &fake_call_, kDefaultNumCpuCores,
|
||||
&packet_router_, config_.Copy(), &call_stats_, clock_, timing_,
|
||||
&nack_periodic_processor_, nullptr);
|
||||
&packet_router_, config_.Copy(), &call_stats_, clock_,
|
||||
absl::WrapUnique(timing_), &nack_periodic_processor_, nullptr);
|
||||
video_receive_stream_->RegisterWithTransport(
|
||||
&rtp_stream_receiver_controller_);
|
||||
}
|
||||
@ -283,10 +284,11 @@ class VideoReceiveStream2TestWithFakeDecoder : public ::testing::Test {
|
||||
video_receive_stream_ = nullptr;
|
||||
}
|
||||
timing_ = new VCMTiming(clock_);
|
||||
video_receive_stream_.reset(new webrtc::internal::VideoReceiveStream2(
|
||||
task_queue_factory_.get(), &fake_call_, kDefaultNumCpuCores,
|
||||
&packet_router_, config_.Copy(), &call_stats_, clock_, timing_,
|
||||
&nack_periodic_processor_, nullptr));
|
||||
video_receive_stream_ =
|
||||
std::make_unique<webrtc::internal::VideoReceiveStream2>(
|
||||
task_queue_factory_.get(), &fake_call_, kDefaultNumCpuCores,
|
||||
&packet_router_, config_.Copy(), &call_stats_, clock_,
|
||||
absl::WrapUnique(timing_), &nack_periodic_processor_, nullptr);
|
||||
video_receive_stream_->RegisterWithTransport(
|
||||
&rtp_stream_receiver_controller_);
|
||||
video_receive_stream_->SetAndGetRecordingState(std::move(state), false);
|
||||
@ -545,16 +547,17 @@ class VideoReceiveStream2TestWithSimulatedClock
|
||||
&fake_decoder_factory_,
|
||||
&fake_renderer_)),
|
||||
call_stats_(time_controller_.GetClock(), loop_.task_queue()),
|
||||
video_receive_stream_(time_controller_.GetTaskQueueFactory(),
|
||||
&fake_call_,
|
||||
/*num_cores=*/2,
|
||||
&packet_router_,
|
||||
config_.Copy(),
|
||||
&call_stats_,
|
||||
time_controller_.GetClock(),
|
||||
new VCMTiming(time_controller_.GetClock()),
|
||||
&nack_periodic_processor_,
|
||||
nullptr) {
|
||||
video_receive_stream_(
|
||||
time_controller_.GetTaskQueueFactory(),
|
||||
&fake_call_,
|
||||
/*num_cores=*/2,
|
||||
&packet_router_,
|
||||
config_.Copy(),
|
||||
&call_stats_,
|
||||
time_controller_.GetClock(),
|
||||
std::make_unique<VCMTiming>(time_controller_.GetClock()),
|
||||
&nack_periodic_processor_,
|
||||
nullptr) {
|
||||
if (std::get<1>(GetParam())) {
|
||||
fake_call_.SetFieldTrial("WebRTC-FrameBuffer3/arm:FrameBuffer3/");
|
||||
} else {
|
||||
@ -741,8 +744,8 @@ class VideoReceiveStream2TestWithLazyDecoderCreation : public ::testing::Test {
|
||||
video_receive_stream_ =
|
||||
std::make_unique<webrtc::internal::VideoReceiveStream2>(
|
||||
task_queue_factory_.get(), &fake_call_, kDefaultNumCpuCores,
|
||||
&packet_router_, config_.Copy(), &call_stats_, clock_, timing_,
|
||||
&nack_periodic_processor_, nullptr);
|
||||
&packet_router_, config_.Copy(), &call_stats_, clock_,
|
||||
absl::WrapUnique(timing_), &nack_periodic_processor_, nullptr);
|
||||
video_receive_stream_->RegisterWithTransport(
|
||||
&rtp_stream_receiver_controller_);
|
||||
}
|
||||
|
Reference in New Issue
Block a user