OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/renderer/media/mock_media_stream_impl.h" | |
6 | |
7 #include <utility> | |
8 | |
9 #include "base/utf_string_conversions.h" | |
10 #include "content/renderer/media/rtc_video_decoder.h" | |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amDescriptor.h" | |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | |
13 | |
14 MockMediaStreamImpl::MockMediaStreamImpl() | |
15 : MediaStreamImpl(NULL, NULL, NULL, NULL, NULL) { | |
16 } | |
17 | |
18 MockMediaStreamImpl::~MockMediaStreamImpl() {} | |
19 | |
20 WebKit::WebPeerConnectionHandler* | |
21 MockMediaStreamImpl::CreatePeerConnectionHandler( | |
22 WebKit::WebPeerConnectionHandlerClient* client) { | |
23 NOTIMPLEMENTED(); | |
24 return NULL; | |
25 } | |
26 | |
27 void MockMediaStreamImpl::ClosePeerConnection( | |
28 PeerConnectionHandlerBase* pc_handler) { | |
29 } | |
30 | |
31 webrtc::LocalMediaStreamInterface* MockMediaStreamImpl::GetLocalMediaStream( | |
32 const WebKit::WebMediaStreamDescriptor& stream) { | |
33 MockMediaStreamPtrMap::iterator it = mock_local_streams_.find( | |
34 UTF16ToUTF8(stream.label())); | |
35 if (it == mock_local_streams_.end()) | |
36 return NULL; | |
37 return it->second; | |
38 } | |
39 | |
40 scoped_refptr<media::VideoDecoder> MockMediaStreamImpl::GetVideoDecoder( | |
41 const GURL& url, | |
42 media::MessageLoopFactory* message_loop_factory) { | |
43 NOTIMPLEMENTED(); | |
44 return NULL; | |
45 } | |
46 | |
47 void MockMediaStreamImpl::OnStreamGenerated( | |
48 int request_id, | |
49 const std::string& label, | |
50 const media_stream::StreamDeviceInfoArray& audio_array, | |
51 const media_stream::StreamDeviceInfoArray& video_array) { | |
52 NOTIMPLEMENTED(); | |
53 } | |
54 | |
55 void MockMediaStreamImpl::OnStreamGenerationFailed(int request_id) { | |
56 NOTIMPLEMENTED(); | |
57 } | |
58 | |
59 void MockMediaStreamImpl::OnVideoDeviceFailed( | |
60 const std::string& label, | |
61 int index) { | |
62 NOTIMPLEMENTED(); | |
63 } | |
64 | |
65 void MockMediaStreamImpl::OnAudioDeviceFailed( | |
66 const std::string& label, | |
67 int index) { | |
68 NOTIMPLEMENTED(); | |
69 } | |
70 | |
71 void MockMediaStreamImpl::AddLocalStream( | |
72 webrtc::LocalMediaStreamInterface* stream) { | |
73 mock_local_streams_[stream->label()] = | |
74 talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface>(stream); | |
75 } | |
OLD | NEW |