Remove mutable from rtc::CriticalSection members.

rtc::CriticalSection is now lockable from const methods and no longer
need to remain mutable.

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1613643004

Cr-Commit-Position: refs/heads/master@{#11367}
This commit is contained in:
pbos 2016-01-25 03:52:44 -08:00 committed by Commit bot
parent 7d0d0e0763
commit 5ad935cb56
38 changed files with 49 additions and 49 deletions

View file

@ -278,7 +278,7 @@ class FakeAudioCaptureModule
// Protects variables that are accessed from process_thread_ and // Protects variables that are accessed from process_thread_ and
// the main thread. // the main thread.
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
// Protects |audio_callback_| that is accessed from process_thread_ and // Protects |audio_callback_| that is accessed from process_thread_ and
// the main thread. // the main thread.
rtc::CriticalSection crit_callback_; rtc::CriticalSection crit_callback_;

View file

@ -126,7 +126,7 @@ class FakeAdmTest : public testing::Test,
return min_buffer_size; return min_buffer_size;
} }
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
int push_iterations_; int push_iterations_;
int pull_iterations_; int pull_iterations_;

View file

@ -69,7 +69,7 @@ class CaptureRenderAdapter : public sigslot::has_slots<> {
VideoRenderers video_renderers_; VideoRenderers video_renderers_;
VideoCapturer* video_capturer_; VideoCapturer* video_capturer_;
// Critical section synchronizing the capture thread. // Critical section synchronizing the capture thread.
mutable rtc::CriticalSection capture_crit_; rtc::CriticalSection capture_crit_;
}; };
} // namespace cricket } // namespace cricket

View file

@ -142,7 +142,7 @@ class FakeVideoRenderer : public VideoRenderer {
int height_; int height_;
int num_rendered_frames_; int num_rendered_frames_;
bool black_frame_; bool black_frame_;
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
}; };
} // namespace cricket } // namespace cricket

View file

@ -149,7 +149,7 @@ class FileVideoCapturer::FileReadThread
private: private:
FileVideoCapturer* capturer_; FileVideoCapturer* capturer_;
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
bool finished_; bool finished_;
RTC_DISALLOW_COPY_AND_ASSIGN(FileReadThread); RTC_DISALLOW_COPY_AND_ASSIGN(FileReadThread);

View file

@ -85,7 +85,7 @@ class YuvFramesCapturer::YuvFramesThread
private: private:
YuvFramesCapturer* capturer_; YuvFramesCapturer* capturer_;
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
bool finished_; bool finished_;
RTC_DISALLOW_COPY_AND_ASSIGN(YuvFramesThread); RTC_DISALLOW_COPY_AND_ASSIGN(YuvFramesThread);

View file

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

View file

@ -45,7 +45,7 @@ class BufferQueue {
private: private:
size_t capacity_; size_t capacity_;
size_t default_size_; size_t default_size_;
mutable CriticalSection crit_; CriticalSection crit_;
std::deque<Buffer*> queue_ GUARDED_BY(crit_); std::deque<Buffer*> queue_ GUARDED_BY(crit_);
std::vector<Buffer*> free_list_ GUARDED_BY(crit_); std::vector<Buffer*> free_list_ GUARDED_BY(crit_);

View file

@ -251,7 +251,7 @@ class MessageQueue {
MessageList msgq_; MessageList msgq_;
PriorityQueue dmsgq_; PriorityQueue dmsgq_;
uint32_t dmsgq_next_num_; uint32_t dmsgq_next_num_;
mutable CriticalSection crit_; CriticalSection crit_;
private: private:
RTC_DISALLOW_COPY_AND_ASSIGN(MessageQueue); RTC_DISALLOW_COPY_AND_ASSIGN(MessageQueue);

View file

@ -172,7 +172,7 @@ class PhysicalSocket : public AsyncSocket, public sigslot::has_slots<> {
SOCKET s_; SOCKET s_;
uint8_t enabled_events_; uint8_t enabled_events_;
bool udp_; bool udp_;
mutable CriticalSection crit_; CriticalSection crit_;
int error_ GUARDED_BY(crit_); int error_ GUARDED_BY(crit_);
ConnState state_; ConnState state_;
AsyncResolver* resolver_; AsyncResolver* resolver_;

View file

@ -555,7 +555,7 @@ class FifoBuffer : public StreamInterface {
size_t data_length_; // amount of readable data in the buffer size_t data_length_; // amount of readable data in the buffer
size_t read_position_; // offset to the readable data size_t read_position_; // offset to the readable data
Thread* owner_; // stream callbacks are dispatched on this thread Thread* owner_; // stream callbacks are dispatched on this thread
mutable CriticalSection crit_; // object lock CriticalSection crit_; // object lock
RTC_DISALLOW_COPY_AND_ASSIGN(FifoBuffer); RTC_DISALLOW_COPY_AND_ASSIGN(FifoBuffer);
}; };

View file

@ -37,7 +37,7 @@ class ThreadCheckerImpl {
void DetachFromThread(); void DetachFromThread();
private: private:
mutable CriticalSection lock_; CriticalSection lock_;
// This is mutable so that CalledOnValidThread can set it. // This is mutable so that CalledOnValidThread can set it.
// It's guarded by |lock_|. // It's guarded by |lock_|.
mutable PlatformThreadRef valid_thread_; mutable PlatformThreadRef valid_thread_;

View file

@ -164,7 +164,7 @@ class AtomicBool {
} }
private: private:
mutable CriticalSection cs_; CriticalSection cs_;
bool flag_; bool flag_;
}; };

View file

@ -89,7 +89,7 @@ class BitrateAllocator {
ObserverBitrateMap LowRateAllocation(uint32_t bitrate) ObserverBitrateMap LowRateAllocation(uint32_t bitrate)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
mutable rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
// Stored in a list to keep track of the insertion order. // Stored in a list to keep track of the insertion order.
BitrateObserverConfList bitrate_observers_ GUARDED_BY(crit_sect_); BitrateObserverConfList bitrate_observers_ GUARDED_BY(crit_sect_);
bool bitrate_observers_modified_ GUARDED_BY(crit_sect_); bool bitrate_observers_modified_ GUARDED_BY(crit_sect_);

View file

@ -113,7 +113,7 @@ class SyncRtcpObserver : public test::RtpRtcpObserver {
ntp_rtp_pairs_.push_front(ntp_rtp_pair); ntp_rtp_pairs_.push_front(ntp_rtp_pair);
} }
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
RtcpList ntp_rtp_pairs_ GUARDED_BY(crit_); RtcpList ntp_rtp_pairs_ GUARDED_BY(crit_);
}; };

View file

@ -74,7 +74,7 @@ class CongestionController {
rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_; rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_;
mutable rtc::CriticalSection encoder_crit_; rtc::CriticalSection encoder_crit_;
std::vector<ViEEncoder*> encoders_ GUARDED_BY(encoder_crit_); std::vector<ViEEncoder*> encoders_ GUARDED_BY(encoder_crit_);
// Registered at construct time and assumed to outlive this class. // Registered at construct time and assumed to outlive this class.

View file

@ -77,9 +77,9 @@ class IncomingVideoStream : public VideoRenderCallback {
uint32_t const stream_id_; uint32_t const stream_id_;
const bool disable_prerenderer_smoothing_; const bool disable_prerenderer_smoothing_;
// Critsects in allowed to enter order. // Critsects in allowed to enter order.
mutable rtc::CriticalSection stream_critsect_; rtc::CriticalSection stream_critsect_;
mutable rtc::CriticalSection thread_critsect_; rtc::CriticalSection thread_critsect_;
mutable rtc::CriticalSection buffer_critsect_; rtc::CriticalSection buffer_critsect_;
// TODO(pbos): Make plain member and stop resetting this thread, just // TODO(pbos): Make plain member and stop resetting this thread, just
// start/stoping it is enough. // start/stoping it is enough.
rtc::scoped_ptr<rtc::PlatformThread> incoming_render_thread_ rtc::scoped_ptr<rtc::PlatformThread> incoming_render_thread_

View file

@ -281,7 +281,7 @@ class AcmReceiver {
uint32_t NowInTimestamp(int decoder_sampling_rate) const; uint32_t NowInTimestamp(int decoder_sampling_rate) const;
mutable rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
int id_; // TODO(henrik.lundin) Make const. int id_; // TODO(henrik.lundin) Make const.
const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_); const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_);
AudioFrame::VADActivity previous_audio_activity_ GUARDED_BY(crit_sect_); AudioFrame::VADActivity previous_audio_activity_ GUARDED_BY(crit_sect_);

View file

@ -240,7 +240,7 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
// to |index|. // to |index|.
int UpdateUponReceivingCodec(int index); int UpdateUponReceivingCodec(int index);
mutable rtc::CriticalSection acm_crit_sect_; rtc::CriticalSection acm_crit_sect_;
rtc::Buffer encode_buffer_ GUARDED_BY(acm_crit_sect_); rtc::Buffer encode_buffer_ 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_ GUARDED_BY(acm_crit_sect_);
@ -274,7 +274,7 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_); uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_);
uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_); uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_);
mutable rtc::CriticalSection callback_crit_sect_; rtc::CriticalSection callback_crit_sect_;
AudioPacketizationCallback* packetization_callback_ AudioPacketizationCallback* packetization_callback_
GUARDED_BY(callback_crit_sect_); GUARDED_BY(callback_crit_sect_);
ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_); ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_);

View file

@ -147,7 +147,7 @@ class PacketizationCallbackStubOldApi : public AudioPacketizationCallback {
int last_payload_type_ GUARDED_BY(crit_sect_); int last_payload_type_ GUARDED_BY(crit_sect_);
uint32_t last_timestamp_ GUARDED_BY(crit_sect_); uint32_t last_timestamp_ GUARDED_BY(crit_sect_);
std::vector<uint8_t> last_payload_vec_ GUARDED_BY(crit_sect_); std::vector<uint8_t> last_payload_vec_ GUARDED_BY(crit_sect_);
mutable rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
}; };
class AudioCodingModuleTestOldApi : public ::testing::Test { class AudioCodingModuleTestOldApi : public ::testing::Test {
@ -579,7 +579,7 @@ class AudioCodingModuleMtTestOldApi : public AudioCodingModuleTestOldApi {
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_ GUARDED_BY(crit_sect_);
mutable 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_ GUARDED_BY(crit_sect_);
rtc::scoped_ptr<SimulatedClock> fake_clock_; rtc::scoped_ptr<SimulatedClock> fake_clock_;
}; };
@ -842,7 +842,7 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
rtc::PlatformThread receive_thread_; rtc::PlatformThread receive_thread_;
rtc::PlatformThread codec_registration_thread_; rtc::PlatformThread codec_registration_thread_;
const rtc::scoped_ptr<EventWrapper> test_complete_; const rtc::scoped_ptr<EventWrapper> test_complete_;
mutable rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
bool codec_registered_ GUARDED_BY(crit_sect_); bool codec_registered_ GUARDED_BY(crit_sect_);
int receive_packet_count_ GUARDED_BY(crit_sect_); int receive_packet_count_ GUARDED_BY(crit_sect_);
int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_); int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);

View file

@ -36,7 +36,7 @@ class LockedIsacBandwidthInfo final {
} }
private: private:
mutable rtc::CriticalSection lock_; rtc::CriticalSection lock_;
IsacBandwidthInfo bwinfo_ GUARDED_BY(lock_); IsacBandwidthInfo bwinfo_ GUARDED_BY(lock_);
}; };

View file

@ -338,7 +338,7 @@ class NetEqImpl : public webrtc::NetEq {
// 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() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
mutable rtc::CriticalSection crit_sect_; rtc::CriticalSection crit_sect_;
const rtc::scoped_ptr<BufferLevelFilter> buffer_level_filter_ const rtc::scoped_ptr<BufferLevelFilter> buffer_level_filter_
GUARDED_BY(crit_sect_); GUARDED_BY(crit_sect_);
const rtc::scoped_ptr<DecoderDatabase> decoder_database_ const rtc::scoped_ptr<DecoderDatabase> decoder_database_

View file

@ -100,7 +100,7 @@ class Channel : public AudioPacketizationCallback {
// 60msec * 32 sample(max)/msec * 2 description (maybe) * 2 bytes/sample // 60msec * 32 sample(max)/msec * 2 description (maybe) * 2 bytes/sample
uint8_t _payloadData[60 * 32 * 2 * 2]; uint8_t _payloadData[60 * 32 * 2 * 2];
mutable rtc::CriticalSection _channelCritSect; rtc::CriticalSection _channelCritSect;
FILE* _bitStreamFile; FILE* _bitStreamFile;
bool _saveBitStream; bool _saveBitStream;
int16_t _lastPayloadType; int16_t _lastPayloadType;

View file

@ -239,15 +239,15 @@ class AudioProcessingImpl : public AudioProcessing {
EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
// Critical section. // Critical section.
mutable rtc::CriticalSection crit_debug_; rtc::CriticalSection crit_debug_;
// Debug dump state. // Debug dump state.
ApmDebugDumpState debug_dump_; ApmDebugDumpState debug_dump_;
#endif #endif
// Critical sections. // Critical sections.
mutable rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_); rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_);
mutable rtc::CriticalSection crit_capture_; rtc::CriticalSection crit_capture_;
// Structs containing the pointers to the submodules. // Structs containing the pointers to the submodules.
rtc::scoped_ptr<ApmPublicSubmodules> public_submodules_; rtc::scoped_ptr<ApmPublicSubmodules> public_submodules_;

View file

@ -298,7 +298,7 @@ class FrameCounters {
} }
private: private:
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
int render_count GUARDED_BY(crit_) = 0; int render_count GUARDED_BY(crit_) = 0;
int capture_count GUARDED_BY(crit_) = 0; int capture_count GUARDED_BY(crit_) = 0;
}; };

View file

@ -202,7 +202,7 @@ class FrameCounters {
} }
private: private:
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
int render_count_ GUARDED_BY(crit_) = 0; int render_count_ GUARDED_BY(crit_) = 0;
int capture_count_ GUARDED_BY(crit_) = 0; int capture_count_ GUARDED_BY(crit_) = 0;
}; };
@ -221,7 +221,7 @@ class LockedFlag {
} }
private: private:
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
bool flag_ GUARDED_BY(crit_) = false; bool flag_ GUARDED_BY(crit_) = false;
}; };

View file

@ -74,7 +74,7 @@ class BitrateControllerImpl : public BitrateController {
BitrateObserver* observer_; BitrateObserver* observer_;
int64_t last_bitrate_update_ms_; int64_t last_bitrate_update_ms_;
mutable rtc::CriticalSection critsect_; rtc::CriticalSection critsect_;
SendSideBandwidthEstimation bandwidth_estimation_ GUARDED_BY(critsect_); SendSideBandwidthEstimation bandwidth_estimation_ GUARDED_BY(critsect_);
uint32_t reserved_bitrate_bps_ GUARDED_BY(critsect_); uint32_t reserved_bitrate_bps_ GUARDED_BY(critsect_);

View file

@ -9,8 +9,8 @@
* *
*/ */
#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_FRAME_BUFFER_POOL_H_ #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_FRAME_BUFFER_POOL_H_
#define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_FRAME_BUFFER_POOL_H_ #define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_FRAME_BUFFER_POOL_H_
#include <vector> #include <vector>
@ -103,7 +103,7 @@ class Vp9FrameBufferPool {
private: private:
// Protects |allocated_buffers_|. // Protects |allocated_buffers_|.
mutable 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_); GUARDED_BY(buffers_lock_);
@ -114,4 +114,4 @@ class Vp9FrameBufferPool {
} // namespace webrtc } // namespace webrtc
#endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_FRAME_BUFFER_POOL_H_ #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_FRAME_BUFFER_POOL_H_

View file

@ -138,7 +138,7 @@ class VCMGenericEncoder {
VideoEncoderRateObserver* const rate_observer_; VideoEncoderRateObserver* const rate_observer_;
VCMEncodedFrameCallback* const vcm_encoded_frame_callback_; VCMEncodedFrameCallback* const vcm_encoded_frame_callback_;
const bool internal_source_; const bool internal_source_;
mutable rtc::CriticalSection params_lock_; rtc::CriticalSection params_lock_;
EncoderParameters encoder_params_ GUARDED_BY(params_lock_); EncoderParameters encoder_params_ GUARDED_BY(params_lock_);
VideoRotation rotation_; VideoRotation rotation_;
bool is_screenshare_; bool is_screenshare_;

View file

@ -104,7 +104,7 @@ class VideoSender {
Clock* const clock_; Clock* const clock_;
rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_; rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_;
mutable rtc::CriticalSection encoder_crit_; rtc::CriticalSection encoder_crit_;
VCMGenericEncoder* _encoder; VCMGenericEncoder* _encoder;
VCMEncodedFrameCallback _encodedFrameCallback GUARDED_BY(encoder_crit_); VCMEncodedFrameCallback _encodedFrameCallback GUARDED_BY(encoder_crit_);
media_optimization::MediaOptimization _mediaOpt; media_optimization::MediaOptimization _mediaOpt;

View file

@ -44,7 +44,7 @@ class VideoProcessingImpl : public VideoProcessing {
VideoContentMetrics* GetContentMetrics() const override; VideoContentMetrics* GetContentMetrics() const override;
private: private:
mutable rtc::CriticalSection mutex_; rtc::CriticalSection mutex_;
VPMDeflickering deflickering_ GUARDED_BY(mutex_); VPMDeflickering deflickering_ GUARDED_BY(mutex_);
VPMBrightnessDetection brightness_detection_; VPMBrightnessDetection brightness_detection_;
VPMFramePreprocessor frame_pre_processor_; VPMFramePreprocessor frame_pre_processor_;

View file

@ -179,7 +179,7 @@ class WindowsRealTimeClock : public RealTimeClock {
} }
// mutable as time-accessing functions are const. // mutable as time-accessing functions are const.
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
mutable DWORD last_time_ms_; mutable DWORD last_time_ms_;
mutable LONG num_timer_wraps_; mutable LONG num_timer_wraps_;
const ReferencePoint ref_point_; const ReferencePoint ref_point_;

View file

@ -58,7 +58,7 @@ class FakeAudioDevice : public FakeAudioDeviceModule {
Clock* clock_; Clock* clock_;
rtc::scoped_ptr<EventTimerWrapper> tick_; rtc::scoped_ptr<EventTimerWrapper> tick_;
mutable rtc::CriticalSection lock_; rtc::CriticalSection lock_;
rtc::PlatformThread thread_; rtc::PlatformThread thread_;
rtc::scoped_ptr<ModuleFileUtility> file_utility_; rtc::scoped_ptr<ModuleFileUtility> file_utility_;
rtc::scoped_ptr<FileWrapper> input_stream_; rtc::scoped_ptr<FileWrapper> input_stream_;

View file

@ -71,7 +71,7 @@ class FakeNetworkPipe {
private: private:
Clock* const clock_; Clock* const clock_;
mutable rtc::CriticalSection lock_; rtc::CriticalSection lock_;
PacketReceiver* packet_receiver_; PacketReceiver* packet_receiver_;
std::queue<NetworkPacket*> capacity_link_; std::queue<NetworkPacket*> capacity_link_;
std::queue<NetworkPacket*> delay_link_; std::queue<NetworkPacket*> delay_link_;

View file

@ -119,7 +119,7 @@ class OveruseFrameDetector : public Module {
// processing thread. // processing thread.
// TODO(asapersson): See if we can reduce locking. As is, video frame // TODO(asapersson): See if we can reduce locking. As is, video frame
// processing contends with reading stats and the processing thread. // processing contends with reading stats and the processing thread.
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
const CpuOveruseOptions options_; const CpuOveruseOptions options_;

View file

@ -95,7 +95,7 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
Clock* const clock_; Clock* const clock_;
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
VideoReceiveStream::Stats stats_ GUARDED_BY(crit_); VideoReceiveStream::Stats stats_ GUARDED_BY(crit_);
RateStatistics decode_fps_estimator_ GUARDED_BY(crit_); RateStatistics decode_fps_estimator_ GUARDED_BY(crit_);
RateStatistics renders_fps_estimator_ GUARDED_BY(crit_); RateStatistics renders_fps_estimator_ GUARDED_BY(crit_);

View file

@ -131,7 +131,7 @@ class SendStatisticsProxy : public CpuOveruseMetricsObserver,
Clock* const clock_; Clock* const clock_;
const VideoSendStream::Config config_; const VideoSendStream::Config config_;
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
VideoEncoderConfig::ContentType content_type_ GUARDED_BY(crit_); VideoEncoderConfig::ContentType content_type_ GUARDED_BY(crit_);
VideoSendStream::Stats stats_ GUARDED_BY(crit_); VideoSendStream::Stats stats_ GUARDED_BY(crit_);
uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_); uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_);

View file

@ -1079,7 +1079,7 @@ TEST_F(VideoSendStreamTest, CanReconfigureToUseStartBitrateAbovePreviousMax) {
} }
private: private:
mutable rtc::CriticalSection crit_; rtc::CriticalSection crit_;
int start_bitrate_kbps_ GUARDED_BY(crit_); int start_bitrate_kbps_ GUARDED_BY(crit_);
}; };