Fix Event Log For Video Receiver

Resolves an issue where, in Chrome, WebRTC event logs do not capture outgoing packets for video receivers because no reference to the event log was passed to the video receiver.

Bug: webrtc:14338
Change-Id: Ia33ce6f2d69a0e341530648b10a08516dc53abf3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271080
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37746}
This commit is contained in:
Brett Hebert
2022-08-09 18:25:04 +00:00
committed by WebRTC LUCI CQ
parent ef4a2cfc45
commit e04d0fa1b2
8 changed files with 20 additions and 11 deletions

View File

@ -24,6 +24,7 @@ Anil Kumar <an1kumar@gmail.com>
Ben Strong <bstrong@gmail.com>
Berthold Herrmann <bertholdherrmann08@googlemail.com>
Bob Withers <bwit@pobox.com>
Brett Hebert <hebert.brett@pm.me>
Bridger Maxwell <bridgeyman@gmail.com>
Bruno Pitrus <brunopitrus@hotmail.com>
Cheng Qian <chengqian1521@qq.com>

View File

@ -1042,7 +1042,7 @@ webrtc::VideoReceiveStreamInterface* Call::CreateVideoReceiveStream(
task_queue_factory_, this, num_cpu_cores_,
transport_send_->packet_router(), std::move(configuration),
call_stats_.get(), clock_, std::make_unique<VCMTiming>(clock_, trials()),
&nack_periodic_processor_, decode_sync_.get());
&nack_periodic_processor_, decode_sync_.get(), event_log_);
// TODO(bugs.webrtc.org/11993): Set this up asynchronously on the network
// thread.
receive_stream->RegisterWithTransport(&video_receiver_controller_);

View File

@ -83,7 +83,8 @@ std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpRtcpModule(
RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer,
RtcpCnameCallback* rtcp_cname_callback,
bool non_sender_rtt_measurement,
uint32_t local_ssrc) {
uint32_t local_ssrc,
RtcEventLog* rtc_event_log) {
RtpRtcpInterface::Configuration configuration;
configuration.clock = clock;
configuration.audio = false;
@ -96,6 +97,7 @@ std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpRtcpModule(
configuration.rtcp_cname_callback = rtcp_cname_callback;
configuration.local_media_ssrc = local_ssrc;
configuration.non_sender_rtt_measurement = non_sender_rtt_measurement;
configuration.event_log = rtc_event_log;
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp =
ModuleRtpRtcpImpl2::Create(configuration);
@ -223,7 +225,8 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2(
OnCompleteFrameCallback* complete_frame_callback,
rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor,
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer,
const FieldTrialsView& field_trials)
const FieldTrialsView& field_trials,
RtcEventLog* event_log)
: field_trials_(field_trials),
worker_queue_(current_queue),
clock_(clock),
@ -251,7 +254,8 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2(
rtcp_packet_type_counter_observer,
rtcp_cname_callback,
config_.rtp.rtcp_xr.receiver_reference_time_report,
config_.rtp.local_ssrc)),
config_.rtp.local_ssrc,
event_log)),
nack_periodic_processor_(nack_periodic_processor),
complete_frame_callback_(complete_frame_callback),
keyframe_request_method_(config_.rtp.keyframe_method),

View File

@ -96,7 +96,8 @@ class RtpVideoStreamReceiver2 : public LossNotificationSender,
OnCompleteFrameCallback* complete_frame_callback,
rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor,
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer,
const FieldTrialsView& field_trials);
const FieldTrialsView& field_trials,
RtcEventLog* event_log);
~RtpVideoStreamReceiver2() override;
void AddReceiveCodec(uint8_t payload_type,

View File

@ -161,7 +161,7 @@ class RtpVideoStreamReceiver2Test : public ::testing::Test,
TaskQueueBase::Current(), Clock::GetRealTimeClock(), &mock_transport_,
nullptr, nullptr, &config_, rtp_receive_statistics_.get(), nullptr,
nullptr, &nack_periodic_processor_, &mock_on_complete_frame_callback_,
nullptr, nullptr, field_trials_);
nullptr, nullptr, field_trials_, nullptr);
rtp_video_stream_receiver_->AddReceiveCodec(kPayloadType,
kVideoCodecGeneric, {},
/*raw_payload=*/false);
@ -1143,7 +1143,7 @@ TEST_F(RtpVideoStreamReceiver2Test, TransformFrame) {
TaskQueueBase::Current(), Clock::GetRealTimeClock(), &mock_transport_,
nullptr, nullptr, &config_, rtp_receive_statistics_.get(), nullptr,
nullptr, &nack_periodic_processor_, &mock_on_complete_frame_callback_,
nullptr, mock_frame_transformer, field_trials_);
nullptr, mock_frame_transformer, field_trials_, nullptr);
receiver->AddReceiveCodec(kPayloadType, kVideoCodecGeneric, {},
/*raw_payload=*/false);

View File

@ -200,7 +200,8 @@ VideoReceiveStream2::VideoReceiveStream2(
Clock* clock,
std::unique_ptr<VCMTiming> timing,
NackPeriodicProcessor* nack_periodic_processor,
DecodeSynchronizer* decode_sync)
DecodeSynchronizer* decode_sync,
RtcEventLog* event_log)
: task_queue_factory_(task_queue_factory),
transport_adapter_(config.rtcp_send_transport),
config_(std::move(config)),
@ -226,7 +227,8 @@ VideoReceiveStream2::VideoReceiveStream2(
this, // OnCompleteFrameCallback
std::move(config_.frame_decryptor),
std::move(config_.frame_transformer),
call->trials()),
call->trials(),
event_log),
rtp_stream_sync_(call->worker_thread(), this),
max_wait_for_keyframe_(DetermineMaxWaitForFrame(
TimeDelta::Millis(config_.rtp.nack.rtp_history_ms),

View File

@ -102,7 +102,8 @@ class VideoReceiveStream2
Clock* clock,
std::unique_ptr<VCMTiming> timing,
NackPeriodicProcessor* nack_periodic_processor,
DecodeSynchronizer* decode_sync);
DecodeSynchronizer* decode_sync,
RtcEventLog* event_log);
// Destruction happens on the worker thread. Prior to destruction the caller
// must ensure that a registration with the transport has been cleared. See
// `RegisterWithTransport` for details.

View File

@ -266,7 +266,7 @@ class VideoReceiveStream2Test : public ::testing::TestWithParam<bool> {
time_controller_.GetTaskQueueFactory(), &fake_call_,
kDefaultNumCpuCores, &packet_router_, config_.Copy(), &call_stats_,
clock_, absl::WrapUnique(timing_), &nack_periodic_processor_,
GetParam() ? &decode_sync_ : nullptr);
GetParam() ? &decode_sync_ : nullptr, nullptr);
video_receive_stream_->RegisterWithTransport(
&rtp_stream_receiver_controller_);
if (state)