| 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/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/numerics/safe_math.h" | 12 #include "base/numerics/safe_math.h" |
| 13 #include "base/process/process.h" | 13 #include "base/process/process.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "content/browser/media/capture/web_contents_audio_input_stream.h" | 16 #include "content/browser/media/capture/web_contents_audio_input_stream.h" |
| 17 #include "content/browser/media/capture/web_contents_capture_util.h" | |
| 18 #include "content/browser/media/media_internals.h" | 17 #include "content/browser/media/media_internals.h" |
| 19 #include "content/browser/media/webrtc_internals.h" | 18 #include "content/browser/media/webrtc_internals.h" |
| 20 #include "content/browser/renderer_host/media/audio_input_debug_writer.h" | 19 #include "content/browser/renderer_host/media/audio_input_debug_writer.h" |
| 21 #include "content/browser/renderer_host/media/audio_input_device_manager.h" | 20 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
| 22 #include "content/browser/renderer_host/media/audio_input_sync_writer.h" | 21 #include "content/browser/renderer_host/media/audio_input_sync_writer.h" |
| 23 #include "content/browser/renderer_host/media/media_stream_manager.h" | 22 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 23 #include "content/public/browser/web_contents_media_capture_id.h" |
| 24 #include "media/audio/audio_manager_base.h" | 24 #include "media/audio/audio_manager_base.h" |
| 25 #include "media/base/audio_bus.h" | 25 #include "media/base/audio_bus.h" |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 #ifdef ENABLE_WEBRTC | 31 #ifdef ENABLE_WEBRTC |
| 32 const base::FilePath::CharType kDebugRecordingFileNameAddition[] = | 32 const base::FilePath::CharType kDebugRecordingFileNameAddition[] = |
| 33 FILE_PATH_LITERAL("source_input"); | 33 FILE_PATH_LITERAL("source_input"); |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 | 432 |
| 433 if (!writer->Init()) { | 433 if (!writer->Init()) { |
| 434 SendErrorMessage(stream_id, SYNC_WRITER_INIT_FAILED); | 434 SendErrorMessage(stream_id, SYNC_WRITER_INIT_FAILED); |
| 435 MaybeUnregisterKeyboardMicStream(config); | 435 MaybeUnregisterKeyboardMicStream(config); |
| 436 return; | 436 return; |
| 437 } | 437 } |
| 438 | 438 |
| 439 // If we have successfully created the SyncWriter then assign it to the | 439 // If we have successfully created the SyncWriter then assign it to the |
| 440 // entry and construct an AudioInputController. | 440 // entry and construct an AudioInputController. |
| 441 entry->writer.reset(writer.release()); | 441 entry->writer.reset(writer.release()); |
| 442 if (WebContentsCaptureUtil::IsWebContentsDeviceId(device_id)) { | 442 if (WebContentsMediaCaptureId::IsWebContentsDeviceId(device_id)) { |
| 443 entry->controller = media::AudioInputController::CreateForStream( | 443 entry->controller = media::AudioInputController::CreateForStream( |
| 444 audio_manager_->GetTaskRunner(), | 444 audio_manager_->GetTaskRunner(), |
| 445 this, | 445 this, |
| 446 WebContentsAudioInputStream::Create( | 446 WebContentsAudioInputStream::Create( |
| 447 device_id, | 447 device_id, |
| 448 audio_params, | 448 audio_params, |
| 449 audio_manager_->GetWorkerTaskRunner(), | 449 audio_manager_->GetWorkerTaskRunner(), |
| 450 audio_mirroring_manager_), | 450 audio_mirroring_manager_), |
| 451 entry->writer.get(), | 451 entry->writer.get(), |
| 452 user_input_monitor_); | 452 user_input_monitor_); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 BrowserThread::PostTask( | 724 BrowserThread::PostTask( |
| 725 BrowserThread::FILE, | 725 BrowserThread::FILE, |
| 726 FROM_HERE, | 726 FROM_HERE, |
| 727 base::Bind(&DeleteInputDebugWriterOnFileThread, | 727 base::Bind(&DeleteInputDebugWriterOnFileThread, |
| 728 base::Passed(entry->input_debug_writer.Pass()))); | 728 base::Passed(entry->input_debug_writer.Pass()))); |
| 729 } | 729 } |
| 730 } | 730 } |
| 731 #endif // defined(ENABLE_WEBRTC) | 731 #endif // defined(ENABLE_WEBRTC) |
| 732 | 732 |
| 733 } // namespace content | 733 } // namespace content |
| OLD | NEW |