| 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_impl.h" | 5 #include "content/renderer/media/mock_media_stream_impl.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "content/renderer/media/rtc_video_decoder.h" | 9 #include "content/renderer/media/rtc_video_decoder.h" |
| 8 | 10 |
| 9 MockMediaStreamImpl::MockMediaStreamImpl() | 11 MockMediaStreamImpl::MockMediaStreamImpl() |
| 10 : MediaStreamImpl(NULL, NULL, NULL, NULL) { | 12 : MediaStreamImpl(NULL, NULL, NULL, NULL) { |
| 11 } | 13 } |
| 12 | 14 |
| 13 MockMediaStreamImpl::~MockMediaStreamImpl() {} | 15 MockMediaStreamImpl::~MockMediaStreamImpl() {} |
| 14 | 16 |
| 15 WebKit::WebPeerConnectionHandler* | 17 WebKit::WebPeerConnectionHandler* |
| 16 MockMediaStreamImpl::CreatePeerConnectionHandler( | 18 MockMediaStreamImpl::CreatePeerConnectionHandler( |
| 17 WebKit::WebPeerConnectionHandlerClient* client) { | 19 WebKit::WebPeerConnectionHandlerClient* client) { |
| 18 NOTIMPLEMENTED(); | 20 NOTIMPLEMENTED(); |
| 19 return NULL; | 21 return NULL; |
| 20 } | 22 } |
| 21 | 23 |
| 22 void MockMediaStreamImpl::ClosePeerConnection() { | 24 void MockMediaStreamImpl::ClosePeerConnection() { |
| 23 video_label_.clear(); | |
| 24 } | 25 } |
| 25 | 26 |
| 26 bool MockMediaStreamImpl::SetVideoCaptureModule(const std::string& label) { | 27 webrtc::MediaStreamTrackInterface* |
| 27 video_label_ = label; | 28 MockMediaStreamImpl::GetLocalMediaStreamTrack(const std::string& label) { |
| 28 return true; | 29 MockMediaStreamTrackPtrMap::iterator it = mock_local_tracks_.find(label); |
| 30 if (it == mock_local_tracks_.end()) |
| 31 return NULL; |
| 32 webrtc::MediaStreamTrackInterface* stream = it->second; |
| 33 return stream; |
| 29 } | 34 } |
| 30 | 35 |
| 31 scoped_refptr<media::VideoDecoder> MockMediaStreamImpl::GetVideoDecoder( | 36 scoped_refptr<media::VideoDecoder> MockMediaStreamImpl::GetVideoDecoder( |
| 32 const GURL& url, | 37 const GURL& url, |
| 33 media::MessageLoopFactory* message_loop_factory) { | 38 media::MessageLoopFactory* message_loop_factory) { |
| 34 NOTIMPLEMENTED(); | 39 NOTIMPLEMENTED(); |
| 35 return NULL; | 40 return NULL; |
| 36 } | 41 } |
| 37 | 42 |
| 38 void MockMediaStreamImpl::OnStreamGenerated( | 43 void MockMediaStreamImpl::OnStreamGenerated( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 51 const std::string& label, | 56 const std::string& label, |
| 52 int index) { | 57 int index) { |
| 53 NOTIMPLEMENTED(); | 58 NOTIMPLEMENTED(); |
| 54 } | 59 } |
| 55 | 60 |
| 56 void MockMediaStreamImpl::OnAudioDeviceFailed( | 61 void MockMediaStreamImpl::OnAudioDeviceFailed( |
| 57 const std::string& label, | 62 const std::string& label, |
| 58 int index) { | 63 int index) { |
| 59 NOTIMPLEMENTED(); | 64 NOTIMPLEMENTED(); |
| 60 } | 65 } |
| 66 |
| 67 void MockMediaStreamImpl::AddTrack( |
| 68 const std::string& label, |
| 69 webrtc::MediaStreamTrackInterface* track) { |
| 70 mock_local_tracks_.insert( |
| 71 std::pair<std::string, webrtc::MediaStreamTrackInterface*>(label, track)); |
| 72 } |
| OLD | NEW |