Use backticks not vertical bars to denote variables in comments for /test

Bug: webrtc:12338
Change-Id: I2a33903a79194bb092a17ea1e1505bf2a3377d8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227027
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34558}
This commit is contained in:
Artem Titov 2021-07-27 12:46:29 +02:00 committed by WebRTC LUCI CQ
parent fad54cbc9d
commit 1ee563d5e0
57 changed files with 147 additions and 147 deletions

View file

@ -40,10 +40,10 @@ class DefaultVideoStreamFactory
const VideoEncoderConfig& encoder_config) override; const VideoEncoderConfig& encoder_config) override;
}; };
// Creates |encoder_config.number_of_streams| VideoStreams where index // Creates `encoder_config.number_of_streams` VideoStreams where index
// |encoder_config.number_of_streams -1| have width = |width|, height = // `encoder_config.number_of_streams -1` have width = `width`, height =
// |height|. The total max bitrate of all VideoStreams is // `height`. The total max bitrate of all VideoStreams is
// |encoder_config.max_bitrate_bps|. // `encoder_config.max_bitrate_bps`.
std::vector<VideoStream> CreateVideoStreams( std::vector<VideoStream> CreateVideoStreams(
int width, int width,
int height, int height,

View file

@ -83,8 +83,8 @@ class FakeEncoder : public VideoEncoder {
int framerate) RTC_LOCKS_EXCLUDED(mutex_); int framerate) RTC_LOCKS_EXCLUDED(mutex_);
// Called before the frame is passed to callback_->OnEncodedImage, to let // Called before the frame is passed to callback_->OnEncodedImage, to let
// subclasses fill out CodecSpecificInfo, possibly modify |encoded_image| or // subclasses fill out CodecSpecificInfo, possibly modify `encoded_image` or
// |buffer|. // `buffer`.
virtual CodecSpecificInfo EncodeHook( virtual CodecSpecificInfo EncodeHook(
EncodedImage& encoded_image, EncodedImage& encoded_image,
rtc::scoped_refptr<EncodedImageBuffer> buffer); rtc::scoped_refptr<EncodedImageBuffer> buffer);
@ -139,7 +139,7 @@ class DelayedEncoder : public test::FakeEncoder {
}; };
// This class implements a multi-threaded fake encoder by posting // This class implements a multi-threaded fake encoder by posting
// FakeH264Encoder::Encode(.) tasks to |queue1_| and |queue2_|, in an // FakeH264Encoder::Encode(.) tasks to `queue1_` and `queue2_`, in an
// alternating fashion. The class itself does not need to be thread safe, // alternating fashion. The class itself does not need to be thread safe,
// as it is called from the task queue in VideoStreamEncoder. // as it is called from the task queue in VideoStreamEncoder.
class MultithreadedFakeH264Encoder : public test::FakeH264Encoder { class MultithreadedFakeH264Encoder : public test::FakeH264Encoder {

View file

@ -24,7 +24,7 @@
namespace { namespace {
// Write width and height to the payload the same way as the real encoder does. // Write width and height to the payload the same way as the real encoder does.
// It requires that |payload| has a size of at least kMinPayLoadHeaderLength. // It requires that `payload` has a size of at least kMinPayLoadHeaderLength.
void WriteFakeVp8(unsigned char* payload, void WriteFakeVp8(unsigned char* payload,
int width, int width,
int height, int height,

View file

@ -25,7 +25,7 @@ class FrameForwarder : public rtc::VideoSourceInterface<VideoFrame> {
public: public:
FrameForwarder(); FrameForwarder();
~FrameForwarder() override; ~FrameForwarder() override;
// Forwards |video_frame| to the registered |sink_|. // Forwards `video_frame` to the registered `sink_`.
virtual void IncomingCapturedFrame(const VideoFrame& video_frame) virtual void IncomingCapturedFrame(const VideoFrame& video_frame)
RTC_LOCKS_EXCLUDED(mutex_); RTC_LOCKS_EXCLUDED(mutex_);
rtc::VideoSinkWants sink_wants() const RTC_LOCKS_EXCLUDED(mutex_); rtc::VideoSinkWants sink_wants() const RTC_LOCKS_EXCLUDED(mutex_);

View file

@ -179,7 +179,7 @@ TEST_F(FrameGeneratorTest, SlideGenerator) {
for (int i = 0; i < kGenCount; ++i) { for (int i = 0; i < kGenCount; ++i) {
hashes[i] = Hash(generator->NextFrame()); hashes[i] = Hash(generator->NextFrame());
} }
// Check that the buffer changes only every |kRepeatCount| frames. // Check that the buffer changes only every `kRepeatCount` frames.
for (int i = 1; i < kGenCount; ++i) { for (int i = 1; i < kGenCount; ++i) {
if (i % kRepeatCount == 0) { if (i % kRepeatCount == 0) {
EXPECT_NE(hashes[i - 1], hashes[i]); EXPECT_NE(hashes[i - 1], hashes[i]);

View file

@ -35,12 +35,12 @@ bool ParseInt(const uint8_t** data, size_t* remaining_size, T* value) {
} }
} // namespace } // namespace
// This function reads two bytes from the beginning of |data|, interprets them // This function reads two bytes from the beginning of `data`, interprets them
// as the first packet length, and reads this many bytes if available. The // as the first packet length, and reads this many bytes if available. The
// payload is inserted into the decoder, and the process continues until no more // payload is inserted into the decoder, and the process continues until no more
// data is available. Either AudioDecoder::Decode or // data is available. Either AudioDecoder::Decode or
// AudioDecoder::DecodeRedundant is used, depending on the value of // AudioDecoder::DecodeRedundant is used, depending on the value of
// |decode_type|. // `decode_type`.
void FuzzAudioDecoder(DecoderFunctionType decode_type, void FuzzAudioDecoder(DecoderFunctionType decode_type,
const uint8_t* data, const uint8_t* data,
size_t size, size_t size,

View file

@ -18,7 +18,7 @@
namespace webrtc { namespace webrtc {
// This function reads bytes from |data_view|, interprets them as RTP timestamp // This function reads bytes from `data_view`, interprets them as RTP timestamp
// and input samples, and sends them for encoding. The process continues until // and input samples, and sends them for encoding. The process continues until
// no more data is available. // no more data is available.
void FuzzAudioEncoder(rtc::ArrayView<const uint8_t> data_view, void FuzzAudioEncoder(rtc::ArrayView<const uint8_t> data_view,

View file

@ -37,7 +37,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
// Fuzz non-POD member of the packet. // Fuzz non-POD member of the packet.
packet->video_payload.SetSize(helper.ReadOrDefaultValue<uint8_t>(0)); packet->video_payload.SetSize(helper.ReadOrDefaultValue<uint8_t>(0));
// TODO(danilchap): Fuzz other non-POD members of the |packet|. // TODO(danilchap): Fuzz other non-POD members of the `packet`.
IgnoreResult(packet_buffer.InsertPacket(std::move(packet))); IgnoreResult(packet_buffer.InsertPacket(std::move(packet)));
} }

View file

@ -52,7 +52,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
// Write parsed descriptor back into raw buffer. // Write parsed descriptor back into raw buffer.
size_t value_size = size_t value_size =
RtpDependencyDescriptorExtension::ValueSize(structure1, descriptor1); RtpDependencyDescriptorExtension::ValueSize(structure1, descriptor1);
// Check |writer| use minimal number of bytes to pack the descriptor by // Check `writer` use minimal number of bytes to pack the descriptor by
// checking it doesn't use more than reader consumed. // checking it doesn't use more than reader consumed.
RTC_CHECK_LE(value_size, raw.size()); RTC_CHECK_LE(value_size, raw.size());
uint8_t some_memory[256]; uint8_t some_memory[256];

View file

@ -16,7 +16,7 @@
namespace webrtc { namespace webrtc {
// We decide which header extensions to register by reading four bytes // We decide which header extensions to register by reading four bytes
// from the beginning of |data| and interpreting it as a bitmask over // from the beginning of `data` and interpreting it as a bitmask over
// the RTPExtensionType enum. This assert ensures four bytes are enough. // the RTPExtensionType enum. This assert ensures four bytes are enough.
static_assert(kRtpExtensionNumberOfExtensions <= 32, static_assert(kRtpExtensionNumberOfExtensions <= 32,
"Insufficient bits read to configure all header extensions. Add " "Insufficient bits read to configure all header extensions. Add "

View file

@ -20,7 +20,7 @@
namespace webrtc { namespace webrtc {
// We decide which header extensions to register by reading four bytes // We decide which header extensions to register by reading four bytes
// from the beginning of |data| and interpreting it as a bitmask over // from the beginning of `data` and interpreting it as a bitmask over
// the RTPExtensionType enum. This assert ensures four bytes are enough. // the RTPExtensionType enum. This assert ensures four bytes are enough.
static_assert(kRtpExtensionNumberOfExtensions <= 32, static_assert(kRtpExtensionNumberOfExtensions <= 32,
"Insufficient bits read to configure all header extensions. Add " "Insufficient bits read to configure all header extensions. Add "

View file

@ -35,7 +35,7 @@ namespace test {
// The RtpReplayer is a utility for fuzzing the RTP/RTCP receiver stack in // The RtpReplayer is a utility for fuzzing the RTP/RTCP receiver stack in
// WebRTC. It achieves this by accepting a set of Receiver configurations and // WebRTC. It achieves this by accepting a set of Receiver configurations and
// an RtpDump (consisting of both RTP and RTCP packets). The |rtp_dump| is // an RtpDump (consisting of both RTP and RTCP packets). The `rtp_dump` is
// passed in as a buffer to allow simple mutation fuzzing directly on the dump. // passed in as a buffer to allow simple mutation fuzzing directly on the dump.
class RtpReplayer final { class RtpReplayer final {
public: public:

View file

@ -40,7 +40,7 @@ rtc::scoped_refptr<MappableNativeBuffer> GetMappableNativeBufferFromVideoFrame(
// modules. // modules.
class MappableNativeBuffer : public VideoFrameBuffer { class MappableNativeBuffer : public VideoFrameBuffer {
public: public:
// If |allow_i420_conversion| is false, calling ToI420() on a non-I420 buffer // If `allow_i420_conversion` is false, calling ToI420() on a non-I420 buffer
// will DCHECK-crash. Used to ensure zero-copy in tests. // will DCHECK-crash. Used to ensure zero-copy in tests.
MappableNativeBuffer(VideoFrameBuffer::Type mappable_type, MappableNativeBuffer(VideoFrameBuffer::Type mappable_type,
int width, int width,

View file

@ -68,7 +68,7 @@ class MockAudioEncoder : public AudioEncoder {
class FakeEncoding { class FakeEncoding {
public: public:
// Creates a functor that will return |info| and adjust the rtc::Buffer // Creates a functor that will return `info` and adjust the rtc::Buffer
// given as input to it, so it is info.encoded_bytes larger. // given as input to it, so it is info.encoded_bytes larger.
explicit FakeEncoding(const AudioEncoder::EncodedInfo& info); explicit FakeEncoding(const AudioEncoder::EncodedInfo& info);
@ -88,7 +88,7 @@ class MockAudioEncoder : public AudioEncoder {
public: public:
~CopyEncoding(); ~CopyEncoding();
// Creates a functor that will return |info| and append the data in the // Creates a functor that will return `info` and append the data in the
// payload to the buffer given as input to it. Up to info.encoded_bytes are // payload to the buffer given as input to it. Up to info.encoded_bytes are
// appended - make sure the payload is big enough! Since it uses an // appended - make sure the payload is big enough! Since it uses an
// ArrayView, it _does not_ copy the payload. Make sure it doesn't fall out // ArrayView, it _does not_ copy the payload. Make sure it doesn't fall out

View file

@ -85,7 +85,7 @@ class TcpMessageRouteImpl final : public TcpMessageRoute {
EmulatedRoute* send_route, EmulatedRoute* send_route,
EmulatedRoute* ret_route); EmulatedRoute* ret_route);
// Sends a TCP message of the given |size| over the route, |on_received| is // Sends a TCP message of the given `size` over the route, `on_received` is
// called when the message has been delivered. Note that the connection // called when the message has been delivered. Note that the connection
// parameters are reset iff there's no currently pending message on the route. // parameters are reset iff there's no currently pending message on the route.
void SendMessage(size_t size, std::function<void()> on_received) override; void SendMessage(size_t size, std::function<void()> on_received) override;

View file

@ -79,7 +79,7 @@ class PacketSocketFactoryWrapper : public rtc::PacketSocketFactory {
~PacketSocketFactoryWrapper() override {} ~PacketSocketFactoryWrapper() override {}
// This method is called from TurnServer when making a TURN ALLOCATION. // This method is called from TurnServer when making a TURN ALLOCATION.
// It will create a socket on the |peer_| endpoint. // It will create a socket on the `peer_` endpoint.
rtc::AsyncPacketSocket* CreateUdpSocket(const rtc::SocketAddress& address, rtc::AsyncPacketSocket* CreateUdpSocket(const rtc::SocketAddress& address,
uint16_t min_port, uint16_t min_port,
uint16_t max_port) override { uint16_t max_port) override {

View file

@ -39,7 +39,7 @@ class EmulatedTURNServer : public EmulatedTURNServerInterface,
public webrtc::EmulatedNetworkReceiverInterface { public webrtc::EmulatedNetworkReceiverInterface {
public: public:
// Create an EmulatedTURNServer. // Create an EmulatedTURNServer.
// |thread| is a thread that will be used to run cricket::TurnServer // `thread` is a thread that will be used to run cricket::TurnServer
// that expects all calls to be made from a single thread. // that expects all calls to be made from a single thread.
EmulatedTURNServer(std::unique_ptr<rtc::Thread> thread, EmulatedTURNServer(std::unique_ptr<rtc::Thread> thread,
EmulatedEndpoint* client, EmulatedEndpoint* client,

View file

@ -185,7 +185,7 @@ int FakeNetworkSocket::Recv(void* pv, size_t cb, int64_t* timestamp) {
return RecvFrom(pv, cb, &paddr, timestamp); return RecvFrom(pv, cb, &paddr, timestamp);
} }
// Reads 1 packet from internal queue. Reads up to |cb| bytes into |pv| // Reads 1 packet from internal queue. Reads up to `cb` bytes into `pv`
// and returns the length of received packet. // and returns the length of received packet.
int FakeNetworkSocket::RecvFrom(void* pv, int FakeNetworkSocket::RecvFrom(void* pv,
size_t cb, size_t cb,

View file

@ -456,10 +456,10 @@ class NetworkRouterNode : public EmulatedNetworkReceiverInterface {
// NetworkBehaviorInterface that is provided on construction. // NetworkBehaviorInterface that is provided on construction.
class EmulatedNetworkNode : public EmulatedNetworkReceiverInterface { class EmulatedNetworkNode : public EmulatedNetworkReceiverInterface {
public: public:
// Creates node based on |network_behavior|. The specified |packet_overhead| // Creates node based on `network_behavior`. The specified `packet_overhead`
// is added to the size of each packet in the information provided to // is added to the size of each packet in the information provided to
// |network_behavior|. // `network_behavior`.
// |task_queue| is used to process packets and to forward the packets when // `task_queue` is used to process packets and to forward the packets when
// they are ready. // they are ready.
EmulatedNetworkNode( EmulatedNetworkNode(
Clock* clock, Clock* clock,

View file

@ -31,9 +31,9 @@ class CrossTrafficRouteImpl final : public CrossTrafficRoute {
EmulatedEndpointImpl* endpoint); EmulatedEndpointImpl* endpoint);
~CrossTrafficRouteImpl(); ~CrossTrafficRouteImpl();
// Triggers sending of dummy packets with size |packet_size| bytes. // Triggers sending of dummy packets with size `packet_size` bytes.
void TriggerPacketBurst(size_t num_packets, size_t packet_size) override; void TriggerPacketBurst(size_t num_packets, size_t packet_size) override;
// Sends a packet over the nodes and runs |action| when it has been delivered. // Sends a packet over the nodes and runs `action` when it has been delivered.
void NetworkDelayedAction(size_t packet_size, void NetworkDelayedAction(size_t packet_size,
std::function<void()> action) override; std::function<void()> action) override;

View file

@ -161,7 +161,7 @@ uint16_t DefaultVideoQualityAnalyzer::OnFrameCaptured(
absl::string_view peer_name, absl::string_view peer_name,
const std::string& stream_label, const std::string& stream_label,
const webrtc::VideoFrame& frame) { const webrtc::VideoFrame& frame) {
// |next_frame_id| is atomic, so we needn't lock here. // `next_frame_id` is atomic, so we needn't lock here.
uint16_t frame_id = next_frame_id_++; uint16_t frame_id = next_frame_id_++;
Timestamp start_time = Timestamp::MinusInfinity(); Timestamp start_time = Timestamp::MinusInfinity();
size_t peer_index = -1; size_t peer_index = -1;
@ -169,8 +169,8 @@ uint16_t DefaultVideoQualityAnalyzer::OnFrameCaptured(
size_t stream_index; size_t stream_index;
{ {
MutexLock lock(&lock_); MutexLock lock(&lock_);
// Create a local copy of |start_time_|, peer's index and total peers count // Create a local copy of `start_time_`, peer's index and total peers count
// to access it under |comparison_lock_| without holding a |lock_| // to access it under `comparison_lock_` without holding a `lock_`
start_time = start_time_; start_time = start_time_;
peer_index = peers_->index(peer_name); peer_index = peers_->index(peer_name);
peers_count = peers_->size(); peers_count = peers_->size();
@ -191,10 +191,10 @@ uint16_t DefaultVideoQualityAnalyzer::OnFrameCaptured(
// between freezes. // between freezes.
stream_last_freeze_end_time_.insert({stats_key, start_time}); stream_last_freeze_end_time_.insert({stats_key, start_time});
} else { } else {
// When we see some |stream_label| for the first time we need to create // When we see some `stream_label` for the first time we need to create
// stream stats object for it and set up some states, but we need to do // stream stats object for it and set up some states, but we need to do
// it only once and for all receivers, so on the next frame on the same // it only once and for all receivers, so on the next frame on the same
// |stream_label| we can be sure, that it's already done and we needn't // `stream_label` we can be sure, that it's already done and we needn't
// to scan though all peers again. // to scan though all peers again.
break; break;
} }
@ -427,9 +427,9 @@ void DefaultVideoQualityAnalyzer::OnFrameRendered(
state->Front(peer_index) != frame.id()) { state->Front(peer_index) != frame.id()) {
dropped_count++; dropped_count++;
uint16_t dropped_frame_id = state->PopFront(peer_index); uint16_t dropped_frame_id = state->PopFront(peer_index);
// Frame with id |dropped_frame_id| was dropped. We need: // Frame with id `dropped_frame_id` was dropped. We need:
// 1. Update global and stream frame counters // 1. Update global and stream frame counters
// 2. Extract corresponding frame from |captured_frames_in_flight_| // 2. Extract corresponding frame from `captured_frames_in_flight_`
// 3. Send extracted frame to comparison with dropped=true // 3. Send extracted frame to comparison with dropped=true
// 4. Cleanup dropped frame // 4. Cleanup dropped frame
frame_counters_.dropped++; frame_counters_.dropped++;
@ -566,7 +566,7 @@ void DefaultVideoQualityAnalyzer::Stop() {
// If there are no freezes in the call we have to report // If there are no freezes in the call we have to report
// time_between_freezes_ms as call duration and in such case // time_between_freezes_ms as call duration and in such case
// |stream_last_freeze_end_time_| for this stream will be |start_time_|. // `stream_last_freeze_end_time_` for this stream will be `start_time_`.
// If there is freeze, then we need add time from last rendered frame // If there is freeze, then we need add time from last rendered frame
// to last freeze end as time between freezes. // to last freeze end as time between freezes.
if (stream_state.last_rendered_frame_time(i)) { if (stream_state.last_rendered_frame_time(i)) {
@ -1185,7 +1185,7 @@ size_t DefaultVideoQualityAnalyzer::NamesCollection::AddIfAbsent(
if (old_capacity == new_capacity) { if (old_capacity == new_capacity) {
index_.emplace(names_[out], out); index_.emplace(names_[out], out);
} else { } else {
// Reallocation happened in the vector, so we need to rebuild |index_| // Reallocation happened in the vector, so we need to rebuild `index_`
index_.clear(); index_.clear();
for (size_t i = 0; i < names_.size(); ++i) { for (size_t i = 0; i < names_.size(); ++i) {
index_.emplace(names_[i], i); index_.emplace(names_[i], i);

View file

@ -274,11 +274,11 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
// Represents comparison between two VideoFrames. Contains video frames itself // Represents comparison between two VideoFrames. Contains video frames itself
// and stats. Can be one of two types: // and stats. Can be one of two types:
// 1. Normal - in this case |captured| is presented and either |rendered| is // 1. Normal - in this case `captured` is presented and either `rendered` is
// presented and |dropped| is false, either |rendered| is omitted and // presented and `dropped` is false, either `rendered` is omitted and
// |dropped| is true. // `dropped` is true.
// 2. Overloaded - in this case both |captured| and |rendered| are omitted // 2. Overloaded - in this case both `captured` and `rendered` are omitted
// because there were too many comparisons in the queue. |dropped| can be // because there were too many comparisons in the queue. `dropped` can be
// true or false showing was frame dropped or not. // true or false showing was frame dropped or not.
struct FrameComparison { struct FrameComparison {
FrameComparison(InternalStatsKey stats_key, FrameComparison(InternalStatsKey stats_key,
@ -294,7 +294,7 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
absl::optional<VideoFrame> captured; absl::optional<VideoFrame> captured;
absl::optional<VideoFrame> rendered; absl::optional<VideoFrame> rendered;
// If true frame was dropped somewhere from capturing to rendering and // If true frame was dropped somewhere from capturing to rendering and
// wasn't rendered on remote peer side. If |dropped| is true, |rendered| // wasn't rendered on remote peer side. If `dropped` is true, `rendered`
// will be |absl::nullopt|. // will be |absl::nullopt|.
bool dropped; bool dropped;
FrameStats frame_stats; FrameStats frame_stats;
@ -329,7 +329,7 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
absl::optional<Timestamp> last_rendered_frame_time(size_t peer) const; absl::optional<Timestamp> last_rendered_frame_time(size_t peer) const;
private: private:
// Index of the owner. Owner's queue in |frame_ids_| will keep alive frames. // Index of the owner. Owner's queue in `frame_ids_` will keep alive frames.
const size_t owner_; const size_t owner_;
// To correctly determine dropped frames we have to know sequence of frames // To correctly determine dropped frames we have to know sequence of frames
// in each stream so we will keep a list of frame ids inside the stream. // in each stream so we will keep a list of frame ids inside the stream.
@ -342,10 +342,10 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
// //
// If we received frame with id frame_id3, then we will pop frame_id1 and // If we received frame with id frame_id3, then we will pop frame_id1 and
// frame_id2 and consider that frames as dropped and then compare received // frame_id2 and consider that frames as dropped and then compare received
// frame with the one from |captured_frames_in_flight_| with id frame_id3. // frame with the one from `captured_frames_in_flight_` with id frame_id3.
// //
// To track alive frames (frames that contains frame's payload in // To track alive frames (frames that contains frame's payload in
// |captured_frames_in_flight_|) the head which corresponds to |owner_| will // `captured_frames_in_flight_`) the head which corresponds to `owner_` will
// be used. So that head will point to the first alive frame in frames list. // be used. So that head will point to the first alive frame in frames list.
MultiHeadQueue<uint16_t> frame_ids_; MultiHeadQueue<uint16_t> frame_ids_;
std::map<size_t, Timestamp> last_rendered_frame_time_; std::map<size_t, Timestamp> last_rendered_frame_time_;
@ -418,7 +418,7 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
bool HasRenderedTime(size_t peer) const; bool HasRenderedTime(size_t peer) const;
// Crash if rendered time is not set for specified |peer|. // Crash if rendered time is not set for specified `peer`.
webrtc::Timestamp rendered_time(size_t peer) const { webrtc::Timestamp rendered_time(size_t peer) const {
return receiver_stats_.at(peer).rendered_time; return receiver_stats_.at(peer).rendered_time;
} }
@ -466,8 +466,8 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
return index_.find(name) != index_.end(); return index_.find(name) != index_.end();
} }
// Add specified |name| to the collection if it isn't presented. // Add specified `name` to the collection if it isn't presented.
// Returns index which corresponds to specified |name|. // Returns index which corresponds to specified `name`.
size_t AddIfAbsent(absl::string_view name); size_t AddIfAbsent(absl::string_view name);
private: private:
@ -540,12 +540,12 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
// Frame counters per each stream per each receiver. // Frame counters per each stream per each receiver.
std::map<InternalStatsKey, FrameCounters> stream_frame_counters_ std::map<InternalStatsKey, FrameCounters> stream_frame_counters_
RTC_GUARDED_BY(lock_); RTC_GUARDED_BY(lock_);
// Map from stream index in |streams_| to its StreamState. // Map from stream index in `streams_` to its StreamState.
std::map<size_t, StreamState> stream_states_ RTC_GUARDED_BY(lock_); std::map<size_t, StreamState> stream_states_ RTC_GUARDED_BY(lock_);
// Map from stream index in |streams_| to sender peer index in |peers_|. // Map from stream index in `streams_` to sender peer index in `peers_`.
std::map<size_t, size_t> stream_to_sender_ RTC_GUARDED_BY(lock_); std::map<size_t, size_t> stream_to_sender_ RTC_GUARDED_BY(lock_);
// Stores history mapping between stream index in |streams_| and frame ids. // Stores history mapping between stream index in `streams_` and frame ids.
// Updated when frame id overlap. It required to properly return stream label // Updated when frame id overlap. It required to properly return stream label
// after 1st frame from simulcast streams was already rendered and last is // after 1st frame from simulcast streams was already rendered and last is
// still encoding. // still encoding.

View file

@ -24,8 +24,8 @@ class EncodedImageDataInjector {
public: public:
virtual ~EncodedImageDataInjector() = default; virtual ~EncodedImageDataInjector() = default;
// Return encoded image with specified |id| and |discard| flag injected into // Return encoded image with specified `id` and `discard` flag injected into
// its payload. |discard| flag mean does analyzing decoder should discard this // its payload. `discard` flag mean does analyzing decoder should discard this
// encoded image because it belongs to unnecessary simulcast stream or spatial // encoded image because it belongs to unnecessary simulcast stream or spatial
// layer. // layer.
virtual EncodedImage InjectData(uint16_t id, virtual EncodedImage InjectData(uint16_t id,
@ -47,7 +47,7 @@ class EncodedImageDataExtractor {
virtual ~EncodedImageDataExtractor() = default; virtual ~EncodedImageDataExtractor() = default;
// Invoked by framework before any image will come to the extractor. // Invoked by framework before any image will come to the extractor.
// |expected_receivers_count| is the expected amount of receivers for each // `expected_receivers_count` is the expected amount of receivers for each
// encoded image. // encoded image.
virtual void Start(int expected_receivers_count) = 0; virtual void Start(int expected_receivers_count) = 0;

View file

@ -28,7 +28,7 @@ namespace webrtc_pc_e2e {
template <typename T> template <typename T>
class MultiHeadQueue { class MultiHeadQueue {
public: public:
// Creates queue with exactly |readers_count| readers. // Creates queue with exactly `readers_count` readers.
explicit MultiHeadQueue(size_t readers_count) { explicit MultiHeadQueue(size_t readers_count) {
for (size_t i = 0; i < readers_count; ++i) { for (size_t i = 0; i < readers_count; ++i) {
queues_.push_back(std::deque<T>()); queues_.push_back(std::deque<T>());

View file

@ -85,8 +85,8 @@ int32_t QualityAnalyzingVideoDecoder::Decode(const EncodedImage& input_image,
origin_image = &( origin_image = &(
decoding_images_.insert({out.id, std::move(out.image)}).first->second); decoding_images_.insert({out.id, std::move(out.image)}).first->second);
} }
// We can safely dereference |origin_image|, because it can be removed from // We can safely dereference `origin_image`, because it can be removed from
// the map only after |delegate_| Decode method will be invoked. Image will be // the map only after `delegate_` Decode method will be invoked. Image will be
// removed inside DecodedImageCallback, which can be done on separate thread. // removed inside DecodedImageCallback, which can be done on separate thread.
analyzer_->OnFramePreDecode(peer_name_, out.id, *origin_image); analyzer_->OnFramePreDecode(peer_name_, out.id, *origin_image);
int32_t result = int32_t result =
@ -143,8 +143,8 @@ void QualityAnalyzingVideoDecoder::DecoderCallback::SetDelegateCallback(
} }
// We have to implement all next 3 methods because we don't know which one // We have to implement all next 3 methods because we don't know which one
// exactly is implemented in |delegate_callback_|, so we need to call the same // exactly is implemented in `delegate_callback_`, so we need to call the same
// method on |delegate_callback_|, as was called on |this| callback. // method on `delegate_callback_`, as was called on `this` callback.
int32_t QualityAnalyzingVideoDecoder::DecoderCallback::Decoded( int32_t QualityAnalyzingVideoDecoder::DecoderCallback::Decoded(
VideoFrame& decodedImage) { VideoFrame& decodedImage) {
decoder_->OnFrameDecoded(&decodedImage, /*decode_time_ms=*/absl::nullopt, decoder_->OnFrameDecoded(&decodedImage, /*decode_time_ms=*/absl::nullopt,

View file

@ -245,7 +245,7 @@ EncodedImageCallback::Result QualityAnalyzingVideoEncoder::OnEncodedImage(
timestamp_to_frame_id_list_.pop_front(); timestamp_to_frame_id_list_.pop_front();
} }
// After the loop the first element should point to current |encoded_image| // After the loop the first element should point to current `encoded_image`
// frame id. We don't remove it from the list, because there may be // frame id. We don't remove it from the list, because there may be
// multiple spatial layers for this frame, so encoder can produce more // multiple spatial layers for this frame, so encoder can produce more
// encoded images with this timestamp. The first element will be removed // encoded images with this timestamp. The first element will be removed

View file

@ -139,8 +139,8 @@ class QualityAnalyzingVideoEncoder : public VideoEncoder,
const double bitrate_multiplier_; const double bitrate_multiplier_;
// Contains mapping from stream label to optional spatial index. // Contains mapping from stream label to optional spatial index.
// If we have stream label "Foo" and mapping contains // If we have stream label "Foo" and mapping contains
// 1. |absl::nullopt| means "Foo" isn't simulcast/SVC stream // 1. `absl::nullopt` means "Foo" isn't simulcast/SVC stream
// 2. |kAnalyzeAnySpatialStream| means all simulcast/SVC streams are required // 2. `kAnalyzeAnySpatialStream` means all simulcast/SVC streams are required
// 3. Concrete value means that particular simulcast/SVC stream have to be // 3. Concrete value means that particular simulcast/SVC stream have to be
// analyzed. // analyzed.
std::map<std::string, absl::optional<int>> stream_required_spatial_index_; std::map<std::string, absl::optional<int>> stream_required_spatial_index_;

View file

@ -44,7 +44,7 @@ class SingleProcessEncodedImageDataInjector : public EncodedImageDataInjector,
~SingleProcessEncodedImageDataInjector() override; ~SingleProcessEncodedImageDataInjector() override;
// Id and discard flag will be injected into EncodedImage buffer directly. // Id and discard flag will be injected into EncodedImage buffer directly.
// This buffer won't be fully copied, so |source| image buffer will be also // This buffer won't be fully copied, so `source` image buffer will be also
// changed. // changed.
EncodedImage InjectData(uint16_t id, EncodedImage InjectData(uint16_t id,
bool discard, bool discard,

View file

@ -68,13 +68,13 @@ class VideoQualityAnalyzerInjectionHelper : public StatsObserverInterface {
// Creates VideoFrame preprocessor, that will allow video quality analyzer to // Creates VideoFrame preprocessor, that will allow video quality analyzer to
// get access to the captured frames. If provided config also specifies // get access to the captured frames. If provided config also specifies
// |input_dump_file_name|, video will be written into that file. // `input_dump_file_name`, video will be written into that file.
std::unique_ptr<test::TestVideoCapturer::FramePreprocessor> std::unique_ptr<test::TestVideoCapturer::FramePreprocessor>
CreateFramePreprocessor(absl::string_view peer_name, CreateFramePreprocessor(absl::string_view peer_name,
const VideoConfig& config); const VideoConfig& config);
// Creates sink, that will allow video quality analyzer to get access to // Creates sink, that will allow video quality analyzer to get access to
// the rendered frames. If corresponding video track has // the rendered frames. If corresponding video track has
// |output_dump_file_name| in its VideoConfig, which was used for // `output_dump_file_name` in its VideoConfig, which was used for
// CreateFramePreprocessor(...), then video also will be written // CreateFramePreprocessor(...), then video also will be written
// into that file. // into that file.
std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> CreateVideoSink( std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> CreateVideoSink(
@ -84,8 +84,8 @@ class VideoQualityAnalyzerInjectionHelper : public StatsObserverInterface {
rtc::ArrayView<const std::string> peer_names, rtc::ArrayView<const std::string> peer_names,
int max_threads_count = 1); int max_threads_count = 1);
// Forwards |stats_reports| for Peer Connection |pc_label| to // Forwards `stats_reports` for Peer Connection `pc_label` to
// |analyzer_|. // `analyzer_`.
void OnStatsReports( void OnStatsReports(
absl::string_view pc_label, absl::string_view pc_label,
const rtc::scoped_refptr<const RTCStatsReport>& report) override; const rtc::scoped_refptr<const RTCStatsReport>& report) override;

View file

@ -66,9 +66,9 @@ constexpr char kFlexFecEnabledFieldTrials[] =
class FixturePeerConnectionObserver : public MockPeerConnectionObserver { class FixturePeerConnectionObserver : public MockPeerConnectionObserver {
public: public:
// |on_track_callback| will be called when any new track will be added to peer // `on_track_callback` will be called when any new track will be added to peer
// connection. // connection.
// |on_connected_callback| will be called when peer connection will come to // `on_connected_callback` will be called when peer connection will come to
// either connected or completed state. Client should notice that in the case // either connected or completed state. Client should notice that in the case
// of reconnect this callback can be called again, so it should be tolerant // of reconnect this callback can be called again, so it should be tolerant
// to such behavior. // to such behavior.
@ -197,7 +197,7 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) {
video_quality_analyzer_injection_helper_.get(), task_queue_factory_.get(), video_quality_analyzer_injection_helper_.get(), task_queue_factory_.get(),
time_controller_.GetClock()); time_controller_.GetClock());
// Create a |task_queue_|. // Create a `task_queue_`.
task_queue_ = std::make_unique<webrtc::TaskQueueForTest>( task_queue_ = std::make_unique<webrtc::TaskQueueForTest>(
time_controller_.GetTaskQueueFactory()->CreateTaskQueue( time_controller_.GetTaskQueueFactory()->CreateTaskQueue(
"pc_e2e_quality_test", webrtc::TaskQueueFactory::Priority::NORMAL)); "pc_e2e_quality_test", webrtc::TaskQueueFactory::Priority::NORMAL));
@ -350,7 +350,7 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) {
stats_poller.PollStatsAndNotifyObservers(); stats_poller.PollStatsAndNotifyObservers();
}, },
RTC_FROM_HERE); RTC_FROM_HERE);
// We need to detach AEC dumping from peers, because dump uses |task_queue_| // We need to detach AEC dumping from peers, because dump uses `task_queue_`
// inside. // inside.
alice_->DetachAecDump(); alice_->DetachAecDump();
bob_->DetachAecDump(); bob_->DetachAecDump();
@ -372,7 +372,7 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) {
reporter->StopAndReportResults(); reporter->StopAndReportResults();
} }
// Reset |task_queue_| after test to cleanup. // Reset `task_queue_` after test to cleanup.
task_queue_.reset(); task_queue_.reset();
alice_ = nullptr; alice_ = nullptr;

View file

@ -103,14 +103,14 @@ struct InjectableComponents {
struct Params { struct Params {
// Peer name. If empty - default one will be set by the fixture. // Peer name. If empty - default one will be set by the fixture.
absl::optional<std::string> name; absl::optional<std::string> name;
// If |video_configs| is empty - no video should be added to the test call. // If `video_configs` is empty - no video should be added to the test call.
std::vector<PeerConnectionE2EQualityTestFixture::VideoConfig> video_configs; std::vector<PeerConnectionE2EQualityTestFixture::VideoConfig> video_configs;
// If |audio_config| is set audio stream will be configured // If `audio_config` is set audio stream will be configured
absl::optional<PeerConnectionE2EQualityTestFixture::AudioConfig> audio_config; absl::optional<PeerConnectionE2EQualityTestFixture::AudioConfig> audio_config;
// If |rtc_event_log_path| is set, an RTCEventLog will be saved in that // If `rtc_event_log_path` is set, an RTCEventLog will be saved in that
// location and it will be available for further analysis. // location and it will be available for further analysis.
absl::optional<std::string> rtc_event_log_path; absl::optional<std::string> rtc_event_log_path;
// If |aec_dump_path| is set, an AEC dump will be saved in that location and // If `aec_dump_path` is set, an AEC dump will be saved in that location and
// it will be available for further analysis. // it will be available for further analysis.
absl::optional<std::string> aec_dump_path; absl::optional<std::string> aec_dump_path;

View file

@ -110,7 +110,7 @@ std::vector<RtpCodecCapability> FilterVideoCodecCapabilities(
// If offer has no simulcast video sections - do nothing. // If offer has no simulcast video sections - do nothing.
// //
// If offer has simulcast video sections - for each section creates // If offer has simulcast video sections - for each section creates
// SimulcastSectionInfo and put it into |context_|. // SimulcastSectionInfo and put it into `context_`.
void SignalingInterceptor::FillSimulcastContext( void SignalingInterceptor::FillSimulcastContext(
SessionDescriptionInterface* offer) { SessionDescriptionInterface* offer) {
for (auto& content : offer->description()->contents()) { for (auto& content : offer->description()->contents()) {
@ -227,7 +227,7 @@ LocalAndRemoteSdp SignalingInterceptor::PatchVp8Offer(
// Remove simulcast video section from offer. // Remove simulcast video section from offer.
RTC_CHECK(desc->RemoveContentByName(simulcast_content->mid())); RTC_CHECK(desc->RemoveContentByName(simulcast_content->mid()));
// Clear |simulcast_content|, because now it is pointing to removed object. // Clear `simulcast_content`, because now it is pointing to removed object.
simulcast_content = nullptr; simulcast_content = nullptr;
// Swap mid and rid extensions, so remote peer will understand rid as mid. // Swap mid and rid extensions, so remote peer will understand rid as mid.
@ -410,7 +410,7 @@ LocalAndRemoteSdp SignalingInterceptor::PatchVp8Answer(
// Get media description, which will be converted to simulcast answer. // Get media description, which will be converted to simulcast answer.
std::unique_ptr<cricket::MediaContentDescription> media_desc = std::unique_ptr<cricket::MediaContentDescription> media_desc =
simulcast_content->media_description()->Clone(); simulcast_content->media_description()->Clone();
// Set |simulcast_content| to nullptr, because then it will be removed, so // Set `simulcast_content` to nullptr, because then it will be removed, so
// it will point to deleted object. // it will point to deleted object.
simulcast_content = nullptr; simulcast_content = nullptr;
@ -419,7 +419,7 @@ LocalAndRemoteSdp SignalingInterceptor::PatchVp8Answer(
RTC_CHECK(desc->RemoveContentByName(rid)); RTC_CHECK(desc->RemoveContentByName(rid));
} }
// Patch |media_desc| to make it simulcast answer description. // Patch `media_desc` to make it simulcast answer description.
// Restore mid/rid rtp header extensions // Restore mid/rid rtp header extensions
std::vector<webrtc::RtpExtension> extensions = std::vector<webrtc::RtpExtension> extensions =
media_desc->rtp_header_extensions(); media_desc->rtp_header_extensions();

View file

@ -30,15 +30,15 @@ namespace webrtc_pc_e2e {
// Creates list of capabilities, which can be set on RtpTransceiverInterface via // Creates list of capabilities, which can be set on RtpTransceiverInterface via
// RtpTransceiverInterface::SetCodecPreferences(...) to negotiate use of codecs // RtpTransceiverInterface::SetCodecPreferences(...) to negotiate use of codecs
// from list of |supported_codecs| which will match |video_codecs|. If flags // from list of `supported_codecs` which will match `video_codecs`. If flags
// |ulpfec| or |flexfec| set to true corresponding FEC codec will be added. // `ulpfec` or `flexfec` set to true corresponding FEC codec will be added.
// FEC and RTX codecs will be added after required codecs. // FEC and RTX codecs will be added after required codecs.
// //
// All codecs will be added only if they exists in the list of // All codecs will be added only if they exists in the list of
// |supported_codecs|. If multiple codecs from this list will match // `supported_codecs`. If multiple codecs from this list will match
// |video_codecs|, then all of them will be added to the output // `video_codecs`, then all of them will be added to the output
// vector and they will be added in the same order, as they were in // vector and they will be added in the same order, as they were in
// |supported_codecs|. // `supported_codecs`.
std::vector<RtpCodecCapability> FilterVideoCodecCapabilities( std::vector<RtpCodecCapability> FilterVideoCodecCapabilities(
rtc::ArrayView<const PeerConnectionE2EQualityTestFixture::VideoCodecConfig> rtc::ArrayView<const PeerConnectionE2EQualityTestFixture::VideoCodecConfig>
video_codecs, video_codecs,

View file

@ -35,7 +35,7 @@ namespace webrtc_pc_e2e {
class StatsBasedNetworkQualityMetricsReporter class StatsBasedNetworkQualityMetricsReporter
: public PeerConnectionE2EQualityTestFixture::QualityMetricsReporter { : public PeerConnectionE2EQualityTestFixture::QualityMetricsReporter {
public: public:
// |networks| map peer name to network to report network layer stability stats // `networks` map peer name to network to report network layer stability stats
// and to log network layer metrics. // and to log network layer metrics.
StatsBasedNetworkQualityMetricsReporter( StatsBasedNetworkQualityMetricsReporter(
std::map<std::string, std::vector<EmulatedEndpoint*>> peer_endpoints, std::map<std::string, std::vector<EmulatedEndpoint*>> peer_endpoints,

View file

@ -68,10 +68,10 @@ class TestActivitiesExecutor {
// yet. // yet.
Timestamp start_time_ RTC_GUARDED_BY(lock_) = Timestamp::MinusInfinity(); Timestamp start_time_ RTC_GUARDED_BY(lock_) = Timestamp::MinusInfinity();
// Queue of activities that were added before test was started. // Queue of activities that were added before test was started.
// Activities from this queue will be posted on the |task_queue_| after test // Activities from this queue will be posted on the `task_queue_` after test
// will be set up and then this queue will be unused. // will be set up and then this queue will be unused.
std::queue<ScheduledActivity> scheduled_activities_ RTC_GUARDED_BY(lock_); std::queue<ScheduledActivity> scheduled_activities_ RTC_GUARDED_BY(lock_);
// List of task handles for activities, that are posted on |task_queue_| as // List of task handles for activities, that are posted on `task_queue_` as
// repeated during the call. // repeated during the call.
std::vector<RepeatingTaskHandle> repeating_task_handles_ std::vector<RepeatingTaskHandle> repeating_task_handles_
RTC_GUARDED_BY(lock_); RTC_GUARDED_BY(lock_);

View file

@ -116,7 +116,7 @@ class TestPeer final {
} }
} }
// Adds provided |candidates| to the owned peer connection. // Adds provided `candidates` to the owned peer connection.
bool AddIceCandidates( bool AddIceCandidates(
std::vector<std::unique_ptr<IceCandidateInterface>> candidates); std::vector<std::unique_ptr<IceCandidateInterface>> candidates);
@ -135,7 +135,7 @@ class TestPeer final {
std::unique_ptr<rtc::Thread> worker_thread); std::unique_ptr<rtc::Thread> worker_thread);
private: private:
// Keeps ownership of worker thread. It has to be destroyed after |wrapper_|. // Keeps ownership of worker thread. It has to be destroyed after `wrapper_`.
std::unique_ptr<rtc::Thread> worker_thread_; std::unique_ptr<rtc::Thread> worker_thread_;
std::unique_ptr<PeerConnectionWrapper> wrapper_; std::unique_ptr<PeerConnectionWrapper> wrapper_;
std::unique_ptr<Params> params_; std::unique_ptr<Params> params_;

View file

@ -42,8 +42,8 @@ using EchoEmulationConfig = ::webrtc::webrtc_pc_e2e::
constexpr int16_t kGeneratedAudioMaxAmplitude = 32000; constexpr int16_t kGeneratedAudioMaxAmplitude = 32000;
constexpr int kDefaultSamplingFrequencyInHz = 48000; constexpr int kDefaultSamplingFrequencyInHz = 48000;
// Sets mandatory entities in injectable components like |pcf_dependencies| // Sets mandatory entities in injectable components like `pcf_dependencies`
// and |pc_dependencies| if they are omitted. Also setup required // and `pc_dependencies` if they are omitted. Also setup required
// dependencies, that won't be specially provided by factory and will be just // dependencies, that won't be specially provided by factory and will be just
// transferred to peer connection creation code. // transferred to peer connection creation code.
void SetMandatoryEntities(InjectableComponents* components, void SetMandatoryEntities(InjectableComponents* components,
@ -74,7 +74,7 @@ void SetMandatoryEntities(InjectableComponents* components,
// Returns mapping from stream label to optional spatial index. // Returns mapping from stream label to optional spatial index.
// If we have stream label "Foo" and mapping contains // If we have stream label "Foo" and mapping contains
// 1. |absl::nullopt| means "Foo" isn't simulcast/SVC stream // 1. |absl::nullopt| means "Foo" isn't simulcast/SVC stream
// 2. |kAnalyzeAnySpatialStream| means all simulcast/SVC streams are required // 2. `kAnalyzeAnySpatialStream` means all simulcast/SVC streams are required
// 3. Concrete value means that particular simulcast/SVC stream have to be // 3. Concrete value means that particular simulcast/SVC stream have to be
// analyzed. // analyzed.
std::map<std::string, absl::optional<int>> std::map<std::string, absl::optional<int>>

View file

@ -46,13 +46,13 @@ struct RemotePeerAudioConfig {
class TestPeerFactory { class TestPeerFactory {
public: public:
// Creates a test peer factory. // Creates a test peer factory.
// |signaling_thread| will be used as a signaling thread for all peers created // `signaling_thread` will be used as a signaling thread for all peers created
// by this factory. // by this factory.
// |time_controller| will be used to create required threads, task queue // `time_controller` will be used to create required threads, task queue
// factories and call factory. // factories and call factory.
// |video_analyzer_helper| will be used to setup video quality analysis for // `video_analyzer_helper` will be used to setup video quality analysis for
// created peers. // created peers.
// |task_queue| will be used for AEC dump if it is requested. // `task_queue` will be used for AEC dump if it is requested.
TestPeerFactory(rtc::Thread* signaling_thread, TestPeerFactory(rtc::Thread* signaling_thread,
TimeController& time_controller, TimeController& time_controller,
VideoQualityAnalyzerInjectionHelper* video_analyzer_helper, VideoQualityAnalyzerInjectionHelper* video_analyzer_helper,

View file

@ -78,14 +78,14 @@ class PeerScenario {
std::vector<EmulatedNetworkNode*> send_link, std::vector<EmulatedNetworkNode*> send_link,
std::vector<EmulatedNetworkNode*> ret_link); std::vector<EmulatedNetworkNode*> ret_link);
// Starts feeding the results of comparing captured frames from |send_track| // Starts feeding the results of comparing captured frames from `send_track`
// with decoded frames on |receiver| to |analyzer|. // with decoded frames on `receiver` to `analyzer`.
// TODO(srte): Provide a way to detach to allow removal of tracks. // TODO(srte): Provide a way to detach to allow removal of tracks.
void AttachVideoQualityAnalyzer(VideoQualityAnalyzer* analyzer, void AttachVideoQualityAnalyzer(VideoQualityAnalyzer* analyzer,
VideoTrackInterface* send_track, VideoTrackInterface* send_track,
PeerScenarioClient* receiver); PeerScenarioClient* receiver);
// Waits on |event| while processing messages on the signaling thread. // Waits on `event` while processing messages on the signaling thread.
bool WaitAndProcess(std::atomic<bool>* event, bool WaitAndProcess(std::atomic<bool>* event,
TimeDelta max_duration = TimeDelta::Seconds(5)); TimeDelta max_duration = TimeDelta::Seconds(5));

View file

@ -83,7 +83,7 @@ class PeerScenarioClient {
struct Video { struct Video {
bool use_fake_codecs = false; bool use_fake_codecs = false;
} video; } video;
// The created endpoints can be accessed using the map key as |index| in // The created endpoints can be accessed using the map key as `index` in
// PeerScenarioClient::endpoint(index). // PeerScenarioClient::endpoint(index).
std::map<int, EmulatedEndpointConfig> endpoints = { std::map<int, EmulatedEndpointConfig> endpoints = {
{0, EmulatedEndpointConfig()}}; {0, EmulatedEndpointConfig()}};
@ -137,7 +137,7 @@ class PeerScenarioClient {
CallbackHandlers* handlers() { return &handlers_; } CallbackHandlers* handlers() { return &handlers_; }
// The |munge_offer| function can be used to munge the SDP, i.e. modify a // The `munge_offer` function can be used to munge the SDP, i.e. modify a
// local description afer creating it but before setting it. Note that this is // local description afer creating it but before setting it. Note that this is
// legacy behavior. It's added here only to be able to have test coverage for // legacy behavior. It's added here only to be able to have test coverage for
// scenarios even if they are not spec compliant. // scenarios even if they are not spec compliant.

View file

@ -30,12 +30,12 @@ class SignalingRoute {
void StartIceSignaling(); void StartIceSignaling();
// The |modify_offer| callback is used to modify an offer after the local // The `modify_offer` callback is used to modify an offer after the local
// description has been set. This is legal (but odd) behavior. // description has been set. This is legal (but odd) behavior.
// The |munge_offer| callback is used to modify an offer between its creation // The `munge_offer` callback is used to modify an offer between its creation
// and set local description. This behavior is forbidden according to the spec // and set local description. This behavior is forbidden according to the spec
// but available here in order to allow test coverage on corner cases. // but available here in order to allow test coverage on corner cases.
// The |exchange_finished| callback is called with the answer produced after // The `exchange_finished` callback is called with the answer produced after
// SDP negotations has completed. // SDP negotations has completed.
// TODO(srte): Handle lossy links. // TODO(srte): Handle lossy links.
void NegotiateSdp( void NegotiateSdp(

View file

@ -210,7 +210,7 @@ TEST_P(UnsignaledStreamTest, ReplacesUnsignaledStreamOnCompletedSignaling) {
case MidTestConfiguration::kMidNegotiatedAndPresentInPackets: case MidTestConfiguration::kMidNegotiatedAndPresentInPackets:
EXPECT_TRUE(parsed_packet.HasExtension<RtpMid>()); EXPECT_TRUE(parsed_packet.HasExtension<RtpMid>());
// The simulated second m= section would have a different MID. // The simulated second m= section would have a different MID.
// If we don't modify it here then |second_ssrc| would end up // If we don't modify it here then `second_ssrc` would end up
// being mapped to the first m= section which would cause SSRC // being mapped to the first m= section which would cause SSRC
// conflicts if we later add the same SSRC to a second m= // conflicts if we later add the same SSRC to a second m=
// section. Hidden assumption: first m= section does not use // section. Hidden assumption: first m= section does not use

View file

@ -22,7 +22,7 @@ struct RtpPacket {
static const size_t kMaxPacketBufferSize = 3500; static const size_t kMaxPacketBufferSize = 3500;
uint8_t data[kMaxPacketBufferSize]; uint8_t data[kMaxPacketBufferSize];
size_t length; size_t length;
// The length the packet had on wire. Will be different from |length| when // The length the packet had on wire. Will be different from `length` when
// reading a header-only RTP dump. // reading a header-only RTP dump.
size_t original_length; size_t original_length;

View file

@ -258,7 +258,7 @@ ColumnPrinter CallClient::StatsPrinter() {
} }
Call::Stats CallClient::GetStats() { Call::Stats CallClient::GetStats() {
// This call needs to be made on the thread that |call_| was constructed on. // This call needs to be made on the thread that `call_` was constructed on.
Call::Stats stats; Call::Stats stats;
SendTask([this, &stats] { stats = call_->GetStats(); }); SendTask([this, &stats] { stats = call_->GetStats(); });
return stats; return stats;

View file

@ -98,7 +98,7 @@ class Scenario {
AudioStreamConfig config); AudioStreamConfig config);
// Runs the provided function with a fixed interval. For real time tests, // Runs the provided function with a fixed interval. For real time tests,
// |function| starts being called after |interval| from the call to Every(). // `function` starts being called after `interval` from the call to Every().
void Every(TimeDelta interval, std::function<void(TimeDelta)> function); void Every(TimeDelta interval, std::function<void(TimeDelta)> function);
void Every(TimeDelta interval, std::function<void()> function); void Every(TimeDelta interval, std::function<void()> function);
@ -107,21 +107,21 @@ class Scenario {
void Post(std::function<void()> function); void Post(std::function<void()> function);
// Runs the provided function after given duration has passed. For real time // Runs the provided function after given duration has passed. For real time
// tests, |function| is called after |target_time_since_start| from the call // tests, `function` is called after `target_time_since_start` from the call
// to Every(). // to Every().
void At(TimeDelta offset, std::function<void()> function); void At(TimeDelta offset, std::function<void()> function);
// Sends a packet over the nodes and runs |action| when it has been delivered. // Sends a packet over the nodes and runs `action` when it has been delivered.
void NetworkDelayedAction(std::vector<EmulatedNetworkNode*> over_nodes, void NetworkDelayedAction(std::vector<EmulatedNetworkNode*> over_nodes,
size_t packet_size, size_t packet_size,
std::function<void()> action); std::function<void()> action);
// Runs the scenario for the given time. // Runs the scenario for the given time.
void RunFor(TimeDelta duration); void RunFor(TimeDelta duration);
// Runs the scenario until |target_time_since_start|. // Runs the scenario until `target_time_since_start`.
void RunUntil(TimeDelta target_time_since_start); void RunUntil(TimeDelta target_time_since_start);
// Runs the scenario until |target_time_since_start| or |exit_function| // Runs the scenario until `target_time_since_start` or `exit_function`
// returns true. |exit_function| is polled after each |check_interval| has // returns true. `exit_function` is polled after each `check_interval` has
// passed. // passed.
void RunUntil(TimeDelta target_time_since_start, void RunUntil(TimeDelta target_time_since_start,
TimeDelta check_interval, TimeDelta check_interval,

View file

@ -44,7 +44,7 @@ TEST_F(CopyToFileAudioCapturerTest, Capture) {
// Destruct capturer to close wav file. // Destruct capturer to close wav file.
capturer_.reset(nullptr); capturer_.reset(nullptr);
// Read resulted file content with |wav_file_capture| and compare with // Read resulted file content with `wav_file_capture` and compare with
// what was captured. // what was captured.
std::unique_ptr<TestAudioDeviceModule::Capturer> wav_file_capturer = std::unique_ptr<TestAudioDeviceModule::Capturer> wav_file_capturer =
TestAudioDeviceModule::CreateWavFileReader(temp_filename_, 48000); TestAudioDeviceModule::CreateWavFileReader(temp_filename_, 48000);

View file

@ -75,7 +75,7 @@ std::string WorkingDir();
// Reads the content of a directory and, in case of success, returns a vector // Reads the content of a directory and, in case of success, returns a vector
// of strings with one element for each found file or directory. Each element is // of strings with one element for each found file or directory. Each element is
// a path created by prepending |dir| to the file/directory name. "." and ".." // a path created by prepending `dir` to the file/directory name. "." and ".."
// are never added in the returned vector. // are never added in the returned vector.
absl::optional<std::vector<std::string>> ReadDirectory(std::string path); absl::optional<std::vector<std::string>> ReadDirectory(std::string path);

View file

@ -39,7 +39,7 @@ std::string Path(const std::string& path) {
} }
// Remove files and directories in a directory non-recursively and writes the // Remove files and directories in a directory non-recursively and writes the
// number of deleted items in |num_deleted_entries|. // number of deleted items in `num_deleted_entries`.
void CleanDir(const std::string& dir, size_t* num_deleted_entries) { void CleanDir(const std::string& dir, size_t* num_deleted_entries) {
RTC_DCHECK(num_deleted_entries); RTC_DCHECK(num_deleted_entries);
*num_deleted_entries = 0; *num_deleted_entries = 0;

View file

@ -59,7 +59,7 @@ IvfVideoFrameGenerator::~IvfVideoFrameGenerator() {
} }
file_reader_->Close(); file_reader_->Close();
file_reader_.reset(); file_reader_.reset();
// Reset decoder to prevent it from async access to |this|. // Reset decoder to prevent it from async access to `this`.
video_decoder_.reset(); video_decoder_.reset();
{ {
MutexLock frame_lock(&frame_decode_lock_); MutexLock frame_lock(&frame_decode_lock_);

View file

@ -73,7 +73,7 @@ class IvfVideoFrameGenerator : public FrameGeneratorInterface {
// thread comparing to the one from which frames were read. // thread comparing to the one from which frames were read.
Mutex lock_; Mutex lock_;
// This lock is used to sync between sending and receiving frame from decoder. // This lock is used to sync between sending and receiving frame from decoder.
// We can't reuse |lock_| because then generator can be destroyed between // We can't reuse `lock_` because then generator can be destroyed between
// frame was sent to decoder and decoder callback was invoked. // frame was sent to decoder and decoder callback was invoked.
Mutex frame_decode_lock_; Mutex frame_decode_lock_;

View file

@ -78,7 +78,7 @@ class PerfResultReporter {
// Users should prefer AddResultList if possible, as otherwise the min/max // Users should prefer AddResultList if possible, as otherwise the min/max
// values reported on the perf dashboard aren't useful. // values reported on the perf dashboard aren't useful.
// |mean_and_error| should be a comma-separated string of mean then // `mean_and_error` should be a comma-separated string of mean then
// error/stddev, e.g. "2.4,0.5". // error/stddev, e.g. "2.4,0.5".
void AddResultMeanAndError(absl::string_view metric_suffix, void AddResultMeanAndError(absl::string_view metric_suffix,
const double mean, const double mean,

View file

@ -41,7 +41,7 @@ enum class ImproveDirection {
// //
// (test binary name) > (bot) > ramp_up_time_turn_over_tcp > bwe_15s. // (test binary name) > (bot) > ramp_up_time_turn_over_tcp > bwe_15s.
// //
// The |measurement| + |modifier| is what we're measuring. |user_story| is the // The `measurement` + `modifier` is what we're measuring. `user_story` is the
// scenario we're testing under. // scenario we're testing under.
// //
// The binary this runs in must be hooked up as a perf test in the WebRTC // The binary this runs in must be hooked up as a perf test in the WebRTC
@ -68,7 +68,7 @@ void PrintResultMeanAndError(
bool important, bool important,
ImproveDirection improve_direction = ImproveDirection::kNone); ImproveDirection improve_direction = ImproveDirection::kNone);
// Like PrintResult(), but prints an entire list of results. The |values| // Like PrintResult(), but prints an entire list of results. The `values`
// will generally be a list of comma-separated numbers. A typical // will generally be a list of comma-separated numbers. A typical
// post-processing step might produce plots of their mean and standard // post-processing step might produce plots of their mean and standard
// deviation. // deviation.
@ -99,8 +99,8 @@ void PrintResult(absl::string_view measurement,
std::string GetPerfResults(); std::string GetPerfResults();
// Print into stdout plottable metrics for further post processing. // Print into stdout plottable metrics for further post processing.
// |desired_graphs| - list of metrics, that should be plotted. If empty - all // `desired_graphs` - list of metrics, that should be plotted. If empty - all
// available metrics will be plotted. If some of |desired_graphs| are missing // available metrics will be plotted. If some of `desired_graphs` are missing
// they will be skipped. // they will be skipped.
void PrintPlottableResults(const std::vector<std::string>& desired_graphs); void PrintPlottableResults(const std::vector<std::string>& desired_graphs);

View file

@ -20,13 +20,13 @@ namespace webrtc {
namespace test { namespace test {
// If the test_artifacts_dir flag is set, returns true and copies the location // If the test_artifacts_dir flag is set, returns true and copies the location
// of the dir to |out_dir|. Otherwise, return false. // of the dir to `out_dir`. Otherwise, return false.
bool GetTestArtifactsDir(std::string* out_dir); bool GetTestArtifactsDir(std::string* out_dir);
// Writes a |length| bytes array |buffer| to |filename| in isolated output // Writes a `length` bytes array `buffer` to `filename` in isolated output
// directory defined by swarming. If the file is existing, content will be // directory defined by swarming. If the file is existing, content will be
// appended. Otherwise a new file will be created. This function returns false // appended. Otherwise a new file will be created. This function returns false
// if isolated output directory has not been defined, or |filename| indicates an // if isolated output directory has not been defined, or `filename` indicates an
// invalid or non-writable file, or underlying file system errors. // invalid or non-writable file, or underlying file system errors.
bool WriteToTestArtifactsDir(const char* filename, bool WriteToTestArtifactsDir(const char* filename,
const uint8_t* buffer, const uint8_t* buffer,

View file

@ -53,7 +53,7 @@ class ExternalTimeController : public TimeController, public TaskQueueFactory {
class TaskQueueWrapper; class TaskQueueWrapper;
// Executes any tasks scheduled at or before the current time. May call // Executes any tasks scheduled at or before the current time. May call
// |ScheduleNext| to schedule the next call to |Run|. // `ScheduleNext` to schedule the next call to `Run`.
void Run(); void Run();
void UpdateTime(); void UpdateTime();

View file

@ -98,7 +98,7 @@ void SimulatedTimeControllerImpl::RunReadyRunners() {
MutexLock lock(&lock_); MutexLock lock(&lock_);
RTC_DCHECK_EQ(rtc::CurrentThreadId(), thread_id_); RTC_DCHECK_EQ(rtc::CurrentThreadId(), thread_id_);
Timestamp current_time = CurrentTime(); Timestamp current_time = CurrentTime();
// Clearing |ready_runners_| in case this is a recursive call: // Clearing `ready_runners_` in case this is a recursive call:
// RunReadyRunners -> Run -> Event::Wait -> Yield ->RunReadyRunners // RunReadyRunners -> Run -> Event::Wait -> Yield ->RunReadyRunners
ready_runners_.clear(); ready_runners_.clear();
@ -118,8 +118,8 @@ void SimulatedTimeControllerImpl::RunReadyRunners() {
ready_runners_.pop_front(); ready_runners_.pop_front();
lock_.Unlock(); lock_.Unlock();
// Note that the RunReady function might indirectly cause a call to // Note that the RunReady function might indirectly cause a call to
// Unregister() which will grab |lock_| again to remove items from // Unregister() which will grab `lock_` again to remove items from
// |ready_runners_|. // `ready_runners_`.
runner->RunReady(current_time); runner->RunReady(current_time);
lock_.Lock(); lock_.Lock();
} }
@ -221,8 +221,8 @@ void GlobalSimulatedTimeController::AdvanceTime(TimeDelta duration) {
sim_clock_.AdvanceTimeMicroseconds(delta.us()); sim_clock_.AdvanceTimeMicroseconds(delta.us());
global_clock_.AdvanceTime(delta); global_clock_.AdvanceTime(delta);
} }
// After time has been simulated up until |target_time| we also need to run // After time has been simulated up until `target_time` we also need to run
// tasks meant to be executed at |target_time|. // tasks meant to be executed at `target_time`.
impl_.RunReadyRunners(); impl_.RunReadyRunners();
} }

View file

@ -58,32 +58,32 @@ class SimulatedTimeControllerImpl : public TaskQueueFactory,
// except that if this method is called from a task, the task queue running // except that if this method is called from a task, the task queue running
// that task is skipped. // that task is skipped.
void YieldExecution() RTC_LOCKS_EXCLUDED(time_lock_, lock_) override; void YieldExecution() RTC_LOCKS_EXCLUDED(time_lock_, lock_) override;
// Create process thread with the name |thread_name|. // Create process thread with the name `thread_name`.
std::unique_ptr<ProcessThread> CreateProcessThread(const char* thread_name) std::unique_ptr<ProcessThread> CreateProcessThread(const char* thread_name)
RTC_LOCKS_EXCLUDED(time_lock_, lock_); RTC_LOCKS_EXCLUDED(time_lock_, lock_);
// Create thread using provided |socket_server|. // Create thread using provided `socket_server`.
std::unique_ptr<rtc::Thread> CreateThread( std::unique_ptr<rtc::Thread> CreateThread(
const std::string& name, const std::string& name,
std::unique_ptr<rtc::SocketServer> socket_server) std::unique_ptr<rtc::SocketServer> socket_server)
RTC_LOCKS_EXCLUDED(time_lock_, lock_); RTC_LOCKS_EXCLUDED(time_lock_, lock_);
// Runs all runners in |runners_| that has tasks or modules ready for // Runs all runners in `runners_` that has tasks or modules ready for
// execution. // execution.
void RunReadyRunners() RTC_LOCKS_EXCLUDED(time_lock_, lock_); void RunReadyRunners() RTC_LOCKS_EXCLUDED(time_lock_, lock_);
// Return |current_time_|. // Return `current_time_`.
Timestamp CurrentTime() const RTC_LOCKS_EXCLUDED(time_lock_); Timestamp CurrentTime() const RTC_LOCKS_EXCLUDED(time_lock_);
// Return min of runner->GetNextRunTime() for runner in |runners_|. // Return min of runner->GetNextRunTime() for runner in `runners_`.
Timestamp NextRunTime() const RTC_LOCKS_EXCLUDED(lock_); Timestamp NextRunTime() const RTC_LOCKS_EXCLUDED(lock_);
// Set |current_time_| to |target_time|. // Set `current_time_` to `target_time`.
void AdvanceTime(Timestamp target_time) RTC_LOCKS_EXCLUDED(time_lock_); void AdvanceTime(Timestamp target_time) RTC_LOCKS_EXCLUDED(time_lock_);
// Adds |runner| to |runners_|. // Adds `runner` to `runners_`.
void Register(SimulatedSequenceRunner* runner) RTC_LOCKS_EXCLUDED(lock_); void Register(SimulatedSequenceRunner* runner) RTC_LOCKS_EXCLUDED(lock_);
// Removes |runner| from |runners_|. // Removes `runner` from `runners_`.
void Unregister(SimulatedSequenceRunner* runner) RTC_LOCKS_EXCLUDED(lock_); void Unregister(SimulatedSequenceRunner* runner) RTC_LOCKS_EXCLUDED(lock_);
// Indicates that |yielding_from| is not ready to run. // Indicates that `yielding_from` is not ready to run.
void StartYield(TaskQueueBase* yielding_from); void StartYield(TaskQueueBase* yielding_from);
// Indicates that processing can be continued on |yielding_from|. // Indicates that processing can be continued on `yielding_from`.
void StopYield(TaskQueueBase* yielding_from); void StopYield(TaskQueueBase* yielding_from);
private: private:

View file

@ -55,7 +55,7 @@ static void CodecSettings(VideoCodecType codec_type, VideoCodec* settings) {
*(settings->VP9()) = VideoEncoder::GetDefaultVp9Settings(); *(settings->VP9()) = VideoEncoder::GetDefaultVp9Settings();
return; return;
case kVideoCodecH264: case kVideoCodecH264:
// TODO(brandtr): Set |qpMax| here, when the OpenH264 wrapper supports it. // TODO(brandtr): Set `qpMax` here, when the OpenH264 wrapper supports it.
*(settings->H264()) = VideoEncoder::GetDefaultH264Settings(); *(settings->H264()) = VideoEncoder::GetDefaultH264Settings();
return; return;
default: default: