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

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

Issue 1780653002: Revert of MediaStream audio object graph untangling and clean-ups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 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/files/file.h" 10 #include "base/files/file.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 protected: 146 protected:
147 // Asks the PeerConnection factory to create a Local Audio Source. 147 // Asks the PeerConnection factory to create a Local Audio Source.
148 virtual scoped_refptr<webrtc::AudioSourceInterface> 148 virtual scoped_refptr<webrtc::AudioSourceInterface>
149 CreateLocalAudioSource( 149 CreateLocalAudioSource(
150 const webrtc::MediaConstraintsInterface* constraints); 150 const webrtc::MediaConstraintsInterface* constraints);
151 151
152 // Creates a media::AudioCapturerSource with an implementation that is 152 // Creates a media::AudioCapturerSource with an implementation that is
153 // specific for a WebAudio source. The created WebAudioCapturerSource 153 // specific for a WebAudio source. The created WebAudioCapturerSource
154 // instance will function as audio source instead of the default 154 // instance will function as audio source instead of the default
155 // WebRtcAudioCapturer. Ownership of the new WebAudioCapturerSource is 155 // WebRtcAudioCapturer.
156 // transferred to |source|. 156 virtual scoped_refptr<WebAudioCapturerSource> CreateWebAudioSource(
157 virtual void CreateWebAudioSource(blink::WebMediaStreamSource* source); 157 blink::WebMediaStreamSource* source);
158 158
159 // Asks the PeerConnection factory to create a Local VideoTrack object with 159 // Asks the PeerConnection factory to create a Local VideoTrack object with
160 // the video source using |capturer|. 160 // the video source using |capturer|.
161 virtual scoped_refptr<webrtc::VideoTrackInterface> 161 virtual scoped_refptr<webrtc::VideoTrackInterface>
162 CreateLocalVideoTrack(const std::string& id, 162 CreateLocalVideoTrack(const std::string& id,
163 cricket::VideoCapturer* capturer); 163 cricket::VideoCapturer* capturer);
164 164
165 virtual const scoped_refptr<webrtc::PeerConnectionFactoryInterface>& 165 virtual const scoped_refptr<webrtc::PeerConnectionFactoryInterface>&
166 GetPcFactory(); 166 GetPcFactory();
167 virtual bool PeerConnectionFactoryCreated(); 167 virtual bool PeerConnectionFactoryCreated();
168 168
169 // Returns a new capturer or existing capturer based on the |render_frame_id| 169 // Returns a new capturer or existing capturer based on the |render_frame_id|
170 // and |device_info|; if both are valid, it reuses existing capture if any -- 170 // and |device_info|; if both are valid, it reuses existing capture if any --
171 // otherwise it creates a new capturer. 171 // otherwise it creates a new capturer.
172 virtual scoped_ptr<WebRtcAudioCapturer> CreateAudioCapturer( 172 virtual scoped_refptr<WebRtcAudioCapturer> CreateAudioCapturer(
173 int render_frame_id, 173 int render_frame_id,
174 const StreamDeviceInfo& device_info, 174 const StreamDeviceInfo& device_info,
175 const blink::WebMediaConstraints& constraints, 175 const blink::WebMediaConstraints& constraints,
176 MediaStreamAudioSource* audio_source); 176 MediaStreamAudioSource* audio_source);
177 177
178 // Adds the audio device as a sink to the audio track and starts the local
179 // audio track. This is virtual for test purposes since no real audio device
180 // exist in unit tests.
181 virtual void StartLocalAudioTrack(WebRtcLocalAudioTrack* audio_track);
182
178 private: 183 private:
179 // Implement base::MessageLoop::DestructionObserver. 184 // Implement base::MessageLoop::DestructionObserver.
180 // This makes sure the libjingle PeerConnectionFactory is released before 185 // This makes sure the libjingle PeerConnectionFactory is released before
181 // the renderer message loop is destroyed. 186 // the renderer message loop is destroyed.
182 void WillDestroyCurrentMessageLoop() override; 187 void WillDestroyCurrentMessageLoop() override;
183 188
184 // Functions related to Stun probing trial to determine how fast we could send 189 // Functions related to Stun probing trial to determine how fast we could send
185 // Stun request without being dropped by NAT. 190 // Stun request without being dropped by NAT.
186 void TryScheduleStunProbeTrial(); 191 void TryScheduleStunProbeTrial();
187 void StartStunProbeTrialOnWorkerThread(const std::string& params); 192 void StartStunProbeTrialOnWorkerThread(const std::string& params);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 rtc::Thread* worker_thread_; 227 rtc::Thread* worker_thread_;
223 base::Thread chrome_signaling_thread_; 228 base::Thread chrome_signaling_thread_;
224 base::Thread chrome_worker_thread_; 229 base::Thread chrome_worker_thread_;
225 230
226 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); 231 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory);
227 }; 232 };
228 233
229 } // namespace content 234 } // namespace content
230 235
231 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 236 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698