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