summaryrefslogtreecommitdiffstats
path: root/content/common/media
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-12 23:38:49 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-12 23:38:49 +0000
commitf343a499e981bff20b5304838041800d0ce5e587 (patch)
tree7d18d53019834a3bc18fd52c5fe093b1dba150e1 /content/common/media
parent98d4c65b57e0def1c279a8d6a9579cffc42bdf2a (diff)
downloadchromium_src-f343a499e981bff20b5304838041800d0ce5e587.zip
chromium_src-f343a499e981bff20b5304838041800d0ce5e587.tar.gz
chromium_src-f343a499e981bff20b5304838041800d0ce5e587.tar.bz2
Add basic support for "googDucking" to getUserMedia on Windows.
When enabled, this causes Chrome to open the default communication device instead of the "regular" default device (eConsole). At the moment this only works for the default device (i.e. when getUserMedia is called _without_ a sourceId constraint). But it is possible to implement this for other audio devices and I'll do so in a followup CL. While doing this I also fixed a few other things that I ran into: * Added support for the 'AudioParameters::DUCKING' effect in the WASAPI audio implementation. * Refactored WASAPIAudioInputStream: Removed HardwareSampleRate and HardwareChannelCount since they duplicate work and added GetInputStreamParameters instead. * Fixed AudioManager::GetInputStream to return format == linear AudioParameters on XP (previously it would always return 'low latency'). * Fixed AudioManager::GetInputStream to return a 10ms default buffer size for the low latency path instead of a fixed buffer size of 2048. * Fixed a race issue with how CoreAudio::IsSupported was being used. Also added documentation/warning about the implementation properties of that function. - This race has been causing tests to be flaky (for example the InputVolumeTest has been red for weeks on the Windows audio bot: http://build.chromium.org/p/chromium.gpu.fyi/waterfall?builder=Win7%20Audio). * Removed the InvalidPacketSize test since it doesn't make sense anymore. The code that InvalidPacketSize has been testing, has been gone for 6 weeks now and the Windows audio bot has been red that entire time. BUG=340377, 314654, 295751 TEST=Manually run the "WASAPIAudioInputStreamRecordToFile" test while playing out audio in another application (or a youtube clip). The playing audio should lower in volume while the test runs. Review URL: https://codereview.chromium.org/155863003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/media')
-rw-r--r--content/common/media/media_stream_options.cc3
-rw-r--r--content/common/media/media_stream_options.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/content/common/media/media_stream_options.cc b/content/common/media/media_stream_options.cc
index 4ddef01..c727b63 100644
--- a/content/common/media/media_stream_options.cc
+++ b/content/common/media/media_stream_options.cc
@@ -17,6 +17,9 @@ const char kMediaStreamSourceDesktop[] = "desktop";
const char kMediaStreamSourceSystem[] = "system";
const char kMediaStreamRenderToAssociatedSink[] =
"chromeRenderToAssociatedSink";
+// The prefix of this constant is 'goog' to match with other getUserMedia
+// constraints for audio.
+const char kMediaStreamAudioDucking[] = "googDucking";
namespace {
diff --git a/content/common/media/media_stream_options.h b/content/common/media/media_stream_options.h
index 1b7401c..e58f137 100644
--- a/content/common/media/media_stream_options.h
+++ b/content/common/media/media_stream_options.h
@@ -28,6 +28,9 @@ CONTENT_EXPORT extern const char kMediaStreamSourceSystem[];
// device belongs to.
CONTENT_EXPORT extern const char kMediaStreamRenderToAssociatedSink[];
+// Controls whether ducking of audio is enabled on platforms that support it.
+CONTENT_EXPORT extern const char kMediaStreamAudioDucking[];
+
// StreamOptions is a Chromium representation of constraints
// used in WebUserMediaRequest.
// It describes properties requested by JS in a request for a new