| 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/webrtc_audio_capturer.h" | 10 #include "content/renderer/media/webrtc_audio_capturer.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 scoped_refptr<webrtc::VideoTrackInterface> | 438 scoped_refptr<webrtc::VideoTrackInterface> |
| 439 MockMediaStreamDependencyFactory::CreateLocalVideoTrack( | 439 MockMediaStreamDependencyFactory::CreateLocalVideoTrack( |
| 440 const std::string& id, | 440 const std::string& id, |
| 441 cricket::VideoCapturer* capturer) { | 441 cricket::VideoCapturer* capturer) { |
| 442 DCHECK(mock_pc_factory_created_); | 442 DCHECK(mock_pc_factory_created_); |
| 443 | 443 |
| 444 scoped_refptr<MockVideoSource> source = | 444 scoped_refptr<MockVideoSource> source = |
| 445 new talk_base::RefCountedObject<MockVideoSource>(); | 445 new talk_base::RefCountedObject<MockVideoSource>(); |
| 446 source->SetVideoCapturer(capturer); | 446 source->SetVideoCapturer(capturer); |
| 447 | 447 |
| 448 return new talk_base::RefCountedObject<MockLocalVideoTrack>(id, source); | 448 return new talk_base::RefCountedObject<MockLocalVideoTrack>(id, source.get()); |
| 449 } | 449 } |
| 450 | 450 |
| 451 scoped_refptr<webrtc::AudioTrackInterface> | 451 scoped_refptr<webrtc::AudioTrackInterface> |
| 452 MockMediaStreamDependencyFactory::CreateLocalAudioTrack( | 452 MockMediaStreamDependencyFactory::CreateLocalAudioTrack( |
| 453 const std::string& id, | 453 const std::string& id, |
| 454 webrtc::AudioSourceInterface* source) { | 454 webrtc::AudioSourceInterface* source) { |
| 455 DCHECK(mock_pc_factory_created_); | 455 DCHECK(mock_pc_factory_created_); |
| 456 scoped_refptr<WebRtcAudioCapturer> capturer( | 456 scoped_refptr<WebRtcAudioCapturer> capturer( |
| 457 WebRtcAudioCapturer::CreateCapturer()); | 457 WebRtcAudioCapturer::CreateCapturer()); |
| 458 return WebRtcLocalAudioTrack::Create(id, capturer, source); | 458 return WebRtcLocalAudioTrack::Create(id, capturer, source); |
| 459 } | 459 } |
| 460 | 460 |
| 461 SessionDescriptionInterface* | 461 SessionDescriptionInterface* |
| 462 MockMediaStreamDependencyFactory::CreateSessionDescription( | 462 MockMediaStreamDependencyFactory::CreateSessionDescription( |
| 463 const std::string& type, | 463 const std::string& type, |
| 464 const std::string& sdp, | 464 const std::string& sdp, |
| 465 webrtc::SdpParseError* error) { | 465 webrtc::SdpParseError* error) { |
| 466 return new MockSessionDescription(type, sdp); | 466 return new MockSessionDescription(type, sdp); |
| 467 } | 467 } |
| 468 | 468 |
| 469 webrtc::IceCandidateInterface* | 469 webrtc::IceCandidateInterface* |
| 470 MockMediaStreamDependencyFactory::CreateIceCandidate( | 470 MockMediaStreamDependencyFactory::CreateIceCandidate( |
| 471 const std::string& sdp_mid, | 471 const std::string& sdp_mid, |
| 472 int sdp_mline_index, | 472 int sdp_mline_index, |
| 473 const std::string& sdp) { | 473 const std::string& sdp) { |
| 474 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); | 474 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); |
| 475 } | 475 } |
| 476 | 476 |
| 477 } // namespace content | 477 } // namespace content |
| OLD | NEW |