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

Side by Side Diff: content/renderer/media/media_stream_dependency_factory.cc

Issue 11166002: Plumb render view ID from audio-related code in renderer through IPCs to AudioRendererHost in brows… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 8 years, 2 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 (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/renderer/media/media_stream_dependency_factory.h" 5 #include "content/renderer/media/media_stream_dependency_factory.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 MediaStreamExtraData* extra_data = 195 MediaStreamExtraData* extra_data =
196 static_cast<MediaStreamExtraData*>(description->extraData()); 196 static_cast<MediaStreamExtraData*>(description->extraData());
197 extra_data->SetLocalStreamStopCallback(stream_stop); 197 extra_data->SetLocalStreamStopCallback(stream_stop);
198 return true; 198 return true;
199 } 199 }
200 200
201 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { 201 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() {
202 if (!pc_factory_.get()) { 202 if (!pc_factory_.get()) {
203 DCHECK(!audio_device_); 203 DCHECK(!audio_device_);
204 audio_device_ = new WebRtcAudioDeviceImpl(); 204 // TODO(miu): Some significant refactoring work is needed to support a
205 // separate WebRtcAudioDevice per render view. http://crbug.com/156535
206 // For now, here's a stub:
207 static const int kUnknownRenderViewId = -1;
208 audio_device_ = new WebRtcAudioDeviceImpl(kUnknownRenderViewId);
205 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( 209 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory(
206 webrtc::CreatePeerConnectionFactory(worker_thread_, 210 webrtc::CreatePeerConnectionFactory(worker_thread_,
207 signaling_thread_, 211 signaling_thread_,
208 audio_device_)); 212 audio_device_));
209 if (factory.get()) 213 if (factory.get())
210 pc_factory_ = factory.release(); 214 pc_factory_ = factory.release();
211 } 215 }
212 return pc_factory_.get() != NULL; 216 return pc_factory_.get() != NULL;
213 } 217 }
214 218
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 base::Unretained(this))); 387 base::Unretained(this)));
384 // Stopping the thread will wait until all tasks have been 388 // Stopping the thread will wait until all tasks have been
385 // processed before returning. We wait for the above task to finish before 389 // processed before returning. We wait for the above task to finish before
386 // letting the the function continue to avoid any potential race issues. 390 // letting the the function continue to avoid any potential race issues.
387 chrome_worker_thread_.Stop(); 391 chrome_worker_thread_.Stop();
388 } else { 392 } else {
389 NOTREACHED() << "Worker thread not running."; 393 NOTREACHED() << "Worker thread not running.";
390 } 394 }
391 } 395 }
392 } 396 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698