Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: content/renderer/media/media_stream_dependency_factory.h

Issue 14247018: Implement WebRTC in Chrome for TV (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
39 } 39 }
40 40
41 namespace content { 41 namespace content {
42 42
43 class IpcNetworkManager; 43 class IpcNetworkManager;
44 class IpcPacketSocketFactory; 44 class IpcPacketSocketFactory;
45 class VideoCaptureImplManager; 45 class VideoCaptureImplManager;
46 class WebRtcAudioDeviceImpl; 46 class WebRtcAudioDeviceImpl;
47 struct StreamDeviceInfo; 47 struct StreamDeviceInfo;
48 48
49 #if defined(GOOGLE_TV)
50 class RTCVideoDecoderFactoryTv;
51 #endif
52
49 // Object factory for RTC MediaStreams and RTC PeerConnections. 53 // Object factory for RTC MediaStreams and RTC PeerConnections.
50 class CONTENT_EXPORT MediaStreamDependencyFactory 54 class CONTENT_EXPORT MediaStreamDependencyFactory
51 : NON_EXPORTED_BASE(public base::NonThreadSafe) { 55 : NON_EXPORTED_BASE(public base::NonThreadSafe) {
52 public: 56 public:
53 // MediaSourcesCreatedCallback is used in CreateNativeMediaSources. 57 // MediaSourcesCreatedCallback is used in CreateNativeMediaSources.
54 typedef base::Callback<void(WebKit::WebMediaStream* description, 58 typedef base::Callback<void(WebKit::WebMediaStream* description,
55 bool live)> MediaSourcesCreatedCallback; 59 bool live)> MediaSourcesCreatedCallback;
56 MediaStreamDependencyFactory( 60 MediaStreamDependencyFactory(
57 VideoCaptureImplManager* vc_manager, 61 VideoCaptureImplManager* vc_manager,
58 P2PSocketDispatcher* p2p_socket_dispatcher); 62 P2PSocketDispatcher* p2p_socket_dispatcher);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 int sdp_mline_index, 131 int sdp_mline_index,
128 const std::string& sdp); 132 const std::string& sdp);
129 133
130 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice(); 134 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice();
131 135
132 // Stop the audio source for local audio tracks. 136 // Stop the audio source for local audio tracks.
133 // TODO(xians): Remove this function if each audio track takes care of their 137 // TODO(xians): Remove this function if each audio track takes care of their
134 // own source. 138 // own source.
135 void StopLocalAudioSource(const WebKit::WebMediaStream& description); 139 void StopLocalAudioSource(const WebKit::WebMediaStream& description);
136 140
141 #if defined(GOOGLE_TV)
142 RTCVideoDecoderFactoryTv* decoder_factory_tv() { return decoder_factory_tv_; }
143 #endif
144
137 protected: 145 protected:
138 // Asks the PeerConnection factory to create a Local MediaStream object. 146 // Asks the PeerConnection factory to create a Local MediaStream object.
139 virtual scoped_refptr<webrtc::MediaStreamInterface> 147 virtual scoped_refptr<webrtc::MediaStreamInterface>
140 CreateLocalMediaStream(const std::string& label); 148 CreateLocalMediaStream(const std::string& label);
141 149
142 // Asks the PeerConnection factory to create a Local Audio Source. 150 // Asks the PeerConnection factory to create a Local Audio Source.
143 virtual scoped_refptr<webrtc::AudioSourceInterface> 151 virtual scoped_refptr<webrtc::AudioSourceInterface>
144 CreateLocalAudioSource( 152 CreateLocalAudioSource(
145 const webrtc::MediaConstraintsInterface* constraints); 153 const webrtc::MediaConstraintsInterface* constraints);
146 154
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 void DeleteIpcNetworkManager(); 202 void DeleteIpcNetworkManager();
195 void CleanupPeerConnectionFactory(); 203 void CleanupPeerConnectionFactory();
196 204
197 // We own network_manager_, must be deleted on the worker thread. 205 // We own network_manager_, must be deleted on the worker thread.
198 // The network manager uses |p2p_socket_dispatcher_|. 206 // The network manager uses |p2p_socket_dispatcher_|.
199 IpcNetworkManager* network_manager_; 207 IpcNetworkManager* network_manager_;
200 scoped_ptr<IpcPacketSocketFactory> socket_factory_; 208 scoped_ptr<IpcPacketSocketFactory> socket_factory_;
201 209
202 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; 210 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_;
203 211
212 #if defined(GOOGLE_TV)
213 // |pc_factory_| will hold the ownership of this object, and |pc_factory_|
214 // outlives this object. Thus weak pointer is sufficient.
ycheo (away) 2013/05/14 13:28:09 weak pointer?
wonsik 2013/05/14 14:18:55 raw pointer is considered weak.
215 RTCVideoDecoderFactoryTv* decoder_factory_tv_;
216 #endif
217
204 scoped_refptr<VideoCaptureImplManager> vc_manager_; 218 scoped_refptr<VideoCaptureImplManager> vc_manager_;
205 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; 219 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_;
206 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; 220 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_;
207 221
208 // PeerConnection threads. signaling_thread_ is created from the 222 // PeerConnection threads. signaling_thread_ is created from the
209 // "current" chrome thread. 223 // "current" chrome thread.
210 talk_base::Thread* signaling_thread_; 224 talk_base::Thread* signaling_thread_;
211 talk_base::Thread* worker_thread_; 225 talk_base::Thread* worker_thread_;
212 base::Thread chrome_worker_thread_; 226 base::Thread chrome_worker_thread_;
213 227
214 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); 228 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory);
215 }; 229 };
216 230
217 } // namespace content 231 } // namespace content
218 232
219 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 233 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698