Split VideoReceiveStream2 init into worker / network steps.
This is in preparation for actually doing this initialization
differently in the Call class. This CL takes the registration
steps that are inherently network thread associated and makes
them separate from the ctor/dtor.
Inject Call* instead of worker_thread(), which will simplify upcoming
work that needs to access the network_thread() as well.
This is related to:
https://webrtc-review.googlesource.com/c/src/+/220608
https://webrtc-review.googlesource.com/c/src/+/220609
Bug: webrtc:11993
Change-Id: I72769fd61de84967d9a645750c40d01660a2716b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220764
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34172}
diff --git a/audio/audio_receive_stream.cc b/audio/audio_receive_stream.cc
index ef69e73..aecc246 100644
--- a/audio/audio_receive_stream.cc
+++ b/audio/audio_receive_stream.cc
@@ -126,7 +126,7 @@
RTC_DCHECK(audio_state_);
RTC_DCHECK(channel_receive_);
- network_thread_checker_.Detach();
+ packet_sequence_checker_.Detach();
RTC_DCHECK(packet_router);
// Configure bandwidth estimation.
@@ -157,14 +157,14 @@
void AudioReceiveStream::RegisterWithTransport(
RtpStreamReceiverControllerInterface* receiver_controller) {
- RTC_DCHECK_RUN_ON(&network_thread_checker_);
+ RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
RTC_DCHECK(!rtp_stream_receiver_);
rtp_stream_receiver_ = receiver_controller->CreateReceiver(
config_.rtp.remote_ssrc, channel_receive_.get());
}
void AudioReceiveStream::UnregisterFromTransport() {
- RTC_DCHECK_RUN_ON(&network_thread_checker_);
+ RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
rtp_stream_receiver_.reset();
}
@@ -395,7 +395,7 @@
}
void AudioReceiveStream::AssociateSendStream(AudioSendStream* send_stream) {
- RTC_DCHECK_RUN_ON(&network_thread_checker_);
+ RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
channel_receive_->SetAssociatedSendChannel(
send_stream ? send_stream->GetChannel() : nullptr);
associated_send_stream_ = send_stream;
@@ -416,7 +416,7 @@
const AudioSendStream* AudioReceiveStream::GetAssociatedSendStreamForTesting()
const {
- RTC_DCHECK_RUN_ON(&network_thread_checker_);
+ RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
return associated_send_stream_;
}
diff --git a/audio/audio_receive_stream.h b/audio/audio_receive_stream.h
index 40749cc..87c82cc 100644
--- a/audio/audio_receive_stream.h
+++ b/audio/audio_receive_stream.h
@@ -125,18 +125,18 @@
// thread, but still serves as a mechanism of grouping together concepts
// that belong to the network thread. Once the packets are fully delivered
// on the network thread, this comment will be deleted.
- RTC_NO_UNIQUE_ADDRESS SequenceChecker network_thread_checker_;
+ RTC_NO_UNIQUE_ADDRESS SequenceChecker packet_sequence_checker_;
webrtc::AudioReceiveStream::Config config_;
rtc::scoped_refptr<webrtc::AudioState> audio_state_;
SourceTracker source_tracker_;
const std::unique_ptr<voe::ChannelReceiveInterface> channel_receive_;
AudioSendStream* associated_send_stream_
- RTC_GUARDED_BY(network_thread_checker_) = nullptr;
+ RTC_GUARDED_BY(packet_sequence_checker_) = nullptr;
bool playing_ RTC_GUARDED_BY(worker_thread_checker_) = false;
std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_
- RTC_GUARDED_BY(network_thread_checker_);
+ RTC_GUARDED_BY(packet_sequence_checker_);
};
} // namespace internal
} // namespace webrtc