NetEq tests: BUILD target reorg
In this CL, the neteq_unittest_tools target is split in two separate targets. One still called neteq_tools which does not set testonly=true and that includes code related to audio input, replacement audio and fake decoding. The other target called neteq_test_tools contains the remaining files, and is still under testonly=true. Other renames: neteq_test_tools -> neteq_test_tools_deprecated neteq_test_minimal -> neteq_tools_minimal Cyclic dependencies were also cleaned up. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_compile_rel_ng,linux_chromium_compile_dbg_ng BUG=webrtc:7467,webrtc:6828 Review-Url: https://codereview.webrtc.org/2845013003 Cr-Commit-Position: refs/heads/master@{#17921}
This commit is contained in:
committed by
Commit bot
parent
777cb7b4c6
commit
b637a94b63
@ -1105,18 +1105,19 @@ rtc_static_library("neteq") {
|
||||
# rtc_include_tests conditional. The reason is that it supports fuzzer tests
|
||||
# that ultimately are built and run as a part of the Chromium ecosystem, which
|
||||
# does not set the rtc_include_tests flag.
|
||||
rtc_source_set("neteq_test_minimal") {
|
||||
testonly = true
|
||||
|
||||
# TODO(kjellander): Remove (bugs.webrtc.org/6828)
|
||||
# Has cyclic dependency with :neteq_unittest_tools
|
||||
check_includes = false
|
||||
|
||||
rtc_source_set("neteq_tools_minimal") {
|
||||
sources = [
|
||||
"neteq/tools/audio_sink.cc",
|
||||
"neteq/tools/audio_sink.h",
|
||||
"neteq/tools/encode_neteq_input.cc",
|
||||
"neteq/tools/encode_neteq_input.h",
|
||||
"neteq/tools/neteq_input.h",
|
||||
"neteq/tools/neteq_test.cc",
|
||||
"neteq/tools/neteq_test.h",
|
||||
"neteq/tools/packet.cc",
|
||||
"neteq/tools/packet.h",
|
||||
"neteq/tools/packet_source.cc",
|
||||
"neteq/tools/packet_source.h",
|
||||
]
|
||||
|
||||
if (!build_with_chromium && is_clang) {
|
||||
@ -1127,9 +1128,11 @@ rtc_source_set("neteq_test_minimal") {
|
||||
deps = [
|
||||
":audio_encoder_interface",
|
||||
":neteq",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
"../../base:rtc_base_approved",
|
||||
"../rtp_rtcp",
|
||||
]
|
||||
}
|
||||
|
||||
@ -1236,7 +1239,7 @@ if (rtc_include_tests) {
|
||||
]
|
||||
deps = [
|
||||
":neteq_test_support",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_test_tools",
|
||||
":webrtc_opus",
|
||||
"../..:webrtc_common",
|
||||
"../../base:protobuf_utils",
|
||||
@ -1265,7 +1268,7 @@ if (rtc_include_tests) {
|
||||
":audio_format_conversion",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_tools",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../test:test_support",
|
||||
"//testing/gtest",
|
||||
@ -1285,7 +1288,7 @@ if (rtc_include_tests) {
|
||||
":audio_coding",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
":audio_encoder_interface",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_tools",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../test:test_support",
|
||||
"//testing/gtest",
|
||||
@ -1379,7 +1382,7 @@ if (rtc_include_tests) {
|
||||
":isac",
|
||||
":isac_fix",
|
||||
":neteq",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_tools",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../base:protobuf_utils",
|
||||
"../../common_audio",
|
||||
@ -1456,7 +1459,7 @@ if (rtc_include_tests) {
|
||||
|
||||
deps += [
|
||||
":neteq",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_test_tools",
|
||||
"../..:webrtc_common",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../system_wrappers:system_wrappers_default",
|
||||
@ -1515,7 +1518,7 @@ if (rtc_include_tests) {
|
||||
|
||||
deps = [
|
||||
":neteq",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_test_tools",
|
||||
":pcm16b",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
@ -1542,7 +1545,7 @@ if (rtc_include_tests) {
|
||||
|
||||
deps = [
|
||||
":neteq",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_test_tools",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
@ -1553,42 +1556,59 @@ if (rtc_include_tests) {
|
||||
]
|
||||
}
|
||||
|
||||
config("neteq_unittest_tools_config") {
|
||||
config("neteq_tools_config") {
|
||||
include_dirs = [ "tools" ]
|
||||
}
|
||||
|
||||
rtc_source_set("neteq_unittest_tools") {
|
||||
testonly = true
|
||||
rtc_source_set("neteq_tools") {
|
||||
sources = [
|
||||
"neteq/tools/audio_checksum.h",
|
||||
"neteq/tools/audio_loop.cc",
|
||||
"neteq/tools/audio_loop.h",
|
||||
"neteq/tools/audio_sink.cc",
|
||||
"neteq/tools/audio_sink.h",
|
||||
"neteq/tools/constant_pcm_packet_source.cc",
|
||||
"neteq/tools/constant_pcm_packet_source.h",
|
||||
"neteq/tools/fake_decode_from_file.cc",
|
||||
"neteq/tools/fake_decode_from_file.h",
|
||||
"neteq/tools/input_audio_file.cc",
|
||||
"neteq/tools/input_audio_file.h",
|
||||
"neteq/tools/neteq_input.h",
|
||||
"neteq/tools/neteq_replacement_input.cc",
|
||||
"neteq/tools/neteq_replacement_input.h",
|
||||
"neteq/tools/output_audio_file.h",
|
||||
"neteq/tools/output_wav_file.h",
|
||||
"neteq/tools/packet.cc",
|
||||
"neteq/tools/packet.h",
|
||||
"neteq/tools/packet_source.cc",
|
||||
"neteq/tools/packet_source.h",
|
||||
"neteq/tools/resample_input_audio_file.cc",
|
||||
"neteq/tools/resample_input_audio_file.h",
|
||||
"neteq/tools/rtp_file_source.cc",
|
||||
"neteq/tools/rtp_file_source.h",
|
||||
"neteq/tools/rtp_generator.cc",
|
||||
"neteq/tools/rtp_generator.h",
|
||||
]
|
||||
|
||||
public_configs = [ ":neteq_unittest_tools_config" ]
|
||||
public_configs = [ ":neteq_tools_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",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../common_audio",
|
||||
"../rtp_rtcp",
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
":neteq_tools_minimal",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("neteq_test_tools") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"neteq/tools/audio_checksum.h",
|
||||
"neteq/tools/audio_loop.cc",
|
||||
"neteq/tools/audio_loop.h",
|
||||
"neteq/tools/constant_pcm_packet_source.cc",
|
||||
"neteq/tools/constant_pcm_packet_source.h",
|
||||
"neteq/tools/output_audio_file.h",
|
||||
"neteq/tools/output_wav_file.h",
|
||||
"neteq/tools/rtp_file_source.cc",
|
||||
"neteq/tools/rtp_file_source.h",
|
||||
"neteq/tools/rtp_generator.cc",
|
||||
"neteq/tools/rtp_generator.h",
|
||||
]
|
||||
|
||||
public_configs = [ ":neteq_tools_config" ]
|
||||
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
@ -1596,11 +1616,9 @@ if (rtc_include_tests) {
|
||||
}
|
||||
|
||||
deps = [
|
||||
":audio_encoder_interface",
|
||||
":pcm16b",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../common_audio",
|
||||
"../../test:rtp_test_utils",
|
||||
@ -1608,7 +1626,8 @@ if (rtc_include_tests) {
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
":neteq_test_minimal",
|
||||
":neteq_tools",
|
||||
":neteq_tools_minimal",
|
||||
]
|
||||
|
||||
if (rtc_enable_protobuf) {
|
||||
@ -1620,7 +1639,7 @@ if (rtc_include_tests) {
|
||||
}
|
||||
}
|
||||
|
||||
rtc_source_set("neteq_test_tools") {
|
||||
rtc_source_set("neteq_test_tools_deprecated") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"neteq/test/NETEQTEST_DummyRTPpacket.cc",
|
||||
@ -1686,7 +1705,7 @@ if (rtc_include_tests) {
|
||||
":ilbc",
|
||||
":isac",
|
||||
":neteq",
|
||||
":neteq_test_tools",
|
||||
":neteq_test_tools_deprecated",
|
||||
":pcm16b",
|
||||
":webrtc_opus",
|
||||
"../..:webrtc_common",
|
||||
@ -1721,7 +1740,7 @@ if (rtc_include_tests) {
|
||||
]
|
||||
|
||||
deps = [
|
||||
":neteq_test_tools",
|
||||
":neteq_test_tools_deprecated",
|
||||
]
|
||||
}
|
||||
|
||||
@ -1748,7 +1767,7 @@ if (rtc_include_tests) {
|
||||
]
|
||||
|
||||
deps = [
|
||||
":neteq_test_tools",
|
||||
":neteq_test_tools_deprecated",
|
||||
"../../test:test_support",
|
||||
"//testing/gtest",
|
||||
]
|
||||
@ -1776,7 +1795,7 @@ if (rtc_include_tests) {
|
||||
|
||||
deps = [
|
||||
":neteq",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_test_tools",
|
||||
":pcm16b",
|
||||
"../../system_wrappers:system_wrappers_default",
|
||||
"//testing/gtest",
|
||||
@ -1799,7 +1818,7 @@ if (rtc_include_tests) {
|
||||
deps = [
|
||||
":neteq",
|
||||
":neteq_quality_test_support",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_tools",
|
||||
":webrtc_opus",
|
||||
"../../test:test_main",
|
||||
"//testing/gtest",
|
||||
@ -1835,7 +1854,7 @@ if (rtc_include_tests) {
|
||||
":ilbc",
|
||||
":neteq",
|
||||
":neteq_quality_test_support",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_tools",
|
||||
"../..:webrtc_common",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../system_wrappers:system_wrappers_default",
|
||||
@ -2143,7 +2162,7 @@ if (rtc_include_tests) {
|
||||
":legacy_encoded_audio_frame",
|
||||
":neteq",
|
||||
":neteq_test_support",
|
||||
":neteq_unittest_tools",
|
||||
":neteq_test_tools",
|
||||
":pcm16b",
|
||||
":red",
|
||||
":rent_a_codec",
|
||||
|
||||
@ -29,7 +29,7 @@ int FakeDecodeFromFile::DecodeInternal(const uint8_t* encoded,
|
||||
RTC_DCHECK_GT(last_decoded_length_, 0);
|
||||
std::fill_n(decoded, last_decoded_length_, 0);
|
||||
*speech_type = kComfortNoise;
|
||||
return last_decoded_length_;
|
||||
return rtc::dchecked_cast<int>(last_decoded_length_);
|
||||
}
|
||||
|
||||
RTC_CHECK_GE(encoded_len, 12);
|
||||
@ -42,8 +42,8 @@ int FakeDecodeFromFile::DecodeInternal(const uint8_t* encoded,
|
||||
if (last_decoded_length_ > 0) {
|
||||
// Use length of last decoded packet, but since this is the total for all
|
||||
// channels, we have to divide by 2 in the stereo case.
|
||||
samples_to_decode = rtc::CheckedDivExact(
|
||||
last_decoded_length_, static_cast<size_t>(stereo_ ? 2uL : 1uL));
|
||||
samples_to_decode = rtc::dchecked_cast<int>(rtc::CheckedDivExact(
|
||||
last_decoded_length_, static_cast<size_t>(stereo_ ? 2uL : 1uL)));
|
||||
} else {
|
||||
// This is the first packet to decode, and we do not know the length of
|
||||
// it. Set it to 10 ms.
|
||||
@ -70,7 +70,7 @@ int FakeDecodeFromFile::DecodeInternal(const uint8_t* encoded,
|
||||
std::fill_n(decoded, last_decoded_length_, 0);
|
||||
*speech_type = kComfortNoise;
|
||||
cng_mode_ = true;
|
||||
return last_decoded_length_;
|
||||
return rtc::dchecked_cast<int>(last_decoded_length_);
|
||||
}
|
||||
|
||||
cng_mode_ = false;
|
||||
@ -83,7 +83,8 @@ int FakeDecodeFromFile::DecodeInternal(const uint8_t* encoded,
|
||||
}
|
||||
|
||||
*speech_type = kSpeech;
|
||||
return last_decoded_length_ = samples_to_decode;
|
||||
last_decoded_length_ = samples_to_decode;
|
||||
return rtc::dchecked_cast<int>(last_decoded_length_);
|
||||
}
|
||||
|
||||
void FakeDecodeFromFile::PrepareEncoded(uint32_t timestamp,
|
||||
|
||||
Reference in New Issue
Block a user