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 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/message_loop/message_loop_proxy.h" | |
scherkus (not reviewing)
2013/07/19 18:13:58
AFAIK you can fwd decl vs include
you may also be
wuchengli
2013/07/20 06:04:14
Done.
| |
12 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
13 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
14 #include "content/renderer/media/media_stream_extra_data.h" | 15 #include "content/renderer/media/media_stream_extra_data.h" |
15 #include "content/renderer/p2p/socket_dispatcher.h" | 16 #include "content/renderer/p2p/socket_dispatcher.h" |
16 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h " | 17 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h " |
17 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h" | 18 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h" |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class WaitableEvent; | 21 class WaitableEvent; |
21 } | 22 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 | 55 |
55 // Object factory for RTC MediaStreams and RTC PeerConnections. | 56 // Object factory for RTC MediaStreams and RTC PeerConnections. |
56 class CONTENT_EXPORT MediaStreamDependencyFactory | 57 class CONTENT_EXPORT MediaStreamDependencyFactory |
57 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | 58 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
58 public: | 59 public: |
59 // MediaSourcesCreatedCallback is used in CreateNativeMediaSources. | 60 // MediaSourcesCreatedCallback is used in CreateNativeMediaSources. |
60 typedef base::Callback<void(WebKit::WebMediaStream* description, | 61 typedef base::Callback<void(WebKit::WebMediaStream* description, |
61 bool live)> MediaSourcesCreatedCallback; | 62 bool live)> MediaSourcesCreatedCallback; |
62 MediaStreamDependencyFactory( | 63 MediaStreamDependencyFactory( |
63 VideoCaptureImplManager* vc_manager, | 64 VideoCaptureImplManager* vc_manager, |
64 P2PSocketDispatcher* p2p_socket_dispatcher); | 65 P2PSocketDispatcher* p2p_socket_dispatcher, |
66 const scoped_refptr<base::MessageLoopProxy>& media_loop_proxy); | |
65 virtual ~MediaStreamDependencyFactory(); | 67 virtual ~MediaStreamDependencyFactory(); |
66 | 68 |
67 // Create a RTCPeerConnectionHandler object that implements the | 69 // Create a RTCPeerConnectionHandler object that implements the |
68 // WebKit WebRTCPeerConnectionHandler interface. | 70 // WebKit WebRTCPeerConnectionHandler interface. |
69 WebKit::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( | 71 WebKit::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( |
70 WebKit::WebRTCPeerConnectionHandlerClient* client); | 72 WebKit::WebRTCPeerConnectionHandlerClient* client); |
71 | 73 |
72 // CreateNativeMediaSources creates libjingle representations of | 74 // CreateNativeMediaSources creates libjingle representations of |
73 // the underlying sources to the tracks in |description|. | 75 // the underlying sources to the tracks in |description|. |
74 // |sources_created| is invoked when the sources have either been created and | 76 // |sources_created| is invoked when the sources have either been created and |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 scoped_refptr<VideoCaptureImplManager> vc_manager_; | 226 scoped_refptr<VideoCaptureImplManager> vc_manager_; |
225 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; | 227 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; |
226 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; | 228 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; |
227 | 229 |
228 // PeerConnection threads. signaling_thread_ is created from the | 230 // PeerConnection threads. signaling_thread_ is created from the |
229 // "current" chrome thread. | 231 // "current" chrome thread. |
230 talk_base::Thread* signaling_thread_; | 232 talk_base::Thread* signaling_thread_; |
231 talk_base::Thread* worker_thread_; | 233 talk_base::Thread* worker_thread_; |
232 base::Thread chrome_worker_thread_; | 234 base::Thread chrome_worker_thread_; |
233 | 235 |
236 // Message loop proxy of the media thread. | |
237 scoped_refptr<base::MessageLoopProxy> media_loop_proxy_; | |
238 | |
234 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); | 239 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); |
235 }; | 240 }; |
236 | 241 |
237 } // namespace content | 242 } // namespace content |
238 | 243 |
239 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 244 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |