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

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: Addressed o1ka's 2nd round of comments. 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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void MockPeerConnectionDependencyFactory::CreateWebAudioSource(
474 MockPeerConnectionDependencyFactory::CreateWebAudioSource( 474 blink::WebMediaStreamSource* source) {}
475 blink::WebMediaStreamSource* source) {
476 return NULL;
477 }
478 475
479 scoped_refptr<webrtc::MediaStreamInterface> 476 scoped_refptr<webrtc::MediaStreamInterface>
480 MockPeerConnectionDependencyFactory::CreateLocalMediaStream( 477 MockPeerConnectionDependencyFactory::CreateLocalMediaStream(
481 const std::string& label) { 478 const std::string& label) {
482 return new rtc::RefCountedObject<MockMediaStream>(label); 479 return new rtc::RefCountedObject<MockMediaStream>(label);
483 } 480 }
484 481
485 scoped_refptr<webrtc::VideoTrackInterface> 482 scoped_refptr<webrtc::VideoTrackInterface>
486 MockPeerConnectionDependencyFactory::CreateLocalVideoTrack( 483 MockPeerConnectionDependencyFactory::CreateLocalVideoTrack(
487 const std::string& id, 484 const std::string& id,
(...skipping 24 matching lines...) Expand all
512 } 509 }
513 510
514 webrtc::IceCandidateInterface* 511 webrtc::IceCandidateInterface*
515 MockPeerConnectionDependencyFactory::CreateIceCandidate( 512 MockPeerConnectionDependencyFactory::CreateIceCandidate(
516 const std::string& sdp_mid, 513 const std::string& sdp_mid,
517 int sdp_mline_index, 514 int sdp_mline_index,
518 const std::string& sdp) { 515 const std::string& sdp) {
519 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); 516 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp);
520 } 517 }
521 518
522 scoped_refptr<WebRtcAudioCapturer> 519 scoped_ptr<WebRtcAudioCapturer>
523 MockPeerConnectionDependencyFactory::CreateAudioCapturer( 520 MockPeerConnectionDependencyFactory::CreateAudioCapturer(
524 int render_frame_id, 521 int render_frame_id,
525 const StreamDeviceInfo& device_info, 522 const StreamDeviceInfo& device_info,
526 const blink::WebMediaConstraints& constraints, 523 const blink::WebMediaConstraints& constraints,
527 MediaStreamAudioSource* audio_source) { 524 MediaStreamAudioSource* audio_source) {
528 if (fail_to_create_next_audio_capturer_) { 525 if (fail_to_create_next_audio_capturer_) {
529 fail_to_create_next_audio_capturer_ = false; 526 fail_to_create_next_audio_capturer_ = false;
530 return NULL; 527 return NULL;
531 } 528 }
532 DCHECK(audio_source); 529 DCHECK(audio_source);
533 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL, 530 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL,
534 audio_source); 531 audio_source);
535 } 532 }
536 533
537 void MockPeerConnectionDependencyFactory::StartLocalAudioTrack(
538 WebRtcLocalAudioTrack* audio_track) {
539 audio_track->Start();
540 }
541
542 } // namespace content 534 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698