mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Allow recursive check for RTC_DCHECK_RUN_ON macro
instead of using Lock/Unlock attributes, use Assert attribute to annotate code is running on certain task queue or thread. Such check better matches what is checked, in particular allows to recheck (and thus better document) currently used task queue Bug: None Change-Id: I5bc1c397efbc8342cf7915093b578bb015c85651 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269381 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37619}
This commit is contained in:
parent
a3f2e72008
commit
6e7c2685e3
15 changed files with 68 additions and 73 deletions
|
@ -108,9 +108,8 @@ class RTC_LOCKABLE SequenceChecker
|
|||
RTC_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(x))
|
||||
|
||||
#define RTC_DCHECK_RUN_ON(x) \
|
||||
webrtc::webrtc_sequence_checker_internal::SequenceCheckerScope \
|
||||
seq_check_scope(x); \
|
||||
RTC_DCHECK((x)->IsCurrent()) \
|
||||
<< webrtc::webrtc_sequence_checker_internal::ExpectationToString(x)
|
||||
<< webrtc::webrtc_sequence_checker_internal::ExpectationToString(x); \
|
||||
webrtc::webrtc_sequence_checker_internal::AssertHeld(x)
|
||||
|
||||
#endif // API_SEQUENCE_CHECKER_H_
|
||||
|
|
|
@ -1036,8 +1036,8 @@ absl::optional<Syncable::Info> ChannelReceive::GetSyncInfo() const {
|
|||
return info;
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_checker_)
|
||||
void ChannelReceive::UpdatePlayoutTimestamp(bool rtcp, int64_t now_ms) {
|
||||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
// TODO(bugs.webrtc.org/11993): Expect to be called exclusively on the
|
||||
// network thread. Once that's done, we won't need video_sync_lock_.
|
||||
|
||||
|
|
10
call/call.cc
10
call/call.cc
|
@ -1350,9 +1350,9 @@ void Call::OnAllocationLimitsChanged(BitrateAllocationLimits limits) {
|
|||
std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
AudioReceiveStreamImpl* Call::FindAudioStreamForSyncGroup(
|
||||
absl::string_view sync_group) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
RTC_DCHECK_RUN_ON(&receive_11993_checker_);
|
||||
if (!sync_group.empty()) {
|
||||
for (AudioReceiveStreamImpl* stream : audio_receive_streams_) {
|
||||
|
@ -1364,9 +1364,9 @@ AudioReceiveStreamImpl* Call::FindAudioStreamForSyncGroup(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// TODO(bugs.webrtc.org/11993): Expect to be called on the network thread.
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
void Call::ConfigureSync(absl::string_view sync_group) {
|
||||
// TODO(bugs.webrtc.org/11993): Expect to be called on the network thread.
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
// `audio_stream` may be nullptr when clearing the audio stream for a group.
|
||||
AudioReceiveStreamImpl* audio_stream =
|
||||
FindAudioStreamForSyncGroup(sync_group);
|
||||
|
@ -1389,8 +1389,8 @@ void Call::ConfigureSync(absl::string_view sync_group) {
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(network_thread_)
|
||||
void Call::DeliverRtcp(MediaType media_type, rtc::CopyOnWriteBuffer packet) {
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
TRACE_EVENT0("webrtc", "Call::DeliverRtcp");
|
||||
|
||||
// TODO(bugs.webrtc.org/11993): This DCHECK is here just to maintain the
|
||||
|
@ -1533,10 +1533,10 @@ void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) {
|
|||
video_receiver_controller_.OnRtpPacket(parsed_packet);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet,
|
||||
MediaType media_type,
|
||||
bool use_send_side_bwe) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
RTPHeader header;
|
||||
packet.GetHeader(&header);
|
||||
|
||||
|
|
|
@ -1274,8 +1274,8 @@ std::string WebRtcVideoChannel::CodecSettingsVectorToString(
|
|||
return out.Release();
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&thread_checker_)
|
||||
void WebRtcVideoChannel::SetReceiverReportSsrc(uint32_t ssrc) {
|
||||
RTC_DCHECK_RUN_ON(&thread_checker_);
|
||||
if (ssrc == rtcp_receiver_report_ssrc_)
|
||||
return;
|
||||
|
||||
|
|
|
@ -757,17 +757,17 @@ void ModuleRtpRtcpImpl2::PeriodicUpdate() {
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_queue_);
|
||||
void ModuleRtpRtcpImpl2::MaybeSendRtcp() {
|
||||
RTC_DCHECK_RUN_ON(worker_queue_);
|
||||
if (rtcp_sender_.TimeToSendRTCPReport())
|
||||
rtcp_sender_.SendRTCP(GetFeedbackState(), kRtcpReport);
|
||||
}
|
||||
|
||||
// TODO(bugs.webrtc.org/12889): Consider removing this function when the issue
|
||||
// is resolved.
|
||||
// RTC_RUN_ON(worker_queue_);
|
||||
void ModuleRtpRtcpImpl2::MaybeSendRtcpAtOrAfterTimestamp(
|
||||
Timestamp execution_time) {
|
||||
RTC_DCHECK_RUN_ON(worker_queue_);
|
||||
Timestamp now = clock_->CurrentTime();
|
||||
if (now >= execution_time) {
|
||||
MaybeSendRtcp();
|
||||
|
|
|
@ -71,8 +71,8 @@ void NackPeriodicProcessor::UnregisterNackModule(NackRequesterBase* module) {
|
|||
repeating_task_.Stop();
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(sequence_)
|
||||
void NackPeriodicProcessor::ProcessNackModules() {
|
||||
RTC_DCHECK_RUN_ON(&sequence_);
|
||||
for (NackRequesterBase* module : modules_)
|
||||
module->ProcessNacks();
|
||||
}
|
||||
|
|
|
@ -1289,18 +1289,18 @@ void Connection::set_ice_event_log(webrtc::IceEventLog* ice_event_log) {
|
|||
ice_event_log_ = ice_event_log;
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(network_thread_)
|
||||
void Connection::LogCandidatePairConfig(
|
||||
webrtc::IceCandidatePairConfigType type) {
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
if (ice_event_log_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
ice_event_log_->LogCandidatePairConfig(type, id(), ToLogDescription());
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(network_thread_)
|
||||
void Connection::LogCandidatePairEvent(webrtc::IceCandidatePairEventType type,
|
||||
uint32_t transaction_id) {
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
if (ice_event_log_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
@ -1403,8 +1403,8 @@ void Connection::OnConnectionRequestTimeout(ConnectionRequest* request) {
|
|||
<< request->Elapsed() << " ms";
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(network_thread_).
|
||||
void Connection::OnConnectionRequestSent(ConnectionRequest* request) {
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
// Log at LS_INFO if we send a ping on an unwritable connection.
|
||||
rtc::LoggingSeverity sev = !writable() ? rtc::LS_INFO : rtc::LS_VERBOSE;
|
||||
RTC_LOG_V(sev) << ToString() << ": Sent "
|
||||
|
@ -1620,8 +1620,8 @@ void Connection::SetLocalCandidateNetworkCost(uint16_t cost) {
|
|||
SignalStateChange(this);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(network_thread_).
|
||||
bool Connection::ShouldSendGoogPing(const StunMessage* message) {
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
if (remote_support_goog_ping_ == true && cached_stun_binding_ &&
|
||||
cached_stun_binding_->EqualAttributes(message, [](int type) {
|
||||
// Ignore these attributes.
|
||||
|
|
|
@ -2026,8 +2026,8 @@ void P2PTransportChannel::MaybeStopPortAllocatorSessions() {
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(network_thread_)
|
||||
void P2PTransportChannel::OnSelectedConnectionDestroyed() {
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
RTC_LOG(LS_INFO) << "Selected connection destroyed. Will choose a new one.";
|
||||
IceSwitchReason reason = IceSwitchReason::SELECTED_CONNECTION_DESTROYED;
|
||||
SwitchSelectedConnection(nullptr, reason);
|
||||
|
|
|
@ -83,8 +83,8 @@ void AudioRtpReceiver::OnChanged() {
|
|||
}));
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
void AudioRtpReceiver::SetOutputVolume_w(double volume) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
RTC_DCHECK_GE(volume, 0.0);
|
||||
RTC_DCHECK_LE(volume, 10.0);
|
||||
|
||||
|
@ -164,8 +164,8 @@ void AudioRtpReceiver::Stop() {
|
|||
track_->internal()->set_ended();
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&signaling_thread_checker_)
|
||||
void AudioRtpReceiver::RestartMediaChannel(absl::optional<uint32_t> ssrc) {
|
||||
RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
|
||||
bool enabled = track_->internal()->enabled();
|
||||
MediaSourceInterface::SourceState state = source_->state();
|
||||
worker_thread_->Invoke<void>(RTC_FROM_HERE, [&]() {
|
||||
|
@ -175,11 +175,11 @@ void AudioRtpReceiver::RestartMediaChannel(absl::optional<uint32_t> ssrc) {
|
|||
source_->SetState(MediaSourceInterface::kLive);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
void AudioRtpReceiver::RestartMediaChannel_w(
|
||||
absl::optional<uint32_t> ssrc,
|
||||
bool track_enabled,
|
||||
MediaSourceInterface::SourceState state) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
if (!media_channel_)
|
||||
return; // Can't restart.
|
||||
|
||||
|
@ -281,8 +281,8 @@ void AudioRtpReceiver::SetDepacketizerToDecoderFrameTransformer(
|
|||
frame_transformer_ = std::move(frame_transformer);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
void AudioRtpReceiver::Reconfigure(bool track_enabled) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
RTC_DCHECK(media_channel_);
|
||||
|
||||
SetOutputVolume_w(track_enabled ? cached_volume_ : 0);
|
||||
|
|
|
@ -113,8 +113,8 @@ void VideoRtpReceiver::Stop() {
|
|||
track_->internal()->set_ended();
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&signaling_thread_checker_)
|
||||
void VideoRtpReceiver::RestartMediaChannel(absl::optional<uint32_t> ssrc) {
|
||||
RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
|
||||
MediaSourceInterface::SourceState state = source_->state();
|
||||
// TODO(tommi): Can we restart the media channel without blocking?
|
||||
worker_thread_->Invoke<void>(RTC_FROM_HERE, [&] {
|
||||
|
@ -124,10 +124,10 @@ void VideoRtpReceiver::RestartMediaChannel(absl::optional<uint32_t> ssrc) {
|
|||
source_->SetState(MediaSourceInterface::kLive);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
void VideoRtpReceiver::RestartMediaChannel_w(
|
||||
absl::optional<uint32_t> ssrc,
|
||||
MediaSourceInterface::SourceState state) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
if (!media_channel_) {
|
||||
return; // Can't restart.
|
||||
}
|
||||
|
@ -166,8 +166,8 @@ void VideoRtpReceiver::RestartMediaChannel_w(
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
void VideoRtpReceiver::SetSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
if (ssrc_) {
|
||||
media_channel_->SetSink(*ssrc_, sink);
|
||||
} else {
|
||||
|
@ -260,8 +260,8 @@ void VideoRtpReceiver::SetMediaChannel(cricket::MediaChannel* media_channel) {
|
|||
SetMediaChannel_w(media_channel);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
void VideoRtpReceiver::SetMediaChannel_w(cricket::MediaChannel* media_channel) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
if (media_channel == media_channel_)
|
||||
return;
|
||||
|
||||
|
@ -347,8 +347,8 @@ void VideoRtpReceiver::OnEncodedSinkEnabled(bool enable) {
|
|||
saved_encoded_sink_enabled_ = enable;
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(worker_thread_)
|
||||
void VideoRtpReceiver::SetEncodedSinkEnabled(bool enable) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
if (!media_channel_)
|
||||
return;
|
||||
|
||||
|
|
|
@ -19,9 +19,21 @@
|
|||
#include "rtc_base/system/rtc_export.h"
|
||||
#include "rtc_base/thread_annotations.h"
|
||||
|
||||
namespace rtc {
|
||||
class TaskQueue;
|
||||
} // namespace rtc
|
||||
|
||||
namespace webrtc {
|
||||
class SequenceChecker;
|
||||
namespace webrtc_sequence_checker_internal {
|
||||
|
||||
inline void AssertHeld(const SequenceChecker* checker)
|
||||
RTC_ASSERT_EXCLUSIVE_LOCK(checker) {}
|
||||
inline void AssertHeld(const TaskQueueBase* task_queue)
|
||||
RTC_ASSERT_EXCLUSIVE_LOCK(task_queue) {}
|
||||
inline void AssertHeld(const rtc::TaskQueue* task_queue)
|
||||
RTC_ASSERT_EXCLUSIVE_LOCK(task_queue) {}
|
||||
|
||||
// Real implementation of SequenceChecker, for use in debug mode, or
|
||||
// for temporary use in release mode (e.g. to RTC_CHECK on a threading issue
|
||||
// seen only in the wild).
|
||||
|
@ -63,22 +75,6 @@ class SequenceCheckerDoNothing {
|
|||
void Detach() {}
|
||||
};
|
||||
|
||||
// Helper class used by RTC_DCHECK_RUN_ON (see example usage below).
|
||||
class RTC_SCOPED_LOCKABLE SequenceCheckerScope {
|
||||
public:
|
||||
template <typename ThreadLikeObject>
|
||||
explicit SequenceCheckerScope(const ThreadLikeObject* thread_like_object)
|
||||
RTC_EXCLUSIVE_LOCK_FUNCTION(thread_like_object) {}
|
||||
SequenceCheckerScope(const SequenceCheckerScope&) = delete;
|
||||
SequenceCheckerScope& operator=(const SequenceCheckerScope&) = delete;
|
||||
~SequenceCheckerScope() RTC_UNLOCK_FUNCTION() {}
|
||||
|
||||
template <typename ThreadLikeObject>
|
||||
static bool IsCurrent(const ThreadLikeObject* thread_like_object) {
|
||||
return thread_like_object->IsCurrent();
|
||||
}
|
||||
};
|
||||
|
||||
std::string ExpectationToString(const SequenceCheckerImpl* checker);
|
||||
|
||||
// Catch-all implementation for types other than explicitly supported above.
|
||||
|
|
|
@ -442,8 +442,8 @@ void ZeroHertzAdapterMode::ProcessKeyFrameRequest() {
|
|||
return;
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&sequence_checker_)
|
||||
bool ZeroHertzAdapterMode::HasQualityConverged() const {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
// 1. Define ourselves as unconverged with no spatial layers configured. This
|
||||
// is to keep short repeating until the layer configuration comes.
|
||||
// 2. Unset layers implicitly imply that they're converged to support
|
||||
|
@ -456,8 +456,8 @@ bool ZeroHertzAdapterMode::HasQualityConverged() const {
|
|||
return quality_converged;
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&sequence_checker_)
|
||||
void ZeroHertzAdapterMode::ResetQualityConvergenceInfo() {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
RTC_DLOG(LS_INFO) << __func__ << " this " << this;
|
||||
for (auto& layer_tracker : layer_trackers_) {
|
||||
if (layer_tracker.quality_converged.has_value())
|
||||
|
@ -465,8 +465,8 @@ void ZeroHertzAdapterMode::ResetQualityConvergenceInfo() {
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&sequence_checker_)
|
||||
void ZeroHertzAdapterMode::ProcessOnDelayedCadence() {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
RTC_DCHECK(!queued_frames_.empty());
|
||||
RTC_DLOG(LS_VERBOSE) << __func__ << " this " << this;
|
||||
|
||||
|
@ -485,8 +485,8 @@ void ZeroHertzAdapterMode::ProcessOnDelayedCadence() {
|
|||
ScheduleRepeat(current_frame_id_, HasQualityConverged());
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&sequence_checker_)
|
||||
void ZeroHertzAdapterMode::ScheduleRepeat(int frame_id, bool idle_repeat) {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
RTC_DLOG(LS_VERBOSE) << __func__ << " this " << this << " frame_id "
|
||||
<< frame_id;
|
||||
Timestamp now = clock_->CurrentTime();
|
||||
|
@ -507,8 +507,8 @@ void ZeroHertzAdapterMode::ScheduleRepeat(int frame_id, bool idle_repeat) {
|
|||
repeat_delay);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&sequence_checker_)
|
||||
void ZeroHertzAdapterMode::ProcessRepeatedFrameOnDelayedCadence(int frame_id) {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
RTC_DLOG(LS_VERBOSE) << __func__ << " this " << this << " frame_id "
|
||||
<< frame_id;
|
||||
RTC_DCHECK(!queued_frames_.empty());
|
||||
|
@ -545,8 +545,8 @@ void ZeroHertzAdapterMode::ProcessRepeatedFrameOnDelayedCadence(int frame_id) {
|
|||
ScheduleRepeat(frame_id, HasQualityConverged());
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&sequence_checker_)
|
||||
void ZeroHertzAdapterMode::SendFrameNow(const VideoFrame& frame) const {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
RTC_DLOG(LS_VERBOSE) << __func__ << " this " << this << " timestamp "
|
||||
<< frame.timestamp() << " timestamp_us "
|
||||
<< frame.timestamp_us() << " ntp_time_ms "
|
||||
|
@ -557,15 +557,15 @@ void ZeroHertzAdapterMode::SendFrameNow(const VideoFrame& frame) const {
|
|||
/*frames_scheduled_for_processing=*/1, frame);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&sequence_checker_)
|
||||
TimeDelta ZeroHertzAdapterMode::RepeatDuration(bool idle_repeat) const {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
return idle_repeat
|
||||
? FrameCadenceAdapterInterface::kZeroHertzIdleRepeatRatePeriod
|
||||
: frame_delay_;
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(&sequence_checker_)
|
||||
void ZeroHertzAdapterMode::MaybeStartRefreshFrameRequester() {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
RTC_DLOG(LS_VERBOSE) << __func__;
|
||||
if (!refresh_frame_requester_.Running()) {
|
||||
refresh_frame_requester_ = RepeatingTaskHandle::DelayedStart(
|
||||
|
@ -696,26 +696,26 @@ void FrameCadenceAdapterImpl::OnConstraintsChanged(
|
|||
}));
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(queue_)
|
||||
void FrameCadenceAdapterImpl::OnFrameOnMainQueue(
|
||||
Timestamp post_time,
|
||||
int frames_scheduled_for_processing,
|
||||
const VideoFrame& frame) {
|
||||
RTC_DCHECK_RUN_ON(queue_);
|
||||
current_adapter_mode_->OnFrame(post_time, frames_scheduled_for_processing,
|
||||
frame);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(queue_)
|
||||
bool FrameCadenceAdapterImpl::IsZeroHertzScreenshareEnabled() const {
|
||||
RTC_DCHECK_RUN_ON(queue_);
|
||||
return zero_hertz_screenshare_enabled_ && source_constraints_.has_value() &&
|
||||
source_constraints_->max_fps.value_or(-1) > 0 &&
|
||||
source_constraints_->min_fps.value_or(-1) == 0 &&
|
||||
zero_hertz_params_.has_value();
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(queue_)
|
||||
void FrameCadenceAdapterImpl::MaybeReconfigureAdapters(
|
||||
bool was_zero_hertz_enabled) {
|
||||
RTC_DCHECK_RUN_ON(queue_);
|
||||
bool is_zero_hertz_enabled = IsZeroHertzScreenshareEnabled();
|
||||
if (is_zero_hertz_enabled) {
|
||||
if (!was_zero_hertz_enabled) {
|
||||
|
@ -733,8 +733,8 @@ void FrameCadenceAdapterImpl::MaybeReconfigureAdapters(
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(queue_)
|
||||
void FrameCadenceAdapterImpl::MaybeReportFrameRateConstraintUmas() {
|
||||
RTC_DCHECK_RUN_ON(queue_);
|
||||
if (has_reported_screenshare_frame_rate_umas_)
|
||||
return;
|
||||
has_reported_screenshare_frame_rate_umas_ = true;
|
||||
|
|
|
@ -351,11 +351,11 @@ absl::optional<Syncable::Info> RtpVideoStreamReceiver2::GetSyncInfo() const {
|
|||
return info;
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
RtpVideoStreamReceiver2::ParseGenericDependenciesResult
|
||||
RtpVideoStreamReceiver2::ParseGenericDependenciesExtension(
|
||||
const RtpPacketReceived& rtp_packet,
|
||||
RTPVideoHeader* video_header) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
if (rtp_packet.HasExtension<RtpDependencyDescriptorExtension>()) {
|
||||
webrtc::DependencyDescriptor dependency_descriptor;
|
||||
if (!rtp_packet.GetExtension<RtpDependencyDescriptorExtension>(
|
||||
|
@ -707,9 +707,9 @@ bool RtpVideoStreamReceiver2::IsDecryptable() const {
|
|||
return frames_decryptable_;
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
void RtpVideoStreamReceiver2::OnInsertedPacket(
|
||||
video_coding::PacketBuffer::InsertResult result) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
RTC_DCHECK_RUN_ON(&worker_task_checker_);
|
||||
video_coding::PacketBuffer::Packet* first_packet = nullptr;
|
||||
int max_nack_count;
|
||||
|
@ -785,9 +785,9 @@ void RtpVideoStreamReceiver2::OnInsertedPacket(
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
void RtpVideoStreamReceiver2::OnAssembledFrame(
|
||||
std::unique_ptr<RtpFrameObject> frame) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
RTC_DCHECK(frame);
|
||||
|
||||
const absl::optional<RTPVideoHeader::GenericDescriptorInfo>& descriptor =
|
||||
|
@ -852,9 +852,9 @@ void RtpVideoStreamReceiver2::OnAssembledFrame(
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
void RtpVideoStreamReceiver2::OnCompleteFrames(
|
||||
RtpFrameReferenceFinder::ReturnVector frames) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
for (auto& frame : frames) {
|
||||
last_seq_num_for_pic_id_[frame->Id()] = frame->last_seq_num();
|
||||
|
||||
|
@ -952,8 +952,8 @@ void RtpVideoStreamReceiver2::ManageFrame(
|
|||
OnCompleteFrames(reference_finder_->ManageFrame(std::move(frame)));
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
void RtpVideoStreamReceiver2::ReceivePacket(const RtpPacketReceived& packet) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
RTC_DCHECK_RUN_ON(&worker_task_checker_);
|
||||
if (packet.payload_size() == 0) {
|
||||
// Padding or keep-alive packet.
|
||||
|
@ -982,9 +982,9 @@ void RtpVideoStreamReceiver2::ReceivePacket(const RtpPacketReceived& packet) {
|
|||
parsed_payload->video_header);
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
void RtpVideoStreamReceiver2::ParseAndHandleEncapsulatingHeader(
|
||||
const RtpPacketReceived& packet) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
if (packet.PayloadType() == config_.rtp.red_payload_type &&
|
||||
packet.payload_size() > 0) {
|
||||
if (packet.payload()[0] == config_.rtp.ulpfec_payload_type) {
|
||||
|
@ -1003,8 +1003,8 @@ void RtpVideoStreamReceiver2::ParseAndHandleEncapsulatingHeader(
|
|||
// In the case of a video stream without picture ids and no rtx the
|
||||
// RtpFrameReferenceFinder will need to know about padding to
|
||||
// correctly calculate frame references.
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
void RtpVideoStreamReceiver2::NotifyReceiverOfEmptyPacket(uint16_t seq_num) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
RTC_DCHECK_RUN_ON(&worker_task_checker_);
|
||||
|
||||
OnCompleteFrames(reference_finder_->PaddingReceived(seq_num));
|
||||
|
@ -1140,8 +1140,8 @@ void RtpVideoStreamReceiver2::UpdateHistograms() {
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
void RtpVideoStreamReceiver2::InsertSpsPpsIntoTracker(uint8_t payload_type) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
RTC_DCHECK_RUN_ON(&worker_task_checker_);
|
||||
|
||||
auto codec_params_it = pt_codec_params_.find(payload_type);
|
||||
|
|
|
@ -659,7 +659,7 @@ void VideoReceiveStream2::SetDepacketizerToDecoderFrameTransformer(
|
|||
}
|
||||
|
||||
void VideoReceiveStream2::RequestKeyFrame(Timestamp now) {
|
||||
// Running on worker_sequence_checker_.
|
||||
RTC_DCHECK_RUN_ON(&worker_sequence_checker_);
|
||||
// Called from RtpVideoStreamReceiver (rtp_video_stream_receiver_ is
|
||||
// ultimately responsible).
|
||||
rtp_video_stream_receiver_.RequestKeyFrame();
|
||||
|
@ -775,9 +775,9 @@ void VideoReceiveStream2::OnDecodableFrameTimeout(TimeDelta wait_time) {
|
|||
}));
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(decode_queue_)
|
||||
void VideoReceiveStream2::HandleEncodedFrame(
|
||||
std::unique_ptr<EncodedFrame> frame) {
|
||||
RTC_DCHECK_RUN_ON(&decode_queue_);
|
||||
Timestamp now = clock_->CurrentTime();
|
||||
|
||||
// Current OnPreDecode only cares about QP for VP8.
|
||||
|
@ -847,7 +847,7 @@ void VideoReceiveStream2::HandleEncodedFrame(
|
|||
|
||||
int VideoReceiveStream2::DecodeAndMaybeDispatchEncodedFrame(
|
||||
std::unique_ptr<EncodedFrame> frame) {
|
||||
// Running on decode_queue_.
|
||||
RTC_DCHECK_RUN_ON(&decode_queue_);
|
||||
|
||||
// If `buffered_encoded_frames_` grows out of control (=60 queued frames),
|
||||
// maybe due to a stuck decoder, we just halt the process here and log the
|
||||
|
@ -905,12 +905,12 @@ int VideoReceiveStream2::DecodeAndMaybeDispatchEncodedFrame(
|
|||
return decode_result;
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
void VideoReceiveStream2::HandleKeyFrameGeneration(
|
||||
bool received_frame_is_keyframe,
|
||||
Timestamp now,
|
||||
bool always_request_key_frame,
|
||||
bool keyframe_request_is_due) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
bool request_key_frame = always_request_key_frame;
|
||||
|
||||
// Repeat sending keyframe requests if we've requested a keyframe.
|
||||
|
@ -934,9 +934,9 @@ void VideoReceiveStream2::HandleKeyFrameGeneration(
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
void VideoReceiveStream2::HandleFrameBufferTimeout(Timestamp now,
|
||||
TimeDelta wait) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
absl::optional<int64_t> last_packet_ms =
|
||||
rtp_video_stream_receiver_.LastReceivedPacketMs();
|
||||
|
||||
|
@ -958,8 +958,8 @@ void VideoReceiveStream2::HandleFrameBufferTimeout(Timestamp now,
|
|||
}
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(packet_sequence_checker_)
|
||||
bool VideoReceiveStream2::IsReceivingKeyFrame(Timestamp now) const {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
absl::optional<int64_t> last_keyframe_packet_ms =
|
||||
rtp_video_stream_receiver_.LastReceivedKeyframePacketMs();
|
||||
|
||||
|
@ -972,7 +972,7 @@ bool VideoReceiveStream2::IsReceivingKeyFrame(Timestamp now) const {
|
|||
}
|
||||
|
||||
void VideoReceiveStream2::UpdatePlayoutDelays() const {
|
||||
// Running on worker_sequence_checker_.
|
||||
RTC_DCHECK_RUN_ON(&worker_sequence_checker_);
|
||||
const std::initializer_list<absl::optional<TimeDelta>> min_delays = {
|
||||
frame_minimum_playout_delay_, base_minimum_playout_delay_,
|
||||
syncable_minimum_playout_delay_};
|
||||
|
|
|
@ -373,8 +373,8 @@ void VideoSendStreamImpl::Stop() {
|
|||
StopVideoSendStream();
|
||||
}
|
||||
|
||||
// RTC_RUN_ON(rtp_transport_queue_)
|
||||
void VideoSendStreamImpl::StopVideoSendStream() {
|
||||
RTC_DCHECK_RUN_ON(rtp_transport_queue_);
|
||||
bitrate_allocator_->RemoveObserver(this);
|
||||
check_encoder_activity_task_.Stop();
|
||||
video_stream_encoder_->OnBitrateUpdated(DataRate::Zero(), DataRate::Zero(),
|
||||
|
|
Loading…
Reference in a new issue