| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/media_stream_dependency_factory.h" | 5 #include "content/renderer/media/media_stream_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "media/base/android/media_codec_bridge.h" | 52 #include "media/base/android/media_codec_bridge.h" |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 namespace content { | 55 namespace content { |
| 56 | 56 |
| 57 // Map of corresponding media constraints and platform effects. | 57 // Map of corresponding media constraints and platform effects. |
| 58 struct { | 58 struct { |
| 59 const char* constraint; | 59 const char* constraint; |
| 60 const media::AudioParameters::PlatformEffectsMask effect; | 60 const media::AudioParameters::PlatformEffectsMask effect; |
| 61 } const kConstraintEffectMap[] = { | 61 } const kConstraintEffectMap[] = { |
| 62 { content::kMediaStreamAudioDucking, |
| 63 media::AudioParameters::DUCKING }, |
| 62 { webrtc::MediaConstraintsInterface::kEchoCancellation, | 64 { webrtc::MediaConstraintsInterface::kEchoCancellation, |
| 63 media::AudioParameters::ECHO_CANCELLER}, | 65 media::AudioParameters::ECHO_CANCELLER }, |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 // If any platform effects are available, check them against the constraints. | 68 // If any platform effects are available, check them against the constraints. |
| 67 // Disable effects to match false constraints, but if a constraint is true, set | 69 // Disable effects to match false constraints, but if a constraint is true, set |
| 68 // the constraint to false to later disable the software effect. | 70 // the constraint to false to later disable the software effect. |
| 69 // | 71 // |
| 70 // This function may modify both |constraints| and |effects|. | 72 // This function may modify both |constraints| and |effects|. |
| 71 void HarmonizeConstraintsAndEffects(RTCMediaConstraints* constraints, | 73 void HarmonizeConstraintsAndEffects(RTCMediaConstraints* constraints, |
| 72 int* effects) { | 74 int* effects) { |
| 73 if (*effects != media::AudioParameters::NO_EFFECTS) { | 75 if (*effects != media::AudioParameters::NO_EFFECTS) { |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 } | 836 } |
| 835 | 837 |
| 836 void MediaStreamDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 838 void MediaStreamDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 837 if (audio_device_) | 839 if (audio_device_) |
| 838 return; | 840 return; |
| 839 | 841 |
| 840 audio_device_ = new WebRtcAudioDeviceImpl(); | 842 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 841 } | 843 } |
| 842 | 844 |
| 843 } // namespace content | 845 } // namespace content |
| OLD | NEW |