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" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class IpcPacketSocketFactory; | 47 class IpcPacketSocketFactory; |
48 class RTCMediaConstraints; | 48 class RTCMediaConstraints; |
49 class VideoCaptureImplManager; | 49 class VideoCaptureImplManager; |
50 class WebAudioCapturerSource; | 50 class WebAudioCapturerSource; |
51 class WebRtcAudioCapturer; | 51 class WebRtcAudioCapturer; |
52 class WebRtcAudioDeviceImpl; | 52 class WebRtcAudioDeviceImpl; |
53 class WebRtcLoggingHandlerImpl; | 53 class WebRtcLoggingHandlerImpl; |
54 class WebRtcLoggingMessageFilter; | 54 class WebRtcLoggingMessageFilter; |
55 struct StreamDeviceInfo; | 55 struct StreamDeviceInfo; |
56 | 56 |
57 #if defined(GOOGLE_TV) | |
58 class RTCVideoDecoderFactoryTv; | |
59 #endif | |
60 | |
61 // Object factory for RTC MediaStreams and RTC PeerConnections. | 57 // Object factory for RTC MediaStreams and RTC PeerConnections. |
62 class CONTENT_EXPORT MediaStreamDependencyFactory | 58 class CONTENT_EXPORT MediaStreamDependencyFactory |
63 : NON_EXPORTED_BASE(public base::NonThreadSafe), | 59 : NON_EXPORTED_BASE(public base::NonThreadSafe), |
64 public RenderProcessObserver { | 60 public RenderProcessObserver { |
65 public: | 61 public: |
66 // MediaSourcesCreatedCallback is used in CreateNativeMediaSources. | 62 // MediaSourcesCreatedCallback is used in CreateNativeMediaSources. |
67 typedef base::Callback<void(blink::WebMediaStream* web_stream, | 63 typedef base::Callback<void(blink::WebMediaStream* web_stream, |
68 bool live)> MediaSourcesCreatedCallback; | 64 bool live)> MediaSourcesCreatedCallback; |
69 MediaStreamDependencyFactory( | 65 MediaStreamDependencyFactory( |
70 VideoCaptureImplManager* vc_manager, | 66 VideoCaptureImplManager* vc_manager, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 webrtc::SdpParseError* error); | 135 webrtc::SdpParseError* error); |
140 | 136 |
141 // Creates a libjingle representation of an ice candidate. | 137 // Creates a libjingle representation of an ice candidate. |
142 virtual webrtc::IceCandidateInterface* CreateIceCandidate( | 138 virtual webrtc::IceCandidateInterface* CreateIceCandidate( |
143 const std::string& sdp_mid, | 139 const std::string& sdp_mid, |
144 int sdp_mline_index, | 140 int sdp_mline_index, |
145 const std::string& sdp); | 141 const std::string& sdp); |
146 | 142 |
147 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice(); | 143 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice(); |
148 | 144 |
149 #if defined(GOOGLE_TV) | |
150 RTCVideoDecoderFactoryTv* decoder_factory_tv() { return decoder_factory_tv_; } | |
151 #endif | |
152 | |
153 static void AddNativeTrackToBlinkTrack( | 145 static void AddNativeTrackToBlinkTrack( |
154 webrtc::MediaStreamTrackInterface* native_track, | 146 webrtc::MediaStreamTrackInterface* native_track, |
155 const blink::WebMediaStreamTrack& webkit_track, | 147 const blink::WebMediaStreamTrack& webkit_track, |
156 bool is_local_track); | 148 bool is_local_track); |
157 | 149 |
158 static webrtc::MediaStreamInterface* GetNativeMediaStream( | 150 static webrtc::MediaStreamInterface* GetNativeMediaStream( |
159 const blink::WebMediaStream& stream); | 151 const blink::WebMediaStream& stream); |
160 | 152 |
161 static webrtc::MediaStreamTrackInterface* GetNativeMediaStreamTrack( | 153 static webrtc::MediaStreamTrackInterface* GetNativeMediaStreamTrack( |
162 const blink::WebMediaStreamTrack& track); | 154 const blink::WebMediaStreamTrack& track); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 234 |
243 void StartAecDump(const base::PlatformFile& aec_dump_file); | 235 void StartAecDump(const base::PlatformFile& aec_dump_file); |
244 | 236 |
245 // We own network_manager_, must be deleted on the worker thread. | 237 // We own network_manager_, must be deleted on the worker thread. |
246 // The network manager uses |p2p_socket_dispatcher_|. | 238 // The network manager uses |p2p_socket_dispatcher_|. |
247 IpcNetworkManager* network_manager_; | 239 IpcNetworkManager* network_manager_; |
248 scoped_ptr<IpcPacketSocketFactory> socket_factory_; | 240 scoped_ptr<IpcPacketSocketFactory> socket_factory_; |
249 | 241 |
250 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; | 242 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; |
251 | 243 |
252 #if defined(GOOGLE_TV) | |
253 // |pc_factory_| will hold the ownership of this object, and |pc_factory_| | |
254 // outlives this object. Thus weak pointer is sufficient. | |
255 RTCVideoDecoderFactoryTv* decoder_factory_tv_; | |
256 #endif | |
257 | |
258 scoped_refptr<VideoCaptureImplManager> vc_manager_; | 244 scoped_refptr<VideoCaptureImplManager> vc_manager_; |
259 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; | 245 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; |
260 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; | 246 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; |
261 | 247 |
262 // PeerConnection threads. signaling_thread_ is created from the | 248 // PeerConnection threads. signaling_thread_ is created from the |
263 // "current" chrome thread. | 249 // "current" chrome thread. |
264 talk_base::Thread* signaling_thread_; | 250 talk_base::Thread* signaling_thread_; |
265 talk_base::Thread* worker_thread_; | 251 talk_base::Thread* worker_thread_; |
266 base::Thread chrome_worker_thread_; | 252 base::Thread chrome_worker_thread_; |
267 | 253 |
268 base::PlatformFile aec_dump_file_; | 254 base::PlatformFile aec_dump_file_; |
269 | 255 |
270 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); | 256 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); |
271 }; | 257 }; |
272 | 258 |
273 } // namespace content | 259 } // namespace content |
274 | 260 |
275 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 261 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |