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

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

Issue 1721273002: MediaStream audio object graph untangling and clean-ups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests broken by recent MSAudioTrack::Stop() reworking. 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 #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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 scoped_refptr<webrtc::VideoSourceInterface> 460 scoped_refptr<webrtc::VideoSourceInterface>
461 MockPeerConnectionDependencyFactory::CreateVideoSource( 461 MockPeerConnectionDependencyFactory::CreateVideoSource(
462 cricket::VideoCapturer* capturer, 462 cricket::VideoCapturer* capturer,
463 const blink::WebMediaConstraints& constraints) { 463 const blink::WebMediaConstraints& constraints) {
464 last_video_source_ = new rtc::RefCountedObject<MockVideoSource>(false); 464 last_video_source_ = new rtc::RefCountedObject<MockVideoSource>(false);
465 last_video_source_->SetVideoCapturer(capturer); 465 last_video_source_->SetVideoCapturer(capturer);
466 return last_video_source_; 466 return last_video_source_;
467 } 467 }
468 468
469 scoped_refptr<WebAudioCapturerSource> 469 void MockPeerConnectionDependencyFactory::CreateWebAudioSource(
470 MockPeerConnectionDependencyFactory::CreateWebAudioSource( 470 blink::WebMediaStreamSource* source) {}
471 blink::WebMediaStreamSource* source) {
472 return NULL;
473 }
474 471
475 scoped_refptr<webrtc::MediaStreamInterface> 472 scoped_refptr<webrtc::MediaStreamInterface>
476 MockPeerConnectionDependencyFactory::CreateLocalMediaStream( 473 MockPeerConnectionDependencyFactory::CreateLocalMediaStream(
477 const std::string& label) { 474 const std::string& label) {
478 return new rtc::RefCountedObject<MockMediaStream>(label); 475 return new rtc::RefCountedObject<MockMediaStream>(label);
479 } 476 }
480 477
481 scoped_refptr<webrtc::VideoTrackInterface> 478 scoped_refptr<webrtc::VideoTrackInterface>
482 MockPeerConnectionDependencyFactory::CreateLocalVideoTrack( 479 MockPeerConnectionDependencyFactory::CreateLocalVideoTrack(
483 const std::string& id, 480 const std::string& id,
(...skipping 24 matching lines...) Expand all
508 } 505 }
509 506
510 webrtc::IceCandidateInterface* 507 webrtc::IceCandidateInterface*
511 MockPeerConnectionDependencyFactory::CreateIceCandidate( 508 MockPeerConnectionDependencyFactory::CreateIceCandidate(
512 const std::string& sdp_mid, 509 const std::string& sdp_mid,
513 int sdp_mline_index, 510 int sdp_mline_index,
514 const std::string& sdp) { 511 const std::string& sdp) {
515 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); 512 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp);
516 } 513 }
517 514
518 scoped_refptr<WebRtcAudioCapturer> 515 scoped_ptr<WebRtcAudioCapturer>
519 MockPeerConnectionDependencyFactory::CreateAudioCapturer( 516 MockPeerConnectionDependencyFactory::CreateAudioCapturer(
520 int render_frame_id, 517 int render_frame_id,
521 const StreamDeviceInfo& device_info, 518 const StreamDeviceInfo& device_info,
522 const blink::WebMediaConstraints& constraints, 519 const blink::WebMediaConstraints& constraints,
523 MediaStreamAudioSource* audio_source) { 520 MediaStreamAudioSource* audio_source) {
524 if (fail_to_create_next_audio_capturer_) { 521 if (fail_to_create_next_audio_capturer_) {
525 fail_to_create_next_audio_capturer_ = false; 522 fail_to_create_next_audio_capturer_ = false;
526 return NULL; 523 return NULL;
527 } 524 }
528 DCHECK(audio_source); 525 DCHECK(audio_source);
529 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL, 526 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL,
530 audio_source); 527 audio_source);
531 } 528 }
532 529
533 void MockPeerConnectionDependencyFactory::StartLocalAudioTrack(
534 WebRtcLocalAudioTrack* audio_track) {
535 audio_track->Start();
536 }
537
538 } // namespace content 530 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698