OLD | NEW |
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 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.
h" | 5 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.
h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 scoped_refptr<webrtc::VideoSourceInterface> | 464 scoped_refptr<webrtc::VideoSourceInterface> |
465 MockPeerConnectionDependencyFactory::CreateVideoSource( | 465 MockPeerConnectionDependencyFactory::CreateVideoSource( |
466 cricket::VideoCapturer* capturer, | 466 cricket::VideoCapturer* capturer, |
467 const blink::WebMediaConstraints& constraints) { | 467 const blink::WebMediaConstraints& constraints) { |
468 last_video_source_ = new rtc::RefCountedObject<MockVideoSource>(false); | 468 last_video_source_ = new rtc::RefCountedObject<MockVideoSource>(false); |
469 last_video_source_->SetVideoCapturer(capturer); | 469 last_video_source_->SetVideoCapturer(capturer); |
470 return last_video_source_; | 470 return last_video_source_; |
471 } | 471 } |
472 | 472 |
473 scoped_refptr<WebAudioCapturerSource> | 473 scoped_ptr<WebAudioCapturerSource> |
474 MockPeerConnectionDependencyFactory::CreateWebAudioSource( | 474 MockPeerConnectionDependencyFactory::CreateWebAudioSource( |
475 blink::WebMediaStreamSource* source) { | 475 blink::WebMediaStreamSource* source) { |
476 return NULL; | 476 return scoped_ptr<WebAudioCapturerSource>(nullptr); |
477 } | 477 } |
478 | 478 |
479 scoped_refptr<webrtc::MediaStreamInterface> | 479 scoped_refptr<webrtc::MediaStreamInterface> |
480 MockPeerConnectionDependencyFactory::CreateLocalMediaStream( | 480 MockPeerConnectionDependencyFactory::CreateLocalMediaStream( |
481 const std::string& label) { | 481 const std::string& label) { |
482 return new rtc::RefCountedObject<MockMediaStream>(label); | 482 return new rtc::RefCountedObject<MockMediaStream>(label); |
483 } | 483 } |
484 | 484 |
485 scoped_refptr<webrtc::VideoTrackInterface> | 485 scoped_refptr<webrtc::VideoTrackInterface> |
486 MockPeerConnectionDependencyFactory::CreateLocalVideoTrack( | 486 MockPeerConnectionDependencyFactory::CreateLocalVideoTrack( |
(...skipping 25 matching lines...) Expand all Loading... |
512 } | 512 } |
513 | 513 |
514 webrtc::IceCandidateInterface* | 514 webrtc::IceCandidateInterface* |
515 MockPeerConnectionDependencyFactory::CreateIceCandidate( | 515 MockPeerConnectionDependencyFactory::CreateIceCandidate( |
516 const std::string& sdp_mid, | 516 const std::string& sdp_mid, |
517 int sdp_mline_index, | 517 int sdp_mline_index, |
518 const std::string& sdp) { | 518 const std::string& sdp) { |
519 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); | 519 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); |
520 } | 520 } |
521 | 521 |
522 scoped_refptr<WebRtcAudioCapturer> | 522 scoped_ptr<WebRtcAudioCapturer> |
523 MockPeerConnectionDependencyFactory::CreateAudioCapturer( | 523 MockPeerConnectionDependencyFactory::CreateAudioCapturer( |
524 int render_frame_id, | 524 int render_frame_id, |
525 const StreamDeviceInfo& device_info, | 525 const StreamDeviceInfo& device_info, |
526 const blink::WebMediaConstraints& constraints, | 526 const blink::WebMediaConstraints& constraints, |
527 MediaStreamAudioSource* audio_source) { | 527 MediaStreamAudioSource* audio_source) { |
528 if (fail_to_create_next_audio_capturer_) { | 528 if (fail_to_create_next_audio_capturer_) { |
529 fail_to_create_next_audio_capturer_ = false; | 529 fail_to_create_next_audio_capturer_ = false; |
530 return NULL; | 530 return NULL; |
531 } | 531 } |
532 DCHECK(audio_source); | 532 DCHECK(audio_source); |
533 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL, | 533 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL, |
534 audio_source); | 534 audio_source); |
535 } | 535 } |
536 | 536 |
537 void MockPeerConnectionDependencyFactory::StartLocalAudioTrack( | |
538 WebRtcLocalAudioTrack* audio_track) { | |
539 audio_track->Start(); | |
540 } | |
541 | |
542 } // namespace content | 537 } // namespace content |
OLD | NEW |