diff --git a/common_video/BUILD.gn b/common_video/BUILD.gn index 7b08e42f48..7dfac4fa6a 100644 --- a/common_video/BUILD.gn +++ b/common_video/BUILD.gn @@ -49,11 +49,6 @@ rtc_static_library("common_video") { public_configs = [ ":common_video_config" ] - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - deps = [ "..:webrtc_common", "../:typedefs", @@ -99,11 +94,6 @@ if (rtc_include_tests) { "video_frame_unittest.cc", ] - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - deps = [ ":common_video", "../api/video:video_frame", diff --git a/common_video/h264/pps_parser_unittest.cc b/common_video/h264/pps_parser_unittest.cc index 9fdbf7e3bf..bfafecfc65 100644 --- a/common_video/h264/pps_parser_unittest.cc +++ b/common_video/h264/pps_parser_unittest.cc @@ -140,7 +140,7 @@ void WritePps(const PpsParser::PpsState& pps, class PpsParserTest : public ::testing::Test { public: PpsParserTest() {} - virtual ~PpsParserTest() {} + ~PpsParserTest() override {} void RunTest() { VerifyParsing(generated_pps_, 0, 1, 0); diff --git a/common_video/h264/sps_parser.cc b/common_video/h264/sps_parser.cc index b313f48788..ce12834fe1 100644 --- a/common_video/h264/sps_parser.cc +++ b/common_video/h264/sps_parser.cc @@ -32,6 +32,8 @@ constexpr int kScaldingDeltaMax = 127; namespace webrtc { SpsParser::SpsState::SpsState() = default; +SpsParser::SpsState::SpsState(const SpsState&) = default; +SpsParser::SpsState::~SpsState() = default; // General note: this is based off the 02/2014 version of the H.264 standard. // You can find it on this page: diff --git a/common_video/h264/sps_parser.h b/common_video/h264/sps_parser.h index d4294b2558..386d468936 100644 --- a/common_video/h264/sps_parser.h +++ b/common_video/h264/sps_parser.h @@ -26,6 +26,8 @@ class SpsParser { // Add more as they are actually needed. struct SpsState { SpsState(); + SpsState(const SpsState&); + ~SpsState(); uint32_t width = 0; uint32_t height = 0; diff --git a/common_video/h264/sps_parser_unittest.cc b/common_video/h264/sps_parser_unittest.cc index 50227ed870..e88d0c3119 100644 --- a/common_video/h264/sps_parser_unittest.cc +++ b/common_video/h264/sps_parser_unittest.cc @@ -110,7 +110,7 @@ void GenerateFakeSps(uint16_t width, class H264SpsParserTest : public ::testing::Test { public: H264SpsParserTest() {} - virtual ~H264SpsParserTest() {} + ~H264SpsParserTest() override {} absl::optional sps_; }; diff --git a/common_video/libyuv/libyuv_unittest.cc b/common_video/libyuv/libyuv_unittest.cc index 41d111c7b8..79e7cb61b9 100644 --- a/common_video/libyuv/libyuv_unittest.cc +++ b/common_video/libyuv/libyuv_unittest.cc @@ -35,8 +35,8 @@ void Calc16ByteAlignedStride(int width, int* stride_y, int* stride_uv) { class TestLibYuv : public ::testing::Test { protected: TestLibYuv(); - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; FILE* source_file_; std::unique_ptr orig_frame_; diff --git a/common_video/video_render_frames.cc b/common_video/video_render_frames.cc index 982923c0ba..02a105ac07 100644 --- a/common_video/video_render_frames.cc +++ b/common_video/video_render_frames.cc @@ -38,6 +38,8 @@ uint32_t EnsureValidRenderDelay(uint32_t render_delay) { VideoRenderFrames::VideoRenderFrames(uint32_t render_delay_ms) : render_delay_ms_(EnsureValidRenderDelay(render_delay_ms)) {} +VideoRenderFrames::~VideoRenderFrames() = default; + int32_t VideoRenderFrames::AddFrame(VideoFrame&& new_frame) { const int64_t time_now = rtc::TimeMillis(); diff --git a/common_video/video_render_frames.h b/common_video/video_render_frames.h index 31a46344c9..0b47e0a058 100644 --- a/common_video/video_render_frames.h +++ b/common_video/video_render_frames.h @@ -25,6 +25,7 @@ class VideoRenderFrames { public: explicit VideoRenderFrames(uint32_t render_delay_ms); VideoRenderFrames(const VideoRenderFrames&) = delete; + ~VideoRenderFrames(); // Add a frame to the render queue int32_t AddFrame(VideoFrame&& new_frame); diff --git a/media/engine/simulcast_encoder_adapter_unittest.cc b/media/engine/simulcast_encoder_adapter_unittest.cc index cce32d5c45..a352887321 100644 --- a/media/engine/simulcast_encoder_adapter_unittest.cc +++ b/media/engine/simulcast_encoder_adapter_unittest.cc @@ -793,9 +793,10 @@ TEST_F(TestSimulcastEncoderAdapterFake, } // TODO(nisse): Reuse definition in webrtc/test/fake_texture_handle.h. -class FakeNativeBuffer : public VideoFrameBuffer { +class FakeNativeBufferNoI420 : public VideoFrameBuffer { public: - FakeNativeBuffer(int width, int height) : width_(width), height_(height) {} + FakeNativeBufferNoI420(int width, int height) + : width_(width), height_(height) {} Type type() const override { return Type::kNative; } int width() const override { return width_; } @@ -827,7 +828,7 @@ TEST_F(TestSimulcastEncoderAdapterFake, EXPECT_TRUE(adapter_->SupportsNativeHandle()); rtc::scoped_refptr buffer( - new rtc::RefCountedObject(1280, 720)); + new rtc::RefCountedObject(1280, 720)); VideoFrame input_frame(buffer, 100, 1000, kVideoRotation_180); // Expect calls with the given video frame verbatim, since it's a texture // frame and can't otherwise be modified/resized. diff --git a/test/fake_texture_frame.cc b/test/fake_texture_frame.cc index 4c4ea94fd2..c6f186e23b 100644 --- a/test/fake_texture_frame.cc +++ b/test/fake_texture_frame.cc @@ -21,5 +21,24 @@ VideoFrame FakeNativeBuffer::CreateFrame(int width, return VideoFrame(new rtc::RefCountedObject(width, height), timestamp, render_time_ms, rotation); } + +VideoFrameBuffer::Type FakeNativeBuffer::type() const { + return Type::kNative; +} + +int FakeNativeBuffer::width() const { + return width_; +} + +int FakeNativeBuffer::height() const { + return height_; +} + +rtc::scoped_refptr FakeNativeBuffer::ToI420() { + rtc::scoped_refptr buffer = I420Buffer::Create(width_, height_); + I420Buffer::SetBlack(buffer); + return buffer; +} + } // namespace test } // namespace webrtc diff --git a/test/fake_texture_frame.h b/test/fake_texture_frame.h index 17261ff8ae..1b25112e01 100644 --- a/test/fake_texture_frame.h +++ b/test/fake_texture_frame.h @@ -28,16 +28,12 @@ class FakeNativeBuffer : public VideoFrameBuffer { FakeNativeBuffer(int width, int height) : width_(width), height_(height) {} - Type type() const override { return Type::kNative; } - int width() const override { return width_; } - int height() const override { return height_; } + Type type() const override; + int width() const override; + int height() const override; private: - rtc::scoped_refptr ToI420() override { - rtc::scoped_refptr buffer = I420Buffer::Create(width_, height_); - I420Buffer::SetBlack(buffer); - return buffer; - } + rtc::scoped_refptr ToI420() override; const int width_; const int height_;