Update thread annotiation macros in modules to use RTC_ prefix
BUG=webrtc:8198
Review-Url: https://codereview.webrtc.org/3010223002
Cr-Commit-Position: refs/heads/master@{#19728}
diff --git a/webrtc/modules/audio_coding/acm2/acm_receiver.h b/webrtc/modules/audio_coding/acm2/acm_receiver.h
index ebeecec..93ff89c 100644
--- a/webrtc/modules/audio_coding/acm2/acm_receiver.h
+++ b/webrtc/modules/audio_coding/acm2/acm_receiver.h
@@ -269,22 +269,22 @@
int sample_rate_hz;
};
- const rtc::Optional<CodecInst> RtpHeaderToDecoder(
- const RTPHeader& rtp_header,
- uint8_t first_payload_byte) const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ const rtc::Optional<CodecInst> RtpHeaderToDecoder(const RTPHeader& rtp_header,
+ uint8_t first_payload_byte)
+ const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
uint32_t NowInTimestamp(int decoder_sampling_rate) const;
rtc::CriticalSection crit_sect_;
- rtc::Optional<CodecInst> last_audio_decoder_ GUARDED_BY(crit_sect_);
- rtc::Optional<SdpAudioFormat> last_audio_format_ GUARDED_BY(crit_sect_);
- ACMResampler resampler_ GUARDED_BY(crit_sect_);
- std::unique_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_);
- CallStatistics call_stats_ GUARDED_BY(crit_sect_);
+ rtc::Optional<CodecInst> last_audio_decoder_ RTC_GUARDED_BY(crit_sect_);
+ rtc::Optional<SdpAudioFormat> last_audio_format_ RTC_GUARDED_BY(crit_sect_);
+ ACMResampler resampler_ RTC_GUARDED_BY(crit_sect_);
+ std::unique_ptr<int16_t[]> last_audio_buffer_ RTC_GUARDED_BY(crit_sect_);
+ CallStatistics call_stats_ RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<NetEq> neteq_; // NetEq is thread-safe; no lock needed.
const Clock* const clock_;
- bool resampled_last_output_frame_ GUARDED_BY(crit_sect_);
- rtc::Optional<int> last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_);
+ bool resampled_last_output_frame_ RTC_GUARDED_BY(crit_sect_);
+ rtc::Optional<int> last_packet_sample_rate_hz_ RTC_GUARDED_BY(crit_sect_);
};
} // namespace acm2
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
index 1495818..f7607c6 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
@@ -234,17 +234,17 @@
int RegisterReceiveCodecUnlocked(
const CodecInst& codec,
rtc::FunctionView<std::unique_ptr<AudioDecoder>()> isac_factory)
- EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
+ RTC_EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
int Add10MsDataInternal(const AudioFrame& audio_frame, InputData* input_data)
- EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
+ RTC_EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
int Encode(const InputData& input_data)
- EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
+ RTC_EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
- int InitializeReceiverSafe() EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
+ int InitializeReceiverSafe() RTC_EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
bool HaveValidEncoder(const char* caller_name) const
- EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
+ RTC_EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
// Preprocessing of input audio, including resampling and down-mixing if
// required, before pushing audio into encoder's buffer.
@@ -259,33 +259,36 @@
// 0: otherwise.
int PreprocessToAddData(const AudioFrame& in_frame,
const AudioFrame** ptr_out)
- EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
+ RTC_EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
// Change required states after starting to receive the codec corresponding
// to |index|.
int UpdateUponReceivingCodec(int index);
rtc::CriticalSection acm_crit_sect_;
- rtc::Buffer encode_buffer_ GUARDED_BY(acm_crit_sect_);
+ rtc::Buffer encode_buffer_ RTC_GUARDED_BY(acm_crit_sect_);
int id_; // TODO(henrik.lundin) Make const.
- uint32_t expected_codec_ts_ GUARDED_BY(acm_crit_sect_);
- uint32_t expected_in_ts_ GUARDED_BY(acm_crit_sect_);
- acm2::ACMResampler resampler_ GUARDED_BY(acm_crit_sect_);
+ uint32_t expected_codec_ts_ RTC_GUARDED_BY(acm_crit_sect_);
+ uint32_t expected_in_ts_ RTC_GUARDED_BY(acm_crit_sect_);
+ acm2::ACMResampler resampler_ RTC_GUARDED_BY(acm_crit_sect_);
acm2::AcmReceiver receiver_; // AcmReceiver has it's own internal lock.
- ChangeLogger bitrate_logger_ GUARDED_BY(acm_crit_sect_);
+ ChangeLogger bitrate_logger_ RTC_GUARDED_BY(acm_crit_sect_);
- std::unique_ptr<EncoderFactory> encoder_factory_ GUARDED_BY(acm_crit_sect_);
+ std::unique_ptr<EncoderFactory> encoder_factory_
+ RTC_GUARDED_BY(acm_crit_sect_);
// Current encoder stack, either obtained from
// encoder_factory_->rent_a_codec.RentEncoderStack or provided by a call to
// RegisterEncoder.
- std::unique_ptr<AudioEncoder> encoder_stack_ GUARDED_BY(acm_crit_sect_);
+ std::unique_ptr<AudioEncoder> encoder_stack_ RTC_GUARDED_BY(acm_crit_sect_);
- std::unique_ptr<AudioDecoder> isac_decoder_16k_ GUARDED_BY(acm_crit_sect_);
- std::unique_ptr<AudioDecoder> isac_decoder_32k_ GUARDED_BY(acm_crit_sect_);
+ std::unique_ptr<AudioDecoder> isac_decoder_16k_
+ RTC_GUARDED_BY(acm_crit_sect_);
+ std::unique_ptr<AudioDecoder> isac_decoder_32k_
+ RTC_GUARDED_BY(acm_crit_sect_);
// This is to keep track of CN instances where we can send DTMFs.
- uint8_t previous_pltype_ GUARDED_BY(acm_crit_sect_);
+ uint8_t previous_pltype_ RTC_GUARDED_BY(acm_crit_sect_);
// Used when payloads are pushed into ACM without any RTP info
// One example is when pre-encoded bit-stream is pushed from
@@ -295,19 +298,19 @@
// be used in other methods, locks need to be taken.
std::unique_ptr<WebRtcRTPHeader> aux_rtp_header_;
- bool receiver_initialized_ GUARDED_BY(acm_crit_sect_);
+ bool receiver_initialized_ RTC_GUARDED_BY(acm_crit_sect_);
- AudioFrame preprocess_frame_ GUARDED_BY(acm_crit_sect_);
- bool first_10ms_data_ GUARDED_BY(acm_crit_sect_);
+ AudioFrame preprocess_frame_ RTC_GUARDED_BY(acm_crit_sect_);
+ bool first_10ms_data_ RTC_GUARDED_BY(acm_crit_sect_);
- bool first_frame_ GUARDED_BY(acm_crit_sect_);
- uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_);
- uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_);
+ bool first_frame_ RTC_GUARDED_BY(acm_crit_sect_);
+ uint32_t last_timestamp_ RTC_GUARDED_BY(acm_crit_sect_);
+ uint32_t last_rtp_timestamp_ RTC_GUARDED_BY(acm_crit_sect_);
rtc::CriticalSection callback_crit_sect_;
AudioPacketizationCallback* packetization_callback_
- GUARDED_BY(callback_crit_sect_);
- ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_);
+ RTC_GUARDED_BY(callback_crit_sect_);
+ ACMVADCallback* vad_callback_ RTC_GUARDED_BY(callback_crit_sect_);
int codec_histogram_bins_log_[static_cast<size_t>(
AudioEncoder::CodecType::kMaxLoggedAudioCodecTypes)];
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc
index 1d8571d..9c7e4cd 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc
@@ -146,11 +146,11 @@
}
private:
- int num_calls_ GUARDED_BY(crit_sect_);
- FrameType last_frame_type_ GUARDED_BY(crit_sect_);
- int last_payload_type_ GUARDED_BY(crit_sect_);
- uint32_t last_timestamp_ GUARDED_BY(crit_sect_);
- std::vector<uint8_t> last_payload_vec_ GUARDED_BY(crit_sect_);
+ int num_calls_ RTC_GUARDED_BY(crit_sect_);
+ FrameType last_frame_type_ RTC_GUARDED_BY(crit_sect_);
+ int last_payload_type_ RTC_GUARDED_BY(crit_sect_);
+ uint32_t last_timestamp_ RTC_GUARDED_BY(crit_sect_);
+ std::vector<uint8_t> last_payload_vec_ RTC_GUARDED_BY(crit_sect_);
rtc::CriticalSection crit_sect_;
};
@@ -607,9 +607,9 @@
const std::unique_ptr<EventWrapper> test_complete_;
int send_count_;
int insert_packet_count_;
- int pull_audio_count_ GUARDED_BY(crit_sect_);
+ int pull_audio_count_ RTC_GUARDED_BY(crit_sect_);
rtc::CriticalSection crit_sect_;
- int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
+ int64_t next_insert_packet_time_ms_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<SimulatedClock> fake_clock_;
};
@@ -879,9 +879,9 @@
rtc::PlatformThread codec_registration_thread_;
const std::unique_ptr<EventWrapper> test_complete_;
rtc::CriticalSection crit_sect_;
- bool codec_registered_ GUARDED_BY(crit_sect_);
- int receive_packet_count_ GUARDED_BY(crit_sect_);
- int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
+ bool codec_registered_ RTC_GUARDED_BY(crit_sect_);
+ int receive_packet_count_ RTC_GUARDED_BY(crit_sect_);
+ int64_t next_insert_packet_time_ms_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<AudioEncoderIsacFloatImpl> isac_encoder_;
std::unique_ptr<SimulatedClock> fake_clock_;
test::AudioLoop audio_loop_;