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

Side by Side Diff: content/renderer/media/webrtc/peer_connection_dependency_factory.cc

Issue 367923004: Turn audio ducking on by default on Windows again. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 5 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 5 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // set the constraint to false to later disable the software effect. 91 // set the constraint to false to later disable the software effect.
92 if (is_mandatory) { 92 if (is_mandatory) {
93 constraints->AddMandatory(kConstraintEffectMap[i].constraint, 93 constraints->AddMandatory(kConstraintEffectMap[i].constraint,
94 webrtc::MediaConstraintsInterface::kValueFalse, true); 94 webrtc::MediaConstraintsInterface::kValueFalse, true);
95 } else { 95 } else {
96 constraints->AddOptional(kConstraintEffectMap[i].constraint, 96 constraints->AddOptional(kConstraintEffectMap[i].constraint,
97 webrtc::MediaConstraintsInterface::kValueFalse, true); 97 webrtc::MediaConstraintsInterface::kValueFalse, true);
98 } 98 }
99 DVLOG(1) << "Disabling constraint: " 99 DVLOG(1) << "Disabling constraint: "
100 << kConstraintEffectMap[i].constraint; 100 << kConstraintEffectMap[i].constraint;
101 } else if (kConstraintEffectMap[i].effect ==
102 media::AudioParameters::DUCKING && value && !is_mandatory) {
103 // Special handling of the DUCKING flag that sets the optional
104 // constraint to |false| to match what the device will support.
105 constraints->AddOptional(kConstraintEffectMap[i].constraint,
106 webrtc::MediaConstraintsInterface::kValueFalse, true);
107 // No need to modify |effects| since the ducking flag is already off.
108 DCHECK((*effects & media::AudioParameters::DUCKING) == 0);
101 } 109 }
102 } 110 }
103 } 111 }
104 } 112 }
105 113
106 class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface { 114 class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface {
107 public: 115 public:
108 P2PPortAllocatorFactory( 116 P2PPortAllocatorFactory(
109 P2PSocketDispatcher* socket_dispatcher, 117 P2PSocketDispatcher* socket_dispatcher,
110 talk_base::NetworkManager* network_manager, 118 talk_base::NetworkManager* network_manager,
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 } 656 }
649 657
650 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { 658 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() {
651 if (audio_device_) 659 if (audio_device_)
652 return; 660 return;
653 661
654 audio_device_ = new WebRtcAudioDeviceImpl(); 662 audio_device_ = new WebRtcAudioDeviceImpl();
655 } 663 }
656 664
657 } // namespace content 665 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698