Commit c4a521ef authored by Alessio Bazzica's avatar Alessio Bazzica Committed by Commit Bot

One WebRTC APM instance is enough

Stop using APM in the Blink peer connection module, since the active
APM instance is owned and handled in the Blink media stream module.
Less CPU usage at call initialization, less memory and more importantly
no misleading logs from APM (in particular, those from
`AudioProcessing::ApplyConfig()`).

Tested: chromium compiled, appr.tc call successfully made, logs now
look ok.

Bug: 1136418
Change-Id: I83fd5c2c04da279e997bef76cdd18872463f5b4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2461107Reviewed-by: default avatarTommi <tommi@chromium.org>
Commit-Queue: Ale Bzk <alessiob@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815115}
parent c72968a0
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#include "third_party/webrtc/media/engine/fake_video_codec_factory.h" #include "third_party/webrtc/media/engine/fake_video_codec_factory.h"
#include "third_party/webrtc/media/engine/multiplex_codec_factory.h" #include "third_party/webrtc/media/engine/multiplex_codec_factory.h"
#include "third_party/webrtc/media/engine/webrtc_media_engine.h" #include "third_party/webrtc/media/engine/webrtc_media_engine.h"
#include "third_party/webrtc/modules/audio_processing/include/audio_processing.h"
#include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h" #include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h"
#include "third_party/webrtc/rtc_base/openssl_stream_adapter.h" #include "third_party/webrtc/rtc_base/openssl_stream_adapter.h"
#include "third_party/webrtc/rtc_base/ref_counted_object.h" #include "third_party/webrtc/rtc_base/ref_counted_object.h"
...@@ -323,7 +322,9 @@ void PeerConnectionDependencyFactory::InitializeSignalingThread( ...@@ -323,7 +322,9 @@ void PeerConnectionDependencyFactory::InitializeSignalingThread(
media_deps.audio_decoder_factory = blink::CreateWebrtcAudioDecoderFactory(); media_deps.audio_decoder_factory = blink::CreateWebrtcAudioDecoderFactory();
media_deps.video_encoder_factory = std::move(webrtc_encoder_factory); media_deps.video_encoder_factory = std::move(webrtc_encoder_factory);
media_deps.video_decoder_factory = std::move(webrtc_decoder_factory); media_deps.video_decoder_factory = std::move(webrtc_decoder_factory);
media_deps.audio_processing = webrtc::AudioProcessingBuilder().Create(); // Audio Processing Module (APM) instances are owned and handled by the Blink
// media stream module.
DCHECK_EQ(media_deps.audio_processing, nullptr);
pcf_deps.media_engine = cricket::CreateMediaEngine(std::move(media_deps)); pcf_deps.media_engine = cricket::CreateMediaEngine(std::move(media_deps));
pc_factory_ = webrtc::CreateModularPeerConnectionFactory(std::move(pcf_deps)); pc_factory_ = webrtc::CreateModularPeerConnectionFactory(std::move(pcf_deps));
CHECK(pc_factory_.get()); CHECK(pc_factory_.get());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment