| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/process.h" | 9 #include "base/process.h" |
| 10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 if (LookupById(stream_id) != NULL) { | 225 if (LookupById(stream_id) != NULL) { |
| 226 SendErrorMessage(stream_id); | 226 SendErrorMessage(stream_id); |
| 227 return; | 227 return; |
| 228 } | 228 } |
| 229 | 229 |
| 230 media::AudioParameters audio_params(params); | 230 media::AudioParameters audio_params(params); |
| 231 | 231 |
| 232 if (media_stream_manager_->audio_input_device_manager()-> | 232 if (media_stream_manager_->audio_input_device_manager()-> |
| 233 ShouldUseFakeDevice()) { | 233 ShouldUseFakeDevice()) { |
| 234 audio_params.Reset(media::AudioParameters::AUDIO_FAKE, | 234 audio_params.Reset(media::AudioParameters::AUDIO_FAKE, |
| 235 params.channel_layout(), 0, params.sample_rate(), | 235 params.channel_layout(), params.channels(), 0, |
| 236 params.sample_rate(), |
| 236 params.bits_per_sample(), params.frames_per_buffer()); | 237 params.bits_per_sample(), params.frames_per_buffer()); |
| 237 } | 238 } |
| 238 | 239 |
| 239 uint32 buffer_size = audio_params.GetBytesPerBuffer(); | 240 uint32 buffer_size = audio_params.GetBytesPerBuffer(); |
| 240 | 241 |
| 241 // Create a new AudioEntry structure. | 242 // Create a new AudioEntry structure. |
| 242 scoped_ptr<AudioEntry> entry(new AudioEntry()); | 243 scoped_ptr<AudioEntry> entry(new AudioEntry()); |
| 243 | 244 |
| 244 uint32 segment_size = | 245 uint32 segment_size = |
| 245 sizeof(media::AudioInputBufferParameters) + buffer_size; | 246 sizeof(media::AudioInputBufferParameters) + buffer_size; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 for (SessionEntryMap::iterator it = session_entries_.begin(); | 468 for (SessionEntryMap::iterator it = session_entries_.begin(); |
| 468 it != session_entries_.end(); ++it) { | 469 it != session_entries_.end(); ++it) { |
| 469 if (stream_id == it->second) { | 470 if (stream_id == it->second) { |
| 470 return it->first; | 471 return it->first; |
| 471 } | 472 } |
| 472 } | 473 } |
| 473 return 0; | 474 return 0; |
| 474 } | 475 } |
| 475 | 476 |
| 476 } // namespace content | 477 } // namespace content |
| OLD | NEW |