Enable clang::find_bad_constructs for audio_coding (part 1/2).
This CL removes //build/config/clang:find_bad_constructs from the suppressed_configs list, which means that clang:find_bad_constructs is now enabled on these translation units. Bug: webrtc:9251, webrtc:163 Change-Id: I6a7d4964723a5e195189aac30a83d9e924e61dd7 Reviewed-on: https://webrtc-review.googlesource.com/89743 Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24053}
This commit is contained in:

committed by
Commit Bot

parent
5e6dcb2e64
commit
682aac5103
@ -1119,11 +1119,6 @@ rtc_source_set("neteq_tools_minimal") {
|
||||
"neteq/tools/packet_source.h",
|
||||
]
|
||||
|
||||
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 = [
|
||||
":neteq",
|
||||
"../..:typedefs",
|
||||
@ -1510,31 +1505,22 @@ if (rtc_include_tests) {
|
||||
"neteq/audio_decoder_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 = [
|
||||
"../../test:fileutils",
|
||||
]
|
||||
|
||||
defines = neteq_defines
|
||||
|
||||
deps += audio_coding_deps
|
||||
deps += [
|
||||
":ilbc",
|
||||
":isac",
|
||||
":isac_fix",
|
||||
":neteq",
|
||||
":neteq_tools",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../api/audio_codecs/opus:audio_encoder_opus",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../test:test_main",
|
||||
"//testing/gtest",
|
||||
]
|
||||
deps = [
|
||||
":ilbc",
|
||||
":isac",
|
||||
":isac_fix",
|
||||
":neteq",
|
||||
":neteq_tools",
|
||||
"../../test:fileutils",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../api/audio_codecs/opus:audio_encoder_opus",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../test:test_main",
|
||||
"//testing/gtest",
|
||||
] + audio_coding_deps
|
||||
|
||||
data = audio_decoder_unittests_resources
|
||||
|
||||
@ -1545,7 +1531,7 @@ if (rtc_include_tests) {
|
||||
if (is_ios) {
|
||||
deps += [ ":audio_decoder_unittests_bundle_data" ]
|
||||
}
|
||||
} # audio_decoder_unittests
|
||||
}
|
||||
|
||||
if (rtc_enable_protobuf) {
|
||||
proto_library("neteq_unittest_proto") {
|
||||
@ -1777,11 +1763,6 @@ if (rtc_include_tests) {
|
||||
"../../system_wrappers:system_wrappers_default",
|
||||
"//testing/gtest",
|
||||
]
|
||||
|
||||
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" ]
|
||||
}
|
||||
}
|
||||
|
||||
rtc_executable("neteq_opus_quality_test") {
|
||||
@ -2020,11 +2001,6 @@ if (rtc_include_tests) {
|
||||
"../../test:test_main",
|
||||
"//testing/gtest",
|
||||
]
|
||||
|
||||
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" ]
|
||||
}
|
||||
}
|
||||
|
||||
rtc_source_set("audio_coding_unittests") {
|
||||
|
@ -38,8 +38,8 @@ class OpusFecTest : public TestWithParam<coding_param> {
|
||||
protected:
|
||||
OpusFecTest();
|
||||
|
||||
virtual void SetUp();
|
||||
virtual void TearDown();
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
|
||||
virtual void EncodeABlock();
|
||||
|
||||
|
@ -100,16 +100,16 @@ class AudioDecoderTest : public ::testing::Test {
|
||||
payload_type_(17),
|
||||
decoder_(NULL) {}
|
||||
|
||||
virtual ~AudioDecoderTest() {}
|
||||
~AudioDecoderTest() override {}
|
||||
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
if (audio_encoder_)
|
||||
codec_input_rate_hz_ = audio_encoder_->SampleRateHz();
|
||||
// Create arrays.
|
||||
ASSERT_GT(data_length_, 0u) << "The test must set data_length_ > 0";
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
delete decoder_;
|
||||
decoder_ = NULL;
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ EncodeNetEqInput::EncodeNetEqInput(std::unique_ptr<Generator> generator,
|
||||
CreatePacket();
|
||||
}
|
||||
|
||||
EncodeNetEqInput::~EncodeNetEqInput() = default;
|
||||
|
||||
absl::optional<int64_t> EncodeNetEqInput::NextPacketTime() const {
|
||||
RTC_DCHECK(packet_data_);
|
||||
return static_cast<int64_t>(packet_data_->time_ms);
|
||||
@ -50,6 +52,10 @@ void EncodeNetEqInput::AdvanceOutputEvent() {
|
||||
next_output_event_ms_ += kOutputPeriodMs;
|
||||
}
|
||||
|
||||
bool EncodeNetEqInput::ended() const {
|
||||
return next_output_event_ms_ <= input_duration_ms_;
|
||||
}
|
||||
|
||||
absl::optional<RTPHeader> EncodeNetEqInput::NextHeader() const {
|
||||
RTC_DCHECK(packet_data_);
|
||||
return packet_data_->header;
|
||||
|
@ -35,6 +35,7 @@ class EncodeNetEqInput : public NetEqInput {
|
||||
EncodeNetEqInput(std::unique_ptr<Generator> generator,
|
||||
std::unique_ptr<AudioEncoder> encoder,
|
||||
int64_t input_duration_ms);
|
||||
~EncodeNetEqInput() override;
|
||||
|
||||
absl::optional<int64_t> NextPacketTime() const override;
|
||||
|
||||
@ -44,9 +45,7 @@ class EncodeNetEqInput : public NetEqInput {
|
||||
|
||||
void AdvanceOutputEvent() override;
|
||||
|
||||
bool ended() const override {
|
||||
return next_output_event_ms_ <= input_duration_ms_;
|
||||
}
|
||||
bool ended() const override;
|
||||
|
||||
absl::optional<RTPHeader> NextHeader() const override;
|
||||
|
||||
|
@ -15,6 +15,9 @@
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
NetEqInput::PacketData::PacketData() = default;
|
||||
NetEqInput::PacketData::~PacketData() = default;
|
||||
|
||||
std::string NetEqInput::PacketData::ToString() const {
|
||||
std::stringstream ss;
|
||||
ss << "{"
|
||||
@ -34,6 +37,8 @@ TimeLimitedNetEqInput::TimeLimitedNetEqInput(std::unique_ptr<NetEqInput> input,
|
||||
start_time_ms_(input_->NextEventTime()),
|
||||
duration_ms_(duration_ms) {}
|
||||
|
||||
TimeLimitedNetEqInput::~TimeLimitedNetEqInput() = default;
|
||||
|
||||
absl::optional<int64_t> TimeLimitedNetEqInput::NextPacketTime() const {
|
||||
return ended_ ? absl::nullopt : input_->NextPacketTime();
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ namespace test {
|
||||
class NetEqInput {
|
||||
public:
|
||||
struct PacketData {
|
||||
PacketData();
|
||||
~PacketData();
|
||||
std::string ToString() const;
|
||||
|
||||
RTPHeader header;
|
||||
@ -84,6 +86,7 @@ class NetEqInput {
|
||||
class TimeLimitedNetEqInput : public NetEqInput {
|
||||
public:
|
||||
TimeLimitedNetEqInput(std::unique_ptr<NetEqInput> input, int64_t duration_ms);
|
||||
~TimeLimitedNetEqInput() override;
|
||||
absl::optional<int64_t> NextPacketTime() const override;
|
||||
absl::optional<int64_t> NextOutputEventTime() const override;
|
||||
std::unique_ptr<PacketData> PopPacket() override;
|
||||
|
@ -46,6 +46,8 @@ NetEqTest::NetEqTest(const NetEq::Config& config,
|
||||
RegisterExternalDecoders(ext_codecs);
|
||||
}
|
||||
|
||||
NetEqTest::~NetEqTest() = default;
|
||||
|
||||
int64_t NetEqTest::Run() {
|
||||
const int64_t start_time_ms = *input_->NextEventTime();
|
||||
int64_t time_now_ms = start_time_ms;
|
||||
|
@ -82,7 +82,7 @@ class NetEqTest {
|
||||
std::unique_ptr<AudioSink> output,
|
||||
Callbacks callbacks);
|
||||
|
||||
~NetEqTest() = default;
|
||||
~NetEqTest();
|
||||
|
||||
// Runs the test. Returns the duration of the produced audio in ms.
|
||||
int64_t Run();
|
||||
|
@ -39,7 +39,7 @@ class RtpFileSource : public PacketSource {
|
||||
static bool ValidRtpDump(const std::string& file_name);
|
||||
static bool ValidPcap(const std::string& file_name);
|
||||
|
||||
virtual ~RtpFileSource();
|
||||
~RtpFileSource() override;
|
||||
|
||||
// Registers an RTP header extension and binds it to |id|.
|
||||
virtual bool RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id);
|
||||
|
Reference in New Issue
Block a user