Add support for Location (RTC_FROM_HERE) to ProcessThread::RegisterModule.

This makes a few things a lot clearer when looking at perf trace data:

* What module instances (where they were created) are called
* On what thread
* How frequently
* For how long

ProcessThread will be replaced by TaskQueue moving forward and this is a step towards understanding the behavior of the affected code.

BUG=webrtc:7219

Review-Url: https://codereview.webrtc.org/2729053002
Cr-Commit-Position: refs/heads/master@{#16998}
This commit is contained in:
tommi
2017-03-03 03:20:24 -08:00
committed by Commit bot
parent bcb72e786d
commit dea489f33e
17 changed files with 70 additions and 42 deletions

View File

@ -23,6 +23,7 @@
#include "webrtc/base/basictypes.h" #include "webrtc/base/basictypes.h"
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/base/optional.h" #include "webrtc/base/optional.h"
#include "webrtc/base/task_queue.h" #include "webrtc/base/task_queue.h"
@ -355,11 +356,12 @@ Call::Call(const Call::Config& config)
config_.bitrate_config.max_bitrate_bps); config_.bitrate_config.max_bitrate_bps);
module_process_thread_->Start(); module_process_thread_->Start();
module_process_thread_->RegisterModule(call_stats_.get()); module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE);
module_process_thread_->RegisterModule(congestion_controller_.get()); module_process_thread_->RegisterModule(congestion_controller_.get(),
pacer_thread_->RegisterModule(congestion_controller_->pacer()); RTC_FROM_HERE);
pacer_thread_->RegisterModule(congestion_controller_->pacer(), RTC_FROM_HERE);
pacer_thread_->RegisterModule( pacer_thread_->RegisterModule(
congestion_controller_->GetRemoteBitrateEstimator(true)); congestion_controller_->GetRemoteBitrateEstimator(true), RTC_FROM_HERE);
pacer_thread_->Start(); pacer_thread_->Start();
} }

View File

@ -13,6 +13,7 @@
#include <string> #include <string>
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h"
#include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
@ -140,7 +141,7 @@ FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl(
rtp_rtcp_->SetSendingMediaStatus(false); rtp_rtcp_->SetSendingMediaStatus(false);
rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode); rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode);
rtp_rtcp_->SetSSRC(config_.local_ssrc); rtp_rtcp_->SetSSRC(config_.local_ssrc);
process_thread_->RegisterModule(rtp_rtcp_.get()); process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE);
} }
FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() {

View File

@ -330,6 +330,7 @@ if (rtc_include_tests) {
deps = [ deps = [
":audio_device", ":audio_device",
"../..:webrtc_common", "../..:webrtc_common",
"../../base:rtc_base_approved",
"../../system_wrappers", "../../system_wrappers",
"../../test:test_main", "../../test:test_main",
"../../test:test_support", "../../test:test_support",

View File

@ -14,15 +14,14 @@
#include <memory> #include <memory>
#include "webrtc/modules/audio_device/test/audio_device_test_defines.h" #include "webrtc/base/location.h"
#include "webrtc/test/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/modules/audio_device/audio_device_config.h" #include "webrtc/modules/audio_device/audio_device_config.h"
#include "webrtc/modules/audio_device/audio_device_impl.h" #include "webrtc/modules/audio_device/audio_device_impl.h"
#include "webrtc/modules/audio_device/test/audio_device_test_defines.h"
#include "webrtc/modules/utility/include/process_thread.h" #include "webrtc/modules/utility/include/process_thread.h"
#include "webrtc/system_wrappers/include/sleep.h" #include "webrtc/system_wrappers/include/sleep.h"
#include "webrtc/test/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
// Helper functions // Helper functions
#if defined(ANDROID) #if defined(ANDROID)
@ -218,7 +217,7 @@ class AudioDeviceAPITest: public testing::Test {
FAIL() << "Failed creating audio device object!"; FAIL() << "Failed creating audio device object!";
} }
process_thread_->RegisterModule(audio_device_); process_thread_->RegisterModule(audio_device_, RTC_FROM_HERE);
AudioDeviceModule::AudioLayer audio_layer = AudioDeviceModule::AudioLayer audio_layer =
AudioDeviceModule::kPlatformDefaultAudio; AudioDeviceModule::kPlatformDefaultAudio;

View File

@ -13,8 +13,8 @@
#include <memory> #include <memory>
#include "webrtc/base/location.h"
#include "webrtc/modules/utility/include/process_thread.h" #include "webrtc/modules/utility/include/process_thread.h"
#include "webrtc/test/gmock.h" #include "webrtc/test/gmock.h"
namespace webrtc { namespace webrtc {
@ -29,7 +29,7 @@ class MockProcessThread : public ProcessThread {
MOCK_METHOD0(Stop, void()); MOCK_METHOD0(Stop, void());
MOCK_METHOD1(WakeUp, void(Module* module)); MOCK_METHOD1(WakeUp, void(Module* module));
MOCK_METHOD1(PostTask, void(rtc::QueuedTask* task)); MOCK_METHOD1(PostTask, void(rtc::QueuedTask* task));
MOCK_METHOD1(RegisterModule, void(Module* module)); MOCK_METHOD2(RegisterModule, void(Module* module, const rtc::Location&));
MOCK_METHOD1(DeRegisterModule, void(Module* module)); MOCK_METHOD1(DeRegisterModule, void(Module* module));
// MOCK_METHOD1 gets confused with mocking this method, so we work around it // MOCK_METHOD1 gets confused with mocking this method, so we work around it

View File

@ -25,6 +25,10 @@ class QueuedTask;
} }
#endif #endif
namespace rtc {
class Location;
}
namespace webrtc { namespace webrtc {
class Module; class Module;
@ -61,7 +65,7 @@ class ProcessThread {
// Adds a module that will start to receive callbacks on the worker thread. // Adds a module that will start to receive callbacks on the worker thread.
// Can be called from any thread. // Can be called from any thread.
virtual void RegisterModule(Module* module) = 0; virtual void RegisterModule(Module* module, const rtc::Location& from) = 0;
// Removes a previously registered module. // Removes a previously registered module.
// Can be called from any thread. // Can be called from any thread.

View File

@ -13,6 +13,7 @@
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/task_queue.h" #include "webrtc/base/task_queue.h"
#include "webrtc/base/timeutils.h" #include "webrtc/base/timeutils.h"
#include "webrtc/base/trace_event.h"
#include "webrtc/modules/include/module.h" #include "webrtc/modules/include/module.h"
#include "webrtc/system_wrappers/include/logging.h" #include "webrtc/system_wrappers/include/logging.h"
@ -129,7 +130,8 @@ void ProcessThreadImpl::PostTask(std::unique_ptr<rtc::QueuedTask> task) {
wake_up_->Set(); wake_up_->Set();
} }
void ProcessThreadImpl::RegisterModule(Module* module) { void ProcessThreadImpl::RegisterModule(Module* module,
const rtc::Location& from) {
RTC_DCHECK(thread_checker_.CalledOnValidThread()); RTC_DCHECK(thread_checker_.CalledOnValidThread());
RTC_DCHECK(module); RTC_DCHECK(module);
@ -150,7 +152,7 @@ void ProcessThreadImpl::RegisterModule(Module* module) {
{ {
rtc::CritScope lock(&lock_); rtc::CritScope lock(&lock_);
modules_.push_back(ModuleCallback(module)); modules_.push_back(ModuleCallback(module, from));
} }
// Wake the thread calling ProcessThreadImpl::Process() to update the // Wake the thread calling ProcessThreadImpl::Process() to update the
@ -189,6 +191,7 @@ bool ProcessThreadImpl::Run(void* obj) {
} }
bool ProcessThreadImpl::Process() { bool ProcessThreadImpl::Process() {
TRACE_EVENT1("webrtc", "ProcessThreadImpl", "name", thread_name_);
int64_t now = rtc::TimeMillis(); int64_t now = rtc::TimeMillis();
int64_t next_checkpoint = now + (1000 * 60); int64_t next_checkpoint = now + (1000 * 60);
@ -206,7 +209,12 @@ bool ProcessThreadImpl::Process() {
if (m.next_callback <= now || if (m.next_callback <= now ||
m.next_callback == kCallProcessImmediately) { m.next_callback == kCallProcessImmediately) {
{
TRACE_EVENT2("webrtc", "ModuleProcess", "function",
m.location.function_name(), "file",
m.location.file_and_line());
m.module->Process(); m.module->Process();
}
// Use a new 'now' reference to calculate when the next callback // Use a new 'now' reference to calculate when the next callback
// should occur. We'll continue to use 'now' above for the baseline // should occur. We'll continue to use 'now' above for the baseline
// of calculating how long we should wait, to reduce variance. // of calculating how long we should wait, to reduce variance.

View File

@ -16,6 +16,7 @@
#include <queue> #include <queue>
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/location.h"
#include "webrtc/base/platform_thread.h" #include "webrtc/base/platform_thread.h"
#include "webrtc/base/thread_checker.h" #include "webrtc/base/thread_checker.h"
#include "webrtc/modules/utility/include/process_thread.h" #include "webrtc/modules/utility/include/process_thread.h"
@ -35,7 +36,7 @@ class ProcessThreadImpl : public ProcessThread {
void WakeUp(Module* module) override; void WakeUp(Module* module) override;
void PostTask(std::unique_ptr<rtc::QueuedTask> task) override; void PostTask(std::unique_ptr<rtc::QueuedTask> task) override;
void RegisterModule(Module* module) override; void RegisterModule(Module* module, const rtc::Location& from) override;
void DeRegisterModule(Module* module) override; void DeRegisterModule(Module* module) override;
protected: protected:
@ -44,16 +45,18 @@ class ProcessThreadImpl : public ProcessThread {
private: private:
struct ModuleCallback { struct ModuleCallback {
ModuleCallback() : module(nullptr), next_callback(0) {} ModuleCallback() = delete;
ModuleCallback(const ModuleCallback& cb) ModuleCallback(ModuleCallback&& cb) = default;
: module(cb.module), next_callback(cb.next_callback) {} ModuleCallback(const ModuleCallback& cb) = default;
ModuleCallback(Module* module) : module(module), next_callback(0) {} ModuleCallback(Module* module, const rtc::Location& location)
: module(module), location(location) {}
bool operator==(const ModuleCallback& cb) const { bool operator==(const ModuleCallback& cb) const {
return cb.module == module; return cb.module == module;
} }
Module* const module; Module* const module;
int64_t next_callback; // Absolute timestamp. int64_t next_callback = 0; // Absolute timestamp.
const rtc::Location location;
private: private:
ModuleCallback& operator=(ModuleCallback&); ModuleCallback& operator=(ModuleCallback&);

View File

@ -11,6 +11,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "webrtc/base/location.h"
#include "webrtc/base/task_queue.h" #include "webrtc/base/task_queue.h"
#include "webrtc/base/timeutils.h" #include "webrtc/base/timeutils.h"
#include "webrtc/modules/include/module.h" #include "webrtc/modules/include/module.h"
@ -93,7 +94,7 @@ TEST(ProcessThreadImpl, ProcessCall) {
.WillRepeatedly(Return()); .WillRepeatedly(Return());
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.RegisterModule(&module); thread.RegisterModule(&module, RTC_FROM_HERE);
EXPECT_EQ(kEventSignaled, event->Wait(kEventWaitTimeout)); EXPECT_EQ(kEventSignaled, event->Wait(kEventWaitTimeout));
EXPECT_CALL(module, ProcessThreadAttached(nullptr)).Times(1); EXPECT_CALL(module, ProcessThreadAttached(nullptr)).Times(1);
@ -114,7 +115,7 @@ TEST(ProcessThreadImpl, ProcessCall2) {
.WillOnce(DoAll(SetEvent(event.get()), Return())) .WillOnce(DoAll(SetEvent(event.get()), Return()))
.WillRepeatedly(Return()); .WillRepeatedly(Return());
thread.RegisterModule(&module); thread.RegisterModule(&module, RTC_FROM_HERE);
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.Start(); thread.Start();
@ -141,7 +142,7 @@ TEST(ProcessThreadImpl, Deregister) {
Return())) Return()))
.WillRepeatedly(DoAll(Increment(&process_count), Return())); .WillRepeatedly(DoAll(Increment(&process_count), Return()));
thread.RegisterModule(&module); thread.RegisterModule(&module, RTC_FROM_HERE);
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.Start(); thread.Start();
@ -183,7 +184,7 @@ void ProcessCallAfterAFewMs(int64_t milliseconds) {
.WillRepeatedly(Return()); .WillRepeatedly(Return());
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.RegisterModule(&module); thread.RegisterModule(&module, RTC_FROM_HERE);
// Add a buffer of 50ms due to slowness of some trybots // Add a buffer of 50ms due to slowness of some trybots
// (e.g. win_drmemory_light) // (e.g. win_drmemory_light)
@ -244,7 +245,7 @@ TEST(ProcessThreadImpl, DISABLED_Process50Times) {
Return())); Return()));
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.RegisterModule(&module); thread.RegisterModule(&module, RTC_FROM_HERE);
EXPECT_EQ(kEventTimeout, event->Wait(1000)); EXPECT_EQ(kEventTimeout, event->Wait(1000));
@ -290,7 +291,7 @@ TEST(ProcessThreadImpl, WakeUp) {
.WillRepeatedly(Return()); .WillRepeatedly(Return());
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.RegisterModule(&module); thread.RegisterModule(&module, RTC_FROM_HERE);
EXPECT_EQ(kEventSignaled, started->Wait(kEventWaitTimeout)); EXPECT_EQ(kEventSignaled, started->Wait(kEventWaitTimeout));
thread.WakeUp(&module); thread.WakeUp(&module);

View File

@ -14,6 +14,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "webrtc/base/location.h"
#include "webrtc/common_video/h264/h264_common.h" #include "webrtc/common_video/h264/h264_common.h"
#include "webrtc/modules/video_coding/frame_buffer.h" #include "webrtc/modules/video_coding/frame_buffer.h"
#include "webrtc/modules/video_coding/jitter_buffer.h" #include "webrtc/modules/video_coding/jitter_buffer.h"
@ -199,7 +200,7 @@ class ProcessThreadMock : public ProcessThread {
MOCK_METHOD0(Start, void()); MOCK_METHOD0(Start, void());
MOCK_METHOD0(Stop, void()); MOCK_METHOD0(Stop, void());
MOCK_METHOD1(WakeUp, void(Module* module)); MOCK_METHOD1(WakeUp, void(Module* module));
MOCK_METHOD1(RegisterModule, void(Module* module)); MOCK_METHOD2(RegisterModule, void(Module* module, const rtc::Location&));
MOCK_METHOD1(DeRegisterModule, void(Module* module)); MOCK_METHOD1(DeRegisterModule, void(Module* module));
void PostTask(std::unique_ptr<rtc::QueuedTask> task) /*override*/ {} void PostTask(std::unique_ptr<rtc::QueuedTask> task) /*override*/ {}
}; };

View File

@ -14,6 +14,7 @@
#include <utility> #include <utility>
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/common_types.h" #include "webrtc/common_types.h"
#include "webrtc/config.h" #include "webrtc/config.h"
@ -184,12 +185,12 @@ RtpStreamReceiver::RtpStreamReceiver(
// Stats callback for CNAME changes. // Stats callback for CNAME changes.
rtp_rtcp_->RegisterRtcpStatisticsCallback(receive_stats_proxy); rtp_rtcp_->RegisterRtcpStatisticsCallback(receive_stats_proxy);
process_thread_->RegisterModule(rtp_rtcp_.get()); process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE);
if (config_.rtp.nack.rtp_history_ms != 0) { if (config_.rtp.nack.rtp_history_ms != 0) {
nack_module_.reset( nack_module_.reset(
new NackModule(clock_, nack_sender, keyframe_request_sender)); new NackModule(clock_, nack_sender, keyframe_request_sender));
process_thread_->RegisterModule(nack_module_.get()); process_thread_->RegisterModule(nack_module_.get(), RTC_FROM_HERE);
} }
packet_buffer_ = video_coding::PacketBuffer::Create( packet_buffer_ = video_coding::PacketBuffer::Create(

View File

@ -17,6 +17,7 @@
#include <utility> #include <utility>
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/base/optional.h" #include "webrtc/base/optional.h"
#include "webrtc/common_video/h264/profile_level_id.h" #include "webrtc/common_video/h264/profile_level_id.h"
@ -227,8 +228,8 @@ VideoReceiveStream::VideoReceiveStream(
frame_buffer_.reset(new video_coding::FrameBuffer( frame_buffer_.reset(new video_coding::FrameBuffer(
clock_, jitter_estimator_.get(), timing_.get(), &stats_proxy_)); clock_, jitter_estimator_.get(), timing_.get(), &stats_proxy_));
process_thread_->RegisterModule(&video_receiver_); process_thread_->RegisterModule(&video_receiver_, RTC_FROM_HERE);
process_thread_->RegisterModule(&rtp_stream_sync_); process_thread_->RegisterModule(&rtp_stream_sync_, RTC_FROM_HERE);
} }
VideoReceiveStream::~VideoReceiveStream() { VideoReceiveStream::~VideoReceiveStream() {

View File

@ -16,13 +16,14 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "webrtc/common_types.h"
#include "webrtc/common_video/include/video_bitrate_allocator.h"
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/file.h" #include "webrtc/base/file.h"
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/base/trace_event.h" #include "webrtc/base/trace_event.h"
#include "webrtc/base/weak_ptr.h" #include "webrtc/base/weak_ptr.h"
#include "webrtc/common_types.h"
#include "webrtc/common_video/include/video_bitrate_allocator.h"
#include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
#include "webrtc/modules/congestion_controller/include/congestion_controller.h" #include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include "webrtc/modules/pacing/packet_router.h" #include "webrtc/modules/pacing/packet_router.h"
@ -883,7 +884,7 @@ void VideoSendStreamImpl::RegisterProcessThread(
module_process_thread_ = module_process_thread; module_process_thread_ = module_process_thread;
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
module_process_thread_->RegisterModule(rtp_rtcp); module_process_thread_->RegisterModule(rtp_rtcp, RTC_FROM_HERE);
} }
void VideoSendStreamImpl::DeRegisterProcessThread() { void VideoSendStreamImpl::DeRegisterProcessThread() {

View File

@ -16,9 +16,10 @@
#include "webrtc/base/arraysize.h" #include "webrtc/base/arraysize.h"
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/base/trace_event.h"
#include "webrtc/base/timeutils.h" #include "webrtc/base/timeutils.h"
#include "webrtc/base/trace_event.h"
#include "webrtc/common_video/include/video_bitrate_allocator.h" #include "webrtc/common_video/include/video_bitrate_allocator.h"
#include "webrtc/modules/pacing/paced_sender.h" #include "webrtc/modules/pacing/paced_sender.h"
#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
@ -329,7 +330,7 @@ void ViEEncoder::RegisterProcessThread(ProcessThread* module_process_thread) {
RTC_DCHECK_RUN_ON(&thread_checker_); RTC_DCHECK_RUN_ON(&thread_checker_);
RTC_DCHECK(!module_process_thread_); RTC_DCHECK(!module_process_thread_);
module_process_thread_ = module_process_thread; module_process_thread_ = module_process_thread;
module_process_thread_->RegisterModule(&video_sender_); module_process_thread_->RegisterModule(&video_sender_, RTC_FROM_HERE);
module_process_thread_checker_.DetachFromThread(); module_process_thread_checker_.DetachFromThread();
} }

View File

@ -18,6 +18,7 @@
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/format_macros.h" #include "webrtc/base/format_macros.h"
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/base/rate_limiter.h" #include "webrtc/base/rate_limiter.h"
#include "webrtc/base/thread_checker.h" #include "webrtc/base/thread_checker.h"
@ -1025,7 +1026,7 @@ int32_t Channel::Init() {
// --- Add modules to process thread (for periodic schedulation) // --- Add modules to process thread (for periodic schedulation)
_moduleProcessThreadPtr->RegisterModule(_rtpRtcpModule.get()); _moduleProcessThreadPtr->RegisterModule(_rtpRtcpModule.get(), RTC_FROM_HERE);
// --- ACM initialization // --- ACM initialization

View File

@ -14,6 +14,7 @@
#include "webrtc/audio/utility/audio_frame_operations.h" #include "webrtc/audio/utility/audio_frame_operations.h"
#include "webrtc/base/format_macros.h" #include "webrtc/base/format_macros.h"
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/system_wrappers/include/event_wrapper.h" #include "webrtc/system_wrappers/include/event_wrapper.h"
#include "webrtc/system_wrappers/include/trace.h" #include "webrtc/system_wrappers/include/trace.h"
@ -203,7 +204,7 @@ TransmitMixer::SetEngineInformation(ProcessThread& processThread,
_channelManagerPtr = &channelManager; _channelManagerPtr = &channelManager;
#if WEBRTC_VOICE_ENGINE_TYPING_DETECTION #if WEBRTC_VOICE_ENGINE_TYPING_DETECTION
_processThreadPtr->RegisterModule(&_monitorModule); _processThreadPtr->RegisterModule(&_monitorModule, RTC_FROM_HERE);
#endif #endif
return 0; return 0;
} }

View File

@ -12,6 +12,7 @@
#include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h" #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h"
#include "webrtc/base/format_macros.h" #include "webrtc/base/format_macros.h"
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
#include "webrtc/modules/audio_coding/include/audio_coding_module.h" #include "webrtc/modules/audio_coding/include/audio_coding_module.h"
@ -213,7 +214,8 @@ int VoEBaseImpl::Init(
// Register the ADM to the process thread, which will drive the error // Register the ADM to the process thread, which will drive the error
// callback mechanism // callback mechanism
if (shared_->process_thread()) { if (shared_->process_thread()) {
shared_->process_thread()->RegisterModule(shared_->audio_device()); shared_->process_thread()->RegisterModule(shared_->audio_device(),
RTC_FROM_HERE);
} }
bool available = false; bool available = false;