Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: webrtc/call/call.cc

Issue 1418613002: ChannelGroup cleanup. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added TODO Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/call.cc
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index 9a036c9ede2bd8ae32c2de92151a9603401aaeec..a7c6a7b46850d6a7e7952b03a42201c10d2f65c9 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -34,6 +34,7 @@
#include "webrtc/system_wrappers/interface/trace_event.h"
#include "webrtc/video/video_receive_stream.h"
#include "webrtc/video/video_send_stream.h"
+#include "webrtc/video_engine/call_stats.h"
#include "webrtc/voice_engine/include/voe_codec.h"
namespace webrtc {
@@ -94,6 +95,7 @@ class Call : public webrtc::Call, public PacketReceiver {
const int num_cpu_cores_;
const rtc::scoped_ptr<ProcessThread> module_process_thread_;
+ const rtc::scoped_ptr<CallStats> call_stats_;
const rtc::scoped_ptr<ChannelGroup> channel_group_;
Call::Config config_;
rtc::ThreadChecker configuration_thread_checker_;
@@ -138,7 +140,9 @@ namespace internal {
Call::Call(const Call::Config& config)
: num_cpu_cores_(CpuInfo::DetectNumberOfCores()),
module_process_thread_(ProcessThread::Create("ModuleProcessThread")),
- channel_group_(new ChannelGroup(module_process_thread_.get())),
+ call_stats_(new CallStats()),
+ channel_group_(new ChannelGroup(module_process_thread_.get(),
+ call_stats_.get())),
config_(config),
network_enabled_(true),
receive_crit_(RWLockWrapper::CreateRWLock()),
@@ -162,6 +166,7 @@ Call::Call(const Call::Config& config)
Trace::CreateTrace();
module_process_thread_->Start();
+ module_process_thread_->RegisterModule(call_stats_.get());
channel_group_->SetBweBitrates(config_.bitrate_config.min_bitrate_bps,
config_.bitrate_config.start_bitrate_bps,
@@ -177,6 +182,7 @@ Call::~Call() {
RTC_CHECK(video_receive_ssrcs_.empty());
RTC_CHECK(video_receive_streams_.empty());
+ module_process_thread_->DeRegisterModule(call_stats_.get());
module_process_thread_->Stop();
Trace::ReturnTrace();
}
@@ -272,8 +278,8 @@ webrtc::VideoSendStream* Call::CreateVideoSendStream(
// TODO(mflodman): Base the start bitrate on a current bandwidth estimate, if
// the call has already started.
VideoSendStream* send_stream = new VideoSendStream(num_cpu_cores_,
- module_process_thread_.get(), channel_group_.get(), config,
- encoder_config, suspended_video_send_ssrcs_);
+ module_process_thread_.get(), call_stats_.get(), channel_group_.get(),
+ config, encoder_config, suspended_video_send_ssrcs_);
// This needs to be taken before send_crit_ as both locks need to be held
// while changing network state.
@@ -333,7 +339,7 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream(
RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread());
VideoReceiveStream* receive_stream = new VideoReceiveStream(
num_cpu_cores_, channel_group_.get(), config, config_.voice_engine,
- module_process_thread_.get());
+ module_process_thread_.get(), call_stats_.get());
// This needs to be taken before receive_crit_ as both locks need to be held
// while changing network state.
« no previous file with comments | « no previous file | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698