OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 class WebRtcVideoCapturerAdapter; | 54 class WebRtcVideoCapturerAdapter; |
55 struct StreamDeviceInfo; | 55 struct StreamDeviceInfo; |
56 | 56 |
57 // Object factory for RTC PeerConnections. | 57 // Object factory for RTC PeerConnections. |
58 class CONTENT_EXPORT PeerConnectionDependencyFactory | 58 class CONTENT_EXPORT PeerConnectionDependencyFactory |
59 : NON_EXPORTED_BASE(base::MessageLoop::DestructionObserver), | 59 : NON_EXPORTED_BASE(base::MessageLoop::DestructionObserver), |
60 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 60 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
61 public: | 61 public: |
62 PeerConnectionDependencyFactory( | 62 PeerConnectionDependencyFactory( |
63 P2PSocketDispatcher* p2p_socket_dispatcher); | 63 P2PSocketDispatcher* p2p_socket_dispatcher); |
64 virtual ~PeerConnectionDependencyFactory(); | 64 ~PeerConnectionDependencyFactory() override; |
65 | 65 |
66 // Create a RTCPeerConnectionHandler object that implements the | 66 // Create a RTCPeerConnectionHandler object that implements the |
67 // WebKit WebRTCPeerConnectionHandler interface. | 67 // WebKit WebRTCPeerConnectionHandler interface. |
68 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( | 68 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( |
69 blink::WebRTCPeerConnectionHandlerClient* client); | 69 blink::WebRTCPeerConnectionHandlerClient* client); |
70 | 70 |
71 // Asks the PeerConnection factory to create a Local MediaStream object. | 71 // Asks the PeerConnection factory to create a Local MediaStream object. |
72 virtual scoped_refptr<webrtc::MediaStreamInterface> | 72 virtual scoped_refptr<webrtc::MediaStreamInterface> |
73 CreateLocalMediaStream(const std::string& label); | 73 CreateLocalMediaStream(const std::string& label); |
74 | 74 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 // Adds the audio device as a sink to the audio track and starts the local | 161 // Adds the audio device as a sink to the audio track and starts the local |
162 // audio track. This is virtual for test purposes since no real audio device | 162 // audio track. This is virtual for test purposes since no real audio device |
163 // exist in unit tests. | 163 // exist in unit tests. |
164 virtual void StartLocalAudioTrack(WebRtcLocalAudioTrack* audio_track); | 164 virtual void StartLocalAudioTrack(WebRtcLocalAudioTrack* audio_track); |
165 | 165 |
166 private: | 166 private: |
167 // Implement base::MessageLoop::DestructionObserver. | 167 // Implement base::MessageLoop::DestructionObserver. |
168 // This makes sure the libjingle PeerConnectionFactory is released before | 168 // This makes sure the libjingle PeerConnectionFactory is released before |
169 // the renderer message loop is destroyed. | 169 // the renderer message loop is destroyed. |
170 virtual void WillDestroyCurrentMessageLoop() override; | 170 void WillDestroyCurrentMessageLoop() override; |
171 | 171 |
172 // Creates |pc_factory_|, which in turn is used for | 172 // Creates |pc_factory_|, which in turn is used for |
173 // creating PeerConnection objects. | 173 // creating PeerConnection objects. |
174 void CreatePeerConnectionFactory(); | 174 void CreatePeerConnectionFactory(); |
175 | 175 |
176 void InitializeSignalingThread( | 176 void InitializeSignalingThread( |
177 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories, | 177 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories, |
178 base::WaitableEvent* event); | 178 base::WaitableEvent* event); |
179 | 179 |
180 void InitializeWorkerThread(rtc::Thread** thread, | 180 void InitializeWorkerThread(rtc::Thread** thread, |
(...skipping 22 matching lines...) Expand all Loading... |
203 rtc::Thread* worker_thread_; | 203 rtc::Thread* worker_thread_; |
204 base::Thread chrome_signaling_thread_; | 204 base::Thread chrome_signaling_thread_; |
205 base::Thread chrome_worker_thread_; | 205 base::Thread chrome_worker_thread_; |
206 | 206 |
207 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); | 207 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); |
208 }; | 208 }; |
209 | 209 |
210 } // namespace content | 210 } // namespace content |
211 | 211 |
212 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ | 212 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ |
OLD | NEW |