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}
This commit is contained in:
danilchap
2017-09-07 07:53:45 -07:00
committed by Commit Bot
parent df23299259
commit 56359be7fe
60 changed files with 878 additions and 837 deletions

View File

@ -269,22 +269,22 @@ class AcmReceiver {
int sample_rate_hz; int sample_rate_hz;
}; };
const rtc::Optional<CodecInst> RtpHeaderToDecoder( const rtc::Optional<CodecInst> RtpHeaderToDecoder(const RTPHeader& rtp_header,
const RTPHeader& rtp_header, uint8_t first_payload_byte)
uint8_t first_payload_byte) const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
uint32_t NowInTimestamp(int decoder_sampling_rate) const; uint32_t NowInTimestamp(int decoder_sampling_rate) const;
rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
rtc::Optional<CodecInst> last_audio_decoder_ GUARDED_BY(crit_sect_); rtc::Optional<CodecInst> last_audio_decoder_ RTC_GUARDED_BY(crit_sect_);
rtc::Optional<SdpAudioFormat> last_audio_format_ GUARDED_BY(crit_sect_); rtc::Optional<SdpAudioFormat> last_audio_format_ RTC_GUARDED_BY(crit_sect_);
ACMResampler resampler_ GUARDED_BY(crit_sect_); ACMResampler resampler_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_); std::unique_ptr<int16_t[]> last_audio_buffer_ RTC_GUARDED_BY(crit_sect_);
CallStatistics call_stats_ GUARDED_BY(crit_sect_); CallStatistics call_stats_ RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<NetEq> neteq_; // NetEq is thread-safe; no lock needed. const std::unique_ptr<NetEq> neteq_; // NetEq is thread-safe; no lock needed.
const Clock* const clock_; const Clock* const clock_;
bool resampled_last_output_frame_ GUARDED_BY(crit_sect_); bool resampled_last_output_frame_ RTC_GUARDED_BY(crit_sect_);
rtc::Optional<int> last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_); rtc::Optional<int> last_packet_sample_rate_hz_ RTC_GUARDED_BY(crit_sect_);
}; };
} // namespace acm2 } // namespace acm2

View File

@ -234,17 +234,17 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
int RegisterReceiveCodecUnlocked( int RegisterReceiveCodecUnlocked(
const CodecInst& codec, const CodecInst& codec,
rtc::FunctionView<std::unique_ptr<AudioDecoder>()> isac_factory) rtc::FunctionView<std::unique_ptr<AudioDecoder>()> isac_factory)
EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
int Add10MsDataInternal(const AudioFrame& audio_frame, InputData* input_data) 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) 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 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 // Preprocessing of input audio, including resampling and down-mixing if
// required, before pushing audio into encoder's buffer. // required, before pushing audio into encoder's buffer.
@ -259,33 +259,36 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
// 0: otherwise. // 0: otherwise.
int PreprocessToAddData(const AudioFrame& in_frame, int PreprocessToAddData(const AudioFrame& in_frame,
const AudioFrame** ptr_out) 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 // Change required states after starting to receive the codec corresponding
// to |index|. // to |index|.
int UpdateUponReceivingCodec(int index); int UpdateUponReceivingCodec(int index);
rtc::CriticalSection acm_crit_sect_; 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. int id_; // TODO(henrik.lundin) Make const.
uint32_t expected_codec_ts_ GUARDED_BY(acm_crit_sect_); uint32_t expected_codec_ts_ RTC_GUARDED_BY(acm_crit_sect_);
uint32_t expected_in_ts_ GUARDED_BY(acm_crit_sect_); uint32_t expected_in_ts_ RTC_GUARDED_BY(acm_crit_sect_);
acm2::ACMResampler resampler_ GUARDED_BY(acm_crit_sect_); acm2::ACMResampler resampler_ RTC_GUARDED_BY(acm_crit_sect_);
acm2::AcmReceiver receiver_; // AcmReceiver has it's own internal lock. acm2::AcmReceiver receiver_; // AcmReceiver has it's own internal lock.
ChangeLogger bitrate_logger_ GUARDED_BY(acm_crit_sect_); ChangeLogger bitrate_logger_ RTC_GUARDED_BY(acm_crit_sect_);
std::unique_ptr<EncoderFactory> encoder_factory_ GUARDED_BY(acm_crit_sect_); std::unique_ptr<EncoderFactory> encoder_factory_
RTC_GUARDED_BY(acm_crit_sect_);
// Current encoder stack, either obtained from // Current encoder stack, either obtained from
// encoder_factory_->rent_a_codec.RentEncoderStack or provided by a call to // encoder_factory_->rent_a_codec.RentEncoderStack or provided by a call to
// RegisterEncoder. // RegisterEncoder.
std::unique_ptr<AudioEncoder> encoder_stack_ GUARDED_BY(acm_crit_sect_); std::unique_ptr<AudioEncoder> encoder_stack_ RTC_GUARDED_BY(acm_crit_sect_);
std::unique_ptr<AudioDecoder> isac_decoder_16k_ GUARDED_BY(acm_crit_sect_); std::unique_ptr<AudioDecoder> isac_decoder_16k_
std::unique_ptr<AudioDecoder> isac_decoder_32k_ GUARDED_BY(acm_crit_sect_); RTC_GUARDED_BY(acm_crit_sect_);
std::unique_ptr<AudioDecoder> isac_decoder_32k_
RTC_GUARDED_BY(acm_crit_sect_);
// This is to keep track of CN instances where we can send DTMFs. // 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 // Used when payloads are pushed into ACM without any RTP info
// One example is when pre-encoded bit-stream is pushed from // 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. // be used in other methods, locks need to be taken.
std::unique_ptr<WebRtcRTPHeader> aux_rtp_header_; std::unique_ptr<WebRtcRTPHeader> aux_rtp_header_;
bool receiver_initialized_ GUARDED_BY(acm_crit_sect_); bool receiver_initialized_ RTC_GUARDED_BY(acm_crit_sect_);
AudioFrame preprocess_frame_ GUARDED_BY(acm_crit_sect_); AudioFrame preprocess_frame_ RTC_GUARDED_BY(acm_crit_sect_);
bool first_10ms_data_ GUARDED_BY(acm_crit_sect_); bool first_10ms_data_ RTC_GUARDED_BY(acm_crit_sect_);
bool first_frame_ GUARDED_BY(acm_crit_sect_); bool first_frame_ RTC_GUARDED_BY(acm_crit_sect_);
uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_); uint32_t last_timestamp_ RTC_GUARDED_BY(acm_crit_sect_);
uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_); uint32_t last_rtp_timestamp_ RTC_GUARDED_BY(acm_crit_sect_);
rtc::CriticalSection callback_crit_sect_; rtc::CriticalSection callback_crit_sect_;
AudioPacketizationCallback* packetization_callback_ AudioPacketizationCallback* packetization_callback_
GUARDED_BY(callback_crit_sect_); RTC_GUARDED_BY(callback_crit_sect_);
ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_); ACMVADCallback* vad_callback_ RTC_GUARDED_BY(callback_crit_sect_);
int codec_histogram_bins_log_[static_cast<size_t>( int codec_histogram_bins_log_[static_cast<size_t>(
AudioEncoder::CodecType::kMaxLoggedAudioCodecTypes)]; AudioEncoder::CodecType::kMaxLoggedAudioCodecTypes)];

View File

@ -146,11 +146,11 @@ class PacketizationCallbackStubOldApi : public AudioPacketizationCallback {
} }
private: private:
int num_calls_ GUARDED_BY(crit_sect_); int num_calls_ RTC_GUARDED_BY(crit_sect_);
FrameType last_frame_type_ GUARDED_BY(crit_sect_); FrameType last_frame_type_ RTC_GUARDED_BY(crit_sect_);
int last_payload_type_ GUARDED_BY(crit_sect_); int last_payload_type_ RTC_GUARDED_BY(crit_sect_);
uint32_t last_timestamp_ GUARDED_BY(crit_sect_); uint32_t last_timestamp_ RTC_GUARDED_BY(crit_sect_);
std::vector<uint8_t> last_payload_vec_ GUARDED_BY(crit_sect_); std::vector<uint8_t> last_payload_vec_ RTC_GUARDED_BY(crit_sect_);
rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
}; };
@ -607,9 +607,9 @@ class AudioCodingModuleMtTestOldApi : public AudioCodingModuleTestOldApi {
const std::unique_ptr<EventWrapper> test_complete_; const std::unique_ptr<EventWrapper> test_complete_;
int send_count_; int send_count_;
int insert_packet_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_; rtc::CriticalSection crit_sect_;
int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_); int64_t next_insert_packet_time_ms_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<SimulatedClock> fake_clock_; std::unique_ptr<SimulatedClock> fake_clock_;
}; };
@ -879,9 +879,9 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
rtc::PlatformThread codec_registration_thread_; rtc::PlatformThread codec_registration_thread_;
const std::unique_ptr<EventWrapper> test_complete_; const std::unique_ptr<EventWrapper> test_complete_;
rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
bool codec_registered_ GUARDED_BY(crit_sect_); bool codec_registered_ RTC_GUARDED_BY(crit_sect_);
int receive_packet_count_ GUARDED_BY(crit_sect_); int receive_packet_count_ RTC_GUARDED_BY(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<AudioEncoderIsacFloatImpl> isac_encoder_; std::unique_ptr<AudioEncoderIsacFloatImpl> isac_encoder_;
std::unique_ptr<SimulatedClock> fake_clock_; std::unique_ptr<SimulatedClock> fake_clock_;
test::AudioLoop audio_loop_; test::AudioLoop audio_loop_;

View File

@ -48,7 +48,7 @@ class LockedIsacBandwidthInfo final {
private: private:
mutable volatile int ref_count_; mutable volatile int ref_count_;
rtc::CriticalSection lock_; rtc::CriticalSection lock_;
IsacBandwidthInfo bwinfo_ GUARDED_BY(lock_); IsacBandwidthInfo bwinfo_ RTC_GUARDED_BY(lock_);
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -244,12 +244,12 @@ class NetEqImpl : public webrtc::NetEq {
int InsertPacketInternal(const RTPHeader& rtp_header, int InsertPacketInternal(const RTPHeader& rtp_header,
rtc::ArrayView<const uint8_t> payload, rtc::ArrayView<const uint8_t> payload,
uint32_t receive_timestamp) 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|. // Delivers 10 ms of audio data. The data is written to |audio_frame|.
// Returns 0 on success, otherwise an error code. // Returns 0 on success, otherwise an error code.
int GetAudioInternal(AudioFrame* audio_frame, bool* muted) 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 // Provides a decision to the GetAudioInternal method. The decision what to
// do is written to |operation|. Packets to decode are written 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, int GetDecision(Operations* operation,
PacketList* packet_list, PacketList* packet_list,
DtmfEvent* dtmf_event, 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 // Decodes the speech packets in |packet_list|, and writes the results to
// |decoded_buffer|, which is allocated to hold |decoded_buffer_length| // |decoded_buffer|, which is allocated to hold |decoded_buffer_length|
@ -271,12 +271,13 @@ class NetEqImpl : public webrtc::NetEq {
Operations* operation, Operations* operation,
int* decoded_length, int* decoded_length,
AudioDecoder::SpeechType* speech_type) AudioDecoder::SpeechType* speech_type)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Sub-method to Decode(). Performs codec internal CNG. // 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) AudioDecoder::SpeechType* speech_type)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Sub-method to Decode(). Performs the actual decoding. // Sub-method to Decode(). Performs the actual decoding.
int DecodeLoop(PacketList* packet_list, int DecodeLoop(PacketList* packet_list,
@ -284,22 +285,22 @@ class NetEqImpl : public webrtc::NetEq {
AudioDecoder* decoder, AudioDecoder* decoder,
int* decoded_length, int* decoded_length,
AudioDecoder::SpeechType* speech_type) 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. // Sub-method which calls the Normal class to perform the normal operation.
void DoNormal(const int16_t* decoded_buffer, void DoNormal(const int16_t* decoded_buffer,
size_t decoded_length, size_t decoded_length,
AudioDecoder::SpeechType speech_type, 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. // Sub-method which calls the Merge class to perform the merge operation.
void DoMerge(int16_t* decoded_buffer, void DoMerge(int16_t* decoded_buffer,
size_t decoded_length, size_t decoded_length,
AudioDecoder::SpeechType speech_type, 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. // 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 // Sub-method which calls the Accelerate class to perform the accelerate
// operation. // operation.
@ -307,131 +308,138 @@ class NetEqImpl : public webrtc::NetEq {
size_t decoded_length, size_t decoded_length,
AudioDecoder::SpeechType speech_type, AudioDecoder::SpeechType speech_type,
bool play_dtmf, 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 // Sub-method which calls the PreemptiveExpand class to perform the
// preemtive expand operation. // preemtive expand operation.
int DoPreemptiveExpand(int16_t* decoded_buffer, int DoPreemptiveExpand(int16_t* decoded_buffer,
size_t decoded_length, size_t decoded_length,
AudioDecoder::SpeechType speech_type, 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 // 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. |packet_list| can either contain one SID frame to update the
// noise parameters, or no payload at all, in which case the previously // noise parameters, or no payload at all, in which case the previously
// received parameters are used. // received parameters are used.
int DoRfc3389Cng(PacketList* packet_list, bool play_dtmf) 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 // Calls the audio decoder to generate codec-internal comfort noise when
// no packet was received. // no packet was received.
void DoCodecInternalCng(const int16_t* decoded_buffer, size_t decoded_length) 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. // Calls the DtmfToneGenerator class to generate DTMF tones.
int DoDtmf(const DtmfEvent& dtmf_event, bool* play_dtmf) 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 // Produces packet-loss concealment using alternative methods. If the codec
// has an internal PLC, it is called to generate samples. Otherwise, the // has an internal PLC, it is called to generate samples. Otherwise, the
// method performs zero-stuffing. // method performs zero-stuffing.
void DoAlternativePlc(bool increase_timestamp) void DoAlternativePlc(bool increase_timestamp)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Overdub DTMF on top of |output|. // Overdub DTMF on top of |output|.
int DtmfOverdub(const DtmfEvent& dtmf_event, int DtmfOverdub(const DtmfEvent& dtmf_event,
size_t num_channels, 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 // Extracts packets from |packet_buffer_| to produce at least
// |required_samples| samples. The packets are inserted into |packet_list|. // |required_samples| samples. The packets are inserted into |packet_list|.
// Returns the number of samples that the packets in the list will produce, or // Returns the number of samples that the packets in the list will produce, or
// -1 in case of an error. // -1 in case of an error.
int ExtractPackets(size_t required_samples, PacketList* packet_list) 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 // Resets various variables and objects to new values based on the sample rate
// |fs_hz| and |channels| number audio channels. // |fs_hz| and |channels| number audio channels.
void SetSampleRateAndChannels(int fs_hz, size_t 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 // Returns the output type for the audio produced by the latest call to
// GetAudio(). // GetAudio().
OutputType LastOutputType() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); OutputType LastOutputType() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Updates Expand and Merge. // Updates Expand and Merge.
virtual void UpdatePlcComponents(int fs_hz, size_t channels) 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_|. // 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_; rtc::CriticalSection crit_sect_;
const std::unique_ptr<TickTimer> tick_timer_ GUARDED_BY(crit_sect_); const std::unique_ptr<TickTimer> tick_timer_ RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<BufferLevelFilter> buffer_level_filter_ const std::unique_ptr<BufferLevelFilter> buffer_level_filter_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<DecoderDatabase> decoder_database_ const std::unique_ptr<DecoderDatabase> decoder_database_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<DelayManager> delay_manager_ GUARDED_BY(crit_sect_); const std::unique_ptr<DelayManager> delay_manager_ RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<DelayPeakDetector> delay_peak_detector_ const std::unique_ptr<DelayPeakDetector> delay_peak_detector_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<DtmfBuffer> dtmf_buffer_ GUARDED_BY(crit_sect_); const std::unique_ptr<DtmfBuffer> dtmf_buffer_ RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<DtmfToneGenerator> dtmf_tone_generator_ const std::unique_ptr<DtmfToneGenerator> dtmf_tone_generator_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<PacketBuffer> packet_buffer_ GUARDED_BY(crit_sect_); const std::unique_ptr<PacketBuffer> packet_buffer_ RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<RedPayloadSplitter> red_payload_splitter_ const std::unique_ptr<RedPayloadSplitter> red_payload_splitter_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<TimestampScaler> timestamp_scaler_ const std::unique_ptr<TimestampScaler> timestamp_scaler_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<PostDecodeVad> vad_ GUARDED_BY(crit_sect_); const std::unique_ptr<PostDecodeVad> vad_ RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<ExpandFactory> expand_factory_ GUARDED_BY(crit_sect_); const std::unique_ptr<ExpandFactory> expand_factory_
RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<AccelerateFactory> accelerate_factory_ const std::unique_ptr<AccelerateFactory> accelerate_factory_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
const std::unique_ptr<PreemptiveExpandFactory> preemptive_expand_factory_ const std::unique_ptr<PreemptiveExpandFactory> preemptive_expand_factory_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<BackgroundNoise> background_noise_ GUARDED_BY(crit_sect_); std::unique_ptr<BackgroundNoise> background_noise_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<DecisionLogic> decision_logic_ GUARDED_BY(crit_sect_); std::unique_ptr<DecisionLogic> decision_logic_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<AudioMultiVector> algorithm_buffer_ GUARDED_BY(crit_sect_); std::unique_ptr<AudioMultiVector> algorithm_buffer_
std::unique_ptr<SyncBuffer> sync_buffer_ GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<Expand> expand_ GUARDED_BY(crit_sect_); std::unique_ptr<SyncBuffer> sync_buffer_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<Normal> normal_ GUARDED_BY(crit_sect_); std::unique_ptr<Expand> expand_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<Merge> merge_ GUARDED_BY(crit_sect_); std::unique_ptr<Normal> normal_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<Accelerate> accelerate_ GUARDED_BY(crit_sect_); std::unique_ptr<Merge> merge_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<PreemptiveExpand> preemptive_expand_ GUARDED_BY(crit_sect_); std::unique_ptr<Accelerate> accelerate_ RTC_GUARDED_BY(crit_sect_);
RandomVector random_vector_ GUARDED_BY(crit_sect_); std::unique_ptr<PreemptiveExpand> preemptive_expand_
std::unique_ptr<ComfortNoise> comfort_noise_ GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
Rtcp rtcp_ GUARDED_BY(crit_sect_); RandomVector random_vector_ RTC_GUARDED_BY(crit_sect_);
StatisticsCalculator stats_ GUARDED_BY(crit_sect_); std::unique_ptr<ComfortNoise> comfort_noise_ RTC_GUARDED_BY(crit_sect_);
int fs_hz_ GUARDED_BY(crit_sect_); Rtcp rtcp_ RTC_GUARDED_BY(crit_sect_);
int fs_mult_ GUARDED_BY(crit_sect_); StatisticsCalculator stats_ RTC_GUARDED_BY(crit_sect_);
int last_output_sample_rate_hz_ GUARDED_BY(crit_sect_); int fs_hz_ RTC_GUARDED_BY(crit_sect_);
size_t output_size_samples_ GUARDED_BY(crit_sect_); int fs_mult_ RTC_GUARDED_BY(crit_sect_);
size_t decoder_frame_length_ GUARDED_BY(crit_sect_); int last_output_sample_rate_hz_ RTC_GUARDED_BY(crit_sect_);
Modes last_mode_ GUARDED_BY(crit_sect_); size_t output_size_samples_ RTC_GUARDED_BY(crit_sect_);
Operations last_operation_ GUARDED_BY(crit_sect_); size_t decoder_frame_length_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<int16_t[]> mute_factor_array_ GUARDED_BY(crit_sect_); Modes last_mode_ RTC_GUARDED_BY(crit_sect_);
size_t decoded_buffer_length_ GUARDED_BY(crit_sect_); Operations last_operation_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<int16_t[]> decoded_buffer_ GUARDED_BY(crit_sect_); std::unique_ptr<int16_t[]> mute_factor_array_ RTC_GUARDED_BY(crit_sect_);
uint32_t playout_timestamp_ GUARDED_BY(crit_sect_); size_t decoded_buffer_length_ RTC_GUARDED_BY(crit_sect_);
bool new_codec_ GUARDED_BY(crit_sect_); std::unique_ptr<int16_t[]> decoded_buffer_ RTC_GUARDED_BY(crit_sect_);
uint32_t timestamp_ GUARDED_BY(crit_sect_); uint32_t playout_timestamp_ RTC_GUARDED_BY(crit_sect_);
bool reset_decoder_ GUARDED_BY(crit_sect_); bool new_codec_ RTC_GUARDED_BY(crit_sect_);
rtc::Optional<uint8_t> current_rtp_payload_type_ GUARDED_BY(crit_sect_); uint32_t timestamp_ RTC_GUARDED_BY(crit_sect_);
rtc::Optional<uint8_t> current_cng_rtp_payload_type_ GUARDED_BY(crit_sect_); bool reset_decoder_ RTC_GUARDED_BY(crit_sect_);
uint32_t ssrc_ GUARDED_BY(crit_sect_); rtc::Optional<uint8_t> current_rtp_payload_type_ RTC_GUARDED_BY(crit_sect_);
bool first_packet_ GUARDED_BY(crit_sect_); rtc::Optional<uint8_t> current_cng_rtp_payload_type_
const BackgroundNoiseMode background_noise_mode_ GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
NetEqPlayoutMode playout_mode_ GUARDED_BY(crit_sect_); uint32_t ssrc_ RTC_GUARDED_BY(crit_sect_);
bool enable_fast_accelerate_ GUARDED_BY(crit_sect_); bool first_packet_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<NackTracker> nack_ GUARDED_BY(crit_sect_); const BackgroundNoiseMode background_noise_mode_ RTC_GUARDED_BY(crit_sect_);
bool nack_enabled_ GUARDED_BY(crit_sect_); NetEqPlayoutMode playout_mode_ RTC_GUARDED_BY(crit_sect_);
const bool enable_muted_state_ GUARDED_BY(crit_sect_); bool enable_fast_accelerate_ RTC_GUARDED_BY(crit_sect_);
AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = std::unique_ptr<NackTracker> 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; AudioFrame::kVadPassive;
std::unique_ptr<TickTimer::Stopwatch> generated_noise_stopwatch_ std::unique_ptr<TickTimer::Stopwatch> generated_noise_stopwatch_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
std::vector<uint32_t> last_decoded_timestamps_ GUARDED_BY(crit_sect_); std::vector<uint32_t> last_decoded_timestamps_ RTC_GUARDED_BY(crit_sect_);
private: private:
RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl);

View File

@ -188,58 +188,58 @@ class AudioDeviceBuffer {
// Keeps track of if playout/recording are active or not. A combination // 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. // 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. // Only used on the creating thread and not used to control any media flow.
bool playing_ ACCESS_ON(main_thread_checker_); bool playing_ RTC_ACCESS_ON(main_thread_checker_);
bool recording_ 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 // Buffer used for audio samples to be played out. Size can be changed
// dynamically. The 16-bit samples are interleaved, hence the size is // dynamically. The 16-bit samples are interleaved, hence the size is
// proportional to the number of channels. // proportional to the number of channels.
rtc::BufferT<int16_t> play_buffer_ ACCESS_ON(playout_thread_checker_); rtc::BufferT<int16_t> play_buffer_ RTC_ACCESS_ON(playout_thread_checker_);
// Byte buffer used for recorded audio samples. Size can be changed // Byte buffer used for recorded audio samples. Size can be changed
// dynamically. // dynamically.
rtc::BufferT<int16_t> rec_buffer_ ACCESS_ON(recording_thread_checker_); rtc::BufferT<int16_t> rec_buffer_ RTC_ACCESS_ON(recording_thread_checker_);
// AGC parameters. // AGC parameters.
#if !defined(WEBRTC_WIN) #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 #else
// Windows uses a dedicated thread for volume APIs. // Windows uses a dedicated thread for volume APIs.
uint32_t current_mic_level_; uint32_t current_mic_level_;
#endif #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. // 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. // Delay values used by the AEC.
int play_delay_ms_ ACCESS_ON(recording_thread_checker_); int play_delay_ms_ RTC_ACCESS_ON(recording_thread_checker_);
int rec_delay_ms_ ACCESS_ON(recording_thread_checker_); int rec_delay_ms_ RTC_ACCESS_ON(recording_thread_checker_);
// Contains a clock-drift measurement. // 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. // 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). // 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 // Counts number of audio callbacks modulo 50 to create a signal when
// a new storage of audio stats shall be done. // a new storage of audio stats shall be done.
int16_t rec_stat_count_ ACCESS_ON(recording_thread_checker_); int16_t rec_stat_count_ RTC_ACCESS_ON(recording_thread_checker_);
int16_t play_stat_count_ ACCESS_ON(playout_thread_checker_); int16_t play_stat_count_ RTC_ACCESS_ON(playout_thread_checker_);
// Time stamps of when playout and recording starts. // Time stamps of when playout and recording starts.
int64_t play_start_time_ ACCESS_ON(main_thread_checker_); int64_t play_start_time_ RTC_ACCESS_ON(main_thread_checker_);
int64_t rec_start_time_ ACCESS_ON(main_thread_checker_); int64_t rec_start_time_ RTC_ACCESS_ON(main_thread_checker_);
// Contains counters for playout and recording statistics. // 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 // Stores current stats at each timer task. Used to calculate differences
// between two successive timer events. // 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- // Set to true at construction and modified to false as soon as one audio-
// level estimate larger than zero is detected. // level estimate larger than zero is detected.
@ -249,12 +249,12 @@ class AudioDeviceBuffer {
// StartPeriodicLogging() and set to false by StopPeriodicLogging(). // StartPeriodicLogging() and set to false by StopPeriodicLogging().
// Setting this member to false prevents (possiby invalid) log messages from // Setting this member to false prevents (possiby invalid) log messages from
// being printed in the LogStats() task. // 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. // 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. // When defined, the output signal will be replaced by a sinus tone at 440Hz.
#ifdef AUDIO_DEVICE_PLAYS_SINUS_TONE #ifdef AUDIO_DEVICE_PLAYS_SINUS_TONE
double phase_ ACCESS_ON(playout_thread_checker_); double phase_ RTC_ACCESS_ON(playout_thread_checker_);
#endif #endif
}; };

View File

@ -173,10 +173,10 @@ class FifoAudioStream : public AudioStream {
rtc::CriticalSection lock_; rtc::CriticalSection lock_;
rtc::RaceChecker race_checker_; rtc::RaceChecker race_checker_;
std::list<Buffer16> fifo_ GUARDED_BY(lock_); std::list<Buffer16> fifo_ RTC_GUARDED_BY(lock_);
size_t write_count_ GUARDED_BY(race_checker_) = 0; size_t write_count_ RTC_GUARDED_BY(race_checker_) = 0;
size_t max_size_ GUARDED_BY(race_checker_) = 0; size_t max_size_ RTC_GUARDED_BY(race_checker_) = 0;
size_t written_elements_ 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 // 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 read_thread_checker_;
rtc::ThreadChecker write_thread_checker_; rtc::ThreadChecker write_thread_checker_;
rtc::Optional<int64_t> pulse_time_ GUARDED_BY(lock_); rtc::Optional<int64_t> pulse_time_ RTC_GUARDED_BY(lock_);
std::vector<int> latencies_ GUARDED_BY(race_checker_); std::vector<int> latencies_ RTC_GUARDED_BY(race_checker_);
size_t read_count_ ACCESS_ON(read_thread_checker_) = 0; size_t read_count_ RTC_ACCESS_ON(read_thread_checker_) = 0;
size_t write_count_ ACCESS_ON(write_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 // Mocks the AudioTransport object and proxies actions for the two callbacks

View File

@ -269,7 +269,7 @@ class AudioDeviceIOS : public AudioDeviceGeneric,
volatile int playing_; volatile int playing_;
// Set to true after successful call to Init(), false otherwise. // 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(), // Set to true after successful call to InitRecording() or InitPlayout(),
// false otherwise. // false otherwise.
@ -280,14 +280,14 @@ class AudioDeviceIOS : public AudioDeviceGeneric,
// Audio interruption observer instance. // Audio interruption observer instance.
RTCAudioSessionDelegateAdapter* audio_session_observer_ RTCAudioSessionDelegateAdapter* audio_session_observer_
ACCESS_ON(thread_checker_); RTC_ACCESS_ON(thread_checker_);
// Set to true if we've activated the audio session. // 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. // Counts number of detected audio glitches on the playout side.
int64_t num_detected_playout_glitches_ ACCESS_ON(thread_checker_); int64_t num_detected_playout_glitches_ RTC_ACCESS_ON(thread_checker_);
int64_t last_playout_time_ ACCESS_ON(io_thread_checker_); int64_t last_playout_time_ RTC_ACCESS_ON(io_thread_checker_);
// Counts number of playout callbacks per call. // Counts number of playout callbacks per call.
// The value isupdated on the native I/O thread and later read on the // 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_; int64_t num_playout_callbacks_;
// Contains the time for when the last output volume change was detected. // 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. // Exposes private members for testing purposes only.
FRIEND_TEST_ALL_PREFIXES(AudioDeviceTest, testInterruptedAudioSession); FRIEND_TEST_ALL_PREFIXES(AudioDeviceTest, testInterruptedAudioSession);

View File

@ -146,8 +146,8 @@ private:
bool KeyPressed() const; bool KeyPressed() const;
void Lock() EXCLUSIVE_LOCK_FUNCTION(_critSect) { _critSect.Enter(); }; void Lock() RTC_EXCLUSIVE_LOCK_FUNCTION(_critSect) { _critSect.Enter(); };
void UnLock() UNLOCK_FUNCTION(_critSect) { _critSect.Leave(); }; void UnLock() RTC_UNLOCK_FUNCTION(_critSect) { _critSect.Leave(); };
inline int32_t InputSanityCheckAfterUnlockedPeriod() const; inline int32_t InputSanityCheckAfterUnlockedPeriod() const;
inline int32_t OutputSanityCheckAfterUnlockedPeriod() const; inline int32_t OutputSanityCheckAfterUnlockedPeriod() const;

View File

@ -1947,7 +1947,7 @@ int32_t AudioDeviceLinuxPulse::LatencyUsecs(pa_stream* stream) {
int32_t AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData, int32_t AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData,
size_t bufferSize) size_t bufferSize)
EXCLUSIVE_LOCKS_REQUIRED(_critSect) { RTC_EXCLUSIVE_LOCKS_REQUIRED(_critSect) {
size_t size = bufferSize; size_t size = bufferSize;
uint32_t numRecSamples = _recordBufferSize / (2 * _recChannels); uint32_t numRecSamples = _recordBufferSize / (2 * _recChannels);
@ -2017,7 +2017,7 @@ int32_t AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData,
int32_t AudioDeviceLinuxPulse::ProcessRecordedData(int8_t* bufferData, int32_t AudioDeviceLinuxPulse::ProcessRecordedData(int8_t* bufferData,
uint32_t bufferSizeInSamples, uint32_t bufferSizeInSamples,
uint32_t recDelay) uint32_t recDelay)
EXCLUSIVE_LOCKS_REQUIRED(_critSect) { RTC_EXCLUSIVE_LOCKS_REQUIRED(_critSect) {
uint32_t currentMicLevel(0); uint32_t currentMicLevel(0);
uint32_t newMicLevel(0); uint32_t newMicLevel(0);

View File

@ -199,153 +199,156 @@ public:
void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override; void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override;
private: private:
void Lock() EXCLUSIVE_LOCK_FUNCTION(_critSect) { void Lock() RTC_EXCLUSIVE_LOCK_FUNCTION(_critSect) { _critSect.Enter(); }
_critSect.Enter(); void UnLock() RTC_UNLOCK_FUNCTION(_critSect) { _critSect.Leave(); }
} void WaitForOperationCompletion(pa_operation* paOperation) const;
void UnLock() UNLOCK_FUNCTION(_critSect) { void WaitForSuccess(pa_operation* paOperation) const;
_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 PaContextStateCallback(pa_context* c, void* pThis);
static void PaSinkInfoCallback(pa_context *c, const pa_sink_info *i, static void PaSinkInfoCallback(pa_context* c,
int eol, void *pThis); const pa_sink_info* i,
static void PaSourceInfoCallback(pa_context *c, const pa_source_info *i, int eol,
int eol, void *pThis); void* pThis);
static void PaServerInfoCallback(pa_context *c, const pa_server_info *i, static void PaSourceInfoCallback(pa_context* c,
void *pThis); const pa_source_info* i,
static void PaStreamStateCallback(pa_stream *p, void *pThis); int eol,
void PaContextStateCallbackHandler(pa_context *c); void* pThis);
void PaSinkInfoCallbackHandler(const pa_sink_info *i, int eol); static void PaServerInfoCallback(pa_context* c,
void PaSourceInfoCallbackHandler(const pa_source_info *i, int eol); const pa_server_info* i,
void PaServerInfoCallbackHandler(const pa_server_info *i); void* pThis);
void PaStreamStateCallbackHandler(pa_stream *p); 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 EnableWriteCallback();
void DisableWriteCallback(); void DisableWriteCallback();
static void PaStreamWriteCallback(pa_stream *unused, size_t buffer_space, static void PaStreamWriteCallback(pa_stream* unused,
void *pThis); size_t buffer_space,
void PaStreamWriteCallbackHandler(size_t buffer_space); void* pThis);
static void PaStreamUnderflowCallback(pa_stream *unused, void *pThis); void PaStreamWriteCallbackHandler(size_t buffer_space);
void PaStreamUnderflowCallbackHandler(); static void PaStreamUnderflowCallback(pa_stream* unused, void* pThis);
void EnableReadCallback(); void PaStreamUnderflowCallbackHandler();
void DisableReadCallback(); void EnableReadCallback();
static void PaStreamReadCallback(pa_stream *unused1, size_t unused2, void DisableReadCallback();
void *pThis); static void PaStreamReadCallback(pa_stream* unused1,
void PaStreamReadCallbackHandler(); size_t unused2,
static void PaStreamOverflowCallback(pa_stream *unused, void *pThis); void* pThis);
void PaStreamOverflowCallbackHandler(); void PaStreamReadCallbackHandler();
int32_t LatencyUsecs(pa_stream *stream); static void PaStreamOverflowCallback(pa_stream* unused, void* pThis);
int32_t ReadRecordedData(const void* bufferData, size_t bufferSize); void PaStreamOverflowCallbackHandler();
int32_t ProcessRecordedData(int8_t *bufferData, int32_t LatencyUsecs(pa_stream* stream);
uint32_t bufferSizeInSamples, int32_t ReadRecordedData(const void* bufferData, size_t bufferSize);
uint32_t recDelay); int32_t ProcessRecordedData(int8_t* bufferData,
uint32_t bufferSizeInSamples,
uint32_t recDelay);
int32_t CheckPulseAudioVersion(); int32_t CheckPulseAudioVersion();
int32_t InitSamplingFrequency(); int32_t InitSamplingFrequency();
int32_t GetDefaultDeviceInfo(bool recDevice, char* name, uint16_t& index); int32_t GetDefaultDeviceInfo(bool recDevice, char* name, uint16_t& index);
int32_t InitPulseAudio(); int32_t InitPulseAudio();
int32_t TerminatePulseAudio(); int32_t TerminatePulseAudio();
void PaLock(); void PaLock();
void PaUnLock(); void PaUnLock();
static bool RecThreadFunc(void*); static bool RecThreadFunc(void*);
static bool PlayThreadFunc(void*); static bool PlayThreadFunc(void*);
bool RecThreadProcess(); bool RecThreadProcess();
bool PlayThreadProcess(); bool PlayThreadProcess();
AudioDeviceBuffer* _ptrAudioBuffer; AudioDeviceBuffer* _ptrAudioBuffer;
rtc::CriticalSection _critSect; rtc::CriticalSection _critSect;
EventWrapper& _timeEventRec; EventWrapper& _timeEventRec;
EventWrapper& _timeEventPlay; EventWrapper& _timeEventPlay;
EventWrapper& _recStartEvent; EventWrapper& _recStartEvent;
EventWrapper& _playStartEvent; EventWrapper& _playStartEvent;
// TODO(pbos): Remove unique_ptr and use directly without resetting. // TODO(pbos): Remove unique_ptr and use directly without resetting.
std::unique_ptr<rtc::PlatformThread> _ptrThreadPlay; std::unique_ptr<rtc::PlatformThread> _ptrThreadPlay;
std::unique_ptr<rtc::PlatformThread> _ptrThreadRec; std::unique_ptr<rtc::PlatformThread> _ptrThreadRec;
AudioMixerManagerLinuxPulse _mixerManager; AudioMixerManagerLinuxPulse _mixerManager;
uint16_t _inputDeviceIndex; uint16_t _inputDeviceIndex;
uint16_t _outputDeviceIndex; uint16_t _outputDeviceIndex;
bool _inputDeviceIsSpecified; bool _inputDeviceIsSpecified;
bool _outputDeviceIsSpecified; bool _outputDeviceIsSpecified;
int sample_rate_hz_; int sample_rate_hz_;
uint8_t _recChannels; uint8_t _recChannels;
uint8_t _playChannels; uint8_t _playChannels;
// Stores thread ID in constructor. // Stores thread ID in constructor.
// We can then use ThreadChecker::CalledOnValidThread() to ensure that // We can then use ThreadChecker::CalledOnValidThread() to ensure that
// other methods are called from the same thread. // other methods are called from the same thread.
// Currently only does RTC_DCHECK(thread_checker_.CalledOnValidThread()). // Currently only does RTC_DCHECK(thread_checker_.CalledOnValidThread()).
rtc::ThreadChecker thread_checker_; rtc::ThreadChecker thread_checker_;
bool _initialized; bool _initialized;
bool _recording; bool _recording;
bool _playing; bool _playing;
bool _recIsInitialized; bool _recIsInitialized;
bool _playIsInitialized; bool _playIsInitialized;
bool _startRec; bool _startRec;
bool _stopRec; bool _stopRec;
bool _startPlay; bool _startPlay;
bool _stopPlay; bool _stopPlay;
bool _AGC; bool _AGC;
bool update_speaker_volume_at_startup_; bool update_speaker_volume_at_startup_;
uint32_t _sndCardPlayDelay; uint32_t _sndCardPlayDelay;
uint32_t _sndCardRecDelay; uint32_t _sndCardRecDelay;
int32_t _writeErrors; int32_t _writeErrors;
uint16_t _playWarning; uint16_t _playWarning;
uint16_t _playError; uint16_t _playError;
uint16_t _recWarning; uint16_t _recWarning;
uint16_t _recError; uint16_t _recError;
uint16_t _deviceIndex; uint16_t _deviceIndex;
int16_t _numPlayDevices; int16_t _numPlayDevices;
int16_t _numRecDevices; int16_t _numRecDevices;
char* _playDeviceName; char* _playDeviceName;
char* _recDeviceName; char* _recDeviceName;
char* _playDisplayDeviceName; char* _playDisplayDeviceName;
char* _recDisplayDeviceName; char* _recDisplayDeviceName;
char _paServerVersion[32]; char _paServerVersion[32];
int8_t* _playBuffer; int8_t* _playBuffer;
size_t _playbackBufferSize; size_t _playbackBufferSize;
size_t _playbackBufferUnused; size_t _playbackBufferUnused;
size_t _tempBufferSpace; size_t _tempBufferSpace;
int8_t* _recBuffer; int8_t* _recBuffer;
size_t _recordBufferSize; size_t _recordBufferSize;
size_t _recordBufferUsed; size_t _recordBufferUsed;
const void* _tempSampleData; const void* _tempSampleData;
size_t _tempSampleDataSize; size_t _tempSampleDataSize;
int32_t _configuredLatencyPlay; int32_t _configuredLatencyPlay;
int32_t _configuredLatencyRec; int32_t _configuredLatencyRec;
// PulseAudio // PulseAudio
uint16_t _paDeviceIndex; uint16_t _paDeviceIndex;
bool _paStateChanged; bool _paStateChanged;
pa_threaded_mainloop* _paMainloop; pa_threaded_mainloop* _paMainloop;
pa_mainloop_api* _paMainloopApi; pa_mainloop_api* _paMainloopApi;
pa_context* _paContext; pa_context* _paContext;
pa_stream* _recStream; pa_stream* _recStream;
pa_stream* _playStream; pa_stream* _playStream;
uint32_t _recStreamFlags; uint32_t _recStreamFlags;
uint32_t _playStreamFlags; uint32_t _playStreamFlags;
pa_buffer_attr _playBufferAttr; pa_buffer_attr _playBufferAttr;
pa_buffer_attr _recBufferAttr; pa_buffer_attr _recBufferAttr;
char _oldKeyState[32]; char _oldKeyState[32];
Display* _XDisplay; Display* _XDisplay;
}; };
} }

View File

@ -60,7 +60,8 @@ class AudioMixerImpl : public AudioMixer {
void RemoveSource(Source* audio_source) override; void RemoveSource(Source* audio_source) override;
void Mix(size_t number_of_channels, 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 // Returns true if the source was mixed last round. Returns
// false and logs an error if the source was never added to the // 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 // Compute what audio sources to mix from audio_source_list_. Ramp
// in and out. Update mixed status. Mixes up to // in and out. Update mixed status. Mixes up to
// kMaximumAmountOfMixedAudioSources audio sources. // kMaximumAmountOfMixedAudioSources audio sources.
AudioFrameList GetAudioFromSources() EXCLUSIVE_LOCKS_REQUIRED(crit_); AudioFrameList GetAudioFromSources() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Add/remove the MixerAudioSource to the specified // Add/remove the MixerAudioSource to the specified
// MixerAudioSource list. // MixerAudioSource list.
@ -97,14 +98,14 @@ class AudioMixerImpl : public AudioMixer {
std::unique_ptr<OutputRateCalculator> output_rate_calculator_; std::unique_ptr<OutputRateCalculator> output_rate_calculator_;
// The current sample frequency and sample size when mixing. // The current sample frequency and sample size when mixing.
int output_frequency_ GUARDED_BY(race_checker_); int output_frequency_ RTC_GUARDED_BY(race_checker_);
size_t sample_size_ GUARDED_BY(race_checker_); size_t sample_size_ RTC_GUARDED_BY(race_checker_);
// List of all audio sources. Note all lists are disjunct // 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. // 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); RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl);
}; };

View File

@ -105,7 +105,8 @@ class EchoCanceller3 {
rtc::RaceChecker render_race_checker_; rtc::RaceChecker render_race_checker_;
// State that is accessed by the AnalyzeRender call. // State that is accessed by the AnalyzeRender call.
std::unique_ptr<RenderWriter> render_writer_ GUARDED_BY(render_race_checker_); std::unique_ptr<RenderWriter> render_writer_
RTC_GUARDED_BY(render_race_checker_);
// State that may be accessed by the capture thread. // State that may be accessed by the capture thread.
static int instance_count_; static int instance_count_;
@ -113,21 +114,22 @@ class EchoCanceller3 {
const int sample_rate_hz_; const int sample_rate_hz_;
const int num_bands_; const int num_bands_;
const size_t frame_length_; const size_t frame_length_;
BlockFramer output_framer_ GUARDED_BY(capture_race_checker_); BlockFramer output_framer_ RTC_GUARDED_BY(capture_race_checker_);
FrameBlocker capture_blocker_ GUARDED_BY(capture_race_checker_); FrameBlocker capture_blocker_ RTC_GUARDED_BY(capture_race_checker_);
FrameBlocker render_blocker_ GUARDED_BY(capture_race_checker_); FrameBlocker render_blocker_ RTC_GUARDED_BY(capture_race_checker_);
SwapQueue<std::vector<std::vector<float>>, Aec3RenderQueueItemVerifier> SwapQueue<std::vector<std::vector<float>>, Aec3RenderQueueItemVerifier>
render_transfer_queue_; render_transfer_queue_;
std::unique_ptr<BlockProcessor> block_processor_ std::unique_ptr<BlockProcessor> block_processor_
GUARDED_BY(capture_race_checker_); RTC_GUARDED_BY(capture_race_checker_);
std::vector<std::vector<float>> render_queue_output_frame_ std::vector<std::vector<float>> render_queue_output_frame_
GUARDED_BY(capture_race_checker_); RTC_GUARDED_BY(capture_race_checker_);
std::unique_ptr<CascadedBiQuadFilter> capture_highpass_filter_ std::unique_ptr<CascadedBiQuadFilter> capture_highpass_filter_
GUARDED_BY(capture_race_checker_); RTC_GUARDED_BY(capture_race_checker_);
bool saturated_microphone_signal_ GUARDED_BY(capture_race_checker_) = false; bool saturated_microphone_signal_ RTC_GUARDED_BY(capture_race_checker_) =
std::vector<std::vector<float>> block_ GUARDED_BY(capture_race_checker_); false;
std::vector<std::vector<float>> block_ RTC_GUARDED_BY(capture_race_checker_);
std::vector<rtc::ArrayView<float>> sub_frame_view_ std::vector<rtc::ArrayView<float>> sub_frame_view_
GUARDED_BY(capture_race_checker_); RTC_GUARDED_BY(capture_race_checker_);
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCanceller3); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCanceller3);
}; };

View File

@ -100,7 +100,7 @@ class AudioProcessingImpl : public AudioProcessing {
size_t num_reverse_channels() const override; size_t num_reverse_channels() const override;
int stream_delay_ms() const override; int stream_delay_ms() const override;
bool was_stream_delay_set() const override bool was_stream_delay_set() const override
EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
AudioProcessingStatistics GetStatistics() const override; AudioProcessingStatistics GetStatistics() const override;
@ -125,7 +125,7 @@ class AudioProcessingImpl : public AudioProcessing {
protected: protected:
// Overridden in a mock. // Overridden in a mock.
virtual int InitializeLocked() virtual int InitializeLocked()
EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
private: private:
// TODO(peah): These friend classes should be removed as soon as the new // 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 // The struct is modified in a single-threaded manner by holding both the
// render and capture locks. // render and capture locks.
int MaybeInitialize(const ProcessingConfig& config, bool force_initialization) 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) int MaybeInitializeRender(const ProcessingConfig& processing_config)
EXCLUSIVE_LOCKS_REQUIRED(crit_render_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
int MaybeInitializeCapture(const ProcessingConfig& processing_config, int MaybeInitializeCapture(const ProcessingConfig& processing_config,
bool force_initialization) 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. // Method for updating the state keeping track of the active submodules.
// Returns a bool indicating whether the state has changed. // 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. // Methods requiring APM running in a single-threaded manner.
// Are called with both the render and capture locks already // Are called with both the render and capture locks already
// acquired. // acquired.
void InitializeTransient() void InitializeTransient()
EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
void InitializeBeamformer() void InitializeBeamformer()
EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
void InitializeIntelligibility() void InitializeIntelligibility()
EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
int InitializeLocked(const ProcessingConfig& config) int InitializeLocked(const ProcessingConfig& config)
EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); void InitializeLevelController() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeResidualEchoDetector() void InitializeResidualEchoDetector()
EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
void InitializeLowCutFilter() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); void InitializeLowCutFilter() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeEchoCanceller3() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); void InitializeEchoCanceller3() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeGainController2(); void InitializeGainController2();
void EmptyQueuedRenderAudio(); void EmptyQueuedRenderAudio();
void AllocateRenderQueue() void AllocateRenderQueue()
EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
void QueueBandedRenderAudio(AudioBuffer* audio) void QueueBandedRenderAudio(AudioBuffer* audio)
EXCLUSIVE_LOCKS_REQUIRED(crit_render_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
void QueueNonbandedRenderAudio(AudioBuffer* audio) 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 // Capture-side exclusive methods possibly running APM in a multi-threaded
// manner that are called with the render lock already acquired. // manner that are called with the render lock already acquired.
int ProcessCaptureStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); int ProcessCaptureStreamLocked() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void MaybeUpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); void MaybeUpdateHistograms() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
// Render-side exclusive methods possibly running APM in a multi-threaded // Render-side exclusive methods possibly running APM in a multi-threaded
// manner that are called with the render lock already acquired. // manner that are called with the render lock already acquired.
@ -238,8 +239,8 @@ class AudioProcessingImpl : public AudioProcessing {
int AnalyzeReverseStreamLocked(const float* const* src, int AnalyzeReverseStreamLocked(const float* const* src,
const StreamConfig& input_config, const StreamConfig& input_config,
const StreamConfig& output_config) const StreamConfig& output_config)
EXCLUSIVE_LOCKS_REQUIRED(crit_render_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
int ProcessRenderStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_render_); int ProcessRenderStreamLocked() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
// Collects configuration settings from public and private // Collects configuration settings from public and private
// submodules to be saved as an audioproc::Config message on the // 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|, // config if it is different from the last saved one; if |forced|,
// writes the config regardless of the last saved. // writes the config regardless of the last saved.
void WriteAecDumpConfigMessage(bool forced) void WriteAecDumpConfigMessage(bool forced)
EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
// Notifies attached AecDump of current configuration and capture data. // Notifies attached AecDump of current configuration and capture data.
void RecordUnprocessedCaptureStream(const float* const* capture_stream) void RecordUnprocessedCaptureStream(const float* const* capture_stream)
EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void RecordUnprocessedCaptureStream(const AudioFrame& capture_frame) void RecordUnprocessedCaptureStream(const AudioFrame& capture_frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
// Notifies attached AecDump of current configuration and // Notifies attached AecDump of current configuration and
// processed capture data and issues a capture stream recording // processed capture data and issues a capture stream recording
// request. // request.
void RecordProcessedCaptureStream( void RecordProcessedCaptureStream(
const float* const* processed_capture_stream) const float* const* processed_capture_stream)
EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void RecordProcessedCaptureStream(const AudioFrame& processed_capture_frame) 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). // 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 // AecDump instance used for optionally logging APM config, input
// and output to file in the AEC-dump format defined in debug.proto. // 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 // Hold the last config written with AecDump for avoiding writing
// the same config twice. // 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. // Critical sections.
rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_); rtc::CriticalSection crit_render_ RTC_ACQUIRED_BEFORE(crit_capture_);
rtc::CriticalSection crit_capture_; rtc::CriticalSection crit_capture_;
// Struct containing the Config specifying the behavior of APM. // Struct containing the Config specifying the behavior of APM.
@ -345,7 +346,7 @@ class AudioProcessingImpl : public AudioProcessing {
StreamConfig capture_processing_format; StreamConfig capture_processing_format;
int split_rate; int split_rate;
bool echo_path_gain_change; bool echo_path_gain_change;
} capture_ GUARDED_BY(crit_capture_); } capture_ RTC_GUARDED_BY(crit_capture_);
struct ApmCaptureNonLockedState { struct ApmCaptureNonLockedState {
ApmCaptureNonLockedState(bool beamformer_enabled, ApmCaptureNonLockedState(bool beamformer_enabled,
@ -373,31 +374,31 @@ class AudioProcessingImpl : public AudioProcessing {
~ApmRenderState(); ~ApmRenderState();
std::unique_ptr<AudioConverter> render_converter; std::unique_ptr<AudioConverter> render_converter;
std::unique_ptr<AudioBuffer> render_audio; std::unique_ptr<AudioBuffer> 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_) size_t aec_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_)
GUARDED_BY(crit_capture_) = 0; RTC_GUARDED_BY(crit_capture_) = 0;
std::vector<float> aec_render_queue_buffer_ GUARDED_BY(crit_render_); std::vector<float> aec_render_queue_buffer_ RTC_GUARDED_BY(crit_render_);
std::vector<float> aec_capture_queue_buffer_ GUARDED_BY(crit_capture_); std::vector<float> aec_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_);
size_t aecm_render_queue_element_max_size_ GUARDED_BY(crit_render_) size_t aecm_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_)
GUARDED_BY(crit_capture_) = 0; RTC_GUARDED_BY(crit_capture_) = 0;
std::vector<int16_t> aecm_render_queue_buffer_ GUARDED_BY(crit_render_); std::vector<int16_t> aecm_render_queue_buffer_ RTC_GUARDED_BY(crit_render_);
std::vector<int16_t> aecm_capture_queue_buffer_ GUARDED_BY(crit_capture_); std::vector<int16_t> aecm_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_);
size_t agc_render_queue_element_max_size_ GUARDED_BY(crit_render_) size_t agc_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_)
GUARDED_BY(crit_capture_) = 0; RTC_GUARDED_BY(crit_capture_) = 0;
std::vector<int16_t> agc_render_queue_buffer_ GUARDED_BY(crit_render_); std::vector<int16_t> agc_render_queue_buffer_ RTC_GUARDED_BY(crit_render_);
std::vector<int16_t> agc_capture_queue_buffer_ GUARDED_BY(crit_capture_); std::vector<int16_t> agc_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_);
size_t red_render_queue_element_max_size_ GUARDED_BY(crit_render_) size_t red_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_)
GUARDED_BY(crit_capture_) = 0; RTC_GUARDED_BY(crit_capture_) = 0;
std::vector<float> red_render_queue_buffer_ GUARDED_BY(crit_render_); std::vector<float> red_render_queue_buffer_ RTC_GUARDED_BY(crit_render_);
std::vector<float> red_capture_queue_buffer_ GUARDED_BY(crit_capture_); std::vector<float> red_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_);
RmsLevel capture_input_rms_ GUARDED_BY(crit_capture_); RmsLevel capture_input_rms_ RTC_GUARDED_BY(crit_capture_);
RmsLevel capture_output_rms_ GUARDED_BY(crit_capture_); RmsLevel capture_output_rms_ RTC_GUARDED_BY(crit_capture_);
int capture_rms_interval_counter_ GUARDED_BY(crit_capture_) = 0; int capture_rms_interval_counter_ RTC_GUARDED_BY(crit_capture_) = 0;
// Lock protection not needed. // Lock protection not needed.
std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>> std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>>

View File

@ -83,7 +83,7 @@ class RandomGenerator {
private: private:
rtc::CriticalSection crit_; rtc::CriticalSection crit_;
Random rand_gen_ GUARDED_BY(crit_); Random rand_gen_ RTC_GUARDED_BY(crit_);
}; };
// Variables related to the audio data and formats. // Variables related to the audio data and formats.
@ -300,8 +300,8 @@ class FrameCounters {
private: private:
rtc::CriticalSection crit_; rtc::CriticalSection crit_;
int render_count GUARDED_BY(crit_) = 0; int render_count RTC_GUARDED_BY(crit_) = 0;
int capture_count GUARDED_BY(crit_) = 0; int capture_count RTC_GUARDED_BY(crit_) = 0;
}; };
// Class for handling the capture side processing. // Class for handling the capture side processing.

View File

@ -26,7 +26,7 @@ class MockInitialize : public AudioProcessingImpl {
: AudioProcessingImpl(config) {} : AudioProcessingImpl(config) {}
MOCK_METHOD0(InitializeLocked, int()); MOCK_METHOD0(InitializeLocked, int());
int RealInitializeLocked() NO_THREAD_SAFETY_ANALYSIS { int RealInitializeLocked() RTC_NO_THREAD_SAFETY_ANALYSIS {
return AudioProcessingImpl::InitializeLocked(); return AudioProcessingImpl::InitializeLocked();
} }

View File

@ -90,20 +90,20 @@ class EchoCancellationImpl : public EchoCancellation {
void AllocateRenderQueue(); void AllocateRenderQueue();
int Configure(); 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_; rtc::CriticalSection* const crit_capture_;
bool enabled_ = false; bool enabled_ = false;
bool drift_compensation_enabled_ GUARDED_BY(crit_capture_); bool drift_compensation_enabled_ RTC_GUARDED_BY(crit_capture_);
bool metrics_enabled_ GUARDED_BY(crit_capture_); bool metrics_enabled_ RTC_GUARDED_BY(crit_capture_);
SuppressionLevel suppression_level_ GUARDED_BY(crit_capture_); SuppressionLevel suppression_level_ RTC_GUARDED_BY(crit_capture_);
int stream_drift_samples_ GUARDED_BY(crit_capture_); int stream_drift_samples_ RTC_GUARDED_BY(crit_capture_);
bool was_stream_drift_set_ GUARDED_BY(crit_capture_); bool was_stream_drift_set_ RTC_GUARDED_BY(crit_capture_);
bool stream_has_echo_ GUARDED_BY(crit_capture_); bool stream_has_echo_ RTC_GUARDED_BY(crit_capture_);
bool delay_logging_enabled_ GUARDED_BY(crit_capture_); bool delay_logging_enabled_ RTC_GUARDED_BY(crit_capture_);
bool extended_filter_enabled_ GUARDED_BY(crit_capture_); bool extended_filter_enabled_ RTC_GUARDED_BY(crit_capture_);
bool delay_agnostic_enabled_ GUARDED_BY(crit_capture_); bool delay_agnostic_enabled_ RTC_GUARDED_BY(crit_capture_);
bool refined_adaptive_filter_enabled_ GUARDED_BY(crit_capture_) = false; bool refined_adaptive_filter_enabled_ RTC_GUARDED_BY(crit_capture_) = false;
std::vector<std::unique_ptr<Canceller>> cancellers_; std::vector<std::unique_ptr<Canceller>> cancellers_;
std::unique_ptr<StreamProperties> stream_properties_; std::unique_ptr<StreamProperties> stream_properties_;

View File

@ -64,15 +64,15 @@ class EchoControlMobileImpl : public EchoControlMobile {
int Configure(); 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_; rtc::CriticalSection* const crit_capture_;
bool enabled_ = false; bool enabled_ = false;
RoutingMode routing_mode_ GUARDED_BY(crit_capture_); RoutingMode routing_mode_ RTC_GUARDED_BY(crit_capture_);
bool comfort_noise_enabled_ GUARDED_BY(crit_capture_); bool comfort_noise_enabled_ RTC_GUARDED_BY(crit_capture_);
unsigned char* external_echo_path_ GUARDED_BY(crit_render_) unsigned char* external_echo_path_ RTC_GUARDED_BY(crit_render_)
GUARDED_BY(crit_capture_); RTC_GUARDED_BY(crit_capture_);
std::vector<std::unique_ptr<Canceller>> cancellers_; std::vector<std::unique_ptr<Canceller>> cancellers_;
std::unique_ptr<StreamProperties> stream_properties_; std::unique_ptr<StreamProperties> stream_properties_;

View File

@ -67,27 +67,27 @@ class GainControlImpl : public GainControl {
int Configure(); 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_; rtc::CriticalSection* const crit_capture_;
std::unique_ptr<ApmDataDumper> data_dumper_; std::unique_ptr<ApmDataDumper> data_dumper_;
bool enabled_ = false; bool enabled_ = false;
Mode mode_ GUARDED_BY(crit_capture_); Mode mode_ RTC_GUARDED_BY(crit_capture_);
int minimum_capture_level_ GUARDED_BY(crit_capture_); int minimum_capture_level_ RTC_GUARDED_BY(crit_capture_);
int maximum_capture_level_ GUARDED_BY(crit_capture_); int maximum_capture_level_ RTC_GUARDED_BY(crit_capture_);
bool limiter_enabled_ GUARDED_BY(crit_capture_); bool limiter_enabled_ RTC_GUARDED_BY(crit_capture_);
int target_level_dbfs_ GUARDED_BY(crit_capture_); int target_level_dbfs_ RTC_GUARDED_BY(crit_capture_);
int compression_gain_db_ GUARDED_BY(crit_capture_); int compression_gain_db_ RTC_GUARDED_BY(crit_capture_);
int analog_capture_level_ GUARDED_BY(crit_capture_); int analog_capture_level_ RTC_GUARDED_BY(crit_capture_);
bool was_analog_level_set_ GUARDED_BY(crit_capture_); bool was_analog_level_set_ RTC_GUARDED_BY(crit_capture_);
bool stream_is_saturated_ GUARDED_BY(crit_capture_); bool stream_is_saturated_ RTC_GUARDED_BY(crit_capture_);
std::vector<std::unique_ptr<GainController>> gain_controllers_; std::vector<std::unique_ptr<GainController>> gain_controllers_;
rtc::Optional<size_t> num_proc_channels_ GUARDED_BY(crit_capture_); rtc::Optional<size_t> num_proc_channels_ RTC_GUARDED_BY(crit_capture_);
rtc::Optional<int> sample_rate_hz_ GUARDED_BY(crit_capture_); rtc::Optional<int> sample_rate_hz_ RTC_GUARDED_BY(crit_capture_);
static int instance_counter_; static int instance_counter_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(GainControlImpl); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(GainControlImpl);

View File

@ -38,8 +38,8 @@ class LevelEstimatorImpl : public LevelEstimator {
private: private:
rtc::CriticalSection* const crit_ = nullptr; rtc::CriticalSection* const crit_ = nullptr;
bool enabled_ GUARDED_BY(crit_) = false; bool enabled_ RTC_GUARDED_BY(crit_) = false;
std::unique_ptr<RmsLevel> rms_ GUARDED_BY(crit_); std::unique_ptr<RmsLevel> rms_ RTC_GUARDED_BY(crit_);
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(LevelEstimatorImpl); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(LevelEstimatorImpl);
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -44,11 +44,11 @@ class NoiseSuppressionImpl : public NoiseSuppression {
private: private:
class Suppressor; class Suppressor;
rtc::CriticalSection* const crit_; rtc::CriticalSection* const crit_;
bool enabled_ GUARDED_BY(crit_) = false; bool enabled_ RTC_GUARDED_BY(crit_) = false;
Level level_ GUARDED_BY(crit_) = kModerate; Level level_ RTC_GUARDED_BY(crit_) = kModerate;
size_t channels_ GUARDED_BY(crit_) = 0; size_t channels_ RTC_GUARDED_BY(crit_) = 0;
int sample_rate_hz_ GUARDED_BY(crit_) = 0; int sample_rate_hz_ RTC_GUARDED_BY(crit_) = 0;
std::vector<std::unique_ptr<Suppressor>> suppressors_ GUARDED_BY(crit_); std::vector<std::unique_ptr<Suppressor>> suppressors_ RTC_GUARDED_BY(crit_);
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(NoiseSuppressionImpl); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(NoiseSuppressionImpl);
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -43,14 +43,14 @@ class VoiceDetectionImpl : public VoiceDetection {
private: private:
class Vad; class Vad;
rtc::CriticalSection* const crit_; rtc::CriticalSection* const crit_;
bool enabled_ GUARDED_BY(crit_) = false; bool enabled_ RTC_GUARDED_BY(crit_) = false;
bool stream_has_voice_ GUARDED_BY(crit_) = false; bool stream_has_voice_ RTC_GUARDED_BY(crit_) = false;
bool using_external_vad_ GUARDED_BY(crit_) = false; bool using_external_vad_ RTC_GUARDED_BY(crit_) = false;
Likelihood likelihood_ GUARDED_BY(crit_) = kLowLikelihood; Likelihood likelihood_ RTC_GUARDED_BY(crit_) = kLowLikelihood;
int frame_size_ms_ GUARDED_BY(crit_) = 10; int frame_size_ms_ RTC_GUARDED_BY(crit_) = 10;
size_t frame_size_samples_ GUARDED_BY(crit_) = 0; size_t frame_size_samples_ RTC_GUARDED_BY(crit_) = 0;
int sample_rate_hz_ GUARDED_BY(crit_) = 0; int sample_rate_hz_ RTC_GUARDED_BY(crit_) = 0;
std::unique_ptr<Vad> vad_ GUARDED_BY(crit_); std::unique_ptr<Vad> vad_ RTC_GUARDED_BY(crit_);
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(VoiceDetectionImpl); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(VoiceDetectionImpl);
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -83,7 +83,7 @@ class BitrateControllerImpl : public BitrateController {
void OnNetworkChanged(uint32_t bitrate, void OnNetworkChanged(uint32_t bitrate,
uint8_t fraction_loss, // 0 - 255. 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. // Used by process thread.
const Clock* const clock_; const Clock* const clock_;
@ -93,14 +93,14 @@ class BitrateControllerImpl : public BitrateController {
rtc::CriticalSection critsect_; rtc::CriticalSection critsect_;
std::map<uint32_t, uint32_t> ssrc_to_last_received_extended_high_seq_num_ std::map<uint32_t, uint32_t> ssrc_to_last_received_extended_high_seq_num_
GUARDED_BY(critsect_); RTC_GUARDED_BY(critsect_);
SendSideBandwidthEstimation bandwidth_estimation_ GUARDED_BY(critsect_); SendSideBandwidthEstimation bandwidth_estimation_ RTC_GUARDED_BY(critsect_);
uint32_t reserved_bitrate_bps_ GUARDED_BY(critsect_); uint32_t reserved_bitrate_bps_ RTC_GUARDED_BY(critsect_);
uint32_t last_bitrate_bps_ GUARDED_BY(critsect_); uint32_t last_bitrate_bps_ RTC_GUARDED_BY(critsect_);
uint8_t last_fraction_loss_ GUARDED_BY(critsect_); uint8_t last_fraction_loss_ RTC_GUARDED_BY(critsect_);
int64_t last_rtt_ms_ GUARDED_BY(critsect_); int64_t last_rtt_ms_ RTC_GUARDED_BY(critsect_);
uint32_t last_reserved_bitrate_bps_ GUARDED_BY(critsect_); uint32_t last_reserved_bitrate_bps_ RTC_GUARDED_BY(critsect_);
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BitrateControllerImpl); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BitrateControllerImpl);
}; };

View File

@ -82,8 +82,8 @@ class ReceiveSideCongestionController : public CallStatsObserver,
private: private:
void PickEstimatorFromHeader(const RTPHeader& header) void PickEstimatorFromHeader(const RTPHeader& header)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void PickEstimator() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); void PickEstimator() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
RemoteBitrateObserver* observer_; RemoteBitrateObserver* observer_;
const Clock* const clock_; const Clock* const clock_;
rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;

View File

@ -126,7 +126,7 @@ class SendSideCongestionController : public CallStatsObserver,
void LimitOutstandingBytes(size_t num_outstanding_bytes); void LimitOutstandingBytes(size_t num_outstanding_bytes);
const Clock* const clock_; const Clock* const clock_;
rtc::CriticalSection observer_lock_; rtc::CriticalSection observer_lock_;
Observer* observer_ GUARDED_BY(observer_lock_); Observer* observer_ RTC_GUARDED_BY(observer_lock_);
RtcEventLog* const event_log_; RtcEventLog* const event_log_;
std::unique_ptr<PacedSender> owned_pacer_; std::unique_ptr<PacedSender> owned_pacer_;
PacedSender* pacer_; PacedSender* pacer_;
@ -136,18 +136,18 @@ class SendSideCongestionController : public CallStatsObserver,
const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; const std::unique_ptr<RateLimiter> retransmission_rate_limiter_;
TransportFeedbackAdapter transport_feedback_adapter_; TransportFeedbackAdapter transport_feedback_adapter_;
rtc::CriticalSection network_state_lock_; rtc::CriticalSection network_state_lock_;
uint32_t last_reported_bitrate_bps_ GUARDED_BY(network_state_lock_); uint32_t last_reported_bitrate_bps_ RTC_GUARDED_BY(network_state_lock_);
uint8_t last_reported_fraction_loss_ GUARDED_BY(network_state_lock_); uint8_t last_reported_fraction_loss_ RTC_GUARDED_BY(network_state_lock_);
int64_t last_reported_rtt_ GUARDED_BY(network_state_lock_); int64_t last_reported_rtt_ RTC_GUARDED_BY(network_state_lock_);
NetworkState network_state_ GUARDED_BY(network_state_lock_); NetworkState network_state_ RTC_GUARDED_BY(network_state_lock_);
bool pause_pacer_ 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 // Duplicate the pacer paused state to avoid grabbing a lock when
// pausing the pacer. This can be removed when we move this class // pausing the pacer. This can be removed when we move this class
// over to the task queue. // over to the task queue.
bool pacer_paused_; bool pacer_paused_;
rtc::CriticalSection bwe_lock_; rtc::CriticalSection bwe_lock_;
int min_bitrate_bps_ GUARDED_BY(bwe_lock_); int min_bitrate_bps_ RTC_GUARDED_BY(bwe_lock_);
std::unique_ptr<DelayBasedBwe> delay_based_bwe_ GUARDED_BY(bwe_lock_); std::unique_ptr<DelayBasedBwe> delay_based_bwe_ RTC_GUARDED_BY(bwe_lock_);
bool in_cwnd_experiment_; bool in_cwnd_experiment_;
int64_t accepted_queue_ms_; int64_t accepted_queue_ms_;
bool was_in_alr_; bool was_in_alr_;

View File

@ -58,32 +58,33 @@ class ProbeController {
kProbingComplete, kProbingComplete,
}; };
void InitiateExponentialProbing() EXCLUSIVE_LOCKS_REQUIRED(critsect_); void InitiateExponentialProbing() RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
void InitiateProbing(int64_t now_ms, void InitiateProbing(int64_t now_ms,
std::initializer_list<int64_t> bitrates_to_probe, std::initializer_list<int64_t> bitrates_to_probe,
bool probe_further) EXCLUSIVE_LOCKS_REQUIRED(critsect_); bool probe_further)
RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
rtc::CriticalSection critsect_; rtc::CriticalSection critsect_;
PacedSender* const pacer_; PacedSender* const pacer_;
const Clock* const clock_; const Clock* const clock_;
NetworkState network_state_ GUARDED_BY(critsect_); NetworkState network_state_ RTC_GUARDED_BY(critsect_);
State state_ GUARDED_BY(critsect_); State state_ RTC_GUARDED_BY(critsect_);
int64_t min_bitrate_to_probe_further_bps_ GUARDED_BY(critsect_); int64_t min_bitrate_to_probe_further_bps_ RTC_GUARDED_BY(critsect_);
int64_t time_last_probing_initiated_ms_ GUARDED_BY(critsect_); int64_t time_last_probing_initiated_ms_ RTC_GUARDED_BY(critsect_);
int64_t estimated_bitrate_bps_ GUARDED_BY(critsect_); int64_t estimated_bitrate_bps_ RTC_GUARDED_BY(critsect_);
int64_t start_bitrate_bps_ GUARDED_BY(critsect_); int64_t start_bitrate_bps_ RTC_GUARDED_BY(critsect_);
int64_t max_bitrate_bps_ GUARDED_BY(critsect_); int64_t max_bitrate_bps_ RTC_GUARDED_BY(critsect_);
int64_t last_bwe_drop_probing_time_ms_ GUARDED_BY(critsect_); int64_t last_bwe_drop_probing_time_ms_ RTC_GUARDED_BY(critsect_);
rtc::Optional<int64_t> alr_end_time_ms_ GUARDED_BY(critsect_); rtc::Optional<int64_t> alr_end_time_ms_ RTC_GUARDED_BY(critsect_);
bool enable_periodic_alr_probing_ GUARDED_BY(critsect_); bool enable_periodic_alr_probing_ RTC_GUARDED_BY(critsect_);
int64_t time_of_last_large_drop_ms_ GUARDED_BY(critsect_); int64_t time_of_last_large_drop_ms_ RTC_GUARDED_BY(critsect_);
int64_t bitrate_before_last_large_drop_bps_ 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. // For WebRTC.BWE.MidCallProbing.* metric.
bool mid_call_probing_waiting_for_result_ GUARDED_BY(&critsect_); bool mid_call_probing_waiting_for_result_ RTC_GUARDED_BY(&critsect_);
int64_t mid_call_probing_bitrate_bps_ GUARDED_BY(&critsect_); int64_t mid_call_probing_bitrate_bps_ RTC_GUARDED_BY(&critsect_);
int64_t mid_call_probing_succcess_threshold_ GUARDED_BY(&critsect_); int64_t mid_call_probing_succcess_threshold_ RTC_GUARDED_BY(&critsect_);
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ProbeController); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ProbeController);
}; };

View File

@ -61,19 +61,20 @@ class TransportFeedbackAdapter {
const bool send_side_bwe_with_overhead_; const bool send_side_bwe_with_overhead_;
rtc::CriticalSection lock_; rtc::CriticalSection lock_;
int transport_overhead_bytes_per_packet_ GUARDED_BY(&lock_); int transport_overhead_bytes_per_packet_ RTC_GUARDED_BY(&lock_);
SendTimeHistory send_time_history_ GUARDED_BY(&lock_); SendTimeHistory send_time_history_ RTC_GUARDED_BY(&lock_);
const Clock* const clock_; const Clock* const clock_;
int64_t current_offset_ms_; int64_t current_offset_ms_;
int64_t last_timestamp_us_; int64_t last_timestamp_us_;
std::vector<PacketFeedback> last_packet_feedback_vector_; std::vector<PacketFeedback> last_packet_feedback_vector_;
uint16_t local_net_id_ GUARDED_BY(&lock_); uint16_t local_net_id_ RTC_GUARDED_BY(&lock_);
uint16_t remote_net_id_ GUARDED_BY(&lock_); uint16_t remote_net_id_ RTC_GUARDED_BY(&lock_);
std::deque<int64_t> feedback_rtts_ GUARDED_BY(&lock_); std::deque<int64_t> feedback_rtts_ RTC_GUARDED_BY(&lock_);
rtc::Optional<int64_t> min_feedback_rtt_ GUARDED_BY(&lock_); rtc::Optional<int64_t> min_feedback_rtt_ RTC_GUARDED_BY(&lock_);
rtc::CriticalSection observers_lock_; rtc::CriticalSection observers_lock_;
std::vector<PacketFeedbackObserver*> observers_ GUARDED_BY(&observers_lock_); std::vector<PacketFeedbackObserver*> observers_
RTC_GUARDED_BY(&observers_lock_);
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -155,48 +155,48 @@ class PacedSender : public Pacer {
private: private:
// Updates the number of bytes that can be sent for the next time interval. // Updates the number of bytes that can be sent for the next time interval.
void UpdateBudgetWithElapsedTime(int64_t delta_time_in_ms) void UpdateBudgetWithElapsedTime(int64_t delta_time_in_ms)
EXCLUSIVE_LOCKS_REQUIRED(critsect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
void UpdateBudgetWithBytesSent(size_t bytes) void UpdateBudgetWithBytesSent(size_t bytes)
EXCLUSIVE_LOCKS_REQUIRED(critsect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
bool SendPacket(const paced_sender::Packet& packet, bool SendPacket(const paced_sender::Packet& packet,
const PacedPacketInfo& cluster_info) const PacedPacketInfo& cluster_info)
EXCLUSIVE_LOCKS_REQUIRED(critsect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
size_t SendPadding(size_t padding_needed, const PacedPacketInfo& cluster_info) size_t SendPadding(size_t padding_needed, const PacedPacketInfo& cluster_info)
EXCLUSIVE_LOCKS_REQUIRED(critsect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
const Clock* const clock_; const Clock* const clock_;
PacketSender* const packet_sender_; PacketSender* const packet_sender_;
std::unique_ptr<AlrDetector> alr_detector_ GUARDED_BY(critsect_); std::unique_ptr<AlrDetector> alr_detector_ RTC_GUARDED_BY(critsect_);
rtc::CriticalSection 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 // This is the media budget, keeping track of how many bits of media
// we can pace out during the current interval. // we can pace out during the current interval.
std::unique_ptr<IntervalBudget> media_budget_ GUARDED_BY(critsect_); std::unique_ptr<IntervalBudget> media_budget_ RTC_GUARDED_BY(critsect_);
// This is the padding budget, keeping track of how many bits of padding we're // 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 // allowed to send out during the current interval. This budget will be
// utilized when there's no media to send. // utilized when there's no media to send.
std::unique_ptr<IntervalBudget> padding_budget_ GUARDED_BY(critsect_); std::unique_ptr<IntervalBudget> padding_budget_ RTC_GUARDED_BY(critsect_);
std::unique_ptr<BitrateProber> prober_ GUARDED_BY(critsect_); std::unique_ptr<BitrateProber> prober_ RTC_GUARDED_BY(critsect_);
bool probing_send_failure_; bool probing_send_failure_;
// Actual configured bitrates (media_budget_ may temporarily be higher in // Actual configured bitrates (media_budget_ may temporarily be higher in
// order to meet pace time constraint). // order to meet pace time constraint).
uint32_t estimated_bitrate_bps_ GUARDED_BY(critsect_); uint32_t estimated_bitrate_bps_ RTC_GUARDED_BY(critsect_);
uint32_t min_send_bitrate_kbps_ GUARDED_BY(critsect_); uint32_t min_send_bitrate_kbps_ RTC_GUARDED_BY(critsect_);
uint32_t max_padding_bitrate_kbps_ GUARDED_BY(critsect_); uint32_t max_padding_bitrate_kbps_ RTC_GUARDED_BY(critsect_);
uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_); uint32_t pacing_bitrate_kbps_ RTC_GUARDED_BY(critsect_);
int64_t time_last_update_us_ GUARDED_BY(critsect_); int64_t time_last_update_us_ RTC_GUARDED_BY(critsect_);
int64_t first_sent_packet_ms_ GUARDED_BY(critsect_); int64_t first_sent_packet_ms_ RTC_GUARDED_BY(critsect_);
std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); std::unique_ptr<paced_sender::PacketQueue> packets_ RTC_GUARDED_BY(critsect_);
uint64_t packet_counter_; uint64_t packet_counter_;
ProcessThread* process_thread_ = nullptr; ProcessThread* process_thread_ = nullptr;
float pacing_factor_ GUARDED_BY(critsect_); float pacing_factor_ RTC_GUARDED_BY(critsect_);
int64_t queue_time_limit GUARDED_BY(critsect_); int64_t queue_time_limit RTC_GUARDED_BY(critsect_);
}; };
} // namespace webrtc } // namespace webrtc
#endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_

View File

@ -96,32 +96,32 @@ class PacketRouter : public PacedSender::PacketSender,
private: private:
void AddRembModuleCandidate(RtpRtcp* candidate_module, bool sender) 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) void MaybeRemoveRembModuleCandidate(RtpRtcp* candidate_module, bool sender)
EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
void UnsetActiveRembModule() EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); void UnsetActiveRembModule() RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
void DetermineActiveRembModule() EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); void DetermineActiveRembModule() RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
rtc::RaceChecker pacer_race_; rtc::RaceChecker pacer_race_;
rtc::CriticalSection modules_crit_; rtc::CriticalSection modules_crit_;
std::list<RtpRtcp*> rtp_send_modules_ GUARDED_BY(modules_crit_); std::list<RtpRtcp*> rtp_send_modules_ RTC_GUARDED_BY(modules_crit_);
std::vector<RtpRtcp*> rtp_receive_modules_ GUARDED_BY(modules_crit_); std::vector<RtpRtcp*> rtp_receive_modules_ RTC_GUARDED_BY(modules_crit_);
// TODO(eladalon): remb_crit_ only ever held from one function, and it's not // 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. // clear if that function can actually be called from more than one thread.
rtc::CriticalSection remb_crit_; rtc::CriticalSection remb_crit_;
// The last time a REMB was sent. // The last time a REMB was sent.
int64_t last_remb_time_ms_ GUARDED_BY(remb_crit_); int64_t last_remb_time_ms_ RTC_GUARDED_BY(remb_crit_);
uint32_t last_send_bitrate_bps_ GUARDED_BY(remb_crit_); uint32_t last_send_bitrate_bps_ RTC_GUARDED_BY(remb_crit_);
// The last bitrate update. // The last bitrate update.
uint32_t bitrate_bps_ GUARDED_BY(remb_crit_); uint32_t bitrate_bps_ RTC_GUARDED_BY(remb_crit_);
uint32_t max_bitrate_bps_ 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 // Candidates for the REMB module can be RTP sender/receiver modules, with
// the sender modules taking precedence. // the sender modules taking precedence.
std::vector<RtpRtcp*> sender_remb_candidates_ GUARDED_BY(modules_crit_); std::vector<RtpRtcp*> sender_remb_candidates_ RTC_GUARDED_BY(modules_crit_);
std::vector<RtpRtcp*> receiver_remb_candidates_ GUARDED_BY(modules_crit_); std::vector<RtpRtcp*> receiver_remb_candidates_ RTC_GUARDED_BY(modules_crit_);
RtpRtcp* active_remb_module_ GUARDED_BY(modules_crit_); RtpRtcp* active_remb_module_ RTC_GUARDED_BY(modules_crit_);
volatile int transport_seq_; volatile int transport_seq_;

View File

@ -106,12 +106,13 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator {
const std::list<Cluster>& clusters) const; const std::list<Cluster>& clusters) const;
// Returns true if a probe which changed the estimate was detected. // 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 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_; rtc::ThreadChecker network_thread_;
const Clock* const clock_; const Clock* const clock_;
@ -130,8 +131,8 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator {
bool uma_recorded_; bool uma_recorded_;
rtc::CriticalSection crit_; rtc::CriticalSection crit_;
Ssrcs ssrcs_ GUARDED_BY(&crit_); Ssrcs ssrcs_ RTC_GUARDED_BY(&crit_);
AimdRateControl remote_rate_ GUARDED_BY(&crit_); AimdRateControl remote_rate_ RTC_GUARDED_BY(&crit_);
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorAbsSendTime); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorAbsSendTime);
}; };

View File

@ -47,24 +47,24 @@ class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator {
// Triggers a new estimate calculation. // Triggers a new estimate calculation.
void UpdateEstimate(int64_t time_now) void UpdateEstimate(int64_t time_now)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void GetSsrcs(std::vector<uint32_t>* ssrcs) const void GetSsrcs(std::vector<uint32_t>* ssrcs) const
SHARED_LOCKS_REQUIRED(crit_sect_); RTC_SHARED_LOCKS_REQUIRED(crit_sect_);
// Returns |remote_rate_| if the pointed to object exists, // Returns |remote_rate_| if the pointed to object exists,
// otherwise creates it. // otherwise creates it.
AimdRateControl* GetRemoteRate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); AimdRateControl* GetRemoteRate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
const Clock* const clock_; const Clock* const clock_;
SsrcOveruseEstimatorMap overuse_detectors_ GUARDED_BY(crit_sect_); SsrcOveruseEstimatorMap overuse_detectors_ RTC_GUARDED_BY(crit_sect_);
RateStatistics incoming_bitrate_ GUARDED_BY(crit_sect_); RateStatistics incoming_bitrate_ RTC_GUARDED_BY(crit_sect_);
uint32_t last_valid_incoming_bitrate_ GUARDED_BY(crit_sect_); uint32_t last_valid_incoming_bitrate_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<AimdRateControl> remote_rate_ GUARDED_BY(crit_sect_); std::unique_ptr<AimdRateControl> remote_rate_ RTC_GUARDED_BY(crit_sect_);
RemoteBitrateObserver* const observer_ GUARDED_BY(crit_sect_); RemoteBitrateObserver* const observer_ RTC_GUARDED_BY(crit_sect_);
rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
int64_t last_process_time_; 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_; bool uma_recorded_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorSingleStream); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorSingleStream);

View File

@ -54,7 +54,7 @@ class RemoteEstimatorProxy : public RemoteBitrateEstimator {
private: private:
void OnPacketArrival(uint16_t sequence_number, int64_t arrival_time) 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); bool BuildFeedbackPacket(rtcp::TransportFeedback* feedback_packet);
const Clock* const clock_; const Clock* const clock_;
@ -63,13 +63,13 @@ class RemoteEstimatorProxy : public RemoteBitrateEstimator {
rtc::CriticalSection lock_; rtc::CriticalSection lock_;
uint32_t media_ssrc_ GUARDED_BY(&lock_); uint32_t media_ssrc_ RTC_GUARDED_BY(&lock_);
uint8_t feedback_sequence_ GUARDED_BY(&lock_); uint8_t feedback_sequence_ RTC_GUARDED_BY(&lock_);
SequenceNumberUnwrapper unwrapper_ GUARDED_BY(&lock_); SequenceNumberUnwrapper unwrapper_ RTC_GUARDED_BY(&lock_);
int64_t window_start_seq_ GUARDED_BY(&lock_); int64_t window_start_seq_ RTC_GUARDED_BY(&lock_);
// Map unwrapped seq -> time. // Map unwrapped seq -> time.
std::map<int64_t, int64_t> packet_arrival_times_ GUARDED_BY(&lock_); std::map<int64_t, int64_t> packet_arrival_times_ RTC_GUARDED_BY(&lock_);
int64_t send_interval_ms_ GUARDED_BY(&lock_); int64_t send_interval_ms_ RTC_GUARDED_BY(&lock_);
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -49,17 +49,17 @@ class FlexfecReceiver {
// Erasure code interfacing and callback. // Erasure code interfacing and callback.
std::unique_ptr<ForwardErrorCorrection> erasure_code_ std::unique_ptr<ForwardErrorCorrection> erasure_code_
GUARDED_BY(sequence_checker_); RTC_GUARDED_BY(sequence_checker_);
ForwardErrorCorrection::ReceivedPacketList received_packets_ ForwardErrorCorrection::ReceivedPacketList received_packets_
GUARDED_BY(sequence_checker_); RTC_GUARDED_BY(sequence_checker_);
ForwardErrorCorrection::RecoveredPacketList recovered_packets_ ForwardErrorCorrection::RecoveredPacketList recovered_packets_
GUARDED_BY(sequence_checker_); RTC_GUARDED_BY(sequence_checker_);
RecoveredPacketReceiver* const recovered_packet_receiver_; RecoveredPacketReceiver* const recovered_packet_receiver_;
// Logging and stats. // Logging and stats.
Clock* const clock_; Clock* const clock_;
int64_t last_recovered_packet_ms_ GUARDED_BY(sequence_checker_); int64_t last_recovered_packet_ms_ RTC_GUARDED_BY(sequence_checker_);
FecPacketCounter packet_counter_ GUARDED_BY(sequence_checker_); FecPacketCounter packet_counter_ RTC_GUARDED_BY(sequence_checker_);
rtc::SequencedTaskChecker sequence_checker_; rtc::SequencedTaskChecker sequence_checker_;
}; };

View File

@ -126,13 +126,14 @@ class RTPPayloadRegistry {
uint32_t ssrc_rtx_; uint32_t ssrc_rtx_;
// Only warn once per payload type, if an RTX packet is received but // Only warn once per payload type, if an RTX packet is received but
// no associated payload type found in |rtx_payload_type_map_|. // no associated payload type found in |rtx_payload_type_map_|.
std::set<int> payload_types_with_suppressed_warnings_ GUARDED_BY(crit_sect_); std::set<int> 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 // 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. // video, DCHECK that no instance is used for both audio and video.
#if RTC_DCHECK_IS_ON #if RTC_DCHECK_IS_ON
bool used_for_audio_ GUARDED_BY(crit_sect_) = false; bool used_for_audio_ RTC_GUARDED_BY(crit_sect_) = false;
bool used_for_video_ GUARDED_BY(crit_sect_) = false; bool used_for_video_ RTC_GUARDED_BY(crit_sect_) = false;
#endif #endif
}; };

View File

@ -63,15 +63,15 @@ class PlayoutDelayOracle {
// Guards access to data across multiple threads. // Guards access to data across multiple threads.
rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
// The current highest sequence number on which playout delay has been sent. // 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. // 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. // Sender ssrc.
uint32_t ssrc_ GUARDED_BY(crit_sect_); uint32_t ssrc_ RTC_GUARDED_BY(crit_sect_);
// Sequence number unwrapper. // 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. // 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); RTC_DISALLOW_COPY_AND_ASSIGN(PlayoutDelayOracle);
}; };

View File

@ -51,7 +51,7 @@ class StreamStatisticianImpl : public StreamStatistician {
private: private:
bool InOrderPacketInternal(uint16_t sequence_number) const; bool InOrderPacketInternal(uint16_t sequence_number) const;
RtcpStatistics CalculateRtcpStatistics() RtcpStatistics CalculateRtcpStatistics()
EXCLUSIVE_LOCKS_REQUIRED(stream_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(stream_lock_);
void UpdateJitter(const RTPHeader& header, NtpTime receive_time); void UpdateJitter(const RTPHeader& header, NtpTime receive_time);
StreamDataCounters UpdateCounters(const RTPHeader& rtp_header, StreamDataCounters UpdateCounters(const RTPHeader& rtp_header,
size_t packet_length, size_t packet_length,

View File

@ -130,80 +130,80 @@ class RTCPReceiver {
const PacketInformation& packet_information); const PacketInformation& packet_information);
TmmbrInformation* FindOrCreateTmmbrInfo(uint32_t remote_ssrc) 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. // Update TmmbrInformation (if present) is alive.
void UpdateTmmbrRemoteIsAlive(uint32_t remote_ssrc) 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) 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, void HandleSenderReport(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleReceiverReport(const rtcp::CommonHeader& rtcp_block, void HandleReceiverReport(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleReportBlock(const rtcp::ReportBlock& report_block, void HandleReportBlock(const rtcp::ReportBlock& report_block,
PacketInformation* packet_information, PacketInformation* packet_information,
uint32_t remote_ssrc) uint32_t remote_ssrc)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleSdes(const rtcp::CommonHeader& rtcp_block, void HandleSdes(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleXr(const rtcp::CommonHeader& rtcp_block, void HandleXr(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleXrReceiveReferenceTime(uint32_t sender_ssrc, void HandleXrReceiveReferenceTime(uint32_t sender_ssrc,
const rtcp::Rrtr& rrtr) const rtcp::Rrtr& rrtr)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti) void HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleXrTargetBitrate(uint32_t ssrc, void HandleXrTargetBitrate(uint32_t ssrc,
const rtcp::TargetBitrate& target_bitrate, const rtcp::TargetBitrate& target_bitrate,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleNack(const rtcp::CommonHeader& rtcp_block, void HandleNack(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleBye(const rtcp::CommonHeader& rtcp_block) 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, void HandlePli(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandlePsfbApp(const rtcp::CommonHeader& rtcp_block, void HandlePsfbApp(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleTmmbr(const rtcp::CommonHeader& rtcp_block, void HandleTmmbr(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleTmmbn(const rtcp::CommonHeader& rtcp_block, void HandleTmmbn(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleSrReq(const rtcp::CommonHeader& rtcp_block, void HandleSrReq(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleFir(const rtcp::CommonHeader& rtcp_block, void HandleFir(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
void HandleTransportFeedback(const rtcp::CommonHeader& rtcp_block, void HandleTransportFeedback(const rtcp::CommonHeader& rtcp_block,
PacketInformation* packet_information) PacketInformation* packet_information)
EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_); RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
Clock* const clock_; Clock* const clock_;
const bool receiver_only_; const bool receiver_only_;
@ -216,42 +216,43 @@ class RTCPReceiver {
VideoBitrateAllocationObserver* const bitrate_allocation_observer_; VideoBitrateAllocationObserver* const bitrate_allocation_observer_;
rtc::CriticalSection rtcp_receiver_lock_; rtc::CriticalSection rtcp_receiver_lock_;
uint32_t main_ssrc_ GUARDED_BY(rtcp_receiver_lock_); uint32_t main_ssrc_ RTC_GUARDED_BY(rtcp_receiver_lock_);
uint32_t remote_ssrc_ GUARDED_BY(rtcp_receiver_lock_); uint32_t remote_ssrc_ RTC_GUARDED_BY(rtcp_receiver_lock_);
std::set<uint32_t> registered_ssrcs_ GUARDED_BY(rtcp_receiver_lock_); std::set<uint32_t> registered_ssrcs_ RTC_GUARDED_BY(rtcp_receiver_lock_);
// Received sender report. // Received sender report.
NtpTime remote_sender_ntp_time_ GUARDED_BY(rtcp_receiver_lock_); NtpTime remote_sender_ntp_time_ RTC_GUARDED_BY(rtcp_receiver_lock_);
uint32_t remote_sender_rtp_time_ 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. // 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. // Received XR receive time report.
rtcp::ReceiveTimeInfo remote_time_info_; rtcp::ReceiveTimeInfo remote_time_info_;
// Time when the report was received. // Time when the report was received.
NtpTime last_received_xr_ntp_; NtpTime last_received_xr_ntp_;
// Estimated rtt, zero when there is no valid estimate. // 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 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. // Mapped by remote ssrc.
std::map<uint32_t, TmmbrInformation> tmmbr_infos_ std::map<uint32_t, TmmbrInformation> tmmbr_infos_
GUARDED_BY(rtcp_receiver_lock_); RTC_GUARDED_BY(rtcp_receiver_lock_);
ReportBlockMap received_report_blocks_ GUARDED_BY(rtcp_receiver_lock_); ReportBlockMap received_report_blocks_ RTC_GUARDED_BY(rtcp_receiver_lock_);
std::map<uint32_t, LastFirStatus> last_fir_ GUARDED_BY(rtcp_receiver_lock_); std::map<uint32_t, LastFirStatus> last_fir_
RTC_GUARDED_BY(rtcp_receiver_lock_);
std::map<uint32_t, std::string> received_cnames_ std::map<uint32_t, std::string> received_cnames_
GUARDED_BY(rtcp_receiver_lock_); RTC_GUARDED_BY(rtcp_receiver_lock_);
// The last time we received an RTCP RR. // 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 // The time we last received an RTCP RR telling we have successfully
// delivered RTP packet to the remote side. // delivered RTP packet to the remote side.
int64_t last_increased_sequence_number_ms_; 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_; RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
RtcpPacketTypeCounter packet_type_counter_; RtcpPacketTypeCounter packet_type_counter_;

View File

@ -155,117 +155,119 @@ class RTCPSender {
// Determine which RTCP messages should be sent and setup flags. // Determine which RTCP messages should be sent and setup flags.
void PrepareReport(const FeedbackState& feedback_state) void PrepareReport(const FeedbackState& feedback_state)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::vector<rtcp::ReportBlock> CreateReportBlocks( std::vector<rtcp::ReportBlock> CreateReportBlocks(
const FeedbackState& feedback_state) const FeedbackState& feedback_state)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildSR(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildSR(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildRR(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildRR(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildSDES(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildSDES(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildPLI(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildPLI(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildREMB(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildREMB(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildTMMBR(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildTMMBR(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildTMMBN(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildTMMBN(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildAPP(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildAPP(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildExtendedReports( std::unique_ptr<rtcp::RtcpPacket> BuildExtendedReports(
const RtcpContext& context) const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildBYE(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildBYE(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildFIR(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildFIR(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
std::unique_ptr<rtcp::RtcpPacket> BuildNACK(const RtcpContext& context) std::unique_ptr<rtcp::RtcpPacket> BuildNACK(const RtcpContext& context)
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
private: private:
const bool audio_; const bool audio_;
Clock* const clock_; Clock* const clock_;
Random random_ GUARDED_BY(critical_section_rtcp_sender_); Random random_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
RtcpMode method_ GUARDED_BY(critical_section_rtcp_sender_); RtcpMode method_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
RtcEventLog* const event_log_; RtcEventLog* const event_log_;
Transport* const transport_; Transport* const transport_;
rtc::CriticalSection critical_section_rtcp_sender_; rtc::CriticalSection critical_section_rtcp_sender_;
bool using_nack_ GUARDED_BY(critical_section_rtcp_sender_); bool using_nack_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
bool sending_ GUARDED_BY(critical_section_rtcp_sender_); bool sending_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
bool remb_enabled_ 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 timestamp_offset_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
uint32_t last_rtp_timestamp_ 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_ GUARDED_BY(critical_section_rtcp_sender_); int64_t last_frame_capture_time_ms_
uint32_t ssrc_ GUARDED_BY(critical_section_rtcp_sender_); 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 // SSRC that we receive on our RTP channel
uint32_t remote_ssrc_ GUARDED_BY(critical_section_rtcp_sender_); uint32_t remote_ssrc_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
std::string cname_ GUARDED_BY(critical_section_rtcp_sender_); std::string cname_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
ReceiveStatisticsProvider* receive_statistics_ ReceiveStatisticsProvider* receive_statistics_
GUARDED_BY(critical_section_rtcp_sender_); RTC_GUARDED_BY(critical_section_rtcp_sender_);
std::map<uint32_t, std::string> csrc_cnames_ std::map<uint32_t, std::string> csrc_cnames_
GUARDED_BY(critical_section_rtcp_sender_); RTC_GUARDED_BY(critical_section_rtcp_sender_);
// send CSRCs // send CSRCs
std::vector<uint32_t> csrcs_ GUARDED_BY(critical_section_rtcp_sender_); std::vector<uint32_t> csrcs_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
// Full intra request // 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 // REMB
uint32_t remb_bitrate_ GUARDED_BY(critical_section_rtcp_sender_); uint32_t remb_bitrate_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(critical_section_rtcp_sender_); std::vector<uint32_t> remb_ssrcs_
RTC_GUARDED_BY(critical_section_rtcp_sender_);
std::vector<rtcp::TmmbItem> tmmbn_to_send_ std::vector<rtcp::TmmbItem> tmmbn_to_send_
GUARDED_BY(critical_section_rtcp_sender_); RTC_GUARDED_BY(critical_section_rtcp_sender_);
uint32_t tmmbr_send_bps_ GUARDED_BY(critical_section_rtcp_sender_); uint32_t tmmbr_send_bps_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
uint32_t packet_oh_send_ GUARDED_BY(critical_section_rtcp_sender_); uint32_t packet_oh_send_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
size_t max_packet_size_ GUARDED_BY(critical_section_rtcp_sender_); size_t max_packet_size_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
// APP // APP
uint8_t app_sub_type_ GUARDED_BY(critical_section_rtcp_sender_); uint8_t app_sub_type_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
uint32_t app_name_ GUARDED_BY(critical_section_rtcp_sender_); uint32_t app_name_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
std::unique_ptr<uint8_t[]> app_data_ std::unique_ptr<uint8_t[]> app_data_
GUARDED_BY(critical_section_rtcp_sender_); RTC_GUARDED_BY(critical_section_rtcp_sender_);
uint16_t app_length_ 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. // True if sending of XR Receiver reference time report is enabled.
bool xr_send_receiver_reference_time_enabled_ bool xr_send_receiver_reference_time_enabled_
GUARDED_BY(critical_section_rtcp_sender_); RTC_GUARDED_BY(critical_section_rtcp_sender_);
// XR VoIP metric // XR VoIP metric
rtc::Optional<RTCPVoIPMetric> xr_voip_metric_ rtc::Optional<RTCPVoIPMetric> xr_voip_metric_
GUARDED_BY(critical_section_rtcp_sender_); RTC_GUARDED_BY(critical_section_rtcp_sender_);
RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
RtcpPacketTypeCounter packet_type_counter_ 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<BitrateAllocation> video_bitrate_allocation_ rtc::Optional<BitrateAllocation> video_bitrate_allocation_
GUARDED_BY(critical_section_rtcp_sender_); RTC_GUARDED_BY(critical_section_rtcp_sender_);
void SetFlag(uint32_t type, bool is_volatile) 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<RTCPPacketType>& types, bool is_volatile) void SetFlags(const std::set<RTCPPacketType>& 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 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) 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 bool AllVolatileFlagsConsumed() const
EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
struct ReportFlag { struct ReportFlag {
ReportFlag(uint32_t type, bool is_volatile) ReportFlag(uint32_t type, bool is_volatile)
: type(type), is_volatile(is_volatile) {} : type(type), is_volatile(is_volatile) {}
@ -275,7 +277,8 @@ class RTCPSender {
const bool is_volatile; const bool is_volatile;
}; };
std::set<ReportFlag> report_flags_ GUARDED_BY(critical_section_rtcp_sender_); std::set<ReportFlag> report_flags_
RTC_GUARDED_BY(critical_section_rtcp_sender_);
typedef std::unique_ptr<rtcp::RtcpPacket> (RTCPSender::*BuilderFunc)( typedef std::unique_ptr<rtcp::RtcpPacket> (RTCPSender::*BuilderFunc)(
const RtcpContext&); const RtcpContext&);

View File

@ -30,7 +30,8 @@ class RtpHeaderParserImpl : public RtpHeaderParser {
private: private:
rtc::CriticalSection critical_section_; 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() { RtpHeaderParser* RtpHeaderParser::Create() {

View File

@ -65,19 +65,19 @@ class RtpPacketHistory {
}; };
std::unique_ptr<RtpPacketToSend> GetPacket(int index) const std::unique_ptr<RtpPacketToSend> GetPacket(int index) const
EXCLUSIVE_LOCKS_REQUIRED(critsect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
void Allocate(size_t number_to_store) EXCLUSIVE_LOCKS_REQUIRED(critsect_); void Allocate(size_t number_to_store) RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
void Free() EXCLUSIVE_LOCKS_REQUIRED(critsect_); void Free() RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
bool FindSeqNum(uint16_t sequence_number, int* index) const bool FindSeqNum(uint16_t sequence_number, int* index) const
EXCLUSIVE_LOCKS_REQUIRED(critsect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
int FindBestFittingPacket(size_t size) const int FindBestFittingPacket(size_t size) const
EXCLUSIVE_LOCKS_REQUIRED(critsect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
Clock* clock_; Clock* clock_;
rtc::CriticalSection critsect_; rtc::CriticalSection critsect_;
bool store_ GUARDED_BY(critsect_); bool store_ RTC_GUARDED_BY(critsect_);
uint32_t prev_index_ GUARDED_BY(critsect_); uint32_t prev_index_ RTC_GUARDED_BY(critsect_);
std::vector<StoredPacket> stored_packets_ GUARDED_BY(critsect_); std::vector<StoredPacket> stored_packets_ RTC_GUARDED_BY(critsect_);
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpPacketHistory); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpPacketHistory);
}; };

View File

@ -254,7 +254,7 @@ class RTPSender {
Clock* const clock_; Clock* const clock_;
const int64_t clock_delta_ms_; const int64_t clock_delta_ms_;
Random random_ GUARDED_BY(send_critsect_); Random random_ RTC_GUARDED_BY(send_critsect_);
const bool audio_configured_; const bool audio_configured_;
const std::unique_ptr<RTPSenderAudio> audio_; const std::unique_ptr<RTPSenderAudio> audio_;
@ -267,14 +267,15 @@ class RTPSender {
rtc::CriticalSection send_critsect_; rtc::CriticalSection send_critsect_;
Transport* transport_; Transport* transport_;
bool sending_media_ GUARDED_BY(send_critsect_); bool sending_media_ RTC_GUARDED_BY(send_critsect_);
size_t max_packet_size_; size_t max_packet_size_;
int8_t payload_type_ GUARDED_BY(send_critsect_); int8_t payload_type_ RTC_GUARDED_BY(send_critsect_);
std::map<int8_t, RtpUtility::Payload*> payload_type_map_; std::map<int8_t, RtpUtility::Payload*> 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 // Tracks the current request for playout delay limits from application
// and decides whether the current RTP frame should include the playout // and decides whether the current RTP frame should include the playout
@ -288,13 +289,14 @@ class RTPSender {
// Statistics // Statistics
rtc::CriticalSection statistics_crit_; rtc::CriticalSection statistics_crit_;
SendDelayMap send_delays_ GUARDED_BY(statistics_crit_); SendDelayMap send_delays_ RTC_GUARDED_BY(statistics_crit_);
FrameCounts frame_counts_ GUARDED_BY(statistics_crit_); FrameCounts frame_counts_ RTC_GUARDED_BY(statistics_crit_);
StreamDataCounters rtp_stats_ GUARDED_BY(statistics_crit_); StreamDataCounters rtp_stats_ RTC_GUARDED_BY(statistics_crit_);
StreamDataCounters rtx_rtp_stats_ GUARDED_BY(statistics_crit_); StreamDataCounters rtx_rtp_stats_ RTC_GUARDED_BY(statistics_crit_);
StreamDataCountersCallback* rtp_stats_callback_ GUARDED_BY(statistics_crit_); StreamDataCountersCallback* rtp_stats_callback_
RateStatistics total_bitrate_sent_ GUARDED_BY(statistics_crit_); RTC_GUARDED_BY(statistics_crit_);
RateStatistics nack_bitrate_sent_ 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_; FrameCountObserver* const frame_count_observer_;
SendSideDelayObserver* const send_side_delay_observer_; SendSideDelayObserver* const send_side_delay_observer_;
RtcEventLog* const event_log_; RtcEventLog* const event_log_;
@ -302,25 +304,25 @@ class RTPSender {
BitrateStatisticsObserver* const bitrate_callback_; BitrateStatisticsObserver* const bitrate_callback_;
// RTP variables // RTP variables
uint32_t timestamp_offset_ GUARDED_BY(send_critsect_); uint32_t timestamp_offset_ RTC_GUARDED_BY(send_critsect_);
uint32_t remote_ssrc_ GUARDED_BY(send_critsect_); uint32_t remote_ssrc_ RTC_GUARDED_BY(send_critsect_);
bool sequence_number_forced_ GUARDED_BY(send_critsect_); bool sequence_number_forced_ RTC_GUARDED_BY(send_critsect_);
uint16_t sequence_number_ GUARDED_BY(send_critsect_); uint16_t sequence_number_ RTC_GUARDED_BY(send_critsect_);
uint16_t sequence_number_rtx_ 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 // Must be explicitly set by the application, use of rtc::Optional
// only to keep track of correct use. // only to keep track of correct use.
rtc::Optional<uint32_t> ssrc_ GUARDED_BY(send_critsect_); rtc::Optional<uint32_t> ssrc_ RTC_GUARDED_BY(send_critsect_);
uint32_t last_rtp_timestamp_ GUARDED_BY(send_critsect_); uint32_t last_rtp_timestamp_ RTC_GUARDED_BY(send_critsect_);
int64_t capture_time_ms_ GUARDED_BY(send_critsect_); int64_t capture_time_ms_ RTC_GUARDED_BY(send_critsect_);
int64_t last_timestamp_time_ms_ GUARDED_BY(send_critsect_); int64_t last_timestamp_time_ms_ RTC_GUARDED_BY(send_critsect_);
bool media_has_been_sent_ GUARDED_BY(send_critsect_); bool media_has_been_sent_ RTC_GUARDED_BY(send_critsect_);
bool last_packet_marker_bit_ GUARDED_BY(send_critsect_); bool last_packet_marker_bit_ RTC_GUARDED_BY(send_critsect_);
std::vector<uint32_t> csrcs_ GUARDED_BY(send_critsect_); std::vector<uint32_t> csrcs_ RTC_GUARDED_BY(send_critsect_);
int rtx_ GUARDED_BY(send_critsect_); int rtx_ RTC_GUARDED_BY(send_critsect_);
rtc::Optional<uint32_t> ssrc_rtx_ GUARDED_BY(send_critsect_); rtc::Optional<uint32_t> ssrc_rtx_ RTC_GUARDED_BY(send_critsect_);
// Mapping rtx_payload_type_map_[associated] = rtx. // Mapping rtx_payload_type_map_[associated] = rtx.
std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); std::map<int8_t, int8_t> rtx_payload_type_map_ RTC_GUARDED_BY(send_critsect_);
size_t rtp_overhead_bytes_per_packet_ GUARDED_BY(send_critsect_); size_t rtp_overhead_bytes_per_packet_ RTC_GUARDED_BY(send_critsect_);
RateLimiter* const retransmission_rate_limiter_; RateLimiter* const retransmission_rate_limiter_;
OverheadObserver* overhead_observer_; OverheadObserver* overhead_observer_;

View File

@ -68,8 +68,8 @@ class RTPSenderAudio {
// DTMF. // DTMF.
bool dtmf_event_is_on_ = false; bool dtmf_event_is_on_ = false;
bool dtmf_event_first_packet_sent_ = false; bool dtmf_event_first_packet_sent_ = false;
int8_t dtmf_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; int8_t dtmf_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1;
uint32_t dtmf_payload_freq_ GUARDED_BY(send_audio_critsect_) = 8000; uint32_t dtmf_payload_freq_ RTC_GUARDED_BY(send_audio_critsect_) = 8000;
uint32_t dtmf_timestamp_ = 0; uint32_t dtmf_timestamp_ = 0;
uint32_t dtmf_length_samples_ = 0; uint32_t dtmf_length_samples_ = 0;
int64_t dtmf_time_last_sent_ = 0; int64_t dtmf_time_last_sent_ = 0;
@ -78,16 +78,16 @@ class RTPSenderAudio {
DtmfQueue dtmf_queue_; DtmfQueue dtmf_queue_;
// VAD detection, used for marker bit. // VAD detection, used for marker bit.
bool inband_vad_active_ GUARDED_BY(send_audio_critsect_) = false; bool inband_vad_active_ RTC_GUARDED_BY(send_audio_critsect_) = false;
int8_t cngnb_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; int8_t cngnb_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1;
int8_t cngwb_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; int8_t cngwb_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1;
int8_t cngswb_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; int8_t cngswb_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1;
int8_t cngfb_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; int8_t cngfb_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1;
int8_t last_payload_type_ GUARDED_BY(send_audio_critsect_) = -1; int8_t last_payload_type_ RTC_GUARDED_BY(send_audio_critsect_) = -1;
// Audio level indication. // Audio level indication.
// (https://datatracker.ietf.org/doc/draft-lennox-avt-rtp-audio-level-exthdr/) // (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_; OneTimeEvent first_packet_sent_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSenderAudio); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSenderAudio);

View File

@ -97,7 +97,7 @@ class RTPSenderVideo {
int64_t last_frame_time_ms; 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<RtpPacketToSend> packet, void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet,
StorageType storage); StorageType storage);
@ -113,11 +113,11 @@ class RTPSenderVideo {
StorageType media_packet_storage, StorageType media_packet_storage,
bool protect_media_packet); 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; 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; return ulpfec_payload_type_ >= 0;
} }
@ -125,7 +125,7 @@ class RTPSenderVideo {
bool UpdateConditionalRetransmit(uint8_t temporal_id, bool UpdateConditionalRetransmit(uint8_t temporal_id,
int64_t expected_retransmission_time_ms) int64_t expected_retransmission_time_ms)
EXCLUSIVE_LOCKS_REQUIRED(stats_crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(stats_crit_);
RTPSender* const rtp_sender_; RTPSender* const rtp_sender_;
Clock* const clock_; Clock* const clock_;
@ -134,30 +134,30 @@ class RTPSenderVideo {
rtc::CriticalSection crit_; rtc::CriticalSection crit_;
RtpVideoCodecTypes video_type_; RtpVideoCodecTypes video_type_;
int32_t retransmission_settings_ GUARDED_BY(crit_); int32_t retransmission_settings_ RTC_GUARDED_BY(crit_);
VideoRotation last_rotation_ GUARDED_BY(crit_); VideoRotation last_rotation_ RTC_GUARDED_BY(crit_);
// RED/ULPFEC. // RED/ULPFEC.
int red_payload_type_ GUARDED_BY(crit_); int red_payload_type_ RTC_GUARDED_BY(crit_);
int ulpfec_payload_type_ GUARDED_BY(crit_); int ulpfec_payload_type_ RTC_GUARDED_BY(crit_);
UlpfecGenerator ulpfec_generator_ GUARDED_BY(crit_); UlpfecGenerator ulpfec_generator_ RTC_GUARDED_BY(crit_);
// FlexFEC. // FlexFEC.
FlexfecSender* const flexfec_sender_; FlexfecSender* const flexfec_sender_;
// FEC parameters, applicable to either ULPFEC or FlexFEC. // FEC parameters, applicable to either ULPFEC or FlexFEC.
FecProtectionParams delta_fec_params_ GUARDED_BY(crit_); FecProtectionParams delta_fec_params_ RTC_GUARDED_BY(crit_);
FecProtectionParams key_fec_params_ GUARDED_BY(crit_); FecProtectionParams key_fec_params_ RTC_GUARDED_BY(crit_);
rtc::CriticalSection stats_crit_; rtc::CriticalSection stats_crit_;
// Bitrate used for FEC payload, RED headers, RTP headers for FEC packets // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets
// and any padding overhead. // 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. // 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<int, TemporalLayerStats> frame_stats_by_temporal_layer_ std::map<int, TemporalLayerStats> frame_stats_by_temporal_layer_
GUARDED_BY(stats_crit_); RTC_GUARDED_BY(stats_crit_);
OneTimeEvent first_frame_sent_; OneTimeEvent first_frame_sent_;
}; };

View File

@ -52,8 +52,8 @@ bool ffmpeg_initialized = false;
// Called by FFmpeg to do mutex operations if initialized using // Called by FFmpeg to do mutex operations if initialized using
// |InitializeFFmpeg|. Disabling thread safety analysis because void** does not // |InitializeFFmpeg|. Disabling thread safety analysis because void** does not
// play nicely with thread_annotations.h macros. // play nicely with thread_annotations.h macros.
int LockManagerOperation(void** lock, AVLockOp op) int LockManagerOperation(void** lock,
NO_THREAD_SAFETY_ANALYSIS { AVLockOp op) RTC_NO_THREAD_SAFETY_ANALYSIS {
switch (op) { switch (op) {
case AV_LOCK_CREATE: case AV_LOCK_CREATE:
*lock = new rtc::CriticalSection(); *lock = new rtc::CriticalSection();

View File

@ -95,13 +95,15 @@ class VideoCodecTest : public ::testing::Test {
rtc::Event encoded_frame_event_; rtc::Event encoded_frame_event_;
rtc::CriticalSection encoded_frame_section_; rtc::CriticalSection encoded_frame_section_;
rtc::Optional<EncodedImage> encoded_frame_ GUARDED_BY(encoded_frame_section_); rtc::Optional<EncodedImage> encoded_frame_
CodecSpecificInfo codec_specific_info_ GUARDED_BY(encoded_frame_section_); RTC_GUARDED_BY(encoded_frame_section_);
CodecSpecificInfo codec_specific_info_ RTC_GUARDED_BY(encoded_frame_section_);
rtc::Event decoded_frame_event_; rtc::Event decoded_frame_event_;
rtc::CriticalSection decoded_frame_section_; rtc::CriticalSection decoded_frame_section_;
rtc::Optional<VideoFrame> decoded_frame_ GUARDED_BY(decoded_frame_section_); rtc::Optional<VideoFrame> decoded_frame_
rtc::Optional<uint8_t> decoded_qp_ GUARDED_BY(decoded_frame_section_); RTC_GUARDED_BY(decoded_frame_section_);
rtc::Optional<uint8_t> decoded_qp_ RTC_GUARDED_BY(decoded_frame_section_);
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -253,8 +253,8 @@ class VideoProcessor {
// Invoked by the callback adapter when a frame has completed decoding. // Invoked by the callback adapter when a frame has completed decoding.
void FrameDecoded(const webrtc::VideoFrame& image); void FrameDecoded(const webrtc::VideoFrame& image);
bool initialized_ GUARDED_BY(sequence_checker_); bool initialized_ RTC_GUARDED_BY(sequence_checker_);
TestConfig config_ GUARDED_BY(sequence_checker_); TestConfig config_ RTC_GUARDED_BY(sequence_checker_);
webrtc::VideoEncoder* const encoder_; webrtc::VideoEncoder* const encoder_;
webrtc::VideoDecoder* const decoder_; webrtc::VideoDecoder* const decoder_;
@ -280,27 +280,27 @@ class VideoProcessor {
FrameWriter* const decoded_frame_writer_; FrameWriter* const decoded_frame_writer_;
// Keep track of inputed/encoded/decoded frames, so we can detect frame drops. // Keep track of inputed/encoded/decoded frames, so we can detect frame drops.
int last_inputed_frame_num_ GUARDED_BY(sequence_checker_); int last_inputed_frame_num_ RTC_GUARDED_BY(sequence_checker_);
int last_encoded_frame_num_ GUARDED_BY(sequence_checker_); int last_encoded_frame_num_ RTC_GUARDED_BY(sequence_checker_);
int last_decoded_frame_num_ 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 // Store an RTP timestamp -> frame number map, since the timestamps are
// based off of the frame rate, which can change mid-test. // based off of the frame rate, which can change mid-test.
std::map<uint32_t, int> rtp_timestamp_to_frame_num_ std::map<uint32_t, int> 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. // 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 // Keep track of the last successfully decoded frame, since we write that
// frame to disk when decoding fails. // 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. // Statistics.
Stats* stats_; Stats* stats_;
std::vector<int> num_dropped_frames_ GUARDED_BY(sequence_checker_); std::vector<int> num_dropped_frames_ RTC_GUARDED_BY(sequence_checker_);
std::vector<int> num_spatial_resizes_ GUARDED_BY(sequence_checker_); std::vector<int> num_spatial_resizes_ RTC_GUARDED_BY(sequence_checker_);
int rate_update_index_ GUARDED_BY(sequence_checker_); int rate_update_index_ RTC_GUARDED_BY(sequence_checker_);
rtc::SequencedTaskChecker sequence_checker_; rtc::SequencedTaskChecker sequence_checker_;

View File

@ -106,7 +106,7 @@ class Vp9FrameBufferPool {
rtc::CriticalSection buffers_lock_; rtc::CriticalSection buffers_lock_;
// All buffers, in use or ready to be recycled. // All buffers, in use or ready to be recycled.
std::vector<rtc::scoped_refptr<Vp9FrameBuffer>> allocated_buffers_ std::vector<rtc::scoped_refptr<Vp9FrameBuffer>> 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 // 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 // debug mode. VP9 is defined to have 8 reference buffers, of which 3 can be
// referenced by any frame, see // referenced by any frame, see

View File

@ -129,56 +129,56 @@ class FrameBuffer {
// Updates the minimal and maximal playout delays // Updates the minimal and maximal playout delays
// depending on the frame. // depending on the frame.
void UpdatePlayoutDelays(const FrameObject& 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 // Update all directly dependent and indirectly dependent frames and mark
// them as continuous if all their references has been fulfilled. // them as continuous if all their references has been fulfilled.
void PropagateContinuity(FrameMap::iterator start) 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. // Marks the frame as decoded and updates all directly dependent frames.
void PropagateDecodability(const FrameInfo& info) void PropagateDecodability(const FrameInfo& info)
EXCLUSIVE_LOCKS_REQUIRED(crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Advances |last_decoded_frame_it_| to |decoded| and removes old // Advances |last_decoded_frame_it_| to |decoded| and removes old
// frame info. // frame info.
void AdvanceLastDecodedFrame(FrameMap::iterator decoded) void AdvanceLastDecodedFrame(FrameMap::iterator decoded)
EXCLUSIVE_LOCKS_REQUIRED(crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Update the corresponding FrameInfo of |frame| and all FrameInfos that // Update the corresponding FrameInfo of |frame| and all FrameInfos that
// |frame| references. // |frame| references.
// Return false if |frame| will never be decodable, true otherwise. // Return false if |frame| will never be decodable, true otherwise.
bool UpdateFrameInfoWithIncomingFrame(const FrameObject& frame, bool UpdateFrameInfoWithIncomingFrame(const FrameObject& frame,
FrameMap::iterator info) 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) 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_; rtc::CriticalSection crit_;
Clock* const clock_; Clock* const clock_;
rtc::Event new_continuous_frame_event_; rtc::Event new_continuous_frame_event_;
VCMJitterEstimator* const jitter_estimator_ GUARDED_BY(crit_); VCMJitterEstimator* const jitter_estimator_ RTC_GUARDED_BY(crit_);
VCMTiming* const timing_ GUARDED_BY(crit_); VCMTiming* const timing_ RTC_GUARDED_BY(crit_);
VCMInterFrameDelay inter_frame_delay_ GUARDED_BY(crit_); VCMInterFrameDelay inter_frame_delay_ RTC_GUARDED_BY(crit_);
uint32_t last_decoded_frame_timestamp_ GUARDED_BY(crit_); uint32_t last_decoded_frame_timestamp_ RTC_GUARDED_BY(crit_);
FrameMap::iterator last_decoded_frame_it_ GUARDED_BY(crit_); FrameMap::iterator last_decoded_frame_it_ RTC_GUARDED_BY(crit_);
FrameMap::iterator last_continuous_frame_it_ GUARDED_BY(crit_); FrameMap::iterator last_continuous_frame_it_ RTC_GUARDED_BY(crit_);
FrameMap::iterator next_frame_it_ GUARDED_BY(crit_); FrameMap::iterator next_frame_it_ RTC_GUARDED_BY(crit_);
int num_frames_history_ GUARDED_BY(crit_); int num_frames_history_ RTC_GUARDED_BY(crit_);
int num_frames_buffered_ GUARDED_BY(crit_); int num_frames_buffered_ RTC_GUARDED_BY(crit_);
bool stopped_ GUARDED_BY(crit_); bool stopped_ RTC_GUARDED_BY(crit_);
VCMVideoProtection protection_mode_ GUARDED_BY(crit_); VCMVideoProtection protection_mode_ RTC_GUARDED_BY(crit_);
VCMReceiveStatisticsCallback* const stats_callback_; 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); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer);
}; };

View File

@ -69,7 +69,7 @@ class VCMDecodedFrameCallback : public DecodedImageCallback {
VCMReceiveCallback* _receiveCallback = nullptr; VCMReceiveCallback* _receiveCallback = nullptr;
VCMTiming* _timing; VCMTiming* _timing;
rtc::CriticalSection lock_; rtc::CriticalSection lock_;
VCMTimestampMap _timestampMap GUARDED_BY(lock_); VCMTimestampMap _timestampMap RTC_GUARDED_BY(lock_);
uint64_t _lastReceivedPictureID; uint64_t _lastReceivedPictureID;
int64_t ntp_offset_; int64_t ntp_offset_;
}; };

View File

@ -77,11 +77,11 @@ class VCMEncodedFrameCallback : public EncodedImageCallback {
}; };
// Separate instance for each simulcast stream or spatial layer. // Separate instance for each simulcast stream or spatial layer.
std::vector<TimingFramesLayerInfo> timing_frames_info_ std::vector<TimingFramesLayerInfo> timing_frames_info_
GUARDED_BY(timing_params_lock_); RTC_GUARDED_BY(timing_params_lock_);
size_t framerate_ GUARDED_BY(timing_params_lock_); size_t framerate_ RTC_GUARDED_BY(timing_params_lock_);
int64_t last_timing_frame_time_ms_ GUARDED_BY(timing_params_lock_); int64_t last_timing_frame_time_ms_ RTC_GUARDED_BY(timing_params_lock_);
VideoCodec::TimingFrameTriggerThresholds timing_frames_thresholds_ 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 // Experiment groups parsed from field trials for realtime video ([0]) and
// screenshare ([1]). 0 means no group specified. Positive values are // screenshare ([1]). 0 means no group specified. Positive values are
@ -117,11 +117,11 @@ class VCMGenericEncoder {
private: private:
rtc::RaceChecker race_checker_; 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_; VCMEncodedFrameCallback* const vcm_encoded_frame_callback_;
const bool internal_source_; const bool internal_source_;
rtc::CriticalSection params_lock_; rtc::CriticalSection params_lock_;
EncoderParameters encoder_params_ GUARDED_BY(params_lock_); EncoderParameters encoder_params_ RTC_GUARDED_BY(params_lock_);
bool is_screenshare_; bool is_screenshare_;
size_t streams_or_svc_num_; size_t streams_or_svc_num_;
}; };

View File

@ -219,72 +219,72 @@ class VCMJitterBuffer {
VCMFrameBufferEnum GetFrame(const VCMPacket& packet, VCMFrameBufferEnum GetFrame(const VCMPacket& packet,
VCMFrameBuffer** frame, VCMFrameBuffer** frame,
FrameList** frame_list) 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 // Returns true if |frame| is continuous in |decoding_state|, not taking
// decodable frames into account. // decodable frames into account.
bool IsContinuousInState(const VCMFrameBuffer& frame, bool IsContinuousInState(const VCMFrameBuffer& frame,
const VCMDecodingState& decoding_state) const 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 // Returns true if |frame| is continuous in the |last_decoded_state_|, taking
// all decodable frames into account. // all decodable frames into account.
bool IsContinuous(const VCMFrameBuffer& frame) const 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 // Looks for frames in |incomplete_frames_| which are continuous in the
// provided |decoded_state|. Starts the search from the timestamp of // provided |decoded_state|. Starts the search from the timestamp of
// |decoded_state|. // |decoded_state|.
void FindAndInsertContinuousFramesWithState( void FindAndInsertContinuousFramesWithState(
const VCMDecodingState& decoded_state) 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 // Looks for frames in |incomplete_frames_| which are continuous in
// |last_decoded_state_| taking all decodable frames into account. Starts // |last_decoded_state_| taking all decodable frames into account. Starts
// the search from |new_frame|. // the search from |new_frame|.
void FindAndInsertContinuousFrames(const VCMFrameBuffer& new_frame) void FindAndInsertContinuousFrames(const VCMFrameBuffer& new_frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
VCMFrameBuffer* NextFrame() const 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 // 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 // |sequence_number|. If false a key frame is needed to get into a state where
// we can continue decoding. // we can continue decoding.
bool UpdateNackList(uint16_t sequence_number) bool UpdateNackList(uint16_t sequence_number)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
bool TooLargeNackList() const; bool TooLargeNackList() const;
// Returns true if the NACK list was reduced without problem. If false a key // 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. // 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 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 // 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 // list. If false, a key frame is needed to get into a state where we can
// continue decoding. // continue decoding.
bool HandleTooOldPackets(uint16_t latest_sequence_number) 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|. // Drops all packets in the NACK list up until |last_decoded_sequence_number|.
void DropPacketsFromNackList(uint16_t 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 // Gets an empty frame, creating a new frame if necessary (i.e. increases
// jitter buffer size). // 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 // Attempts to increase the size of the jitter buffer. Returns true on
// success, false otherwise. // 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 // Recycles oldest frames until a key frame is found. Used if jitter buffer is
// completely full. Returns true if a key frame was found. // 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. // Updates the frame statistics.
// Counts only complete frames, so decodable incomplete frames will not be // Counts only complete frames, so decodable incomplete frames will not be
// counted. // counted.
void CountFrame(const VCMFrameBuffer& frame) void CountFrame(const VCMFrameBuffer& frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Update rolling average of packets per frame. // Update rolling average of packets per frame.
void UpdateAveragePacketsPerFrame(int current_number_packets_); void UpdateAveragePacketsPerFrame(int current_number_packets_);
// Cleans the frame list in the JB from old/empty frames. // Cleans the frame list in the JB from old/empty frames.
// Should only be called prior to actual use. // 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. // Returns true if |packet| is likely to have been retransmitted.
bool IsPacketRetransmitted(const VCMPacket& packet) const; bool IsPacketRetransmitted(const VCMPacket& packet) const;
@ -302,15 +302,16 @@ class VCMJitterBuffer {
// Returns true if we should wait for retransmissions, false otherwise. // Returns true if we should wait for retransmissions, false otherwise.
bool WaitForRetransmissions(); bool WaitForRetransmissions();
int NonContinuousOrIncompleteDuration() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); int NonContinuousOrIncompleteDuration()
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
uint16_t EstimatedLowSequenceNumber(const VCMFrameBuffer& frame) const; 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_. // Reset frame buffer and return it to free_frames_.
void RecycleFrameBuffer(VCMFrameBuffer* frame) void RecycleFrameBuffer(VCMFrameBuffer* frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
Clock* clock_; Clock* clock_;
// If we are running (have started) or not. // If we are running (have started) or not.
@ -320,14 +321,14 @@ class VCMJitterBuffer {
std::unique_ptr<EventWrapper> frame_event_; std::unique_ptr<EventWrapper> frame_event_;
// Number of allocated frames. // Number of allocated frames.
int max_number_of_frames_; int max_number_of_frames_;
UnorderedFrameList free_frames_ GUARDED_BY(crit_sect_); UnorderedFrameList free_frames_ RTC_GUARDED_BY(crit_sect_);
FrameList decodable_frames_ GUARDED_BY(crit_sect_); FrameList decodable_frames_ RTC_GUARDED_BY(crit_sect_);
FrameList incomplete_frames_ GUARDED_BY(crit_sect_); FrameList incomplete_frames_ RTC_GUARDED_BY(crit_sect_);
VCMDecodingState last_decoded_state_ GUARDED_BY(crit_sect_); VCMDecodingState last_decoded_state_ RTC_GUARDED_BY(crit_sect_);
bool first_packet_since_reset_; bool first_packet_since_reset_;
// Statistics. // Statistics.
VCMReceiveStatisticsCallback* stats_callback_ GUARDED_BY(crit_sect_); VCMReceiveStatisticsCallback* stats_callback_ RTC_GUARDED_BY(crit_sect_);
// Frame counts for each type (key, delta, ...) // Frame counts for each type (key, delta, ...)
FrameCounts receive_statistics_; FrameCounts receive_statistics_;
// Latest calculated frame rates of incoming stream. // Latest calculated frame rates of incoming stream.
@ -339,13 +340,13 @@ class VCMJitterBuffer {
// Number of packets in a row that have been too old. // Number of packets in a row that have been too old.
int num_consecutive_old_packets_; int num_consecutive_old_packets_;
// Number of packets received. // Number of packets received.
int num_packets_ GUARDED_BY(crit_sect_); int num_packets_ RTC_GUARDED_BY(crit_sect_);
// Number of duplicated packets received. // 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. // 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. // 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. // Jitter estimation.
// Filter for estimating jitter. // Filter for estimating jitter.

View File

@ -68,40 +68,42 @@ class MediaOptimization {
struct EncodedFrameSample; struct EncodedFrameSample;
typedef std::list<EncodedFrameSample> FrameSampleList; typedef std::list<EncodedFrameSample> FrameSampleList;
void UpdateIncomingFrameRate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); void UpdateIncomingFrameRate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void PurgeOldFrameSamples(int64_t threshold_ms) void PurgeOldFrameSamples(int64_t threshold_ms)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void UpdateSentFramerate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); void UpdateSentFramerate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void ProcessIncomingFrameRate(int64_t now) 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 // Checks conditions for suspending the video. The method compares
// |video_target_bitrate_| with the threshold values for suspension, and // |video_target_bitrate_| with the threshold values for suspension, and
// changes the state of |video_suspended_| accordingly. // 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, void SetEncodingDataInternal(int32_t max_bit_rate,
uint32_t frame_rate, uint32_t frame_rate,
uint32_t bit_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. // Protect all members.
rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
Clock* clock_ GUARDED_BY(crit_sect_); Clock* clock_ RTC_GUARDED_BY(crit_sect_);
int32_t max_bit_rate_ GUARDED_BY(crit_sect_); int32_t max_bit_rate_ RTC_GUARDED_BY(crit_sect_);
float user_frame_rate_ GUARDED_BY(crit_sect_); float user_frame_rate_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<FrameDropper> frame_dropper_ GUARDED_BY(crit_sect_); std::unique_ptr<FrameDropper> frame_dropper_ RTC_GUARDED_BY(crit_sect_);
int video_target_bitrate_ GUARDED_BY(crit_sect_); int video_target_bitrate_ RTC_GUARDED_BY(crit_sect_);
float incoming_frame_rate_ GUARDED_BY(crit_sect_); float incoming_frame_rate_ RTC_GUARDED_BY(crit_sect_);
int64_t incoming_frame_times_[kFrameCountHistorySize] GUARDED_BY(crit_sect_); int64_t incoming_frame_times_[kFrameCountHistorySize] RTC_GUARDED_BY(
std::list<EncodedFrameSample> encoded_frame_samples_ GUARDED_BY(crit_sect_); crit_sect_);
uint32_t avg_sent_framerate_ GUARDED_BY(crit_sect_); std::list<EncodedFrameSample> encoded_frame_samples_
RTC_GUARDED_BY(crit_sect_);
uint32_t avg_sent_framerate_ RTC_GUARDED_BY(crit_sect_);
}; };
} // namespace media_optimization } // namespace media_optimization
} // namespace webrtc } // namespace webrtc

View File

@ -59,22 +59,22 @@ class NackModule : public Module {
int retries; int retries;
}; };
void AddPacketsToNack(uint16_t seq_num_start, uint16_t seq_num_end) 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 // Removes packets from the nack list until the next keyframe. Returns true
// if packets were removed. // if packets were removed.
bool RemovePacketsUntilKeyFrame() EXCLUSIVE_LOCKS_REQUIRED(crit_); bool RemovePacketsUntilKeyFrame() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
std::vector<uint16_t> GetNackBatch(NackFilterOptions options) std::vector<uint16_t> GetNackBatch(NackFilterOptions options)
EXCLUSIVE_LOCKS_REQUIRED(crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Update the reordering distribution. // Update the reordering distribution.
void UpdateReorderingStatistics(uint16_t seq_num) 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 // Returns how many packets we have to wait in order to receive the packet
// with probability |probabilty| or higher. // with probability |probabilty| or higher.
int WaitNumberOfPackets(float probability) const int WaitNumberOfPackets(float probability) const
EXCLUSIVE_LOCKS_REQUIRED(crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
rtc::CriticalSection crit_; rtc::CriticalSection crit_;
Clock* const clock_; Clock* const clock_;
@ -85,13 +85,13 @@ class NackModule : public Module {
// known thread (e.g. see |initialized_|). Those probably do not need // known thread (e.g. see |initialized_|). Those probably do not need
// synchronized access. // synchronized access.
std::map<uint16_t, NackInfo, DescendingSeqNumComp<uint16_t>> nack_list_ std::map<uint16_t, NackInfo, DescendingSeqNumComp<uint16_t>> nack_list_
GUARDED_BY(crit_); RTC_GUARDED_BY(crit_);
std::set<uint16_t, DescendingSeqNumComp<uint16_t>> keyframe_list_ std::set<uint16_t, DescendingSeqNumComp<uint16_t>> keyframe_list_
GUARDED_BY(crit_); RTC_GUARDED_BY(crit_);
video_coding::Histogram reordering_histogram_ GUARDED_BY(crit_); video_coding::Histogram reordering_histogram_ RTC_GUARDED_BY(crit_);
bool initialized_ GUARDED_BY(crit_); bool initialized_ RTC_GUARDED_BY(crit_);
int64_t rtt_ms_ GUARDED_BY(crit_); int64_t rtt_ms_ RTC_GUARDED_BY(crit_);
uint16_t newest_seq_num_ GUARDED_BY(crit_); uint16_t newest_seq_num_ RTC_GUARDED_BY(crit_);
// Only touched on the process thread. // Only touched on the process thread.
int64_t next_process_time_ms_; int64_t next_process_time_ms_;

View File

@ -99,16 +99,16 @@ class PacketBuffer {
Clock* const clock_; Clock* const clock_;
// Tries to expand the buffer. // 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. // Test if all previous packets has arrived for the given sequence number.
bool PotentialNewFrame(uint16_t seq_num) const 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. // Test if all packets of a frame has arrived, and if so, creates a frame.
// Returns a vector of received frames. // Returns a vector of received frames.
std::vector<std::unique_ptr<RtpFrameObject>> FindFrames(uint16_t seq_num) std::vector<std::unique_ptr<RtpFrameObject>> FindFrames(uint16_t seq_num)
EXCLUSIVE_LOCKS_REQUIRED(crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Copy the bitstream for |frame| to |destination|. // Copy the bitstream for |frame| to |destination|.
// Virtual for testing. // Virtual for testing.
@ -117,46 +117,48 @@ class PacketBuffer {
// Get the packet with sequence number |seq_num|. // Get the packet with sequence number |seq_num|.
// Virtual for testing. // Virtual for testing.
virtual VCMPacket* GetPacket(uint16_t seq_num) 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. // Mark all slots used by |frame| as not used.
// Virtual for testing. // Virtual for testing.
virtual void ReturnFrame(RtpFrameObject* frame); 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_; rtc::CriticalSection crit_;
// Buffer size_ and max_size_ must always be a power of two. // 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_; const size_t max_size_;
// The fist sequence number currently in the buffer. // 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. // 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_|. // 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. // Buffer that holds the inserted packets.
std::vector<VCMPacket> data_buffer_ GUARDED_BY(crit_); std::vector<VCMPacket> data_buffer_ RTC_GUARDED_BY(crit_);
// Buffer that holds the information about which slot that is currently in use // Buffer that holds the information about which slot that is currently in use
// and information needed to determine the continuity between packets. // and information needed to determine the continuity between packets.
std::vector<ContinuityInfo> sequence_buffer_ GUARDED_BY(crit_); std::vector<ContinuityInfo> sequence_buffer_ RTC_GUARDED_BY(crit_);
// Called when a received frame is found. // Called when a received frame is found.
OnReceivedFrameCallback* const received_frame_callback_; OnReceivedFrameCallback* const received_frame_callback_;
// Timestamp (not RTP timestamp) of the last received packet/keyframe packet. // Timestamp (not RTP timestamp) of the last received packet/keyframe packet.
rtc::Optional<int64_t> last_received_packet_ms_ GUARDED_BY(crit_); rtc::Optional<int64_t> last_received_packet_ms_ RTC_GUARDED_BY(crit_);
rtc::Optional<int64_t> last_received_keyframe_packet_ms_ GUARDED_BY(crit_); rtc::Optional<int64_t> last_received_keyframe_packet_ms_
RTC_GUARDED_BY(crit_);
rtc::Optional<uint16_t> newest_inserted_seq_num_ GUARDED_BY(crit_); rtc::Optional<uint16_t> newest_inserted_seq_num_ RTC_GUARDED_BY(crit_);
std::set<uint16_t, DescendingSeqNumComp<uint16_t>> missing_packets_ std::set<uint16_t, DescendingSeqNumComp<uint16_t>> missing_packets_
GUARDED_BY(crit_); RTC_GUARDED_BY(crit_);
mutable volatile int ref_count_ = 0; mutable volatile int ref_count_ = 0;
}; };

View File

@ -69,8 +69,8 @@ class ProtectionBitrateCalculator {
rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
std::unique_ptr<media_optimization::VCMLossProtectionLogic> loss_prot_logic_ std::unique_ptr<media_optimization::VCMLossProtectionLogic> loss_prot_logic_
GUARDED_BY(crit_sect_); RTC_GUARDED_BY(crit_sect_);
size_t max_payload_size_ GUARDED_BY(crit_sect_); size_t max_payload_size_ RTC_GUARDED_BY(crit_sect_);
RTC_DISALLOW_COPY_AND_ASSIGN(ProtectionBitrateCalculator); RTC_DISALLOW_COPY_AND_ASSIGN(ProtectionBitrateCalculator);
}; };

View File

@ -79,71 +79,73 @@ class RtpFrameReferenceFinder {
// Find the relevant group of pictures and update its "last-picture-id-with // Find the relevant group of pictures and update its "last-picture-id-with
// padding" sequence number. // padding" sequence number.
void UpdateLastPictureIdWithPadding(uint16_t seq_num) 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. // 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) FrameDecision ManageFrameInternal(RtpFrameObject* frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Find references for generic frames. If |picture_id| is unspecified // Find references for generic frames. If |picture_id| is unspecified
// then packet sequence numbers will be used to determine the references // then packet sequence numbers will be used to determine the references
// of the frames. // of the frames.
FrameDecision ManageFrameGeneric(RtpFrameObject* frame, int picture_id) FrameDecision ManageFrameGeneric(RtpFrameObject* frame, int picture_id)
EXCLUSIVE_LOCKS_REQUIRED(crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Find references for Vp8 frames // Find references for Vp8 frames
FrameDecision ManageFrameVp8(RtpFrameObject* frame) FrameDecision ManageFrameVp8(RtpFrameObject* frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Updates necessary layer info state used to determine frame references for // Updates necessary layer info state used to determine frame references for
// Vp8. // Vp8.
void UpdateLayerInfoVp8(RtpFrameObject* frame) void UpdateLayerInfoVp8(RtpFrameObject* frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Find references for Vp9 frames // Find references for Vp9 frames
FrameDecision ManageFrameVp9(RtpFrameObject* frame) 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 // Check if we are missing a frame necessary to determine the references
// for this frame. // for this frame.
bool MissingRequiredFrameVp9(uint16_t picture_id, const GofInfo& info) 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, // Updates which frames that have been received. If there is a gap,
// missing frames will be added to |missing_frames_for_layer_| or // missing frames will be added to |missing_frames_for_layer_| or
// if this is an already missing frame then it will be removed. // if this is an already missing frame then it will be removed.
void FrameReceivedVp9(uint16_t picture_id, GofInfo* info) 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 // 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|. // (|pid_ref|, |picture_id|) with temporal layer smaller than |temporal_idx|.
bool UpSwitchInIntervalVp9(uint16_t picture_id, bool UpSwitchInIntervalVp9(uint16_t picture_id,
uint8_t temporal_idx, 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. // 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. // 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 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be
// around M59). // around M59).
bool Vp9PidTl0Fix(const RtpFrameObject& frame, bool Vp9PidTl0Fix(const RtpFrameObject& frame,
int16_t* picture_id, 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 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be
// around M59). // around M59).
bool DetectVp9PicIdJump(int fixed_pid, bool DetectVp9PicIdJump(int fixed_pid,
int fixed_tl0, int fixed_tl0,
uint32_t timestamp) const 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 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be
// around M59). // around M59).
bool DetectVp9Tl0PicIdxJump(int fixed_tl0, uint32_t timestamp) const 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 // 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 // the sequence number of the last packet of the last completed frame, and
@ -152,36 +154,37 @@ class RtpFrameReferenceFinder {
std::map<uint16_t, std::map<uint16_t,
std::pair<uint16_t, uint16_t>, std::pair<uint16_t, uint16_t>,
DescendingSeqNumComp<uint16_t>> DescendingSeqNumComp<uint16_t>>
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 // Save the last picture id in order to detect when there is a gap in frames
// that have not yet been fully received. // 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 // Padding packets that have been received but that are not yet continuous
// with any group of pictures. // with any group of pictures.
std::set<uint16_t, DescendingSeqNumComp<uint16_t>> stashed_padding_ std::set<uint16_t, DescendingSeqNumComp<uint16_t>> stashed_padding_
GUARDED_BY(crit_); RTC_GUARDED_BY(crit_);
// The last unwrapped picture id. Used to unwrap the picture id from a length // The last unwrapped picture id. Used to unwrap the picture id from a length
// of |kPicIdLength| to 16 bits. // 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 // Frames earlier than the last received frame that have not yet been
// fully received. // fully received.
std::set<uint16_t, DescendingSeqNumComp<uint16_t, kPicIdLength>> std::set<uint16_t, DescendingSeqNumComp<uint16_t, kPicIdLength>>
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 // Frames that have been fully received but didn't have all the information
// needed to determine their references. // needed to determine their references.
std::deque<std::unique_ptr<RtpFrameObject>> stashed_frames_ GUARDED_BY(crit_); std::deque<std::unique_ptr<RtpFrameObject>> stashed_frames_
RTC_GUARDED_BY(crit_);
// Holds the information about the last completed frame for a given temporal // Holds the information about the last completed frame for a given temporal
// layer given a Tl0 picture index. // layer given a Tl0 picture index.
std::map<uint8_t, std::map<uint8_t,
std::array<int16_t, kMaxTemporalLayers>, std::array<int16_t, kMaxTemporalLayers>,
DescendingSeqNumComp<uint8_t>> DescendingSeqNumComp<uint8_t>>
layer_info_ GUARDED_BY(crit_); layer_info_ RTC_GUARDED_BY(crit_);
// Where the current scalability structure is in the // Where the current scalability structure is in the
// |scalability_structures_| array. // |scalability_structures_| array.
@ -189,36 +192,36 @@ class RtpFrameReferenceFinder {
// Holds received scalability structures. // Holds received scalability structures.
std::array<GofInfoVP9, kMaxGofSaved> scalability_structures_ std::array<GofInfoVP9, kMaxGofSaved> scalability_structures_
GUARDED_BY(crit_); RTC_GUARDED_BY(crit_);
// Holds the the Gof information for a given TL0 picture index. // Holds the the Gof information for a given TL0 picture index.
std::map<uint8_t, GofInfo, DescendingSeqNumComp<uint8_t>> gof_info_ std::map<uint8_t, GofInfo, DescendingSeqNumComp<uint8_t>> gof_info_
GUARDED_BY(crit_); RTC_GUARDED_BY(crit_);
// Keep track of which picture id and which temporal layer that had the // Keep track of which picture id and which temporal layer that had the
// up switch flag set. // up switch flag set.
std::map<uint16_t, uint8_t, DescendingSeqNumComp<uint16_t, kPicIdLength>> std::map<uint16_t, uint8_t, DescendingSeqNumComp<uint16_t, kPicIdLength>>
up_switch_ GUARDED_BY(crit_); up_switch_ RTC_GUARDED_BY(crit_);
// For every temporal layer, keep a set of which frames that are missing. // For every temporal layer, keep a set of which frames that are missing.
std::array<std::set<uint16_t, DescendingSeqNumComp<uint16_t, kPicIdLength>>, std::array<std::set<uint16_t, DescendingSeqNumComp<uint16_t, kPicIdLength>>,
kMaxTemporalLayers> 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 // 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 if it contains a packet with a sequence number older than
// |cleared_to_seq_num_|. // |cleared_to_seq_num_|.
int cleared_to_seq_num_ GUARDED_BY(crit_); int cleared_to_seq_num_ RTC_GUARDED_BY(crit_);
OnCompleteFrameCallback* frame_callback_; OnCompleteFrameCallback* frame_callback_;
// Unwrapper used to unwrap generic RTP streams. In a generic stream we derive // Unwrapper used to unwrap generic RTP streams. In a generic stream we derive
// a picture id from the packet sequence number. // a picture id from the packet sequence number.
SeqNumUnwrapper<uint16_t> generic_unwrapper_ GUARDED_BY(crit_); SeqNumUnwrapper<uint16_t> generic_unwrapper_ RTC_GUARDED_BY(crit_);
// Unwrapper used to unwrap VP8/VP9 streams which have their picture id // Unwrapper used to unwrap VP8/VP9 streams which have their picture id
// specified. // specified.
SeqNumUnwrapper<uint16_t, kPicIdLength> unwrapper_ GUARDED_BY(crit_); SeqNumUnwrapper<uint16_t, kPicIdLength> unwrapper_ RTC_GUARDED_BY(crit_);
}; };
} // namespace video_coding } // namespace video_coding

View File

@ -109,38 +109,38 @@ class VCMTiming {
enum { kDelayMaxChangeMsPerS = 100 }; enum { kDelayMaxChangeMsPerS = 100 };
protected: 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 int64_t RenderTimeMsInternal(uint32_t frame_timestamp, int64_t now_ms) const
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
int TargetDelayInternal() const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); int TargetDelayInternal() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
private: private:
void UpdateHistograms() const; void UpdateHistograms() const;
rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
Clock* const clock_; Clock* const clock_;
bool master_ GUARDED_BY(crit_sect_); bool master_ RTC_GUARDED_BY(crit_sect_);
TimestampExtrapolator* ts_extrapolator_ GUARDED_BY(crit_sect_); TimestampExtrapolator* ts_extrapolator_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<VCMCodecTimer> codec_timer_ GUARDED_BY(crit_sect_); std::unique_ptr<VCMCodecTimer> codec_timer_ RTC_GUARDED_BY(crit_sect_);
int render_delay_ms_ GUARDED_BY(crit_sect_); int render_delay_ms_ RTC_GUARDED_BY(crit_sect_);
// Best-effort playout delay range for frames from capture to render. // Best-effort playout delay range for frames from capture to render.
// The receiver tries to keep the delay between |min_playout_delay_ms_| // The receiver tries to keep the delay between |min_playout_delay_ms_|
// and |max_playout_delay_ms_| taking the network jitter into account. // 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, // 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. // in which case the receiver tries to play the frames as they arrive.
int min_playout_delay_ms_ GUARDED_BY(crit_sect_); int min_playout_delay_ms_ RTC_GUARDED_BY(crit_sect_);
int max_playout_delay_ms_ GUARDED_BY(crit_sect_); int max_playout_delay_ms_ RTC_GUARDED_BY(crit_sect_);
int jitter_delay_ms_ GUARDED_BY(crit_sect_); int jitter_delay_ms_ RTC_GUARDED_BY(crit_sect_);
int current_delay_ms_ GUARDED_BY(crit_sect_); int current_delay_ms_ RTC_GUARDED_BY(crit_sect_);
int last_decode_ms_ GUARDED_BY(crit_sect_); int last_decode_ms_ RTC_GUARDED_BY(crit_sect_);
uint32_t prev_frame_timestamp_ GUARDED_BY(crit_sect_); uint32_t prev_frame_timestamp_ RTC_GUARDED_BY(crit_sect_);
rtc::Optional<TimingFrameInfo> timing_frame_info_ GUARDED_BY(crit_sect_); rtc::Optional<TimingFrameInfo> timing_frame_info_ RTC_GUARDED_BY(crit_sect_);
// Statistics. // Statistics.
size_t num_decoded_frames_ GUARDED_BY(crit_sect_); size_t num_decoded_frames_ RTC_GUARDED_BY(crit_sect_);
size_t num_delayed_decoded_frames_ GUARDED_BY(crit_sect_); size_t num_delayed_decoded_frames_ RTC_GUARDED_BY(crit_sect_);
int64_t first_decoded_frame_ms_ GUARDED_BY(crit_sect_); int64_t first_decoded_frame_ms_ RTC_GUARDED_BY(crit_sect_);
uint64_t sum_missed_render_deadline_ms_ GUARDED_BY(crit_sect_); uint64_t sum_missed_render_deadline_ms_ RTC_GUARDED_BY(crit_sect_);
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -71,16 +71,16 @@ class QualityScaler {
void ReportQPHigh(); void ReportQPHigh();
int64_t GetSamplingPeriodMs() const; int64_t GetSamplingPeriodMs() const;
CheckQPTask* check_qp_task_ GUARDED_BY(&task_checker_); CheckQPTask* check_qp_task_ RTC_GUARDED_BY(&task_checker_);
AdaptationObserverInterface* const observer_ GUARDED_BY(&task_checker_); AdaptationObserverInterface* const observer_ RTC_GUARDED_BY(&task_checker_);
rtc::SequencedTaskChecker task_checker_; rtc::SequencedTaskChecker task_checker_;
const int64_t sampling_period_ms_; const int64_t sampling_period_ms_;
bool fast_rampup_ GUARDED_BY(&task_checker_); bool fast_rampup_ RTC_GUARDED_BY(&task_checker_);
MovingAverage average_qp_ GUARDED_BY(&task_checker_); MovingAverage average_qp_ RTC_GUARDED_BY(&task_checker_);
MovingAverage framedrop_percent_ 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 } // namespace webrtc

View File

@ -72,7 +72,7 @@ class EncodedImageCallbackWrapper : public EncodedImageCallback {
private: private:
rtc::CriticalSection cs_; rtc::CriticalSection cs_;
EncodedImageCallback* callback_ GUARDED_BY(cs_); EncodedImageCallback* callback_ RTC_GUARDED_BY(cs_);
}; };
class VideoCodingModuleImpl : public VideoCodingModule { class VideoCodingModuleImpl : public VideoCodingModule {

View File

@ -118,18 +118,18 @@ class VideoSender : public Module {
VideoBitrateAllocator* bitrate_allocator, VideoBitrateAllocator* bitrate_allocator,
uint32_t target_bitrate_bps); uint32_t target_bitrate_bps);
void SetEncoderParameters(EncoderParameters params, bool has_internal_source) void SetEncoderParameters(EncoderParameters params, bool has_internal_source)
EXCLUSIVE_LOCKS_REQUIRED(encoder_crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(encoder_crit_);
Clock* const clock_; Clock* const clock_;
rtc::CriticalSection encoder_crit_; rtc::CriticalSection encoder_crit_;
VCMGenericEncoder* _encoder; VCMGenericEncoder* _encoder;
media_optimization::MediaOptimization _mediaOpt; media_optimization::MediaOptimization _mediaOpt;
VCMEncodedFrameCallback _encodedFrameCallback GUARDED_BY(encoder_crit_); VCMEncodedFrameCallback _encodedFrameCallback RTC_GUARDED_BY(encoder_crit_);
EncodedImageCallback* const post_encode_callback_; EncodedImageCallback* const post_encode_callback_;
VCMSendStatisticsCallback* const send_stats_callback_; VCMSendStatisticsCallback* const send_stats_callback_;
VCMCodecDataBase _codecDataBase GUARDED_BY(encoder_crit_); VCMCodecDataBase _codecDataBase RTC_GUARDED_BY(encoder_crit_);
bool frame_dropper_enabled_ GUARDED_BY(encoder_crit_); bool frame_dropper_enabled_ RTC_GUARDED_BY(encoder_crit_);
VCMProcessTimer _sendStatsTimer; VCMProcessTimer _sendStatsTimer;
// Must be accessed on the construction thread of VideoSender. // Must be accessed on the construction thread of VideoSender.
@ -137,9 +137,9 @@ class VideoSender : public Module {
rtc::SequencedTaskChecker sequenced_checker_; rtc::SequencedTaskChecker sequenced_checker_;
rtc::CriticalSection params_crit_; rtc::CriticalSection params_crit_;
EncoderParameters encoder_params_ GUARDED_BY(params_crit_); EncoderParameters encoder_params_ RTC_GUARDED_BY(params_crit_);
bool encoder_has_internal_source_ GUARDED_BY(params_crit_); bool encoder_has_internal_source_ RTC_GUARDED_BY(params_crit_);
std::vector<FrameType> next_frame_types_ GUARDED_BY(params_crit_); std::vector<FrameType> next_frame_types_ RTC_GUARDED_BY(params_crit_);
}; };
class VideoReceiver : public Module { class VideoReceiver : public Module {
@ -200,7 +200,7 @@ class VideoReceiver : public Module {
protected: protected:
int32_t Decode(const webrtc::VCMEncodedFrame& frame) int32_t Decode(const webrtc::VCMEncodedFrame& frame)
EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); RTC_EXCLUSIVE_LOCKS_REQUIRED(receive_crit_);
int32_t RequestKeyFrame(); int32_t RequestKeyFrame();
private: private:
@ -211,16 +211,18 @@ class VideoReceiver : public Module {
VCMTiming* _timing; VCMTiming* _timing;
VCMReceiver _receiver; VCMReceiver _receiver;
VCMDecodedFrameCallback _decodedFrameCallback; VCMDecodedFrameCallback _decodedFrameCallback;
VCMFrameTypeCallback* _frameTypeCallback GUARDED_BY(process_crit_); VCMFrameTypeCallback* _frameTypeCallback RTC_GUARDED_BY(process_crit_);
VCMReceiveStatisticsCallback* _receiveStatsCallback GUARDED_BY(process_crit_); VCMReceiveStatisticsCallback* _receiveStatsCallback
VCMPacketRequestCallback* _packetRequestCallback GUARDED_BY(process_crit_); RTC_GUARDED_BY(process_crit_);
VCMPacketRequestCallback* _packetRequestCallback
RTC_GUARDED_BY(process_crit_);
VCMFrameBuffer _frameFromFile; VCMFrameBuffer _frameFromFile;
bool _scheduleKeyRequest GUARDED_BY(process_crit_); bool _scheduleKeyRequest RTC_GUARDED_BY(process_crit_);
bool drop_frames_until_keyframe_ GUARDED_BY(process_crit_); bool drop_frames_until_keyframe_ RTC_GUARDED_BY(process_crit_);
size_t max_nack_list_size_ 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_; EncodedImageCallback* pre_decode_image_callback_;
VCMProcessTimer _receiveStatsTimer; VCMProcessTimer _receiveStatsTimer;