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

Unified Diff: content/browser/renderer_host/media/audio_input_renderer_host.cc

Issue 15979015: Reland 15721002: Hook up the device selection to the WebAudio live audio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the comments. Created 7 years, 7 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/browser/renderer_host/media/audio_input_renderer_host.cc
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc
index e97bad7b82c0c0aa247bc18edcf69567c36451a4..e67204642313fc50471d47a06760eb017c1ce5f6 100644
--- a/content/browser/renderer_host/media/audio_input_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc
@@ -213,9 +213,19 @@ void AudioInputRendererHost::OnCreateStream(
return;
}
+ media::AudioParameters audio_params(config.params);
+ if (media_stream_manager_->audio_input_device_manager()->
+ ShouldUseFakeDevice()) {
+ audio_params.Reset(
+ media::AudioParameters::AUDIO_FAKE,
+ config.params.channel_layout(), config.params.channels(), 0,
+ config.params.sample_rate(), config.params.bits_per_sample(),
+ config.params.frames_per_buffer());
+ }
+
// Check if we have the permission to open the device and which device to use.
std::string device_id = media::AudioManagerBase::kDefaultDeviceId;
- if (session_id != AudioInputDeviceManager::kFakeOpenSessionId) {
+ if (audio_params.format() != media::AudioParameters::AUDIO_FAKE) {
const StreamDeviceInfo* info = media_stream_manager_->
audio_input_device_manager()->GetOpenedDeviceInfoById(session_id);
if (!info) {
@@ -228,16 +238,6 @@ void AudioInputRendererHost::OnCreateStream(
device_id = info->device.id;
}
- media::AudioParameters audio_params(config.params);
- if (media_stream_manager_->audio_input_device_manager()->
- ShouldUseFakeDevice()) {
- audio_params.Reset(
- media::AudioParameters::AUDIO_FAKE,
- config.params.channel_layout(), config.params.channels(), 0,
- config.params.sample_rate(), config.params.bits_per_sample(),
- config.params.frames_per_buffer());
- }
-
// Create a new AudioEntry structure.
scoped_ptr<AudioEntry> entry(new AudioEntry());

Powered by Google App Engine
This is Rietveld 408576698