Chromium Code Reviews| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 440 StartLocalAudioTrack(audio_track.get()); | 440 StartLocalAudioTrack(audio_track.get()); |
| 441 | 441 |
| 442 // Pass the ownership of the native local audio track to the blink track. | 442 // Pass the ownership of the native local audio track to the blink track. |
| 443 blink::WebMediaStreamTrack writable_track = track; | 443 blink::WebMediaStreamTrack writable_track = track; |
| 444 writable_track.setExtraData(audio_track.release()); | 444 writable_track.setExtraData(audio_track.release()); |
| 445 } | 445 } |
| 446 | 446 |
| 447 void PeerConnectionDependencyFactory::StartLocalAudioTrack( | 447 void PeerConnectionDependencyFactory::StartLocalAudioTrack( |
| 448 WebRtcLocalAudioTrack* audio_track) { | 448 WebRtcLocalAudioTrack* audio_track) { |
| 449 // Add the WebRtcAudioDevice as the sink to the local audio track. | 449 // Add the WebRtcAudioDevice as the sink to the local audio track. |
| 450 // TODO(xians): Implement a PeerConnection sink adapter and remove this | 450 // TODO(xians): Remove the following line of code after the APM in WebRTC is |
|
henrika (OOO until Aug 14)
2014/06/03 11:00:15
Link to crbug?
no longer working on chromium
2014/06/03 11:31:14
Done.
| |
| 451 // AddSink() call. | 451 // completely deprecated. |
| 452 audio_track->AddSink(GetWebRtcAudioDevice()); | 452 if (!MediaStreamAudioProcessor::IsAudioTrackProcessingEnabled()) |
| 453 audio_track->AddSink(GetWebRtcAudioDevice()); | |
| 454 | |
| 453 // Start the audio track. This will hook the |audio_track| to the capturer | 455 // Start the audio track. This will hook the |audio_track| to the capturer |
| 454 // as the sink of the audio, and only start the source of the capturer if | 456 // as the sink of the audio, and only start the source of the capturer if |
| 455 // it is the first audio track connecting to the capturer. | 457 // it is the first audio track connecting to the capturer. |
| 456 audio_track->Start(); | 458 audio_track->Start(); |
| 457 } | 459 } |
| 458 | 460 |
| 459 scoped_refptr<WebAudioCapturerSource> | 461 scoped_refptr<WebAudioCapturerSource> |
| 460 PeerConnectionDependencyFactory::CreateWebAudioSource( | 462 PeerConnectionDependencyFactory::CreateWebAudioSource( |
| 461 blink::WebMediaStreamSource* source) { | 463 blink::WebMediaStreamSource* source) { |
| 462 DVLOG(1) << "PeerConnectionDependencyFactory::CreateWebAudioSource()"; | 464 DVLOG(1) << "PeerConnectionDependencyFactory::CreateWebAudioSource()"; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 661 } | 663 } |
| 662 | 664 |
| 663 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 665 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 664 if (audio_device_) | 666 if (audio_device_) |
| 665 return; | 667 return; |
| 666 | 668 |
| 667 audio_device_ = new WebRtcAudioDeviceImpl(); | 669 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 668 } | 670 } |
| 669 | 671 |
| 670 } // namespace content | 672 } // namespace content |
| OLD | NEW |