From aa01f2766732155c3248db8a9b671dc8707a80b8 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Wed, 30 Jan 2019 11:28:59 +0100 Subject: [PATCH] Removes all const Clock*. This prepares for making the Clock interface fully mutable. Calls to the time functions in Clock can have side effects in some circumstances. It's also questionable if it's a good idea to allow repeated calls to a const method return different values without any changed to the class instance. Bug: webrtc:9883 Change-Id: I96fb9230705f7c80a4c0702132fd9dc73899fc5e Reviewed-on: https://webrtc-review.googlesource.com/c/120347 Commit-Queue: Sebastian Jansson Reviewed-by: Karl Wiberg Reviewed-by: Niels Moller Cr-Commit-Position: refs/heads/master@{#26467} --- call/rtp_transport_controller_send.cc | 4 ++-- call/rtp_transport_controller_send.h | 2 +- modules/audio_coding/acm2/acm_receiver.h | 2 +- modules/bitrate_controller/bitrate_controller_impl.cc | 6 +++--- modules/bitrate_controller/bitrate_controller_impl.h | 4 ++-- modules/bitrate_controller/include/bitrate_controller.h | 4 ++-- .../include/receive_side_congestion_controller.h | 8 +++----- .../include/send_side_congestion_controller.h | 4 ++-- .../receive_side_congestion_controller.cc | 5 ++--- .../send_side_congestion_controller.cc | 2 +- .../congestion_controller/transport_feedback_adapter.cc | 3 +-- .../congestion_controller/transport_feedback_adapter.h | 4 ++-- modules/pacing/paced_sender.cc | 2 +- modules/pacing/paced_sender.h | 4 ++-- .../remote_bitrate_estimator_abs_send_time.cc | 2 +- .../remote_bitrate_estimator_abs_send_time.h | 4 ++-- .../remote_bitrate_estimator_single_stream.cc | 2 +- .../remote_bitrate_estimator_single_stream.h | 4 ++-- .../remote_bitrate_estimator/remote_estimator_proxy.cc | 2 +- modules/remote_bitrate_estimator/remote_estimator_proxy.h | 4 ++-- modules/remote_bitrate_estimator/test/bbr_paced_sender.cc | 2 +- modules/remote_bitrate_estimator/test/bbr_paced_sender.h | 4 ++-- modules/rtp_rtcp/source/rtp_rtcp_impl.h | 4 ++-- modules/video_coding/jitter_estimator.cc | 2 +- modules/video_coding/jitter_estimator.h | 8 ++++---- rtc_base/rate_limiter.cc | 2 +- rtc_base/rate_limiter.h | 4 ++-- test/frame_generator_capturer.h | 1 + test/scenario/network_node.cc | 2 +- test/scenario/network_node.h | 4 ++-- test/scenario/quality_stats.cc | 2 +- test/scenario/quality_stats.h | 6 +++--- 32 files changed, 55 insertions(+), 58 deletions(-) diff --git a/call/rtp_transport_controller_send.cc b/call/rtp_transport_controller_send.cc index 777d7f8061..31e1334e28 100644 --- a/call/rtp_transport_controller_send.cc +++ b/call/rtp_transport_controller_send.cc @@ -35,7 +35,7 @@ constexpr TimeDelta kPacerQueueUpdateInterval = TimeDelta::Millis<25>(); TargetRateConstraints ConvertConstraints(int min_bitrate_bps, int max_bitrate_bps, int start_bitrate_bps, - const Clock* clock) { + Clock* clock) { TargetRateConstraints msg; msg.at_time = Timestamp::ms(clock->TimeInMilliseconds()); msg.min_data_rate = @@ -48,7 +48,7 @@ TargetRateConstraints ConvertConstraints(int min_bitrate_bps, } TargetRateConstraints ConvertConstraints(const BitrateConstraints& contraints, - const Clock* clock) { + Clock* clock) { return ConvertConstraints(contraints.min_bitrate_bps, contraints.max_bitrate_bps, contraints.start_bitrate_bps, clock); diff --git a/call/rtp_transport_controller_send.h b/call/rtp_transport_controller_send.h index deef04028e..c1b576e90e 100644 --- a/call/rtp_transport_controller_send.h +++ b/call/rtp_transport_controller_send.h @@ -133,7 +133,7 @@ class RtpTransportControllerSend final void PostUpdates(NetworkControlUpdate update) RTC_RUN_ON(task_queue_); void UpdateControlState() RTC_RUN_ON(task_queue_); - const Clock* const clock_; + Clock* const clock_; PacketRouter packet_router_; std::vector> video_rtp_senders_; PacedSender pacer_; diff --git a/modules/audio_coding/acm2/acm_receiver.h b/modules/audio_coding/acm2/acm_receiver.h index d3b41c862e..b5cb9a41ea 100644 --- a/modules/audio_coding/acm2/acm_receiver.h +++ b/modules/audio_coding/acm2/acm_receiver.h @@ -201,7 +201,7 @@ class AcmReceiver { std::unique_ptr last_audio_buffer_ RTC_GUARDED_BY(crit_sect_); CallStatistics call_stats_ RTC_GUARDED_BY(crit_sect_); const std::unique_ptr neteq_; // NetEq is thread-safe; no lock needed. - const Clock* const clock_; + Clock* const clock_; bool resampled_last_output_frame_ RTC_GUARDED_BY(crit_sect_); }; diff --git a/modules/bitrate_controller/bitrate_controller_impl.cc b/modules/bitrate_controller/bitrate_controller_impl.cc index 57c85f6f6f..05d967bd1d 100644 --- a/modules/bitrate_controller/bitrate_controller_impl.cc +++ b/modules/bitrate_controller/bitrate_controller_impl.cc @@ -54,19 +54,19 @@ class BitrateControllerImpl::RtcpBandwidthObserverImpl }; BitrateController* BitrateController::CreateBitrateController( - const Clock* clock, + Clock* clock, BitrateObserver* observer, RtcEventLog* event_log) { return new BitrateControllerImpl(clock, observer, event_log); } BitrateController* BitrateController::CreateBitrateController( - const Clock* clock, + Clock* clock, RtcEventLog* event_log) { return CreateBitrateController(clock, nullptr, event_log); } -BitrateControllerImpl::BitrateControllerImpl(const Clock* clock, +BitrateControllerImpl::BitrateControllerImpl(Clock* clock, BitrateObserver* observer, RtcEventLog* event_log) : clock_(clock), diff --git a/modules/bitrate_controller/bitrate_controller_impl.h b/modules/bitrate_controller/bitrate_controller_impl.h index 5448c171b5..28dcc03f99 100644 --- a/modules/bitrate_controller/bitrate_controller_impl.h +++ b/modules/bitrate_controller/bitrate_controller_impl.h @@ -32,7 +32,7 @@ class BitrateControllerImpl : public BitrateController { public: // TODO(perkj): BitrateObserver has been deprecated and is not used in WebRTC. // |observer| is left for project that is not yet updated. - BitrateControllerImpl(const Clock* clock, + BitrateControllerImpl(Clock* clock, BitrateObserver* observer, RtcEventLog* event_log); virtual ~BitrateControllerImpl() {} @@ -83,7 +83,7 @@ class BitrateControllerImpl : public BitrateController { int64_t rtt) RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); // Used by process thread. - const Clock* const clock_; + Clock* const clock_; BitrateObserver* const observer_; int64_t last_bitrate_update_ms_; RtcEventLog* const event_log_; diff --git a/modules/bitrate_controller/include/bitrate_controller.h b/modules/bitrate_controller/include/bitrate_controller.h index 3e11fa76a3..c203d90cae 100644 --- a/modules/bitrate_controller/include/bitrate_controller.h +++ b/modules/bitrate_controller/include/bitrate_controller.h @@ -62,11 +62,11 @@ class BitrateController : public Module, public RtcpBandwidthObserver { // Deprecated: // TODO(perkj): BitrateObserver has been deprecated and is not used in WebRTC. // Remove this method once other other projects does not use it. - static BitrateController* CreateBitrateController(const Clock* clock, + static BitrateController* CreateBitrateController(Clock* clock, BitrateObserver* observer, RtcEventLog* event_log); - static BitrateController* CreateBitrateController(const Clock* clock, + static BitrateController* CreateBitrateController(Clock* clock, RtcEventLog* event_log); ~BitrateController() override {} diff --git a/modules/congestion_controller/include/receive_side_congestion_controller.h b/modules/congestion_controller/include/receive_side_congestion_controller.h index ad5d077bfe..b021618912 100644 --- a/modules/congestion_controller/include/receive_side_congestion_controller.h +++ b/modules/congestion_controller/include/receive_side_congestion_controller.h @@ -30,8 +30,7 @@ class RemoteBitrateObserver; class ReceiveSideCongestionController : public CallStatsObserver, public Module { public: - ReceiveSideCongestionController(const Clock* clock, - PacketRouter* packet_router); + ReceiveSideCongestionController(Clock* clock, PacketRouter* packet_router); ~ReceiveSideCongestionController() override {} @@ -57,8 +56,7 @@ class ReceiveSideCongestionController : public CallStatsObserver, private: class WrappingBitrateEstimator : public RemoteBitrateEstimator { public: - WrappingBitrateEstimator(RemoteBitrateObserver* observer, - const Clock* clock); + WrappingBitrateEstimator(RemoteBitrateObserver* observer, Clock* clock); ~WrappingBitrateEstimator() override; @@ -84,7 +82,7 @@ class ReceiveSideCongestionController : public CallStatsObserver, RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); void PickEstimator() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); RemoteBitrateObserver* observer_; - const Clock* const clock_; + Clock* const clock_; rtc::CriticalSection crit_sect_; std::unique_ptr rbe_; bool using_absolute_send_time_; diff --git a/modules/congestion_controller/include/send_side_congestion_controller.h b/modules/congestion_controller/include/send_side_congestion_controller.h index 545be0edef..30c89dd087 100644 --- a/modules/congestion_controller/include/send_side_congestion_controller.h +++ b/modules/congestion_controller/include/send_side_congestion_controller.h @@ -51,7 +51,7 @@ class DEPRECATED_SendSideCongestionController public: using Observer = NetworkChangedObserver; DEPRECATED_SendSideCongestionController( - const Clock* clock, + Clock* clock, Observer* observer, RtcEventLog* event_log, PacedSender* pacer, @@ -140,7 +140,7 @@ class DEPRECATED_SendSideCongestionController RTC_EXCLUSIVE_LOCKS_REQUIRED(&probe_lock_); const FieldTrialBasedConfig field_trial_config_; const WebRtcKeyValueConfig* const key_value_config_; - const Clock* const clock_; + Clock* const clock_; rtc::CriticalSection observer_lock_; Observer* observer_ RTC_GUARDED_BY(observer_lock_); RtcEventLog* const event_log_; diff --git a/modules/congestion_controller/receive_side_congestion_controller.cc b/modules/congestion_controller/receive_side_congestion_controller.cc index c072e4c1e8..224a49d2f3 100644 --- a/modules/congestion_controller/receive_side_congestion_controller.cc +++ b/modules/congestion_controller/receive_side_congestion_controller.cc @@ -23,8 +23,7 @@ static const uint32_t kTimeOffsetSwitchThreshold = 30; } // namespace ReceiveSideCongestionController::WrappingBitrateEstimator:: - WrappingBitrateEstimator(RemoteBitrateObserver* observer, - const Clock* clock) + WrappingBitrateEstimator(RemoteBitrateObserver* observer, Clock* clock) : observer_(observer), clock_(clock), rbe_(new RemoteBitrateEstimatorSingleStream(observer_, clock_)), @@ -120,7 +119,7 @@ void ReceiveSideCongestionController::WrappingBitrateEstimator:: } ReceiveSideCongestionController::ReceiveSideCongestionController( - const Clock* clock, + Clock* clock, PacketRouter* packet_router) : remote_bitrate_estimator_(packet_router, clock), remote_estimator_proxy_(clock, packet_router) {} diff --git a/modules/congestion_controller/send_side_congestion_controller.cc b/modules/congestion_controller/send_side_congestion_controller.cc index af0b14fc1b..f8b8dba46f 100644 --- a/modules/congestion_controller/send_side_congestion_controller.cc +++ b/modules/congestion_controller/send_side_congestion_controller.cc @@ -84,7 +84,7 @@ bool IsPacerPushbackExperimentEnabled( DEPRECATED_SendSideCongestionController:: DEPRECATED_SendSideCongestionController( - const Clock* clock, + Clock* clock, Observer* observer, RtcEventLog* event_log, PacedSender* pacer, diff --git a/modules/congestion_controller/transport_feedback_adapter.cc b/modules/congestion_controller/transport_feedback_adapter.cc index b58b0a953f..5977fe50e4 100644 --- a/modules/congestion_controller/transport_feedback_adapter.cc +++ b/modules/congestion_controller/transport_feedback_adapter.cc @@ -29,8 +29,7 @@ const int64_t kBaseTimestampScaleFactor = rtcp::TransportFeedback::kDeltaScaleFactor * (1 << 8); const int64_t kBaseTimestampRangeSizeUs = kBaseTimestampScaleFactor * (1 << 24); -LegacyTransportFeedbackAdapter::LegacyTransportFeedbackAdapter( - const Clock* clock) +LegacyTransportFeedbackAdapter::LegacyTransportFeedbackAdapter(Clock* clock) : send_time_history_(kSendTimeHistoryWindowMs), clock_(clock), current_offset_ms_(kNoTimestamp), diff --git a/modules/congestion_controller/transport_feedback_adapter.h b/modules/congestion_controller/transport_feedback_adapter.h index a8318f63e3..8ea5234aa0 100644 --- a/modules/congestion_controller/transport_feedback_adapter.h +++ b/modules/congestion_controller/transport_feedback_adapter.h @@ -33,7 +33,7 @@ class TransportFeedback; // modules/congeestion_controller/rtp/transport_feedback_adapter.h class LegacyTransportFeedbackAdapter { public: - explicit LegacyTransportFeedbackAdapter(const Clock* clock); + explicit LegacyTransportFeedbackAdapter(Clock* clock); virtual ~LegacyTransportFeedbackAdapter(); void RegisterPacketFeedbackObserver(PacketFeedbackObserver* observer); @@ -64,7 +64,7 @@ class LegacyTransportFeedbackAdapter { rtc::CriticalSection lock_; SendTimeHistory send_time_history_ RTC_GUARDED_BY(&lock_); - const Clock* const clock_; + Clock* const clock_; int64_t current_offset_ms_; int64_t last_timestamp_us_; std::vector last_packet_feedback_vector_; diff --git a/modules/pacing/paced_sender.cc b/modules/pacing/paced_sender.cc index 9ab8cdb585..a30aef059e 100644 --- a/modules/pacing/paced_sender.cc +++ b/modules/pacing/paced_sender.cc @@ -42,7 +42,7 @@ namespace webrtc { const int64_t PacedSender::kMaxQueueLengthMs = 2000; const float PacedSender::kDefaultPaceMultiplier = 2.5f; -PacedSender::PacedSender(const Clock* clock, +PacedSender::PacedSender(Clock* clock, PacketSender* packet_sender, RtcEventLog* event_log) : clock_(clock), diff --git a/modules/pacing/paced_sender.h b/modules/pacing/paced_sender.h index 0c7a90cc60..0ca5416c42 100644 --- a/modules/pacing/paced_sender.h +++ b/modules/pacing/paced_sender.h @@ -68,7 +68,7 @@ class PacedSender : public Pacer { // overshoots from the encoder. static const float kDefaultPaceMultiplier; - PacedSender(const Clock* clock, + PacedSender(Clock* clock, PacketSender* packet_sender, RtcEventLog* event_log); @@ -168,7 +168,7 @@ class PacedSender : public Pacer { bool Congested() const RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); int64_t TimeMilliseconds() const RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_); - const Clock* const clock_; + Clock* const clock_; PacketSender* const packet_sender_; std::unique_ptr alr_detector_ RTC_PT_GUARDED_BY(critsect_); diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc index 3f943cc0f8..cb3a01ce0f 100644 --- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc +++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc @@ -90,7 +90,7 @@ void RemoteBitrateEstimatorAbsSendTime::AddCluster(std::list* clusters, RemoteBitrateEstimatorAbsSendTime::RemoteBitrateEstimatorAbsSendTime( RemoteBitrateObserver* observer, - const Clock* clock) + Clock* clock) : clock_(clock), observer_(observer), inter_arrival_(), diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h index aee10caebb..5403fca336 100644 --- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h +++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h @@ -73,7 +73,7 @@ struct Cluster { class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator { public: RemoteBitrateEstimatorAbsSendTime(RemoteBitrateObserver* observer, - const Clock* clock); + Clock* clock); ~RemoteBitrateEstimatorAbsSendTime() override; void IncomingPacket(int64_t arrival_time_ms, @@ -120,7 +120,7 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator { void TimeoutStreams(int64_t now_ms) RTC_EXCLUSIVE_LOCKS_REQUIRED(&crit_); rtc::RaceChecker network_race_; - const Clock* const clock_; + Clock* const clock_; RemoteBitrateObserver* const observer_; std::unique_ptr inter_arrival_; std::unique_ptr estimator_; diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc index a267051944..b3c6786ab9 100644 --- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc +++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc @@ -59,7 +59,7 @@ struct RemoteBitrateEstimatorSingleStream::Detector { RemoteBitrateEstimatorSingleStream::RemoteBitrateEstimatorSingleStream( RemoteBitrateObserver* observer, - const Clock* clock) + Clock* clock) : clock_(clock), incoming_bitrate_(kBitrateWindowMs, 8000), last_valid_incoming_bitrate_(0), diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h index ab542186ca..3f05c45972 100644 --- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h +++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h @@ -32,7 +32,7 @@ struct RTPHeader; class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator { public: RemoteBitrateEstimatorSingleStream(RemoteBitrateObserver* observer, - const Clock* clock); + Clock* clock); ~RemoteBitrateEstimatorSingleStream() override; void IncomingPacket(int64_t arrival_time_ms, @@ -62,7 +62,7 @@ class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator { // otherwise creates it. AimdRateControl* GetRemoteRate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); - const Clock* const clock_; + Clock* const clock_; SsrcOveruseEstimatorMap overuse_detectors_ RTC_GUARDED_BY(crit_sect_); RateStatistics incoming_bitrate_ RTC_GUARDED_BY(crit_sect_); uint32_t last_valid_incoming_bitrate_ RTC_GUARDED_BY(crit_sect_); diff --git a/modules/remote_bitrate_estimator/remote_estimator_proxy.cc b/modules/remote_bitrate_estimator/remote_estimator_proxy.cc index d9745c9f54..9d9d27f7b0 100644 --- a/modules/remote_bitrate_estimator/remote_estimator_proxy.cc +++ b/modules/remote_bitrate_estimator/remote_estimator_proxy.cc @@ -33,7 +33,7 @@ static constexpr int64_t kMaxTimeMs = std::numeric_limits::max() / 1000; RemoteEstimatorProxy::RemoteEstimatorProxy( - const Clock* clock, + Clock* clock, TransportFeedbackSenderInterface* feedback_sender) : clock_(clock), feedback_sender_(feedback_sender), diff --git a/modules/remote_bitrate_estimator/remote_estimator_proxy.h b/modules/remote_bitrate_estimator/remote_estimator_proxy.h index ed4e29b7b6..db41a94d23 100644 --- a/modules/remote_bitrate_estimator/remote_estimator_proxy.h +++ b/modules/remote_bitrate_estimator/remote_estimator_proxy.h @@ -32,7 +32,7 @@ class TransportFeedback; class RemoteEstimatorProxy : public RemoteBitrateEstimator { public: - RemoteEstimatorProxy(const Clock* clock, + RemoteEstimatorProxy(Clock* clock, TransportFeedbackSenderInterface* feedback_sender); ~RemoteEstimatorProxy() override; @@ -58,7 +58,7 @@ class RemoteEstimatorProxy : public RemoteBitrateEstimator { RTC_EXCLUSIVE_LOCKS_REQUIRED(&lock_); bool BuildFeedbackPacket(rtcp::TransportFeedback* feedback_packet); - const Clock* const clock_; + Clock* const clock_; TransportFeedbackSenderInterface* const feedback_sender_; int64_t last_process_time_ms_; diff --git a/modules/remote_bitrate_estimator/test/bbr_paced_sender.cc b/modules/remote_bitrate_estimator/test/bbr_paced_sender.cc index 9b80585773..5ba384be16 100644 --- a/modules/remote_bitrate_estimator/test/bbr_paced_sender.cc +++ b/modules/remote_bitrate_estimator/test/bbr_paced_sender.cc @@ -19,7 +19,7 @@ namespace webrtc { -BbrPacedSender::BbrPacedSender(const Clock* clock, +BbrPacedSender::BbrPacedSender(Clock* clock, PacedSender::PacketSender* packet_sender, RtcEventLog* event_log) : clock_(clock), diff --git a/modules/remote_bitrate_estimator/test/bbr_paced_sender.h b/modules/remote_bitrate_estimator/test/bbr_paced_sender.h index 096f9d61ec..c782fd946d 100644 --- a/modules/remote_bitrate_estimator/test/bbr_paced_sender.h +++ b/modules/remote_bitrate_estimator/test/bbr_paced_sender.h @@ -53,7 +53,7 @@ class RtcEventLog; struct Packet; class BbrPacedSender : public Pacer { public: - BbrPacedSender(const Clock* clock, + BbrPacedSender(Clock* clock, PacedSender::PacketSender* packet_sender, RtcEventLog* event_log); ~BbrPacedSender() override; @@ -75,7 +75,7 @@ class BbrPacedSender : public Pacer { bool TryToSendPacket(Packet* packet); private: - const Clock* const clock_; + Clock* const clock_; PacedSender::PacketSender* const packet_sender_; uint32_t estimated_bitrate_bps_; uint32_t min_send_bitrate_kbps_; diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/modules/rtp_rtcp/source/rtp_rtcp_impl.h index 63e9889375..61adb314b5 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl.h +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.h @@ -323,7 +323,7 @@ class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp { RTCPReceiver* rtcp_receiver() { return &rtcp_receiver_; } const RTCPReceiver* rtcp_receiver() const { return &rtcp_receiver_; } - const Clock* clock() const { return clock_; } + Clock* clock() const { return clock_; } private: FRIEND_TEST_ALL_PREFIXES(RtpRtcpImplTest, Rtt); @@ -339,7 +339,7 @@ class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp { RTCPSender rtcp_sender_; RTCPReceiver rtcp_receiver_; - const Clock* const clock_; + Clock* const clock_; const bool audio_; diff --git a/modules/video_coding/jitter_estimator.cc b/modules/video_coding/jitter_estimator.cc index 00d75da812..424f86a296 100644 --- a/modules/video_coding/jitter_estimator.cc +++ b/modules/video_coding/jitter_estimator.cc @@ -32,7 +32,7 @@ static constexpr int64_t kNackCountTimeoutMs = 60000; static constexpr double kDefaultMaxTimestampDeviationInSigmas = 3.5; } // namespace -VCMJitterEstimator::VCMJitterEstimator(const Clock* clock, +VCMJitterEstimator::VCMJitterEstimator(Clock* clock, int32_t vcmId, int32_t receiverId) : _vcmId(vcmId), diff --git a/modules/video_coding/jitter_estimator.h b/modules/video_coding/jitter_estimator.h index f163f4ca3b..c6500da782 100644 --- a/modules/video_coding/jitter_estimator.h +++ b/modules/video_coding/jitter_estimator.h @@ -20,9 +20,9 @@ class Clock; class VCMJitterEstimator { public: - VCMJitterEstimator(const Clock* clock, - int32_t vcmId = 0, - int32_t receiverId = 0); + explicit VCMJitterEstimator(Clock* clock, + int32_t vcmId = 0, + int32_t receiverId = 0); virtual ~VCMJitterEstimator(); VCMJitterEstimator& operator=(const VCMJitterEstimator& rhs); @@ -158,7 +158,7 @@ class VCMJitterEstimator { rtc::RollingAccumulator fps_counter_; const double time_deviation_upper_bound_; - const Clock* clock_; + Clock* clock_; }; } // namespace webrtc diff --git a/rtc_base/rate_limiter.cc b/rtc_base/rate_limiter.cc index 5c7bdefb0c..7394c3eb89 100644 --- a/rtc_base/rate_limiter.cc +++ b/rtc_base/rate_limiter.cc @@ -17,7 +17,7 @@ namespace webrtc { -RateLimiter::RateLimiter(const Clock* clock, int64_t max_window_ms) +RateLimiter::RateLimiter(Clock* clock, int64_t max_window_ms) : clock_(clock), current_rate_(max_window_ms, RateStatistics::kBpsScale), window_size_ms_(max_window_ms), diff --git a/rtc_base/rate_limiter.h b/rtc_base/rate_limiter.h index 7eaa946568..1c956d788b 100644 --- a/rtc_base/rate_limiter.h +++ b/rtc_base/rate_limiter.h @@ -28,7 +28,7 @@ class Clock; // methods will acquire (the same) lock befeore executing. class RateLimiter { public: - RateLimiter(const Clock* clock, int64_t max_window_ms); + RateLimiter(Clock* clock, int64_t max_window_ms); ~RateLimiter(); // Try to use rate to send bytes. Returns true on success and if so updates @@ -44,7 +44,7 @@ class RateLimiter { bool SetWindowSize(int64_t window_size_ms); private: - const Clock* const clock_; + Clock* const clock_; rtc::CriticalSection lock_; RateStatistics current_rate_ RTC_GUARDED_BY(lock_); int64_t window_size_ms_ RTC_GUARDED_BY(lock_); diff --git a/test/frame_generator_capturer.h b/test/frame_generator_capturer.h index 15fee68f72..79a6d32076 100644 --- a/test/frame_generator_capturer.h +++ b/test/frame_generator_capturer.h @@ -59,6 +59,7 @@ class FrameGeneratorCapturer : public TestVideoCapturer { int frame_repeat_count, int target_fps, Clock* clock); + static FrameGeneratorCapturer* Create( std::unique_ptr frame_generator, int target_fps, diff --git a/test/scenario/network_node.cc b/test/scenario/network_node.cc index 316a46bff6..1f16105c64 100644 --- a/test/scenario/network_node.cc +++ b/test/scenario/network_node.cc @@ -78,7 +78,7 @@ SimulationNode::SimulationNode( simulated_network_(simulation), config_(config) {} -NetworkNodeTransport::NetworkNodeTransport(const Clock* sender_clock, +NetworkNodeTransport::NetworkNodeTransport(Clock* sender_clock, Call* sender_call) : sender_clock_(sender_clock), sender_call_(sender_call) {} diff --git a/test/scenario/network_node.h b/test/scenario/network_node.h index cce1dd9928..bdaf2fe2be 100644 --- a/test/scenario/network_node.h +++ b/test/scenario/network_node.h @@ -66,7 +66,7 @@ class SimulationNode : public EmulatedNetworkNode { class NetworkNodeTransport : public Transport { public: - NetworkNodeTransport(const Clock* sender_clock, Call* sender_call); + NetworkNodeTransport(Clock* sender_clock, Call* sender_call); ~NetworkNodeTransport() override; bool SendRtp(const uint8_t* packet, @@ -85,7 +85,7 @@ class NetworkNodeTransport : public Transport { private: rtc::CriticalSection crit_sect_; - const Clock* const sender_clock_; + Clock* const sender_clock_; Call* const sender_call_; EmulatedNetworkNode* send_net_ RTC_GUARDED_BY(crit_sect_) = nullptr; uint64_t receiver_id_ RTC_GUARDED_BY(crit_sect_) = 0; diff --git a/test/scenario/quality_stats.cc b/test/scenario/quality_stats.cc index 863cf1f36a..3b2bb50050 100644 --- a/test/scenario/quality_stats.cc +++ b/test/scenario/quality_stats.cc @@ -134,7 +134,7 @@ void VideoQualityStats::HandleFrameInfo(VideoFrameQualityInfo sample) { } ForwardingCapturedFrameTap::ForwardingCapturedFrameTap( - const Clock* clock, + Clock* clock, VideoQualityAnalyzer* analyzer, rtc::VideoSourceInterface* source) : clock_(clock), analyzer_(analyzer), source_(source) {} diff --git a/test/scenario/quality_stats.h b/test/scenario/quality_stats.h index 18dc4f75ef..ece995cd6d 100644 --- a/test/scenario/quality_stats.h +++ b/test/scenario/quality_stats.h @@ -41,7 +41,7 @@ class VideoQualityAnalyzer { void OnDecodedFrame(const VideoFrame& frame); void Synchronize(); bool Active() const; - const Clock* clock(); + Clock* clock(); private: int64_t DecodedFrameCaptureTimeOffsetMs(const VideoFrame& decoded) const; @@ -73,7 +73,7 @@ class ForwardingCapturedFrameTap : public rtc::VideoSinkInterface, public rtc::VideoSourceInterface { public: - ForwardingCapturedFrameTap(const Clock* clock, + ForwardingCapturedFrameTap(Clock* clock, VideoQualityAnalyzer* analyzer, rtc::VideoSourceInterface* source); ForwardingCapturedFrameTap(ForwardingCapturedFrameTap&) = delete; @@ -91,7 +91,7 @@ class ForwardingCapturedFrameTap VideoFrame PopFrame(); private: - const Clock* clock_; + Clock* const clock_; VideoQualityAnalyzer* const analyzer_; rtc::VideoSourceInterface* const source_; VideoSinkInterface* sink_;