diff --git a/call/BUILD.gn b/call/BUILD.gn index 04b5e50588..d542f4b5b4 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -86,7 +86,7 @@ rtc_source_set("audio_sender_interface") { } # TODO(nisse): These RTP targets should be moved elsewhere -# when interfaces have stabilized. See also TODO for |mock_rtp_interfaces|. +# when interfaces have stabilized. See also TODO for `mock_rtp_interfaces`. rtc_library("rtp_interfaces") { # Client code SHOULD NOT USE THIS TARGET, but for now it needs to be public # because there exists client code that uses it. @@ -558,7 +558,7 @@ if (rtc_include_tests) { } } - # TODO(eladalon): This should be moved, as with the TODO for |rtp_interfaces|. + # TODO(eladalon): This should be moved, as with the TODO for `rtp_interfaces`. rtc_source_set("mock_rtp_interfaces") { testonly = true diff --git a/call/adaptation/resource_adaptation_processor.cc b/call/adaptation/resource_adaptation_processor.cc index 741575ae38..3c06675a16 100644 --- a/call/adaptation/resource_adaptation_processor.cc +++ b/call/adaptation/resource_adaptation_processor.cc @@ -200,7 +200,7 @@ void ResourceAdaptationProcessor::OnResourceUsageStateMeasured( ResourceUsageState usage_state) { RTC_DCHECK_RUN_ON(task_queue_); RTC_DCHECK(resource); - // |resource| could have been removed after signalling. + // `resource` could have been removed after signalling. { MutexLock crit(&resources_lock_); if (absl::c_find(resources_, resource) == resources_.end()) { @@ -261,7 +261,7 @@ ResourceAdaptationProcessor::OnResourceUnderuse( if (!most_limited_resources.empty() && most_limited_restrictions.counters.Total() >= stream_adapter_->adaptation_counters().Total()) { - // If |reason_resource| is not one of the most limiting resources then abort + // If `reason_resource` is not one of the most limiting resources then abort // adaptation. if (absl::c_find(most_limited_resources, reason_resource) == most_limited_resources.end()) { diff --git a/call/adaptation/resource_adaptation_processor.h b/call/adaptation/resource_adaptation_processor.h index c84d359fec..3e273081f8 100644 --- a/call/adaptation/resource_adaptation_processor.h +++ b/call/adaptation/resource_adaptation_processor.h @@ -129,7 +129,7 @@ class ResourceAdaptationProcessor : public ResourceAdaptationProcessorInterface, const VideoAdaptationCounters& counters) RTC_RUN_ON(task_queue_); - // Searches |adaptation_limits_by_resources_| for each resource with the + // Searches `adaptation_limits_by_resources_` for each resource with the // highest total adaptation counts. Adaptation up may only occur if the // resource performing the adaptation is the only most limited resource. This // function returns the list of all most limited resources as well as the diff --git a/call/adaptation/resource_adaptation_processor_unittest.cc b/call/adaptation/resource_adaptation_processor_unittest.cc index 5e4f44b221..7020b22daf 100644 --- a/call/adaptation/resource_adaptation_processor_unittest.cc +++ b/call/adaptation/resource_adaptation_processor_unittest.cc @@ -290,7 +290,7 @@ TEST_F(ResourceAdaptationProcessorTest, OnlyMostLimitedResourceMayAdaptUp) { EXPECT_EQ(2, restrictions_listener_.adaptation_counters().Total()); RestrictSource(restrictions_listener_.restrictions()); - // |other_resource_| is most limited, resource_ can't adapt up. + // `other_resource_` is most limited, resource_ can't adapt up. resource_->SetUsageState(ResourceUsageState::kUnderuse); EXPECT_EQ(2, restrictions_listener_.adaptation_counters().Total()); RestrictSource(restrictions_listener_.restrictions()); @@ -298,7 +298,7 @@ TEST_F(ResourceAdaptationProcessorTest, OnlyMostLimitedResourceMayAdaptUp) { EXPECT_EQ(1, restrictions_listener_.adaptation_counters().Total()); RestrictSource(restrictions_listener_.restrictions()); - // |resource_| and |other_resource_| are now most limited, so both must + // `resource_` and `other_resource_` are now most limited, so both must // signal underuse to adapt up. other_resource_->SetUsageState(ResourceUsageState::kUnderuse); EXPECT_EQ(1, restrictions_listener_.adaptation_counters().Total()); @@ -440,7 +440,7 @@ TEST_F(ResourceAdaptationProcessorTest, DegradationPreference::MAINTAIN_FRAMERATE); SetInputStates(true, kDefaultFrameRate, kDefaultFrameSize); - // Wait for |resource_| to signal oversue first so we know that the delegate + // Wait for `resource_` to signal oversue first so we know that the delegate // has passed it on to the processor's task queue. rtc::Event resource_event; TaskQueueForTest resource_task_queue("ResourceTaskQueue"); @@ -466,24 +466,24 @@ TEST_F(ResourceAdaptationProcessorTest, rtc::Event overuse_event; TaskQueueForTest resource_task_queue("ResourceTaskQueue"); - // Queues task for |resource_| overuse while |processor_| is still listening. + // Queues task for `resource_` overuse while `processor_` is still listening. resource_task_queue.PostTask(ToQueuedTask([&]() { resource_->SetUsageState(ResourceUsageState::kOveruse); overuse_event.Set(); })); EXPECT_TRUE(overuse_event.Wait(kDefaultTimeoutMs)); - // Once we know the overuse task is queued, remove |resource_| so that - // |processor_| is not listening to it. + // Once we know the overuse task is queued, remove `resource_` so that + // `processor_` is not listening to it. processor_->RemoveResource(resource_); - // Runs the queued task so |processor_| gets signalled kOveruse from - // |resource_| even though |processor_| was not listening. + // Runs the queued task so `processor_` gets signalled kOveruse from + // `resource_` even though `processor_` was not listening. WaitUntilTaskQueueIdle(); - // No restrictions should change even though |resource_| signaled |kOveruse|. + // No restrictions should change even though `resource_` signaled `kOveruse`. EXPECT_EQ(0u, restrictions_listener_.restrictions_updated_count()); - // Delete |resource_| for cleanup. + // Delete `resource_` for cleanup. resource_ = nullptr; } @@ -500,7 +500,7 @@ TEST_F(ResourceAdaptationProcessorTest, processor_->RemoveResource(resource_); EXPECT_EQ(0, restrictions_listener_.adaptation_counters().Total()); - // Delete |resource_| for cleanup. + // Delete `resource_` for cleanup. resource_ = nullptr; } @@ -522,14 +522,14 @@ TEST_F(ResourceAdaptationProcessorTest, RestrictSource(restrictions_listener_.restrictions()); EXPECT_EQ(2, restrictions_listener_.adaptation_counters().Total()); - // Removing most limited |resource_| should revert us back to + // Removing most limited `resource_` should revert us back to processor_->RemoveResource(resource_); EXPECT_EQ(1, restrictions_listener_.adaptation_counters().Total()); EXPECT_EQ(next_limited_restrictions, restrictions_listener_.restrictions()); EXPECT_EQ(next_limited_counters, restrictions_listener_.adaptation_counters()); - // Delete |resource_| for cleanup. + // Delete `resource_` for cleanup. resource_ = nullptr; } @@ -556,8 +556,8 @@ TEST_F(ResourceAdaptationProcessorTest, resource_->SetUsageState(ResourceUsageState::kUnderuse); EXPECT_EQ(2, restrictions_listener_.adaptation_counters().Total()); - // Removing most limited |resource_| should revert us back to, even though we - // did not call RestrictSource() after |resource_| was overused. Normally + // Removing most limited `resource_` should revert us back to, even though we + // did not call RestrictSource() after `resource_` was overused. Normally // adaptation for MAINTAIN_FRAMERATE would be blocked here but for removal we // allow this anyways. processor_->RemoveResource(resource_); @@ -566,7 +566,7 @@ TEST_F(ResourceAdaptationProcessorTest, EXPECT_EQ(next_limited_counters, restrictions_listener_.adaptation_counters()); - // Delete |resource_| for cleanup. + // Delete `resource_` for cleanup. resource_ = nullptr; } @@ -588,12 +588,12 @@ TEST_F(ResourceAdaptationProcessorTest, restrictions_listener_.adaptation_counters(); EXPECT_EQ(2, restrictions_listener_.adaptation_counters().Total()); - // Removing most limited |resource_| should revert us back to + // Removing most limited `resource_` should revert us back to processor_->RemoveResource(other_resource_); EXPECT_EQ(current_restrictions, restrictions_listener_.restrictions()); EXPECT_EQ(current_counters, restrictions_listener_.adaptation_counters()); - // Delete |other_resource_| for cleanup. + // Delete `other_resource_` for cleanup. other_resource_ = nullptr; } @@ -617,7 +617,7 @@ TEST_F(ResourceAdaptationProcessorTest, RestrictSource(restrictions_listener_.restrictions()); EXPECT_EQ(2, restrictions_listener_.adaptation_counters().Total()); - // Revert to |other_resource_| when removing |resource_| even though the + // Revert to `other_resource_` when removing `resource_` even though the // degradation preference was different when it was overused. processor_->RemoveResource(resource_); EXPECT_EQ(next_limited_counters, @@ -629,7 +629,7 @@ TEST_F(ResourceAdaptationProcessorTest, DegradationPreference::MAINTAIN_FRAMERATE); EXPECT_EQ(next_limited_restrictions, restrictions_listener_.restrictions()); - // Delete |resource_| for cleanup. + // Delete `resource_` for cleanup. resource_ = nullptr; } @@ -653,7 +653,7 @@ TEST_F(ResourceAdaptationProcessorTest, video_stream_adapter_->SetDegradationPreference( DegradationPreference::DISABLED); - // Revert to |other_resource_| when removing |resource_| even though the + // Revert to `other_resource_` when removing `resource_` even though the // current degradataion preference is disabled. processor_->RemoveResource(resource_); @@ -665,7 +665,7 @@ TEST_F(ResourceAdaptationProcessorTest, EXPECT_EQ(next_limited_counters, restrictions_listener_.adaptation_counters()); - // Delete |resource_| for cleanup. + // Delete `resource_` for cleanup. resource_ = nullptr; } @@ -679,7 +679,7 @@ TEST_F(ResourceAdaptationProcessorTest, resource_->SetUsageState(ResourceUsageState::kOveruse); EXPECT_EQ(0u, restrictions_listener_.restrictions_updated_count()); - // Delete |resource_| for cleanup. + // Delete `resource_` for cleanup. resource_ = nullptr; } @@ -692,7 +692,7 @@ TEST_F(ResourceAdaptationProcessorTest, other_resource_->SetUsageState(ResourceUsageState::kOveruse); RestrictSource(restrictions_listener_.restrictions()); EXPECT_EQ(1, restrictions_listener_.adaptation_counters().Total()); - // Adapt |resource_| up and then down so that both resource's are most + // Adapt `resource_` up and then down so that both resource's are most // limited at 1 adaptation. resource_->SetUsageState(ResourceUsageState::kOveruse); RestrictSource(restrictions_listener_.restrictions()); @@ -700,12 +700,12 @@ TEST_F(ResourceAdaptationProcessorTest, RestrictSource(restrictions_listener_.restrictions()); EXPECT_EQ(1, restrictions_listener_.adaptation_counters().Total()); - // Removing |resource_| has no effect since both |resource_| and - // |other_resource_| are most limited. + // Removing `resource_` has no effect since both `resource_` and + // `other_resource_` are most limited. processor_->RemoveResource(resource_); EXPECT_EQ(1, restrictions_listener_.adaptation_counters().Total()); - // Delete |resource_| for cleanup. + // Delete `resource_` for cleanup. resource_ = nullptr; } @@ -727,8 +727,8 @@ TEST_F(ResourceAdaptationProcessorTest, EXPECT_TRUE(has_reached_min_pixels); auto last_update_count = restrictions_listener_.restrictions_updated_count(); other_resource_->SetUsageState(ResourceUsageState::kOveruse); - // Now both |resource_| and |other_resource_| are most limited. Underuse of - // |resource_| will not adapt up. + // Now both `resource_` and `other_resource_` are most limited. Underuse of + // `resource_` will not adapt up. resource_->SetUsageState(ResourceUsageState::kUnderuse); EXPECT_EQ(last_update_count, restrictions_listener_.restrictions_updated_count()); diff --git a/call/adaptation/video_source_restrictions.h b/call/adaptation/video_source_restrictions.h index 7f79a48e5d..004cc09055 100644 --- a/call/adaptation/video_source_restrictions.h +++ b/call/adaptation/video_source_restrictions.h @@ -61,8 +61,8 @@ class VideoSourceRestrictions { void set_max_frame_rate(absl::optional max_frame_rate); private: - // These map to rtc::VideoSinkWants's |max_pixel_count| and - // |target_pixel_count|. + // These map to rtc::VideoSinkWants's `max_pixel_count` and + // `target_pixel_count`. absl::optional max_pixels_per_frame_; absl::optional target_pixels_per_frame_; absl::optional max_frame_rate_; diff --git a/call/adaptation/video_stream_adapter.cc b/call/adaptation/video_stream_adapter.cc index 64e1a77786..49a4d6a1ce 100644 --- a/call/adaptation/video_stream_adapter.cc +++ b/call/adaptation/video_stream_adapter.cc @@ -640,7 +640,7 @@ VideoStreamAdapter::GetAdaptDownResolutionStepForBalanced( return first_step; } // We didn't decrease resolution so force it; amend a resolution resuction - // to the existing framerate reduction in |first_restrictions|. + // to the existing framerate reduction in `first_restrictions`. auto second_step = DecreaseResolution(input_state, first_restrictions); if (absl::holds_alternative(second_step)) { return second_step; diff --git a/call/adaptation/video_stream_adapter.h b/call/adaptation/video_stream_adapter.h index 3c876b8970..7bf424a17e 100644 --- a/call/adaptation/video_stream_adapter.h +++ b/call/adaptation/video_stream_adapter.h @@ -39,8 +39,8 @@ class VideoSourceRestrictionsListener { public: virtual ~VideoSourceRestrictionsListener(); - // The |restrictions| are filtered by degradation preference but not the - // |adaptation_counters|, which are currently only reported for legacy stats + // The `restrictions` are filtered by degradation preference but not the + // `adaptation_counters`, which are currently only reported for legacy stats // calculation purposes. virtual void OnVideoSourceRestrictionsUpdated( VideoSourceRestrictions restrictions, diff --git a/call/bitrate_allocator.cc b/call/bitrate_allocator.cc index 8e2006defa..1693661ef5 100644 --- a/call/bitrate_allocator.cc +++ b/call/bitrate_allocator.cc @@ -70,9 +70,9 @@ bool EnoughBitrateForAllObservers( return true; } -// Splits |bitrate| evenly to observers already in |allocation|. -// |include_zero_allocations| decides if zero allocations should be part of -// the distribution or not. The allowed max bitrate is |max_multiplier| x +// Splits `bitrate` evenly to observers already in `allocation`. +// `include_zero_allocations` decides if zero allocations should be part of +// the distribution or not. The allowed max bitrate is `max_multiplier` x // observer max bitrate. void DistributeBitrateEvenly( const std::vector& allocatable_tracks, @@ -110,7 +110,7 @@ void DistributeBitrateEvenly( } } -// From the available |bitrate|, each observer will be allocated a +// From the available `bitrate`, each observer will be allocated a // proportional amount based upon its bitrate priority. If that amount is // more than the observer's capacity, it will be allocated its capacity, and // the excess bitrate is still allocated proportionally to other observers. diff --git a/call/bitrate_allocator.h b/call/bitrate_allocator.h index c0d664b6f0..204fc6f94d 100644 --- a/call/bitrate_allocator.h +++ b/call/bitrate_allocator.h @@ -53,9 +53,9 @@ struct MediaStreamAllocationConfig { uint32_t pad_up_bitrate_bps; int64_t priority_bitrate_bps; // True means track may not be paused by allocating 0 bitrate will allocate at - // least |min_bitrate_bps| for this observer, even if the BWE is too low, + // least `min_bitrate_bps` for this observer, even if the BWE is too low, // false will allocate 0 to the observer if BWE doesn't allow - // |min_bitrate_bps|. + // `min_bitrate_bps`. bool enforce_min_bitrate; // The amount of bitrate allocated to this observer relative to all other // observers. If an observer has twice the bitrate_priority of other @@ -119,12 +119,12 @@ class BitrateAllocator : public BitrateAllocatorInterface { void OnNetworkEstimateChanged(TargetTransferRate msg); // Set the configuration used by the bandwidth management. - // |observer| updates bitrates if already in use. - // |config| is the configuration to use for allocation. - // Note that |observer|->OnBitrateUpdated() will be called + // `observer` updates bitrates if already in use. + // `config` is the configuration to use for allocation. + // Note that `observer`->OnBitrateUpdated() will be called // within the scope of this method with the current rtt, fraction_loss and // available bitrate and that the bitrate in OnBitrateUpdated will be zero if - // the |observer| is currently not allowed to send data. + // the `observer` is currently not allowed to send data. void AddObserver(BitrateAllocatorObserver* observer, MediaStreamAllocationConfig config) override; @@ -132,7 +132,7 @@ class BitrateAllocator : public BitrateAllocatorInterface { // allocation. void RemoveObserver(BitrateAllocatorObserver* observer) override; - // Returns initial bitrate allocated for |observer|. If |observer| is not in + // Returns initial bitrate allocated for `observer`. If `observer` is not in // the list of added observers, a best guess is returned. int GetStartBitrate(BitrateAllocatorObserver* observer) const override; diff --git a/call/bitrate_allocator_unittest.cc b/call/bitrate_allocator_unittest.cc index 00fb236948..e4f0566827 100644 --- a/call/bitrate_allocator_unittest.cc +++ b/call/bitrate_allocator_unittest.cc @@ -197,7 +197,7 @@ TEST_F(BitrateAllocatorTest, UpdatingBitrateObserver) { CreateTargetRateMessage(4000000, 0, 0, kDefaultProbingIntervalMs)); EXPECT_EQ(3000000, allocator_->GetStartBitrate(&bitrate_observer)); - // Expect |max_padding_bitrate_bps| to change to 0 if the observer is updated. + // Expect `max_padding_bitrate_bps` to change to 0 if the observer is updated. EXPECT_CALL(limit_observer_, OnAllocationLimitsChanged( AllocationLimitsEq(kMinSendBitrateBps, 0))); AddObserver(&bitrate_observer, kMinSendBitrateBps, 4000000, 0, true, @@ -320,8 +320,8 @@ class BitrateAllocatorTestNoEnforceMin : public ::testing::Test { // intended. TEST_F(BitrateAllocatorTestNoEnforceMin, OneBitrateObserver) { TestBitrateObserver bitrate_observer_1; - // Expect OnAllocationLimitsChanged with |min_send_bitrate_bps| = 0 since - // AddObserver is called with |enforce_min_bitrate| = false. + // Expect OnAllocationLimitsChanged with `min_send_bitrate_bps` = 0 since + // AddObserver is called with `enforce_min_bitrate` = false. EXPECT_CALL(limit_observer_, OnAllocationLimitsChanged(AllocationLimitsEq(0, 0))); EXPECT_CALL(limit_observer_, @@ -421,8 +421,8 @@ TEST_F(BitrateAllocatorTestNoEnforceMin, OneBitrateObserverWithPacketLoss) { const uint32_t kMinStartBitrateBps = kMinBitrateBps + std::max(20000u, kMinBitrateBps / 10); - // Expect OnAllocationLimitsChanged with |min_send_bitrate_bps| = 0 since - // AddObserver is called with |enforce_min_bitrate| = false. + // Expect OnAllocationLimitsChanged with `min_send_bitrate_bps` = 0 since + // AddObserver is called with `enforce_min_bitrate` = false. TestBitrateObserver bitrate_observer; EXPECT_CALL(limit_observer_, OnAllocationLimitsChanged( AllocationLimitsEq(0, 0, kMaxBitrateBps))); @@ -494,7 +494,7 @@ TEST_F(BitrateAllocatorTest, const uint32_t kMinBitrateBps = 100000; const uint32_t kMaxBitrateBps = 400000; - // Register |bitrate_observer| and expect total allocation limits to change. + // Register `bitrate_observer` and expect total allocation limits to change. EXPECT_CALL(limit_observer_, OnAllocationLimitsChanged(AllocationLimitsEq( kMinBitrateBps, 0, kMaxBitrateBps))) .Times(1); diff --git a/call/call.cc b/call/call.cc index a0c33ff756..00f58d30a0 100644 --- a/call/call.cc +++ b/call/call.cc @@ -411,7 +411,7 @@ class Call final : public webrtc::Call, std::map video_send_ssrcs_ RTC_GUARDED_BY(worker_thread_); std::set video_send_streams_ RTC_GUARDED_BY(worker_thread_); - // True if |video_send_streams_| is empty, false if not. The atomic variable + // True if `video_send_streams_` is empty, false if not. The atomic variable // is used to decide UMA send statistics behavior and enables avoiding a // PostTask(). std::atomic video_send_streams_empty_{true}; @@ -434,7 +434,7 @@ class Call final : public webrtc::Call, // thread. ReceiveStats receive_stats_ RTC_GUARDED_BY(worker_thread_); SendStats send_stats_ RTC_GUARDED_BY(send_transport_sequence_checker_); - // |last_bandwidth_bps_| and |configured_max_padding_bitrate_bps_| being + // `last_bandwidth_bps_` and `configured_max_padding_bitrate_bps_` being // atomic avoids a PostTask. The variables are used for stats gathering. std::atomic last_bandwidth_bps_{0}; std::atomic configured_max_padding_bitrate_bps_{0}; @@ -446,8 +446,8 @@ class Call final : public webrtc::Call, const std::unique_ptr video_send_delay_stats_; const Timestamp start_of_call_; - // Note that |task_safety_| needs to be at a greater scope than the task queue - // owned by |transport_send_| since calls might arrive on the network thread + // Note that `task_safety_` needs to be at a greater scope than the task queue + // owned by `transport_send_` since calls might arrive on the network thread // while Call is being deleted and the task queue is being torn down. const ScopedTaskSafety task_safety_; @@ -554,7 +554,7 @@ class SharedModuleThread::Impl { if (ref_count_ == 1 && on_one_ref_remaining_) { auto moved_fn = std::move(on_one_ref_remaining_); - // NOTE: after this function returns, chances are that |this| has been + // NOTE: after this function returns, chances are that `this` has been // deleted - do not touch any member variables. // If the owner of the last reference implements a lambda that releases // that last reference inside of the callback (which is legal according @@ -781,8 +781,8 @@ Call::Call(Clock* clock, : clock_(clock), task_queue_factory_(task_queue_factory), worker_thread_(GetCurrentTaskQueueOrThread()), - // If |network_task_queue_| was set to nullptr, network related calls - // must be made on |worker_thread_| (i.e. they're one and the same). + // If `network_task_queue_` was set to nullptr, network related calls + // must be made on `worker_thread_` (i.e. they're one and the same). network_thread_(config.network_task_queue_ ? config.network_task_queue_ : worker_thread_), num_cpu_cores_(CpuInfo::DetectNumberOfCores()), @@ -1000,7 +1000,7 @@ void Call::DestroyAudioReceiveStream( receive_rtp_config_.erase(ssrc); UpdateAggregateNetworkState(); - // TODO(bugs.webrtc.org/11993): Consider if deleting |audio_receive_stream| + // TODO(bugs.webrtc.org/11993): Consider if deleting `audio_receive_stream` // on the network thread would be better or if we'd need to tear down the // state in two phases. delete audio_receive_stream; @@ -1025,7 +1025,7 @@ webrtc::VideoSendStream* Call::CreateVideoSendStream( // TODO(mflodman): Base the start bitrate on a current bandwidth estimate, if // the call has already started. - // Copy ssrcs from |config| since |config| is moved. + // Copy ssrcs from `config` since `config` is moved. std::vector ssrcs = config.rtp.ssrcs; VideoSendStream* send_stream = new VideoSendStream( @@ -1120,10 +1120,10 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( EnsureStarted(); - // TODO(bugs.webrtc.org/11993): Move the registration between |receive_stream| - // and |video_receiver_controller_| out of VideoReceiveStream2 construction + // TODO(bugs.webrtc.org/11993): Move the registration between `receive_stream` + // and `video_receiver_controller_` out of VideoReceiveStream2 construction // and set it up asynchronously on the network thread (the registration and - // |video_receiver_controller_| need to live on the network thread). + // `video_receiver_controller_` need to live on the network thread). VideoReceiveStream2* receive_stream = new VideoReceiveStream2( task_queue_factory_, this, num_cpu_cores_, transport_send_->packet_router(), std::move(configuration), @@ -1190,7 +1190,7 @@ FlexfecReceiveStream* Call::CreateFlexfecReceiveStream( FlexfecReceiveStreamImpl* receive_stream; // Unlike the video and audio receive streams, FlexfecReceiveStream implements - // RtpPacketSinkInterface itself, and hence its constructor passes its |this| + // RtpPacketSinkInterface itself, and hence its constructor passes its `this` // pointer to video_receiver_controller_->CreateStream(). Calling the // constructor while on the worker thread ensures that we don't call // OnRtpPacket until the constructor is finished and the object is @@ -1407,9 +1407,9 @@ void Call::OnTargetTransferRate(TargetTransferRate msg) { // Ignore updates if bitrate is zero (the aggregate network state is // down) or if we're not sending video. - // Using |video_send_streams_empty_| is racy but as the caller can't - // reasonably expect synchronize with changes in |video_send_streams_| (being - // on |send_transport_sequence_checker|), we can avoid a PostTask this way. + // Using `video_send_streams_empty_` is racy but as the caller can't + // reasonably expect synchronize with changes in `video_send_streams_` (being + // on `send_transport_sequence_checker`), we can avoid a PostTask this way. if (target_bitrate_bps == 0 || video_send_streams_empty_.load(std::memory_order_relaxed)) { send_stats_.PauseSendAndPacerBitrateCounters(); @@ -1565,8 +1565,8 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, RTC_LOG(LS_ERROR) << "receive_rtp_config_ lookup failed for ssrc " << parsed_packet.Ssrc(); // Destruction of the receive stream, including deregistering from the - // RtpDemuxer, is not protected by the |worker_thread_|. - // But deregistering in the |receive_rtp_config_| map is. So by not passing + // RtpDemuxer, is not protected by the `worker_thread_`. + // But deregistering in the `receive_rtp_config_` map is. So by not passing // the packet on to demuxing in this case, we prevent incoming packets to be // passed on via the demuxer to a receive stream which is being torned down. return DELIVERY_UNKNOWN_SSRC; @@ -1617,7 +1617,7 @@ PacketReceiver::DeliveryStatus Call::DeliverPacket( void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) { // TODO(bugs.webrtc.org/11993): Expect to be called on the network thread. - // This method is called synchronously via |OnRtpPacket()| (see DeliverRtp) + // This method is called synchronously via `OnRtpPacket()` (see DeliverRtp) // on the same thread. RTC_DCHECK_RUN_ON(worker_thread_); RtpPacketReceived parsed_packet; @@ -1631,8 +1631,8 @@ void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) { RTC_LOG(LS_ERROR) << "receive_rtp_config_ lookup failed for ssrc " << parsed_packet.Ssrc(); // Destruction of the receive stream, including deregistering from the - // RtpDemuxer, is not protected by the |worker_thread_|. - // But deregistering in the |receive_rtp_config_| map is. + // RtpDemuxer, is not protected by the `worker_thread_`. + // But deregistering in the `receive_rtp_config_` map is. // So by not passing the packet on to demuxing in this case, we prevent // incoming packets to be passed on via the demuxer to a receive stream // which is being torn down. diff --git a/call/call_config.h b/call/call_config.h index ba6dec3ad6..f149790150 100644 --- a/call/call_config.h +++ b/call/call_config.h @@ -28,7 +28,7 @@ class AudioProcessing; class RtcEventLog; struct CallConfig { - // If |network_task_queue| is set to nullptr, Call will assume that network + // If `network_task_queue` is set to nullptr, Call will assume that network // related callbacks will be made on the same TQ as the Call instance was // constructed on. explicit CallConfig(RtcEventLog* event_log, diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc index 701dda7e62..71bd490851 100644 --- a/call/call_perf_tests.cc +++ b/call/call_perf_tests.cc @@ -424,7 +424,7 @@ void CallPerfTest::TestCaptureNtpTime( int64_t now_ms = clock_->TimeInMilliseconds(); int64_t time_since_creation = now_ms - creation_time_ms_; if (time_since_creation < start_time_ms_) { - // Wait for |start_time_ms_| before start measuring. + // Wait for `start_time_ms_` before start measuring. return; } @@ -797,7 +797,7 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) { ++encoder_inits_; if (encoder_inits_ == 1) { // First time initialization. Frame size is known. - // |expected_bitrate| is affected by bandwidth estimation before the + // `expected_bitrate` is affected by bandwidth estimation before the // first frame arrives to the encoder. uint32_t expected_bitrate = last_set_bitrate_kbps_ > 0 ? last_set_bitrate_kbps_ @@ -888,9 +888,9 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) { // contrained to the test bitrate. // // |test_bitrate_from test_bitrate_to| bitrate constraint range -// |test_bitrate_step| bitrate constraint update step during the test +// `test_bitrate_step` bitrate constraint update step during the test // |min_bwe max_bwe| BWE range -// |start_bwe| initial BWE +// `start_bwe` initial BWE void CallPerfTest::TestMinAudioVideoBitrate(int test_bitrate_from, int test_bitrate_to, int test_bitrate_step, diff --git a/call/call_unittest.cc b/call/call_unittest.cc index 92a037f157..c84cc51951 100644 --- a/call/call_unittest.cc +++ b/call/call_unittest.cc @@ -375,7 +375,7 @@ TEST(CallTest, AddAdaptationResourceAfterCreatingVideoSendStream) { // Add a fake resource. auto fake_resource = FakeResource::Create("FakeResource"); call->AddAdaptationResource(fake_resource); - // An adapter resource mirroring the |fake_resource| should now be present on + // An adapter resource mirroring the `fake_resource` should now be present on // both streams. auto injected_resource1 = FindResourceWhoseNameContains( stream1->GetAdaptationResources(), fake_resource->Name()); @@ -437,7 +437,7 @@ TEST(CallTest, AddAdaptationResourceBeforeCreatingVideoSendStream) { VideoSendStream* stream2 = call->CreateVideoSendStream(config.Copy(), encoder_config.Copy()); EXPECT_NE(stream2, nullptr); - // An adapter resource mirroring the |fake_resource| should be present on both + // An adapter resource mirroring the `fake_resource` should be present on both // streams. auto injected_resource1 = FindResourceWhoseNameContains( stream1->GetAdaptationResources(), fake_resource->Name()); @@ -506,7 +506,7 @@ TEST(CallTest, SharedModuleThread) { }; // Create our test instance and pass a lambda to it that gets executed when - // the reference count goes back to 1 - meaning |shared| again is the only + // the reference count goes back to 1 - meaning `shared` again is the only // reference, which means we can free the variable and deallocate the thread. rtc::scoped_refptr shared; shared = diff --git a/call/fake_network_pipe.cc b/call/fake_network_pipe.cc index 324a7bd793..4b5579dfc8 100644 --- a/call/fake_network_pipe.cc +++ b/call/fake_network_pipe.cc @@ -307,7 +307,7 @@ void FakeNetworkPipe::Process() { delivery_info.receive_time_us - packet.send_time(); packet.IncrementArrivalTime(added_delay_us); packets_to_deliver.emplace(std::move(packet)); - // |time_now_us| might be later than when the packet should have + // `time_now_us` might be later than when the packet should have // arrived, due to NetworkProcess being called too late. For stats, use // the time it should have been on the link. total_packet_delay_us_ += added_delay_us; diff --git a/call/fake_network_pipe.h b/call/fake_network_pipe.h index 1e5bb513bf..fadae337f5 100644 --- a/call/fake_network_pipe.h +++ b/call/fake_network_pipe.h @@ -44,7 +44,7 @@ class NetworkPacket { absl::optional packet_time_us, Transport* transport); - // Disallow copy constructor and copy assignment (no deep copies of |data_|). + // Disallow copy constructor and copy assignment (no deep copies of `data_`). NetworkPacket(const NetworkPacket&) = delete; ~NetworkPacket(); NetworkPacket& operator=(const NetworkPacket&) = delete; @@ -91,7 +91,7 @@ class NetworkPacket { // SimulatedNetworkInterface to simulate network behavior. class FakeNetworkPipe : public SimulatedPacketReceiverInterface { public: - // Will keep |network_behavior| alive while pipe is alive itself. + // Will keep `network_behavior` alive while pipe is alive itself. FakeNetworkPipe(Clock* clock, std::unique_ptr network_behavior); FakeNetworkPipe(Clock* clock, @@ -130,7 +130,7 @@ class FakeNetworkPipe : public SimulatedPacketReceiverInterface { bool SendRtcp(const uint8_t* packet, size_t length); // Methods for use with Transport interface. When/if packets are delivered, - // they will be passed to the instance specified by the |transport| parameter. + // they will be passed to the instance specified by the `transport` parameter. // Note that that instance must be in the map of active transports. bool SendRtp(const uint8_t* packet, size_t length, @@ -203,13 +203,13 @@ class FakeNetworkPipe : public SimulatedPacketReceiverInterface { bool HasReceiver() const; Clock* const clock_; - // |config_lock| guards the mostly constant things like the callbacks. + // `config_lock` guards the mostly constant things like the callbacks. mutable Mutex config_lock_; const std::unique_ptr network_behavior_; PacketReceiver* receiver_ RTC_GUARDED_BY(config_lock_); Transport* const global_transport_; - // |process_lock| guards the data structures involved in delay and loss + // `process_lock` guards the data structures involved in delay and loss // processes, such as the packet queues. Mutex process_lock_; // Packets are added at the back of the deque, this makes the deque ordered diff --git a/call/fake_network_pipe_unittest.cc b/call/fake_network_pipe_unittest.cc index 852a427222..b9c69c9b74 100644 --- a/call/fake_network_pipe_unittest.cc +++ b/call/fake_network_pipe_unittest.cc @@ -379,7 +379,7 @@ TEST_F(FakeNetworkPipeTest, BurstLoss) { fake_clock_.AdvanceTimeMilliseconds(1000); pipe->Process(); - // Check that the average loss is |kLossPercent| percent. + // Check that the average loss is `kLossPercent` percent. int lost_packets = kNumPackets - receiver.delivered_sequence_numbers_.size(); double loss_fraction = lost_packets / static_cast(kNumPackets); diff --git a/call/flexfec_receive_stream_impl.cc b/call/flexfec_receive_stream_impl.cc index 688efb7b5e..7230a4a56d 100644 --- a/call/flexfec_receive_stream_impl.cc +++ b/call/flexfec_receive_stream_impl.cc @@ -189,7 +189,7 @@ void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) { receiver_->OnRtpPacket(packet); - // Do not report media packets in the RTCP RRs generated by |rtp_rtcp_|. + // Do not report media packets in the RTCP RRs generated by `rtp_rtcp_`. if (packet.Ssrc() == config_.rtp.remote_ssrc) { rtp_receive_statistics_->OnRtpPacket(packet); } diff --git a/call/rtp_bitrate_configurator.h b/call/rtp_bitrate_configurator.h index 73c4e41f63..7ad83f8b0b 100644 --- a/call/rtp_bitrate_configurator.h +++ b/call/rtp_bitrate_configurator.h @@ -49,8 +49,8 @@ class RtpBitrateConfigurator { absl::optional UpdateWithRelayCap(DataRate cap); private: - // Applies update to the BitrateConstraints cached in |config_|, resetting - // with |new_start| if set. + // Applies update to the BitrateConstraints cached in `config_`, resetting + // with `new_start` if set. absl::optional UpdateConstraints( const absl::optional& new_start); diff --git a/call/rtp_config.h b/call/rtp_config.h index 298644930c..ae5ae3b85f 100644 --- a/call/rtp_config.h +++ b/call/rtp_config.h @@ -78,7 +78,7 @@ struct RtpConfig { // The Rtp Stream Ids (aka RIDs) to send in the RID RTP header extension // if the extension is included in the list of extensions. - // If rids are specified, they should correspond to the |ssrcs| vector. + // If rids are specified, they should correspond to the `ssrcs` vector. // This means that: // 1. rids.size() == 0 || rids.size() == ssrcs.size(). // 2. If rids is not empty, then |rids[i]| should use |ssrcs[i]|. diff --git a/call/rtp_demuxer_unittest.cc b/call/rtp_demuxer_unittest.cc index a4abab73ed..0c50b81035 100644 --- a/call/rtp_demuxer_unittest.cc +++ b/call/rtp_demuxer_unittest.cc @@ -631,13 +631,13 @@ TEST_F(RtpDemuxerTest, FirstSsrcAssociatedWithAnRsidIsNotForgotten) { constexpr uint32_t shared_ssrc = 100; - // First a packet with |rsid_a| is received, and |sink_a| is associated with + // First a packet with `rsid_a` is received, and `sink_a` is associated with // its SSRC. auto packet_a = CreatePacketWithSsrcRsid(shared_ssrc, rsid_a); EXPECT_CALL(sink_a, OnRtpPacket(SamePacketAs(*packet_a))).Times(1); EXPECT_TRUE(demuxer_.OnRtpPacket(*packet_a)); - // Second, a packet with |rsid_b| is received. We guarantee that |sink_b| + // Second, a packet with `rsid_b` is received. We guarantee that `sink_b` // receives it. auto packet_b = CreatePacketWithSsrcRsid(shared_ssrc, rsid_b); EXPECT_CALL(sink_a, OnRtpPacket(_)).Times(0); @@ -645,7 +645,7 @@ TEST_F(RtpDemuxerTest, FirstSsrcAssociatedWithAnRsidIsNotForgotten) { EXPECT_TRUE(demuxer_.OnRtpPacket(*packet_b)); // Known edge-case; adding a new RSID association makes us re-examine all - // SSRCs. |sink_b| may or may not be associated with the SSRC now; we make + // SSRCs. `sink_b` may or may not be associated with the SSRC now; we make // no promises on that. However, since the RSID is specified and it cannot be // found the packet should be dropped. MockRtpPacketSink sink_c; diff --git a/call/rtp_transport_controller_send.h b/call/rtp_transport_controller_send.h index 7455060945..f1b90c7f52 100644 --- a/call/rtp_transport_controller_send.h +++ b/call/rtp_transport_controller_send.h @@ -201,8 +201,8 @@ class RtpTransportControllerSend final // Protected by internal locks. RateLimiter retransmission_rate_limiter_; - // TODO(perkj): |task_queue_| is supposed to replace |process_thread_|. - // |task_queue_| is defined last to ensure all pending tasks are cancelled + // TODO(perkj): `task_queue_` is supposed to replace `process_thread_`. + // `task_queue_` is defined last to ensure all pending tasks are cancelled // and deleted before any other members. rtc::TaskQueue task_queue_; RTC_DISALLOW_COPY_AND_ASSIGN(RtpTransportControllerSend); diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc index 7fad89b20b..5b6712d87e 100644 --- a/call/rtp_video_sender.cc +++ b/call/rtp_video_sender.cc @@ -398,7 +398,7 @@ RtpVideoSender::RtpVideoSender( RTC_DCHECK_EQ(rtp_config_.ssrcs.size(), rtp_streams_.size()); if (send_side_bwe_with_overhead_ && has_packet_feedback_) transport_->IncludeOverheadInPacedSender(); - // SSRCs are assumed to be sorted in the same order as |rtp_modules|. + // SSRCs are assumed to be sorted in the same order as `rtp_modules`. for (uint32_t ssrc : rtp_config_.ssrcs) { // Restore state if it previously existed. const RtpPayloadState* state = nullptr; @@ -817,14 +817,14 @@ void RtpVideoSender::OnBitrateUpdated(BitrateAllocationUpdate update, if (!fec_allowed_) { encoder_target_rate_bps_ = payload_bitrate_bps; // fec_controller_->UpdateFecRates() was still called so as to allow - // |fec_controller_| to update whatever internal state it might have, - // since |fec_allowed_| may be toggled back on at any moment. + // `fec_controller_` to update whatever internal state it might have, + // since `fec_allowed_` may be toggled back on at any moment. } - // Subtract packetization overhead from the encoder target. If target rate - // is really low, cap the overhead at 50%. This also avoids the case where - // |encoder_target_rate_bps_| is 0 due to encoder pause event while the - // packetization rate is positive since packets are still flowing. + // Subtract packetization overhead from the encoder target. If target rate + // is really low, cap the overhead at 50%. This also avoids the case where + // `encoder_target_rate_bps_` is 0 due to encoder pause event while the + // packetization rate is positive since packets are still flowing. uint32_t packetization_rate_bps = std::min(GetPacketizationOverheadRate(), encoder_target_rate_bps_ / 2); encoder_target_rate_bps_ -= packetization_rate_bps; diff --git a/call/rtp_video_sender.h b/call/rtp_video_sender.h index 991276fe79..c725214d8e 100644 --- a/call/rtp_video_sender.h +++ b/call/rtp_video_sender.h @@ -189,7 +189,7 @@ class RtpVideoSender : public RtpVideoSenderInterface, // When using the generic descriptor we want all simulcast streams to share // one frame id space (so that the SFU can switch stream without having to - // rewrite the frame id), therefore |shared_frame_id| has to live in a place + // rewrite the frame id), therefore `shared_frame_id` has to live in a place // where we are aware of all the different streams. int64_t shared_frame_id_ = 0; std::vector params_ RTC_GUARDED_BY(mutex_); diff --git a/call/simulated_network.h b/call/simulated_network.h index 68d066cb82..b781b4658f 100644 --- a/call/simulated_network.h +++ b/call/simulated_network.h @@ -98,7 +98,7 @@ class SimulatedNetwork : public SimulatedNetworkInterface { mutable Mutex config_lock_; - // |process_checker_| guards the data structures involved in delay and loss + // `process_checker_` guards the data structures involved in delay and loss // processes, such as the packet queues. rtc::RaceChecker process_checker_; CoDelSimulation codel_controller_ RTC_GUARDED_BY(process_checker_); diff --git a/call/video_receive_stream.h b/call/video_receive_stream.h index 86e5052151..7c70acddd3 100644 --- a/call/video_receive_stream.h +++ b/call/video_receive_stream.h @@ -266,10 +266,10 @@ class VideoReceiveStream : public MediaReceiveStream { virtual int GetBaseMinimumPlayoutDelayMs() const = 0; // Sets and returns recording state. The old state is moved out - // of the video receive stream and returned to the caller, and |state| + // of the video receive stream and returned to the caller, and `state` // is moved in. If the state's callback is set, it will be called with // recordable encoded frames as they arrive. - // If |generate_key_frame| is true, the method will generate a key frame. + // If `generate_key_frame` is true, the method will generate a key frame. // When the function returns, it's guaranteed that all old callouts // to the returned callback has ceased. // Note: the client should not interpret the returned state's attributes, but diff --git a/call/video_send_stream.h b/call/video_send_stream.h index fd7a101b0a..65c2aba328 100644 --- a/call/video_send_stream.h +++ b/call/video_send_stream.h @@ -54,10 +54,10 @@ class VideoSendStream { // references to this media stream's SSRC. kMedia, // RTX streams are streams dedicated to retransmissions. They have a - // dependency on a single kMedia stream: |referenced_media_ssrc|. + // dependency on a single kMedia stream: `referenced_media_ssrc`. kRtx, // FlexFEC streams are streams dedicated to FlexFEC. They have a - // dependency on a single kMedia stream: |referenced_media_ssrc|. + // dependency on a single kMedia stream: `referenced_media_ssrc`. kFlexfec, }; @@ -67,9 +67,9 @@ class VideoSendStream { std::string ToString() const; StreamType type = StreamType::kMedia; - // If |type| is kRtx or kFlexfec this value is present. The referenced SSRC + // If `type` is kRtx or kFlexfec this value is present. The referenced SSRC // is the kMedia stream that this stream is performing retransmissions or - // FEC for. If |type| is kMedia, this value is null. + // FEC for. If `type` is kMedia, this value is null. absl::optional referenced_media_ssrc; FrameCounts frame_counts; int width = 0; @@ -170,7 +170,7 @@ class VideoSendStream { // Expected delay needed by the renderer, i.e. the frame will be delivered // this many milliseconds, if possible, earlier than expected render time. - // Only valid if |local_renderer| is set. + // Only valid if `local_renderer` is set. int render_delay_ms = 0; // Target delay in milliseconds. A positive value indicates this stream is