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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 protected: | 97 protected: |
98 virtual ~MockAudioSource(); | 98 virtual ~MockAudioSource(); |
99 | 99 |
100 private: | 100 private: |
101 webrtc::ObserverInterface* observer_; | 101 webrtc::ObserverInterface* observer_; |
102 MediaSourceInterface::SourceState state_; | 102 MediaSourceInterface::SourceState state_; |
103 webrtc::MediaConstraintsInterface::Constraints optional_constraints_; | 103 webrtc::MediaConstraintsInterface::Constraints optional_constraints_; |
104 webrtc::MediaConstraintsInterface::Constraints mandatory_constraints_; | 104 webrtc::MediaConstraintsInterface::Constraints mandatory_constraints_; |
105 }; | 105 }; |
106 | 106 |
107 class MockLocalVideoTrack : public webrtc::VideoTrackInterface { | 107 class MockWebRtcVideoTrack : public webrtc::VideoTrackInterface { |
108 public: | 108 public: |
109 MockLocalVideoTrack(std::string id, | 109 MockWebRtcVideoTrack(std::string id, |
110 webrtc::VideoSourceInterface* source); | 110 webrtc::VideoSourceInterface* source); |
111 virtual void AddRenderer(webrtc::VideoRendererInterface* renderer) OVERRIDE; | 111 virtual void AddRenderer(webrtc::VideoRendererInterface* renderer) OVERRIDE; |
112 virtual void RemoveRenderer( | 112 virtual void RemoveRenderer( |
113 webrtc::VideoRendererInterface* renderer) OVERRIDE; | 113 webrtc::VideoRendererInterface* renderer) OVERRIDE; |
114 virtual std::string kind() const OVERRIDE; | 114 virtual std::string kind() const OVERRIDE; |
115 virtual std::string id() const OVERRIDE; | 115 virtual std::string id() const OVERRIDE; |
116 virtual bool enabled() const OVERRIDE; | 116 virtual bool enabled() const OVERRIDE; |
117 virtual TrackState state() const OVERRIDE; | 117 virtual TrackState state() const OVERRIDE; |
118 virtual bool set_enabled(bool enable) OVERRIDE; | 118 virtual bool set_enabled(bool enable) OVERRIDE; |
119 virtual bool set_state(TrackState new_state) OVERRIDE; | 119 virtual bool set_state(TrackState new_state) OVERRIDE; |
120 virtual void RegisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; | 120 virtual void RegisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; |
121 virtual void UnregisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; | 121 virtual void UnregisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; |
122 virtual webrtc::VideoSourceInterface* GetSource() const OVERRIDE; | 122 virtual webrtc::VideoSourceInterface* GetSource() const OVERRIDE; |
123 | 123 |
124 protected: | 124 protected: |
125 virtual ~MockLocalVideoTrack(); | 125 virtual ~MockWebRtcVideoTrack(); |
126 | 126 |
127 private: | 127 private: |
128 bool enabled_; | 128 bool enabled_; |
129 std::string id_; | 129 std::string id_; |
130 TrackState state_; | 130 TrackState state_; |
131 scoped_refptr<webrtc::VideoSourceInterface> source_; | 131 scoped_refptr<webrtc::VideoSourceInterface> source_; |
132 webrtc::ObserverInterface* observer_; | 132 webrtc::ObserverInterface* observer_; |
| 133 webrtc::VideoRendererInterface* renderer_; |
133 }; | 134 }; |
134 | 135 |
135 class MockMediaStream : public webrtc::MediaStreamInterface { | 136 class MockMediaStream : public webrtc::MediaStreamInterface { |
136 public: | 137 public: |
137 explicit MockMediaStream(const std::string& label); | 138 explicit MockMediaStream(const std::string& label); |
138 | 139 |
139 virtual bool AddTrack(webrtc::AudioTrackInterface* track) OVERRIDE; | 140 virtual bool AddTrack(webrtc::AudioTrackInterface* track) OVERRIDE; |
140 virtual bool AddTrack(webrtc::VideoTrackInterface* track) OVERRIDE; | 141 virtual bool AddTrack(webrtc::VideoTrackInterface* track) OVERRIDE; |
141 virtual bool RemoveTrack(webrtc::AudioTrackInterface* track) OVERRIDE; | 142 virtual bool RemoveTrack(webrtc::AudioTrackInterface* track) OVERRIDE; |
142 virtual bool RemoveTrack(webrtc::VideoTrackInterface* track) OVERRIDE; | 143 virtual bool RemoveTrack(webrtc::VideoTrackInterface* track) OVERRIDE; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 private: | 218 private: |
218 scoped_refptr <MockAudioSource> last_audio_source_; | 219 scoped_refptr <MockAudioSource> last_audio_source_; |
219 scoped_refptr <MockVideoSource> last_video_source_; | 220 scoped_refptr <MockVideoSource> last_video_source_; |
220 | 221 |
221 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); | 222 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); |
222 }; | 223 }; |
223 | 224 |
224 } // namespace content | 225 } // namespace content |
225 | 226 |
226 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 227 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |