| 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. For now, here's a stub: |
| 203 static const int kUnknownRenderViewId = -1; |
| 204 audio_device_ = new WebRtcAudioDeviceImpl(kUnknownRenderViewId); |
| 202 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( | 205 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( |
| 203 webrtc::CreatePeerConnectionFactory(worker_thread_, | 206 webrtc::CreatePeerConnectionFactory(worker_thread_, |
| 204 signaling_thread_, | 207 signaling_thread_, |
| 205 audio_device_)); | 208 audio_device_)); |
| 206 if (factory.get()) | 209 if (factory.get()) |
| 207 pc_factory_ = factory.release(); | 210 pc_factory_ = factory.release(); |
| 208 } | 211 } |
| 209 return pc_factory_.get() != NULL; | 212 return pc_factory_.get() != NULL; |
| 210 } | 213 } |
| 211 | 214 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 base::Unretained(this))); | 382 base::Unretained(this))); |
| 380 // Stopping the thread will wait until all tasks have been | 383 // Stopping the thread will wait until all tasks have been |
| 381 // processed before returning. We wait for the above task to finish before | 384 // processed before returning. We wait for the above task to finish before |
| 382 // letting the the function continue to avoid any potential race issues. | 385 // letting the the function continue to avoid any potential race issues. |
| 383 chrome_worker_thread_.Stop(); | 386 chrome_worker_thread_.Stop(); |
| 384 } else { | 387 } else { |
| 385 NOTREACHED() << "Worker thread not running."; | 388 NOTREACHED() << "Worker thread not running."; |
| 386 } | 389 } |
| 387 } | 390 } |
| 388 } | 391 } |
| OLD | NEW |