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 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 protected: | 59 protected: |
60 virtual ~MockLocalAudioTrack() {} | 60 virtual ~MockLocalAudioTrack() {} |
61 | 61 |
62 private: | 62 private: |
63 bool enabled_; | 63 bool enabled_; |
64 std::string label_; | 64 std::string label_; |
65 }; | 65 }; |
66 | 66 |
67 } // namespace webrtc | 67 } // namespace webrtc |
68 | 68 |
69 // A mock factory for creating different objects for MediaStreamImpl. | 69 // A mock factory for creating different objects for |
| 70 // RTC MediaStreams and PeerConnections. |
70 class MockMediaStreamDependencyFactory : public MediaStreamDependencyFactory { | 71 class MockMediaStreamDependencyFactory : public MediaStreamDependencyFactory { |
71 public: | 72 public: |
72 MockMediaStreamDependencyFactory(VideoCaptureImplManager* vc_manager); | 73 MockMediaStreamDependencyFactory(); |
73 virtual ~MockMediaStreamDependencyFactory(); | 74 virtual ~MockMediaStreamDependencyFactory(); |
74 | 75 |
75 virtual bool CreatePeerConnectionFactory( | |
76 talk_base::Thread* worker_thread, | |
77 talk_base::Thread* signaling_thread, | |
78 content::P2PSocketDispatcher* socket_dispatcher, | |
79 talk_base::NetworkManager* network_manager, | |
80 talk_base::PacketSocketFactory* socket_factory) OVERRIDE; | |
81 virtual void ReleasePeerConnectionFactory() OVERRIDE; | |
82 virtual bool PeerConnectionFactoryCreated() OVERRIDE; | |
83 virtual talk_base::scoped_refptr<webrtc::PeerConnectionInterface> | 76 virtual talk_base::scoped_refptr<webrtc::PeerConnectionInterface> |
84 CreatePeerConnection( | 77 CreatePeerConnection( |
85 const std::string& config, | 78 const std::string& config, |
86 webrtc::PeerConnectionObserver* observer) OVERRIDE; | 79 webrtc::PeerConnectionObserver* observer) OVERRIDE; |
87 virtual talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface> | 80 virtual talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface> |
88 CreateLocalMediaStream(const std::string& label) OVERRIDE; | 81 CreateLocalMediaStream(const std::string& label) OVERRIDE; |
89 virtual talk_base::scoped_refptr<webrtc::LocalVideoTrackInterface> | 82 virtual talk_base::scoped_refptr<webrtc::LocalVideoTrackInterface> |
90 CreateLocalVideoTrack( | 83 CreateLocalVideoTrack( |
91 const std::string& label, | 84 const std::string& label, |
92 int video_session_id) OVERRIDE; | 85 int video_session_id) OVERRIDE; |
93 virtual talk_base::scoped_refptr<webrtc::LocalAudioTrackInterface> | 86 virtual talk_base::scoped_refptr<webrtc::LocalAudioTrackInterface> |
94 CreateLocalAudioTrack( | 87 CreateLocalAudioTrack( |
95 const std::string& label, | 88 const std::string& label, |
96 webrtc::AudioDeviceModule* audio_device) OVERRIDE; | 89 webrtc::AudioDeviceModule* audio_device) OVERRIDE; |
97 virtual webrtc::SessionDescriptionInterface* CreateSessionDescription( | 90 virtual webrtc::SessionDescriptionInterface* CreateSessionDescription( |
98 const std::string& sdp) OVERRIDE; | 91 const std::string& sdp) OVERRIDE; |
99 virtual webrtc::IceCandidateInterface* CreateIceCandidate( | 92 virtual webrtc::IceCandidateInterface* CreateIceCandidate( |
100 const std::string& sdp_mid, | 93 const std::string& sdp_mid, |
101 int sdp_mline_index, | 94 int sdp_mline_index, |
102 const std::string& sdp) OVERRIDE; | 95 const std::string& sdp) OVERRIDE; |
| 96 |
| 97 virtual bool EnsurePeerConnectionFactory() OVERRIDE; |
103 virtual void SetAudioDeviceSessionId(int session_id) OVERRIDE; | 98 virtual void SetAudioDeviceSessionId(int session_id) OVERRIDE; |
104 | 99 |
105 private: | 100 private: |
106 bool mock_pc_factory_created_; | 101 bool mock_pc_factory_created_; |
107 | 102 |
108 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); | 103 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); |
109 }; | 104 }; |
110 | 105 |
111 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 106 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |