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

Side by Side Diff: talk/app/webrtc/peerconnection.cc

Issue 1670153003: Introduce struct MediaConfig, with construction-time settings. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 626
627 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) { 627 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) {
628 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP; 628 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP;
629 LOG(LS_INFO) << "TCP candidates are disabled."; 629 LOG(LS_INFO) << "TCP candidates are disabled.";
630 } 630 }
631 631
632 port_allocator_->set_flags(portallocator_flags); 632 port_allocator_->set_flags(portallocator_flags);
633 // No step delay is used while allocating ports. 633 // No step delay is used while allocating ports.
634 port_allocator_->set_step_delay(cricket::kMinimumStepDelay); 634 port_allocator_->set_step_delay(cricket::kMinimumStepDelay);
635 635
636 media_controller_.reset(factory_->CreateMediaController()); 636 // We rely on default values when constraints aren't found.
637 MediaConfig media_config;
638
639 media_config.disable_prerenderer_smoothing =
640 configuration.disable_prerenderer_smoothing;
641
642 // Find DSCP constraint.
643 FindConstraint(constraints,
644 MediaConstraintsInterface::kEnableDscp,
645 &media_config.enable_dscp, NULL);
646 // Find constraints for cpu overuse detection.
647 FindConstraint(constraints,
648 MediaConstraintsInterface::kCpuOveruseDetection,
649 &media_config.cpu_overuse_detection, NULL);
650
651 media_controller_.reset(factory_->CreateMediaController(media_config));
637 652
638 remote_stream_factory_.reset(new RemoteMediaStreamFactory( 653 remote_stream_factory_.reset(new RemoteMediaStreamFactory(
639 factory_->signaling_thread(), media_controller_->channel_manager())); 654 factory_->signaling_thread(), media_controller_->channel_manager()));
640 655
641 session_.reset( 656 session_.reset(
642 new WebRtcSession(media_controller_.get(), factory_->signaling_thread(), 657 new WebRtcSession(media_controller_.get(), factory_->signaling_thread(),
643 factory_->worker_thread(), port_allocator_.get())); 658 factory_->worker_thread(), port_allocator_.get()));
644 stats_.reset(new StatsCollector(this)); 659 stats_.reset(new StatsCollector(this));
645 660
646 // Initialize the WebRtcSession. It creates transport channels etc. 661 // Initialize the WebRtcSession. It creates transport channels etc.
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { 2103 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const {
2089 for (const auto& channel : sctp_data_channels_) { 2104 for (const auto& channel : sctp_data_channels_) {
2090 if (channel->id() == sid) { 2105 if (channel->id() == sid) {
2091 return channel; 2106 return channel;
2092 } 2107 }
2093 } 2108 }
2094 return nullptr; 2109 return nullptr;
2095 } 2110 }
2096 2111
2097 } // namespace webrtc 2112 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698