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