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

Side by Side Diff: webrtc/api/peerconnectionfactory.cc

Issue 1818033002: Embed a cricket::MediaConfig in RTCConfiguration. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/api/peerconnectioninterface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 279 }
280 280
281 if (!allocator) { 281 if (!allocator) {
282 allocator.reset(new cricket::BasicPortAllocator( 282 allocator.reset(new cricket::BasicPortAllocator(
283 default_network_manager_.get(), default_socket_factory_.get())); 283 default_network_manager_.get(), default_socket_factory_.get()));
284 } 284 }
285 allocator->SetNetworkIgnoreMask(options_.network_ignore_mask); 285 allocator->SetNetworkIgnoreMask(options_.network_ignore_mask);
286 286
287 rtc::scoped_refptr<PeerConnection> pc( 287 rtc::scoped_refptr<PeerConnection> pc(
288 new rtc::RefCountedObject<PeerConnection>(this)); 288 new rtc::RefCountedObject<PeerConnection>(this));
289 // We rely on default values when constraints aren't found.
290 cricket::MediaConfig media_config;
291 289
292 media_config.video.disable_prerenderer_smoothing = 290 if (!pc->Initialize(configuration, std::move(allocator),
293 configuration.disable_prerenderer_smoothing;
294 if (configuration.enable_dscp) {
295 media_config.enable_dscp = *(configuration.enable_dscp);
296 }
297 if (configuration.cpu_overuse_detection) {
298 media_config.video.enable_cpu_overuse_detection =
299 *(configuration.cpu_overuse_detection);
300 }
301 if (configuration.suspend_below_min_bitrate) {
302 media_config.video.suspend_below_min_bitrate =
303 *(configuration.suspend_below_min_bitrate);
304 }
305
306 if (!pc->Initialize(media_config, configuration, std::move(allocator),
307 std::move(dtls_identity_store), observer)) { 291 std::move(dtls_identity_store), observer)) {
308 return nullptr; 292 return nullptr;
309 } 293 }
310 return PeerConnectionProxy::Create(signaling_thread(), pc); 294 return PeerConnectionProxy::Create(signaling_thread(), pc);
311 } 295 }
312 296
313 rtc::scoped_refptr<MediaStreamInterface> 297 rtc::scoped_refptr<MediaStreamInterface>
314 PeerConnectionFactory::CreateLocalMediaStream(const std::string& label) { 298 PeerConnectionFactory::CreateLocalMediaStream(const std::string& label) {
315 RTC_DCHECK(signaling_thread_->IsCurrent()); 299 RTC_DCHECK(signaling_thread_->IsCurrent());
316 return MediaStreamProxy::Create(signaling_thread_, 300 return MediaStreamProxy::Create(signaling_thread_,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 337 }
354 338
355 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { 339 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() {
356 ASSERT(worker_thread_ == rtc::Thread::Current()); 340 ASSERT(worker_thread_ == rtc::Thread::Current());
357 return cricket::WebRtcMediaEngineFactory::Create( 341 return cricket::WebRtcMediaEngineFactory::Create(
358 default_adm_.get(), video_encoder_factory_.get(), 342 default_adm_.get(), video_encoder_factory_.get(),
359 video_decoder_factory_.get()); 343 video_decoder_factory_.get());
360 } 344 }
361 345
362 } // namespace webrtc 346 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/api/peerconnectioninterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698