Move BWE_TEST_LOGGING_COMPILE_TIME_ENABLE code to the worker thread.

This is part of moving calls to GetSendRates() to the worker.

Change-Id: Ifb93096a863ddf2669237e7f44af296d0e086b20
Bug: webrtc:11581
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177661
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31582}
This commit is contained in:
Tomas Gunnarsson
2020-06-29 17:41:22 +02:00
committed by Commit Bot
parent 096c0b0921
commit a1163749fd
3 changed files with 47 additions and 24 deletions

View File

@ -289,6 +289,10 @@ void ModuleRtpRtcpImpl2::SetCsrcs(const std::vector<uint32_t>& csrcs) {
// TODO(pbos): Handle media and RTX streams separately (separate RTCP
// feedbacks).
RTCPSender::FeedbackState ModuleRtpRtcpImpl2::GetFeedbackState() {
// TODO(bugs.webrtc.org/11581): Called by potentially multiple threads.
// "Send*" methods and on the ProcessThread. Make sure it's only called on the
// construction thread.
RTCPSender::FeedbackState state;
// This is called also when receiver_only is true. Hence below
// checks that rtp_sender_ exists.
@ -653,6 +657,7 @@ void ModuleRtpRtcpImpl2::BitrateSent(uint32_t* total_rate,
uint32_t* video_rate,
uint32_t* fec_rate,
uint32_t* nack_rate) const {
RTC_DCHECK_RUN_ON(worker_queue_);
RtpSendRates send_rates = rtp_sender_->packet_sender.GetSendRates();
*total_rate = send_rates.Sum().bps<uint32_t>();
if (video_rate)
@ -663,6 +668,7 @@ void ModuleRtpRtcpImpl2::BitrateSent(uint32_t* total_rate,
}
RtpSendRates ModuleRtpRtcpImpl2::GetSendRates() const {
RTC_DCHECK_RUN_ON(worker_queue_);
return rtp_sender_->packet_sender.GetSendRates();
}