| 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 "content/renderer/media/video_capture_impl_manager.h" | 9 #include "content/renderer/media/video_capture_impl_manager.h" |
| 10 #include "content/renderer/media/video_capture_module_impl.h" | 10 #include "content/renderer/media/video_capture_module_impl.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 MediaStreamDependencyFactory::MediaStreamDependencyFactory( | 69 MediaStreamDependencyFactory::MediaStreamDependencyFactory( |
| 70 VideoCaptureImplManager* vc_manager) | 70 VideoCaptureImplManager* vc_manager) |
| 71 : vc_manager_(vc_manager) { | 71 : vc_manager_(vc_manager) { |
| 72 } | 72 } |
| 73 | 73 |
| 74 MediaStreamDependencyFactory::~MediaStreamDependencyFactory() {} | 74 MediaStreamDependencyFactory::~MediaStreamDependencyFactory() {} |
| 75 | 75 |
| 76 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory( | 76 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory( |
| 77 int render_view_id, |
| 77 talk_base::Thread* worker_thread, | 78 talk_base::Thread* worker_thread, |
| 78 talk_base::Thread* signaling_thread, | 79 talk_base::Thread* signaling_thread, |
| 79 content::P2PSocketDispatcher* socket_dispatcher, | 80 content::P2PSocketDispatcher* socket_dispatcher, |
| 80 talk_base::NetworkManager* network_manager, | 81 talk_base::NetworkManager* network_manager, |
| 81 talk_base::PacketSocketFactory* socket_factory) { | 82 talk_base::PacketSocketFactory* socket_factory) { |
| 82 if (!pc_factory_.get()) { | 83 if (!pc_factory_.get()) { |
| 83 talk_base::scoped_refptr<P2PPortAllocatorFactory> pa_factory = | 84 talk_base::scoped_refptr<P2PPortAllocatorFactory> pa_factory = |
| 84 new talk_base::RefCountedObject<P2PPortAllocatorFactory>( | 85 new talk_base::RefCountedObject<P2PPortAllocatorFactory>( |
| 85 socket_dispatcher, | 86 socket_dispatcher, |
| 86 network_manager, | 87 network_manager, |
| 87 socket_factory); | 88 socket_factory); |
| 88 | 89 |
| 89 talk_base::scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( | 90 talk_base::scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( |
| 90 webrtc::CreatePeerConnectionFactory(worker_thread, | 91 webrtc::CreatePeerConnectionFactory( |
| 91 signaling_thread, | 92 worker_thread, |
| 92 pa_factory.release(), | 93 signaling_thread, |
| 93 new WebRtcAudioDeviceImpl())); | 94 pa_factory.release(), |
| 95 new WebRtcAudioDeviceImpl(render_view_id))); |
| 94 if (factory.get()) | 96 if (factory.get()) |
| 95 pc_factory_ = factory.release(); | 97 pc_factory_ = factory.release(); |
| 96 } | 98 } |
| 97 return pc_factory_.get() != NULL; | 99 return pc_factory_.get() != NULL; |
| 98 } | 100 } |
| 99 | 101 |
| 100 void MediaStreamDependencyFactory::ReleasePeerConnectionFactory() { | 102 void MediaStreamDependencyFactory::ReleasePeerConnectionFactory() { |
| 101 if (pc_factory_.get()) | 103 if (pc_factory_.get()) |
| 102 pc_factory_ = NULL; | 104 pc_factory_ = NULL; |
| 103 } | 105 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 webrtc::SessionDescriptionInterface* | 144 webrtc::SessionDescriptionInterface* |
| 143 MediaStreamDependencyFactory::CreateSessionDescription(const std::string& sdp) { | 145 MediaStreamDependencyFactory::CreateSessionDescription(const std::string& sdp) { |
| 144 return webrtc::CreateSessionDescription(sdp); | 146 return webrtc::CreateSessionDescription(sdp); |
| 145 } | 147 } |
| 146 | 148 |
| 147 webrtc::IceCandidateInterface* MediaStreamDependencyFactory::CreateIceCandidate( | 149 webrtc::IceCandidateInterface* MediaStreamDependencyFactory::CreateIceCandidate( |
| 148 const std::string& label, | 150 const std::string& label, |
| 149 const std::string& sdp) { | 151 const std::string& sdp) { |
| 150 return webrtc::CreateIceCandidate(label, sdp); | 152 return webrtc::CreateIceCandidate(label, sdp); |
| 151 } | 153 } |
| OLD | NEW |