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