Format /video folder
Formatting done via:
git ls-files | grep -E '^video\/.*\.(h|cc|mm)' | xargs clang-format -i
No-Iwyu: Includes didn't change and it isn't related to formatting
Bug: webrtc:42225392
Change-Id: Ie7a700221e73a07fab702f84afc3871ddef269f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373904
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43686}
diff --git a/video/decode_synchronizer_unittest.cc b/video/decode_synchronizer_unittest.cc
index 2f4f890..78adc77 100644
--- a/video/decode_synchronizer_unittest.cc
+++ b/video/decode_synchronizer_unittest.cc
@@ -239,7 +239,7 @@
time_controller.GetMainThread());
absl::AnyInvocable<void() &&> callback;
EXPECT_CALL(metronome, RequestCallOnNextTick)
- .WillOnce(Invoke([&callback](absl::AnyInvocable<void() &&> cb) {
+ .WillOnce(Invoke([&callback](absl::AnyInvocable<void()&&> cb) {
callback = std::move(cb);
}));
auto scheduler = decode_synchronizer_.CreateSynchronizedFrameScheduler();
diff --git a/video/frame_dumping_encoder.cc b/video/frame_dumping_encoder.cc
index cb9c576..4528250 100644
--- a/video/frame_dumping_encoder.cc
+++ b/video/frame_dumping_encoder.cc
@@ -96,8 +96,8 @@
RTC_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
char filename_buffer[1024];
rtc::SimpleStringBuilder builder(filename_buffer);
- builder << output_directory_ << "/webrtc_encoded_frames"
- << "." << origin_time_micros_ << "." << index << ".ivf";
+ builder << output_directory_ << "/webrtc_encoded_frames" << "."
+ << origin_time_micros_ << "." << index << ".ivf";
return builder.str();
}
diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc
index 671416a..90f3a11 100644
--- a/video/receive_statistics_proxy.cc
+++ b/video/receive_statistics_proxy.cc
@@ -247,31 +247,31 @@
if (e2e_delay_ms) {
RTC_HISTOGRAM_COUNTS_SPARSE_10000(uma_prefix + ".EndToEndDelayInMs",
*e2e_delay_ms);
- log_stream << uma_prefix << ".EndToEndDelayInMs"
- << " " << *e2e_delay_ms << '\n';
+ log_stream << uma_prefix << ".EndToEndDelayInMs" << " " << *e2e_delay_ms
+ << '\n';
}
std::optional<int> e2e_delay_max_ms = stats.e2e_delay_counter.Max();
if (e2e_delay_max_ms && e2e_delay_ms) {
RTC_HISTOGRAM_COUNTS_SPARSE_100000(uma_prefix + ".EndToEndDelayMaxInMs",
*e2e_delay_max_ms);
- log_stream << uma_prefix << ".EndToEndDelayMaxInMs"
- << " " << *e2e_delay_max_ms << '\n';
+ log_stream << uma_prefix << ".EndToEndDelayMaxInMs" << " "
+ << *e2e_delay_max_ms << '\n';
}
std::optional<int> interframe_delay_ms =
stats.interframe_delay_counter.Avg(kMinRequiredSamples);
if (interframe_delay_ms) {
RTC_HISTOGRAM_COUNTS_SPARSE_10000(uma_prefix + ".InterframeDelayInMs",
*interframe_delay_ms);
- log_stream << uma_prefix << ".InterframeDelayInMs"
- << " " << *interframe_delay_ms << '\n';
+ log_stream << uma_prefix << ".InterframeDelayInMs" << " "
+ << *interframe_delay_ms << '\n';
}
std::optional<int> interframe_delay_max_ms =
stats.interframe_delay_counter.Max();
if (interframe_delay_max_ms && interframe_delay_ms) {
RTC_HISTOGRAM_COUNTS_SPARSE_10000(uma_prefix + ".InterframeDelayMaxInMs",
*interframe_delay_max_ms);
- log_stream << uma_prefix << ".InterframeDelayMaxInMs"
- << " " << *interframe_delay_max_ms << '\n';
+ log_stream << uma_prefix << ".InterframeDelayMaxInMs" << " "
+ << *interframe_delay_max_ms << '\n';
}
std::optional<uint32_t> interframe_delay_95p_ms =
@@ -280,24 +280,24 @@
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
uma_prefix + ".InterframeDelay95PercentileInMs",
*interframe_delay_95p_ms);
- log_stream << uma_prefix << ".InterframeDelay95PercentileInMs"
- << " " << *interframe_delay_95p_ms << '\n';
+ log_stream << uma_prefix << ".InterframeDelay95PercentileInMs" << " "
+ << *interframe_delay_95p_ms << '\n';
}
std::optional<int> width = stats.received_width.Avg(kMinRequiredSamples);
if (width) {
RTC_HISTOGRAM_COUNTS_SPARSE_10000(uma_prefix + ".ReceivedWidthInPixels",
*width);
- log_stream << uma_prefix << ".ReceivedWidthInPixels"
- << " " << *width << '\n';
+ log_stream << uma_prefix << ".ReceivedWidthInPixels" << " " << *width
+ << '\n';
}
std::optional<int> height = stats.received_height.Avg(kMinRequiredSamples);
if (height) {
RTC_HISTOGRAM_COUNTS_SPARSE_10000(uma_prefix + ".ReceivedHeightInPixels",
*height);
- log_stream << uma_prefix << ".ReceivedHeightInPixels"
- << " " << *height << '\n';
+ log_stream << uma_prefix << ".ReceivedHeightInPixels" << " " << *height
+ << '\n';
}
std::optional<double> corruption_score = stats.corruption_score.GetMean();
@@ -320,8 +320,8 @@
flow_duration_sec / 1000);
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
uma_prefix + ".MediaBitrateReceivedInKbps", media_bitrate_kbps);
- log_stream << uma_prefix << ".MediaBitrateReceivedInKbps"
- << " " << media_bitrate_kbps << '\n';
+ log_stream << uma_prefix << ".MediaBitrateReceivedInKbps" << " "
+ << media_bitrate_kbps << '\n';
}
int num_total_frames =
@@ -332,15 +332,14 @@
(num_key_frames * 1000 + num_total_frames / 2) / num_total_frames;
RTC_HISTOGRAM_COUNTS_SPARSE_1000(
uma_prefix + ".KeyFramesReceivedInPermille", key_frames_permille);
- log_stream << uma_prefix << ".KeyFramesReceivedInPermille"
- << " " << key_frames_permille << '\n';
+ log_stream << uma_prefix << ".KeyFramesReceivedInPermille" << " "
+ << key_frames_permille << '\n';
}
std::optional<int> qp = stats.qp_counter.Avg(kMinRequiredSamples);
if (qp) {
RTC_HISTOGRAM_COUNTS_SPARSE_200(uma_prefix + ".Decoded.Vp8.Qp", *qp);
- log_stream << uma_prefix << ".Decoded.Vp8.Qp"
- << " " << *qp << '\n';
+ log_stream << uma_prefix << ".Decoded.Vp8.Qp" << " " << *qp << '\n';
}
}
}
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index 8620c62..a7e2440 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -1444,8 +1444,7 @@
if (!encoder_initialized_) {
RTC_LOG(LS_WARNING) << "Failed to initialize "
<< CodecTypeToPayloadString(codec.codecType)
- << " encoder."
- << "switch_encoder_on_init_failures: "
+ << " encoder." << "switch_encoder_on_init_failures: "
<< switch_encoder_on_init_failures_;
if (switch_encoder_on_init_failures_) {
@@ -2158,45 +2157,45 @@
// need to update on quality convergence.
unsigned int image_width = image_copy._encodedWidth;
unsigned int image_height = image_copy._encodedHeight;
- encoder_queue_->PostTask([this, codec_type, image_width, image_height,
- simulcast_index, qp = image_copy.qp_,
- is_steady_state_refresh_frame =
- image_copy.IsSteadyStateRefreshFrame()] {
- RTC_DCHECK_RUN_ON(encoder_queue_.get());
+ encoder_queue_->PostTask(
+ [this, codec_type, image_width, image_height, simulcast_index,
+ qp = image_copy.qp_,
+ is_steady_state_refresh_frame = image_copy.IsSteadyStateRefreshFrame()] {
+ RTC_DCHECK_RUN_ON(encoder_queue_.get());
- // Check if the encoded image has reached target quality.
- bool at_target_quality =
- quality_convergence_controller_.AddSampleAndCheckTargetQuality(
- simulcast_index, qp, is_steady_state_refresh_frame);
+ // Check if the encoded image has reached target quality.
+ bool at_target_quality =
+ quality_convergence_controller_.AddSampleAndCheckTargetQuality(
+ simulcast_index, qp, is_steady_state_refresh_frame);
- // Let the frame cadence adapter know about quality convergence.
- if (frame_cadence_adapter_)
- frame_cadence_adapter_->UpdateLayerQualityConvergence(simulcast_index,
- at_target_quality);
+ // Let the frame cadence adapter know about quality convergence.
+ if (frame_cadence_adapter_)
+ frame_cadence_adapter_->UpdateLayerQualityConvergence(
+ simulcast_index, at_target_quality);
- // Currently, the internal quality scaler is used for VP9 instead of the
- // webrtc qp scaler (in the no-svc case or if only a single spatial layer is
- // encoded). It has to be explicitly detected and reported to adaptation
- // metrics.
- if (codec_type == VideoCodecType::kVideoCodecVP9 &&
- send_codec_.VP9()->automaticResizeOn) {
- unsigned int expected_width = send_codec_.width;
- unsigned int expected_height = send_codec_.height;
- int num_active_layers = 0;
- for (int i = 0; i < send_codec_.VP9()->numberOfSpatialLayers; ++i) {
- if (send_codec_.spatialLayers[i].active) {
- ++num_active_layers;
- expected_width = send_codec_.spatialLayers[i].width;
- expected_height = send_codec_.spatialLayers[i].height;
+ // Currently, the internal quality scaler is used for VP9 instead of the
+ // webrtc qp scaler (in the no-svc case or if only a single spatial
+ // layer is encoded). It has to be explicitly detected and reported to
+ // adaptation metrics.
+ if (codec_type == VideoCodecType::kVideoCodecVP9 &&
+ send_codec_.VP9()->automaticResizeOn) {
+ unsigned int expected_width = send_codec_.width;
+ unsigned int expected_height = send_codec_.height;
+ int num_active_layers = 0;
+ for (int i = 0; i < send_codec_.VP9()->numberOfSpatialLayers; ++i) {
+ if (send_codec_.spatialLayers[i].active) {
+ ++num_active_layers;
+ expected_width = send_codec_.spatialLayers[i].width;
+ expected_height = send_codec_.spatialLayers[i].height;
+ }
+ }
+ RTC_DCHECK_LE(num_active_layers, 1)
+ << "VP9 quality scaling is enabled for "
+ "SVC with several active layers.";
+ encoder_stats_observer_->OnEncoderInternalScalerUpdate(
+ image_width < expected_width || image_height < expected_height);
}
- }
- RTC_DCHECK_LE(num_active_layers, 1)
- << "VP9 quality scaling is enabled for "
- "SVC with several active layers.";
- encoder_stats_observer_->OnEncoderInternalScalerUpdate(
- image_width < expected_width || image_height < expected_height);
- }
- });
+ });
// Encoded is called on whatever thread the real encoder implementation run
// on. In the case of hardware encoders, there might be several encoders