Make VideoSendStream::UpdateActiveSimulcastLayers not block.

UpdateActiveSimulcastLayers has been blocking
WebRtcVideoChannel::SetSend which may be called quite frequently during
negotiations. This CL changes UpdateActiveSimulcastLayers to not
synchronize with the transport's task queue to wait for the changes to
get applied.

This synchronization is quite costly, but so too are other remaining
things in VideoSendStream, so we should aim to get rid of the
`thread_sync_event_` in VideoSendStream.

Bug: webrtc:12840, webrtc:12854
Change-Id: Idb48d29b6b8382881c7c1e6f1d0f5e708dbca30f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221203
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34228}
This commit is contained in:
Tommi
2021-06-04 12:50:01 +02:00
committed by WebRTC LUCI CQ
parent d25af8ceac
commit a334dc68f3
5 changed files with 59 additions and 22 deletions

View File

@ -364,11 +364,6 @@ void VideoSendStreamImpl::StartupVideoSendStream() {
}
void VideoSendStreamImpl::Stop() {
if (!rtp_transport_queue_->IsCurrent()) {
rtp_transport_queue_->PostTask(
ToQueuedTask(transport_queue_safety_, [this] { Stop(); }));
return;
}
RTC_DCHECK_RUN_ON(rtp_transport_queue_);
RTC_LOG(LS_INFO) << "VideoSendStreamImpl::Stop";
if (!rtp_video_sender_->IsActive())