Update thread annotiation macros to use RTC_ prefix

BUG=webrtc:8198

Review-Url: https://codereview.webrtc.org/3012853002
Cr-Commit-Position: refs/heads/master@{#19760}
This commit is contained in:
danilchap 2017-09-09 04:17:22 -07:00 committed by Commit Bot
parent e1d464ec7b
commit a37de39216
58 changed files with 445 additions and 429 deletions

View File

@ -335,7 +335,7 @@ class StatsReport {
private:
rtc::ThreadChecker thread_checker_;
mutable int ref_count_ ACCESS_ON(thread_checker_) = 0;
mutable int ref_count_ RTC_ACCESS_ON(thread_checker_) = 0;
const Type type_;
// TODO(tommi): Use C++ 11 union and make value_ const.

View File

@ -90,7 +90,7 @@ class AudioReceiveStream final : public webrtc::AudioReceiveStream,
rtc::scoped_refptr<webrtc::AudioState> audio_state_;
std::unique_ptr<voe::ChannelProxy> channel_proxy_;
bool playing_ ACCESS_ON(worker_thread_checker_) = false;
bool playing_ RTC_ACCESS_ON(worker_thread_checker_) = false;
std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_;

View File

@ -115,7 +115,7 @@ class AudioSendStream final : public webrtc::AudioSendStream,
rtc::CriticalSection packet_loss_tracker_cs_;
TransportFeedbackPacketLossTracker packet_loss_tracker_
GUARDED_BY(&packet_loss_tracker_cs_);
RTC_GUARDED_BY(&packet_loss_tracker_cs_);
RtpRtcp* rtp_rtcp_module_;
rtc::Optional<RtpState> const suspended_rtp_state_;

View File

@ -55,7 +55,7 @@ class AudioState final : public webrtc::AudioState,
// The critical section isn't strictly needed in this case, but xSAN bots may
// trigger on unprotected cross-thread access.
rtc::CriticalSection crit_sect_;
bool typing_noise_detected_ GUARDED_BY(crit_sect_) = false;
bool typing_noise_detected_ RTC_GUARDED_BY(crit_sect_) = false;
// Reference count; implementation copied from rtc::RefCountedObject.
mutable volatile int ref_count_ = 0;

View File

@ -153,20 +153,20 @@ class BitrateAllocator {
uint32_t sum_min_bitrates);
rtc::SequencedTaskChecker sequenced_checker_;
LimitObserver* const limit_observer_ GUARDED_BY(&sequenced_checker_);
LimitObserver* const limit_observer_ RTC_GUARDED_BY(&sequenced_checker_);
// Stored in a list to keep track of the insertion order.
ObserverConfigs bitrate_observer_configs_ GUARDED_BY(&sequenced_checker_);
uint32_t last_bitrate_bps_ GUARDED_BY(&sequenced_checker_);
uint32_t last_non_zero_bitrate_bps_ GUARDED_BY(&sequenced_checker_);
uint8_t last_fraction_loss_ GUARDED_BY(&sequenced_checker_);
int64_t last_rtt_ GUARDED_BY(&sequenced_checker_);
int64_t last_bwe_period_ms_ GUARDED_BY(&sequenced_checker_);
ObserverConfigs bitrate_observer_configs_ RTC_GUARDED_BY(&sequenced_checker_);
uint32_t last_bitrate_bps_ RTC_GUARDED_BY(&sequenced_checker_);
uint32_t last_non_zero_bitrate_bps_ RTC_GUARDED_BY(&sequenced_checker_);
uint8_t last_fraction_loss_ RTC_GUARDED_BY(&sequenced_checker_);
int64_t last_rtt_ RTC_GUARDED_BY(&sequenced_checker_);
int64_t last_bwe_period_ms_ RTC_GUARDED_BY(&sequenced_checker_);
// Number of mute events based on too low BWE, not network up/down.
int num_pause_events_ GUARDED_BY(&sequenced_checker_);
Clock* const clock_ GUARDED_BY(&sequenced_checker_);
int64_t last_bwe_log_time_ GUARDED_BY(&sequenced_checker_);
uint32_t total_requested_padding_bitrate_ GUARDED_BY(&sequenced_checker_);
uint32_t total_requested_min_bitrate_ GUARDED_BY(&sequenced_checker_);
int num_pause_events_ RTC_GUARDED_BY(&sequenced_checker_);
Clock* const clock_ RTC_GUARDED_BY(&sequenced_checker_);
int64_t last_bwe_log_time_ RTC_GUARDED_BY(&sequenced_checker_);
uint32_t total_requested_padding_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
uint32_t total_requested_min_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
};
} // namespace webrtc
#endif // WEBRTC_CALL_BITRATE_ALLOCATOR_H_

View File

@ -83,8 +83,8 @@ class LogObserver {
private:
typedef std::list<std::string> Strings;
rtc::CriticalSection crit_sect_;
Strings received_log_lines_ GUARDED_BY(crit_sect_);
Strings expected_log_lines_ GUARDED_BY(crit_sect_);
Strings received_log_lines_ RTC_GUARDED_BY(crit_sect_);
Strings expected_log_lines_ RTC_GUARDED_BY(crit_sect_);
rtc::Event done_;
};

View File

@ -236,11 +236,11 @@ class Call : public webrtc::Call,
size_t length,
const PacketTime& packet_time);
void ConfigureSync(const std::string& sync_group)
EXCLUSIVE_LOCKS_REQUIRED(receive_crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(receive_crit_);
void NotifyBweOfReceivedPacket(const RtpPacketReceived& packet,
MediaType media_type)
SHARED_LOCKS_REQUIRED(receive_crit_);
RTC_SHARED_LOCKS_REQUIRED(receive_crit_);
rtc::Optional<RtpPacketReceived> ParseRtpPacket(
const uint8_t* packet,
@ -248,7 +248,7 @@ class Call : public webrtc::Call,
const PacketTime* packet_time) const;
void UpdateSendHistograms(int64_t first_sent_packet_ms)
EXCLUSIVE_LOCKS_REQUIRED(&bitrate_crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(&bitrate_crit_);
void UpdateReceiveHistograms();
void UpdateHistograms();
void UpdateAggregateNetworkState();
@ -274,12 +274,12 @@ class Call : public webrtc::Call,
// Audio, Video, and FlexFEC receive streams are owned by the client that
// creates them.
std::set<AudioReceiveStream*> audio_receive_streams_
GUARDED_BY(receive_crit_);
RTC_GUARDED_BY(receive_crit_);
std::set<VideoReceiveStream*> video_receive_streams_
GUARDED_BY(receive_crit_);
RTC_GUARDED_BY(receive_crit_);
std::map<std::string, AudioReceiveStream*> sync_stream_mapping_
GUARDED_BY(receive_crit_);
RTC_GUARDED_BY(receive_crit_);
// TODO(nisse): Should eventually be injected at creation,
// with a single object in the bundled case.
@ -308,19 +308,21 @@ class Call : public webrtc::Call,
bool use_send_side_bwe = false;
};
std::map<uint32_t, ReceiveRtpConfig> receive_rtp_config_
GUARDED_BY(receive_crit_);
RTC_GUARDED_BY(receive_crit_);
std::unique_ptr<RWLockWrapper> send_crit_;
// Audio and Video send streams are owned by the client that creates them.
std::map<uint32_t, AudioSendStream*> audio_send_ssrcs_ GUARDED_BY(send_crit_);
std::map<uint32_t, VideoSendStream*> video_send_ssrcs_ GUARDED_BY(send_crit_);
std::set<VideoSendStream*> video_send_streams_ GUARDED_BY(send_crit_);
std::map<uint32_t, AudioSendStream*> audio_send_ssrcs_
RTC_GUARDED_BY(send_crit_);
std::map<uint32_t, VideoSendStream*> video_send_ssrcs_
RTC_GUARDED_BY(send_crit_);
std::set<VideoSendStream*> video_send_streams_ RTC_GUARDED_BY(send_crit_);
using RtpStateMap = std::map<uint32_t, RtpState>;
RtpStateMap suspended_audio_send_ssrcs_
GUARDED_BY(configuration_sequence_checker_);
RTC_GUARDED_BY(configuration_sequence_checker_);
RtpStateMap suspended_video_send_ssrcs_
GUARDED_BY(configuration_sequence_checker_);
RTC_GUARDED_BY(configuration_sequence_checker_);
webrtc::RtcEventLog* event_log_;
@ -340,10 +342,11 @@ class Call : public webrtc::Call,
// TODO(holmer): Remove this lock once BitrateController no longer calls
// OnNetworkChanged from multiple threads.
rtc::CriticalSection bitrate_crit_;
uint32_t min_allocated_send_bitrate_bps_ GUARDED_BY(&bitrate_crit_);
uint32_t configured_max_padding_bitrate_bps_ GUARDED_BY(&bitrate_crit_);
AvgCounter estimated_send_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_);
AvgCounter pacer_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_);
uint32_t min_allocated_send_bitrate_bps_ RTC_GUARDED_BY(&bitrate_crit_);
uint32_t configured_max_padding_bitrate_bps_ RTC_GUARDED_BY(&bitrate_crit_);
AvgCounter estimated_send_bitrate_kbps_counter_
RTC_GUARDED_BY(&bitrate_crit_);
AvgCounter pacer_bitrate_kbps_counter_ RTC_GUARDED_BY(&bitrate_crit_);
std::map<std::string, rtc::NetworkRoute> network_routes_;

View File

@ -131,7 +131,7 @@ class VideoRtcpAndSyncObserver : public test::RtpRtcpObserver,
const int64_t creation_time_ms_;
int64_t first_time_in_sync_;
rtc::CriticalSection crit_;
VideoReceiveStream* receive_stream_ GUARDED_BY(crit_);
VideoReceiveStream* receive_stream_ RTC_GUARDED_BY(crit_);
std::vector<int> sync_offset_ms_list_;
};
@ -463,7 +463,7 @@ void CallPerfTest::TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config,
bool rtp_start_timestamp_set_;
uint32_t rtp_start_timestamp_;
typedef std::map<uint32_t, uint32_t> FrameCaptureTimeList;
FrameCaptureTimeList capture_time_list_ GUARDED_BY(&crit_);
FrameCaptureTimeList capture_time_list_ RTC_GUARDED_BY(&crit_);
std::vector<int> time_offset_ms_list_;
} test(net_config, threshold_ms, start_time_ms, run_time_ms);

View File

@ -64,7 +64,7 @@ class RtpStreamReceiverController
// by a single, but possibly distinct, thread. But applications not
// using Call may have use threads differently.
rtc::CriticalSection lock_;
RtpDemuxer demuxer_ GUARDED_BY(&lock_);
RtpDemuxer demuxer_ RTC_GUARDED_BY(&lock_);
};
} // namespace webrtc

View File

@ -59,29 +59,30 @@ class BitrateAdjuster {
bool IsWithinTolerance(uint32_t bitrate_bps, uint32_t target_bitrate_bps);
// Returns smallest possible adjusted value.
uint32_t GetMinAdjustedBitrateBps() const EXCLUSIVE_LOCKS_REQUIRED(crit_);
uint32_t GetMinAdjustedBitrateBps() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Returns largest possible adjusted value.
uint32_t GetMaxAdjustedBitrateBps() const EXCLUSIVE_LOCKS_REQUIRED(crit_);
uint32_t GetMaxAdjustedBitrateBps() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
void Reset();
void UpdateBitrate(uint32_t current_time_ms) EXCLUSIVE_LOCKS_REQUIRED(crit_);
void UpdateBitrate(uint32_t current_time_ms)
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
rtc::CriticalSection crit_;
Clock* const clock_;
const float min_adjusted_bitrate_pct_;
const float max_adjusted_bitrate_pct_;
// The bitrate we want.
volatile uint32_t target_bitrate_bps_ GUARDED_BY(crit_);
volatile uint32_t target_bitrate_bps_ RTC_GUARDED_BY(crit_);
// The bitrate we use to get what we want.
volatile uint32_t adjusted_bitrate_bps_ GUARDED_BY(crit_);
volatile uint32_t adjusted_bitrate_bps_ RTC_GUARDED_BY(crit_);
// The target bitrate that the adjusted bitrate was computed from.
volatile uint32_t last_adjusted_target_bitrate_bps_ GUARDED_BY(crit_);
volatile uint32_t last_adjusted_target_bitrate_bps_ RTC_GUARDED_BY(crit_);
// Used to estimate bitrate.
RateStatistics bitrate_tracker_ GUARDED_BY(crit_);
RateStatistics bitrate_tracker_ RTC_GUARDED_BY(crit_);
// The last time we tried to adjust the bitrate.
uint32_t last_bitrate_update_time_ms_ GUARDED_BY(crit_);
uint32_t last_bitrate_update_time_ms_ RTC_GUARDED_BY(crit_);
// The number of frames since the last time we tried to adjust the bitrate.
uint32_t frames_since_last_update_ GUARDED_BY(crit_);
uint32_t frames_since_last_update_ RTC_GUARDED_BY(crit_);
};
} // namespace webrtc

View File

@ -168,15 +168,16 @@ class RtcEventLogImpl final : public RtcEventLog {
// History containing all past configuration events.
std::vector<std::unique_ptr<rtclog::Event>> config_history_
ACCESS_ON(task_queue_);
RTC_ACCESS_ON(task_queue_);
// History containing the most recent (non-configuration) events (~10s).
std::deque<std::unique_ptr<rtclog::Event>> history_ ACCESS_ON(task_queue_);
std::deque<std::unique_ptr<rtclog::Event>> history_
RTC_ACCESS_ON(task_queue_);
std::unique_ptr<FileWrapper> file_ ACCESS_ON(task_queue_);
std::unique_ptr<FileWrapper> file_ RTC_ACCESS_ON(task_queue_);
size_t max_size_bytes_ ACCESS_ON(task_queue_);
size_t written_bytes_ ACCESS_ON(task_queue_);
size_t max_size_bytes_ RTC_ACCESS_ON(task_queue_);
size_t written_bytes_ RTC_ACCESS_ON(task_queue_);
// Keep this last to ensure it destructs first, or else tasks living on the
// queue might access other members after they've been torn down.

View File

@ -74,7 +74,7 @@ class AdaptedVideoTrackSource
cricket::VideoAdapter video_adapter_;
rtc::CriticalSection stats_crit_;
rtc::Optional<Stats> stats_ GUARDED_BY(stats_crit_);
rtc::Optional<Stats> stats_ RTC_GUARDED_BY(stats_crit_);
VideoBroadcaster broadcaster_;
};

View File

@ -75,15 +75,17 @@ class VideoAdapter {
// Resolution must be divisible by this factor.
const int required_resolution_alignment_;
// The target timestamp for the next frame based on requested format.
rtc::Optional<int64_t> next_frame_timestamp_ns_ GUARDED_BY(critical_section_);
rtc::Optional<int64_t> next_frame_timestamp_ns_
RTC_GUARDED_BY(critical_section_);
// Max number of pixels requested via calls to OnOutputFormatRequest,
// OnResolutionRequest respectively.
// The adapted output format is the minimum of these.
rtc::Optional<VideoFormat> requested_format_ GUARDED_BY(critical_section_);
int resolution_request_target_pixel_count_ GUARDED_BY(critical_section_);
int resolution_request_max_pixel_count_ GUARDED_BY(critical_section_);
int max_framerate_request_ GUARDED_BY(critical_section_);
rtc::Optional<VideoFormat> requested_format_
RTC_GUARDED_BY(critical_section_);
int resolution_request_target_pixel_count_ RTC_GUARDED_BY(critical_section_);
int resolution_request_max_pixel_count_ RTC_GUARDED_BY(critical_section_);
int max_framerate_request_ RTC_GUARDED_BY(critical_section_);
// The critical section to protect the above variables.
rtc::CriticalSection critical_section_;

View File

@ -51,15 +51,15 @@ class VideoBroadcaster : public VideoSourceBase,
void OnFrame(const webrtc::VideoFrame& frame) override;
protected:
void UpdateWants() EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
void UpdateWants() RTC_EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& GetBlackFrameBuffer(
int width, int height)
EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
int width,
int height) RTC_EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
ThreadChecker thread_checker_;
rtc::CriticalSection sinks_and_wants_lock_;
VideoSinkWants current_wants_ GUARDED_BY(sinks_and_wants_lock_);
VideoSinkWants current_wants_ RTC_GUARDED_BY(sinks_and_wants_lock_);
rtc::scoped_refptr<webrtc::VideoFrameBuffer> black_frame_buffer_;
};

View File

@ -271,9 +271,9 @@ class VideoCapturer : public sigslot::has_slots<>,
rtc::CriticalSection frame_stats_crit_;
// The captured frame size before potential adapation.
bool input_size_valid_ GUARDED_BY(frame_stats_crit_) = false;
int input_width_ GUARDED_BY(frame_stats_crit_);
int input_height_ GUARDED_BY(frame_stats_crit_);
bool input_size_valid_ RTC_GUARDED_BY(frame_stats_crit_) = false;
int input_width_ RTC_GUARDED_BY(frame_stats_crit_);
int input_height_ RTC_GUARDED_BY(frame_stats_crit_);
// Whether capturer should apply rotation to the frame before
// passing it on to the registered sinks.

View File

@ -172,8 +172,8 @@ class FakeWebRtcVideoEncoder : public webrtc::VideoEncoder {
private:
rtc::CriticalSection crit_;
rtc::Event init_encode_event_;
int num_frames_encoded_ GUARDED_BY(crit_);
webrtc::VideoCodec codec_settings_ GUARDED_BY(crit_);
int num_frames_encoded_ RTC_GUARDED_BY(crit_);
webrtc::VideoCodec codec_settings_ RTC_GUARDED_BY(crit_);
};
// Fake class for mocking out WebRtcVideoEncoderFactory.
@ -250,8 +250,8 @@ class FakeWebRtcVideoEncoderFactory : public WebRtcVideoEncoderFactory {
rtc::CriticalSection crit_;
rtc::Event created_video_encoder_event_;
std::vector<cricket::VideoCodec> codecs_;
std::vector<FakeWebRtcVideoEncoder*> encoders_ GUARDED_BY(crit_);
int num_created_encoders_ GUARDED_BY(crit_);
std::vector<FakeWebRtcVideoEncoder*> encoders_ RTC_GUARDED_BY(crit_);
int num_created_encoders_ RTC_GUARDED_BY(crit_);
bool encoders_have_internal_sources_;
};

View File

@ -241,11 +241,11 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
webrtc::FlexfecReceiveStream::Config* flexfec_config,
const StreamParams& sp) const;
bool ValidateSendSsrcAvailability(const StreamParams& sp) const
EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const
EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
void DeleteReceiveStream(WebRtcVideoReceiveStream* stream)
EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
static std::string CodecSettingsVectorToString(
const std::vector<VideoCodecSettings>& codecs);
@ -326,38 +326,38 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
void UpdateSendState();
webrtc::VideoSendStream::DegradationPreference GetDegradationPreference()
const EXCLUSIVE_LOCKS_REQUIRED(&thread_checker_);
const RTC_EXCLUSIVE_LOCKS_REQUIRED(&thread_checker_);
rtc::ThreadChecker thread_checker_;
rtc::AsyncInvoker invoker_;
rtc::Thread* worker_thread_;
const std::vector<uint32_t> ssrcs_ ACCESS_ON(&thread_checker_);
const std::vector<SsrcGroup> ssrc_groups_ ACCESS_ON(&thread_checker_);
const std::vector<uint32_t> ssrcs_ RTC_ACCESS_ON(&thread_checker_);
const std::vector<SsrcGroup> ssrc_groups_ RTC_ACCESS_ON(&thread_checker_);
webrtc::Call* const call_;
const bool enable_cpu_overuse_detection_;
rtc::VideoSourceInterface<webrtc::VideoFrame>* source_
ACCESS_ON(&thread_checker_);
RTC_ACCESS_ON(&thread_checker_);
std::unique_ptr<EncoderFactoryAdapter> encoder_factory_
ACCESS_ON(&thread_checker_);
RTC_ACCESS_ON(&thread_checker_);
webrtc::VideoSendStream* stream_ ACCESS_ON(&thread_checker_);
webrtc::VideoSendStream* stream_ RTC_ACCESS_ON(&thread_checker_);
rtc::VideoSinkInterface<webrtc::VideoFrame>* encoder_sink_
ACCESS_ON(&thread_checker_);
RTC_ACCESS_ON(&thread_checker_);
// Contains settings that are the same for all streams in the MediaChannel,
// such as codecs, header extensions, and the global bitrate limit for the
// entire channel.
VideoSendStreamParameters parameters_ ACCESS_ON(&thread_checker_);
VideoSendStreamParameters parameters_ RTC_ACCESS_ON(&thread_checker_);
// Contains settings that are unique for each stream, such as max_bitrate.
// Does *not* contain codecs, however.
// TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_.
// TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only
// one stream per MediaChannel.
webrtc::RtpParameters rtp_parameters_ ACCESS_ON(&thread_checker_);
webrtc::RtpParameters rtp_parameters_ RTC_ACCESS_ON(&thread_checker_);
std::unique_ptr<webrtc::VideoEncoder> allocated_encoder_
ACCESS_ON(&thread_checker_);
VideoCodec allocated_codec_ ACCESS_ON(&thread_checker_);
RTC_ACCESS_ON(&thread_checker_);
VideoCodec allocated_codec_ RTC_ACCESS_ON(&thread_checker_);
bool sending_ ACCESS_ON(&thread_checker_);
bool sending_ RTC_ACCESS_ON(&thread_checker_);
};
// Wrapper for the receiver part, contains configs etc. that are needed to
@ -437,15 +437,16 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
std::vector<AllocatedDecoder> allocated_decoders_;
rtc::CriticalSection sink_lock_;
rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_ GUARDED_BY(sink_lock_);
rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_
RTC_GUARDED_BY(sink_lock_);
// Expands remote RTP timestamps to int64_t to be able to estimate how long
// the stream has been running.
rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_
GUARDED_BY(sink_lock_);
int64_t first_frame_timestamp_ GUARDED_BY(sink_lock_);
RTC_GUARDED_BY(sink_lock_);
int64_t first_frame_timestamp_ RTC_GUARDED_BY(sink_lock_);
// Start NTP time is estimated as current remote NTP time (estimated from
// RTCP) minus the elapsed time, as soon as remote NTP time is available.
int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(sink_lock_);
int64_t estimated_remote_start_ntp_time_ms_ RTC_GUARDED_BY(sink_lock_);
};
void Construct(webrtc::Call* call, WebRtcVideoEngine* engine);
@ -487,11 +488,11 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
rtc::CriticalSection stream_crit_;
// Using primary-ssrc (first ssrc) as key.
std::map<uint32_t, WebRtcVideoSendStream*> send_streams_
GUARDED_BY(stream_crit_);
RTC_GUARDED_BY(stream_crit_);
std::map<uint32_t, WebRtcVideoReceiveStream*> receive_streams_
GUARDED_BY(stream_crit_);
std::set<uint32_t> send_ssrcs_ GUARDED_BY(stream_crit_);
std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_);
RTC_GUARDED_BY(stream_crit_);
std::set<uint32_t> send_ssrcs_ RTC_GUARDED_BY(stream_crit_);
std::set<uint32_t> receive_ssrcs_ RTC_GUARDED_BY(stream_crit_);
rtc::Optional<VideoCodecSettings> send_codec_;
rtc::Optional<std::vector<webrtc::RtpExtension>> send_rtp_extensions_;

View File

@ -61,7 +61,7 @@ class MediaMonitorT : public MediaMonitor {
media_info_.Clear();
media_channel_->GetStats(&media_info_);
}
virtual void Update() EXCLUSIVE_LOCKS_REQUIRED(crit_) {
virtual void Update() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) {
MI stats(media_info_);
crit_.Leave();
SignalUpdate(media_channel_, stats);

View File

@ -55,7 +55,7 @@ class VideoTrack : public MediaStreamTrack<VideoTrackInterface>,
rtc::Thread* const worker_thread_;
rtc::ThreadChecker signaling_thread_checker_;
rtc::scoped_refptr<VideoTrackSourceInterface> video_source_;
ContentHint content_hint_ GUARDED_BY(signaling_thread_checker_);
ContentHint content_hint_ RTC_GUARDED_BY(signaling_thread_checker_);
};
} // namespace webrtc

View File

@ -236,7 +236,8 @@ class TaskQueue::Impl : public RefCountInterface {
TaskQueue* const queue_;
WorkerThread thread_;
rtc::CriticalSection pending_lock_;
std::queue<std::unique_ptr<QueuedTask>> pending_ GUARDED_BY(pending_lock_);
std::queue<std::unique_ptr<QueuedTask>> pending_
RTC_GUARDED_BY(pending_lock_);
HANDLE in_queue_;
};

View File

@ -49,10 +49,10 @@ class PacketSender {
private:
rtc::SequencedTaskChecker worker_queue_checker_;
size_t packet_size_ ACCESS_ON(worker_queue_checker_);
int64_t send_interval_ms_ ACCESS_ON(worker_queue_checker_);
int64_t sequence_number_ ACCESS_ON(worker_queue_checker_);
bool sending_ ACCESS_ON(worker_queue_checker_);
size_t packet_size_ RTC_ACCESS_ON(worker_queue_checker_);
int64_t send_interval_ms_ RTC_ACCESS_ON(worker_queue_checker_);
int64_t sequence_number_ RTC_ACCESS_ON(worker_queue_checker_);
bool sending_ RTC_ACCESS_ON(worker_queue_checker_);
const std::string config_file_path_;
TestController* const test_controller_;
rtc::TaskQueue worker_queue_;

View File

@ -67,7 +67,7 @@ class TestController : public sigslot::has_slots<> {
const std::string config_file_path_;
PacketLogger packet_logger_;
rtc::CriticalSection local_test_done_lock_;
bool local_test_done_ GUARDED_BY(local_test_done_lock_);
bool local_test_done_ RTC_GUARDED_BY(local_test_done_lock_);
bool remote_test_done_;
std::array<char, kEthernetMtu> send_data_;
std::unique_ptr<cricket::UdpTransport> udp_transport_;

View File

@ -19,45 +19,41 @@
namespace webrtc {
class LOCKABLE RWLockWrapper {
class RTC_LOCKABLE RWLockWrapper {
public:
static RWLockWrapper* CreateRWLock();
virtual ~RWLockWrapper() {}
virtual void AcquireLockExclusive() EXCLUSIVE_LOCK_FUNCTION() = 0;
virtual void ReleaseLockExclusive() UNLOCK_FUNCTION() = 0;
virtual void AcquireLockExclusive() RTC_EXCLUSIVE_LOCK_FUNCTION() = 0;
virtual void ReleaseLockExclusive() RTC_UNLOCK_FUNCTION() = 0;
virtual void AcquireLockShared() SHARED_LOCK_FUNCTION() = 0;
virtual void ReleaseLockShared() UNLOCK_FUNCTION() = 0;
virtual void AcquireLockShared() RTC_SHARED_LOCK_FUNCTION() = 0;
virtual void ReleaseLockShared() RTC_UNLOCK_FUNCTION() = 0;
};
// RAII extensions of the RW lock. Prevents Acquire/Release missmatches and
// provides more compact locking syntax.
class SCOPED_LOCKABLE ReadLockScoped {
class RTC_SCOPED_LOCKABLE ReadLockScoped {
public:
ReadLockScoped(RWLockWrapper& rw_lock) SHARED_LOCK_FUNCTION(rw_lock)
ReadLockScoped(RWLockWrapper& rw_lock) RTC_SHARED_LOCK_FUNCTION(rw_lock)
: rw_lock_(rw_lock) {
rw_lock_.AcquireLockShared();
}
~ReadLockScoped() UNLOCK_FUNCTION() {
rw_lock_.ReleaseLockShared();
}
~ReadLockScoped() RTC_UNLOCK_FUNCTION() { rw_lock_.ReleaseLockShared(); }
private:
RWLockWrapper& rw_lock_;
};
class SCOPED_LOCKABLE WriteLockScoped {
class RTC_SCOPED_LOCKABLE WriteLockScoped {
public:
WriteLockScoped(RWLockWrapper& rw_lock) EXCLUSIVE_LOCK_FUNCTION(rw_lock)
WriteLockScoped(RWLockWrapper& rw_lock) RTC_EXCLUSIVE_LOCK_FUNCTION(rw_lock)
: rw_lock_(rw_lock) {
rw_lock_.AcquireLockExclusive();
}
~WriteLockScoped() UNLOCK_FUNCTION() {
rw_lock_.ReleaseLockExclusive();
}
~WriteLockScoped() RTC_UNLOCK_FUNCTION() { rw_lock_.ReleaseLockExclusive(); }
private:
RWLockWrapper& rw_lock_;

View File

@ -93,7 +93,7 @@ class RtcHistogram {
rtc::CriticalSection crit_;
const int min_;
const int max_;
SampleInfo info_ GUARDED_BY(crit_);
SampleInfo info_ RTC_GUARDED_BY(crit_);
RTC_DISALLOW_COPY_AND_ASSIGN(RtcHistogram);
};
@ -165,7 +165,8 @@ class RtcHistogramMap {
private:
rtc::CriticalSection crit_;
std::map<std::string, std::unique_ptr<RtcHistogram>> map_ GUARDED_BY(crit_);
std::map<std::string, std::unique_ptr<RtcHistogram>> map_
RTC_GUARDED_BY(crit_);
RTC_DISALLOW_COPY_AND_ASSIGN(RtcHistogramMap);
};

View File

@ -81,7 +81,7 @@ class TraceImpl : public Trace {
bool UpdateFileName(
char file_name_with_counter_utf8[FileWrapper::kMaxFileNameSize],
const uint32_t new_count) const EXCLUSIVE_LOCKS_REQUIRED(crit_);
const uint32_t new_count) const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
bool CreateFileName(
const char file_name_utf8[FileWrapper::kMaxFileNameSize],
@ -89,14 +89,14 @@ class TraceImpl : public Trace {
const uint32_t new_count) const;
void WriteToFile(const char* msg, uint16_t length)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
TraceCallback* callback_ GUARDED_BY(crit_);
uint32_t row_count_text_ GUARDED_BY(crit_);
uint32_t file_count_text_ GUARDED_BY(crit_);
TraceCallback* callback_ RTC_GUARDED_BY(crit_);
uint32_t row_count_text_ RTC_GUARDED_BY(crit_);
uint32_t file_count_text_ RTC_GUARDED_BY(crit_);
const std::unique_ptr<FileWrapper> trace_file_ GUARDED_BY(crit_);
std::string trace_file_path_ GUARDED_BY(crit_);
const std::unique_ptr<FileWrapper> trace_file_ RTC_GUARDED_BY(crit_);
std::string trace_file_path_ RTC_GUARDED_BY(crit_);
rtc::CriticalSection crit_;
};

View File

@ -70,7 +70,7 @@ class DirectTransport : public Transport {
SingleThreadedTaskQueueForTesting* const task_queue_;
SingleThreadedTaskQueueForTesting::TaskId next_scheduled_task_
GUARDED_BY(&sequence_checker_);
RTC_GUARDED_BY(&sequence_checker_);
FakeNetworkPipe fake_network_;

View File

@ -121,19 +121,19 @@ class FakeAudioDevice : public FakeAudioDeviceModule {
static bool Run(void* obj);
void ProcessAudio();
const std::unique_ptr<Capturer> capturer_ GUARDED_BY(lock_);
const std::unique_ptr<Renderer> renderer_ GUARDED_BY(lock_);
const std::unique_ptr<Capturer> capturer_ RTC_GUARDED_BY(lock_);
const std::unique_ptr<Renderer> renderer_ RTC_GUARDED_BY(lock_);
const float speed_;
rtc::CriticalSection lock_;
AudioTransport* audio_callback_ GUARDED_BY(lock_);
bool rendering_ GUARDED_BY(lock_);
bool capturing_ GUARDED_BY(lock_);
AudioTransport* audio_callback_ RTC_GUARDED_BY(lock_);
bool rendering_ RTC_GUARDED_BY(lock_);
bool capturing_ RTC_GUARDED_BY(lock_);
rtc::Event done_rendering_;
rtc::Event done_capturing_;
std::vector<int16_t> playout_buffer_ GUARDED_BY(lock_);
rtc::BufferT<int16_t> recording_buffer_ GUARDED_BY(lock_);
std::vector<int16_t> playout_buffer_ RTC_GUARDED_BY(lock_);
rtc::BufferT<int16_t> recording_buffer_ RTC_GUARDED_BY(lock_);
std::unique_ptr<EventTimerWrapper> tick_;
rtc::PlatformThread thread_;

View File

@ -51,12 +51,12 @@ class FakeEncoder : public VideoEncoder {
protected:
Clock* const clock_;
VideoCodec config_ GUARDED_BY(crit_sect_);
EncodedImageCallback* callback_ GUARDED_BY(crit_sect_);
BitrateAllocation target_bitrate_ GUARDED_BY(crit_sect_);
int configured_input_framerate_ GUARDED_BY(crit_sect_);
int max_target_bitrate_kbps_ GUARDED_BY(crit_sect_);
bool pending_keyframe_ GUARDED_BY(crit_sect_);
VideoCodec config_ RTC_GUARDED_BY(crit_sect_);
EncodedImageCallback* callback_ RTC_GUARDED_BY(crit_sect_);
BitrateAllocation target_bitrate_ RTC_GUARDED_BY(crit_sect_);
int configured_input_framerate_ RTC_GUARDED_BY(crit_sect_);
int max_target_bitrate_kbps_ RTC_GUARDED_BY(crit_sect_);
bool pending_keyframe_ RTC_GUARDED_BY(crit_sect_);
rtc::CriticalSection crit_sect_;
uint8_t encoded_buffer_[100000];
@ -79,8 +79,8 @@ class FakeH264Encoder : public FakeEncoder, public EncodedImageCallback {
const RTPFragmentationHeader* fragments) override;
private:
EncodedImageCallback* callback_ GUARDED_BY(local_crit_sect_);
int idr_counter_ GUARDED_BY(local_crit_sect_);
EncodedImageCallback* callback_ RTC_GUARDED_BY(local_crit_sect_);
int idr_counter_ RTC_GUARDED_BY(local_crit_sect_);
rtc::CriticalSection local_crit_sect_;
};
@ -95,7 +95,7 @@ class DelayedEncoder : public test::FakeEncoder {
const std::vector<FrameType>* frame_types) override;
private:
int delay_ms_ ACCESS_ON(sequence_checker_);
int delay_ms_ RTC_ACCESS_ON(sequence_checker_);
rtc::SequencedTaskChecker sequence_checker_;
};
@ -125,9 +125,9 @@ class MultithreadedFakeH264Encoder : public test::FakeH264Encoder {
protected:
class EncodeTask;
int current_queue_ ACCESS_ON(sequence_checker_);
std::unique_ptr<rtc::TaskQueue> queue1_ ACCESS_ON(sequence_checker_);
std::unique_ptr<rtc::TaskQueue> queue2_ ACCESS_ON(sequence_checker_);
int current_queue_ RTC_ACCESS_ON(sequence_checker_);
std::unique_ptr<rtc::TaskQueue> queue1_ RTC_ACCESS_ON(sequence_checker_);
std::unique_ptr<rtc::TaskQueue> queue2_ RTC_ACCESS_ON(sequence_checker_);
rtc::SequencedTaskChecker sequence_checker_;
};

View File

@ -108,10 +108,10 @@ class SquareGenerator : public FrameGenerator {
};
rtc::CriticalSection crit_;
int width_ GUARDED_BY(&crit_);
int height_ GUARDED_BY(&crit_);
std::vector<std::unique_ptr<Square>> squares_ GUARDED_BY(&crit_);
std::unique_ptr<VideoFrame> frame_ GUARDED_BY(&crit_);
int width_ RTC_GUARDED_BY(&crit_);
int height_ RTC_GUARDED_BY(&crit_);
std::vector<std::unique_ptr<Square>> squares_ RTC_GUARDED_BY(&crit_);
std::unique_ptr<VideoFrame> frame_ RTC_GUARDED_BY(&crit_);
};
class YuvFileGenerator : public FrameGenerator {

View File

@ -42,8 +42,8 @@ class FrameForwarder : public rtc::VideoSourceInterface<VideoFrame> {
void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override;
rtc::CriticalSection crit_;
rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_);
rtc::VideoSinkWants sink_wants_ GUARDED_BY(crit_);
rtc::VideoSinkInterface<VideoFrame>* sink_ RTC_GUARDED_BY(crit_);
rtc::VideoSinkWants sink_wants_ RTC_GUARDED_BY(crit_);
};
class FrameGenerator {

View File

@ -87,14 +87,14 @@ class FrameGeneratorCapturer : public VideoCapturer {
Clock* const clock_;
bool sending_;
rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(&lock_);
SinkWantsObserver* sink_wants_observer_ GUARDED_BY(&lock_);
rtc::VideoSinkInterface<VideoFrame>* sink_ RTC_GUARDED_BY(&lock_);
SinkWantsObserver* sink_wants_observer_ RTC_GUARDED_BY(&lock_);
rtc::CriticalSection lock_;
std::unique_ptr<FrameGenerator> frame_generator_;
int target_fps_ GUARDED_BY(&lock_);
rtc::Optional<int> wanted_fps_ GUARDED_BY(&lock_);
int target_fps_ RTC_GUARDED_BY(&lock_);
rtc::Optional<int> wanted_fps_ RTC_GUARDED_BY(&lock_);
VideoRotation fake_rotation_ = kVideoRotation_0;
int64_t first_frame_capture_time_;

View File

@ -71,10 +71,10 @@ class SingleThreadedTaskQueueForTesting {
void RunLoop();
rtc::CriticalSection cs_;
std::list<std::unique_ptr<QueuedTask>> tasks_ GUARDED_BY(cs_);
std::list<std::unique_ptr<QueuedTask>> tasks_ RTC_GUARDED_BY(cs_);
rtc::ThreadChecker owner_thread_checker_;
rtc::PlatformThread thread_;
bool running_ GUARDED_BY(cs_);
bool running_ RTC_GUARDED_BY(cs_);
TaskId next_task_id_;

View File

@ -49,8 +49,8 @@ class VcmCapturer
void Destroy();
rtc::CriticalSection crit_;
bool started_ GUARDED_BY(crit_);
rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_);
bool started_ RTC_GUARDED_BY(crit_);
rtc::VideoSinkInterface<VideoFrame>* sink_ RTC_GUARDED_BY(crit_);
rtc::scoped_refptr<VideoCaptureModule> vcm_;
VideoCaptureCapability capability_;
};

View File

@ -70,9 +70,9 @@ class CallStats : public Module {
// The last RTT in the statistics update (zero if there is no valid estimate).
int64_t max_rtt_ms_;
int64_t avg_rtt_ms_;
int64_t sum_avg_rtt_ms_ GUARDED_BY(crit_);
int64_t num_avg_rtt_ GUARDED_BY(crit_);
int64_t time_of_first_rtt_ms_ GUARDED_BY(crit_);
int64_t sum_avg_rtt_ms_ RTC_GUARDED_BY(crit_);
int64_t num_avg_rtt_ RTC_GUARDED_BY(crit_);
int64_t time_of_first_rtt_ms_ RTC_GUARDED_BY(crit_);
// All Rtt reports within valid time interval, oldest first.
std::list<RttTime> reports_;

View File

@ -37,7 +37,7 @@ class EncoderRtcpFeedback : public RtcpIntraFrameObserver {
VideoStreamEncoder* const video_stream_encoder_;
rtc::CriticalSection crit_;
std::vector<int64_t> time_last_intra_request_ms_ GUARDED_BY(crit_);
std::vector<int64_t> time_last_intra_request_ms_ RTC_GUARDED_BY(crit_);
};
} // namespace webrtc

View File

@ -540,7 +540,7 @@ TEST_F(EndToEndTest, ReceivesAndRetransmitsNack) {
std::set<uint16_t> retransmitted_packets_;
uint64_t sent_rtp_packets_;
int packets_left_to_drop_;
int nacks_left_ GUARDED_BY(&crit_);
int nacks_left_ RTC_GUARDED_BY(&crit_);
} test;
RunBaseTest(&test);
@ -710,11 +710,11 @@ TEST_F(EndToEndTest, ReceivesUlpfec) {
rtc::CriticalSection crit_;
std::unique_ptr<VideoEncoder> encoder_;
std::unique_ptr<VideoDecoder> decoder_;
std::set<uint32_t> dropped_sequence_numbers_ GUARDED_BY(crit_);
std::set<uint32_t> dropped_sequence_numbers_ RTC_GUARDED_BY(crit_);
// Several packets can have the same timestamp.
std::multiset<uint32_t> dropped_timestamps_ GUARDED_BY(crit_);
std::multiset<uint32_t> dropped_timestamps_ RTC_GUARDED_BY(crit_);
Random random_;
int num_packets_sent_ GUARDED_BY(crit_);
int num_packets_sent_ RTC_GUARDED_BY(crit_);
} test;
RunBaseTest(&test);
@ -887,12 +887,12 @@ class FlexfecRenderObserver : public test::EndToEndTest,
}
rtc::CriticalSection crit_;
std::set<uint32_t> dropped_sequence_numbers_ GUARDED_BY(crit_);
std::set<uint32_t> dropped_sequence_numbers_ RTC_GUARDED_BY(crit_);
// Several packets can have the same timestamp.
std::multiset<uint32_t> dropped_timestamps_ GUARDED_BY(crit_);
std::multiset<uint32_t> dropped_timestamps_ RTC_GUARDED_BY(crit_);
const bool enable_nack_;
const bool expect_flexfec_rtcp_;
bool received_flexfec_rtcp_ GUARDED_BY(crit_);
bool received_flexfec_rtcp_ RTC_GUARDED_BY(crit_);
Random random_;
int num_packets_sent_;
};
@ -1069,7 +1069,7 @@ TEST_F(EndToEndTest, ReceivedUlpfecPacketsNotNacked) {
} state_;
rtc::CriticalSection crit_;
uint16_t ulpfec_sequence_number_ GUARDED_BY(&crit_);
uint16_t ulpfec_sequence_number_ RTC_GUARDED_BY(&crit_);
bool has_last_sequence_number_;
uint16_t last_sequence_number_;
std::unique_ptr<webrtc::VideoEncoder> encoder_;
@ -1224,8 +1224,8 @@ void EndToEndTest::DecodesRetransmittedFrame(bool enable_rtx, bool enable_red) {
std::unique_ptr<VideoEncoder> encoder_;
const std::string payload_name_;
int marker_bits_observed_;
uint32_t retransmitted_timestamp_ GUARDED_BY(&crit_);
std::vector<uint32_t> rendered_timestamps_ GUARDED_BY(&crit_);
uint32_t retransmitted_timestamp_ RTC_GUARDED_BY(&crit_);
std::vector<uint32_t> rendered_timestamps_ RTC_GUARDED_BY(&crit_);
} test(enable_rtx, enable_red);
RunBaseTest(&test);
@ -1319,9 +1319,9 @@ void EndToEndTest::ReceivesPliAndRecovers(int rtp_history_ms) {
rtc::CriticalSection crit_;
int rtp_history_ms_;
bool nack_enabled_;
uint32_t highest_dropped_timestamp_ GUARDED_BY(&crit_);
int frames_to_drop_ GUARDED_BY(&crit_);
bool received_pli_ GUARDED_BY(&crit_);
uint32_t highest_dropped_timestamp_ RTC_GUARDED_BY(&crit_);
int frames_to_drop_ RTC_GUARDED_BY(&crit_);
bool received_pli_ RTC_GUARDED_BY(&crit_);
} test(rtp_history_ms);
RunBaseTest(&test);
@ -1479,8 +1479,8 @@ void EndToEndTest::RespectsRtcpMode(RtcpMode rtcp_mode) {
rtc::CriticalSection crit_;
// Must be protected since RTCP can be sent by both the process thread
// and the pacer thread.
int sent_rtp_ GUARDED_BY(&crit_);
int sent_rtcp_ GUARDED_BY(&crit_);
int sent_rtp_ RTC_GUARDED_BY(&crit_);
int sent_rtcp_ RTC_GUARDED_BY(&crit_);
} test(rtcp_mode);
RunBaseTest(&test);
@ -2075,8 +2075,8 @@ TEST_F(EndToEndTest, StopsSendingMediaWithoutFeedback) {
const size_t num_video_streams_;
const size_t num_audio_streams_;
rtc::CriticalSection crit_;
int media_sent_ GUARDED_BY(crit_);
int padding_sent_ GUARDED_BY(crit_);
int media_sent_ RTC_GUARDED_BY(crit_);
int padding_sent_ RTC_GUARDED_BY(crit_);
} test(1, 0);
RunBaseTest(&test);
}
@ -2623,7 +2623,7 @@ TEST_F(EndToEndTest, VerifyNackStats) {
return SEND_PACKET;
}
void VerifyStats() EXCLUSIVE_LOCKS_REQUIRED(&crit_) {
void VerifyStats() RTC_EXCLUSIVE_LOCKS_REQUIRED(&crit_) {
if (!dropped_rtp_packet_requested_)
return;
int send_stream_nack_packets = 0;
@ -2680,8 +2680,8 @@ TEST_F(EndToEndTest, VerifyNackStats) {
test::FakeVideoRenderer fake_renderer_;
rtc::CriticalSection crit_;
uint64_t sent_rtp_packets_;
uint16_t dropped_rtp_packet_ GUARDED_BY(&crit_);
bool dropped_rtp_packet_requested_ GUARDED_BY(&crit_);
uint16_t dropped_rtp_packet_ RTC_GUARDED_BY(&crit_);
bool dropped_rtp_packet_requested_ RTC_GUARDED_BY(&crit_);
std::vector<VideoReceiveStream*> receive_streams_;
VideoSendStream* send_stream_;
int64_t start_runtime_ms_;
@ -2803,7 +2803,7 @@ void EndToEndTest::VerifyHistogramStats(bool use_rtx,
Call* sender_call_;
Call* receiver_call_;
int64_t start_runtime_ms_;
int num_frames_received_ GUARDED_BY(&crit_);
int num_frames_received_ RTC_GUARDED_BY(&crit_);
} test(use_rtx, use_red, screenshare);
metrics::Reset();
@ -2973,7 +2973,7 @@ TEST_F(EndToEndTest, MAYBE_ContentTypeSwitches) {
}
rtc::CriticalSection crit_;
int num_frames_received_ GUARDED_BY(&crit_);
int num_frames_received_ RTC_GUARDED_BY(&crit_);
} test;
metrics::Reset();
@ -3277,7 +3277,7 @@ TEST_F(EndToEndTest, ReportsSetEncoderRates) {
test::SingleThreadedTaskQueueForTesting* const task_queue_;
rtc::CriticalSection crit_;
VideoSendStream* send_stream_;
uint32_t bitrate_kbps_ GUARDED_BY(crit_);
uint32_t bitrate_kbps_ RTC_GUARDED_BY(crit_);
} test(&task_queue_);
RunBaseTest(&test);
@ -3762,9 +3762,9 @@ class RtcpXrObserver : public test::EndToEndTest {
const bool enable_rrtr_;
const bool enable_target_bitrate_;
int sent_rtcp_sr_;
int sent_rtcp_rr_ GUARDED_BY(&crit_);
int sent_rtcp_rrtr_ GUARDED_BY(&crit_);
bool sent_rtcp_target_bitrate_ GUARDED_BY(&crit_);
int sent_rtcp_rr_ RTC_GUARDED_BY(&crit_);
int sent_rtcp_rrtr_ RTC_GUARDED_BY(&crit_);
bool sent_rtcp_target_bitrate_ RTC_GUARDED_BY(&crit_);
int sent_rtcp_dlrr_;
};
@ -3994,7 +3994,7 @@ void EndToEndTest::TestRtpStatePreservation(bool use_rtx,
void ValidateTimestampGap(uint32_t ssrc,
uint32_t timestamp,
bool only_padding)
EXCLUSIVE_LOCKS_REQUIRED(crit_) {
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) {
static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90;
auto timestamp_it = last_observed_timestamp_.find(ssrc);
if (timestamp_it == last_observed_timestamp_.end()) {
@ -4083,8 +4083,8 @@ void EndToEndTest::TestRtpStatePreservation(bool use_rtx,
std::map<uint32_t, bool> ssrc_is_rtx_;
rtc::CriticalSection crit_;
size_t ssrcs_to_observe_ GUARDED_BY(crit_);
std::map<uint32_t, bool> ssrc_observed_ GUARDED_BY(crit_);
size_t ssrcs_to_observe_ RTC_GUARDED_BY(crit_);
std::map<uint32_t, bool> ssrc_observed_ RTC_GUARDED_BY(crit_);
} observer(use_rtx);
std::unique_ptr<test::PacketTransport> send_transport;
@ -4276,9 +4276,10 @@ TEST_F(EndToEndTest, MAYBE_TestFlexfecRtpStatePreservation) {
return SEND_PACKET;
}
rtc::Optional<uint16_t> last_observed_sequence_number_ GUARDED_BY(crit_);
rtc::Optional<uint32_t> last_observed_timestamp_ GUARDED_BY(crit_);
size_t num_flexfec_packets_sent_ GUARDED_BY(crit_);
rtc::Optional<uint16_t> last_observed_sequence_number_
RTC_GUARDED_BY(crit_);
rtc::Optional<uint32_t> last_observed_timestamp_ RTC_GUARDED_BY(crit_);
size_t num_flexfec_packets_sent_ RTC_GUARDED_BY(crit_);
rtc::CriticalSection crit_;
} observer;
@ -4595,12 +4596,12 @@ TEST_F(EndToEndTest, RespectsNetworkState) {
rtc::Event packet_event_;
Call* sender_call_;
Call* receiver_call_;
NetworkState sender_state_ GUARDED_BY(test_crit_);
int sender_rtp_ GUARDED_BY(test_crit_);
int sender_padding_ GUARDED_BY(test_crit_);
int sender_rtcp_ GUARDED_BY(test_crit_);
int receiver_rtcp_ GUARDED_BY(test_crit_);
int down_frames_ GUARDED_BY(test_crit_);
NetworkState sender_state_ RTC_GUARDED_BY(test_crit_);
int sender_rtp_ RTC_GUARDED_BY(test_crit_);
int sender_padding_ RTC_GUARDED_BY(test_crit_);
int sender_rtcp_ RTC_GUARDED_BY(test_crit_);
int receiver_rtcp_ RTC_GUARDED_BY(test_crit_);
int down_frames_ RTC_GUARDED_BY(test_crit_);
} test(&task_queue_);
RunBaseTest(&test);
@ -5016,7 +5017,7 @@ TEST_F(EndToEndLogTest, LogsEncodedFramesWhenRequested) {
std::unique_ptr<VideoEncoder> encoder_;
std::unique_ptr<VideoDecoder> decoder_;
rtc::CriticalSection crit_;
int recorded_frames_ GUARDED_BY(crit_);
int recorded_frames_ RTC_GUARDED_BY(crit_);
} test(this);
RunBaseTest(&test);

View File

@ -133,27 +133,28 @@ class OveruseFrameDetector {
// Stats metrics.
CpuOveruseMetricsObserver* const metrics_observer_;
rtc::Optional<CpuOveruseMetrics> metrics_ GUARDED_BY(task_checker_);
rtc::Optional<CpuOveruseMetrics> metrics_ RTC_GUARDED_BY(task_checker_);
int64_t num_process_times_ GUARDED_BY(task_checker_);
int64_t num_process_times_ RTC_GUARDED_BY(task_checker_);
int64_t last_capture_time_us_ GUARDED_BY(task_checker_);
int64_t last_processed_capture_time_us_ GUARDED_BY(task_checker_);
int64_t last_capture_time_us_ RTC_GUARDED_BY(task_checker_);
int64_t last_processed_capture_time_us_ RTC_GUARDED_BY(task_checker_);
// Number of pixels of last captured frame.
int num_pixels_ GUARDED_BY(task_checker_);
int max_framerate_ GUARDED_BY(task_checker_);
int64_t last_overuse_time_ms_ GUARDED_BY(task_checker_);
int checks_above_threshold_ GUARDED_BY(task_checker_);
int num_overuse_detections_ GUARDED_BY(task_checker_);
int64_t last_rampup_time_ms_ GUARDED_BY(task_checker_);
bool in_quick_rampup_ GUARDED_BY(task_checker_);
int current_rampup_delay_ms_ GUARDED_BY(task_checker_);
int num_pixels_ RTC_GUARDED_BY(task_checker_);
int max_framerate_ RTC_GUARDED_BY(task_checker_);
int64_t last_overuse_time_ms_ RTC_GUARDED_BY(task_checker_);
int checks_above_threshold_ RTC_GUARDED_BY(task_checker_);
int num_overuse_detections_ RTC_GUARDED_BY(task_checker_);
int64_t last_rampup_time_ms_ RTC_GUARDED_BY(task_checker_);
bool in_quick_rampup_ RTC_GUARDED_BY(task_checker_);
int current_rampup_delay_ms_ RTC_GUARDED_BY(task_checker_);
// TODO(asapersson): Can these be regular members (avoid separate heap
// allocs)?
const std::unique_ptr<SendProcessingUsage> usage_ GUARDED_BY(task_checker_);
std::list<FrameTiming> frame_timing_ GUARDED_BY(task_checker_);
const std::unique_ptr<SendProcessingUsage> usage_
RTC_GUARDED_BY(task_checker_);
std::list<FrameTiming> frame_timing_ RTC_GUARDED_BY(task_checker_);
RTC_DISALLOW_COPY_AND_ASSIGN(OveruseFrameDetector);
};

View File

@ -49,10 +49,10 @@ class PayloadRouter : public EncodedImageCallback {
void OnBitrateAllocationUpdated(const BitrateAllocation& bitrate);
private:
void UpdateModuleSendingState() EXCLUSIVE_LOCKS_REQUIRED(crit_);
void UpdateModuleSendingState() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
rtc::CriticalSection crit_;
bool active_ GUARDED_BY(crit_);
bool active_ RTC_GUARDED_BY(crit_);
// Rtp modules are assumed to be sorted in simulcast index order. Not owned.
const std::vector<RtpRtcp*> rtp_modules_;

View File

@ -124,12 +124,12 @@ class PictureIdObserver : public test::RtpRtcpObserver {
}
rtc::CriticalSection crit_;
std::map<uint32_t, uint32_t> last_observed_timestamp_ GUARDED_BY(crit_);
std::map<uint32_t, uint16_t> last_observed_picture_id_ GUARDED_BY(crit_);
std::map<uint32_t, size_t> num_packets_sent_ GUARDED_BY(crit_);
int max_expected_picture_id_gap_ GUARDED_BY(crit_);
size_t num_ssrcs_to_observe_ GUARDED_BY(crit_);
std::set<uint32_t> observed_ssrcs_ GUARDED_BY(crit_);
std::map<uint32_t, uint32_t> last_observed_timestamp_ RTC_GUARDED_BY(crit_);
std::map<uint32_t, uint16_t> last_observed_picture_id_ RTC_GUARDED_BY(crit_);
std::map<uint32_t, size_t> num_packets_sent_ RTC_GUARDED_BY(crit_);
int max_expected_picture_id_gap_ RTC_GUARDED_BY(crit_);
size_t num_ssrcs_to_observe_ RTC_GUARDED_BY(crit_);
std::set<uint32_t> observed_ssrcs_ RTC_GUARDED_BY(crit_);
};
class PictureIdTest : public test::CallTest {

View File

@ -126,12 +126,13 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
FrameCounts frame_counts;
};
void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_);
void UpdateHistograms() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
void QualitySample() EXCLUSIVE_LOCKS_REQUIRED(crit_);
void QualitySample() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Removes info about old frames and then updates the framerate.
void UpdateFramerate(int64_t now_ms) const EXCLUSIVE_LOCKS_REQUIRED(crit_);
void UpdateFramerate(int64_t now_ms) const
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
Clock* const clock_;
// Ownership of this object lies with the owner of the ReceiveStatisticsProxy
@ -145,42 +146,42 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
const int64_t start_ms_;
rtc::CriticalSection crit_;
int64_t last_sample_time_ GUARDED_BY(crit_);
QualityThreshold fps_threshold_ GUARDED_BY(crit_);
QualityThreshold qp_threshold_ GUARDED_BY(crit_);
QualityThreshold variance_threshold_ GUARDED_BY(crit_);
SampleCounter qp_sample_ GUARDED_BY(crit_);
int num_bad_states_ GUARDED_BY(crit_);
int num_certain_states_ GUARDED_BY(crit_);
mutable VideoReceiveStream::Stats stats_ GUARDED_BY(crit_);
RateStatistics decode_fps_estimator_ GUARDED_BY(crit_);
RateStatistics renders_fps_estimator_ GUARDED_BY(crit_);
rtc::RateTracker render_fps_tracker_ GUARDED_BY(crit_);
rtc::RateTracker render_pixel_tracker_ GUARDED_BY(crit_);
rtc::RateTracker total_byte_tracker_ GUARDED_BY(crit_);
SampleCounter sync_offset_counter_ GUARDED_BY(crit_);
SampleCounter decode_time_counter_ GUARDED_BY(crit_);
SampleCounter jitter_buffer_delay_counter_ GUARDED_BY(crit_);
SampleCounter target_delay_counter_ GUARDED_BY(crit_);
SampleCounter current_delay_counter_ GUARDED_BY(crit_);
SampleCounter delay_counter_ GUARDED_BY(crit_);
int64_t last_sample_time_ RTC_GUARDED_BY(crit_);
QualityThreshold fps_threshold_ RTC_GUARDED_BY(crit_);
QualityThreshold qp_threshold_ RTC_GUARDED_BY(crit_);
QualityThreshold variance_threshold_ RTC_GUARDED_BY(crit_);
SampleCounter qp_sample_ RTC_GUARDED_BY(crit_);
int num_bad_states_ RTC_GUARDED_BY(crit_);
int num_certain_states_ RTC_GUARDED_BY(crit_);
mutable VideoReceiveStream::Stats stats_ RTC_GUARDED_BY(crit_);
RateStatistics decode_fps_estimator_ RTC_GUARDED_BY(crit_);
RateStatistics renders_fps_estimator_ RTC_GUARDED_BY(crit_);
rtc::RateTracker render_fps_tracker_ RTC_GUARDED_BY(crit_);
rtc::RateTracker render_pixel_tracker_ RTC_GUARDED_BY(crit_);
rtc::RateTracker total_byte_tracker_ RTC_GUARDED_BY(crit_);
SampleCounter sync_offset_counter_ RTC_GUARDED_BY(crit_);
SampleCounter decode_time_counter_ RTC_GUARDED_BY(crit_);
SampleCounter jitter_buffer_delay_counter_ RTC_GUARDED_BY(crit_);
SampleCounter target_delay_counter_ RTC_GUARDED_BY(crit_);
SampleCounter current_delay_counter_ RTC_GUARDED_BY(crit_);
SampleCounter delay_counter_ RTC_GUARDED_BY(crit_);
mutable rtc::MovingMaxCounter<int> interframe_delay_max_moving_
GUARDED_BY(crit_);
RTC_GUARDED_BY(crit_);
std::map<VideoContentType, ContentSpecificStats> content_specific_stats_
GUARDED_BY(crit_);
MaxCounter freq_offset_counter_ GUARDED_BY(crit_);
int64_t first_report_block_time_ms_ GUARDED_BY(crit_);
ReportBlockStats report_block_stats_ GUARDED_BY(crit_);
RTC_GUARDED_BY(crit_);
MaxCounter freq_offset_counter_ RTC_GUARDED_BY(crit_);
int64_t first_report_block_time_ms_ RTC_GUARDED_BY(crit_);
ReportBlockStats report_block_stats_ RTC_GUARDED_BY(crit_);
QpCounters qp_counters_; // Only accessed on the decoding thread.
std::map<uint32_t, StreamDataCounters> rtx_stats_ GUARDED_BY(crit_);
int64_t avg_rtt_ms_ GUARDED_BY(crit_);
mutable std::map<int64_t, size_t> frame_window_ GUARDED_BY(&crit_);
VideoContentType last_content_type_ GUARDED_BY(&crit_);
rtc::Optional<int64_t> last_decoded_frame_time_ms_ GUARDED_BY(&crit_);
std::map<uint32_t, StreamDataCounters> rtx_stats_ RTC_GUARDED_BY(crit_);
int64_t avg_rtt_ms_ RTC_GUARDED_BY(crit_);
mutable std::map<int64_t, size_t> frame_window_ RTC_GUARDED_BY(&crit_);
VideoContentType last_content_type_ RTC_GUARDED_BY(&crit_);
rtc::Optional<int64_t> last_decoded_frame_time_ms_ RTC_GUARDED_BY(&crit_);
// Mutable because calling Max() on MovingMaxCounter is not const. Yet it is
// called from const GetStats().
mutable rtc::MovingMaxCounter<TimingFrameInfo> timing_frame_info_counter_
GUARDED_BY(&crit_);
RTC_GUARDED_BY(&crit_);
};
} // namespace webrtc

View File

@ -52,13 +52,13 @@ class RtpStreamsSynchronizer : public Module {
Syncable* syncable_video_;
rtc::CriticalSection crit_;
Syncable* syncable_audio_ GUARDED_BY(crit_);
std::unique_ptr<StreamSynchronization> sync_ GUARDED_BY(crit_);
StreamSynchronization::Measurements audio_measurement_ GUARDED_BY(crit_);
StreamSynchronization::Measurements video_measurement_ GUARDED_BY(crit_);
Syncable* syncable_audio_ RTC_GUARDED_BY(crit_);
std::unique_ptr<StreamSynchronization> sync_ RTC_GUARDED_BY(crit_);
StreamSynchronization::Measurements audio_measurement_ RTC_GUARDED_BY(crit_);
StreamSynchronization::Measurements video_measurement_ RTC_GUARDED_BY(crit_);
rtc::ThreadChecker process_thread_checker_;
int64_t last_sync_time_ ACCESS_ON(&process_thread_checker_);
int64_t last_sync_time_ RTC_ACCESS_ON(&process_thread_checker_);
};
} // namespace webrtc

View File

@ -184,10 +184,10 @@ class RtpVideoStreamReceiver : public RtpData,
std::unique_ptr<UlpfecReceiver> ulpfec_receiver_;
rtc::SequencedTaskChecker worker_task_checker_;
bool receiving_ GUARDED_BY(worker_task_checker_);
uint8_t restored_packet_[IP_PACKET_SIZE] GUARDED_BY(worker_task_checker_);
bool restored_packet_in_use_ GUARDED_BY(worker_task_checker_);
int64_t last_packet_log_ms_ GUARDED_BY(worker_task_checker_);
bool receiving_ RTC_GUARDED_BY(worker_task_checker_);
uint8_t restored_packet_[IP_PACKET_SIZE] RTC_GUARDED_BY(worker_task_checker_);
bool restored_packet_in_use_ RTC_GUARDED_BY(worker_task_checker_);
int64_t last_packet_log_ms_ RTC_GUARDED_BY(worker_task_checker_);
const std::unique_ptr<RtpRtcp> rtp_rtcp_;
@ -200,7 +200,7 @@ class RtpVideoStreamReceiver : public RtpData,
std::unique_ptr<video_coding::RtpFrameReferenceFinder> reference_finder_;
rtc::CriticalSection last_seq_num_cs_;
std::map<int64_t, uint16_t> last_seq_num_for_pic_id_
GUARDED_BY(last_seq_num_cs_);
RTC_GUARDED_BY(last_seq_num_cs_);
video_coding::H264SpsPpsTracker tracker_;
// TODO(johan): Remove pt_codec_params_ once
// https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved.
@ -211,7 +211,7 @@ class RtpVideoStreamReceiver : public RtpData,
bool has_received_frame_;
std::vector<RtpPacketSinkInterface*> secondary_sinks_
GUARDED_BY(worker_task_checker_);
RTC_GUARDED_BY(worker_task_checker_);
};
} // namespace webrtc

View File

@ -64,22 +64,22 @@ class SendDelayStats : public SendPacketObserver {
void UpdateHistograms();
void RemoveOld(int64_t now, PacketMap* packets)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
AvgCounter* GetSendDelayCounter(uint32_t ssrc)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
Clock* const clock_;
rtc::CriticalSection crit_;
PacketMap packets_ GUARDED_BY(crit_);
size_t num_old_packets_ GUARDED_BY(crit_);
size_t num_skipped_packets_ GUARDED_BY(crit_);
PacketMap packets_ RTC_GUARDED_BY(crit_);
size_t num_old_packets_ RTC_GUARDED_BY(crit_);
size_t num_skipped_packets_ RTC_GUARDED_BY(crit_);
std::set<uint32_t> ssrcs_ GUARDED_BY(crit_);
std::set<uint32_t> ssrcs_ RTC_GUARDED_BY(crit_);
// Mapped by SSRC.
std::map<uint32_t, std::unique_ptr<AvgCounter>> send_delay_counters_
GUARDED_BY(crit_);
RTC_GUARDED_BY(crit_);
};
} // namespace webrtc

View File

@ -162,30 +162,29 @@ class SendStatisticsProxy : public CpuOveruseMetricsObserver,
SampleCounter vp9; // QP range: 0-255.
SampleCounter h264; // QP range: 0-51.
};
void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_);
void PurgeOldStats() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
void SetAdaptTimer(const VideoStreamEncoder::AdaptCounts& counts,
StatsTimer* timer)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
StatsTimer* timer) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
void UpdateAdaptationStats(
const VideoStreamEncoder::AdaptCounts& cpu_counts,
const VideoStreamEncoder::AdaptCounts& quality_counts)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
Clock* const clock_;
const std::string payload_name_;
const VideoSendStream::Config::Rtp rtp_config_;
rtc::CriticalSection crit_;
VideoEncoderConfig::ContentType content_type_ GUARDED_BY(crit_);
VideoEncoderConfig::ContentType content_type_ RTC_GUARDED_BY(crit_);
const int64_t start_ms_;
VideoSendStream::Stats stats_ GUARDED_BY(crit_);
uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_);
std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_);
rtc::ExpFilter encode_time_ GUARDED_BY(crit_);
int quality_downscales_ GUARDED_BY(crit_);
int cpu_downscales_ GUARDED_BY(crit_);
VideoSendStream::Stats stats_ RTC_GUARDED_BY(crit_);
uint32_t last_sent_frame_timestamp_ RTC_GUARDED_BY(crit_);
std::map<uint32_t, StatsUpdateTimes> update_times_ RTC_GUARDED_BY(crit_);
rtc::ExpFilter encode_time_ RTC_GUARDED_BY(crit_);
int quality_downscales_ RTC_GUARDED_BY(crit_);
int cpu_downscales_ RTC_GUARDED_BY(crit_);
// Contains stats used for UMA histograms. These stats will be reset if
// content type changes between real-time video and screenshare, since these
@ -240,7 +239,7 @@ class SendStatisticsProxy : public CpuOveruseMetricsObserver,
qp_counters_; // QP counters mapped by spatial idx.
};
std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_);
std::unique_ptr<UmaSamplesContainer> uma_container_ RTC_GUARDED_BY(crit_);
};
} // namespace webrtc

View File

@ -649,7 +649,7 @@ class VideoAnalyzer : public PacketReceiver,
const VideoFrame& render,
bool dropped,
int64_t render_time_ms)
EXCLUSIVE_LOCKS_REQUIRED(crit_) {
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) {
int64_t reference_timestamp = wrap_handler_.Unwrap(reference.timestamp());
int64_t send_time_ms = send_times_[reference_timestamp];
send_times_.erase(reference_timestamp);
@ -1032,7 +1032,8 @@ class VideoAnalyzer : public PacketReceiver,
VideoAnalyzer* const analyzer_;
rtc::CriticalSection crit_;
rtc::VideoSinkInterface<VideoFrame>* send_stream_input_ GUARDED_BY(crit_);
rtc::VideoSinkInterface<VideoFrame>* send_stream_input_
RTC_GUARDED_BY(crit_);
test::VideoCapturer* video_capturer_;
Clock* clock_;
};
@ -1056,24 +1057,25 @@ class VideoAnalyzer : public PacketReceiver,
const int selected_tl_;
PreEncodeProxy pre_encode_proxy_;
OnEncodeTimingProxy encode_timing_proxy_;
std::vector<Sample> samples_ GUARDED_BY(comparison_lock_);
std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_);
test::Statistics sender_time_ GUARDED_BY(comparison_lock_);
test::Statistics receiver_time_ GUARDED_BY(comparison_lock_);
test::Statistics psnr_ GUARDED_BY(comparison_lock_);
test::Statistics ssim_ GUARDED_BY(comparison_lock_);
test::Statistics end_to_end_ GUARDED_BY(comparison_lock_);
test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_);
test::Statistics encoded_frame_size_ GUARDED_BY(comparison_lock_);
test::Statistics encode_frame_rate_ GUARDED_BY(comparison_lock_);
test::Statistics encode_time_ms_ GUARDED_BY(comparison_lock_);
test::Statistics encode_usage_percent_ GUARDED_BY(comparison_lock_);
test::Statistics decode_time_ms_ GUARDED_BY(comparison_lock_);
test::Statistics decode_time_max_ms_ GUARDED_BY(comparison_lock_);
test::Statistics media_bitrate_bps_ GUARDED_BY(comparison_lock_);
test::Statistics fec_bitrate_bps_ GUARDED_BY(comparison_lock_);
test::Statistics send_bandwidth_bps_ GUARDED_BY(comparison_lock_);
test::Statistics memory_usage_ GUARDED_BY(comparison_lock_);
std::vector<Sample> samples_ RTC_GUARDED_BY(comparison_lock_);
std::map<int64_t, int> samples_encode_time_ms_
RTC_GUARDED_BY(comparison_lock_);
test::Statistics sender_time_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics receiver_time_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics psnr_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics ssim_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics end_to_end_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics rendered_delta_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics encoded_frame_size_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics encode_frame_rate_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics encode_time_ms_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics encode_usage_percent_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics decode_time_ms_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics decode_time_max_ms_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics media_bitrate_bps_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics fec_bitrate_bps_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics send_bandwidth_bps_ RTC_GUARDED_BY(comparison_lock_);
test::Statistics memory_usage_ RTC_GUARDED_BY(comparison_lock_);
struct FrameWithPsnr {
double psnr;
@ -1081,7 +1083,7 @@ class VideoAnalyzer : public PacketReceiver,
};
// Rendered frame with worst PSNR is saved for further analysis.
rtc::Optional<FrameWithPsnr> worst_frame_ GUARDED_BY(comparison_lock_);
rtc::Optional<FrameWithPsnr> worst_frame_ RTC_GUARDED_BY(comparison_lock_);
size_t last_fec_bytes_;
@ -1097,19 +1099,19 @@ class VideoAnalyzer : public PacketReceiver,
int64_t first_sending_time_;
int64_t last_sending_time_;
int64_t cpu_time_ GUARDED_BY(cpu_measurement_lock_);
int64_t wallclock_time_ GUARDED_BY(cpu_measurement_lock_);
int64_t cpu_time_ RTC_GUARDED_BY(cpu_measurement_lock_);
int64_t wallclock_time_ RTC_GUARDED_BY(cpu_measurement_lock_);
rtc::CriticalSection cpu_measurement_lock_;
rtc::CriticalSection crit_;
std::deque<VideoFrame> frames_ GUARDED_BY(crit_);
rtc::Optional<VideoFrame> last_rendered_frame_ GUARDED_BY(crit_);
rtc::TimestampWrapAroundHandler wrap_handler_ GUARDED_BY(crit_);
std::map<int64_t, int64_t> send_times_ GUARDED_BY(crit_);
std::map<int64_t, int64_t> recv_times_ GUARDED_BY(crit_);
std::map<int64_t, size_t> encoded_frame_sizes_ GUARDED_BY(crit_);
rtc::Optional<uint32_t> first_encoded_timestamp_ GUARDED_BY(crit_);
rtc::Optional<uint32_t> first_sent_timestamp_ GUARDED_BY(crit_);
std::deque<VideoFrame> frames_ RTC_GUARDED_BY(crit_);
rtc::Optional<VideoFrame> last_rendered_frame_ RTC_GUARDED_BY(crit_);
rtc::TimestampWrapAroundHandler wrap_handler_ RTC_GUARDED_BY(crit_);
std::map<int64_t, int64_t> send_times_ RTC_GUARDED_BY(crit_);
std::map<int64_t, int64_t> recv_times_ RTC_GUARDED_BY(crit_);
std::map<int64_t, size_t> encoded_frame_sizes_ RTC_GUARDED_BY(crit_);
rtc::Optional<uint32_t> first_encoded_timestamp_ RTC_GUARDED_BY(crit_);
rtc::Optional<uint32_t> first_sent_timestamp_ RTC_GUARDED_BY(crit_);
const double avg_psnr_threshold_;
const double avg_ssim_threshold_;
bool is_quick_test_enabled_;
@ -1118,7 +1120,7 @@ class VideoAnalyzer : public PacketReceiver,
std::vector<rtc::PlatformThread*> comparison_thread_pool_;
rtc::PlatformThread stats_polling_thread_;
rtc::Event comparison_available_event_;
std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_);
std::deque<FrameComparison> comparisons_ RTC_GUARDED_BY(comparison_lock_);
rtc::Event done_;
std::unique_ptr<test::RtpFileWriter> rtp_file_writer_;

View File

@ -134,7 +134,7 @@ class VideoReceiveStream : public webrtc::VideoReceiveStream,
RtpStreamsSynchronizer rtp_stream_sync_;
rtc::CriticalSection ivf_writer_lock_;
std::unique_ptr<IvfFileWriter> ivf_writer_ GUARDED_BY(ivf_writer_lock_);
std::unique_ptr<IvfFileWriter> ivf_writer_ RTC_GUARDED_BY(ivf_writer_lock_);
// Members for the new jitter buffer experiment.
std::unique_ptr<VCMJitterEstimator> jitter_estimator_;

View File

@ -293,7 +293,7 @@ class VideoSendStreamImpl : public webrtc::BitrateAllocatorObserver,
rtc::CriticalSection encoder_activity_crit_sect_;
CheckEncoderActivityTask* check_encoder_activity_task_
GUARDED_BY(encoder_activity_crit_sect_);
RTC_GUARDED_BY(encoder_activity_crit_sect_);
CallStats* const call_stats_;
RtpTransportControllerSendInterface* const transport_;
@ -303,8 +303,8 @@ class VideoSendStreamImpl : public webrtc::BitrateAllocatorObserver,
std::unique_ptr<FlexfecSender> flexfec_sender_;
rtc::CriticalSection ivf_writers_crit_;
std::unique_ptr<IvfFileWriter> file_writers_[kMaxSimulcastStreams] GUARDED_BY(
ivf_writers_crit_);
std::unique_ptr<IvfFileWriter>
file_writers_[kMaxSimulcastStreams] RTC_GUARDED_BY(ivf_writers_crit_);
int max_padding_bitrate_;
int encoder_min_bitrate_bps_;
@ -329,7 +329,8 @@ class VideoSendStreamImpl : public webrtc::BitrateAllocatorObserver,
rtc::WeakPtrFactory<VideoSendStreamImpl> weak_ptr_factory_;
rtc::CriticalSection overhead_bytes_per_packet_crit_;
size_t overhead_bytes_per_packet_ GUARDED_BY(overhead_bytes_per_packet_crit_);
size_t overhead_bytes_per_packet_
RTC_GUARDED_BY(overhead_bytes_per_packet_crit_);
size_t transport_overhead_bytes_per_packet_;
};

View File

@ -1223,7 +1223,7 @@ TEST_F(VideoSendStreamTest, SuspendBelowMinBitrate) {
};
virtual void SendRtcpFeedback(int remb_value)
EXCLUSIVE_LOCKS_REQUIRED(crit_) {
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) {
FakeReceiveStatistics receive_stats(kVideoSendSsrcs[0],
last_sequence_number_, rtp_count_, 0);
RTCPSender rtcp_sender(false, clock_, &receive_stats, nullptr, nullptr,
@ -1244,12 +1244,12 @@ TEST_F(VideoSendStreamTest, SuspendBelowMinBitrate) {
VideoSendStream* stream_;
rtc::CriticalSection crit_;
TestState test_state_ GUARDED_BY(crit_);
int rtp_count_ GUARDED_BY(crit_);
int last_sequence_number_ GUARDED_BY(crit_);
int suspended_frame_count_ GUARDED_BY(crit_);
int low_remb_bps_ GUARDED_BY(crit_);
int high_remb_bps_ GUARDED_BY(crit_);
TestState test_state_ RTC_GUARDED_BY(crit_);
int rtp_count_ RTC_GUARDED_BY(crit_);
int last_sequence_number_ RTC_GUARDED_BY(crit_);
int suspended_frame_count_ RTC_GUARDED_BY(crit_);
int low_remb_bps_ RTC_GUARDED_BY(crit_);
int high_remb_bps_ RTC_GUARDED_BY(crit_);
} test;
RunBaseTest(&test);
@ -1326,8 +1326,8 @@ TEST_F(VideoSendStreamTest, NoPaddingWhenVideoIsMuted) {
Clock* const clock_;
std::unique_ptr<internal::TransportAdapter> transport_adapter_;
rtc::CriticalSection crit_;
int64_t last_packet_time_ms_ GUARDED_BY(crit_);
test::FrameGeneratorCapturer* capturer_ GUARDED_BY(crit_);
int64_t last_packet_time_ms_ RTC_GUARDED_BY(crit_);
test::FrameGeneratorCapturer* capturer_ RTC_GUARDED_BY(crit_);
} test;
RunBaseTest(&test);
@ -1395,8 +1395,8 @@ TEST_F(VideoSendStreamTest, PaddingIsPrimarilyRetransmissions) {
rtc::CriticalSection crit_;
Clock* const clock_;
size_t padding_length_ GUARDED_BY(crit_);
size_t total_length_ GUARDED_BY(crit_);
size_t padding_length_ RTC_GUARDED_BY(crit_);
size_t total_length_ RTC_GUARDED_BY(crit_);
Call* call_;
} test;
@ -1634,7 +1634,7 @@ TEST_F(VideoSendStreamTest, ChangingTransportOverhead) {
test::SingleThreadedTaskQueueForTesting* const task_queue_;
Call* call_;
rtc::CriticalSection lock_;
int packets_sent_ GUARDED_BY(lock_);
int packets_sent_ RTC_GUARDED_BY(lock_);
int transport_overhead_;
const size_t kMaxRtpPacketSize = 1000;
} test(&task_queue_);
@ -1742,10 +1742,10 @@ class MaxPaddingSetTest : public test::SendTest {
rtc::CriticalSection crit_;
rtc::Event content_switch_event_;
Call* call_;
VideoSendStream* send_stream_ GUARDED_BY(crit_);
VideoSendStream* send_stream_ RTC_GUARDED_BY(crit_);
VideoSendStream::Config send_stream_config_;
VideoEncoderConfig encoder_config_;
uint32_t packets_sent_ GUARDED_BY(crit_);
uint32_t packets_sent_ RTC_GUARDED_BY(crit_);
bool running_without_padding_;
T* const stream_resetter_;
};
@ -1833,9 +1833,9 @@ TEST_F(VideoSendStreamTest,
rtc::CriticalSection crit_;
rtc::Event init_encode_called_;
size_t number_of_initializations_ GUARDED_BY(&crit_);
int last_initialized_frame_width_ GUARDED_BY(&crit_);
int last_initialized_frame_height_ GUARDED_BY(&crit_);
size_t number_of_initializations_ RTC_GUARDED_BY(&crit_);
int last_initialized_frame_width_ RTC_GUARDED_BY(&crit_);
int last_initialized_frame_height_ RTC_GUARDED_BY(&crit_);
};
test::NullTransport transport;
@ -1902,7 +1902,7 @@ TEST_F(VideoSendStreamTest, CanReconfigureToUseStartBitrateAbovePreviousMax) {
private:
rtc::CriticalSection crit_;
rtc::Event start_bitrate_changed_;
int start_bitrate_kbps_ GUARDED_BY(crit_);
int start_bitrate_kbps_ RTC_GUARDED_BY(crit_);
};
CreateSenderCall(Call::Config(event_log_.get()));
@ -1992,7 +1992,7 @@ TEST_F(VideoSendStreamTest, VideoSendStreamStopSetEncoderRateToZero) {
rtc::CriticalSection crit_;
rtc::Event encoder_init_;
rtc::Event bitrate_changed_;
rtc::Optional<int> bitrate_kbps_ GUARDED_BY(crit_);
rtc::Optional<int> bitrate_kbps_ RTC_GUARDED_BY(crit_);
};
test::NullTransport transport;
@ -2244,10 +2244,10 @@ TEST_F(VideoSendStreamTest, EncoderIsProperlyInitializedAndDestroyed) {
test::SingleThreadedTaskQueueForTesting* const task_queue_;
rtc::CriticalSection crit_;
VideoSendStream* stream_;
bool initialized_ GUARDED_BY(crit_);
bool callback_registered_ GUARDED_BY(crit_);
size_t num_releases_ GUARDED_BY(crit_);
bool released_ GUARDED_BY(crit_);
bool initialized_ RTC_GUARDED_BY(crit_);
bool callback_registered_ RTC_GUARDED_BY(crit_);
size_t num_releases_ RTC_GUARDED_BY(crit_);
bool released_ RTC_GUARDED_BY(crit_);
VideoEncoderConfig encoder_config_;
} test_encoder(&task_queue_);
@ -2557,8 +2557,8 @@ TEST_F(VideoSendStreamTest, RtcpSenderReportContainsMediaBytesSent) {
}
rtc::CriticalSection crit_;
size_t rtp_packets_sent_ GUARDED_BY(&crit_);
size_t media_bytes_sent_ GUARDED_BY(&crit_);
size_t rtp_packets_sent_ RTC_GUARDED_BY(&crit_);
size_t media_bytes_sent_ RTC_GUARDED_BY(&crit_);
} test;
RunBaseTest(&test);
@ -2792,7 +2792,7 @@ TEST_F(VideoSendStreamTest, ReconfigureBitratesSetsEncoderBitratesCorrectly) {
rtc::Event init_encode_event_;
rtc::Event bitrate_changed_event_;
rtc::CriticalSection crit_;
uint32_t target_bitrate_ GUARDED_BY(&crit_);
uint32_t target_bitrate_ RTC_GUARDED_BY(&crit_);
int num_initializations_;
webrtc::Call* call_;
@ -3457,8 +3457,8 @@ TEST_F(VideoSendStreamTest, RemoveOverheadFromBandwidth) {
test::SingleThreadedTaskQueueForTesting* const task_queue_;
Call* call_;
rtc::CriticalSection crit_;
uint32_t max_bitrate_bps_ GUARDED_BY(&crit_);
bool first_packet_sent_ GUARDED_BY(&crit_);
uint32_t max_bitrate_bps_ RTC_GUARDED_BY(&crit_);
bool first_packet_sent_ RTC_GUARDED_BY(&crit_);
rtc::Event bitrate_changed_event_;
} test(&task_queue_);
RunBaseTest(&test);

View File

@ -97,7 +97,7 @@ class VideoStreamDecoder : public VCMReceiveCallback,
ReceiveStatisticsProxy* const receive_stats_callback_;
rtc::VideoSinkInterface<VideoFrame>* const incoming_video_stream_;
int64_t last_rtt_ms_ GUARDED_BY(crit_);
int64_t last_rtt_ms_ RTC_GUARDED_BY(crit_);
};
} // namespace webrtc

View File

@ -342,7 +342,7 @@ class VideoStreamEncoder::VideoSourceProxy {
private:
rtc::VideoSinkWants GetActiveSinkWantsInternal()
EXCLUSIVE_LOCKS_REQUIRED(&crit_) {
RTC_EXCLUSIVE_LOCKS_REQUIRED(&crit_) {
rtc::VideoSinkWants wants = sink_wants_;
// Clear any constraints from the current sink wants that don't apply to
// the used degradation_preference.
@ -367,10 +367,10 @@ class VideoStreamEncoder::VideoSourceProxy {
rtc::CriticalSection crit_;
rtc::SequencedTaskChecker main_checker_;
VideoStreamEncoder* const video_stream_encoder_;
rtc::VideoSinkWants sink_wants_ GUARDED_BY(&crit_);
rtc::VideoSinkWants sink_wants_ RTC_GUARDED_BY(&crit_);
VideoSendStream::DegradationPreference degradation_preference_
GUARDED_BY(&crit_);
rtc::VideoSourceInterface<VideoFrame>* source_ GUARDED_BY(&crit_);
RTC_GUARDED_BY(&crit_);
rtc::VideoSourceInterface<VideoFrame>* source_ RTC_GUARDED_BY(&crit_);
RTC_DISALLOW_COPY_AND_ASSIGN(VideoSourceProxy);
};

View File

@ -217,10 +217,10 @@ class VideoStreamEncoder : public rtc::VideoSinkInterface<VideoFrame>,
std::vector<int> resolution_counters_;
};
AdaptCounter& GetAdaptCounter() RUN_ON(&encoder_queue_);
const AdaptCounter& GetConstAdaptCounter() RUN_ON(&encoder_queue_);
void UpdateAdaptationStats(AdaptReason reason) RUN_ON(&encoder_queue_);
AdaptCounts GetActiveCounts(AdaptReason reason) RUN_ON(&encoder_queue_);
AdaptCounter& GetAdaptCounter() RTC_RUN_ON(&encoder_queue_);
const AdaptCounter& GetConstAdaptCounter() RTC_RUN_ON(&encoder_queue_);
void UpdateAdaptationStats(AdaptReason reason) RTC_RUN_ON(&encoder_queue_);
AdaptCounts GetActiveCounts(AdaptReason reason) RTC_RUN_ON(&encoder_queue_);
rtc::Event shutdown_event_;
@ -233,10 +233,10 @@ class VideoStreamEncoder : public rtc::VideoSinkInterface<VideoFrame>,
const VideoSendStream::Config::EncoderSettings settings_;
const VideoCodecType codec_type_;
vcm::VideoSender video_sender_ ACCESS_ON(&encoder_queue_);
vcm::VideoSender video_sender_ RTC_ACCESS_ON(&encoder_queue_);
std::unique_ptr<OveruseFrameDetector> overuse_detector_
ACCESS_ON(&encoder_queue_);
std::unique_ptr<QualityScaler> quality_scaler_ ACCESS_ON(&encoder_queue_);
RTC_ACCESS_ON(&encoder_queue_);
std::unique_ptr<QualityScaler> quality_scaler_ RTC_ACCESS_ON(&encoder_queue_);
SendStatisticsProxy* const stats_proxy_;
rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_;
@ -246,24 +246,24 @@ class VideoStreamEncoder : public rtc::VideoSinkInterface<VideoFrame>,
// of VideoStreamEncoder are called on the same thread.
rtc::ThreadChecker thread_checker_;
VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_);
VideoEncoderConfig encoder_config_ RTC_ACCESS_ON(&encoder_queue_);
std::unique_ptr<VideoBitrateAllocator> rate_allocator_
ACCESS_ON(&encoder_queue_);
RTC_ACCESS_ON(&encoder_queue_);
// The maximum frame rate of the current codec configuration, as determined
// at the last ReconfigureEncoder() call.
int max_framerate_ ACCESS_ON(&encoder_queue_);
int max_framerate_ RTC_ACCESS_ON(&encoder_queue_);
// Set when ConfigureEncoder has been called in order to lazy reconfigure the
// encoder on the next frame.
bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_);
rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_);
int crop_width_ ACCESS_ON(&encoder_queue_);
int crop_height_ ACCESS_ON(&encoder_queue_);
uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_);
size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_);
bool nack_enabled_ ACCESS_ON(&encoder_queue_);
uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_);
bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_);
bool pending_encoder_reconfiguration_ RTC_ACCESS_ON(&encoder_queue_);
rtc::Optional<VideoFrameInfo> last_frame_info_ RTC_ACCESS_ON(&encoder_queue_);
int crop_width_ RTC_ACCESS_ON(&encoder_queue_);
int crop_height_ RTC_ACCESS_ON(&encoder_queue_);
uint32_t encoder_start_bitrate_bps_ RTC_ACCESS_ON(&encoder_queue_);
size_t max_data_payload_length_ RTC_ACCESS_ON(&encoder_queue_);
bool nack_enabled_ RTC_ACCESS_ON(&encoder_queue_);
uint32_t last_observed_bitrate_bps_ RTC_ACCESS_ON(&encoder_queue_);
bool encoder_paused_and_dropped_frame_ RTC_ACCESS_ON(&encoder_queue_);
Clock* const clock_;
// Counters used for deciding if the video resolution or framerate is
// currently restricted, and if so, why, on a per degradation preference
@ -271,10 +271,10 @@ class VideoStreamEncoder : public rtc::VideoSinkInterface<VideoFrame>,
// TODO(sprang): Replace this with a state holding a relative overuse measure
// instead, that can be translated into suitable down-scale or fps limit.
std::map<const VideoSendStream::DegradationPreference, AdaptCounter>
adapt_counters_ ACCESS_ON(&encoder_queue_);
adapt_counters_ RTC_ACCESS_ON(&encoder_queue_);
// Set depending on degradation preferences.
VideoSendStream::DegradationPreference degradation_preference_
ACCESS_ON(&encoder_queue_);
RTC_ACCESS_ON(&encoder_queue_);
struct AdaptationRequest {
// The pixel count produced by the source at the time of the adaptation.
@ -287,22 +287,25 @@ class VideoStreamEncoder : public rtc::VideoSinkInterface<VideoFrame>,
// Stores a snapshot of the last adaptation request triggered by an AdaptUp
// or AdaptDown signal.
rtc::Optional<AdaptationRequest> last_adaptation_request_
ACCESS_ON(&encoder_queue_);
RTC_ACCESS_ON(&encoder_queue_);
rtc::RaceChecker incoming_frame_race_checker_
GUARDED_BY(incoming_frame_race_checker_);
RTC_GUARDED_BY(incoming_frame_race_checker_);
Atomic32 posted_frames_waiting_for_encode_;
// Used to make sure incoming time stamp is increasing for every frame.
int64_t last_captured_timestamp_ GUARDED_BY(incoming_frame_race_checker_);
int64_t last_captured_timestamp_ RTC_GUARDED_BY(incoming_frame_race_checker_);
// Delta used for translating between NTP and internal timestamps.
const int64_t delta_ntp_internal_ms_ GUARDED_BY(incoming_frame_race_checker_);
const int64_t delta_ntp_internal_ms_
RTC_GUARDED_BY(incoming_frame_race_checker_);
int64_t last_frame_log_ms_ GUARDED_BY(incoming_frame_race_checker_);
int captured_frame_count_ ACCESS_ON(&encoder_queue_);
int dropped_frame_count_ ACCESS_ON(&encoder_queue_);
int64_t last_frame_log_ms_ RTC_GUARDED_BY(incoming_frame_race_checker_);
int captured_frame_count_ RTC_ACCESS_ON(&encoder_queue_);
int dropped_frame_count_ RTC_ACCESS_ON(&encoder_queue_);
VideoBitrateAllocationObserver* bitrate_observer_ ACCESS_ON(&encoder_queue_);
rtc::Optional<int64_t> last_parameters_update_ms_ ACCESS_ON(&encoder_queue_);
VideoBitrateAllocationObserver* bitrate_observer_
RTC_ACCESS_ON(&encoder_queue_);
rtc::Optional<int64_t> last_parameters_update_ms_
RTC_ACCESS_ON(&encoder_queue_);
// All public methods are proxied to |encoder_queue_|. It must must be
// destroyed first to make sure no tasks are run that use other members.

View File

@ -89,7 +89,7 @@ class CpuOveruseDetectorProxy : public OveruseFrameDetector {
private:
rtc::CriticalSection lock_;
int last_target_framerate_fps_ GUARDED_BY(lock_);
int last_target_framerate_fps_ RTC_GUARDED_BY(lock_);
};
class VideoStreamEncoderUnderTest : public VideoStreamEncoder {
@ -218,8 +218,8 @@ class AdaptingFrameForwarder : public test::FrameForwarder {
test::FrameForwarder::AddOrUpdateSink(sink, wants);
}
cricket::VideoAdapter adapter_;
bool adaptation_enabled_ GUARDED_BY(crit_);
rtc::VideoSinkWants last_wants_ GUARDED_BY(crit_);
bool adaptation_enabled_ RTC_GUARDED_BY(crit_);
rtc::VideoSinkWants last_wants_ RTC_GUARDED_BY(crit_);
};
class MockableSendStatisticsProxy : public SendStatisticsProxy {
@ -248,7 +248,7 @@ class MockableSendStatisticsProxy : public SendStatisticsProxy {
private:
rtc::CriticalSection lock_;
rtc::Optional<VideoSendStream::Stats> mock_stats_ GUARDED_BY(lock_);
rtc::Optional<VideoSendStream::Stats> mock_stats_ RTC_GUARDED_BY(lock_);
};
class MockBitrateObserver : public VideoBitrateAllocationObserver {
@ -551,16 +551,16 @@ class VideoStreamEncoderTest : public ::testing::Test {
}
rtc::CriticalSection local_crit_sect_;
bool block_next_encode_ GUARDED_BY(local_crit_sect_) = false;
bool block_next_encode_ RTC_GUARDED_BY(local_crit_sect_) = false;
rtc::Event continue_encode_event_;
uint32_t timestamp_ GUARDED_BY(local_crit_sect_) = 0;
int64_t ntp_time_ms_ GUARDED_BY(local_crit_sect_) = 0;
int last_input_width_ GUARDED_BY(local_crit_sect_) = 0;
int last_input_height_ GUARDED_BY(local_crit_sect_) = 0;
bool quality_scaling_ GUARDED_BY(local_crit_sect_) = true;
uint32_t timestamp_ RTC_GUARDED_BY(local_crit_sect_) = 0;
int64_t ntp_time_ms_ RTC_GUARDED_BY(local_crit_sect_) = 0;
int last_input_width_ RTC_GUARDED_BY(local_crit_sect_) = 0;
int last_input_height_ RTC_GUARDED_BY(local_crit_sect_) = 0;
bool quality_scaling_ RTC_GUARDED_BY(local_crit_sect_) = true;
std::vector<std::unique_ptr<TemporalLayers>> allocated_temporal_layers_
GUARDED_BY(local_crit_sect_);
bool force_init_encode_failed_ GUARDED_BY(local_crit_sect_) = false;
RTC_GUARDED_BY(local_crit_sect_);
bool force_init_encode_failed_ RTC_GUARDED_BY(local_crit_sect_) = false;
};
class TestSink : public VideoStreamEncoder::EncoderSink {

View File

@ -45,13 +45,13 @@ class AudioLevel {
rtc::CriticalSection crit_sect_;
int16_t abs_max_ GUARDED_BY(crit_sect_);
int16_t count_ GUARDED_BY(crit_sect_);
int8_t current_level_ GUARDED_BY(crit_sect_);
int16_t current_level_full_range_ GUARDED_BY(crit_sect_);
int16_t abs_max_ RTC_GUARDED_BY(crit_sect_);
int16_t count_ RTC_GUARDED_BY(crit_sect_);
int8_t current_level_ RTC_GUARDED_BY(crit_sect_);
int16_t current_level_full_range_ RTC_GUARDED_BY(crit_sect_);
double total_energy_ GUARDED_BY(crit_sect_) = 0.0;
double total_duration_ GUARDED_BY(crit_sect_) = 0.0;
double total_energy_ RTC_GUARDED_BY(crit_sect_) = 0.0;
double total_duration_ RTC_GUARDED_BY(crit_sect_) = 0.0;
};
} // namespace voe

View File

@ -192,7 +192,7 @@ class RtcEventLogProxy final : public webrtc::RtcEventLog {
private:
rtc::CriticalSection crit_;
RtcEventLog* event_log_ GUARDED_BY(crit_);
RtcEventLog* event_log_ RTC_GUARDED_BY(crit_);
RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogProxy);
};
@ -220,7 +220,7 @@ class RtcpRttStatsProxy final : public RtcpRttStats {
private:
rtc::CriticalSection crit_;
RtcpRttStats* rtcp_rtt_stats_ GUARDED_BY(crit_);
RtcpRttStats* rtcp_rtt_stats_ RTC_GUARDED_BY(crit_);
RTC_DISALLOW_COPY_AND_ASSIGN(RtcpRttStatsProxy);
};
@ -265,7 +265,7 @@ class TransportFeedbackProxy : public TransportFeedbackObserver {
rtc::ThreadChecker thread_checker_;
rtc::ThreadChecker pacer_thread_;
rtc::ThreadChecker network_thread_;
TransportFeedbackObserver* feedback_observer_ GUARDED_BY(&crit_);
TransportFeedbackObserver* feedback_observer_ RTC_GUARDED_BY(&crit_);
};
class TransportSequenceNumberProxy : public TransportSequenceNumberAllocator {
@ -294,7 +294,7 @@ class TransportSequenceNumberProxy : public TransportSequenceNumberAllocator {
rtc::CriticalSection crit_;
rtc::ThreadChecker thread_checker_;
rtc::ThreadChecker pacer_thread_;
TransportSequenceNumberAllocator* seq_num_allocator_ GUARDED_BY(&crit_);
TransportSequenceNumberAllocator* seq_num_allocator_ RTC_GUARDED_BY(&crit_);
};
class RtpPacketSenderProxy : public RtpPacketSender {
@ -324,7 +324,7 @@ class RtpPacketSenderProxy : public RtpPacketSender {
private:
rtc::ThreadChecker thread_checker_;
rtc::CriticalSection crit_;
RtpPacketSender* rtp_packet_sender_ GUARDED_BY(&crit_);
RtpPacketSender* rtp_packet_sender_ RTC_GUARDED_BY(&crit_);
};
class VoERtcpObserver : public RtcpBandwidthObserver {
@ -398,7 +398,7 @@ class VoERtcpObserver : public RtcpBandwidthObserver {
// Maps remote side ssrc to extended highest sequence number received.
std::map<uint32_t, uint32_t> extended_max_sequence_number_;
rtc::CriticalSection crit_;
RtcpBandwidthObserver* bandwidth_observer_ GUARDED_BY(crit_);
RtcpBandwidthObserver* bandwidth_observer_ RTC_GUARDED_BY(crit_);
};
class Channel::ProcessAndEncodeAudioTask : public rtc::QueuedTask {

View File

@ -440,7 +440,7 @@ class Channel
unsigned char id);
void UpdateOverheadForEncoder()
EXCLUSIVE_LOCKS_REQUIRED(overhead_per_packet_lock_);
RTC_EXCLUSIVE_LOCKS_REQUIRED(overhead_per_packet_lock_);
int GetRtpTimestampRateHz() const;
int64_t GetRTT(bool allow_associate_channel) const;
@ -482,16 +482,16 @@ class Channel
int _outputFilePlayerId;
int _outputFileRecorderId;
bool _outputFileRecording;
uint32_t _timeStamp ACCESS_ON(encoder_queue_);
uint32_t _timeStamp RTC_ACCESS_ON(encoder_queue_);
RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_);
RemoteNtpTimeEstimator ntp_estimator_ RTC_GUARDED_BY(ts_stats_lock_);
// Timestamp of the audio pulled from NetEq.
rtc::Optional<uint32_t> jitter_buffer_playout_timestamp_;
rtc::CriticalSection video_sync_lock_;
uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_);
uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_);
uint32_t playout_timestamp_rtp_ RTC_GUARDED_BY(video_sync_lock_);
uint32_t playout_delay_ms_ RTC_GUARDED_BY(video_sync_lock_);
uint16_t send_sequence_number_;
rtc::CriticalSection ts_stats_lock_;
@ -501,7 +501,7 @@ class Channel
int64_t capture_start_rtp_time_stamp_;
// The capture ntp time (in local timebase) of the first played out audio
// frame.
int64_t capture_start_ntp_time_ms_ GUARDED_BY(ts_stats_lock_);
int64_t capture_start_ntp_time_ms_ RTC_GUARDED_BY(ts_stats_lock_);
// uses
Statistics* _engineStatisticsPtr;
@ -511,18 +511,19 @@ class Channel
VoiceEngineObserver* _voiceEngineObserverPtr; // owned by base
rtc::CriticalSection* _callbackCritSectPtr; // owned by base
Transport* _transportPtr; // WebRtc socket or external transport
RmsLevel rms_level_ ACCESS_ON(encoder_queue_);
bool input_mute_ GUARDED_BY(volume_settings_critsect_);
bool previous_frame_muted_ ACCESS_ON(encoder_queue_);
float _outputGain GUARDED_BY(volume_settings_critsect_);
RmsLevel rms_level_ RTC_ACCESS_ON(encoder_queue_);
bool input_mute_ RTC_GUARDED_BY(volume_settings_critsect_);
bool previous_frame_muted_ RTC_ACCESS_ON(encoder_queue_);
float _outputGain RTC_GUARDED_BY(volume_settings_critsect_);
// VoEBase
bool _mixFileWithMicrophone;
// VoeRTP_RTCP
// TODO(henrika): can today be accessed on the main thread and on the
// task queue; hence potential race.
bool _includeAudioLevelIndication;
size_t transport_overhead_per_packet_ GUARDED_BY(overhead_per_packet_lock_);
size_t rtp_overhead_per_packet_ GUARDED_BY(overhead_per_packet_lock_);
size_t transport_overhead_per_packet_
RTC_GUARDED_BY(overhead_per_packet_lock_);
size_t rtp_overhead_per_packet_ RTC_GUARDED_BY(overhead_per_packet_lock_);
rtc::CriticalSection overhead_per_packet_lock_;
// VoENetwork
AudioFrame::SpeechType _outputSpeechType;
@ -530,7 +531,7 @@ class Channel
std::unique_ptr<VoERtcpObserver> rtcp_observer_;
// An associated send channel.
rtc::CriticalSection assoc_send_channel_lock_;
ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_);
ChannelOwner associate_send_channel_ RTC_GUARDED_BY(assoc_send_channel_lock_);
bool pacing_enabled_;
PacketRouter* packet_router_ = nullptr;
@ -550,7 +551,7 @@ class Channel
rtc::CriticalSection encoder_queue_lock_;
bool encoder_queue_is_active_ GUARDED_BY(encoder_queue_lock_) = false;
bool encoder_queue_is_active_ RTC_GUARDED_BY(encoder_queue_lock_) = false;
rtc::TaskQueue* encoder_queue_ = nullptr;
};

View File

@ -71,7 +71,7 @@ protected:
std::unique_ptr<ProcessThread> _moduleProcessThreadPtr;
// |encoder_queue| is defined last to ensure all pending tasks are cancelled
// and deleted before any other members.
rtc::TaskQueue encoder_queue_ ACCESS_ON(construction_thread_);
rtc::TaskQueue encoder_queue_ RTC_ACCESS_ON(construction_thread_);
SharedData();
virtual ~SharedData();

View File

@ -137,8 +137,9 @@ class ConferenceTransport: public webrtc::Transport {
unsigned int rtt_ms_;
unsigned int stream_count_;
std::map<unsigned int, std::pair<int, int>> streams_ GUARDED_BY(stream_crit_);
std::deque<Packet> packet_queue_ GUARDED_BY(pq_crit_);
std::map<unsigned int, std::pair<int, int>> streams_
RTC_GUARDED_BY(stream_crit_);
std::deque<Packet> packet_queue_ RTC_GUARDED_BY(pq_crit_);
int local_sender_; // Channel Id of local sender
int reflector_;

View File

@ -145,9 +145,9 @@ class LoopBackTransport : public webrtc::Transport {
rtc::CriticalSection crit_;
const std::unique_ptr<webrtc::EventWrapper> packet_event_;
rtc::PlatformThread thread_;
std::deque<Packet> packet_queue_ GUARDED_BY(crit_);
std::deque<Packet> packet_queue_ RTC_GUARDED_BY(crit_);
const int channel_;
std::map<uint32_t, int> channels_ GUARDED_BY(crit_);
std::map<uint32_t, int> channels_ RTC_GUARDED_BY(crit_);
webrtc::VoENetwork* const voe_network_;
webrtc::Atomic32 transmitted_packets_;
};