Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 for (const auto& constraint : constraints) { | 59 for (const auto& constraint : constraints) { |
| 60 bool value = false; | 60 bool value = false; |
| 61 if (!rtc::FromString(constraint.value, &value)) | 61 if (!rtc::FromString(constraint.value, &value)) |
| 62 continue; | 62 continue; |
| 63 | 63 |
| 64 for (auto& entry : key_to_value) { | 64 for (auto& entry : key_to_value) { |
| 65 if (constraint.key.compare(entry.name) == 0) | 65 if (constraint.key.compare(entry.name) == 0) |
| 66 entry.value = rtc::Optional<bool>(value); | 66 entry.value = rtc::Optional<bool>(value); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | |
| 70 std::string value; | |
| 71 if (constraints.FindFirst( | |
| 72 MediaConstraintsInterface::kLevelControlInitialPeakLevelDBFS, | |
| 73 &value)) { | |
| 74 float level_control_initial_peak_level_dbfs; | |
| 75 if (rtc::FromString(value, &level_control_initial_peak_level_dbfs)) { | |
| 76 options->level_control_initial_peak_level_dbfs = | |
| 77 rtc::Optional<float>(level_control_initial_peak_level_dbfs); | |
| 78 } | |
| 79 } | |
|
aleloi
2016/10/12 11:43:09
I'm not sure about this. Maybe we should change th
peah-webrtc
2016/10/13 10:23:48
I think it is fine to have them separated like thi
aleloi
2016/10/13 10:30:47
Acknowledged.
| |
| 69 } | 80 } |
| 70 | 81 |
| 71 } // namespace | 82 } // namespace |
| 72 | 83 |
| 73 rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create( | 84 rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create( |
| 74 const PeerConnectionFactoryInterface::Options& options, | 85 const PeerConnectionFactoryInterface::Options& options, |
| 75 const MediaConstraintsInterface* constraints) { | 86 const MediaConstraintsInterface* constraints) { |
| 76 rtc::scoped_refptr<LocalAudioSource> source( | 87 rtc::scoped_refptr<LocalAudioSource> source( |
| 77 new rtc::RefCountedObject<LocalAudioSource>()); | 88 new rtc::RefCountedObject<LocalAudioSource>()); |
| 78 source->Initialize(options, constraints); | 89 source->Initialize(options, constraints); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 106 void LocalAudioSource::Initialize( | 117 void LocalAudioSource::Initialize( |
| 107 const PeerConnectionFactoryInterface::Options& options, | 118 const PeerConnectionFactoryInterface::Options& options, |
| 108 const cricket::AudioOptions* audio_options) { | 119 const cricket::AudioOptions* audio_options) { |
| 109 if (!audio_options) | 120 if (!audio_options) |
| 110 return; | 121 return; |
| 111 | 122 |
| 112 options_ = *audio_options; | 123 options_ = *audio_options; |
| 113 } | 124 } |
| 114 | 125 |
| 115 } // namespace webrtc | 126 } // namespace webrtc |
| OLD | NEW |