mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
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:
parent
fad54cbc9d
commit
1ee563d5e0
57 changed files with 147 additions and 147 deletions
|
@ -40,10 +40,10 @@ class DefaultVideoStreamFactory
|
|||
const VideoEncoderConfig& encoder_config) override;
|
||||
};
|
||||
|
||||
// Creates |encoder_config.number_of_streams| VideoStreams where index
|
||||
// |encoder_config.number_of_streams -1| have width = |width|, height =
|
||||
// |height|. The total max bitrate of all VideoStreams is
|
||||
// |encoder_config.max_bitrate_bps|.
|
||||
// Creates `encoder_config.number_of_streams` VideoStreams where index
|
||||
// `encoder_config.number_of_streams -1` have width = `width`, height =
|
||||
// `height`. The total max bitrate of all VideoStreams is
|
||||
// `encoder_config.max_bitrate_bps`.
|
||||
std::vector<VideoStream> CreateVideoStreams(
|
||||
int width,
|
||||
int height,
|
||||
|
|
|
@ -83,8 +83,8 @@ class FakeEncoder : public VideoEncoder {
|
|||
int framerate) RTC_LOCKS_EXCLUDED(mutex_);
|
||||
|
||||
// Called before the frame is passed to callback_->OnEncodedImage, to let
|
||||
// subclasses fill out CodecSpecificInfo, possibly modify |encoded_image| or
|
||||
// |buffer|.
|
||||
// subclasses fill out CodecSpecificInfo, possibly modify `encoded_image` or
|
||||
// `buffer`.
|
||||
virtual CodecSpecificInfo EncodeHook(
|
||||
EncodedImage& encoded_image,
|
||||
rtc::scoped_refptr<EncodedImageBuffer> buffer);
|
||||
|
@ -139,7 +139,7 @@ class DelayedEncoder : public test::FakeEncoder {
|
|||
};
|
||||
|
||||
// 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,
|
||||
// as it is called from the task queue in VideoStreamEncoder.
|
||||
class MultithreadedFakeH264Encoder : public test::FakeH264Encoder {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
namespace {
|
||||
|
||||
// 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,
|
||||
int width,
|
||||
int height,
|
||||
|
|
|
@ -25,7 +25,7 @@ class FrameForwarder : public rtc::VideoSourceInterface<VideoFrame> {
|
|||
public:
|
||||
FrameForwarder();
|
||||
~FrameForwarder() override;
|
||||
// Forwards |video_frame| to the registered |sink_|.
|
||||
// Forwards `video_frame` to the registered `sink_`.
|
||||
virtual void IncomingCapturedFrame(const VideoFrame& video_frame)
|
||||
RTC_LOCKS_EXCLUDED(mutex_);
|
||||
rtc::VideoSinkWants sink_wants() const RTC_LOCKS_EXCLUDED(mutex_);
|
||||
|
|
|
@ -179,7 +179,7 @@ TEST_F(FrameGeneratorTest, SlideGenerator) {
|
|||
for (int i = 0; i < kGenCount; ++i) {
|
||||
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) {
|
||||
if (i % kRepeatCount == 0) {
|
||||
EXPECT_NE(hashes[i - 1], hashes[i]);
|
||||
|
|
|
@ -35,12 +35,12 @@ bool ParseInt(const uint8_t** data, size_t* remaining_size, T* value) {
|
|||
}
|
||||
} // 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
|
||||
// payload is inserted into the decoder, and the process continues until no more
|
||||
// data is available. Either AudioDecoder::Decode or
|
||||
// AudioDecoder::DecodeRedundant is used, depending on the value of
|
||||
// |decode_type|.
|
||||
// `decode_type`.
|
||||
void FuzzAudioDecoder(DecoderFunctionType decode_type,
|
||||
const uint8_t* data,
|
||||
size_t size,
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
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
|
||||
// no more data is available.
|
||||
void FuzzAudioEncoder(rtc::ArrayView<const uint8_t> data_view,
|
||||
|
|
|
@ -37,7 +37,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
|
|||
|
||||
// Fuzz non-POD member of the packet.
|
||||
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)));
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
|
|||
// Write parsed descriptor back into raw buffer.
|
||||
size_t value_size =
|
||||
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.
|
||||
RTC_CHECK_LE(value_size, raw.size());
|
||||
uint8_t some_memory[256];
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace webrtc {
|
||||
// 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.
|
||||
static_assert(kRtpExtensionNumberOfExtensions <= 32,
|
||||
"Insufficient bits read to configure all header extensions. Add "
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace webrtc {
|
||||
// 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.
|
||||
static_assert(kRtpExtensionNumberOfExtensions <= 32,
|
||||
"Insufficient bits read to configure all header extensions. Add "
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace test {
|
|||
|
||||
// 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
|
||||
// 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.
|
||||
class RtpReplayer final {
|
||||
public:
|
||||
|
|
|
@ -40,7 +40,7 @@ rtc::scoped_refptr<MappableNativeBuffer> GetMappableNativeBufferFromVideoFrame(
|
|||
// modules.
|
||||
class MappableNativeBuffer : public VideoFrameBuffer {
|
||||
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.
|
||||
MappableNativeBuffer(VideoFrameBuffer::Type mappable_type,
|
||||
int width,
|
||||
|
|
|
@ -68,7 +68,7 @@ class MockAudioEncoder : public AudioEncoder {
|
|||
|
||||
class FakeEncoding {
|
||||
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.
|
||||
explicit FakeEncoding(const AudioEncoder::EncodedInfo& info);
|
||||
|
||||
|
@ -88,7 +88,7 @@ class MockAudioEncoder : public AudioEncoder {
|
|||
public:
|
||||
~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
|
||||
// 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
|
||||
|
|
|
@ -85,7 +85,7 @@ class TcpMessageRouteImpl final : public TcpMessageRoute {
|
|||
EmulatedRoute* send_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
|
||||
// parameters are reset iff there's no currently pending message on the route.
|
||||
void SendMessage(size_t size, std::function<void()> on_received) override;
|
||||
|
|
|
@ -79,7 +79,7 @@ class PacketSocketFactoryWrapper : public rtc::PacketSocketFactory {
|
|||
~PacketSocketFactoryWrapper() override {}
|
||||
|
||||
// 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,
|
||||
uint16_t min_port,
|
||||
uint16_t max_port) override {
|
||||
|
|
|
@ -39,7 +39,7 @@ class EmulatedTURNServer : public EmulatedTURNServerInterface,
|
|||
public webrtc::EmulatedNetworkReceiverInterface {
|
||||
public:
|
||||
// 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.
|
||||
EmulatedTURNServer(std::unique_ptr<rtc::Thread> thread,
|
||||
EmulatedEndpoint* client,
|
||||
|
|
|
@ -185,7 +185,7 @@ int FakeNetworkSocket::Recv(void* pv, size_t cb, int64_t* 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.
|
||||
int FakeNetworkSocket::RecvFrom(void* pv,
|
||||
size_t cb,
|
||||
|
|
|
@ -456,10 +456,10 @@ class NetworkRouterNode : public EmulatedNetworkReceiverInterface {
|
|||
// NetworkBehaviorInterface that is provided on construction.
|
||||
class EmulatedNetworkNode : public EmulatedNetworkReceiverInterface {
|
||||
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
|
||||
// |network_behavior|.
|
||||
// |task_queue| is used to process packets and to forward the packets when
|
||||
// `network_behavior`.
|
||||
// `task_queue` is used to process packets and to forward the packets when
|
||||
// they are ready.
|
||||
EmulatedNetworkNode(
|
||||
Clock* clock,
|
||||
|
|
|
@ -31,9 +31,9 @@ class CrossTrafficRouteImpl final : public CrossTrafficRoute {
|
|||
EmulatedEndpointImpl* endpoint);
|
||||
~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;
|
||||
// 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,
|
||||
std::function<void()> action) override;
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ uint16_t DefaultVideoQualityAnalyzer::OnFrameCaptured(
|
|||
absl::string_view peer_name,
|
||||
const std::string& stream_label,
|
||||
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_++;
|
||||
Timestamp start_time = Timestamp::MinusInfinity();
|
||||
size_t peer_index = -1;
|
||||
|
@ -169,8 +169,8 @@ uint16_t DefaultVideoQualityAnalyzer::OnFrameCaptured(
|
|||
size_t stream_index;
|
||||
{
|
||||
MutexLock lock(&lock_);
|
||||
// Create a local copy of |start_time_|, peer's index and total peers count
|
||||
// to access it under |comparison_lock_| without holding a |lock_|
|
||||
// Create a local copy of `start_time_`, peer's index and total peers count
|
||||
// to access it under `comparison_lock_` without holding a `lock_`
|
||||
start_time = start_time_;
|
||||
peer_index = peers_->index(peer_name);
|
||||
peers_count = peers_->size();
|
||||
|
@ -191,10 +191,10 @@ uint16_t DefaultVideoQualityAnalyzer::OnFrameCaptured(
|
|||
// between freezes.
|
||||
stream_last_freeze_end_time_.insert({stats_key, start_time});
|
||||
} 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
|
||||
// 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.
|
||||
break;
|
||||
}
|
||||
|
@ -427,9 +427,9 @@ void DefaultVideoQualityAnalyzer::OnFrameRendered(
|
|||
state->Front(peer_index) != frame.id()) {
|
||||
dropped_count++;
|
||||
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
|
||||
// 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
|
||||
// 4. Cleanup dropped frame
|
||||
frame_counters_.dropped++;
|
||||
|
@ -566,7 +566,7 @@ void DefaultVideoQualityAnalyzer::Stop() {
|
|||
|
||||
// If there are no freezes in the call we have to report
|
||||
// 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
|
||||
// to last freeze end as time between freezes.
|
||||
if (stream_state.last_rendered_frame_time(i)) {
|
||||
|
@ -1185,7 +1185,7 @@ size_t DefaultVideoQualityAnalyzer::NamesCollection::AddIfAbsent(
|
|||
if (old_capacity == new_capacity) {
|
||||
index_.emplace(names_[out], out);
|
||||
} 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();
|
||||
for (size_t i = 0; i < names_.size(); ++i) {
|
||||
index_.emplace(names_[i], i);
|
||||
|
|
|
@ -274,11 +274,11 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
|
|||
|
||||
// Represents comparison between two VideoFrames. Contains video frames itself
|
||||
// and stats. Can be one of two types:
|
||||
// 1. Normal - in this case |captured| is presented and either |rendered| is
|
||||
// presented and |dropped| is false, either |rendered| is omitted and
|
||||
// |dropped| is true.
|
||||
// 2. Overloaded - in this case both |captured| and |rendered| are omitted
|
||||
// because there were too many comparisons in the queue. |dropped| can be
|
||||
// 1. Normal - in this case `captured` is presented and either `rendered` is
|
||||
// presented and `dropped` is false, either `rendered` is omitted and
|
||||
// `dropped` is true.
|
||||
// 2. Overloaded - in this case both `captured` and `rendered` are omitted
|
||||
// because there were too many comparisons in the queue. `dropped` can be
|
||||
// true or false showing was frame dropped or not.
|
||||
struct FrameComparison {
|
||||
FrameComparison(InternalStatsKey stats_key,
|
||||
|
@ -294,7 +294,7 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
|
|||
absl::optional<VideoFrame> captured;
|
||||
absl::optional<VideoFrame> rendered;
|
||||
// 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|.
|
||||
bool dropped;
|
||||
FrameStats frame_stats;
|
||||
|
@ -329,7 +329,7 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
|
|||
absl::optional<Timestamp> last_rendered_frame_time(size_t peer) const;
|
||||
|
||||
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_;
|
||||
// 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.
|
||||
|
@ -342,10 +342,10 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
|
|||
//
|
||||
// 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 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
|
||||
// |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.
|
||||
MultiHeadQueue<uint16_t> frame_ids_;
|
||||
std::map<size_t, Timestamp> last_rendered_frame_time_;
|
||||
|
@ -418,7 +418,7 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
|
|||
|
||||
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 {
|
||||
return receiver_stats_.at(peer).rendered_time;
|
||||
}
|
||||
|
@ -466,8 +466,8 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
|
|||
return index_.find(name) != index_.end();
|
||||
}
|
||||
|
||||
// Add specified |name| to the collection if it isn't presented.
|
||||
// Returns index which corresponds to specified |name|.
|
||||
// Add specified `name` to the collection if it isn't presented.
|
||||
// Returns index which corresponds to specified `name`.
|
||||
size_t AddIfAbsent(absl::string_view name);
|
||||
|
||||
private:
|
||||
|
@ -540,12 +540,12 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
|
|||
// Frame counters per each stream per each receiver.
|
||||
std::map<InternalStatsKey, FrameCounters> stream_frame_counters_
|
||||
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_);
|
||||
// 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_);
|
||||
|
||||
// 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
|
||||
// after 1st frame from simulcast streams was already rendered and last is
|
||||
// still encoding.
|
||||
|
|
|
@ -24,8 +24,8 @@ class EncodedImageDataInjector {
|
|||
public:
|
||||
virtual ~EncodedImageDataInjector() = default;
|
||||
|
||||
// Return encoded image with specified |id| and |discard| flag injected into
|
||||
// its payload. |discard| flag mean does analyzing decoder should discard this
|
||||
// Return encoded image with specified `id` and `discard` flag injected into
|
||||
// its payload. `discard` flag mean does analyzing decoder should discard this
|
||||
// encoded image because it belongs to unnecessary simulcast stream or spatial
|
||||
// layer.
|
||||
virtual EncodedImage InjectData(uint16_t id,
|
||||
|
@ -47,7 +47,7 @@ class EncodedImageDataExtractor {
|
|||
virtual ~EncodedImageDataExtractor() = default;
|
||||
|
||||
// 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.
|
||||
virtual void Start(int expected_receivers_count) = 0;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace webrtc_pc_e2e {
|
|||
template <typename T>
|
||||
class MultiHeadQueue {
|
||||
public:
|
||||
// Creates queue with exactly |readers_count| readers.
|
||||
// Creates queue with exactly `readers_count` readers.
|
||||
explicit MultiHeadQueue(size_t readers_count) {
|
||||
for (size_t i = 0; i < readers_count; ++i) {
|
||||
queues_.push_back(std::deque<T>());
|
||||
|
|
|
@ -85,8 +85,8 @@ int32_t QualityAnalyzingVideoDecoder::Decode(const EncodedImage& input_image,
|
|||
origin_image = &(
|
||||
decoding_images_.insert({out.id, std::move(out.image)}).first->second);
|
||||
}
|
||||
// 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
|
||||
// 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
|
||||
// removed inside DecodedImageCallback, which can be done on separate thread.
|
||||
analyzer_->OnFramePreDecode(peer_name_, out.id, *origin_image);
|
||||
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
|
||||
// exactly is implemented in |delegate_callback_|, so we need to call the same
|
||||
// method on |delegate_callback_|, as was called on |this| callback.
|
||||
// exactly is implemented in `delegate_callback_`, so we need to call the same
|
||||
// method on `delegate_callback_`, as was called on `this` callback.
|
||||
int32_t QualityAnalyzingVideoDecoder::DecoderCallback::Decoded(
|
||||
VideoFrame& decodedImage) {
|
||||
decoder_->OnFrameDecoded(&decodedImage, /*decode_time_ms=*/absl::nullopt,
|
||||
|
|
|
@ -245,7 +245,7 @@ EncodedImageCallback::Result QualityAnalyzingVideoEncoder::OnEncodedImage(
|
|||
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
|
||||
// multiple spatial layers for this frame, so encoder can produce more
|
||||
// encoded images with this timestamp. The first element will be removed
|
||||
|
|
|
@ -139,8 +139,8 @@ class QualityAnalyzingVideoEncoder : public VideoEncoder,
|
|||
const double bitrate_multiplier_;
|
||||
// Contains mapping from stream label to optional spatial index.
|
||||
// If we have stream label "Foo" and mapping contains
|
||||
// 1. |absl::nullopt| means "Foo" isn't simulcast/SVC stream
|
||||
// 2. |kAnalyzeAnySpatialStream| means all simulcast/SVC streams are required
|
||||
// 1. `absl::nullopt` means "Foo" isn't simulcast/SVC stream
|
||||
// 2. `kAnalyzeAnySpatialStream` means all simulcast/SVC streams are required
|
||||
// 3. Concrete value means that particular simulcast/SVC stream have to be
|
||||
// analyzed.
|
||||
std::map<std::string, absl::optional<int>> stream_required_spatial_index_;
|
||||
|
|
|
@ -44,7 +44,7 @@ class SingleProcessEncodedImageDataInjector : public EncodedImageDataInjector,
|
|||
~SingleProcessEncodedImageDataInjector() override;
|
||||
|
||||
// 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.
|
||||
EncodedImage InjectData(uint16_t id,
|
||||
bool discard,
|
||||
|
|
|
@ -68,13 +68,13 @@ class VideoQualityAnalyzerInjectionHelper : public StatsObserverInterface {
|
|||
|
||||
// Creates VideoFrame preprocessor, that will allow video quality analyzer to
|
||||
// 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>
|
||||
CreateFramePreprocessor(absl::string_view peer_name,
|
||||
const VideoConfig& config);
|
||||
// Creates sink, that will allow video quality analyzer to get access to
|
||||
// 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
|
||||
// into that file.
|
||||
std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> CreateVideoSink(
|
||||
|
@ -84,8 +84,8 @@ class VideoQualityAnalyzerInjectionHelper : public StatsObserverInterface {
|
|||
rtc::ArrayView<const std::string> peer_names,
|
||||
int max_threads_count = 1);
|
||||
|
||||
// Forwards |stats_reports| for Peer Connection |pc_label| to
|
||||
// |analyzer_|.
|
||||
// Forwards `stats_reports` for Peer Connection `pc_label` to
|
||||
// `analyzer_`.
|
||||
void OnStatsReports(
|
||||
absl::string_view pc_label,
|
||||
const rtc::scoped_refptr<const RTCStatsReport>& report) override;
|
||||
|
|
|
@ -66,9 +66,9 @@ constexpr char kFlexFecEnabledFieldTrials[] =
|
|||
|
||||
class FixturePeerConnectionObserver : public MockPeerConnectionObserver {
|
||||
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.
|
||||
// |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
|
||||
// of reconnect this callback can be called again, so it should be tolerant
|
||||
// to such behavior.
|
||||
|
@ -197,7 +197,7 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) {
|
|||
video_quality_analyzer_injection_helper_.get(), task_queue_factory_.get(),
|
||||
time_controller_.GetClock());
|
||||
|
||||
// Create a |task_queue_|.
|
||||
// Create a `task_queue_`.
|
||||
task_queue_ = std::make_unique<webrtc::TaskQueueForTest>(
|
||||
time_controller_.GetTaskQueueFactory()->CreateTaskQueue(
|
||||
"pc_e2e_quality_test", webrtc::TaskQueueFactory::Priority::NORMAL));
|
||||
|
@ -350,7 +350,7 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) {
|
|||
stats_poller.PollStatsAndNotifyObservers();
|
||||
},
|
||||
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.
|
||||
alice_->DetachAecDump();
|
||||
bob_->DetachAecDump();
|
||||
|
@ -372,7 +372,7 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) {
|
|||
reporter->StopAndReportResults();
|
||||
}
|
||||
|
||||
// Reset |task_queue_| after test to cleanup.
|
||||
// Reset `task_queue_` after test to cleanup.
|
||||
task_queue_.reset();
|
||||
|
||||
alice_ = nullptr;
|
||||
|
|
|
@ -103,14 +103,14 @@ struct InjectableComponents {
|
|||
struct Params {
|
||||
// Peer name. If empty - default one will be set by the fixture.
|
||||
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;
|
||||
// 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;
|
||||
// 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.
|
||||
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.
|
||||
absl::optional<std::string> aec_dump_path;
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ std::vector<RtpCodecCapability> FilterVideoCodecCapabilities(
|
|||
// If offer has no simulcast video sections - do nothing.
|
||||
//
|
||||
// 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(
|
||||
SessionDescriptionInterface* offer) {
|
||||
for (auto& content : offer->description()->contents()) {
|
||||
|
@ -227,7 +227,7 @@ LocalAndRemoteSdp SignalingInterceptor::PatchVp8Offer(
|
|||
|
||||
// Remove simulcast video section from offer.
|
||||
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;
|
||||
|
||||
// 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.
|
||||
std::unique_ptr<cricket::MediaContentDescription> media_desc =
|
||||
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.
|
||||
simulcast_content = nullptr;
|
||||
|
||||
|
@ -419,7 +419,7 @@ LocalAndRemoteSdp SignalingInterceptor::PatchVp8Answer(
|
|||
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
|
||||
std::vector<webrtc::RtpExtension> extensions =
|
||||
media_desc->rtp_header_extensions();
|
||||
|
|
|
@ -30,15 +30,15 @@ namespace webrtc_pc_e2e {
|
|||
|
||||
// Creates list of capabilities, which can be set on RtpTransceiverInterface via
|
||||
// RtpTransceiverInterface::SetCodecPreferences(...) to negotiate use of codecs
|
||||
// from list of |supported_codecs| which will match |video_codecs|. If flags
|
||||
// |ulpfec| or |flexfec| set to true corresponding FEC codec will be added.
|
||||
// from list of `supported_codecs` which will match `video_codecs`. If flags
|
||||
// `ulpfec` or `flexfec` set to true corresponding FEC codec will be added.
|
||||
// FEC and RTX codecs will be added after required codecs.
|
||||
//
|
||||
// All codecs will be added only if they exists in the list of
|
||||
// |supported_codecs|. If multiple codecs from this list will match
|
||||
// |video_codecs|, then all of them will be added to the output
|
||||
// `supported_codecs`. If multiple codecs from this list will match
|
||||
// `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
|
||||
// |supported_codecs|.
|
||||
// `supported_codecs`.
|
||||
std::vector<RtpCodecCapability> FilterVideoCodecCapabilities(
|
||||
rtc::ArrayView<const PeerConnectionE2EQualityTestFixture::VideoCodecConfig>
|
||||
video_codecs,
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace webrtc_pc_e2e {
|
|||
class StatsBasedNetworkQualityMetricsReporter
|
||||
: public PeerConnectionE2EQualityTestFixture::QualityMetricsReporter {
|
||||
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.
|
||||
StatsBasedNetworkQualityMetricsReporter(
|
||||
std::map<std::string, std::vector<EmulatedEndpoint*>> peer_endpoints,
|
||||
|
|
|
@ -68,10 +68,10 @@ class TestActivitiesExecutor {
|
|||
// yet.
|
||||
Timestamp start_time_ RTC_GUARDED_BY(lock_) = Timestamp::MinusInfinity();
|
||||
// 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.
|
||||
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.
|
||||
std::vector<RepeatingTaskHandle> repeating_task_handles_
|
||||
RTC_GUARDED_BY(lock_);
|
||||
|
|
|
@ -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(
|
||||
std::vector<std::unique_ptr<IceCandidateInterface>> candidates);
|
||||
|
||||
|
@ -135,7 +135,7 @@ class TestPeer final {
|
|||
std::unique_ptr<rtc::Thread> worker_thread);
|
||||
|
||||
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<PeerConnectionWrapper> wrapper_;
|
||||
std::unique_ptr<Params> params_;
|
||||
|
|
|
@ -42,8 +42,8 @@ using EchoEmulationConfig = ::webrtc::webrtc_pc_e2e::
|
|||
constexpr int16_t kGeneratedAudioMaxAmplitude = 32000;
|
||||
constexpr int kDefaultSamplingFrequencyInHz = 48000;
|
||||
|
||||
// Sets mandatory entities in injectable components like |pcf_dependencies|
|
||||
// and |pc_dependencies| if they are omitted. Also setup required
|
||||
// Sets mandatory entities in injectable components like `pcf_dependencies`
|
||||
// and `pc_dependencies` if they are omitted. Also setup required
|
||||
// dependencies, that won't be specially provided by factory and will be just
|
||||
// transferred to peer connection creation code.
|
||||
void SetMandatoryEntities(InjectableComponents* components,
|
||||
|
@ -74,7 +74,7 @@ void SetMandatoryEntities(InjectableComponents* components,
|
|||
// Returns mapping from stream label to optional spatial index.
|
||||
// If we have stream label "Foo" and mapping contains
|
||||
// 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
|
||||
// analyzed.
|
||||
std::map<std::string, absl::optional<int>>
|
||||
|
|
|
@ -46,13 +46,13 @@ struct RemotePeerAudioConfig {
|
|||
class TestPeerFactory {
|
||||
public:
|
||||
// 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.
|
||||
// |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.
|
||||
// |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.
|
||||
// |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,
|
||||
TimeController& time_controller,
|
||||
VideoQualityAnalyzerInjectionHelper* video_analyzer_helper,
|
||||
|
|
|
@ -78,14 +78,14 @@ class PeerScenario {
|
|||
std::vector<EmulatedNetworkNode*> send_link,
|
||||
std::vector<EmulatedNetworkNode*> ret_link);
|
||||
|
||||
// Starts feeding the results of comparing captured frames from |send_track|
|
||||
// with decoded frames on |receiver| to |analyzer|.
|
||||
// Starts feeding the results of comparing captured frames from `send_track`
|
||||
// with decoded frames on `receiver` to `analyzer`.
|
||||
// TODO(srte): Provide a way to detach to allow removal of tracks.
|
||||
void AttachVideoQualityAnalyzer(VideoQualityAnalyzer* analyzer,
|
||||
VideoTrackInterface* send_track,
|
||||
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,
|
||||
TimeDelta max_duration = TimeDelta::Seconds(5));
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class PeerScenarioClient {
|
|||
struct Video {
|
||||
bool use_fake_codecs = false;
|
||||
} 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).
|
||||
std::map<int, EmulatedEndpointConfig> endpoints = {
|
||||
{0, EmulatedEndpointConfig()}};
|
||||
|
@ -137,7 +137,7 @@ class PeerScenarioClient {
|
|||
|
||||
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
|
||||
// legacy behavior. It's added here only to be able to have test coverage for
|
||||
// scenarios even if they are not spec compliant.
|
||||
|
|
|
@ -30,12 +30,12 @@ class SignalingRoute {
|
|||
|
||||
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.
|
||||
// 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
|
||||
// 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.
|
||||
// TODO(srte): Handle lossy links.
|
||||
void NegotiateSdp(
|
||||
|
|
|
@ -210,7 +210,7 @@ TEST_P(UnsignaledStreamTest, ReplacesUnsignaledStreamOnCompletedSignaling) {
|
|||
case MidTestConfiguration::kMidNegotiatedAndPresentInPackets:
|
||||
EXPECT_TRUE(parsed_packet.HasExtension<RtpMid>());
|
||||
// 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
|
||||
// conflicts if we later add the same SSRC to a second m=
|
||||
// section. Hidden assumption: first m= section does not use
|
||||
|
|
|
@ -22,7 +22,7 @@ struct RtpPacket {
|
|||
static const size_t kMaxPacketBufferSize = 3500;
|
||||
uint8_t data[kMaxPacketBufferSize];
|
||||
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.
|
||||
size_t original_length;
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ ColumnPrinter CallClient::StatsPrinter() {
|
|||
}
|
||||
|
||||
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;
|
||||
SendTask([this, &stats] { stats = call_->GetStats(); });
|
||||
return stats;
|
||||
|
|
|
@ -98,7 +98,7 @@ class Scenario {
|
|||
AudioStreamConfig config);
|
||||
|
||||
// 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()> function);
|
||||
|
||||
|
@ -107,21 +107,21 @@ class Scenario {
|
|||
void Post(std::function<void()> function);
|
||||
|
||||
// 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().
|
||||
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,
|
||||
size_t packet_size,
|
||||
std::function<void()> action);
|
||||
|
||||
// Runs the scenario for the given time.
|
||||
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);
|
||||
// Runs the scenario until |target_time_since_start| or |exit_function|
|
||||
// returns true. |exit_function| is polled after each |check_interval| has
|
||||
// Runs the scenario until `target_time_since_start` or `exit_function`
|
||||
// returns true. `exit_function` is polled after each `check_interval` has
|
||||
// passed.
|
||||
void RunUntil(TimeDelta target_time_since_start,
|
||||
TimeDelta check_interval,
|
||||
|
|
|
@ -44,7 +44,7 @@ TEST_F(CopyToFileAudioCapturerTest, Capture) {
|
|||
// Destruct capturer to close wav file.
|
||||
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.
|
||||
std::unique_ptr<TestAudioDeviceModule::Capturer> wav_file_capturer =
|
||||
TestAudioDeviceModule::CreateWavFileReader(temp_filename_, 48000);
|
||||
|
|
|
@ -75,7 +75,7 @@ std::string WorkingDir();
|
|||
|
||||
// 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
|
||||
// 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.
|
||||
absl::optional<std::vector<std::string>> ReadDirectory(std::string path);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ std::string Path(const std::string& path) {
|
|||
}
|
||||
|
||||
// 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) {
|
||||
RTC_DCHECK(num_deleted_entries);
|
||||
*num_deleted_entries = 0;
|
||||
|
|
|
@ -59,7 +59,7 @@ IvfVideoFrameGenerator::~IvfVideoFrameGenerator() {
|
|||
}
|
||||
file_reader_->Close();
|
||||
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();
|
||||
{
|
||||
MutexLock frame_lock(&frame_decode_lock_);
|
||||
|
|
|
@ -73,7 +73,7 @@ class IvfVideoFrameGenerator : public FrameGeneratorInterface {
|
|||
// thread comparing to the one from which frames were read.
|
||||
Mutex lock_;
|
||||
// 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.
|
||||
Mutex frame_decode_lock_;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ class PerfResultReporter {
|
|||
|
||||
// Users should prefer AddResultList if possible, as otherwise the min/max
|
||||
// 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".
|
||||
void AddResultMeanAndError(absl::string_view metric_suffix,
|
||||
const double mean,
|
||||
|
|
|
@ -41,7 +41,7 @@ enum class ImproveDirection {
|
|||
//
|
||||
// (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.
|
||||
//
|
||||
// The binary this runs in must be hooked up as a perf test in the WebRTC
|
||||
|
@ -68,7 +68,7 @@ void PrintResultMeanAndError(
|
|||
bool important,
|
||||
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
|
||||
// post-processing step might produce plots of their mean and standard
|
||||
// deviation.
|
||||
|
@ -99,8 +99,8 @@ void PrintResult(absl::string_view measurement,
|
|||
std::string GetPerfResults();
|
||||
|
||||
// Print into stdout plottable metrics for further post processing.
|
||||
// |desired_graphs| - list of metrics, that should be plotted. If empty - all
|
||||
// available metrics will be plotted. If some of |desired_graphs| are missing
|
||||
// `desired_graphs` - list of metrics, that should be plotted. If empty - all
|
||||
// available metrics will be plotted. If some of `desired_graphs` are missing
|
||||
// they will be skipped.
|
||||
void PrintPlottableResults(const std::vector<std::string>& desired_graphs);
|
||||
|
||||
|
|
|
@ -20,13 +20,13 @@ namespace webrtc {
|
|||
namespace test {
|
||||
|
||||
// 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);
|
||||
|
||||
// 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
|
||||
// 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.
|
||||
bool WriteToTestArtifactsDir(const char* filename,
|
||||
const uint8_t* buffer,
|
||||
|
|
|
@ -53,7 +53,7 @@ class ExternalTimeController : public TimeController, public TaskQueueFactory {
|
|||
class TaskQueueWrapper;
|
||||
|
||||
// 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 UpdateTime();
|
||||
|
|
|
@ -98,7 +98,7 @@ void SimulatedTimeControllerImpl::RunReadyRunners() {
|
|||
MutexLock lock(&lock_);
|
||||
RTC_DCHECK_EQ(rtc::CurrentThreadId(), thread_id_);
|
||||
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
|
||||
ready_runners_.clear();
|
||||
|
||||
|
@ -118,8 +118,8 @@ void SimulatedTimeControllerImpl::RunReadyRunners() {
|
|||
ready_runners_.pop_front();
|
||||
lock_.Unlock();
|
||||
// Note that the RunReady function might indirectly cause a call to
|
||||
// Unregister() which will grab |lock_| again to remove items from
|
||||
// |ready_runners_|.
|
||||
// Unregister() which will grab `lock_` again to remove items from
|
||||
// `ready_runners_`.
|
||||
runner->RunReady(current_time);
|
||||
lock_.Lock();
|
||||
}
|
||||
|
@ -221,8 +221,8 @@ void GlobalSimulatedTimeController::AdvanceTime(TimeDelta duration) {
|
|||
sim_clock_.AdvanceTimeMicroseconds(delta.us());
|
||||
global_clock_.AdvanceTime(delta);
|
||||
}
|
||||
// After time has been simulated up until |target_time| we also need to run
|
||||
// tasks meant to be executed at |target_time|.
|
||||
// After time has been simulated up until `target_time` we also need to run
|
||||
// tasks meant to be executed at `target_time`.
|
||||
impl_.RunReadyRunners();
|
||||
}
|
||||
|
||||
|
|
|
@ -58,32 +58,32 @@ class SimulatedTimeControllerImpl : public TaskQueueFactory,
|
|||
// except that if this method is called from a task, the task queue running
|
||||
// that task is skipped.
|
||||
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)
|
||||
RTC_LOCKS_EXCLUDED(time_lock_, lock_);
|
||||
// Create thread using provided |socket_server|.
|
||||
// Create thread using provided `socket_server`.
|
||||
std::unique_ptr<rtc::Thread> CreateThread(
|
||||
const std::string& name,
|
||||
std::unique_ptr<rtc::SocketServer> socket_server)
|
||||
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.
|
||||
void RunReadyRunners() RTC_LOCKS_EXCLUDED(time_lock_, lock_);
|
||||
// Return |current_time_|.
|
||||
// Return `current_time_`.
|
||||
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_);
|
||||
// Set |current_time_| to |target_time|.
|
||||
// Set `current_time_` to `target_time`.
|
||||
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_);
|
||||
// Removes |runner| from |runners_|.
|
||||
// Removes `runner` from `runners_`.
|
||||
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);
|
||||
// Indicates that processing can be continued on |yielding_from|.
|
||||
// Indicates that processing can be continued on `yielding_from`.
|
||||
void StopYield(TaskQueueBase* yielding_from);
|
||||
|
||||
private:
|
||||
|
|
|
@ -55,7 +55,7 @@ static void CodecSettings(VideoCodecType codec_type, VideoCodec* settings) {
|
|||
*(settings->VP9()) = VideoEncoder::GetDefaultVp9Settings();
|
||||
return;
|
||||
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();
|
||||
return;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue