OLD | NEW |
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 }; | 68 }; |
69 | 69 |
70 // If any platform effects are available, check them against the constraints. | 70 // If any platform effects are available, check them against the constraints. |
71 // Disable effects to match false constraints, but if a constraint is true, set | 71 // Disable effects to match false constraints, but if a constraint is true, set |
72 // the constraint to false to later disable the software effect. | 72 // the constraint to false to later disable the software effect. |
73 // | 73 // |
74 // This function may modify both |constraints| and |effects|. | 74 // This function may modify both |constraints| and |effects|. |
75 void HarmonizeConstraintsAndEffects(RTCMediaConstraints* constraints, | 75 void HarmonizeConstraintsAndEffects(RTCMediaConstraints* constraints, |
76 int* effects) { | 76 int* effects) { |
77 if (*effects != media::AudioParameters::NO_EFFECTS) { | 77 if (*effects != media::AudioParameters::NO_EFFECTS) { |
78 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kConstraintEffectMap); ++i) { | 78 for (size_t i = 0; i < arraysize(kConstraintEffectMap); ++i) { |
79 bool value; | 79 bool value; |
80 size_t is_mandatory = 0; | 80 size_t is_mandatory = 0; |
81 if (!webrtc::FindConstraint(constraints, | 81 if (!webrtc::FindConstraint(constraints, |
82 kConstraintEffectMap[i].constraint, | 82 kConstraintEffectMap[i].constraint, |
83 &value, | 83 &value, |
84 &is_mandatory) || !value) { | 84 &is_mandatory) || !value) { |
85 // If the constraint is false, or does not exist, disable the platform | 85 // If the constraint is false, or does not exist, disable the platform |
86 // effect. | 86 // effect. |
87 *effects &= ~kConstraintEffectMap[i].effect; | 87 *effects &= ~kConstraintEffectMap[i].effect; |
88 DVLOG(1) << "Disabling platform effect: " | 88 DVLOG(1) << "Disabling platform effect: " |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 } | 649 } |
650 | 650 |
651 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 651 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
652 if (audio_device_.get()) | 652 if (audio_device_.get()) |
653 return; | 653 return; |
654 | 654 |
655 audio_device_ = new WebRtcAudioDeviceImpl(); | 655 audio_device_ = new WebRtcAudioDeviceImpl(); |
656 } | 656 } |
657 | 657 |
658 } // namespace content | 658 } // namespace content |
OLD | NEW |