[clang-tidy] Apply performance-move-const-arg fixes (mutable lambdas).
This CL is a manual spin-off of [1], which tried to apply clang-tidy's performance-move-const-arg [1] to the WebRTC codebase. Since there were some wrong fixes to correct, this CL lands all the manual fixes where std::move was actually fine but the lambda was not mutable. [1] - https://webrtc-review.googlesource.com/c/src/+/120350 [2] - https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html Bug: webrtc:10252 Change-Id: I4602e3d4a63d2637dd389e775ffbf80fe95f40fc Reviewed-on: https://webrtc-review.googlesource.com/c/120927 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26532}
This commit is contained in:

committed by
Commit Bot

parent
817aec8eca
commit
80a8687082
@ -140,7 +140,7 @@ RTCError MediaTransportPair::LoopbackMediaTransport::SendVideoFrame(
|
||||
MediaTransportEncodedVideoFrame frame_copy = frame;
|
||||
frame_copy.Retain();
|
||||
invoker_.AsyncInvoke<void>(
|
||||
RTC_FROM_HERE, thread_, [this, channel_id, frame_copy] {
|
||||
RTC_FROM_HERE, thread_, [this, channel_id, frame_copy]() mutable {
|
||||
other_->OnData(channel_id, std::move(frame_copy));
|
||||
});
|
||||
return RTCError::OK();
|
||||
|
@ -1235,7 +1235,7 @@ void ChannelSend::SetFrameEncryptor(
|
||||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
rtc::CritScope cs(&encoder_queue_lock_);
|
||||
if (encoder_queue_is_active_) {
|
||||
encoder_queue_->PostTask([this, frame_encryptor]() {
|
||||
encoder_queue_->PostTask([this, frame_encryptor]() mutable {
|
||||
this->frame_encryptor_ = std::move(frame_encryptor);
|
||||
});
|
||||
} else {
|
||||
|
@ -39,7 +39,7 @@ VideoQualityAnalyzer::~VideoQualityAnalyzer() {
|
||||
|
||||
void VideoQualityAnalyzer::OnCapturedFrame(const VideoFrame& frame) {
|
||||
VideoFrame copy = frame;
|
||||
task_queue_.PostTask([this, copy] {
|
||||
task_queue_.PostTask([this, copy]() mutable {
|
||||
if (!first_capture_ntp_time_ms_)
|
||||
first_capture_ntp_time_ms_ = copy.ntp_time_ms();
|
||||
captured_frames_.push_back(std::move(copy));
|
||||
|
@ -513,13 +513,13 @@ void VideoSendStreamImpl::OnEncoderConfigurationChanged(
|
||||
int min_transmit_bitrate_bps) {
|
||||
if (!worker_queue_->IsCurrent()) {
|
||||
rtc::WeakPtr<VideoSendStreamImpl> send_stream = weak_ptr_;
|
||||
worker_queue_->PostTask(
|
||||
[send_stream, streams, content_type, min_transmit_bitrate_bps]() {
|
||||
if (send_stream) {
|
||||
send_stream->OnEncoderConfigurationChanged(
|
||||
std::move(streams), content_type, min_transmit_bitrate_bps);
|
||||
}
|
||||
});
|
||||
worker_queue_->PostTask([send_stream, streams, content_type,
|
||||
min_transmit_bitrate_bps]() mutable {
|
||||
if (send_stream) {
|
||||
send_stream->OnEncoderConfigurationChanged(
|
||||
std::move(streams), content_type, min_transmit_bitrate_bps);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
RTC_DCHECK_GE(config_->rtp.ssrcs.size(), streams.size());
|
||||
|
Reference in New Issue
Block a user