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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 } | 448 } |
449 | 449 |
450 scoped_refptr<webrtc::AudioTrackInterface> | 450 scoped_refptr<webrtc::AudioTrackInterface> |
451 MockMediaStreamDependencyFactory::CreateLocalAudioTrack( | 451 MockMediaStreamDependencyFactory::CreateLocalAudioTrack( |
452 const std::string& id, | 452 const std::string& id, |
453 const scoped_refptr<WebRtcAudioCapturer>& capturer, | 453 const scoped_refptr<WebRtcAudioCapturer>& capturer, |
454 WebAudioCapturerSource* webaudio_source, | 454 WebAudioCapturerSource* webaudio_source, |
455 webrtc::AudioSourceInterface* source, | 455 webrtc::AudioSourceInterface* source, |
456 const webrtc::MediaConstraintsInterface* constraints) { | 456 const webrtc::MediaConstraintsInterface* constraints) { |
457 DCHECK(mock_pc_factory_created_); | 457 DCHECK(mock_pc_factory_created_); |
458 DCHECK(!capturer.get()); | 458 scoped_refptr<WebRtcAudioCapturer> audio_capturer = capturer ? |
| 459 capturer : WebRtcAudioCapturer::CreateCapturer(-1, StreamDeviceInfo(), |
| 460 NULL); |
459 return WebRtcLocalAudioTrack::Create( | 461 return WebRtcLocalAudioTrack::Create( |
460 id, WebRtcAudioCapturer::CreateCapturer(), webaudio_source, | 462 id, audio_capturer, webaudio_source, source, constraints); |
461 source, constraints); | |
462 } | 463 } |
463 | 464 |
464 SessionDescriptionInterface* | 465 SessionDescriptionInterface* |
465 MockMediaStreamDependencyFactory::CreateSessionDescription( | 466 MockMediaStreamDependencyFactory::CreateSessionDescription( |
466 const std::string& type, | 467 const std::string& type, |
467 const std::string& sdp, | 468 const std::string& sdp, |
468 webrtc::SdpParseError* error) { | 469 webrtc::SdpParseError* error) { |
469 return new MockSessionDescription(type, sdp); | 470 return new MockSessionDescription(type, sdp); |
470 } | 471 } |
471 | 472 |
472 webrtc::IceCandidateInterface* | 473 webrtc::IceCandidateInterface* |
473 MockMediaStreamDependencyFactory::CreateIceCandidate( | 474 MockMediaStreamDependencyFactory::CreateIceCandidate( |
474 const std::string& sdp_mid, | 475 const std::string& sdp_mid, |
475 int sdp_mline_index, | 476 int sdp_mline_index, |
476 const std::string& sdp) { | 477 const std::string& sdp) { |
477 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); | 478 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); |
478 } | 479 } |
479 | 480 |
480 scoped_refptr<WebRtcAudioCapturer> | 481 scoped_refptr<WebRtcAudioCapturer> |
481 MockMediaStreamDependencyFactory::MaybeCreateAudioCapturer( | 482 MockMediaStreamDependencyFactory::CreateAudioCapturer( |
482 int render_view_id, const StreamDeviceInfo& device_info) { | 483 int render_view_id, const StreamDeviceInfo& device_info) { |
483 return WebRtcAudioCapturer::CreateCapturer(); | 484 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, NULL); |
484 } | 485 } |
485 | 486 |
486 } // namespace content | 487 } // namespace content |
OLD | NEW |