| 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 #include "content/renderer/media/mock_media_stream_dependency_factory.h" | 5 #include "content/renderer/media/mock_media_stream_dependency_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/renderer/media/mock_peer_connection_impl.h" | 9 #include "content/renderer/media/mock_peer_connection_impl.h" |
| 10 #include "content/renderer/media/webaudio_capturer_source.h" | 10 #include "content/renderer/media/webaudio_capturer_source.h" |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 } | 410 } |
| 411 | 411 |
| 412 scoped_refptr<webrtc::AudioSourceInterface> | 412 scoped_refptr<webrtc::AudioSourceInterface> |
| 413 MockMediaStreamDependencyFactory::CreateLocalAudioSource( | 413 MockMediaStreamDependencyFactory::CreateLocalAudioSource( |
| 414 const webrtc::MediaConstraintsInterface* constraints) { | 414 const webrtc::MediaConstraintsInterface* constraints) { |
| 415 last_audio_source_ = | 415 last_audio_source_ = |
| 416 new talk_base::RefCountedObject<MockAudioSource>(constraints); | 416 new talk_base::RefCountedObject<MockAudioSource>(constraints); |
| 417 return last_audio_source_; | 417 return last_audio_source_; |
| 418 } | 418 } |
| 419 | 419 |
| 420 scoped_refptr<webrtc::VideoSourceInterface> | 420 cricket::VideoCapturer* MockMediaStreamDependencyFactory::CreateVideoCapturer( |
| 421 MockMediaStreamDependencyFactory::CreateLocalVideoSource( | 421 const StreamDeviceInfo& info) { |
| 422 int video_session_id, | 422 return NULL; |
| 423 bool is_screencast, | |
| 424 const webrtc::MediaConstraintsInterface* constraints) { | |
| 425 last_video_source_ = new talk_base::RefCountedObject<MockVideoSource>(); | |
| 426 return last_video_source_; | |
| 427 } | 423 } |
| 428 | 424 |
| 429 scoped_refptr<webrtc::VideoSourceInterface> | 425 scoped_refptr<webrtc::VideoSourceInterface> |
| 430 MockMediaStreamDependencyFactory::CreateVideoSource( | 426 MockMediaStreamDependencyFactory::CreateVideoSource( |
| 431 cricket::VideoCapturer* capturer, | 427 cricket::VideoCapturer* capturer, |
| 432 const webrtc::MediaConstraintsInterface* constraints) { | 428 const webrtc::MediaConstraintsInterface* constraints) { |
| 429 EnsurePeerConnectionFactory(); |
| 433 last_video_source_ = new talk_base::RefCountedObject<MockVideoSource>(); | 430 last_video_source_ = new talk_base::RefCountedObject<MockVideoSource>(); |
| 434 last_video_source_->SetVideoCapturer(capturer); | 431 last_video_source_->SetVideoCapturer(capturer); |
| 435 return last_video_source_; | 432 return last_video_source_; |
| 436 } | 433 } |
| 437 | 434 |
| 438 scoped_refptr<WebAudioCapturerSource> | 435 scoped_refptr<WebAudioCapturerSource> |
| 439 MockMediaStreamDependencyFactory::CreateWebAudioSource( | 436 MockMediaStreamDependencyFactory::CreateWebAudioSource( |
| 440 blink::WebMediaStreamSource* source, | 437 blink::WebMediaStreamSource* source, |
| 441 const RTCMediaConstraints& constraints) { | 438 const RTCMediaConstraints& constraints) { |
| 442 return NULL; | 439 return NULL; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 | 503 |
| 507 scoped_refptr<WebRtcAudioCapturer> | 504 scoped_refptr<WebRtcAudioCapturer> |
| 508 MockMediaStreamDependencyFactory::CreateAudioCapturer( | 505 MockMediaStreamDependencyFactory::CreateAudioCapturer( |
| 509 int render_view_id, const StreamDeviceInfo& device_info, | 506 int render_view_id, const StreamDeviceInfo& device_info, |
| 510 const blink::WebMediaConstraints& constraints) { | 507 const blink::WebMediaConstraints& constraints) { |
| 511 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, | 508 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, |
| 512 constraints, NULL); | 509 constraints, NULL); |
| 513 } | 510 } |
| 514 | 511 |
| 515 } // namespace content | 512 } // namespace content |
| OLD | NEW |