Format the rest

git ls-files | grep -e  "\(\.h\|\.cc\)$" | grep -vE "^(rtc_base|sdk|modules|api|call|common_audio|examples|media|net|p2p|pc)/" | xargs clang-format -i ; git cl format
after landing: add to .git-blame-ignore-revs

Bug: webrtc:15082
Change-Id: I9c7fc4e6fbb023809fb22a89a78be713de6990d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302063
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39978}
This commit is contained in:
Jared Siskin 2023-05-03 12:06:14 +03:00 committed by WebRTC LUCI CQ
parent bceec84aee
commit 7220ee97aa
24 changed files with 319 additions and 325 deletions

View file

@ -24,8 +24,6 @@ ProtobufPlot::~ProtobufPlot() {}
void ProtobufPlot::Draw() {}
ProtobufPlotCollection::ProtobufPlotCollection() {}
ProtobufPlotCollection::~ProtobufPlotCollection() {}

View file

@ -32,8 +32,8 @@ namespace webrtc {
namespace metrics_impl {
template <typename... Ts>
void NoOp(const Ts&...) {}
}
}
} // namespace metrics_impl
} // namespace webrtc
#if RTC_METRICS_ENABLED
#define EXPECT_METRIC_EQ(val1, val2) EXPECT_EQ(val1, val2)
@ -46,12 +46,16 @@ void NoOp(const Ts&...) {}
#define EXPECT_METRIC_THAT(value, matcher) EXPECT_THAT(value, matcher)
#else
#define EXPECT_METRIC_EQ(val1, val2) webrtc::metrics_impl::NoOp(val1, val2)
#define EXPECT_METRIC_EQ_WAIT(val1, val2, timeout) webrtc::metrics_impl::NoOp(val1, val2, timeout)
#define EXPECT_METRIC_EQ_WAIT(val1, val2, timeout) \
webrtc::metrics_impl::NoOp(val1, val2, timeout)
#define EXPECT_METRIC_GT(val1, val2) webrtc::metrics_impl::NoOp(val1, val2)
#define EXPECT_METRIC_LE(val1, val2) webrtc::metrics_impl::NoOp(val1, val2)
#define EXPECT_METRIC_TRUE(condition) webrtc::metrics_impl::NoOp(condition || true)
#define EXPECT_METRIC_FALSE(condition) webrtc::metrics_impl::NoOp(condition && false)
#define EXPECT_METRIC_THAT(value, matcher) webrtc::metrics_impl::NoOp(value, testing::_)
#define EXPECT_METRIC_TRUE(condition) \
webrtc::metrics_impl::NoOp(condition || true)
#define EXPECT_METRIC_FALSE(condition) \
webrtc::metrics_impl::NoOp(condition && false)
#define EXPECT_METRIC_THAT(value, matcher) \
webrtc::metrics_impl::NoOp(value, testing::_)
#endif
#if RTC_METRICS_ENABLED
@ -278,17 +282,23 @@ void NoOp(const Ts&...) {}
// This section defines no-op alternatives to the metrics macros when
// RTC_METRICS_ENABLED is defined.
#define RTC_HISTOGRAM_COUNTS_100(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_100(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_200(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_200(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_500(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_500(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_1000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_1000(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_10000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_10000(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_100000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_100000(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS(name, sample, min, max, bucket_count) \
webrtc::metrics_impl::NoOp(name, sample, min, max, bucket_count)
@ -296,31 +306,41 @@ void NoOp(const Ts&...) {}
#define RTC_HISTOGRAM_COUNTS_LINEAR(name, sample, min, max, bucket_count) \
webrtc::metrics_impl::NoOp(name, sample, min, max, bucket_count)
#define RTC_HISTOGRAM_COUNTS_SPARSE_100(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_100(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_200(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_200(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_500(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_500(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_1000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_1000(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_10000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_10000(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_100000(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE_100000(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_COUNTS_SPARSE(name, sample, min, max, bucket_count) \
webrtc::metrics_impl::NoOp(name, sample, min, max, bucket_count)
#define RTC_HISTOGRAM_PERCENTAGE_SPARSE(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_PERCENTAGE_SPARSE(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_BOOLEAN_SPARSE(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_BOOLEAN_SPARSE(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_ENUMERATION_SPARSE(name, sample, boundary) \
webrtc::metrics_impl::NoOp(name, sample, boundary)
#define RTC_HISTOGRAM_PERCENTAGE(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_PERCENTAGE(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_BOOLEAN(name, sample) webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_BOOLEAN(name, sample) \
webrtc::metrics_impl::NoOp(name, sample)
#define RTC_HISTOGRAM_ENUMERATION(name, sample, boundary) \
webrtc::metrics_impl::NoOp(name, sample, boundary)
@ -332,11 +352,14 @@ void NoOp(const Ts&...) {}
#define RTC_HISTOGRAM_COMMON_BLOCK_SLOW(name, sample, factory_get_invocation) \
webrtc::metrics_impl::NoOp(name, sample, factory_get_invocation)
#define RTC_HISTOGRAMS_COUNTS_100(index, name, sample) webrtc::metrics_impl::NoOp(index, name, sample)
#define RTC_HISTOGRAMS_COUNTS_100(index, name, sample) \
webrtc::metrics_impl::NoOp(index, name, sample)
#define RTC_HISTOGRAMS_COUNTS_200(index, name, sample) webrtc::metrics_impl::NoOp(index, name, sample)
#define RTC_HISTOGRAMS_COUNTS_200(index, name, sample) \
webrtc::metrics_impl::NoOp(index, name, sample)
#define RTC_HISTOGRAMS_COUNTS_500(index, name, sample) webrtc::metrics_impl::NoOp(index, name, sample)
#define RTC_HISTOGRAMS_COUNTS_500(index, name, sample) \
webrtc::metrics_impl::NoOp(index, name, sample)
#define RTC_HISTOGRAMS_COUNTS_1000(index, name, sample) \
webrtc::metrics_impl::NoOp(index, name, sample)
@ -350,7 +373,8 @@ void NoOp(const Ts&...) {}
#define RTC_HISTOGRAMS_ENUMERATION(index, name, sample, boundary) \
webrtc::metrics_impl::NoOp(index, name, sample, boundary)
#define RTC_HISTOGRAMS_PERCENTAGE(index, name, sample) webrtc::metrics_impl::NoOp(index, name, sample)
#define RTC_HISTOGRAMS_PERCENTAGE(index, name, sample) \
webrtc::metrics_impl::NoOp(index, name, sample)
#define RTC_HISTOGRAMS_COMMON(index, name, sample, macro_invocation) \
webrtc::metrics_impl::NoOp(index, name, sample, macro_invocation)

View file

@ -233,7 +233,6 @@ class CallTest : public ::testing::Test, public RtpPacketSinkInterface {
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory_;
test::FakeVideoRenderer fake_renderer_;
private:
absl::optional<RtpExtension> GetRtpExtensionByUri(
const std::string& uri) const;

View file

@ -92,8 +92,8 @@ void FuzzGainController(test::FuzzDataHelper* fuzz_data, GainControlImpl* gci) {
FuzzGainControllerConfig(fuzz_data, gci);
// The audio buffer is used for both capture and render.
AudioBuffer audio(sample_rate_hz, num_channels, sample_rate_hz,
num_channels, sample_rate_hz, num_channels);
AudioBuffer audio(sample_rate_hz, num_channels, sample_rate_hz, num_channels,
sample_rate_hz, num_channels);
std::vector<int16_t> packed_render_audio(samples_per_frame);

View file

@ -7,14 +7,13 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_av1.h"
#include <stddef.h>
#include <stdint.h>
#include <vector>
#include "api/array_view.h"
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_av1.h"
#include "test/fuzzers/fuzz_data_helper.h"
namespace webrtc {

View file

@ -142,8 +142,7 @@ TcpMessageRouteImpl::TcpMessageRouteImpl(Clock* clock,
void TcpMessageRouteImpl::SendMessage(size_t size,
std::function<void()> on_received) {
task_queue_->PostTask(
[this, size, handler = std::move(on_received)] {
task_queue_->PostTask([this, size, handler = std::move(on_received)] {
// If we are currently sending a message we won't reset the connection,
// we'll act as if the messages are sent in the same TCP stream. This is
// intended to simulate recreation of a TCP session for each message

View file

@ -113,7 +113,6 @@ void FakeNetworkSocket::OnPacketReceived(EmulatedIpPacket packet) {
socket_server_->WakeUp();
}
rtc::SocketAddress FakeNetworkSocket::GetLocalAddress() const {
RTC_DCHECK_RUN_ON(thread_);
return local_addr_;
@ -317,6 +316,5 @@ void FakeNetworkSocketServer::WakeUp() {
wakeup_.Set();
}
} // namespace test
} // namespace webrtc

View file

@ -32,7 +32,6 @@ class FakeNetworkSocketServer : public rtc::SocketServer {
explicit FakeNetworkSocketServer(EndpointsContainer* endpoints_controller);
~FakeNetworkSocketServer() override;
// rtc::SocketFactory methods:
rtc::Socket* CreateSocket(int family, int type) override;

View file

@ -32,9 +32,7 @@ class ActionReceiver : public EmulatedNetworkReceiverInterface {
explicit ActionReceiver(std::function<void()> action) : action_(action) {}
~ActionReceiver() override = default;
void OnPacketReceived(EmulatedIpPacket packet) override {
action_();
}
void OnPacketReceived(EmulatedIpPacket packet) override { action_(); }
private:
std::function<void()> action_;

View file

@ -61,7 +61,8 @@ TEST(RemoteEstimateEndToEnd, OfferedCapabilityIsInAnswer) {
}
TEST(RemoteEstimateEndToEnd, AudioUsesAbsSendTimeExtension) {
// Defined before PeerScenario so it gets destructed after, to avoid use after free.
// Defined before PeerScenario so it gets destructed after, to avoid use after
// free.
std::atomic<bool> received_abs_send_time(false);
PeerScenario s(*test_info_);

View file

@ -37,7 +37,6 @@ struct VideoFramePair {
int repeated = 0;
};
struct VideoFramesStats {
int count = 0;
SampleStats<double> pixels;

View file

@ -106,7 +106,6 @@ TEST(VideoStreamTest, ReceivesVp8SimulcastFrames) {
c->encoder.simulcast_streams = {webrtc::ScalabilityMode::kL1T1,
webrtc::ScalabilityMode::kL1T1,
webrtc::ScalabilityMode::kL1T1};
});
s.RunFor(kRunTime);
}

View file

@ -10,7 +10,6 @@
#include "test/testsupport/file_utils.h"
#if defined(WEBRTC_POSIX)
#include <unistd.h>
#endif

View file

@ -37,8 +37,7 @@ class VideoEncoderProxyFactory : public VideoEncoderFactory {
: encoder_(encoder),
encoder_selector_(encoder_selector),
num_simultaneous_encoder_instances_(0),
max_num_simultaneous_encoder_instances_(0) {
}
max_num_simultaneous_encoder_instances_(0) {}
// Unused by tests.
std::vector<SdpVideoFormat> GetSupportedFormats() const override {

View file

@ -98,8 +98,7 @@ TEST_F(CallOperationEndToEndTest, RendersSingleDelayedFrame) {
test::FrameForwarder frame_forwarder;
SendTask(
task_queue(), [this, &renderer, &frame_forwarder]() {
SendTask(task_queue(), [this, &renderer, &frame_forwarder]() {
CreateCalls();
CreateSendTransport(BuiltInNetworkBehaviorConfig(),
/*observer=*/nullptr);
@ -119,8 +118,8 @@ TEST_F(CallOperationEndToEndTest, RendersSingleDelayedFrame) {
std::unique_ptr<test::FrameGeneratorInterface> frame_generator(
test::CreateSquareFrameGenerator(kWidth, kHeight, absl::nullopt,
absl::nullopt));
GetVideoSendStream()->SetSource(
&frame_forwarder, DegradationPreference::MAINTAIN_FRAMERATE);
GetVideoSendStream()->SetSource(&frame_forwarder,
DegradationPreference::MAINTAIN_FRAMERATE);
test::FrameGeneratorInterface::VideoFrameData frame_data =
frame_generator->NextFrame();
@ -159,8 +158,8 @@ TEST_F(CallOperationEndToEndTest, TransmitsFirstFrame) {
std::unique_ptr<test::DirectTransport> sender_transport;
std::unique_ptr<test::DirectTransport> receiver_transport;
SendTask(
task_queue(), [this, &renderer, &frame_generator, &frame_forwarder]() {
SendTask(task_queue(), [this, &renderer, &frame_generator,
&frame_forwarder]() {
CreateCalls();
CreateSendTransport(BuiltInNetworkBehaviorConfig(),
/*observer=*/nullptr);
@ -176,10 +175,9 @@ TEST_F(CallOperationEndToEndTest, TransmitsFirstFrame) {
frame_generator = test::CreateSquareFrameGenerator(
test::VideoTestConstants::kDefaultWidth,
test::VideoTestConstants::kDefaultHeight, absl::nullopt,
absl::nullopt);
GetVideoSendStream()->SetSource(
&frame_forwarder, DegradationPreference::MAINTAIN_FRAMERATE);
test::VideoTestConstants::kDefaultHeight, absl::nullopt, absl::nullopt);
GetVideoSendStream()->SetSource(&frame_forwarder,
DegradationPreference::MAINTAIN_FRAMERATE);
test::FrameGeneratorInterface::VideoFrameData frame_data =
frame_generator->NextFrame();
VideoFrame frame = VideoFrame::Builder()

View file

@ -94,18 +94,15 @@ void NetworkStateEndToEndTest::VerifyNewVideoSendStreamsRespectNetworkState(
Transport* transport) {
test::VideoEncoderProxyFactory encoder_factory(encoder);
SendTask(task_queue(),
[this, network_to_bring_up, &encoder_factory, transport]() {
SendTask(task_queue(), [this, network_to_bring_up, &encoder_factory,
transport]() {
CreateSenderCall(Call::Config(send_event_log_.get()));
sender_call_->SignalChannelNetworkState(network_to_bring_up,
kNetworkUp);
sender_call_->SignalChannelNetworkState(network_to_bring_up, kNetworkUp);
CreateSendConfig(1, 0, 0, transport);
GetVideoSendConfig()->encoder_settings.encoder_factory =
&encoder_factory;
GetVideoSendConfig()->encoder_settings.encoder_factory = &encoder_factory;
CreateVideoStreams();
CreateFrameGeneratorCapturer(
test::VideoTestConstants::kDefaultFramerate,
CreateFrameGeneratorCapturer(test::VideoTestConstants::kDefaultFramerate,
test::VideoTestConstants::kDefaultWidth,
test::VideoTestConstants::kDefaultHeight);

View file

@ -95,23 +95,22 @@ TEST_F(SsrcEndToEndTest, UnknownRtpPacketTriggersUndemuxablePacketHandler) {
std::unique_ptr<test::DirectTransport> receive_transport;
std::unique_ptr<PacketInputObserver> input_observer;
SendTask(
task_queue(),
[this, &send_transport, &receive_transport, &input_observer]() {
SendTask(task_queue(), [this, &send_transport, &receive_transport,
&input_observer]() {
CreateCalls();
send_transport = std::make_unique<test::DirectTransport>(
task_queue(),
std::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), std::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
Clock::GetRealTimeClock(),
std::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig())),
sender_call_.get(), payload_type_map_, GetRegisteredExtensions(),
GetRegisteredExtensions());
receive_transport = std::make_unique<test::DirectTransport>(
task_queue(),
std::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), std::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
Clock::GetRealTimeClock(),
std::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig())),
receiver_call_.get(), payload_type_map_, GetRegisteredExtensions(),
GetRegisteredExtensions());
input_observer =
@ -123,8 +122,7 @@ TEST_F(SsrcEndToEndTest, UnknownRtpPacketTriggersUndemuxablePacketHandler) {
CreateMatchingReceiveConfigs(receive_transport.get());
CreateVideoStreams();
CreateFrameGeneratorCapturer(
test::VideoTestConstants::kDefaultFramerate,
CreateFrameGeneratorCapturer(test::VideoTestConstants::kDefaultFramerate,
test::VideoTestConstants::kDefaultWidth,
test::VideoTestConstants::kDefaultHeight);
Start();

View file

@ -516,8 +516,7 @@ TEST_F(StatsEndToEndTest, MAYBE_ContentTypeSwitches) {
VideoEncoderConfig encoder_config_with_screenshare;
SendTask(
task_queue(), [this, &test, &send_config, &recv_config,
SendTask(task_queue(), [this, &test, &send_config, &recv_config,
&encoder_config_with_screenshare]() {
CreateSenderCall(send_config);
CreateReceiverCall(recv_config);
@ -535,8 +534,7 @@ TEST_F(StatsEndToEndTest, MAYBE_ContentTypeSwitches) {
test::VideoTestConstants::kNackRtpHistoryMs;
video_receive_configs_[0].renderer = &test;
// RTT needed for RemoteNtpTimeEstimator for the receive stream.
video_receive_configs_[0].rtp.rtcp_xr.receiver_reference_time_report =
true;
video_receive_configs_[0].rtp.rtcp_xr.receiver_reference_time_report = true;
// Start with realtime video.
GetVideoEncoderConfig()->content_type =
VideoEncoderConfig::ContentType::kRealtimeVideo;
@ -546,8 +544,7 @@ TEST_F(StatsEndToEndTest, MAYBE_ContentTypeSwitches) {
VideoEncoderConfig::ContentType::kScreen;
CreateVideoStreams();
CreateFrameGeneratorCapturer(
test::VideoTestConstants::kDefaultFramerate,
CreateFrameGeneratorCapturer(test::VideoTestConstants::kDefaultFramerate,
test::VideoTestConstants::kDefaultWidth,
test::VideoTestConstants::kDefaultHeight);
Start();

View file

@ -255,14 +255,12 @@ void PictureIdTest::SetupEncoder(VideoEncoderFactory* encoder_factory,
observer_.reset(
new PictureIdObserver(PayloadStringToCodecType(payload_name)));
SendTask(
task_queue(), [this, encoder_factory, payload_name]() {
SendTask(task_queue(), [this, encoder_factory, payload_name]() {
CreateCalls();
CreateSendTransport(BuiltInNetworkBehaviorConfig(), observer_.get());
CreateSendConfig(test::VideoTestConstants::kNumSimulcastStreams, 0, 0,
send_transport_.get());
GetVideoSendConfig()->encoder_settings.encoder_factory =
encoder_factory;
GetVideoSendConfig()->encoder_settings.encoder_factory = encoder_factory;
GetVideoSendConfig()->rtp.payload_name = payload_name;
GetVideoEncoderConfig()->codec_type =
PayloadStringToCodecType(payload_name);

View file

@ -743,8 +743,7 @@ VideoSendStream::Stats SendStatisticsProxy::GetStats() {
PurgeOldStats();
stats_.input_frame_rate =
uma_container_->input_frame_rate_tracker_.ComputeRate();
stats_.frames =
uma_container_->input_frame_rate_tracker_.TotalSampleCount();
stats_.frames = uma_container_->input_frame_rate_tracker_.TotalSampleCount();
stats_.content_type =
content_type_ == VideoEncoderConfig::ContentType::kRealtimeVideo
? VideoContentType::UNSPECIFIED

View file

@ -1644,11 +1644,10 @@ TEST_F(VideoSendStreamTest, ChangingNetworkRoute) {
new_route.remote = rtc::RouteEndpoint::CreateWithNetworkId(20);
BitrateConstraints bitrate_config;
SendTask(task_queue_,
[this, &new_route, &bitrate_config]() {
SendTask(task_queue_, [this, &new_route, &bitrate_config]() {
RTC_DCHECK_RUN_ON(&task_queue_thread_);
call_->GetTransportControllerSend()->OnNetworkRouteChanged(
"transport", new_route);
call_->GetTransportControllerSend()->OnNetworkRouteChanged("transport",
new_route);
bitrate_config.start_bitrate_bps = kStartBitrateBps;
call_->GetTransportControllerSend()->SetSdpBitrateParameters(
bitrate_config);
@ -1657,8 +1656,7 @@ TEST_F(VideoSendStreamTest, ChangingNetworkRoute) {
EXPECT_TRUE(Wait())
<< "Timed out while waiting for start bitrate to be exceeded.";
SendTask(
task_queue_, [this, &new_route, &bitrate_config]() {
SendTask(task_queue_, [this, &new_route, &bitrate_config]() {
RTC_DCHECK_RUN_ON(&task_queue_thread_);
bitrate_config.start_bitrate_bps = -1;
bitrate_config.max_bitrate_bps = kNewMaxBitrateBps;
@ -1669,8 +1667,8 @@ TEST_F(VideoSendStreamTest, ChangingNetworkRoute) {
// that id.
new_route.local = rtc::RouteEndpoint::CreateWithNetworkId(
new_route.local.network_id() + 1);
call_->GetTransportControllerSend()->OnNetworkRouteChanged(
"transport", new_route);
call_->GetTransportControllerSend()->OnNetworkRouteChanged("transport",
new_route);
EXPECT_GE(call_->GetStats().send_bandwidth_bps, kStartBitrateBps);
});
}
@ -4013,16 +4011,15 @@ TEST_F(VideoSendStreamTest, SwitchesToScreenshareAndBack) {
auto reset_fun = [this](const VideoSendStream::Config& send_stream_config,
const VideoEncoderConfig& encoder_config,
test::BaseTest* test) {
SendTask(task_queue(),
[this, &send_stream_config, &encoder_config, &test]() {
SendTask(task_queue(), [this, &send_stream_config, &encoder_config,
&test]() {
Stop();
DestroyVideoSendStreams();
SetVideoSendConfig(send_stream_config);
SetVideoEncoderConfig(encoder_config);
CreateVideoSendStreams();
SetVideoDegradation(DegradationPreference::MAINTAIN_RESOLUTION);
test->OnVideoStreamsCreated(GetVideoSendStream(),
video_receive_streams_);
test->OnVideoStreamsCreated(GetVideoSendStream(), video_receive_streams_);
Start();
});
};

View file

@ -785,8 +785,7 @@ void VideoStreamEncoder::Stop() {
rtc::Event shutdown_event;
absl::Cleanup shutdown = [&shutdown_event] { shutdown_event.Set(); };
encoder_queue_.PostTask(
[this, shutdown = std::move(shutdown)] {
encoder_queue_.PostTask([this, shutdown = std::move(shutdown)] {
RTC_DCHECK_RUN_ON(&encoder_queue_);
if (resource_adaptation_processor_) {
stream_resource_manager_.StopManagedResources();
@ -915,8 +914,8 @@ void VideoStreamEncoder::ConfigureEncoder(VideoEncoderConfig config,
size_t max_data_payload_length,
SetParametersCallback callback) {
RTC_DCHECK_RUN_ON(worker_queue_);
encoder_queue_.PostTask(
[this, config = std::move(config), max_data_payload_length,
encoder_queue_.PostTask([this, config = std::move(config),
max_data_payload_length,
callback = std::move(callback)]() mutable {
RTC_DCHECK_RUN_ON(&encoder_queue_);
RTC_DCHECK(sink_);