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

Unified Diff: content/renderer/media/media_stream_audio_processor_options.cc

Issue 155863003: Add basic support for "googDucking" to getUserMedia on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_audio_processor_options.cc
diff --git a/content/renderer/media/media_stream_audio_processor_options.cc b/content/renderer/media/media_stream_audio_processor_options.cc
index 882d57c8c7bb62691615b2d0327faebeded69883..f70c0900e2532079568527bda19803b81ecbec1c 100644
--- a/content/renderer/media/media_stream_audio_processor_options.cc
+++ b/content/renderer/media/media_stream_audio_processor_options.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/common/media/media_stream_options.h"
#include "content/renderer/media/rtc_media_constraints.h"
#include "media/audio/audio_parameters.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
@@ -41,6 +42,10 @@ struct {
webrtc::MediaConstraintsInterface::kValueTrue },
{ webrtc::MediaConstraintsInterface::kTypingNoiseDetection,
webrtc::MediaConstraintsInterface::kValueTrue },
+#if defined(OS_WIN)
+ { content::kMediaStreamAudioDucking,
+ webrtc::MediaConstraintsInterface::kValueTrue },
+#endif
};
} // namespace
@@ -50,6 +55,12 @@ void ApplyFixedAudioConstraints(RTCMediaConstraints* constraints) {
bool already_set_value;
if (!webrtc::FindConstraint(constraints, kDefaultAudioConstraints[i].key,
&already_set_value, NULL)) {
+ // TODO(tommi): This adds the default constraints to the 'mandatory'
+ // section but it might make more sense to add these to the optional
+ // section since if for whatever reason the default implied constraints
+ // aren't supported on some platform then we should not fail the
+ // getUserMedia call. 'kMediaStreamAudioDucking' is an example where
+ // it is not supported on XP but is supported on newer versions.
constraints->AddMandatory(kDefaultAudioConstraints[i].key,
kDefaultAudioConstraints[i].value, false);
} else {

Powered by Google App Engine
This is Rietveld 408576698