OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer/media/webrtc/peer_connection_dependency_factory.h" | 5 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 // it is the first audio track connecting to the capturer. | 497 // it is the first audio track connecting to the capturer. |
498 audio_track->Start(); | 498 audio_track->Start(); |
499 } | 499 } |
500 | 500 |
501 scoped_refptr<WebAudioCapturerSource> | 501 scoped_refptr<WebAudioCapturerSource> |
502 PeerConnectionDependencyFactory::CreateWebAudioSource( | 502 PeerConnectionDependencyFactory::CreateWebAudioSource( |
503 blink::WebMediaStreamSource* source) { | 503 blink::WebMediaStreamSource* source) { |
504 DVLOG(1) << "PeerConnectionDependencyFactory::CreateWebAudioSource()"; | 504 DVLOG(1) << "PeerConnectionDependencyFactory::CreateWebAudioSource()"; |
505 | 505 |
506 scoped_refptr<WebAudioCapturerSource> | 506 scoped_refptr<WebAudioCapturerSource> |
507 webaudio_capturer_source(new WebAudioCapturerSource()); | 507 webaudio_capturer_source(new WebAudioCapturerSource(*source)); |
508 MediaStreamAudioSource* source_data = new MediaStreamAudioSource(); | 508 MediaStreamAudioSource* source_data = new MediaStreamAudioSource(); |
509 | 509 |
510 // Use the current default capturer for the WebAudio track so that the | 510 // Use the current default capturer for the WebAudio track so that the |
511 // WebAudio track can pass a valid delay value and |need_audio_processing| | 511 // WebAudio track can pass a valid delay value and |need_audio_processing| |
512 // flag to PeerConnection. | 512 // flag to PeerConnection. |
513 // TODO(xians): Remove this after moving APM to Chrome. | 513 // TODO(xians): Remove this after moving APM to Chrome. |
514 if (GetWebRtcAudioDevice()) { | 514 if (GetWebRtcAudioDevice()) { |
515 source_data->SetAudioCapturer( | 515 source_data->SetAudioCapturer( |
516 GetWebRtcAudioDevice()->GetDefaultCapturer()); | 516 GetWebRtcAudioDevice()->GetDefaultCapturer()); |
517 } | 517 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 } | 643 } |
644 | 644 |
645 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 645 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
646 if (audio_device_.get()) | 646 if (audio_device_.get()) |
647 return; | 647 return; |
648 | 648 |
649 audio_device_ = new WebRtcAudioDeviceImpl(); | 649 audio_device_ = new WebRtcAudioDeviceImpl(); |
650 } | 650 } |
651 | 651 |
652 } // namespace content | 652 } // namespace content |
OLD | NEW |