aboutsummaryrefslogtreecommitdiff
path: root/pc
diff options
context:
space:
mode:
authorPer Åhgren <peah@webrtc.org>2020-04-26 23:56:17 +0200
committerCommit Bot <commit-bot@chromium.org>2020-04-26 23:06:44 +0000
commitcc73ed3e70d1968f8e2bc365880d8273028e14a6 (patch)
treee26c3f0be0eeac5eadd10d8e65499729d1864959 /pc
parent86bd33a1e77efc85383c61589dacd4310fdcb50e (diff)
downloadwebrtc-cc73ed3e70d1968f8e2bc365880d8273028e14a6.tar.gz
APM: Add build flag to allow building WebRTC without APM
This CL adds a build flag to allow building the non-test parts of WebRTC without the audio processing module. The CL also ensures that the WebRTC code correctly handles the case when no APM is available. Bug: webrtc:5298 Change-Id: I5c8b5d1f7115e5cce2af4c2b5ff701fa1c54e49e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171509 Commit-Queue: Per Åhgren <peah@webrtc.org> Reviewed-by: Sam Zackrisson <saza@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31133}
Diffstat (limited to 'pc')
-rw-r--r--pc/BUILD.gn1
-rw-r--r--pc/peer_connection_integrationtest.cc7
2 files changed, 8 insertions, 0 deletions
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index 576685c29c..a48a0469d9 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -587,6 +587,7 @@ if (rtc_include_tests) {
"../media:rtc_media_engine_defaults",
"../modules/audio_device:audio_device_api",
"../modules/audio_processing:audio_processing_statistics",
+ "../modules/audio_processing:audioproc_test_utils",
"../modules/rtp_rtcp:rtp_rtcp_format",
"../p2p:fake_ice_transport",
"../p2p:fake_port_allocator",
diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc
index 1575572ce8..f3b4f28360 100644
--- a/pc/peer_connection_integrationtest.cc
+++ b/pc/peer_connection_integrationtest.cc
@@ -36,6 +36,7 @@
#include "media/engine/fake_webrtc_video_engine.h"
#include "media/engine/webrtc_media_engine.h"
#include "media/engine/webrtc_media_engine_defaults.h"
+#include "modules/audio_processing/test/audio_processing_builder_for_testing.h"
#include "p2p/base/fake_ice_transport.h"
#include "p2p/base/mock_async_resolver.h"
#include "p2p/base/p2p_constants.h"
@@ -648,6 +649,12 @@ class PeerConnectionWrapper : public webrtc::PeerConnectionObserver,
media_deps.video_decoder_factory.reset();
}
+ if (!media_deps.audio_processing) {
+ // If the standard Creation method for APM returns a null pointer, instead
+ // use the builder for testing to create an APM object.
+ media_deps.audio_processing = AudioProcessingBuilderForTesting().Create();
+ }
+
pc_factory_dependencies.media_engine =
cricket::CreateMediaEngine(std::move(media_deps));
pc_factory_dependencies.call_factory = webrtc::CreateCallFactory();