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

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

Issue 1647773002: MediaStream audio sourcing: Bypass audio processing for non-WebRTC cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NOT FOR REVIEW -- This will be broken-up across multiple CLs. Created 4 years, 10 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_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 14 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
15 #include "third_party/webrtc/api/mediaconstraintsinterface.h" 15 #include "third_party/webrtc/api/mediaconstraintsinterface.h"
16 #include "third_party/webrtc/media/base/videorenderer.h" 16 #include "third_party/webrtc/media/base/videorenderer.h"
17 #include "third_party/webrtc/media/base/videosinkinterface.h" 17 #include "third_party/webrtc/media/base/videosinkinterface.h"
18 18
19 namespace content { 19 namespace content {
20 20
21 class WebAudioCapturerSource;
22 typedef std::set<webrtc::ObserverInterface*> ObserverSet; 21 typedef std::set<webrtc::ObserverInterface*> ObserverSet;
23 22
24 class MockVideoRenderer : public cricket::VideoRenderer { 23 class MockVideoRenderer : public cricket::VideoRenderer {
25 public: 24 public:
26 MockVideoRenderer(); 25 MockVideoRenderer();
27 ~MockVideoRenderer() override; 26 ~MockVideoRenderer() override;
28 bool RenderFrame(const cricket::VideoFrame* frame) override; 27 bool RenderFrame(const cricket::VideoFrame* frame) override;
29 28
30 int num() const { return num_; } 29 int num() const { return num_; }
31 30
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 const webrtc::MediaConstraintsInterface* constraints, 181 const webrtc::MediaConstraintsInterface* constraints,
183 blink::WebFrame* frame, 182 blink::WebFrame* frame,
184 webrtc::PeerConnectionObserver* observer) override; 183 webrtc::PeerConnectionObserver* observer) override;
185 scoped_refptr<webrtc::AudioSourceInterface> CreateLocalAudioSource( 184 scoped_refptr<webrtc::AudioSourceInterface> CreateLocalAudioSource(
186 const webrtc::MediaConstraintsInterface* constraints) override; 185 const webrtc::MediaConstraintsInterface* constraints) override;
187 WebRtcVideoCapturerAdapter* CreateVideoCapturer( 186 WebRtcVideoCapturerAdapter* CreateVideoCapturer(
188 bool is_screen_capture) override; 187 bool is_screen_capture) override;
189 scoped_refptr<webrtc::VideoSourceInterface> CreateVideoSource( 188 scoped_refptr<webrtc::VideoSourceInterface> CreateVideoSource(
190 cricket::VideoCapturer* capturer, 189 cricket::VideoCapturer* capturer,
191 const blink::WebMediaConstraints& constraints) override; 190 const blink::WebMediaConstraints& constraints) override;
192 scoped_refptr<WebAudioCapturerSource> CreateWebAudioSource(
193 blink::WebMediaStreamSource* source) override;
194 scoped_refptr<webrtc::MediaStreamInterface> CreateLocalMediaStream( 191 scoped_refptr<webrtc::MediaStreamInterface> CreateLocalMediaStream(
195 const std::string& label) override; 192 const std::string& label) override;
196 scoped_refptr<webrtc::VideoTrackInterface> CreateLocalVideoTrack( 193 scoped_refptr<webrtc::VideoTrackInterface> CreateLocalVideoTrack(
197 const std::string& id, 194 const std::string& id,
198 webrtc::VideoSourceInterface* source) override; 195 webrtc::VideoSourceInterface* source) override;
199 scoped_refptr<webrtc::VideoTrackInterface> CreateLocalVideoTrack( 196 scoped_refptr<webrtc::VideoTrackInterface> CreateLocalVideoTrack(
200 const std::string& id, 197 const std::string& id,
201 cricket::VideoCapturer* capturer) override; 198 cricket::VideoCapturer* capturer) override;
202 webrtc::SessionDescriptionInterface* CreateSessionDescription( 199 webrtc::SessionDescriptionInterface* CreateSessionDescription(
203 const std::string& type, 200 const std::string& type,
204 const std::string& sdp, 201 const std::string& sdp,
205 webrtc::SdpParseError* error) override; 202 webrtc::SdpParseError* error) override;
206 webrtc::IceCandidateInterface* CreateIceCandidate( 203 webrtc::IceCandidateInterface* CreateIceCandidate(
207 const std::string& sdp_mid, 204 const std::string& sdp_mid,
208 int sdp_mline_index, 205 int sdp_mline_index,
209 const std::string& sdp) override; 206 const std::string& sdp) override;
210 207
211 scoped_refptr<WebRtcAudioCapturer> CreateAudioCapturer(
212 int render_frame_id,
213 const StreamDeviceInfo& device_info,
214 const blink::WebMediaConstraints& constraints,
215 MediaStreamAudioSource* audio_source) override;
216 void FailToCreateNextAudioCapturer() { 208 void FailToCreateNextAudioCapturer() {
217 fail_to_create_next_audio_capturer_ = true; 209 fail_to_create_next_audio_capturer_ = true;
218 } 210 }
219 211
220 void StartLocalAudioTrack(WebRtcLocalAudioTrack* audio_track) override;
221
222 MockAudioSource* last_audio_source() { return last_audio_source_.get(); } 212 MockAudioSource* last_audio_source() { return last_audio_source_.get(); }
223 MockVideoSource* last_video_source() { return last_video_source_.get(); } 213 MockVideoSource* last_video_source() { return last_video_source_.get(); }
224 214
225 private: 215 private:
226 bool fail_to_create_next_audio_capturer_; 216 bool fail_to_create_next_audio_capturer_;
227 scoped_refptr <MockAudioSource> last_audio_source_; 217 scoped_refptr <MockAudioSource> last_audio_source_;
228 scoped_refptr <MockVideoSource> last_video_source_; 218 scoped_refptr <MockVideoSource> last_video_source_;
229 219
230 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionDependencyFactory); 220 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionDependencyFactory);
231 }; 221 };
232 222
233 } // namespace content 223 } // namespace content
234 224
235 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY _H_ 225 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698