AudioSendStream: s/worker_queue_/rtp_transport_queue_/g

The 'worker' noun in WebRTC is tied to the worker thread.
Hence naming an unrelated queue to something with worker
confuses code reading.

Change this to something which can't reasonably be confused
with the worker thread.

Bug: webrtc:11993
Change-Id: Icdcc728cf3dd9eb020f922367eebd0c520814568
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220934
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34183}
This commit is contained in:
Markus Handell
2021-06-01 09:07:20 +02:00
committed by WebRTC LUCI CQ
parent 58b8d297f5
commit 3907e7b160
2 changed files with 16 additions and 15 deletions

View File

@ -142,7 +142,7 @@ AudioSendStream::AudioSendStream(
const absl::optional<RtpState>& suspended_rtp_state, const absl::optional<RtpState>& suspended_rtp_state,
std::unique_ptr<voe::ChannelSendInterface> channel_send) std::unique_ptr<voe::ChannelSendInterface> channel_send)
: clock_(clock), : clock_(clock),
worker_queue_(rtp_transport->GetWorkerQueue()), rtp_transport_queue_(rtp_transport->GetWorkerQueue()),
allocate_audio_without_feedback_( allocate_audio_without_feedback_(
field_trial::IsEnabled("WebRTC-Audio-ABWENoTWCC")), field_trial::IsEnabled("WebRTC-Audio-ABWENoTWCC")),
enable_audio_alr_probing_( enable_audio_alr_probing_(
@ -160,7 +160,7 @@ AudioSendStream::AudioSendStream(
rtp_rtcp_module_(channel_send_->GetRtpRtcp()), rtp_rtcp_module_(channel_send_->GetRtpRtcp()),
suspended_rtp_state_(suspended_rtp_state) { suspended_rtp_state_(suspended_rtp_state) {
RTC_LOG(LS_INFO) << "AudioSendStream: " << config.rtp.ssrc; RTC_LOG(LS_INFO) << "AudioSendStream: " << config.rtp.ssrc;
RTC_DCHECK(worker_queue_); RTC_DCHECK(rtp_transport_queue_);
RTC_DCHECK(audio_state_); RTC_DCHECK(audio_state_);
RTC_DCHECK(channel_send_); RTC_DCHECK(channel_send_);
RTC_DCHECK(bitrate_allocator_); RTC_DCHECK(bitrate_allocator_);
@ -182,7 +182,7 @@ AudioSendStream::~AudioSendStream() {
// Blocking call to synchronize state with worker queue to ensure that there // Blocking call to synchronize state with worker queue to ensure that there
// are no pending tasks left that keeps references to audio. // are no pending tasks left that keeps references to audio.
rtc::Event thread_sync_event; rtc::Event thread_sync_event;
worker_queue_->PostTask([&] { thread_sync_event.Set(); }); rtp_transport_queue_->PostTask([&] { thread_sync_event.Set(); });
thread_sync_event.Wait(rtc::Event::kForever); thread_sync_event.Wait(rtc::Event::kForever);
} }
@ -517,7 +517,7 @@ void AudioSendStream::DeliverRtcp(const uint8_t* packet, size_t length) {
} }
uint32_t AudioSendStream::OnBitrateUpdated(BitrateAllocationUpdate update) { uint32_t AudioSendStream::OnBitrateUpdated(BitrateAllocationUpdate update) {
RTC_DCHECK_RUN_ON(worker_queue_); RTC_DCHECK_RUN_ON(rtp_transport_queue_);
// Pick a target bitrate between the constraints. Overrules the allocator if // Pick a target bitrate between the constraints. Overrules the allocator if
// it 1) allocated a bitrate of zero to disable the stream or 2) allocated a // it 1) allocated a bitrate of zero to disable the stream or 2) allocated a
@ -855,9 +855,10 @@ void AudioSendStream::ConfigureBitrateObserver() {
if (allocation_settings_.priority_bitrate_raw) if (allocation_settings_.priority_bitrate_raw)
priority_bitrate = *allocation_settings_.priority_bitrate_raw; priority_bitrate = *allocation_settings_.priority_bitrate_raw;
worker_queue_->PostTask([this, constraints, priority_bitrate, rtp_transport_queue_->PostTask([this, constraints, priority_bitrate,
config_bitrate_priority = config_.bitrate_priority] { config_bitrate_priority =
RTC_DCHECK_RUN_ON(worker_queue_); config_.bitrate_priority] {
RTC_DCHECK_RUN_ON(rtp_transport_queue_);
bitrate_allocator_->AddObserver( bitrate_allocator_->AddObserver(
this, this,
MediaStreamAllocationConfig{ MediaStreamAllocationConfig{
@ -872,8 +873,8 @@ void AudioSendStream::ConfigureBitrateObserver() {
void AudioSendStream::RemoveBitrateObserver() { void AudioSendStream::RemoveBitrateObserver() {
registered_with_allocator_ = false; registered_with_allocator_ = false;
rtc::Event thread_sync_event; rtc::Event thread_sync_event;
worker_queue_->PostTask([this, &thread_sync_event] { rtp_transport_queue_->PostTask([this, &thread_sync_event] {
RTC_DCHECK_RUN_ON(worker_queue_); RTC_DCHECK_RUN_ON(rtp_transport_queue_);
bitrate_allocator_->RemoveObserver(this); bitrate_allocator_->RemoveObserver(this);
thread_sync_event.Set(); thread_sync_event.Set();
}); });
@ -940,8 +941,8 @@ void AudioSendStream::UpdateCachedTargetAudioBitrateConstraints() {
if (!new_constraints.has_value()) { if (!new_constraints.has_value()) {
return; return;
} }
worker_queue_->PostTask([this, new_constraints]() { rtp_transport_queue_->PostTask([this, new_constraints]() {
RTC_DCHECK_RUN_ON(worker_queue_); RTC_DCHECK_RUN_ON(rtp_transport_queue_);
cached_constraints_ = new_constraints; cached_constraints_ = new_constraints;
}); });
} }

View File

@ -165,7 +165,7 @@ class AudioSendStream final : public webrtc::AudioSendStream,
SequenceChecker worker_thread_checker_; SequenceChecker worker_thread_checker_;
SequenceChecker pacer_thread_checker_; SequenceChecker pacer_thread_checker_;
rtc::RaceChecker audio_capture_race_checker_; rtc::RaceChecker audio_capture_race_checker_;
rtc::TaskQueue* worker_queue_; rtc::TaskQueue* rtp_transport_queue_;
const bool allocate_audio_without_feedback_; const bool allocate_audio_without_feedback_;
const bool force_no_audio_feedback_ = allocate_audio_without_feedback_; const bool force_no_audio_feedback_ = allocate_audio_without_feedback_;
@ -189,10 +189,10 @@ class AudioSendStream final : public webrtc::AudioSendStream,
webrtc::voe::AudioLevel audio_level_ RTC_GUARDED_BY(audio_level_lock_); webrtc::voe::AudioLevel audio_level_ RTC_GUARDED_BY(audio_level_lock_);
BitrateAllocatorInterface* const bitrate_allocator_ BitrateAllocatorInterface* const bitrate_allocator_
RTC_GUARDED_BY(worker_queue_); RTC_GUARDED_BY(rtp_transport_queue_);
// Constrains cached to be accessed from |worker_queue_|. // Constrains cached to be accessed from |rtp_transport_queue_|.
absl::optional<AudioSendStream::TargetAudioBitrateConstraints> absl::optional<AudioSendStream::TargetAudioBitrateConstraints>
cached_constraints_ RTC_GUARDED_BY(worker_queue_) = absl::nullopt; cached_constraints_ RTC_GUARDED_BY(rtp_transport_queue_) = absl::nullopt;
RtpTransportControllerSendInterface* const rtp_transport_; RtpTransportControllerSendInterface* const rtp_transport_;
RtpRtcpInterface* const rtp_rtcp_module_; RtpRtcpInterface* const rtp_rtcp_module_;