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/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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 MediaStreamExtraData* extra_data = | 188 MediaStreamExtraData* extra_data = |
189 static_cast<MediaStreamExtraData*>(description->extraData()); | 189 static_cast<MediaStreamExtraData*>(description->extraData()); |
190 extra_data->SetLocalStreamStopCallback(stream_stop); | 190 extra_data->SetLocalStreamStopCallback(stream_stop); |
191 return true; | 191 return true; |
192 } | 192 } |
193 | 193 |
194 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { | 194 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { |
195 if (!pc_factory_.get()) { | 195 if (!pc_factory_.get()) { |
196 DCHECK(!audio_device_); | 196 DCHECK(!audio_device_); |
197 audio_device_ = new WebRtcAudioDeviceImpl(); | 197 // TODO(miu): Some significant refactoring work is needed to support a |
| 198 // separate WebRtcAudioDevice per render view. For now, here's a stub: |
| 199 static const int kUnknownRenderViewId = -1; |
| 200 audio_device_ = new WebRtcAudioDeviceImpl(kUnknownRenderViewId); |
198 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( | 201 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( |
199 webrtc::CreatePeerConnectionFactory(worker_thread_, | 202 webrtc::CreatePeerConnectionFactory(worker_thread_, |
200 signaling_thread_, | 203 signaling_thread_, |
201 audio_device_)); | 204 audio_device_)); |
202 if (factory.get()) | 205 if (factory.get()) |
203 pc_factory_ = factory.release(); | 206 pc_factory_ = factory.release(); |
204 } | 207 } |
205 return pc_factory_.get() != NULL; | 208 return pc_factory_.get() != NULL; |
206 } | 209 } |
207 | 210 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 base::Unretained(this))); | 373 base::Unretained(this))); |
371 // Stopping the thread will wait until all tasks have been | 374 // Stopping the thread will wait until all tasks have been |
372 // processed before returning. We wait for the above task to finish before | 375 // processed before returning. We wait for the above task to finish before |
373 // letting the the function continue to avoid any potential race issues. | 376 // letting the the function continue to avoid any potential race issues. |
374 chrome_worker_thread_.Stop(); | 377 chrome_worker_thread_.Stop(); |
375 } else { | 378 } else { |
376 NOTREACHED() << "Worker thread not running."; | 379 NOTREACHED() << "Worker thread not running."; |
377 } | 380 } |
378 } | 381 } |
379 } | 382 } |
OLD | NEW |