Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: content/renderer/media/webrtc/peer_connection_dependency_factory.cc

Issue 310013002: Fix the race when the WebRtcAudioDeviceImpl goes away before capturers stop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the indentation. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/webrtc_audio_device_impl.cc » ('j') | content/renderer/media/webrtc_audio_device_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698