Fix ClangTidy issues in video/
These are manual edits please verify there are no typos.
Feel free to auto-submit if there are no issues.
Bug: webrtc:10410
Change-Id: Iedb3be944828a1caba55bbbd4dc0b56c55bbb7d5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127624
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27123}
diff --git a/video/call_stats_unittest.cc b/video/call_stats_unittest.cc
index c31d336..01bc346 100644
--- a/video/call_stats_unittest.cc
+++ b/video/call_stats_unittest.cc
@@ -21,7 +21,6 @@
#include "test/gmock.h"
#include "test/gtest.h"
-using ::testing::_;
using ::testing::AnyNumber;
using ::testing::InvokeWithoutArgs;
using ::testing::Return;
diff --git a/video/encoder_key_frame_callback_unittest.cc b/video/encoder_key_frame_callback_unittest.cc
index 2491fb8..d00478a 100644
--- a/video/encoder_key_frame_callback_unittest.cc
+++ b/video/encoder_key_frame_callback_unittest.cc
@@ -16,8 +16,6 @@
#include "test/gtest.h"
#include "video/test/mock_video_stream_encoder.h"
-using ::testing::NiceMock;
-
namespace webrtc {
class VieKeyRequestTest : public ::testing::Test {
diff --git a/video/frame_encode_timer.cc b/video/frame_encode_timer.cc
index bf4d6b2..42002f7 100644
--- a/video/frame_encode_timer.cc
+++ b/video/frame_encode_timer.cc
@@ -203,7 +203,7 @@
EncodedImageCallback::DropReason::kDroppedByEncoder);
encode_start_list->pop_front();
}
- if (encode_start_list->size() > 0 &&
+ if (!encode_start_list->empty() &&
encode_start_list->front().rtp_timestamp ==
encoded_image->Timestamp()) {
result.emplace(encode_start_list->front().encode_start_time_ms);
diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc
index dd2bccc..23c703e 100644
--- a/video/video_quality_test.cc
+++ b/video/video_quality_test.cc
@@ -1012,7 +1012,7 @@
params_.video[video_idx].fps);
} else {
std::vector<std::string> slides = params_.screenshare[video_idx].slides;
- if (slides.size() == 0) {
+ if (slides.empty()) {
slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv"));
slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv"));
slides.push_back(test::ResourcePath("photo_1850_1110", "yuv"));
@@ -1206,8 +1206,8 @@
task_queue_.SendTask([this, &send_call_config, &recv_call_config,
&send_transport, &recv_transport]() {
if (params_.audio.enabled)
- InitializeAudioDevice(
- &send_call_config, &recv_call_config, params_.audio.use_real_adm);
+ InitializeAudioDevice(&send_call_config, &recv_call_config,
+ params_.audio.use_real_adm);
CreateCalls(send_call_config, recv_call_config);
send_transport = CreateSendTransport();
@@ -1298,21 +1298,21 @@
rtc::scoped_refptr<AudioDeviceModule> VideoQualityTest::CreateAudioDevice() {
#ifdef WEBRTC_WIN
- RTC_LOG(INFO) << "Using latest version of ADM on Windows";
- // We must initialize the COM library on a thread before we calling any of
- // the library functions. All COM functions in the ADM will return
- // CO_E_NOTINITIALIZED otherwise. The legacy ADM for Windows used internal
- // COM initialization but the new ADM requires COM to be initialized
- // externally.
- com_initializer_ = absl::make_unique<webrtc_win::ScopedCOMInitializer>(
- webrtc_win::ScopedCOMInitializer::kMTA);
- RTC_CHECK(com_initializer_->Succeeded());
- RTC_CHECK(webrtc_win::core_audio_utility::IsSupported());
- RTC_CHECK(webrtc_win::core_audio_utility::IsMMCSSSupported());
- return CreateWindowsCoreAudioAudioDeviceModule();
+ RTC_LOG(INFO) << "Using latest version of ADM on Windows";
+ // We must initialize the COM library on a thread before we calling any of
+ // the library functions. All COM functions in the ADM will return
+ // CO_E_NOTINITIALIZED otherwise. The legacy ADM for Windows used internal
+ // COM initialization but the new ADM requires COM to be initialized
+ // externally.
+ com_initializer_ = absl::make_unique<webrtc_win::ScopedCOMInitializer>(
+ webrtc_win::ScopedCOMInitializer::kMTA);
+ RTC_CHECK(com_initializer_->Succeeded());
+ RTC_CHECK(webrtc_win::core_audio_utility::IsSupported());
+ RTC_CHECK(webrtc_win::core_audio_utility::IsMMCSSSupported());
+ return CreateWindowsCoreAudioAudioDeviceModule();
#else
- // Use legacy factory method on all platforms except Windows.
- return AudioDeviceModule::Create(AudioDeviceModule::kPlatformDefaultAudio);
+ // Use legacy factory method on all platforms except Windows.
+ return AudioDeviceModule::Create(AudioDeviceModule::kPlatformDefaultAudio);
#endif
}
@@ -1348,7 +1348,7 @@
}
// Always initialize the ADM before injecting a valid audio transport.
RTC_CHECK(audio_device->RegisterAudioCallback(
- send_call_config->audio_state->audio_transport()) == 0);
+ send_call_config->audio_state->audio_transport()) == 0);
}
void VideoQualityTest::SetupAudio(Transport* transport) {
@@ -1428,8 +1428,8 @@
Call::Config recv_call_config(recv_event_log_.get());
if (params_.audio.enabled)
- InitializeAudioDevice(
- &send_call_config, &recv_call_config, params_.audio.use_real_adm);
+ InitializeAudioDevice(&send_call_config, &recv_call_config,
+ params_.audio.use_real_adm);
CreateCalls(send_call_config, recv_call_config);
diff --git a/video/video_send_stream.cc b/video/video_send_stream.cc
index edf3922..12d9dac 100644
--- a/video/video_send_stream.cc
+++ b/video/video_send_stream.cc
@@ -34,7 +34,7 @@
size_t header_size = kRtpHeaderSize;
size_t extensions_size = 0;
size_t fec_extensions_size = 0;
- if (config.extensions.size() > 0) {
+ if (!config.extensions.empty()) {
RtpHeaderExtensionMap extensions_map(config.extensions);
extensions_size = RtpHeaderExtensionSize(RTPSender::VideoExtensionSizes(),
extensions_map);
diff --git a/video/video_send_stream_impl_unittest.cc b/video/video_send_stream_impl_unittest.cc
index a84b129..6315352 100644
--- a/video/video_send_stream_impl_unittest.cc
+++ b/video/video_send_stream_impl_unittest.cc
@@ -30,12 +30,10 @@
namespace webrtc {
namespace internal {
namespace {
-using testing::NiceMock;
-using testing::StrictMock;
-using testing::ReturnRef;
-using testing::Return;
-using testing::Invoke;
using testing::_;
+using testing::Invoke;
+using testing::NiceMock;
+using testing::Return;
constexpr int64_t kDefaultInitialBitrateBps = 333000;
const double kDefaultBitratePriority = 0.5;
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index 15abc42..449286f 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -817,7 +817,7 @@
scaling_settings.thresholds;
if (quality_scaling_allowed) {
- if (quality_scaler_.get() == nullptr) {
+ if (quality_scaler_ == nullptr) {
// Quality scaler has not already been configured.
// Use experimental thresholds if available.
diff --git a/video/video_stream_encoder_unittest.cc b/video/video_stream_encoder_unittest.cc
index 86b2f0e..e2453a4 100644
--- a/video/video_stream_encoder_unittest.cc
+++ b/video/video_stream_encoder_unittest.cc
@@ -42,7 +42,6 @@
using ScaleReason = AdaptationObserverInterface::AdaptReason;
using ::testing::_;
-using ::testing::Return;
namespace {
const int kMinPixelsPerFrame = 320 * 180;