diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 22:12:05 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 22:12:05 +0000 |
commit | 2b392e59ab9a72858d224bad9e422fe40a696a69 (patch) | |
tree | 124296c1b0473baa88c55a66f95d22b3e4623f04 /media/audio/audio_output_resampler.cc | |
parent | c9b6e6a5b77de034a13c5d26b9084c40bb0e74c7 (diff) | |
download | chromium_src-2b392e59ab9a72858d224bad9e422fe40a696a69.zip chromium_src-2b392e59ab9a72858d224bad9e422fe40a696a69.tar.gz chromium_src-2b392e59ab9a72858d224bad9e422fe40a696a69.tar.bz2 |
Simulate an audio output stream when a real one isn't available.
Upgrades FakeAudioOutputStream to fake OnMoreData calls using a
PostDelayedTask approach similar to NullAudioSink.
This is necessary for playback of HTML5 videos when a real audio
device is not present. I.e. over remote desktop w/ remote audio
disabled on on some of the Buildbot machines (this should allow
us to remove --disable-audio from many of our tests).
This is a two fold change:
1. AudioOutputResampler will now request an AUDIO_FAKE device
when invalid output parameters are provided.
2. AudioManagerBase will check for AUDIO_FAKE as it always has
but will additionally check if there are any output devices
and if not return a fake stream.
2 is necessary for HTML5 audio since it doesn't use the low
latency output path.
BUG=120749
TEST=unittests. HTML5/Flash video playback over Remote Desktop
w/o Remote Audio works.
Review URL: https://chromiumcodereview.appspot.com/10987087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162810 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_output_resampler.cc')
-rw-r--r-- | media/audio/audio_output_resampler.cc | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/media/audio/audio_output_resampler.cc b/media/audio/audio_output_resampler.cc index 12fe139..9658642 100644 --- a/media/audio/audio_output_resampler.cc +++ b/media/audio/audio_output_resampler.cc @@ -176,25 +176,13 @@ AudioOutputResampler::AudioOutputResampler(AudioManager* audio_manager, close_delay_(close_delay), output_params_(output_params), streams_opened_(false) { + DCHECK(input_params.IsValid()); + DCHECK(output_params.IsValid()); DCHECK_EQ(output_params_.format(), AudioParameters::AUDIO_PCM_LOW_LATENCY); // Record UMA statistics for the hardware configuration. RecordStats(output_params); - // Immediately fallback if we're given invalid output parameters. This may - // happen if the OS provided us junk values for the hardware configuration. - if (!output_params_.IsValid()) { - LOG(ERROR) << "Invalid audio output parameters received; using fallback " - << "path. Channels: " << output_params_.channels() << ", " - << "Sample Rate: " << output_params_.sample_rate() << ", " - << "Bits Per Sample: " << output_params_.bits_per_sample() - << ", Frames Per Buffer: " << output_params_.frames_per_buffer(); - // Record UMA statistics about the hardware which triggered the failure so - // we can debug and triage later. - RecordFallbackStats(output_params); - output_params_ = SetupFallbackParams(input_params, output_params); - } - Initialize(); } |