Reland Move fake_audio_device to its own target.
Patchset 1 is patchset #5 id:80001 of https://codereview.webrtc.org/2717983003/
Patchset 2 fix call_perf_test dep on fake_audio_device.
This reverts commit 985371bda999c6db51286586c5850d2ff58f3511.
Original cl description:
Move fake_audio_device to its own target.
The purpose is to make it usefull for test targets that does not need or can use test_common.
For some reason this also triggered override issues in rtp module tests that are fixed in the same cl.
BUG=none
TBR=kjellander@webrtc.org
NOTRY=True
Review-Url: https://codereview.webrtc.org/2718363002
Cr-Original-Commit-Position: refs/heads/master@{#16922}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 16ccfdf45746d034a5692bf707d03f6746beb240
diff --git a/call/BUILD.gn b/call/BUILD.gn
index 95db035..154ae04 100644
--- a/call/BUILD.gn
+++ b/call/BUILD.gn
@@ -116,6 +116,7 @@
"../system_wrappers",
"../system_wrappers:metrics_default",
"../test:direct_transport",
+ "../test:fake_audio_device",
"../test:test_support",
"../test:video_test_common",
"../video",
diff --git a/modules/rtp_rtcp/source/nack_rtx_unittest.cc b/modules/rtp_rtcp/source/nack_rtx_unittest.cc
index d772753..6337890 100644
--- a/modules/rtp_rtcp/source/nack_rtx_unittest.cc
+++ b/modules/rtp_rtcp/source/nack_rtx_unittest.cc
@@ -58,7 +58,7 @@
explicit TestRtpFeedback(RtpRtcp* rtp_rtcp) : rtp_rtcp_(rtp_rtcp) {}
virtual ~TestRtpFeedback() {}
- void OnIncomingSSRCChanged(const uint32_t ssrc) override {
+ void OnIncomingSSRCChanged(uint32_t ssrc) override {
rtp_rtcp_->SetRemoteSSRC(ssrc);
}
diff --git a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
index 0aa6361..40b8e06 100644
--- a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
+++ b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
@@ -211,7 +211,7 @@
return true;
}
int OnReceivedPayloadData(const uint8_t* payload_data,
- const size_t payload_size,
+ size_t payload_size,
const WebRtcRTPHeader* rtp_header) override {
return 0;
}
diff --git a/modules/rtp_rtcp/test/testAPI/test_api_audio.cc b/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
index 2801c65..5e5d8ee 100644
--- a/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
+++ b/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
@@ -70,11 +70,11 @@
class RTPCallback : public NullRtpFeedback {
public:
- int32_t OnInitializeDecoder(const int8_t payloadType,
+ int32_t OnInitializeDecoder(int8_t payloadType,
const char payloadName[RTP_PAYLOAD_NAME_SIZE],
- const int frequency,
- const size_t channels,
- const uint32_t rate) override {
+ int frequency,
+ size_t channels,
+ uint32_t rate) override {
EXPECT_EQ(0u, rate) << "The rate should be zero";
return 0;
}
diff --git a/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc b/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
index 25ff98d..9637928 100644
--- a/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
+++ b/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
@@ -56,7 +56,7 @@
explicit TestRtpFeedback(RtpRtcp* rtp_rtcp) : rtp_rtcp_(rtp_rtcp) {}
virtual ~TestRtpFeedback() {}
- void OnIncomingSSRCChanged(const uint32_t ssrc) override {
+ void OnIncomingSSRCChanged(uint32_t ssrc) override {
rtp_rtcp_->SetRemoteSSRC(ssrc);
}
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 07ffbee..12eb3ca 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -333,6 +333,22 @@
]
}
+rtc_source_set("fake_audio_device") {
+ testonly = true
+ sources = [
+ "fake_audio_device.cc",
+ "fake_audio_device.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 = [
+ "../base:rtc_base_approved",
+ "../modules/audio_device:audio_device",
+ ]
+}
+
rtc_source_set("test_common") {
testonly = true
sources = [
@@ -346,8 +362,6 @@
"drifting_clock.h",
"encoder_settings.cc",
"encoder_settings.h",
- "fake_audio_device.cc",
- "fake_audio_device.h",
"fake_decoder.cc",
"fake_decoder.h",
"fake_encoder.cc",
@@ -379,13 +393,13 @@
deps = [
":direct_transport",
+ ":fake_audio_device",
":rtp_test_utils",
":test_support",
"..:webrtc_common",
"../audio",
"../base:rtc_base_approved",
"../call",
- "../modules/audio_device:mock_audio_device",
"../modules/audio_mixer:audio_mixer_impl",
"../modules/audio_processing",
"../video",