From 56359be7fea745a29a47d3a36b99016e6dbd2741 Mon Sep 17 00:00:00 2001 From: danilchap Date: Thu, 7 Sep 2017 07:53:45 -0700 Subject: [PATCH] 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} --- .../modules/audio_coding/acm2/acm_receiver.h | 20 +- .../audio_coding/acm2/audio_coding_module.cc | 51 ++-- .../acm2/audio_coding_module_unittest.cc | 20 +- .../codecs/isac/locked_bandwidth_info.h | 2 +- .../modules/audio_coding/neteq/neteq_impl.h | 160 +++++------ .../audio_device/audio_device_buffer.h | 40 +-- .../audio_device/audio_device_unittest.cc | 16 +- .../audio_device/ios/audio_device_ios.h | 12 +- .../linux/audio_device_alsa_linux.h | 4 +- .../linux/audio_device_pulse_linux.cc | 4 +- .../linux/audio_device_pulse_linux.h | 253 +++++++++--------- webrtc/modules/audio_mixer/audio_mixer_impl.h | 13 +- .../audio_processing/aec3/echo_canceller3.h | 22 +- .../audio_processing/audio_processing_impl.h | 101 +++---- .../audio_processing_impl_locking_unittest.cc | 6 +- .../audio_processing_impl_unittest.cc | 2 +- .../audio_processing/echo_cancellation_impl.h | 22 +- .../echo_control_mobile_impl.h | 10 +- .../audio_processing/gain_control_impl.h | 24 +- .../audio_processing/level_estimator_impl.h | 4 +- .../audio_processing/noise_suppression_impl.h | 10 +- .../audio_processing/voice_detection_impl.h | 16 +- .../bitrate_controller_impl.h | 16 +- .../receive_side_congestion_controller.h | 4 +- .../include/send_side_congestion_controller.h | 16 +- .../congestion_controller/probe_controller.h | 37 +-- .../transport_feedback_adapter.h | 15 +- webrtc/modules/pacing/paced_sender.h | 36 +-- webrtc/modules/pacing/packet_router.h | 26 +- .../remote_bitrate_estimator_abs_send_time.h | 11 +- .../remote_bitrate_estimator_single_stream.h | 18 +- .../remote_estimator_proxy.h | 14 +- .../rtp_rtcp/include/flexfec_receiver.h | 10 +- .../rtp_rtcp/include/rtp_payload_registry.h | 7 +- .../rtp_rtcp/source/playout_delay_oracle.h | 10 +- .../rtp_rtcp/source/receive_statistics_impl.h | 2 +- .../modules/rtp_rtcp/source/rtcp_receiver.h | 69 ++--- webrtc/modules/rtp_rtcp/source/rtcp_sender.h | 105 ++++---- .../rtp_rtcp/source/rtp_header_parser.cc | 3 +- .../rtp_rtcp/source/rtp_packet_history.h | 16 +- webrtc/modules/rtp_rtcp/source/rtp_sender.h | 56 ++-- .../rtp_rtcp/source/rtp_sender_audio.h | 18 +- .../rtp_rtcp/source/rtp_sender_video.h | 28 +- .../codecs/h264/h264_decoder_impl.cc | 4 +- .../codecs/test/video_codec_test.h | 10 +- .../video_coding/codecs/test/videoprocessor.h | 22 +- .../codecs/vp9/vp9_frame_buffer_pool.h | 2 +- webrtc/modules/video_coding/frame_buffer2.h | 44 +-- webrtc/modules/video_coding/generic_decoder.h | 2 +- webrtc/modules/video_coding/generic_encoder.h | 12 +- webrtc/modules/video_coding/jitter_buffer.h | 55 ++-- .../modules/video_coding/media_optimization.h | 36 +-- webrtc/modules/video_coding/nack_module.h | 22 +- webrtc/modules/video_coding/packet_buffer.h | 32 +-- .../protection_bitrate_calculator.h | 4 +- .../video_coding/rtp_frame_reference_finder.h | 59 ++-- webrtc/modules/video_coding/timing.h | 36 +-- .../video_coding/utility/quality_scaler.h | 12 +- .../modules/video_coding/video_coding_impl.cc | 2 +- .../modules/video_coding/video_coding_impl.h | 32 +-- 60 files changed, 878 insertions(+), 837 deletions(-) diff --git a/webrtc/modules/audio_coding/acm2/acm_receiver.h b/webrtc/modules/audio_coding/acm2/acm_receiver.h index ebeecec7f9..93ff89cb68 100644 --- a/webrtc/modules/audio_coding/acm2/acm_receiver.h +++ b/webrtc/modules/audio_coding/acm2/acm_receiver.h @@ -269,22 +269,22 @@ class AcmReceiver { int sample_rate_hz; }; - const rtc::Optional RtpHeaderToDecoder( - const RTPHeader& rtp_header, - uint8_t first_payload_byte) const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + const rtc::Optional 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 last_audio_decoder_ GUARDED_BY(crit_sect_); - rtc::Optional last_audio_format_ GUARDED_BY(crit_sect_); - ACMResampler resampler_ GUARDED_BY(crit_sect_); - std::unique_ptr last_audio_buffer_ GUARDED_BY(crit_sect_); - CallStatistics call_stats_ GUARDED_BY(crit_sect_); + rtc::Optional last_audio_decoder_ RTC_GUARDED_BY(crit_sect_); + rtc::Optional last_audio_format_ RTC_GUARDED_BY(crit_sect_); + ACMResampler resampler_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr last_audio_buffer_ RTC_GUARDED_BY(crit_sect_); + CallStatistics call_stats_ RTC_GUARDED_BY(crit_sect_); const std::unique_ptr neteq_; // NetEq is thread-safe; no lock needed. const Clock* const clock_; - bool resampled_last_output_frame_ GUARDED_BY(crit_sect_); - rtc::Optional last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_); + bool resampled_last_output_frame_ RTC_GUARDED_BY(crit_sect_); + rtc::Optional 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 1495818185..f7607c6521 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 @@ class AudioCodingModuleImpl final : public AudioCodingModule { int RegisterReceiveCodecUnlocked( const CodecInst& codec, rtc::FunctionView()> 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 @@ class AudioCodingModuleImpl final : public AudioCodingModule { // 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 encoder_factory_ GUARDED_BY(acm_crit_sect_); + std::unique_ptr 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 encoder_stack_ GUARDED_BY(acm_crit_sect_); + std::unique_ptr encoder_stack_ RTC_GUARDED_BY(acm_crit_sect_); - std::unique_ptr isac_decoder_16k_ GUARDED_BY(acm_crit_sect_); - std::unique_ptr isac_decoder_32k_ GUARDED_BY(acm_crit_sect_); + std::unique_ptr isac_decoder_16k_ + RTC_GUARDED_BY(acm_crit_sect_); + std::unique_ptr 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 @@ class AudioCodingModuleImpl final : public AudioCodingModule { // be used in other methods, locks need to be taken. std::unique_ptr 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( 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 1d8571d017..9c7e4cd97f 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 @@ class PacketizationCallbackStubOldApi : public AudioPacketizationCallback { } 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 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 last_payload_vec_ RTC_GUARDED_BY(crit_sect_); rtc::CriticalSection crit_sect_; }; @@ -607,9 +607,9 @@ class AudioCodingModuleMtTestOldApi : public AudioCodingModuleTestOldApi { const std::unique_ptr 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 fake_clock_; }; @@ -879,9 +879,9 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi { rtc::PlatformThread codec_registration_thread_; const std::unique_ptr 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 isac_encoder_; std::unique_ptr fake_clock_; test::AudioLoop audio_loop_; diff --git a/webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h b/webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h index 65bea4c924..a0e74b55e2 100644 --- a/webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h +++ b/webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h @@ -48,7 +48,7 @@ class LockedIsacBandwidthInfo final { private: mutable volatile int ref_count_; rtc::CriticalSection lock_; - IsacBandwidthInfo bwinfo_ GUARDED_BY(lock_); + IsacBandwidthInfo bwinfo_ RTC_GUARDED_BY(lock_); }; } // namespace webrtc diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.h b/webrtc/modules/audio_coding/neteq/neteq_impl.h index fea1682f74..ea10558725 100644 --- a/webrtc/modules/audio_coding/neteq/neteq_impl.h +++ b/webrtc/modules/audio_coding/neteq/neteq_impl.h @@ -244,12 +244,12 @@ class NetEqImpl : public webrtc::NetEq { int InsertPacketInternal(const RTPHeader& rtp_header, rtc::ArrayView payload, uint32_t receive_timestamp) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Delivers 10 ms of audio data. The data is written to |audio_frame|. // Returns 0 on success, otherwise an error code. int GetAudioInternal(AudioFrame* audio_frame, bool* muted) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Provides a decision to the GetAudioInternal method. The decision what to // do is written to |operation|. Packets to decode are written to @@ -259,7 +259,7 @@ class NetEqImpl : public webrtc::NetEq { int GetDecision(Operations* operation, PacketList* packet_list, DtmfEvent* dtmf_event, - bool* play_dtmf) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + bool* play_dtmf) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Decodes the speech packets in |packet_list|, and writes the results to // |decoded_buffer|, which is allocated to hold |decoded_buffer_length| @@ -271,12 +271,13 @@ class NetEqImpl : public webrtc::NetEq { Operations* operation, int* decoded_length, AudioDecoder::SpeechType* speech_type) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Sub-method to Decode(). Performs codec internal CNG. - int DecodeCng(AudioDecoder* decoder, int* decoded_length, + int DecodeCng(AudioDecoder* decoder, + int* decoded_length, AudioDecoder::SpeechType* speech_type) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Sub-method to Decode(). Performs the actual decoding. int DecodeLoop(PacketList* packet_list, @@ -284,22 +285,22 @@ class NetEqImpl : public webrtc::NetEq { AudioDecoder* decoder, int* decoded_length, AudioDecoder::SpeechType* speech_type) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Sub-method which calls the Normal class to perform the normal operation. void DoNormal(const int16_t* decoded_buffer, size_t decoded_length, AudioDecoder::SpeechType speech_type, - bool play_dtmf) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + bool play_dtmf) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Sub-method which calls the Merge class to perform the merge operation. void DoMerge(int16_t* decoded_buffer, size_t decoded_length, AudioDecoder::SpeechType speech_type, - bool play_dtmf) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + bool play_dtmf) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Sub-method which calls the Expand class to perform the expand operation. - int DoExpand(bool play_dtmf) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + int DoExpand(bool play_dtmf) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Sub-method which calls the Accelerate class to perform the accelerate // operation. @@ -307,131 +308,138 @@ class NetEqImpl : public webrtc::NetEq { size_t decoded_length, AudioDecoder::SpeechType speech_type, bool play_dtmf, - bool fast_accelerate) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + bool fast_accelerate) + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Sub-method which calls the PreemptiveExpand class to perform the // preemtive expand operation. int DoPreemptiveExpand(int16_t* decoded_buffer, size_t decoded_length, AudioDecoder::SpeechType speech_type, - bool play_dtmf) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + bool play_dtmf) + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Sub-method which calls the ComfortNoise class to generate RFC 3389 comfort // noise. |packet_list| can either contain one SID frame to update the // noise parameters, or no payload at all, in which case the previously // received parameters are used. int DoRfc3389Cng(PacketList* packet_list, bool play_dtmf) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Calls the audio decoder to generate codec-internal comfort noise when // no packet was received. void DoCodecInternalCng(const int16_t* decoded_buffer, size_t decoded_length) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Calls the DtmfToneGenerator class to generate DTMF tones. int DoDtmf(const DtmfEvent& dtmf_event, bool* play_dtmf) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Produces packet-loss concealment using alternative methods. If the codec // has an internal PLC, it is called to generate samples. Otherwise, the // method performs zero-stuffing. void DoAlternativePlc(bool increase_timestamp) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Overdub DTMF on top of |output|. int DtmfOverdub(const DtmfEvent& dtmf_event, size_t num_channels, - int16_t* output) const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + int16_t* output) const + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Extracts packets from |packet_buffer_| to produce at least // |required_samples| samples. The packets are inserted into |packet_list|. // Returns the number of samples that the packets in the list will produce, or // -1 in case of an error. int ExtractPackets(size_t required_samples, PacketList* packet_list) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Resets various variables and objects to new values based on the sample rate // |fs_hz| and |channels| number audio channels. void SetSampleRateAndChannels(int fs_hz, size_t channels) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Returns the output type for the audio produced by the latest call to // GetAudio(). - OutputType LastOutputType() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + OutputType LastOutputType() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Updates Expand and Merge. virtual void UpdatePlcComponents(int fs_hz, size_t channels) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Creates DecisionLogic object with the mode given by |playout_mode_|. - virtual void CreateDecisionLogic() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + virtual void CreateDecisionLogic() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); rtc::CriticalSection crit_sect_; - const std::unique_ptr tick_timer_ GUARDED_BY(crit_sect_); + const std::unique_ptr tick_timer_ RTC_GUARDED_BY(crit_sect_); const std::unique_ptr buffer_level_filter_ - GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); const std::unique_ptr decoder_database_ - GUARDED_BY(crit_sect_); - const std::unique_ptr delay_manager_ GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); + const std::unique_ptr delay_manager_ RTC_GUARDED_BY(crit_sect_); const std::unique_ptr delay_peak_detector_ - GUARDED_BY(crit_sect_); - const std::unique_ptr dtmf_buffer_ GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); + const std::unique_ptr dtmf_buffer_ RTC_GUARDED_BY(crit_sect_); const std::unique_ptr dtmf_tone_generator_ - GUARDED_BY(crit_sect_); - const std::unique_ptr packet_buffer_ GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); + const std::unique_ptr packet_buffer_ RTC_GUARDED_BY(crit_sect_); const std::unique_ptr red_payload_splitter_ - GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); const std::unique_ptr timestamp_scaler_ - GUARDED_BY(crit_sect_); - const std::unique_ptr vad_ GUARDED_BY(crit_sect_); - const std::unique_ptr expand_factory_ GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); + const std::unique_ptr vad_ RTC_GUARDED_BY(crit_sect_); + const std::unique_ptr expand_factory_ + RTC_GUARDED_BY(crit_sect_); const std::unique_ptr accelerate_factory_ - GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); const std::unique_ptr preemptive_expand_factory_ - GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); - std::unique_ptr background_noise_ GUARDED_BY(crit_sect_); - std::unique_ptr decision_logic_ GUARDED_BY(crit_sect_); - std::unique_ptr algorithm_buffer_ GUARDED_BY(crit_sect_); - std::unique_ptr sync_buffer_ GUARDED_BY(crit_sect_); - std::unique_ptr expand_ GUARDED_BY(crit_sect_); - std::unique_ptr normal_ GUARDED_BY(crit_sect_); - std::unique_ptr merge_ GUARDED_BY(crit_sect_); - std::unique_ptr accelerate_ GUARDED_BY(crit_sect_); - std::unique_ptr preemptive_expand_ GUARDED_BY(crit_sect_); - RandomVector random_vector_ GUARDED_BY(crit_sect_); - std::unique_ptr comfort_noise_ GUARDED_BY(crit_sect_); - Rtcp rtcp_ GUARDED_BY(crit_sect_); - StatisticsCalculator stats_ GUARDED_BY(crit_sect_); - int fs_hz_ GUARDED_BY(crit_sect_); - int fs_mult_ GUARDED_BY(crit_sect_); - int last_output_sample_rate_hz_ GUARDED_BY(crit_sect_); - size_t output_size_samples_ GUARDED_BY(crit_sect_); - size_t decoder_frame_length_ GUARDED_BY(crit_sect_); - Modes last_mode_ GUARDED_BY(crit_sect_); - Operations last_operation_ GUARDED_BY(crit_sect_); - std::unique_ptr mute_factor_array_ GUARDED_BY(crit_sect_); - size_t decoded_buffer_length_ GUARDED_BY(crit_sect_); - std::unique_ptr decoded_buffer_ GUARDED_BY(crit_sect_); - uint32_t playout_timestamp_ GUARDED_BY(crit_sect_); - bool new_codec_ GUARDED_BY(crit_sect_); - uint32_t timestamp_ GUARDED_BY(crit_sect_); - bool reset_decoder_ GUARDED_BY(crit_sect_); - rtc::Optional current_rtp_payload_type_ GUARDED_BY(crit_sect_); - rtc::Optional current_cng_rtp_payload_type_ GUARDED_BY(crit_sect_); - uint32_t ssrc_ GUARDED_BY(crit_sect_); - bool first_packet_ GUARDED_BY(crit_sect_); - const BackgroundNoiseMode background_noise_mode_ GUARDED_BY(crit_sect_); - NetEqPlayoutMode playout_mode_ GUARDED_BY(crit_sect_); - bool enable_fast_accelerate_ GUARDED_BY(crit_sect_); - std::unique_ptr nack_ GUARDED_BY(crit_sect_); - bool nack_enabled_ GUARDED_BY(crit_sect_); - const bool enable_muted_state_ GUARDED_BY(crit_sect_); - AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = + std::unique_ptr background_noise_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr decision_logic_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr algorithm_buffer_ + RTC_GUARDED_BY(crit_sect_); + std::unique_ptr sync_buffer_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr expand_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr normal_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr merge_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr accelerate_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr preemptive_expand_ + RTC_GUARDED_BY(crit_sect_); + RandomVector random_vector_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr comfort_noise_ RTC_GUARDED_BY(crit_sect_); + Rtcp rtcp_ RTC_GUARDED_BY(crit_sect_); + StatisticsCalculator stats_ RTC_GUARDED_BY(crit_sect_); + int fs_hz_ RTC_GUARDED_BY(crit_sect_); + int fs_mult_ RTC_GUARDED_BY(crit_sect_); + int last_output_sample_rate_hz_ RTC_GUARDED_BY(crit_sect_); + size_t output_size_samples_ RTC_GUARDED_BY(crit_sect_); + size_t decoder_frame_length_ RTC_GUARDED_BY(crit_sect_); + Modes last_mode_ RTC_GUARDED_BY(crit_sect_); + Operations last_operation_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr mute_factor_array_ RTC_GUARDED_BY(crit_sect_); + size_t decoded_buffer_length_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr decoded_buffer_ RTC_GUARDED_BY(crit_sect_); + uint32_t playout_timestamp_ RTC_GUARDED_BY(crit_sect_); + bool new_codec_ RTC_GUARDED_BY(crit_sect_); + uint32_t timestamp_ RTC_GUARDED_BY(crit_sect_); + bool reset_decoder_ RTC_GUARDED_BY(crit_sect_); + rtc::Optional current_rtp_payload_type_ RTC_GUARDED_BY(crit_sect_); + rtc::Optional current_cng_rtp_payload_type_ + RTC_GUARDED_BY(crit_sect_); + uint32_t ssrc_ RTC_GUARDED_BY(crit_sect_); + bool first_packet_ RTC_GUARDED_BY(crit_sect_); + const BackgroundNoiseMode background_noise_mode_ RTC_GUARDED_BY(crit_sect_); + NetEqPlayoutMode playout_mode_ RTC_GUARDED_BY(crit_sect_); + bool enable_fast_accelerate_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr nack_ RTC_GUARDED_BY(crit_sect_); + bool nack_enabled_ RTC_GUARDED_BY(crit_sect_); + const bool enable_muted_state_ RTC_GUARDED_BY(crit_sect_); + AudioFrame::VADActivity last_vad_activity_ RTC_GUARDED_BY(crit_sect_) = AudioFrame::kVadPassive; std::unique_ptr generated_noise_stopwatch_ - GUARDED_BY(crit_sect_); - std::vector last_decoded_timestamps_ GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); + std::vector last_decoded_timestamps_ RTC_GUARDED_BY(crit_sect_); private: RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); diff --git a/webrtc/modules/audio_device/audio_device_buffer.h b/webrtc/modules/audio_device/audio_device_buffer.h index a9163ea0a6..ed8b1f7722 100644 --- a/webrtc/modules/audio_device/audio_device_buffer.h +++ b/webrtc/modules/audio_device/audio_device_buffer.h @@ -188,58 +188,58 @@ class AudioDeviceBuffer { // Keeps track of if playout/recording are active or not. A combination // of these states are used to determine when to start and stop the timer. // Only used on the creating thread and not used to control any media flow. - bool playing_ ACCESS_ON(main_thread_checker_); - bool recording_ ACCESS_ON(main_thread_checker_); + bool playing_ RTC_ACCESS_ON(main_thread_checker_); + bool recording_ RTC_ACCESS_ON(main_thread_checker_); // Buffer used for audio samples to be played out. Size can be changed // dynamically. The 16-bit samples are interleaved, hence the size is // proportional to the number of channels. - rtc::BufferT play_buffer_ ACCESS_ON(playout_thread_checker_); + rtc::BufferT play_buffer_ RTC_ACCESS_ON(playout_thread_checker_); // Byte buffer used for recorded audio samples. Size can be changed // dynamically. - rtc::BufferT rec_buffer_ ACCESS_ON(recording_thread_checker_); + rtc::BufferT rec_buffer_ RTC_ACCESS_ON(recording_thread_checker_); // AGC parameters. #if !defined(WEBRTC_WIN) - uint32_t current_mic_level_ ACCESS_ON(recording_thread_checker_); + uint32_t current_mic_level_ RTC_ACCESS_ON(recording_thread_checker_); #else // Windows uses a dedicated thread for volume APIs. uint32_t current_mic_level_; #endif - uint32_t new_mic_level_ ACCESS_ON(recording_thread_checker_); + uint32_t new_mic_level_ RTC_ACCESS_ON(recording_thread_checker_); // Contains true of a key-press has been detected. - bool typing_status_ ACCESS_ON(recording_thread_checker_); + bool typing_status_ RTC_ACCESS_ON(recording_thread_checker_); // Delay values used by the AEC. - int play_delay_ms_ ACCESS_ON(recording_thread_checker_); - int rec_delay_ms_ ACCESS_ON(recording_thread_checker_); + int play_delay_ms_ RTC_ACCESS_ON(recording_thread_checker_); + int rec_delay_ms_ RTC_ACCESS_ON(recording_thread_checker_); // Contains a clock-drift measurement. - int clock_drift_ ACCESS_ON(recording_thread_checker_); + int clock_drift_ RTC_ACCESS_ON(recording_thread_checker_); // Counts number of times LogStats() has been called. - size_t num_stat_reports_ ACCESS_ON(task_queue_); + size_t num_stat_reports_ RTC_ACCESS_ON(task_queue_); // Time stamp of last timer task (drives logging). - int64_t last_timer_task_time_ ACCESS_ON(task_queue_); + int64_t last_timer_task_time_ RTC_ACCESS_ON(task_queue_); // Counts number of audio callbacks modulo 50 to create a signal when // a new storage of audio stats shall be done. - int16_t rec_stat_count_ ACCESS_ON(recording_thread_checker_); - int16_t play_stat_count_ ACCESS_ON(playout_thread_checker_); + int16_t rec_stat_count_ RTC_ACCESS_ON(recording_thread_checker_); + int16_t play_stat_count_ RTC_ACCESS_ON(playout_thread_checker_); // Time stamps of when playout and recording starts. - int64_t play_start_time_ ACCESS_ON(main_thread_checker_); - int64_t rec_start_time_ ACCESS_ON(main_thread_checker_); + int64_t play_start_time_ RTC_ACCESS_ON(main_thread_checker_); + int64_t rec_start_time_ RTC_ACCESS_ON(main_thread_checker_); // Contains counters for playout and recording statistics. - Stats stats_ GUARDED_BY(lock_); + Stats stats_ RTC_GUARDED_BY(lock_); // Stores current stats at each timer task. Used to calculate differences // between two successive timer events. - Stats last_stats_ ACCESS_ON(task_queue_); + Stats last_stats_ RTC_ACCESS_ON(task_queue_); // Set to true at construction and modified to false as soon as one audio- // level estimate larger than zero is detected. @@ -249,12 +249,12 @@ class AudioDeviceBuffer { // StartPeriodicLogging() and set to false by StopPeriodicLogging(). // Setting this member to false prevents (possiby invalid) log messages from // being printed in the LogStats() task. - bool log_stats_ ACCESS_ON(task_queue_); + bool log_stats_ RTC_ACCESS_ON(task_queue_); // Should *never* be defined in production builds. Only used for testing. // When defined, the output signal will be replaced by a sinus tone at 440Hz. #ifdef AUDIO_DEVICE_PLAYS_SINUS_TONE - double phase_ ACCESS_ON(playout_thread_checker_); + double phase_ RTC_ACCESS_ON(playout_thread_checker_); #endif }; diff --git a/webrtc/modules/audio_device/audio_device_unittest.cc b/webrtc/modules/audio_device/audio_device_unittest.cc index c65f139192..24db9ae8e5 100644 --- a/webrtc/modules/audio_device/audio_device_unittest.cc +++ b/webrtc/modules/audio_device/audio_device_unittest.cc @@ -173,10 +173,10 @@ class FifoAudioStream : public AudioStream { rtc::CriticalSection lock_; rtc::RaceChecker race_checker_; - std::list fifo_ GUARDED_BY(lock_); - size_t write_count_ GUARDED_BY(race_checker_) = 0; - size_t max_size_ GUARDED_BY(race_checker_) = 0; - size_t written_elements_ GUARDED_BY(race_checker_) = 0; + std::list fifo_ RTC_GUARDED_BY(lock_); + size_t write_count_ RTC_GUARDED_BY(race_checker_) = 0; + size_t max_size_ RTC_GUARDED_BY(race_checker_) = 0; + size_t written_elements_ RTC_GUARDED_BY(race_checker_) = 0; }; // Inserts periodic impulses and measures the latency between the time of @@ -293,10 +293,10 @@ class LatencyAudioStream : public AudioStream { rtc::ThreadChecker read_thread_checker_; rtc::ThreadChecker write_thread_checker_; - rtc::Optional pulse_time_ GUARDED_BY(lock_); - std::vector latencies_ GUARDED_BY(race_checker_); - size_t read_count_ ACCESS_ON(read_thread_checker_) = 0; - size_t write_count_ ACCESS_ON(write_thread_checker_) = 0; + rtc::Optional pulse_time_ RTC_GUARDED_BY(lock_); + std::vector latencies_ RTC_GUARDED_BY(race_checker_); + size_t read_count_ RTC_ACCESS_ON(read_thread_checker_) = 0; + size_t write_count_ RTC_ACCESS_ON(write_thread_checker_) = 0; }; // Mocks the AudioTransport object and proxies actions for the two callbacks diff --git a/webrtc/modules/audio_device/ios/audio_device_ios.h b/webrtc/modules/audio_device/ios/audio_device_ios.h index 7cccc16b59..5c15c7f05d 100644 --- a/webrtc/modules/audio_device/ios/audio_device_ios.h +++ b/webrtc/modules/audio_device/ios/audio_device_ios.h @@ -269,7 +269,7 @@ class AudioDeviceIOS : public AudioDeviceGeneric, volatile int playing_; // Set to true after successful call to Init(), false otherwise. - bool initialized_ ACCESS_ON(thread_checker_); + bool initialized_ RTC_ACCESS_ON(thread_checker_); // Set to true after successful call to InitRecording() or InitPlayout(), // false otherwise. @@ -280,14 +280,14 @@ class AudioDeviceIOS : public AudioDeviceGeneric, // Audio interruption observer instance. RTCAudioSessionDelegateAdapter* audio_session_observer_ - ACCESS_ON(thread_checker_); + RTC_ACCESS_ON(thread_checker_); // Set to true if we've activated the audio session. - bool has_configured_session_ ACCESS_ON(thread_checker_); + bool has_configured_session_ RTC_ACCESS_ON(thread_checker_); // Counts number of detected audio glitches on the playout side. - int64_t num_detected_playout_glitches_ ACCESS_ON(thread_checker_); - int64_t last_playout_time_ ACCESS_ON(io_thread_checker_); + int64_t num_detected_playout_glitches_ RTC_ACCESS_ON(thread_checker_); + int64_t last_playout_time_ RTC_ACCESS_ON(io_thread_checker_); // Counts number of playout callbacks per call. // The value isupdated on the native I/O thread and later read on the @@ -296,7 +296,7 @@ class AudioDeviceIOS : public AudioDeviceGeneric, int64_t num_playout_callbacks_; // Contains the time for when the last output volume change was detected. - int64_t last_output_volume_change_time_ ACCESS_ON(thread_checker_); + int64_t last_output_volume_change_time_ RTC_ACCESS_ON(thread_checker_); // Exposes private members for testing purposes only. FRIEND_TEST_ALL_PREFIXES(AudioDeviceTest, testInterruptedAudioSession); diff --git a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.h b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.h index 264846544c..034f083c62 100644 --- a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.h +++ b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.h @@ -146,8 +146,8 @@ private: bool KeyPressed() const; - void Lock() EXCLUSIVE_LOCK_FUNCTION(_critSect) { _critSect.Enter(); }; - void UnLock() UNLOCK_FUNCTION(_critSect) { _critSect.Leave(); }; + void Lock() RTC_EXCLUSIVE_LOCK_FUNCTION(_critSect) { _critSect.Enter(); }; + void UnLock() RTC_UNLOCK_FUNCTION(_critSect) { _critSect.Leave(); }; inline int32_t InputSanityCheckAfterUnlockedPeriod() const; inline int32_t OutputSanityCheckAfterUnlockedPeriod() const; diff --git a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc index 0e03932f18..02f03c7f5f 100644 --- a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc +++ b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc @@ -1947,7 +1947,7 @@ int32_t AudioDeviceLinuxPulse::LatencyUsecs(pa_stream* stream) { int32_t AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData, size_t bufferSize) - EXCLUSIVE_LOCKS_REQUIRED(_critSect) { + RTC_EXCLUSIVE_LOCKS_REQUIRED(_critSect) { size_t size = bufferSize; uint32_t numRecSamples = _recordBufferSize / (2 * _recChannels); @@ -2017,7 +2017,7 @@ int32_t AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData, int32_t AudioDeviceLinuxPulse::ProcessRecordedData(int8_t* bufferData, uint32_t bufferSizeInSamples, uint32_t recDelay) - EXCLUSIVE_LOCKS_REQUIRED(_critSect) { + RTC_EXCLUSIVE_LOCKS_REQUIRED(_critSect) { uint32_t currentMicLevel(0); uint32_t newMicLevel(0); diff --git a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.h b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.h index 7e8d68347b..6170944212 100644 --- a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.h +++ b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.h @@ -199,153 +199,156 @@ public: void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override; private: - void Lock() EXCLUSIVE_LOCK_FUNCTION(_critSect) { - _critSect.Enter(); - } - void UnLock() UNLOCK_FUNCTION(_critSect) { - _critSect.Leave(); - } - void WaitForOperationCompletion(pa_operation* paOperation) const; - void WaitForSuccess(pa_operation* paOperation) const; + void Lock() RTC_EXCLUSIVE_LOCK_FUNCTION(_critSect) { _critSect.Enter(); } + void UnLock() RTC_UNLOCK_FUNCTION(_critSect) { _critSect.Leave(); } + void WaitForOperationCompletion(pa_operation* paOperation) const; + void WaitForSuccess(pa_operation* paOperation) const; - bool KeyPressed() const; + bool KeyPressed() const; - static void PaContextStateCallback(pa_context *c, void *pThis); - static void PaSinkInfoCallback(pa_context *c, const pa_sink_info *i, - int eol, void *pThis); - static void PaSourceInfoCallback(pa_context *c, const pa_source_info *i, - int eol, void *pThis); - static void PaServerInfoCallback(pa_context *c, const pa_server_info *i, - void *pThis); - static void PaStreamStateCallback(pa_stream *p, void *pThis); - void PaContextStateCallbackHandler(pa_context *c); - void PaSinkInfoCallbackHandler(const pa_sink_info *i, int eol); - void PaSourceInfoCallbackHandler(const pa_source_info *i, int eol); - void PaServerInfoCallbackHandler(const pa_server_info *i); - void PaStreamStateCallbackHandler(pa_stream *p); + static void PaContextStateCallback(pa_context* c, void* pThis); + static void PaSinkInfoCallback(pa_context* c, + const pa_sink_info* i, + int eol, + void* pThis); + static void PaSourceInfoCallback(pa_context* c, + const pa_source_info* i, + int eol, + void* pThis); + static void PaServerInfoCallback(pa_context* c, + const pa_server_info* i, + void* pThis); + static void PaStreamStateCallback(pa_stream* p, void* pThis); + void PaContextStateCallbackHandler(pa_context* c); + void PaSinkInfoCallbackHandler(const pa_sink_info* i, int eol); + void PaSourceInfoCallbackHandler(const pa_source_info* i, int eol); + void PaServerInfoCallbackHandler(const pa_server_info* i); + void PaStreamStateCallbackHandler(pa_stream* p); - void EnableWriteCallback(); - void DisableWriteCallback(); - static void PaStreamWriteCallback(pa_stream *unused, size_t buffer_space, - void *pThis); - void PaStreamWriteCallbackHandler(size_t buffer_space); - static void PaStreamUnderflowCallback(pa_stream *unused, void *pThis); - void PaStreamUnderflowCallbackHandler(); - void EnableReadCallback(); - void DisableReadCallback(); - static void PaStreamReadCallback(pa_stream *unused1, size_t unused2, - void *pThis); - void PaStreamReadCallbackHandler(); - static void PaStreamOverflowCallback(pa_stream *unused, void *pThis); - void PaStreamOverflowCallbackHandler(); - int32_t LatencyUsecs(pa_stream *stream); - int32_t ReadRecordedData(const void* bufferData, size_t bufferSize); - int32_t ProcessRecordedData(int8_t *bufferData, - uint32_t bufferSizeInSamples, - uint32_t recDelay); + void EnableWriteCallback(); + void DisableWriteCallback(); + static void PaStreamWriteCallback(pa_stream* unused, + size_t buffer_space, + void* pThis); + void PaStreamWriteCallbackHandler(size_t buffer_space); + static void PaStreamUnderflowCallback(pa_stream* unused, void* pThis); + void PaStreamUnderflowCallbackHandler(); + void EnableReadCallback(); + void DisableReadCallback(); + static void PaStreamReadCallback(pa_stream* unused1, + size_t unused2, + void* pThis); + void PaStreamReadCallbackHandler(); + static void PaStreamOverflowCallback(pa_stream* unused, void* pThis); + void PaStreamOverflowCallbackHandler(); + int32_t LatencyUsecs(pa_stream* stream); + int32_t ReadRecordedData(const void* bufferData, size_t bufferSize); + int32_t ProcessRecordedData(int8_t* bufferData, + uint32_t bufferSizeInSamples, + uint32_t recDelay); - int32_t CheckPulseAudioVersion(); - int32_t InitSamplingFrequency(); - int32_t GetDefaultDeviceInfo(bool recDevice, char* name, uint16_t& index); - int32_t InitPulseAudio(); - int32_t TerminatePulseAudio(); + int32_t CheckPulseAudioVersion(); + int32_t InitSamplingFrequency(); + int32_t GetDefaultDeviceInfo(bool recDevice, char* name, uint16_t& index); + int32_t InitPulseAudio(); + int32_t TerminatePulseAudio(); - void PaLock(); - void PaUnLock(); + void PaLock(); + void PaUnLock(); - static bool RecThreadFunc(void*); - static bool PlayThreadFunc(void*); - bool RecThreadProcess(); - bool PlayThreadProcess(); + static bool RecThreadFunc(void*); + static bool PlayThreadFunc(void*); + bool RecThreadProcess(); + bool PlayThreadProcess(); - AudioDeviceBuffer* _ptrAudioBuffer; + AudioDeviceBuffer* _ptrAudioBuffer; - rtc::CriticalSection _critSect; - EventWrapper& _timeEventRec; - EventWrapper& _timeEventPlay; - EventWrapper& _recStartEvent; - EventWrapper& _playStartEvent; + rtc::CriticalSection _critSect; + EventWrapper& _timeEventRec; + EventWrapper& _timeEventPlay; + EventWrapper& _recStartEvent; + EventWrapper& _playStartEvent; - // TODO(pbos): Remove unique_ptr and use directly without resetting. - std::unique_ptr _ptrThreadPlay; - std::unique_ptr _ptrThreadRec; + // TODO(pbos): Remove unique_ptr and use directly without resetting. + std::unique_ptr _ptrThreadPlay; + std::unique_ptr _ptrThreadRec; - AudioMixerManagerLinuxPulse _mixerManager; + AudioMixerManagerLinuxPulse _mixerManager; - uint16_t _inputDeviceIndex; - uint16_t _outputDeviceIndex; - bool _inputDeviceIsSpecified; - bool _outputDeviceIsSpecified; + uint16_t _inputDeviceIndex; + uint16_t _outputDeviceIndex; + bool _inputDeviceIsSpecified; + bool _outputDeviceIsSpecified; - int sample_rate_hz_; - uint8_t _recChannels; - uint8_t _playChannels; + int sample_rate_hz_; + uint8_t _recChannels; + uint8_t _playChannels; - // Stores thread ID in constructor. - // We can then use ThreadChecker::CalledOnValidThread() to ensure that - // other methods are called from the same thread. - // Currently only does RTC_DCHECK(thread_checker_.CalledOnValidThread()). - rtc::ThreadChecker thread_checker_; + // Stores thread ID in constructor. + // We can then use ThreadChecker::CalledOnValidThread() to ensure that + // other methods are called from the same thread. + // Currently only does RTC_DCHECK(thread_checker_.CalledOnValidThread()). + rtc::ThreadChecker thread_checker_; - bool _initialized; - bool _recording; - bool _playing; - bool _recIsInitialized; - bool _playIsInitialized; - bool _startRec; - bool _stopRec; - bool _startPlay; - bool _stopPlay; - bool _AGC; - bool update_speaker_volume_at_startup_; + bool _initialized; + bool _recording; + bool _playing; + bool _recIsInitialized; + bool _playIsInitialized; + bool _startRec; + bool _stopRec; + bool _startPlay; + bool _stopPlay; + bool _AGC; + bool update_speaker_volume_at_startup_; - uint32_t _sndCardPlayDelay; - uint32_t _sndCardRecDelay; + uint32_t _sndCardPlayDelay; + uint32_t _sndCardRecDelay; - int32_t _writeErrors; - uint16_t _playWarning; - uint16_t _playError; - uint16_t _recWarning; - uint16_t _recError; + int32_t _writeErrors; + uint16_t _playWarning; + uint16_t _playError; + uint16_t _recWarning; + uint16_t _recError; - uint16_t _deviceIndex; - int16_t _numPlayDevices; - int16_t _numRecDevices; - char* _playDeviceName; - char* _recDeviceName; - char* _playDisplayDeviceName; - char* _recDisplayDeviceName; - char _paServerVersion[32]; + uint16_t _deviceIndex; + int16_t _numPlayDevices; + int16_t _numRecDevices; + char* _playDeviceName; + char* _recDeviceName; + char* _playDisplayDeviceName; + char* _recDisplayDeviceName; + char _paServerVersion[32]; - int8_t* _playBuffer; - size_t _playbackBufferSize; - size_t _playbackBufferUnused; - size_t _tempBufferSpace; - int8_t* _recBuffer; - size_t _recordBufferSize; - size_t _recordBufferUsed; - const void* _tempSampleData; - size_t _tempSampleDataSize; - int32_t _configuredLatencyPlay; - int32_t _configuredLatencyRec; + int8_t* _playBuffer; + size_t _playbackBufferSize; + size_t _playbackBufferUnused; + size_t _tempBufferSpace; + int8_t* _recBuffer; + size_t _recordBufferSize; + size_t _recordBufferUsed; + const void* _tempSampleData; + size_t _tempSampleDataSize; + int32_t _configuredLatencyPlay; + int32_t _configuredLatencyRec; - // PulseAudio - uint16_t _paDeviceIndex; - bool _paStateChanged; + // PulseAudio + uint16_t _paDeviceIndex; + bool _paStateChanged; - pa_threaded_mainloop* _paMainloop; - pa_mainloop_api* _paMainloopApi; - pa_context* _paContext; + pa_threaded_mainloop* _paMainloop; + pa_mainloop_api* _paMainloopApi; + pa_context* _paContext; - pa_stream* _recStream; - pa_stream* _playStream; - uint32_t _recStreamFlags; - uint32_t _playStreamFlags; - pa_buffer_attr _playBufferAttr; - pa_buffer_attr _recBufferAttr; + pa_stream* _recStream; + pa_stream* _playStream; + uint32_t _recStreamFlags; + uint32_t _playStreamFlags; + pa_buffer_attr _playBufferAttr; + pa_buffer_attr _recBufferAttr; - char _oldKeyState[32]; - Display* _XDisplay; + char _oldKeyState[32]; + Display* _XDisplay; }; } diff --git a/webrtc/modules/audio_mixer/audio_mixer_impl.h b/webrtc/modules/audio_mixer/audio_mixer_impl.h index 93eea98168..abc98f13a6 100644 --- a/webrtc/modules/audio_mixer/audio_mixer_impl.h +++ b/webrtc/modules/audio_mixer/audio_mixer_impl.h @@ -60,7 +60,8 @@ class AudioMixerImpl : public AudioMixer { void RemoveSource(Source* audio_source) override; void Mix(size_t number_of_channels, - AudioFrame* audio_frame_for_mixing) override LOCKS_EXCLUDED(crit_); + AudioFrame* audio_frame_for_mixing) override + RTC_LOCKS_EXCLUDED(crit_); // Returns true if the source was mixed last round. Returns // false and logs an error if the source was never added to the @@ -80,7 +81,7 @@ class AudioMixerImpl : public AudioMixer { // Compute what audio sources to mix from audio_source_list_. Ramp // in and out. Update mixed status. Mixes up to // kMaximumAmountOfMixedAudioSources audio sources. - AudioFrameList GetAudioFromSources() EXCLUSIVE_LOCKS_REQUIRED(crit_); + AudioFrameList GetAudioFromSources() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Add/remove the MixerAudioSource to the specified // MixerAudioSource list. @@ -97,14 +98,14 @@ class AudioMixerImpl : public AudioMixer { std::unique_ptr output_rate_calculator_; // The current sample frequency and sample size when mixing. - int output_frequency_ GUARDED_BY(race_checker_); - size_t sample_size_ GUARDED_BY(race_checker_); + int output_frequency_ RTC_GUARDED_BY(race_checker_); + size_t sample_size_ RTC_GUARDED_BY(race_checker_); // List of all audio sources. Note all lists are disjunct - SourceStatusList audio_source_list_ GUARDED_BY(crit_); // May be mixed. + SourceStatusList audio_source_list_ RTC_GUARDED_BY(crit_); // May be mixed. // Component that handles actual adding of audio frames. - FrameCombiner frame_combiner_ GUARDED_BY(race_checker_); + FrameCombiner frame_combiner_ RTC_GUARDED_BY(race_checker_); RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl); }; diff --git a/webrtc/modules/audio_processing/aec3/echo_canceller3.h b/webrtc/modules/audio_processing/aec3/echo_canceller3.h index d857dfbed5..f3b69e5e3c 100644 --- a/webrtc/modules/audio_processing/aec3/echo_canceller3.h +++ b/webrtc/modules/audio_processing/aec3/echo_canceller3.h @@ -105,7 +105,8 @@ class EchoCanceller3 { rtc::RaceChecker render_race_checker_; // State that is accessed by the AnalyzeRender call. - std::unique_ptr render_writer_ GUARDED_BY(render_race_checker_); + std::unique_ptr render_writer_ + RTC_GUARDED_BY(render_race_checker_); // State that may be accessed by the capture thread. static int instance_count_; @@ -113,21 +114,22 @@ class EchoCanceller3 { const int sample_rate_hz_; const int num_bands_; const size_t frame_length_; - BlockFramer output_framer_ GUARDED_BY(capture_race_checker_); - FrameBlocker capture_blocker_ GUARDED_BY(capture_race_checker_); - FrameBlocker render_blocker_ GUARDED_BY(capture_race_checker_); + BlockFramer output_framer_ RTC_GUARDED_BY(capture_race_checker_); + FrameBlocker capture_blocker_ RTC_GUARDED_BY(capture_race_checker_); + FrameBlocker render_blocker_ RTC_GUARDED_BY(capture_race_checker_); SwapQueue>, Aec3RenderQueueItemVerifier> render_transfer_queue_; std::unique_ptr block_processor_ - GUARDED_BY(capture_race_checker_); + RTC_GUARDED_BY(capture_race_checker_); std::vector> render_queue_output_frame_ - GUARDED_BY(capture_race_checker_); + RTC_GUARDED_BY(capture_race_checker_); std::unique_ptr capture_highpass_filter_ - GUARDED_BY(capture_race_checker_); - bool saturated_microphone_signal_ GUARDED_BY(capture_race_checker_) = false; - std::vector> block_ GUARDED_BY(capture_race_checker_); + RTC_GUARDED_BY(capture_race_checker_); + bool saturated_microphone_signal_ RTC_GUARDED_BY(capture_race_checker_) = + false; + std::vector> block_ RTC_GUARDED_BY(capture_race_checker_); std::vector> sub_frame_view_ - GUARDED_BY(capture_race_checker_); + RTC_GUARDED_BY(capture_race_checker_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCanceller3); }; diff --git a/webrtc/modules/audio_processing/audio_processing_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h index 325d1be564..56c1afc8d6 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl.h +++ b/webrtc/modules/audio_processing/audio_processing_impl.h @@ -100,7 +100,7 @@ class AudioProcessingImpl : public AudioProcessing { size_t num_reverse_channels() const override; int stream_delay_ms() const override; bool was_stream_delay_set() const override - EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); AudioProcessingStatistics GetStatistics() const override; @@ -125,7 +125,7 @@ class AudioProcessingImpl : public AudioProcessing { protected: // Overridden in a mock. virtual int InitializeLocked() - EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); private: // TODO(peah): These friend classes should be removed as soon as the new @@ -188,49 +188,50 @@ class AudioProcessingImpl : public AudioProcessing { // The struct is modified in a single-threaded manner by holding both the // render and capture locks. int MaybeInitialize(const ProcessingConfig& config, bool force_initialization) - EXCLUSIVE_LOCKS_REQUIRED(crit_render_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_); int MaybeInitializeRender(const ProcessingConfig& processing_config) - EXCLUSIVE_LOCKS_REQUIRED(crit_render_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_); int MaybeInitializeCapture(const ProcessingConfig& processing_config, bool force_initialization) - EXCLUSIVE_LOCKS_REQUIRED(crit_render_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_); // Method for updating the state keeping track of the active submodules. // Returns a bool indicating whether the state has changed. - bool UpdateActiveSubmoduleStates() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + bool UpdateActiveSubmoduleStates() + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); // Methods requiring APM running in a single-threaded manner. // Are called with both the render and capture locks already // acquired. void InitializeTransient() - EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); void InitializeBeamformer() - EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); void InitializeIntelligibility() - EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); int InitializeLocked(const ProcessingConfig& config) - EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); - void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); + void InitializeLevelController() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); void InitializeResidualEchoDetector() - EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); - void InitializeLowCutFilter() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); - void InitializeEchoCanceller3() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); + void InitializeLowCutFilter() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + void InitializeEchoCanceller3() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); void InitializeGainController2(); void EmptyQueuedRenderAudio(); void AllocateRenderQueue() - EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); void QueueBandedRenderAudio(AudioBuffer* audio) - EXCLUSIVE_LOCKS_REQUIRED(crit_render_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_); void QueueNonbandedRenderAudio(AudioBuffer* audio) - EXCLUSIVE_LOCKS_REQUIRED(crit_render_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_); // Capture-side exclusive methods possibly running APM in a multi-threaded // manner that are called with the render lock already acquired. - int ProcessCaptureStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); - void MaybeUpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + int ProcessCaptureStreamLocked() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + void MaybeUpdateHistograms() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); // Render-side exclusive methods possibly running APM in a multi-threaded // manner that are called with the render lock already acquired. @@ -238,8 +239,8 @@ class AudioProcessingImpl : public AudioProcessing { int AnalyzeReverseStreamLocked(const float* const* src, const StreamConfig& input_config, const StreamConfig& output_config) - EXCLUSIVE_LOCKS_REQUIRED(crit_render_); - int ProcessRenderStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_render_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_); + int ProcessRenderStreamLocked() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_); // Collects configuration settings from public and private // submodules to be saved as an audioproc::Config message on the @@ -247,27 +248,27 @@ class AudioProcessingImpl : public AudioProcessing { // config if it is different from the last saved one; if |forced|, // writes the config regardless of the last saved. void WriteAecDumpConfigMessage(bool forced) - EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); // Notifies attached AecDump of current configuration and capture data. void RecordUnprocessedCaptureStream(const float* const* capture_stream) - EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); void RecordUnprocessedCaptureStream(const AudioFrame& capture_frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); // Notifies attached AecDump of current configuration and // processed capture data and issues a capture stream recording // request. void RecordProcessedCaptureStream( const float* const* processed_capture_stream) - EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); void RecordProcessedCaptureStream(const AudioFrame& processed_capture_frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); // Notifies attached AecDump about current state (delay, drift, etc). - void RecordAudioProcessingState() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); + void RecordAudioProcessingState() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); // AecDump instance used for optionally logging APM config, input // and output to file in the AEC-dump format defined in debug.proto. @@ -275,10 +276,10 @@ class AudioProcessingImpl : public AudioProcessing { // Hold the last config written with AecDump for avoiding writing // the same config twice. - InternalAPMConfig apm_config_for_aec_dump_ GUARDED_BY(crit_capture_); + InternalAPMConfig apm_config_for_aec_dump_ RTC_GUARDED_BY(crit_capture_); // Critical sections. - rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_); + rtc::CriticalSection crit_render_ RTC_ACQUIRED_BEFORE(crit_capture_); rtc::CriticalSection crit_capture_; // Struct containing the Config specifying the behavior of APM. @@ -345,7 +346,7 @@ class AudioProcessingImpl : public AudioProcessing { StreamConfig capture_processing_format; int split_rate; bool echo_path_gain_change; - } capture_ GUARDED_BY(crit_capture_); + } capture_ RTC_GUARDED_BY(crit_capture_); struct ApmCaptureNonLockedState { ApmCaptureNonLockedState(bool beamformer_enabled, @@ -373,31 +374,31 @@ class AudioProcessingImpl : public AudioProcessing { ~ApmRenderState(); std::unique_ptr render_converter; std::unique_ptr render_audio; - } render_ GUARDED_BY(crit_render_); + } render_ RTC_GUARDED_BY(crit_render_); - size_t aec_render_queue_element_max_size_ GUARDED_BY(crit_render_) - GUARDED_BY(crit_capture_) = 0; - std::vector aec_render_queue_buffer_ GUARDED_BY(crit_render_); - std::vector aec_capture_queue_buffer_ GUARDED_BY(crit_capture_); + size_t aec_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_) + RTC_GUARDED_BY(crit_capture_) = 0; + std::vector aec_render_queue_buffer_ RTC_GUARDED_BY(crit_render_); + std::vector aec_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_); - size_t aecm_render_queue_element_max_size_ GUARDED_BY(crit_render_) - GUARDED_BY(crit_capture_) = 0; - std::vector aecm_render_queue_buffer_ GUARDED_BY(crit_render_); - std::vector aecm_capture_queue_buffer_ GUARDED_BY(crit_capture_); + size_t aecm_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_) + RTC_GUARDED_BY(crit_capture_) = 0; + std::vector aecm_render_queue_buffer_ RTC_GUARDED_BY(crit_render_); + std::vector aecm_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_); - size_t agc_render_queue_element_max_size_ GUARDED_BY(crit_render_) - GUARDED_BY(crit_capture_) = 0; - std::vector agc_render_queue_buffer_ GUARDED_BY(crit_render_); - std::vector agc_capture_queue_buffer_ GUARDED_BY(crit_capture_); + size_t agc_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_) + RTC_GUARDED_BY(crit_capture_) = 0; + std::vector agc_render_queue_buffer_ RTC_GUARDED_BY(crit_render_); + std::vector agc_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_); - size_t red_render_queue_element_max_size_ GUARDED_BY(crit_render_) - GUARDED_BY(crit_capture_) = 0; - std::vector red_render_queue_buffer_ GUARDED_BY(crit_render_); - std::vector red_capture_queue_buffer_ GUARDED_BY(crit_capture_); + size_t red_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_) + RTC_GUARDED_BY(crit_capture_) = 0; + std::vector red_render_queue_buffer_ RTC_GUARDED_BY(crit_render_); + std::vector red_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_); - RmsLevel capture_input_rms_ GUARDED_BY(crit_capture_); - RmsLevel capture_output_rms_ GUARDED_BY(crit_capture_); - int capture_rms_interval_counter_ GUARDED_BY(crit_capture_) = 0; + RmsLevel capture_input_rms_ RTC_GUARDED_BY(crit_capture_); + RmsLevel capture_output_rms_ RTC_GUARDED_BY(crit_capture_); + int capture_rms_interval_counter_ RTC_GUARDED_BY(crit_capture_) = 0; // Lock protection not needed. std::unique_ptr, RenderQueueItemVerifier>> diff --git a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc index 4189d6f7e6..76c74fc45e 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc @@ -83,7 +83,7 @@ class RandomGenerator { private: rtc::CriticalSection crit_; - Random rand_gen_ GUARDED_BY(crit_); + Random rand_gen_ RTC_GUARDED_BY(crit_); }; // Variables related to the audio data and formats. @@ -300,8 +300,8 @@ class FrameCounters { private: rtc::CriticalSection crit_; - int render_count GUARDED_BY(crit_) = 0; - int capture_count GUARDED_BY(crit_) = 0; + int render_count RTC_GUARDED_BY(crit_) = 0; + int capture_count RTC_GUARDED_BY(crit_) = 0; }; // Class for handling the capture side processing. diff --git a/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc b/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc index e49b632b01..bb895b589b 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc @@ -26,7 +26,7 @@ class MockInitialize : public AudioProcessingImpl { : AudioProcessingImpl(config) {} MOCK_METHOD0(InitializeLocked, int()); - int RealInitializeLocked() NO_THREAD_SAFETY_ANALYSIS { + int RealInitializeLocked() RTC_NO_THREAD_SAFETY_ANALYSIS { return AudioProcessingImpl::InitializeLocked(); } diff --git a/webrtc/modules/audio_processing/echo_cancellation_impl.h b/webrtc/modules/audio_processing/echo_cancellation_impl.h index 2bce6332d4..301bd53a9f 100644 --- a/webrtc/modules/audio_processing/echo_cancellation_impl.h +++ b/webrtc/modules/audio_processing/echo_cancellation_impl.h @@ -90,20 +90,20 @@ class EchoCancellationImpl : public EchoCancellation { void AllocateRenderQueue(); int Configure(); - rtc::CriticalSection* const crit_render_ ACQUIRED_BEFORE(crit_capture_); + rtc::CriticalSection* const crit_render_ RTC_ACQUIRED_BEFORE(crit_capture_); rtc::CriticalSection* const crit_capture_; bool enabled_ = false; - bool drift_compensation_enabled_ GUARDED_BY(crit_capture_); - bool metrics_enabled_ GUARDED_BY(crit_capture_); - SuppressionLevel suppression_level_ GUARDED_BY(crit_capture_); - int stream_drift_samples_ GUARDED_BY(crit_capture_); - bool was_stream_drift_set_ GUARDED_BY(crit_capture_); - bool stream_has_echo_ GUARDED_BY(crit_capture_); - bool delay_logging_enabled_ GUARDED_BY(crit_capture_); - bool extended_filter_enabled_ GUARDED_BY(crit_capture_); - bool delay_agnostic_enabled_ GUARDED_BY(crit_capture_); - bool refined_adaptive_filter_enabled_ GUARDED_BY(crit_capture_) = false; + bool drift_compensation_enabled_ RTC_GUARDED_BY(crit_capture_); + bool metrics_enabled_ RTC_GUARDED_BY(crit_capture_); + SuppressionLevel suppression_level_ RTC_GUARDED_BY(crit_capture_); + int stream_drift_samples_ RTC_GUARDED_BY(crit_capture_); + bool was_stream_drift_set_ RTC_GUARDED_BY(crit_capture_); + bool stream_has_echo_ RTC_GUARDED_BY(crit_capture_); + bool delay_logging_enabled_ RTC_GUARDED_BY(crit_capture_); + bool extended_filter_enabled_ RTC_GUARDED_BY(crit_capture_); + bool delay_agnostic_enabled_ RTC_GUARDED_BY(crit_capture_); + bool refined_adaptive_filter_enabled_ RTC_GUARDED_BY(crit_capture_) = false; std::vector> cancellers_; std::unique_ptr stream_properties_; diff --git a/webrtc/modules/audio_processing/echo_control_mobile_impl.h b/webrtc/modules/audio_processing/echo_control_mobile_impl.h index 2c604ca0d9..b3e1577793 100644 --- a/webrtc/modules/audio_processing/echo_control_mobile_impl.h +++ b/webrtc/modules/audio_processing/echo_control_mobile_impl.h @@ -64,15 +64,15 @@ class EchoControlMobileImpl : public EchoControlMobile { int Configure(); - rtc::CriticalSection* const crit_render_ ACQUIRED_BEFORE(crit_capture_); + rtc::CriticalSection* const crit_render_ RTC_ACQUIRED_BEFORE(crit_capture_); rtc::CriticalSection* const crit_capture_; bool enabled_ = false; - RoutingMode routing_mode_ GUARDED_BY(crit_capture_); - bool comfort_noise_enabled_ GUARDED_BY(crit_capture_); - unsigned char* external_echo_path_ GUARDED_BY(crit_render_) - GUARDED_BY(crit_capture_); + RoutingMode routing_mode_ RTC_GUARDED_BY(crit_capture_); + bool comfort_noise_enabled_ RTC_GUARDED_BY(crit_capture_); + unsigned char* external_echo_path_ RTC_GUARDED_BY(crit_render_) + RTC_GUARDED_BY(crit_capture_); std::vector> cancellers_; std::unique_ptr stream_properties_; diff --git a/webrtc/modules/audio_processing/gain_control_impl.h b/webrtc/modules/audio_processing/gain_control_impl.h index 03bb5fa7d2..8fca699694 100644 --- a/webrtc/modules/audio_processing/gain_control_impl.h +++ b/webrtc/modules/audio_processing/gain_control_impl.h @@ -67,27 +67,27 @@ class GainControlImpl : public GainControl { int Configure(); - rtc::CriticalSection* const crit_render_ ACQUIRED_BEFORE(crit_capture_); + rtc::CriticalSection* const crit_render_ RTC_ACQUIRED_BEFORE(crit_capture_); rtc::CriticalSection* const crit_capture_; std::unique_ptr data_dumper_; bool enabled_ = false; - Mode mode_ GUARDED_BY(crit_capture_); - int minimum_capture_level_ GUARDED_BY(crit_capture_); - int maximum_capture_level_ GUARDED_BY(crit_capture_); - bool limiter_enabled_ GUARDED_BY(crit_capture_); - int target_level_dbfs_ GUARDED_BY(crit_capture_); - int compression_gain_db_ GUARDED_BY(crit_capture_); - int analog_capture_level_ GUARDED_BY(crit_capture_); - bool was_analog_level_set_ GUARDED_BY(crit_capture_); - bool stream_is_saturated_ GUARDED_BY(crit_capture_); + Mode mode_ RTC_GUARDED_BY(crit_capture_); + int minimum_capture_level_ RTC_GUARDED_BY(crit_capture_); + int maximum_capture_level_ RTC_GUARDED_BY(crit_capture_); + bool limiter_enabled_ RTC_GUARDED_BY(crit_capture_); + int target_level_dbfs_ RTC_GUARDED_BY(crit_capture_); + int compression_gain_db_ RTC_GUARDED_BY(crit_capture_); + int analog_capture_level_ RTC_GUARDED_BY(crit_capture_); + bool was_analog_level_set_ RTC_GUARDED_BY(crit_capture_); + bool stream_is_saturated_ RTC_GUARDED_BY(crit_capture_); std::vector> gain_controllers_; - rtc::Optional num_proc_channels_ GUARDED_BY(crit_capture_); - rtc::Optional sample_rate_hz_ GUARDED_BY(crit_capture_); + rtc::Optional num_proc_channels_ RTC_GUARDED_BY(crit_capture_); + rtc::Optional sample_rate_hz_ RTC_GUARDED_BY(crit_capture_); static int instance_counter_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(GainControlImpl); diff --git a/webrtc/modules/audio_processing/level_estimator_impl.h b/webrtc/modules/audio_processing/level_estimator_impl.h index db7217493d..68b1932116 100644 --- a/webrtc/modules/audio_processing/level_estimator_impl.h +++ b/webrtc/modules/audio_processing/level_estimator_impl.h @@ -38,8 +38,8 @@ class LevelEstimatorImpl : public LevelEstimator { private: rtc::CriticalSection* const crit_ = nullptr; - bool enabled_ GUARDED_BY(crit_) = false; - std::unique_ptr rms_ GUARDED_BY(crit_); + bool enabled_ RTC_GUARDED_BY(crit_) = false; + std::unique_ptr rms_ RTC_GUARDED_BY(crit_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(LevelEstimatorImpl); }; } // namespace webrtc diff --git a/webrtc/modules/audio_processing/noise_suppression_impl.h b/webrtc/modules/audio_processing/noise_suppression_impl.h index ac5909fd8b..1c8cbb0e60 100644 --- a/webrtc/modules/audio_processing/noise_suppression_impl.h +++ b/webrtc/modules/audio_processing/noise_suppression_impl.h @@ -44,11 +44,11 @@ class NoiseSuppressionImpl : public NoiseSuppression { private: class Suppressor; rtc::CriticalSection* const crit_; - bool enabled_ GUARDED_BY(crit_) = false; - Level level_ GUARDED_BY(crit_) = kModerate; - size_t channels_ GUARDED_BY(crit_) = 0; - int sample_rate_hz_ GUARDED_BY(crit_) = 0; - std::vector> suppressors_ GUARDED_BY(crit_); + bool enabled_ RTC_GUARDED_BY(crit_) = false; + Level level_ RTC_GUARDED_BY(crit_) = kModerate; + size_t channels_ RTC_GUARDED_BY(crit_) = 0; + int sample_rate_hz_ RTC_GUARDED_BY(crit_) = 0; + std::vector> suppressors_ RTC_GUARDED_BY(crit_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(NoiseSuppressionImpl); }; } // namespace webrtc diff --git a/webrtc/modules/audio_processing/voice_detection_impl.h b/webrtc/modules/audio_processing/voice_detection_impl.h index 3f515ce059..683c425a96 100644 --- a/webrtc/modules/audio_processing/voice_detection_impl.h +++ b/webrtc/modules/audio_processing/voice_detection_impl.h @@ -43,14 +43,14 @@ class VoiceDetectionImpl : public VoiceDetection { private: class Vad; rtc::CriticalSection* const crit_; - bool enabled_ GUARDED_BY(crit_) = false; - bool stream_has_voice_ GUARDED_BY(crit_) = false; - bool using_external_vad_ GUARDED_BY(crit_) = false; - Likelihood likelihood_ GUARDED_BY(crit_) = kLowLikelihood; - int frame_size_ms_ GUARDED_BY(crit_) = 10; - size_t frame_size_samples_ GUARDED_BY(crit_) = 0; - int sample_rate_hz_ GUARDED_BY(crit_) = 0; - std::unique_ptr vad_ GUARDED_BY(crit_); + bool enabled_ RTC_GUARDED_BY(crit_) = false; + bool stream_has_voice_ RTC_GUARDED_BY(crit_) = false; + bool using_external_vad_ RTC_GUARDED_BY(crit_) = false; + Likelihood likelihood_ RTC_GUARDED_BY(crit_) = kLowLikelihood; + int frame_size_ms_ RTC_GUARDED_BY(crit_) = 10; + size_t frame_size_samples_ RTC_GUARDED_BY(crit_) = 0; + int sample_rate_hz_ RTC_GUARDED_BY(crit_) = 0; + std::unique_ptr vad_ RTC_GUARDED_BY(crit_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(VoiceDetectionImpl); }; } // namespace webrtc diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h index 11a5850773..0934fa2d10 100644 --- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h +++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h @@ -83,7 +83,7 @@ class BitrateControllerImpl : public BitrateController { void OnNetworkChanged(uint32_t bitrate, uint8_t fraction_loss, // 0 - 255. - int64_t rtt) EXCLUSIVE_LOCKS_REQUIRED(critsect_); + int64_t rtt) RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); // Used by process thread. const Clock* const clock_; @@ -93,14 +93,14 @@ class BitrateControllerImpl : public BitrateController { rtc::CriticalSection critsect_; std::map ssrc_to_last_received_extended_high_seq_num_ - GUARDED_BY(critsect_); - SendSideBandwidthEstimation bandwidth_estimation_ GUARDED_BY(critsect_); - uint32_t reserved_bitrate_bps_ GUARDED_BY(critsect_); + RTC_GUARDED_BY(critsect_); + SendSideBandwidthEstimation bandwidth_estimation_ RTC_GUARDED_BY(critsect_); + uint32_t reserved_bitrate_bps_ RTC_GUARDED_BY(critsect_); - uint32_t last_bitrate_bps_ GUARDED_BY(critsect_); - uint8_t last_fraction_loss_ GUARDED_BY(critsect_); - int64_t last_rtt_ms_ GUARDED_BY(critsect_); - uint32_t last_reserved_bitrate_bps_ GUARDED_BY(critsect_); + uint32_t last_bitrate_bps_ RTC_GUARDED_BY(critsect_); + uint8_t last_fraction_loss_ RTC_GUARDED_BY(critsect_); + int64_t last_rtt_ms_ RTC_GUARDED_BY(critsect_); + uint32_t last_reserved_bitrate_bps_ RTC_GUARDED_BY(critsect_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BitrateControllerImpl); }; diff --git a/webrtc/modules/congestion_controller/include/receive_side_congestion_controller.h b/webrtc/modules/congestion_controller/include/receive_side_congestion_controller.h index 8544068ebd..2960729b0a 100644 --- a/webrtc/modules/congestion_controller/include/receive_side_congestion_controller.h +++ b/webrtc/modules/congestion_controller/include/receive_side_congestion_controller.h @@ -82,8 +82,8 @@ class ReceiveSideCongestionController : public CallStatsObserver, private: void PickEstimatorFromHeader(const RTPHeader& header) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); - void PickEstimator() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + void PickEstimator() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RemoteBitrateObserver* observer_; const Clock* const clock_; rtc::CriticalSection crit_sect_; diff --git a/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h b/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h index 490711f54d..b85b5111a4 100644 --- a/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h +++ b/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h @@ -126,7 +126,7 @@ class SendSideCongestionController : public CallStatsObserver, void LimitOutstandingBytes(size_t num_outstanding_bytes); const Clock* const clock_; rtc::CriticalSection observer_lock_; - Observer* observer_ GUARDED_BY(observer_lock_); + Observer* observer_ RTC_GUARDED_BY(observer_lock_); RtcEventLog* const event_log_; std::unique_ptr owned_pacer_; PacedSender* pacer_; @@ -136,18 +136,18 @@ class SendSideCongestionController : public CallStatsObserver, const std::unique_ptr retransmission_rate_limiter_; TransportFeedbackAdapter transport_feedback_adapter_; rtc::CriticalSection network_state_lock_; - uint32_t last_reported_bitrate_bps_ GUARDED_BY(network_state_lock_); - uint8_t last_reported_fraction_loss_ GUARDED_BY(network_state_lock_); - int64_t last_reported_rtt_ GUARDED_BY(network_state_lock_); - NetworkState network_state_ GUARDED_BY(network_state_lock_); - bool pause_pacer_ GUARDED_BY(network_state_lock_); + uint32_t last_reported_bitrate_bps_ RTC_GUARDED_BY(network_state_lock_); + uint8_t last_reported_fraction_loss_ RTC_GUARDED_BY(network_state_lock_); + int64_t last_reported_rtt_ RTC_GUARDED_BY(network_state_lock_); + NetworkState network_state_ RTC_GUARDED_BY(network_state_lock_); + bool pause_pacer_ RTC_GUARDED_BY(network_state_lock_); // Duplicate the pacer paused state to avoid grabbing a lock when // pausing the pacer. This can be removed when we move this class // over to the task queue. bool pacer_paused_; rtc::CriticalSection bwe_lock_; - int min_bitrate_bps_ GUARDED_BY(bwe_lock_); - std::unique_ptr delay_based_bwe_ GUARDED_BY(bwe_lock_); + int min_bitrate_bps_ RTC_GUARDED_BY(bwe_lock_); + std::unique_ptr delay_based_bwe_ RTC_GUARDED_BY(bwe_lock_); bool in_cwnd_experiment_; int64_t accepted_queue_ms_; bool was_in_alr_; diff --git a/webrtc/modules/congestion_controller/probe_controller.h b/webrtc/modules/congestion_controller/probe_controller.h index f47bdb0ca2..7a23360d85 100644 --- a/webrtc/modules/congestion_controller/probe_controller.h +++ b/webrtc/modules/congestion_controller/probe_controller.h @@ -58,32 +58,33 @@ class ProbeController { kProbingComplete, }; - void InitiateExponentialProbing() EXCLUSIVE_LOCKS_REQUIRED(critsect_); + void InitiateExponentialProbing() RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); void InitiateProbing(int64_t now_ms, std::initializer_list bitrates_to_probe, - bool probe_further) EXCLUSIVE_LOCKS_REQUIRED(critsect_); + bool probe_further) + RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); rtc::CriticalSection critsect_; PacedSender* const pacer_; const Clock* const clock_; - NetworkState network_state_ GUARDED_BY(critsect_); - State state_ GUARDED_BY(critsect_); - int64_t min_bitrate_to_probe_further_bps_ GUARDED_BY(critsect_); - int64_t time_last_probing_initiated_ms_ GUARDED_BY(critsect_); - int64_t estimated_bitrate_bps_ GUARDED_BY(critsect_); - int64_t start_bitrate_bps_ GUARDED_BY(critsect_); - int64_t max_bitrate_bps_ GUARDED_BY(critsect_); - int64_t last_bwe_drop_probing_time_ms_ GUARDED_BY(critsect_); - rtc::Optional alr_end_time_ms_ GUARDED_BY(critsect_); - bool enable_periodic_alr_probing_ GUARDED_BY(critsect_); - int64_t time_of_last_large_drop_ms_ GUARDED_BY(critsect_); - int64_t bitrate_before_last_large_drop_bps_ GUARDED_BY(critsect_); + NetworkState network_state_ RTC_GUARDED_BY(critsect_); + State state_ RTC_GUARDED_BY(critsect_); + int64_t min_bitrate_to_probe_further_bps_ RTC_GUARDED_BY(critsect_); + int64_t time_last_probing_initiated_ms_ RTC_GUARDED_BY(critsect_); + int64_t estimated_bitrate_bps_ RTC_GUARDED_BY(critsect_); + int64_t start_bitrate_bps_ RTC_GUARDED_BY(critsect_); + int64_t max_bitrate_bps_ RTC_GUARDED_BY(critsect_); + int64_t last_bwe_drop_probing_time_ms_ RTC_GUARDED_BY(critsect_); + rtc::Optional alr_end_time_ms_ RTC_GUARDED_BY(critsect_); + bool enable_periodic_alr_probing_ RTC_GUARDED_BY(critsect_); + int64_t time_of_last_large_drop_ms_ RTC_GUARDED_BY(critsect_); + int64_t bitrate_before_last_large_drop_bps_ RTC_GUARDED_BY(critsect_); - bool in_rapid_recovery_experiment_ GUARDED_BY(critsect_); + bool in_rapid_recovery_experiment_ RTC_GUARDED_BY(critsect_); // For WebRTC.BWE.MidCallProbing.* metric. - bool mid_call_probing_waiting_for_result_ GUARDED_BY(&critsect_); - int64_t mid_call_probing_bitrate_bps_ GUARDED_BY(&critsect_); - int64_t mid_call_probing_succcess_threshold_ GUARDED_BY(&critsect_); + bool mid_call_probing_waiting_for_result_ RTC_GUARDED_BY(&critsect_); + int64_t mid_call_probing_bitrate_bps_ RTC_GUARDED_BY(&critsect_); + int64_t mid_call_probing_succcess_threshold_ RTC_GUARDED_BY(&critsect_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ProbeController); }; diff --git a/webrtc/modules/congestion_controller/transport_feedback_adapter.h b/webrtc/modules/congestion_controller/transport_feedback_adapter.h index 4fe70c5dcc..4d4b4077ce 100644 --- a/webrtc/modules/congestion_controller/transport_feedback_adapter.h +++ b/webrtc/modules/congestion_controller/transport_feedback_adapter.h @@ -61,19 +61,20 @@ class TransportFeedbackAdapter { const bool send_side_bwe_with_overhead_; rtc::CriticalSection lock_; - int transport_overhead_bytes_per_packet_ GUARDED_BY(&lock_); - SendTimeHistory send_time_history_ GUARDED_BY(&lock_); + int transport_overhead_bytes_per_packet_ RTC_GUARDED_BY(&lock_); + SendTimeHistory send_time_history_ RTC_GUARDED_BY(&lock_); const Clock* const clock_; int64_t current_offset_ms_; int64_t last_timestamp_us_; std::vector last_packet_feedback_vector_; - uint16_t local_net_id_ GUARDED_BY(&lock_); - uint16_t remote_net_id_ GUARDED_BY(&lock_); - std::deque feedback_rtts_ GUARDED_BY(&lock_); - rtc::Optional min_feedback_rtt_ GUARDED_BY(&lock_); + uint16_t local_net_id_ RTC_GUARDED_BY(&lock_); + uint16_t remote_net_id_ RTC_GUARDED_BY(&lock_); + std::deque feedback_rtts_ RTC_GUARDED_BY(&lock_); + rtc::Optional min_feedback_rtt_ RTC_GUARDED_BY(&lock_); rtc::CriticalSection observers_lock_; - std::vector observers_ GUARDED_BY(&observers_lock_); + std::vector observers_ + RTC_GUARDED_BY(&observers_lock_); }; } // namespace webrtc diff --git a/webrtc/modules/pacing/paced_sender.h b/webrtc/modules/pacing/paced_sender.h index a9c6233b27..196c9f4be9 100644 --- a/webrtc/modules/pacing/paced_sender.h +++ b/webrtc/modules/pacing/paced_sender.h @@ -155,48 +155,48 @@ class PacedSender : public Pacer { private: // Updates the number of bytes that can be sent for the next time interval. void UpdateBudgetWithElapsedTime(int64_t delta_time_in_ms) - EXCLUSIVE_LOCKS_REQUIRED(critsect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); void UpdateBudgetWithBytesSent(size_t bytes) - EXCLUSIVE_LOCKS_REQUIRED(critsect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); bool SendPacket(const paced_sender::Packet& packet, const PacedPacketInfo& cluster_info) - EXCLUSIVE_LOCKS_REQUIRED(critsect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); size_t SendPadding(size_t padding_needed, const PacedPacketInfo& cluster_info) - EXCLUSIVE_LOCKS_REQUIRED(critsect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); const Clock* const clock_; PacketSender* const packet_sender_; - std::unique_ptr alr_detector_ GUARDED_BY(critsect_); + std::unique_ptr alr_detector_ RTC_GUARDED_BY(critsect_); rtc::CriticalSection critsect_; - bool paused_ GUARDED_BY(critsect_); + bool paused_ RTC_GUARDED_BY(critsect_); // This is the media budget, keeping track of how many bits of media // we can pace out during the current interval. - std::unique_ptr media_budget_ GUARDED_BY(critsect_); + std::unique_ptr media_budget_ RTC_GUARDED_BY(critsect_); // This is the padding budget, keeping track of how many bits of padding we're // allowed to send out during the current interval. This budget will be // utilized when there's no media to send. - std::unique_ptr padding_budget_ GUARDED_BY(critsect_); + std::unique_ptr padding_budget_ RTC_GUARDED_BY(critsect_); - std::unique_ptr prober_ GUARDED_BY(critsect_); + std::unique_ptr prober_ RTC_GUARDED_BY(critsect_); bool probing_send_failure_; // Actual configured bitrates (media_budget_ may temporarily be higher in // order to meet pace time constraint). - uint32_t estimated_bitrate_bps_ GUARDED_BY(critsect_); - uint32_t min_send_bitrate_kbps_ GUARDED_BY(critsect_); - uint32_t max_padding_bitrate_kbps_ GUARDED_BY(critsect_); - uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_); + uint32_t estimated_bitrate_bps_ RTC_GUARDED_BY(critsect_); + uint32_t min_send_bitrate_kbps_ RTC_GUARDED_BY(critsect_); + uint32_t max_padding_bitrate_kbps_ RTC_GUARDED_BY(critsect_); + uint32_t pacing_bitrate_kbps_ RTC_GUARDED_BY(critsect_); - int64_t time_last_update_us_ GUARDED_BY(critsect_); - int64_t first_sent_packet_ms_ GUARDED_BY(critsect_); + int64_t time_last_update_us_ RTC_GUARDED_BY(critsect_); + int64_t first_sent_packet_ms_ RTC_GUARDED_BY(critsect_); - std::unique_ptr packets_ GUARDED_BY(critsect_); + std::unique_ptr packets_ RTC_GUARDED_BY(critsect_); uint64_t packet_counter_; ProcessThread* process_thread_ = nullptr; - float pacing_factor_ GUARDED_BY(critsect_); - int64_t queue_time_limit GUARDED_BY(critsect_); + float pacing_factor_ RTC_GUARDED_BY(critsect_); + int64_t queue_time_limit RTC_GUARDED_BY(critsect_); }; } // namespace webrtc #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ diff --git a/webrtc/modules/pacing/packet_router.h b/webrtc/modules/pacing/packet_router.h index 945b1c2caa..d76a210701 100644 --- a/webrtc/modules/pacing/packet_router.h +++ b/webrtc/modules/pacing/packet_router.h @@ -96,32 +96,32 @@ class PacketRouter : public PacedSender::PacketSender, private: void AddRembModuleCandidate(RtpRtcp* candidate_module, bool sender) - EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); void MaybeRemoveRembModuleCandidate(RtpRtcp* candidate_module, bool sender) - EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); - void UnsetActiveRembModule() EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); - void DetermineActiveRembModule() EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); + void UnsetActiveRembModule() RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); + void DetermineActiveRembModule() RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); rtc::RaceChecker pacer_race_; rtc::CriticalSection modules_crit_; - std::list rtp_send_modules_ GUARDED_BY(modules_crit_); - std::vector rtp_receive_modules_ GUARDED_BY(modules_crit_); + std::list rtp_send_modules_ RTC_GUARDED_BY(modules_crit_); + std::vector rtp_receive_modules_ RTC_GUARDED_BY(modules_crit_); // TODO(eladalon): remb_crit_ only ever held from one function, and it's not // clear if that function can actually be called from more than one thread. rtc::CriticalSection remb_crit_; // The last time a REMB was sent. - int64_t last_remb_time_ms_ GUARDED_BY(remb_crit_); - uint32_t last_send_bitrate_bps_ GUARDED_BY(remb_crit_); + int64_t last_remb_time_ms_ RTC_GUARDED_BY(remb_crit_); + uint32_t last_send_bitrate_bps_ RTC_GUARDED_BY(remb_crit_); // The last bitrate update. - uint32_t bitrate_bps_ GUARDED_BY(remb_crit_); - uint32_t max_bitrate_bps_ GUARDED_BY(remb_crit_); + uint32_t bitrate_bps_ RTC_GUARDED_BY(remb_crit_); + uint32_t max_bitrate_bps_ RTC_GUARDED_BY(remb_crit_); // Candidates for the REMB module can be RTP sender/receiver modules, with // the sender modules taking precedence. - std::vector sender_remb_candidates_ GUARDED_BY(modules_crit_); - std::vector receiver_remb_candidates_ GUARDED_BY(modules_crit_); - RtpRtcp* active_remb_module_ GUARDED_BY(modules_crit_); + std::vector sender_remb_candidates_ RTC_GUARDED_BY(modules_crit_); + std::vector receiver_remb_candidates_ RTC_GUARDED_BY(modules_crit_); + RtpRtcp* active_remb_module_ RTC_GUARDED_BY(modules_crit_); volatile int transport_seq_; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h index 564b563cc7..135e448067 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h @@ -106,12 +106,13 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator { const std::list& clusters) const; // Returns true if a probe which changed the estimate was detected. - ProbeResult ProcessClusters(int64_t now_ms) EXCLUSIVE_LOCKS_REQUIRED(&crit_); + ProbeResult ProcessClusters(int64_t now_ms) + RTC_EXCLUSIVE_LOCKS_REQUIRED(&crit_); bool IsBitrateImproving(int probe_bitrate_bps) const - EXCLUSIVE_LOCKS_REQUIRED(&crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(&crit_); - void TimeoutStreams(int64_t now_ms) EXCLUSIVE_LOCKS_REQUIRED(&crit_); + void TimeoutStreams(int64_t now_ms) RTC_EXCLUSIVE_LOCKS_REQUIRED(&crit_); rtc::ThreadChecker network_thread_; const Clock* const clock_; @@ -130,8 +131,8 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator { bool uma_recorded_; rtc::CriticalSection crit_; - Ssrcs ssrcs_ GUARDED_BY(&crit_); - AimdRateControl remote_rate_ GUARDED_BY(&crit_); + Ssrcs ssrcs_ RTC_GUARDED_BY(&crit_); + AimdRateControl remote_rate_ RTC_GUARDED_BY(&crit_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorAbsSendTime); }; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h index baccf52eec..4634492b48 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h @@ -47,24 +47,24 @@ class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator { // Triggers a new estimate calculation. void UpdateEstimate(int64_t time_now) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); void GetSsrcs(std::vector* ssrcs) const - SHARED_LOCKS_REQUIRED(crit_sect_); + RTC_SHARED_LOCKS_REQUIRED(crit_sect_); // Returns |remote_rate_| if the pointed to object exists, // otherwise creates it. - AimdRateControl* GetRemoteRate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + AimdRateControl* GetRemoteRate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); const Clock* const clock_; - SsrcOveruseEstimatorMap overuse_detectors_ GUARDED_BY(crit_sect_); - RateStatistics incoming_bitrate_ GUARDED_BY(crit_sect_); - uint32_t last_valid_incoming_bitrate_ GUARDED_BY(crit_sect_); - std::unique_ptr remote_rate_ GUARDED_BY(crit_sect_); - RemoteBitrateObserver* const observer_ GUARDED_BY(crit_sect_); + SsrcOveruseEstimatorMap overuse_detectors_ RTC_GUARDED_BY(crit_sect_); + RateStatistics incoming_bitrate_ RTC_GUARDED_BY(crit_sect_); + uint32_t last_valid_incoming_bitrate_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr remote_rate_ RTC_GUARDED_BY(crit_sect_); + RemoteBitrateObserver* const observer_ RTC_GUARDED_BY(crit_sect_); rtc::CriticalSection crit_sect_; int64_t last_process_time_; - int64_t process_interval_ms_ GUARDED_BY(crit_sect_); + int64_t process_interval_ms_ RTC_GUARDED_BY(crit_sect_); bool uma_recorded_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorSingleStream); diff --git a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h index 52632cf01f..129b5e704a 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h +++ b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h @@ -54,7 +54,7 @@ class RemoteEstimatorProxy : public RemoteBitrateEstimator { private: void OnPacketArrival(uint16_t sequence_number, int64_t arrival_time) - EXCLUSIVE_LOCKS_REQUIRED(&lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(&lock_); bool BuildFeedbackPacket(rtcp::TransportFeedback* feedback_packet); const Clock* const clock_; @@ -63,13 +63,13 @@ class RemoteEstimatorProxy : public RemoteBitrateEstimator { rtc::CriticalSection lock_; - uint32_t media_ssrc_ GUARDED_BY(&lock_); - uint8_t feedback_sequence_ GUARDED_BY(&lock_); - SequenceNumberUnwrapper unwrapper_ GUARDED_BY(&lock_); - int64_t window_start_seq_ GUARDED_BY(&lock_); + uint32_t media_ssrc_ RTC_GUARDED_BY(&lock_); + uint8_t feedback_sequence_ RTC_GUARDED_BY(&lock_); + SequenceNumberUnwrapper unwrapper_ RTC_GUARDED_BY(&lock_); + int64_t window_start_seq_ RTC_GUARDED_BY(&lock_); // Map unwrapped seq -> time. - std::map packet_arrival_times_ GUARDED_BY(&lock_); - int64_t send_interval_ms_ GUARDED_BY(&lock_); + std::map packet_arrival_times_ RTC_GUARDED_BY(&lock_); + int64_t send_interval_ms_ RTC_GUARDED_BY(&lock_); }; } // namespace webrtc diff --git a/webrtc/modules/rtp_rtcp/include/flexfec_receiver.h b/webrtc/modules/rtp_rtcp/include/flexfec_receiver.h index 384e3c01de..ae4696441b 100644 --- a/webrtc/modules/rtp_rtcp/include/flexfec_receiver.h +++ b/webrtc/modules/rtp_rtcp/include/flexfec_receiver.h @@ -49,17 +49,17 @@ class FlexfecReceiver { // Erasure code interfacing and callback. std::unique_ptr erasure_code_ - GUARDED_BY(sequence_checker_); + RTC_GUARDED_BY(sequence_checker_); ForwardErrorCorrection::ReceivedPacketList received_packets_ - GUARDED_BY(sequence_checker_); + RTC_GUARDED_BY(sequence_checker_); ForwardErrorCorrection::RecoveredPacketList recovered_packets_ - GUARDED_BY(sequence_checker_); + RTC_GUARDED_BY(sequence_checker_); RecoveredPacketReceiver* const recovered_packet_receiver_; // Logging and stats. Clock* const clock_; - int64_t last_recovered_packet_ms_ GUARDED_BY(sequence_checker_); - FecPacketCounter packet_counter_ GUARDED_BY(sequence_checker_); + int64_t last_recovered_packet_ms_ RTC_GUARDED_BY(sequence_checker_); + FecPacketCounter packet_counter_ RTC_GUARDED_BY(sequence_checker_); rtc::SequencedTaskChecker sequence_checker_; }; diff --git a/webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h b/webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h index eb552b84e1..a84e2d35cf 100644 --- a/webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h +++ b/webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h @@ -126,13 +126,14 @@ class RTPPayloadRegistry { uint32_t ssrc_rtx_; // Only warn once per payload type, if an RTX packet is received but // no associated payload type found in |rtx_payload_type_map_|. - std::set payload_types_with_suppressed_warnings_ GUARDED_BY(crit_sect_); + std::set payload_types_with_suppressed_warnings_ + RTC_GUARDED_BY(crit_sect_); // As a first step in splitting this class up in separate cases for audio and // video, DCHECK that no instance is used for both audio and video. #if RTC_DCHECK_IS_ON - bool used_for_audio_ GUARDED_BY(crit_sect_) = false; - bool used_for_video_ GUARDED_BY(crit_sect_) = false; + bool used_for_audio_ RTC_GUARDED_BY(crit_sect_) = false; + bool used_for_video_ RTC_GUARDED_BY(crit_sect_) = false; #endif }; diff --git a/webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h b/webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h index 26a616509d..b0d734bf29 100644 --- a/webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h +++ b/webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h @@ -63,15 +63,15 @@ class PlayoutDelayOracle { // Guards access to data across multiple threads. rtc::CriticalSection crit_sect_; // The current highest sequence number on which playout delay has been sent. - int64_t high_sequence_number_ GUARDED_BY(crit_sect_); + int64_t high_sequence_number_ RTC_GUARDED_BY(crit_sect_); // Indicates whether the playout delay should go on the next frame. - bool send_playout_delay_ GUARDED_BY(crit_sect_); + bool send_playout_delay_ RTC_GUARDED_BY(crit_sect_); // Sender ssrc. - uint32_t ssrc_ GUARDED_BY(crit_sect_); + uint32_t ssrc_ RTC_GUARDED_BY(crit_sect_); // Sequence number unwrapper. - SequenceNumberUnwrapper unwrapper_ GUARDED_BY(crit_sect_); + SequenceNumberUnwrapper unwrapper_ RTC_GUARDED_BY(crit_sect_); // Playout delay values on the next frame if |send_playout_delay_| is set. - PlayoutDelay playout_delay_ GUARDED_BY(crit_sect_); + PlayoutDelay playout_delay_ RTC_GUARDED_BY(crit_sect_); RTC_DISALLOW_COPY_AND_ASSIGN(PlayoutDelayOracle); }; diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h index d567869357..b80a91a72e 100644 --- a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h +++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h @@ -51,7 +51,7 @@ class StreamStatisticianImpl : public StreamStatistician { private: bool InOrderPacketInternal(uint16_t sequence_number) const; RtcpStatistics CalculateRtcpStatistics() - EXCLUSIVE_LOCKS_REQUIRED(stream_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(stream_lock_); void UpdateJitter(const RTPHeader& header, NtpTime receive_time); StreamDataCounters UpdateCounters(const RTPHeader& rtp_header, size_t packet_length, diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h index a167c135b0..28d892795c 100644 --- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h +++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h @@ -130,80 +130,80 @@ class RTCPReceiver { const PacketInformation& packet_information); TmmbrInformation* FindOrCreateTmmbrInfo(uint32_t remote_ssrc) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); // Update TmmbrInformation (if present) is alive. void UpdateTmmbrRemoteIsAlive(uint32_t remote_ssrc) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); TmmbrInformation* GetTmmbrInformation(uint32_t remote_ssrc) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleSenderReport(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleReceiverReport(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleReportBlock(const rtcp::ReportBlock& report_block, PacketInformation* packet_information, uint32_t remote_ssrc) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleSdes(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleXr(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleXrReceiveReferenceTime(uint32_t sender_ssrc, const rtcp::Rrtr& rrtr) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleXrTargetBitrate(uint32_t ssrc, const rtcp::TargetBitrate& target_bitrate, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleNack(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleBye(const rtcp::CommonHeader& rtcp_block) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandlePli(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandlePsfbApp(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleTmmbr(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleTmmbn(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleSrReq(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleFir(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); void HandleTransportFeedback(const rtcp::CommonHeader& rtcp_block, PacketInformation* packet_information) - EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); Clock* const clock_; const bool receiver_only_; @@ -216,42 +216,43 @@ class RTCPReceiver { VideoBitrateAllocationObserver* const bitrate_allocation_observer_; rtc::CriticalSection rtcp_receiver_lock_; - uint32_t main_ssrc_ GUARDED_BY(rtcp_receiver_lock_); - uint32_t remote_ssrc_ GUARDED_BY(rtcp_receiver_lock_); - std::set registered_ssrcs_ GUARDED_BY(rtcp_receiver_lock_); + uint32_t main_ssrc_ RTC_GUARDED_BY(rtcp_receiver_lock_); + uint32_t remote_ssrc_ RTC_GUARDED_BY(rtcp_receiver_lock_); + std::set registered_ssrcs_ RTC_GUARDED_BY(rtcp_receiver_lock_); // Received sender report. - NtpTime remote_sender_ntp_time_ GUARDED_BY(rtcp_receiver_lock_); - uint32_t remote_sender_rtp_time_ GUARDED_BY(rtcp_receiver_lock_); + NtpTime remote_sender_ntp_time_ RTC_GUARDED_BY(rtcp_receiver_lock_); + uint32_t remote_sender_rtp_time_ RTC_GUARDED_BY(rtcp_receiver_lock_); // When did we receive the last send report. - NtpTime last_received_sr_ntp_ GUARDED_BY(rtcp_receiver_lock_); + NtpTime last_received_sr_ntp_ RTC_GUARDED_BY(rtcp_receiver_lock_); // Received XR receive time report. rtcp::ReceiveTimeInfo remote_time_info_; // Time when the report was received. NtpTime last_received_xr_ntp_; // Estimated rtt, zero when there is no valid estimate. - bool xr_rrtr_status_ GUARDED_BY(rtcp_receiver_lock_); + bool xr_rrtr_status_ RTC_GUARDED_BY(rtcp_receiver_lock_); int64_t xr_rr_rtt_ms_; - int64_t oldest_tmmbr_info_ms_ GUARDED_BY(rtcp_receiver_lock_); + int64_t oldest_tmmbr_info_ms_ RTC_GUARDED_BY(rtcp_receiver_lock_); // Mapped by remote ssrc. std::map tmmbr_infos_ - GUARDED_BY(rtcp_receiver_lock_); + RTC_GUARDED_BY(rtcp_receiver_lock_); - ReportBlockMap received_report_blocks_ GUARDED_BY(rtcp_receiver_lock_); - std::map last_fir_ GUARDED_BY(rtcp_receiver_lock_); + ReportBlockMap received_report_blocks_ RTC_GUARDED_BY(rtcp_receiver_lock_); + std::map last_fir_ + RTC_GUARDED_BY(rtcp_receiver_lock_); std::map received_cnames_ - GUARDED_BY(rtcp_receiver_lock_); + RTC_GUARDED_BY(rtcp_receiver_lock_); // The last time we received an RTCP RR. - int64_t last_received_rr_ms_ GUARDED_BY(rtcp_receiver_lock_); + int64_t last_received_rr_ms_ RTC_GUARDED_BY(rtcp_receiver_lock_); // The time we last received an RTCP RR telling we have successfully // delivered RTP packet to the remote side. int64_t last_increased_sequence_number_ms_; - RtcpStatisticsCallback* stats_callback_ GUARDED_BY(feedbacks_lock_); + RtcpStatisticsCallback* stats_callback_ RTC_GUARDED_BY(feedbacks_lock_); RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; RtcpPacketTypeCounter packet_type_counter_; diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.h b/webrtc/modules/rtp_rtcp/source/rtcp_sender.h index ae06a17d8e..d581a044de 100644 --- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.h +++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.h @@ -155,117 +155,119 @@ class RTCPSender { // Determine which RTCP messages should be sent and setup flags. void PrepareReport(const FeedbackState& feedback_state) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::vector CreateReportBlocks( const FeedbackState& feedback_state) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildSR(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildRR(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildSDES(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildPLI(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildREMB(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildTMMBR(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildTMMBN(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildAPP(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildExtendedReports( const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildBYE(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildFIR(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); std::unique_ptr BuildNACK(const RtcpContext& context) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); private: const bool audio_; Clock* const clock_; - Random random_ GUARDED_BY(critical_section_rtcp_sender_); - RtcpMode method_ GUARDED_BY(critical_section_rtcp_sender_); + Random random_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + RtcpMode method_ RTC_GUARDED_BY(critical_section_rtcp_sender_); RtcEventLog* const event_log_; Transport* const transport_; rtc::CriticalSection critical_section_rtcp_sender_; - bool using_nack_ GUARDED_BY(critical_section_rtcp_sender_); - bool sending_ GUARDED_BY(critical_section_rtcp_sender_); - bool remb_enabled_ GUARDED_BY(critical_section_rtcp_sender_); + bool using_nack_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + bool sending_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + bool remb_enabled_ RTC_GUARDED_BY(critical_section_rtcp_sender_); - int64_t next_time_to_send_rtcp_ GUARDED_BY(critical_section_rtcp_sender_); + int64_t next_time_to_send_rtcp_ RTC_GUARDED_BY(critical_section_rtcp_sender_); - uint32_t timestamp_offset_ GUARDED_BY(critical_section_rtcp_sender_); - uint32_t last_rtp_timestamp_ GUARDED_BY(critical_section_rtcp_sender_); - int64_t last_frame_capture_time_ms_ GUARDED_BY(critical_section_rtcp_sender_); - uint32_t ssrc_ GUARDED_BY(critical_section_rtcp_sender_); + uint32_t timestamp_offset_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + uint32_t last_rtp_timestamp_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + int64_t last_frame_capture_time_ms_ + RTC_GUARDED_BY(critical_section_rtcp_sender_); + uint32_t ssrc_ RTC_GUARDED_BY(critical_section_rtcp_sender_); // SSRC that we receive on our RTP channel - uint32_t remote_ssrc_ GUARDED_BY(critical_section_rtcp_sender_); - std::string cname_ GUARDED_BY(critical_section_rtcp_sender_); + uint32_t remote_ssrc_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + std::string cname_ RTC_GUARDED_BY(critical_section_rtcp_sender_); ReceiveStatisticsProvider* receive_statistics_ - GUARDED_BY(critical_section_rtcp_sender_); + RTC_GUARDED_BY(critical_section_rtcp_sender_); std::map csrc_cnames_ - GUARDED_BY(critical_section_rtcp_sender_); + RTC_GUARDED_BY(critical_section_rtcp_sender_); // send CSRCs - std::vector csrcs_ GUARDED_BY(critical_section_rtcp_sender_); + std::vector csrcs_ RTC_GUARDED_BY(critical_section_rtcp_sender_); // Full intra request - uint8_t sequence_number_fir_ GUARDED_BY(critical_section_rtcp_sender_); + uint8_t sequence_number_fir_ RTC_GUARDED_BY(critical_section_rtcp_sender_); // REMB - uint32_t remb_bitrate_ GUARDED_BY(critical_section_rtcp_sender_); - std::vector remb_ssrcs_ GUARDED_BY(critical_section_rtcp_sender_); + uint32_t remb_bitrate_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + std::vector remb_ssrcs_ + RTC_GUARDED_BY(critical_section_rtcp_sender_); std::vector tmmbn_to_send_ - GUARDED_BY(critical_section_rtcp_sender_); - uint32_t tmmbr_send_bps_ GUARDED_BY(critical_section_rtcp_sender_); - uint32_t packet_oh_send_ GUARDED_BY(critical_section_rtcp_sender_); - size_t max_packet_size_ GUARDED_BY(critical_section_rtcp_sender_); + RTC_GUARDED_BY(critical_section_rtcp_sender_); + uint32_t tmmbr_send_bps_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + uint32_t packet_oh_send_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + size_t max_packet_size_ RTC_GUARDED_BY(critical_section_rtcp_sender_); // APP - uint8_t app_sub_type_ GUARDED_BY(critical_section_rtcp_sender_); - uint32_t app_name_ GUARDED_BY(critical_section_rtcp_sender_); + uint8_t app_sub_type_ RTC_GUARDED_BY(critical_section_rtcp_sender_); + uint32_t app_name_ RTC_GUARDED_BY(critical_section_rtcp_sender_); std::unique_ptr app_data_ - GUARDED_BY(critical_section_rtcp_sender_); - uint16_t app_length_ GUARDED_BY(critical_section_rtcp_sender_); + RTC_GUARDED_BY(critical_section_rtcp_sender_); + uint16_t app_length_ RTC_GUARDED_BY(critical_section_rtcp_sender_); // True if sending of XR Receiver reference time report is enabled. bool xr_send_receiver_reference_time_enabled_ - GUARDED_BY(critical_section_rtcp_sender_); + RTC_GUARDED_BY(critical_section_rtcp_sender_); // XR VoIP metric rtc::Optional xr_voip_metric_ - GUARDED_BY(critical_section_rtcp_sender_); + RTC_GUARDED_BY(critical_section_rtcp_sender_); RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; RtcpPacketTypeCounter packet_type_counter_ - GUARDED_BY(critical_section_rtcp_sender_); + RTC_GUARDED_BY(critical_section_rtcp_sender_); - RtcpNackStats nack_stats_ GUARDED_BY(critical_section_rtcp_sender_); + RtcpNackStats nack_stats_ RTC_GUARDED_BY(critical_section_rtcp_sender_); rtc::Optional video_bitrate_allocation_ - GUARDED_BY(critical_section_rtcp_sender_); + RTC_GUARDED_BY(critical_section_rtcp_sender_); void SetFlag(uint32_t type, bool is_volatile) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); void SetFlags(const std::set& types, bool is_volatile) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); bool IsFlagPresent(uint32_t type) const - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); bool ConsumeFlag(uint32_t type, bool forced = false) - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); bool AllVolatileFlagsConsumed() const - EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); struct ReportFlag { ReportFlag(uint32_t type, bool is_volatile) : type(type), is_volatile(is_volatile) {} @@ -275,7 +277,8 @@ class RTCPSender { const bool is_volatile; }; - std::set report_flags_ GUARDED_BY(critical_section_rtcp_sender_); + std::set report_flags_ + RTC_GUARDED_BY(critical_section_rtcp_sender_); typedef std::unique_ptr (RTCPSender::*BuilderFunc)( const RtcpContext&); diff --git a/webrtc/modules/rtp_rtcp/source/rtp_header_parser.cc b/webrtc/modules/rtp_rtcp/source/rtp_header_parser.cc index be940a6066..b79135937d 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_header_parser.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_header_parser.cc @@ -30,7 +30,8 @@ class RtpHeaderParserImpl : public RtpHeaderParser { private: rtc::CriticalSection critical_section_; - RtpHeaderExtensionMap rtp_header_extension_map_ GUARDED_BY(critical_section_); + RtpHeaderExtensionMap rtp_header_extension_map_ + RTC_GUARDED_BY(critical_section_); }; RtpHeaderParser* RtpHeaderParser::Create() { diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h index bffeb5c938..9b12436e66 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h @@ -65,19 +65,19 @@ class RtpPacketHistory { }; std::unique_ptr GetPacket(int index) const - EXCLUSIVE_LOCKS_REQUIRED(critsect_); - void Allocate(size_t number_to_store) EXCLUSIVE_LOCKS_REQUIRED(critsect_); - void Free() EXCLUSIVE_LOCKS_REQUIRED(critsect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); + void Allocate(size_t number_to_store) RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); + void Free() RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); bool FindSeqNum(uint16_t sequence_number, int* index) const - EXCLUSIVE_LOCKS_REQUIRED(critsect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); int FindBestFittingPacket(size_t size) const - EXCLUSIVE_LOCKS_REQUIRED(critsect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); Clock* clock_; rtc::CriticalSection critsect_; - bool store_ GUARDED_BY(critsect_); - uint32_t prev_index_ GUARDED_BY(critsect_); - std::vector stored_packets_ GUARDED_BY(critsect_); + bool store_ RTC_GUARDED_BY(critsect_); + uint32_t prev_index_ RTC_GUARDED_BY(critsect_); + std::vector stored_packets_ RTC_GUARDED_BY(critsect_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpPacketHistory); }; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.h b/webrtc/modules/rtp_rtcp/source/rtp_sender.h index f345274b9d..91ae865927 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.h @@ -254,7 +254,7 @@ class RTPSender { Clock* const clock_; const int64_t clock_delta_ms_; - Random random_ GUARDED_BY(send_critsect_); + Random random_ RTC_GUARDED_BY(send_critsect_); const bool audio_configured_; const std::unique_ptr audio_; @@ -267,14 +267,15 @@ class RTPSender { rtc::CriticalSection send_critsect_; Transport* transport_; - bool sending_media_ GUARDED_BY(send_critsect_); + bool sending_media_ RTC_GUARDED_BY(send_critsect_); size_t max_packet_size_; - int8_t payload_type_ GUARDED_BY(send_critsect_); + int8_t payload_type_ RTC_GUARDED_BY(send_critsect_); std::map payload_type_map_; - RtpHeaderExtensionMap rtp_header_extension_map_ GUARDED_BY(send_critsect_); + RtpHeaderExtensionMap rtp_header_extension_map_ + RTC_GUARDED_BY(send_critsect_); // Tracks the current request for playout delay limits from application // and decides whether the current RTP frame should include the playout @@ -288,13 +289,14 @@ class RTPSender { // Statistics rtc::CriticalSection statistics_crit_; - SendDelayMap send_delays_ GUARDED_BY(statistics_crit_); - FrameCounts frame_counts_ GUARDED_BY(statistics_crit_); - StreamDataCounters rtp_stats_ GUARDED_BY(statistics_crit_); - StreamDataCounters rtx_rtp_stats_ GUARDED_BY(statistics_crit_); - StreamDataCountersCallback* rtp_stats_callback_ GUARDED_BY(statistics_crit_); - RateStatistics total_bitrate_sent_ GUARDED_BY(statistics_crit_); - RateStatistics nack_bitrate_sent_ GUARDED_BY(statistics_crit_); + SendDelayMap send_delays_ RTC_GUARDED_BY(statistics_crit_); + FrameCounts frame_counts_ RTC_GUARDED_BY(statistics_crit_); + StreamDataCounters rtp_stats_ RTC_GUARDED_BY(statistics_crit_); + StreamDataCounters rtx_rtp_stats_ RTC_GUARDED_BY(statistics_crit_); + StreamDataCountersCallback* rtp_stats_callback_ + RTC_GUARDED_BY(statistics_crit_); + RateStatistics total_bitrate_sent_ RTC_GUARDED_BY(statistics_crit_); + RateStatistics nack_bitrate_sent_ RTC_GUARDED_BY(statistics_crit_); FrameCountObserver* const frame_count_observer_; SendSideDelayObserver* const send_side_delay_observer_; RtcEventLog* const event_log_; @@ -302,25 +304,25 @@ class RTPSender { BitrateStatisticsObserver* const bitrate_callback_; // RTP variables - uint32_t timestamp_offset_ GUARDED_BY(send_critsect_); - uint32_t remote_ssrc_ GUARDED_BY(send_critsect_); - bool sequence_number_forced_ GUARDED_BY(send_critsect_); - uint16_t sequence_number_ GUARDED_BY(send_critsect_); - uint16_t sequence_number_rtx_ GUARDED_BY(send_critsect_); + uint32_t timestamp_offset_ RTC_GUARDED_BY(send_critsect_); + uint32_t remote_ssrc_ RTC_GUARDED_BY(send_critsect_); + bool sequence_number_forced_ RTC_GUARDED_BY(send_critsect_); + uint16_t sequence_number_ RTC_GUARDED_BY(send_critsect_); + uint16_t sequence_number_rtx_ RTC_GUARDED_BY(send_critsect_); // Must be explicitly set by the application, use of rtc::Optional // only to keep track of correct use. - rtc::Optional ssrc_ GUARDED_BY(send_critsect_); - uint32_t last_rtp_timestamp_ GUARDED_BY(send_critsect_); - int64_t capture_time_ms_ GUARDED_BY(send_critsect_); - int64_t last_timestamp_time_ms_ GUARDED_BY(send_critsect_); - bool media_has_been_sent_ GUARDED_BY(send_critsect_); - bool last_packet_marker_bit_ GUARDED_BY(send_critsect_); - std::vector csrcs_ GUARDED_BY(send_critsect_); - int rtx_ GUARDED_BY(send_critsect_); - rtc::Optional ssrc_rtx_ GUARDED_BY(send_critsect_); + rtc::Optional ssrc_ RTC_GUARDED_BY(send_critsect_); + uint32_t last_rtp_timestamp_ RTC_GUARDED_BY(send_critsect_); + int64_t capture_time_ms_ RTC_GUARDED_BY(send_critsect_); + int64_t last_timestamp_time_ms_ RTC_GUARDED_BY(send_critsect_); + bool media_has_been_sent_ RTC_GUARDED_BY(send_critsect_); + bool last_packet_marker_bit_ RTC_GUARDED_BY(send_critsect_); + std::vector csrcs_ RTC_GUARDED_BY(send_critsect_); + int rtx_ RTC_GUARDED_BY(send_critsect_); + rtc::Optional ssrc_rtx_ RTC_GUARDED_BY(send_critsect_); // Mapping rtx_payload_type_map_[associated] = rtx. - std::map rtx_payload_type_map_ GUARDED_BY(send_critsect_); - size_t rtp_overhead_bytes_per_packet_ GUARDED_BY(send_critsect_); + std::map rtx_payload_type_map_ RTC_GUARDED_BY(send_critsect_); + size_t rtp_overhead_bytes_per_packet_ RTC_GUARDED_BY(send_critsect_); RateLimiter* const retransmission_rate_limiter_; OverheadObserver* overhead_observer_; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h b/webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h index 8529e0d48c..3a07080599 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h @@ -68,8 +68,8 @@ class RTPSenderAudio { // DTMF. bool dtmf_event_is_on_ = false; bool dtmf_event_first_packet_sent_ = false; - int8_t dtmf_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; - uint32_t dtmf_payload_freq_ GUARDED_BY(send_audio_critsect_) = 8000; + int8_t dtmf_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1; + uint32_t dtmf_payload_freq_ RTC_GUARDED_BY(send_audio_critsect_) = 8000; uint32_t dtmf_timestamp_ = 0; uint32_t dtmf_length_samples_ = 0; int64_t dtmf_time_last_sent_ = 0; @@ -78,16 +78,16 @@ class RTPSenderAudio { DtmfQueue dtmf_queue_; // VAD detection, used for marker bit. - bool inband_vad_active_ GUARDED_BY(send_audio_critsect_) = false; - int8_t cngnb_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; - int8_t cngwb_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; - int8_t cngswb_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; - int8_t cngfb_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; - int8_t last_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; + bool inband_vad_active_ RTC_GUARDED_BY(send_audio_critsect_) = false; + int8_t cngnb_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1; + int8_t cngwb_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1; + int8_t cngswb_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1; + int8_t cngfb_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1; + int8_t last_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1; // Audio level indication. // (https://datatracker.ietf.org/doc/draft-lennox-avt-rtp-audio-level-exthdr/) - uint8_t audio_level_dbov_ GUARDED_BY(send_audio_critsect_) = 0; + uint8_t audio_level_dbov_ RTC_GUARDED_BY(send_audio_critsect_) = 0; OneTimeEvent first_packet_sent_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSenderAudio); diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h index f91fa69051..fed35cd03a 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h @@ -97,7 +97,7 @@ class RTPSenderVideo { int64_t last_frame_time_ms; }; - size_t CalculateFecPacketOverhead() const EXCLUSIVE_LOCKS_REQUIRED(crit_); + size_t CalculateFecPacketOverhead() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); void SendVideoPacket(std::unique_ptr packet, StorageType storage); @@ -113,11 +113,11 @@ class RTPSenderVideo { StorageType media_packet_storage, bool protect_media_packet); - bool red_enabled() const EXCLUSIVE_LOCKS_REQUIRED(crit_) { + bool red_enabled() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) { return red_payload_type_ >= 0; } - bool ulpfec_enabled() const EXCLUSIVE_LOCKS_REQUIRED(crit_) { + bool ulpfec_enabled() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) { return ulpfec_payload_type_ >= 0; } @@ -125,7 +125,7 @@ class RTPSenderVideo { bool UpdateConditionalRetransmit(uint8_t temporal_id, int64_t expected_retransmission_time_ms) - EXCLUSIVE_LOCKS_REQUIRED(stats_crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(stats_crit_); RTPSender* const rtp_sender_; Clock* const clock_; @@ -134,30 +134,30 @@ class RTPSenderVideo { rtc::CriticalSection crit_; RtpVideoCodecTypes video_type_; - int32_t retransmission_settings_ GUARDED_BY(crit_); - VideoRotation last_rotation_ GUARDED_BY(crit_); + int32_t retransmission_settings_ RTC_GUARDED_BY(crit_); + VideoRotation last_rotation_ RTC_GUARDED_BY(crit_); // RED/ULPFEC. - int red_payload_type_ GUARDED_BY(crit_); - int ulpfec_payload_type_ GUARDED_BY(crit_); - UlpfecGenerator ulpfec_generator_ GUARDED_BY(crit_); + int red_payload_type_ RTC_GUARDED_BY(crit_); + int ulpfec_payload_type_ RTC_GUARDED_BY(crit_); + UlpfecGenerator ulpfec_generator_ RTC_GUARDED_BY(crit_); // FlexFEC. FlexfecSender* const flexfec_sender_; // FEC parameters, applicable to either ULPFEC or FlexFEC. - FecProtectionParams delta_fec_params_ GUARDED_BY(crit_); - FecProtectionParams key_fec_params_ GUARDED_BY(crit_); + FecProtectionParams delta_fec_params_ RTC_GUARDED_BY(crit_); + FecProtectionParams key_fec_params_ RTC_GUARDED_BY(crit_); rtc::CriticalSection stats_crit_; // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets // and any padding overhead. - RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); + RateStatistics fec_bitrate_ RTC_GUARDED_BY(stats_crit_); // Bitrate used for video payload and RTP headers. - RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); + RateStatistics video_bitrate_ RTC_GUARDED_BY(stats_crit_); std::map frame_stats_by_temporal_layer_ - GUARDED_BY(stats_crit_); + RTC_GUARDED_BY(stats_crit_); OneTimeEvent first_frame_sent_; }; diff --git a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc index 290df944bd..b71347e87e 100644 --- a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc +++ b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc @@ -52,8 +52,8 @@ bool ffmpeg_initialized = false; // Called by FFmpeg to do mutex operations if initialized using // |InitializeFFmpeg|. Disabling thread safety analysis because void** does not // play nicely with thread_annotations.h macros. -int LockManagerOperation(void** lock, AVLockOp op) - NO_THREAD_SAFETY_ANALYSIS { +int LockManagerOperation(void** lock, + AVLockOp op) RTC_NO_THREAD_SAFETY_ANALYSIS { switch (op) { case AV_LOCK_CREATE: *lock = new rtc::CriticalSection(); diff --git a/webrtc/modules/video_coding/codecs/test/video_codec_test.h b/webrtc/modules/video_coding/codecs/test/video_codec_test.h index efdac0caee..ed2c1a312f 100644 --- a/webrtc/modules/video_coding/codecs/test/video_codec_test.h +++ b/webrtc/modules/video_coding/codecs/test/video_codec_test.h @@ -95,13 +95,15 @@ class VideoCodecTest : public ::testing::Test { rtc::Event encoded_frame_event_; rtc::CriticalSection encoded_frame_section_; - rtc::Optional encoded_frame_ GUARDED_BY(encoded_frame_section_); - CodecSpecificInfo codec_specific_info_ GUARDED_BY(encoded_frame_section_); + rtc::Optional encoded_frame_ + RTC_GUARDED_BY(encoded_frame_section_); + CodecSpecificInfo codec_specific_info_ RTC_GUARDED_BY(encoded_frame_section_); rtc::Event decoded_frame_event_; rtc::CriticalSection decoded_frame_section_; - rtc::Optional decoded_frame_ GUARDED_BY(decoded_frame_section_); - rtc::Optional decoded_qp_ GUARDED_BY(decoded_frame_section_); + rtc::Optional decoded_frame_ + RTC_GUARDED_BY(decoded_frame_section_); + rtc::Optional decoded_qp_ RTC_GUARDED_BY(decoded_frame_section_); }; } // namespace webrtc diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor.h b/webrtc/modules/video_coding/codecs/test/videoprocessor.h index 072a3962ba..295d012356 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor.h +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.h @@ -253,8 +253,8 @@ class VideoProcessor { // Invoked by the callback adapter when a frame has completed decoding. void FrameDecoded(const webrtc::VideoFrame& image); - bool initialized_ GUARDED_BY(sequence_checker_); - TestConfig config_ GUARDED_BY(sequence_checker_); + bool initialized_ RTC_GUARDED_BY(sequence_checker_); + TestConfig config_ RTC_GUARDED_BY(sequence_checker_); webrtc::VideoEncoder* const encoder_; webrtc::VideoDecoder* const decoder_; @@ -280,27 +280,27 @@ class VideoProcessor { FrameWriter* const decoded_frame_writer_; // Keep track of inputed/encoded/decoded frames, so we can detect frame drops. - int last_inputed_frame_num_ GUARDED_BY(sequence_checker_); - int last_encoded_frame_num_ GUARDED_BY(sequence_checker_); - int last_decoded_frame_num_ GUARDED_BY(sequence_checker_); + int last_inputed_frame_num_ RTC_GUARDED_BY(sequence_checker_); + int last_encoded_frame_num_ RTC_GUARDED_BY(sequence_checker_); + int last_decoded_frame_num_ RTC_GUARDED_BY(sequence_checker_); // Store an RTP timestamp -> frame number map, since the timestamps are // based off of the frame rate, which can change mid-test. std::map rtp_timestamp_to_frame_num_ - GUARDED_BY(sequence_checker_); + RTC_GUARDED_BY(sequence_checker_); // Keep track of if we have excluded the first key frame from packet loss. - bool first_key_frame_has_been_excluded_ GUARDED_BY(sequence_checker_); + bool first_key_frame_has_been_excluded_ RTC_GUARDED_BY(sequence_checker_); // Keep track of the last successfully decoded frame, since we write that // frame to disk when decoding fails. - rtc::Buffer last_decoded_frame_buffer_ GUARDED_BY(sequence_checker_); + rtc::Buffer last_decoded_frame_buffer_ RTC_GUARDED_BY(sequence_checker_); // Statistics. Stats* stats_; - std::vector num_dropped_frames_ GUARDED_BY(sequence_checker_); - std::vector num_spatial_resizes_ GUARDED_BY(sequence_checker_); - int rate_update_index_ GUARDED_BY(sequence_checker_); + std::vector num_dropped_frames_ RTC_GUARDED_BY(sequence_checker_); + std::vector num_spatial_resizes_ RTC_GUARDED_BY(sequence_checker_); + int rate_update_index_ RTC_GUARDED_BY(sequence_checker_); rtc::SequencedTaskChecker sequence_checker_; diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.h b/webrtc/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.h index 485dc5fc03..d75f67436e 100644 --- a/webrtc/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.h +++ b/webrtc/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.h @@ -106,7 +106,7 @@ class Vp9FrameBufferPool { rtc::CriticalSection buffers_lock_; // All buffers, in use or ready to be recycled. std::vector> allocated_buffers_ - GUARDED_BY(buffers_lock_); + RTC_GUARDED_BY(buffers_lock_); // If more buffers than this are allocated we print warnings and crash if in // debug mode. VP9 is defined to have 8 reference buffers, of which 3 can be // referenced by any frame, see diff --git a/webrtc/modules/video_coding/frame_buffer2.h b/webrtc/modules/video_coding/frame_buffer2.h index 13dd341aaa..5f5173e4dd 100644 --- a/webrtc/modules/video_coding/frame_buffer2.h +++ b/webrtc/modules/video_coding/frame_buffer2.h @@ -129,56 +129,56 @@ class FrameBuffer { // Updates the minimal and maximal playout delays // depending on the frame. void UpdatePlayoutDelays(const FrameObject& frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Update all directly dependent and indirectly dependent frames and mark // them as continuous if all their references has been fulfilled. void PropagateContinuity(FrameMap::iterator start) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Marks the frame as decoded and updates all directly dependent frames. void PropagateDecodability(const FrameInfo& info) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Advances |last_decoded_frame_it_| to |decoded| and removes old // frame info. void AdvanceLastDecodedFrame(FrameMap::iterator decoded) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Update the corresponding FrameInfo of |frame| and all FrameInfos that // |frame| references. // Return false if |frame| will never be decodable, true otherwise. bool UpdateFrameInfoWithIncomingFrame(const FrameObject& frame, FrameMap::iterator info) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); - void UpdateJitterDelay() EXCLUSIVE_LOCKS_REQUIRED(crit_); + void UpdateJitterDelay() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); - void UpdateTimingFrameInfo() EXCLUSIVE_LOCKS_REQUIRED(crit_); + void UpdateTimingFrameInfo() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); - void ClearFramesAndHistory() EXCLUSIVE_LOCKS_REQUIRED(crit_); + void ClearFramesAndHistory() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); bool HasBadRenderTiming(const FrameObject& frame, int64_t now_ms) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); - FrameMap frames_ GUARDED_BY(crit_); + FrameMap frames_ RTC_GUARDED_BY(crit_); rtc::CriticalSection crit_; Clock* const clock_; rtc::Event new_continuous_frame_event_; - VCMJitterEstimator* const jitter_estimator_ GUARDED_BY(crit_); - VCMTiming* const timing_ GUARDED_BY(crit_); - VCMInterFrameDelay inter_frame_delay_ GUARDED_BY(crit_); - uint32_t last_decoded_frame_timestamp_ GUARDED_BY(crit_); - FrameMap::iterator last_decoded_frame_it_ GUARDED_BY(crit_); - FrameMap::iterator last_continuous_frame_it_ GUARDED_BY(crit_); - FrameMap::iterator next_frame_it_ GUARDED_BY(crit_); - int num_frames_history_ GUARDED_BY(crit_); - int num_frames_buffered_ GUARDED_BY(crit_); - bool stopped_ GUARDED_BY(crit_); - VCMVideoProtection protection_mode_ GUARDED_BY(crit_); + VCMJitterEstimator* const jitter_estimator_ RTC_GUARDED_BY(crit_); + VCMTiming* const timing_ RTC_GUARDED_BY(crit_); + VCMInterFrameDelay inter_frame_delay_ RTC_GUARDED_BY(crit_); + uint32_t last_decoded_frame_timestamp_ RTC_GUARDED_BY(crit_); + FrameMap::iterator last_decoded_frame_it_ RTC_GUARDED_BY(crit_); + FrameMap::iterator last_continuous_frame_it_ RTC_GUARDED_BY(crit_); + FrameMap::iterator next_frame_it_ RTC_GUARDED_BY(crit_); + int num_frames_history_ RTC_GUARDED_BY(crit_); + int num_frames_buffered_ RTC_GUARDED_BY(crit_); + bool stopped_ RTC_GUARDED_BY(crit_); + VCMVideoProtection protection_mode_ RTC_GUARDED_BY(crit_); VCMReceiveStatisticsCallback* const stats_callback_; - int64_t last_log_non_decoded_ms_ GUARDED_BY(crit_); + int64_t last_log_non_decoded_ms_ RTC_GUARDED_BY(crit_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer); }; diff --git a/webrtc/modules/video_coding/generic_decoder.h b/webrtc/modules/video_coding/generic_decoder.h index fcfea7740e..c8122da2d8 100644 --- a/webrtc/modules/video_coding/generic_decoder.h +++ b/webrtc/modules/video_coding/generic_decoder.h @@ -69,7 +69,7 @@ class VCMDecodedFrameCallback : public DecodedImageCallback { VCMReceiveCallback* _receiveCallback = nullptr; VCMTiming* _timing; rtc::CriticalSection lock_; - VCMTimestampMap _timestampMap GUARDED_BY(lock_); + VCMTimestampMap _timestampMap RTC_GUARDED_BY(lock_); uint64_t _lastReceivedPictureID; int64_t ntp_offset_; }; diff --git a/webrtc/modules/video_coding/generic_encoder.h b/webrtc/modules/video_coding/generic_encoder.h index 20e07c7378..32db2e7908 100644 --- a/webrtc/modules/video_coding/generic_encoder.h +++ b/webrtc/modules/video_coding/generic_encoder.h @@ -77,11 +77,11 @@ class VCMEncodedFrameCallback : public EncodedImageCallback { }; // Separate instance for each simulcast stream or spatial layer. std::vector timing_frames_info_ - GUARDED_BY(timing_params_lock_); - size_t framerate_ GUARDED_BY(timing_params_lock_); - int64_t last_timing_frame_time_ms_ GUARDED_BY(timing_params_lock_); + RTC_GUARDED_BY(timing_params_lock_); + size_t framerate_ RTC_GUARDED_BY(timing_params_lock_); + int64_t last_timing_frame_time_ms_ RTC_GUARDED_BY(timing_params_lock_); VideoCodec::TimingFrameTriggerThresholds timing_frames_thresholds_ - GUARDED_BY(timing_params_lock_); + RTC_GUARDED_BY(timing_params_lock_); // Experiment groups parsed from field trials for realtime video ([0]) and // screenshare ([1]). 0 means no group specified. Positive values are @@ -117,11 +117,11 @@ class VCMGenericEncoder { private: rtc::RaceChecker race_checker_; - VideoEncoder* const encoder_ GUARDED_BY(race_checker_); + VideoEncoder* const encoder_ RTC_GUARDED_BY(race_checker_); VCMEncodedFrameCallback* const vcm_encoded_frame_callback_; const bool internal_source_; rtc::CriticalSection params_lock_; - EncoderParameters encoder_params_ GUARDED_BY(params_lock_); + EncoderParameters encoder_params_ RTC_GUARDED_BY(params_lock_); bool is_screenshare_; size_t streams_or_svc_num_; }; diff --git a/webrtc/modules/video_coding/jitter_buffer.h b/webrtc/modules/video_coding/jitter_buffer.h index 44794d21bc..04fc0cd8f4 100644 --- a/webrtc/modules/video_coding/jitter_buffer.h +++ b/webrtc/modules/video_coding/jitter_buffer.h @@ -219,72 +219,72 @@ class VCMJitterBuffer { VCMFrameBufferEnum GetFrame(const VCMPacket& packet, VCMFrameBuffer** frame, FrameList** frame_list) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Returns true if |frame| is continuous in |decoding_state|, not taking // decodable frames into account. bool IsContinuousInState(const VCMFrameBuffer& frame, const VCMDecodingState& decoding_state) const - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Returns true if |frame| is continuous in the |last_decoded_state_|, taking // all decodable frames into account. bool IsContinuous(const VCMFrameBuffer& frame) const - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Looks for frames in |incomplete_frames_| which are continuous in the // provided |decoded_state|. Starts the search from the timestamp of // |decoded_state|. void FindAndInsertContinuousFramesWithState( const VCMDecodingState& decoded_state) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Looks for frames in |incomplete_frames_| which are continuous in // |last_decoded_state_| taking all decodable frames into account. Starts // the search from |new_frame|. void FindAndInsertContinuousFrames(const VCMFrameBuffer& new_frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); - VCMFrameBuffer* NextFrame() const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + VCMFrameBuffer* NextFrame() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Returns true if the NACK list was updated to cover sequence numbers up to // |sequence_number|. If false a key frame is needed to get into a state where // we can continue decoding. bool UpdateNackList(uint16_t sequence_number) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); bool TooLargeNackList() const; // Returns true if the NACK list was reduced without problem. If false a key // frame is needed to get into a state where we can continue decoding. - bool HandleTooLargeNackList() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + bool HandleTooLargeNackList() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); bool MissingTooOldPacket(uint16_t latest_sequence_number) const - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Returns true if the too old packets was successfully removed from the NACK // list. If false, a key frame is needed to get into a state where we can // continue decoding. bool HandleTooOldPackets(uint16_t latest_sequence_number) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Drops all packets in the NACK list up until |last_decoded_sequence_number|. void DropPacketsFromNackList(uint16_t last_decoded_sequence_number); // Gets an empty frame, creating a new frame if necessary (i.e. increases // jitter buffer size). - VCMFrameBuffer* GetEmptyFrame() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + VCMFrameBuffer* GetEmptyFrame() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Attempts to increase the size of the jitter buffer. Returns true on // success, false otherwise. - bool TryToIncreaseJitterBufferSize() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + bool TryToIncreaseJitterBufferSize() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Recycles oldest frames until a key frame is found. Used if jitter buffer is // completely full. Returns true if a key frame was found. - bool RecycleFramesUntilKeyFrame() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + bool RecycleFramesUntilKeyFrame() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Updates the frame statistics. // Counts only complete frames, so decodable incomplete frames will not be // counted. void CountFrame(const VCMFrameBuffer& frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Update rolling average of packets per frame. void UpdateAveragePacketsPerFrame(int current_number_packets_); // Cleans the frame list in the JB from old/empty frames. // Should only be called prior to actual use. - void CleanUpOldOrEmptyFrames() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + void CleanUpOldOrEmptyFrames() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Returns true if |packet| is likely to have been retransmitted. bool IsPacketRetransmitted(const VCMPacket& packet) const; @@ -302,15 +302,16 @@ class VCMJitterBuffer { // Returns true if we should wait for retransmissions, false otherwise. bool WaitForRetransmissions(); - int NonContinuousOrIncompleteDuration() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + int NonContinuousOrIncompleteDuration() + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); uint16_t EstimatedLowSequenceNumber(const VCMFrameBuffer& frame) const; - void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + void UpdateHistograms() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Reset frame buffer and return it to free_frames_. void RecycleFrameBuffer(VCMFrameBuffer* frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); Clock* clock_; // If we are running (have started) or not. @@ -320,14 +321,14 @@ class VCMJitterBuffer { std::unique_ptr frame_event_; // Number of allocated frames. int max_number_of_frames_; - UnorderedFrameList free_frames_ GUARDED_BY(crit_sect_); - FrameList decodable_frames_ GUARDED_BY(crit_sect_); - FrameList incomplete_frames_ GUARDED_BY(crit_sect_); - VCMDecodingState last_decoded_state_ GUARDED_BY(crit_sect_); + UnorderedFrameList free_frames_ RTC_GUARDED_BY(crit_sect_); + FrameList decodable_frames_ RTC_GUARDED_BY(crit_sect_); + FrameList incomplete_frames_ RTC_GUARDED_BY(crit_sect_); + VCMDecodingState last_decoded_state_ RTC_GUARDED_BY(crit_sect_); bool first_packet_since_reset_; // Statistics. - VCMReceiveStatisticsCallback* stats_callback_ GUARDED_BY(crit_sect_); + VCMReceiveStatisticsCallback* stats_callback_ RTC_GUARDED_BY(crit_sect_); // Frame counts for each type (key, delta, ...) FrameCounts receive_statistics_; // Latest calculated frame rates of incoming stream. @@ -339,13 +340,13 @@ class VCMJitterBuffer { // Number of packets in a row that have been too old. int num_consecutive_old_packets_; // Number of packets received. - int num_packets_ GUARDED_BY(crit_sect_); + int num_packets_ RTC_GUARDED_BY(crit_sect_); // Number of duplicated packets received. - int num_duplicated_packets_ GUARDED_BY(crit_sect_); + int num_duplicated_packets_ RTC_GUARDED_BY(crit_sect_); // Number of packets discarded by the jitter buffer. - int num_discarded_packets_ GUARDED_BY(crit_sect_); + int num_discarded_packets_ RTC_GUARDED_BY(crit_sect_); // Time when first packet is received. - int64_t time_first_packet_ms_ GUARDED_BY(crit_sect_); + int64_t time_first_packet_ms_ RTC_GUARDED_BY(crit_sect_); // Jitter estimation. // Filter for estimating jitter. diff --git a/webrtc/modules/video_coding/media_optimization.h b/webrtc/modules/video_coding/media_optimization.h index 1e4179ca68..bbd018ef42 100644 --- a/webrtc/modules/video_coding/media_optimization.h +++ b/webrtc/modules/video_coding/media_optimization.h @@ -68,40 +68,42 @@ class MediaOptimization { struct EncodedFrameSample; typedef std::list FrameSampleList; - void UpdateIncomingFrameRate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + void UpdateIncomingFrameRate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); void PurgeOldFrameSamples(int64_t threshold_ms) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); - void UpdateSentFramerate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + void UpdateSentFramerate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); void ProcessIncomingFrameRate(int64_t now) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Checks conditions for suspending the video. The method compares // |video_target_bitrate_| with the threshold values for suspension, and // changes the state of |video_suspended_| accordingly. - void CheckSuspendConditions() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + void CheckSuspendConditions() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); void SetEncodingDataInternal(int32_t max_bit_rate, uint32_t frame_rate, uint32_t bit_rate) - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); - uint32_t InputFrameRateInternal() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + uint32_t InputFrameRateInternal() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); - uint32_t SentFrameRateInternal() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + uint32_t SentFrameRateInternal() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Protect all members. rtc::CriticalSection crit_sect_; - Clock* clock_ GUARDED_BY(crit_sect_); - int32_t max_bit_rate_ GUARDED_BY(crit_sect_); - float user_frame_rate_ GUARDED_BY(crit_sect_); - std::unique_ptr frame_dropper_ GUARDED_BY(crit_sect_); - int video_target_bitrate_ GUARDED_BY(crit_sect_); - float incoming_frame_rate_ GUARDED_BY(crit_sect_); - int64_t incoming_frame_times_[kFrameCountHistorySize] GUARDED_BY(crit_sect_); - std::list encoded_frame_samples_ GUARDED_BY(crit_sect_); - uint32_t avg_sent_framerate_ GUARDED_BY(crit_sect_); + Clock* clock_ RTC_GUARDED_BY(crit_sect_); + int32_t max_bit_rate_ RTC_GUARDED_BY(crit_sect_); + float user_frame_rate_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr frame_dropper_ RTC_GUARDED_BY(crit_sect_); + int video_target_bitrate_ RTC_GUARDED_BY(crit_sect_); + float incoming_frame_rate_ RTC_GUARDED_BY(crit_sect_); + int64_t incoming_frame_times_[kFrameCountHistorySize] RTC_GUARDED_BY( + crit_sect_); + std::list encoded_frame_samples_ + RTC_GUARDED_BY(crit_sect_); + uint32_t avg_sent_framerate_ RTC_GUARDED_BY(crit_sect_); }; } // namespace media_optimization } // namespace webrtc diff --git a/webrtc/modules/video_coding/nack_module.h b/webrtc/modules/video_coding/nack_module.h index 35be4c2b18..df04a6b251 100644 --- a/webrtc/modules/video_coding/nack_module.h +++ b/webrtc/modules/video_coding/nack_module.h @@ -59,22 +59,22 @@ class NackModule : public Module { int retries; }; void AddPacketsToNack(uint16_t seq_num_start, uint16_t seq_num_end) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Removes packets from the nack list until the next keyframe. Returns true // if packets were removed. - bool RemovePacketsUntilKeyFrame() EXCLUSIVE_LOCKS_REQUIRED(crit_); + bool RemovePacketsUntilKeyFrame() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); std::vector GetNackBatch(NackFilterOptions options) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Update the reordering distribution. void UpdateReorderingStatistics(uint16_t seq_num) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Returns how many packets we have to wait in order to receive the packet // with probability |probabilty| or higher. int WaitNumberOfPackets(float probability) const - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); rtc::CriticalSection crit_; Clock* const clock_; @@ -85,13 +85,13 @@ class NackModule : public Module { // known thread (e.g. see |initialized_|). Those probably do not need // synchronized access. std::map> nack_list_ - GUARDED_BY(crit_); + RTC_GUARDED_BY(crit_); std::set> keyframe_list_ - GUARDED_BY(crit_); - video_coding::Histogram reordering_histogram_ GUARDED_BY(crit_); - bool initialized_ GUARDED_BY(crit_); - int64_t rtt_ms_ GUARDED_BY(crit_); - uint16_t newest_seq_num_ GUARDED_BY(crit_); + RTC_GUARDED_BY(crit_); + video_coding::Histogram reordering_histogram_ RTC_GUARDED_BY(crit_); + bool initialized_ RTC_GUARDED_BY(crit_); + int64_t rtt_ms_ RTC_GUARDED_BY(crit_); + uint16_t newest_seq_num_ RTC_GUARDED_BY(crit_); // Only touched on the process thread. int64_t next_process_time_ms_; diff --git a/webrtc/modules/video_coding/packet_buffer.h b/webrtc/modules/video_coding/packet_buffer.h index e0f058a56c..56e2363382 100644 --- a/webrtc/modules/video_coding/packet_buffer.h +++ b/webrtc/modules/video_coding/packet_buffer.h @@ -99,16 +99,16 @@ class PacketBuffer { Clock* const clock_; // Tries to expand the buffer. - bool ExpandBufferSize() EXCLUSIVE_LOCKS_REQUIRED(crit_); + bool ExpandBufferSize() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Test if all previous packets has arrived for the given sequence number. bool PotentialNewFrame(uint16_t seq_num) const - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Test if all packets of a frame has arrived, and if so, creates a frame. // Returns a vector of received frames. std::vector> FindFrames(uint16_t seq_num) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Copy the bitstream for |frame| to |destination|. // Virtual for testing. @@ -117,46 +117,48 @@ class PacketBuffer { // Get the packet with sequence number |seq_num|. // Virtual for testing. virtual VCMPacket* GetPacket(uint16_t seq_num) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Mark all slots used by |frame| as not used. // Virtual for testing. virtual void ReturnFrame(RtpFrameObject* frame); - void UpdateMissingPackets(uint16_t seq_num) EXCLUSIVE_LOCKS_REQUIRED(crit_); + void UpdateMissingPackets(uint16_t seq_num) + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); rtc::CriticalSection crit_; // Buffer size_ and max_size_ must always be a power of two. - size_t size_ GUARDED_BY(crit_); + size_t size_ RTC_GUARDED_BY(crit_); const size_t max_size_; // The fist sequence number currently in the buffer. - uint16_t first_seq_num_ GUARDED_BY(crit_); + uint16_t first_seq_num_ RTC_GUARDED_BY(crit_); // If the packet buffer has received its first packet. - bool first_packet_received_ GUARDED_BY(crit_); + bool first_packet_received_ RTC_GUARDED_BY(crit_); // If the buffer is cleared to |first_seq_num_|. - bool is_cleared_to_first_seq_num_ GUARDED_BY(crit_); + bool is_cleared_to_first_seq_num_ RTC_GUARDED_BY(crit_); // Buffer that holds the inserted packets. - std::vector data_buffer_ GUARDED_BY(crit_); + std::vector data_buffer_ RTC_GUARDED_BY(crit_); // Buffer that holds the information about which slot that is currently in use // and information needed to determine the continuity between packets. - std::vector sequence_buffer_ GUARDED_BY(crit_); + std::vector sequence_buffer_ RTC_GUARDED_BY(crit_); // Called when a received frame is found. OnReceivedFrameCallback* const received_frame_callback_; // Timestamp (not RTP timestamp) of the last received packet/keyframe packet. - rtc::Optional last_received_packet_ms_ GUARDED_BY(crit_); - rtc::Optional last_received_keyframe_packet_ms_ GUARDED_BY(crit_); + rtc::Optional last_received_packet_ms_ RTC_GUARDED_BY(crit_); + rtc::Optional last_received_keyframe_packet_ms_ + RTC_GUARDED_BY(crit_); - rtc::Optional newest_inserted_seq_num_ GUARDED_BY(crit_); + rtc::Optional newest_inserted_seq_num_ RTC_GUARDED_BY(crit_); std::set> missing_packets_ - GUARDED_BY(crit_); + RTC_GUARDED_BY(crit_); mutable volatile int ref_count_ = 0; }; diff --git a/webrtc/modules/video_coding/protection_bitrate_calculator.h b/webrtc/modules/video_coding/protection_bitrate_calculator.h index d2c1499231..d6496958c8 100644 --- a/webrtc/modules/video_coding/protection_bitrate_calculator.h +++ b/webrtc/modules/video_coding/protection_bitrate_calculator.h @@ -69,8 +69,8 @@ class ProtectionBitrateCalculator { rtc::CriticalSection crit_sect_; std::unique_ptr loss_prot_logic_ - GUARDED_BY(crit_sect_); - size_t max_payload_size_ GUARDED_BY(crit_sect_); + RTC_GUARDED_BY(crit_sect_); + size_t max_payload_size_ RTC_GUARDED_BY(crit_sect_); RTC_DISALLOW_COPY_AND_ASSIGN(ProtectionBitrateCalculator); }; diff --git a/webrtc/modules/video_coding/rtp_frame_reference_finder.h b/webrtc/modules/video_coding/rtp_frame_reference_finder.h index 601e7c48d8..f309a5eea2 100644 --- a/webrtc/modules/video_coding/rtp_frame_reference_finder.h +++ b/webrtc/modules/video_coding/rtp_frame_reference_finder.h @@ -79,71 +79,73 @@ class RtpFrameReferenceFinder { // Find the relevant group of pictures and update its "last-picture-id-with // padding" sequence number. void UpdateLastPictureIdWithPadding(uint16_t seq_num) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Retry stashed frames until no more complete frames are found. - void RetryStashedFrames() EXCLUSIVE_LOCKS_REQUIRED(crit_); + void RetryStashedFrames() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); FrameDecision ManageFrameInternal(RtpFrameObject* frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Find references for generic frames. If |picture_id| is unspecified // then packet sequence numbers will be used to determine the references // of the frames. FrameDecision ManageFrameGeneric(RtpFrameObject* frame, int picture_id) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Find references for Vp8 frames FrameDecision ManageFrameVp8(RtpFrameObject* frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Updates necessary layer info state used to determine frame references for // Vp8. void UpdateLayerInfoVp8(RtpFrameObject* frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Find references for Vp9 frames FrameDecision ManageFrameVp9(RtpFrameObject* frame) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Check if we are missing a frame necessary to determine the references // for this frame. bool MissingRequiredFrameVp9(uint16_t picture_id, const GofInfo& info) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Updates which frames that have been received. If there is a gap, // missing frames will be added to |missing_frames_for_layer_| or // if this is an already missing frame then it will be removed. void FrameReceivedVp9(uint16_t picture_id, GofInfo* info) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Check if there is a frame with the up-switch flag set in the interval // (|pid_ref|, |picture_id|) with temporal layer smaller than |temporal_idx|. bool UpSwitchInIntervalVp9(uint16_t picture_id, uint8_t temporal_idx, - uint16_t pid_ref) EXCLUSIVE_LOCKS_REQUIRED(crit_); + uint16_t pid_ref) + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Unwrap |frame|s picture id and its references to 16 bits. - void UnwrapPictureIds(RtpFrameObject* frame) EXCLUSIVE_LOCKS_REQUIRED(crit_); + void UnwrapPictureIds(RtpFrameObject* frame) + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Returns true if the frame is old and should be dropped. // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be // around M59). bool Vp9PidTl0Fix(const RtpFrameObject& frame, int16_t* picture_id, - int16_t* tl0_pic_idx) EXCLUSIVE_LOCKS_REQUIRED(crit_); + int16_t* tl0_pic_idx) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be // around M59). bool DetectVp9PicIdJump(int fixed_pid, int fixed_tl0, uint32_t timestamp) const - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be // around M59). bool DetectVp9Tl0PicIdxJump(int fixed_tl0, uint32_t timestamp) const - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // For every group of pictures, hold two sequence numbers. The first being // the sequence number of the last packet of the last completed frame, and @@ -152,36 +154,37 @@ class RtpFrameReferenceFinder { std::map, DescendingSeqNumComp> - last_seq_num_gop_ GUARDED_BY(crit_); + last_seq_num_gop_ RTC_GUARDED_BY(crit_); // Save the last picture id in order to detect when there is a gap in frames // that have not yet been fully received. - int last_picture_id_ GUARDED_BY(crit_); + int last_picture_id_ RTC_GUARDED_BY(crit_); // Padding packets that have been received but that are not yet continuous // with any group of pictures. std::set> stashed_padding_ - GUARDED_BY(crit_); + RTC_GUARDED_BY(crit_); // The last unwrapped picture id. Used to unwrap the picture id from a length // of |kPicIdLength| to 16 bits. - int last_unwrap_ GUARDED_BY(crit_); + int last_unwrap_ RTC_GUARDED_BY(crit_); // Frames earlier than the last received frame that have not yet been // fully received. std::set> - not_yet_received_frames_ GUARDED_BY(crit_); + not_yet_received_frames_ RTC_GUARDED_BY(crit_); // Frames that have been fully received but didn't have all the information // needed to determine their references. - std::deque> stashed_frames_ GUARDED_BY(crit_); + std::deque> stashed_frames_ + RTC_GUARDED_BY(crit_); // Holds the information about the last completed frame for a given temporal // layer given a Tl0 picture index. std::map, DescendingSeqNumComp> - layer_info_ GUARDED_BY(crit_); + layer_info_ RTC_GUARDED_BY(crit_); // Where the current scalability structure is in the // |scalability_structures_| array. @@ -189,36 +192,36 @@ class RtpFrameReferenceFinder { // Holds received scalability structures. std::array scalability_structures_ - GUARDED_BY(crit_); + RTC_GUARDED_BY(crit_); // Holds the the Gof information for a given TL0 picture index. std::map> gof_info_ - GUARDED_BY(crit_); + RTC_GUARDED_BY(crit_); // Keep track of which picture id and which temporal layer that had the // up switch flag set. std::map> - up_switch_ GUARDED_BY(crit_); + up_switch_ RTC_GUARDED_BY(crit_); // For every temporal layer, keep a set of which frames that are missing. std::array>, kMaxTemporalLayers> - missing_frames_for_layer_ GUARDED_BY(crit_); + missing_frames_for_layer_ RTC_GUARDED_BY(crit_); // How far frames have been cleared by sequence number. A frame will be // cleared if it contains a packet with a sequence number older than // |cleared_to_seq_num_|. - int cleared_to_seq_num_ GUARDED_BY(crit_); + int cleared_to_seq_num_ RTC_GUARDED_BY(crit_); OnCompleteFrameCallback* frame_callback_; // Unwrapper used to unwrap generic RTP streams. In a generic stream we derive // a picture id from the packet sequence number. - SeqNumUnwrapper generic_unwrapper_ GUARDED_BY(crit_); + SeqNumUnwrapper generic_unwrapper_ RTC_GUARDED_BY(crit_); // Unwrapper used to unwrap VP8/VP9 streams which have their picture id // specified. - SeqNumUnwrapper unwrapper_ GUARDED_BY(crit_); + SeqNumUnwrapper unwrapper_ RTC_GUARDED_BY(crit_); }; } // namespace video_coding diff --git a/webrtc/modules/video_coding/timing.h b/webrtc/modules/video_coding/timing.h index 954a006d31..bbbb65fbd8 100644 --- a/webrtc/modules/video_coding/timing.h +++ b/webrtc/modules/video_coding/timing.h @@ -109,38 +109,38 @@ class VCMTiming { enum { kDelayMaxChangeMsPerS = 100 }; protected: - int RequiredDecodeTimeMs() const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + int RequiredDecodeTimeMs() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); int64_t RenderTimeMsInternal(uint32_t frame_timestamp, int64_t now_ms) const - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); - int TargetDelayInternal() const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + int TargetDelayInternal() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); private: void UpdateHistograms() const; rtc::CriticalSection crit_sect_; Clock* const clock_; - bool master_ GUARDED_BY(crit_sect_); - TimestampExtrapolator* ts_extrapolator_ GUARDED_BY(crit_sect_); - std::unique_ptr codec_timer_ GUARDED_BY(crit_sect_); - int render_delay_ms_ GUARDED_BY(crit_sect_); + bool master_ RTC_GUARDED_BY(crit_sect_); + TimestampExtrapolator* ts_extrapolator_ RTC_GUARDED_BY(crit_sect_); + std::unique_ptr codec_timer_ RTC_GUARDED_BY(crit_sect_); + int render_delay_ms_ RTC_GUARDED_BY(crit_sect_); // Best-effort playout delay range for frames from capture to render. // The receiver tries to keep the delay between |min_playout_delay_ms_| // and |max_playout_delay_ms_| taking the network jitter into account. // A special case is where min_playout_delay_ms_ = max_playout_delay_ms_ = 0, // in which case the receiver tries to play the frames as they arrive. - int min_playout_delay_ms_ GUARDED_BY(crit_sect_); - int max_playout_delay_ms_ GUARDED_BY(crit_sect_); - int jitter_delay_ms_ GUARDED_BY(crit_sect_); - int current_delay_ms_ GUARDED_BY(crit_sect_); - int last_decode_ms_ GUARDED_BY(crit_sect_); - uint32_t prev_frame_timestamp_ GUARDED_BY(crit_sect_); - rtc::Optional timing_frame_info_ GUARDED_BY(crit_sect_); + int min_playout_delay_ms_ RTC_GUARDED_BY(crit_sect_); + int max_playout_delay_ms_ RTC_GUARDED_BY(crit_sect_); + int jitter_delay_ms_ RTC_GUARDED_BY(crit_sect_); + int current_delay_ms_ RTC_GUARDED_BY(crit_sect_); + int last_decode_ms_ RTC_GUARDED_BY(crit_sect_); + uint32_t prev_frame_timestamp_ RTC_GUARDED_BY(crit_sect_); + rtc::Optional timing_frame_info_ RTC_GUARDED_BY(crit_sect_); // Statistics. - size_t num_decoded_frames_ GUARDED_BY(crit_sect_); - size_t num_delayed_decoded_frames_ GUARDED_BY(crit_sect_); - int64_t first_decoded_frame_ms_ GUARDED_BY(crit_sect_); - uint64_t sum_missed_render_deadline_ms_ GUARDED_BY(crit_sect_); + size_t num_decoded_frames_ RTC_GUARDED_BY(crit_sect_); + size_t num_delayed_decoded_frames_ RTC_GUARDED_BY(crit_sect_); + int64_t first_decoded_frame_ms_ RTC_GUARDED_BY(crit_sect_); + uint64_t sum_missed_render_deadline_ms_ RTC_GUARDED_BY(crit_sect_); }; } // namespace webrtc diff --git a/webrtc/modules/video_coding/utility/quality_scaler.h b/webrtc/modules/video_coding/utility/quality_scaler.h index 25d39cc986..abe6d72bd4 100644 --- a/webrtc/modules/video_coding/utility/quality_scaler.h +++ b/webrtc/modules/video_coding/utility/quality_scaler.h @@ -71,16 +71,16 @@ class QualityScaler { void ReportQPHigh(); int64_t GetSamplingPeriodMs() const; - CheckQPTask* check_qp_task_ GUARDED_BY(&task_checker_); - AdaptationObserverInterface* const observer_ GUARDED_BY(&task_checker_); + CheckQPTask* check_qp_task_ RTC_GUARDED_BY(&task_checker_); + AdaptationObserverInterface* const observer_ RTC_GUARDED_BY(&task_checker_); rtc::SequencedTaskChecker task_checker_; const int64_t sampling_period_ms_; - bool fast_rampup_ GUARDED_BY(&task_checker_); - MovingAverage average_qp_ GUARDED_BY(&task_checker_); - MovingAverage framedrop_percent_ GUARDED_BY(&task_checker_); + bool fast_rampup_ RTC_GUARDED_BY(&task_checker_); + MovingAverage average_qp_ RTC_GUARDED_BY(&task_checker_); + MovingAverage framedrop_percent_ RTC_GUARDED_BY(&task_checker_); - VideoEncoder::QpThresholds thresholds_ GUARDED_BY(&task_checker_); + VideoEncoder::QpThresholds thresholds_ RTC_GUARDED_BY(&task_checker_); }; } // namespace webrtc diff --git a/webrtc/modules/video_coding/video_coding_impl.cc b/webrtc/modules/video_coding/video_coding_impl.cc index 7ab53143bd..7551214f1b 100644 --- a/webrtc/modules/video_coding/video_coding_impl.cc +++ b/webrtc/modules/video_coding/video_coding_impl.cc @@ -72,7 +72,7 @@ class EncodedImageCallbackWrapper : public EncodedImageCallback { private: rtc::CriticalSection cs_; - EncodedImageCallback* callback_ GUARDED_BY(cs_); + EncodedImageCallback* callback_ RTC_GUARDED_BY(cs_); }; class VideoCodingModuleImpl : public VideoCodingModule { diff --git a/webrtc/modules/video_coding/video_coding_impl.h b/webrtc/modules/video_coding/video_coding_impl.h index 37d2b2d299..3f4d6abeed 100644 --- a/webrtc/modules/video_coding/video_coding_impl.h +++ b/webrtc/modules/video_coding/video_coding_impl.h @@ -118,18 +118,18 @@ class VideoSender : public Module { VideoBitrateAllocator* bitrate_allocator, uint32_t target_bitrate_bps); void SetEncoderParameters(EncoderParameters params, bool has_internal_source) - EXCLUSIVE_LOCKS_REQUIRED(encoder_crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(encoder_crit_); Clock* const clock_; rtc::CriticalSection encoder_crit_; VCMGenericEncoder* _encoder; media_optimization::MediaOptimization _mediaOpt; - VCMEncodedFrameCallback _encodedFrameCallback GUARDED_BY(encoder_crit_); + VCMEncodedFrameCallback _encodedFrameCallback RTC_GUARDED_BY(encoder_crit_); EncodedImageCallback* const post_encode_callback_; VCMSendStatisticsCallback* const send_stats_callback_; - VCMCodecDataBase _codecDataBase GUARDED_BY(encoder_crit_); - bool frame_dropper_enabled_ GUARDED_BY(encoder_crit_); + VCMCodecDataBase _codecDataBase RTC_GUARDED_BY(encoder_crit_); + bool frame_dropper_enabled_ RTC_GUARDED_BY(encoder_crit_); VCMProcessTimer _sendStatsTimer; // Must be accessed on the construction thread of VideoSender. @@ -137,9 +137,9 @@ class VideoSender : public Module { rtc::SequencedTaskChecker sequenced_checker_; rtc::CriticalSection params_crit_; - EncoderParameters encoder_params_ GUARDED_BY(params_crit_); - bool encoder_has_internal_source_ GUARDED_BY(params_crit_); - std::vector next_frame_types_ GUARDED_BY(params_crit_); + EncoderParameters encoder_params_ RTC_GUARDED_BY(params_crit_); + bool encoder_has_internal_source_ RTC_GUARDED_BY(params_crit_); + std::vector next_frame_types_ RTC_GUARDED_BY(params_crit_); }; class VideoReceiver : public Module { @@ -200,7 +200,7 @@ class VideoReceiver : public Module { protected: int32_t Decode(const webrtc::VCMEncodedFrame& frame) - EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); int32_t RequestKeyFrame(); private: @@ -211,16 +211,18 @@ class VideoReceiver : public Module { VCMTiming* _timing; VCMReceiver _receiver; VCMDecodedFrameCallback _decodedFrameCallback; - VCMFrameTypeCallback* _frameTypeCallback GUARDED_BY(process_crit_); - VCMReceiveStatisticsCallback* _receiveStatsCallback GUARDED_BY(process_crit_); - VCMPacketRequestCallback* _packetRequestCallback GUARDED_BY(process_crit_); + VCMFrameTypeCallback* _frameTypeCallback RTC_GUARDED_BY(process_crit_); + VCMReceiveStatisticsCallback* _receiveStatsCallback + RTC_GUARDED_BY(process_crit_); + VCMPacketRequestCallback* _packetRequestCallback + RTC_GUARDED_BY(process_crit_); VCMFrameBuffer _frameFromFile; - bool _scheduleKeyRequest GUARDED_BY(process_crit_); - bool drop_frames_until_keyframe_ GUARDED_BY(process_crit_); - size_t max_nack_list_size_ GUARDED_BY(process_crit_); + bool _scheduleKeyRequest RTC_GUARDED_BY(process_crit_); + bool drop_frames_until_keyframe_ RTC_GUARDED_BY(process_crit_); + size_t max_nack_list_size_ RTC_GUARDED_BY(process_crit_); - VCMCodecDataBase _codecDataBase GUARDED_BY(receive_crit_); + VCMCodecDataBase _codecDataBase RTC_GUARDED_BY(receive_crit_); EncodedImageCallback* pre_decode_image_callback_; VCMProcessTimer _receiveStatsTimer;