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

Side by Side Diff: content/renderer/media/mock_media_stream_dependency_factory.cc

Issue 133903004: Cleaned up the WebRtcAudioCapturer a bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased and fixed the comment. Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 return new talk_base::RefCountedObject<MockLocalVideoTrack>(id, source.get()); 473 return new talk_base::RefCountedObject<MockLocalVideoTrack>(id, source.get());
474 } 474 }
475 475
476 scoped_refptr<webrtc::AudioTrackInterface> 476 scoped_refptr<webrtc::AudioTrackInterface>
477 MockMediaStreamDependencyFactory::CreateLocalAudioTrack( 477 MockMediaStreamDependencyFactory::CreateLocalAudioTrack(
478 const std::string& id, 478 const std::string& id,
479 const scoped_refptr<WebRtcAudioCapturer>& capturer, 479 const scoped_refptr<WebRtcAudioCapturer>& capturer,
480 WebAudioCapturerSource* webaudio_source, 480 WebAudioCapturerSource* webaudio_source,
481 webrtc::AudioSourceInterface* source) { 481 webrtc::AudioSourceInterface* source) {
482 DCHECK(mock_pc_factory_created_); 482 DCHECK(mock_pc_factory_created_);
483 DCHECK(!capturer.get()); 483 blink::WebMediaConstraints constraints;
484 scoped_refptr<WebRtcAudioCapturer> audio_capturer = capturer ?
485 capturer : WebRtcAudioCapturer::CreateCapturer(-1, StreamDeviceInfo(),
486 constraints, NULL);
484 return WebRtcLocalAudioTrack::Create( 487 return WebRtcLocalAudioTrack::Create(
485 id, WebRtcAudioCapturer::CreateCapturer(), webaudio_source, source); 488 id, audio_capturer, webaudio_source, source);
486 } 489 }
487 490
488 SessionDescriptionInterface* 491 SessionDescriptionInterface*
489 MockMediaStreamDependencyFactory::CreateSessionDescription( 492 MockMediaStreamDependencyFactory::CreateSessionDescription(
490 const std::string& type, 493 const std::string& type,
491 const std::string& sdp, 494 const std::string& sdp,
492 webrtc::SdpParseError* error) { 495 webrtc::SdpParseError* error) {
493 return new MockSessionDescription(type, sdp); 496 return new MockSessionDescription(type, sdp);
494 } 497 }
495 498
496 webrtc::IceCandidateInterface* 499 webrtc::IceCandidateInterface*
497 MockMediaStreamDependencyFactory::CreateIceCandidate( 500 MockMediaStreamDependencyFactory::CreateIceCandidate(
498 const std::string& sdp_mid, 501 const std::string& sdp_mid,
499 int sdp_mline_index, 502 int sdp_mline_index,
500 const std::string& sdp) { 503 const std::string& sdp) {
501 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); 504 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp);
502 } 505 }
503 506
504 scoped_refptr<WebRtcAudioCapturer> 507 scoped_refptr<WebRtcAudioCapturer>
505 MockMediaStreamDependencyFactory::MaybeCreateAudioCapturer( 508 MockMediaStreamDependencyFactory::CreateAudioCapturer(
506 int render_view_id, const StreamDeviceInfo& device_info, 509 int render_view_id, const StreamDeviceInfo& device_info,
507 const blink::WebMediaConstraints& constraints) { 510 const blink::WebMediaConstraints& constraints) {
508 return WebRtcAudioCapturer::CreateCapturer(); 511 return WebRtcAudioCapturer::CreateCapturer(-1, device_info,
512 constraints, NULL);
509 } 513 }
510 514
511 } // namespace content 515 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/mock_media_stream_dependency_factory.h ('k') | content/renderer/media/rtc_peer_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698