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/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/numerics/safe_math.h" | 10 #include "base/numerics/safe_math.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 return; | 407 return; |
408 } | 408 } |
409 | 409 |
410 // Set the initial AGC state for the audio input stream. Note that, the AGC | 410 // Set the initial AGC state for the audio input stream. Note that, the AGC |
411 // is only supported in AUDIO_PCM_LOW_LATENCY mode. | 411 // is only supported in AUDIO_PCM_LOW_LATENCY mode. |
412 if (config.params.format() == media::AudioParameters::AUDIO_PCM_LOW_LATENCY) { | 412 if (config.params.format() == media::AudioParameters::AUDIO_PCM_LOW_LATENCY) { |
413 entry->controller->SetAutomaticGainControl(config.automatic_gain_control); | 413 entry->controller->SetAutomaticGainControl(config.automatic_gain_control); |
414 oss << ", AGC=" << config.automatic_gain_control; | 414 oss << ", AGC=" << config.automatic_gain_control; |
415 } | 415 } |
416 | 416 |
| 417 #if defined(OS_CHROMEOS) |
| 418 if (config.params.channel_layout() == |
| 419 media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC) { |
| 420 entry->has_keyboard_mic_ = true; |
| 421 } |
| 422 #endif |
| 423 |
417 MediaStreamManager::SendMessageToNativeLog(oss.str()); | 424 MediaStreamManager::SendMessageToNativeLog(oss.str()); |
418 DVLOG(1) << oss.str(); | 425 DVLOG(1) << oss.str(); |
419 | 426 |
420 // Since the controller was created successfully, create an entry and add it | 427 // Since the controller was created successfully, create an entry and add it |
421 // to the map. | 428 // to the map. |
422 entry->stream_id = stream_id; | 429 entry->stream_id = stream_id; |
423 audio_entries_.insert(std::make_pair(stream_id, entry.release())); | 430 audio_entries_.insert(std::make_pair(stream_id, entry.release())); |
424 audio_log_->OnCreated(stream_id, audio_params, device_id); | 431 audio_log_->OnCreated(stream_id, audio_params, device_id); |
425 } | 432 } |
426 | 433 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 #if defined(OS_CHROMEOS) | 556 #if defined(OS_CHROMEOS) |
550 if (config.params.channel_layout() == | 557 if (config.params.channel_layout() == |
551 media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC) { | 558 media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC) { |
552 media_stream_manager_->audio_input_device_manager() | 559 media_stream_manager_->audio_input_device_manager() |
553 ->UnregisterKeyboardMicStream(); | 560 ->UnregisterKeyboardMicStream(); |
554 } | 561 } |
555 #endif | 562 #endif |
556 } | 563 } |
557 | 564 |
558 } // namespace content | 565 } // namespace content |
OLD | NEW |