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

Side by Side Diff: talk/app/webrtc/localaudiosource.cc

Issue 1179233003: Add kGoogEchoCancellation to MediaConstraintsInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 months 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 unified diff | Download patch
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void FromConstraints(const MediaConstraintsInterface::Constraints& constraints, 44 void FromConstraints(const MediaConstraintsInterface::Constraints& constraints,
45 cricket::AudioOptions* options) { 45 cricket::AudioOptions* options) {
46 // This design relies on the fact that all the audio constraints are actually 46 // This design relies on the fact that all the audio constraints are actually
47 // "options", i.e. boolean-valued and always satisfiable. If the constraints 47 // "options", i.e. boolean-valued and always satisfiable. If the constraints
48 // are extended to include non-boolean values or actual format constraints, 48 // are extended to include non-boolean values or actual format constraints,
49 // a different algorithm will be required. 49 // a different algorithm will be required.
50 struct { 50 struct {
51 const char* name; 51 const char* name;
52 cricket::Settable<bool>& value; 52 cricket::Settable<bool>& value;
53 } key_to_value[] = { 53 } key_to_value[] = {
54 {MediaConstraintsInterface::kEchoCancellation, 54 {MediaConstraintsInterface::kGoogEchoCancellation,
55 options->echo_cancellation}, 55 options->echo_cancellation},
56 // Both kExperimentalEchoCancellation (old) and 56 // Both kExperimentalEchoCancellation (old) and
57 // kExtendedFilterEchoCancellation (new) translate to 57 // kExtendedFilterEchoCancellation (new) translate to
58 // extended_filter_aec 58 // extended_filter_aec
59 // option being set. This is to manage the transition from the old to 59 // option being set. This is to manage the transition from the old to
60 // the 60 // the
61 // new without breaking dependent code. 61 // new without breaking dependent code.
62 {MediaConstraintsInterface::kExperimentalEchoCancellation, 62 {MediaConstraintsInterface::kExperimentalEchoCancellation,
63 options->extended_filter_aec}, 63 options->extended_filter_aec},
64 {MediaConstraintsInterface::kExtendedFilterEchoCancellation, 64 {MediaConstraintsInterface::kExtendedFilterEchoCancellation,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // constraints. 112 // constraints.
113 FromConstraints(constraints->GetOptional(), &options_); 113 FromConstraints(constraints->GetOptional(), &options_);
114 114
115 cricket::AudioOptions mandatory_options; 115 cricket::AudioOptions mandatory_options;
116 FromConstraints(constraints->GetMandatory(), &mandatory_options); 116 FromConstraints(constraints->GetMandatory(), &mandatory_options);
117 options_.SetAll(mandatory_options); 117 options_.SetAll(mandatory_options);
118 source_state_ = kLive; 118 source_state_ = kLive;
119 } 119 }
120 120
121 } // namespace webrtc 121 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/localaudiosource_unittest.cc » ('j') | talk/app/webrtc/mediaconstraintsinterface.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698