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 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_IMPL_H_ | |
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_IMPL_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 | |
11 #include "content/renderer/media/media_stream_impl.h" | |
12 | |
13 class MockMediaStreamImpl : public MediaStreamImpl { | |
14 public: | |
15 MockMediaStreamImpl(); | |
16 virtual ~MockMediaStreamImpl(); | |
17 | |
18 virtual WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler( | |
19 WebKit::WebPeerConnectionHandlerClient* client) OVERRIDE; | |
20 virtual void ClosePeerConnection( | |
21 PeerConnectionHandlerBase* pc_handler) OVERRIDE; | |
22 | |
23 virtual webrtc::LocalMediaStreamInterface* GetLocalMediaStream( | |
24 const WebKit::WebMediaStreamDescriptor& stream) OVERRIDE; | |
25 | |
26 // Implement webkit_glue::MediaStreamClient. | |
27 virtual scoped_refptr<media::VideoDecoder> GetVideoDecoder( | |
28 const GURL& url, | |
29 media::MessageLoopFactory* message_loop_factory) OVERRIDE; | |
30 | |
31 // Implement MediaStreamDispatcherEventHandler. | |
32 virtual void OnStreamGenerated( | |
33 int request_id, | |
34 const std::string& label, | |
35 const media_stream::StreamDeviceInfoArray& audio_array, | |
36 const media_stream::StreamDeviceInfoArray& video_array) OVERRIDE; | |
37 virtual void OnStreamGenerationFailed(int request_id) OVERRIDE; | |
38 virtual void OnVideoDeviceFailed( | |
39 const std::string& label, | |
40 int index) OVERRIDE; | |
41 virtual void OnAudioDeviceFailed( | |
42 const std::string& label, | |
43 int index) OVERRIDE; | |
44 | |
45 void AddLocalStream(webrtc::LocalMediaStreamInterface* stream); | |
46 private: | |
47 typedef std::map<std::string, | |
48 talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface> > | |
49 MockMediaStreamPtrMap; | |
50 MockMediaStreamPtrMap mock_local_streams_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamImpl); | |
53 }; | |
54 | |
55 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_IMPL_H_ | |
OLD | NEW |