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

Side by Side Diff: content/renderer/media/webrtc/peer_connection_dependency_factory.h

Issue 671793004: Clean up the media stream audio track code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 1 month 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 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 class WebRtcAudioCapturer; 48 class WebRtcAudioCapturer;
49 class WebRtcAudioDeviceImpl; 49 class WebRtcAudioDeviceImpl;
50 class WebRtcLocalAudioTrack; 50 class WebRtcLocalAudioTrack;
51 class WebRtcLoggingHandlerImpl; 51 class WebRtcLoggingHandlerImpl;
52 class WebRtcLoggingMessageFilter; 52 class WebRtcLoggingMessageFilter;
53 class WebRtcVideoCapturerAdapter; 53 class WebRtcVideoCapturerAdapter;
54 struct StreamDeviceInfo; 54 struct StreamDeviceInfo;
55 55
56 // Object factory for RTC PeerConnections. 56 // Object factory for RTC PeerConnections.
57 class CONTENT_EXPORT PeerConnectionDependencyFactory 57 class CONTENT_EXPORT PeerConnectionDependencyFactory
58 : NON_EXPORTED_BASE(public base::NonThreadSafe), 58 : NON_EXPORTED_BASE(public base::NonThreadSafe) {
59 NON_EXPORTED_BASE(public AecDumpMessageFilter::AecDumpDelegate) {
60 public: 59 public:
61 PeerConnectionDependencyFactory( 60 PeerConnectionDependencyFactory(
62 P2PSocketDispatcher* p2p_socket_dispatcher); 61 P2PSocketDispatcher* p2p_socket_dispatcher);
63 virtual ~PeerConnectionDependencyFactory(); 62 virtual ~PeerConnectionDependencyFactory();
64 63
65 // Create a RTCPeerConnectionHandler object that implements the 64 // Create a RTCPeerConnectionHandler object that implements the
66 // WebKit WebRTCPeerConnectionHandler interface. 65 // WebKit WebRTCPeerConnectionHandler interface.
67 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( 66 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler(
68 blink::WebRTCPeerConnectionHandlerClient* client); 67 blink::WebRTCPeerConnectionHandlerClient* client);
69 68
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 virtual webrtc::IceCandidateInterface* CreateIceCandidate( 118 virtual webrtc::IceCandidateInterface* CreateIceCandidate(
120 const std::string& sdp_mid, 119 const std::string& sdp_mid,
121 int sdp_mline_index, 120 int sdp_mline_index,
122 const std::string& sdp); 121 const std::string& sdp);
123 122
124 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice(); 123 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice();
125 124
126 scoped_refptr<base::MessageLoopProxy> GetWebRtcWorkerThread() const; 125 scoped_refptr<base::MessageLoopProxy> GetWebRtcWorkerThread() const;
127 scoped_refptr<base::MessageLoopProxy> GetWebRtcSignalingThread() const; 126 scoped_refptr<base::MessageLoopProxy> GetWebRtcSignalingThread() const;
128 127
129 // AecDumpMessageFilter::AecDumpDelegate implementation.
130 // TODO(xians): Remove when option to disable audio track processing is
131 // removed.
132 void OnAecDumpFile(const IPC::PlatformFileForTransit& file_handle) override;
133 void OnDisableAecDump() override;
134 void OnIpcClosing() override;
135
136 protected: 128 protected:
137 // Asks the PeerConnection factory to create a Local Audio Source. 129 // Asks the PeerConnection factory to create a Local Audio Source.
138 virtual scoped_refptr<webrtc::AudioSourceInterface> 130 virtual scoped_refptr<webrtc::AudioSourceInterface>
139 CreateLocalAudioSource( 131 CreateLocalAudioSource(
140 const webrtc::MediaConstraintsInterface* constraints); 132 const webrtc::MediaConstraintsInterface* constraints);
141 133
142 // Creates a media::AudioCapturerSource with an implementation that is 134 // Creates a media::AudioCapturerSource with an implementation that is
143 // specific for a WebAudio source. The created WebAudioCapturerSource 135 // specific for a WebAudio source. The created WebAudioCapturerSource
144 // instance will function as audio source instead of the default 136 // instance will function as audio source instead of the default
145 // WebRtcAudioCapturer. 137 // WebRtcAudioCapturer.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // We own network_manager_, must be deleted on the worker thread. 183 // We own network_manager_, must be deleted on the worker thread.
192 // The network manager uses |p2p_socket_dispatcher_|. 184 // The network manager uses |p2p_socket_dispatcher_|.
193 IpcNetworkManager* network_manager_; 185 IpcNetworkManager* network_manager_;
194 scoped_ptr<IpcPacketSocketFactory> socket_factory_; 186 scoped_ptr<IpcPacketSocketFactory> socket_factory_;
195 187
196 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; 188 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_;
197 189
198 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; 190 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_;
199 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; 191 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_;
200 192
201 // This is only used if audio track processing is disabled.
202 // TODO(xians): Remove when option to disable audio track processing is
203 // removed.
204 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_;
205
206 // PeerConnection threads. signaling_thread_ is created from the 193 // PeerConnection threads. signaling_thread_ is created from the
207 // "current" chrome thread. 194 // "current" chrome thread.
208 rtc::Thread* signaling_thread_; 195 rtc::Thread* signaling_thread_;
209 rtc::Thread* worker_thread_; 196 rtc::Thread* worker_thread_;
210 base::Thread chrome_signaling_thread_; 197 base::Thread chrome_signaling_thread_;
211 base::Thread chrome_worker_thread_; 198 base::Thread chrome_worker_thread_;
212 199
213 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); 200 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory);
214 }; 201 };
215 202
216 } // namespace content 203 } // namespace content
217 204
218 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 205 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698