OLD | NEW |
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 scoped_refptr<webrtc::VideoTrackSourceInterface> | 363 scoped_refptr<webrtc::VideoTrackSourceInterface> |
364 MockPeerConnectionDependencyFactory::CreateVideoSource( | 364 MockPeerConnectionDependencyFactory::CreateVideoSource( |
365 cricket::VideoCapturer* capturer, | 365 cricket::VideoCapturer* capturer, |
366 const blink::WebMediaConstraints& constraints) { | 366 const blink::WebMediaConstraints& constraints) { |
367 // Video source normally take ownership of |capturer|. | 367 // Video source normally take ownership of |capturer|. |
368 delete capturer; | 368 delete capturer; |
369 NOTIMPLEMENTED(); | 369 NOTIMPLEMENTED(); |
370 return nullptr; | 370 return nullptr; |
371 } | 371 } |
372 | 372 |
373 scoped_refptr<WebAudioCapturerSource> | 373 void MockPeerConnectionDependencyFactory::CreateWebAudioSource( |
374 MockPeerConnectionDependencyFactory::CreateWebAudioSource( | 374 blink::WebMediaStreamSource* source) {} |
375 blink::WebMediaStreamSource* source) { | |
376 return NULL; | |
377 } | |
378 | 375 |
379 scoped_refptr<webrtc::MediaStreamInterface> | 376 scoped_refptr<webrtc::MediaStreamInterface> |
380 MockPeerConnectionDependencyFactory::CreateLocalMediaStream( | 377 MockPeerConnectionDependencyFactory::CreateLocalMediaStream( |
381 const std::string& label) { | 378 const std::string& label) { |
382 return new rtc::RefCountedObject<MockMediaStream>(label); | 379 return new rtc::RefCountedObject<MockMediaStream>(label); |
383 } | 380 } |
384 | 381 |
385 scoped_refptr<webrtc::VideoTrackInterface> | 382 scoped_refptr<webrtc::VideoTrackInterface> |
386 MockPeerConnectionDependencyFactory::CreateLocalVideoTrack( | 383 MockPeerConnectionDependencyFactory::CreateLocalVideoTrack( |
387 const std::string& id, | 384 const std::string& id, |
(...skipping 20 matching lines...) Expand all Loading... |
408 } | 405 } |
409 | 406 |
410 webrtc::IceCandidateInterface* | 407 webrtc::IceCandidateInterface* |
411 MockPeerConnectionDependencyFactory::CreateIceCandidate( | 408 MockPeerConnectionDependencyFactory::CreateIceCandidate( |
412 const std::string& sdp_mid, | 409 const std::string& sdp_mid, |
413 int sdp_mline_index, | 410 int sdp_mline_index, |
414 const std::string& sdp) { | 411 const std::string& sdp) { |
415 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); | 412 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); |
416 } | 413 } |
417 | 414 |
418 scoped_refptr<WebRtcAudioCapturer> | 415 scoped_ptr<WebRtcAudioCapturer> |
419 MockPeerConnectionDependencyFactory::CreateAudioCapturer( | 416 MockPeerConnectionDependencyFactory::CreateAudioCapturer( |
420 int render_frame_id, | 417 int render_frame_id, |
421 const StreamDeviceInfo& device_info, | 418 const StreamDeviceInfo& device_info, |
422 const blink::WebMediaConstraints& constraints, | 419 const blink::WebMediaConstraints& constraints, |
423 MediaStreamAudioSource* audio_source) { | 420 MediaStreamAudioSource* audio_source) { |
424 if (fail_to_create_next_audio_capturer_) { | 421 if (fail_to_create_next_audio_capturer_) { |
425 fail_to_create_next_audio_capturer_ = false; | 422 fail_to_create_next_audio_capturer_ = false; |
426 return NULL; | 423 return NULL; |
427 } | 424 } |
428 DCHECK(audio_source); | 425 DCHECK(audio_source); |
429 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL, | 426 return WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL, |
430 audio_source); | 427 audio_source); |
431 } | 428 } |
432 | 429 |
433 void MockPeerConnectionDependencyFactory::StartLocalAudioTrack( | |
434 WebRtcLocalAudioTrack* audio_track) { | |
435 audio_track->Start(); | |
436 } | |
437 | |
438 } // namespace content | 430 } // namespace content |
OLD | NEW |