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

Unified Diff: webrtc/pc/peerconnection.cc

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: Rebase. Created 3 years, 6 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 | « webrtc/pc/peerconnection.h ('k') | webrtc/pc/peerconnectionfactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnection.cc
diff --git a/webrtc/pc/peerconnection.cc b/webrtc/pc/peerconnection.cc
index 7111b1c53d5925cae4ddfc742a7da2a571840ee2..12891df16bedad5253c0fcc356404aba41f67ef9 100644
--- a/webrtc/pc/peerconnection.cc
+++ b/webrtc/pc/peerconnection.cc
@@ -391,17 +391,20 @@ bool ParseConstraintsForAnswer(const MediaConstraintsInterface* constraints,
return mandatory_constraints_satisfied == constraints->GetMandatory().size();
}
-PeerConnection::PeerConnection(PeerConnectionFactory* factory)
+PeerConnection::PeerConnection(PeerConnectionFactory* factory,
+ std::unique_ptr<RtcEventLog> event_log,
+ std::unique_ptr<Call> call)
: factory_(factory),
observer_(NULL),
uma_observer_(NULL),
- event_log_(RtcEventLog::Create()),
+ event_log_(std::move(event_log)),
signaling_state_(kStable),
ice_connection_state_(kIceConnectionNew),
ice_gathering_state_(kIceGatheringNew),
rtcp_cname_(GenerateRtcpCname()),
local_streams_(StreamCollection::Create()),
- remote_streams_(StreamCollection::Create()) {}
+ remote_streams_(StreamCollection::Create()),
+ call_(std::move(call)) {}
PeerConnection::~PeerConnection() {
TRACE_EVENT0("webrtc", "PeerConnection::~PeerConnection");
@@ -460,10 +463,6 @@ bool PeerConnection::Initialize(
return false;
}
- // Call must be constructed on the worker thread.
- factory_->worker_thread()->Invoke<void>(
- RTC_FROM_HERE, rtc::Bind(&PeerConnection::CreateCall_w,
- this));
session_.reset(new WebRtcSession(
call_.get(), factory_->channel_manager(), configuration.media_config,
@@ -2375,21 +2374,4 @@ void PeerConnection::StopRtcEventLog_w() {
}
}
-void PeerConnection::CreateCall_w() {
- RTC_DCHECK(!call_);
-
- const int kMinBandwidthBps = 30000;
- const int kStartBandwidthBps = 300000;
- const int kMaxBandwidthBps = 2000000;
-
- webrtc::Call::Config call_config(event_log_.get());
- call_config.audio_state =
- factory_->channel_manager() ->media_engine()->GetAudioState();
- call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps;
- call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps;
- call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps;
-
- call_.reset(webrtc::Call::Create(call_config));
-}
-
} // namespace webrtc
« no previous file with comments | « webrtc/pc/peerconnection.h ('k') | webrtc/pc/peerconnectionfactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698