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

Unified Diff: trunk/src/content/renderer/media/media_stream_dependency_factory.cc

Issue 110303003: Revert 240548 "Enable platform echo cancellation through the Aud..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/content/renderer/media/media_stream_dependency_factory.cc
===================================================================
--- trunk/src/content/renderer/media/media_stream_dependency_factory.cc (revision 240588)
+++ trunk/src/content/renderer/media/media_stream_dependency_factory.cc (working copy)
@@ -78,15 +78,6 @@
webrtc::MediaConstraintsInterface::kValueTrue },
};
-// Map of corresponding media constraints and platform effects.
-struct {
- const char* constraint;
- const media::AudioParameters::PlatformEffectsMask effect;
-} const kConstraintEffectMap[] = {
- { webrtc::MediaConstraintsInterface::kEchoCancellation,
- media::AudioParameters::ECHO_CANCELLER},
-};
-
// Merge |constraints| with |kDefaultAudioConstraints|. For any key which exists
// in both, the value from |constraints| is maintained, including its
// mandatory/optional status. New values from |kDefaultAudioConstraints| will
@@ -332,36 +323,7 @@
// TODO(xians): Create a new capturer for difference microphones when we
// support multiple microphones. See issue crbug/262117 .
- StreamDeviceInfo device_info = source_data->device_info();
- RTCMediaConstraints constraints = native_audio_constraints;
-
- // If any platform effects are available, check them against the
- // constraints. Disable effects to match false constraints, but if a
- // constraint is true, set the constraint to false to later disable the
- // software effect.
- int effects = device_info.device.input.effects;
- if (effects != media::AudioParameters::NO_EFFECTS) {
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kConstraintEffectMap); ++i) {
- bool value;
- if (!webrtc::FindConstraint(&constraints,
- kConstraintEffectMap[i].constraint, &value, NULL) || !value) {
- // If the constraint is false, or does not exist, disable the platform
- // effect.
- effects &= ~kConstraintEffectMap[i].effect;
- DVLOG(1) << "Disabling constraint: "
- << kConstraintEffectMap[i].constraint;
- } else if (effects & kConstraintEffectMap[i].effect) {
- // If the constraint is true, leave the platform effect enabled, and
- // set the constraint to false to later disable the software effect.
- constraints.AddMandatory(kConstraintEffectMap[i].constraint,
- webrtc::MediaConstraintsInterface::kValueFalse, true);
- DVLOG(1) << "Disabling platform effect: "
- << kConstraintEffectMap[i].constraint;
- }
- }
- device_info.device.input.effects = effects;
- }
-
+ const StreamDeviceInfo device_info = source_data->device_info();
scoped_refptr<WebRtcAudioCapturer> capturer(
MaybeCreateAudioCapturer(render_view_id, device_info));
if (!capturer.get()) {
@@ -379,7 +341,7 @@
// Creates a LocalAudioSource object which holds audio options.
// TODO(xians): The option should apply to the track instead of the source.
source_data->SetLocalAudioSource(
- CreateLocalAudioSource(&constraints).get());
+ CreateLocalAudioSource(&native_audio_constraints).get());
source_observer->AddSource(source_data->local_audio_source());
}
@@ -948,8 +910,7 @@
device_info.session_id,
device_info.device.id,
device_info.device.matched_output.sample_rate,
- device_info.device.matched_output.frames_per_buffer,
- device_info.device.input.effects)) {
+ device_info.device.matched_output.frames_per_buffer)) {
return NULL;
}
« no previous file with comments | « trunk/src/content/public/common/media_stream_request.h ('k') | trunk/src/content/renderer/media/webrtc_audio_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698