| 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_impl.h" | 5 #include "content/renderer/media/media_stream_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 type, | 71 type, |
| 72 UTF8ToUTF16(devices[i].name)); | 72 UTF8ToUTF16(devices[i].name)); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 MediaStreamImpl::MediaStreamImpl( | 76 MediaStreamImpl::MediaStreamImpl( |
| 77 content::RenderView* render_view, | 77 content::RenderView* render_view, |
| 78 MediaStreamDispatcher* media_stream_dispatcher, | 78 MediaStreamDispatcher* media_stream_dispatcher, |
| 79 content::P2PSocketDispatcher* p2p_socket_dispatcher, | 79 content::P2PSocketDispatcher* p2p_socket_dispatcher, |
| 80 VideoCaptureImplManager* vc_manager, | 80 VideoCaptureImplManager* vc_manager, |
| 81 MediaStreamDependencyFactory* dependency_factory) | 81 MediaStreamDependencyFactory* dependency_factory, |
| 82 AudioDeviceFactoryInterface* audio_device_factory) |
| 82 : content::RenderViewObserver(render_view), | 83 : content::RenderViewObserver(render_view), |
| 83 dependency_factory_(dependency_factory), | 84 dependency_factory_(dependency_factory), |
| 84 media_stream_dispatcher_(media_stream_dispatcher), | 85 media_stream_dispatcher_(media_stream_dispatcher), |
| 85 p2p_socket_dispatcher_(p2p_socket_dispatcher), | 86 p2p_socket_dispatcher_(p2p_socket_dispatcher), |
| 87 audio_device_factory_(audio_device_factory), |
| 86 network_manager_(NULL), | 88 network_manager_(NULL), |
| 87 vc_manager_(vc_manager), | 89 vc_manager_(vc_manager), |
| 88 signaling_thread_(NULL), | 90 signaling_thread_(NULL), |
| 89 worker_thread_(NULL), | 91 worker_thread_(NULL), |
| 90 chrome_worker_thread_("Chrome_libJingle_WorkerThread") { | 92 chrome_worker_thread_("Chrome_libJingle_WorkerThread") { |
| 91 } | 93 } |
| 92 | 94 |
| 93 MediaStreamImpl::~MediaStreamImpl() { | 95 MediaStreamImpl::~MediaStreamImpl() { |
| 94 CleanupPeerConnectionFactory(); | 96 CleanupPeerConnectionFactory(); |
| 95 } | 97 } |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 socket_factory_.reset( | 448 socket_factory_.reset( |
| 447 new content::IpcPacketSocketFactory(p2p_socket_dispatcher_)); | 449 new content::IpcPacketSocketFactory(p2p_socket_dispatcher_)); |
| 448 } | 450 } |
| 449 | 451 |
| 450 if (!dependency_factory_->PeerConnectionFactoryCreated()) { | 452 if (!dependency_factory_->PeerConnectionFactoryCreated()) { |
| 451 if (!dependency_factory_->CreatePeerConnectionFactory( | 453 if (!dependency_factory_->CreatePeerConnectionFactory( |
| 452 worker_thread_, | 454 worker_thread_, |
| 453 signaling_thread_, | 455 signaling_thread_, |
| 454 p2p_socket_dispatcher_, | 456 p2p_socket_dispatcher_, |
| 455 network_manager_, | 457 network_manager_, |
| 456 socket_factory_.get())) { | 458 socket_factory_.get(), |
| 459 audio_device_factory_)) { |
| 457 LOG(ERROR) << "Could not create PeerConnection factory"; | 460 LOG(ERROR) << "Could not create PeerConnection factory"; |
| 458 return false; | 461 return false; |
| 459 } | 462 } |
| 460 } | 463 } |
| 461 | 464 |
| 462 return true; | 465 return true; |
| 463 } | 466 } |
| 464 | 467 |
| 465 void MediaStreamImpl::CleanupPeerConnectionFactory() { | 468 void MediaStreamImpl::CleanupPeerConnectionFactory() { |
| 466 if (dependency_factory_.get()) | 469 if (dependency_factory_.get()) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 MediaStreamExtraData::MediaStreamExtraData( | 585 MediaStreamExtraData::MediaStreamExtraData( |
| 583 webrtc::MediaStreamInterface* remote_stream) | 586 webrtc::MediaStreamInterface* remote_stream) |
| 584 : remote_stream_(remote_stream) { | 587 : remote_stream_(remote_stream) { |
| 585 } | 588 } |
| 586 MediaStreamExtraData::MediaStreamExtraData( | 589 MediaStreamExtraData::MediaStreamExtraData( |
| 587 webrtc::LocalMediaStreamInterface* local_stream) | 590 webrtc::LocalMediaStreamInterface* local_stream) |
| 588 : local_stream_(local_stream) { | 591 : local_stream_(local_stream) { |
| 589 } | 592 } |
| 590 MediaStreamExtraData::~MediaStreamExtraData() { | 593 MediaStreamExtraData::~MediaStreamExtraData() { |
| 591 } | 594 } |
| OLD | NEW |