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

Unified Diff: webrtc/pc/peerconnection.cc

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: Fix the issues. Make it ready for another round of review. Add a test. Created 3 years, 7 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
Index: webrtc/pc/peerconnection.cc
diff --git a/webrtc/pc/peerconnection.cc b/webrtc/pc/peerconnection.cc
index 852dd39de5bc21eed1461340f796d4ef0132e55f..eed4c0d974bf03ed9c3a7af249b6b36502cd099f 100644
--- a/webrtc/pc/peerconnection.cc
+++ b/webrtc/pc/peerconnection.cc
@@ -220,6 +220,10 @@ bool SafeSetError(webrtc::RTCErrorType type, webrtc::RTCError* error) {
namespace webrtc {
+std::unique_ptr<RtcEventLog> CreateRtcEventLog();
+
+Call* CreateCall(const Call::Config& config);
+
bool PeerConnectionInterface::RTCConfiguration::operator==(
const PeerConnectionInterface::RTCConfiguration& o) const {
// This static_assert prevents us from accidentally breaking operator==.
@@ -395,7 +399,7 @@ PeerConnection::PeerConnection(PeerConnectionFactory* factory)
: factory_(factory),
observer_(NULL),
uma_observer_(NULL),
- event_log_(RtcEventLog::Create()),
+ event_log_(CreateRtcEventLog()),
signaling_state_(kStable),
ice_connection_state_(kIceConnectionNew),
ice_gathering_state_(kIceGatheringNew),
@@ -2335,13 +2339,17 @@ void PeerConnection::CreateCall_w() {
const int kMaxBandwidthBps = 2000000;
webrtc::Call::Config call_config(event_log_.get());
+ if (!factory_->channel_manager()->media_engine()) {
+ LOG(LS_WARNING)
+ << "Failed to create the Call because the media engine is unset.";
+ return;
+ }
call_config.audio_state =
- factory_->channel_manager() ->media_engine()->GetAudioState();
+ 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));
+ call_.reset(CreateCall(call_config));
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698