diff --git a/video/call_stats_unittest.cc b/video/call_stats_unittest.cc index c31d33664d..01bc3469a9 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 2491fb8deb..d00478a89a 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 bf4d6b2e56..42002f78ab 100644 --- a/video/frame_encode_timer.cc +++ b/video/frame_encode_timer.cc @@ -203,7 +203,7 @@ absl::optional FrameEncodeTimer::ExtractEncodeStartTime( 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 dd2bccc142..23c703e659 100644 --- a/video/video_quality_test.cc +++ b/video/video_quality_test.cc @@ -1012,7 +1012,7 @@ std::unique_ptr VideoQualityTest::CreateFrameGenerator( params_.video[video_idx].fps); } else { std::vector 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 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) { 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 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) { rtc::scoped_refptr 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::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::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 @@ void VideoQualityTest::InitializeAudioDevice(Call::Config* send_call_config, } // 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 @@ void VideoQualityTest::RunWithRenderers(const Params& params) { 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 edf39223a7..12d9dac5e9 100644 --- a/video/video_send_stream.cc +++ b/video/video_send_stream.cc @@ -34,7 +34,7 @@ size_t CalculateMaxHeaderSize(const RtpConfig& config) { 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 a84b129e4b..6315352de8 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 15abc42f1e..449286fd7a 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -817,7 +817,7 @@ void VideoStreamEncoder::ConfigureQualityScaler( 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 86b2f0eeef..e2453a42a6 100644 --- a/video/video_stream_encoder_unittest.cc +++ b/video/video_stream_encoder_unittest.cc @@ -42,7 +42,6 @@ namespace webrtc { using ScaleReason = AdaptationObserverInterface::AdaptReason; using ::testing::_; -using ::testing::Return; namespace { const int kMinPixelsPerFrame = 320 * 180;