Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 // a different algorithm will be required. | 51 // a different algorithm will be required. |
| 52 for (iter = constraints.begin(); iter != constraints.end(); ++iter) { | 52 for (iter = constraints.begin(); iter != constraints.end(); ++iter) { |
| 53 bool value = false; | 53 bool value = false; |
| 54 | 54 |
| 55 if (!rtc::FromString(iter->value, &value)) | 55 if (!rtc::FromString(iter->value, &value)) |
| 56 continue; | 56 continue; |
| 57 | 57 |
| 58 if (iter->key == MediaConstraintsInterface::kEchoCancellation) | 58 if (iter->key == MediaConstraintsInterface::kEchoCancellation) |
| 59 options->echo_cancellation.Set(value); | 59 options->echo_cancellation.Set(value); |
| 60 else if (iter->key == | 60 else if (iter->key == |
| 61 MediaConstraintsInterface::kExperimentalEchoCancellation) | 61 MediaConstraintsInterface::kExperimentalEchoCancellation || |
| 62 options->experimental_aec.Set(value); | 62 iter->key == |
| 63 MediaConstraintsInterface::kExtendedFilterEchoCancellation) | |
|
tommi
2015/06/08 16:41:34
hmm... don't suppose you can start adding braces :
hlundin-webrtc
2015/06/09 08:42:51
Like that?
| |
| 64 // Both kExperimentalEchoCancellation (old) and | |
| 65 // kExtendedFilterEchoCancellation (new) translate to extended_filter_aec | |
| 66 // option being set. This is to manage the transition from the old to the | |
| 67 // new without breaking dependent code. | |
| 68 options->extended_filter_aec.Set(value); | |
| 63 else if (iter->key == MediaConstraintsInterface::kDAEchoCancellation) | 69 else if (iter->key == MediaConstraintsInterface::kDAEchoCancellation) |
| 64 options->delay_agnostic_aec.Set(value); | 70 options->delay_agnostic_aec.Set(value); |
| 65 else if (iter->key == MediaConstraintsInterface::kAutoGainControl) | 71 else if (iter->key == MediaConstraintsInterface::kAutoGainControl) |
| 66 options->auto_gain_control.Set(value); | 72 options->auto_gain_control.Set(value); |
| 67 else if (iter->key == | 73 else if (iter->key == |
| 68 MediaConstraintsInterface::kExperimentalAutoGainControl) | 74 MediaConstraintsInterface::kExperimentalAutoGainControl) |
| 69 options->experimental_agc.Set(value); | 75 options->experimental_agc.Set(value); |
| 70 else if (iter->key == MediaConstraintsInterface::kNoiseSuppression) | 76 else if (iter->key == MediaConstraintsInterface::kNoiseSuppression) |
| 71 options->noise_suppression.Set(value); | 77 options->noise_suppression.Set(value); |
| 72 else if (iter->key == | 78 else if (iter->key == |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 // constraints. | 110 // constraints. |
| 105 FromConstraints(constraints->GetOptional(), &options_); | 111 FromConstraints(constraints->GetOptional(), &options_); |
| 106 | 112 |
| 107 cricket::AudioOptions mandatory_options; | 113 cricket::AudioOptions mandatory_options; |
| 108 FromConstraints(constraints->GetMandatory(), &mandatory_options); | 114 FromConstraints(constraints->GetMandatory(), &mandatory_options); |
| 109 options_.SetAll(mandatory_options); | 115 options_.SetAll(mandatory_options); |
| 110 source_state_ = kLive; | 116 source_state_ = kLive; |
| 111 } | 117 } |
| 112 | 118 |
| 113 } // namespace webrtc | 119 } // namespace webrtc |
| OLD | NEW |